@olympeio/runtime-node 9.0.1 → 9.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -211,793 +211,789 @@ 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={dj:()=>'object'===typeof window?window:'object'===typeof global?global:self};olympe.dj().olympe=olympe;olympe.DC=(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.U={};olympe.U.zf={};olympe.U.zf.io=class{process(a){const b=Object.keys(a.Ae);let c,d;c=0;for(d=b.length;c<d;c++)if(a.Rd(b[c]).ij())throw Error('Service "'+b[c]+'" is defined as abstract and needs to be overridden');}};olympe.U.zf.io.ma=[olympe.U.zf.oq];olympe.U.zf.jo=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.Rd(g),c(g.bj(),h),g=g.Ci,null!==g))for(let k=0,l=g.length;k<l;k++)c(g[k].bj(),h)}function c(g,h){for(let k=0,l=g.length,n;k<l;k++)n=g[k],n instanceof olympe.U.Bb&&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.U.zf.jo.ma=[olympe.U.zf.oq];olympe.U.zf.oq=class{process(){}};const ka=[],la=[];olympe.U.mo=class{constructor(){}static C(a,b){ka.push(new olympe.U.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.U.wl(b,c,a))}};olympe.U.config=olympe.U.mo.C;olympe.U.run=olympe.U.mo.F;olympe.U.ol=class{constructor(){}getValue(){}};olympe.U.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.U.Bb(c[d]))}}bj(){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.U.ff.C.Jh)return null;throw Error('Service "'+b+'" not found');}try{d=e.instantiate(a)}catch(f){throw a.N.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.N.C++,f=b[e],d[e]=f instanceof olympe.U.ol?f.getValue(a):f,oa(a.N);return d}
216
- olympe.U.ff=class{constructor(a,b,c=2){this.F=a;this.parameters=b;this.C=Object.create(null);this.N=new olympe.U.Kp(c);a=olympe.U.O.cg;if(void 0!==this.C[a])throw Error('Service "'+a+'" has already been instantiated');this.C[a]=this}Ya(){return this.N}getParameter(a){return this.parameters[a.toLowerCase()]}};olympe.U.ff.C={bt:'exception',Jh:'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.N,'Defining service '+b);a.C(b,c,d,!1,!1)}function ra(a,b,c,...d){qa(a.N,'Defining service '+b);a.C(b,c,d,!1,!0)}
217
- function C(a,b,c,d,e=!1){qa(a.N,'Defining service (as a factory) '+b);a.C(b,d,c,!0,e)}function sa(a,b,c,d=!1){qa(a.N,'Defining service alias '+b);a.C(b,e=>e,[c],!0,d)}function ta(a,b){qa(a.N,'Defining abstract service '+b);a.C(b).Ri=!0}function ua(a,b){a.parameters[olympe.H.Config.co.toLowerCase()]=b}function E(a,b,c){b=b.toLowerCase();Object.prototype.hasOwnProperty.call(a.parameters,b)||(a.parameters[b]=c)}
218
- olympe.U.Ps=class{constructor(a){var b=va,c=wa;this.Ae=Object.create(null);this.parameters=Object.create(null);this.L=[new olympe.U.zf.io,new olympe.U.zf.jo];this.F=[];b&&pa(this,b);c&&pa(this,c,'version');a&&pa(this,a);a=this.getParameter(olympe.U.Config.Yt);this.G=void 0!==a?a:3;this.N=new olympe.U.Kp(this.G)}Ya(){return this.N}C(a,b,c,d,e){const f=a instanceof olympe.U.Bb?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.U.Cl.C;g.F=!0;g=g.id;c[h]=g;this.Ae[g]=this.Ae[f]}}this.Ae[f]=new olympe.U.Cl(b,c,d||!1,f,e||!1);return this.Ae[f]}Rd(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.N.debug('Calling '+a.length+' configure callbacks');this.N.C++;for(let b=0,c=a.length;b<c;b++)qa(this.N,'Calling callback'),this.N.C++,a[b].call(null,this),oa(this.N);oa(this.N);this.N.debug('Configuration summary: '+
220
- Object.keys(this.Ae).length+' definitions');this.N.debug('Compiling...');this.N.C++;a=this.L;for(let b=0,c=a.length;b<c;b++)this.N.debug('running compilation pass '+(b+1)+': '+a[b].constructor.name),a[b].process(this);oa(this.N);this.N.debug('Compilation done, returning container');return new olympe.U.ff(this.Ae,this.parameters,this.G)}};olympe.U.Cl=class{constructor(a,b,c,d,e=!0){this.G=a||null;this.L=!!c;this.C=[];this.Ri=!1;this.Ci=null;if(b){this.C=b;for(let f=0,g=b.length;f<g;f++)'string'===typeof b[f]&&(b[f]=new olympe.U.Bb(b[f]))}this.id=d||'';this.R=e;this.F=!1}Z(){return this.id}instantiate(a){const b=a.Ya();b.debug('Resolving arguments for '+this.id);const c=this.G;let d=na(a,this.C);const e=()=>{if(this.L)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.zg().run(()=>e()):e(),g=this.Ci;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.bj()),d.push(f),h.F.apply(null,d),oa(b);oa(b)}qa(b,'Done instantiating '+this.id);return f}kj(){return this.R}bj(){return this.C}ij(){return this.Ri}config(a,b,c){null===this.Ci&&(this.Ci=[]);this.Ci.push(new olympe.U.wl(b,c,a))}};olympe.U.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.U.Kp=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.U.fa=class extends olympe.U.ol{constructor(a){super();this.id=a}Z(){return this.id}getValue(a){return a.getParameter(this.id)}};olympe.U.Bb=class extends olympe.U.ol{constructor(a,b){super();this.id=a;this.C=b||olympe.U.ff.C.bt}Z(){return this.id}getValue(a){return ma(a,this.id,this.C)}};olympe.U.O={cg:'di.Container',vA:'di.PublicContainer'};olympe.U.Config={Yt:'logging.di'};olympe.U.run([olympe.U.O.cg],a=>{olympe.U.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.fc=function(){return za()};olympe.W.aj=function(){return za()};olympe.W.gn=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.fD=function(){for(let a=0;1E4>a;a++)console.log(olympe.W.fw())};
223
- olympe.W.xg=function(){let a='';for(let b=0;19>b;b++)a+='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'.charAt(Math.floor(62*Math.random()));return'@'+a};olympe.W.IC=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.FC=function(a,b){return(b?b:'UI')+'-'+a};olympe.W.wp=class{constructor(a){this.id=a||olympe.W.wp.C++}sb(a){return a?this.id===a.id:!1}toJSON(){return this.id.toString()}toString(){return this.id.toString()}};olympe.W.wp.C=0;olympe.W.hA=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.Hh=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.Hh.F=function(a){return new olympe.W.Hh(.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.Hh.C=function(){return new olympe.W.Hh(0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0)};olympe.W.Hh.prototype.set=function(a,b,c){this.values[5*a+b]=c};olympe.W.Hh.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{R(){}C(){}G(){}L(){}F(){}Y(){}};olympe.W.yr=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.L)}function Ga(a,b){a.G=b;return a}
224
- olympe.W.br=class{constructor(a,b=a/2){this.timeout=a;this.L=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.ar=class{constructor(a){this.F=Ga(new olympe.W.br(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={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}
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.ob=Ja;olympe.W.Xx=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,tC:g||null,us:l||null,host:n||null,port:p&&parseInt(p,10)||null,path:h&&'/'!==h?h:null,query:k||null,GC:f||null,parameters:b}};olympe.W.aD=function(a){a=a.substring(1);return''===a?new Map:new Map(a.split('&').map(b=>b.split('=')))};olympe.W.dD=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.Nr=(a,b)=>{const c=Object.keys(a).find(d=>a[d]===b);return void 0===c?null:c};
233
- olympe.W.vn=(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.vn(a[c],d):a[c]=d}};olympe.W.Ym=(a,b,c)=>{const d=Object.create(null);b(a,e=>{olympe.W.vn(d,e);b(`conf.d/${a}`,f=>{olympe.W.vn(d,f);c(d)})})};olympe.W.qC=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.Sy=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={Di:'left',Li:'right',Qy:'bottom',LB:'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.L=d||null}Rk(a){return this.C!==a.C?this.C>a.C:this.F!==a.F?this.F>a.F:this.G>a.G}vj(a){return this.C!==a.C?this.C<a.C:this.F!==a.F?this.F<a.F:this.G<a.G}sb(a){return this.C===a.C&&this.F===a.F&&this.G===a.G}toString(){return`${this.C}.${this.F}.${this.G}`+(null!==this.L?`-${this.L}`:'')}};olympe.W.Uh.C=new olympe.W.Uh(Number.NaN,Number.NaN,Number.NaN);olympe.W.O={xh:'utils.binaryConverter',Bs:'utils.base64Converter'};olympe.U.config(a=>{ta(a,olympe.W.O.xh);sa(a,olympe.W.O.Bs,olympe.W.O.xh,!0)},'Utils services');olympe.U.run([olympe.W.O.xh],a=>{olympe.W.bi=()=>a});olympe.sa={};olympe.sa.Qb=class{L(){}qa(){}G(){}ea(){}ka(){}Fa(){}R(){}Y(){}trace(){}debug(){}log(){}info(){}warn(){}error(){}fatal(){}};olympe.sa.Qb.prototype.fatal=olympe.sa.Qb.prototype.fatal;olympe.sa.Qb.prototype.error=olympe.sa.Qb.prototype.error;olympe.sa.Qb.prototype.warn=olympe.sa.Qb.prototype.warn;olympe.sa.Qb.prototype.info=olympe.sa.Qb.prototype.info;olympe.sa.Qb.prototype.log=olympe.sa.Qb.prototype.log;olympe.sa.Qb.prototype.debug=olympe.sa.Qb.prototype.debug;olympe.sa.Qb.prototype.trace=olympe.sa.Qb.prototype.trace;
235
- olympe.sa.Qb.C={Zu:0,dg:1,Xt:2,sp:3,gv:4,tc:5,et:6,Zl:7};olympe.sa.Qb.F={0:'TRACE',1:'DEBUG',2:'LOG',3:'INFO',4:'WARN',5:'ERROR',6:'FATAL',7:'NOTHING'};olympe.sa.ta=class{Qc(){}};olympe.sa.jd={};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.cb?`%c[${g}] [${f.toUpperCase()}] ${c}:%c`:`%c[${g}] ${c}:%c`;for(const h of d)f+=' '+h;a.Ta[b](f,'color: '+e,'color: #444');for(const h of a.sd.values())h(g,c,b,...d)}
236
- olympe.sa.jd.Qb=class{constructor(a,b,c){this.name=a;this.C=b;this.cb=c;this.F=a.toUpperCase();this.sd=new Map;this.Ta=console}L(){return this.C}qa(){return this.C<=olympe.sa.Qb.C.Zu}G(){return this.C<=olympe.sa.Qb.C.dg}ka(){return this.C<=olympe.sa.Qb.C.Xt}ea(){return this.C<=olympe.sa.Qb.C.sp}Fa(){return this.C<=olympe.sa.Qb.C.gv}R(){return this.C<=olympe.sa.Qb.C.tc}Y(){return this.C<=olympe.sa.Qb.C.et}trace(...a){this.qa()&&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.ea()&&Ma(this,'info',this.F,a,'#00f','info')}warn(...a){this.Fa()&&Ma(this,'warn',this.F,a,'#684911','warn')}error(...a){this.R()&&Ma(this,'error',this.F,a,'#f00','error')}fatal(...a){this.Y()&&Ma(this,'error',this.F,a,'#f00','fatal')}};olympe.sa.jd.Qb.ma=[olympe.sa.Qb];olympe.sa.jd.ta=class{constructor(a,b,c){this.C=a;this.F=parseInt(b,10);this.G=c;this.channels=new Map;this.N=this.Qc('logging');this.N.info('Logging initialized, global log level is '+olympe.sa.Qb.F[b])}Qc(a){var b=this.channels.get(a);if(!b){b=this.F;var c=`${olympe.sa.Config.Gs}.${a}`;Object.prototype.hasOwnProperty.call(this.C.parameters,c.toLowerCase())&&(b=parseInt(this.C.getParameter(c),10));let d=this.G;c=`${c}.${olympe.sa.Config.Nu}`;Object.prototype.hasOwnProperty.call(this.C.parameters,
238
- c.toLowerCase())&&(d=!0===this.C.getParameter(c));b=new olympe.sa.jd.Qb(a,b,d);this.channels.set(a,b)}return b}};olympe.sa.jd.ta.ma=[olympe.sa.ta];olympe.sa.O={xa:'logging.Manager'};olympe.sa.Config={To:'logging',Uo:'logging.showLogLevel',Gs:'logging',Nu:'showLogLevel'};olympe.U.config(function(a){E(a,olympe.sa.Config.To,olympe.sa.Qb.C.sp);E(a,olympe.sa.Config.Uo,!0);ra(a,olympe.sa.O.xa,olympe.sa.jd.ta,olympe.U.O.cg,new olympe.U.fa(olympe.sa.Config.To),new olympe.U.fa(olympe.sa.Config.Uo))},'olympe.logging');olympe.U.run([olympe.sa.O.xa],a=>{olympe.sa.Ya=b=>a.Qc(b)},'Logging singleton getter initialization');olympe.D={};olympe.D.Config={Qp:'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.ea=d}static L(){var b=[];return void 0===b||0===b.length?olympe.D.J.ka:new a(Pa,b)}L(){return this.C?this.C():void 0}G(){return this.F?this.F:Na}R(){return null===this.C&&null===this.F}Y(){return this.C===Pa}};olympe.D.J.ea=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.da);
239
- olympe.D.J.F=new olympe.D.J(()=>olympe.D.Xa);olympe.D.J.R=new olympe.D.J(()=>olympe.D.ra);olympe.D.J.Y=new olympe.D.J(()=>olympe.D.kc);olympe.D.Bh=class{Z(){return''}Tb(){return''}destroy(){}zb(){return!1}R(){return!1}run(a,...b){return a(...b)}C(a){return a}getParent(){return null}ee(){}kh(){}lc(){}Pc(){}Kk(){}ea(){}onDestroy(){return''}Ie(){}xc(){return''}Lc(){}};olympe.D.Bh.prototype.offDestroy=olympe.D.Bh.prototype.Ie;olympe.D.Bh.prototype.onDestroy=olympe.D.Bh.prototype.onDestroy;let Qa=0;olympe.U.run([new olympe.U.fa(olympe.D.Config.Qp)],()=>{});
240
- olympe.D.Zb=class{constructor(a='SimpleContext',b){++Qa;this.children=new Map;this.Fa=new Map;this.qa=new Map;this.Ab=0;this.name=a;this.id=String(Qa);this.$a=this.Ta=!1;(this.parent=void 0===b?olympe.D.Ia():b)&&this.parent.lc(this);this.debug=!1}Z(){return this.id}Tb(){return this.name}run(a,...b){if(!this.Ta){var c=olympe.D.ms(this);a=a(...b);c&&olympe.D.ms(c);return a}}C(a){return(...b)=>this.run(a,...b)}destroy(){if(!this.Ta&&!this.$a){this.$a=!0;this.ea();for(const a of this.Fa.keys())this.Fa.has(a)&&
241
- this.Fa.get(a)();this.Fa.clear();this.qa.clear();this.parent&&(this.parent.Pc(this,!1),this.parent=null);this.Ta=!0;this.$a=!1;this.ea()}}zb(){return this.Ta}R(){return this.$a}lc(a){if(!this.Ta){var b;olympe.D.nb(a)?b=a.Na:olympe.D.pn(a)&&(b=a);b&&this.children.set(b.Z(),b)}}Pc(a,b=!0){let c;olympe.D.nb(a)?c=a.Na:olympe.D.pn(a)&&(c=a);c&&this.children.has(c.Z())&&(b&&c.Kk(this),this.children.delete(c.Z()))}Kk(){this.parent=null;this.destroy()}ea(){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.qa.keys())this.qa.has(b)&&this.qa.get(b)();this.qa.clear()}onDestroy(a,b){void 0===b&&(++this.Ab,b=String(this.Ab));this.Fa.set(b,a);return b}Ie(a){this.Fa.delete(a)}xc(a){if(void 0===b){++this.Ab;var b=String(this.Ab)}this.qa.set(b,a);return b}Lc(a){this.qa.delete(a)}ee(a){this.parent&&this.parent.Pc(this,!1);(this.parent=a||null)&&this.parent.lc(this)}getParent(){return this.parent}kh(){return this.children}};
243
- olympe.D.Eq=class extends olympe.D.Zb{constructor(){super('Root',null)}destroy(){}onDestroy(){return''}Ie(){}};olympe.D.Bh.ma=[olympe.D.Bh];let Ra=0;
244
- function Sa(a,b){a.Y||(a.Y=new Map);a.Y.set(b.Z(),b);switch(b.Td()){case olympe.D.Node.C.Ih:break;case olympe.D.Node.C.Th:break;case olympe.D.Node.C.fk:case olympe.D.Node.C.fg:olympe.D.N.warn('Not bad as such but should not happen!');break;case olympe.D.Node.C.Ch:Ta(a,olympe.D.Node.C.Ch);break;case olympe.D.Node.C.OBSOLETE:a.cc=!0;a.F!==olympe.D.Node.C.Ch&&Ta(a,olympe.D.Node.C.OBSOLETE);break;case olympe.D.Node.C.eg:olympe.D.N.warn('Adding a destroyed node as upstream => should never happen!');break;
245
- default:olympe.D.N.warn('Unknown state, investigate: ',b.Td())}Ua(b,a)}
246
- function Va(a){if(a.Ed){var b=[],c=[];if(a.Xf)if(a.Xf instanceof olympe.D.Node)if(Wa(a.Xf))b=a.Xf.Ib;else return;else b=a.Xf;else b=null;if(null!==a.ka){const e=a.tg;for(let f=0,g=a.ka.length;f<g;f++)if(null!==e&&-1<e.indexOf(f)){const h=a.ka[f];if(Wa(h))c.push(h.Ib);else return}else c.push(a.ka[f])}if(a.Ed instanceof Function)var d=a.Ed;else b&&(b[a.Ed]||olympe.D.N.warn('looks like you forget a cast somewhere around '+a.Ed),d=b[a.Ed]);a.run(()=>{a.ea();if(void 0!==d){const e=d.apply(b,c);e&&e.sr?
247
- Xa(a,e.Na):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.Pb&&(a.Pb=a.valueType===olympe.D.Proxy?Za(void 0,a.td):Za(a.valueType,a.td),a.Pb.Na=a);return a.Pb}function $a(a){void 0!==a.G&&(ab(a.G,a),a.G=void 0)}function bb(a){if(a.F===olympe.D.Node.C.OBSOLETE&&(a.F=olympe.D.Node.C.Th,null!==a.L))for(const b of a.L.values())cb(b)}function Ta(a,b){b!==a.F&&(a.F=b)}
248
- function db(a){if(a.F!==olympe.D.Node.C.OBSOLETE&&a.F!==olympe.D.Node.C.fk&&a.F!==olympe.D.Node.C.Ih&&a.F!==olympe.D.Node.C.Ch){Ta(a,olympe.D.Node.C.fk);var b=a.L;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.F!==olympe.D.Node.C.fg)if(b===a.G)K(a,c,!0);else{if(a.F===olympe.D.Node.C.OBSOLETE||a.F===olympe.D.Node.C.fk)a.cc=!0;Va(a)}}
249
- function K(a,b,c){b instanceof olympe.D.Node&&(olympe.D.N.warn('We are setting the value of a node as a node, that should never happen?'),b=b.Ib);a.cb||c||void 0===a.G||$a(a);if(void 0!==b){if((a.cb||a.F===olympe.D.Node.C.Th||a.F===olympe.D.Node.C.OBSOLETE)&&!olympe.D.nb(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.sb&&a.Ib.sb(b))){bb(a);return}}if(!0===a.cb)olympe.D.N.error("Circular dependency detected: updating a downstream node caused this node's (#"+
250
- a.Z()+') value to get updated !');else{a.F===olympe.D.Node.C.eg&&olympe.D.N.warn(`trying to set a value on a destroyed node (#${a.Z()} ${a.Cd?', '+a.Cd:''})`);a.F===olympe.D.Node.C.fg&&olympe.D.N.warn(`trying to set a value on a node being destroyed (#${a.Z()} ${a.Cd?', '+a.Cd:''})`);a.cb=!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.Xa?(c=olympe.D.Cb(c),d=!1):'number'===b.toLowerCase()&&a.valueType===olympe.D.da?(c=olympe.D.za(c),d=!1):'boolean'===b.toLowerCase()&&a.valueType===olympe.D.ra&&(c=olympe.D.Bc(c),d=!1)));a.Ib=c;Ta(a,olympe.D.Node.C.Th);if(b=a.L){d=0;for(const f of b.values())0<d&&db(f),d++;for(const f of b.values())eb(f,a,c)}a.cb=!1}}}
252
- function fb(a,b){if(a.F!==olympe.D.Node.C.fg&&a.F!==olympe.D.Node.C.eg&&(a.F!==olympe.D.Node.C.Ih||a.Ed)){var c=void 0!==a.defaultValue;a.Ed&&b!==a.G&&a.ea();if(c)K(a,a.defaultValue,!0);else if(a.Ib=void 0,Ta(a,olympe.D.Node.C.Ih),b=a.L)for(const d of b.values())fb(d,a)}}function Ya(a){if(a.F!==olympe.D.Node.C.Ch){Ta(a,olympe.D.Node.C.Ch);var b=a.L;if(b)for(const c of b.values())Ya(c);a.ea();void 0!==a.G&&$a(a);a.Ib=a.defaultValue}}function Wa(a){return a.F===olympe.D.Node.C.Th}
253
- function Xa(a,b){b===a?olympe.D.N.error('Setting a node as provider of itself. Ignoring'):(a.G&&a.G!==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.G=b)}function gb(a,b){a.Ed&&(a.Ed=void 0);a.Cd='Repeater';Xa(a,b)}function cb(a){a.G?bb(a):null!==a.Y&&0===Array.from(a.Y.values()).filter(b=>!Wa(b)).length&&(a.cc&&(a.cc=!1,Va(a)),bb(a))}
254
- function Ua(a,b){a.L||(a.L=new Map);a.L.set(b.Z(),b);a.F===olympe.D.Node.C.eg&&olympe.D.N.warn('adding a downstream node on a deleted one (#'+a.Z()+') !')}function ab(a,b){a.L&&(b=b.Z(),a.L.has(b)&&(a.L.delete(b),hb(a)))}function hb(a){if(null===a.getParent()){var b=a.L;b&&0<b.size||a.destroy()}}
255
- olympe.D.Node=class extends olympe.D.Zb{constructor({valueType:a,Ed:b,Zx:c=!0,Xf:d,jn:e,debug:f=!1,tg:g=null,Cd:h='Node',Si:k}={}){++Ra;super(String(Ra));this.debug=!!f;this.Cd=h;h&&'string'===typeof h||(b?this.Cd=b.name?b.name:'anon()':this.Cd='Node');this.ka=e&&0<e.length?e:null;this.tg=g&&0<g.length?g:null;this.valueType=a;this.Ib=void 0;this.cb=!1;this.F=olympe.D.Node.C.Ih;this.cc=!1;this.L=this.Y=null;this.Ed=b;this.Xf=d||null;this.defaultValue=this.Pb=this.G=void 0;this.Si=k;d&&d instanceof
256
- olympe.D.Node&&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.F===olympe.D.Node.C.Ih&&K(this,a,!0);return this}Vi(a){this.valueType=a}$b(){return this.valueType||Object}Td(){return this.F}zb(){return this.F===olympe.D.Node.C.eg}R(){return this.F===olympe.D.Node.C.fg}td(...a){if(this.Si instanceof Function)return this.Si(...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.Td();a!==olympe.D.Node.C.fg&&
257
- a!==olympe.D.Node.C.eg||olympe.D.N.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.nb(g)&&b.push(g.Na);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.Na,b.push(g));return L(new olympe.D.Node({valueType:d.L(),Ed:c,Xf:this,jn:e,debug:!1,tg:b,Cd:'Proxy.'+c+'()'}))}Kk(a){if(null===this.getParent())olympe.D.N.warn('context is undefined, investigate');else if(this.getParent()!==a){olympe.D.N.warn('Investigate a potential issue in creator-createe link: create node mismatch',
258
- a,this.getParent());return}this.ee(null);hb(this)}destroy(){var a=this.F;if(a!==olympe.D.Node.C.fg&&a!==olympe.D.Node.C.eg){Ta(this,olympe.D.Node.C.fg);if(a=this.L){for(const c of a.values())if(a.has(c.Z())){var b=c;b.Y&&b.Y.delete(this.Z());b.G&&b.G.Z()===this.Z()?b.G=void 0:b.destroy()}a.clear()}this.L=null;super.destroy();if(this.Y){for(const c of this.Y.values())this.Y.has(c.Z())&&ab(c,this);this.Y.clear()}this.Y=null;this.G&&(ab(this.G,this),this.G=void 0);this.Ib=void 0;this.ka&&(this.ka.length=
259
- 0,this.ka=null);this.tg&&(this.tg.length=0,this.tg=null);this.Si=this.Ed=void 0;this.defaultValue=this.Xf=null;this.Cd=`** Destroyed ** ${this.Cd}`;Ta(this,olympe.D.Node.C.eg)}}Tb(){return this.Cd}};olympe.D.Node.F='rootNode';olympe.D.Node.C={Ih:0,Th:1,Ch:3,fk:4,OBSOLETE:5,fg:6,eg: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.N.error('investigate');c=Object.create(ib(c,a.prototype));c.Dk=a;c.tr=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.N.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.Na&&a.Na.Vi(b)}}
261
- function jb(a,b){let c={};if(b.prototype)olympe.D.N.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.R()?c[d]=function(...f){var g=this.Na;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.ea,c[d]=function(...f){f=this.tr.call(this.Na,
262
- ...f,e,d);const g=e.ea;if(g){const h=this.Na.Ib;h&&h[g]&&kb(f,h[g])}return e.Y()?this:f})}});return c}function lb(a,b){K(a.Na,b)}function mb(a){fb(a.Na)}function nb(a){olympe.D.yc([olympe.D.ra.C],b=>{a.Na.bf(b)},'setDefaultValue');return a}function ob(a,b){gb(a.Na,olympe.D.Sf(b)?b:b.Na)}function pb(a,b){olympe.D.nb(b)||olympe.D.Sf(b)?ob(a,b):lb(a,b)}
263
- olympe.D.Proxy=class{constructor(a,b){this.Na=null;this.Dk=a;this.tr=b}static nb(a){return!(!a||!a.xf)}sb(a){return olympe.D.Ga([this,a],(b,c)=>b===c,Boolean)}Vd(a){return olympe.D.Ga([this,a],(b,c)=>null===b||null===c?b===c?olympe.D.ra.F:olympe.D.ra.C:b.valueOf()===c.valueOf()?olympe.D.ra.F:olympe.D.ra.C,olympe.D.ra)}sr(){return this.Na}};olympe.D.Proxy.im='__opp__';olympe.D.Proxy.prototype.xf=!0;function qb(a,b){a.node.bf(b);return a}olympe.D.Rj=class{constructor(a,b='FlowSource'){this.node=olympe.D.createNode(a,void 0,void 0,void 0,void 0,b)}update(a){olympe.D.nb(a)?K(this.node,olympe.D.Za(a)):K(this.node,a);return this}repeat(a){gb(this.node,olympe.D.nb(a)?a.Na: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.Nc(olympe.D.da),g=d||olympe.D.da.zo.Gp;let h,k,l,n;f.update(olympe.D.za(a));const p=window.performance.now(),q=b.valueOf();l=q-a.valueOf();if(0!==l&&void 0===n){const r=()=>{f.node.zb()||(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.za(h)),1===k&&void 0!==e&&e(h),1>k&&(n=window.requestAnimationFrame(r)))};n=window.requestAnimationFrame(r)}return f.Eb()}
264
- olympe.D.da=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.za(b.value)}En(){return'number'===typeof this.value&&!isNaN(this.value)}isNaN(){return olympe.D.Bc(!this.En())}kd(){return null===this.value||void 0===this.value||void 0===this.value.toString||isNaN(this.value)?olympe.D.Cb(''):olympe.D.Cb(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.Nc(olympe.D.da,'ONumber.max result'),e=()=>{c=-Infinity;for(const f of b.values())f>c&&(c=f);d.update(olympe.D.za(c))};a.forEach((f,g)=>{olympe.D.yc([f],h=>{b.set(g,h.valueOf());e()})},f=>{if(!d.node.zb()){var g=b.get(f);b.delete(f);g===c&&
266
- e()}});return d.Eb()}je(a){return olympe.D.Ga([this,a],(b,c)=>olympe.D.za(b.valueOf()+c.valueOf()),olympe.D.da,'ONumber.plus')}vh(a){return olympe.D.Ga([this,a],(b,c)=>olympe.D.za(b.valueOf()-c.valueOf()),olympe.D.da,'ONumber.minus')}round(){return olympe.D.za(Math.round(this.valueOf()))}xj(){return olympe.D.za(-this.valueOf())}Zk(a){return olympe.D.Ga([this,a],(b,c)=>olympe.D.za(b.valueOf()*c.valueOf()),olympe.D.da,'ONumber.mul')}Wi(a){return olympe.D.Ga([this,a],(b,c)=>olympe.D.za(b.valueOf()/c.valueOf()),
267
- olympe.D.da,'ONumber.div')}Cx(a){return olympe.D.Ga([this,a],(b,c)=>olympe.D.za(b.valueOf()%c.valueOf()),olympe.D.da,'ONumber.div')}floor(){return olympe.D.za(Math.floor(this.valueOf()))}ceil(){return olympe.D.za(Math.ceil(this.valueOf()))}trunc(){return olympe.D.za(Math.trunc(this.valueOf()))}log(){return olympe.D.za(Math.log(this.valueOf()))}pow(a){return olympe.D.Ga([this,a],(b,c)=>olympe.D.za(Math.pow(b.valueOf(),c.valueOf())),olympe.D.da,'ONumber.pow')}exp(){return olympe.D.za(Math.exp(this.valueOf()))}Vd(a){return olympe.D.Ga([this,
268
- a],(b,c)=>olympe.D.Bc(b.sb(c)),olympe.D.ra,'ONumber.oEquals')}sb(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()}mn(a){return olympe.D.Ga([this,a],(b,c)=>b.valueOf()>c.valueOf()?olympe.D.ra.F:olympe.D.ra.C,olympe.D.ra,'ONumber.isBiggerThan')}$x(a){return olympe.D.Ga([this,a],(b,c)=>b.valueOf()>=c.valueOf()?b:olympe.D.za(c),olympe.D.da,'ONumber.returnsBiggest')}js(a){return olympe.D.Ga([this,
269
- a],(b,c)=>b.valueOf()<=c.valueOf()?b:olympe.D.za(c),olympe.D.da,'ONumber.returnsSmallest')}sx(a){return olympe.D.Ga([this,a],(b,c)=>b.valueOf()<c.valueOf()?olympe.D.ra.F:olympe.D.ra.C,olympe.D.ra,'ONumber.isSmallerThan')}sin(){return olympe.D.za(Math.sin(this.valueOf()))}cos(){return olympe.D.za(Math.cos(this.valueOf()))}atan2(a){return olympe.D.nb(a)?olympe.D.ke([a],b=>olympe.D.za(Math.atan2(this.valueOf(),b.valueOf())),olympe.D.da):olympe.D.za(Math.atan2(this.valueOf(),a.valueOf()))}abs(){return olympe.D.za(Math.abs(this.valueOf()))}mj(a,
270
- b){return olympe.D.nb(a)||olympe.D.nb(b)?olympe.D.ke([a,b],(c,d)=>olympe.D.za(this.valueOf()*d.valueOf()+c.valueOf()*(1-d.valueOf())),olympe.D.da):olympe.D.za(this.valueOf()*b.valueOf()+a.valueOf()*(1-b.valueOf()))}static jv(a,b,c,d){'number'===typeof a&&(a=olympe.D.ie(a));'number'===typeof b&&(b=olympe.D.ie(b));'number'===typeof c&&(c=olympe.D.ie(c));let e=0;const f=olympe.D.ie(0);let g,h;void 0!==b&&void 0!==c&&olympe.D.Tk(b.mn(c),()=>{olympe.sa.Ya('df').warn('You have a min bigger than max, cap your inputs')});
271
- const k=(l,n)=>{n=olympe.D.ie(n);const p=olympe.D.da.animate(n,500);ob(f,p);lb(n,olympe.D.za(l));e=l};olympe.D.ke([a],l=>{e+=l.valueOf();e>h?k(h,e):e<g?k(g,e):ob(f,olympe.D.ie(e))},olympe.D.da);void 0!==b&&olympe.D.dl(b.valueOf(),l=>{if(g!==l&&(g=l,g>e)){const n=olympe.D.ie(e),p=olympe.D.da.animate(n,400,d);l=olympe.D.za(g);K(n.Na,l);e=g;ob(f,p)}});void 0!==c&&olympe.D.dl(c.valueOf(),l=>{if(h!==l&&(h=l,h<e)){const n=olympe.D.ie(e),p=olympe.D.da.animate(n,400,d);l=olympe.D.za(h);K(n.Na,l);e=h;ob(f,
272
- p)}});return f}static offset(a){let b;return olympe.D.ke([a],c=>{void 0===b&&(b=c);return olympe.D.za(c-b)},olympe.D.da,'offset')}static Hr(a){let b,c,d;return olympe.D.Ga([a],e=>{if(void 0===b)return b=e,c=window.performance.now(),olympe.D.za(0);d=window.performance.now();const f=olympe.D.za((e.valueOf()-b.valueOf())/(d-c));b=e;c=d;return f},olympe.D.da,'derivative')}static nx(a){let b=olympe.D.za(0),c,d,e;return olympe.D.Ga([a],f=>{if(void 0===c)return c=f,d=window.performance.now(),olympe.D.za(0);
273
- e=window.performance.now();b=b.je((f.valueOf()+c.valueOf())/2*(e-d));c=f;d=e;return b},olympe.D.da,'integrate')}static Qv(a){let b;return olympe.D.Ga([a],c=>{void 0===b&&(b=c.valueOf());const d=olympe.D.za(c.valueOf()-b.valueOf());b=c;return d},olympe.D.da,'diff')}static Fv(a,b,c){return olympe.D.ke([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.za(d>=e?d<=f?d:f:e)},olympe.D.da)}static animate(a,b,c,d){let e;
274
- return e=olympe.D.Ga([a],f=>{const g=olympe.D.Za(b,1E3),h=olympe.D.Za(e);return void 0===h?olympe.D.za(f):rb(h,f,g,c,k=>{d&&d(k)})},olympe.D.da)}static wv(a,b,c){let d,e,f,g,h,k,l=olympe.D.ie(),n;olympe.D.yc([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.za(g));1===h&&(clearTimeout(n),n=void 0)},0))});return l}static kd(a){return olympe.D.nb(a)?
275
- olympe.D.Ga([a],b=>olympe.D.Cb(b.valueOf().toString()),olympe.D.Xa):olympe.D.Cb(a)}static xj(a){return olympe.D.nb(a)?olympe.D.Ga([a],b=>olympe.D.za(-b.valueOf()),olympe.D.da):olympe.D.za(-a.valueOf())}static je(a,b){return olympe.D.nb(a)||olympe.D.nb(b)?olympe.D.Ga([a,b],(c,d)=>olympe.D.za(c.valueOf()+d.valueOf()),olympe.D.da,'plus'):olympe.D.za(a.valueOf()+b.valueOf())}static vh(a,b){return olympe.D.nb(a)||olympe.D.nb(b)?olympe.D.ke([a,b],(c,d)=>olympe.D.za(c.valueOf()-d.valueOf()),olympe.D.da,
276
- 'minus'):olympe.D.za(a.valueOf()-b.valueOf())}static Wi(a,b){return olympe.D.nb(a)||olympe.D.nb(b)?olympe.D.ke([a,b],(c,d)=>olympe.D.za(c.valueOf()/d.valueOf()),olympe.D.da,'div'):olympe.D.za(a.valueOf()/b.valueOf())}static Yx(a,b){if(void 0===b)return a;olympe.D.yc([b],c=>{c=olympe.D.za(a.Na.Ib.valueOf()+c.valueOf());K(a.Na,c)},'plusEqual');return a}};olympe.D.da.ZERO=new olympe.D.da(0);olympe.D.da.ONE=new olympe.D.da(1);olympe.D.da.av=new olympe.D.da(2);olympe.D.da.PI=new olympe.D.da(Math.PI);
277
- olympe.D.da.vt=new olympe.D.da(Infinity);olympe.D.da.hu=new olympe.D.da(-Infinity);olympe.D.da.Pp=new olympe.D.da(NaN);olympe.D.da.xA=olympe.D.da.Yx;olympe.D.da.Gy=olympe.D.da.jv;olympe.D.da.nA=olympe.D.da.offset;olympe.D.da.fz=olympe.D.da.Hr;olympe.D.da.AC=olympe.D.da.Hr;olympe.D.da.Zz=olympe.D.da.nx;olympe.D.da.gz=olympe.D.da.Qv;olympe.D.da.Vy=olympe.D.da.Fv;olympe.D.da.Hy=olympe.D.da.animate;olympe.D.da.Iy=olympe.D.da.wv;olympe.D.da.MB=olympe.D.da.kd;olympe.D.da.NB=olympe.D.da.xj;
278
- olympe.D.da.wA=olympe.D.da.je;olympe.D.da.iA=olympe.D.da.vh;olympe.D.da.hz=olympe.D.da.Wi;
279
- olympe.D.da.zo={Gp:function(a,b,c,d){return c*a/d+b},Cz:function(a,b,c,d){a/=d;return c*a*a+b},Mz:function(a,b,c,d){a/=d;return-c*a*(a-2)+b},yz: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},qz:function(a,b,c,d){a/=d;return c*a*a*a+b},Iz:function(a,b,c,d){a/=d;a--;return c*(a*a*a+1)+b},wz: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},Dz:function(a,b,c,d){a/=d;return c*a*a*a*a+b},Nz:function(a,b,c,d){a/=d;a--;return-c*(a*a*a*a-1)+b},
280
- zz: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},Ez:function(a,b,c,d){a/=d;return c*a*a*a*a*a+b},Oz:function(a,b,c,d){a/=d;a--;return c*(a*a*a*a*a+1)+b},Az: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},Fz:function(a,b,c,d){return-c*Math.cos(a/d*(Math.PI/2))+c+b},Pz:function(a,b,c,d){return c*Math.sin(a/d*(Math.PI/2))+b},Bz:function(a,b,c,d){return-c/2*(Math.cos(Math.PI*a/d)-1)+b},uz:function(a,b,c,d){return c*Math.pow(2,
281
- 10*(a/d-1))+b},Lz:function(a,b,c,d){return c*(-Math.pow(2,-10*a/d)+1)+b},xz: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},pz:function(a,b,c,d){a/=d;return-c*(Math.sqrt(1-a*a)-1)+b},Hz:function(a,b,c,d){a/=d;a--;return c*Math.sqrt(1-a*a)+b},vz: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},kz:function(a,b,c,d){d=(a/=d)*a;return b+c*(4*d*a+-3*d)},lz:function(a,b,c,d){d=(a/=d)*a;return b+
282
- c*(2*d*d+2*d*a+-3*d)},mz:function(a,b,c,d){d=(a/=d)*a;return b+c*(4*d*a+-9*d+6*a)},nz:function(a,b,c,d){d=(a/=d)*a;return b+c*(-2*d*d+10*d*a+-15*d+8*a)},Kz: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)},Jz: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)},sz:function(a,b,c,d){d=(a/=d)*a;a*=d;return b+c*(33*a*d+-59*d*d+32*a+-5*d)},rz:function(a,b,c,d){d=(a/=d)*a;a*=d;return b+c*(56*a*d+-105*d*d+60*a+-10*d)},Gz: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},oz: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.da.prototype;m.toJSON.K=olympe.D.J.C;m.En.K=olympe.D.J.C;m.isNaN.K=olympe.D.J.R;m.kd.K=olympe.D.J.F;
284
- m.toString.K=new olympe.D.J(()=>String,[]);m.toFixed.K=new olympe.D.J(()=>String,[]);m.je.K=new olympe.D.J(()=>olympe.D.da,[0]);m.vh.K=new olympe.D.J(()=>olympe.D.da,[0]);m.round.K=olympe.D.J.G;m.xj.K=olympe.D.J.G;m.Zk.K=new olympe.D.J(()=>olympe.D.da,[0]);m.Wi.K=new olympe.D.J(()=>olympe.D.da,[0]);m.Cx.K=new olympe.D.J(()=>olympe.D.da,[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.da,[0]);m.exp.K=olympe.D.J.G;
285
- m.Vd.K=new olympe.D.J(()=>olympe.D.ra,[0]);m.sb.K=olympe.D.J.C;m.valueOf.K=olympe.D.J.C;m.Mw.K=olympe.D.J.C;m.mn.K=new olympe.D.J(()=>olympe.D.ra,[0]);m.$x.K=new olympe.D.J(()=>olympe.D.da,[0]);m.js.K=new olympe.D.J(()=>olympe.D.da,[0]);m.sx.K=new olympe.D.J(()=>olympe.D.ra,[0]);m.sin.K=olympe.D.J.G;m.cos.K=olympe.D.J.G;m.atan2.K=new olympe.D.J(()=>olympe.D.da,[0]);m.abs.K=olympe.D.J.G;m.mj.K=new olympe.D.J(()=>olympe.D.da,[0,1]);olympe.D.Xa=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.Cb(b.value)}Dr(a){return olympe.D.Xa.concat(this,'.',a)}concat(...a){let b;Array.isArray(a[0])?b=a[0]:b=a;return olympe.D.Ga([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.Cb(d)},olympe.D.Xa,'OString.concat')}kd(){return this}vy(a){return olympe.D.za(parseInt(this.value,
286
- a))}ss(){return olympe.D.za(parseFloat(this.value))}toString(){return this.value}valueOf(){return this.value.valueOf()}sb(a){return this.value===(void 0===a||null===a?void 0:a.valueOf())}Vd(a){return olympe.D.Ga([this,a],(b,c)=>olympe.D.Bc(c&&b.valueOf()===c.valueOf()),olympe.D.ra,'OString.oEquals')}Qf(){return olympe.D.Bc(!this.value||0===this.value.length)}contains(a){return olympe.D.Ga([this,a],(b,c)=>olympe.D.Bc((c instanceof olympe.D.Xa||'string'===typeof c)&&b.valueOf().includes(c.valueOf())),
287
- olympe.D.ra,'OString.contains')}startsWith(a,b){return olympe.D.Ga([this,a,b||0],(c,d,e)=>olympe.D.Bc(c.valueOf().startsWith(d.valueOf(),e.valueOf())),olympe.D.ra,'OString.startsWith')}endsWith(a,b){return olympe.D.Ga([this,a,b||-1],(c,d,e)=>{e=0<=e.valueOf()?e.valueOf():this.Ag().valueOf()+e.valueOf()+1;return olympe.D.Bc(c.valueOf().endsWith(d.valueOf(),e))},olympe.D.ra,'OString.endsWith')}indexOf(a,b){return olympe.D.Ga([this,a,b||0],(c,d,e)=>olympe.D.za(c.valueOf().indexOf(d.valueOf(),e.valueOf())),
288
- olympe.D.da,'OString.indexOf')}lastIndexOf(a,b){return olympe.D.Ga([this,a,b||Infinity],(c,d,e)=>olympe.D.za(c.valueOf().lastIndexOf(d.valueOf(),e.valueOf())),olympe.D.da,'OString.lastIndexOf')}slice(a,b){return olympe.D.Ga([this,a,b],(c,d,e)=>olympe.D.Cb(c.valueOf().slice(d.valueOf(),e?e.valueOf():void 0)),olympe.D.Xa,'OString.slice')}Ag(){return olympe.D.za(this.value.length)}threshold(a){return olympe.D.Ga([this,a],(b,c)=>b.valueOf().length>=c.valueOf()?b:olympe.D.Xa.EMPTY,olympe.D.Xa,'OString.threshold')}toLowerCase(){return olympe.D.Cb(this.value.toLowerCase())}toUpperCase(){return olympe.D.Cb(this.value.toUpperCase())}trim(){return olympe.D.Cb(this.value.trim())}padStart(a,
289
- b){return olympe.D.Ga([this,a,b],(c,d,e)=>olympe.D.Cb(c.valueOf().padStart(d.valueOf(),e.valueOf())),olympe.D.Xa,'OString.padStart')}padEnd(a,b){return olympe.D.Ga([this,a,b],(c,d,e)=>olympe.D.Cb(c.valueOf().padEnd(d.valueOf(),e.valueOf())),olympe.D.Xa,'OString.padEnd')}replace(a,b){return olympe.D.Ga([this,a,b],(c,d,e)=>olympe.D.Cb(c.valueOf().replace(d.valueOf(),e.valueOf())),olympe.D.Xa,'OString.replace')}ry(a,b){return olympe.D.Ga([this,a,b],(c,d,e)=>olympe.D.Cb(c.valueOf().substr(d.valueOf(),
290
- e.valueOf())),olympe.D.Xa,'OString.subOStr')}static concat(...a){return olympe.D.Cb('').concat(...a)}};olympe.D.Xa.EMPTY=new olympe.D.Xa('');olympe.D.Xa.Ou=new olympe.D.Xa(' ');m=olympe.D.Xa.prototype;m.toJSON.K=olympe.D.J.C;m.Dr.K=new olympe.D.J(()=>olympe.D.Xa,[0,1]);m.concat.K=olympe.D.J.F;m.kd.K=olympe.D.J.F;m.vy.K=olympe.D.J.G;m.ss.K=olympe.D.J.G;m.toString.K=olympe.D.J.C;m.valueOf.K=olympe.D.J.C;m.sb.K=olympe.D.J.C;m.Vd.K=new olympe.D.J(()=>olympe.D.ra,[0]);m.Qf.K=olympe.D.J.R;
291
- m.contains.K=new olympe.D.J(()=>olympe.D.ra,[0]);m.startsWith.K=new olympe.D.J(()=>olympe.D.ra,[0,1]);m.endsWith.K=new olympe.D.J(()=>olympe.D.ra,[0,1]);m.indexOf.K=new olympe.D.J(()=>olympe.D.da,[0,1]);m.lastIndexOf.K=new olympe.D.J(()=>olympe.D.da,[0,1]);m.slice.K=new olympe.D.J(()=>olympe.D.Xa,[0,1]);m.Ag.K=olympe.D.J.G;m.threshold.K=new olympe.D.J(()=>olympe.D.Xa,[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.ry.K=olympe.D.J.F;olympe.D.ra=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.ra.F:olympe.D.ra.C}and(a){if(void 0!==a)return olympe.D.nb(a)?olympe.D.ke([a],b=>new olympe.D.ra(this.valueOf()&&b.valueOf()),olympe.D.ra,'and'):this.value&&a.valueOf()?olympe.D.ra.F:olympe.D.ra.C}sb(a){return this.valueOf()===(void 0!==a?a.valueOf():void 0)}Vd(a){if(void 0!==a)return olympe.D.nb(a)?
293
- olympe.D.ke([a],b=>new olympe.D.ra(this.valueOf()===b.valueOf()),olympe.D.ra,'oEquals'):this.sb(a)?olympe.D.ra.F:olympe.D.ra.C}not(){return this.value?olympe.D.ra.C:olympe.D.ra.F}vv(a){if(void 0!==a)return olympe.D.nb(a)?olympe.D.ke([a],b=>new olympe.D.ra(!(this.valueOf()&&b.valueOf())),olympe.D.ra,'andNot'):this.value&&!a.valueOf()?olympe.D.ra.F:olympe.D.ra.C}or(a){if(void 0!==a)return olympe.D.nb(a)?olympe.D.ke([a],b=>new olympe.D.ra(this.valueOf()||b.valueOf()),olympe.D.ra,'or'):this.value||a.valueOf()?
294
- olympe.D.ra.F:olympe.D.ra.C}xor(a){return olympe.D.Ga([this,a],(b,c)=>{b=b.valueOf();c=c.valueOf();return olympe.D.Bc(b&&!c||!b&&c)},olympe.D.ra,'OBoolean.xor')}hw(){return this.value}Pr(){return!0===this.value?olympe.D.da.ONE:olympe.D.da.ZERO}kd(){return olympe.D.Cb(this.toString())}toString(){return this.value?'true':'false'}valueOf(){return this.value}};olympe.D.ra.F=new olympe.D.ra(!0);olympe.D.ra.C=new olympe.D.ra(!1);m=olympe.D.ra.prototype;m.toJSON.K=olympe.D.J.C;
295
- m.and.K=new olympe.D.J(()=>olympe.D.ra,[0]);m.sb.K=olympe.D.J.C;m.Vd.K=new olympe.D.J(()=>olympe.D.ra,[0]);m.not.K=olympe.D.J.R;m.vv.K=new olympe.D.J(()=>olympe.D.ra,[0]);m.or.K=new olympe.D.J(()=>olympe.D.ra,[0]);m.xor.K=new olympe.D.J(()=>olympe.D.ra,[0]);m.hw.K=new olympe.D.J(()=>Boolean,[]);m.Pr.K=olympe.D.J.G;m.kd.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.kb(new Date(a))}
296
- olympe.D.kb=class{constructor(a){this.yb=a}toJSON(){return'{ "type": "dateTime", "value": "'+this.yb.toJSON()+'" }'}static mc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.D.kb(new Date(b.value.valueOf()))}static now(){return new olympe.D.kb(new Date)}lj(){return this.yb&&!isNaN(this.yb.getTime())?olympe.D.ra.F:olympe.D.ra.C}Ct(){return olympe.D.za(this.yb.getMilliseconds())}Et(){return olympe.D.za(this.yb.getSeconds())}Dt(){return olympe.D.za(this.yb.getMinutes())}Bt(){return olympe.D.za(this.yb.getHours())}qw(){return olympe.D.za(this.yb.getDate())}getMonth(){return olympe.D.za(this.yb.getMonth()+1)}Ft(){return olympe.D.za(this.yb.getFullYear())}getTime(){return this.yb.getTime()}oy(){var a=
297
- olympe.D,b=a.Cb;var c=this.yb.getDate();c=10>c?'0'+c:c;var d=this.yb.getMonth()+1;return b.call(a,`${c}.${10>d?'0'+d:d}.${this.yb.getFullYear()}`)}toLocaleString(a){return void 0===a||'string'===typeof a?olympe.D.Cb(this.yb.toLocaleString(a)):olympe.D.Ga([this,a],(b,c)=>olympe.D.Cb(b.yb.toLocaleString(c.valueOf())),olympe.D.Xa)}toLocaleDateString(a){return void 0===a||'string'===typeof a?olympe.D.Cb(this.yb.toLocaleDateString(a)):olympe.D.Ga([this,a],(b,c)=>olympe.D.Cb(b.yb.toLocaleDateString(c.valueOf())),
298
- olympe.D.Xa)}toLocaleTimeString(a){return void 0===a||'string'===typeof a?olympe.D.Cb(this.yb.toLocaleTimeString(a)):olympe.D.Ga([this,a],(b,c)=>olympe.D.Cb(b.yb.toLocaleTimeString(c.valueOf())),olympe.D.Xa)}kd(){return olympe.D.Cb(this.yb.toISOString())}rs(){return new Date(this.getTime())}uy(){return this}wy(){return this}lg(a,b){return olympe.D.Ga([b],c=>{const d=new olympe.D.kb(new Date(this.yb.getTime()));d.yb['set'+a](this.yb['get'+a]()+c.valueOf());return d},olympe.D.kb)}mv(a){return this.lg('Milliseconds',
299
- a)}rv(a){return this.lg('Seconds',a)}nv(a){return this.lg('Minutes',a)}kv(a){return this.lg('Hours',a)}Fm(a){return this.lg('Date',a)}tv(a){return'number'===typeof a?this.Fm(7*a):this.Fm(a.Zk(7))}ov(a){return this.lg('Month',a)}uv(a){return this.lg('FullYear',a)}py(){let a=this.yb.getDay();a=0===a?6:a-1;return new olympe.D.kb(new Date(this.yb.getFullYear(),this.yb.getMonth(),this.yb.getDate()-a))}qy(){return new olympe.D.kb(new Date(this.yb.getFullYear(),this.yb.getMonth()))}Vd(a){return olympe.D.Ga([a],
300
- b=>olympe.D.Bc(this.sb(b)),olympe.D.ra)}sb(a){return a instanceof olympe.D.kb?this.getTime()===a.getTime()||isNaN(this.getTime())&&isNaN(a.getTime()):!1}Fw(){let a=this.yb.getDay();0===a&&(a=7);return olympe.D.za(a)}uw(a,b){return olympe.D.Ga([a,b],(c,d)=>{d=d.valueOf();'years'===d?c=this.yb.getFullYear()-c.yb.getFullYear():'months'===d?c=12*(this.yb.getFullYear()-c.yb.getFullYear())+(this.yb.getMonth()-c.yb.getMonth()):(d={milliseconds:1,seconds:1E3,minutes:6E4,hours:36E5,days:864E5,weeks:6048E5}[d],
301
- void 0===d&&(olympe.sa.Ya('df').warn("[getDiff] '_unit' is not a valid unit! Defaulting to milliseconds"),d=1),c=Math.trunc((this.yb.getTime()-c.yb.getTime())/d));return olympe.D.za(c)},olympe.D.da)}qx(a){return olympe.D.Ga([a],b=>olympe.D.Bc(this.getTime()<b.getTime()),olympe.D.ra)}ox(a){return olympe.D.Ga([a],b=>olympe.D.Bc(this.getTime()>b.getTime()),olympe.D.ra)}rx(a,b){return olympe.D.Ga([a,b],(c,d)=>olympe.D.Bc(this.getTime()>c.getTime()&&this.getTime()<d.getTime()),olympe.D.ra)}valueOf(){return this.lj().valueOf()?
302
- new Date(this.getTime()):new Date(0)}};olympe.D.kb.C=sb(0);olympe.D.kb.F=sb(Number.NaN);m=olympe.D.kb.prototype;m.lj.K=olympe.D.J.R;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.oy.K=new olympe.D.J(()=>olympe.D.Xa,[0]);m.toLocaleString.K=olympe.D.J.F;m.toLocaleDateString.K=olympe.D.J.F;m.toLocaleTimeString.K=olympe.D.J.F;m.kd.K=olympe.D.J.F;m.rs.K=olympe.D.J.C;
303
- m.uy.K=new olympe.D.J(()=>olympe.D.kb,[]);m.wy.K=new olympe.D.J(()=>olympe.D.kb,[]);m.lg.K=new olympe.D.J(()=>olympe.D.kb,[]);m.mv.K=new olympe.D.J(()=>olympe.D.kb,[]);m.rv.K=new olympe.D.J(()=>olympe.D.kb,[]);m.nv.K=new olympe.D.J(()=>olympe.D.kb,[]);m.kv.K=new olympe.D.J(()=>olympe.D.kb,[]);m.Fm.K=new olympe.D.J(()=>olympe.D.kb,[0]);m.tv.K=new olympe.D.J(()=>olympe.D.kb,[]);m.ov.K=new olympe.D.J(()=>olympe.D.kb,[]);m.uv.K=new olympe.D.J(()=>olympe.D.kb,[0]);
304
- m.py.K=new olympe.D.J(()=>olympe.D.kb,[]);m.qy.K=new olympe.D.J(()=>olympe.D.kb,[]);m.Vd.K=olympe.D.J.R;m.sb.K=olympe.D.J.C;m.Fw.K=olympe.D.J.G;m.uw.K=new olympe.D.J(()=>olympe.D.da,[0,1]);m.qx.K=new olympe.D.J(()=>olympe.D.ra,[0]);m.ox.K=new olympe.D.J(()=>olympe.D.ra,[0]);m.rx.K=new olympe.D.J(()=>olympe.D.ra,[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.Tf(a)?olympe.D.ke([a],b,olympe.D.Color):b(a)}
305
- olympe.D.Color=class{constructor(a,b,c,d){this.C=olympe.D.za(void 0!==a?Math.min(255,Math.max(0,Math.round(a))):0);this.F=olympe.D.za(void 0!==b?Math.min(255,Math.max(0,Math.round(b))):0);this.b=olympe.D.za(void 0!==c?Math.min(255,Math.max(0,Math.round(c))):0);this.a=olympe.D.za(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
- 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.Ga([a,b,c,d],(e,f,g,h)=>{e=olympe.D.za(void 0!==e?Math.min(255,Math.max(0,Math.round(e.valueOf()))):0);f=olympe.D.za(void 0!==f?Math.min(255,Math.max(0,Math.round(f.valueOf()))):0);g=olympe.D.za(void 0!==g?Math.min(255,Math.max(0,Math.round(g.valueOf()))):0);h=olympe.D.za(void 0!==h?Math.min(1,Math.max(0,h.valueOf())):1);for(let k of tb.values())if(k&&k.C.sb(e)&&k.F.sb(f)&&k.b.sb(g)&&k.a.sb(h))return k;
307
- return new olympe.D.Color(e,f,g,h)},olympe.D.Color)}Nf(){return this.C}Cf(){return this.b}Hf(){return this.F}Bf(){return this.a}Dv(a,b){return olympe.D.Color.create(this.C.mj(a.Nf(),b),this.F.mj(a.Hf(),b),this.b.mj(a.Cf(),b),this.a.mj(a.Bf(),b))}Yv(a){return olympe.D.Color.create(this.C,this.F,this.b,a)}ts(){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()}sb(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.sb;olympe.D.Color.prototype.toHexString=olympe.D.Color.prototype.Dn;olympe.D.Color.prototype.toRGBString=olympe.D.Color.prototype.ts;olympe.D.Color.prototype.getAlpha=olympe.D.Color.prototype.Bf;
309
- olympe.D.Color.prototype.getGreen=olympe.D.Color.prototype.Hf;olympe.D.Color.prototype.getBlue=olympe.D.Color.prototype.Cf;olympe.D.Color.prototype.getRed=olympe.D.Color.prototype.Nf;olympe.D.Color.create=olympe.D.Color.create;m=olympe.D.Color.prototype;m.toJSON.K=olympe.D.J.C;m.Nf.K=olympe.D.J.G;m.Cf.K=olympe.D.J.G;m.Hf.K=olympe.D.J.G;m.Bf.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.ts.K=new olympe.D.J(()=>String,[]);
310
- m.Dn.K=new olympe.D.J(()=>String,[]);m.sb.K=olympe.D.J.C;olympe.D.File=class{na(){}xp(){}Ql(){}en(){}Ok(){}Zm(){}Pk(){}rename(){}};olympe.D.kc=class{constructor(a,b){this.x=olympe.D.ie(a);this.y=olympe.D.ie(b)}toJSON(){return'{ "type": "vector2", "x": '+JSON.stringify(olympe.D.Za(this.x).valueOf())+', "y": '+JSON.stringify(olympe.D.Za(this.y).valueOf())+' }'}static mc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.D.kc(b.x,b.y)}kx(){return this.x}my(a){pb(this.x,a)}lx(){return this.y}ny(a){pb(this.y,a)}ax(){return this.x.js(this.y)}je(a){return olympe.D.Ga([this,a],(b,c)=>new olympe.D.kc(b.x.je(c.x),b.y.je(c.y)),
311
- olympe.D.kc,'Vector2.plus')}vh(a){return olympe.D.Ga([this,a],(b,c)=>new olympe.D.kc(b.x.vh(c.x),b.y.vh(c.y)),olympe.D.kc,'Vector2.minus')}Fx(a){return new olympe.D.kc(this.x.Zk(a),this.y.Zk(a))}Tv(a){return new olympe.D.kc(this.x.Wi(a),this.y.Wi(a))}Hx(){return new olympe.D.kc(this.x.xj(),this.y.xj())}Uv(a){return olympe.D.Ga([this,a],(b,c)=>olympe.D.Ga([b.x,b.y,c.x,c.y],(d,e,f,g)=>olympe.D.za(d*f+e*g),olympe.D.da),olympe.D.da)}length(){return olympe.D.Ga([this.x,this.y],(a,b)=>olympe.D.za(Math.sqrt(a*
312
- a+b*b)),olympe.D.da)}normalize(){return olympe.D.Ga([this.x,this.y],(a,b)=>{const c=Math.sqrt(a*a+b*b);return new olympe.D.kc(a/c,b/c)},olympe.D.kc)}floor(){return olympe.D.Ga([this.x,this.y],(a,b)=>new olympe.D.kc(Math.floor(a),Math.floor(b)),olympe.D.kc)}ceil(){return olympe.D.Ga([this.x,this.y],(a,b)=>new olympe.D.kc(Math.ceil(a),Math.ceil(b)),olympe.D.kc)}round(){return olympe.D.Ga([this.x,this.y],(a,b)=>new olympe.D.kc(Math.round(a),Math.round(b)),olympe.D.kc)}pv(a){return new olympe.D.kc(this.x.je(a),
313
- this.y.je(a))}qv(a,b){return new olympe.D.kc(this.x.je(a),this.y.je(b))}kd(){return olympe.D.Ga([this.x,this.y],(a,b)=>olympe.D.Cb(`Vector2[${a.valueOf()}, ${b.valueOf()}]`),olympe.D.Xa)}toString(){return`Vector2[${this.x.Na.Ib}, ${this.y.Na.Ib}]`}sb(a){return this===a?!0:!1}};m=olympe.D.kc.prototype;m.toJSON.K=olympe.D.J.C;m.kx.K=olympe.D.J.G;m.my.K=olympe.D.J.C;m.lx.K=olympe.D.J.G;m.ny.K=olympe.D.J.C;m.ax.K=olympe.D.J.G;m.je.K=new olympe.D.J(()=>olympe.D.kc,[0]);
314
- m.vh.K=new olympe.D.J(()=>olympe.D.kc,[0]);m.Fx.K=olympe.D.J.Y;m.Tv.K=olympe.D.J.Y;m.Hx.K=olympe.D.J.Y;m.Uv.K=new olympe.D.J(()=>olympe.D.da,[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.pv.K=olympe.D.J.Y;m.qv.K=olympe.D.J.Y;m.kd.K=olympe.D.J.F;m.toString.K=olympe.D.J.C;m.sb.K=olympe.D.J.C;olympe.D.Pg=class{constructor(){}$b(){}Jd(){}get(){}lh(){}has(){}Dg(){}Rc(){}Ff(){}lf(){}yg(){}forEach(){}fe(){}};olympe.D.Pg.prototype.forEachCurrentValue=olympe.D.Pg.prototype.fe;olympe.D.Pg.prototype.forEach=olympe.D.Pg.prototype.forEach;m=olympe.D.Pg.prototype;m.has.K=olympe.D.J.R;m.Dg.K=olympe.D.J.C;m.Rc.K=new olympe.D.J(()=>Object,[]);m.Ff.K=new olympe.D.J(()=>String,[]);m.lf.K=olympe.D.J.G;m.yg.K=olympe.D.J.C;m.forEach.K=new olympe.D.J(()=>{},[]);m.fe.K=olympe.D.J.C;olympe.D.pd=class extends olympe.D.Pg{constructor(){super()}he(){}Ef(){}Xe(){}Df(){}se(){}We(){}Zi(){}di(){}};olympe.D.pd.prototype.getCurrentAt=olympe.D.pd.prototype.We;olympe.D.pd.prototype.getAt=olympe.D.pd.prototype.se;olympe.D.pd.prototype.getCurrentKeyAt=olympe.D.pd.prototype.Df;olympe.D.pd.prototype.getKeyAt=olympe.D.pd.prototype.Xe;olympe.D.pd.prototype.getCurrentRank=olympe.D.pd.prototype.Ef;olympe.D.pd.prototype.getRank=olympe.D.pd.prototype.he;m=olympe.D.pd.prototype;m.he.K=olympe.D.J.G;
315
- m.Ef.K=olympe.D.J.C;m.Xe.K=new olympe.D.J(()=>String,[]);m.Df.K=olympe.D.J.C;m.se.K=new olympe.D.J(()=>Object,[]);m.We.K=olympe.D.J.C;m.Zi.K=olympe.D.J.C;m.di.K=new olympe.D.J(()=>Array,[]);olympe.D.oi=class{constructor(a,b){this.R=b||olympe.D.Ia();this.valueType=a||Object;this.values={};this.Ab=this.Ta=null;this.Wf=0;this.ea=Object.create(null);this.Pb=Object.create(null);this.size=0;this.L=null;this.R.onDestroy(()=>{const c=this.ea;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()}}})}Gh(){return this.R}$b(){return this.valueType}Jd(a){this.valueType=a;const b=this.Ta;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.Ta&&(this.Ta={});return this.cj(this.Ta,c,this.values[c],this.valueType,'Map.get('+c+')')};return olympe.D.Ga([a],c=>b(c),this.valueType)}lh(a){a=this.values[a];return olympe.D.nb(a)?Wa(a.Na)?a.Na.Ib:void 0:a}has(a){const b=c=>{null===this.Ab&&(this.Ab={});return this.cj(this.Ab,c,c in this.values?olympe.D.ra.F:olympe.D.ra.C,olympe.D.ra,'Map.has('+c+')')};return olympe.D.Ga([a],c=>b(c),olympe.D.ra)}Dg(a){return a in this.values}cj(a,b,c,d,e){let f=a[b];
317
- f||this.R.run(()=>{f=olympe.D.Pd(d,void 0,e);a[b]=f;f.Na.onDestroy(()=>delete a[b]);olympe.D.nb(c)?ob(f,c):lb(f,c)});return f}Rc(){throw Error('Abstract method getFirstKey needs to be overridden');}Ff(){throw Error('Abstract method getFirstKey needs to be overridden');}lf(){null===this.L&&this.R.run(()=>{this.L=olympe.D.Pd(olympe.D.da,olympe.D.za(this.size));this.L.Na.onDestroy(()=>{this.L=null})});return this.L}yg(){return this.size}forEach(a,b){const c=this.Bm();a=this.ur(c,a,b);this.Am(c,a)}Bm(){return String(++this.Wf)}Am(a,
318
- b){this.Pb[a]=b;olympe.D.Ia().xc(()=>{const c=this.ea;for(const d in c)Object.prototype.hasOwnProperty.call(c,d)&&delete c[d][a];delete this.Pb[a]});this.fe(b)}ur(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.Em(a,f,g)})}}Em(a,b,c){void 0===this.ea[b]&&(this.ea[b]={});this.ea[b][a]=c}fe(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.Qi(a,!0);this.values[a]=b;var c=this.Ta;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.Pb;for(const d in c)if(Object.prototype.hasOwnProperty.call(c,d))c[d](b,a,this)}Qi(a,b){const c=this.values;if(Object.prototype.hasOwnProperty.call(c,a)){var d=(d=c[a])&&d.xf?d.Na.Ib:d;var e=this.Ta;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.ea[a];if(void 0!==a)for(const f in a)Object.prototype.hasOwnProperty.call(a,f)&&a[f].destroy();return d}yf(){null!==this.L&&pb(this.L,this.size)}Wh(){var a=this.Ta;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.ea)if(Object.prototype.hasOwnProperty.call(this.ea,c)){b=this.ea[c];for(const d in b)Object.prototype.hasOwnProperty.call(b,d)&&b[d].destroy()}this.size=0;null!==this.L&&pb(this.L,this.size)}Ug(){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.oi.ma=[olympe.D.Pg];m=olympe.D.oi.prototype;m.Gh.K=olympe.D.J.C;m.$b.K=olympe.D.J.C;m.Jd.K=olympe.D.J.C;m.get.K=new olympe.D.J(()=>Object,[],'valueType');
322
- m.lh.K=olympe.D.J.C;m.has.K=olympe.D.J.R;m.Dg.K=olympe.D.J.C;m.cj.K=olympe.D.J.C;m.lf.K=olympe.D.J.G;m.yg.K=olympe.D.J.C;m.forEach.K=new olympe.D.J(()=>{},[]);m.Bm.K=olympe.D.J.C;m.Am.K=olympe.D.J.C;m.ur.K=olympe.D.J.C;m.Em.K=olympe.D.J.C;m.fe.K=olympe.D.J.C;m.Fk.K=olympe.D.J.C;m.Qi.K=olympe.D.J.C;m.yf.K=olympe.D.J.C;m.Wh.K=olympe.D.J.C;m.Ug.K=olympe.D.J.C;olympe.D.Bj=class extends olympe.D.oi{constructor(a,b){super(a,b);this.F=Object.create(null);this.C=[];this.Fa=this.cb=this.$a=this.qa=null}Jd(a){super.Jd(a);if(null!==this.Fa)for(let b of this.Fa.values())kb(b,a)}Rc(){return this.se(0)}Ff(){return this.Xe(0)}he(a){const b=c=>{null===this.$a&&(this.$a=Object.create(null));let d=this.Ef(a);d=void 0!==d?olympe.D.za(d):void 0;return this.cj(this.$a,c,d,olympe.D.da,`List.getRank(${c})`)};return olympe.D.nb(a)?L(olympe.D.createNode(olympe.D.da,b,null,
323
- [a.Na],[0],'onResolved('+(b.name||'')+')')):b(a)}Ef(a){return this.F[a]}Xe(a){const b=c=>{const d=c.valueOf(),e=this.Df(d);null===this.cb&&(this.cb=Object.create(null));return this.cj(this.cb,String(d),e,String,'List.getKeyAt('+c+')')};return olympe.D.Ga([a],c=>b(c),String)}Df(a){return this.C[a.valueOf()]}se(a){if(olympe.D.nb(a))return this.get(olympe.D.Ga([a],c=>{c=this.Xe(c);if(!Wa(c.Na)){const d=olympe.D.Ia();olympe.D.Sf(d)&&fb(d)}return c},String));null===this.Fa&&(this.Fa=new Map);let b=this.Fa.get(a);
324
- b||this.R.run(()=>{b=this.get(this.Xe(a));this.Fa.set(a,b);b.Na.onDestroy(()=>this.Fa.delete(a))});return b}We(a){return this.lh(this.Df(a))}Zi(a,b,c,d){let e=this.Bm();a=this.Yr(e,a,b,c,d);this.Am(e,a)}Yr(a,b,c,d,e){return olympe.D.Ia().C((f,g)=>{let h=!1,k=olympe.D.cf([b,c,this.he(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.Em(a,g,k)})}di(){null===this.qa&&this.R.run(()=>{this.qa=olympe.D.Pd(Array,this.C.filter(a=>void 0!==a));
325
- this.qa.Na.onDestroy(()=>{this.L=null})});return this.qa}fe(a){if(this.C.length!==this.size)super.fe(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}}Dm(a,b){const c=this.$a,d=this.cb,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.za(f)));null!==d&&(void 0!==e&&null!==e&&void 0!==d[e]&&mb(d[e]),void 0!==d[b]&&lb(d[b],a))}}Cm(a){var b=this.cb,c=this.F[a];null!==c&&void 0!==c&&null!==b&&(b=b[c],void 0!==b&&b.Na.Ib===a&&mb(b));delete this.F[a];this.C.splice(c,1);c=this.$a;null!==c&&void 0!==c[a]&&mb(c[a])}vr(){if(null!==this.qa){const a=this.C,b=this.qa.Na.Ib;b&&a.join(',')!==b.join(',')&&lb(this.qa,a)}}yf(){this.vr();super.yf()}Wh(){var a=this.F;for(b in a)delete a[b];this.C.length=0;a=this.$a;if(null!==
327
- a)for(b in a)mb(a[b]);a=this.cb;if(null!==a)for(b in a)mb(a[parseInt(b,10)]);var b=this.qa;null!==b&&(db(b.Na),lb(b,this.C));return olympe.D.oi.prototype.Wh.call(this)}Ug(){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.Bj.ma=[olympe.D.pd];m=olympe.D.Bj.prototype;m.Jd.K=olympe.D.J.C;m.Rc.K=new olympe.D.J(()=>Object,[]);m.Ff.K=new olympe.D.J(()=>String,[]);m.he.K=olympe.D.J.G;m.Ef.K=olympe.D.J.C;
328
- m.Xe.K=new olympe.D.J(()=>String,[]);m.Df.K=olympe.D.J.C;m.se.K=new olympe.D.J(()=>Object,[]);m.We.K=olympe.D.J.C;m.Zi.K=new olympe.D.J(()=>{},[]);m.Yr.K=olympe.D.J.C;m.di.K=new olympe.D.J(()=>Array,[]);m.fe.K=olympe.D.J.C;m.Dm.K=olympe.D.J.C;m.Cm.K=olympe.D.J.C;m.vr.K=olympe.D.J.C;m.yf.K=olympe.D.J.C;m.Wh.K=olympe.D.J.C;m.Ug.K=olympe.D.J.C;olympe.D.Map=class extends olympe.D.oi{constructor(a){a===olympe.D.Proxy&&(a=Object);super(a);this.C=this.F=null}Jd(a){a===olympe.D.Proxy&&(a=Object);null!==this.F&&kb(this.F,a);super.Jd(a)}Rc(){null===this.F&&this.Qm();return this.F}Ff(){null===this.C&&this.Qm();return this.C}Qm(){this.Gh().run(()=>{this.F=olympe.D.Pd(this.$b());this.C=olympe.D.Pd(String);this.uj(this.Vm())})}Vm(){const a=this.values;let b,c;for(b in a)if(Object.prototype.hasOwnProperty.call(a,b)){c=b;break}return c}uj(a){if(void 0!==
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.Na.Ib&&(mb(this.F),mb(this.C))}set(a,b){this.Fk(a,b);1===this.size&&null!==this.C&&this.uj(a);this.yf()}remove(a){const b=this.Qi(a);null!==this.C&&this.C.Na.Ib===a&&this.uj(this.Vm());return b}clear(){this.Wh();null!==this.C&&this.uj(void 0)}};m=olympe.D.Map.prototype;m.Jd.K=olympe.D.J.C;m.Rc.K=new olympe.D.J(()=>Object,[]);m.Ff.K=new olympe.D.J(()=>String,[]);m.Qm.K=olympe.D.J.C;
330
- m.Vm.K=olympe.D.J.C;m.uj.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.Vg=class extends olympe.D.Bj{constructor(a){super(a)}set(a,b,c){this.Fk(a,b);void 0!==c&&olympe.D.yc([c],d=>{this.Dm(a,d)});this.yf()}remove(a){this.Cm(a);return this.Qi(a)}clear(){this.Wh()}};olympe.D.Vg.prototype.remove.K=olympe.D.J.C;olympe.D.Vg.prototype.clear.K=olympe.D.J.C;olympe.D.zs=class extends olympe.D.Rj{constructor(a,b){super(olympe.D.da,'animatedFlowSource');this.duration=a;this.C=b||olympe.D.da.zo.Gp}Eb(){return olympe.D.Lx(this.node,this.duration,this.C,void 0)}};let xb=null;olympe.D.N=void 0;olympe.D.yn=void 0;olympe.D.Zh=void 0;olympe.D.Vh=new Map;olympe.D.Vh.set(0,olympe.D.da.ZERO);olympe.D.Vh.set(1,olympe.D.da.ONE);olympe.D.Vh.set(2,olympe.D.da.av);olympe.D.Ek=new Map;olympe.D.Ek.set('',olympe.D.Xa.EMPTY);olympe.D.Ek.set(' ',olympe.D.Xa.Ou);olympe.D.createNode=function(a,b,c,d,e,f,g,h){return new olympe.D.Node({valueType:a,Ed:b,Xf:c,jn:d,debug:g,tg:e,Cd:f,Si:h})};olympe.D.Sf=function(a){return!!(a&&a instanceof olympe.D.Node)};
331
- olympe.D.Pd=function(a,b,c){a=olympe.D.createNode(a,void 0,void 0,void 0,void 0,c);olympe.D.Sf(b)?gb(a,b):olympe.D.nb(b)?gb(a,b.Na):K(a,b);return L(a)};olympe.D.nb=function(a){return!(!a||!a.xf)};olympe.D.Tf=function(a){return!(!a||!(a instanceof olympe.D.Node||a.xf))};olympe.D.pn=function(a){return olympe.D.Sf(a)||a instanceof olympe.D.Zb||a instanceof olympe.D.Eq};olympe.D.hi=function(a){return a instanceof olympe.D.Rj};
332
- olympe.D.dl=function(a,b){if(void 0!==a){olympe.D.hi(a)&&(a=a.Eb().Na);if(!olympe.D.Tf(a))return b(a);var c=[];olympe.D.nb(a)?c.push(a.Na):c.push(a);return olympe.D.createNode(void 0,b,null,c,[0],'onResolved')}};olympe.D.Za=function(a,b){let c=a;olympe.D.nb(a)?c=a.Na.Ib:olympe.D.Sf(a)?c=a.Ib:olympe.D.hi(a)&&(c=a.Eb().Na.Ib);return void 0===c?b:c};
333
- olympe.D.bf=function(a,b){let c;olympe.D.nb(a)?c=a.Na:olympe.D.Sf(a)?c=a:olympe.D.hi(a)&&(c=a.Eb().Na);c&&olympe.D.yc([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.sr?(h=h.Na,g.push(k)):h instanceof olympe.D.Node?g.push(k):olympe.D.hi(h)&&(h=h.Eb().Na,g.push(k))),f[k]=h;return olympe.D.createNode(c,b,null,f,g,d||'syncNodes')};
334
- olympe.D.ke=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.Tf(b)||olympe.D.hi(b))return!1;return!0};olympe.D.Ga=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.yc([e],g=>{f.bf(g)},'setDefaultValue');return L(f)};olympe.D.yc=function(a,b,c){yb(a)?b(...a):olympe.D.cf(a,b,void 0,c||'processFlows')};
335
- olympe.D.ds=function(a,b){if(yb(a))b(...a);else{const c=olympe.D.Ia();olympe.D.cf(a,(...d)=>{olympe.D.Ia().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.nb(g)?(g=g.Na,f.push(h)):g instanceof olympe.D.Node?f.push(h):olympe.D.hi(g)&&(g=g.Eb().Na,f.push(h))),e[h]=g;0!==f.length&&new olympe.D.Node({Ed:b,jn:e,tg:f,Zx:!1,Cd:c})};
336
- olympe.D.bD=function(a,b,c){const d=olympe.D.Ia();olympe.D.xn(a,(...e)=>{olympe.D.Ia().destroy();d.run(b,...e)},c||'processFutureFlowsOnce')};olympe.D.zC=function(a,b,c){a=new olympe.D.Rj(a,c);b(a);return a.Eb()};olympe.D.Nc=function(a,b='flowSource'){return new olympe.D.Rj(a,b)};olympe.D.eD=function(a,b,c,d){const e=olympe.D.Ia();olympe.D.cf(a,(...f)=>{olympe.D.Ia().destroy();e.run(b,...f)},c,d||'syncProxiesOnce')};
337
- olympe.D.Tk=function(a,b,c){olympe.D.Ga([a],d=>d.valueOf()?b.apply(null,void 0):c&&c.apply(null,void 0),Object,'If')};olympe.D.EC=function(a,b,...c){return a?a.run(b,...c):b(...c)};olympe.D.mD=function(a){return olympe.D.Ia().C(a)};olympe.D.CC=function(a,b,c){olympe.D.Vv(a?a.Na:a,b,c)};
338
- olympe.D.Vv=function(a,b,c){if(a){var d=a.Z();null===xb&&(xb={});if(xb[d])olympe.D.N.log(`Already started node #${d} dump`+(b?`: ${b}`:''));else{xb[d]=!0;var e=`Starting node #${d} dump`+(b?`: ${b}`:'');c?olympe.D.N.warn(e):olympe.D.N.log(e);var f=`#${d}`+(b?`: ${b}`:'')+':';c=olympe.D.createNode(null,g=>{void 0===g?olympe.D.N.log(f,'undefined'):null===g?olympe.D.N.log(f,'null'):olympe.D.N.log(f,String(g))},null,[a],[0],'DataFlowDump');a.onDestroy(()=>{olympe.D.N.log(`Node #${d} destroyed`+(b?`: ${b}`:
339
- ''))});c.onDestroy(()=>{delete xb[d]})}}else olympe.D.N.log('NOT starting node dump, node is '+String(a))};olympe.D.BC=function(){let a='',b=olympe.D.Ia();for(;null!==b;)a+=b.Tb()+' --\x3e ',b=b.getParent();olympe.D.N.log(a)};
340
- olympe.D.za=function(a){if(void 0===a)return olympe.D.da.ZERO;if(a instanceof olympe.D.da)return a;a&&a.valueOf&&(a=a.valueOf());if('number'===typeof a){if(isNaN(a))return olympe.D.da.Pp;if(a===Math.PI)return olympe.D.da.PI;if(Infinity===a)return olympe.D.da.vt;if(-Infinity===a)return olympe.D.da.hu;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.da(a)),olympe.D.Vh.get(a)):new olympe.D.da(a)}return null};
341
- olympe.D.ie=function(a){return void 0===a?olympe.D.Pd(olympe.D.da):olympe.D.Pd(olympe.D.da,olympe.D.Tf(a)?a:olympe.D.za(a))};olympe.D.Lx=olympe.D.da.animate;olympe.D.WC=function(a,b){return new olympe.D.zs(a,b)};olympe.D.Cb=function(a){if(a instanceof olympe.D.Xa)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.Xa(a)};
342
- olympe.D.ZC=function(a){return void 0===a?olympe.D.Pd(olympe.D.Xa):olympe.D.Pd(olympe.D.Xa,olympe.D.Tf(a)?a:olympe.D.Cb(a))};olympe.D.Bc=function(a){return a instanceof olympe.D.ra?a:void 0!==a&&null!==a&&a.valueOf()?olympe.D.ra.F:olympe.D.ra.C};olympe.D.Wx=function(a){return void 0===a?olympe.D.Pd(olympe.D.ra):olympe.D.Pd(olympe.D.ra,olympe.D.Tf(a)?a:olympe.D.Bc(a))};olympe.D.Mx=function(a){if(a instanceof Date)return new olympe.D.kb(a)};
343
- olympe.D.YC=function(a){return olympe.D.Pd(olympe.D.kb,void 0!==a?new olympe.D.kb(a):null)};olympe.D.Xr=a=>a instanceof olympe.D.ra||a instanceof olympe.D.da||a instanceof olympe.D.Xa||a instanceof olympe.D.kb;olympe.D.$C=function(a,b){return olympe.D.Pd(olympe.D.kc,void 0===a&&void 0===b?void 0:new olympe.D.kc(a,b))};olympe.D.Vx=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.Pd(olympe.D.Color,e)};olympe.D.XC=olympe.D.Vx;
344
- olympe.D.Lv=function(a){olympe.D.N=a;olympe.D.Zh=olympe.D.zg()};olympe.D.zg=function(){olympe.D.yn||(olympe.D.yn=new olympe.D.Eq);return olympe.D.yn};olympe.D.Ia=function(){olympe.D.Zh||(olympe.D.Zh=olympe.D.zg());return olympe.D.Zh};olympe.D.ms=function(a){const b=olympe.D.Zh;olympe.D.pn(a)&&(olympe.D.Zh=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.kb.mc(a);break;case 'number':b=olympe.D.da.mc(a);break;case 'string':b=olympe.D.Xa.mc(a);break;case 'vector2':b=olympe.D.kc.mc(a);break;case 'color':b=olympe.D.Color.mc(a);break;case 'boolean':b=olympe.D.ra.mc(a)}return b}return null};function zb(a){a.C.zb()||(a.G.forEach(b=>{b.destroy()}),a.G.clear(),a.F.clear(),a.size.clear(),a.R.clear(),a.Y.length=0,a.L.length=0)}
346
- olympe.D.aB=class{constructor(){this.C=new olympe.D.Zb('Slot Manager context');this.G=new Map;this.C.run(()=>{this.F=olympe.D.Nc(Ab,'Last slot manager entry');this.size=qb(olympe.D.Nc(olympe.D.da,'SlotManager size').repeat(this.F.Eb().an()),olympe.D.da.ZERO);this.R=qb(olympe.D.Nc(olympe.D.da,'last valid slots'),olympe.D.za(-1))});this.Y=[];this.L=[];this.C.onDestroy(()=>{zb(this)})}};
347
- class Ab{constructor(a,b,c,d){this.id=a;this.vc=new olympe.D.Zb('Slot manager entry');this.G=c;this.L=d;this.vc.run(()=>{const e=qb(olympe.D.Nc(olympe.D.da),olympe.D.da.ZERO);olympe.D.nb(b)?e.repeat(b):e.update(b);this.C=olympe.D.Nc(olympe.D.da);this.F=this.C.Eb().je(e.Eb())});this.next=null}Z(){return this.id}ex(){return this.C.Eb()}an(){return this.F}he(){return this.G}px(){return this.L}Ay(a){this.G=a}hy(a){null===a?this.C.update(olympe.D.da.ZERO):(this.C.repeat(a.an()),a.next=this)}Gt(){this.C.clear();
348
- this.next=null}destroy(){this.vc.destroy();this.F=this.C=this.next=null}}m=Ab.prototype;m.Z.K=olympe.D.J.C;m.ex.K=new olympe.D.J(()=>olympe.D.da);m.an.K=new olympe.D.J(()=>olympe.D.da);m.he.K=olympe.D.J.C;m.px.K=olympe.D.J.C;m.Ay.K=olympe.D.J.C;m.hy.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.U.config(a=>{E(a,olympe.D.Config.Qp,Number.POSITIVE_INFINITY);C(a,olympe.D.O.Ea,[olympe.sa.O.xa],b=>b.Qc('df'))},'olympe.df');olympe.U.run([olympe.D.O.Ea],a=>{olympe.D.Lv(a)},'olympe.df');olympe.host={};const Bb=new Map,Cb=new Map;olympe.host.Up=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.N.debug('CREATE #',b,', type=',c);a.C.set(b,olympe.host.Up.create(c,b,a.N,a.L))}function Eb(a,b,c,...d){const e=a.C.get(b);if(void 0!==e){a.N.L()<=olympe.sa.Qb.C.dg&&a.N.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.nb(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.zb()||g(...k)})}else b.push(f.valueOf());e[c].apply(e,b)}}
349
- function Fb(a){var b=olympe.host.ba.Yc,c=olympe.host.ba.Tp.lr;++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.nb(p)?(h.push(n),p=p.Na):olympe.D.Sf(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.xc(a.R.bind(a,d));a=L(e);a.hv=d;K(e,a);return a}olympe.host.ta=class{constructor(a,b){this.N=a;this.L=b;this.G=0;this.C=new Map;this.F=new Map;a.debug('Starting host manager')}Ya(){return this.N}R(a){this.N.debug('DESTROY #',a);const b=this.C.get(a);this.C.delete(a);b.destroy()}};olympe.host.Kd=class{constructor(a){this.C=a;this.F=olympe.D.Ia()}G(){return this.C}R(){return this.C.Na.R()||this.F.R()}zb(){return this.C.Na.zb()}};olympe.host.Kd.prototype.G.K=new olympe.D.J(()=>olympe.host.ba.Kd,[]);olympe.host.uk=class{};olympe.host.Bi=class{constructor(){}C(){}F(){}lj(){}};function Gb(a){return(a=a.find(b=>'authToken'===b.na()))?a.getValue():null}olympe.host.Bi.F=class{constructor(a,b,c=!1){this.name=a;this.value=b;this.C=c}na(){return this.name}getValue(){return this.value}sb(a){return this.na()===a.na()&&this.getValue()===a.getValue()&&this.C===a.C}};function Hb(){const a={}.parameters;return new olympe.host.Bi.C(a?a.map(b=>new olympe.host.Bi.F(b.name,b.value,b.hidden)):[])}
351
- olympe.host.Bi.C=class{constructor(a){this.parameters=a}un(a){const b=new Map(this.parameters.map((c,d)=>[c.na(),d]));a.parameters.forEach(c=>{b.has(c.na())?this.parameters[b.get(c.na())]=c:this.parameters.push(c)})}};function Ib(a,b,c){var d=olympe.host.Le;const e=c||olympe.W.fc(),f=new olympe.D.Zb('onTimeout context');d.C.ea(b,e,()=>{f.zb()||f.run(a);d.C.G(e)});return new olympe.host.Yc.G(d.C,e)}function Jb(a){var b=olympe.host.Le;a=a instanceof olympe.host.Yc.G?a.Z():a;b.C.G(a)}function Kb(a,b,c){var d=olympe.host.Le;const e=c||olympe.W.fc(),f=new olympe.D.Zb('onInterval context');d.C.Y(b,e,()=>{f.zb()?d.C.F(e):f.run(a)});return new olympe.host.Yc.F(d.C,e)}
352
- function Lb(a){var b=olympe.host.Le;a=a instanceof olympe.host.Yc.F?a.Z():a;b.C.F(a)}olympe.host.Yc=class{constructor(a){this.C=Fb(a)}};olympe.host.Yc.C=class{constructor(a,b){this.Le=a;this.id=b}Z(){return this.id}cancel(){}};olympe.host.Yc.L=class extends olympe.host.Yc.C{cancel(){this.Le.R(this.id)}};olympe.host.Yc.G=class extends olympe.host.Yc.C{cancel(){this.Le.G(this.id)}};olympe.host.Yc.F=class extends olympe.host.Yc.C{cancel(){this.Le.F(this.id)}};olympe.host.ba={};olympe.host.ba.Kd=class{destroy(){}};olympe.host.ba.Kd.prototype.destroy=olympe.host.ba.Kd.prototype.destroy;olympe.host.ba.Tp={Ly:100,Ny:101,My:102,Py:103,Oy:104,Ky:105,OA:201,MA:202,JA:204,RA:205,IA:206,LA:207,PA:208,SA:209,TA:210,UA:211,KA:212,QA:218,NA:219,VA:220,HA:221,GA:222,dB:300,eB:301,fB:302,jB:303,kB:304,lB:305,gB:310,hB:311,iB:312,oA:400,pA:401,qA:402,kA:450,cA:500,aA:501,fA:502,eA:503,bA:504,dA:505,EB:600,vB:601,zB:602,rB:603,sB:604,pB:605,uB:606,KB:607,CB:608,mB:609,qB:610,tB:611,BB:612,GB:613,nB:614,FB:615,AB:616,JB:617,wB:618,xB:619,yB:620,DB:630,oB:631,HB:632,IB:633,mC:700,QB:701,RB:702,
353
- SB:703,UB:704,VB:705,WB:706,TB:707,YB:708,XB:709,ZB:710,cC:711,kC:712,$B:713,aC:714,dC:715,eC:716,gC:717,hC:718,jC:719,fC:720,iC:721,lC:722,bC:723,nC:724,oC:725,lr:800};olympe.host.ba.Yc=class{R(){}ea(){}G(){}Y(){}F(){}};olympe.host.O={Sq:'host.System',Il:'host.HistoryManager',Gq:'host.Scheduler',Ea:'host.platform.Logger',xa:'host.Manager'};olympe.host.Le=null;olympe.U.config(function(a){ta(a,olympe.host.O.Sq);ta(a,olympe.host.O.Il);C(a,olympe.host.O.Ea,[olympe.sa.O.xa],function(b){return b.Qc('host')});B(a,olympe.host.O.xa,olympe.host.ta,olympe.host.O.Ea,olympe.U.O.cg);C(a,olympe.host.O.Gq,[olympe.host.O.xa],b=>{null===olympe.host.Le&&(olympe.host.Le=new olympe.host.Yc(b));return olympe.host.Le},!0)},'olympe.host');
354
- olympe.U.run([olympe.host.O.Gq],a=>a,'olympe.host.scheduler');olympe.U.run([olympe.host.O.xa],a=>a,'olympe.host');olympe.la={};olympe.la.fb={};olympe.la.fb.ce={hm:'POST',GET:'GET',st:'HEAD',ik:'PUT',Hc:'DELETE',bm:'OPTIONS',sA:'PATCH'};olympe.la.fb.ResponseType={vk:'text',pl:'blob',ARRAY_BUFFER:'arraybuffer'};olympe.la.fb.Headers={Hj:'content-type',Wy:'content-length',pi:'authorization',ys:'access-control-allow-origin'};olympe.la.fb.Xy={Tz:'text/html',JSON:'application/json',rC:'application/zip'};olympe.la.fb.qd={Fs:0,Kh:200,vl:201,zj:202,Jy:400,OB:401,it:403,mA:404,gA:405,Hq:500,Mu:503};function Mb(a){return a.host&&encodeURI(a.host)}function Nb(a){return encodeURI(a.path).replace(olympe.la.Ck.C,(b,c)=>'%'+c)}function Ob(a){return void 0===a.G?443===a.port:a.G}olympe.la.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`${Ob(this)?'wss':'ws'}://${Mb(this)}:${this.port}/${Nb(this)}`}toString(){return`${Mb(this)}:${this.port}/${Nb(this)}`}};
355
- olympe.la.Ck.C=/%25([0-9a-f]{2})/i;olympe.la.WebSocket=class{send(){}close(){}qa(){}ka(){}ea(){}};function Pb(a,b,c,d){a=olympe.W.Xx(a.valueOf());if(!a.host&&!a.path)return null;const e=a.scheme?a.scheme.includes('s'):!1;b=new olympe.la.Vj(a.host,a.port||(e?443:80),a.path||'',e,b,c,d,a.query||void 0);a.us&&(c=a.us.split(':'),2===c.length&&(c=olympe.W.bi().C(Da(`${c[0]}:${c[1]}`)),Qb(b,{Authorization:`Basic ${c}`})));return b}function Rb(a){return void 0!==a.query?a.query.replace(/[^=&]+/g,b=>encodeURIComponent(b)):null}
356
- function Qb(a,b){for(let c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a.headers[c]=b[c])}
357
- olympe.la.Vj=class extends olympe.la.Ck{constructor(a,b,c,d,e,f,g,h){super(a,b,c,d);this.method=void 0!==e?e:olympe.la.fb.ce.GET;this.query=h;this.headers={};this.body=f;this.F=void 0!==g?g:olympe.la.fb.ResponseType.vk;this.ca=this.cert=this.key=null;this.rejectUnauthorized=!1}ej(){return this.headers}setHeader(a,b){this.headers[a]=b}C(){let a=Rb(this);a=a?`?${a}`:'';return Mb(this)?`${Ob(this)?'https':'http'}://${Mb(this)}:${this.port}/${Nb(this)}${a}`:`${Nb(this)}${a}`}toString(){return this.C()}};
358
- olympe.la.Vj.ce={hm:'POST',GET:'GET',st:'HEAD',ik:'PUT',Hc:'DELETE',bm:'OPTIONS'};olympe.la.Sg=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}Td(){return this.status}ej(){return this.headers}getHeader(a){return this.headers[a]}};function Sb(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.C(f=>{d.Ie(e);a.F().C.delete(b);c(f)})}olympe.la.ta=class{constructor(a){this.N=a;this.G=1;a='Initializing NET layer';this.N.G()&&(a+=' (implementation: '+this.Y()+')');this.N.info(a);this.N.log('DONE initializing NET layer (ready to receive connection requests)')}F(){}ka(){}C(){}L(){}R(){}Y(){}};function Tb(a){return!(!a.client||!a.client.connected)}function Ub(a,b,c){a.connect();a.client.subscribe(b,void 0,d=>{d?a.N.error(`Failed to subscribe to topic ${b}: ${d}`):a.C.set(b,c)})}function Vb(a,b,c){a.connect();a.client.unsubscribe(b,void 0,c);a.C.delete(b)}
359
- olympe.la.dk=class{constructor(a,b){this.url=a;this.G=b||null;this.client=null;this.F=[];this.C=new Map;this.N=olympe.sa.Ya('MQTT')}connect(a){if(Tb(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.la.dk.C.gu,(b,c)=>{this.C.has(b)?this.C.get(b)(JSON.parse(c.toString())):this.N.warn('There is no subscriber for topic '+b)}),this.client.on(olympe.la.dk.C.Ks,()=>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.N.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.la.dk.C={Ks:'connect',gu:'message',Ty:'close',iz:'end'};olympe.la.Bk=class{constructor(a){this.N=a}ea(){this.N.error('Try to set cors policies on a web server with the browser implementation.');return this}L(){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.la.O={xa:'net.Manager',Ea:'net.Logger',zm:'net.WebServer'};olympe.la.Config={Jl:'net.httpHost',Kl:'net.httpPort',gp:'net.httpSSL'};
361
- olympe.U.config(function(a){const b='object'===typeof window&&window.location&&window.location.hostname||'localhost',c='localhost'===b;E(a,olympe.la.Config.Jl,b);E(a,olympe.la.Config.Kl,c?3141:443);E(a,olympe.la.Config.gp,!c);ta(a,olympe.la.O.xa);C(a,olympe.la.O.Ea,[olympe.sa.O.xa],function(d){return d.Qc('net')});B(a,olympe.la.O.zm,olympe.la.Bk,olympe.la.O.Ea)},'olympe.net');olympe.async={};function Wb(a,b){0<=b&&(a.timeout=b)}function Xb(a,b){a.L||a.sd.push(a.G.C(b))}
362
- olympe.async.Ho=class{constructor(a,b=void 0===a){this.C=[];this.sd=[];this.G=a||new olympe.D.Zb('Async executor context');this.qa=b;this.F=null;this.env=new Map;this.env.set('Executor',this);this.L=this.R=!1;this.N=null;this.Y=this.timeout=0}Ya(){return this.N}add(a){this.L||this.C.push(this.G.C(a));return this}start(){this.R||(this.N&&this.N.log('Executor started.'),this.R=!0,0<this.timeout&&(this.Y=setTimeout(()=>{this.F='Timeout expired.';this.Y=0;this.complete(!1)},this.timeout)))}clear(){this.C=
363
- [];this.sd=[];this.env.clear();this.qa&&this.G.destroy()}complete(a){if(!this.L){this.L=!0;this.Y&&(clearTimeout(this.Y),this.Y=0);this.N&&this.N.log(a?'Executor completed successfully':`Executor completed with error: ${this.F}`);for(const b of this.sd)b(a,a?null:this.F,this.env);this.clear()}}};
364
- function Yb(a){if(0<a.C.length){const b=a.C.shift();a.N&&a.N.log(`Executing next task. ${a.C.length} tasks left in the pipeline.`);a.G.run(()=>{b(()=>{Promise.resolve().then(()=>{Yb(a)})},c=>{c&&(a.F=c);a.complete(!1)},a.env)})}else a.complete(!0)}olympe.async.sk=class extends olympe.async.Ho{static create(){return new olympe.async.sk(new olympe.D.Zb('SequencedExecutor'),!0)}insert(a){this.L||this.C.unshift(a);return this}start(){this.R||(super.start(),Yb(this))}};
365
- olympe.async.ng=class extends olympe.async.Ho{constructor(a,b){super(a,b);this.ea=0;this.ka=!0}static create(){return new olympe.async.ng(new olympe.D.Zb('ParallelExecutor'),!0)}run(a){this.N&&this.N.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.R&&!this.L&&(this.ea++,this.run(a));return this}done(){this.ea--;0>=this.ea&&this.complete(this.ka)}start(){if(!this.R)if(super.start(),0<
366
- this.C.length){this.ea=this.C.length;for(const a of this.C)this.run(a)}else this.complete(!0)}};olympe.ic={};olympe.ic.Wt=class{constructor(){}set(){}get(){}forEach(){}remove(){}clear(){}close(){}};olympe.ic.Vt=class{constructor(){}C(){}};olympe.ic.Storage=class{open(){}F(){}R(){}write(){}G(){}L(){}C(){}close(){}};function Zb(a,b,c){a.storage.F(c)}function $b(a,b,c,d,e){a.storage.write(b,'transactions',c.toJSON(),'text/json',d,e)}function ac(a,b){a.storage.G(b)}function bc(a,b){a.storage.C(b)}function cc(a,b,c,d,e,f){a.storage.write(b,'files',c,d,()=>{e('files/'+b)},f)}function dc(a,b){a.storage.R(b)}olympe.ic.Xs=class{constructor(a){this.storage=a}};olympe.ic.O={$j:'localStorage.KeyValueManager',Ni:'localStorage.Storage',qo:'localStorage.DatacloudStorage',Ea:'localStorage.Logger'};olympe.U.config(function(a){ta(a,olympe.ic.O.$j);C(a,olympe.ic.O.Ea,[olympe.sa.O.xa],function(b){return b.Qc('localstorage')});B(a,olympe.ic.O.qo,olympe.ic.Xs,olympe.ic.O.Ni)},'olympe.localstorage');olympe.auth={};olympe.auth.Uu=class{R(){}L(){}Y(){}cb(){}ka(){}ii(){}oh(){}Qr(){}};function ec(a){a.N.info('Initializing AUTH layer');let b=a.lc;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.na()))}b&&a.storage&&fc(a.storage,b,c=>{!c&&a.N.error('Could not store authToken')});a.N.debug('Asking to be notified when auth connector gets online');a.F.R(()=>{if(a.$a)if(a.L=olympe.auth.ta.G.ws,a.N.log('Connector online, parameter auth.autoLogin=true --\x3e attempting to log with parameters'),a.Y){const c=new olympe.auth.Request;c.set('username',
367
- a.Y);c.An(a.Ab);a.N.log('Autologin with user "'+a.Y+'"');gc(a,c)}else a.N.error('autoLogin: auto user not specified.'),hc(a);else a.L=olympe.auth.ta.G.wk,a.N.log('Connector online, attempting to log with token'),a.Ta()});a.F.L(()=>{switch(olympe.D.Za(a.G)){case olympe.auth.ta.C.Lg:a.N.warn('Disconnected from server - session of user '+olympe.D.Za(a.C.Eb()).Ud()+' lost');break;case olympe.auth.ta.C.Dh:a.N.warn('Disconnected from server - guest session lost');break;case olympe.auth.ta.C.ni:a.N.warn('Disconnected from server - authentication aborted');
368
- break;case olympe.auth.ta.C.INIT:a.N.warn('Cannot open auth session - no server connection');break;default:a.N.error('Should not get there, investigate')}ic(a,olympe.auth.ta.C.gf)});a.F.Y(a.Ta.bind(a));a.F.cb((c,d)=>{if(c===olympe.auth.ta.F.zj)a.N.info('Authentication revoked'),hc(a),a.storage&&jc(a.storage),a.qa.forEach(e=>{e(c,d)});else if(c===olympe.auth.ta.F.jp)a.N.info('Redirection to IDP to invalidate token (SAML)'),a.storage&&jc(a.storage),a.cb.F();else throw Error(`Unknown logout step coming from server : ${c}`);
369
- });a.N.log('DONE initializing AUTH layer (waiting for connector to be online)')}function ic(a,b){a.N.log('State change: ',kc(a),'--\x3e',b);a.G.update(b)}function hc(a){a.C.update(a.Fa);ic(a,olympe.auth.ta.C.Dh);a.N.info('Authenticated as guest')}function kc(a){return olympe.D.Za(a.G.Eb())}
370
- function lc(a){const b=olympe.auth.ta.C.Lg,c=olympe.auth.ta.C.Dh,d=olympe.auth.ta.C.ni,e=olympe.D.Nc(olympe.D.ra,'auth.isOnline');olympe.D.yc([a.G],f=>{e.update(olympe.D.Bc(f===b||f===c||f===d))},'Router is online');return e.Eb()}function mc(a){var b=olympe.public.Ua.get(),c='logoutCallback';void 0===c&&(c=olympe.W.xg());b.qa.set(c,a)}function nc(a){return a.C.Eb().Jf()}
371
- function oc(a,b,c,d=!1){b=b+c?':'+c.message:'';a.N.error(b);a.error.update(olympe.D.Cb(b));ic(a,olympe.auth.ta.C.tc);if(d)throw Error(b);}function gc(a,b,c,d){void 0===c&&(c=a.Tb);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.R.set('login',d);a.N.log('Sending authentication request using "'+c+'" for '+b);e.hd(b,a.cc.bind(a));ic(a,olympe.auth.ta.C.ni)}
372
- function pc(a,b,c){a.R.forEach(d=>{d(b,c)})}
373
- olympe.auth.ta=class{constructor(a,b,c,d,e,f,g,h,k,l,n,p){this.N=a;this.F=b;this.storage=c;this.cb=d;this.ka=e;this.Tb=g;this.Pb=h;this.$a=void 0===k?!0:k;this.Y=l;this.Ab=n;this.lc=p;this.Hb=new Map;this.G=olympe.D.Nc(String).update(olympe.auth.ta.C.INIT);this.error=olympe.D.Nc(olympe.D.Xa);this.L=null;this.Fa=new olympe.auth.tf('guest','0163d9653067b6237f62','e96e099c-55bb-4004-b0e8-bd76b6209218');this.C=olympe.D.Nc(olympe.auth.tf).update(this.Fa);this.R=new Map;this.qa=new Map;f.forEach(q=>{const r=
374
- q.na();if(this.Hb.has(r))throw Error('Provider "'+r+'" has already been registered !');this.Hb.set(r,q)});ec(this)}getState(){return this.G.Eb()}ea(){return this.error.Eb()}Ud(){return this.C.Eb().Ud()}Cg(){return this.C.Eb().Cg()}ci(){return this.C.Eb().ci()}oh(a,b){this.F.oh(a,olympe.D.Za(nc(this)),b)}tn(){this.N.debug('Sending logout');jc(this.storage);this.F.ka(a=>{a?oc(this,'Logout request rejected:',a):this.N.debug('Logout request acknowledged')})}ii(){kc(this)===olympe.auth.ta.C.Lg&&this.F.ii(a=>
375
- {a&&this.N.error('Was not able to send the auth keep alive message:',a.message)})}Ta(){null!==this.storage?(this.N.debug('Retrieving token from local storage'),this.storage.hd(a=>{if(a){const c=new olympe.auth.Request;var b=a.Ud();c.set('username',b);a=a.Jf();c.set('nonce',a);this.N.debug('Token found, trying login with',c);gc(this,c,this.Pb)}else this.N.debug('No token found, cannot perform auto login. Falling back in GUEST state'),hc(this)})):(this.N.error('Cannot retrieve token: no storage configured, cannot perform auto login. Falling back in GUEST state'),
376
- hc(this))}cc(a,b){const c=null===this.L?olympe.auth.ta.G.du:this.L;this.L=null;a?(this.N.warn('Authentication rejected: '+a.message+'. Falling back into GUEST state'),jc(this.storage),this.error.update(olympe.D.Cb(a.message)),hc(this),pc(this,a,c)):(this.N.info('User '+b.Ud()+' (#'+b.Cg()+') successfully authenticated'),this.C.update(b),ic(this,olympe.auth.ta.C.Lg),pc(this,a,c),this.storage&&fc(this.storage,b));this.R.has('login')&&this.R.delete('login')}};
377
- olympe.auth.ta.C={INIT:'init',gf:'disconnected',Dh:'guest',ni:'authenticating',tc:'error',Lg:'authenticated'};olympe.auth.ta.G={du:'manual',ws:'auto',wk:'tokenOnFirstConnection'};olympe.auth.ta.F={zj:'accepted',jp:'redirect'};olympe.auth.Ki=class{na(){}hd(){}};olympe.auth.Request=class{constructor(){this.C=new Map}set(a,b){olympe.D.yc([b],c=>{this.C.set(a.toLocaleLowerCase(),c.toString())})}get(a){(a=this.C.get(a.toLowerCase()))&&a.xf&&(a=a.Na.Ib);return a?a.valueOf():a}Ud(){return this.get('username')}An(a){this.set('password',a)}Jf(){return this.get('nonce')}toString(){return this.Ud()+(this.Jf()?' with nonce':'')+(this.get('password')?' with password':'')}};olympe.auth.tf=class{constructor(a,b,c,d={}){this.user=a;this.yj=b;this.F=c;this.G=d}Ud(){return this.user}Cg(){return this.yj}Jf(){return this.F}Yj(){return this.G}ci(){return null}ia(){var a=olympe.W,b=a.yr;var c=JSON.stringify({user:this.user,userTag:this.yj,nonce:this.F,payload:this.G});c=olympe.W.bi().C(Da(c));return b.call(a,c)}};m=olympe.auth.tf.prototype;m.Ud.K=new olympe.D.J(()=>String,[]);m.Cg.K=new olympe.D.J(()=>String,[]);m.Jf.K=new olympe.D.J(()=>String,[]);
378
- m.Yj.K=new olympe.D.J(()=>Object,[]);m.ci.K=new olympe.D.J(()=>String,[]);m.ia.K=new olympe.D.J(()=>String,[]);olympe.auth.fm=class extends olympe.auth.tf{constructor(a,b,c,d){super(a,b,c,d)}ci(){return this.Yj().access_token||null}};olympe.auth.Fq=class extends olympe.auth.tf{constructor(a,b,c,d){super(a,b,c,d);this.C=null}ci(){return this.C}ia(){var a=olympe.W.bi(),b={user:this.Ud(),userTag:this.Cg(),nonce:this.Jf(),payload:this.Yj(),fullToken:this.C},c=olympe.W,d=c.yr;b=JSON.stringify(b);a=a.C(Da(b));return d.call(c,a)}};function fc(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.vm=class{constructor(a,b,c){this.C=a;this.N=b;this.key='OlympeToken-'+c.C}hd(a){const b=this.C.C('AUTH');this.N.debug(`olympe.auth.TokenStorage: retrieve token with key ${this.key}`);b.get(this.key,c=>{let d=null;if(c)try{this.N.debug('olympe.auth.TokenStorage: Token retrieved successfully');{var e=JSON,f=e.parse;var g=Ea(olympe.W.bi().R(olympe.W.Cv(c)));const h=f.call(e,g);if(h.fullToken){const k=new olympe.auth.Fq(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.fm(h.user,h.userTag,h.nonce,h.payload):new olympe.auth.tf(h.user,h.userTag,h.nonce,h.payload)}}catch(h){this.N.error('Error while unserializing token: ',h.message)}else this.N.debug('olympe.auth.TokenStorage: No token found');b.close();a(d)})}};olympe.auth.vm.F='OlympeToken';olympe.auth.vm.C='AUTH';olympe.auth.pk=class{redirect(){}F(){}C(){}};olympe.auth.pk.C={GET:'GET',hm:'POST'};olympe.auth.nl=class{constructor(a){this.C=a||'default'}};olympe.auth.Hb={};olympe.auth.Hb.pa={};olympe.auth.Hb.pa.Fi=class{ea(){}};olympe.auth.Hb.pa.Re=class{qa(){}};olympe.auth.Hb.pa.Ee=class{Fa(){}Ta(){}};function qc(a,b){return olympe.W.ob(b+'-olympe-'+a.C[b])}olympe.auth.Hb.Ei=class{constructor(a){this.C=a}na(){return'local'}hd(a,b){const c=a.Ud();if(c){const d=a.get('password'),e=a.Jf();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.ob(d||'');if(this.C[c]===a){b(null,new olympe.auth.tf(c,'',qc(this,c)));return}}b(Error('Invalid login'))}};olympe.auth.Hb.Ei.C='local';olympe.auth.Hb.Ei.ma=[olympe.auth.Ki];olympe.auth.Hb.Fi=class{constructor(a,b){this.C=a;this.storage=b}na(){return'localToken'}hd(a,b){this.storage.hd(c=>{this.C.ea(a,(d,e)=>{b(d,e||c)})})}};olympe.auth.Hb.Fi.C='localToken';olympe.auth.Hb.Fi.ma=[olympe.auth.Ki];olympe.auth.Hb.em=class{constructor(a,b){this.C=a;this.F=b}na(){return'openID'}hd(){const a=this.C.C();this.C.redirect(`${this.F}/auth?url=${a}`,null,olympe.auth.pk.C.GET)}};olympe.auth.Hb.em.C='openID';olympe.auth.Hb.em.ma=[olympe.auth.Ki];olympe.auth.Hb.Re=class{constructor(a,b){this.F=a;this.C=b}na(){return'saml'}hd(a,b){this.F.qa(c=>{c?b(c):this.C.F()})}};olympe.auth.Hb.Re.C='saml';olympe.auth.Hb.Re.ma=[olympe.auth.Ki];olympe.auth.Hb.Ee=class{static $i(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.N=olympe.sa.Ya('auth')}na(){return'srp'}hd(a,b){const c=a.get('password');a.C.delete('password');this.N.debug('Sending SRP request');this.C.Fa(a,(d,e,f)=>{this.N.debug('Received Salt+B message');if(d)b(d);else{try{const g=new SRPClient;g.step1(a.Ud(),c);const h=g.step2(e,f);a.set('a',h.A);a.set('m1',h.M1)}catch(g){b(g);
381
- return}this.N.debug('Sending SRP A+M (proof) message');this.C.Ta(a,b)}})}};olympe.auth.Hb.Ee.C='srp';olympe.auth.Hb.Ee.ma=[olympe.auth.Ki];olympe.auth.O={xa:'auth.Manager',Ea:'auth.Logger',Ni:'auth.Storage',Aj:'auth.appNameToken',kk:'auth.Redirector'};olympe.auth.wd={xa:'auth.ManagerConnector',Ep:'auth.LocalTokenConnector',Ee:'auth.SRPConnector',Re:'auth.SAMLConnector'};olympe.auth.Config={zl:'auth.defaultProvider',Fp:'auth.localTokenProvider',Jn:'auth.autoLogin',Nn:'auth.autoUser',Kn:'auth.autoPassword',wk:'auth.token',Hn:'auth.appToken'};
382
- olympe.U.config(function(a){E(a,olympe.auth.Config.zl,'srp');E(a,olympe.auth.Config.Fp,'localToken');E(a,olympe.auth.Config.Jn,!1);E(a,olympe.auth.Config.Nn,'');E(a,olympe.auth.Config.Kn,'');E(a,olympe.auth.Config.wk,'');E(a,olympe.auth.Config.Hn,'default');C(a,olympe.auth.O.Ea,[olympe.sa.O.xa],b=>b.Qc('auth'));B(a,olympe.auth.O.Aj,olympe.auth.nl,new olympe.U.fa(olympe.auth.Config.Hn));B(a,olympe.auth.O.Ni,olympe.auth.vm,olympe.ic.O.$j,olympe.auth.O.Ea,olympe.auth.O.Aj);ta(a,olympe.auth.wd.xa);ta(a,
383
- olympe.auth.O.kk);C(a,olympe.auth.O.xa,[olympe.auth.O.Ea,olympe.auth.wd.xa,olympe.host.O.Il,new olympe.U.Bb(olympe.auth.O.Ni,olympe.U.ff.C.Jh),new olympe.U.fa(olympe.auth.Config.zl),new olympe.U.fa(olympe.auth.Config.Fp),new olympe.U.fa(olympe.auth.Config.Jn),new olympe.U.fa(olympe.auth.Config.Nn),new olympe.U.fa(olympe.auth.Config.Kn),new olympe.U.fa(olympe.auth.Config.wk),new olympe.U.Bb(olympe.auth.O.kk,olympe.U.ff.C.Jh),new olympe.U.Bb(olympe.auth.wd.Ep,olympe.U.ff.C.Jh),new olympe.U.Bb(olympe.auth.wd.Ee,
384
- olympe.U.ff.C.Jh),new olympe.U.Bb(olympe.auth.wd.Re,olympe.U.ff.C.Jh)],(b,c,d,e,f,g,h,k,l,n,p,q,r,t)=>{const u=[];q&&u.push(new olympe.auth.Hb.Fi(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.em(p,c.Qr()));if(0===u.length)throw Error('At least one provider is needed for auth to start');if(!u.map(v=>v.na()).includes(f))throw Error('Default provider name'+f+'given by parameter'+olympe.auth.Config.zl+'cannot be found');return new olympe.auth.ta(b,
385
- c,e,p,d.lj()?d:null,u,f,g,h,k,l,n)},!0)},'olympe.auth');olympe.U.run([olympe.auth.O.xa],a=>{olympe.auth.Tc=()=>a});olympe.dc={};olympe.dc.Aa={ORIGIN:'<',DESTINATION:'>'};z('olympe.dc.Direction',olympe.dc.Aa);olympe.dc.jc={Wc:'ff022000000000000000',ui:'ff02200000000000000e',eo:'ff02200000000000000f'};olympe.dc.bc={VERSION:'@v',Nd:'@s'};olympe.dc.Tg={rc:'?'};olympe.dc.tk={Yp:'online',$l:'offline',yt:'invalidate'};olympe.dc.Ka={rb:'self',Xc:'server',hq:'peer',rc:'server'};olympe.dc.wa=function(a){if('string'===typeof a)return a;let b=null;a=olympe.D.Za(a);void 0!==a&&null!==a&&(a=a.valueOf(),'string'===typeof a?b=a:a.T?b=a.T():'function'===typeof a&&(b=olympe.dc.Ca.Wb(a)));return b||''};z('olympe.dc.instanceToTag',olympe.dc.wa);olympe.dc.Pa=function(){return olympe.dc.Dd().view};olympe.dc.register=function(a,b){olympe.dc.Ca.C(a,b)};olympe.dc.defineProperty=function(a){return new olympe.dc.va.Property(a)};
386
- olympe.dc.ih=function(a,b=olympe.dc.Aa.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.Aa.DESTINATION){const e=olympe.dc.Aa.DESTINATION;return b===olympe.dc.Aa.ORIGIN||b===e?new olympe.dc.va.Relation(a,b):new olympe.dc.va.Relation(a,d,b,c)};olympe.dc.Ov=function(a){return a.Sc()};olympe.dc.eh=class{F(){}qc(){}Mc(){}Oa(){}Jb(){}};olympe.dc.jm=class{$c(){}Z(){}G(){}};function rc(a,b,c,d,e,f,g){d=new olympe.dc.ga(olympe.dc.ga.ja.Sh,{file:b,url:null,content:c,Ze:e?h=>{sc(a,b,c);f(h)}:f,mimeType:d,ue:g||null},[olympe.dc.Pa().source(b)||olympe.dc.Ka.Xc]);a.F.send(d)}function tc(a,b,c,d,e,f){c=c instanceof olympe.D.Xa?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.wa(b);a.C.set(d,c);const e=olympe.W.xg();uc(olympe.dc.Pa(),d,f=>{f||(a.C.delete(d),vc(olympe.dc.Pa(),d,e))},e)}function wc(a,b,c,d){olympe.D.ds([b.Wr(),b.T(),b.Ql(),b.en()],(e,f,g,h)=>{a.C.has(f)?c(a.C.get(f)):(e=new olympe.dc.ga(olympe.dc.ga.ja.Ah,{file:f,url:e.valueOf()?null:g,mimeType:h.valueOf(),Ze:a.G?k=>{sc(a,f,k);c(k)}:c,ue:d},[olympe.dc.Pa().source(f)||olympe.dc.Ka.Xc]),a.F.send(e))})}
388
- olympe.dc.lt=class{constructor(a,b,c,d,e){this.N=a;this.F=c;this.G=e;this.C=new Map}};olympe.dc.ta=class{constructor(a){this.N=a}};function xc(a,b){a.F=b;return a}function M(a,b){a.G.unshift(b);return a}olympe.dc.ga=class{constructor(a,b,c){this.type=a;this.content=b;this.C=c;this.G=[];this.F=olympe.D.Ia()}validate(a=null){this.G.forEach(b=>{b(a||null)})}toString(){const a=olympe.W.Nr(olympe.dc.ga.ja,this.type);return a?a:'UNKNOWN_MESSAGE'}};
389
- olympe.dc.ga.ja={tc:1,nf:2,Rg:10,Rz:11,Pu:20,ZA:21,$A:22,Ru:23,xi:24,wi:25,Sz:26,Vo:28,mm:30,om:31,yu:32,bh:40,xk:41,Og:45,Fj:46,Pj:47,Sh:50,Ah:51,ti:52,ev:60,Eu:61,nt:62,ot:63,Is:64,Un:65,Qz:90,yl:91,Hl:92,Wo:93,Ap:94,ek:95,Qu:96,QUERY_RESULT:97,nm:98};olympe.dc.og=class{process(){}};olympe.dc.km=class{constructor(...a){this.Xb=a}process(a,b,c){const d=this.Xb.length,e=(f,g,h)=>{g||f>=d?c(g,h):this.Xb[f].process(a,h,e.bind(null,f+1))};e(0,null,b)}};olympe.dc.km.ma=[olympe.dc.og];olympe.dc.Ec=class{constructor(a){this.tag='string'===typeof a?a:a.T()}T(){return this.tag}toJSON(){return'{ "type": "reference", "tag": '+JSON.stringify(this.tag)+' }'}sb(a){return a instanceof olympe.dc.Ec&&this.tag===a.tag}static mc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.dc.Ec(b.tag)}};olympe.dc.Ec.ma=[olympe.dc.ze];olympe.dc.Ec.prototype.toJSON.K=olympe.D.J.C;olympe.dc.Ec.prototype.sb.K=olympe.D.J.C;olympe.dc.pg=class{send(){}C(){}qa(){}};const yc=olympe.dc.Aa.ORIGIN,zc=olympe.dc.Aa.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.Cn||[])];return olympe.dc.Ca.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.T()+'@'+a.Qa();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.Ca=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.U.Bb(g):g}}b=new olympe.dc.va.Entry(a,b,d);Ac.set(a,b);return b.C.entry=b}static Wb(a){return(a=a.entry)&&a.T()||null}};olympe.dc.va={};function P(a,b){b=b.Sc();Hc(b.T(),b.Qa(),a.C);return b}function Jc(a){a.F=!0;return a}
392
- olympe.dc.va.Entry=class{constructor(a,b,c){this.tag=a;this.C=b;this.Cn=c||null;this.F=!1}T(){return this.tag}instantiate(a,b){const c=this.C;if(this.ij()&&b.getParameter(olympe.dc.Config.Co)){var d=olympe.dc.Pa();d=`Trying to instantiate an abstract class ${d.name(this)} (${this.T()}).`+` This may happen when the implementation of another class extending ${d.name(this)} has not been registered`;olympe.sa.Ya('dc').error(d)}return this.Cn?(a=[void 0,a].concat(na(b,this.Cn)),new c(...a)):new c(void 0,
393
- a)}Da(a){return new olympe.dc.va.Property(a)}Ra(a,b=olympe.dc.Aa.DESTINATION){Hc(a,b,this.C);return new olympe.dc.X.Sb(a,b)}ij(){return this.F}};z('olympe.dc.registry.Entry',olympe.dc.va.Entry);olympe.dc.va.Entry.prototype.addRelation=olympe.dc.va.Entry.prototype.Ra;olympe.dc.va.Entry.prototype.addProperty=olympe.dc.va.Entry.prototype.Da;olympe.dc.va.Entry.ma=[olympe.dc.ze];olympe.dc.va.Property=class{constructor(a){this.tag=a}T(){return this.tag}};olympe.dc.va.Property.ma=[olympe.dc.ze];olympe.dc.va.Relation=class{constructor(a,b=olympe.dc.Aa.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.CloudObject){this.tag=olympe.dc.wa(a);this.direction=b;this.origin=c;this.destination=d}T(){return this.tag}Qa(){return this.direction}type(){return this.destination}Sc(){return new olympe.dc.va.Relation(this.tag,this.direction===olympe.dc.Aa.DESTINATION?olympe.dc.Aa.ORIGIN:olympe.dc.Aa.DESTINATION,this.destination,this.origin)}sb(a){return a instanceof olympe.dc.va.Relation?a.T()===this.T()&&
394
- a.Qa()===this.Qa():!1}toString(){return this.direction+this.tag}};olympe.dc.va.Relation.prototype.getInverse=olympe.dc.va.Relation.prototype.Sc;olympe.dc.va.Relation.prototype.getDirection=olympe.dc.va.Relation.prototype.Qa;olympe.dc.va.Relation.prototype.getTag=olympe.dc.va.Relation.prototype.T;olympe.dc.va.Relation.ma=[olympe.dc.ze];olympe.dc.db={};function Kc(a,b,c,d,e,f=olympe.dc.Ka.rb){const g=c.Z();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.Ja.Ta(b)}function Pc(a,b,c){b&&a.Ja.lc(b);c&&a.Ja.Lc(c)}
395
- olympe.dc.db.Zs=class{constructor(a,b,c,d,e){this.N=a;this.Ja=b;this.C=new olympe.dc.db.Os(a,b,d);this.view=new olympe.dc.jb(a,b);this.Dx=new olympe.dc.db.ju(this.N,this.view,b,e)}Ya(){return this.N}persist(a){this.Ja.Fa();this.Ja.Ab(a,olympe.dc.db.Instance.C.kq);this.Ja.qa()}af(a,b){this.C.af(a,b)}};const Qc=olympe.dc.bc.VERSION,Rc=olympe.dc.bc.Nd,Sc=olympe.dc.jc.Wc,Tc=olympe.dc.jc.ui;
396
- olympe.dc.db.Database=class a extends Map{constructor(b,c){super();this.id=olympe.W.fc();this.N=b;this.Tb=olympe.D.Ia();this.Ge=c.get('defaultSource')||olympe.dc.Ka.rb;this.R=olympe.dc.db.Database.F.IDLE;this.ka=new Map;this.Pb=[];this.G=[];this.$a=new Map;b=c.get('garbageCollector')||olympe.dc.db.yi.C.Bl;new olympe.dc.db.yi(this,b,this.Tb);c.get('debug')&&this.Vf()}Z(){return this.id}getState(){return this.R}Ya(){return this.N}create(b,c){const d=this.L(b,!0);d.cc(c&&parseInt(c.get(Qc),10)||1);d.ki(c&&
397
- c.get(Rc)||this.Ge);c&&(c.delete(Qc),c.delete(Rc),this.td(d,c));this.C(a.C.tp,b)}update(b,c,d=!1){if(void 0!==c&&null!==c){b=this.L(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.td(b,c))}}Mc(b){const c=this.get(b);void 0!==c&&(this.cb(c,!1),this.C(a.C.up,b))}link(b,c,d){c=this.L(c,!0);d=this.L(d,!0);switch(b){case Sc:c.Of(d);break;case Tc:c.Ge(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.$k(d);break;case Tc:c.uh(d);break;default:c.unlink(b,d)}}lc(b){for(const c of b)this.L(c).ea()}Lc(b){for(const c of b)(b=this.get(c))&&b.ka()}Ab(b,c){b.forEach(d=>{this.L(d).Wf(c)})}cc(b){const c=this.get(b);void 0!==c&&(c.clear(),super.delete(b),this.C(a.C.Bo,b))}L(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.Ao,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,
399
- h=olympe.dm.Relation.C.mk,k=olympe.dc.Aa.ORIGIN,l=olympe.dc.Aa.DESTINATION,n=a.hc.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(([A])=>{r.set(A,!1)})})}.bind(this,b)}}Pc(b){this.G[0].Te(olympe.W.xg(),b)}ea(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)})}cb(b,c){this.$a.set(b,c)}Of(b,c,d,e){0<this.G.length&&Uc(this.G[0],b).Da(e?Vc+c:c,d)}Pf(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).$a(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)}Ta(b){this.Pb.push(b)}ee(b){return this.G.reduce((c,d)=>d.G.has(b)||c,!1)}Fa(){this.R===a.F.IDLE&&(this.R=a.F.Cs);this.G.unshift(new olympe.dc.db.dt(this,
401
- this.Tb))}qa(){this.R=a.F.bg;this.Wf();Xc(this.G[0]);this.G.shift();0===this.G.length&&(this.R=a.F.IDLE,this.Pb.forEach(b=>{b()}))}td(b,c){const d=a.hc.rc;for(const [e,f]of c)void 0!==f&&(e[0]===d?b.bl(e.substr(1),f):b.update(e,f))}Wf(){const b=a.hc.ORIGIN,c=this.$a,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.td(g)&&(h=h.tag(),g?Uc(f,h).create():Uc(f,h).delete())});
402
- this.$a.clear()}Vf(){const b=a.hc.DESTINATION,c=a.C.Dl,d=a.C.lk,e=new Set,f=new Map;this.F(a.C.tp,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.Ta(()=>{e.forEach(g=>{const h=this.get(g);h&&null===h.model()&&this.N.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.N.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.hc={Nh:'$',wt:'~',rc:'?',ll:'=',$n:'@',ORIGIN:olympe.dc.Aa.ORIGIN,DESTINATION:olympe.dc.Aa.DESTINATION};olympe.dc.db.Database.C={Ao:0,Bo:1,dr:2,zk:3,ao:4,bo:5,Dl:6,Hc:7,lk:8,qm:9,tp:10,up:11,wq:12};olympe.dc.db.Database.F={IDLE:0,Cs:1,bg:2};const Q=olympe.dc.db.Database.C,Yc=olympe.dc.db.Database.hc.Nh,Zc=olympe.dc.db.Database.hc.wt,$c=olympe.dc.db.Database.hc.rc,ad=olympe.dc.db.Database.hc.ll,bd=olympe.dc.db.Database.hc.$n,R=olympe.dc.Aa.ORIGIN,S=olympe.dc.Aa.DESTINATION,cd=olympe.dc.jc.Wc,dd=olympe.dc.jc.ui;
404
- olympe.dc.db.Instance=class a extends Map{constructor(b,c){super();this.C=b;this.Lc=olympe.dc.Ka.rb;this.e=!1;this.Tb=0;this.F=void 0;this.c=0;this.Fa=a.C.kq;this.db=c}tag(){return this.C}Gb(){return this.e}Pb(){return this.db.ee(this.C)}source(){return this.Lc}version(){return this.Tb}model(){const b=this.get(S+cd);return b&&b.values().next().value||null}Af(){const b=this.get(S+dd);return b&&b.values().next().value||null}persisted(){return this.Fa!==a.C.mr}toString(){var b=this.gb(olympe.dc.CloudObject.nameProp.T());
405
- b=`Instance: ${this.C}, Exist: ${this.e}, Name: ${b}`;var c=this.model();if(c){var d=c.gb(olympe.dc.CloudObject.nameProp.T())||'No model name';b+=`\nModel: ${c.C}, Exist: ${c.e}, Model name: ${d}`}else b+='\nModel: no model';(c=this.Af())?(d=c.gb(olympe.dc.CloudObject.nameProp.T())||'No extension name',b+=`\nExtension: ${c.C}, Exist: ${c.e}, Extension name: ${d}`):b+='\nExtension: no extension';return b}gb(b,c=!1){const d=this.get(Yc+b);return c||void 0!==d?d:this.get(ad+b)}Ta(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.sb?f.sb(c):f===c)||(e instanceof olympe.dc.Ec&&(this.db.get(e.T()).Pc(),this.db.Mc(e.T())),c instanceof olympe.dc.Ec&&(e=this.db.L(c.T(),!0),e.F&&e.F.tag!==this.C&&this.db.Ya().fatal('Instance',c.T(),'referenced multiple times!\nThis instance is currently property of',e.F.tag,'(for the property '+e.F.mb+')','and is assigned as a property of',this.C,'(for the property '+
407
- b+')'),e.th(this.C,b)),e=ad+b,null===c?(this.delete(d),c=(c=this.model())&&c.Ta(b),void 0!==c?(this.set(e,c),this.L(b,c,!0)):this.L(b,null,!1)):(this.set(d,c),this.delete(e),this.L(b,c,!1)))}bl(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.Af())&&c.Ta(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+
408
- 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.$a(S+b,c.C)&&(c.$a(d,this.C),this.db.C(Q.qm,this.C,b,S,c.C),this.db.C(Q.qm,c.C,b,R,this.C),this.e&&c.e&&(this.G(b,S,c,!1),c.G(b,R,this,!1)))}Of(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.cb(e.substr(1),d)});
409
- (b.e||b===this)&&this.db.cb(this,!0)}$k(b){this.unlink(cd,b);this.forEach((c,d)=>{this.cb(d.substr(1),null)});this.db.cb(this,!1)}Ge(b){const c=this.Af();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.Y(d)}uh(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.Y(c)}lc(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.ea():g.ka());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.ea(),this.db.C(Q.ao,this.C,b,c))}R(b,c){const d=this.$a(bd+b,c);void 0!==d&&(this.ka(),this.db.C(Q.bo,this.C,b,c));return d}ki(b){this.Lc=b}cc(b){this.Tb=b}Wf(b){this.Fa=b;this.qa()||this.db.C(Q.zk,this.C)}td(b){const c=this.e!==b;c&&(b?(this.e=b,this.Vf()):(this.Pf(),this.e=b),this.ee(b));return c}ea(){this.c++;1===this.c&&this.db.C(Q.dr,this.C)}ka(){0<
411
- this.c?--this.c:this.db.C(Q.wq,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)}qa(){return 0<this.c||this.Fa===olympe.dc.db.Instance.C.lq}clear(){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=>{const h=
412
- g.get(f+e);h.delete(this.C);0===h.size&&g.delete(f+e)})}d===Yc&&b instanceof olympe.dc.Ec&&this.db.get(b.T()).Pc()});void 0!==this.F&&this.db.get(this.F.tag).delete(Yc+this.F.mb)}th(b,c){void 0===this.F&&this.ea();this.F={tag:b,mb:c}}Pc(){void 0!==this.F&&(this.ka(),this.F=void 0)}Vf(){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.L(c.substr(1),b,d===ad)})}Pf(){this.forEach((b,c)=>
413
- {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.Tb=0;if(void 0!==this.F){const b=this.db.get(this.F.tag),c=b.get(Yc+this.F.mb);c&&c.T&&c.T()===this.C&&b.update(this.F.mb,null)}}ee(b){this.db.C(b?Q.Dl:Q.Hc,this.C)}L(b,c,d){this.e&&this.db.Of(this.C,b,c,d)}G(b,c,d,e){this.db.Pf(this.C,b,c,d.C,e)}Y(b,c=[]){var d=this.get(R+cd);void 0!==d&&d.forEach(e=>{b.forEach((f,g)=>e.cb(g,f))});
414
- 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.Y(g,[...c,f])}})}cb(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.L(b,c,null!==c))}}Ab(b){let c=this.get(b);void 0===c&&(c=new Map,this.set(b,c));return c}$a(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={mr:0,lq:1,kq:2};const Wc=olympe.dc.db.Database.hc.DESTINATION,Vc=olympe.dc.db.Database.hc.ll,ed=olympe.dc.db.Database.hc.Nh,fd=olympe.dc.db.Database.hc.$n,gd=olympe.dc.db.Database.hc.ORIGIN+Wc,hd=ed+ed;
416
- function Xc(a){const b=a.Ja;a.F.forEach((c,d)=>{const e=b.get(d);if(c.te()||c.L()){var f=e.get(fd);f&&id(a,f,c.te(),d);c.L()&&a.G.add(d)}for(const [l,n]of c.vd()){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.Ta())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.kg(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.L.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.Ja=a;this.L=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.Bo,c=olympe.dc.db.Database.C.Dl,d=olympe.dc.db.Database.C.Hc,e=olympe.dc.db.Database.C.lk,f=olympe.dc.db.Database.C.qm,g=olympe.dc.db.Database.C.ao,h=olympe.dc.db.Database.C.bo,k=()=>{};a.Ja.F(olympe.dc.db.Database.C.Ao,()=>{});a.Ja.F(b,()=>{});a.Ja.F(c,l=>{a.Ja.Pc(()=>{md(a.view,l,k,`monitorRelations${l}`)})});a.Ja.F(d,l=>{a.Ja.Pc(()=>{nd(a.view,l,`monitorRelations${l}`)})});a.Ja.F(e,()=>{});a.Ja.F(f,()=>{});a.Ja.F(g,()=>{});a.Ja.F(h,()=>{})}
419
- olympe.dc.db.ju=class{constructor(a,b,c,d){this.N=a;this.view=b;this.Ja=c;d&&ld(this)}debug(a){const b=olympe.dc.wa(a);if(this.Ja.has(b)){var c=this.Ja.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.Ja.get(d[d.length-1]);const e=olympe.dc.db.Database.hc.Nh+olympe.dc.CloudObject.nameProp.T();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.N.info(a)}else this.N.info('[DATABASE] Instance',b,'has never been created or referred by the database')}};olympe.dc.db.yi=class a{constructor(b,c,d){this.N=b.Ya();this.Ja=b;this.F=new Set;this.mode=c;this.L=d;this.C=!1;c!==a.C.Bl&&this.R()}run(){if(!this.C)switch(this.mode){case a.C.vs:this.C=!0;this.L.run(()=>{Ib(()=>{this.G();this.C=!1},0)});break;case a.C.Qq:this.C=!0,this.G(),this.C=!1}}G(){const b=this.Ja,c=olympe.dc.Ub.rf,d=this.F,e=h=>b.get(h);var f=h=>!(h.persisted()||h.qa());for(var g of d){const h=b.get(g);if(h&&!h.qa()){if(!h.persisted())continue;Array.from(b.Y(g,c,!1,f)).forEach(k=>{d.add(k)});
421
- b.cc(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.qa())?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.cc(k)});d.clear()}R(){this.Ja.Ta(this.run.bind(this));const b=olympe.dc.db.Database.C.dr,c=olympe.dc.db.Database.C.up,d=olympe.dc.db.Database.C.wq,e=olympe.dc.db.Database.F.IDLE,f=g=>{this.F.add(g);this.Ja.getState()===e&&this.run()};this.Ja.F(olympe.dc.db.Database.C.zk,
422
- f.bind(this));this.Ja.F(c,f.bind(this));this.Ja.F(b,g=>{this.F.delete(g)});this.Ja.F(d,(g,...h)=>{this.N.error(h[0])})}};olympe.dc.db.yi.C={Bl:0,Qq:1,vs:2};const od=olympe.dc.db.Database.hc.ORIGIN,pd=olympe.dc.db.Database.hc.DESTINATION,qd=olympe.dc.db.Database.hc.Nh,rd=olympe.dc.db.Database.hc.ll,sd=od+pd,td=qd+qd,ud=olympe.dc.db.Database.F;function uc(a,b,c,d){const e=a.Ja.L(olympe.dc.wa(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.R('',c);void 0!==f&&(a.Ja.getState()===ud.bg&&a.Ja.ea(c),!d&&e.Gb()&&a.G.run(()=>{f(!1,b)}))}}
423
- function md(a,b,c,d){const e=a.Ja.L(olympe.dc.wa(b));b=d||vd(a);const f=e.lc(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.R(sd,c);void 0!==e&&(a.Ja.getState()!==ud.bg||d.Pb()||a.Ja.ea(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.L;return String(a.L)}
424
- function xd(a,b,c,d,e){b=a.Ja.L(olympe.dc.wa(b));c=olympe.dc.wa(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.Ja.get(olympe.dc.wa(b));return!a||c&&!a.Gb()?null:a}
425
- function yd(a,b,c){b=a.Ja.L(olympe.dc.wa(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.Ja.L(olympe.dc.wa(b));c=c.Qa()+c.T();e=e||vd(a);d=b.lc(c,e,d);b.Gb()&&wd(a,b,c,!0,d,!1);return e}function zd(a,b,c){return c===olympe.dc.Ub.NONE?0:a.gb(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.N.warn(`No instance found with tag ${b}`),new Map;const d=new Map,e=[olympe.dc.wa(b)];for(const f of e){const g=a.tb(f,c);d.set(f,g);for(const h of g.filter(k=>!d.has(k)))e.push(h)}a.N.debug(`Found ${d.size} instances in sub-tree rooted at ${olympe.dc.wa(b)}`);return d}
427
- function Cd(a,b,c){return null!==a.Wm(c,olympe.dc.CloudObject.extendRel,d=>olympe.dc.Pa().Xk(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.jb=class{constructor(a,b){this.N=a;this.G=new olympe.D.Zb('DB View context');this.Ja=b;this.L=0}Z(){return this.Ja.Z()}F(a,b,c){a=U(this,a);null!==a&&(b=olympe.dc.wa(b),a.R(qd+b,c),this.Ja.getState()===ud.bg&&this.Ja.ea(c))}C(a,b,c,d=!1){a=U(this,a);if(null!==a){b=b.Qa()+b.T();const e=a.R(b,c);void 0!==e&&(this.Ja.getState()!==ud.bg||a.Pb()&&!d||this.Ja.ea(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.gb(olympe.dc.CloudObject.nameProp.T()):
429
- ''}model(a){return(a=(a=U(this,a,!0))?a.model():null)?a.tag():null}Af(a){return(a=(a=U(this,a,!0))&&a.Af())?a.tag():null}jj(a){a=U(this,a,!0);return!(!a||!a.Af())}qh(a,b){a=(a=U(this,a,!0))&&a.model();return!(!a||!this.Rf(a.tag(),b))}version(a){return(a=U(this,a,!0))&&a.version()}source(a){return(a=U(this,a,!0))&&a.source()}Uf(a){return(a=U(this,a,!1))?!!a.persisted():!0}gb(a,b,c){b=(a=U(this,a,!0))?a.gb(olympe.dc.wa(b),c):null;return void 0!==b?b:null}vd(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}tb(a,b){return this.fj(a,[b])}Xk(a,b,c){return this.tb(a,b).includes(olympe.dc.wa(c))}fj(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.Qa()+c.T()),void 0!==a)for(const e of a.values())e.Gb()&&b.push(e.tag());a=b}return a}oc(a,b){var c=U(this,a,!0);return c?(c=c.get(b.Qa()+b.T()))&&1<c.size?(this.N.warn(`Relation ${b.T()} 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}Mf(a,b,c){a=olympe.dc.wa(a);const d=Bd(this,a,b);d.delete(a);return c?(c=olympe.dc.wa(c),d.has(c)?Array.from(Bd(this,c,b.Sc()).keys()).filter(e=>d.has(e)):[]):Array.from(d.keys())}Wm(a,b,c){if(!this.Gb(a))return null;b=Bd(this,a,b);const d=[olympe.dc.wa(a)];for(const e of d){if(c(e))return e;if(a=b.get(e))for(const f of a.filter(g=>!d.includes(g)))d.push(f)}return null}Xm(a,b,c){return this.fj(a,b).find(c)||null}Zv(a,b,c){return this.fj(a,
432
- b).filter(c)}cn(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.Af();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.wa(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())}Rf(a,b){const c=olympe.dc.wa(b);return!!this.Wm(a,olympe.dc.CloudObject.extendRel,d=>d===c)}ge(a){return this.tb(a,olympe.dc.CloudObject.instancesRel)}};olympe.dc.jb.prototype.getInstances=olympe.dc.jb.prototype.ge;olympe.dc.jb.prototype.isExtending=olympe.dc.jb.prototype.Rf;olympe.dc.jb.prototype.getExtendedModels=olympe.dc.jb.prototype.cn;olympe.dc.jb.prototype.findAllRelated=olympe.dc.jb.prototype.Zv;olympe.dc.jb.prototype.findRelated=olympe.dc.jb.prototype.Xm;
434
- olympe.dc.jb.prototype.findRecursive=olympe.dc.jb.prototype.Wm;olympe.dc.jb.prototype.getRecursiveRelated=olympe.dc.jb.prototype.Mf;olympe.dc.jb.prototype.getUniqueRelated=olympe.dc.jb.prototype.oc;olympe.dc.jb.prototype.getMultiRelated=olympe.dc.jb.prototype.fj;olympe.dc.jb.prototype.isRelated=olympe.dc.jb.prototype.Xk;olympe.dc.jb.prototype.getRelated=olympe.dc.jb.prototype.tb;olympe.dc.jb.prototype.getProperties=olympe.dc.jb.prototype.vd;olympe.dc.jb.prototype.getProperty=olympe.dc.jb.prototype.gb;
435
- olympe.dc.jb.prototype.isPersisted=olympe.dc.jb.prototype.Uf;olympe.dc.jb.prototype.instanceOf=olympe.dc.jb.prototype.qh;olympe.dc.jb.prototype.isModel=olympe.dc.jb.prototype.jj;olympe.dc.jb.prototype.extension=olympe.dc.jb.prototype.Af;olympe.dc.jb.prototype.model=olympe.dc.jb.prototype.model;olympe.dc.jb.prototype.name=olympe.dc.jb.prototype.name;olympe.dc.jb.prototype.exist=olympe.dc.jb.prototype.Gb;function Ed(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 Fd(a,b,c=olympe.dc.Ub.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.mk,f=olympe.dm.Relation.C.yk,g=olympe.dc.Aa.ORIGIN,h=olympe.dc.Pa();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.gd())r&&zd(h,p,c)&f?b.add(q):d||r||k.add(`${n}.${p}.${q}`);for(const [p,q,r]of l.cb())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.Aa.ORIGIN,e=olympe.dc.Aa.DESTINATION,f=a.C.get(b);for(const [h,k,l]of f.gd())if(l||!c){f.R(h,e,k);var g=a.C.get(k);g&&g.R(h,d,b)}for(const [h,k,l]of f.cb())if(l||!c)f.R(h,d,k),(g=a.C.get(k))&&g.R(h,e,b)}function*Id(a,b,c,d,e=[]){e.push(b);b=a.If(b);for(const [f,g]of b.tb(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.R(b,olympe.dc.Aa.DESTINATION,d);a&&a.R(b,olympe.dc.Aa.ORIGIN,c)}
438
- olympe.dc.db.zc=class{constructor(a){this.id=a||olympe.W.aj();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.zc(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}$c(a){const b=
439
- olympe.dc.db.kg.C.Yl,c=olympe.dc.db.kg.C.Hc,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.vd():void 0);break;case d:e.Y()&&a.qc(f,e.vd(),g.Yi);break;case c:a.Mc(f,g.Yi)}for(const [h,k,l]of e.gd())l?a.Oa(h,f,k):a.Jb(h,f,k)})}G(){let a=0;this.C.forEach(b=>{a+=b.Tb()});return a}F(a,b){a=Ed(this,a).create();b&&a.qa(b)}qc(a,b,c){b&&(a=Ed(this,a).qa(b),c&&a.Pb())}Mc(a,b=olympe.dc.Ub.NONE){const c=this.C.get(a);if(c&&c.te())Fd(this,a,b);else{Ed(this,
440
- a).delete(b);for(const d of Gd(this,a,b,!1))this.C.get(d).vd().clear(),Hd(this,d,!0)}}Oa(a,b,c){Ed(this,b).link(a,c);Ed(this,c).$a(a,b)}Jb(a,b,c){Ed(this,b).unlink(a,c);Ed(this,c).Ab(a,b)}ge(){return function*(a){for(const b of a.values())if(b.te()||b.L()||b.Y())yield b}(this.C)}If(a){return this.C.get(olympe.dc.wa(a))||null}gd(){return function*(a){for(var b=a.next();!b.done;){b=b.value;const c=b.tag();yield*b.gd((d,e,f)=>[d,c,e,f]);b=a.next()}}(this.C.values())}Mf(a,b,c=(d,e)=>[d,e]){return Id(this,
441
- a,b,c)}};olympe.dc.db.zc.ma=[olympe.dc.eh,olympe.dc.jm];const Kd=new Map;
442
- olympe.dc.db.kg=class a{constructor(b){this.ka=b;this.F=a.F(a.C.Ak,!1);this.G=this.Ma=this.C=null}toJSON(){let b='{ "tag": '+JSON.stringify(this.ka)+', "state": '+JSON.stringify(this.F);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.Ma){b+=', "relations": {';for(const d of this.Ma.keys()){c=this.Ma.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 mc(b){var c;'string'===typeof b?c=JSON.parse(b):c=b;b=new olympe.dc.db.kg(c.tag);b.F=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.Ec.mc(f):h=olympe.D.mc(f));null!==h&&void 0!==h&&b.C.set(e,h)}}if(c=
444
- c.relations){b.Ma=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.Ma.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,Yi:c},Kd.set(d,e));return e}tag(){return this.ka}getState(){return this.F}create(){this.F=a.F(a.C.Yl);return this}delete(b=olympe.dc.Ub.NONE){this.F=a.F(a.C.Hc,b);this.C=null;return this}Pb(){this.F.id===a.C.Ak&&(this.F=a.F(a.C.Ak,!0))}Da(b,c){if(this.F.type===a.C.Hc)return this;
445
- this.C||(this.C=new Map);this.C.set(b,c);return this}qa(b){this.C||(this.C=new Map);b.forEach((c,d)=>{this.C.set(d,c)});return this}Fa(b){this.C&&this.C.delete(b);0===this.C.size&&(this.C=null)}link(b,c){null===this.Ma&&(this.Ma=new Map);this.Ra(this.Ma,b,c,!0);return this}unlink(b,c){null===this.Ma&&(this.Ma=new Map);this.Ra(this.Ma,b,c,!1);return this}$a(b,c){this.G||(this.G=new Map);this.Ra(this.G,b,c,!0)}Ab(b,c){this.G||(this.G=new Map);this.Ra(this.G,b,c,!1)}cc(b,c,d){if(c=c===olympe.dc.Aa.ORIGIN?
446
- this.G:this.Ma)return(b=c.get(b))&&b.get(d)}R(b,c,d){const e=(c=c===olympe.dc.Aa.ORIGIN?this.G:this.Ma)&&c.get(b);e&&e.delete(d);e&&0===e.size&&c.delete(b)}te(){return this.F.id===a.C.Yl}L(){return this.F.id===a.C.Hc}Tb(){let b=this.C?this.C.size:0;this.Ma&&this.Ma.forEach(c=>{b+=c.size});return b}Y(){return null!==this.C}vd(){return this.C||new Map}gb(b){if(this.C)return this.C.get(b)}tb(b,c=(d,e)=>[d,e]){return function*(d){if(d=d&&d.get(b.T()))for(const [e,f]of d)yield c(e,f)}(b.Qa()===olympe.dc.Aa.ORIGIN?
447
- this.G:this.Ma)}gd(b=(c,d,e)=>[c,d,e]){return this.ea(this.Ma,b)}cb(b=(c,d,e)=>[c,d,e]){return this.ea(this.G,b)}Ta(b=(c,d,e,f)=>[c,d,e,f]){const c=olympe.dc.Aa.ORIGIN,d=olympe.dc.Aa.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.ea.bind(this),this.Ma,this.G)}Ra(b,c,d,e){if(this.F.id!==a.C.Hc||!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)}}*ea(b,c){if(null!==b)for(const [d,
448
- 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,Hc:2};function Lc(a,b,c,d,e,f=olympe.dc.Ka.rb){const g=olympe.dc.db.Instance.C.lq,h=olympe.dc.db.Instance.C.mr,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 Ld(c,Md(a,c),f);a.C.push(k);a.F.set(k,l);a.Ja.Fa();a.Ja.Ab(d,g);a.Ja.Ab(e,h);Mc(a,c,f);const n=Array.from(c.ge()).filter(p=>p.te()).map(p=>p.tag());a.Ja.lc(n);a.Ja.qa();0<n.length&&b.xc(()=>{a.Ja.Fa();a.Ja.Lc(n);a.Ja.qa()})}
449
- function Mc(a,b,c){a.G.process(c,b,d=>{d||a.N.debug('CommitController: Rebase of patch',b.Z(),'done')})}function Nc(a,b,c){return a.C.slice(0,c).map(d=>a.F.get(d)).reduce((d,e)=>e?e.af(d):d,b)}
450
- function Md(a,b){const c=a.Ja,d=olympe.dc.db.Database.hc.Nh,e=olympe.dc.db.Database.hc.rc,f=olympe.dc.db.Database.hc.ORIGIN,g=olympe.dc.db.Database.hc.DESTINATION,h=olympe.dc.bc.VERSION,k=olympe.dc.bc.Nd,l=new olympe.dc.db.zc('rev-'+b.Z());a.N.debug('Generate the reverse graphLayer of',b.Z());b.C.forEach((n,p)=>{if(n.te()){l.Mc(p,olympe.dc.Ub.NONE);for(const [t,u]of n.gd())l.Jb(t,p,u)}else{var q=c.get(p);if(void 0!==q)if(n.L()){n=n.getState().Yi;for(const t of c.Y(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.Oa(A,T,t,0)}):y===g&&v.forEach((D,T)=>{l.Oa(A,t,T,0)})});l.F(t,u,0)}}else{const t=(new Map).set(h,q.version());for(const u of n.vd().keys()){var r=u[0]===e;const v=r?u.substr(1):u;r=r?q.Ta(v,!0):q.gb(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.gd())w?l.Jb(u,p,v):l.Oa(u,p,v)}}});return l}
452
- olympe.dc.db.Os=class{constructor(a,b,c){this.N=a;this.Ja=b;this.G=c;this.C=[];this.F=new Map}af(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.Aa.DESTINATION;c=c.tag();const f=a.C.If(c);b.vd().forEach((g,h)=>{f.Da(h,g);b.Fa(h)});for(const [g,h,k,l]of b.Ta()){if(!l)continue;const n=h===e?c:k,p=h===e?k:c;a.C.Oa(g,n,p);Jd(d,g,n,p)}}
453
- function Od(a,b,c,d){const e=olympe.dc.Aa.DESTINATION,f=c.tag(),g=a.C.If(f);b.vd().forEach((h,k)=>{void 0!==c.gb(k)&&(g.Da(k,h),b.Fa(k))});for(const [h,k,l]of b.gd()){const n=c.cc(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.Pa()}Z(){return this.F.Z()}af(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.L()?c.te()||Fd(this.C,b,f.getState().Yi):c.L()?(Nd(this,f,c,a),Fd(a,b,c.getState().Yi)):Od(this,f,c,a))}return a}};olympe.dc.db.O={Ea:'dc.db.Logger',xa:'dc.db.DatabaseManager',Jj:'dc.db.Database',jb:'dc.db.Driver',pt:'dc.db.Graph',oo:'dc.db.DataProcessor',so:'dc.db.DebugProcessor',tA:'dc.db.PermissionProcessor',Gi:'dc.db.GraphMonitor'};olympe.dc.db.Config={Qo:'db.garbageCollector',Gi:'db.monitor',ro:'db.debug'};
455
- olympe.U.config(function(a){E(a,olympe.dc.db.Config.Qo,olympe.dc.db.yi.C.Qq);E(a,olympe.dc.db.Config.Gi,!1);E(a,olympe.dc.db.Config.ro,!1);C(a,olympe.dc.db.O.Ea,[olympe.sa.O.xa],b=>b.Qc('dc.db'));C(a,olympe.dc.db.O.Jj,[olympe.dc.db.O.Ea,new olympe.U.fa(olympe.dc.Config.to),new olympe.U.fa(olympe.dc.db.Config.Qo),new olympe.U.fa(olympe.dc.Config.Yg),new olympe.U.fa(olympe.dc.db.Config.ro)],(b,c,d,e,f)=>{d=e?olympe.dc.db.yi.C.Bl: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.jb,[olympe.dc.db.O.xa],b=>b.view);C(a,olympe.dc.db.O.Gi,[olympe.dc.db.O.xa],b=>b.Dx);B(a,olympe.dc.db.O.so,olympe.dc.db.Xb.yo,olympe.dc.O.Ea);C(a,olympe.dc.db.O.oo,[olympe.dc.db.O.Ea,olympe.dc.db.O.Jj,olympe.U.O.cg,new olympe.U.fa(olympe.dc.Config.dg)],(b,c,d,e)=>{b=new olympe.dc.db.Xb.rr(b,c);e&&(b=new olympe.dc.km(ma(d,olympe.dc.db.O.so),b));return b});B(a,olympe.dc.db.O.xa,olympe.dc.db.Zs,olympe.dc.db.O.Ea,olympe.dc.db.O.Jj,olympe.dc.O.oe,
457
- olympe.dc.db.O.oo,new olympe.U.fa(olympe.dc.db.Config.Gi))},'olympe.dc.db');olympe.U.run([olympe.dc.db.O.Jj,olympe.dc.db.O.Gi],(a,b)=>{olympe.dj().db=a;olympe.dj().dbMonitor=b},'DC.DB debug service injection');olympe.dc.db.Xb={};olympe.dc.db.Xb.rr=class{constructor(a,b){this.N=a;this.Ja=b;this.buffer=[]}process(a,b,c){this.Ja.Fa();b.$c(this);this.Ja.qa();c(null,b)}F(a,b){this.Ja.create(a,b)}qc(a,b,c){this.Ja.update(a,b,c)}Mc(a,b=olympe.dc.Ub.NONE){for(const c of this.Ja.Y(a,b))this.Ja.Mc(c)}Oa(a,b,c){this.Ja.link(a,b,c)}Jb(a,b,c){this.Ja.unlink(a,b,c)}};olympe.dc.db.Xb.rr.ma=[olympe.dc.og,olympe.dc.eh];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.Ec||f instanceof olympe.dc.CloudObject?d+='new olympe.dc.Reference("'+f.T()+'")':f instanceof olympe.D.Color?d+='new olympe.df.Color("'+f.Nf()+','+f.Hf()+','+f.Cf()+','+f.Bf()+'")':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'{'+
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;
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}
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=
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=
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}
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}`);
369
+ });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;
445
+ 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'{'+
458
458
  (d?d:'')+'}'}
459
- olympe.dc.db.Xb.yo=class{constructor(a){this.N=a;this.output=''}process(a,b,c){this.output='Patch #'+b.Z()+' (source: '+a+')';b.$c(this);this.N.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)+')')}qc(a,b){this.log('updateInstance("'+a+'", '+Pd(this,b)+')')}Mc(a,b){var c=olympe.dc.Pa();const d=c.model(a);c=d?c.name(d)+' #'+d:'';this.log('deleteInstance("'+a+'", rule: '+b+')',c)}Oa(a,b,c){this.log('createRelation("'+
460
- a+'", "'+b+'", "'+c+'")',a===olympe.dc.jc.Wc?'Model':'')}Jb(a,b,c){this.log('deleteRelation("'+a+'", "'+b+'", "'+c+'")',a===olympe.dc.jc.Wc?'Model':'')}};olympe.dc.db.Xb.yo.ma=[olympe.dc.eh,olympe.dc.og];olympe.dc.transaction={};function Qd(a){a&&a(!0,null)}function Rd(a,b,c,d){const e=b+' , '+c;a.L.set(e,d);a.R.add(e);a.qa(b,c,d);null===a.F&&(a.F=setTimeout(a.G.bind(a),a.ka))}
461
- olympe.dc.ri=class{constructor(a,b){this.id=a||olympe.W.fc();this.C=new olympe.D.Zb('BurstTransaction#'+this.id,b);this.qa=Sd(this);this.C.onDestroy(()=>Qd());this.ea=new Set;this.L=new Map;this.R=new Set;this.F=null;this.ka=olympe.U.getParameter(olympe.dc.transaction.Config.Tn)||30;this.Y=[]}G(){null!==this.F&&(clearTimeout(this.F),this.F=null);const a=new Map;this.R.forEach(b=>{const c=b.split(' , ');let d=a.get(c[0]);void 0===d&&(d=new Map,a.set(c[0],d));d.set(c[1],this.L.get(b))});0<a.size&&Td(this,
462
- a);this.R.clear()}push(a,b){const c=olympe.dc.wa(a);a=b.subscribe(d=>{for(const [e,f]of d)d=olympe.dc.wa(e),this.L.get(c+' , '+d)!==f&&Rd(this,c,d,f.valueOf())});this.ea.add(a)}complete(){return new Promise((a,b)=>{this.G();Qd((c,d)=>{for(const e of this.ea)e.unsubscribe();c?a():b(d)})})}update(a,b,c){const d=olympe.dc.wa(a),e=olympe.dc.wa(b);void 0===d||void 0===e?olympe.dc.gi().Ya().error('Burst transaction: instance tag or property tag is undefined'):(this.C.run(()=>{olympe.D.xn([c],f=>{f instanceof
463
- olympe.dc.Ec?olympe.dc.gi().Ya().error('Cannot send complex property values in burst transactions'):Rd(this,d,e,f.valueOf())})}),this.C.xc(this.G.bind(this)))}stop(){this.C.destroy();this.Y.length=0}Z(){return this.id}rh(){return!1}toString(){return'Burst transaction #'+this.id}};olympe.dc.ri.prototype.complete=olympe.dc.ri.prototype.complete;olympe.dc.ri.prototype.push=olympe.dc.ri.prototype.push;olympe.dc.cq=class{C(){}toString(){}};olympe.dc.transaction.mg=class{constructor(a){this.id=a||olympe.W.aj();this.ua=[];this.size=0}Z(){return this.id}G(){return this.size}concat(a){this.ua.push(...a.ua)}$c(a){const b=olympe.dc.transaction.mg.C,c=this.ua.length;let d=0;for(;d<c;)switch(this.ua[d]){case b.fo:a.F(this.ua[d+1],this.ua[d+2],this.ua[d+3]);d+=4;break;case b.cr:a.qc(this.ua[d+1],this.ua[d+2],this.ua[d+3],this.ua[d+4]);d+=5;break;case b.uo:a.Mc(this.ua[d+1],this.ua[d+2],this.ua[d+3]);d+=4;break;case b.ho:a.Oa(this.ua[d+1],this.ua[d+
464
- 2],this.ua[d+3],this.ua[d+4]);d+=5;break;case b.vo:a.Jb(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.mg.C.fo,a,b,c);this.size++}qc(a,b,c,d){this.ua.push(olympe.dc.transaction.mg.C.cr,a,b,c,d);this.size++}Mc(a,b=olympe.dc.Ub.NONE,c){this.ua.push(olympe.dc.transaction.mg.C.uo,a,b,c);this.size++}Oa(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.mg.C.ho,a,b,c,d);this.size++}Jb(a,b,c,d){this.ua.push(olympe.dc.transaction.mg.C.vo,a,b,c,d);this.size++}};olympe.dc.transaction.mg.C={fo:1,cr:2,uo:3,ho:4,vo:5};olympe.dc.transaction.mg.ma=[olympe.dc.eh,olympe.dc.jm];function Ud(a,b){return a.R.get(b)||a.db.source(b)||olympe.dc.Ka.rc}function Vd(a,b){return a.L.has(b)?a.L.get(b):a.db.Uf(b)}function Wd(a,b,c,d){var e=d&&d.get(olympe.dc.bc.VERSION);a.versions.set(b,Number(e)||1);d&&a.R.set(b,d.get(olympe.dc.bc.Nd));e=Ud(a,b);a.L.set(b,c&&a.F);a.Gc(e,c,f=>{f.F(b,d,0)})}
466
- olympe.dc.transaction.wu=class{constructor(a,b){this.id=b||olympe.W.fc();this.db=a;this.C=new Map;this.G=new olympe.dc.db.zc(b);this.versions=new Map;this.R=new Map;this.Y={};this.L=new Map;this.F=!0}Qf(){return 0===this.G.C.size}persist(a){this.F=a}qc(a,b,c=!1){var d=b&&b.get(olympe.dc.bc.VERSION);this.versions.set(a,Number(d)||1);d=Ud(this,a);if(!d)throw Error('Attempt to update an instance which has an unknown source.');this.Gc(d,Vd(this,a),e=>{e.qc(a,b,c,0)})}Mc(a,b){const c=Ud(this,a),d=Vd(this,
467
- a);this.Gc(c,d,e=>{e.Mc(a,b)})}Oa(a,b,c){const d=Ud(this,b),e=Ud(this,c);let f=Vd(this,b)&&Vd(this,c);f&&d!==e&&a!==olympe.dc.jc.Wc&&(olympe.sa.Ya('dc').warn(`Try to create a relation between 2 objects that have different locations: ${b}-[${a}]->${c}`),f=!1);this.Gc(d,f,g=>{g.Oa(a,b,c,0)})}Jb(a,b,c){const d=Ud(this,b),e=Ud(this,c);let f=Vd(this,b)&&Vd(this,c);f&&d!==e&&a!==olympe.dc.jc.Wc&&(olympe.sa.Ya('dc').warn(`Try to delete a relation between 2 objects that have different locations: ${b}-[${a}]->${c}`),
468
- f=!1);this.Gc(d,f,g=>{g.Jb(a,b,c,0)})}Gc(a,b,c){c(this.G);b&&this.F&&(b=this.C.get(a),b||(b=new olympe.dc.db.zc(this.id),this.C.set(a,b)),c(b))}};function Xd(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.bc.Nd)if(e===olympe.dc.Ka.rb)d[g]=olympe.dc.Pa().Z();else{if(e===olympe.dc.Ka.Xc)continue}else g.startsWith(olympe.dc.bc.VERSION)?(g=g.substr(1),e=null===e?1:e):g.startsWith(olympe.dc.Tg.rc)&&(g='fd'+g.substr(1));e=a.ea(e);c&&e instanceof Object&&8===e.c?a.Y.set(g,e):d[g]=e}return d}
469
- function Yd(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}
470
- class Zd{constructor(){this.Y=new Map}ea(a){return a instanceof olympe.D.Xa||a instanceof olympe.D.ra||a instanceof olympe.D.da?a.valueOf():a instanceof Date||a instanceof olympe.D.kb?(a=a instanceof olympe.D.kb?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.Nf().valueOf(),g:a.Hf().valueOf(),b:a.Cf().valueOf(),a:a.Bf().valueOf()}:a&&'function'===
471
- typeof a.T?{c:8,t:a.T()}:a}}function $d(a){a.Fg=[];a.Ue=[];a.Zf=[];a.Gg=[];a.vg=[]}function ae(a){const b={};0<a.vg.length&&(b.vg=a.vg);0<a.Ue.length&&(b.Ue=a.Ue);0<a.Fg.length&&(b.Fg=a.Fg);0<a.Zf.length&&(b.Zf=a.Zf);0<a.Gg.length&&(b.Gg=a.Gg);$d(a);return b}function be(a){const b=[...a.vg,...a.Ue,...a.Fg,...a.Zf,...a.Gg];$d(a);return b}
472
- olympe.dc.transaction.Md=class{constructor(a=!1){this.Fg=[];this.Ue=[];this.Zf=[];this.Gg=[];this.vg=[];this.G=a;this.C=olympe.D?new Zd:new class extends Zd{ea(b){return b&&'function'===typeof b.T?{c:8,t:b.T()}:b}}}flush(){return JSON.stringify(be(this))}F(a,b,c=-1){this.Fg.push({o:1,t:a,p:Xd(this.C,b||null,this.G),i:c});this.G&&(b=Yd(this.C))&&this.Zf.push({o:2,t:a,p:b,i:c})}qc(a,b,c,d=-1){this.Zf.push({o:2,t:a,p:Xd(this.C,b||null,!1),i:d})}Mc(a,b,c=-1){this.Ue.push({o:3,t:a,f:b,i:c})}Oa(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.Gg.push({o:4,m:a,l:b,r:c,i:d})}Jb(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.vg.push({o:5,m:a,
474
- l:b,r:c,i:d})}};olympe.dc.transaction.Md.ma=[olympe.dc.eh];olympe.dc.transaction.Rh=class{constructor(a){this.id=a||olympe.W.fc();this.C=new Map;this.Ma=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.Da(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');}Mc(){throw Error('DeleteInstance should never be called on a SubGraph since it represents the result of a GraphDef Query');
475
- }Oa(a,b,c){a=new olympe.dc.transaction.Rh.Relation(b,c,a);this.Ma.set(a.toString(),a)}Jb(a,b,c){a=new olympe.dc.transaction.Rh.Relation(b,c,a);this.Ma.delete(a.F+'.'+a.G+'.'+a.C)}G(){return this.Ma.size+this.C.size}ge(){return this.C}$c(a){const b=new Map;this.C.forEach((c,d)=>{const e=new Map;ce(c,(f,g)=>{if(g instanceof olympe.dc.Ec){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.Ma.forEach(c=>{a.Oa(c.C,c.F,c.G)})}};
476
- function ce(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}T(){return this.tag}Da(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.wa(c)}toString(){return this.F+'.'+this.G+'.'+this.C}};olympe.dc.transaction.Rh.ma=[olympe.dc.eh,olympe.dc.jm];function de(a,b){b&&a.ua.push(b);return b}function ee(a){return(b,c)=>a.forEach(d=>d&&d(b,c))}
477
- olympe.dc.Transaction=class{constructor(a){this.id=a||olympe.W.fc();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 de(this,new olympe.dc.transaction.ua.Zd(a,b))}qj(a,b=!0){const c=olympe.dc.wa(a);var d=this.ua.find(g=>g instanceof olympe.dc.transaction.ua.Zd&&g.T()===c);if(d)return d.persist(b);d=olympe.dc.Pa();const e=d.model(a);if(null===e)throw Error('Try to persist a instance that does not exist: '+
478
- a);if(d.Uf(a))return null;const f=d.source(a)||olympe.dc.Ka.rc;a=this.create(e,a).persist(b).ki(f);for(const [g,h,k]of Ad(d,a))g!==olympe.dc.jc.Wc&&d.Uf(k)&&this.Oa(g,h===olympe.dc.Aa.DESTINATION?a:k,h===olympe.dc.Aa.DESTINATION?k:a);return a}delete(a,b=olympe.dc.Ub.Hc){de(this,new olympe.dc.transaction.ua.Mj(a,b))}update(a,b,c){return de(this,new olympe.dc.transaction.ua.Pi(a,b,c))}Oa(a,b,c){de(this,new olympe.dc.transaction.ua.no(a,b,c))}Jb(a,b,c,d){de(this,new olympe.dc.transaction.ua.at(a,b,c,
479
- d))}Rm(a,b,c,d){de(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.Tg.rc+d.T(),e);this.Oa(olympe.dc.CloudObject.propertyRel,a,d);this.Oa(olympe.dm.Property.typeRel,d,b);this.Oa(olympe.dc.CloudObject.containsRel,a,d);return d}ih(a,b,c='',{Ui:d=olympe.dm.Relation.F.am,pj:e=olympe.dm.Relation.L,Ir:f=olympe.dm.Relation.C.xq,Gr:g=olympe.dm.Relation.C.ql,
480
- sj:h=olympe.dm.Relation.C.kp}={},k=olympe.W.fc()){k=this.create(olympe.dm.Relation,k);k.setProperty(olympe.dc.CloudObject.nameProp,c||'');k.setProperty(olympe.dm.Relation.Jm,d);k.setProperty(olympe.dm.Relation.wn,e);k.setProperty(olympe.dm.Relation.Tm,f);k.setProperty(olympe.dm.Relation.Sm,g);k.setProperty(olympe.dm.Relation.fl,h);k.setProperty(olympe.dm.Relation.fl,h);this.Oa(olympe.dc.CloudObject.G,a,k);this.Oa(olympe.dm.Relation.destinationModelRel,k,b);this.Oa(olympe.dc.CloudObject.containsRel,
481
- a,k);return k}rh(){return!1}Hm(a){this.F.push(olympe.D.Ia().C(a))}ib(a,b){a=ee([...this.F,a]);fe(this,a,b)}Um(a){a=ee([...this.F,a]);ge(olympe.dc.gi(),this,a,!0)}toString(){return`Transaction #${this.id}`}};olympe.dc.Transaction.ma=[olympe.dc.cq];function Sd(a){var b=olympe.dc.gi();const c=a.Z();b.L.set(c,a);a.C.onDestroy(()=>{b.L.delete(c)});return(d,e,f)=>{const g=new olympe.dc.db.zc(c);e=(new Map).set(olympe.dc.bc.VERSION,b.db.version(d)+1).set(e,f);g.qc(d,e,!1,0);olympe.dc.Dd().af(g,olympe.dc.Ka.rb)}}
482
- function Td(a,b){var c=olympe.dc.gi();const d=olympe.dc.bc.VERSION,e=olympe.dc.ga.ja.Og,f=a.Z(),g=a.rh(),h=new Map;for(const l of b.keys()){var k=c.db.source(l);if(k===olympe.dc.Ka.rb)continue;let n=h.get(k);n||(n=new olympe.dc.db.zc(f),h.set(k,n));k=b.get(l);k.set(d,c.db.version(l)+1);n.qc(l,k,!1,0)}for(const [l,n]of h)b=xc(new olympe.dc.ga(e,{Gc:n,rh:g},[l]),a.C),c.G.send(b)}
483
- function fe(a,b,c){var d=olympe.dc.gi();if(c&&b){const e=a.Z();d.F.set(e,b);ge(d,a,(f,g)=>{f||(d.F.delete(e),b(f,g))},!1)}else ge(d,a,b,!1)}
484
- function he(a){const b=olympe.dc.ga.ja.Pj;a.G.C(olympe.dc.ga.ja.Fj,(c,d)=>{c=d.id;var e=d.rollback;d=d.error;const f=a.L.get(c);if(void 0!==f){a.L.delete(c);for(const g of f.Y)g(d);f.stop()}olympe.dc.Dd().af(e,olympe.dc.Ka.rb);a.N.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 ge(a,b,c,d=!1){const e=olympe.D.Ia(),f=c?e.C(c):void 0;c=olympe.dc.Dd();const g=b.Z(),h=new olympe.dc.transaction.wu(a.db,g);b.C(h);if(h.Qf())f&&f(!0,null);else{a.C.set(g,[]);const k=[],l=[];for(const p of h.versions.keys())Vd(h,p)?k.push(p):l.push(p);const n=Kc(c,e,h.G,k,l);ie(a,h,(p,q,r)=>{q?(je(a,g,k,h.C.size),ke(a,h,d,b.rh(),(t,u)=>{!t&&a.C.has(g)&&(a.C.get(g).forEach(v=>v(olympe.dc.transaction.rg.C.ek,u)),le(a,g));n(t);p&&p(t);f&&f(t,u)})):(a.N.error(r),n(!1),f&&f(!1,r))})}}
486
- function ie(a,b,c){const d=[];for(const p of b.versions.keys())a.db.qh(p,olympe.dm.File)&&Vd(b,p)&&d.push(p);if(0===d.length)c(null,!0,null);else{var e=olympe.dm.File.urlProp.T(),f=olympe.dm.File.C.T(),g=olympe.dm.File.modificationDateProp.T(),h=Array.from(b.C.values()),k=[],l=new olympe.async.ng(olympe.D.zg()),n=olympe.W.bi();d.forEach(p=>{l.add((q,r)=>{const t=a.db.gb(p,e,!0),u=a.db.gb(p,olympe.dm.File.mimeTypeProp)||'application/data';t.startsWith('blob:')?n.F(t,v=>{n.Y(t);null===v?q():tc(a.Y,
487
- p,v,u,w=>{const y=h.reduce((A,D)=>A||D.If(p),null);null!==y&&(y.Da(e,w).Da(f,!0),k.push([p,w]));q()},w=>{r(w)})}):(2048<t.length&&a.N.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())})});Xb(l,(p,q)=>{let r=null;if(p){const t=new olympe.dc.db.zc;k.forEach(([u,v])=>{const w=new Map;w.set(e,v).set(f,!0).set(g,olympe.D.kb.now());t.qc(u,w,!0,0)});r=Kc(olympe.dc.Dd(),olympe.D.zg(),t,[],[])}c(r,p,q)});l.start()}}
488
- function je(a,b,c,d){const e=olympe.D.zg(),f=new olympe.async.ng(e);0<a.timeout&&Wb(f,a.timeout);const g=a.C.get(b);for(let h=0;h<d;h++)f.add((k,l,n)=>{g.push(e.C((p,q)=>{n.set('final',p);q?l(q):k()}))});Xb(f,(h,k,l)=>{h||a.N.warn(`An error occurred while processing the notification of transaction (${b}): ${k}.`);l.get('final')!==olympe.dc.transaction.rg.C.Sp&&olympe.dc.Dd().persist(c);le(a,b)});f.start()}
489
- function ke(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,{Gc:h,rh:d},[k]),p=>{p instanceof Error?n(p.message):l()});a.G.send(h)};var g=new olympe.async.ng(olympe.D.zg());for(const [h,k]of b)g.add(c.bind(null,k,h));Xb(g,e);g.start()}}function le(a,b){a.C.delete(b);if(0===a.C.size){for(var c of a.R)c();a.R=[]}a.F.has(b)&&(c=a.F.get(b),a.F.delete(b),c(!0,null))}
490
- function me(a,b){0<a.C.size?a.R.push(olympe.D.Ia().C(b)):b()}olympe.dc.transaction.rg=class{constructor(a,b,c,d,e){this.N=a;this.db=b;this.G=c;this.Y=d;this.timeout=e;this.L=new Map;this.C=new Map;this.R=[];this.F=new Map;he(this)}Ya(){return this.N}};olympe.dc.transaction.rg.C={ek:0,Rp:1,Sp:2};olympe.dc.transaction.O={Ea:'dc.transaction.Logger',xa:'dc.transaction.Manager'};olympe.dc.transaction.Config={TIMEOUT:'dc.transaction.timeout',Tn:'dc.transaction.burstInterval'};
491
- olympe.U.config(function(a){E(a,olympe.dc.transaction.Config.TIMEOUT,6E4);E(a,olympe.dc.transaction.Config.Tn,30);C(a,olympe.dc.transaction.O.Ea,[olympe.sa.O.xa],b=>b.Qc('dc'));B(a,olympe.dc.transaction.O.xa,olympe.dc.transaction.rg,olympe.dc.transaction.O.Ea,olympe.dc.O.si,olympe.dc.O.oe,olympe.dc.O.vi,new olympe.U.fa(olympe.dc.transaction.Config.TIMEOUT))},'olympe.dc.transaction');olympe.dc.transaction.ua={};function W(a){return olympe.dc.wa(a)}function ne(a,b){const c=new Map;for(const [d,e]of b)c.set(d,a.Za(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 !');}Za(a){a=olympe.D.Za(a);return void 0===a||null===a?null:olympe.D.Xr(a)?a.valueOf():a}};olympe.dc.transaction.ua.Ng.ma=[olympe.dc.cq];olympe.dc.transaction.ua.Zd=class extends olympe.dc.transaction.ua.Ng{constructor(a,b){super();this.tag=void 0!==b?b:olympe.W.fc();this.model=a;this.F=new Map;this.G=!0;this.F.set(olympe.dc.bc.VERSION,1)}T(){return W(this.tag)}Wb(){return W(this.model)}persist(a){this.G=a;return this}ki(a){this.F.set(olympe.dc.bc.Nd,a);return this}vx(){this.F.set(olympe.dc.bc.Nd,olympe.dc.Ka.rb)}setProperty(a,b){this.F.set(olympe.dc.wa(a),b);return this}gl(a){this.setProperty(olympe.dc.CloudObject.nameProp.T(),a);
492
- return this}C(a){const b=olympe.dc.Pa(),c=this.Wb(),d=this.T();if(void 0===c)throw Error('OperationError: Cannot create instance, model tag is undefined');var e=olympe.dc.bc.Nd;if(!this.F.has(e)){var f=b.source(c);this.F.set(e,null!==f?f:olympe.dc.Ka.rc)}if(b.Gb(d)&&!b.Uf(d)&&this.G){e=new Map([...b.vd(d,!0),...ne(this,this.F)]);for(const g of e.values())g instanceof olympe.dc.Ec&&!Vd(a,g.T())&&(f=new olympe.dc.Transaction,f.qj(g.T()),f.C(a));Wd(a,d,this.G,e);a.Oa(olympe.dc.CloudObject.modelRel.T(),
493
- d,c);for(const [g,h,k]of Ad(b,d))Vd(a,k)&&(h===olympe.dc.Aa.ORIGIN?a.Oa(g,k,d):a.Oa(g,d,k))}else b.Gb(d)||(Wd(a,d,this.G,ne(this,this.F)),a.Oa(olympe.dc.CloudObject.modelRel.T(),d,c))}toString(){return`CreateInstance(${this.Wb()}, ${this.T()})`}};olympe.dc.transaction.ua.Zd.prototype.setProperty=olympe.dc.transaction.ua.Zd.prototype.setProperty;olympe.dc.transaction.ua.Zd.prototype.localSource=olympe.dc.transaction.ua.Zd.prototype.vx;olympe.dc.transaction.ua.Zd.prototype.persist=olympe.dc.transaction.ua.Zd.prototype.persist;
494
- olympe.dc.transaction.ua.Zd.prototype.getModelTag=olympe.dc.transaction.ua.Zd.prototype.Wb;olympe.dc.transaction.ua.Zd.prototype.getTag=olympe.dc.transaction.ua.Zd.prototype.T;olympe.dc.transaction.ua.Zd.ma=[olympe.dc.ze];olympe.dc.transaction.ua.no=class extends olympe.dc.transaction.ua.Ng{constructor(a,b,c){super();this.type=a.Qa?a:new olympe.dc.X.Sb(W(a));this.F=b;this.G=c}Qa(){return this.Za(this.type).Qa()}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.jc.Wc)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.Qa()===olympe.dc.Aa.DESTINATION?a.Oa(b,c,d):a.Oa(b,d,c)}toString(){return`CreateRelation('${this.Qa()}${W(this.type)}, ${W(this.F)}, ${W(this.G)})`}};olympe.dc.transaction.ua.ez=class extends olympe.dc.transaction.ua.Ng{constructor(a,b=olympe.dc.Ub.Hc){super();this.model=a;this.F=b}Wb(){return W(this.model)}C(a){const b=this.Wb();if(void 0===b)throw Error('OperationError: Cannot delete instances of model, model is undefined');const c=olympe.dc.Pa();for(const d of c.ge(b))d!==b&&(new olympe.dc.transaction.ua.Mj(d,this.F)).C(a)}toString(){return`DeleteAllInstances(${this.Wb()}, ${this.F})`}};olympe.dc.transaction.ua.$s=class extends olympe.dc.transaction.ua.Ng{constructor(a,b,c,d){super();this.F=a.Qa?a:new olympe.dc.X.Sb(W(a));this.G=b;this.L=c||!1;this.R=d instanceof Array?d.map(e=>W(e)):null}Qa(){return this.Za(this.F).Qa()}C(a){const b=W(this.F);if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.jc.Wc)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.Pa();const e=this.Qa(),f=this.R;d=d.tb(c,this.F);for(const g of d)e===olympe.dc.Aa.DESTINATION?a.Jb(b,c,g):a.Jb(b,g,c),null!==f&&0<=f.indexOf(g)||this.L&&(new olympe.dc.transaction.ua.Mj(g,olympe.dc.Ub.Hc)).C(a)}toString(){return`DeleteAllRelations(${this.Qa()}${W(this.F)}, ${W(this.G)}, ${this.L})`}};olympe.dc.transaction.ua.Mj=class extends olympe.dc.transaction.ua.Ng{constructor(a,b=olympe.dc.Ub.Hc){super();this.tag=a;this.F=b}T(){return W(this.tag)}C(a){const b=olympe.dc.Pa(),c=this.T();if(void 0===c)throw Error('OperationError: Cannot delete instance, tag is undefined');const d=b.model(c);0<=b.version(c)&&d&&a.Mc(c,this.F)}toString(){return'DeleteInstance('+this.T()+', '+this.F+')'}};olympe.dc.transaction.ua.at=class extends olympe.dc.transaction.ua.no{constructor(a,b,c,d=!1){super(a,b,c);this.L=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.jc.Wc)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.Qa()===olympe.dc.Aa.DESTINATION?a.Jb(b,c,d):a.Jb(b,d,c);this.L&&(new olympe.dc.transaction.ua.Mj(d,olympe.dc.Ub.Hc)).C(a)}toString(){return'DeleteRelation('+this.Qa()+W(this.type)+', '+W(this.F)+', '+W(this.G)+', '+this.L+')'}};olympe.dc.transaction.ua.Pi=class extends olympe.dc.transaction.ua.Ng{constructor(a,b,c){super();this.tag=a;this.F=new Map;this.F.set(olympe.dc.bc.VERSION,-1);void 0!==b&&this.setProperty(b,c)}T(){return W(this.tag)}setProperty(a,b){this.F.set(W(a),b);return this}C(a){const b=this.T();if(void 0===b)throw Error('OperationError: Cannot update instance, tag is undefined');const c=olympe.dc.Pa();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=ne(this,this.F);0>=d.get(olympe.dc.bc.VERSION)&&d.set(olympe.dc.bc.VERSION,e+1);for(const [f,g]of d)e=c.gb(b,f),e instanceof olympe.dc.Ec&&(e=e.T(),a.Y[e]=!0),g instanceof olympe.dc.Ec&&!Vd(a,g.T())&&(e=new olympe.dc.Transaction,e.qj(g.T()),e.C(a));a.qc(b,d)}toString(){return'UpdateInstance('+this.T()+', '+ne(this,this.F)+')'}};olympe.dc.transaction.ua.Pi.prototype.setProperty=olympe.dc.transaction.ua.Pi.prototype.setProperty;
499
- olympe.dc.transaction.ua.Pi.prototype.getTag=olympe.dc.transaction.ua.Pi.prototype.T;olympe.dc.ba={};olympe.dc.ze=class{T(){}};olympe.dc.ze.prototype.getTag=olympe.dc.ze.prototype.T;olympe.dc.Uz=olympe.dc.ze;olympe.dc.ba.eq={ASC:'ASC',DESC:'DESC'};function oe(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.ba.V.Ic(a.p,b,olympe.dc.Pa());case 2:return new olympe.dc.ba.V.Vc(a.p,a.s,olympe.dc.Pa(),a.c);case 3:return new olympe.dc.ba.V.Fh(a.p,a.b,a.l,a.s);case 4:return new olympe.dc.ba.V.md(oe(a.v));case 5:return new olympe.dc.ba.V.zd(a.p,new RegExp(a.r),olympe.dc.Pa(),a.c);case 6:b=new olympe.dc.ba.V.De(a.d);
500
- for(const [d,e,f]of a.r)a=new olympe.dc.query.Relation(d,e,f),f?b.Lk(a):b.vb(a);return b;case 7:return new olympe.dc.ba.V.de(...a.p.map(d=>oe(d)));case 8:return new olympe.dc.ba.V.Xd(...a.p.map(d=>oe(d)));default:return null}}
501
- olympe.dc.ba.bb=class{observe(){}ib(){}clear(){}ia(){}toString(){}static sb(a,b){return new olympe.dc.ba.V.Ic(a,b,olympe.dc.Pa())}static contains(a,b,c=!1){return new olympe.dc.ba.V.Vc(a,b,olympe.dc.Pa(),c)}static hs(a,b,c=!0){return new olympe.dc.ba.V.zd(a,b,olympe.dc.Pa(),c)}static Rk(a,b,c=!0){return new olympe.dc.ba.V.Fh(a,b,!1,c)}static vj(a,b,c=!0){return new olympe.dc.ba.V.Fh(a,b,!0,c)}static and(...a){return new olympe.dc.ba.V.Xd(...a)}static or(...a){return new olympe.dc.ba.V.de(...a)}static not(a){return new olympe.dc.ba.V.md(a)}};
502
- olympe.dc.ba.bb.not=olympe.dc.ba.bb.not;olympe.dc.ba.bb.or=olympe.dc.ba.bb.or;olympe.dc.ba.bb.and=olympe.dc.ba.bb.and;olympe.dc.ba.bb.smallerThan=olympe.dc.ba.bb.vj;olympe.dc.ba.bb.greaterThan=olympe.dc.ba.bb.Rk;olympe.dc.ba.bb.regex=olympe.dc.ba.bb.hs;olympe.dc.ba.bb.contains=olympe.dc.ba.bb.contains;olympe.dc.ba.bb.equals=olympe.dc.ba.bb.sb;function pe(a,b){return new olympe.dc.hb(a.G,a.source,b,a.F,{max:a.max,offset:a.offset})}function qe(a){return a.C.filter(b=>b instanceof olympe.dc.ba.Lb.hg||b instanceof olympe.dc.ba.Lb.ig).length}function re(a){const b=a.C.findIndex(c=>c instanceof olympe.dc.ba.Lb.Qh);a=0===a.F.size?a.Ti():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 se(a,b){const c=olympe.dc.Hd.SUBSCRIBE,d=olympe.dc.Hd.Ii,e=new olympe.dc.hf(a.G,b?c:d);for(const f of a.C)f instanceof olympe.dc.ba.Lb.hg?e.vb(f.Sd()):f instanceof olympe.dc.ba.Lb.ig?e.vb(f.Sd(),!0):f instanceof olympe.dc.ba.Lb.uc&&(a=f.C,a instanceof olympe.dc.ba.V.De&&(a=a.gd(),a.forEach(g=>e.vb(g)),te(e,a.length)));return e}function ue(a){return new olympe.dc.hb(a.r,a.s,a.qp.map(b=>ve(b)),new Set(a.lv),{max:a.lp.m,offset:a.lp.o})}
504
- olympe.dc.hb=class{constructor(a,b=olympe.dc.Ka.rc,c=[],d=new Set,e={max:-1,offset:0}){this.db=olympe.dc.Pa();this.G=olympe.dc.wa(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.hb(a)}static Uk(a,b){return(new olympe.dc.hb(a,b)).vb(olympe.dc.CloudObject.instancesRel)}vb(a){const b=Array.from(this.C);b.push(new olympe.dc.ba.Lb.hg(this.db,a));return pe(this,b)}bw(a,b=!1){const c=Array.from(this.C);c.push(new olympe.dc.ba.Lb.ig(this.db,
505
- a,b));return pe(this,c)}Ti(){this.F.add(qe(this));return new olympe.dc.hb(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.ba.Lb.uc(a));return pe(this,b)}Vi(){return this}limit(a,b=0){return new olympe.dc.hb(this.G,this.source,this.C,this.F,{max:a,offset:b})}Bn(a,b){const c=Array.from(this.C);c.push(new olympe.dc.ba.Lb.Qh(this.db,a,b));return pe(this,c)}ib(a){return we(olympe.dc.Kf(),re(this),'function'===typeof a.Fc?a.Fc():
506
- a)}observe(a){return xe(olympe.dc.Kf(),re(this),'function'===typeof a.Fc?a.Fc():a)}ud(){var a=re(this);return olympe.dc.Kf().R.ud(a)}Z(){null===this.id&&(this.id=olympe.W.ob(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.hb.prototype.executeFromCache=olympe.dc.hb.prototype.ud;
507
- olympe.dc.hb.prototype.observe=olympe.dc.hb.prototype.observe;olympe.dc.hb.prototype.execute=olympe.dc.hb.prototype.ib;olympe.dc.hb.prototype.sortBy=olympe.dc.hb.prototype.Bn;olympe.dc.hb.prototype.limit=olympe.dc.hb.prototype.limit;olympe.dc.hb.prototype.cast=olympe.dc.hb.prototype.Vi;olympe.dc.hb.prototype.filter=olympe.dc.hb.prototype.filter;olympe.dc.hb.prototype.andReturn=olympe.dc.hb.prototype.Ti;olympe.dc.hb.prototype.followRecursively=olympe.dc.hb.prototype.bw;
508
- olympe.dc.hb.prototype.follow=olympe.dc.hb.prototype.vb;olympe.dc.hb.instancesOf=olympe.dc.hb.Uk;olympe.dc.hb.from=olympe.dc.hb.from;function ve(a){const b=olympe.dc.Pa();switch(a.t){case 1:return(a=oe(a.p))?new olympe.dc.ba.Lb.uc(a):null;case 2:return new olympe.dc.ba.Lb.hg(b,new olympe.dc.query.Relation(a.r.t,a.r.d,!1));case 3:var c=a.s;return new olympe.dc.ba.Lb.ig(b,new olympe.dc.query.Relation(a.r.t,a.r.d,!0),c);case 4:return c=a.o,new olympe.dc.ba.Lb.Qh(b,new olympe.dc.va.Property(a.p),c);default:return null}}olympe.dc.ba.jk=class{ia(){}F(){}ib(){}observe(){}toString(){}};function ye(a){return a.G.map(b=>a.F.get(a.C[b]))}function ze(a){return a.L.map(b=>{b=b.split('.');return 1===b.length?b[0]:b})}function Ae(a){a=Array.from(a.F.values()).flat();return new Set(a.map(b=>b.T()))}function Be(a){return new Set(a.L.flatMap(b=>b.split('.')))}
509
- function Ce(a,b){var c=olympe.dc.Pa();if(c.Gb(a)){b.F(a,c.vd(a,!0),0);b.Oa(olympe.dc.jc.Wc,a,c.model(a),0);for(const [d,e,f]of Ad(c,a))(c=b.If(f))&&c.te()&&(e===olympe.dc.Aa.DESTINATION?b.Oa(d,a,f,0):b.Oa(d,f,a,0))}else olympe.sa.Ya('Query Result').error(`Fail to serialize instance with tag ${a} not present in local DBView`)}
510
- function De(a,b,c=olympe.dc.Ka.Xc){b&&b((new olympe.dc.W.Hi(c)).C(a.p||[]));const d=olympe.dc.Pa();let e=!1;b=a.k.map(f=>{const g=f.split('.').map(h=>d.Gb(h)?olympe.dc.CloudObject.get(h):(olympe.sa.Ya('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.Wa.create(b,a.a,a.r)}
511
- olympe.dc.Wa=class{constructor(){this.C=[];this.F=new Map;this.G=[];this.L=[];this.hash=''}static empty(){return new olympe.dc.Wa}[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+=1);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===
512
- 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}Rc(){return this.se(0)}se(a){return a<this.C.length?this.F.get(this.C[a]):null}push(...a){let 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)=>a(this.F.get(b),
513
- 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.Wa.create(b,Array.from(this.G),Array.from(this.L))}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.L.concat(...a.map(d=>d.L));return olympe.dc.Wa.create(b,c,a)}static from(a,b){const c=olympe.dc.Pa();var d=Ee(b);if(b.Bd){const {mb:l,order:n,Bd:p,
514
- Gv:q}=b.Bd,r=Array.from(b.G).sort().indexOf(q),t=n===olympe.dc.ba.eq.ASC?1:-1;d=d.sort((u,v)=>{v=v[r];u=c.gb(u[r],l);v=c.gb(v,l);return null===u?-t:null===v?t:t*p(u,v)})}else d=d.sort((l,n)=>l.reduce((p,q,r)=>p||q.localeCompare(n[r]),0));0<b.offset&&(d=d.slice(b.offset));-1<b.max&&(d=d.slice(0,b.max));const e=olympe.W.ob(d.flat().join(''));if(e===a.hash)return b.F=!1,a;d=d.map(l=>[l.join('.'),1===l.length?olympe.dc.CloudObject.get(l[0]):l.map(n=>olympe.dc.CloudObject.get(n))]);b.Bd||(d=d.sort((l,
515
- n)=>l[0].localeCompare(n[0])));const f=new Set(d.map(l=>l[0])),g=new Set(a.keys()),h=[],k=[];d.forEach(([l],n)=>{!g.has(l)&&h.push(n)});g.forEach(l=>{!f.has(l)&&k.push(l)});a=olympe.dc.Wa.create(d,h,k,e);b.F=!1;return a}static create(a,b,c,d){const e=new olympe.dc.Wa;e.C=a.map(f=>f[0]);e.F=new Map(a);e.hash=d||olympe.W.ob(e.C.join(''));e.G=b||e.C.map((f,g)=>g);e.L=c||[];return e}ia(){const a=new olympe.dc.db.zc;var b=new Set(this.G.flatMap(c=>this.C[c].split('.')));for(const c of b)Ce(c,a);b=new olympe.dc.transaction.Md;
516
- a.$c(b);return{k:this.C,p:be(b),a:this.G,r:this.L}}};olympe.dc.Wa.prototype.concat=olympe.dc.Wa.prototype.concat;olympe.dc.Wa.prototype.reduce=olympe.dc.Wa.prototype.reduce;olympe.dc.Wa.prototype.sort=olympe.dc.Wa.prototype.sort;olympe.dc.Wa.prototype.map=olympe.dc.Wa.prototype.map;olympe.dc.Wa.prototype.forEach=olympe.dc.Wa.prototype.forEach;olympe.dc.Wa.prototype.find=olympe.dc.Wa.prototype.find;olympe.dc.Wa.prototype.filter=olympe.dc.Wa.prototype.filter;olympe.dc.Wa.prototype.shift=olympe.dc.Wa.prototype.shift;
517
- olympe.dc.Wa.prototype.pop=olympe.dc.Wa.prototype.pop;olympe.dc.Wa.prototype.push=olympe.dc.Wa.prototype.push;olympe.dc.Wa.prototype.getAt=olympe.dc.Wa.prototype.se;olympe.dc.Wa.prototype.getFirst=olympe.dc.Wa.prototype.Rc;olympe.dc.Wa.prototype.get=olympe.dc.Wa.prototype.get;olympe.dc.Wa.prototype.indexOf=olympe.dc.Wa.prototype.indexOf;olympe.dc.Wa.prototype.has=olympe.dc.Wa.prototype.has;olympe.dc.Wa.prototype.size=olympe.dc.Wa.prototype.size;olympe.dc.Wa.prototype.toArray=olympe.dc.Wa.prototype.df;
518
- olympe.dc.Wa.prototype.keys=olympe.dc.Wa.prototype.keys;olympe.dc.Wa.prototype.values=olympe.dc.Wa.prototype.values;olympe.dc.Wa.prototype.entries=olympe.dc.Wa.prototype.entries;olympe.dc.Wa.empty=olympe.dc.Wa.empty;function Ee(a){var b=new Set(X(a,a.Ag()-1).keys());a.C.push((new Map).set('sink',b));b=[];for(const c of Fe(a,'sink',a.Ag()-1,''))b.push(c.slice(0,-1).split(';'));a.C.pop();return b}function Ge(a,b,c,d,e){a.Bd={Bd:b,Gv:c,order:d,mb:e}}function He(a,b){a.L=b}function Ie(a){a.L?a.F||(a.F=!0,a.L()):olympe.sa.Ya('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]}
519
- function Fe(a,b,c,d){if(0===c)return a.G.has(c)?(b=Array.from(X(a,0).keys())[0],(new Set).add(`${b};${d}`)):(new Set).add(d);const e=Je(a,b,c),f=a.G.has(c)?`${b};${d}`:d;return e.reduce((g,h)=>{for(const k of Fe(a,h,c-1,f))g.add(k);return g},new Set)}function Je(a,b,c){return 0===c?null:(a=X(a,c))&&a.has(b)?Array.from(a.get(b)):null}function Ke(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);Ie(a)}
520
- olympe.dc.ba.nq=class{constructor(a){this.C=Array.from({length:qe(a)+1},()=>new Map);this.G=new Set(Array.from(a.F));this.Bd=null;this.F=!1;this.L=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.sa.Ya('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&&Ie(this),!1;if(b>=this.Ag())return olympe.sa.Ya('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);Ie(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.sa.Ya('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 Ie(this),Ke(this,a,b,a),!0;Ie(this);return!1}};olympe.dc.nd=class{constructor(a){this.query=a}static from(a){return new olympe.dc.nd(olympe.dc.hb.from(a))}vb(a){return new olympe.dc.nd(this.query.vb(a))}Vi(){return this}ib(a){return this.query.ib(a).then(b=>{const c=b.size();return 1<c?(olympe.sa.Ya('dc').warn('a follow() on a QuerySingle has '+c+' results (0 or 1 expected) -> returns null'),null):b.Rc()||null})}ud(){const a=this.query.ud(),b=a.size();return 1<b?(olympe.sa.Ya('dc').warn('a follow() on a QuerySingle has '+b+' results (0 or 1 expected) -> returns null'),
522
- null):a.Rc()||null}};olympe.dc.nd.prototype.executeFromCache=olympe.dc.nd.prototype.ud;olympe.dc.nd.prototype.execute=olympe.dc.nd.prototype.ib;olympe.dc.nd.prototype.cast=olympe.dc.nd.prototype.Vi;olympe.dc.nd.prototype.follow=olympe.dc.nd.prototype.vb;olympe.dc.ba.V={};olympe.dc.ba.V.Xd=class{constructor(...a){this.V=a}ib(a){return this.V.reduce((b,c)=>b&&c.ib(a),!0)}observe(a,b,c){const d=this.V.map(()=>!1);let e=this.V.map(()=>null);const 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.ob('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.ob('AND-'+b+a+d))})}};
523
- olympe.dc.ba.V.Xd.C=8;olympe.dc.ba.V.Xd.ma=[olympe.dc.ba.bb];olympe.dc.ba.V.Vc=class{constructor(a,b,c,d=!1){this.mb=olympe.dc.wa(a);this.substring=b;this.db=c;this.C=d}gb(){return this.mb}ib(a){return this.apply(this.db.gb(a,this.mb))}observe(a,b,c){xd(this.db,a,this.mb,d=>{c(this.apply(d))},olympe.W.ob(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.mb+'-'+this.substring+'-'+this.C}clear(a,b){this.db.F(a,this.mb,olympe.W.ob(b+
524
- a+this.toString()))}ia(){return{pr:2,p:this.mb,s:this.substring,c:this.C}}};olympe.dc.ba.V.Vc.C=2;olympe.dc.ba.V.Vc.ma=[olympe.dc.ba.bb];olympe.dc.ba.V.Ic=class{constructor(a,b,c){this.mb=olympe.dc.wa(a);this.C=b;this.db=c}ib(a){return this.apply(this.db.gb(a,this.mb))}observe(a,b,c){xd(this.db,a,this.mb,d=>{c(this.apply(d))},olympe.W.ob(b+a+this.toString()))}clear(a,b){this.db.F(a,this.mb,olympe.W.ob(b+a+this.toString()))}apply(a){return'object'===typeof a&&null!==a?a instanceof olympe.dc.CloudObject?a.sb(this.C):a instanceof Date?this.C instanceof Date&&this.C.getTime()===a.getTime():a instanceof olympe.D.Color?a.sb(this.C):!1:a===
525
- this.C}toString(){return'Equals-'+this.mb+'-'+this.C.toString()}gb(){return this.mb}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.T();break;case this.C instanceof olympe.D.Color:a=4,b={r:this.C.Nf().valueOf(),g:this.C.Hf().valueOf(),b:this.C.Cf().valueOf(),a:this.C.Bf().valueOf()}}return{pr:1,p:this.mb,t:a,v:b}}};olympe.dc.ba.V.Ic.C=1;olympe.dc.ba.V.Ic.ma=[olympe.dc.ba.bb];function Le(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 Me(a,b){return'number'===typeof a.C?a.C:a.db.gb(b,a.C)}function Ne(a,b,c){return olympe.W.ob(c+b+a.C+a.mb)}
526
- olympe.dc.ba.V.Fh=class{constructor(a,b,c=!0,d=!0){this.db=olympe.dc.Pa();this.mb=olympe.dc.wa(a);this.C='number'===typeof b?b:olympe.dc.wa(b);this.F=c;this.G=d}gb(){return this.mb}ib(a){return Le(this,this.db.gb(a,this.mb),Me(this,a))}observe(a,b,c){'string'===typeof this.C&&xd(this.db,a,this.C,d=>{const e=this.db.gb(a,this.mb);null!==e&&c(Le(this,e,d))},Ne(this,a,b));xd(this.db,a,this.mb,d=>{const e=Me(this,a);c(null!==e?Le(this,d,e):!0)},Ne(this,a,b))}clear(a,b){this.db.F(a,this.mb,Ne(this,a,b));
527
- 'string'===typeof this.C&&this.db.F(a,this.C,Ne(this,a,b))}ia(){return{pr:3,p:this.mb,b:this.C,l:this.F,s:this.G}}toString(){return'GreaterThan-'+this.mb+'-'+this.G+'-'+this.C}};olympe.dc.ba.V.Fh.C=3;olympe.dc.ba.V.Fh.ma=[olympe.dc.ba.bb];olympe.dc.ba.V.md=class{constructor(a){this.C=a}ib(a){return!this.C.ib(a)}observe(a,b,c){let d=null;this.C.observe(a,olympe.W.ob('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.ob('NOT'+b+a))}};olympe.dc.ba.V.md.C=4;olympe.dc.ba.V.md.ma=[olympe.dc.ba.bb];olympe.dc.ba.V.de=class{constructor(...a){this.V=a}ib(a){return this.V.reduce((b,c)=>b||c.ib(a),!1)}observe(a,b,c){let d=this.V.map(()=>!1),e=this.V.map(()=>null);const 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.ob('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.ob('OR-'+b+a+d))})}};
528
- olympe.dc.ba.V.de.C=7;olympe.dc.ba.V.de.ma=[olympe.dc.ba.bb];olympe.dc.ba.V.zd=class{constructor(a,b,c,d=!0){this.mb=olympe.dc.wa(a);this.C=RegExp('');try{this.C=new RegExp(b)}catch(e){if(!(e instanceof SyntaxError))throw e;}this.db=c;this.F=d}gb(){return this.mb}ib(a){return this.apply(this.db.gb(a,this.mb))}observe(a,b,c){xd(this.db,a,this.mb,d=>{c(this.apply(d))},olympe.W.ob(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.mb+'-'+this.C.toString()+'-'+this.F}ia(){return{pr:5,
529
- p:this.mb,r:this.C.source,c:this.F}}clear(a,b){this.db.F(a,this.mb,olympe.W.ob(b+a+this.toString()))}};olympe.dc.ba.V.zd.C=5;olympe.dc.ba.V.zd.ma=[olympe.dc.ba.bb];olympe.dc.ba.V.De=class{constructor(a){this.db=olympe.dc.Pa();this.Ma=[];this.recursive=[];this.destination=a?olympe.dc.wa(a):null}gd(){return Array.from(this.Ma)}clear(a,b){0<this.Ma.length&&this.db.C(a,this.Ma[0],olympe.W.ob(b+0+a))}vb(a){this.Ma.push(a);this.recursive.push(!1);return this}Lk(a){this.Ma.push(a);this.recursive.push(!0);return this}ib(a){if(1>this.Ma.length)return olympe.sa.Ya('dc').error('RelatedTo executed with less than 1 relation'),!1;let b=[];const c=this.destination||'';let d=
530
- (e,f,g,h)=>e?f?this.db.Mf(g,h,c):this.db.Mf(g,h):this.db.tb(g,h);for(let e=0;e<this.Ma.length;++e){const f=this.Ma[e],g=this.recursive[e],h=e===this.Ma.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.Ma.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.Ma[k],r=this.recursive[k-1]?this.Ma[k-1]:null;l=olympe.W.ob(l+k+
531
- p);const t=olympe.W.ob(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.Ma.map((a,b)=>[a.T(),a.Qa(),this.recursive[b]]),d:this.destination}}toString(){const a=this.Ma.reduce((b,c,d)=>b+c.T()+this.recursive[d],'');return`RelatedTo-${this.destination}-${a}`}};olympe.dc.ba.V.De.prototype.followRecursive=olympe.dc.ba.V.De.prototype.Lk;
532
- olympe.dc.ba.V.De.prototype.follow=olympe.dc.ba.V.De.prototype.vb;olympe.dc.ba.V.De.C=6;olympe.dc.ba.V.De.ma=[olympe.dc.ba.bb];olympe.dc.ba.Lb={};olympe.dc.ba.Lb.uc=class{constructor(a){this.C=a}F(a){return a}ib(a,b){for(const c of X(a,b).keys())this.C.ib(c)||(0===b?a.remove(c,b,null):Je(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.ob(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.ba.Lb.uc.C=1;
533
- olympe.dc.ba.Lb.uc.ma=[olympe.dc.ba.jk];olympe.dc.ba.Lb.hg=class{constructor(a,b){this.db=a;this.C=b}Sd(){return this.C}F(a){return a+1}ib(a,b){for(const c of X(a,b).keys())this.db.tb(c,this.C).forEach(d=>{a.insert(d,b+1,c)})}observe(a,b,c){return(d,e,f,g)=>{const h=olympe.W.ob(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.T(),d:this.C.Qa()}}}toString(){return'followQueryPart-'+this.C.Qa()+this.C.T()}};olympe.dc.ba.Lb.hg.C=2;
534
- olympe.dc.ba.Lb.hg.ma=[olympe.dc.ba.jk];olympe.dc.ba.Lb.ig=class{constructor(a,b,c=!1){this.db=a;this.C=b;this.G=c}Sd(){return this.C}F(a){return a+1}ib(a,b){for(const c of X(a,b).keys())this.G&&a.insert(c,b+1,c),this.db.Mf(c,this.C).forEach(d=>{a.insert(d,b+1,c)})}observe(a,b,c){const d=(g,h,k,l)=>olympe.W.ob(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.T(),d:this.C.Qa()}}}toString(){return'followRecursivelyQueryPart-'+this.C.Qa()+this.C.T()}};olympe.dc.ba.Lb.ig.C=3;olympe.dc.ba.Lb.ig.ma=[olympe.dc.ba.jk];function Oe(a){a=a.db.oc(a.mb,olympe.dm.Property.typeRel);if(a===olympe.dc.wa(olympe.dm.String))return Pe((b,c)=>b.localeCompare(c));if(a===olympe.dc.wa(olympe.dm.Number)||a===olympe.dc.wa(olympe.dm.Boolean))return Pe((b,c)=>b-c);if(a===olympe.dc.wa(olympe.dm.DateTime))return Pe((b,c)=>b.getTime()-c.getTime());olympe.sa.Ya('dc').warn(`No comparator found for type with tag ${a}`);return Pe(()=>-1)}function Pe(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.ba.Lb.Qh=class{constructor(a,b,c){this.db=a;this.mb=b;this.order=c}F(a){return a}ib(a,b){Ge(a,Oe(this),b,this.order,this.mb)}observe(a,b,c){Ge(a,Oe(this),b,this.order,this.mb);return(d,e,f,g)=>{g=olympe.W.ob(g+this.toString());d?xd(this.db,e,this.mb,()=>{Ie(a)},g):this.db.F(e,this.mb,g);c(d,e,f,g)}}ia(){return{t:4,p:this.mb.T(),o:this.order}}toString(){return'sortByQueryPart-'+this.order+this.mb.T()}gb(){return this.mb}};olympe.dc.ba.Lb.Qh.C=4;olympe.dc.ba.Lb.Qh.ma=[olympe.dc.ba.jk];olympe.dc.query={};function Qe(a,b,c,d){let e=a.C.get(b);void 0===e&&(e=new Set,a.C.set(b,e));a=olympe.W.fc();e.add(a);d.set(a,c)}function Re(a,b,c){Qe(a,b,c,a.F)}function Se(a,b,c){if(a.C.has(b)){for(const d of a.C.get(b))c.delete(d);a.C.delete(b)}}function Te(a,b,c,d,e){if(a.C.has(b)){if(!a.L.has(b)){a.L.add(b);for(const f of a.C.get(b))e=d.get(f),d.delete(f),c instanceof olympe.dc.query.Xi.Uj?e(Error(c.ea()),c):'string'===typeof c?e(Error(c),null):e(null,c);a.C.delete(b);a.L.delete(b)}}else a.N.warn(e)}
537
- function Ue(a,b,c){Te(a,b,c,a.F,`Graph result of graphdef ${b} has no associated handler in the datacloud`)}function Ve(a,b,c){Qe(a,b,c,a.G)}olympe.dc.query.Ns=class{constructor(a){this.N=a;this.C=new Map;this.F=new Map;this.G=new Map;this.L=new Set}};olympe.dc.Ne=class{na(){}L(){}G(){}R(){}ia(){}toString(){}};olympe.dc.Hd={SUBSCRIBE:0,Ii:1,lm:2,XA:0,GET:1};olympe.dc.Hd.toString=function(a){for(const [b,c]of Object.entries(olympe.dc.Hd))if(c===a)return b;return null};function te(a,b=1){a.validate(olympe.dc.Ub.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 We(a){return'not_defined'===a.C?olympe.dc.Ub.NONE:a.C}function Xe(a,b){a.validate(b,'activateFollowRules');return a}function Ye(a){return'not_defined'!==a.C&&a.C!==olympe.dc.Ub.NONE}
538
- function Ze(a){if(Ye(a))throw Error('An implicit GraphDef has no blocks');return a.F.values()}
539
- function $e(a,b,c){c=new olympe.dc.query.Relation(b.T(),b.Qa(),c||b instanceof olympe.dc.X.Dc);b=[];var d;for(var e of af(a)){if(d=a.F.get(e)){var f=new olympe.dc.query.Tj(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.ob(d.G);f=olympe.W.ob(h+g.toString());g=d.F.get(f)||new olympe.dc.query.Tj(g,h);d.R.set(f,g);d=g}f=d.Z();a.F.set(f,d);b.push(f)}e=b[0];a.qa.set(e,b);return a.F.get(e)}
540
- function bf(a,b){if(Ye(a))a.ea.push(b);else throw Error('You cannot add a "skip predicate" to an explicit graphdef. Please activate a follow rule first.');return a}function cf(a,b){a.ka=b;return a}function df(a){const b=new olympe.dc.hf(a.G,a.L);b.C=a.C;for(const [c,d]of a.R)b.R.set(c,d);for(const [c,d]of a.F)b.F.set(c,d);b.ka=a.ka;b.ea=[...a.ea];return b}function ef(a,b){return Ye(a)?new olympe.dc.query.Ol(df(a),b||olympe.D.Ia()):new olympe.dc.query.Sj(df(a),b||olympe.D.Ia())}
541
- function af(a){let b=a.Y;const c=[];for(;b&&b.Sd().recursive;)c.push(b.Z()),b=a.F.get(b.F)||null;c.push(b&&b.Z()||olympe.W.ob(a.G));const d=[];c.slice(0,5).forEach(e=>{d.push(...a.qa.get(e))});return d}
542
- olympe.dc.hf=class{constructor(a,b=olympe.dc.Hd.SUBSCRIBE){if(void 0===a||null===a)throw Error('Cannot create GraphDef with undefined or null baseTag');this.G=olympe.dc.wa(a);this.L=b;this.C='not_defined';this.ea=[];this.Y=null;this.R=new Map;this.F=new Map;this.ka=null;this.qa=(new Map).set(olympe.W.ob(this.G),[olympe.W.ob(this.G)])}static Mc(a,b){olympe.dc.hf.Ue([a],b)}static Ue(a,b){const c=new olympe.dc.Transaction;a.forEach(d=>c.delete(d,olympe.dc.Ub.Hc));c.ib(b)}toJSON(){const a=Object.create(null),
543
- b=c=>{const d=Object.create(null),e=c.Sd();d.t=e.T();d.d=e.Qa();d.r=e.recursive;d.c=c.kh().map(b);return d};a.t=this.G;a.o=this.L;a.f=We(this);a.b=Array.from(this.R.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=Xe(new olympe.dc.hf(a.t,a.o),a.f),c=d=>{const e=new olympe.dc.va.Relation(d.t,d.d);b.vb(e,d.r);for(const f of d.c)c(f);te(b)};for(const d of a.b)c(d);return b}Z(){const a=olympe.W.ob,b=d=>d.Z()+d.kh().map(e=>b(e)).sort().join(''),
544
- c=Array.from(this.R,([,d])=>b(d)).sort().join('');return a(`${this.L}-${this.G}${c}-${We(this)}`)}add(a,b=!1){this.validate(olympe.dc.Ub.NONE,'add');$e(this,a,b);return this}vb(a,b=!1){this.validate(olympe.dc.Ub.NONE,'follow');this.Y=$e(this,a,b);return this}ib(a=b=>b){'not_defined'===this.C&&(this.C=olympe.dc.Ub.NONE);const b=olympe.dc.Kf();a=olympe.D.Ia().C(a);switch(this.L){case olympe.dc.Hd.SUBSCRIBE:case olympe.dc.Hd.Ii:const c=ff(b,this,a);olympe.D.Ia().xc(()=>{gf(olympe.dc.Kf(),c.Z())});break;
545
- case olympe.dc.Hd.lm:hf(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.Ub.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 jf(a,b){a.data.$c(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 kf(d);f.add=c.add;f.remove=e;b.C.set(d,f)}})}function lf(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}Z(){return this.id}};class kf{constructor(a){this.id=a;this.add=[];this.remove=[]}Z(){return this.id}};function mf(a){return(a=a.C)&&olympe.dc.Pa().source(a)||olympe.dc.Ka.Xc}function nf(a){return Array.from(a.Fa,b=>a.F.get(b))}function of(a){if(!a.L){for(const b of a.R.values())b();a.R.clear();a.L=!0}}
546
- olympe.dc.query.Sj=class{constructor(a,b){this.ph=a;this.C=a.G;this.id=a.Z();this.ea=new olympe.D.Zb(`GraphSubscription ${this.id}`,b);this.N=olympe.sa.Ya('dc.query');this.Fa=[];this.F=new Map;this.L=!1;this.R=new Map;b=olympe.W.ob(this.C);if(!Ye(a))for(const c of Ze(a))this.F.set(c.Z(),c),c.F===b&&this.Fa.push(c.Z())}Z(){return this.id}Je(a,b){b=b||olympe.W.fc();this.L?a():this.R.set(b,olympe.D.Ia().C(a));return b}nj(a){return this.R.delete(a)}onDestroy(a){this.ea.onDestroy(a)}release(){this.ea.destroy()}Y(){return function*(a,
547
- b){yield a;for(const c of b)yield*c.ge()}(this.C,this.F.values())}ka(a){const b=olympe.W.ob(this.C);pf(a,(c,d)=>{if(b!==c)if(c=this.F.get(c),void 0===c)this.N.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)})}qa(a){let b=[],c=[];const d=olympe.W.ob(this.C);lf(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.N.error(`A notification contains a block ${e} which is not present in the current graph query ${this.id}`)});Pc(olympe.dc.Dd(),b,c)}Er(a){const b=a.C,c=[],d=this.C;d===b&&c.push(olympe.W.ob(d));this.F.forEach((k,l)=>{k.C.has(b)&&c.push(l)});const e=olympe.W.ob,f=this.F,g=(k,l)=>{const n=l.Sd(),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.kh().reduce((q,r)=>q&&g(p[0],r),!0):!1},h=nf(a);return void 0!==c.find(k=>{for(const l of h)if(!g(k,
549
- l))return!1;return!0})}};olympe.dc.query.Tj=class{constructor(a,b){this.G=a;this.children=new Map;this.C=new Set;this.F=b;this.id=olympe.W.ob(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 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.Tj(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.Tj.mc(c),a.children.set(b.id,b);return a}Z(){return this.id}Sd(){return this.G}kh(){return Array.from(this.children.values())}ge(){return this.C.values()}toString(){return this.F+
551
- this.G.toString()}};function pf(a,b){a.C.forEach((c,d)=>b(d,c))}
552
- olympe.dc.query.zi=class{constructor(a,b,c,d){this.id=a;this.source=b;this.destination=c;this.C=new Map;this.Gc=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.Gc.toJSON()}`;return a+'}'}static mc(a){let b;'string'===typeof a?b=JSON.parse(a):
553
- b=a;a=olympe.dc.db.zc.mc(b.patch);a=new olympe.dc.query.zi(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 qf=olympe.dc.jc.Wc,rf=olympe.dc.jc.ui,sf=olympe.dc.Aa.ORIGIN,tf=olympe.dc.Aa.DESTINATION;function uf(a,b,c){const d=a.ph.ea;return c.filter(e=>d.reduce((f,g)=>f&&!g(b,e.Sd()),!0))}
554
- olympe.dc.query.Ol=class extends olympe.dc.query.Sj{constructor(a,b){super(a,b);this.G=(new Set).add(a.G)}Y(){return this.G.values()}ka(a){a=a.Gc;for(const b of a.ge())b.L()?this.G.delete(b.tag()):b.te()&&this.G.add(b.tag())}qa(a){let b=[],c=[];lf(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.Dd(),b,c)}Er(a){var b=a.C,c=Array.from(a.F.values()),d=uf(this,b,c);if(d.length===c.length&&!this.G.has(b))return!1;
555
- b=olympe.dm.Relation.C.yk;c=olympe.dm.Relation.C.mk;const e=olympe.dc.Pa();for(const h of d){var f=h.Sd(),g=f.T();d=f.Qa();if(d!==tf||g!==qf&&g!==rf){if(!e.Gb(f))return this.N.info('ImplicitGraphQuery: checking coverage of graphPath',a.Z(),'failed at the relation',g,'which is not in local DB'),!1;f=zd(e,f,We(this.ph));g=0===h.kh().length;if(!(f&(d===sf?g?12:c:g?3:b)))return!1}}return!0}};function vf(a){let b=null;for(a=[...a.X];null===b&&0<a.length;)b=a.pop().$b();return b}function wf(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.sa.Ya('dc').warn(a))}
556
- function xf(a,b){const c=new olympe.D.Zb('listDef toObservable',a.nc().Gh());return new rxjs.Observable(d=>{c.run(()=>{olympe.D.yc([b],e=>{d.next(e.valueOf())})});c.onDestroy(()=>{d.complete()});return c.destroy.bind(c)})}
557
- olympe.dc.Ba=class{constructor(a,b,c){void 0===a||null===a?olympe.sa.Ya('dc').warn('attempt to create a listdef with a null or undefind basetag. This listdef is thus without effect.'):(this.F=olympe.D.Ga([a],olympe.dc.wa,String),this.X=void 0!==b&&(Array.isArray(b)?b:[b])||[],this.valueType=c||vf(this),this.C=null)}Tc(){return olympe.dc.Tc()}ib(){if(null===this.C){const a=olympe.dc.Kf();this.C=yf(a,this);null!==this.valueType&&this.C.Jd(this.valueType);olympe.D.Ia().xc(()=>{zf(a,this.C.Z());this.C=
558
- null})}return this}nc(){null===this.C&&this.ib();return this.C}Jd(a){this.valueType=a;null!==this.C&&this.C.Jd(this.valueType)}$b(){return null!==this.C?this.C.$b():null===this.valueType?olympe.dc.CloudObject:this.valueType}Qd(){return this.F}Rl(){return this.X}Je(a,b){return this.nc().Je(a,b)}nj(a){this.nc().nj(a)}Jt(){return this.nc().Pf()}It(){return this.nc().Y()}get(a){return this.nc().get(a)}di(){return this.nc().di()}lh(a){const b=this.nc();wf(b,'getCurrent');return b.lh(a)}has(a){return this.nc().has(a)}Dg(a){const b=
559
- this.nc();wf(b,'hasCurrent');return b.Dg(a)}se(a){return this.nc().se(a)}Nx(a){return xf(this,this.se(a))}We(a){const b=this.nc();wf(b,'getCurrentAt');return b.We(a)}Xe(a){return this.nc().Xe(a)}Df(a){const b=this.nc();wf(b,'getCurrentKeyAt');return b.Df(a)}he(a){return this.nc().he(a)}Rx(a){return xf(this,this.he(a))}Ef(a){const b=this.nc();wf(b,'getCurrentRank');return b.Ef(a)}Rc(){return this.nc().Rc()}Ox(){return xf(this,this.Rc())}Ff(){return this.nc().Ff()}lf(){return this.nc().lf()}Sx(){return xf(this,
560
- this.lf())}yg(){const a=this.nc();wf(a,'getCurrentSize');return a.yg()}forEach(a,b){this.nc().forEach(a,b)}fe(a){const b=this.nc();wf(b,'forEachCurrentValue');return b.fe(a)}Zi(a,b,c,d){a=new olympe.dc.X.be(a,b);(new olympe.dc.Ba(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.va.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.Ba(this.F,a);b.Jd(vf(b)||this.valueType||Object);return b}kl(a){return this.transform(new olympe.dc.X.uf(a))}filter(a){return this.transform(new olympe.dc.X.uc(a))}ug(){const a=new olympe.dc.bk(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.Za(this.F)+a+')'}Ht(){return this.nc().Ug()}kd(){return olympe.D.Ga([this.lf()],a=>{let b='[';for(let c=0;c<a;c++){const d=this.We(c).toString();b=0<c&&c<a?b+(', '+d):b+d}return olympe.D.Cb(b+']')},olympe.D.Xa)}};olympe.dc.Ba.prototype.filter=olympe.dc.Ba.prototype.filter;olympe.dc.Ba.prototype.union=olympe.dc.Ba.prototype.kl;
563
- olympe.dc.Ba.prototype.transform=olympe.dc.Ba.prototype.transform;olympe.dc.Ba.prototype.forEachCurrentValue=olympe.dc.Ba.prototype.fe;olympe.dc.Ba.prototype.forEach=olympe.dc.Ba.prototype.forEach;olympe.dc.Ba.prototype.getCurrentSize=olympe.dc.Ba.prototype.yg;olympe.dc.Ba.prototype.observeSize=olympe.dc.Ba.prototype.Sx;olympe.dc.Ba.prototype.observeFirst=olympe.dc.Ba.prototype.Ox;olympe.dc.Ba.prototype.getCurrentRank=olympe.dc.Ba.prototype.Ef;olympe.dc.Ba.prototype.observeRank=olympe.dc.Ba.prototype.Rx;
564
- olympe.dc.Ba.prototype.getCurrentAt=olympe.dc.Ba.prototype.We;olympe.dc.Ba.prototype.observeAt=olympe.dc.Ba.prototype.Nx;olympe.dc.Ba.prototype.offReady=olympe.dc.Ba.prototype.nj;olympe.dc.Ba.prototype.onReady=olympe.dc.Ba.prototype.Je;olympe.dc.Ba.prototype.getBaseTag=olympe.dc.Ba.prototype.Qd;olympe.dc.Ba.ma=[olympe.D.pd];m=olympe.dc.Ba.prototype;m.Tc.K=olympe.D.J.C;m.ib.K=olympe.D.J.L();m.nc.K=new olympe.D.J(()=>olympe.dc.query.Subscription,[]);m.Jd.K=new olympe.D.J(()=>{},[]);
565
- m.Qd.K=new olympe.D.J(()=>String,[]);m.Rl.K=new olympe.D.J(()=>Array,[]);m.Je.K=new olympe.D.J(()=>String,[]);m.nj.K=new olympe.D.J(()=>{},[]);m.Jt.K=olympe.D.J.R;m.It.K=olympe.D.J.C;m.get.K=new olympe.D.J(()=>olympe.dc.CloudObject,[],'valueType');m.di.K=new olympe.D.J(()=>Array,[]);m.lh.K=olympe.D.J.C;m.has.K=olympe.D.J.R;m.Dg.K=olympe.D.J.C;m.se.K=new olympe.D.J(()=>olympe.dc.CloudObject,[],'valueType');m.We.K=olympe.D.J.C;m.Xe.K=new olympe.D.J(()=>String,[]);m.Df.K=olympe.D.J.C;m.he.K=olympe.D.J.G;
566
- m.Ef.K=olympe.D.J.C;m.Rc.K=new olympe.D.J(()=>olympe.dc.CloudObject,[],'valueType');m.Ff.K=new olympe.D.J(()=>String,[]);m.lf.K=olympe.D.J.G;m.yg.K=olympe.D.J.C;m.forEach.K=new olympe.D.J(()=>{},[]);m.fe.K=olympe.D.J.C;m.Zi.K=new olympe.D.J(()=>{},[]);m.transform.K=new olympe.D.J(()=>olympe.dc.Ba,[]);m.kl.K=new olympe.D.J(()=>olympe.dc.Ba,[]);m.filter.K=new olympe.D.J(()=>olympe.dc.Ba,[]);m.ug.K=new olympe.D.J(()=>olympe.dc.bk,[]);m.toString.K=olympe.D.J.C;m.Ht.K=olympe.D.J.C;m.kd.K=olympe.D.J.F;const Af={Ey:'append',El:'filter_not',Lo:'filter_and',Mo:'filter_or'};function Bf(a,b){a=Cf(a);a=olympe.dc.CloudObject.get(a);return(new olympe.dc.oa.On(a,b)).F}
567
- olympe.dc.bk=class{constructor(a,b){this.C=Cf(a);this.N=olympe.dc.Kf().Ya();this.valueType=void 0===b?olympe.dc.CloudObject:b;this.X=[];this.ua=[]}mf(){return new olympe.dc.Ba(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 Df('transform','Trying to set an undefined transformer');if(d instanceof olympe.dc.va.Property)throw new Df('transform','Properties cannot be used as transformer, unlike relations '+d);if(!d||'function'!==typeof d.getTransform)throw new Df('transform',
568
- 'one of the argument is not a Transformer '+d);const e=d.$b();null!==e&&(this.valueType=e);this.X.push(d)}return this}kl(a){this.X.push(new olympe.dc.X.uf(a));return this}yy(a){this.X.push(new olympe.dc.X.uf(Cf(a)));return this}Lt(a){this.valueType=a;return this}vb(a){this.X.push(a);this.valueType=a.$b()||olympe.dc.CloudObject;return this}dw(a){for(const b of a)this.X.push(b),this.valueType=b.$b()||olympe.dc.CloudObject;return this}Lk(a,b,c){a=new olympe.dc.X.Dc(a,a.Qa(),b,c);this.X.push(a);this.valueType=
569
- a.$b()||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.T());void 0===c&&(c=e.Qa())}a=new olympe.dc.X.Be(b,c);this.X.push(a);this.valueType=a.$b()||olympe.dc.CloudObject;return this}Kt(){this.vb(olympe.dc.CloudObject.instancesRel);return this}Ve(a){var b=this.ua.pop();b===Af.El&&(a=new olympe.dc.V.md(a),b=this.ua.pop());switch(b){case Af.Lo:b=this.X.pop().C;b instanceof olympe.dc.V.Xd?(b=b.V,b.push(a),a=new olympe.dc.V.Xd(...b)):a=new olympe.dc.V.Xd(b,
570
- a);b=this.ua.pop();break;case Af.Mo:b=this.X.pop().C,b instanceof olympe.dc.V.de?(b=b.V,b.push(a),a=new olympe.dc.V.de(...b)):a=new olympe.dc.V.de(b,a),b=this.ua.pop()}b===Af.El&&(a=new olympe.dc.V.md(a),this.ua.pop());this.X.push(new olympe.dc.X.uc(a));return this}Wv(a,b,c){return this.Ve(new olympe.dc.V.Ic(Bf(a,c),new olympe.dc.oa.bd(b)))}contains(a,b,c=!1,d){return this.Ve(new olympe.dc.V.Vc(Bf(a,d),new olympe.dc.oa.bd(b),c))}qh(a){if(!(a instanceof Array))throw new Df('instanceOf','Provided argument "models" must be an array.');
571
- const b=[];for(let c=0;c<a.length;c++)b.push(Cf(a[c]));return this.Ve(new olympe.dc.V.kf(b))}Sk(a){return this.Ve(new olympe.dc.V.Ic(new olympe.dc.oa.sf,new olympe.dc.oa.bd(Cf(a))))}Xv(a){if(!Array.isArray(a))throw Error('ExcludeInstances should be called with an array');if(0<a.length){this.not().Sk(a[0]);for(let b=1,c=a.length;b<c;b++)this.and().not().Sk(a[b])}return this}hj(a,b){if(!(a instanceof Array))throw new Df('hasRelated','Provided argument "relations" must be an array.');const c=[],d=[];
572
- a.forEach(e=>{c.push(e);d.push(e.Qa())});return this.Ve(new olympe.dc.V.jf(c,d,b))}Rk(a,b,c){a=Bf(a,c);return this.Ve(new olympe.dc.V.ye(a,new olympe.dc.oa.bd(b)))}vj(a,b,c){a=Bf(a,c);return this.Ve(new olympe.dc.V.Fe(a,new olympe.dc.oa.bd(b)))}Bx(a,b,c,d){a=Bf(a,d);return this.Ve(new olympe.dc.V.zd(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.Ve(b)}not(){this.ua.push(Af.El);return this}and(){this.X[this.X.length-1]instanceof
573
- olympe.dc.X.uc&&this.ua.push(Af.Lo);return this}or(){this.X[this.X.length-1]instanceof olympe.dc.X.uc&&this.ua.push(Af.Mo);return this}Bn(a,b,c){a=Cf(a);let d=null;switch(olympe.dc.Pa().oc(a,olympe.dm.Property.typeRel)){case olympe.dm.String.P.T():d=new olympe.dc.Db.String(new olympe.dc.oa.qe(a,c));break;case olympe.dm.Number.P.T():d=new olympe.dc.Db.Number(new olympe.dc.oa.me(a,c));break;case olympe.dm.DateTime.P.T():d=new olympe.dc.Db.DateTime(new olympe.dc.oa.le(a,c))}c=d;null!==c&&this.X.push(new olympe.dc.X.Od(c,
574
- b));return this}sort(a,b,c){const d=new class extends olympe.dc.Db.Mg{L(e,f){return a(olympe.dc.CloudObject.get(f))}G(e,f){return b(e,f).valueOf()}};this.X.push(new olympe.dc.X.Od(d,c));return this}Sv(){this.X.push(new olympe.dc.X.Gd);return this}limit(a,b){this.X.push(new olympe.dc.X.be(a,b));return this}};class Df extends Error{constructor(a,b){super(`ListDefBuilder.${a}(): ${b}`)}}
575
- function Cf(a){return'string'===typeof a||a instanceof olympe.D.Xa?a:'function'===typeof a?olympe.dc.Ca.Wb(a):olympe.D.nb(a)?a.Dk===olympe.D.Xa?a:olympe.D.Ga([a],b=>olympe.D.Cb(olympe.dc.wa(b)),olympe.D.Xa):a.T()}m=olympe.dc.bk.prototype;m.mf.K=new olympe.D.J(()=>olympe.dc.Ba,[]);m.transform.K=olympe.D.J.L();m.kl.K=olympe.D.J.L();m.yy.K=olympe.D.J.L();m.Lt.K=olympe.D.J.L();m.vb.K=olympe.D.J.L();m.dw.K=olympe.D.J.L();m.Lk.K=olympe.D.J.L();m.aw.K=olympe.D.J.L();m.Kt.K=olympe.D.J.L();m.Ve.K=olympe.D.J.L();
576
- m.Wv.K=olympe.D.J.L();m.contains.K=olympe.D.J.L();m.qh.K=olympe.D.J.L();m.Sk.K=olympe.D.J.L();m.Xv.K=olympe.D.J.L();m.hj.K=olympe.D.J.L();m.Rk.K=olympe.D.J.L();m.vj.K=olympe.D.J.L();m.Bx.K=olympe.D.J.L();m.filter.K=olympe.D.J.L();m.not.K=olympe.D.J.L();m.and.K=olympe.D.J.L();m.or.K=olympe.D.J.L();m.Bn.K=olympe.D.J.L();m.sort.K=olympe.D.J.L();m.Sv.K=olympe.D.J.L();m.limit.K=olympe.D.J.L();olympe.dc.query.Hp=class{constructor(a){this.id=a;this.C=[];this.data=new olympe.dc.db.zc}F(a){this.C.push(olympe.dc.wa(a))}Z(){return this.id}getData(){return this.data}};function Ef(a){return olympe.D.nb(a)?'Node#'+a.Na.Z():String(a)}function Ff(a,b){return olympe.D.nb(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.nb(a)?'n'+a.Na.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.bb=class{na(){}C(){}F(){}ia(){}toString(){}};function we(a,b,c){return c.run(()=>a.R.ib(b,c))}function xe(a,b,c){return c.run(()=>Gf(a.R,b,c))}
578
- function ff(a,b,c){var d=olympe.dc.Ka.rb;const e=b.Z();let f=Hf(a.va,e),g=olympe.dc.Ka.rb;null===f&&(f=ef(b,a.G),a.L||(g=mf(f)));If(a.va,f,d,g);c&&Re(a.F,e,c);b=olympe.dc.ga.ja.xi;const h=olympe.dc.ga.ja.wi,k=l=>{if(null!==l){a.N.error(`graph subscription "${e}" failed to subscribe ${l}`);Jf(a.va,e,d);var n=a.F;Se(n,e,n.F);c(l,null)}};g===olympe.dc.Ka.rb?(a.N.debug('QueryManager: [ID:',e,'] GraphQuery processed locally'),a.Y.process(d,f,k)):(b=M(new olympe.dc.ga(f.ph.L===olympe.dc.Hd.Ii?h:b,f,[g]),
579
- k),a.N.debug('QueryManager: [ID:',e,'] sending GraphQuery to',g),a.C.send(b));return f}function gf(a,b){var c=olympe.dc.Ka.rb;const d=olympe.dc.Ka.rb;if(c===d){const e=Hf(a.va,b).ph.L,f=Kf(a.va,b);Jf(a.va,b,c)&&f!==d&&e===olympe.dc.Hd.SUBSCRIBE&&(c=M(new olympe.dc.ga(olympe.dc.ga.ja.Vo,String(b),[f]),g=>{g&&a.N.error(`Unsubscription of graphdef ${b} failed: ${g.message}`)}),a.C.send(c))}else Jf(a.va,b,c)}
580
- function hf(a,b,c){var d=olympe.dc.Ka.rb;b=ef(b,a.G);const e=b.Z();var f=a.F.C.has(e);c&&Re(a.F,e,c);if(!f){f=h=>{if(h){var k=a.F;Se(k,e,k.F);c(h,null)}};var g=mf(b);g===olympe.dc.Ka.rb?a.Y.process(d,b,f):(d=M(new olympe.dc.ga(olympe.dc.ga.ja.wi,b,[g]),f),a.C.send(d))}}
581
- function yf(a,b){var c=olympe.dc.Ka.rb;const d=b.Qd();var e=new olympe.dc.query.uu;let f;f=d;olympe.D.nb(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=Lf(a.va,g);null===e&&(a.N.debug('QueryMGR: new',a.L?'local':'remote','subscription "',g,'": #',`${f},`,b),e=new olympe.dc.query.Subscription(g,d,b,a.G),a.L||e.td());a.Ta.process(c,e,h=>{h&&(Mf(a.va,g,c||olympe.dc.Ka.rb),a.N.error(`subscription "${g}" failed to subscribe ${h}`))});return e}
582
- function zf(a,b){var c=olympe.dc.Ka.rb;if(c===olympe.dc.Ka.rb){const d=Kf(a.va,b);a.N.debug('QueryMGR: [ID:',b,'] - Unregistered');Mf(a.va,b,c)&&d!==olympe.dc.Ka.rb&&(c=M(new olympe.dc.ga(olympe.dc.ga.ja.Ru,String(b),[d]),e=>{e&&a.N.error(`Unsubscription of listdef ${b} failed, ${e.message}`)}),a.C.send(c))}else Mf(a.va,b,c)}
583
- function Nf(a){const b=olympe.dc.ga.ja.Wo,c=olympe.dc.ga.ja.yl,d=olympe.dc.ga.ja.Ap;a.C.C(olympe.dc.ga.ja.Hl,(e,f)=>{Of(a,f,e)});a.C.C(b,(e,f)=>{Pf(a,f,e)});a.C.C(c,(e,f)=>{a.ea.af(f,e)});a.C.C(d,(e,f)=>{Qf(a,f,e)});a.C.qa((e,f)=>{Rf(a,f,e)})}function Sf(a,b){a.N.log('Received subscribeToAll command');b=b?olympe.D.Ia().C(b):void 0;const c=new olympe.dc.ga(olympe.dc.ga.ja.Rg,null,[olympe.dc.Ka.Xc]);b&&M(c,b);a.C.send(c)}
584
- function Of(a,b,c=olympe.dc.Ka.rb){b.destination!==olympe.dc.Ka.rb?a.N.error(`Graphdefs registered from peers is not supported yet ! (id: ${b.Z()})`):a.qa.process(c,b,d=>{d&&a.N.error(`An error occurred during the process of a graphdef result ${b.Z()}: ${d.message}`)})}
585
- function Pf(a,b,c=olympe.dc.Ka.rb){const d=Tf(a.va,b.Z());0!==d.length&&(1<d.length||d[0]!==olympe.dc.Ka.rb?a.N.error(`Notification received for graphdefs subscription registered from peers. Not supported yet ! (id: ${b.Z()})`):a.ka.process(c,b,e=>{e&&a.N.error(`An error occurred during the process of a graphNotification ${b.Z()}`)}))}
586
- function Qf(a,b,c=olympe.dc.Ka.rb){const d=Uf(a.va,b.Z());1<d.length||d[0]!==olympe.dc.Ka.rb?a.N.error(`Listdefs registered from peers is not supported yet ! (id: ${b.Z()})`):a.Fa.process(c,b,e=>{e&&a.N.error(`An error occurred during the process of a listNotification ${b.Z()}`)})}
587
- function Rf(a,b,c){a.N.debug('Source event',b,'received for source',c);if(b===olympe.dc.tk.Yp){const d=(e,f)=>{f&&a.N.error(`Error after trying to resubscribe to ${e}: ${f}`)};Vf(a.va,c).forEach(e=>{Re(a.F,e.Z(),d.bind(a,e.Z()));a.N.debug(`resubscribing graph subscription ${e.Z()} to destination : ${c}`);e=M(new olympe.dc.ga(olympe.dc.ga.ja.xi,e,[c]),d.bind(a,e.Z()));a.C.send(e)});Wf(a.va,c).forEach(e=>{a.N.debug(`resubscribing list subscription ${e.Z()} to destination : ${c}`);e=M(new olympe.dc.ga(olympe.dc.ga.ja.Pu,
588
- e,[c]),d.bind(a,e.Z()));a.C.send(e)})}}olympe.dc.query.Au=class{constructor(a,b,c,d,e,f,g,h){this.N=a;this.L=b;this.C=c;this.ea=d;this.va=e;this.F=f;this.G=new olympe.D.Zb('Query Manager context');this.Ta=g[0];this.Y=g[1];this.qa=g[2];this.ka=g[3];this.Fa=g[4];this.R=h;Nf(this)}Ya(){return this.N}};olympe.dc.query.Relation=class extends olympe.dc.va.Relation{constructor(a,b,c){super(a,b);this.recursive=c}toJSON(){let a='{ "tag": '+JSON.stringify(this.T())+', ';a+='"direction": '+JSON.stringify(this.Qa())+', ';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.T(),a.Qa(),a instanceof olympe.dc.X.Dc)}Sc(){const a=
589
- olympe.dc.Aa.DESTINATION,b=olympe.dc.Aa.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.Bj{constructor(b,c,d,e){super(olympe.dc.CloudObject,new olympe.D.Zb('context subscription '+b,e));this.id=b;this.Of=c;this.X=d||null;this.G=this.R.run(()=>olympe.D.ie(olympe.dc.query.Subscription.C.INIT));this.Ge=!1;this.ka=this.ee=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.ob(e)}catch(f){e=olympe.W.fc()}return e}Z(){return this.id}Qd(){return this.Of}Bg(){return this.X}td(){const b=
590
- olympe.dc.Pa(),c=olympe.D.Za(this.Qd());return c?b.Uf(c)?b.source(c)||olympe.dc.Ka.Xc:olympe.dc.Ka.rb:olympe.dc.Ka.Xc}th(){const b=this.G.Na.Ib;return b&&b.valueOf()>=olympe.dc.query.Subscription.C.Nq}uh(){if(this.G.Na.zb())throw Error(`Cannot set destroyed subscription '${this.id}' as subscribed`);const b=this.ee;this.ee=null;for(let c in b)if(Object.prototype.hasOwnProperty.call(b,c))b[c](this);pb(this.G,olympe.D.ie(olympe.dc.query.Subscription.C.Nq))}Pf(){return olympe.D.Ga([this.G],()=>{},olympe.D.ra)}Y(){const b=
591
- this.G.Na.Ib;return b&&b.valueOf()>=olympe.dc.query.Subscription.C.uq}Je(b,c){this.Y()?b(this):(null===this.ka&&(this.ka=new Map),void 0===c&&(c=olympe.W.fc()),this.ka.set(c,olympe.D.Ia().C(b)));return c||''}nj(b){null!==this.ka&&b&&this.ka.delete(b)}Pc(){const b=olympe.dc.query.Subscription.C.uq;if(!this.G.Na.zb()&&olympe.D.Za(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.R.onDestroy(b)}release(){this.R.destroy()}Tb(b){if(!this.G.Na.zb()){for(let c=
592
- 0,d=b.length;c<d;c++)this.Dm(b[c],c);if(this.Y())this.yf();else{this.Ge=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.Pc()}}}Lc(b){const c=this.F;for(let d in c)Object.prototype.hasOwnProperty.call(c,d)&&b(c[d],d)}cc(b,c){if(!this.G.Na.zb()&&(this.Fk(b,olympe.dc.CloudObject.get(c)),b=this.Y(),this.Ge&&!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.Pc()}}lc(b){this.G.Na.zb()||(this.Cm(b),this.Qi(b,!this.Y()))}Ug(){return this.Y()?super.Ug():'Subscription is not ready!'}Vf(){const b=olympe.D.Za(this.Qd());return olympe.dc.query.Subscription.F(b,this.Bg())}static F(b,c){var d=new olympe.dc.hf(b,olympe.dc.Hd.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.Sb||g instanceof olympe.dc.X.Dc)b.forEach(h=>{const k=olympe.dc.query.Relation.from(g);h.vb(k,k.recursive)});
594
- else if(g instanceof olympe.dc.X.uf)d=a.F(olympe.D.Za(g.Qd()),g.Bg()),b.push(...d);else if(g instanceof olympe.dc.X.uc||g instanceof olympe.dc.X.Od){const h=g.F();b.forEach(k=>{for(const l of h){for(const n of l)k.vb(n,n.recursive);te(k,l.length)}})}}return b}};olympe.dc.query.Subscription.C={INIT:0,Nq:1,uq:2};olympe.dc.query.Subscription.prototype.Ug.K=olympe.D.J.C;function Lf(a,b){return a.F.has(b)?a.F.get(b).F():null}function Mf(a,b,c){return Xf(a,a.F,b,c)}function Kf(a,b){for(const [c,d]of a.L)if(d.has(b))return c;return null}function Hf(a,b){return a.C.has(b)?a.C.get(b).F():null}function If(a,b,c,d){const e=b.Z();let f=a.C.get(e);void 0===f&&(f=new olympe.dc.query.va.qt(b,a.Y,a),a.C.set(e,f));f.L(c);Yf(a,e,d)}function Jf(a,b,c){return Xf(a,a.C,b,c)}function Tf(a,b){return(a=a.C.get(b))?Array.from(a.C.keys()):[]}
595
- function Uf(a,b){return(a=a.F.get(b))?Array.from(a.C.keys()):[]}function Vf(a,b){const c=new Set;(a.L.get(b)||new Set).forEach(d=>{(d=a.C.get(d))&&c.add(d.F())});return c}function Wf(a,b){const c=new Set;(a.L.get(b)||new Set).forEach(d=>{(d=a.F.get(d))&&c.add(d.F())});return c}function Zf(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 Yf(a,b,c){let d=a.L.get(c);d?d.add(b):(d=(new Set).add(b),a.L.set(c,d))}function $f(a,b,c){var d=olympe.dc.Ka.rb;const e=b.Z();let f=a.F.get(e);void 0===f&&(f=new olympe.dc.query.va.cu(b,a.Y),a.F.set(e,f));f.L(c);Yf(a,e,d)}function Xf(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=Kf(a,c))&&a.L.get(d).delete(c),e.F().release(),b.delete(c),!0):0===e.C.get(d)}
597
- function ag(a,b){const c=b.Z();let d=a.G.get(c);d||(d=new olympe.dc.query.va.Bu(b),a.G.set(c,d));d.counter++;return d}function bg(a,b){(a=a.G.get(b))&&a.update()}function cg(a,b,c){const d=a.C.get(b);d?c instanceof olympe.dc.query.Subscription?dg(d,c):eg(d,c):a.N.error(`Try to set the subscription ${c.Z()} as covered by a graphquery that is not registered (${b}).`)}
598
- olympe.dc.query.Wu=class{constructor(a,b){this.N=a;this.C=new Map;this.F=new Map;this.G=new Map;this.R=new Set;this.L=new Map;this.Y=b}};olympe.dc.Zc=class{na(){}$b(){}getTransform(){}ia(){}toString(){}};olympe.dc.pq=class{F(){}};olympe.dc.wf=class{na(){}getValue(){}C(){}ia(){}toString(){}};olympe.dc.query.O={Ea:'olympe.dc.query.Logger',xa:'olympe.dc.query.QueryManager'};olympe.dc.query.Nb={Se:'olympe.dc.query.SubscriptionRegistry',Gj:'olympe.dc.query.CallbackRegistry',Yo:'olympe.dc.query.GraphProcessor',Xo:'olympe.dc.query.GraphNotificationProcessor',Zo:'olympe.dc.query.GraphResultProcessor',Bp:'olympe.dc.query.ListProcessor',ak:'olympe.dc.query.ListNotificationProcessor',rq:'olympe.dc.query.QueryProcessor',ul:'olympe.dc.query.CoverageProcessor'};olympe.dc.query.Config={Oq:'subscription.debug'};
599
- olympe.U.config(function(a){E(a,olympe.dc.query.Config.Oq,!1);C(a,olympe.dc.query.O.Ea,[olympe.sa.O.xa],b=>b.Qc('dc.query'));B(a,olympe.dc.query.Nb.Se,olympe.dc.query.Wu,olympe.dc.query.O.Ea,new olympe.U.fa(olympe.dc.query.Config.Oq));B(a,olympe.dc.query.Nb.Gj,olympe.dc.query.Ns,olympe.dc.query.O.Ea);B(a,olympe.dc.query.Nb.Bp,olympe.dc.query.Xb.Jp,olympe.dc.query.O.Ea,olympe.dc.O.si,olympe.dc.query.Nb.Se,olympe.dc.query.Nb.ul,olympe.dc.transaction.O.xa,new olympe.U.fa(olympe.dc.Config.Yg));B(a,olympe.dc.query.Nb.Yo,
600
- olympe.dc.query.Xb.ep,olympe.dc.query.O.Ea,olympe.dc.query.Nb.Se,new olympe.U.fa(olympe.dc.Config.Yg));B(a,olympe.dc.query.Nb.Zo,olympe.dc.query.Xb.fp,olympe.dc.query.O.Ea,olympe.dc.query.Nb.Se,olympe.dc.query.Nb.Gj);B(a,olympe.dc.query.Nb.Xo,olympe.dc.query.Xb.cp,olympe.dc.query.O.Ea,olympe.dc.query.Nb.Se);B(a,olympe.dc.query.Nb.ak,olympe.dc.query.Xb.Ip,olympe.dc.query.O.Ea,olympe.dc.O.si,olympe.dc.query.Nb.Se);B(a,olympe.dc.query.Nb.rq,olympe.dc.query.Xb.Cu,olympe.dc.query.O.Ea,olympe.dc.query.Nb.Se,
601
- olympe.dc.query.Nb.ul,olympe.dc.query.Nb.Gj,olympe.dc.O.oe,olympe.dc.db.O.xa);B(a,olympe.dc.query.Nb.ul,olympe.dc.query.Xb.Qs,olympe.dc.query.O.Ea,olympe.dc.query.Nb.Se,olympe.dc.transaction.O.xa);C(a,olympe.dc.query.O.xa,[olympe.dc.query.O.Ea,new olympe.U.fa(olympe.dc.Config.Yg),olympe.dc.O.oe,olympe.dc.db.O.xa,olympe.dc.query.Nb.Se,olympe.dc.query.Nb.Gj,olympe.dc.query.Nb.Bp,olympe.dc.query.Nb.Yo,olympe.dc.query.Nb.Zo,olympe.dc.query.Nb.Xo,olympe.dc.query.Nb.ak,olympe.dc.query.Nb.rq],(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.U.run([olympe.dc.query.Nb.Se],a=>{olympe.dj().subscriptions=a});olympe.dc.query.va={};function fg(){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.va.Xq=class{constructor(a,b){this.C=new Map;this.G=new Map;this.R=a;this.ka=b}F(){}L(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 dg(a,b){const c=b.Z();a.Y.set(c,b);olympe.D.Ia().onDestroy(()=>{a.Y.delete(c)})}function eg(a,b){const c=b.Z();a.ea.set(c,b);olympe.D.Ia().onDestroy(()=>{a.ea.delete(c)})}olympe.dc.query.va.qt=class extends olympe.dc.query.va.Xq{constructor(a,b,c){super(a,b);this.va=c;this.Y=new Map;this.ea=new Map;b&&fg()}F(){return this.R}};olympe.dc.query.va.cu=class extends olympe.dc.query.va.Xq{constructor(a,b){super(a,b);this.Y=new Map}F(){return this.R}L(a){super.L(a);if(this.ka){const b='md_'+olympe.W.fc();this.Y.set(b,fg());olympe.D.Ia().onDestroy(()=>{this.Y.delete(b)})}}};olympe.dc.query.va.Bu=class{constructor(a){this.query=a;this.F=olympe.dc.Dd();this.id=a.Z();this.C=olympe.D.Nc(olympe.dc.Wa);this.G=null;this.counter=0}update(){const a=olympe.D.Za(this.C)||olympe.dc.Wa.empty(),b=olympe.dc.Wa.from(a,this.G);b!==a&&(Pc(this.F,null,Be(b)),this.C.update(b))}destroy(){const a=olympe.D.Za(this.C)||olympe.dc.Wa.empty();Pc(this.F,null,Ae(a))}};olympe.dc.query.Xb={};function gg(a,b,c,d,e){a.N.debug('CoverageProcessor: [ID:',d,'] - checking coverage of remote query over',b.length,'paths.');const f=new olympe.async.ng(olympe.D.Ia()),g=k=>{f.add((l,n)=>{k.ib(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()});cg(a.va,k.Z(),c)})},h=Array.from(Vf(a.va,olympe.dc.Ka.Xc));b.forEach(k=>{const l=ef(k);let n=!1;for(let p=0,q=h.length;p<q;p++){const r=h[p];if(r.Er(l)){g(r.ph,!1);
604
- n=!0;break}}n?a.N.debug('CoverageProcessor: [ID:',d,'] - graphPath',k,' is covered'):g(k,!0)});Xb(f,(k,l)=>e(l));f.start()}function hg(a,b,c){const d=[b.Qd()],e=g=>g instanceof olympe.dc.X.uf,f=(b.Bg()||[]).filter(e);for(const g of f)d.push(g.Qd()),f.push(...(g.Bg()||[]).filter(e));me(a.C,()=>{olympe.D.yc(d,()=>{const g=b.Vf();gg(a,g,b,b.Z(),c)})})}function ig(a,b,c,d){const e=b.Z(),f=[se(b,c)];me(a.C,()=>gg(a,f,b,e,d))}olympe.dc.query.Xb.Qs=class{constructor(a,b,c){this.N=a;this.va=b;this.C=c}};olympe.dc.query.Xb.cp=class{constructor(a,b){this.N=a;this.va=b}process(a,b,c){const d=b.Z();this.va.C.has(d)?(Hf(this.va,d).qa(b),olympe.dc.Dd().af(b.data,a),c(null,b)):c(Error(`Received a notification for the graphdef ${d} which does not exist.`),b)}};olympe.dc.query.Xb.cp.ma=[olympe.dc.og];olympe.dc.query.Xb.ep=class{constructor(a,b,c){this.N=a;this.va=b;this.C=c}process(a,b,c){var d=b.Z();if(a===olympe.dc.Ka.rb||this.va.C.has(d)){if(c(null,b),a=Hf(this.va,d),this.C||a&&a.L)a=olympe.dc.Ka.rb,d=new olympe.dc.query.zi(d,a,a,new olympe.dc.db.zc),Of(olympe.dc.Kf(),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.Xb.ep.ma=[olympe.dc.og];olympe.dc.query.Xb.fp=class{constructor(a,b,c){this.N=a;this.C=b;this.F=c}process(a,b,c){const d=b.Z();if(this.C.C.has(d)){const f=Hf(this.C,d);if(b instanceof olympe.dc.query.Xi.Uj)Jf(this.C,d,a);else if(!f.L){f.ka(b);const g=olympe.dc.Dd();Pc(g,f.Y());g.af(b.Gc,b.destination);f.onDestroy(()=>{Pc(g,null,f.Y())});of(f)}}let e;b instanceof olympe.dc.query.Xi.Uj&&(e=`graph subscription "${d}" failed to create the initial result: ${b.ea()}`,this.N.error(e));Ue(this.F,b.Z(),b);c(e?Error(e):null,b)}};
605
- olympe.dc.query.Xb.fp.ma=[olympe.dc.og];const jg=[],kg=new Map;function lg(a,b,c,d){uc(a.db,d,e=>{e?b.Dg(c)?a.N.warn('Adding the same index twice (should never happen) for sub #'+b.Z()+', index #'+c+', tag #'+d):b.cc(c,d):mg(a,b,c,d)},c)}function mg(a,b,c,d){vc(a.db,d,c,!0);b.lc(c);jg.length=0;b.Lc(function(e,f){jg[e]=f});c=a=0;for(d=jg.length;a<d;a++)'string'===typeof jg[a]&&(jg[c++]=jg[a]);jg.length=c;b.Tb(jg)}
606
- olympe.dc.query.Xb.Ip=class{constructor(a,b,c){this.N=a;this.db=b;this.va=c}process(a,b,c){const d=b.Z();a=b.C;const e=Lf(this.va,d);if(null===e)c(Error(`Received list notification for undefined subscription "${d}"`),b);else{jg.length=a.length;e.Lc((f,g)=>{if(f=e.lh(g)){f=f.T();var h=kg.get(f);void 0===h?kg.set(f,g):'string'===typeof h?kg.set(f,[h,g]):h.push(g)}else this.N.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=kg.get(h);void 0===k?(k=olympe.W.fc(),lg(this,e,k,h)):'string'===typeof k?kg.delete(h):(k=k.pop(),0===k.length&&kg.delete(h));jg[f]=k}for(const [f,g]of kg){if('string'===typeof g)mg(this,e,g,f);else for(let h=0,k=g.length;h<k;h++)mg(this,e,g[h],f);kg.delete(f)}e.Tb(jg);c(null,b)}}};olympe.dc.query.Xb.Ip.ma=[olympe.dc.og];function ng(a,b,c,d){const e=c.Z();a.N.debug('ListProcessor: [ID:',e,'] - processing with source ',b);$f(a.va,c,b);if(Zf(a.va,e,olympe.dc.Ka.rb))a.N.debug('ListProcessor: [ID:',e,'] - id already processed');else{a.N.debug('ListProcessor: [ID:',e,'] - NOT processed yet.');const f=c.td();a.F||f===olympe.dc.Ka.rb?(a.N.debug('QueryMGR: [ID:',e,'] - Local subscription, no need for coverage check, booting subscription '),og(a,c)):c.Gh().run(()=>{hg(a.C,c,g=>{g?a.N.error(g):og(a,c)})})}b===olympe.dc.Ka.rb||
608
- Zf(a.va,e,b)||a.notify(b,c);d(null,c)}
609
- function og(a,b){if(b.Y())a.N.debug('ListProcessor: [ID:',b.Z(),'] - Subscription already booted, ignoring');else{a.N.debug('ListProcessor: [ID:',b.Z(),'] - Booting subscription');var c=new olympe.dc.pc.Wq(a.db,a.N),d=pg(a,b,c),e=b.Z();b.Gh().run(()=>{olympe.D.yc([b.Qd()],f=>{const g=olympe.dc.wa(f);a.N.debug('ListProcessor: [ID:',b.Z(),'] - Booting with baseTag',g);b.th()||b.uh();uc(a.db,g,h=>d(h,g),e);olympe.D.Ia().xc(()=>vc(a.db,g,e));a.db.Gb(g.valueOf())||qg(c);b.Y()||(qg(c),b.Tb([]))})})}}
610
- function pg(a,b,c){const d=new olympe.dc.pc.Ej;let e=!1;const f=b.Gh(),g=b.Bg(),h=[];h[g?g.length:0]=f.C((k,l,n,p)=>{f.R()||f.zb()||(k?b.Dg(n)?a.N.warn('Adding the same index twice (should never happen) for sub #',b.Z(),', index #',n,', tag #',l):(a.N.debug('ListProcessor: [ID:',b.Z(),'] - Adding Instance',l,'to the subscription'),b.cc(n,l)):(a.N.debug('ListProcessor: [ID:',b.Z(),'] - Removing Instance',l,'from the subscription'),b.lc(n)),e||(rg(c,()=>{p.sg();qg(c)}),p.Tc().Jg(b.Tb.bind(b)),e=!0),
611
- sg(c,n))});if(null!==g){const k=olympe.dc.Tc();for(let l=g.length-1;0<=l;l--)h[l]=f.C(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,tg(p,k,l,n))}}
612
- olympe.dc.query.Xb.Jp=class{constructor(a,b,c,d,e,f){this.N=a;this.db=b;this.va=c;this.C=d;this.F=f}process(a,b,c){ng(this,a,b,c)}notify(a,b){const c=b.Z();this.N.debug(`Register notification of list subscription ${c} for destination ${a}`);const d=()=>{const f=new olympe.dc.query.Hp(c);b.fe(g=>f.F(g));Qf(olympe.dc.Kf(),f)};let e=!1;b.forEach(()=>{e&&d()});b.Je(()=>{e=!0;d()})}};olympe.dc.query.Xb.Jp.ma=[olympe.dc.og];function Gf(a,b,c){const d=b.Z(),e=b.source,f=a.va.G.has(d),g=ag(a.va,b);return new rxjs.Observable(h=>{c.run(()=>{olympe.D.yc([g.C.Eb()],h.next.bind(h))});const k=()=>{l&&c.Lc(l);{var n=a.va;const q=n.G.get(d);var p;if(p=q)p=q,0<p.counter?p.counter--:olympe.sa.Ya('dc').warn('Try to decrement counter of query metadata below 0. Investigate...'),p=0===p.counter;p&&(q.destroy(),n.G.delete(d),n.R.delete(d))}},l=c.xc(k);if(e===olympe.dc.Ka.Xc)ig(a.L,b,!0,n=>{n?(h.error(n),k()):ug(a,d,b,g,c)});else if(e===
613
- olympe.dc.Ka.rb)ug(a,d,b,g,c);else if(!f){const n=M(xc(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})}
614
- function vg(a){const b=olympe.dc.ga.ja.nm,c=(d,e)=>De(d,f=>{Pc(a.F,Array.from(f.ge()).filter(g=>g.te()).map(g=>g.tag()));a.F.af(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,Te(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,Te(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.va.G.get(e))f=olympe.D.Za(e.C),f&&f.hash===d.hash||(Pc(e.F,null,Be(d)),e.C.update(d))});Oc(a.F,()=>{var d=a.va;for(const e of d.R)bg(d,e);d.R.clear()})}
616
- function ug(a,b,c,d,e){const f=new olympe.dc.ba.nq(c);He(f,()=>{var p=a.va;p.G.has(b)&&p.R.add(b)});d.G=f;let g=(p,q)=>{p?a.N.debug(`New result tuple for query ${b}, ${q}`):a.N.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.xc(()=>vc(k,l,n));bg(a.va,b)}
617
- olympe.dc.query.Xb.Cu=class{constructor(a,b,c,d,e,f){this.N=a;this.va=b;this.L=c;this.C=d;this.G=e;this.F=f;vg(this)}ib(a,b){return new Promise((c,d)=>{var e=a.source;if(e===olympe.dc.Ka.Xc)ig(this.L,a,!1,f=>{f?d(f):c(this.ud(a))});else if(e===olympe.dc.Ka.rb)c(this.ud(a));else{const f=a.Z(),g=this.C.C.has(f),h=l=>{var n=this.C;Se(n,f,n.G);d(l||`The execution of the query ${f} has been interrupted`)},k=b.xc(h);Ve(this.C,f,(l,n)=>{b.Lc(k);l?d(l.message):(b.xc(()=>{Pc(this.F,null,Ae(n))}),c(n))});g||
618
- (e=M(xc(new olympe.dc.ga(olympe.dc.ga.ja.mm,a,[e]),b),l=>l&&h(l.message)),this.G.send(e))}})}ud(a){const b=new olympe.dc.ba.nq(a);He(b,()=>{});b.insert(a.G,0,null);let c=0;for(const d of a.C)d.ib(b,c),c=d.F(c);return olympe.dc.Wa.from(olympe.dc.Wa.empty(),b)}};olympe.dc.query.Xi={};olympe.dc.query.Xi.Uj=class extends olympe.dc.query.zi{constructor(a,b,c,d){super(a,b,c,new olympe.dc.db.zc);this.error=d}ea(){return this.error}};olympe.dc.pc={};function tg(a,b,c,d){b?a.R[d]=c:delete a.R[d];null===a.F&&(a.F=new olympe.dc.pc.Lj(a.C,a));return a.F}function wg(a,b){for(let c=0;c<b;c++)if(null!==a.F)a=a.F;else break;return a}function xg(a,b){a=a.R;if(null!==a)for(let c in a)Object.prototype.hasOwnProperty.call(a,c)&&b.push(c)}olympe.dc.pc.Lj=class{constructor(a,b){this.C=a;this.parent=b||null;this.ea=b?b.ea+1:0;this.R=Object.create(null);this.F=null}Tc(){return this.C}sg(){this.C.R()?this.C.G():this.C.ea(this.ea-1)}};olympe.dc.pc.ta=class{constructor(){}C(){}R(){}ea(){}G(){}Jg(){}};olympe.dc.pc.Ej=class{constructor(){this.Y=this.L=this.index=this.F=null}R(){return null!==this.F}ea(a){if(null!==this.F)throw Error('Manager already activated (depth='+this.F+')');this.F=a;this.G()}C(a,b,c){b=this.L;if(a&&null!==b)throw Error('The AutoManger handles only a single item.');a?(b=new olympe.dc.pc.Lj(this),this.index=c,this.L=b):this.L=this.index=null;return b}G(){if(null===this.F)throw Error('Manager not activated, need to set a depth before updating ranks');if(null!==this.Y){const a=
619
- [];null!==this.L&&(0<=this.F?xg(wg(this.L,this.F),a):a.push(this.index));this.Y(a)}}Jg(a){this.Y=a}};olympe.dc.pc.Ej.ma=[olympe.dc.pc.ta];function yg(a,b){olympe.D.Tf(a.value)?(a.node=olympe.D.dl(a.value,b),Wa(a.node)||b()):b()}function zg(a,b){if(olympe.D.Tf(a.value)){const c=olympe.D.Ia(),d=a.L;olympe.D.yc([a.value],e=>{d!==e.valueOf()&&(c.run(()=>yg(a,b)),olympe.D.Ia().destroy())})}}
620
- class Ag extends olympe.dc.pc.Lj{constructor(a,b,c){super(a);this.index=b;this.value=c;this.L=this.Za();this.position=this.node=null;this.Y=!1;this.G=null}Za(){const a=olympe.D.Za(this.value);return a?a.valueOf():a}destroy(){this.node&&(this.node.destroy(),this.node=null);this.G=this.value=null}zb(){return null===this.value}}
621
- function Bg(a,b){if(!b.zb()){var c=a.F;const d=a.Fa,e=b.Za();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].L,e);if(0===k||2>g-f){0>k&&null!==b.position&&b.position<=h&&(k=d(c[g].L,e));h=0>k?g:h;break}0>k?f=h:g=h}c=h;b.L=b.Za();c!==b.position&&(a.insert(b,c),b.Y&&a.G())}}function Cg(a){const b=a.Fa;a.F.sort((c,d)=>b(c.Za(),d.Za()))}
622
- olympe.dc.pc.Vq=class{constructor(a){this.Fa=a;this.L=null;this.F=[];this.Y=[];this.ka=null;this.qa=new Map}C(a,b,c,d){b='$'+c;const e=this.F;let f;if(a)f=new Ag(this,c,d),this.qa.set(b,f),this.R()?yg(f,()=>Bg(this,f)):(f.position=e.length,e.push(f));else{f=this.qa.get(b);if(void 0===f)throw Error('Trying to remove an non-registered item: "'+c+'"');this.qa.delete(b);null!==f.position&&(this.R()?this.remove(f):delete e[f.position]);f.destroy()}return f}R(){return null!==this.L}ea(a){if(null!==this.L)throw Error('Manager already activated (depth='+
623
- this.L+')');this.L=a;Cg(this);for(let b=0,c=this.F.length;b<c;b++){const d=this.F[b];d.position=b;zg(d,()=>Bg(this,d))}this.G()}G(){if(null===this.L)throw Error('Manager not activated, need to set a depth before updating ranks');const a=this.F.length;this.Y.length=0;for(let d=0;d<a;d++){let e=this.F[d];if(!e.Y){var b=e,c=this.L;b.Y=!0;b.G=wg(b,c)}0>this.L?this.Y.push(e.index):e.G&&xg(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===
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.pc.Vq.ma=[olympe.dc.pc.ta];class Dg extends olympe.dc.pc.Lj{constructor(a,b,c){super(a);this.index=b;this.tag=c;this.ka=this.Y=this.L=!1;this.G=null}}
625
- function Eg(a,b,c,d,e){const f=Object.create(null),g=a.order,h=a.L;let k,l,n;a.qa=!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.L||(c.L=!0,e(!0,c.tag,c.index,c)));for(k in f)Object.prototype.hasOwnProperty.call(f,k)&&(c=h[k],c.L&&(c.L=!1,e(!1,c.tag,c.index,c)),c.Y&&(c.G=null,delete h[k]),delete f[k]);a.qa=!1;null!==a.F&&a.G()}
626
- olympe.dc.pc.Xl=class{constructor(){this.L={};this.order=[];this.F=null;this.qa=!1;this.Y=[];this.ka=null}R(){return null!==this.F}ea(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.qa){var a=this.order,b=a.length,c=this.L,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;
627
- f.G=wg(f,g)}null!==e.G&&xg(e.G,this.Y)}}this.ka&&this.ka(this.Y)}}Jg(a){this.ka=a}C(a,b,c){let d=this.L[c];a?void 0===d?(d=new Dg(this,c,b),this.L[c]=d):(d.tag=b,d.Y=!1):void 0!==d&&(d.Y=!0);return d}};olympe.dc.pc.Xl.ma=[olympe.dc.pc.ta];function qg(a){if(!a.F){for(let b in a.G)Fg(a.G[b]);a.F=!0}a.L=null;a.R=null}function rg(a,b,c){a.G[c||'root'].L=b}function sg(a,b,c){a.G[c||'root'].sg(b)}function Gg(a,b,c,d){const e=a.R,f=b+d+c;let g=e[f];void 0===g&&(g=Dd(a.db,b,c,d),e[f]=g);return g}function Hg(a,b){a.F||a.C.sg(b)}function Ig(a,b,c,d,e){if(!a.F){let f=Gg(a,c,d,e||olympe.dc.Aa.DESTINATION);e||(f+=Gg(a,c,d,olympe.dc.Aa.ORIGIN));0===f&&Hg(a,b)}}
628
- function Jg(a,b){const c=a.G[b];void 0!==c?(a.N&&a.N.debug('Set current block to',b,null!==c.parent?'parent = '+c.parent.Z():''),a.C=c):a.N&&a.N.error('Try to set a block that does not exists:',b)}function Kg(a){const b=String(++a.Y),c=a.C;a.G[b]=new Lg(b,c);Mg(c,b);c.F||(c.F=()=>Jg(a,c.Z()));return b}function Ng(a,b){const c=a.C;a.C.F=()=>{Jg(a,c.Z());b()}}function Og(a,b){Fg(b?a.G[b]:a.C)}
629
- olympe.dc.pc.Wq=class{constructor(a,b){this.db=a;this.N=b||null;this.L=Object.create(null);this.R=Object.create(null);this.F=!1;this.Y=0;this.C=new Lg('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=Gg(this,c,d,e),d=this.L[b]||0,this.L[b]=++d,this.C.C===b&&c<=d&&(this.C.C=a)):this.C.C=a)}};function Mg(a,b){null===a.children&&(a.children=Object.create(null));a.children[b]=!1}function Fg(a){a.G=!0;null!==a.parent&&a.parent.notify(a.id)}
630
- class Lg{constructor(a,b){this.id=a;this.parent=b||null;this.C=this.L=this.F=this.children=null;this.G=!1}Z(){return this.id}sg(a){const b=this.L;if(this.G||this.C===a||null===a)b&&b(),!b&&Fg(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.oa={};olympe.dc.oa.sf=class{na(){return O(olympe.dc.oa.sf)}C(){return[]}getValue(a,b){return b}ia(){return'{"c":"'+this.na()+'","a":[]}'}toString(){return'Tag()'}};N('olympe.dc.valuedefs.Tag',olympe.dc.oa.sf);olympe.dc.oa.sf.ma=[olympe.dc.wf];olympe.dc.oa.bd=class{constructor(a){this.value=a}na(){return O(olympe.dc.oa.bd)}C(){return[]}getValue(){return this.value}ia(a){a=Ff(a,this.value);return`{"c":"${this.na()}","a":[${a}]}`}toString(){return`Constant(${Ef(this.value)})`}};N('olympe.dc.valuedefs.Constant',olympe.dc.oa.bd);olympe.dc.oa.bd.ma=[olympe.dc.wf];function Pg(a,b,c,d){const e=olympe.dc.Pa(),f=new olympe.dc.pc.Ej,g=new olympe.dc.pc.Wq(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.R()||w.zb()||(h||(rg(g,()=>{v.sg();qg(g)}),v.Tc().Jg(l),h=!0),r?k[u]=t:delete k[u],sg(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.C(n));n=p.C(n);const q=olympe.W.fc();uc(e,b,(r,t)=>{g.register(q,null);const u=f.C(r,b,q,null);
631
- n(r,t,q,tg(u,r,b,q))},q);p.onDestroy(()=>{vc(e,b,q)});e.Gb(b)||qg(g)}function Qg(a,b,c){const d=c.node,e=olympe.dc.Pa(),f=a.G(),g=xd(e,b,a.$e,d.C(h=>{null!==h&&(h=f(h));null===h?c.clear():c.update(h)}));d.onDestroy(()=>e.F(b,a.$e,g))}
632
- olympe.dc.oa.Oc=class{constructor(a,b,c){this.$e=a&&a.T?a.T():a;this.X=b&&b.filter(d=>d instanceof olympe.dc.X.Sb||d instanceof olympe.dc.X.Dc)||null;this.F=c||null;this.defaultValue=null}na(){}$b(){}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}Qd(){return this.F}getValue(a,b){const c=olympe.D.Nc(this.$b()||Object,'AbstractProperty valueType');null!==this.defaultValue&&qb(c,this.defaultValue);b=this.F||
633
- b;null!==this.X?Pg(a,b,this.X,d=>{Qg(this,d,c)}):Qg(this,b,c);return c.Eb()}ia(a){const b=Ff(a,this.$e),c=Ff(a,this.F);let d='null';this.X&&(d=this.X.map(function(e){return e.ia(a)}).join(','));return`{"c":"${this.na()}","a":["${b}",${d},${c}]}`}toString(){const a=Ef(this.$e),b=this.F?','+Ef(this.F):'';let c='';this.X&&(c=','+this.X.join(','));return this.na().replace(/^.+\./,'')+'('+a+c+b+')'}};olympe.dc.oa.Oc.ma=[olympe.dc.wf];olympe.dc.oa.me=class extends olympe.dc.oa.Oc{constructor(a,b,c){super(a,b,c)}na(){return O(olympe.dc.oa.me)}G(){return olympe.dc.W.Vb.Mm}$b(){return olympe.D.da}};N('olympe.dc.valuedefs.NumberProperty',olympe.dc.oa.me);olympe.dc.oa.qe=class extends olympe.dc.oa.Oc{constructor(a,b,c){super(a,b,c)}na(){return O(olympe.dc.oa.qe)}G(){return olympe.dc.W.Vb.Nm}$b(){return olympe.D.Xa}};N('olympe.dc.valuedefs.StringProperty',olympe.dc.oa.qe);olympe.dc.oa.ve=class extends olympe.dc.oa.Oc{constructor(a,b,c){super(a,b,c)}na(){return O(olympe.dc.oa.ve)}G(){return olympe.dc.W.Vb.Km}$b(){return olympe.D.ra}};N('olympe.dc.valuedefs.BooleanProperty',olympe.dc.oa.ve);olympe.dc.oa.le=class extends olympe.dc.oa.Oc{constructor(a,b,c){super(a,b,c)}na(){return O(olympe.dc.oa.le)}G(){return olympe.dc.W.Vb.Lm}$b(){return olympe.D.kb}};N('olympe.dc.valuedefs.DateTimeProperty',olympe.dc.oa.le);olympe.dc.oa.On=class{constructor(a,b){if(olympe.D.Tf(a))throw Error('Dataflows of Property not supported by AnyProperty');const c=a.T();var d=olympe.dc.Pa();const e=d.oc(a,olympe.dm.Property.typeRel);if(!e)throw Error('Type of property '+a+'unavailable locally, cannot proceed with AnyProperty');a=d.Mf(e,olympe.dc.CloudObject.extendRel,olympe.dm.qf);d=null;switch(1<a.length?a[a.length-2]:e){case olympe.dm.String.P.T():d=new olympe.dc.oa.qe(c,b);break;case olympe.dm.Number.P.T():d=new olympe.dc.oa.me(c,
634
- b);break;case olympe.dm.Boolean.P.T():d=new olympe.dc.oa.ve(c,b);break;case olympe.dm.DateTime.P.T():d=new olympe.dc.oa.le(c,b)}this.F=d}na(){return this.F.na()}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.oa.On.ma=[olympe.dc.wf];olympe.dc.Db={};olympe.dc.Db.Number=class{constructor(a){this.C=a}na(){return O(olympe.dc.Db.Number)}R(){return this.C.C()}L(a,b){return this.C.getValue(a,b)}G(a,b){return a!==b?a>b?1:-1:0}ia(a){return`{"c":"${this.na()}",a:[${this.C.ia(a)}]}`}toString(){return`Number(${this.C.toString()})`}};N('olympe.dc.comparators.Number',olympe.dc.Db.Number);olympe.dc.Db.Number.ma=[olympe.dc.Ne];olympe.dc.Db.String=class{constructor(a){this.C=a}na(){return O(olympe.dc.Db.String)}R(){return this.C.C()}L(a,b){return olympe.D.Ga([this.C.getValue(a,b)],c=>c.toLowerCase(),olympe.D.Xa)}G(a,b){return void 0===a?void 0===b?0:1:a!==b?a>b?1:-1:0}ia(a){return`{"c":"${this.na()}",a:[${this.C.ia(a)}]}`}toString(){return`String(${this.C.toString()})`}};N('olympe.dc.comparators.String',olympe.dc.Db.String);olympe.dc.Db.String.ma=[olympe.dc.Ne];olympe.dc.Db.DateTime=class{constructor(a){this.C=a}na(){return O(olympe.dc.Db.DateTime)}R(){return this.C.C()}L(a,b){return this.C.getValue(a,b)}G(a,b){if(!a)return b?-1:0;if(!b)return 1;a=a.getTime();b=b.getTime();return a!==b?a>b?1:-1:0}ia(a){return'{"c":"'+this.na()+'",a:['+this.C.ia(a)+']}'}toString(){return'Number('+this.C.toString()+')'}};N('olympe.dc.comparators.DateTime',olympe.dc.Db.DateTime);olympe.dc.Db.DateTime.ma=[olympe.dc.Ne];let Rg=0;olympe.dc.Db.Mg=class{constructor(){this.id=Rg++}na(){return'CustomLocalComparator#'+Rg}R(){return[]}L(){throw Error('GetComparedValue function was not implemented.');}G(){throw Error('Compare function was not implemented.');}ia(){return`{"c":"${this.na()}"}`}toString(){return this.na()+'()'}};olympe.dc.Db.Mg.ma=[olympe.dc.Ne];olympe.dc.V={};olympe.dc.V.md=class{constructor(a){this.G=a}na(){return O(olympe.dc.V.md)}F(){return this.G.F()}C(a,b){return olympe.D.dl(this.G.C(a,b),c=>!c.valueOf())}ia(a){return`{"c":"${this.na()}","a":[${this.G.ia(a)}]}`}toString(){return'Not('+this.G.toString()+')'}};N('olympe.dc.predicates.Not',olympe.dc.V.md);olympe.dc.V.md.ma=[olympe.dc.bb];olympe.dc.V.Xd=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])}na(){return O(olympe.dc.V.Xd)}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.na()+'","a":['+b.join(',')+']}'}toString(){return'And('+
635
- this.V.map(a=>a.toString()).join(',')+')'}};N('olympe.dc.predicates.And',olympe.dc.V.Xd);olympe.dc.V.Xd.ma=[olympe.dc.bb];olympe.dc.V.de=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])}na(){return O(olympe.dc.V.de)}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.na()+'","a":['+b.join(',')+']}'}toString(){return'Or('+
636
- this.V.map(a=>a.toString()).join(',')+')'}};N('olympe.dc.predicates.Or',olympe.dc.V.de);olympe.dc.V.de.ma=[olympe.dc.bb];olympe.dc.V.ml=class{constructor(a,b){this.G=a;this.L=b}na(){}F(){return[this.G.C(),this.L.C()]}C(a,b){return olympe.D.Ga([this.G.getValue(a,b),this.L.getValue(a,b)],(c,d)=>{c=c.valueOf();d=d.valueOf();return this.R('string'===typeof c?c:Number(c),'string'===typeof d?d:Number(d))},Boolean)}R(){}ia(a){return'{"c":"'+this.na()+'","a":['+this.G.ia(a)+','+this.L.ia(a)+']}'}toString(){return this.na().replace(/^.+\./,'')+'('+this.G.toString()+','+this.L.toString()+')'}};olympe.dc.V.ml.ma=[olympe.dc.bb];olympe.dc.V.Ic=class{constructor(a,b){this.G=a;this.L=b}na(){return O(olympe.dc.V.Ic)}F(){return[this.G.C(),this.L.C()]}C(a,b){return olympe.D.Ga([this.G.getValue(a,b),this.L.getValue(a,b)],(c,d)=>'object'===typeof c&&void 0!==c.Vd?c.Vd(d):'object'===typeof d&&void 0!==d.Vd?d.Vd(c):olympe.D.Bc(c.valueOf()===d.valueOf()),olympe.D.ra,'Test equal predicate')}ia(a){return'{"c":"'+this.na()+'","a":['+this.G.ia(a)+','+this.L.ia(a)+']}'}toString(){return'Equals('+this.G.toString()+','+this.L.toString()+
637
- ')'}};N('olympe.dc.predicates.Equals',olympe.dc.V.Ic);olympe.dc.V.Ic.ma=[olympe.dc.bb];olympe.dc.V.ct=class extends olympe.dc.V.Ic{constructor(a,b){super(a,new olympe.dc.oa.bd(b))}};olympe.dc.V.ct.ma=[olympe.dc.bb];olympe.dc.V.ye=class extends olympe.dc.V.ml{constructor(a,b){super(a,b)}na(){return O(olympe.dc.V.ye)}R(a,b){return a>b}};N('olympe.dc.predicates.Greater',olympe.dc.V.ye);olympe.dc.V.Fe=class extends olympe.dc.V.ml{constructor(a,b){super(a,b)}na(){return O(olympe.dc.V.Fe)}R(a,b){return a<b}};N('olympe.dc.predicates.Smaller',olympe.dc.V.Fe);olympe.dc.V.Vc=class{constructor(a,b,c){this.source=a;this.value=b;this.G=c?c:!1}na(){return O(olympe.dc.V.Vc)}F(){return[this.source.C(),this.value.C()]}getValue(){return this.value}C(a,b){return olympe.D.Ga([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.Bc(c.includes(d))},olympe.D.ra)}ia(a){const b=this.source.ia(a),c=this.value.ia(a);a=Ff(a,this.G);return'{"c":"'+this.na()+'","a":['+
638
- b+','+c+','+a+']}'}toString(){const a=Ef(this.G);return'Contains('+this.source.toString()+','+this.value.toString()+','+a+')'}};N('olympe.dc.predicates.Contains',olympe.dc.V.Vc);olympe.dc.V.Vc.ma=[olympe.dc.bb];olympe.dc.V.zd=class{constructor(a,b,c){this.source=a;this.L=b;this.G=void 0===c?!0:c}na(){return O(olympe.dc.V.zd)}F(){return[this.source.C()]}C(a,b){return olympe.D.cf([this.source.getValue(a,b),this.L,this.G],(c,d,e)=>{c=String(c);d=String(d);e.valueOf()||(c=c.toLowerCase(),d=d.toLowerCase());return(new RegExp(d)).test(c)})}ia(a){const b=this.source.ia(a),c=Ff(a,this.L);a=Ff(a,this.G);return'{"c":"'+this.na()+'","a":['+b+','+c+','+a+']}'}toString(){const a=Ef(this.G);return'Regex('+this.source.toString()+
639
- ','+this.L+','+a+')'}};N('olympe.dc.predicates.Regex',olympe.dc.V.zd);olympe.dc.V.zd.ma=[olympe.dc.bb];olympe.dc.V.kf=class{constructor(a){this.G=new Set;a instanceof Array?a.forEach(b=>{this.G.add(olympe.dc.wa(b))}):this.G.add(olympe.dc.wa(a))}na(){return O(olympe.dc.V.kf)}F(){return[]}C(a,b){const c=olympe.D.createNode(Boolean),d=olympe.dc.Pa();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.wa(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 Sg(k,olympe.dc.CloudObject.extendRel),e.push(h),V(d,h.tag,h.C,g,h.id))}};a=new Sg(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.na()+'","a":['+JSON.stringify(Array.from(this.G))+']}'}toString(){return'InstanceOf('+Array.from(this.G).join(', ')+')'}};class Sg{constructor(a,b){this.tag=a;this.C=b;this.id=olympe.W.xg()}}N('olympe.dc.predicates.InstanceOf',olympe.dc.V.kf);olympe.dc.V.kf.ma=[olympe.dc.bb];function Tg(a){return a.Ma.map(b=>b.T())}function Ug(a){return a.Ma.map(b=>b.Qa())}
641
- olympe.dc.V.jf=class{constructor(a,b,c){this.Ma=[];this.G=c instanceof Array?c:void 0!==c?[olympe.dc.wa(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.Ma.push(new Vg(c.T(),c.Qa(),c.F,c.C)):this.Ma.push(new Vg(olympe.dc.wa(c),b[d],1,1))}na(){return O(olympe.dc.V.jf)}F(){return[this.Ma.reduce((a,b)=>a.concat(b),[])]}C(a,b){const c=olympe.D.createNode(Boolean),d=olympe.W.fc(),e=olympe.dc.Pa();let f=0;a=(h,k)=>{0!==this.G.length&&!this.G.includes(k)||
642
- c.zb()||(f+=h?1:-1,K(c,0<f))};const g=this.Ma;for(let h=g.length-1;0<=h;h--)a=Wg(g[h],e,a,d+h);uc(e,b,a,d);olympe.D.Ia().onDestroy(()=>{vc(e,b,d)});c.bf(!1);return c}ia(){return'{"c":"'+this.na()+'","a":['+JSON.stringify(this.Ma.map(a=>a.ia()))+(0!==this.G.length?',"'+this.G.toString():'')+'"]}'}toString(){return'HasRelated('+(0!==this.G.length?'#'+this.G.toString()+', ':'')+this.Ma.map(a=>a.ia())+')'}};N('olympe.dc.predicates.HasRelated',olympe.dc.V.jf);
643
- function Wg(a,b,c,d){const e=Object.create(null);d+=olympe.W.xg();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 Vg 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.T()}, ${this.Qa()}, ${this.F}, ${this.C}`}}olympe.dc.V.jf.ma=[olympe.dc.bb];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)})}na(){return O(olympe.dc.V.sl)}F(){return[this.value.C()]}ia(a){const b=olympe.D.nb(this.G)?this.G.Na.Ib.valueOf():this.G.valueOf();return'{"c":"'+this.na()+'","a":['+b+','+this.value.ia(a)+']}'}toString(){const a=olympe.D.nb(this.G)?this.G.Na.Ib.valueOf():this.G.valueOf();return this.na().replace(/^.+\./,'')+
644
- '('+a.toString()+','+this.value.toString()+')'}};N('olympe.dc.predicates.BitMask',olympe.dc.V.sl);olympe.dc.V.sl.ma=[olympe.dc.bb];let Xg=0;olympe.dc.V.Mg=class{constructor(){this.id=Xg++}na(){return'CustomLocalPredicate#'+this.id}F(){return[]}C(){throw Error('Test function was not implemented.');}ia(){return`{"c":"${this.na()}"}`}toString(){return this.na()+'()'}};olympe.dc.V.Mg.ma=[olympe.dc.bb];olympe.dc.V.Ll=class{constructor(a,b,c){this.Ma=[];this.G=void 0!==c?c.map(olympe.dc.wa):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.Ma.push(new Yg(c.T(),c.Qa(),c.F,c.C)):this.Ma.push(new Yg(olympe.dc.wa(c),b[d],1,1))}na(){return O(olympe.dc.V.Ll)}F(){return[this.Ma.reduce((a,b)=>a.concat(b),[])]}C(a,b){const c=olympe.D.createNode(Boolean),d=olympe.dc.Pa(),e=olympe.W.xg();a=(h,k,l)=>{k&&(null===this.G||this.G.includes(l))&&h(1)};const f=this.Ma;
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.R()||c.zb()||(g+=h,K(c,0<g))}),e);olympe.D.Ia().onDestroy(()=>vc(d,b,e));c.bf(!1);return c}ia(){return'{"c":"'+this.na()+'","a":['+JSON.stringify(this.Ma.map(a=>a.ia()))+(null!==this.G?',"'+this.G.toString():'')+'"]}'}toString(){return'HasRelatedTree('+(null!==this.G?'#['+this.G.toString()+'], ':'')+this.Ma.map(a=>a.ia())+')'}};N('olympe.dc.predicates.HasRelatedTree',olympe.dc.V.Ll);
646
- class Yg extends olympe.dc.query.Relation{constructor(a,b,c,d){super(a,b,1!==c||1!==d);this.F=c;this.C=d;this.L=new Map;this.G=new Map}getTransform(a,b,c){const d=this.G,e=this.L,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.xg();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.T()}, ${this.Qa()}, ${this.F}, ${this.C}`}}olympe.dc.V.Ll.ma=[olympe.dc.bb];olympe.dc.X={};olympe.dc.X.nk={ht:1,ut:-1,rp:0};olympe.dc.X.bB={Fy:!0,bz:!1};olympe.dc.X.Sb=class extends olympe.dc.va.Relation{constructor(a,b){super(a,b||olympe.dc.Aa.DESTINATION)}$b(){return Ic(this)}na(){return O(olympe.dc.X.Sb)}Sc(){return new olympe.dc.X.Sb(this.tag,this.direction===olympe.dc.Aa.DESTINATION?olympe.dc.Aa.ORIGIN:olympe.dc.Aa.DESTINATION)}getTransform(a,b,c){const d=olympe.dc.Pa(),e=this.T(),f=this.Qa();return(g,h,k,l)=>{Ig(b,k,h,e,f);g?V(d,h,this,(n,p)=>{const q=olympe.W.ob(k+f+e+p,20),r=tg(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.na()+'","a":["'+this.T()+'","'+this.Qa()+'"]}'}toString(){return'Related('+this.Qa()+this.T()+')'}};N('olympe.dc.transformers.Related',olympe.dc.X.Sb);olympe.dc.X.Sb.ma=[olympe.dc.Zc];olympe.dc.X.Dc=class extends olympe.dc.va.Relation{constructor(a,b=olympe.dc.Aa.DESTINATION,c=1,d=-1){super(a,b);this.F=c;this.C=d}$b(){return Ic(this)}na(){return O(olympe.dc.X.Dc)}getTransform(a,b,c){const d=olympe.dc.Pa(),e=Object.create(null),f=olympe.dc.Aa.ORIGIN,g=olympe.dc.Aa.DESTINATION,h=this.T(),k=this.Qa(),l=(p,q,r)=>{if(!(0<=this.C&&p>=this.C)){var t=d.tb(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.ob(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,tg(r,u,v,t)):Ig(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.ob(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.na()+'","a":["'+this.T()+'","'+this.Qa()+'",'+this.F+','+this.C+']}'}toString(){return'RecursiveRelated('+this.Qa()+this.T()+'['+this.F+'..'+this.C+'])'}};
650
- N('olympe.dc.transformers.RecursiveRelated',olympe.dc.X.Dc);olympe.dc.X.Dc.ma=[olympe.dc.Zc];function Zg(a){return a.Ma.map(b=>b.T())}
651
- olympe.dc.X.Be=class{constructor(a,b){this.direction=b||olympe.dc.Aa.DESTINATION;this.Ma=a.map(c=>new olympe.dc.va.Relation(c,this.direction))}$b(){return olympe.dc.CloudObject}na(){return O(olympe.dc.X.Be)}Qa(){return this.direction}getTransform(a,b,c){const d=olympe.dc.Pa(),e=(f,g,h,k)=>V(d,f,k,(l,n)=>{var p=k.Qa();var q=k.T();p=olympe.W.ob(g+p+q+n,20);q=tg(h,l,n,p);l&&b.register(p,g,f,k.T(),k.Qa());c(l,n,p,q)},g);return(f,g,h,k)=>{f?this.Ma.forEach(l=>{Ig(b,h,g,l.T(),l.Qa());e(g,h,k,l)}):this.Ma.forEach(l=>
652
- {d.C(g,l,h)})}}ia(){return'{"c":"'+this.na()+'","a":['+JSON.stringify(Zg(this))+',"'+this.direction+'"]}'}toString(){return'MultiRelated('+this.Qa()+'['+Zg(this).join(',')+'])'}};N('olympe.dc.transformers.MultiRelated',olympe.dc.X.Be);olympe.dc.X.Be.ma=[olympe.dc.Zc];olympe.dc.X.Fl=class{constructor(a,b,c,d){this.C=new olympe.dc.va.Relation(olympe.dc.wa(a),c||olympe.dc.Aa.DESTINATION);this.F=new olympe.dc.va.Relation(olympe.dc.wa(b),d||olympe.dc.Aa.DESTINATION)}$b(){return Ic(this.C)}na(){return O(olympe.dc.X.Fl)}getTransform(a,b,c){const d=olympe.dc.Pa(),e={},f=this.C.T(),g=this.C.Qa(),h=this.F.T(),k=this.F.Qa();let l=null,n=null;const p=(r,t,u,v,w,y)=>{if(w){if(w=()=>{const A=olympe.W.ob(u+g+(f+'_'+r)+y,20),D=tg(t,!0,y,A);l=r;n=()=>{c(!1,y,A,tg(t,!1,y,A))};
653
- b.register(A,u,v,f,g);c(!0,y,A,D)},w.Vr=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.Vr<w&&(w=aa.Vr,A=aa)}A&&A()}},q=(r,t,u,v,w)=>{v?e[w]||(e[w]=!0,Ig(b,u,w,f,g),Ig(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.na()+'","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.Fl);olympe.dc.X.Fl.ma=[olympe.dc.Zc];olympe.dc.X.Gd=class{$b(){return null}na(){return O(olympe.dc.X.Gd)}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,tg(h,!0,f,f))):(d[f]++,Hg(b,g)):void 0!==d[f]&&0>=--d[f]&&(delete d[f],c(!1,f,f,tg(h,!1,f,f)))}}ia(){return'{"c":"'+this.na()+'"}'}toString(){return'Distinct()'}};N('olympe.dc.transformers.Distinct',olympe.dc.X.Gd);olympe.dc.X.Gd.ma=[olympe.dc.Zc];olympe.dc.X.Od=class{constructor(a,b){this.Bd=a;this.C=void 0===b?!0:!!b}$b(){return null}na(){return O(olympe.dc.X.Od)}F(){return[this.Bd.R()]}getTransform(a,b,c){const d=new olympe.dc.pc.Vq(this.C?this.Bd.G.bind(this.Bd):(e,f)=>this.Bd.G(f,e));return(e,f,g)=>{var h=e?this.Bd.L(a,f):void 0;h=d.C(e,f,g,h);c(e,f,g,h)}}ia(a){return'{"c":"'+this.na()+'","a":['+this.Bd.ia(a)+','+JSON.stringify(this.C)+']}'}toString(){return'Sort('+this.Bd.toString()+','+JSON.stringify(this.C)+')'}};
655
- N('olympe.dc.transformers.Sort',olympe.dc.X.Od);olympe.dc.X.Od.ma=[olympe.dc.Zc,olympe.dc.pq];olympe.dc.X.uc=class{constructor(a){this.C=a}$b(){return null}na(){return O(olympe.dc.X.uc)}F(){return this.C.F()}getTransform(a,b,c){function d(f,g,h,k){k=k.valueOf();!1===k&&Hg(b,g);k!==!!e[g]&&(e[g]=k,c(k,f,g,tg(h,k,f,g)))}const e={};return(f,g,h,k)=>{const l='@'+h;f?(f=this.C.C(a,g),olympe.D.nb(f)&&(f=f.Na),olympe.D.Sf(f)?(b.F||void 0!==olympe.D.Za(f)||Hg(b,h),e[l]=f,olympe.D.yc([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.na()+'","a":['+this.C.ia(a)+']}'}toString(){return'Filter('+this.C.toString()+')'}};N('olympe.dc.transformers.Filter',olympe.dc.X.uc);olympe.dc.X.uc.ma=[olympe.dc.Zc,olympe.dc.pq];olympe.dc.X.be=class{constructor(a,b){this.start=a;this.C=b}$b(){return null}na(){return O(olympe.dc.X.be)}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]);Eg(d,e,f,n,c)}};olympe.D.ke([this.start,this.C],(n,p)=>{f=n.valueOf();g=p.valueOf();k()});Ng(b,k);const l=Kg(b);Jg(b,l);return(n,p,q,r)=>{h||(r.Tc().Jg(t=>{e=t;Og(b,l)}),rg(b,()=>r.sg(),l),h=!0);d.C(n,p,q,null);sg(b,q,l)}}ia(a){return'{"c":"'+
657
- this.na()+'","a":['+Ff(a,this.start)+','+Ff(a,this.C)+']}'}toString(){return`Limit(${olympe.D.Za(this.start)},${olympe.D.Za(this.C)})`}};N('olympe.dc.transformers.Limit',olympe.dc.X.be);olympe.dc.X.be.ma=[olympe.dc.Zc];function $g(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.C(f));f=n.C(f);e.register(h,null);r=d.C(p,q,c,null);f(p,q,h,tg(r,p,q,h))}const h=olympe.W.fc(),k=olympe.dc.Pa(),l=a.X,n=olympe.D.Ia();olympe.D.yc([a.C],p=>{ah(k,p,g,h);void 0===k.model(p)&&qg(e)})}function ah(a,b,c,d){const e=b&&b.valueOf();e&&(uc(a,e,c,d),olympe.D.Ia().xc(()=>vc(a,e,d)))}
658
- olympe.dc.X.uf=class{constructor(a,b){this.X=this.C=null;a instanceof olympe.dc.Ba?(this.C=a.Qd(),this.X=a.Rl()):(this.C=a,b&&(this.X=b))}$b(){return null}na(){return O(olympe.dc.X.uf)||''}Bg(){return this.X}Qd(){return this.C}getTransform(a,b,c){const d=new olympe.dc.pc.Xl,e=new olympe.dc.pc.Ej;let f=[],g=[],h=!1,k=!1;const l=Kg(b),n=Kg(b);Ng(b,()=>{const p=f.concat(g);0<p.length?b.F||(b.C.C=p[p.length-1]):Og(b);Eg(d,p,0,p.length,c)});Jg(b,n);$g(this,a,this.C,e,b,(p,q,r,t)=>{const u=olympe.D.Ia();
659
- u.R()||u.zb()||(k||(t.Tc().Jg(v=>{g=v;Og(b,n)}),rg(b,()=>t.sg(),n),k=!0),d.C(p,q,r),sg(b,r,n))});Jg(b,l);return(p,q,r,t)=>{h||(t.Tc().Jg(u=>{f=u;Og(b,l)}),rg(b,()=>t.sg(),l),h=!0);d.C(p,q,r,l);sg(b,r,l)}}ia(a){const b=this.X?'['+this.X.map(c=>c.ia(a)).join(',')+']':'null';return'{"c":"'+this.na()+'","a":['+Ff(a,this.C)+','+b+']}'}toString(){const a=olympe.D.nb(this.C)?'N:'+this.C.Na.Z():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.ma=[olympe.dc.Zc];olympe.dc.Kg={};function bh(a,b){let c=Ac.get(b)||null,d=null;for(;!c&&b&&b!==d;){d=b;b=a.db.Af(b);if(null===b)break;c=Ac.get(b)||null}return c||null}olympe.dc.Kg.SyncManager=class{constructor(a,b,c){this.N=a;this.db=b;this.C=c}};olympe.dc.Kg.O={Ea:'dc.syncs.Logger',xa:'dc.syncs.SyncManager'};olympe.U.config(function(a){C(a,olympe.dc.Kg.O.Ea,[olympe.sa.O.xa],b=>b.Qc('dc'));B(a,olympe.dc.Kg.O.xa,olympe.dc.Kg.SyncManager,olympe.dc.Kg.O.Ea,olympe.dc.O.si,olympe.U.O.cg)});olympe.dc.W={};olympe.dc.W.MC=function(a){a=olympe.dc.wa(a);const b=olympe.D.Nc(olympe.D.Xa,'getInstanceName'),c=olympe.dc.Pa(),d=xd(c,a,olympe.dc.CloudObject.nameProp,b.update.bind(b));olympe.D.Ia().xc(c.F.bind(c,a,olympe.dc.CloudObject.nameProp,d));return b.Eb()};olympe.dc.W.PC=function(a){return olympe.D.Ga([a],b=>olympe.D.Wx(olympe.dc.Pa().jj(b)),olympe.D.ra)};olympe.dc.W.QC=function(a){return(a=olympe.D.Za(a))?olympe.dc.Pa().jj(a):!1};olympe.dc.W.Hi=class a{constructor(b=olympe.dc.Ka.Xc){this.G=b}C(b){const c=new olympe.dc.db.zc;this.F(b,c);return c}R(b,c,d){const e=new olympe.dc.db.zc(b),f=new olympe.dc.query.zi(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}L(b,c){const d=new olympe.dc.db.zc(b),e=new olympe.dc.query.rt(b,d);this.F(c,d,(f,g,h)=>{h=h||[];const k=new kf(f);k.add=g||[];k.remove=h;e.C.set(f,k)});return e}F(b,c,d){const e=olympe.dc.bc.Nd;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.qc(f.t,a.C(f.p),!0,b);break;case 3:c.Mc(f.t,f.f,b);break;case 4:c.Oa(f.m,f.l,f.r,b);break;case 5:c.Jb(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.bc.Nd||b===olympe.dc.bc.VERSION){c.set(b,e);continue}else if('v'===d){c.set(olympe.dc.bc.VERSION,e);continue}let f=
662
- typeof e;b.startsWith('fd')&&(b=olympe.dc.Tg.rc+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.Ec(e.t));break;case 'untyped':null===e&&c.set(b,null)}}return c}};olympe.dc.W.Vb={};olympe.dc.W.Vb.Nm=a=>'string'===typeof a||'number'===typeof a||'boolean'===typeof a||a instanceof String?olympe.D.Cb(a):a instanceof olympe.D.Xa?a:null;olympe.dc.W.Vb.Km=a=>'boolean'===typeof a||a instanceof Boolean?olympe.D.Bc(a):a instanceof olympe.D.ra?a:null;olympe.dc.W.Vb.Mm=a=>'number'===typeof a||a instanceof Number?olympe.D.za(a):'string'===typeof a||a instanceof String?olympe.D.za(Number.parseFloat(a.valueOf())):a instanceof olympe.D.da?a:null;
664
- olympe.dc.W.Vb.Lm=function(a){return'number'===typeof a||a instanceof Number?sb(a.valueOf()):'string'===typeof a||a instanceof String?new olympe.D.kb(new Date(a.valueOf().valueOf())):a instanceof Date?new olympe.D.kb(a):a instanceof olympe.D.kb?a:null};olympe.dc.W.Vb.Ar=function(a){return a instanceof olympe.D.Color?a:'string'===typeof a||a instanceof String?wb(a.valueOf()):null};olympe.dc.W.Vb.Br=a=>a instanceof olympe.dc.CloudObject?a:a instanceof olympe.dc.Ec?olympe.dc.CloudObject.get(a.tag):null;
665
- olympe.dc.W.Vb.hh=a=>a instanceof olympe.dc.Ec?olympe.dc.CloudObject.get(a.tag):a;olympe.dc.W.Vb.wC=a=>{switch(typeof a){case 'boolean':return olympe.D.Bc(a);case 'number':return olympe.D.za(a);case 'string':return olympe.D.Cb(a);case 'object':if(a instanceof Date)return olympe.D.Mx(a)}return a};
666
- olympe.dc.W.Vb.JC=a=>{switch(a){case olympe.D.ra:return olympe.dc.W.Vb.Km;case olympe.D.Xa:return olympe.dc.W.Vb.Nm;case olympe.D.da:return olympe.dc.W.Vb.Mm;case olympe.D.kb:return olympe.dc.W.Vb.Lm;case olympe.D.Color:return olympe.dc.W.Vb.Ar;case olympe.dc.CloudObject:return olympe.dc.W.Vb.Br;default:return olympe.dc.W.Vb.hh}};olympe.dc.O={xa:'dc.Manager',pt:'dc.Graph',si:'dc.DBView',Ea:'dc.Logger',$u:'dc.TransactionLogger',vi:'dc.FileServiceManager',oe:'dc.Router'};olympe.dc.Config={dg:'dc.debug',Yg:'dc.subscribeAll',to:'dc.defaultSource',Jo:'dc.fileCache',Co:'dc.errorOnAbstractInstantiation'};
667
- olympe.U.config(function(a){E(a,olympe.dc.Config.dg,!1);E(a,olympe.dc.Config.Yg,!1);E(a,olympe.dc.Config.to,olympe.dc.Ka.Xc);E(a,olympe.dc.Config.Jo,!0);E(a,olympe.dc.Config.Co,!0);C(a,olympe.dc.O.Ea,[olympe.sa.O.xa],b=>b.Qc('dc'));sa(a,olympe.dc.O.$u,olympe.dc.transaction.O.Ea);sa(a,olympe.dc.O.si,olympe.dc.db.O.jb);B(a,olympe.dc.O.vi,olympe.dc.lt,olympe.dc.O.Ea,olympe.la.O.xa,olympe.dc.O.oe,olympe.W.O.xh,new olympe.U.fa(olympe.dc.Config.Jo));ta(a,olympe.dc.O.oe);B(a,olympe.dc.O.xa,olympe.dc.ta,
668
- olympe.dc.O.Ea,olympe.dc.db.O.xa,olympe.dc.query.O.xa,olympe.dc.transaction.O.xa,olympe.dc.Kg.O.xa,olympe.dc.O.vi)},'olympe.dc');olympe.U.run([olympe.dc.db.O.xa,olympe.dc.query.O.xa,olympe.dc.transaction.O.xa,olympe.dc.Kg.O.xa,olympe.dc.O.xa,olympe.dc.O.vi],(a,b,c,d,e,f)=>{olympe.dc.Dd=()=>a;olympe.dc.Kf=()=>b;olympe.dc.gi=()=>c;olympe.dc.Tr=()=>d;olympe.dc.Tc=()=>e;olympe.dc.zw=()=>f},'DC singleton getter initialization');olympe.dc.CloudObject=class{constructor(a,b){this.tag=b;this.db=olympe.dc.Pa();this.model=null}static get(a){{var b=olympe.dc.Tr();a=olympe.dc.wa(a);const c=bh(b,b.db.model(a));null===c?(b.N.error(`Instantiation of a Sync (tag = '${a}') that does not exist (or incompletely exists) in the local database.\n
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:l,
514
+ order:n,Ld:p,Gv:q}=b.Ld,r=Array.from(b.G).sort().indexOf(q),t=n===olympe.dc.da.km.ASC?1:-1;d.sort((u,v)=>{v=v[r];u=c.fb(u[r],l);v=c.fb(v,l);return null===u?-t:null===v?t:t*p(u,v)})}else d.sort((l,n)=>l.reduce((p,q,r)=>p||q.localeCompare(n[r]),0));0<b.offset&&(d=d.slice(b.offset));-1<b.max&&(d=d.slice(0,b.max));const e=olympe.W.mb(d.flat().join(''));if(e===a.hash)return b.F=!1,a;d=d.map(l=>[l.join('.'),1===l.length?olympe.dc.CloudObject.get(l[0]):l.map(n=>olympe.dc.CloudObject.get(n))]);const f=new Set(d.map(l=>
515
+ l[0])),g=new Set(a.keys()),h=[],k=[];d.forEach(([l],n)=>{!g.has(l)&&h.push(n)});g.forEach(l=>{!f.has(l)&&k.push(l)});a=olympe.dc.Va.create(d,h,k,e);b.F=!1;return a}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),
516
+ a:this.G,r:this.N}}};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;
517
+ olympe.dc.Va.prototype.pop=olympe.dc.Va.prototype.pop;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;
518
+ olympe.dc.Va.prototype.keys=olympe.dc.Va.prototype.keys;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.N=b}function Ge(a){a.N?a.F||(a.F=!0,a.N()):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.G.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.G.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.G=new Set(Array.from(a.F));this.Ld=null;this.F=!1;this.N=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,
530
+ 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);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(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 if(!f){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
669
669
  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){const c=(new olympe.dc.Transaction).persist(!1),d=c.create(b||this);a.forEach((e,f)=>{d.setProperty(f,e instanceof olympe.dc.CloudObject?new olympe.dc.Ec(e.T()):e)});c.ib();return this.get(d)}static xv(){return this.get(this)}static Uk(a){return olympe.dc.hb.Uk(a)}static vd(){return olympe.dc.Pa().tb(this,
671
- olympe.dc.CloudObject.propertyRel).map(a=>new olympe.dc.va.Property(a))}static gd(){const a=olympe.dc.Pa();return a.tb(this,olympe.dc.CloudObject.G).map(b=>new olympe.dc.va.Relation(b)).concat(a.tb(this,olympe.dc.CloudObject.Y).map(b=>new olympe.dc.va.Relation(b,olympe.dc.Aa.ORIGIN)))}static If(a){return olympe.dc.CloudObject.get(a)}static Ew(a){var b=bh(olympe.dc.Tr(),olympe.dc.wa(a));b=b&&b.C;return new olympe.dc.Ba(olympe.dc.wa(a),olympe.dc.CloudObject.instancesRel,b)}T(){return this.tag}name(){return this.db.name(this)}na(){return this.Fb(olympe.dc.CloudObject.nameProp)}ei(){this.model||
672
- (this.model=olympe.dc.CloudObject.get(this.db.model(this)));return this.model}query(){return olympe.dc.hb.from(this)}Uf(){return this.db.Uf(this)}jx(){return this.db.version(this)}Mt(){return this.db.source(this)}Mr(){return olympe.D.Ga([this.na()],a=>olympe.D.Cb(a),olympe.D.Xa,'getDisplayName',olympe.D.Cb('('+this.toString()+')'))}Wb(){return this.model?this.model.T():this.db.model(this)}observe(a,b){const c='function'===typeof a.Fc?a.Fc():a;return new rxjs.Observable(d=>{const e=xd(this.db,this.tag,
673
- b,f=>{null===f||void 0===f?d.next(null):d.next(f)});c.xc(()=>{d.complete();this.db.F(this.tag,b,e)});return()=>this.db.F(this.tag,b,e)})}Qx(a){return this.observe(olympe.D.Ia(),a)}get(a){return this.db.gb(this.tag,a,!0)}gb(a){return this.get(a)}vb(a){return olympe.dc.hb.from(this).vb(a)}cw(a){return olympe.dc.nd.from(this).vb(a)}nw(){return this.ed(olympe.dc.CloudObject.Tb,olympe.dc.CloudObject)}$m(){return this.tb(olympe.dc.CloudObject.containsRel,olympe.dc.CloudObject)}Lf(a,b,c){const d=olympe.D.Nc(c,
674
- 'Sync valueType'),e=xd(this.db,this.tag,a,olympe.D.Ia().C(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.Lf(a,olympe.dc.W.Vb.Nm,olympe.D.Xa))}He(a){return L(this.Lf(a,olympe.dc.W.Vb.Mm,olympe.D.da))}nh(a){return L(this.Lf(a,olympe.dc.W.Vb.Km,olympe.D.ra))}gj(a){return L(this.Lf(a,olympe.dc.W.Vb.Lm,olympe.D.kb))}Sr(){return L(this.Lf(olympe.dm.Color.valueProp,olympe.dc.W.Vb.Ar,olympe.D.Color))}Uw(a){return L(this.Lf(a,
675
- olympe.dc.W.Vb.Br,olympe.dc.CloudObject))}tb(a,b){a=a instanceof olympe.dc.X.Sb?a:new olympe.dc.X.Sb(a.T(),a.Qa());return new olympe.dc.Ba(this.T(),a,b)}ed(a,b){return this.tb(a,b).Rc()}Jr(a,b){const c=this.db,d=olympe.W.fc(),e=olympe.D.Ia(),f=new Map;V(c,this.tag,a,(g,h)=>{g?(g=new olympe.D.Zb(`forEachRelated: (${this.tag})-[:${a.T()}]-(${h})`,e),f.set(h,g),g.run(b,olympe.dc.CloudObject.get(h))):f.has(h)&&(f.get(h).destroy(),f.delete(h))},d);e.xc(()=>{c.C(this.tag,a,d)})}ty(){return new olympe.dc.Ba(this.T(),
676
- [],Gc(this.T()))}transform(...a){return(new olympe.dc.Ba(this.T(),[],this.constructor)).transform(...a)}kd(){return this.Mr()}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'};const a=this.db.model(this.tag),b=this.db.name(a),
677
- c=this.db.name(this.tag);return{CloudObject:this.tag,Name:c,Model:`${b} (${a})`}}sb(a){return a instanceof olympe.dc.CloudObject?this.T()===a.T():!1}Vd(a){return olympe.D.Ga([a],b=>olympe.D.Bc(this.sb(b)),olympe.D.ra)}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.Aa.ORIGIN;for(const [e,f,g]of Ad(b,this))f===d?a.Jb(e,g,this):e!==olympe.dc.CloudObject.modelRel.T()&&a.Jb(e,this,g);a.delete(this,olympe.dc.Ub.NONE);c&&a.ib()}};
678
- olympe.dc.CloudObject.prototype.followSingle=olympe.dc.CloudObject.prototype.cw;olympe.dc.CloudObject.prototype.follow=olympe.dc.CloudObject.prototype.vb;olympe.dc.CloudObject.prototype.getProperty=olympe.dc.CloudObject.prototype.gb;olympe.dc.CloudObject.prototype.get=olympe.dc.CloudObject.prototype.get;olympe.dc.CloudObject.prototype.observeProperty=olympe.dc.CloudObject.prototype.Qx;olympe.dc.CloudObject.prototype.observe=olympe.dc.CloudObject.prototype.observe;
679
- olympe.dc.CloudObject.prototype.getModelTag=olympe.dc.CloudObject.prototype.Wb;olympe.dc.CloudObject.prototype.isPersisted=olympe.dc.CloudObject.prototype.Uf;olympe.dc.CloudObject.prototype.query=olympe.dc.CloudObject.prototype.query;olympe.dc.CloudObject.prototype.getModel=olympe.dc.CloudObject.prototype.ei;olympe.dc.CloudObject.prototype.name=olympe.dc.CloudObject.prototype.name;olympe.dc.CloudObject.prototype.getTag=olympe.dc.CloudObject.prototype.T;olympe.dc.CloudObject.getInstancesOf=olympe.dc.CloudObject.Ew;
680
- olympe.dc.CloudObject.getInstance=olympe.dc.CloudObject.If;olympe.dc.CloudObject.getRelations=olympe.dc.CloudObject.gd;olympe.dc.CloudObject.getProperties=olympe.dc.CloudObject.vd;olympe.dc.CloudObject.instancesOf=olympe.dc.CloudObject.Uk;olympe.dc.CloudObject.asInstance=olympe.dc.CloudObject.xv;olympe.dc.CloudObject.createWith=olympe.dc.CloudObject.Nv;olympe.dc.CloudObject.get=olympe.dc.CloudObject.get;olympe.dc.CloudObject.P=olympe.dc.Ca.C('ff021000000000000001',olympe.dc.CloudObject);
681
- olympe.dc.CloudObject.uh=olympe.dc.CloudObject.P.Da(olympe.dc.bc.VERSION);olympe.dc.CloudObject.nameProp=olympe.dc.CloudObject.P.Da('ff023000000000000011');z('olympe.dc.CloudObject.nameProp',olympe.dc.CloudObject.nameProp);olympe.dc.CloudObject.ea=olympe.dc.CloudObject.P.Da('ff023000000000000012');olympe.dc.CloudObject.G=olympe.dc.CloudObject.P.Ra('ff02200000000000000a');olympe.dc.CloudObject.Y=olympe.dc.CloudObject.P.Ra('ff02200000000000000b',olympe.dc.Aa.ORIGIN);olympe.dc.CloudObject.Of=olympe.dc.CloudObject.P.Ra('017e9c4ba4c847d71cbf');
682
- olympe.dc.CloudObject.ee=olympe.dc.CloudObject.P.Ra('017ea013caf8e89cedb2');olympe.dc.CloudObject.propertyRel=olympe.dc.CloudObject.P.Ra('ff02200000000000000c');z('olympe.dc.CloudObject.propertyRel',olympe.dc.CloudObject.propertyRel);olympe.dc.CloudObject.typeRel=olympe.dc.CloudObject.P.Ra('ff02200000000000000d',olympe.dc.Aa.ORIGIN);olympe.dc.CloudObject.modelRel=olympe.dc.CloudObject.P.Ra(olympe.dc.jc.Wc);z('olympe.dc.CloudObject.modelRel',olympe.dc.CloudObject.modelRel);
683
- 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.Ra(olympe.dc.jc.ui);z('olympe.dc.CloudObject.extendRel',olympe.dc.CloudObject.extendRel);olympe.dc.CloudObject.extendedByRel=P(olympe.dc.CloudObject.P,olympe.dc.CloudObject.extendRel);z('olympe.dc.CloudObject.extendedByRel',olympe.dc.CloudObject.extendedByRel);
684
- olympe.dc.CloudObject.containsRel=olympe.dc.CloudObject.P.Ra(olympe.dc.jc.eo);z('olympe.dc.CloudObject.containsRel',olympe.dc.CloudObject.containsRel);olympe.dc.CloudObject.Tb=P(olympe.dc.CloudObject.P,olympe.dc.CloudObject.containsRel);olympe.dc.cB=olympe.dc.CloudObject;olympe.dc.CloudObject.ma=[olympe.dc.ze];m=olympe.dc.CloudObject.prototype;m.T.K=new olympe.D.J(()=>String,[]);m.name.K=new olympe.D.J(()=>String,[]);m.na.K=olympe.D.J.F;m.ei.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);
685
- m.jx.K=new olympe.D.J(()=>Number,[]);m.Mt.K=new olympe.D.J(()=>String,[]);m.Mr.K=olympe.D.J.F;m.Wb.K=new olympe.D.J(()=>String,[]);m.nw.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.$m.K=new olympe.D.J(()=>olympe.dc.Ba,[]);m.Lf.K=new olympe.D.J(()=>olympe.D.Node,[]);m.Fb.K=olympe.D.J.F;m.He.K=olympe.D.J.G;m.nh.K=olympe.D.J.R;m.gj.K=new olympe.D.J(()=>olympe.D.kb,[]);m.Sr.K=new olympe.D.J(()=>olympe.D.Color,[]);m.Uw.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);
686
- m.tb.K=new olympe.D.J(()=>olympe.dc.Ba,[]);m.ed.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.Jr.K=new olympe.D.J(()=>{},[]);m.ty.K=new olympe.D.J(()=>olympe.dc.Ba,[]);m.transform.K=new olympe.D.J(()=>olympe.dc.Ba,[]);m.kd.K=olympe.D.J.F;m.toString.K=olympe.D.J.C;m.sb.K=olympe.D.J.C;m.Vd.K=olympe.D.J.R;m.Pv.K=new olympe.D.J(()=>{},[]);olympe.dc.ck=class{constructor(a){this.instance=a}T(){return this.instance.T()}ij(){return nb(this.instance.nh(olympe.dc.CloudObject.ea))}xw(){return this.instance.ed(olympe.dc.CloudObject.extendRel,olympe.dc.CloudObject)}cn(){return this.instance.transform(new olympe.dc.X.Dc(olympe.dc.CloudObject.extendRel.T(),olympe.dc.Aa.DESTINATION,olympe.dc.X.nk.ht))}fn(){return this.instance.transform(new olympe.dc.X.Dc(olympe.dc.CloudObject.extendRel.T(),olympe.dc.Aa.DESTINATION,olympe.dc.X.nk.rp))}vd(){return this.fn().transform(olympe.dc.CloudObject.propertyRel,
687
- new olympe.dc.X.Gd)}Nw(){return this.instance.transform(olympe.dc.CloudObject.propertyRel)}gd(){return this.fn().transform(olympe.dc.CloudObject.G,new olympe.dc.X.Gd)}Ow(){return this.instance.transform(olympe.dc.CloudObject.G)}static from(a){return olympe.D.Ga([a],b=>{const c=b.T(),d=olympe.dc.Pa();if(!d.jj(c))throw Error(`Instance "${d.name(c)}" (tag=${c}) is not a model.`);return new olympe.dc.ck(b)},olympe.dc.ck,'transformToModelInfo')}static ij(){return nb((void 0).nh(olympe.dc.CloudObject.ea))}};
688
- olympe.dc.ck.ma=[olympe.dc.ze];m=olympe.dc.ck.prototype;m.xw.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.cn.K=new olympe.D.J(()=>olympe.dc.Ba,[]);m.fn.K=new olympe.D.J(()=>olympe.dc.Ba,[]);m.vd.K=new olympe.D.J(()=>olympe.dc.Ba,[]);m.Nw.K=new olympe.D.J(()=>olympe.dc.Ba,[]);m.gd.K=new olympe.D.J(()=>olympe.dc.Ba,[]);m.Ow.K=new olympe.D.J(()=>olympe.dc.Ba,[]);olympe.dc.jA=class{};olympe.dc.aa={};olympe.dc.aa.vp=class{constructor(a){this.N=a}};olympe.dc.aa.vp.qd={Oi:0,BA:1,CA:3,lA:4};olympe.dc.aa.Wj=class{};function Y(a){if(a.Y)throw Error('Cannot modify definition after definition is written');}
689
- olympe.dc.aa.ac=class{constructor(a,b){a=this.C=a;if(a.C)throw b=a.C.na(),a=a.C.T(),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.ea=olympe.dc.CloudObject.P.T();this.Fa=new Map;this.qa=new Map;this.Y=this.ka=!1;this.R=null}zn(a){Y(this);this.ea=a;return this}Wb(){return this.ea}tj(a){Y(this);
690
- this.R=a;return this}gy(){this.ka=!0;return this}fy(a){Y(this);const b=new Map;if('string'===typeof a){const c=olympe.dc.CloudObject.nameProp.T();b.set(c,a||'')}else Object.keys(a).forEach(c=>{b.set(c,a[c])});this.F=b;return this}ji(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}gl(a){Y(this);const b=olympe.dc.CloudObject.nameProp.T();this.F.set(b,a);return this}wr(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.T())throw Error('Container must be defined using dedicated helpers setContainedIn');b&&this.Fa.set(a+'.'+b,[a,b]);return this}Gm(a,b){Y(this);if(!a)throw Error('Cannot relate an object to another without a relation tag');if(a===olympe.dc.CloudObject.containsRel.T())throw Error('Container must be defined using dedicated helper setContainedIn');b&&this.qa.set(a+'.'+b,[a,b]);return this}done(){if(this.Y)return this;const a=ch(this.C,this.ka);a.F(this.tag,this.F,
692
- -1);dh(this.C,this);a.Oa(olympe.dc.jc.Wc,this.tag,this.ea,-1);this.R&&a.Oa(olympe.dc.jc.eo,this.R,this.tag,-1);this.G(-1);this.Fa.forEach(b=>{a.Oa(b[0],this.tag,b[1],-1)});this.qa.forEach(b=>{a.Oa(b[0],b[1],this.tag,-1)});this.Y=!0;this.C.C=void 0;return this}G(){}T(){return this.tag}na(){return this.F.get('ff023000000000000011')}};olympe.dc.aa.ac.prototype.getName=olympe.dc.aa.ac.prototype.na;olympe.dc.aa.ac.prototype.getTag=olympe.dc.aa.ac.prototype.T;olympe.dc.aa.ac.prototype.done=olympe.dc.aa.ac.prototype.done;
693
- olympe.dc.aa.ac.prototype.addRelationFrom=olympe.dc.aa.ac.prototype.Gm;olympe.dc.aa.ac.prototype.addRelationTo=olympe.dc.aa.ac.prototype.wr;olympe.dc.aa.ac.prototype.setName=olympe.dc.aa.ac.prototype.gl;olympe.dc.aa.ac.prototype.setProperty=olympe.dc.aa.ac.prototype.setProperty;olympe.dc.aa.ac.prototype.setProperties=olympe.dc.aa.ac.prototype.ji;olympe.dc.aa.ac.prototype.setNameOrProperties=olympe.dc.aa.ac.prototype.fy;olympe.dc.aa.ac.prototype.setOptional=olympe.dc.aa.ac.prototype.gy;
694
- olympe.dc.aa.ac.prototype.setContainedIn=olympe.dc.aa.ac.prototype.tj;olympe.dc.aa.ac.prototype.setModelTag=olympe.dc.aa.ac.prototype.zn;olympe.dc.aa.cd=class extends olympe.dc.aa.ac{constructor(a,b){super(a,b);this.Ta=this.C.OBJECT;this.cb=new Map;this.$a=new Map}ns(a){Y(this);this.Ta=a;return this}extends(a){return this.ns(a)}Ri(){Y(this);this.setProperty(olympe.dc.CloudObject.ea.T(),!0);return this}defineProperty(a,b,c,d){Y(this);this.cb.set(a,new olympe.dc.aa.cd.Property(a,b,c,d));void 0!==d&&super.setProperty(olympe.dc.Tg.rc+a,d);return this}ih(a,b,c,d,e,{Ui:f=0,pj:g=olympe.dm.Relation.L,sj:h=0,il:k=d,Jk:l=olympe.dm.Uc.NONE}=
695
- {}){Y(this);b=new olympe.dc.aa.cd.Relation(a,this.T(),b,c||'',d,e,h,k,f,g,l);this.$a.set(a,b);return this}G(a){super.G(a);ch(this.C).Oa(olympe.dc.CloudObject.extendRel.T(),this.tag,this.Ta,a);this.cb.forEach(b=>{const c={[olympe.dc.CloudObject.nameProp.T()]:b.name||''},d=olympe.dc.wa(olympe.dm.Property),e=olympe.dc.CloudObject.propertyRel.T(),f=b.tag;this.C.push();this.C.wh(f,d).ji(c).done();this.C.pop();b=b.type;ch(this.C).Oa(e,this.T(),f,a);ch(this.C).Oa(olympe.dm.Property.typeRel.T(),f,b,a)});
696
- this.$a.forEach(b=>{this.C.ih(b.C,b.G,b.F,b.name,b.Ir,b.Gr,{sj:b.sj,il:b.il,Ui:b.Ui,pj:b.pj,Jk:b.Jk},a)})}};olympe.dc.aa.cd.prototype.defineRelation=olympe.dc.aa.cd.prototype.ih;olympe.dc.aa.cd.prototype.defineProperty=olympe.dc.aa.cd.prototype.defineProperty;olympe.dc.aa.cd.prototype['abstract']=olympe.dc.aa.cd.prototype.Ri;olympe.dc.aa.cd.prototype['extends']=olympe.dc.aa.cd.prototype.extends;olympe.dc.aa.cd.prototype.setParentTag=olympe.dc.aa.cd.prototype.ns;
697
- olympe.dc.aa.cd.Property=class{constructor(a,b,c,d){this.tag=a;this.type=b;this.name=c||'';this.defaultValue=d}};olympe.dc.aa.cd.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.Ir=e;this.Gr=f;this.sj=g;this.il=h;this.Ui=k;this.pj=l;this.Jk=n}};function ch(a,b){return b?a.Y:a.F}function dh(a,b){0<a.L.length&&(b.R||a.F.Oa(olympe.dc.CloudObject.containsRel.T(),a.L[a.L.length-1].T(),b.T(),-1))}
698
- olympe.dc.aa.Sa=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.Md(!0);this.Y=new olympe.dc.transaction.Md(!0);this.N=a||null;this.Fa=!1;this.G=null;this.qa=new Map;this.ea=null;this.ka=Object.create(null);this.C=void 0;this.L=[];this.R=!0;this.hs=/eval \(eval at process .*<anonymous>:(\d+):(\d+)\)/m;this.DEFAULT=olympe.dc.Tg.rc;this.OBJECT=olympe.dc.CloudObject.P.T();
699
- this.PROPERTY=olympe.dm.Property.P.T();this.RELATION=olympe.dm.Relation.P.T();this.STRING=olympe.dm.String.P.T();this.BOOLEAN=olympe.dm.Boolean.P.T();this.NUMBER=olympe.dm.Number.P.T();this.DATETIME=olympe.dm.DateTime.P.T();this.COLOR=olympe.dm.Color.P.T();this.FILE=olympe.dm.File.P.T();this.ROLE=olympe.dm.dd.P.T();this.USER=olympe.dm.User.P.T();this.ONE_ONE=olympe.dm.Relation.F.mu;this.ONE_MANY=olympe.dm.Relation.F.am;this.MANY_ONE=olympe.dm.Relation.F.eu;this.MANY_MANY=olympe.dm.Relation.F.Wl;this.NONE=
700
- olympe.dm.Uc.NONE;this.DESTINATION_READ=olympe.dm.Uc.Us;this.DESTINATION_CREATE=olympe.dm.Uc.wo;this.DESTINATION_WRITE=olympe.dm.Uc.Vs;this.DESTINATION_DELETE=olympe.dm.Uc.Rs;this.DESTINATION_LINK=olympe.dm.Uc.Ts;this.DESTINATION_FULL=olympe.dm.Uc.Ss;this.ORIGIN_READ=olympe.dm.Uc.qu;this.ORIGIN_CREATE=olympe.dm.Uc.nu;this.ORIGIN_WRITE=olympe.dm.Uc.ru;this.ORIGIN_DELETE=olympe.dm.Uc.ou;this.ORIGIN_LINK=olympe.dm.Uc.bq;this.ORIGIN_FULL=olympe.dm.Uc.pu;this.FULL=olympe.dm.Uc.jt;this.DUMP_IGNORE=olympe.dm.Relation.C.kp;
701
- this.DUMP_REF=olympe.dm.Relation.C.xq;this.DUMP_REVERSE_REF=olympe.dm.Relation.C.Ju;this.DUMP_UNILATERAL=olympe.dm.Relation.C.yk;this.DUMP_REVERSE_UNILATERAL=olympe.dm.Relation.C.mk;this.DUMP_EVERYTHING=olympe.dm.Relation.C.Do;this.DUMP_DEFAULT=olympe.dm.Relation.C.rc;this.DUMP_REV_DEFAULT=olympe.dm.Relation.C.Iu;this.DELETE_REF=this.DUMP_BOTH_REF=olympe.dm.Relation.C.ql;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.Do;this.OLYMPE_AUTHENTICATED_USERS=olympe.dm.dd.F}push(){this.L.push(this.C);this.C=void 0}pop(){if(this.C)throw Error('Cannot unstack definition: current definition not closed');this.C=this.L.pop()}$v(){const a=new Map,b=olympe.dc.aa.Tu.C(this.ea,this.F,this.Y);for(const [c,d]of b.entries())a.set(c,d.wj());return a}Xw(){return this.ea}ey(a){this.R=a}log(...a){this.R&&this.N&&this.N.log(...a)}sn(...a){this.R&&this.N&&this.N.debug(...a)}wx(...a){this.R&&this.N&&this.N.warn(...a)}Yk(...a){this.R&&
703
- this.N&&this.N.error(...a)}zv(a){if(a&&20===a.length&&!this.Fa){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.aj():olympe.W.Vw(this.G);this.log('Generating new tag to replace '+a+'. New tag is: '+this.G);return this.G}gn(a){const b=this.qa.get(a)||1,c=olympe.W.gn(a,b);this.qa.set(a,b+1);return c}ky(a){this.Fa=a}Rv(){}iy(a){this.ea=a}wh(a,b){return(new olympe.dc.aa.ac(this,a)).zn(b)}Jx(a,b){return(new olympe.dc.aa.cd(this,
704
- a)).gl(b)}Ix(a,b){return(new olympe.dc.aa.cd(this,a)).gl(b).Ri()}Kx(a){return new olympe.dc.aa.vf(this,a)}al(a,b,c){this.F.Oa(a,b,c,-1)}defineProperty(a,b,c,d,e){this.sn('Defining property ',d,' on model ',a);d={[olympe.dc.CloudObject.nameProp.T()]:d||''};void 0!==e&&this.qc(a,{[olympe.dc.Tg.rc+c]:e});this.C?(this.push(),this.wh(c,olympe.dm.Property.P.T()).ji(d).done(),this.pop()):this.wh(c,olympe.dm.Property.P.T()).ji(d).tj(a).done();this.al(olympe.dc.CloudObject.propertyRel.T(),a,c);this.al(olympe.dm.Property.typeRel.T(),
705
- c,b)}ih(a,b,c,d,e,f,{Ui:g=olympe.dm.Relation.F.am,pj:h=olympe.dm.Relation.L,sj:k=0,il:l=e,Jk:n=olympe.dm.Uc.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.T()]:d||
706
- '',[q.Jm.T()]:g,[q.wn.T()]:h,[q.Tm.T()]:e,[q.Sm.T()]:f,[q.fl.T()]:k,[q.ps.T()]:l,[q.Av.T()]:n};this.C?(this.push(),this.wh(a,q.P.T()).ji(d).done(),this.pop()):this.wh(a,q.P.T()).ji(d).tj(b).done();this.F.Oa(q.originModelRel.T(),b,a,p);this.F.Oa(q.destinationModelRel.T(),a,c,p)}tx(a,b){this.F.Oa(olympe.dm.dd.C.T(),a,b,-1)}qc(a,b,c=!1){this.sn('Updating instance ',a);delete b[olympe.dc.bc.Nd];delete b[olympe.dc.bc.VERSION];const d=new Map;Object.keys(b).forEach(e=>{d.set(e,b[e])});this.F.qc(a,d,c,-1)}assign(a,
707
- b,c){this.al(b,a,c)}yv(a,b,c){this.Y.Oa(b,a,c,-1)}Mv(a){return new olympe.dc.Ec(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,VC:g=0,gD: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}$i(a,b,c){return olympe.auth.Hb.Ee.$i(a,c)}Kr(a,b){return olympe.auth.Hb.Ee.$i(a,b)}Jb(){throw Error('DeleteRelation method on OSaveFile is deprecated');}Mc(){throw Error('DeleteInstance method on OSaveFile is deprecated');}};
709
- olympe.dc.aa.Sa.prototype.deleteInstance=olympe.dc.aa.Sa.prototype.Mc;olympe.dc.aa.Sa.prototype.deleteRelation=olympe.dc.aa.Sa.prototype.Jb;olympe.dc.aa.Sa.prototype.generateAuthenticationData=olympe.dc.aa.Sa.prototype.Kr;olympe.dc.aa.Sa.prototype.generateAuthData=olympe.dc.aa.Sa.prototype.$i;olympe.dc.aa.Sa.prototype.createDateTimeLegacy=olympe.dc.aa.Sa.prototype.Jv;olympe.dc.aa.Sa.prototype.fromISODate=olympe.dc.aa.Sa.prototype.ew;olympe.dc.aa.Sa.prototype.createDateTime=olympe.dc.aa.Sa.prototype.Iv;
710
- olympe.dc.aa.Sa.prototype.createColor=olympe.dc.aa.Sa.prototype.Hv;olympe.dc.aa.Sa.prototype.createReference=olympe.dc.aa.Sa.prototype.Mv;olympe.dc.aa.Sa.prototype.assignOptional=olympe.dc.aa.Sa.prototype.yv;olympe.dc.aa.Sa.prototype.assign=olympe.dc.aa.Sa.prototype.assign;olympe.dc.aa.Sa.prototype.updateInstance=olympe.dc.aa.Sa.prototype.qc;olympe.dc.aa.Sa.prototype.linkRoleToUser=olympe.dc.aa.Sa.prototype.tx;olympe.dc.aa.Sa.prototype.defineRelation=olympe.dc.aa.Sa.prototype.ih;
711
- olympe.dc.aa.Sa.prototype.defineProperty=olympe.dc.aa.Sa.prototype.defineProperty;olympe.dc.aa.Sa.prototype.newRelation=olympe.dc.aa.Sa.prototype.al;olympe.dc.aa.Sa.prototype.newUser=olympe.dc.aa.Sa.prototype.Kx;olympe.dc.aa.Sa.prototype.newAbstractModel=olympe.dc.aa.Sa.prototype.Ix;olympe.dc.aa.Sa.prototype.newModel=olympe.dc.aa.Sa.prototype.Jx;olympe.dc.aa.Sa.prototype.newInstance=olympe.dc.aa.Sa.prototype.wh;olympe.dc.aa.Sa.prototype.setRootInstanceTag=olympe.dc.aa.Sa.prototype.iy;
712
- olympe.dc.aa.Sa.prototype.disableChecks=olympe.dc.aa.Sa.prototype.Rv;olympe.dc.aa.Sa.prototype.setUseNewTags=olympe.dc.aa.Sa.prototype.ky;olympe.dc.aa.Sa.prototype.assignTag=olympe.dc.aa.Sa.prototype.zv;olympe.dc.aa.Sa.prototype.logError=olympe.dc.aa.Sa.prototype.Yk;olympe.dc.aa.Sa.prototype.logWarn=olympe.dc.aa.Sa.prototype.wx;olympe.dc.aa.Sa.prototype.logDebug=olympe.dc.aa.Sa.prototype.sn;olympe.dc.aa.Sa.prototype.log=olympe.dc.aa.Sa.prototype.log;olympe.dc.aa.Sa.prototype.setLoggingEnabled=olympe.dc.aa.Sa.prototype.ey;
713
- olympe.dc.aa.Sa.prototype.getRootInstanceTag=olympe.dc.aa.Sa.prototype.Xw;olympe.dc.aa.Sa.prototype.flushContents=olympe.dc.aa.Sa.prototype.$v;olympe.dc.aa.qg=class extends olympe.dc.aa.cd{constructor(a,b,c){super(a,b);this.L=this.description=null;this.setProperty(olympe.dm.BrickMetadata.cb.T(),olympe.dm.BrickMetadata.Ab.tu);null!==c&&this.xr(c)}xr(a){this.tj(a);this.Gm(olympe.dm.Rb.C.T(),a);return this}dy(a){this.F.set(olympe.dm.xe.Ta.T(),a);return this}by(a){Y(this);this.description=a;return this}jy(a){Y(this);this.L=a;return this}G(a){super.G(a);if(null!==this.description||null!==this.L)this.C.push(),a=this.C.wh(this.C.gn(this.tag),olympe.sc.Cc.P.T()),
714
- this.description&&a.setProperty(olympe.sc.Cc.C.T(),this.description),this.L&&a.setProperty(olympe.sc.Cc.L.T(),this.L),a.tj(this.tag).wr(olympe.sc.Cc.F.T(),this.tag).done(),this.C.pop()}};olympe.dc.aa.qg.prototype.setSummary=olympe.dc.aa.qg.prototype.jy;olympe.dc.aa.qg.prototype.setDescription=olympe.dc.aa.qg.prototype.by;olympe.dc.aa.qg.prototype.setIcon=olympe.dc.aa.qg.prototype.dy;olympe.dc.aa.qg.prototype.addToFolder=olympe.dc.aa.qg.prototype.xr;olympe.dc.aa.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.Md&&d instanceof olympe.dc.transaction.Md){c=ae(c);var e=ae(d)}else e=new olympe.dc.transaction.Md(!0),c.$c(e),c=ae(e),d.$c(e),e=ae(e);d=new Map;var f=new a(b,c.vg,e.vg);f.Qf()||d.set('delRel',f);f=new a(b,c.Ue,e.Ue);f.Qf()||d.set('detInst',f);f=new a(b,c.Fg,e.Fg);f.Qf()||d.set('newInst',f);f=new a(b,c.Zf,e.Zf);f.Qf()||d.set('updateInst',f);b=new a(b,c.Gg,e.Gg);b.Qf()||
715
- d.set('newRel',b);return d}Qf(){return 0===this.ua.length+this.C.length}static un(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}wj(){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);c.rootTag=this.F;c.operations=this.ua.sort(b);c.optionalOperations=this.C.sort(b);return c}};olympe.dc.aa.vf=class extends olympe.dc.aa.ac{constructor(a,b){super(a,b);this.password=this.L=null;this.zn(olympe.dc.wa(olympe.dm.User))}ly(a){Y(this);this.L=a;return this}An(a){Y(this);this.password=a;return this}cy(){return this}Bv(a){Y(this);this.Gm(olympe.dm.User.C.T(),a);return this}G(a){super.G(a);if(null==this.L||''===this.L)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.Kr(this.L,this.password),c=new Map;c.set(olympe.dm.User.loginProp.T(),b.login);c.set(olympe.dm.User.saltProp.T(),b.salt);c.set(olympe.dm.User.verifierProp.T(),b.verifier);ch(this.C).qc(this.T(),c,!1,a)}};olympe.dc.aa.vf.prototype.awardRole=olympe.dc.aa.vf.prototype.Bv;olympe.dc.aa.vf.prototype.setDomain=olympe.dc.aa.vf.prototype.cy;olympe.dc.aa.vf.prototype.setPassword=olympe.dc.aa.vf.prototype.An;olympe.dc.aa.vf.prototype.setUsername=olympe.dc.aa.vf.prototype.ly;olympe.dc.aa.O={At:'dc.io.IOService',Eh:'dc.io.IOUrlsProvider'};olympe.U.config(function(a){ta(a,olympe.dc.aa.O.Eh);C(a,olympe.dc.aa.O.At,[olympe.sa.O.xa,olympe.la.O.xa,olympe.auth.O.xa,olympe.dc.aa.O.Eh],b=>new olympe.dc.aa.vp(b.Qc('dc.io')))},'olympe.dc.io');olympe.dc.aa.RC=function(a,b,c=!1){if(a.startsWith('@')||a.startsWith('v'))return!1;a.startsWith(olympe.dc.Tg.rc)&&(a=a.substring(1));const d=olympe.dc.Pa();return b?c?Cd(d,a,b):Cd(d,a,d.model(b)):d.Gb(a)};olympe.dm={};olympe.dm.Uc={NONE:0,Us:1,wo:2,Vs:4,Rs:8,Ts:16,Ss:31,qu:32,nu:64,ru:128,ou:256,bq:512,pu:992,jt:1023};olympe.dm.dd=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}na(){return this.Fb(olympe.dc.CloudObject.nameProp)}C(){return olympe.D.Xa.EMPTY}F(){return olympe.D.ra.C}};olympe.dm.dd.P=olympe.dc.Ca.C('ff021000000000000002',olympe.dm.dd);olympe.dm.dd.ka=olympe.dm.dd.P.Da('ff023000000000000035');olympe.dm.dd.C=olympe.dm.dd.P.Ra('ff022000000000000005');olympe.dm.dd.F=Fc('ff011000000000000001','AUTHENTICATED_USERS');olympe.dm.dd.R=Fc('ff011000000000000002','PROJECT_RUNNER_USERS_ROLE');
718
- olympe.dm.dd.L=Fc('014831d95f83635090ea','ADMIN_USERS_ROLE');olympe.dm.dd.prototype.na.K=olympe.D.J.F;olympe.dm.dd.prototype.C.K=olympe.D.J.F;olympe.dm.dd.prototype.F.K=olympe.D.J.R;olympe.dm.User=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}Aw(){return this.dn()}na(){return this.dn()}dn(){return this.Fb(olympe.dm.User.loginProp)}Ot(){return this.Fb(olympe.dm.User.F)}Nt(){return olympe.D.Xa.EMPTY}Zw(){return this.Fb(olympe.dm.User.saltProp)}ix(){return this.Fb(olympe.dm.User.verifierProp)}Ww(){return this.tb(olympe.dm.User.C,olympe.dm.dd)}};olympe.dm.User.P=olympe.dc.Ca.C('ff021000000000000003',olympe.dm.User);olympe.dm.User.loginProp=olympe.dm.User.P.Da('ff023000000000000001');
719
- z('olympe.dm.User.loginProp',olympe.dm.User.loginProp);olympe.dm.User.F=olympe.dm.User.P.Da('ff023000000000000002');olympe.dm.User.saltProp=olympe.dm.User.P.Da('ff023000000000000004');z('olympe.dm.User.saltProp',olympe.dm.User.saltProp);olympe.dm.User.verifierProp=olympe.dm.User.P.Da('ff023000000000000005');z('olympe.dm.User.verifierProp',olympe.dm.User.verifierProp);olympe.dm.User.R=olympe.dm.User.P.Da('ff023000000000000020');olympe.dm.User.SAMLnameIdProp=olympe.dm.User.P.Da('ff023000000000000036');
720
- z('olympe.dm.User.SAMLnameIdProp',olympe.dm.User.SAMLnameIdProp);olympe.dm.User.C=P(olympe.dm.User.P,olympe.dm.dd.C);olympe.dm.User.ka=olympe.dm.User.P.Ra('ff022000000000000002');olympe.dm.User.L=Fc('0163d9653067b6237f62','GUEST_USER');m=olympe.dm.User.prototype;m.Aw.K=olympe.D.J.F;m.na.K=olympe.D.J.F;m.dn.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.Ba,[]);olympe.dm.xe=class extends olympe.dc.CloudObject{ka(){return this.$m()}Ab(){return this.Fb(olympe.dm.xe.Ta)}};olympe.dm.xe.P=olympe.dc.Ca.C('01621fb84e3300000000',olympe.dm.xe);olympe.dm.xe.Ta=olympe.dm.xe.P.Da('01609de3f292e3c2c6ff');olympe.dm.xe.prototype.ka.K=new olympe.D.J(()=>olympe.D.pd,[]);olympe.dm.xe.prototype.Ab.K=olympe.D.J.F;olympe.dm.BrickMetadata=class extends olympe.dm.xe{Pb(){return this.Fb(olympe.dm.BrickMetadata.cb)}Td(){return this.Fb(olympe.dm.BrickMetadata.$a)}C(){return null}};olympe.dm.BrickMetadata.P=Jc(olympe.dc.Ca.C('01621fb84e3500000000',olympe.dm.BrickMetadata));olympe.dm.BrickMetadata.cb=olympe.dm.BrickMetadata.P.Da('01621fb84e320000f001');olympe.dm.BrickMetadata.$a=olympe.dm.BrickMetadata.P.Da('01703376c4a81c0e9d94');olympe.dm.BrickMetadata.Vf=olympe.dm.BrickMetadata.P.Ra('0161ae97622bb21f335b');
721
- olympe.dm.BrickMetadata.Ab={uA:'private',tu:'public'};olympe.dm.BrickMetadata.Pc=Fc('01703376c4a81c0e9d95','BRICK_STATUS');olympe.dm.BrickMetadata.qd={jz:'experimental',FA:'stable',az:'deprecated'};olympe.dm.BrickMetadata.prototype.Pb.K=olympe.D.J.F;olympe.dm.BrickMetadata.prototype.Td.K=olympe.D.J.F;olympe.dm.BrickMetadata.prototype.C.K=new olympe.D.J(()=>String,[]);olympe.dm.Rb=class extends olympe.dm.BrickMetadata{R(){return new olympe.dc.Ba(this.T(),[new olympe.dc.X.Dc(olympe.dm.Rb.F.T(),olympe.dc.Aa.DESTINATION,olympe.dc.X.nk.rp,olympe.dc.X.nk.ut),olympe.dm.Rb.C])}C(){return null}F(){return this.tb(olympe.dm.Rb.F,olympe.dm.Rb)}Y(){return this.tb(olympe.dm.Rb.C)}};olympe.dm.Rb.P=olympe.dc.Ca.C('01612df1db9749227626',olympe.dm.Rb);olympe.dm.Rb.F=olympe.dm.Rb.P.Ra('016a697ef00ce7554691');olympe.dm.Rb.Pb=P(olympe.dm.Rb.P,olympe.dm.Rb.F);olympe.dm.Rb.C=olympe.dm.Rb.P.Ra('016a697ef00ce7554692');
722
- P(olympe.dc.CloudObject.P,olympe.dm.Rb.C);olympe.dm.Rb.prototype.R.K=new olympe.D.J(()=>olympe.dc.Ba,[]);olympe.dm.Rb.prototype.F.K=new olympe.D.J(()=>olympe.dc.Ba,[]);olympe.dm.Rb.prototype.Y.K=new olympe.D.J(()=>olympe.dc.Ba,[]);olympe.dm.od=class extends olympe.dm.Rb{F(){return this.T()===olympe.dm.od.Fa?this.tb(olympe.dm.od.R,olympe.dm.Rb):this.tb(olympe.dm.od.ka,olympe.dm.Rb)}};olympe.dm.od.P=olympe.dc.Ca.C('ff021000000000000020',olympe.dm.od);olympe.dm.od.ka=olympe.dm.od.P.Ra('017e9c34cf48bd6965c1');olympe.dm.od.R=olympe.dm.od.P.Ra('017e9c2e013e06bfffd9');olympe.dm.od.Fa=Fc('10000000000000000000','ROOT_OF_ROOTS');olympe.dm.od.Lc=Fc('10000000000000000001','OLYMPE_FOLDER');
723
- olympe.dm.od.prototype.F.K=new olympe.D.J(()=>olympe.dc.Ba,[]);olympe.dm.Module=class extends olympe.dc.CloudObject{yw(){return this.Fb(olympe.dm.Module.ka)}Kw(){return this.He(olympe.dm.Module.qa)}Pt(){return this.Fb(olympe.dm.Module.F)}Pw(){return this.Fb(olympe.dm.Module.Fa)}lw(){return this.Fb(olympe.dm.Module.L)}Lw(){return this.tb(olympe.dm.Module.R,olympe.dm.Module)}$w(){return this.tb(olympe.dm.Module.C,olympe.dm.Id)}};olympe.dm.Module.P=olympe.dc.Ca.C('ff021000000000000040',olympe.dm.Module);olympe.dm.Module.ka=olympe.dm.Module.P.Da('ff023000000000000042');
724
- olympe.dm.Module.qa=olympe.dm.Module.P.Da('ff023000000000000043');olympe.dm.Module.F=olympe.dm.Module.P.Da('ff023000000000000044');olympe.dm.Module.Fa=olympe.dm.Module.P.Da('ff023000000000000045');olympe.dm.Module.L=olympe.dm.Module.P.Da('ff023000000000000046');olympe.dm.Module.creationDateProp=olympe.dm.Module.P.Da('ff023000000000000049');olympe.dm.Module.C=olympe.dm.Module.P.Ra('ff022000000000000013');olympe.dm.Module.R=olympe.dm.Module.P.Ra('ff022000000000000014');
725
- olympe.dm.Module.Ta=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.Ba,[]);m.$w.K=new olympe.D.J(()=>olympe.dc.Ba,[]);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}en(){return this.Fb(olympe.dm.File.mimeTypeProp)}Ok(a,b){const c=olympe.D.Ia().C(a),d=b&&olympe.D.Ia().C(b);(a=this.db.gb(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)})}Zm(a,b){this.Ok(c=>{a(Ea(c))},b)}Pk(a,b){const c=olympe.D.Ia().C(a);b=b&&olympe.D.Ia().C(b);const d=this.db.gb(this,olympe.dm.File.C),
726
- e=this.db.gb(this,olympe.dm.File.urlProp),f=g=>{const h=this.db.gb(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().C(b);olympe.D.ds([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.ib(f=>{c&&c(f)})})}ay(){this.G.L(this.db.gb(this,olympe.dm.File.mimeTypeProp))}Ql(){return this.Fb(olympe.dm.File.urlProp)}xp(){return this.Fb(olympe.dm.File.nameProp)}ow(){return this.gj(olympe.dm.File.creationDateProp)}Jw(){return this.gj(olympe.dm.File.modificationDateProp)}Wr(){return this.nh(olympe.dm.File.C)}static Kv(a,
727
- b,c,d,e,f){d=d||'application/data';c=olympe.W.bi().L(new Blob([c],{type:d}));return olympe.dm.File.Fr(a,b,c,d,e,f)}static Fr(a,b,c,d,e,f){const g=olympe.D.kb.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.Ka.rc,f)}};olympe.dm.File.createFromURL=olympe.dm.File.Fr;
728
- olympe.dm.File.createFromContent=olympe.dm.File.Kv;olympe.dm.File.prototype.saveAs=olympe.dm.File.prototype.ay;olympe.dm.File.prototype.getContentUrl=olympe.dm.File.prototype.Pk;olympe.dm.File.prototype.getContentAsString=olympe.dm.File.prototype.Zm;olympe.dm.File.prototype.getContentAsBinary=olympe.dm.File.prototype.Ok;olympe.dm.File.P=olympe.dc.Ca.C('ff021000000000000030',olympe.dm.File,olympe.dc.O.vi,olympe.la.O.xa,olympe.W.O.xh);olympe.dm.File.nameProp=olympe.dm.File.P.Da('ff023000000000000050');
729
- z('olympe.dm.File.nameProp',olympe.dm.File.nameProp);olympe.dm.File.creationDateProp=olympe.dm.File.P.Da('ff023000000000000051');z('olympe.dm.File.creationDateProp',olympe.dm.File.creationDateProp);olympe.dm.File.modificationDateProp=olympe.dm.File.P.Da('ff023000000000000055');z('olympe.dm.File.modificationDateProp',olympe.dm.File.modificationDateProp);olympe.dm.File.mimeTypeProp=olympe.dm.File.P.Da('ff023000000000000052');z('olympe.dm.File.mimeTypeProp',olympe.dm.File.mimeTypeProp);
730
- olympe.dm.File.urlProp=olympe.dm.File.P.Da('ff023000000000000053');z('olympe.dm.File.urlProp',olympe.dm.File.urlProp);olympe.dm.File.C=olympe.dm.File.P.Da('ff023000000000000054');olympe.dm.File.ma=[olympe.D.File];m=olympe.dm.File.prototype;m.en.K=olympe.D.J.F;m.Ok.K=new olympe.D.J(()=>{},[]);m.Zm.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.xp.K=olympe.D.J.F;m.ow.K=new olympe.D.J(()=>olympe.D.kb,[]);
731
- m.Jw.K=new olympe.D.J(()=>olympe.D.kb,[]);m.Wr.K=olympe.D.J.R;olympe.dm.Id=class extends olympe.dc.CloudObject{C(){return this.Fb(olympe.dm.Id.F)}G(){return this.He(olympe.dm.Id.L)}F(){return this.tb(olympe.dm.Id.C,olympe.dm.Module)}};olympe.dm.Id.P=olympe.dc.Ca.C('ff021000000000000041',olympe.dm.Id);olympe.dm.Id.F=olympe.dm.Id.P.Da('ff023000000000000047');olympe.dm.Id.L=olympe.dm.Id.P.Da('ff023000000000000048');olympe.dm.Id.C=olympe.dm.Module.C.Sc();olympe.dm.Id.prototype.C.K=olympe.D.J.F;olympe.dm.Id.prototype.G.K=olympe.D.J.G;
732
- olympe.dm.Id.prototype.F.K=new olympe.D.J(()=>olympe.dc.Ba,[]);olympe.dm.Ob=class extends olympe.dm.od{F(){return this.tb(olympe.dm.Rb.F,olympe.dm.Rb)}L(){return this.Fb(olympe.dm.Ob.qa)}ea(){return this.Fb(olympe.dm.Ob.lc)}G(){return this.tb(olympe.dm.Ob.L,olympe.dm.Ob)}};olympe.dm.Ob.P=olympe.dc.Ca.C('0163d9594700fcf61e54',olympe.dm.Ob);olympe.dm.Ob.qa=olympe.dm.Ob.P.Da('017869c7d2833c9492c1');olympe.dm.Ob.lc=olympe.dm.Ob.P.Da('017869c80bb9929c76d0');olympe.dm.Ob.L=olympe.dm.Ob.P.Ra('ff02200000000000002b');olympe.dm.Ob.Pf=P(olympe.dm.Ob.P,olympe.dm.Ob.L);
733
- olympe.dm.Ob.cc=olympe.dm.Ob.P.Ra('ff02200000000000002a');olympe.dm.Ob.Ge=olympe.dm.Ob.P.Ra('017e9c412e2b944bd590');olympe.dm.Ob.th=olympe.dm.Ob.P.Ra('017e9c416872a89d3415');olympe.dm.Ob.Wf=olympe.dm.Ob.P.Ra('017ebf8fe5c506662098');P(olympe.dc.CloudObject.P,olympe.dm.Ob.cc);olympe.dm.Ob.td=Fc('100000000000000000dd','PRIMORDIAL');olympe.dm.Ob.prototype.F.K=new olympe.D.J(()=>olympe.dc.Ba,[]);olympe.dm.Ob.prototype.L.K=olympe.D.J.F;olympe.dm.Ob.prototype.ea.K=olympe.D.J.F;
734
- olympe.dm.Ob.prototype.G.K=new olympe.D.J(()=>olympe.dc.Ba,[]);olympe.dm.Property=class extends olympe.dc.CloudObject{F(){return this.ed(olympe.dm.Property.definingModelRel,olympe.dc.CloudObject)}C(){return this.ed(olympe.dm.Property.typeRel,olympe.dc.CloudObject)}kd(){return this.F().na().Dr(this.na())}};olympe.dm.Property.P=olympe.dc.Ca.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.Xa.EMPTY}jw(){return this.He(olympe.dm.Relation.Jm)}Qw(){return this.He(olympe.dm.Relation.wn)}Lr(){return this.tb(olympe.dm.Relation.destinationModelRel,olympe.dc.CloudObject).Rc()}Rr(){return this.tb(olympe.dm.Relation.originModelRel,olympe.dc.CloudObject).Rc()}kd(){return this.Rr().na().concat(['-',this.na(),'->',this.Lr().na()])}};olympe.dm.Relation.P=olympe.dc.Ca.C('ff021000000000000006',olympe.dm.Relation);
736
- olympe.dm.Relation.wn=olympe.dm.Relation.P.Da('ff023000000000000030');olympe.dm.Relation.Jm=olympe.dm.Relation.P.Da('ff023000000000000034');olympe.dm.Relation.Tm=olympe.dm.Relation.P.Da('ff023000000000000037');olympe.dm.Relation.Sm=olympe.dm.Relation.P.Da('ff023000000000000137');olympe.dm.Relation.fl=olympe.dm.Relation.P.Da('ff023000000000000237');olympe.dm.Relation.ps=olympe.dm.Relation.P.Da('ff023000000000000337');olympe.dm.Relation.Av=olympe.dm.Relation.P.Da('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.Y);z('olympe.dm.Relation.destinationModelRel',olympe.dm.Relation.destinationModelRel);olympe.dc.Ub={NONE:null,dz:olympe.dm.Relation.Tm.T(),Hc:olympe.dm.Relation.Sm.T(),rf:olympe.dm.Relation.fl.T(),EA:olympe.dm.Relation.ps.T()};
738
- olympe.dc.Ub.toString=function(a){for(const [b,c]of Object.entries(olympe.dc.Ub))if(c===a)return b;return null};olympe.dm.Relation.C={kp:0,ql:5,xq:1,Ju:4,yk:2,mk:8,Do:10,Fu:6,Gu:9,rc:6,Iu:9};olympe.dm.Relation.F={mu:3,am:4,eu:5,Wl:6};olympe.dm.Relation.L=olympe.dm.Uc.bq+olympe.dm.Uc.wo;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.Lr.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.Rr.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.dm.qf=class extends olympe.dc.CloudObject{getValue(){}};olympe.dm.qf.P=olympe.dc.Ca.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.Ca.C('ff021000000000000011',olympe.dm.String);olympe.dm.String.valueProp=olympe.dm.String.P.Da('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.nh(olympe.dm.Boolean.valueProp)}};olympe.dm.Boolean.P=olympe.dc.Ca.C('ff021000000000000012',olympe.dm.Boolean);olympe.dm.Boolean.valueProp=olympe.dm.Boolean.P.Da('ff023000000000000027');z('olympe.dm.Boolean.valueProp',olympe.dm.Boolean.valueProp);olympe.dm.Boolean.prototype.getValue.K=olympe.D.J.R;olympe.dm.Color=class extends olympe.dm.qf{getValue(){return this.Sr()}};olympe.dm.Color.P=olympe.dc.Ca.C('ff021000000000000017',olympe.dm.Color);olympe.dm.Color.valueProp=olympe.dm.Color.P.Da('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.gj(olympe.dm.DateTime.valueProp)}};olympe.dm.DateTime.P=olympe.dc.Ca.C('ff021000000000000014',olympe.dm.DateTime);olympe.dm.DateTime.valueProp=olympe.dm.DateTime.P.Da('ff023000000000000029');z('olympe.dm.DateTime.valueProp',olympe.dm.DateTime.valueProp);olympe.dm.DateTime.prototype.getValue.K=new olympe.D.J(()=>olympe.D.kb,[]);olympe.dm.Enum=class extends olympe.dm.String{na(){return olympe.D.Ga([super.na(),super.getValue()],(a,b)=>''!==a.valueOf()?a:b,olympe.D.Xa)}he(){return this.He(olympe.dm.Enum.rankProp)}static create(a,b,c,d,e){const f=olympe.dc.Pa();e=void 0!==e?e:f.Gb(b)&&f.ge(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.Ca.C('016cdd861b32d56c81f7',olympe.dm.Enum);olympe.dm.Enum.rankProp=olympe.dm.Enum.P.Da('017a7690c915975ea995');olympe.dm.Enum.prototype.he.K=olympe.D.J.G;olympe.dm.gg=class extends olympe.dm.BrickMetadata{hx(){return this.tb(olympe.dc.CloudObject.instancesRel,olympe.dm.Enum)}static create(a,b){b=a.create(olympe.dm.gg,(new Map).set(olympe.dc.CloudObject.nameProp,b));a.Oa(olympe.dc.CloudObject.extendRel,b,olympe.dm.Enum);return b}};olympe.dm.gg.create=olympe.dm.gg.create;olympe.dm.gg.prototype.getValues=olympe.dm.gg.prototype.hx;olympe.dm.gg.P=olympe.dc.Ca.C('017a768f966fc08ebb98',olympe.dm.gg);olympe.dm.Number=class extends olympe.dm.qf{getValue(){return this.He(olympe.dm.Number.valueProp)}};olympe.dm.Number.P=olympe.dc.Ca.C('ff021000000000000013',olympe.dm.Number);olympe.dm.Number.valueProp=olympe.dm.Number.P.Da('ff023000000000000028');z('olympe.dm.Number.valueProp',olympe.dm.Number.valueProp);olympe.dm.Number.prototype.getValue.K=olympe.D.J.G;olympe.ab={};olympe.ab.$g=class{constructor(a){this.N=a;this.Y=new olympe.D.Zb(`${this.Z()} source context`);this.R=this.C=null}Z(){}L(){}close(){this.R&&this.R(this.Z(),olympe.dc.tk.yt);this.Y.destroy()}};function eh(a){olympe.D.yc([lc(a.qa)],b=>{if(b.valueOf()){const c=a.G.keys();fh(a,d=>{if(d)a.N.error('An error occurred while auto synchronising:\n'+d.message);else if(a.N.debug('Auto synchronise transactions successfully'),a.ea)for(const e of c)bc(a.F,f=>{a.N.error(`Could not clear transactions for ${e}: ${f}.`)})})}})}
740
- function gh(a){let b;olympe.D.yc([lc(a.qa)],c=>{c.valueOf()?(a.ea=!1,b&&(Lb(b),b=null)):(a.ea=!0,b=Kb(()=>{if(a.ka){a.ka=!1;for(const d of a.G.keys())$b(a.F,d,a.G.get(d),()=>{},e=>{a.N.error(`Could persist transaction for ${d}: ${e}`)})}},5E3))})}
741
- function fh(a,b){const c=olympe.async.sk.create(),d=c.G;c.add((e,f)=>{a.F.storage.L(f)});c.add((e,f,g)=>{const h=olympe.dc.Ka.rb,k=g.get('files'),l=new olympe.async.ng(d);a.G.forEach((n,p)=>{if(p!==h){const q=a.Fa.Y(p);null!==q?(l.add(a.Ta.bind(a,n,q,k)),a.F.storage.C(void 0)):f(`The source: ${p} is not reachable.`)}});Xb(l,(n,p)=>{n?e():f(p||void 0)});l.start()});Xb(c,(e,f)=>{b(e?null:Error(f));e&&(a.ka=!1,a.G.clear())});c.start()}
742
- function hh(a,b){const c=new olympe.async.sk(olympe.D.Ia());c.add((d,e)=>{ac(a.F,f=>null===f?d():e(f))});c.add(d=>{const e=olympe.dc.Dd();a.G.forEach((f,g)=>{const h=Array.from(f.ge()).map(k=>k.tag());Kc(e,olympe.D.Ia(),f,h,[],g)(!0)});d()});Xb(c,(d,e)=>{b(e?Error(e):null)});c.start()}
743
- olympe.ab.Ei=class extends olympe.ab.$g{constructor(a,b,c,d,e){super(a);this.G=new Map;this.qa=c;this.F=d;this.Fa=b;this.ka=this.ea=!1;e.get('syncTimeout');e.get('autoSync')&&eh(this);e.get('autoPersist')&&gh(this)}Ta(a,b,c,d,e){const f=olympe.dc.ga.ja.xk,g=olympe.dc.ga.ja.yl,h=new olympe.dc.db.zc,k=new olympe.async.ng(olympe.D.Ia()),l=(n,p,q)=>{const r=n.tag(),t=n.gb(olympe.dm.File.mimeTypeProp.T());dc(this.F,u=>{tc(olympe.dc.zw(),r,u,t,v=>{n.Da(olympe.dm.File.urlProp.T(),v);const w=new Map;w.set(olympe.dm.File.urlProp.T(),
744
- v);h.qc(r,w);this.F.storage.C(q)})})};for(const n of c)(c=a.If(n))&&c.te()&&k.add(l.bind(this,c));Xb(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.ge()).map(r=>r.tag()),olympe.dc.Dd().persist(q),d())}),b.L(n)):e(`Transaction synchronisation failed! ${p?p:''}`)});k.start()}Z(){return olympe.dc.Ka.rb}L(a){var b=olympe.dc.ga.ja.bh,c=olympe.dc.ga.ja.Og;const d=olympe.dc.ga.ja.xi,e=olympe.dc.ga.ja.wi,f=olympe.dc.ga.ja.Rg,g=olympe.dc.ga.ja.Hl,h=olympe.dc.ga.ja.Sh,
745
- k=olympe.dc.ga.ja.ti,l=olympe.dc.ga.ja.Ah;var n=olympe.dc.ga.ja.Pj;const p=a.type;switch(p){case f:a.validate(null);this.F.storage.F(void 0);hh(this,v=>{null!==v&&this.N.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.zc,this.G.set(v,w));q.$c(w);this.ea&&(this.ka=!0)});a.validate(null);a=olympe.dc.transaction.rg.C.Sp;this.C(olympe.dc.Ka.rb,n,{id:q.Z(),finalize:a});break;case e:case d:const r=
746
- a.C[0],t=a.content;a.validate(null);Zb(this.F,t.Z(),v=>{this.N.warn('No graphresult for subscription : '+t.Z(),v,'\n',t.ph.toJSON());this.N.warn();this.C(r,g,new olympe.dc.query.zi(t.Z(),r,olympe.dc.Ka.rb,new olympe.dc.db.zc))});break;case h:case l:case k:n=a.content;b=n.file;const u=n.Ze;c=n.ue;p===h?cc(this.F,b,n.content,n.mimeType,u,c):p===l?dc(this.F,v=>{u(v)}):this.F.storage.C(c);a.validate(null)}}};olympe.ab.Ei.C='context';const ih=olympe.dc.ga.ja.mm,jh=olympe.dc.ga.ja.om,kh=olympe.dc.ga.ja.QUERY_RESULT,lh=olympe.dc.ga.ja.nm,mh=olympe.dc.ga.ja.bh,nh=olympe.dc.ga.ja.xk,oh=olympe.dc.ga.ja.Pj,ph=olympe.dc.ga.ja.Og,qh=olympe.dc.ga.ja.Fj,rh=olympe.dc.ga.ja.Un,sh=olympe.dc.ga.ja.Sh,th=olympe.dc.ga.ja.Ah,uh=olympe.dc.ga.ja.ti,vh=olympe.dc.ga.ja.nf;
747
- function wh(a,b,c,d,e){const f=c.Z();c={t:ih,q:c.ia()};olympe.H.ya.pb.Bb.get(b,c).then(g=>{g.t===kh?(d(null),a.C(b,e||kh,{i:f,r:g.r,s:b})):d(Error(g.e))}).catch(g=>d(Error(g)))}function xh(a,b,c,d,e){const f=c.Z();wh(a,b,c,g=>{if(g)e(g);else{yh(a,b,f);g={t:jh,q:c.ia()};var h=olympe.H.ya.pb.Bb.observe(b,d,g).subscribe(k=>{const l=k.t;l===lh?(e(null),a.C(b,l,{i:f,r:k.r,s:b})):e(Error(k.e))});d.xc(()=>h.unsubscribe())}},lh)}
748
- function zh(a,b,c,d){const e=c.Gc;c=new olympe.dc.transaction.Md;e.$c(c);c={t:mh,i:e.Z(),p:be(c)};olympe.H.ya.pb.Bb.send(b,c).then(()=>{d(null);a.C(b,oh,{id:e.Z(),finalize:olympe.dc.transaction.rg.C.Rp})}).catch(f=>d(Error(f)))}function Ah(a,b,c,d,e){var f=c.Gc;c=f.Z();const g=new olympe.dc.transaction.Md;f.$c(g);f={t:ph,i:c,p:be(g)};olympe.H.ya.pb.Bb.publish(b,f).then(()=>e(null)).catch(h=>e(Error(h)));Bh(a,c,b,d)}
749
- function yh(a,b,c){const d=()=>{const f=setInterval(()=>{0===a.F.size?clearInterval(f):a.F.forEach((g,h)=>{olympe.H.ya.pb.Bb.send(h,{t:vh,s:Array.from(g)}).catch(k=>a.N.warn(`Error occurred while keeping alive subscription list: ${k}`))})},a.ea)},e=a.F.get(b)||new Set;e.add(c);a.F.set(b,e);1===a.F.size&&d()}
750
- function Bh(a,b,c,d){const e=new olympe.H.ya.pb.Bb(b,d);e.listen().subscribe(f=>{f=f.body();if(f.t===qh){a.N.error(`Burst Transaction ${b} failed. Local rollback is not supported yet. Refresh the application`);const g=new olympe.dc.db.zc;a.C(c,qh,{id:b,rollback:g,error:f.r})}});d.xc(()=>e.stop())}
751
- olympe.ab.xu=class extends olympe.ab.$g{constructor(a,b,c){super(a);this.F=new Map;this.G=b;this.ea=c}Z(){return olympe.dc.Ka.hq}L(a){const b=a.C[0],c=a.type,d=a.validate.bind(a),e=a.content;a=a.F;switch(c){case ih:wh(this,b,e,d);break;case jh:xh(this,b,e,a,d);break;case mh:case nh:zh(this,b,e,d);break;case ph:Ah(this,b,e,a,d);break;case rh:e.t=c;olympe.H.ya.pb.Bb.publish(b,e).then(d).catch(f=>d(Error(f)));break;case sh:case th:case uh:olympe.H.ya.pb.Bb.get(b,{t:c,f:e.file}).then(f=>{this.G.ka(e.file,
752
- b,f);c===sh?this.G.Y(e.file,e.content,e.mimeType,e.Ze,e.ue):c===th?this.G.R(e.file,e.url,e.mimeType,e.Ze,e.ue):this.G.L(e.file,e.Ze,e.ue)}).catch(e.ue);break;default:this.N.info(`Messages of type ${c} is not supported by the source ${this.Z()}`)}}};olympe.ab.Buffer=class{constructor(){this.counter=0;this.Kb=new Map}buffer(a){const b=this.counter++;this.Kb.set(b,a);return this.clear.bind(this,b)}clear(a){this.Kb.delete(a)}};olympe.ab.pg=class a{constructor(b,c,d){this.N=b;this.ea=c;this.R=new olympe.ab.Buffer(this);this.L=new Map;this.G=this.Pb(d);new olympe.D.Zb('Data Router context');this.F=new Map;this.ka=new Map;this.cb()}cb(){this.N.info('Initializing DR layer');olympe.D.Tk(lc(this.ea),()=>{this.N.info('Router: ONLINE')},()=>{this.N.log('Router: OFFLINE (no auth layer not online)');for(const b of this.R.Kb.values())this.Fa(b)});this.N.log('DONE initializing DR layer (waiting for AUTH layer session to be established)')}send(b){M(b,
753
- this.R.buffer(b));this.Fa(b)}C(b,c){const d=olympe.W.fc();let e=this.F.get(b);void 0===e&&(e=new Map,this.F.set(b,e));e.set(d,c)}qa(b){this.ka.set(olympe.W.xg(),b)}Ab(b,c,d){this.F.has(c)&&this.F.get(c).forEach(e=>{e(b,d)})}Tb(b,c){this.L.set(b,c);c.C=this.Ab.bind(this);c.R=this.Ta.bind(this)}Y(b){return this.L.get(b)||this.L.get(olympe.dc.Ka.hq)}Ta(b,c){this.ka.forEach(d=>{d(b,c)})}Fa(b){this.N.debug('Processing message',b.toString());this.$a(b).forEach(c=>{(c=this.Y(c))&&c.L(b)})}$a(b){var c=olympe.dc.ga.ja.Rg,
754
- d=olympe.dc.ga.ja.wi,e=olympe.dc.ga.ja.xi,f=olympe.dc.ga.ja.bh,g=olympe.dc.ga.ja.Og;const h=olympe.dc.ga.ja.Sh,k=olympe.dc.ga.ja.ti,l=olympe.dc.ga.ja.Ah;switch(b.type){case c:d=this.G.get(a.C.Rg)||[];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.gt)||[];break;default:d=[]}c=b.content;e=olympe.auth.ta.C.Lg;f=olympe.auth.ta.C.Dh;g=kc(this.ea);e=!(g===e||g===f);for(var n of d)if(d=n,f=c&&c.Z&&c.Z(),g=d.get('type'),
755
- g===a.F.$l&&e||g===a.F.ip&&d.get('id')===f||g===a.F.rc)return n=n.get('destinations'),this.N.debug('Message',b.toString(),'is redirect to',n),n;this.N.debug('Message',b.toString(),'not redirect');return b.C}Pb(b){const c=Object.values(olympe.ab.pg.C),d=Object.values(olympe.ab.pg.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.ip&&n.set('id',k.id)):this.N.error('Routing rule',f,l,'is not valid. Destinations must be stored in an array')}else this.N.error('Routing rule',f,l,'is not valid. Valid rules are',d.toString())})}else this.N.error('Routing rule',f,'is not valid. Rules must be ordered in an array');else this.N.error('Routing rule',f,'is not valid. Valid messages are',c.toString())});return e}};olympe.ab.pg.C={Rg:'getContext',lm:'query',TRANSACTION:'transaction',gt:'file'};
757
- olympe.ab.pg.F={rc:'default',$l:'offline',ip:'id'};olympe.ab.pg.ma=[olympe.dc.pg];olympe.ab.Qj=class{ka(){}Y(){}R(){}L(){}};olympe.ab.O={xa:'dr.Manager',Ea:'dr.Logger',oe:'dr.sources.Router',Dp:'dr.sources.Local',tm:'dr.sources.Server',jq:'dr.sources.Peer',Qg:'dr.sources.FileSource'};olympe.ab.Config={Vl:'dr.keepAliveTimeout',Mn:'dr.autoSync',Ln:'dr.autoPersist',Rq:'dr.syncTimeout',Dq:'dr.routing'};
758
- olympe.U.config(function(a){E(a,olympe.ab.Config.Dq,{});E(a,olympe.ab.Config.Vl,3E5);E(a,olympe.ab.Config.Mn,!1);E(a,olympe.ab.Config.Ln,!1);E(a,olympe.ab.Config.Rq,3E4);C(a,olympe.ab.O.Ea,[olympe.sa.O.xa],b=>b.Qc('dr'));C(a,olympe.ab.O.Dp,[olympe.ab.O.Ea,olympe.ab.O.oe,olympe.auth.O.xa,olympe.ic.O.qo,new olympe.U.fa(olympe.ab.Config.Mn),new olympe.U.fa(olympe.ab.Config.Ln),new olympe.U.fa(olympe.ab.Config.Rq)],(b,c,d,e,f,g,h)=>{f=(new Map).set('autoSync',f).set('autoPersist',g).set('syncTimeout',
759
- h);return new olympe.ab.Ei(b,c,d,e,f)});ta(a,olympe.ab.O.tm);B(a,olympe.ab.O.jq,olympe.ab.xu,olympe.ab.O.Ea,olympe.ab.O.Qg,new olympe.U.fa(olympe.ab.Config.Vl));ta(a,olympe.ab.O.Qg);B(a,olympe.ab.O.oe,olympe.ab.pg,olympe.ab.O.Ea,olympe.auth.O.xa,new olympe.U.fa(olympe.ab.Config.Dq));sa(a,olympe.dc.O.oe,olympe.ab.O.oe);C(a,olympe.dc.query.Nb.ak,[olympe.dc.query.Nb.ak],b=>new olympe.dc.km(b))},'olympe.dr');
760
- olympe.U.run([olympe.ab.O.oe,olympe.ab.O.Dp,olympe.ab.O.tm,olympe.ab.O.jq],(a,...b)=>{b.forEach(c=>a.Tb(c.Z(),c))});olympe.H={};olympe.H.Jc={zh:1,dg:2,tc:3,pf:4,Ls:5,Ai:6,rA:7};olympe.H.ja={Ai:1,fv:2,ft:3,nf:5};olympe.H.ta=class{qa(){}connect(){}disconnect(){}th(){}uh(){}$k(){}G(){}td(){}Lc(){}Fa(){}Of(){}gs(){}ls(){}};olympe.H.ta.C={INIT:'initialize',CONNECTING:'connecting',gf:'disconnected',yh:'connected',pm:'reconnecting',tc:'error'};olympe.H.ta.G={Kh:1,mt:-1,zt:-2,Yu:-3};function Ch(a,b){const c=a.G.get(b)||a.Ta;a.G.delete(b);return`${c}/${b}`}
761
- olympe.H.Qj=class{constructor(a,b,c,d,e){this.N=a;this.F=b;this.qa=c;this.Ta=d;this.cb=e;this.C=new Map;this.G=new Map;this.ea=new Map;this.Fa=new olympe.D.Zb('File manager context')}ka(a,b,c){b&&this.G.set(a,`${this.cb}/${b}`);c&&this.ea.set(a,c)}Y(a,b,c,d,e){const f=Pb(Ch(this,a),olympe.la.fb.ce.ik,b,olympe.la.fb.ResponseType.pl);Qb(f,{[olympe.la.fb.Headers.pi]:this.hd(a),[olympe.la.fb.Headers.Hj]:c||'application/octet-stream'});this.F.C(f,g=>{g=g.Td();g===olympe.la.fb.qd.Kh||g===olympe.la.fb.qd.vl?
762
- (g=new URL(f.C()),d(g.pathname)):e&&(g=`Failed to create file ${a}. Response code ${g}`,this.N.error(g),e(g))})}R(a,b,c,d,e){const f=olympe.D.Ia();d={Ze:f.C(d),ue:e&&f.C(e)};if(this.C.has(a))this.C.get(a).push(d);else{this.C.set(a,[d]);if(null===b){var g=Pb(Ch(this,a));Qb(g,{[olympe.la.fb.Headers.pi]:this.hd(a)})}else g=Pb(b);g.F=olympe.la.fb.ResponseType.pl;Qb(g,{[olympe.la.fb.Headers.Hj]:c||'application/octet-stream'});this.Fa.run(()=>{this.F.C(g,h=>{const k=h.Td(),l=this.C.get(a);if(200<=k&&300>
763
- k){const n=h.getData();l&&l.forEach(p=>{if(f.zb()){const q=f.Tb(),r=f.Z();this.N.warn(`Context ${q} ${r} is being destroyed while file tag ${a} is being downloaded`)}p.Ze(n)})}else{const n=`Failed to download file ${a}. Response code ${k}`;l&&l.forEach(p=>{p.ue&&p.ue(n)})}this.C.delete(a)})})}}L(a,b,c){const d=Pb(Ch(this,a),olympe.la.fb.ce.Hc);Qb(d,{[olympe.la.fb.Headers.pi]:this.hd(a)});this.F.C(d,e=>{e=e.Td();200<=e&&300>e?b():(e=`Failed to delete file ${a}. Response code ${e}`,this.N.error(e),
764
- c&&c(e))})}hd(a){const b=this.ea.get(a);b&&this.ea.delete(a);return b||olympe.D.Za(nc(this.qa))}};olympe.H.Qj.ma=[olympe.ab.Qj];const Dh=olympe.dc.ga.ja.Rg,Eh=olympe.dc.ga.ja.bh,Fh=olympe.dc.ga.ja.xk,Gh=olympe.dc.ga.ja.Og,Hh=olympe.dc.ga.ja.wi,Ih=olympe.dc.ga.ja.xi,Jh=olympe.dc.ga.ja.Vo,Kh=olympe.dc.ga.ja.Wo,Lh=olympe.dc.ga.ja.Hl,Mh=olympe.dc.ga.ja.ti,Nh=olympe.dc.ga.ja.Ah,Oh=olympe.dc.ga.ja.Sh,Ph=olympe.dc.ga.ja.Pj,Qh=olympe.dc.ga.ja.ev,Rh=olympe.dc.ga.ja.Eu,Sh=olympe.dc.ga.ja.nt,Th=olympe.dc.ga.ja.Un,Uh=olympe.dc.ga.ja.Is;
765
- function Vh(a){a.F.Fa(olympe.H.Jc.zh,a.cb.bind(a));olympe.D.yc([lc(a.qa)],b=>{b=b.valueOf()?olympe.dc.tk.Yp:olympe.dc.tk.$l;a.R&&a.R(a.Z(),b)},'Server source is online')}function Wh(a,b,c){const d=b.Gc;b=new olympe.dc.transaction.Md(!0);d.$c(b);Xh(a,a.Ab,Eh,!0,be(b),e=>{c&&c(e);a.C(a.Z(),Ph,{id:d.Z(),finalize:olympe.dc.transaction.rg.C.Rp})})}
766
- function Yh(a,b,c,d){const e=c.Z();a.N.log('Graphdef (ID ',e,') sent: ',c);const f=c instanceof olympe.dc.query.Ol?a.$a:a.Fa,g=(new olympe.H.$.Sj).ia(c);c=new olympe.async.ng(a.Y);b===Ih&&c.add((k,l)=>{a.G.set(e,{notification:null,Ux:a.Y.C(n=>n?l(n):k())});Zh(a,b,g,n=>n&&l(n.message))});const h=olympe.D.Ia();c.add((k,l)=>{h.run(()=>{Xh(a,f,Hh,!1,g,a.Y.C(n=>n?l(n.message):k()))})});Xb(c,(k,l)=>{const n=a.G.get(e);k&&n&&n.notification?a.C(a.Z(),Kh,n.notification):!k&&n&&$h(a,Jh,e,p=>p&&a.N.warn(p));
767
- a.G.delete(e);k&&b===Ih&&a.F.gs(e);d(l?Error(l):null)});c.start()}function $h(a,b,c,d){a.N.log('Unsubscribe to: ',c);a.F.ls(c);Zh(a,b,{i:c},d)}function Zh(a,b,c,d){b={c:b};Object.assign(b,c);a.F.G(olympe.H.Jc.zh,b,d&&(e=>{d(e)}))}function Xh(a,b,c,d,e,f){if(a.F.qa()){const g=olympe.H.Jc.zh;!d&&e&&Object.assign(e,{c});c=olympe.D.Za(nc(a.qa)).valueOf();a.F.td(b,g,c,d,e,f)}else a.N.error('Server is disconnected, data request of type',c,'on url',b,'is canceled.'),f(Error('Server is disconnected'))}
768
- olympe.H.$g=class extends olympe.ab.$g{constructor(a,b,c,d,e){super(a);this.F=b;this.qa=c;new olympe.H.$.hb;this.ea=new olympe.dc.W.Hi(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.Ta=e[0];this.$a=e[1];this.Fa=e[2];this.Ab=e[3];this.G=new Map;Vh(this)}Z(){return olympe.dc.Ka.Xc}L(a){var b=a.type;const c=a.validate.bind(a);a=a.content;switch(b){case Dh:Xh(this,
769
- this.Ta,olympe.dc.ga.ja.Rg,!1,null,c);break;case Gh:b=new olympe.dc.transaction.Md;var d=a.Gc;a=a.rh;d.$c(b);Zh(this,olympe.dc.ga.ja.Og,{i:d.Z(),r:a,p:be(b)});c(null);break;case Eh:b=new olympe.dc.transaction.Md;d=a.Gc;a=a.rh;d.$c(b);Zh(this,olympe.dc.ga.ja.bh,{i:d.Z(),r:a,p:be(b)},c);break;case Fh:Wh(this,a,c);break;case Hh:case Ih:Yh(this,b,a,c);break;case Jh:$h(this,b,a,c);break;case Qh:Zh(this,Qh,{},c);break;case Rh:Zh(this,Rh,{},c);break;case Sh:Zh(this,Sh,{},c);break;case Th:Zh(this,Th,a,c);
770
- break;case Uh:Zh(this,Uh,{},c);break;case Nh:this.ka.R(a.file,a.url,a.mimeType,a.Ze,a.ue);break;case Mh:this.ka.L(a.file,a.Ze,a.ue);break;case Oh:this.ka.Y(a.file,a.content,a.mimeType,a.Ze,a.ue);break;default:this.N.info(`Message of type ${b} not supported yet`)}}cb(a){var b=olympe.dc.ga.ja.yl,c=olympe.dc.ga.ja.Fj;const d=olympe.dc.ga.ja.ek,e=olympe.dc.ga.ja.Qu,f=olympe.dc.ga.ja.Ap;var g=olympe.dc.ga.ja.ot;const h=a.c;h===b?(a=this.ea.C(a.p),this.C(this.Z(),b,a)):h===c?(g=a.error.reason,b=this.ea.C(a.p),
771
- this.C(this.Z(),c,{id:a.i,rollback:b,error:g})):h===Lh?(g=olympe.dc.Ka.rb,c=olympe.dc.Ka.Xc,b=a.i,0<a.s?g=new olympe.dc.query.Xi.Uj(b,c,g,a.info.error.reason):(g=this.ea.R(b,g,a.p),this.N.debug('< Graphdef Result (ID ',g.Z(),'):',a.p),this.N.log('< Graphdef Result (ID ',g.Z(),') with',g.Gc.G(),'operations')),this.C(this.Z(),Lh,g)):h===Kh?(g=a.i,a=this.ea.L(g,a.p),this.G.has(g)?(g=this.G.get(g),g.notification?jf(a,g.notification):g.notification=a):this.C(this.Z(),Kh,a)):h===f?(g=new olympe.dc.query.Hp(a.i),
772
- a.l.forEach(g.F.bind(g)),this.C(this.Z(),f,g)):h===d?(g=olympe.dc.transaction.rg.C.ek,c=0<a.s?a.info.error.reason:null,this.C(this.Z(),Ph,{id:a.i,finalize:g,error:c})):h===e?(g=this.G.get(a.i))&&g.Ux(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,{OC:c,hD:b,cD:a}))}};olympe.H.$g.F={Xz:1,YA:2};olympe.H.$g.C={100:'Insufficient Rights',200:'Constraints',300:'IOException',400:'Unexpected',500:'Non Existing Subscription'};olympe.H.Wj=class{constructor(){}};olympe.H.Wj.ma=[olympe.dc.aa.Wj];olympe.H.ya={};function ai(a,b,c){Ub(a.C,b,d=>{d=new olympe.H.ya.Kb.Request(d.dest,d.src,d.auth,d.seq,d.type,d.content);return c(d)})}function bi(a,b,c){a.L.set(b,c)}function ci(a,b){return new Promise((c,d)=>{Vb(a.C,b,e=>e?d(e):c())})}function di(a,b){return new Promise((c,d)=>{a.R.oh(b.hd(),(e,f)=>e?d(e):c(f))})}
773
- olympe.H.ya.ta=class{constructor(a,b,c,d){this.N=a;this.R=c;a=new olympe.W.ar(d.get('messageTimeout'));a.C=this.Y.bind(this);this.L=a;a=d.get('url');d=d.get('connectionOptions');this.C=new olympe.la.dk(a,d);this.G=1;this.F=olympe.W.fc()}connect(){return new Promise(a=>{Tb(this.C)?a():this.C.connect(()=>{Ub(this.C,this.F,b=>{b=new olympe.H.ya.Kb.Response(b.dest,b.src,b.seq,b.type,b.content);const c=this.L.get(b.G);c&&(this.L.delete(b.G),c(b))});a()})})}disconnect(){return new Promise(a=>this.C.end(!1,
774
- ()=>a()))}Ke(a,b,c){return new Promise((d,e)=>{const f=a.source,g=new olympe.H.ya.Kb.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.Za(nc(this.R));g=new olympe.H.ya.Kb.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.ya.Kb.Response(b,a,f,olympe.H.ya.Kb.Response.ja.wm,c);this.C.publish(b,
775
- f.ia(),void 0,g=>g?e(g):d())})}Y(a,b){b(new olympe.H.ya.Kb.Response(this.F,this.F,a,olympe.H.ya.Kb.Response.ja.tc,{reason:'Timeout'}))}};olympe.H.ya.Kb={};olympe.H.ya.Kb.Request=class{constructor(a,b,c,d,e,f){this.G=d;this.destination=a;this.source=b;this.L=c;this.C=e;this.F=f||null}hd(){return this.L}ia(){return{dest:this.destination,src:this.source,seq:this.G,auth:this.L,type:this.C,content:this.F}}toString(){return JSON.stringify(this)}};olympe.H.ya.Kb.Request.ja={SEND:0,GET:1,PUBLISH:2,SUBSCRIBE:3};olympe.H.ya.Kb.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.ya.Kb.Response.ja={wm:0,Gn:1,Yq:2,tc:3};olympe.H.ya.pb={};const ei=olympe.H.ya.Kb.Response.ja.Gn,fi=olympe.H.ya.Kb.Response.ja.tc,gi=olympe.H.ya.Kb.Response.ja.wm,hi=olympe.H.ya.Kb.Response.ja.Yq,ii=olympe.H.ya.Kb.Request.ja.SEND,ji=olympe.H.ya.Kb.Request.ja.GET,ki=olympe.H.ya.Kb.Request.ja.PUBLISH,li=olympe.H.ya.Kb.Request.ja.SUBSCRIBE;
776
- olympe.H.ya.pb.Bb=class{constructor(a,b){this.C=olympe.H.ya.Tc();this.F=a;this.G=new olympe.D.Zb(`Service ${a}`,'function'===typeof b.Fc?b.Fc():b);this.N=olympe.sa.Ya(`Service ${this.F}`)}listen(){return new rxjs.Observable(a=>{const b=()=>{a.complete();ci(this.C,this.F).catch(c=>this.N.error('Failed to unsubscribe from '+this.F+', error: '+c))};this.G.onDestroy(b);this.C.connect().then(()=>{ai(this.C,this.F,c=>a.next(new olympe.H.ya.pb.ga(c,this.C)))}).catch(c=>this.N.error('Failed to connect to the bus: '+
777
- c));return b})}stop(){this.G.destroy()}static publish(a,b){const c=olympe.H.ya.Tc();return c.connect().then(()=>c.request(a,ki,b)).then(()=>Promise.resolve())}static send(a,b){return new Promise((c,d)=>{const e=olympe.H.ya.Tc();e.connect().then(()=>e.request(a,ii,b)).then(f=>{bi(e,f,g=>{switch(g.F){case ei:c();break;case fi: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.ya.Tc();e.connect().then(()=>
778
- e.request(a,ji,b)).then(f=>{bi(e,f,g=>{switch(g.F){case gi:(g=g.C)?c(g):d('No payload after request to service: '+a);break;case fi: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.Fc?b.Fc():b;return new rxjs.Observable(e=>{const f=olympe.H.ya.Tc();let g=null;const h=()=>{e.complete();g&&ci(f,g).catch(k=>olympe.sa.Ya('Service '+a).error('Failed to unsubscribe from a topic '+k))};d.xc(h);f.connect().then(()=>
779
- f.request(a,li,c)).then(k=>{bi(f,k,l=>{switch(l.F){case hi:g=l.C.topic;ai(f,g,n=>{switch(n.C){case ki:e.next(n.F);break;default:e.error('Unsupported notification message. It should be a publish'),h()}});break;case fi: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.ya.pb.Bb.observe=olympe.H.ya.pb.Bb.observe;olympe.H.ya.pb.Bb.get=olympe.H.ya.pb.Bb.get;olympe.H.ya.pb.Bb.send=olympe.H.ya.pb.Bb.send;
780
- olympe.H.ya.pb.Bb.publish=olympe.H.ya.pb.Bb.publish;olympe.H.ya.pb.Bb.prototype.stop=olympe.H.ya.pb.Bb.prototype.stop;olympe.H.ya.pb.Bb.prototype.listen=olympe.H.ya.pb.Bb.prototype.listen;const mi=olympe.H.ya.Kb.Response.ja.Gn,ni=olympe.H.ya.Kb.Response.ja.tc,oi=olympe.H.ya.Kb.Response.ja.wm,pi=olympe.H.ya.Kb.Response.ja.Yq,qi=olympe.H.ya.Kb.Request.ja.SEND,ri=olympe.H.ya.Kb.Request.ja.GET,si=olympe.H.ya.Kb.Request.ja.SUBSCRIBE;
781
- olympe.H.ya.pb.ga=class{constructor(a,b){this.request=a;this.C=b}yj(){return di(this.C,this.request)}source(){return this.request.source}body(){return this.request.F}Hk(){return this.request.C===qi?this.C.Ke(this.request,mi,void 0):Promise.reject('Should only call `ack` on SEND requests')}Ke(a){return this.request.C===ri?this.C.Ke(this.request,oi,a):Promise.reject('Should only call `reply` on GET requests')}$r(a){return this.request.C===si?this.C.Ke(this.request,pi,{topic:a}):Promise.reject('Should only call `notifyOn` on SUBSCRIBE requests')}wg(a){return this.C.Ke(this.request,
782
- ni,{reason:a.message})}};olympe.H.ya.pb.ga.prototype.fail=olympe.H.ya.pb.ga.prototype.wg;olympe.H.ya.pb.ga.prototype.notifyOn=olympe.H.ya.pb.ga.prototype.$r;olympe.H.ya.pb.ga.prototype.reply=olympe.H.ya.pb.ga.prototype.Ke;olympe.H.ya.pb.ga.prototype.ack=olympe.H.ya.pb.ga.prototype.Hk;olympe.H.ya.pb.ga.prototype.body=olympe.H.ya.pb.ga.prototype.body;olympe.H.ya.pb.ga.prototype.source=olympe.H.ya.pb.ga.prototype.source;olympe.H.ya.pb.ga.prototype.userTag=olympe.H.ya.pb.ga.prototype.yj;olympe.H.pa={};function ti(a,b,c,d){c.c=b;a.C.G(olympe.H.Jc.pf,c,d)}
783
- olympe.H.pa.Ua=class{constructor(a,b,c,d,e,f,g,h,k){this.N=a;this.C=b;this.F=h;this.$a=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())}R(a){this.C.th(a)}L(a){this.C.uh(a)}Y(a){this.C.$k(a)}cb(a){this.C.Of(olympe.H.Jc.pf,'logoutHandler');this.C.Fa(olympe.H.Jc.pf,b=>{const c=b.c;c===olympe.H.pa.Ua.C.Zt?(this.C.Lc(),a(olympe.auth.ta.F.zj,b)):c===olympe.H.pa.Ua.C.Ku&&a(olympe.auth.ta.F.jp,
784
- b)},'logoutHandler')}ea(a,b){ti(this,olympe.H.pa.Ua.C.pf,{token:a.Jf()},(c,d)=>{if(null!==c)b(c);else switch(d.c){case olympe.H.pa.Ua.C.tc:b(Error('Invalid token'));break;case olympe.H.pa.Ua.C.Oi: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.Fq(d,f,g,h),c.C=e):'openid'===k&&(c=new olympe.auth.fm(d,f,g,h))}b(null,c);break;default:b(Error('Unknown response from server'))}})}Fa(a,b){ti(this,olympe.H.pa.Ua.C.tt,
785
- {I:a.Ud()},(c,d)=>{if(null!==c)b(c);else switch(d.c){case olympe.H.pa.Ua.C.tc:b(Error(`Username '${a.Ud()}' invalid, or password does not match`));break;case olympe.H.pa.Ua.C.Su:c=d.payload;b(null,c.S,c.B);break;default:b(Error('Unknown response from server'))}})}Ta(a,b){ti(this,olympe.H.pa.Ua.C.xs,{A:a.get('a'),M:a.get('m1'),I:a.Ud()},(c,d)=>{if(null!==c)b(c);else switch(d.c){case olympe.H.pa.Ua.C.tc:this.N.debug('Login failed, invalid username or password');b(Error('Invalid username or password'));
786
- break;case olympe.H.pa.Ua.C.Oi:c=d.payload;this.N.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})`))}})}qa(a){ti(this,olympe.H.pa.Ua.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'))})}ka(a){const b=olympe.D.Za(olympe.auth.Tc().C.Eb())||null;if(b instanceof
787
- olympe.auth.fm){const c=e=>{const f=Object.create(null);f.url=e;f.olympe_token=b.Jf();f.access_token=b.Yj().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.G(olympe.H.Jc.pf,{c:olympe.H.pa.Ua.C.$t},a)}ii(a){this.C.G(olympe.H.Jc.pf,{c:olympe.H.pa.Ua.C.nf},a)}oh(a,b,c){this.C.td(this.$a+
788
- '/'+a,olympe.H.Jc.pf,b,!1,null,(d,e)=>{c(d,e)})}Qr(){return this.G}};olympe.H.pa.Ua.C={pf:1,$t:2,tc:3,nf:5,Oi:6,tt:10,Su:11,xs:12,Re:13,Ku:14,Zt:20};olympe.H.pa.Ua.ma=[olympe.auth.Uu,olympe.auth.Hb.pa.Fi,olympe.auth.Hb.pa.Ee,olympe.auth.Hb.pa.Re];olympe.H.$={};olympe.H.$.Zc=function(){};olympe.H.$.Zc.prototype.ia=function(){};olympe.H.$.Ne=function(){};olympe.H.$.Ne.prototype.ia=function(){};olympe.H.$.bb=function(){};olympe.H.$.bb.prototype.ia=function(){};olympe.H.$.wf=function(){};olympe.H.$.wf.prototype.ia=function(){};olympe.H.$.hb=function(){this.X={};this.Db={};this.V={};this.oa=Object.create(null);var a=new olympe.H.$.X.Sb;this.X[O(olympe.dc.X.Sb)]=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.Od)]=new olympe.H.$.X.Od;this.X[O(olympe.dc.X.uc)]=new olympe.H.$.X.uc;this.X[O(olympe.dc.X.be)]=new olympe.H.$.X.be;this.X[O(olympe.dc.X.Gd)]=new olympe.H.$.X.Gd;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.$.V.Ic;this.V[O(olympe.dc.V.Ic)]=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.Vc;this.V[O(olympe.dc.V.Vc)]=a;a=new olympe.H.$.V.zd;this.V[O(olympe.dc.V.zd)]=a;this.V[O(olympe.dc.V.md)]=new olympe.H.$.V.md;a=new olympe.H.$.V.jf;this.V[O(olympe.dc.V.jf)]=a;a=new olympe.H.$.V.kf;this.V[O(olympe.dc.V.kf)]=a;this.oa[O(olympe.dc.oa.bd)]=new olympe.H.$.oa.bd;a=new olympe.H.$.oa.me;this.oa[O(olympe.dc.oa.me)]=
790
- a;a=new olympe.H.$.oa.qe;this.oa[O(olympe.dc.oa.qe)]=a;a=new olympe.H.$.oa.ve;this.oa[O(olympe.dc.oa.ve)]=a;a=new olympe.H.$.oa.le;this.oa[O(olympe.dc.oa.le)]=a;this.oa[O(olympe.dc.oa.sf)]=new olympe.H.$.oa.sf};olympe.H.$.hb.prototype.constructor=olympe.H.$.hb;function ui(a,b,c){var d=b.na(),e=a.V[d];if(void 0===e)throw Error('No predicate registered for predicate: '+d);return e.ia(b,c,a)}
791
- function vi(a,b,c){var d=b.na(),e=a.oa[d];if(void 0===e)throw Error('No valueDef registered for valueDef: '+d);return e.ia(b,c,a)}
792
- function wi(a,b){return a&&a.xf?'"$'+b.add(a)+'"':a instanceof olympe.D.ra||a instanceof olympe.D.da?String(a):a instanceof olympe.D.Xa?'"'+a+'"':a instanceof olympe.D.kb?(a=a.rs(),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.Nf().valueOf()+',"g":'+a.Hf().valueOf()+',"b":'+a.Cf().valueOf()+',"a":'+a.Bf().valueOf()+
793
- '}':a instanceof olympe.dc.Ec?'{"c":8,"t":"'+a.T()+'"}':JSON.stringify(a)};olympe.H.$.Sj=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?We(a.ph):olympe.dc.Ub.NONE;b.q=nf(a).map(this.C.bind(this));return b}C(a){const b=a.Sd(),c=b.Qa()===olympe.dc.Aa.ORIGIN?olympe.H.$.X.Sb.C.Di:olympe.H.$.X.Sb.C.Li,d=Object.create(null);d.t=b.T();d.d=c;d.v=a.apply;d.r=b.recursive;d.q=a.kh().map(this.C.bind(this));return d}};olympe.H.$.X={};olympe.H.$.X.Gd=function(){};olympe.H.$.X.Gd.prototype.constructor=olympe.H.$.X.Gd;olympe.H.$.X.Gd.prototype.ia=function(){return'{"y":15}'};olympe.H.$.X.Gd.ma=[olympe.H.$.Zc];olympe.H.$.X.uc=function(){};olympe.H.$.X.uc.prototype.constructor=olympe.H.$.X.uc;olympe.H.$.X.uc.prototype.ia=function(a,b,c){return'{"y":21,"p":'+ui(c,a.C,b)+'}'};olympe.H.$.X.uc.ma=[olympe.H.$.Zc];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.Qa()?a.Qa()===olympe.dc.Aa.ORIGIN?olympe.H.$.X.Sb.C.Di:olympe.H.$.X.Sb.C.Li:olympe.H.$.X.Sb.C.Sn;return'{"y":12,"t":'+JSON.stringify(Zg(a))+',"d":'+b+'}'};olympe.H.$.X.Be.ma=[olympe.H.$.Zc];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.Qa()?a.Qa()===olympe.dc.Aa.ORIGIN?olympe.H.$.X.Sb.C.Di:olympe.H.$.X.Sb.C.Li:olympe.H.$.X.Sb.C.Sn;return'{"y":11,"t":"'+a.T()+'","d":'+b+',"s":'+a.F+',"e":'+a.C+'}'};olympe.H.$.X.Dc.ma=[olympe.H.$.Zc];olympe.H.$.X.Sb=function(){};olympe.H.$.X.Sb.C={Sn:0,Di:1,Li:2};olympe.H.$.X.Sb.prototype.constructor=olympe.H.$.X.Sb;olympe.H.$.X.Sb.prototype.ia=function(a){const b=a.Qa()===olympe.dc.Aa.ORIGIN?olympe.H.$.X.Sb.C.Di:olympe.H.$.X.Sb.C.Li;return'{"y":10,"t":"'+a.T()+'","d":'+b+'}'};olympe.H.$.X.Sb.ma=[olympe.H.$.Zc];olympe.H.$.X.Od=function(){};olympe.H.$.X.Od.prototype.constructor=olympe.H.$.X.Od;olympe.H.$.X.Od.prototype.ia=function(a,b,c){var d=a.Bd;const e=d.na();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.Od.ma=[olympe.H.$.Zc];olympe.H.$.X.be=function(){};olympe.H.$.X.be.prototype.constructor=olympe.H.$.X.be;olympe.H.$.X.be.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.be.ma=[olympe.H.$.Zc];olympe.H.$.Db={};olympe.H.$.Db.Number=class{constructor(){}ia(a,b,c){return`{"y":11,"v":${vi(c,a.C,b)}}`}};olympe.H.$.Db.Number.ma=[olympe.H.$.Ne];olympe.H.$.Db.String=class{constructor(){}ia(a,b,c){return`{"y":10,"v":${vi(c,a.C,b)}}`}};olympe.H.$.Db.String.ma=[olympe.H.$.Ne];olympe.H.$.V={};olympe.H.$.V.Vc=function(){};olympe.H.$.V.Vc.prototype.constructor=olympe.H.$.V.Vc;olympe.H.$.V.Vc.prototype.ia=function(a,b,c){const d=vi(c,a.source,b);c=vi(c,a.getValue(),b);a=wi(a.G,b);return'{"y":20,"s":'+d+',"v":'+c+',"a":'+a+'}'};olympe.H.$.V.Vc.ma=[olympe.H.$.bb];olympe.H.$.V.Ic=function(){};olympe.H.$.V.Ic.prototype.constructor=olympe.H.$.V.Ic;olympe.H.$.V.Ic.prototype.ia=function(a,b,c){const d=vi(c,a.G,b);a=vi(c,a.L,b);return'{"y":10,"l":'+d+',"r":'+a+'}'};olympe.H.$.V.Ic.ma=[olympe.H.$.bb];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=vi(c,a.G,b);a=vi(c,a.L,b);return'{"y":11,"l":'+d+',"r":'+a+'}'};olympe.H.$.V.ye.ma=[olympe.H.$.bb];olympe.H.$.V.jf=class{ia(a){const b=Tg(a).map(d=>'"'+d+'"'),c=Ug(a).map(d=>d===olympe.dc.Aa.DESTINATION?'2':'1');a=a.G;return'{"y":81,"r":['+b.toString()+'],"d":['+c.toString()+']'+(0!==a.length?',"t":"'+a.toString()+'"':'')+'}'}};olympe.H.$.V.jf.ma=[olympe.H.$.bb];olympe.H.$.V.kf=class{ia(a){return'{"y":80,"m":['+Array.from(a.G).map(b=>'"'+b+'"').toString()+']}'}};olympe.H.$.V.kf.ma=[olympe.H.$.bb];olympe.H.$.V.md=class{ia(a,b,c){return'{"y":30,"p":'+ui(c,a.G,b)+'}'}};olympe.H.$.V.md.ma=[olympe.H.$.bb];olympe.H.$.V.zd=class{ia(a,b,c){c=vi(c,a.source,b);const d=a.L;a=wi(a.G,b);return'{"y":23,"s":'+c+',"r":"'+d+'","a":'+a+'}'}};olympe.H.$.V.zd.ma=[olympe.H.$.bb];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=vi(c,a.G,b);a=vi(c,a.L,b);return'{"y":12,"l":'+d+',"r":'+a+'}'};olympe.H.$.V.Fe.ma=[olympe.H.$.bb];olympe.H.$.oa={};olympe.H.$.oa.Oc=function(){};olympe.H.$.oa.Oc.prototype.constructor=olympe.H.$.oa.Oc;olympe.H.$.oa.Oc.prototype.C=function(){};
794
- olympe.H.$.oa.Oc.prototype.ia=function(a,b,c){var d=wi(a.$e,b),e=a.Qd();e=e?',"b":'+wi(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.na(),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.$.oa.Oc.ma=[olympe.H.$.wf];olympe.H.$.oa.ve=function(){olympe.H.$.oa.Oc.call(this)};olympe.H.$.oa.ve.prototype=Object.create(olympe.H.$.oa.Oc.prototype);olympe.H.$.oa.ve.prototype.constructor=olympe.H.$.oa.ve;olympe.H.$.oa.ve.prototype.C=function(){return 13};olympe.H.$.oa.bd=function(){};olympe.H.$.oa.bd.prototype.constructor=olympe.H.$.oa.bd;olympe.H.$.oa.bd.prototype.ia=function(a,b){return'{"y":10,"v":'+wi(a.value,b)+'}'};olympe.H.$.oa.bd.ma=[olympe.H.$.wf];olympe.H.$.oa.le=function(){olympe.H.$.oa.Oc.call(this)};olympe.H.$.oa.le.prototype=Object.create(olympe.H.$.oa.Oc.prototype);olympe.H.$.oa.le.prototype.constructor=olympe.H.$.oa.le;olympe.H.$.oa.le.prototype.C=function(){return 14};olympe.H.$.oa.me=function(){olympe.H.$.oa.Oc.call(this)};olympe.H.$.oa.me.prototype=Object.create(olympe.H.$.oa.Oc.prototype);olympe.H.$.oa.me.prototype.constructor=olympe.H.$.oa.me;olympe.H.$.oa.me.prototype.C=function(){return 11};olympe.H.$.oa.qe=function(){olympe.H.$.oa.Oc.call(this)};olympe.H.$.oa.qe.prototype=Object.create(olympe.H.$.oa.Oc.prototype);olympe.H.$.oa.qe.prototype.constructor=olympe.H.$.oa.qe;olympe.H.$.oa.qe.prototype.C=function(){return 12};olympe.H.$.oa.sf=class{ia(){return'{"y":19}'}};olympe.H.$.oa.sf.ma=[olympe.H.$.wf];olympe.H.jd={};function xi(a,b){a.N.info('Initializing SERVER layer');if(a.N.G()){const c=['Server layer parameters:'];b.forEach((d,e)=>{c.push(e+'="'+d+'"')});a.N.debug(c.join('\n\t'))}a.Fa(olympe.H.Jc.tc,c=>{switch(c.c){case olympe.H.ja.fv:a.N.error('Unknown message sent to the server:',olympe.H.ta.F[c.s]);break;case olympe.H.ja.ft:a.N.error('Fatal error, the last message is probably too big according to the websocket config.'),a.R.forEach((d,e)=>{yi(a,e,c.i)})}});b.get('autoConnect')&&(a.N.debug('Connecting automatically'),
795
- a.connect());olympe.D.Tk(a.L.Eb(),()=>{for(const c of a.bl.values())c();Kb(a.Pf.bind(a),a.Vf,'checkTimeoutMessages')},()=>{for(const c of a.Wf.values())c();Lb('checkTimeoutMessages');a.Pf()});a.N.log('DONE initializing SERVER layer (waiting for NET layer connection to be opened)')}
796
- function zi(a,b){if(a.C!==b)switch(a.N.log('State change '+a.C+' --\x3e '+b),a.C=b,b){case olympe.H.ta.C.CONNECTING:break;case olympe.H.ta.C.yh:a.L.update(olympe.D.ra.F);olympe.D.Tk(a.cc.R(),a.Ta.bind(a,a.By),a.Ta.bind(a,5E3));break;case olympe.H.ta.C.pm:a.connect(!0);break;case olympe.H.ta.C.tc:a.N.error('Connection to server',a.ka.C(),'aborted due to error');a.L.update(olympe.D.ra.C);break;case olympe.H.ta.C.gf:a.L.update(olympe.D.ra.C);a.lc&&(a.N.info('Disconnected, will try to auto reconnect in',
797
- a.Pc,'ms'),Ib(()=>{a.connect()},a.Pc));break;default:throw Error('State machine error in server manager. Should not get in state '+b);}}
798
- function Ai(a,b){const c=olympe.H.ta.L.Oi,d=olympe.H.ta.L.iu;return e=>{if(null!==e&&void 0!==e){var f=null,g=e.s;if(g===d)a.N.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.ta.F[g]?`Status code = ${g} [${olympe.H.ta.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)}}}
800
- function Bi(a){var b=JSON.parse(JSON.stringify(a));a=olympe.W.Nr;const c=b.messageFamily,d=a(olympe.H.Jc,c),e=b.payload;b='';switch(c){case olympe.H.Jc.zh:b=a(olympe.dc.ga.ja,e.c);break;case olympe.H.Jc.tc:b=a(olympe.H.ja,e.c);break;case olympe.H.Jc.pf:b=a(olympe.H.pa.Ua.C,e.c);break;case olympe.H.Jc.Ai:2===e.c&&(b=a(olympe.H.ta.G,e.status))}a=`${d} message`;b&&0<b.length&&(a+=` with payload "${b}"`);return a}
801
- function yi(a,b,c){if(a.R.delete(b)){c={s:23,info:c};const d=a.Y.get(b);d&&d(c);a.Y.delete(b)}}function Ci(a,b){a.N.error(b);zi(a,olympe.H.ta.C.tc)}function Di(a,b,c,d){a.N.info('Connected to',a.ka.C(),' | ',c?'server version:'+c:'',null!==d?`activity timeout: ${d}s`:'');zi(a,olympe.H.ta.C.yh);b&&a.bs.forEach(e=>e());null===d||a.Tb||Ei(a,d);a.Pb.forEach(e=>{const f=JSON.stringify(e);a.N.debug('>',Bi(e));a.F.send(f);e=e.seqId;a.Y.has(e)&&a.R.set(e,Date.now())});a.Pb.length=0}
802
- function Ei(a,b){Lb('keepAliveSubscription');const c=Kb(()=>{a.qa()?a.G(olympe.H.Jc.zh,{c:olympe.H.ja.nf,subIds:Array.from(a.Ab)},(d,e)=>d&&a.N.error(e)):c.cancel()},1E3*b,'keepAliveSubscription')}
803
- olympe.H.jd.ta=class{constructor(a,b,c,d){this.N=a;this.cc=b;this.ka=c;this.F=null;this.config=d;this.Pc=this.config.get('reconnectionDelay');this.By=this.config.get('pingInterval');this.Cy=this.Pc/4;this.lc=d.get('autoConnect');this.Dy=d.get('retryHttpOverload');this.Vf=d.get('messageTimeout');this.ea=Ka(d.get('clientVersion'));this.$a=Ka(d.get('serverVersion'));this.C=olympe.H.ta.C.INIT;this.Tb=d.get('getContextMode');this.es=1;this.ee=null;this.Y=new Map;this.cb=new Map;this.L=olympe.D.Nc(olympe.D.ra,
804
- 'Server is online');this.bl=new Map;this.Wf=new Map;this.bs=new Map;this.Pb=[];this.R=new Map;this.Ab=new Set;this.xy=new Map;xi(this,d)}qa(){return this.C===olympe.H.ta.C.yh}connect(a=!1){this.lc=!0;this.N.log('Asking NET layer for a connection to',Mb(this.ka)+':'+this.ka.port,'...');this.F=this.cc.ka(this.ka);this.F.qa(this.Lc.bind(this,a));this.F.ka(this.Ge.bind(this));this.F.ea(()=>{this.F=null;this.C===olympe.H.ta.C.yh?zi(this,olympe.H.ta.C.pm):this.C!==olympe.H.ta.C.tc&&zi(this,olympe.H.ta.C.gf)});
805
- a||zi(this,olympe.H.ta.C.CONNECTING)}disconnect(){const a=olympe.H.ta.C.CONNECTING;if(this.C===olympe.H.ta.C.yh||this.C===a)this.lc=!1,zi(this,olympe.H.ta.C.gf)}th(a){const b=olympe.W.fc();this.bl.set(b,a);olympe.D.Za(this.L)===olympe.D.ra.F&&a()}uh(a){var b;void 0===b&&(b=olympe.W.fc());this.Wf.set(b,a);olympe.D.Za(this.L)===olympe.D.ra.C&&a()}$k(a){var b;void 0===b&&(b=olympe.W.fc());this.bs.set(b,a)}Lc(a=!1){this.N.debug('Websocket connected, sending handshake. Client version:',La(this.ea),'subscribeEverything:',
806
- this.Tb?'NO':'YES');this.G(olympe.H.Jc.Ai,{c:olympe.H.ja.Ai,cv:La(this.ea),m:this.Tb?0:1,s:this.ee},this.sy.bind(this,a))}G(a,b,c){const d=this.es;this.es++;b={seqId:d,messageFamily:a,payload:b};void 0!==c&&this.Y.set(d,Ai(this,c));const e=[olympe.H.ta.C.CONNECTING,olympe.H.ta.C.pm];this.qa()||a===olympe.H.Jc.Ai&&e.includes(this.C)?(a=JSON.stringify(b),this.N.debug('>',Bi(b)),this.F.send(a),void 0!==c&&this.R.set(d,Date.now())):this.Pb.push(b)}td(a,b,c,d,e,f){c&&''!==c||this.N.warn('Trying to send an http request with an invalid authorizationToken');
807
- const g=Pb(a);if(e){g.method=olympe.la.fb.ce.hm;e=d?e:{messageFamily:b,seqId:1,payload:e};const k=JSON.stringify(e);g.body=k;Qb(g,{'Content-Type':'application/json'});this.N.log('HTTP POST >',Bi(e))}else this.N.log('HTTP GET call to',a);g.F=olympe.la.fb.ResponseType.vk;Qb(g,{Authorization:c});const h=()=>{this.cc.C(g,k=>{switch(k.Td()){case olympe.la.fb.qd.Kh:case olympe.la.fb.qd.vl:case olympe.la.fb.qd.zj:k=k.getData();if(b!==olympe.H.Jc.zh||d){f&&f(null,k);break}k=this.Ge(k);f&&f(k);k&&this.N.error(k.message);
808
- break;case olympe.la.fb.qd.Mu:Ib(h,this.Dy);break;case olympe.la.fb.qd.Fs:this.N.debug(`HTTP request canceled (${a}).`);f&&f(null);break;default:k=Error(`Server is currently not available, http status: ${k.Td()}`),f&&f(k)}})};h()}Fa(a,b,c){void 0===c&&(c=olympe.W.fc());let d=this.cb.get(a);void 0===d&&(d=new Map,this.cb.set(a,d));d.set(c,b)}Of(a,b){a=this.cb.get(a);void 0!==a&&a.delete(b)}gs(a){this.Ab.add(a)}ls(a){this.Ab.delete(a)}sy(a,b,c){if(b)Ci(this,'Error in receiving handshake response: '+
809
- b.message);else{this.N.debug('Handshake response received');var d=olympe.H.ta.G;b=c.sv||'undefined';var e=c.activityTimeout?Math.max(c.activityTimeout-60,5):null;switch(c.status){case d.zt:Ci(this,`Framework version (${La(this.ea)}) provided to the orchestrator was not valid. See orchestrator logs for more info.`);return;case d.Yu:Ci(this,`Framework version (${La(this.ea)}) is not compatible with the orchestrator in use. See orchestrator logs for more info.`);return;case d.mt:Ci(this,'Handshake failed. See orchestrator logs for more info.');
810
- return}if(this.$a.sb(olympe.W.Uh.C))this.N.warn('Handshake successful but received server version',b,'is invalid. Cannot check against it');else try{var f=Ka(b);if(f.vj(this.$a)){Ci(this,`Framework v${La(this.ea)} is expecting Orchestrator to be at least in v${La(this.$a)}`);return}this.N.log('Handshake successful. Orchestrator version: ',f,'required:',La(this.$a))}catch(g){Ci(this,g);return}if(f=c.identityProviders)for(const [g,h]of Object.entries(f))this.xy.set(g,h);this.ee=c.sessionId||null;Di(this,
811
- a,b,e)}}Ta(a=-1){if(this.C===olympe.H.ta.C.yh){var b=olympe.D.Ia(),c='onConnectionLost'+olympe.W.fc();this.N.debug('Sending Ping');this.G(olympe.H.Jc.Ls,{c:1},()=>{Jb(c);0<a&&!b.zb()&&b.run(()=>{Ib(this.Ta.bind(this,a),a,c)})});var d=this.Cy;Ib(()=>{this.N.debug('Force close websocket after offline for',d);olympe.D.zg().run(()=>{this.C!==olympe.H.ta.C.gf&&(this.F&&this.F.close(),zi(this,olympe.H.ta.C.gf))})},d,c)}}Ge(a){try{var b=JSON.parse(a)}catch(d){return this.N.error('Unable to parse response from server: '+
812
- d.toString()),Error('Unable to parse response from server')}this.N.debug('<',Bi(b));a=b.seqId;const c=b.messageFamily;b=b.payload;if(this.R.delete(a)){const d=this.Y.get(a);d&&d(b);this.Y.delete(a)}a=this.cb.get(c);if(void 0!==a)for(const d of a.values())d(b);return null}Pf(){const a=Date.now();let b=!1;for(const [c,d]of this.R)a-d>this.Vf&&(this.N.warn(`No response was received from the server for the seqId = ${c}`),yi(this,c,{error:{reason:'Message timeout: never receive acknowledge'}}),b=!0);b&&
813
- this.Ta()}};olympe.H.jd.ta.C='checkTimeoutMessages';olympe.H.ta.L={Oi:0,iu:18,Yz:23};
814
- olympe.H.ta.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',
815
- 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.jd.ta.ma=[olympe.H.ta];olympe.H.O={xa:'server.Manager',Wn:'server.bus.Manager',Ea:'server.Logger',Nd:'server.Source',Qg:'server.FileSource',pp:'server.ImportFileSvcHttpRequest',Rn:'server.BackupSvcHttpRequest',aq:'server.OpenIDSvcHttpRequest',So:'server.GetContextSvcPathRequest',mp:'server.ImplicitGDSvcPathRequest',Eo:'server.ExplicitGDSvcPathRequest',$q:'server.TransactionOverHttpPathRequest',kr:'server.UserTokenRequest',ir:'server.UserTagRequest',gr:'server.UserRolesRequest',Cq:'server.RoleMembersRequest',Eh:'server.IOUrlsProvider',
816
- Ko:'server.fileSvcUrl',iq:'communication.peerFileSvcUrl'};olympe.H.wd={mi:'server.connectors.Auth',DA:'server.connectors.Signaling'};
817
- olympe.H.Config={yd:'server.host',Ld:'server.port',Ad:'server.ssl',In:'server.autoConnect',vq:'server.reconnectionDelay',mq:'server.pingInterval',ym:'server.messageTimeout',Aq:'server.retryHttpOnOverload',co:'server.clientVersion',Iq:'server.serverVersion',Vn:'bus.host',Xn:'bus.path',Yn:'bus.port',Zn:'bus.vhost',nf:'bus.keepalive',Hu:'bus.reschedulePings',Js:'bus.clientId',Hs:'bus.clean',Du:'bus.reconnectPeriod',Ms:'bus.connectTimeout',er:'bus.username',gq:'bus.password',zu:'bus.queueQoSZero'};
818
- olympe.H.qb={Fd:'server.basePath',qr:'server.wsPath',Io:'server.filePath',op:'server.importFilePath',Qn:'server.backupSvcPath',$p:'server.openIDSvcPath',Ro:'server.GetContextSvcPath',np:'server.ImplicitGraphdefSvcPath',Fo:'server.ExplicitGraphdefSvcPath',Zq:'server.TransactionOverHttpPath',jr:'server.userTokenSvcPath',hr:'server.userTagPath',fr:'server.userRolesPath',Bq:'server.roleMembersPath',gm:'communication.peerFileSvcPath'};
819
- olympe.U.config(function(a){var b='object'===typeof window&&window.location&&window.location.hostname||'localhost';const c='localhost'===b;E(a,olympe.H.Config.yd,b);E(a,olympe.H.Config.Ld,c?8080:443);E(a,olympe.H.Config.Ad,'localhost'!==b);E(a,olympe.H.qb.Fd,'OlympeServer');E(a,olympe.H.qb.qr,'websocket');E(a,olympe.H.qb.Io,'rest/filesvc');E(a,olympe.H.qb.op,'rest/importsvc');E(a,olympe.H.qb.Qn,'rest/backupsvc');E(a,olympe.H.qb.$p,'rest/openid');E(a,olympe.H.qb.Ro,'rest/initialData');E(a,olympe.H.qb.np,
820
- 'rest/querysvc/graphDefImplicit');E(a,olympe.H.qb.Fo,'rest/querysvc/graphDefExplicit');E(a,olympe.H.qb.Zq,'rest/transaction');E(a,olympe.H.qb.jr,'rest/token');E(a,olympe.H.qb.hr,'rest/authorization/getUserTag');E(a,olympe.H.qb.fr,'rest/authorization/getUserRoles');E(a,olympe.H.qb.Bq,'rest/authorization/roleMembers');E(a,olympe.H.Config.In,!0);E(a,olympe.H.Config.vq,5E3);E(a,olympe.H.Config.mq,3E5);E(a,olympe.H.Config.ym,15E3);E(a,olympe.H.Config.Aq,5E3);E(a,olympe.H.Config.Iq,'6.2.2');E(a,olympe.H.Config.Vn,
821
- '');E(a,olympe.H.Config.Xn,c?'':'/mqtt');E(a,olympe.H.Config.Yn,c?15675:443);E(a,olympe.H.Config.Zn,c?'/':'');E(a,olympe.H.Config.er,'guest');E(a,olympe.H.Config.gq,'guest');E(a,olympe.H.Config.nf,30);E(a,olympe.H.qb.gm,'nodes/files');b=a.getParameter(olympe.Eg.Config.Oo);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.sa.O.xa],d=>d.Qc('communication'));C(a,'server.WebSocketRequest',[new olympe.U.fa(olympe.H.Config.yd),
822
- new olympe.U.fa(olympe.H.Config.Ld),new olympe.U.fa(olympe.H.Config.Ad),new olympe.U.fa(olympe.H.qb.Fd),new olympe.U.fa(olympe.H.qb.qr)],(d,e,f,g,h)=>new olympe.la.Ck(d,e,(g+'/'+h).replace(/\/+/g,'/').replace(/\/$/,''),f));b=(d,e,f,g,h)=>(new olympe.la.Vj(d,e,`${g}${h?'/'+h:''}`.replace(/\/+/g,'/').replace(/\/$/,''),f)).C();C(a,olympe.H.O.pp,[new olympe.U.fa(olympe.H.Config.yd),new olympe.U.fa(olympe.H.Config.Ld),new olympe.U.fa(olympe.H.Config.Ad),new olympe.U.fa(olympe.H.qb.Fd),new olympe.U.fa(olympe.H.qb.op)],
823
- b);C(a,olympe.H.O.Rn,[new olympe.U.fa(olympe.H.Config.yd),new olympe.U.fa(olympe.H.Config.Ld),new olympe.U.fa(olympe.H.Config.Ad),new olympe.U.fa(olympe.H.qb.Fd),new olympe.U.fa(olympe.H.qb.Qn)],b);C(a,olympe.H.O.aq,[new olympe.U.fa(olympe.H.Config.yd),new olympe.U.fa(olympe.H.Config.Ld),new olympe.U.fa(olympe.H.Config.Ad),new olympe.U.fa(olympe.H.qb.Fd),new olympe.U.fa(olympe.H.qb.$p)],b);C(a,olympe.H.O.So,[new olympe.U.fa(olympe.H.Config.yd),new olympe.U.fa(olympe.H.Config.Ld),new olympe.U.fa(olympe.H.Config.Ad),
824
- new olympe.U.fa(olympe.H.qb.Fd),new olympe.U.fa(olympe.H.qb.Ro)],b);C(a,olympe.H.O.mp,[new olympe.U.fa(olympe.H.Config.yd),new olympe.U.fa(olympe.H.Config.Ld),new olympe.U.fa(olympe.H.Config.Ad),new olympe.U.fa(olympe.H.qb.Fd),new olympe.U.fa(olympe.H.qb.np)],b);C(a,olympe.H.O.Eo,[new olympe.U.fa(olympe.H.Config.yd),new olympe.U.fa(olympe.H.Config.Ld),new olympe.U.fa(olympe.H.Config.Ad),new olympe.U.fa(olympe.H.qb.Fd),new olympe.U.fa(olympe.H.qb.Fo)],b);C(a,olympe.H.O.$q,[new olympe.U.fa(olympe.H.Config.yd),
825
- new olympe.U.fa(olympe.H.Config.Ld),new olympe.U.fa(olympe.H.Config.Ad),new olympe.U.fa(olympe.H.qb.Fd),new olympe.U.fa(olympe.H.qb.Zq)],b);C(a,olympe.H.O.kr,[new olympe.U.fa(olympe.H.Config.yd),new olympe.U.fa(olympe.H.Config.Ld),new olympe.U.fa(olympe.H.Config.Ad),new olympe.U.fa(olympe.H.qb.Fd),new olympe.U.fa(olympe.H.qb.jr)],b);C(a,olympe.H.O.ir,[new olympe.U.fa(olympe.H.Config.yd),new olympe.U.fa(olympe.H.Config.Ld),new olympe.U.fa(olympe.H.Config.Ad),new olympe.U.fa(olympe.H.qb.Fd),new olympe.U.fa(olympe.H.qb.hr)],
826
- b);C(a,olympe.H.O.gr,[new olympe.U.fa(olympe.H.Config.yd),new olympe.U.fa(olympe.H.Config.Ld),new olympe.U.fa(olympe.H.Config.Ad),new olympe.U.fa(olympe.H.qb.Fd),new olympe.U.fa(olympe.H.qb.fr)],b);C(a,olympe.H.O.Cq,[new olympe.U.fa(olympe.H.Config.yd),new olympe.U.fa(olympe.H.Config.Ld),new olympe.U.fa(olympe.H.Config.Ad),new olympe.U.fa(olympe.H.qb.Fd),new olympe.U.fa(olympe.H.qb.Bq)],b);C(a,olympe.H.O.Ko,[new olympe.U.fa(olympe.H.Config.yd),new olympe.U.fa(olympe.H.Config.Ld),new olympe.U.fa(olympe.H.Config.Ad),
827
- new olympe.U.fa(olympe.H.qb.Fd),new olympe.U.fa(olympe.H.qb.Io)],b);C(a,olympe.H.O.iq,[new olympe.U.fa(olympe.la.Config.Jl),new olympe.U.fa(olympe.la.Config.Kl),new olympe.U.fa(olympe.la.Config.gp),new olympe.U.fa(olympe.H.qb.gm)],b);C(a,'server.ManagerConfig',[new olympe.U.fa(olympe.H.Config.In),new olympe.U.fa(olympe.H.Config.vq),new olympe.U.fa(olympe.H.Config.mq),new olympe.U.fa(olympe.H.Config.ym),new olympe.U.fa(olympe.H.Config.co),new olympe.U.fa(olympe.H.Config.Iq),new olympe.U.fa(olympe.dc.Config.Yg),
828
- new olympe.U.fa(olympe.H.Config.Aq)],(...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.U.fa(olympe.H.Config.yd),new olympe.U.fa(olympe.H.Config.Vn),new olympe.U.fa(olympe.H.Config.Xn),new olympe.U.fa(olympe.H.Config.Yn),new olympe.U.fa(olympe.H.Config.Zn),new olympe.U.fa(olympe.H.Config.er),new olympe.U.fa(olympe.H.Config.Ad),
829
- new olympe.U.fa(olympe.H.Config.nf),new olympe.U.fa(olympe.H.Config.Hu),new olympe.U.fa(olympe.H.Config.Js),new olympe.U.fa(olympe.H.Config.Hs),new olympe.U.fa(olympe.H.Config.Du),new olympe.U.fa(olympe.H.Config.Ms),new olympe.U.fa(olympe.H.Config.gq),new olympe.U.fa(olympe.H.Config.zu),new olympe.U.fa(olympe.H.Config.ym)],(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(' ');
830
- 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.xa,olympe.H.jd.ta,olympe.H.O.Ea,olympe.la.O.xa,'server.WebSocketRequest','server.ManagerConfig');B(a,olympe.H.wd.mi,olympe.H.pa.Ua,olympe.H.O.Ea,olympe.H.O.xa,olympe.H.O.kr,olympe.H.O.ir,olympe.H.O.gr,olympe.H.O.Cq,olympe.H.O.aq,olympe.auth.O.kk,olympe.ic.O.$j);B(a,olympe.H.O.Wn,olympe.H.ya.ta,olympe.H.O.Ea,olympe.la.O.xa,olympe.auth.O.xa,
831
- 'server.bus.ManagerConfig');sa(a,olympe.auth.wd.xa,olympe.H.wd.mi);sa(a,olympe.auth.wd.Ep,olympe.H.wd.mi);sa(a,olympe.auth.wd.Ee,olympe.H.wd.mi);sa(a,olympe.auth.wd.Re,olympe.H.wd.mi);B(a,olympe.H.O.Qg,olympe.H.Qj,olympe.H.O.Ea,olympe.la.O.xa,olympe.auth.O.xa,olympe.H.O.Ko,olympe.H.O.iq);sa(a,olympe.ab.O.Qg,olympe.H.O.Qg);C(a,olympe.H.O.Nd,[olympe.sa.O.xa,olympe.H.O.xa,olympe.auth.O.xa,olympe.ab.O.Qg,olympe.H.O.So,olympe.H.O.mp,olympe.H.O.Eo,olympe.H.O.$q],(d,e,f,g,h,k,l,n)=>new olympe.H.$g(d.Qc('server.source'),
832
- e,f,g,[h,k,l,n]));B(a,olympe.H.O.Eh,olympe.H.Wj,olympe.H.O.pp,olympe.H.O.Rn);sa(a,olympe.dc.aa.O.Eh,olympe.H.O.Eh);sa(a,olympe.ab.O.tm,olympe.H.O.Nd)},'olympe.communication');olympe.U.run([olympe.H.O.Wn],a=>{olympe.H.ya.Tc=()=>a});olympe.sc={};olympe.sc.O={Ea:'sc.Logger',rm:'sc.RootContext'};olympe.sc.Config={ef:'sc.app',dg:'sc.debug',Ws:'sc.disableTheme',PRODUCTION:'sc.production',Zp:'sc.onstartTimeout',zq:'sc.remoteActionTimeout',Xp:'sc.offlineStart',fu:'google.apikey'};
833
- olympe.U.config(a=>{E(a,olympe.sc.Config.ef,'');E(a,olympe.sc.Config.Xp,!1);E(a,olympe.sc.Config.dg,!1);E(a,olympe.sc.Config.Ws,!1);E(a,olympe.sc.Config.PRODUCTION,!1);E(a,olympe.sc.Config.Zp,2E4);E(a,olympe.sc.Config.fu,'AIzaSyD0rTnF3Tq-ZjgdaqyvC8Jg-RSgpZM2jBU');E(a,olympe.sc.Config.zq,1E4);C(a,olympe.sc.O.Ea,[olympe.sa.O.xa],b=>b.Qc('sc'));C(a,olympe.sc.O.rm,[new olympe.U.fa(olympe.sc.Config.PRODUCTION),new olympe.U.fa(olympe.sc.Config.Zp)],b=>{const c=new olympe.sc.Va('root','root',null);olympe.sc.ks=
834
- c;c.set(olympe.sc.Va.jg.PRODUCTION,b);return c})},'olympe.sc');olympe.U.run([olympe.sc.O.rm],a=>{olympe.dj().ctx=a});olympe.sc.UC=(a,b,c)=>{a.Oa(olympe.dc.CloudObject.containsRel,c,b)};olympe.sc.SC=(a,b,c)=>{a.Oa(olympe.dc.CloudObject.containsRel,c,b);a.Oa(olympe.sc.Runnable.G,c,b);a.Oa(olympe.sc.Runnable.C,c,b)};olympe.sc.jD=(a,b,c)=>{a.Jb(olympe.dc.CloudObject.containsRel,c,b);a.Jb(olympe.sc.Runnable.G,c,b);a.Jb(olympe.sc.Runnable.C,c,b)};olympe.sc.ln=()=>null!==olympe.dc.Pa().oc(void 0,olympe.sc.Runnable.C.Sc());olympe.sc.lD=(a,b,c)=>{a.Jb(olympe.dc.CloudObject.containsRel,c,b)};
835
- olympe.sc.ux=(a,b,c)=>{a.Oa(olympe.sc.lb.F,c,b)};olympe.sc.zy=(a,b,c)=>{a.Jb(olympe.sc.lb.F,c,b)};olympe.sc.TC=(a,b,c)=>{olympe.sc.ux(a,b,c);a.Oa(olympe.dc.CloudObject.containsRel,c,b)};olympe.sc.kD=(a,b,c)=>{olympe.sc.zy(a,b,c);a.Jb(olympe.dc.CloudObject.containsRel,c,b)};olympe.sc.yC=(a,b,c,d)=>{c=a.create(olympe.sc.Cc).setProperty(olympe.sc.Cc.C,c||null).setProperty(olympe.sc.Cc.L,d||null);a.Oa(olympe.sc.Cc.F,c,b);a.Oa(olympe.dc.CloudObject.containsRel,b,c);return c.T()};
836
- olympe.sc.hh=a=>{a=olympe.dc.W.Vb.hh(a);return a instanceof olympe.sc.Ce?a.C():a};olympe.sc.NC=a=>{a=olympe.dc.CloudObject.get(a.tag);return a instanceof olympe.sc.Ce?a.C():a};
837
- olympe.sc.KC=function(a){const b=olympe.dm.Rb.C.Sc(),c=olympe.dc.CloudObject.containsRel.Sc();var d=olympe.dc.wa(a);if(void 0===d)return[];a=olympe.dc.Pa();var e=a.model(d);const f=[],g=[];let h=[];if(a.Rf(e,olympe.dm.Rb))h.push(d);else{for(e=[];null===a.oc(d,b);){e.push(d);const k=a.oc(d,c);if(null===k)return olympe.sa.Ya('sc').warn(`Object ${d} has no container`),[];k===a.oc(d,olympe.dc.CloudObject.instancesRel)?(f.push(d),d=a.oc(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.oc(g[0],b))}h=h.concat(a.Mf(h[0],olympe.dm.Rb.Pb));h=h.concat(a.Mf(h[h.length-1],olympe.dm.od.ka.Sc()));h=h.concat(a.Mf(h[h.length-1],olympe.dm.od.R.Sc()));return[...f,...g,...h].reverse()};olympe.sc.LC=a=>{a=a&&a.valueOf()||'';return a.startsWith('image/')?olympe.sc.Xj:a.startsWith('video/')?olympe.sc.xm:a.startsWith('font/')||a.startsWith('application/font-woff')?olympe.sc.xd:olympe.dm.File};let Fi=0,Gi=0;function Hi(a,b){if(a.children)for(const c of a.children.values())b(c)}function Ii(a,b){if(a.re&&a.re.has(b)){var c=a.re.get(b);--c[0];0===c[0]&&(a.re.delete(b),0===a.re.size&&(a.re=null),Pc(olympe.dc.Dd(),null,c[1]))}}function Ji(a,b){a.children&&a.children.delete(b.Z())}function Ki(a,b){if(null===a)return null;if(a.has(b))return a.get(b);for(const c of a.values())if(c.Im&&c.kj()&&(a=Ki(c.children,b)))return a;return null}
839
- function Li(a,b){b=olympe.dc.wa(b);return a.sh&&(a.sh.get('O#'+b)||a.sh.get('IO#'+b))||b}function Mi(a,b,c,d){const e='$'+b;a.$h.add(b);c.map(f=>'@'+f+'.'+b).forEach(f=>{(f=a.sd&&a.sd.get(f))&&f.forEach(g=>{g(d)})});Hi(a,f=>{!f.Om&&f.$h.has(b)||f.data.has(e)||Mi(f,b,c,d)});a.$h.delete(b)}function Ni(a,b){b=olympe.dc.wa(b);return a.sh&&(a.sh.get('I#'+b)||a.sh.get('IO#'+b))||b}
840
- function Oi(a,b,c){a.$h.add(b);const d=a.sd&&a.sd.get('&'+b);if(d)for(const e of d.values())e(c);Hi(a,e=>{e.$h.has(b)||Oi(e,b,c)});a.$h.delete(b)}
841
- olympe.sc.Va=class{constructor(a,b,c=olympe.sc.ks){++Gi;this.id=a;this.gh=new Set;this.parent=c;this.Cd=b||null;this.vc=new olympe.D.Zb('SC Context');this.data=new Map;this.re=this.children=this.sd=null;this.Pm=new Map;this.uid=Gi;this.zr=null;this.Im=!1;this.$h=new Set;this.Om=!1;this.N=olympe.sa.Ya('sc');this.sh=null;this.vc.xc(()=>{Hi(this,d=>d.destroy())});this.vc.onDestroy(()=>{this.re&&this.re.forEach(([d],e)=>{for(let f=0;f<d;f++)Ii(this,e)});c&&Ji(this.parent,this);this.gh.clear();this.parent=
842
- null;null!==this.get(olympe.sc.Va.jg.TRANSACTION)&&this.N.warn(`The context ${this.id} is being destroyed but still has unreleased transactions. You probably forgot to end a transaction.`)})}Z(){return this.id}hn(){return this.uid}getParent(){return this.parent}Nk(){return this.zr}Fc(){return this.vc}rn(a){this.zr=olympe.dc.wa(a);this.Im=a.Rd().ln();a.ea().forEach(b=>{this.gh.add(b)});this.sh=a.Y()}Gk(){this.Om=!0;Hi(this,a=>{a.Gk()})}jl(){this.Om=!1;Hi(this,a=>{a.jl()})}set(a,b){if(this.vc.R()||
843
- this.vc.zb())return this;a=Li(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),Mi(this,a,['*',this.id,...this.gh],null));else{var e;(e=void 0===d)||(e=!('function'===typeof b.sb?b.sb(d):b.valueOf()===d.valueOf()));e&&(this.data.set(c,b),Mi(this,a,['*',this.id,...this.gh],b))}return this}li(a){return this.set(a,Date.now())}remove(a){this.vc.zb()||this.vc.R()||(a=Li(this,a),this.data.delete('$'+a)&&Mi(this,a,['*',this.id,
844
- ...this.gh],null))}Eb(a,b,c=!1){const d=olympe.dc.wa(a),e=olympe.D.Nc(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.Za(a,b);return void 0!==a?a:null}has(a,b=!1){a='$'+Ni(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.zb())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);this.onDestroy(()=>{f();d.complete()});return f})}repeat(a,b){const c=Ni(this,a);a=b.subscribe(d=>{null!==d?this.set(c,d):this.remove(c)});this.Hg(a.unsubscribe.bind(a));return this}el(a){a=a instanceof olympe.sc.Runnable?a:this.get(a);if(!a)return null;const b=this.Yh(`Runner ${olympe.D.Za(a.na(),'')}`);a.run(b);return b}Fn(a,b=!0,c=!1){return rxjs.firstValueFrom(this.observe(a,b,c))}hl(a){this.set(olympe.sc.Va.jg.cg,
846
- a);return this}Za(a,b=!0){a='$'+Ni(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){if(this.vc.zb()||this.vc.R())return()=>{};const d=Ni(this,a),e=c?olympe.dc.wa(c):'*';a=this.Te('@'+e+'.'+d,b);c=c?(c=this.fi(e))?c.Za(d,!1):void 0:this.Za(d);void 0!==c&&b(c);olympe.D.Ia().onDestroy(a);return a}Yh(a){const b='_'+olympe.W.fc();null===this.children&&(this.children=new Map);const c=this.vc.run(()=>new olympe.sc.Va(b,a,this));this.children.set(b,
847
- c);return c}Qk(a,b){a=olympe.dc.wa(a);null===this.children&&(this.children=new Map);let c=this.children.get(a);if(!c){c=new olympe.sc.Va(a,b,this);this.children.set(a,c);for(b=c.parent;b&&b.Im&&b.kj();)b=b.parent;b&&Oi(b,a,c)}return c}oj(a,b){const c=this.fi(a);if(c)return b(c),()=>{};const d=this.Te('&'+a,e=>{d&&d();b(e)});return d}fi(a){if(a===this.id||this.gh.has(a)||!a)return this;let b=this.parent;for(;b;){if(a===b.id||b.gh.has(a))return b;const c=Ki(b.children,a);if(c)return c;b=b.parent}return null}kj(){return!this.id.startsWith('_')}Ik(a,
848
- b){this.re||(this.re=new Map);const c=this.re.get(a);c?c[0]+=1:(this.re.set(a,[1,b]),Pc(olympe.dc.Dd(),b))}destroy(){this.vc.R()||this.vc.zb()||this.vc.destroy()}Hg(a,b){return this.vc.zb()?b||'noId':(b=b||String(++Fi),this.Pm.set(b,a),b)}cl(a){this.Pm.delete(a)}onDestroy(a){return this.zb()?(a(),'noId'):this.vc.onDestroy(a)}Ie(a){this.zb()||this.vc.Ie(a)}clear(){this.vc.R()||this.vc.zb()||(this.Pm.forEach(a=>a()),this.vc.ea())}Te(a,b){this.sd||(this.sd=new Map);let c=this.sd.get(a);void 0===c&&(c=
849
- new Map,this.sd.set(a,c));++Fi;const d=Fi;c.set(d,b);return()=>{const e=this.sd.get(a);e&&(e.delete(d),0===e.size&&this.sd.delete(a))}}zb(){return this.vc.zb()}nn(){const a=this.Za(olympe.sc.Va.jg.EDITION);return a?a:!1}Wk(){const a=this.Za(olympe.sc.Va.jg.PRODUCTION);return a?a:!1}};olympe.sc.Va.prototype.clear=olympe.sc.Va.prototype.clear;olympe.sc.Va.prototype.offDestroy=olympe.sc.Va.prototype.Ie;olympe.sc.Va.prototype.onDestroy=olympe.sc.Va.prototype.onDestroy;
850
- olympe.sc.Va.prototype.offClear=olympe.sc.Va.prototype.cl;olympe.sc.Va.prototype.onClear=olympe.sc.Va.prototype.Hg;olympe.sc.Va.prototype.destroy=olympe.sc.Va.prototype.destroy;olympe.sc.Va.prototype.getOtherContext=olympe.sc.Va.prototype.fi;olympe.sc.Va.prototype.onContext=olympe.sc.Va.prototype.oj;olympe.sc.Va.prototype.createChild=olympe.sc.Va.prototype.Yh;olympe.sc.Va.prototype.setParentElement=olympe.sc.Va.prototype.hl;olympe.sc.Va.prototype.waitFor=olympe.sc.Va.prototype.Fn;
851
- olympe.sc.Va.prototype.runner=olympe.sc.Va.prototype.el;olympe.sc.Va.prototype.repeat=olympe.sc.Va.prototype.repeat;olympe.sc.Va.prototype.observe=olympe.sc.Va.prototype.observe;olympe.sc.Va.prototype.has=olympe.sc.Va.prototype.has;olympe.sc.Va.prototype.get=olympe.sc.Va.prototype.get;olympe.sc.Va.prototype.remove=olympe.sc.Va.prototype.remove;olympe.sc.Va.prototype.trigger=olympe.sc.Va.prototype.li;olympe.sc.Va.prototype.set=olympe.sc.Va.prototype.set;olympe.sc.Va.prototype.getParent=olympe.sc.Va.prototype.getParent;
852
- olympe.sc.Va.hc={xt:'I#',su:'O#',Wz:'IO#'};olympe.sc.Va.jg={PRODUCTION:'__production',EDITION:'__editionMode',TRANSACTION:'__transaction',cg:'__htmlContainer',cz:'__dockableElement'};olympe.sc.Metadata=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}};olympe.sc.Metadata.P=olympe.dc.Ca.C('0161ae936c62f9fcd131',olympe.sc.Metadata);olympe.sc.Cc=class extends olympe.dc.CloudObject{F(){return this.Fb(olympe.sc.Cc.L)}C(){return this.Fb(olympe.sc.Cc.C)}};olympe.sc.Cc.P=olympe.dc.Ca.C('01703376c4a81c0e9d90',olympe.sc.Cc);olympe.sc.Cc.L=olympe.sc.Cc.P.Da('01703376c4a81c0e9d91');olympe.sc.Cc.C=olympe.sc.Cc.P.Da('01703376c4a81c0e9d92');olympe.sc.Cc.F=olympe.sc.Cc.P.Ra('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 Pi(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.kt=class{constructor(a,b,c){const d=olympe.la.fb.ce.GET,e=olympe.la.fb.ce.Hc,f=olympe.la.fb.ce.ik,g=olympe.la.fb.ce.bm,h=olympe.la.fb.Headers.Hj,k=olympe.la.fb.Headers.pi;this.N=a;this.G=b.ea([d,e,f,g],[h,k]);this.L=c;this.C=new olympe.W.ar(3E4);this.F=new olympe.D.Zb('FileService context')}start(a){var b=olympe.la.fb.ce.GET;const c=olympe.la.fb.ce.Hc,d=olympe.la.fb.ce.ik,e=olympe.la.fb.ce.bm,f=olympe.la.fb.qd.Kh,g=olympe.la.fb.qd.it,h=olympe.la.fb.qd.Hq,k=olympe.la.fb.Headers.pi,l=olympe.la.fb.Headers.ys,
854
- n=`fileServer_${a}`;a=`/${this.L}/${a}/:${'fileTag'}`.replace(/\/+/g,'/').replace(/\/$/,'');this.N.debug(`Started file service with path : ${a}`);b=this.G.L(n,a,[b,c,d,e],(p,q)=>{if(p.method===e)return Promise.resolve(new olympe.la.Sg('',f,'',{[l]:'*'}));const r=p.ej()[k],t=this.C.get(r);if(!t)return Promise.resolve(new olympe.la.Sg('Invalid token',g,'Access denied'));this.C.delete(r);return t(p.ej(),q.get('fileTag'),p.body).catch(u=>Promise.resolve(new olympe.la.Sg(`Internal server error: ${u}`,
855
- h,'Internal server error')))});this.F.onDestroy(()=>{this.G.Y(n).catch(p=>this.N.error(`An error occurred while stopping the file service: ${p}`))});return b}stop(){this.F.destroy()}};olympe.sc.Ye={};olympe.sc.Ye.dh={Uy:null,Lu:'screenflow',dv:'ui-design',Jq:'software-intelligence',xl:'data-management'};olympe.sc.pe=class extends olympe.dm.BrickMetadata{C(){return olympe.sc.Ye.dh.Jq}F(){return this.tb(olympe.sc.pe.C,olympe.sc.logic.Ji)}G(){return this.tb(olympe.sc.pe.F,olympe.sc.logic.Oh)}};olympe.sc.pe.P=olympe.dc.Ca.C('011100000000000adef0',olympe.sc.pe);olympe.sc.pe.C=olympe.sc.pe.P.Ra('016ac4f59a2917fdef01');olympe.sc.pe.F=olympe.sc.pe.P.Ra('016ac4f59a2917fdef02');olympe.sc.pe.prototype.F.K=new olympe.D.J(()=>olympe.dc.Ba,[]);olympe.sc.pe.prototype.G.K=new olympe.D.J(()=>olympe.dc.Ba,[]);function Qi(a,b){[].forEach(c=>c.call(a,b,(d,e)=>{null===e?b.remove(d):b.set(d,e)}))}function Ri(a,b){const c=[];for(const d of b)b=a.db.gb(d,olympe.sc.logic.Kc.C,!0),c[b]=d;return c}
856
- olympe.sc.lb=class extends olympe.dm.BrickMetadata{Qt(a,b,c,d,e=!0){e||olympe.sa.Ya('sc').error('parameter own= false ignored, investigate');return olympe.D.bf(L(this.Lf(a,olympe.dc.W.Vb.hh,c)),d)}Yw(){return this.tb(olympe.sc.lb.F,olympe.sc.Runnable)}mw(){return this.tb(olympe.sc.lb.ka,olympe.sc.Runnable)}qn(){return this.db.gb(this,olympe.sc.lb.Pb)}ln(){return null!==this.db.oc(this.tag,olympe.sc.Runnable.C.Sc())}Sl(){return this.tb(olympe.sc.lb.L,olympe.sc.logic.Mb)}Zj(){return this.tb(olympe.sc.lb.R,
857
- olympe.sc.logic.Yb)}};olympe.sc.lb.P=olympe.dc.Ca.C('0112000000000000def0',olympe.sc.lb);olympe.sc.lb.Pb=olympe.sc.lb.P.Da('01692aa71f3108454479');olympe.sc.lb.cc=olympe.sc.lb.P.Da('0166446c1f128ebc903a');olympe.sc.lb.F=olympe.sc.lb.P.Ra('01692a4af82e8984742c');olympe.sc.lb.ka=olympe.sc.lb.P.Ra('01692a4af82e8984742d');olympe.sc.lb.Fa=olympe.sc.lb.P.Ra('01692a4af82e8984742e');olympe.sc.lb.L=olympe.sc.lb.P.Ra('01621fb84e320000f00a');olympe.sc.lb.R=olympe.sc.lb.P.Ra('01621fb84e320000f00b');
858
- olympe.sc.lb.Ge=olympe.sc.lb.P.Ra('0171838bcfed0000e00e');olympe.sc.lb.td=olympe.sc.lb.P.Ra('0171838bcfed0000a00a');m=olympe.sc.lb.prototype;m.Qt.K=olympe.D.J.C;m.Yw.K=new olympe.D.J(()=>olympe.dc.Ba,[]);m.mw.K=new olympe.D.J(()=>olympe.dc.Ba,[]);m.qn.K=olympe.D.J.C;m.ln.K=olympe.D.J.C;m.Sl.K=new olympe.D.J(()=>olympe.dc.Ba,[]);m.Zj.K=new olympe.D.J(()=>olympe.dc.Ba,[]);function Si(a){const b=new olympe.dc.Transaction,c=b.create(a).persist(!1).T();b.ib();olympe.D.Ia().onDestroy(()=>{const d=new olympe.dc.Transaction;d.delete(c);d.ib()});return olympe.dc.CloudObject.get(c)}function Ti(a,b){b.rn(a);Qi(a.Rd(),b);const c=a.L(),d=Ui(b,c),e=[];c.forEach((f,g)=>{f===a.Fa?e[0]=g:f===a.qa&&(e[1]=g)});void 0!==e[0]&&void 0!==e[1]&&(Vi(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 Wi(a,b){var c=a.Wb();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.zb()||(b.clear(),null===h)?!1:(b.Fc().run(a.update.bind(a,new olympe.sc.eb(b),Array.isArray(h)?h:[h],g)),!0))).subscribe(rxjs.Subscriber.create(h=>h?a.N.debug(e):a.N.debug(f),a.cb.bind(a,b),()=>a.N.debug(`Brick ${d} completed`)));b.onDestroy(c.unsubscribe.bind(c))}
860
- function Xi(a,b,c,d){const e=d.Fc(),f=V(a.db,b,c,e.C((g,h)=>{const k=d.Qk(h);g?olympe.dc.CloudObject.get(h).run(k):k.destroy()}));e.xc(a.db.C.bind(a.db,b,c,f,!0))}function Ui(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 Vi(a,b,c){const d=olympe.D.Ia(),e=yd(a.db,a.tag,d.C((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.hh(g)))}));d.onDestroy(()=>{var f=a.db;const g=U(f,a.tag);null!==g&&(g.R(td,e),f.Ja.getState()===ud.bg&&f.Ja.ea(e))})}
862
- olympe.sc.Runnable=class extends olympe.dm.BrickMetadata{constructor(a,b,c){super(a,b);this.N=c}run(a){const b=()=>{Ti(this,a);this.init(a);this.Rd().qn()?Wi(this,a):a.Fc().run(this.update.bind(this,new olympe.sc.eb(a),[],[]));a.li(olympe.sc.lb.cc);a.Hg(this.clear.bind(this,a));a.onDestroy(this.destroy.bind(this,a))},c=a.getParent();c?c.Fc().run(b):b()}Rd(){return this.ei()}init(a){this.onInit(a)}update(a,b,c){const d=this.Rd();if(d.qn())this.onUpdate(a,b,c);else this.N.debug(`Softcoded runnable ${this.db.name(this)} with tag ${this.tag} running in context ${a.hn()}`),
863
- Xi(this,d,olympe.sc.lb.F,a),this.Ta()&&Xi(this,d,olympe.sc.lb.Fa,a)}clear(){}destroy(a){this.onDestroy(a)}setupExecution(){return rxjs.of([])}F(){return[]}onInit(){}onUpdate(){this.N.error(`Brick ${this.db.name(this.Wb())} (${this.Wb()}) is flagged as hardcoded, but method update() has not been overridden.`)}onDestroy(){}getInputs(){var a=this.Rd();return Ri(a,a.db.tb(a.tag,olympe.sc.lb.L))}getOutputs(){var a=this.Rd();return Ri(a,a.db.tb(a.tag,olympe.sc.lb.R))}ea(){return[]}Y(){return new Map}Ta(){return!1}G(a,
864
- b,c,d){a=b.Eb(a,c,!0);void 0!==d&&olympe.D.bf(a,d);return a}Tb(a,b,c,d,e){olympe.D.xn([d],f=>{b.set(a,olympe.D.Xr(f)?f.valueOf():f)});return this.G(a,b,c,e)}L(){return[this.Fa,this.qa]}Fa(a,b){Vi(this,b,null)}qa(a,b){Vi(this,null,b)}cc(a,b){const c=this.db,d=olympe.sc.logic.xb.L.Sc(),e=olympe.sc.logic.xb.F,f=olympe.sc.logic.xb.C;this.Jr(d,g=>{var h=g.T();if(h=c.oc(h,e)||c.oc(h,f))g=Yi(g,a,b.bind(null,h)),olympe.D.Ia().onDestroy(g)})}cb(a,b){const c=this.Wb();let d=this.db.name(c);try{const e=[a.Nk()];
865
- let f=a.getParent();for(;null!==f&&f!==olympe.sc.ks;)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.N.warn(`Impossible to retrieve the stack for brick ${this.db.name(c)}.`)}this.N.error(`An error occurred in brick ${d} (${c}): ${b}\n${b.stack}`)}};olympe.sc.Runnable.P=Jc(olympe.dc.Ca.C('01130000000000ca1100',olympe.sc.Runnable));olympe.sc.Runnable.G=olympe.sc.Runnable.P.Ra('01692a4af82e8984742b');
866
- olympe.sc.Runnable.C=olympe.sc.Runnable.P.Ra('01756a18d4921c103111');olympe.sc.Runnable.R=P(olympe.sc.Runnable.P,olympe.sc.lb.F);olympe.sc.Runnable.Y=P(olympe.sc.Runnable.P,olympe.sc.lb.ka);olympe.sc.Runnable.ea=P(olympe.sc.Runnable.P,olympe.sc.lb.Fa);P(olympe.sc.lb.P,olympe.sc.Runnable.G);P(olympe.sc.lb.P,olympe.sc.Runnable.C);olympe.sc.Runnable.prototype.Rd.K=new olympe.D.J(()=>olympe.sc.lb,[]);olympe.sc.Runnable.prototype.G.K=new olympe.D.J(()=>Object,[]);olympe.sc.Runnable.prototype.Tb.K=olympe.D.J.C;function Zi(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.T)return a.T()}return null}olympe.sc.Ce=class extends olympe.dc.CloudObject{F(){return this.db.tb(this,olympe.sc.Ce.C)[0]}C(){return olympe.dc.CloudObject.get(Zi(this))}toString(){const a=Zi(this);let b;a&&(b=this.db.name(a));return b||super.toString()}};olympe.sc.Ce.P=olympe.dc.Ca.C('0163c9ae01f2d6e9ca49',olympe.sc.Ce);olympe.sc.Ce.C=olympe.sc.Ce.P.Ra('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.xo=class extends olympe.dm.Rb{C(){return olympe.sc.Ye.dh.xl}};olympe.sc.xo.P=olympe.dc.Ca.C('0163a68ce44f3d1fa84c',olympe.sc.xo);olympe.sc.tl=class extends olympe.dm.BrickMetadata{};olympe.sc.tl.P=olympe.dc.Ca.C('016324fde11a836f76c2',olympe.sc.tl);let $i=null;
868
- function aj(a,b){$i=a;(new olympe.dc.hf(a,olympe.dc.Hd.Ii)).vb(olympe.sc.La.Me.C).vb(olympe.sc.ld.F.Sc()).ib((c,d)=>{if(c)olympe.sa.Ya('sc').error('Error while loading business container:',c.message),b(olympe.sc.ld.C.tc);else{c=null;for(const [e,f]of d.Gc.gd())e===olympe.sc.ld.F.T()&&(c=f);null!==c?bf(Xe(new olympe.dc.hf(c),olympe.dc.Ub.rf),(e,f)=>{const g=olympe.dc.jc.Wc,h=olympe.dc.jc.ui,k=f.T();f=f.Qa();return olympe.dc.Pa().qh(e,olympe.sc.tl)&&f===olympe.dc.Aa.ORIGIN&&(k===g||k===h)}).ib(()=>
869
- b(olympe.sc.ld.C.Cp)):(olympe.sa.Ya('sc').error('No container found for the application',a),b(olympe.sc.ld.C.Zl))}})}olympe.sc.ld=class extends olympe.dc.CloudObject{};olympe.sc.ld.C={Cp:0,Zl:1,tc:2};olympe.sc.ld.P=olympe.dc.Ca.C('017b3aa8fae1e3d044dc',olympe.sc.ld);olympe.sc.ld.F=olympe.sc.ld.P.Ra('017b3aa8fd1659291b92');olympe.sc.ld.L=olympe.sc.ld.P.Ra('017b3aa8fe7ec3fd52f2');olympe.sc.Map=class extends olympe.dc.CloudObject{};olympe.sc.Map.P=olympe.dc.Ca.C('01631aacd5c1f9d61c5d',olympe.sc.Map);olympe.sc.Vg=class extends olympe.sc.Map{};olympe.sc.Vg.P=olympe.dc.Ca.C('01631aacd8276ea98490',olympe.sc.Vg);olympe.sc.Xj=class extends olympe.dm.File{L(){const a=olympe.D.Nc(olympe.D.Xa);this.Pk(b=>{a.update(olympe.D.Cb(b))});return a.Eb()}};olympe.sc.Xj.P=Ec('01644b6297305d62fca2',olympe.sc.Xj);olympe.sc.Xj.prototype.L.K=olympe.D.J.F;olympe.sc.xd=class extends olympe.dm.File{L(){return this.Fb(olympe.sc.xd.F)}R(){return this.Fb(olympe.sc.xd.L)}Y(){return this.He(olympe.sc.xd.R)}};olympe.sc.xd.P=Ec('01647e113043c637b541',olympe.sc.xd);olympe.sc.xd.F=olympe.sc.xd.P.Da('01647e35ecd24ef0b88d');olympe.sc.xd.L=olympe.sc.xd.P.Da('01647e677f5d1cfbdf42');olympe.sc.xd.R=olympe.sc.xd.P.Da('01647e6780999bf8bd25');olympe.sc.xd.prototype.L.K=olympe.D.J.F;olympe.sc.xd.prototype.R.K=olympe.D.J.F;olympe.sc.xd.prototype.Y.K=olympe.D.J.G;olympe.sc.xm=class extends olympe.dm.File{};olympe.sc.xm.P=Ec('0164643c432146a71d5c',olympe.sc.xm);olympe.sc.nr=class extends olympe.dc.CloudObject{};olympe.sc.nr.P=olympe.dc.Ca.C('016421bb3797e22d1c4e',olympe.sc.nr);olympe.sc.logic={};olympe.sc.logic.bp=(a,b)=>a===b?0:a>b?1:-1;
870
- olympe.sc.logic.$z=(a,b,c,d,e,f,g)=>{const h=b.T();b=olympe.D.Za(b.C().T());let k,l;if(b===olympe.dc.wa(olympe.dm.String))k=c.valueOf().toLowerCase(),l=p=>p.Fb(h).toLowerCase();else if(b===olympe.dc.wa(olympe.dm.Number))k=c.valueOf(),l=p=>p.He(h);else if(b===olympe.dc.wa(olympe.dm.DateTime))k=c.getTime(),l=p=>olympe.D.Ga([p.gj(h)],q=>q.getTime(),Number,'FilterList Date&DateTime TransformFlows');else{c=olympe.dc.Pa().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.bp(q,p);else if('>'===f)n=(p,q)=>olympe.sc.logic.bp(p,q);else{g.error(`Unknown inequality ${f}. Please use '<' or '>'`);return}e(a.ug().filter(p=>olympe.D.Ga([l(p)],q=>{q=n(q.valueOf(),k);return olympe.D.Bc(d.valueOf()?1===q:0<=q)},olympe.D.ra,'FilterList ListDefBuilder Filter TransformFlows')).mf())};
872
- olympe.sc.logic.vC=(a,b)=>{if(a instanceof olympe.D.da)return a;if(a instanceof olympe.D.Xa)return a.ss();if(a instanceof olympe.D.ra)return a.Pr();if('string'===typeof a||'number'===typeof a)return olympe.D.za(Number(a));b.error(`Could not parse provided value ${a} into a number`);return olympe.D.da.Pp};olympe.sc.logic.va={};olympe.sc.logic.va.Po=class{constructor(a,b,c){this.P=olympe.dc.Ca.C(a,b,...c)}T(){return this.P.T()}};olympe.sc.logic.va.Po.ma=[olympe.dc.ze];const bj=Object.create(null),cj=new Map;function dj(a){if(void 0===bj[a])throw Error(`Tag: ${a} - does not correspond to a registered function`);return Gc(a)}function ej(a,b,c=olympe.sc.logic.Function){if(cj.has(a))throw c=dj(a),Error(`Tag: ${a} - overwriting existing function definition "${c.name}" with "${b.name}"`);const d=olympe.dc.Ca.C(a,b,...[]);cj.set(a,{P:d,HC:b,uC:c});return d}
873
- olympe.sc.logic.Ca=class{constructor(){}static C(a,b,...c){if(bj[a])throw c=dj(a),Error(`Tag: ${a} - overwriting already defined function "${c.name}" with "${b.name}"`);b=new olympe.sc.logic.va.Po(a,b,[olympe.sc.O.Ea].concat(c));return bj[a]=b}};olympe.sc.logic.Zy=class{};olympe.sc.logic.Ij=class extends olympe.dc.CloudObject{};olympe.sc.logic.Ij.P=olympe.dc.Ca.C('01621fb84e320000cf00',olympe.sc.logic.Ij);olympe.sc.logic.Error=class{constructor(a,b){this.code=a;this.Zr=b}static create(a,b){return new olympe.sc.logic.Error(b,a)}Iw(){return this.Zr}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;
874
- olympe.sc.logic.Nj=class extends olympe.sc.logic.Ij{static create(a,b){return new olympe.sc.logic.Error(b,a)}};olympe.sc.logic.Nj.P=olympe.dc.Ca.C('016eeb5ede9f3094d8f0',olympe.sc.logic.Nj);olympe.sc.logic.ne=class extends olympe.dc.CloudObject{C(){return this.ed(olympe.sc.logic.ne.C,olympe.dc.CloudObject)}};olympe.sc.logic.ne.P=olympe.dc.Ca.C('016ac4f59ee8ea2081ba',olympe.sc.logic.ne);olympe.sc.logic.ne.L=olympe.sc.logic.ne.P.Da('017bc044aeacce7ffc8f');olympe.sc.logic.ne.C=olympe.sc.logic.ne.P.Ra('016ac4f5a0091c4790e2');P(olympe.dc.CloudObject.P,olympe.sc.logic.ne.C);olympe.sc.logic.ne.prototype.C.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.Ji=class extends olympe.sc.logic.ne{};olympe.sc.logic.Ji.P=olympe.dc.Ca.C('016ac4f59c592b862457',olympe.sc.logic.Ji);olympe.sc.logic.Ji.F=olympe.sc.pe.C.Sc();olympe.sc.logic.Oh=class extends olympe.sc.logic.ne{};olympe.sc.logic.Oh.P=olympe.dc.Ca.C('016ac4f59dd99f5df3e1',olympe.sc.logic.Oh);olympe.sc.logic.Oh.F=P(olympe.sc.logic.Oh.P,olympe.sc.pe.F);olympe.sc.logic.Oe=class extends olympe.sc.lb{C(){return olympe.sc.Ye.dh.Jq}ka(){return this.$m().ug().qh([olympe.sc.logic.Function]).and().not().qh([olympe.sc.logic.Yd,olympe.sc.logic.ae]).mf()}Bw(){return this.Sl().ug().hj([olympe.dc.CloudObject.modelRel,olympe.sc.logic.Ji.F]).mf()}Cw(){return this.Zj().ug().hj([olympe.dc.CloudObject.modelRel,olympe.sc.logic.Oh.F]).mf()}Gf(a){const b=this.db.Xm(this,[olympe.sc.lb.L],c=>this.db.model(c)===olympe.dc.wa(a));return b?olympe.dc.CloudObject.get(b):null}mh(a){const b=
875
- this.db.Xm(this,[olympe.sc.lb.R],c=>this.db.model(c)===olympe.dc.wa(a));return b?olympe.dc.CloudObject.get(b):null}fx(){return this.Sl().ug().hj([olympe.dc.CloudObject.modelRel],olympe.sc.logic.Mb).mf()}gx(){return this.Zj().ug().hj([olympe.dc.CloudObject.modelRel],olympe.sc.logic.Yb).mf()}};ej('01621fb84e320000f000',olympe.sc.logic.Oe,olympe.sc.logic.Function);m=olympe.sc.logic.Oe.prototype;m.Bw.K=new olympe.D.J(()=>olympe.dc.Ba,[]);m.Cw.K=new olympe.D.J(()=>olympe.dc.Ba,[]);
876
- m.Gf.K=new olympe.D.J(()=>olympe.sc.logic.Mb,[]);m.mh.K=new olympe.D.J(()=>olympe.sc.logic.Yb,[]);m.fx.K=new olympe.D.J(()=>olympe.dc.Ba,[]);m.gx.K=new olympe.D.J(()=>olympe.dc.Ba,[]);olympe.sc.logic.ag=class extends olympe.sc.logic.Oe{F(){return this.Gf('016ac63229782039429f')}G(){return this.mh('016ac6322acf67eebfe7')}L(){return this.Zj().ug().vb(olympe.sc.logic.Kc.typeRel).Sk(olympe.sc.logic.Nj).mf().lf().mn(olympe.D.da.ZERO)}};olympe.sc.logic.ag.C='016ac63229782039429f';olympe.sc.logic.ag.qa='016ac6322acf67eebfe7';olympe.sc.logic.ag.P=ej('01621fb84e320000a000',olympe.sc.logic.ag,olympe.sc.logic.Action);
877
- olympe.sc.logic.ag.prototype.F.K=new olympe.D.J(()=>olympe.sc.logic.Mb,[]);olympe.sc.logic.ag.prototype.G.K=new olympe.D.J(()=>olympe.sc.logic.Yb,[]);olympe.sc.logic.ag.prototype.L.K=olympe.D.J.R;olympe.sc.logic.lo=class extends olympe.sc.logic.Oe{};olympe.sc.logic.lo.P=ej('01621fb84e320000f011',olympe.sc.logic.lo);olympe.sc.logic.ko=class extends olympe.sc.logic.ag{};olympe.sc.logic.ko.P=ej('01621fb84e320000f012',olympe.sc.logic.ko);olympe.sc.logic.Function=class extends olympe.sc.Runnable{L(){return[this.cc]}Y(){const a=olympe.sc.Va.hc.xt,b=olympe.sc.Va.hc.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.Xk(b,olympe.sc.logic.Kc.typeRel,olympe.sc.logic.Ij)?a.li.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=>
878
- c.includes(null)?null:c)):rxjs.of([])}};olympe.sc.logic.Function.P=olympe.dc.Ca.C('0168c6f020f2a96f0000',olympe.sc.logic.Function,olympe.sc.O.Ea);olympe.sc.logic.Kc=class extends olympe.dc.CloudObject{C(){return this.ed(olympe.sc.logic.Kc.typeRel,olympe.dc.CloudObject)}F(){return this.He(olympe.sc.logic.Kc.C)}};olympe.sc.logic.Kc.P=olympe.dc.Ca.C('0168a431d25001540000',olympe.sc.logic.Kc);olympe.sc.logic.Kc.C=olympe.sc.logic.Kc.P.Da('01740c5d4ae4b520dd01');olympe.sc.logic.Kc.typeRel=olympe.sc.logic.Kc.P.Ra('0168a431d3b9b7438424');P(olympe.dc.CloudObject.P,olympe.sc.logic.Kc.typeRel);
879
- olympe.sc.logic.Kc.prototype.C.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.Kc.prototype.F.K=olympe.D.J.G;olympe.sc.logic.Mb=class extends olympe.sc.logic.Kc{};olympe.sc.logic.Mb.P=olympe.dc.Ca.C('0168a431d25001540001',olympe.sc.logic.Mb);olympe.sc.logic.Mb.qa=olympe.sc.logic.Kc.P.Da('01740c5d4ae4b520dd02');olympe.sc.logic.Mb.ka=P(olympe.sc.logic.Mb.P,olympe.sc.lb.L);olympe.sc.logic.Mb.F=olympe.sc.logic.Mb.P.Ra('0168a431d91f2578000b',olympe.dc.Aa.ORIGIN);olympe.sc.logic.Mb.L=olympe.sc.logic.Mb.P.Ra('01621fb84e32000000a1',olympe.dc.Aa.ORIGIN);
880
- olympe.sc.logic.Mb.R=olympe.sc.logic.Mb.P.Ra('01621fb84e32000000d1',olympe.dc.Aa.ORIGIN);olympe.sc.logic.Yb=class extends olympe.sc.logic.Kc{};olympe.sc.logic.Yb.P=olympe.dc.Ca.C('0168a431d25001540002',olympe.sc.logic.Yb);olympe.sc.logic.Yb.ka=P(olympe.sc.logic.Yb.P,olympe.sc.lb.R);olympe.sc.logic.Yb.F=olympe.sc.logic.Yb.P.Ra('0168a431d91f25780003',olympe.dc.Aa.ORIGIN);olympe.sc.logic.Yb.R=olympe.sc.logic.Yb.P.Ra('01621fb84e32000000a2',olympe.dc.Aa.ORIGIN);olympe.sc.logic.Yb.L=olympe.sc.logic.Yb.P.Ra('01621fb84e32000000d2',olympe.dc.Aa.ORIGIN);olympe.sc.logic.Action=class extends olympe.sc.logic.Function{setupExecution(a){const b=this.Rd().F().T();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.Ca.C('0168c6f020f2a96a0000',olympe.sc.logic.Action,olympe.sc.O.Ea);olympe.sc.logic.Yd=class extends olympe.sc.logic.Function{run(a){Ti(this,a);const b=a.getParent(),c=this.db.oc(this,olympe.sc.logic.Yd.F),d=this.db.oc(this,olympe.sc.logic.Yd.L);a.on(c,e=>b.set(d,e),this.tag)}R(){return this.ed(olympe.sc.logic.Yd.F,olympe.sc.logic.Mb)}$a(){return this.ed(olympe.sc.logic.Yd.L,olympe.sc.logic.Yb)}};olympe.sc.logic.Yd.P=olympe.dc.Ca.C('01621fb84e32000000a0',olympe.sc.logic.Yd,olympe.sc.O.Ea);olympe.sc.logic.Yd.F=P(olympe.sc.logic.Yd.P,olympe.sc.logic.Mb.L);
881
- olympe.sc.logic.Yd.L=P(olympe.sc.logic.Yd.P,olympe.sc.logic.Yb.R);olympe.sc.logic.Yd.prototype.R.K=new olympe.D.J(()=>olympe.sc.logic.Mb,[]);olympe.sc.logic.Yd.prototype.$a.K=new olympe.D.J(()=>olympe.sc.logic.Yb,[]);olympe.sc.logic.ae=class extends olympe.sc.logic.Function{run(a){const b=a.getParent(),c=this.db.oc(this,olympe.sc.logic.ae.L),d=this.db.oc(this,olympe.sc.logic.ae.F);b.on(c,e=>a.set(d,e),b.Z())}$a(){return this.ed(olympe.sc.logic.ae.L,olympe.sc.logic.Mb)}R(){return this.ed(olympe.sc.logic.ae.F,olympe.sc.logic.Yb)}};olympe.sc.logic.ae.P=olympe.dc.Ca.C('01621fb84e32000000d0',olympe.sc.logic.ae,olympe.sc.O.Ea);olympe.sc.logic.ae.L=P(olympe.sc.logic.ae.P,olympe.sc.logic.Mb.R);
882
- olympe.sc.logic.ae.F=P(olympe.sc.logic.ae.P,olympe.sc.logic.Yb.L);olympe.sc.logic.ae.prototype.$a.K=new olympe.D.J(()=>olympe.sc.logic.Mb,[]);olympe.sc.logic.ae.prototype.R.K=new olympe.D.J(()=>olympe.sc.logic.Yb,[]);function Yi(a,b,c){const d=a.db.oc(a,olympe.sc.logic.xb.qa)||a.db.oc(a,olympe.sc.logic.xb.R),e=a.db.oc(a,olympe.sc.logic.xb.ka),f=a.db.Rf((()=>{let k=null,l=a.db.oc(a,olympe.sc.logic.xb.F);l?k=a.db.oc(l,olympe.dm.Property.typeRel):(l=a.db.oc(a,olympe.sc.logic.xb.C))&&(k=a.db.oc(l,olympe.sc.logic.Kc.typeRel));return k||olympe.dc.CloudObject.P.T()})(),olympe.dm.qf)?new olympe.D.Zb('Pipe Context'):null,g=a.F.bind(a,b,c,f);if(null!==d&&null!==e){let k;const l=b.oj(e,n=>{k&&k();k=n.on(d,g,e)});return()=>
883
- {g(null);l();k&&k()}}const h=xd(a.db,a,olympe.sc.logic.xb.valueProp,g);return()=>{g(null);a.db.F(a,olympe.sc.logic.xb.valueProp,h)}}
884
- olympe.sc.logic.xb=class extends olympe.dc.CloudObject{constructor(a,b,c){super(a,b);this.N=c;this.C=`detachObject${this.tag}`}F(a,b,c,d){null!==c&&c.ea();const e=a.get(this.C);e&&(e(),a.remove(this.C));const f=olympe.sc.hh(d);if(f instanceof olympe.dc.CloudObject){if(d=f.T(),this.Ik(a,d,[d]),null!==c&&'function'===typeof f.getValue){c.run(()=>{olympe.D.yc([f.getValue()],g=>{b(g.valueOf())})});return}}else f instanceof olympe.dc.Wa&&this.Ik(a,`qr-${f.hash}`,Ae(f));b(f)}Ik(a,b,c){const d=a.getParent();
885
- d.Ik(b,c);a.set(this.C,()=>Ii(d,b))}getValue(a){return this.Lf(olympe.sc.logic.xb.valueProp,a||olympe.dc.W.Vb.hh,Object)}Rt(){const a=this.transform(olympe.sc.logic.xb.C,olympe.sc.logic.Kc.typeRel);a.Jd(olympe.dc.CloudObject);return a.Rc()}dx(){return this.ed(olympe.sc.logic.xb.ka,olympe.dc.CloudObject)}bx(){return this.ed(olympe.sc.logic.xb.qa,olympe.sc.logic.Yb)}cx(){return this.ed(olympe.sc.logic.xb.R,olympe.dm.Property)}tw(){return this.ed(olympe.sc.logic.xb.L,olympe.dc.CloudObject)}rw(){return this.ed(olympe.sc.logic.xb.C,
886
- olympe.sc.logic.Mb)}sw(){return this.ed(olympe.sc.logic.xb.F,olympe.dm.Property)}};olympe.sc.logic.xb.P=olympe.dc.Ca.C('0168a431d91f25780000',olympe.sc.logic.xb,olympe.sc.O.Ea);olympe.sc.logic.xb.valueProp=olympe.sc.logic.xb.P.Da('0168a431d91f25780001');olympe.sc.logic.xb.ka=olympe.sc.logic.xb.P.Ra('0168a431d91f25780002');olympe.sc.logic.xb.qa=P(olympe.sc.logic.xb.P,olympe.sc.logic.Yb.F);olympe.sc.logic.xb.R=olympe.sc.logic.xb.P.Ra('0168a431d91f25780004');olympe.sc.logic.xb.L=olympe.sc.logic.xb.P.Ra('0168a431d91f2578000a');
887
- olympe.sc.logic.xb.C=P(olympe.sc.logic.xb.P,olympe.sc.logic.Mb.F);olympe.sc.logic.xb.F=olympe.sc.logic.xb.P.Ra('0168a431d91f2578000c');P(olympe.dc.CloudObject.P,olympe.sc.logic.xb.ka);P(olympe.dm.Property.P,olympe.sc.logic.xb.R);P(olympe.dc.CloudObject.P,olympe.sc.logic.xb.L);P(olympe.dm.Property.P,olympe.sc.logic.xb.F);m=olympe.sc.logic.xb.prototype;m.Rt.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.dx.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);
888
- m.bx.K=new olympe.D.J(()=>olympe.sc.logic.Yb,[]);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.Mb,[]);m.sw.K=new olympe.D.J(()=>olympe.dm.Property,[]);olympe.sc.logic.$d=class extends olympe.sc.logic.Function{};olympe.sc.logic.$d.P=olympe.dc.Ca.C('017dc8c114aa61a0e27f',olympe.sc.logic.$d);olympe.sc.logic.$d.F=olympe.sc.logic.$d.P.Ra('017dc8d6d8ef9135f08a');olympe.sc.logic.$d.L=olympe.sc.logic.$d.P.Ra('017dc8d6d8ef9135f08b');P(olympe.dm.Ob.P,olympe.sc.logic.$d.L);function fj(a,b){const c=a.Rd(),d=c.Tl().T(),e=c.Ul().T(),f=c.bn().T();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.ya.pb.Bb.get(a.Wb(),g).then(h=>{h=gj(h,a.R.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.Nj.create(h.toString(),1))}))},b.Z())}
889
- function hj(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.Ke(q).finally(()=>b.destroy())}catch(p){n=Error(`Error while serializing the response from remote action ${a.Wb()}: ${p.message}`),f.wg(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.$a=d;this.timeout=e}run(a){a.nn()||(this.db.gb(this,olympe.sc.logic.Ph.F)?this.lc(a):(Ti(this,a),fj(this,a)))}lc(a){const b=this.Wb(),c=this.Rd(),d=c.Ur().T(),e=c.Tl().T(),f=c.Ul().T(),g=c.bn().T();(new olympe.H.ya.pb.Bb(b,a)).listen().subscribe(rxjs.Subscriber.create(h=>{const k=a.Yh('remote call'),l=gj(h.body(),this.R.bind(this,k)),n=Ib(()=>{h.wg(Error(`Timeout reached on remote action ${this.db.name(this)} (${this.tag})`));
891
- k.destroy()},this.timeout);hj(this,k,f,g,n,h);super.run(k);for(const [p,q]of l)p!==e&&k.set(p,q);h.yj().then(p=>{var q=k.get(d);null!==q&&olympe.dc.wa(q)!==p&&(q=this.Wb(),this.N.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.Wb();this.N.error(`Error while listening on remote action ${this.db.name(k)} (${k}): ${h.message}`)}))}R(a,b){const c=Array.from(b.ge()).map(d=>d.tag());
892
- Kc(this.$a,a.Fc(),b,[],c)}};olympe.sc.logic.Ph.P=olympe.dc.Ca.C('017a7b0c5dcbd8964c5d',olympe.sc.logic.Ph,olympe.sc.O.Ea,olympe.dc.db.O.xa,new olympe.U.fa(olympe.sc.Config.zq));olympe.sc.logic.Ph.F=olympe.sc.logic.Ph.P.Da('017a7b0c62a02a89444f');function gj(a,b){var c=(new olympe.dc.W.Hi(olympe.dc.Ka.Xc)).C(a.p||[]);b&&b(c);c=new Map;for(const [d,e]of Object.entries(a.v||{}))c.set(d,ij(olympe.sc.logic.qk,e,b));return c}function jj(a){a.Gc=new olympe.dc.db.zc;a.values=Object.create(null)}
893
- function ij(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 ue(b.v);case 6:return De(b.v,c);case 7:return new Map(Object.entries(b.m).map(([d,e])=>[d,ij(a,e,c)]));default:return Array.isArray(b)?b.map(d=>ij(a,d,c)):'object'===typeof b?Object.entries(b).reduce((d,[e,f])=>{d[e]=ij(a,f,c);return d},{}):b}}
894
- function kj(a,b){var c=a.db;a=a.Gc;if(c.Gb(b)){a.F(b,c.vd(b,!0),0);a.Oa(olympe.dc.jc.Wc,b,c.model(b),0);for(const [d,e,f]of Ad(c,b))(c=a.If(f))&&c.te()&&(e===olympe.dc.Aa.DESTINATION?a.Oa(d,b,f,0):a.Oa(d,f,b,0))}else olympe.sa.Ya('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.Pa();jj(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.Md;this.Gc.$c(b);a.p=be(b);a.v=this.values;jj(this);return a}C(a){switch(!0){case a instanceof olympe.D.kb: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.Nf().valueOf(),g:a.Hf().valueOf(),b:a.Cf().valueOf(),a:a.Bf().valueOf()};case a instanceof olympe.sc.logic.Error:return{t:3,c:a.code,m:a.Zr};case a&&'function'===typeof a.T:return a=a.T(),kj(this,a),{t:4,v:a};case a instanceof olympe.dc.hb:return{t:5,v:a.ia()};case a instanceof olympe.dc.Wa: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.Pa();this.typeRel=a}};olympe.sc.logic.controllers.Nl.C={$y:-1,Vz:1};olympe.sc.logic.controllers.yA=class extends olympe.sc.logic.controllers.Nl{constructor(){super(olympe.sc.logic.ne.C)}};olympe.sc.logic.controllers.AA=class extends olympe.sc.logic.controllers.Nl{constructor(){super(olympe.sc.logic.Kc.typeRel)}};olympe.sc.logic.Mk={};olympe.sc.logic.Mk.Vu=class extends olympe.sc.logic.Function{update(a,[b,c],[d]){const e=olympe.dc.wa(b);e?cf(Xe(new olympe.dc.hf(e),olympe.dc.Ub.rf),c).ib(()=>{d(olympe.dc.CloudObject.get(e))}):this.N.warn('Cannot subscribe to an instance with no tag: '+e)}};olympe.sc.logic.Ca.C('0174bf4b7e006e4b788a',olympe.sc.logic.Mk.Vu);olympe.sc.logic.actions={};olympe.sc.logic.Mk.bu=class extends olympe.sc.logic.Function{run(a){Ti(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.N.warn('No list to iter upon'),this.N.info(a.Z())):f<e?(b(g.We(f)),f++,c((new Date).getTime())):(h.jl(),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.yg();f=0;h.Gk();k();break;case 2:k();break;default:this.N.error('Unhandled input')}},this.tag))}};
898
- olympe.sc.logic.Ca.C('0171889b060b6cd54300',olympe.sc.logic.Mk.bu);olympe.sc.logic.ec={};olympe.sc.logic.ec.po=class extends olympe.sc.logic.Oe{F(){return this.Gf('017dc92292107fb98b21')}};ej('017dc8d6c8fd8c8bd2f0',olympe.sc.logic.ec.po);olympe.sc.logic.ec.po.prototype.F.K=new olympe.D.J(()=>olympe.sc.logic.Mb,[]);olympe.sc.logic.ec.Pl=class extends olympe.sc.logic.Oe{F(){return this.Gf('016ac63808535703691c')}};olympe.sc.logic.ec.Pl.P=ej('0169b6876a03f139d50a',olympe.sc.logic.ec.Pl);olympe.sc.logic.ec.Pl.prototype.F.K=new olympe.D.J(()=>olympe.sc.logic.Mb,[]);olympe.sc.logic.ec.cm=class extends olympe.sc.logic.Oe{F(){return this.Gf('016ac63809a9a8e6db96')}G(){return this.mh('016ac6380ab003363b3e')}};ej('01646ad602f933b8caaf',olympe.sc.logic.ec.cm);olympe.sc.logic.ec.cm.prototype.F.K=new olympe.D.J(()=>olympe.sc.logic.Mb,[]);olympe.sc.logic.ec.cm.prototype.G.K=new olympe.D.J(()=>olympe.sc.logic.Yb,[]);olympe.sc.logic.ec.hk=class extends olympe.sc.logic.Oe{F(){return this.Gf('016ac6380bd98f1d91a0')}L(){return this.mh('016ac63c589ae38ca3ae')}G(){return this.mh('016ac63c5a377fceabaa')}};ej('0168ec42fc01747a98b6',olympe.sc.logic.ec.hk);olympe.sc.logic.ec.hk.prototype.F.K=new olympe.D.J(()=>olympe.sc.logic.Mb,[]);olympe.sc.logic.ec.hk.prototype.L.K=new olympe.D.J(()=>olympe.sc.logic.Yb,[]);olympe.sc.logic.ec.hk.prototype.G.K=new olympe.D.J(()=>olympe.sc.logic.Yb,[]);olympe.sc.logic.ec.Xg=class extends olympe.sc.logic.Oe{Tl(){return this.Gf('017a7b07b09e3b22c8b4')}Ur(){return this.Gf('017a7b07ba05807a74b0')}Ul(){return this.mh('017a7b0818c12388d731')}bn(){return this.mh('017a7b085146d5e69aec')}St(){return olympe.D.ra.F}};olympe.sc.logic.ec.Xg.qa='017a7b07b09e3b22c8b4';olympe.sc.logic.ec.Xg.Lc='017a7b07ba05807a74b0';olympe.sc.logic.ec.Xg.lc='017a7b0818c12388d731';olympe.sc.logic.ec.Xg.C='017a7b085146d5e69aec';
899
- olympe.sc.logic.ec.Xg.P=ej('017a7b07a948e30508fa',olympe.sc.logic.ec.Xg,olympe.sc.logic.Ph);m=olympe.sc.logic.ec.Xg.prototype;m.Tl.K=new olympe.D.J(()=>olympe.sc.logic.Mb,[]);m.Ur.K=new olympe.D.J(()=>olympe.sc.logic.Mb,[]);m.Ul.K=new olympe.D.J(()=>olympe.sc.logic.Yb,[]);m.bn.K=new olympe.D.J(()=>olympe.sc.logic.Yb,[]);m.St.K=olympe.D.J.R;olympe.sc.logic.ec.Tq=class extends olympe.sc.logic.Oe{F(){return this.Gf('016ac63c5b3ed0562740')}};ej('016a9766c230916ea5ec',olympe.sc.logic.ec.Tq);olympe.sc.logic.ec.Tq.prototype.F.K=new olympe.D.J(()=>olympe.sc.logic.Mb,[]);olympe.sc.query={};olympe.sc.query.Pn=class extends olympe.sc.Vg{};olympe.sc.query.Pn.P=olympe.dc.Ca.C('01631aacd8276ea98491',olympe.sc.query.Pn);olympe.sc.query.fq=class extends olympe.dm.Enum{};olympe.sc.query.fq.P=olympe.dc.Ca.C('01631aacd8276ea98495',olympe.sc.query.fq);olympe.sc.query.qq=class extends olympe.dm.Enum{};olympe.sc.query.qq.P=olympe.dc.Ca.C('01631aacd8276ea98494',olympe.sc.query.qq);olympe.sc.query.sq=class extends olympe.sc.Vg{};olympe.sc.query.sq.P=olympe.dc.Ca.C('01631aacd8276ea98492',olympe.sc.query.sq);olympe.sc.query.tq=class extends olympe.dc.CloudObject{};olympe.sc.query.tq.P=olympe.dc.Ca.C('01631aacd8276ea98493',olympe.sc.query.tq);olympe.sc.La={};olympe.sc.La.Me=class extends olympe.sc.lb{C(){return olympe.sc.Ye.dh.Lu}};olympe.sc.La.Me.P=Jc(olympe.dc.Ca.C('01120300000000adef00',olympe.sc.La.Me));olympe.sc.La.Me.C=olympe.sc.La.Me.P.Ra('0171bc1f15da96dfdb89');P(olympe.dm.od.P,olympe.sc.La.Me.C);olympe.sc.La.Cj=class extends olympe.sc.Runnable{ea(){return[this.Wb()]}R(){return olympe.dc.nd.from(this.Wb()).vb(olympe.sc.La.Me.C).ud()}};olympe.sc.La.Cj.P=Jc(olympe.dc.Ca.C('0113030000000aca1100',olympe.sc.La.Cj));olympe.sc.La.Cj.prototype.R.K=new olympe.D.J(()=>olympe.dm.Ob,[]);olympe.sc.La.ub=class extends olympe.dc.CloudObject{Ut(){return this.nh(olympe.sc.La.ub.F)}Gx(){return this.nh(olympe.sc.La.ub.Ab)}Td(){return this.He(olympe.sc.La.ub.C)}vw(){return this.Fb(olympe.sc.La.ub.ka)}Tw(){return this.Fb(olympe.sc.La.ub.$a)}Sw(){return this.Fb(olympe.sc.La.ub.Ta)}Ym(){this.Fb(olympe.sc.La.ub.cb)}Hw(){return this.Fb(olympe.sc.La.ub.qa)}iw(){return this.Fb(olympe.sc.La.ub.L)}Rw(){return this.Fb(olympe.sc.La.ub.Fa)}Tt(){return this.Fb(olympe.sc.La.ub.R)}};
900
- olympe.sc.La.ub.P=olympe.dc.Ca.C('011203300000000adef5',olympe.sc.La.ub);olympe.sc.La.ub.F=olympe.sc.La.ub.P.Da('011203300000000adef6');olympe.sc.La.ub.Ab=olympe.sc.La.ub.P.Da('011203300000000adef7');olympe.sc.La.ub.C=olympe.sc.La.ub.P.Da('011203300000000adef8');olympe.sc.La.ub.ka=olympe.sc.La.ub.P.Da('011203300000000adef9');olympe.sc.La.ub.$a=olympe.sc.La.ub.P.Da('011203300000000adefa');olympe.sc.La.ub.Ta=olympe.sc.La.ub.P.Da('011203300000000adefb');olympe.sc.La.ub.L=olympe.sc.La.ub.P.Da('011203300000000adefc');
901
- olympe.sc.La.ub.cb=olympe.sc.La.ub.P.Da('011203300000000adefd');olympe.sc.La.ub.qa=olympe.sc.La.ub.P.Da('011203300000000adefe');olympe.sc.La.ub.Fa=olympe.sc.La.ub.P.Da('011203300000000adeff');olympe.sc.La.ub.R=olympe.sc.La.ub.P.Da('011203300000000adee0');olympe.sc.La.ub.Pb={INIT:0,Ry:1,Mi:2,um:3,rk:4,WA:5,tc:9};m=olympe.sc.La.ub.prototype;m.Ut.K=olympe.D.J.R;m.Gx.K=olympe.D.J.R;m.Td.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.Ym.K=olympe.D.J.F;m.Hw.K=olympe.D.J.F;
902
- m.iw.K=olympe.D.J.F;m.Rw.K=olympe.D.J.F;m.Tt.K=olympe.D.J.F;olympe.sc.La.hp=class extends olympe.sc.La.Cj{Ta(){return!0}};olympe.sc.La.hp.P=olympe.dc.Ca.C('0113032000000aca1102',olympe.sc.La.hp,olympe.sc.O.Ea);olympe.sc.La.Zg=class extends olympe.sc.La.Me{F(){return(new olympe.dc.bk(this.T(),olympe.sc.La.ub)).vb(olympe.sc.La.Zg.qa).mf().Rc()}};olympe.sc.La.Zg.P=olympe.dc.Ca.C('011203300000000adef3',olympe.sc.La.Zg);olympe.sc.La.Zg.qa=olympe.sc.La.Zg.P.Ra('011203300000000adef4');P(olympe.sc.La.ub.P,olympe.sc.La.Zg.qa);olympe.sc.La.Zg.prototype.F.K=new olympe.D.J(()=>olympe.sc.La.ub,[]);olympe.sc.ah=class extends olympe.dc.CloudObject{static get(){return olympe.dc.CloudObject.get('011203300000000adf0f')}};olympe.sc.ah.P=olympe.dc.Ca.C('011203300000000adf00',olympe.sc.ah);olympe.sc.ah.F=olympe.sc.ah.P.Da('011203300000000adf01');olympe.sc.ah.C=olympe.sc.ah.P.Da('011203300000000adf02');olympe.sc.ah.L='011203300000000adf0f';olympe.sc.Yy=class{};olympe.sc.eb=class{constructor(a){this.wb=a}Z(){return this.wb.Z()}hn(){return this.wb.hn()}getParent(){return this.wb.getParent()}Nk(){return this.wb.Nk()}Fc(){return this.wb.Fc()}rn(a){this.wb.rn(a)}Gk(){this.wb.Gk()}jl(){this.wb.jl()}set(a,b){this.wb.set(a,b);return this}li(a){this.wb.li(a);return this}remove(a){this.wb.remove(a)}Eb(a,b,c=!1){return this.wb.Eb(a,b,c)}get(a,b=!1){return this.wb.get(a,b)}has(a,b=!1){return this.wb.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());this.Hg(()=>{f();d.complete()});return f})}repeat(a,b){this.wb.repeat(a,b);return this}el(a){return this.wb.el(a)}Fn(a,b=!0,c=!1){return rxjs.firstValueFrom(this.observe(a,b,c))}hl(a){this.wb.hl(a);return this}Za(a,b=!0){return this.wb.Za(a,b)}on(a,b,c){return this.wb.on(a,b,c)}Yh(a){return this.wb.Yh(a)}Qk(a,b){return this.wb.Qk(a,b)}oj(a,b){return this.wb.oj(a,b)}fi(a){return this.wb.fi(a)}kj(){return this.wb.kj()}Hg(a,
904
- b){return this.wb.Hg(a,b)}cl(a){this.wb.cl(a)}onDestroy(a){return this.wb.onDestroy(a)}Ie(a){this.wb.Ie(a)}destroy(){this.wb.destroy()}clear(){this.wb.clear()}zb(){return this.wb.zb()}nn(){return this.wb.nn()}Wk(){return this.wb.Wk()}gb(a){if('function'!==typeof this.wb.getProperty)throw Error('Trying to call deprecated method $.getProperty() in a non-UI brick');return this.wb.getProperty(a)}ww(a){if('function'!==typeof this.wb.getEvent)throw Error('Trying to call deprecated method $.getEvent() in a non-UI brick');
905
- return this.wb.getEvent(a)}Px(...a){if('function'!==typeof this.wb.observeMany)throw Error('Trying to call deprecated method $.observeMany() in a non-UI brick');return this.wb.observeMany(a)}};olympe.sc.eb.prototype.observeMany=olympe.sc.eb.prototype.Px;olympe.sc.eb.prototype.getEvent=olympe.sc.eb.prototype.ww;olympe.sc.eb.prototype.getProperty=olympe.sc.eb.prototype.gb;olympe.sc.eb.prototype.clear=olympe.sc.eb.prototype.clear;olympe.sc.eb.prototype.destroy=olympe.sc.eb.prototype.destroy;
906
- olympe.sc.eb.prototype.offDestroy=olympe.sc.eb.prototype.Ie;olympe.sc.eb.prototype.onDestroy=olympe.sc.eb.prototype.onDestroy;olympe.sc.eb.prototype.offClear=olympe.sc.eb.prototype.cl;olympe.sc.eb.prototype.onClear=olympe.sc.eb.prototype.Hg;olympe.sc.eb.prototype.getOtherContext=olympe.sc.eb.prototype.fi;olympe.sc.eb.prototype.onContext=olympe.sc.eb.prototype.oj;olympe.sc.eb.prototype.createChild=olympe.sc.eb.prototype.Yh;olympe.sc.eb.prototype.setParentElement=olympe.sc.eb.prototype.hl;
907
- olympe.sc.eb.prototype.waitFor=olympe.sc.eb.prototype.Fn;olympe.sc.eb.prototype.runner=olympe.sc.eb.prototype.el;olympe.sc.eb.prototype.repeat=olympe.sc.eb.prototype.repeat;olympe.sc.eb.prototype.observe=olympe.sc.eb.prototype.observe;olympe.sc.eb.prototype.has=olympe.sc.eb.prototype.has;olympe.sc.eb.prototype.get=olympe.sc.eb.prototype.get;olympe.sc.eb.prototype.remove=olympe.sc.eb.prototype.remove;olympe.sc.eb.prototype.trigger=olympe.sc.eb.prototype.li;olympe.sc.eb.prototype.set=olympe.sc.eb.prototype.set;
908
- olympe.sc.eb.prototype.getParent=olympe.sc.eb.prototype.getParent;olympe.sc.Kj=class extends olympe.dm.BrickMetadata{C(){return olympe.sc.Ye.dh.xl}};olympe.sc.Kj.P=olympe.dc.Ca.C('01645fe6873aeea59e64',olympe.sc.Kj);olympe.sc.Kj.C=olympe.sc.Kj.P.Ra('017ed8ac775f48d4d589');olympe.sc.we=class extends olympe.sc.Runnable{$a(){return this.tb(olympe.sc.we.L,olympe.sc.Runnable)}R(){return this.tb(olympe.sc.we.F,olympe.dm.Property)}};olympe.sc.we.P=Jc(olympe.dc.Ca.C('016c2d996d9ca27fa9d8',olympe.sc.we));olympe.sc.we.L=olympe.sc.we.P.Ra('016c3cb7742ec9309e0b');olympe.sc.we.F=olympe.sc.we.P.Ra('016c42d3454636f90533');olympe.sc.we.prototype.$a.K=new olympe.D.J(()=>olympe.dc.Ba,[]);olympe.sc.we.prototype.R.K=new olympe.D.J(()=>olympe.dc.Ba,[]);olympe.sc.Go=class extends olympe.dm.Rb{C(){return olympe.sc.Ye.dh.xl}};olympe.sc.Go.P=olympe.dc.Ca.C('017a7a9ff057958e5678',olympe.sc.Go);olympe.sc.Np=class extends olympe.dm.Rb{C(){return olympe.sc.Ye.dh.dv}};olympe.sc.Np.P=olympe.dc.Ca.C('01644b6d4543b344b857',olympe.sc.Np);olympe.sc.Op=class extends olympe.dc.CloudObject{};olympe.sc.Op.P=olympe.dc.Ca.C('0162f672366be5ca7a86',olympe.sc.Op);olympe.sc.Uq=class extends olympe.sc.we{};olympe.sc.Uq.P=olympe.dc.Ca.C('016d3f37610ae4fc3962',olympe.sc.Uq);olympe.sc.Text=class extends olympe.dm.String{};olympe.sc.Text.P=olympe.dc.Ca.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.Ka.rc}static from(a){const b=olympe.sc.Va.jg.TRANSACTION;return a.has(b,!0)?a.get(b,!0):new olympe.sc.Transaction}static process(a,b){return a.has(olympe.sc.Va.jg.TRANSACTION,!0)?Promise.resolve(!1):b.ib().then(()=>!0)}Z(){return this.C.Z()}create(a,b=new Map,c=this.source,d){d=this.C.create(a,d).ki(c);this.F.set(d.T(),olympe.dc.wa(a));for(const [e,f]of b)d.setProperty(e,
909
- f);c===olympe.dc.Ka.Xc&&(b=olympe.dc.Pa(),b=null!==$i?b.fj($i,[olympe.sc.La.Me.C,olympe.sc.ld.F.Sc()])[0]||null:null,null!==b?this.Oa(olympe.sc.ld.L,b,d):olympe.sa.Ya('sc').warn('No business container for new instance of',olympe.dc.wa(a)));return d.T()}update(a,b,c){this.C.update(a,b,c);return this}Ex(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}Oa(a,b,c){this.C.Oa(a,b,c);return this}Jb(a,b,c){this.C.Jb(a,b,c);return this}Rm(a,b){this.C.Rm(a,
910
- b);return this}persist(a=!0){this.C.persist(a);return this}qj(a,b=!0){this.C.qj(a,b);return this}ki(a){this.source=a;return this}model(a){return this.F.get(olympe.dc.wa(a))||olympe.dc.Pa().model(a)}un(a){de(this.C,a.C);return this}Hm(a){this.C.Hm(a);return this}ib(){return new Promise((a,b)=>{this.C.ib((c,d)=>{c?a():b(d)})})}Um(){return new Promise((a,b)=>{this.C.Um((c,d)=>{c?a():b(d)})})}};olympe.sc.Transaction.prototype.executeAsLarge=olympe.sc.Transaction.prototype.Um;
911
- olympe.sc.Transaction.prototype.execute=olympe.sc.Transaction.prototype.ib;olympe.sc.Transaction.prototype.afterExecution=olympe.sc.Transaction.prototype.Hm;olympe.sc.Transaction.prototype.merge=olympe.sc.Transaction.prototype.un;olympe.sc.Transaction.prototype.model=olympe.sc.Transaction.prototype.model;olympe.sc.Transaction.prototype.setSource=olympe.sc.Transaction.prototype.ki;olympe.sc.Transaction.prototype.persistInstance=olympe.sc.Transaction.prototype.qj;
912
- olympe.sc.Transaction.prototype.persist=olympe.sc.Transaction.prototype.persist;olympe.sc.Transaction.prototype.deleteAllRelations=olympe.sc.Transaction.prototype.Rm;olympe.sc.Transaction.prototype.deleteRelation=olympe.sc.Transaction.prototype.Jb;olympe.sc.Transaction.prototype.createRelation=olympe.sc.Transaction.prototype.Oa;olympe.sc.Transaction.prototype['delete']=olympe.sc.Transaction.prototype.delete;olympe.sc.Transaction.prototype.multiUpdate=olympe.sc.Transaction.prototype.Ex;
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.Ye.BrickMetadata=olympe.dm.BrickMetadata;olympe.sc.Ye.xe=olympe.dm.xe;olympe.ha.node.pa={};const Z={client:'client',hostname:'host',port:'port',user:'user',password:'password',Ja:'database',schema:'schema',cs:'pollingFrequency',Ev:'burstTransactionInterval'},lj=olympe.dc.ga.ja.mm,mj=olympe.dc.ga.ja.om,nj=olympe.dc.ga.ja.QUERY_RESULT,oj=olympe.dc.ga.ja.nm,pj=olympe.dc.ga.ja.nf,qj=olympe.dc.ga.ja.Sh,rj=olympe.dc.ga.ja.Ah,sj=olympe.dc.ga.ja.ti,tj=olympe.dc.ga.ja.Og,uj=olympe.dc.ga.ja.bh,vj=olympe.dc.ga.ja.Fj,wj=olympe.dc.ga.ja.yu;
914
- function xj(a,b,c,d,e){const f=new olympe.H.ya.pb.Bb(a.tag,b),g=new olympe.sc.W.kt(a.N,a.Lc,a.$a);g.start(a.tag).catch(h=>a.N.error(`Error occurred while starting the file service of SQLConnector ${e}: ${h}`));f.listen().subscribe(h=>{var k=h.body();a.N.debug(`Serving a new message : ${k.t}`);switch(k.t){case lj:var l=c.queryBuilder().withSchema(d);k=ue(k.q);a.R(b,l,k,(t,u)=>{(u?h.wg(Error(u)):h.Ke({t:nj,r:t})).then()});break;case mj:k=ue(k.q);yj(a,b,()=>c.queryBuilder().withSchema(d),k,h);break;
915
- case wj:zj(b,k.i,h.source());h.Hk().then();break;case uj:k=(new olympe.dc.W.Hi(a.Wb())).C(k.p);Aj(a,b,c,d,k,t=>(t?h.wg(Error(t)):h.Hk()).then());break;case tj:l=k.i;k=(new olympe.dc.W.Hi(a.Wb())).C(k.p);Bj(a,b,l,k,c,d);break;case pj:const n=b.get('_subscription_cache');k=k.s.reduce((t,u)=>{n.has(u)?Cj(n.get(u),h.source()):t.push(u);return t},[]);(0<k.length?h.wg(Error(`These subscriptions was not kept alive: ${k}`)):h.Hk()).then();break;case qj:const p=k.f;a.N.debug(`Uploading a file: ${p}`);k=Pi(g,
916
- (t,u,v)=>{a.N.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?Dj(a,b,c,d,p,v).then(()=>new olympe.la.Sg('',olympe.la.fb.qd.vl)):Promise.reject(`Try to upload content for file ${p} but body is not a Uint8Array or a string`)});h.Ke(k).then();break;case rj:const q=k.f;a.N.debug(`Serving a file: ${q}`);k=Pi(g,(t,u)=>{a.N.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'):Ej(b,c.queryBuilder().withSchema(d),q).then(v=>{a.N.debug('File service download request, content is:',v);return new olympe.la.Sg(v,olympe.la.fb.qd.Kh)})});h.Ke(k).then();break;case sj:const r=k.f;a.N.debug(`Deleting a file: ${r}`);k=Pi(g,(t,u)=>r!==u?Promise.reject('The file to download is not the same as the one initially requested'):Promise.resolve(new olympe.la.Sg('',olympe.la.fb.qd.Kh)));h.Ke(k).then();
918
- break;default:h.wg(Error(`Unsupported message type: ${k.t}`)).then()}})}function yj(a,b,c,d,e){const f=d.Z(),g=`sub${f}`;e.$r(g).then(()=>{const h=b.get('_subscription_cache');let k=h.get(f);k||(k=new Fj(f,d,c,b.get('_polling_frequency'),a.R.bind(a,b),a.lc.bind(a,g,f),()=>h.delete(f)),h.set(f,k));Cj(k,e.source())}).catch(h=>e.wg(Error(h)).then())}
919
- function zj(a,b,c){(a=a.get('_subscription_cache').get(b))&&(a.C.delete(c)||olympe.sa.Ya('Subscription Cache').warn(`Try to unsubscribe to the subscription ${a.id} which is not registered.`))}function Aj(a,b,c,d,e,f){b=b.get('_data_model_observer');a=new olympe.ha.node.pa.Ha.Mq(a.N,b);e.$c(a);Gj(a,c,d).then(()=>f(null)).catch(g=>f(g))}
920
- function Bj(a,b,c,d,e,f){const g=`_burst.${c}`;let h=b.get(g);null===h?(b.set(g,d),setTimeout(()=>{const k=b.get(g);b.remove(g);Aj(a,b,e,f,k,l=>{l&&olympe.H.ya.pb.Bb.publish(c,{t:vj,r:l})})},b.get('_burst_interval'))):d.$c(h)}function Dj(a,b,c,d,e,f){const g=olympe.ha.node.pa.Ha.ad.Oj,h=new olympe.dc.db.zc;h.F(e,(new Map).set(g,f),0);h.Oa(olympe.dc.jc.Wc,e,olympe.dc.wa(olympe.dm.File));return new Promise((k,l)=>{Aj(a,b,c,d,h,n=>n?l(n):k())})}
921
- function Ej(a,b,c){return x(function*(){var d=olympe.ha.node.pa.Ha.ad.Oj,e=olympe.ha.node.pa.Ha.ad.Mh;const f=yield Hj(a.get('_data_model_observer').Wd,olympe.dc.wa(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.pa.Lq=class extends olympe.sc.logic.$d{constructor(a,b,c,d){super(a,b,c);this.Lc=d;this.$a=olympe.U.getParameter(olympe.H.qb.gm)}update(a,b){var [c]=b,d=l=>olympe.U.getParameter(`${'dbconnector'}.${c}.${l}`);const e=l=>olympe.U.getParameter(`${'dbconnector'}.${l}`);a.set('_burst_interval',d(Z.Ev)||5E3);a.set('_polling_frequency',d(Z.cs)||e(Z.cs)||6E5);const f=d(Z.client)||e(Z.client)||'pg',g=d(Z.hostname)||e(Z.hostname)||'',h=d(Z.Ja)||e(Z.Ja);b=d(Z.schema)||e(Z.schema)||c;const k=knex({client:f,
923
- 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.N.info(`SQLConnector ${c} started with host ${g}, database ${h} on schema ${b}`);this.Pc=olympe.sa.Ya('sql');a.Hg(()=>k.destroy().then());d=new olympe.ha.node.pa.Ha.Ys(k,b,this);a.set('_data_model_observer',d);a.set('_subscription_cache',new Map);xj(this,a,k,b,c)}R(a,b,c,d){a=a.get('_data_model_observer');const e=a.Wd,f=new olympe.ha.node.pa.Ha.vu(c,e);Ij(a).then(()=>Jj(f)).then(g=>
924
- {if(0===g.length)return[[],g];const h=Kj(new olympe.ha.node.pa.Ha.Kq(f,b,g));this.Pc.debug(`Sending a sql query with the following text: ${h.toString()}`);return h.then(k=>[k,g])}).then(g=>{var [h,k]=g;return Lj(c.Z(),h,k,e)}).then(g=>d(g,null)).catch(g=>d({},g))}lc(a,b,c){olympe.H.ya.pb.Bb.publish(a,{t:oj,i:b,r:c}).then().catch(d=>this.N.error('Error occurred while publishing query result update: '+d))}};
925
- olympe.ha.node.pa.Lq.P=olympe.dc.Ca.C('017dc8db8074471acb7a',olympe.ha.node.pa.Lq,olympe.sc.O.Ea,olympe.la.O.zm);function Cj(a,b){a.C.has(b)?(a=a.C,a.values.has(b)&&a.values.set(b,Date.now())):a.C.add(b)}
926
- class Fj{constructor(a,b,c,d,e,f,g){this.id=a;this.query=b;a=new olympe.W.br(olympe.U.getParameter(olympe.ab.Config.Vl)+6E4);a.C=g;this.C=a;this.start(c,e,f,d)}start(a,b,c,d){let e=null,f=new Set;const g=()=>{0<this.C.values.size&&(b(a(),this.query,(h,k)=>{if(k)olympe.sa.Ya('Subscription Cache').error(`Error occurred while updating subscription cache update: ${k}`);else if(k=olympe.W.ob(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);
927
- f=new Set(k);c(h)}}),setTimeout(g,d))};setTimeout(g,d)}};olympe.ha.node.pa.Ha={};olympe.ha.node.pa.Ha.Ac={EQUAL:'equal',Pq:'substring',No:'filter',yp:'<=',zp:'<',$o:'>=',ap:'>',$f:'and',Lh:'or',Wg:'not',yq:'regex'};olympe.ha.node.pa.Ha.ad={Mh:'tagOlympe',gk:'tagOlympeOrig',Al:'tagOlympeDest',Oj:'fileContent'};const Mj=olympe.ha.node.pa.Ha.ad.gk,Nj=olympe.ha.node.pa.Ha.ad.Al,Oj=olympe.ha.node.pa.Ha.ad.Mh,Pj=olympe.ha.node.pa.Ha.ad.Oj;function Ij(a){return new Promise(b=>{0<a.C?a.L.add(()=>b()):b()})}
928
- function Qj(a){Rj(a,olympe.dc.wa(olympe.dm.File));const b=new Map;a.F.vb(olympe.sc.logic.$d.F).observe(a.G).subscribe(c=>{ye(c).forEach(d=>{const e=d.T();Sj(a,()=>{var g=Tj;const h=[{name:Oj,$e:Oj,Vk:!1}];e===olympe.dc.wa(olympe.dm.File)&&h.push({name:Pj,$e:Pj,Vk:!1});return g(a,e,e,h)},`Create Table for ${e}`);const f=new olympe.D.Zb('Business model context',a.G);b.set(e,f);f.run(()=>Uj(a,f,e))});ze(c).forEach(d=>{b.get(d).destroy();Sj(a,()=>Vj(a,d),`Delete Table for ${d}`)})})}
929
- function Wj(a){a.C++;1===a.C&&a.N.debug('Data model observer is busy')}function Xj(a){a.C--;if(0===a.C){a.N.debug('Data model observer is free');for(const b of a.L)b();a.L.clear()}}function Rj(a,b){if(!a.db.Xk(a.F,olympe.sc.logic.$d.F,b)){Wj(a);const c=new olympe.dc.Transaction;c.Oa(olympe.sc.logic.$d.F,a.F,b);c.ib((d,e)=>{d||a.N.error(`Error while linking the business model ${b} to the SQLConnector: ${e}`);Xj(a)},!0)}}function Yj(a){return a.client.schema.withSchema(a.schema)}
930
- function Sj(a,b,c){if(!a.G.R()&&!a.G.zb()){a.N.debug(`Push operation:${c}`);Wj(a);var d=a.R,e=()=>{d.shift();Xj(a);if(0<d.length)d[0]()},f=()=>{b().then(()=>{a.N.debug(`Operation ${c} succeed`);e()}).catch(g=>{a.N.error(`Error for operation ${c}: ${g}`);e()})};d.push(f);1===d.length&&f()}}
931
- function Tj(a,b,c,d){return x(function*(){if(yield Yj(a).hasTable(b))return a.N.debug(`Table ${c} already exist`),Promise.resolve().then(()=>{var e=a.Wd;e.C.set(c,b);e.G.set(b,c)});a.N.debug('Create table for : '+c);return Yj(a).createTable(b,e=>{d.forEach(f=>{var {name:g,$e:h,Cr:k,qs:l,Vk:n}=f;Zj(a,e,g,h,n,l,k)})}).then(()=>{var e=a.Wd;e.C.set(c,b);e.G.set(b,c)})}())}
932
- function Uj(a,b,c){b.onDestroy(()=>{Sj(a,()=>Promise.all(Array.from(a.Ma.get(c)).map(d=>Vj(a,d))).then(()=>{a.Ma.delete(c)}),`Destroy relation tables of business model ${c}: relations: ${a.Ma.get(c)}`)});ak(a,c,b);a.Ma.set(c,new Set);olympe.dc.hb.from(c).vb(olympe.dc.CloudObject.G).Ti().vb(olympe.dm.Relation.destinationModelRel).Ti().filter((new olympe.dc.ba.V.De(a.F)).vb(olympe.sc.logic.$d.F.Sc())).observe(b).subscribe(d=>{0<ye(d).length&&(a.N.debug('Handle new relations : '+ye(d)),Sj(a,()=>Promise.all(ye(d).map(e=>
933
- {var [f,g]=e;a.Ma.get(c).add(f.T());a.Ma.get(g.T()).add(f.T());e=f.T();var h=Tj,k=g.T();return h(a,e,e,[{name:Mj,$e:Mj,qs:c,Cr:Oj,Vk:!0},{name:Nj,$e:Nj,qs:k,Cr:Oj,Vk:!0}])})).then(),`Add relation tables for business model ${c}: ${ye(d)}`));0<ze(d).length&&(a.N.debug('Handle relations to remove : '+ze(d)),Sj(a,()=>Promise.all(ze(d).map(e=>{var [f,g]=e;a.Ma.get(c).delete(f);a.Ma.get(g).delete(f);return Vj(a,f)})).then(),`Delete relation tables for business model ${c}: ${ze(d)}`))})}
934
- function Vj(a,b){return x(function*(){try{var c=yield Hj(a.Wd,b)}catch(d){a.N.warn(`Try to delete a table not registered: ${d}`);return}if(yield Yj(a).hasTable(c)){Yj(a).dropTable(c);c=a.Wd;const d=c.C.get(b);c.G.delete(d)||c.C.delete(b)}}())}
935
- function ak(a,b,c){a.N.debug('Observe properties for '+b);olympe.dc.hb.from(b).vb(olympe.dc.CloudObject.propertyRel).observe(c).subscribe(d=>{a.N.debug('New properties for '+b+' '+ye(d));Sj(a,()=>bk(a,b,ye(d).map(e=>e.T()),ze(d)),`Update columns of ${b}: added: ${ye(d)}, removed: ${ze(d)}`)})}
936
- function bk(a,b,c,d){return x(function*(){const e=yield Hj(a.Wd,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 Yj(a).table(e,k=>{const l=new Set(Object.keys(h));f.forEach((n,p)=>{!l.has(n)&&Zj(a,k,n,c[p])});g.forEach(n=>{l.has(n)&&k.dropColumn(n)})})}())}
937
- function Zj(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===Oj)b.string(c,21).primary();else if(c===Mj||c===Nj){if(e)b.string(c).notNullable().references(g).inTable(f).onDelete('CASCADE')}else c===Pj?b.binary(c):d&&(a=a.db,d=olympe.dc.nd.from(d).vb(olympe.dm.Property.typeRel).ud(),a.Rf(d,olympe.dm.String)?b.string(c,1E3):a.Rf(d,olympe.dm.Number)?b.double(c):a.Rf(d,olympe.dm.Boolean)?b.boolean(c):a.Rf(d,olympe.dm.DateTime)?b.string(c):a.Rf(d,olympe.dm.Color)&&b.string(c,
938
- 50))}olympe.ha.node.pa.Ha.Ys=class{constructor(a,b,c){this.N=olympe.sa.Ya('sql');this.client=a;this.schema=b;this.F=c;this.Wd=new olympe.ha.node.pa.Ha.bv;this.G=new olympe.D.Zb(`Data Model Observer of ${c.T()}`);this.R=[];this.C=0;this.Ma=new Map;this.L=new Set;this.db=olympe.dc.Pa();Qj(this)}};const ck=olympe.ha.node.pa.Ha.Ac.EQUAL,dk=olympe.ha.node.pa.Ha.Ac.$f,ek=olympe.ha.node.pa.Ha.Ac.Lh,fk=olympe.ha.node.pa.Ha.Ac.Wg,gk=olympe.ha.node.pa.Ha.Ac.No,hk=olympe.ha.node.pa.Ha.Ac.$o,ik=olympe.ha.node.pa.Ha.Ac.ap,jk=olympe.ha.node.pa.Ha.Ac.yp,kk=olympe.ha.node.pa.Ha.Ac.zp,lk=olympe.ha.node.pa.Ha.Ac.yq,mk=olympe.ha.node.pa.Ha.Ac.Pq,nk=olympe.ha.node.pa.Ha.ad.Mh;
939
- function Jj(a){return x(function*(){var b=a.query.G;let c=b;var d=[];const e=a.query.C;let f=olympe.dc.Pa().jj(b);!f&&e[0]instanceof olympe.dc.ba.Lb.hg&&(f=e[0].Sd().sb(olympe.dc.CloudObject.instancesRel));if(f){try{var g=yield Hj(a.Qe,b)}catch(l){return[]}f=!0;e.shift()}else{try{var h=yield a.Qe.Wb(b,'')}catch(l){return[]}c=h;g=yield Promise.resolve([['tagOlympe',b]]);1<g.length?d.push(['',dk,g.map(l=>{var [n,p]=l;return[n,ck,ok(p)]})]):d.push([g[0][0],ck,ok(g[0][1])]);g=yield Hj(a.Qe,h)}h=pk(a,
940
- g);b=Array.from(a.query.F);b=b.includes(0)||b.includes(1)&&f;var k=[];if(b){const l=a.query.Z(),n=qk(a.Qe,l,c,nk);k=olympe.dc.hb.from(c).vb(olympe.dc.CloudObject.propertyRel).ud().map(q=>q.T());const p=yield Promise.all(k.map(q=>Promise.resolve(q)));k=k.map(q=>qk(a.Qe,l,c,q)).map((q,r)=>[q,p[r]]);k.unshift([n,nk])}a.C.limit=a.query.max;a.C.offset=a.query.offset;a.Pe.push({Ig:b,recursive:!1,filters:d,jh:'',ai:'',Xh:k,fh:h,name:g});d=0;for(const l of e)d=yield rk(a,l,d,f);return a.Pe}())}
941
- function pk(a,b){return`alias-${b.charAt(0)}${a.G++}`}function rk(a,b,c,d){let e=c;switch(!0){case b instanceof olympe.dc.ba.Lb.hg:case b instanceof olympe.dc.ba.Lb.ig:e+=1;a=sk(a,b,e,d);break;case b instanceof olympe.dc.ba.Lb.uc:a=tk(a,b);break;case b instanceof olympe.dc.ba.Lb.Qh:a=uk(a,b);break;default:a=Promise.reject(`Query part ${b.toString()} could not be parsed`)}return a.then(()=>e)}
942
- function sk(a,b,c,d){const e=b.Sd().T(),f=b.Sd().Qa()===olympe.dc.Aa.ORIGIN?olympe.dm.Relation.originModelRel:olympe.dm.Relation.destinationModelRel;let g=b instanceof olympe.dc.ba.Lb.ig;const h=olympe.dm.Relation.F.Wl,k=olympe.dc.nd.from(e).vb(f).ud();c=d?c+1:c;const l=Array.from(a.query.F).includes(c),[n,p]=['',''];return Hj(a.Qe,k.T()).then(q=>x(function*(){const r=pk(a,q),t=[];let u=Promise.resolve();h===olympe.dm.Relation.F.Wl&&(u=Hj(a.Qe,e).then(v=>{const w=pk(a,v),[y,A]=vk(b.Sd().Qa());a.Pe.push({Ig:!1,
943
- fh:w,name:v,Xh:[],jh:y,ai: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.Z(),D=qk(a.Qe,A,k.T(),nk);w=olympe.dc.hb.from(k.T()).vb(olympe.dc.CloudObject.propertyRel).Ti().ud().map(I=>I.T());v=w.map(I=>qk(a.Qe,A,k.T(),I));w=Promise.all(w.map(I=>Promise.resolve(I)));y.push([qk(a.Qe,A,k.T(),nk),nk]);const T=yield w;y=v.map((I,aa)=>[I,T[aa]]);y.unshift([D,nk])}a.Pe.push({Ig:l,fh:r,name:q,Xh:y,jh:n,ai:p,filters:t,recursive:g})}()))}()))}
944
- function tk(a,b){return a.F(b.C).then(c=>{a.Pe[a.Pe.length-1].filters.push(c)})}function uk(a,b){a.C.order=b.order;a.C.aliasSorting=a.Pe[a.Pe.length].fh;return Promise.resolve(b.gb().T()).then(c=>{a.C.columnSorting=c})}function vk(a){const b=olympe.ha.node.pa.Ha.ad.gk,c=olympe.ha.node.pa.Ha.ad.Al;return a===olympe.dc.Aa.ORIGIN?[c,b]:[b,c]}
945
- olympe.ha.node.pa.Ha.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.ba.V.Ic:const c=a.C;return Promise.resolve(a.gb()).then(h=>[h,ck,ok(c)]);case a instanceof olympe.dc.ba.V.Vc:const d=a.substring;return Promise.resolve(a.gb()).then(h=>[h,mk,d]);case a instanceof olympe.dc.ba.V.zd: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)?
946
- Promise.resolve(a.gb()).then(h=>[h,lk,a.C]):Promise.reject(`Query not supported for regex : ${b}`);case a instanceof olympe.dc.ba.V.md:return this.F(a.C).then(h=>['',fk,h]);case a instanceof olympe.dc.ba.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.gd().map((h,k)=>Promise.resolve(h.T()).then(l=>{const [n,p]=vk(h.Qa());let q=[];e&&k===a.gd().length-1&&(q=[[p,ck,ok(e)]]);return{name:l,
947
- recursive:f[k],Xh:[],jh:n,ai:p,filters:q,fh:pk(this,l),Ig:!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,Xh:[[nk,nk]],jh:'',ai:'',filters:[],fh:pk(this,k.name),Ig:!0};h.unshift(k);return g.then(l=>['',gk,{target:l,Ma:h}])});case a instanceof olympe.dc.ba.V.Fh:return Promise.resolve(a.gb()).then(h=>('number'===typeof a.C?Promise.resolve(a.C):Promise.resolve(a.C.T())).then(k=>{var l=
948
- a.G;return Promise.resolve([h,a.F?l?kk:jk:l?ik:hk,k])}));case a instanceof olympe.dc.ba.V.Xd:return b=Array.from(a.V).flatMap(this.F.bind(this)),Promise.all(b).then(h=>['',dk,h]);case a instanceof olympe.dc.ba.V.de:return b=Array.from(a.V).flatMap(this.F.bind(this)),Promise.all(b).then(h=>['',ek,h]);default:return Promise.reject('Failed to parse predicate')}}};function Lj(a,b,c,d){const e=[],f=new olympe.dc.transaction.Md;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 wk(c,d).then(p=>{for(const r of b){const [t,u,v]=xk(a,r,p,d,c,n);for(const w of v){const [y,A,D]=w;f.Oa(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.L.set(y,q);f.F(y,new Map(A),0);f.Oa(olympe.dc.CloudObject.modelRel.T(),y,q,0)}}d.F.delete(a);
949
- return{k:e,p:be(f)}})}function wk(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.ei(a[g-1].name)),e.push(b.ei(a[g+1].name)),c.push(Promise.resolve(b.G.get(a[g].name))),f.push(a[g].jh===olympe.ha.node.pa.Ha.ad.gk?olympe.dc.Aa.DESTINATION:olympe.dc.Aa.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]])})}
950
- function xk(a,b,c,d,e,f){const g=olympe.ha.node.pa.Ha.ad.Mh;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=yk(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.Aa.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.Aa.DESTINATION?[A,f,b]:[A,b,f]),n++)}}p.set(b,[]);q.set(b,t);d.L.set(b,
951
- 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.pa.Ha.zA=class{};function Kj(a){const b=a.C,{offset:c,limit:d,xC:e,order:f,sC:g}=a.R.C;-1<d&&b.limit(d);0<c&&b.offset(c);e&&f&&b.orderBy(`${g}.${e}`,f.toLowerCase());for(const [h,{Ig:k,fh:l,name:n,filters:p,recursive:q,Xh:r,jh:t,ai:u}]of a.Y.entries())zk(a,b,k,l,n,p,q,0===h,t,u,r);return b}
952
- function zk(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&&Ak(a,b,d,f,olympe.ha.node.pa.Ha.rd.NONE);h?(b.from(b.client.raw('?? as ??',[e,d])),a.G=d,a.F=l):(g&&(f=`cte${a.L++}`,Bk(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`:
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');
719
+ 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');
724
+ 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');
729
+ 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));
797
+ 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};
813
+ 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,
854
+ 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=>
875
+ 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
+ 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)}};
897
+ 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`:
953
950
  `${d}.${k}`);a.G=d;a.F=l}))}
954
- function Ak(a,b,c,d,e){const f=olympe.ha.node.pa.Ha.Ac.EQUAL,g=olympe.ha.node.pa.Ha.Ac.$f,h=olympe.ha.node.pa.Ha.Ac.Lh,k=olympe.ha.node.pa.Ha.Ac.Wg,l=olympe.ha.node.pa.Ha.Ac.No,n=olympe.ha.node.pa.Ha.Ac.$o,p=olympe.ha.node.pa.Ha.Ac.ap,q=olympe.ha.node.pa.Ha.Ac.yp,r=olympe.ha.node.pa.Ha.Ac.zp,t=olympe.ha.node.pa.Ha.Ac.yq,u=olympe.ha.node.pa.Ha.Ac.Pq;if(1<d.length)Ck(b,olympe.ha.node.pa.Ha.rd.$f,Dk(a,d,olympe.ha.node.pa.Ha.rd.$f,c));else{var [v,w,y]=d[0];d=`${c}.${v}`;switch(w){case f:Ek(b,e,d,'=',
955
- y.v,!1);break;case u:a=Fk('.*',b.client.dialect);Ek(b,e,d,'LIKE',`${a}${y}${a}`,!1);break;case l:const A=y.relations,D=`cte${a.L++}`,T=new olympe.ha.node.pa.Ha.Kq(a.R,a.C,A),I=olympe.ha.node.pa.Ha.ad.Mh;a.C.with(D,aa=>{for(const [Sk,{Ig:Tk,fh:Uk,name:Vk,filters:Wk,recursive:Xk,Xh:Yk,jh:Zk,ai:$k}]of A.entries())zk(T,aa,Tk,Uk,Vk,Wk,Xk,0===Sk,Zk,$k,Yk);return aa});a.C.whereIn(b.client.raw('??.??',[c,I]),function(aa){aa.select(b.client.raw('??.??',[D,I])).from(D)});break;case q:Ek(b,e,d,'<=',y,'string'===
956
- typeof y);break;case r:Ek(b,e,d,'<',y,'string'===typeof y);break;case n:Ek(b,e,d,'>=',y,'string'===typeof y);break;case p:Ek(b,e,d,'>',y,'string'===typeof y);break;case g:Ck(b,e,Dk(a,y,olympe.ha.node.pa.Ha.rd.$f,c));break;case h:Ck(b,e,Dk(a,y,olympe.ha.node.pa.Ha.rd.Lh,c));break;case k:Ck(b,olympe.ha.node.pa.Ha.rd.Wg,Dk(a,[y],olympe.ha.node.pa.Ha.rd.Wg,c));break;case t:e=Gk(y,b.client.dialect),b.whereRaw('?? LIKE ?',[d,e])}}}
957
- function Bk(a,b,c,d,e){var f=['tagOlympe'];const g=Hk(f,d),h=Hk(f,c),k=g.map((l,n)=>[l,h[n]]);b.withRecursive(c,g,l=>{l.select(g).from({[d]:e}).iD(n=>n.select(g).from({[d]:e}).join(c,()=>{a.on(Object.fromEntries(k))}))})}function Hk(a,b){return a.map(c=>`${b}.${c}`)}
958
- function Ck(a,b,c){switch(b){case olympe.ha.node.pa.Ha.rd.NONE:a.where(c);break;case olympe.ha.node.pa.Ha.rd.$f:a.andWhere(c);break;case olympe.ha.node.pa.Ha.rd.Lh:a.orWhere(c);break;case olympe.ha.node.pa.Ha.rd.Wg:a.whereNot(c);break;default:olympe.sa.Ya('storage').error(`Where operand ${b} not recognized`)}}function Dk(a,b,c,d){return e=>{for(let f=0;f<b.length;++f)Ak(a,e,d,[b[f]],0===f?olympe.ha.node.pa.Ha.rd.NONE:c)}}
959
- function Ek(a,b,c,d,e,f){e=f?a.client.raw(e):e;switch(b){case olympe.ha.node.pa.Ha.rd.NONE:a.where(c,d,e);break;case olympe.ha.node.pa.Ha.rd.$f:a.andWhere(c,d,e);break;case olympe.ha.node.pa.Ha.rd.Lh:a.orWhere(c,d,e);break;case olympe.ha.node.pa.Ha.rd.Wg:a.whereNot(c,d,e);break;default:olympe.sa.Ya('storage').error(`Where operand ${b} not recognized`)}}function Fk(a,b){const c={'.+?':'_','.*':'%','.+':'_%'},d={'.+?':'?','.*':'*','.+':'?*'};return'mssql'===b?d[a]:c[a]}
960
- function Gk(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=/^(\.\+\?|\.\*|\.\+)/;
961
- 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=[Fk(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,
962
- a.length)}return c+d+e}olympe.ha.node.pa.Ha.Kq=class{constructor(a,b,c){this.R=a;this.C=b;this.G=this.F='';this.L=0;this.Y=c}};olympe.ha.node.pa.Ha.rd={$f:'&',Lh:'|',Wg:'!',NONE:''};const Ik=olympe.ha.node.pa.Ha.ad.gk,Jk=olympe.ha.node.pa.Ha.ad.Al,Kk=olympe.ha.node.pa.Ha.ad.Mh,Lk=olympe.ha.node.pa.Ha.ad.Oj,Mk=olympe.dc.bc.VERSION,Nk=olympe.dc.bc.Nd;function Gj(a,b,c){return x(function*(){yield Ij(a.C);yield b.transaction(d=>x(function*(){const e=()=>d.withSchema(c);for(const f of a.ua)yield f(e);a.N.debug(`Transaction after execute operations before commit : ${d.toString()}`);a.ua.length=0;a.kn.clear()}()))}())}
963
- olympe.ha.node.pa.Ha.Mq=class{constructor(a,b){this.N=a;this.C=b;this.Wd=b.Wd;this.kn=new Map;this.ua=[]}wj(a,b,c){a=void 0===c||c?{[Kk]:a}:{};for(const d of b){const [e,f]=d;b=ok(f);a[e]=b.v}return a}F(a,b){b.delete(Nk);b.delete(Mk);this.kn.set(a,b||new Map)}qc(a,b){this.ua.push(c=>{const d=this;return x(function*(){b.delete(Mk);const e=yield Hj(d.Wd,a);yield c().table(e).where(Kk,a).update(d.wj(a,b,!1))}())})}Mc(a){this.ua.push(b=>{const c=this;return x(function*(){var d=yield c.Wd.Wb(a,'');d=yield Hj(c.Wd,
964
- d);var e=olympe.dc.hb.from(d).vb(olympe.dc.CloudObject.G).ud();for(var f of e.keys())e=yield Promise.resolve(f),yield b().table(e).where(Ik,a).del();f=olympe.dc.hb.from(d).vb(olympe.dc.CloudObject.Y).ud();for(const g of f.keys())f=yield Promise.resolve(g),yield b().table(f).where(Jk,a).del();yield b().table(d).where(Kk,a).del()}())})}Oa(a,b,c){a===olympe.dc.jc.Wc?(Rj(this.C,c),this.ua.push(d=>{const e=this;return x(function*(){const f=e.kn.get(b),g=yield Hj(e.Wd,c);c!==olympe.dc.wa(olympe.dm.File)||
965
- f.has(Lk)?(e.Wd.L.set(b,c),yield d().table(g).insert(e.wj(b,f,!0))):yield d().table(g).where(Kk,b).update(e.wj(b,f,!1))}())})):this.ua.push(d=>x(function*(){const e=yield Promise.resolve(a);yield d().table(e).insert({[Ik]:b,[Jk]:c})}()))}Jb(a,b,c){this.ua.push(d=>x(function*(){const e=yield Promise.resolve(a);yield d().table(e).where({[Ik]:b,[Jk]:c}).del()}()))}};olympe.ha.node.pa.Ha.Mq.ma=[olympe.dc.eh];function Hj(a,b){return(a=a.C.get(b))?Promise.resolve(a):Promise.reject(`No table were found for model ${a}`)}function qk(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 yk(a,b,c){a=a.F.get(b)||new Map;return(a=Array.from(a).find(([,d])=>d===c))&&a[0]||null}
966
- olympe.ha.node.pa.Ha.bv=class{constructor(){this.L=new Map;this.F=new Map;this.C=new Map;this.G=new Map}static T(a,b,c){return c?b[0][1]:''}ei(a){return Promise.resolve(a)}gb(a){return Promise.resolve(a)}Wb(a){return(a=this.L.get(a))?Promise.resolve(a):Promise.reject('GET MODEL TAG OF INSTANCE NOT IMPLEMENTED')}};function ok(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.Nf().valueOf()}.${a.Hf().valueOf()}.${a.Cf().valueOf()}.${a.Bf().valueOf()}`}return{t:b,v:c}}olympe.ha.node.pa.Ha.pC=class{};olympe.ha.node.host={};olympe.ha.node.host.Kd=function(a,b){this.uid=a;this.N=b};olympe.ha.node.host.Kd.prototype.constructor=olympe.ha.node.host.Kd;olympe.ha.node.host.Kd.prototype.destroy=function(){};olympe.ha.node.host.Kd.prototype.destroy=olympe.ha.node.host.Kd.prototype.destroy;olympe.ha.node.host.Kd.prototype.Ya=function(){return this.N};olympe.ha.node.host.Kd.ma=[olympe.host.ba.Kd];olympe.ha.node.host.Vp=class{constructor(a){this.N=a}lj(){return!1}Yk(){this.N.error('No history manager implemented in Node')}C(){this.Yk();return Hb()}F(){this.Yk()}};olympe.ha.node.host.Vp.ma=[olympe.host.Bi];olympe.ha.node.host.Yc=class{constructor(){this.C={};this.L={}}destroy(){}R(a){clearTimeout(this.C[a]);delete this.C[a]}ea(a,b,c){this.C[b]=setTimeout(c,a)}G(a){clearTimeout(this.C[a]);delete this.C[a]}Y(a,b,c){this.L[b]=setInterval(c,a)}F(a){clearInterval(this.L[a]);delete this.L[a]}};olympe.host.Up.register(olympe.host.ba.Tp.lr,olympe.ha.node.host.Yc);olympe.ha.node.host.Yc.ma=[olympe.host.ba.Yc];olympe.ha.node.host.uk=class{constructor(a){this.N=a}};olympe.ha.node.host.uk.ma=[olympe.host.uk];olympe.U.config(function(a){ra(a,olympe.host.O.Il,olympe.ha.node.host.Vp,olympe.host.O.Ea);ra(a,olympe.host.O.Sq,olympe.ha.node.host.uk,olympe.host.O.Ea)},'olympe.native.node.host');olympe.la.jd={};olympe.la.jd.Ml=class{constructor(a){this.N=a;this.C=new Map}G(){}F(){}};olympe.la.jd.WebSocket=class{constructor(a,b){this.N=b;this.id=a;this.C=null;this.buffer=[];this.G=!1;this.F=this.L=this.R=null}Z(){return this.id}open(a){const b=this.Y(a);b.binaryType='arraybuffer';b.onopen=()=>{this.N.info('Websocket OPENED');this.G=!0;this.R?(this.N.debug('Notifying upper layer for WebSocket#'+this.id),this.R()):this.N.warn('Nothing to notify for WebSocket#'+this.id);this.buffer.forEach(b.send.bind(b));this.buffer.length=0};b.onmessage=c=>{c='string'===typeof c.data?String(c.data):
967
- Ea(c.data);this.N.debug('#'+this.id+' < '+c);this.F&&this.F(c)};b.onclose=()=>{this.G=!1;this.N.debug('WebSocket#'+this.id+' CLOSE');this.L&&this.L()};b.onerror=()=>{this.N.debug('WebSocket#'+this.id+' ERROR')};this.C=b}send(a){this.N.debug('#'+this.id+' > '+a);this.G?this.C.send(a):this.buffer.push(a)}close(){const a=this.C.constructor,b=this.C.readyState;b===a.OPEN||b===a.CONNECTING?(this.N.debug('Force closing native websocket'),this.C.close(1E3)):this.N.debug('Try to force close native websocket, but not open nor connecting')}qa(a){this.R=
968
- a||null}ka(a){this.F=a||null}ea(a){this.L=a||null}Y(){}};olympe.la.jd.WebSocket.ma=[olympe.la.WebSocket];olympe.ha.node.la={};olympe.ha.node.la.ku=class extends olympe.la.ta{constructor(a,b){super(a,b);this.ea=new olympe.ha.node.la.Ml(a)}Y(){return'NodeJS'}R(){return olympe.D.ra.F}ka(a){var b=this.G++;a=a.C();this.N.debug('CREATE Websocket #'+b+' to '+a);b=new olympe.ha.node.la.lu(b,this.N);b.open(a);return b}C(a,b){this.N.debug('SEND HTTP '+a.method+' to '+a.C());const c=this.G++;b=Sb(this,c,b);this.ea.G(c,{u:a.C(),s:Ob(a),h:Mb(a),p:a.port,z:Nb(a),q:Rb(a),m:a.method,v:a.ej(),k:a.key,c:a.cert,a:a.ca,j:a.rejectUnauthorized,
969
- b:a.body,r:a.F},b)}L(){this.N.warn('DOWNLOAD FILE not available with node native implementation. URL:')}F(){return this.ea}};const Ok=require('fs'),Pk=require('http'),Qk=require('https');
970
- olympe.ha.node.la.Ml=class extends olympe.la.jd.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,A)=>new Promise((D,T)=>{Ok.readFile(w,(I,aa)=>{I?T(I):(A[y]=aa,D(A))})});p=w=>{const y=D=>{D.setEncoding(v===olympe.la.fb.ResponseType.vk?'utf-8':'binary');let T='';D.on('data',I=>{T+=I});D.on('end',()=>{if(v!==olympe.la.fb.ResponseType.vk){var I=
971
- (new Uint8Array(Buffer.from(T,'binary'))).buffer;I=v===olympe.la.fb.ResponseType.pl?new Blob([I]):I}else I=T;c(this.F(D.statusCode,D.statusMessage,I,D.headers))})},A=d?new Qk.request(w,y):new Pk.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 ArrayBuffer?
972
- 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.N.log('Error loading self signed files:',w)})):this.N.warn('All three self signed files must be specified!'):p(b)}F(a,b,c,d){this.N.debug('Received HTTP response',a,c);return new olympe.la.Sg(c,a,b,d)}};olympe.ha.node.la.lu=class extends olympe.la.jd.WebSocket{Y(a){return new (require('ws'))(a)}};olympe.ha.node.la.Config={PB:'native.html.net.useWorkers'};olympe.U.config(function(a){ra(a,olympe.la.O.xa,olympe.ha.node.la.ku,olympe.la.O.Ea,olympe.host.O.xa)},'olympe.native.node.net');olympe.ha.node.la.http={};const Rk=require('fastify'),al=require('fastify-cors'),bl={Mi:0,um:1,rk:2};
973
- function cl(a,b){a.F.route({url:b.path,method:b.methods,handler:(c,d)=>{a.N.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.la.Vj(g,parseInt(h,10),c.url,'https'===c.protocol,c.method,f);for(const [k,l]of Object.entries(c.headers))e.setHeader(k,l);b.mx(e,new Map(Object.entries(c.params))).then(k=>{const l=k.getData();a.N.debug('> HTTP: reply with body:',l instanceof ArrayBuffer?
974
- 'binary':l);d.code(k.Td()).headers(k.ej()).send(l instanceof ArrayBuffer?Buffer.from(l):l)}).catch(k=>{a.N.debug('> HTTP: reply with internal server error:',k);d.code(olympe.la.fb.qd.Hq).header(olympe.la.fb.Headers.Hj,'text/plain').send({error:`Internal server error: ${k}`})})}})}
975
- olympe.ha.node.la.http.Bk=class extends olympe.la.Bk{constructor(a,b,c){super(a);this.F=this.createServer();this.host=b;this.port=c;this.G=new Map;this.R=null;this.C=bl.Mi;this.Je=new Set}ea(a,b){this.R={origin:'*',methods:a,allowedHeaders:b};return this}L(a,b,c,d){this.G.set(a,{path:b,methods:c,mx:d});switch(this.C){case bl.Mi:return this.start();case bl.rk:return this.stop(),this.start();case bl.um:return new Promise((e,f)=>{this.Je.add(g=>g?f(g):e())});default:return Promise.reject('Webservice in unknown state')}}Y(a){this.G.delete(a);
976
- this.stop();return 0===this.G.size?Promise.resolve():this.start()}stop(){this.C===bl.rk&&(this.F.close(),this.C=bl.Mi,this.F=this.createServer())}start(){return this.C===bl.Mi?new Promise((a,b)=>{this.F.register(al,this.R);for(const c of this.G.values())cl(this,c);this.C=bl.um;this.F.listen(this.port,'0.0.0.0',(c,d)=>{this.C=bl.rk;this.Je.forEach(e=>e(c));this.Je.clear();c?(this.stop(),b(c)):(this.N.debug('Web server listening on '+d),a())})}):Promise.reject('Try to start a webservice already started')}createServer(){const a=
977
- Rk({logger:!0});a.addContentTypeParser('*',{parseAs:'buffer'},(b,c,d)=>{d(null,c)});return a}};olympe.U.config(function(a){B(a,olympe.la.O.zm,olympe.ha.node.la.http.Bk,olympe.la.O.Ea,new olympe.U.fa(olympe.la.Config.Jl),new olympe.U.fa(olympe.la.Config.Kl))},'olympe.native.node.net.http');olympe.ha.node.W={};const dl=new Map;olympe.ha.node.W.rl=class extends olympe.W.rl{R(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().C(b))}L(a){var b=()=>Math.random().toString(16).slice(-4);b=`blob://${`${b()}${b()}-${b()}-${b()}-${b()}-${b()}${b()}${b()}`}`;dl.set(b,a);return b}F(a,b,c){dl.has(a)?b(dl.get(a)):c&&c('No object has been found for that url. Maybe the URL has already been revoked')}Y(a){dl.delete(a)}};olympe.U.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.Wp=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.Wp.ma=[olympe.auth.pk];olympe.U.config(a=>{B(a,olympe.auth.O.kk,olympe.ha.node.auth.Wp)},'olympe.native.node.auth');olympe.ha.node.ic={};olympe.ha.node.ic.Lp=class{constructor(a){this.F={};this.N=a}C(a){void 0===this.F[a]&&(this.F[a]=new olympe.ha.node.ic.Mp(a,this.N));return this.F[a].open()}};olympe.ha.node.ic.Lp.ma=[olympe.ic.Vt];olympe.ha.node.ic.Mp=class{constructor(a,b){this.name=a;this.N=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();
978
- b&&b(!0)}clear(){this.C||this.open();this.db.setState({})}};olympe.ha.node.ic.Mp.ma=[olympe.ic.Wt];olympe.U.config(function(a){B(a,olympe.ic.O.$j,olympe.ha.node.ic.Lp,olympe.ic.O.Ea)},'olympe.native.node.localstorage');olympe.ha.node.storage={};olympe.ha.node.storage.Storage=class{constructor(a){this.N=a}F(a){a&&a('Not Implemented.')}R(a){a&&a('Not Implemented.')}write(a,b,c,d,e){e&&e('Not Implemented.')}G(a){a&&a('Not Implemented.')}L(a){a&&a('Not Implemented.')}C(a){a&&a('Not Implemented.')}open(a){a(null)}close(a){a(null)}};olympe.ha.node.storage.Storage.ma=[olympe.ic.Storage];olympe.U.config(function(a){ra(a,olympe.ic.O.Ni,olympe.ha.node.storage.Storage,olympe.host.O.Ea)},'olympe.native.html.storage');olympe.Eg={};olympe.Eg.Config={VERSION:'version.version',Ds:'version.branch',bg:'version.commit',Xu:'version.tag',Oo:'version.olympe-framework',Es:'version.build'};olympe.U.config(function(a){E(a,olympe.Eg.Config.VERSION,'');E(a,olympe.Eg.Config.Ds,'');E(a,olympe.Eg.Config.bg,'');E(a,olympe.Eg.Config.Xu,'');E(a,olympe.Eg.Config.Oo,'');E(a,olympe.Eg.Config.Es,'')},'olympe.main');const el=require('fs');let wa,va;function fl(a,b){el.readFile(a,(c,d)=>{c?b(Object.create(null)):(d=JSON.parse(d),b(d))})}
979
- function gl(){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.U.Ps(a);
980
- d=a.Ya();d.debug('Registering configurations...');d.C++;for(let f=0,g=ka.length;f<g;f++)b=a,c=ka[f],qa(b.N,'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.Ya();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.bj()),b.N.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!')}}
981
- olympe.W.Ym('oConfig.json',fl,function(a){va=a;gl()});fl('version.json',function(a){wa=a;gl()});olympe.wc={};olympe.wc.As=class{run(){}};olympe.wc.ta=class{constructor(a,b){this.C=a;this.N=b;this.F=null;this.G='';this.N.info('HC Manager will execute application registered as:',this.C)}rj(a,b,c=''){b||(b='default');b===this.C?(null===this.F?this.N.log('Application',c,'designated to be launched'):this.N.log('OVERRIDE: Application',c,'designated to be launched'),this.F=a,this.G=c):this.N.debug('ignoring application:'+c+' as it is registered under name '+b+' and not '+this.C)}run(){null!==this.F?(this.N.info('Running application:',this.G),
982
- this.F.run()):this.N.error('No app registered under name: '+this.C)}};olympe.wc.rj=function(a,b,c){const d=a.Ya();c?d.debug('Pre-registering application '+b+' under name '+c+' (use '+olympe.wc.Config.ef+'='+c+' to start it)'):d.debug('Pre-registering application '+b+' as default one');a.Rd(olympe.wc.O.xa).config([b],function(e,f){f.rj(e,c,b)},'olympe.hc.registerApp')};olympe.wc.O={xa:'hc.Manager',Ea:'hc.Logger'};olympe.wc.Config={ef:'hc.app',Gl:'hc.globalToken'};olympe.U.config(function(a){E(a,olympe.wc.Config.ef,'default');E(a,olympe.wc.Config.Gl,!1);C(a,olympe.wc.O.Ea,[olympe.sa.O.xa],b=>b.Qc('hc'));C(a,olympe.auth.O.Aj,[new olympe.U.fa(olympe.wc.Config.ef),new olympe.U.fa(olympe.wc.Config.Gl)],(b,c)=>new olympe.auth.nl(c?'':b));B(a,olympe.wc.O.xa,olympe.wc.ta,new olympe.U.fa(olympe.wc.Config.ef),olympe.wc.O.Ea)},'olympe.hc');
983
- olympe.U.run([olympe.wc.O.xa],a=>a.run(),'olympe.hc');olympe.sc.Yf={};function hl(a){a.N.info('Starting application '+a.C);let b=!1;const c=olympe.dc.Pa();if(0<a.C.length){const d=uc(c,a.C,(e,f)=>{if(e){const g=Si(f);g.run?(a.N.debug('application retrieved: running'),(new olympe.D.Zb('Application execution context',a.F.Fc())).run(()=>{b=!0;g.run(a.F.Qk(g.T()))})):a.N.error('application retrieved: not an Application with a run() method')}else il(a)});olympe.D.Ia().onDestroy(()=>{vc(c,a.C,d)});Ib(()=>{b||a.N.warn(`requested application ${a.C} may not be available (it may not exist or the logged user may not have the correct permissions)`)},
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=
964
+ 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)`)},
984
980
  1E4)}}
985
- function jl(a,b){if(a.L)a.N.debug('Sending getContext request'),Sf(a.R,d=>{d?a.N.error('failed to synchronise (authenticated) with server: '+d.message):(a.N.debug('synchronisation request successful'),$i=a.C,b())});else{var c=olympe.dc.Hd.SUBSCRIBE;const d=olympe.dc.Hd.Ii,e=a.F.Wk()?d:c;a.N.debug((a.F.Wk()?'PULLING':'SUBSCRIBING')+' application '+a.C);const f=olympe.D.Ia();c=new olympe.async.sk(f);c.add((g,h)=>{Xe(new olympe.dc.hf(a.C,e),olympe.dc.Ub.rf).ib(k=>{var l=olympe.dc.Ka;var n=(n=olympe.dc.nd.from(a.C).vb(olympe.sc.La.Me.C).vb(olympe.sc.logic.$d.L.Sc()).ud())&&n.T()||
986
- olympe.dc.Ka.Xc;l.rc=n;k?h(k.message):g()})});c.add(g=>{olympe.D.yc([a.G.Cg()],h=>{(new olympe.dc.Ba(h)).Je(f.C(g))})});c.add((g,h)=>{const k=olympe.sc.ld.C.Cp,l=olympe.sc.ld.C.Zl;aj(a.C,n=>{switch(n){case k:case l:g();break;default:h('Error while loading the business container')}})});Xb(c,(g,h)=>{if(h)throw Error(h);b()});c.start()}}function il(a){a.N.debug('Stop the application');a.F.Fc().ea()}
987
- olympe.sc.Yf.sm=class{constructor(a,b,c,d,e,f,g){this.G=a;this.R=b;this.N=c;this.F=d;this.C=e;this.L=f;this.Y=g||!1}run(){const a=olympe.auth.ta.C.Lg,b=olympe.auth.ta.C.gf,c=olympe.auth.ta.C.Dh,d=olympe.auth.ta.C.ni;this.N.debug('runtime starting for app #'+this.C);let e=!1;const f=()=>{e||(hl(this),e=!0)};olympe.D.yc([this.G.getState()],g=>{switch(g){case a:case c:this.N.debug('Server session opened, calling once connected callback');jl(this,f);break;case b:this.N.debug('Disconnected, working offline.');
988
- this.Y&&!e&&jl(this,f);break;case d:this.N.debug('waiting for authentication');break;default:this.N.debug('No server session available, waiting for connection'),e=!1,il(this)}},'Runtime initial auth state listener')}};olympe.sc.Yf.sm.C='app_instance';olympe.sc.Yf.sm.ma=[olympe.wc.As];olympe.sc.Yf.Dj={rf:'sc.runtime.Main'};
989
- olympe.U.config(function(a){C(a,olympe.auth.O.Aj,[new olympe.U.fa(olympe.wc.Config.ef),new olympe.U.fa(olympe.sc.Config.ef),new olympe.U.fa(olympe.wc.Config.Gl)],(b,c,d)=>new olympe.auth.nl(d?'':b+(c?'-'+c:'')));B(a,olympe.sc.Yf.Dj.rf,olympe.sc.Yf.sm,olympe.auth.O.xa,olympe.dc.query.O.xa,olympe.sc.O.Ea,olympe.sc.O.rm,new olympe.U.fa(olympe.sc.Config.ef),new olympe.U.fa(olympe.dc.Config.Yg),new olympe.U.fa(olympe.sc.Config.Xp));olympe.wc.rj(a,olympe.sc.Yf.Dj.rf,'sc.runtime');olympe.wc.rj(a,olympe.sc.Yf.Dj.rf,
990
- 'sc.headless');olympe.wc.rj(a,olympe.sc.Yf.Dj.rf)},'olympe.sc.runtime');olympe.public={};function kl(a,b){const c=new olympe.auth.Request;for(const [d,e]of a)c.set(d,e);return new Promise(d=>{gc(olympe.public.Ua.get(),c,b,()=>{d()})})}
991
- olympe.public.Ua=class{static gw(a,b){return olympe.auth.Hb.Ee.$i(a,b)}static getState(){return kc(olympe.public.Ua.get())}static pw(){return olympe.D.Za(olympe.public.Ua.get().Cg())}static Tx(a){const b=new olympe.D.Zb('Observe user tag','function'===typeof a.Fc?a.Fc():a);return new rxjs.Observable(c=>{b.run(()=>olympe.D.yc([olympe.public.Ua.get().Cg()],d=>{c.next(d);olympe.D.Ia().onDestroy(()=>c.complete())}));return()=>b.destroy()})}static hd(){return olympe.D.Za(nc(olympe.public.Ua.get()))}static Dw(){return olympe.D.Za(olympe.public.Ua.get().ci())||
992
- void 0}static ii(){olympe.public.Ua.get().ii()}static oh(a){return new Promise((b,c)=>{olympe.public.Ua.get().oh(a,d=>d?c(d):b())})}static zx(a,b){return kl((new Map).set('username',a).set('password',b),'srp')}static yx(){return kl(new Map,'saml')}static Ax(a,b){return kl((new Map).set('username',a).set('nonce',b),'localToken')}static xx(){return kl(new Map,'openID')}static tn(){return new Promise(a=>{mc(()=>{olympe.public.Ua.get().qa.delete('logoutCallback');a()});olympe.public.Ua.get().tn()})}static get(){return olympe.auth.Tc()}};
993
- olympe.public.Ua.logout=olympe.public.Ua.tn;olympe.public.Ua.loginOpenID=olympe.public.Ua.xx;olympe.public.Ua.loginToken=olympe.public.Ua.Ax;olympe.public.Ua.loginSAML=olympe.public.Ua.yx;olympe.public.Ua.loginSRP=olympe.public.Ua.zx;olympe.public.Ua.getUserFromToken=olympe.public.Ua.oh;olympe.public.Ua.sendKeepAlive=olympe.public.Ua.ii;olympe.public.Ua.getIDPToken=olympe.public.Ua.Dw;olympe.public.Ua.getToken=olympe.public.Ua.hd;olympe.public.Ua.observeUser=olympe.public.Ua.Tx;
994
- olympe.public.Ua.getCurrentUser=olympe.public.Ua.pw;olympe.public.Ua.getState=olympe.public.Ua.getState;olympe.public.Ua.generateSRPData=olympe.public.Ua.gw;olympe.public.bb=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.Nc(olympe.D.ra),e=b.subscribe(f=>d.update(olympe.D.Bc(f)));olympe.D.Ia().xc(()=>e.unsubscribe());return d.Eb()}}}};
995
- olympe.public.Ne=class{static create(a){return new class extends olympe.dc.Db.Mg{L(b,c){return olympe.dc.CloudObject.get(c)}G(b,c){b=a(b,c);if('number'===typeof b)return b;const d=olympe.D.Nc(olympe.D.da),e=b.subscribe(f=>d.update(olympe.D.za(f)));olympe.D.Ia().xc(()=>e.unsubscribe());return d.Eb()}}}};'object'===typeof exports&&(exports={CloudObject:olympe.dc.CloudObject,Relation:olympe.dc.va.Relation,Direction:olympe.dc.Aa,generateTag:olympe.W.aj,tagToString:olympe.dc.wa,register:olympe.dc.register,defineProperty:olympe.dc.defineProperty,defineRelation:olympe.dc.ih,defineInverseRelation:olympe.dc.Ov,BrickContext:olympe.sc.Va,Brick:olympe.sc.logic.Function,ActionBrick:olympe.sc.logic.Action,GlobalProperties:olympe.sc.Va.jg,registerBrick:olympe.sc.logic.Ca.C,FunctionBrick:olympe.sc.logic.Function,
996
- Context:olympe.sc.Va,Entry:olympe.dc.va.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.ri,QueryResult:olympe.dc.Wa,Query:olympe.dc.hb,QuerySingle:olympe.dc.nd,Predicate:olympe.dc.ba.bb,
997
- RelatedTo:olympe.dc.ba.V.De,Order:olympe.dc.ba.eq,Config:class{static getParameter(a){return olympe.U.getParameter(a)}},Color:olympe.D.Color,ErrorFlow:olympe.sc.logic.Error,ServiceRequest:olympe.H.ya.pb.ga,Service:olympe.H.ya.pb.Bb,RequestType:olympe.H.ya.Kb.Request.ja,Auth:olympe.public.Ua,AuthState:{INIT:olympe.auth.ta.C.INIT,DISCONNECTED:olympe.auth.ta.C.gf,GUEST:olympe.auth.ta.C.Dh,AUTHENTICATING:olympe.auth.ta.C.ni,ERROR:olympe.auth.ta.C.tc,AUTHENTICATED:olympe.auth.ta.C.Lg},Sync:olympe.dc.CloudObject,
998
- 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.jb{static get(){return olympe.dc.Pa()}},ListDef:olympe.dc.Ba,instanceToTag:olympe.dc.wa,registerSync:olympe.dc.Ca.C,getUniqueTag:olympe.W.aj,onDestroy:a=>olympe.D.Ia().onDestroy(a),offDestroy:a=>
999
- olympe.D.Ia().Ie(a),FollowRules:olympe.dc.Ub,transformers:{Related:olympe.dc.X.Sb,RecursiveRelated:olympe.dc.X.Dc,Distinct:olympe.dc.X.Gd,Filter:olympe.dc.X.uc,Limit:olympe.dc.X.be,Sort:olympe.dc.X.Od,Union:olympe.dc.X.uf},ListDefPredicate:olympe.public.bb,predicates:{And:olympe.dc.V.Xd,Or:olympe.dc.V.de,Not:olympe.dc.V.md,Equals:olympe.dc.V.Ic,Contains:olympe.dc.V.Vc,Greater:olympe.dc.V.ye,Smaller:olympe.dc.V.Fe,HasRelated:olympe.dc.V.jf,InstanceOf:olympe.dc.V.kf,Regex:olympe.dc.V.zd},Comparator:olympe.public.Ne,
1000
- comparators:{Number:olympe.dc.Db.Number,String:olympe.dc.Db.String,DateTime:olympe.dc.Db.DateTime},valuedefs:{BooleanProperty:olympe.dc.oa.ve,StringProperty:olympe.dc.oa.qe,NumberProperty:olympe.dc.oa.me,DateTimeProperty:olympe.dc.oa.le,Constant:olympe.dc.oa.bd,Tag:olympe.dc.oa.sf}});
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}});
1001
997
 
1002
998
 
1003
999
  }.bind(this))();