@olympeio/runtime-node 9.9.1 → 9.9.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
|
@@ -217,24 +217,24 @@ ea('Promise.prototype.finally',function(a){return a?a:function(b){return this.th
|
|
|
217
217
|
ea('String.prototype.padStart',function(a){return a?a:function(b,c){var d=va(this);return wa(c,b-d.length)+d}});ea('String.prototype.padEnd',function(a){return a?a:function(b,c){var d=va(this);return d+wa(c,b-d.length)}});ea('Promise.allSettled',function(a){function b(d){return{status:'fulfilled',value:d}}function c(d){return{status:'rejected',reason:d}}return a?a:function(d){var e=this;d=Array.from(d,function(f){return e.resolve(f).then(b,c)});return e.all(d)}});
|
|
218
218
|
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}});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}});
|
|
219
219
|
ea('Array.prototype.flat',function(a){return a?a:function(b){b=void 0===b?1:b;for(var c=[],d=0;d<this.length;d++){var e=this[d];Array.isArray(e)&&0<b?(e=Array.prototype.flat.call(e,b-1),c.push.apply(c,e)):c.push(e)}return c}});var ya=this||self;function w(a,b){a=a.split('.');let c=ya;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={Yd:()=>'object'===typeof window?window:'object'===typeof global?global:self};if('olympe'in olympe.Yd())throw Error('The olympe runtime is loaded more than once. Make sure not to import `@olympeio/runtime-web` or `@olympeio/runtime-node` explicitly, and to always use the `olympe` alias.');olympe.Yd().olympe=olympe;olympe.RD=(a,...b)=>{b.forEach(c=>{Object.getOwnPropertyNames(c.prototype).forEach(d=>{'constructor'!==d&&void 0===a.prototype[d]&&(a.prototype[d]=c.prototype[d])})})};const za=(a,b)=>{a={level:a,message:b.map(c=>String(c)).join(' ')};for(const c of b){let d;if(null==(d=c)?0:d.stack)a.stackTrace||(a.stackTrace=''),a.stackTrace+=c.stack}return JSON.stringify(a)};
|
|
220
|
-
(()=>{const a=console.trace,b=console.debug,c=console.log,d=console.info,e=console.warn,f=console.error;console.trace=(...g)=>a(za('TRACE',g));console.debug=(...g)=>b(za('DEBUG',g));console.log=(...g)=>c(za('LOG',g));console.info=(...g)=>d(za('INFO',g));console.warn=(...g)=>e(za('WARN',g));console.error=(...g)=>f(za('ERROR',g))})();olympe.Ua={};olympe.Ua.node={};olympe.W={};olympe.W.Af={};olympe.W.Af
|
|
221
|
-
olympe.W.
|
|
222
|
-
function Ka(a,b,c){b=b.toLowerCase();let d;const e=null!=(d=a.F.get(b))?d:[];e.push(c);a.F.set(b,e)}function Ga(a,b){const c=b.length,d=Array(c);let e,f;for(e=0;e<c;e++)a.H.C++,f=b[e],d[e]=f instanceof olympe.W.
|
|
223
|
-
olympe.W.hh=class{constructor(a,b,c,d,e=2){this.J=a;this.G=b;this.parameters=c;this.C=Object.create(null);this.H=new olympe.W.Ep(e);this.F=new Map;Ia(this,this);this.H.debug('Instantiate all computed parameters');d.forEach(f=>Ja(this,f).subscribe(this.
|
|
224
|
-
(d=null==(c=this.F.get(a))?void 0:c.length)?d:0} listeners.`);this.parameters[a]=b;var e;for(const f of null!=(e=this.F.get(a))?e:[])f(b)}}};olympe.W.hh.C={nt:'exception',
|
|
220
|
+
(()=>{const a=console.trace,b=console.debug,c=console.log,d=console.info,e=console.warn,f=console.error;console.trace=(...g)=>a(za('TRACE',g));console.debug=(...g)=>b(za('DEBUG',g));console.log=(...g)=>c(za('LOG',g));console.info=(...g)=>d(za('INFO',g));console.warn=(...g)=>e(za('WARN',g));console.error=(...g)=>f(za('ERROR',g))})();olympe.Ua={};olympe.Ua.node={};olympe.W={};olympe.W.Af={};olympe.W.Af.Yn=class{process(a){for(const b of Object.keys(a.ue))if(a.vd(b).Ym())throw Error('Service "'+b+'" is defined as abstract and needs to be overridden');}};olympe.W.Af.Yn.ya=[olympe.W.Af.lq];olympe.W.Af.Zn=class{process(a){function b(e,f){if(f.includes(e))throw Error('Circular dependency detected: '+f.join(' > ')+' > '+e);if(d.has(e)){f=f.concat(e);d.delete(e);e=a.vd(e);c(e.dj(),f);for(const g of Aa(e))c(g.dj(),f)}}function c(e,f){for(const g of e)g instanceof olympe.W.wb&&b(g.U(),f)}const d=new Set(Object.keys(a.ue));for(const e of d)b(e,[])}};olympe.W.Af.Zn.ya=[olympe.W.Af.lq];olympe.W.Af.lq=class{process(){}};const Ba=[],Ca=[];function Da(a){const b=a.ab();b.debug('Registering configurations...');b.C++;Ba.forEach(c=>{B(a.H,'Registering configure callback '+(c.C?'for module '+c.C:''));a.J.push(c.F)});Ea(b);b.debug('done registering')}function Fa(a){const b=a.ab();b.debug('Running run callbacks of container...');b.C++;Ca.forEach(c=>{const d=Ga(a,c.dj());a.H.debug('Calling run callback '+`for module ${c.C}`);c.F.apply(null,d)});Ea(b);b.debug('done calling run callbacks. DI process completed!')}
|
|
221
|
+
olympe.W.eo=class{constructor(){}static C(a,b){Ba.push(new olympe.W.gl(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');});Ca.push(new olympe.W.gl(b,c,a))}};olympe.W.config=olympe.W.eo.C;olympe.W.run=olympe.W.eo.F;olympe.W.Pr=a=>{const b=new Map,c=(d,e)=>{for(const [f,g]of Object.entries(d))d=e.concat((f.startsWith('#')?f.substring(1):f).toLowerCase()),'object'!==typeof g||null===g||f.startsWith('#')?b.set(d.join('.'),g):c(g,d)};c(a,[]);return b};olympe.W.vj=class{constructor(){}getValue(){}};function Ha(a,b){let c,d;return null!=(d=null==(c=a.G)?void 0:c.call(a,b))?d:!0}olympe.W.gl=class{constructor(a,b,c){this.F=a;this.J=(null!=c?c:[]).map(d=>'string'===typeof d?new olympe.W.wb(d):d);this.C=null!=b?b:'no name di callback';this.G=null}dj(){return this.J}};function Ia(a,b){var c=olympe.W.R.og;if(void 0!==a.C[c])throw Error('Service "'+c+'" has already been instantiated');a.C[c]=b}function Ja(a,b,c){let d=a.C[b];if(void 0===d){const e=a.J[b];if(void 0===e){if(c===olympe.W.hh.C.Pl)return null;throw Error('Service "'+b+'" not found');}try{d=e.instantiate(a)}catch(f){throw a.H.error('Error during instantiation of service '+b),f;}!e.J&&(a.C[b]=d)}return d}
|
|
222
|
+
function Ka(a,b,c){b=b.toLowerCase();let d;const e=null!=(d=a.F.get(b))?d:[];e.push(c);a.F.set(b,e)}function Ga(a,b){const c=b.length,d=Array(c);let e,f;for(e=0;e<c;e++)a.H.C++,f=b[e],d[e]=f instanceof olympe.W.vj?f.getValue(a):f,Ea(a.H);return d}
|
|
223
|
+
olympe.W.hh=class{constructor(a,b,c,d,e=2){this.J=a;this.G=b;this.parameters=c;this.C=Object.create(null);this.H=new olympe.W.Ep(e);this.F=new Map;Ia(this,this);this.H.debug('Instantiate all computed parameters');d.forEach(f=>Ja(this,f).subscribe(this.rj.bind(this,f)))}ab(){return this.H}getParameter(a){a=a.toLowerCase();let b;return null!=(b=this.parameters[a])?b:this.G[a]}rj(a,b){a=a.toLowerCase();if(this.parameters[a]!==b){var c,d;this.H.debug(`Updating parameter ${a} to ${b} and notify ${null!=
|
|
224
|
+
(d=null==(c=this.F.get(a))?void 0:c.length)?d:0} listeners.`);this.parameters[a]=b;var e;for(const f of null!=(e=this.F.get(a))?e:[])f(b)}}};olympe.W.hh.C={nt:'exception',Pl:'null'};function La(a,b){b=olympe.W.Pr(b);for(const [c,d]of b)Ma(a,c,d)}function C(a,b,c,...d){B(a.H,'Defining service '+b);a.C(b,c,d,!1,!1)}function Na(a,b,c,...d){B(a.H,'Defining service '+b);a.C(b,c,d,!1,!0)}function E(a,b,c,d,e=!1){B(a.H,'Defining service (as a factory) '+b);a.C(b,d,c,!0,e)}function Oa(a,b,c,d=!1){B(a.H,'Defining service alias '+b);a.C(b,e=>e,[c],!0,d)}function Pa(a,b){B(a.H,'Defining abstract service '+b);a.C(b).G=!0}function Ma(a,b,c){a.parameters[b.toLowerCase()]=c}
|
|
225
225
|
function Qa(a,b,c,d){a.G.push(b);Ma(a,b,d(...c.map(e=>a.getParameter(e))));E(a,b,c.map(e=>new olympe.W.lh(e)),(...e)=>rxjs.combineLatest(e).pipe(rxjs.operators.skip(1),rxjs.operators.map(f=>d(...f)),rxjs.operators.distinctUntilChanged()))}function F(a,b,c){a.F[b.toLowerCase()]=c}
|
|
226
|
-
olympe.W.dt=class{constructor(a,b){this.ue=Object.create(null);this.parameters=Object.create(null);this.F=Object.create(null);this.G=[];La(this,a);La(this,b);this.T=[new olympe.W.Af
|
|
227
|
-
var g=this.ue[f];g.id=g.id+'!!'+ ++olympe.W.
|
|
226
|
+
olympe.W.dt=class{constructor(a,b){this.ue=Object.create(null);this.parameters=Object.create(null);this.F=Object.create(null);this.G=[];La(this,a);La(this,b);this.T=[new olympe.W.Af.Yn,new olympe.W.Af.Zn];this.J=[];a=this.getParameter(olympe.W.V.tu);this.O=void 0!==a?a:3;this.H=new olympe.W.Ep(this.O)}ab(){return this.H}C(a,b,c,d,e){const f=a instanceof olympe.W.wb?a.U():a;if(3<=arguments.length&&c){const h=c.indexOf(f);if(-1!==h){if(void 0===this.ue[f])throw Error(`ContainerBuilder.define: Service ${f} references itself and is not an override definition!`);
|
|
227
|
+
var g=this.ue[f];g.id=g.id+'!!'+ ++olympe.W.pl.C;g.J=!0;g=g.id;c[h]=g;this.ue[g]=this.ue[f]}}this.ue[f]=new olympe.W.pl(b,c,d||!1,f);return this.ue[f]}vd(a){const b=this.ue[a];if(void 0===b)throw Error(`DI Error: Definition ${a} was not found`);return b}getParameter(a){a=a.toLowerCase();let b;return null!=(b=this.parameters[a])?b:this.F[a]}compile(){const a=this.J;this.H.debug('Calling '+a.length+' configure callbacks');this.H.C++;a.forEach(b=>{B(this.H,'Calling callback');this.H.C++;b(this);Ea(this.H)});
|
|
228
228
|
Ea(this.H);this.H.debug('Configuration summary: '+Object.keys(this.ue).length+' definitions');this.H.debug('Compiling...');this.H.C++;this.T.forEach((b,c)=>{this.H.debug('running compilation pass '+(c+1)+': '+b.constructor.name);b.process(this)});Ea(this.H);this.H.debug('Compilation done, returning container');return new olympe.W.hh(this.ue,this.F,this.parameters,this.G,this.O)}};function Aa(a){let b,c;return null!=(c=null==(b=a.C)?void 0:b.values())?c:[]}
|
|
229
|
-
olympe.W.
|
|
230
|
-
(g=this.C)?void 0:g.size)){b.C++;B(b,'Calling configuration callbacks:');for(const h of this.C.values())b.C++,B(b,'Check if need to call additional configuration callback '+h.C),Ha(h,f)?(B(b,'Calling additional configuration callback '+h.C),d=Ga(a,h.dj()),d.push(f),h.F.apply(null,d)):B(b,'Will not call additional configuration callback '+h.C+'predicate has returned false'),Ea(b);Ea(b)}B(b,'Done instantiating '+this.id);return f}dj(){return this.F}
|
|
231
|
-
(this.C=new Map);var f=this.C,g=f.set;b=new olympe.W.
|
|
232
|
-
olympe.Y
|
|
229
|
+
olympe.W.pl=class{constructor(a,b,c,d){this.O=a||null;this.T=!!c;this.F=(null!=b?b:[]).map(e=>'string'===typeof e?new olympe.W.wb(e):e);this.G=!1;this.C=null;this.id=null!=d?d:'';this.J=!1}U(){return this.id}instantiate(a){const b=a.ab();b.debug('Resolving arguments for '+this.id);const c=this.O;let d=Ga(a,this.F);const e=()=>{if(this.T)return c.apply(null,d);d.unshift(null);return new (c.bind.apply(c,d))};B(b,'Instantiating '+this.id);const f=olympe.D?olympe.D.Sg().run(()=>e()):e();let g;if(0<(null==
|
|
230
|
+
(g=this.C)?void 0:g.size)){b.C++;B(b,'Calling configuration callbacks:');for(const h of this.C.values())b.C++,B(b,'Check if need to call additional configuration callback '+h.C),Ha(h,f)?(B(b,'Calling additional configuration callback '+h.C),d=Ga(a,h.dj()),d.push(f),h.F.apply(null,d)):B(b,'Will not call additional configuration callback '+h.C+'predicate has returned false'),Ea(b);Ea(b)}B(b,'Done instantiating '+this.id);return f}dj(){return this.F}Ym(){return this.G}config(a,b,c,d,e){null===this.C&&
|
|
231
|
+
(this.C=new Map);var f=this.C,g=f.set;b=new olympe.W.gl(c,e,b);b.G=d;g.call(f,a,b)}};olympe.W.pl.C=0;olympe.W.lh=class extends olympe.W.vj{constructor(a){super();this.id=a}U(){return this.id}getValue(a){return new rxjs.Observable(b=>{b.next(a.getParameter(this.id));Ka(a,this.id,c=>b.next(c))})}};function Ea(a){0<a.C&&a.C--}function B(a,b){1>=a.F&&Sa(a,'log','DI: '+b)}function Sa(a,b,c){if(console&&console[b]){var d='';for(let e=0;e<a.C;e++)d+=' ';console[b](d+c)}}olympe.W.Ep=class{constructor(a){this.F=a;this.C=0}debug(a){2>=this.F&&Sa(this,'log','DI: '+a)}info(a){3>=this.F&&Sa(this,'info','DI: '+a)}warn(a){4>=this.F&&Sa(this,'warn','DI: '+a)}error(a){5>=this.F&&Sa(this,'error','DI: '+a)}};olympe.W.oa=class extends olympe.W.vj{constructor(a){super();this.id=a}U(){return this.id}getValue(a){return a.getParameter(this.id)}};olympe.W.wb=class extends olympe.W.vj{constructor(a,b){super();this.id=a;this.C=b||olympe.W.hh.C.nt}U(){return this.id}getValue(a){return Ja(a,this.id,this.C)}};olympe.W.R={og:'di.Container',BB:'di.PublicContainer'};olympe.W.V={tu:'logging.di'};olympe.W.run([olympe.W.R.og],a=>{olympe.W.getParameter=b=>a.getParameter(b);olympe.W.rj=(b,c)=>a.rj(b,c);olympe.Yd().getConfig=b=>a.getParameter(b);olympe.Yd().getConfigNames=()=>Object.keys(a.parameters);olympe.Yd().updateConfig=(b,c)=>a.rj(b,c)});olympe.Y={};olympe.Y.rp=class{constructor(a){this.id=a||olympe.Y.rp.C++}Fa(a){return a?this.id===a.id:!1}toJSON(){return this.id.toString()}toString(){return this.id.toString()}};olympe.Y.rp.C=0;olympe.Y.gB=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.Y.vh=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.Y.vh.F=function(a){return new olympe.Y.vh(.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.Y.vh.C=function(){return new olympe.Y.vh(0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0)};olympe.Y.vh.prototype.set=function(a,b,c){this.values[5*a+b]=c};olympe.Y.vh.prototype.get=function(a,b){return this.values[5*a+b]};function Ta(a){return(new TextEncoder).encode(a)}function Ua(a,b){return a.C(Ta(b))}function Va(a){return(new TextDecoder('utf8')).decode(a)}
|
|
232
|
+
olympe.Y.Zk=class{F(){}C(){}J(a){return v(function*(){if(a instanceof ArrayBuffer)return new Uint8Array(a);if(a instanceof Uint8Array)return a;if('string'===typeof a)return Ta(a);if(a instanceof Blob)return new Uint8Array(yield a.arrayBuffer());if(a instanceof olympe.Y.stream.Eg){const b=[];for(const c=ha(a);;){const d=yield c.next();if(d.done)break;b.push(...d.value)}return new Uint8Array(b)}throw Error('Unsupported value type for binary conversion.');})}G(){}};
|
|
233
233
|
olympe.Y.vr=a=>a.replace('+','-').replace('/','_');olympe.Y.pw=a=>a.replace('-','+').replace('_','/');function Wa(a){a.C=setTimeout(()=>{const b=Date.now(),c=a.timeout;for(const [d,e]of a.values)b-e>c&&(a.delete(d),a.F&&a.F(d));if(0<a.values.size)Wa(a);else{let d;null==(d=a.G)||d.call(a)}},a.J)}function Xa(a,b){return a.values.has(b)?(a.values.set(b,Date.now()),!0):!1}function Ya(a,b){a.F=b;return a}
|
|
234
|
-
olympe.Y.
|
|
235
|
-
olympe.Y.Hh=class{constructor(a){this.C=Ya(new olympe.Y.
|
|
236
|
-
olympe.Y.$u=class{constructor(){this.G=[];this.T=[];this.Z=[];this.O=new Map;this.J=new Map;this.C=!1;this.F=null}start(){this.C||(this.F||(this.F=performance.now()),this.C=!0,this.T.forEach(a=>a()))}stop(){this.C&&(this.Z.forEach(a=>a()),this.C=!1)}};function eb(a,b,c=5E3){return rxjs.operators.retry({resetOnSuccess:!0,delay:(d,e)=>{if(d instanceof a){const f=Math.round(Math.random()*(e+1)*c);return rxjs.timer(f).pipe(rxjs.operators.tap(()=>null==b?void 0:b(d,f)))}return rxjs.throwError(()=>d)}})}olympe.Y.operators={qE(a,b=0){return c=>c.pipe(rxjs.operators.map((d,e)=>{e===b&&a(d);return d}))}};olympe.Y.Promise={};olympe.Y.Promise.$i=function(a,b){let c=null;return(...d)=>new Promise((e,f)=>{clearTimeout(c);c=setTimeout(()=>v(function*(){try{const g=yield a(...d);e(g)}catch(g){f(g)}}),b)})};olympe.Y.Promise.
|
|
237
|
-
olympe.Y.promise.
|
|
234
|
+
olympe.Y.sm=class{constructor(a,b=a/2){this.timeout=a;this.J=b;this.values=new Map;this.G=this.F=this.C=null}add(a){this.values.set(a,Date.now());null===this.C&&Wa(this)}has(a){return this.values.has(a)}forEach(a){this.values.forEach((b,c)=>a(c))}delete(a){a=this.values.delete(a);if(0===this.values.size){this.C&&clearTimeout(this.C);this.C=null;let b;null==(b=this.G)||b.call(this)}return a}clear(){this.C&&clearTimeout(this.C);this.C=null;this.values.clear();return this}};function Za(a,b){a.F=b;return a}function $a(a,b){a.C.G=b}
|
|
235
|
+
olympe.Y.Hh=class{constructor(a){this.C=Ya(new olympe.Y.sm(a,void 0),b=>{const c=this.values.get(b);this.values.delete(b);let d;null==(d=this.F)||d.call(this,b,c)});this.values=new Map;this.F=null}set(a,b){this.values.set(a,b);this.C.add(a);return this}has(a){return this.values.has(a)}get(a){return this.values.get(a)}forEach(a){this.values.forEach((b,c)=>a(b,c))}delete(a){this.values.delete(a);return this.C.delete(a)}clear(){this.C.clear();this.values.clear();return this}};function ab(a,b){a.T.push(b)}function bb(a,b){a.Z.push(b)}function cb(a,b){let c;'object'!==typeof b&&'function'!==typeof b?c=b:b instanceof olympe.dc.CloudObject?c=b.toJSON():Array.isArray(b)?c=b.map(d=>cb(a,d)):c='N/A';return c}function db(a,b,c,d){b={cat:b,epoch:null!=d?d:performance.now()-a.F};let e;for(const [f,g]of null!=(e=c)?e:[])b[f]=cb(a,g);a.G.push(b)}
|
|
236
|
+
olympe.Y.$u=class{constructor(){this.G=[];this.T=[];this.Z=[];this.O=new Map;this.J=new Map;this.C=!1;this.F=null}start(){this.C||(this.F||(this.F=performance.now()),this.C=!0,this.T.forEach(a=>a()))}stop(){this.C&&(this.Z.forEach(a=>a()),this.C=!1)}};function eb(a,b,c=5E3){return rxjs.operators.retry({resetOnSuccess:!0,delay:(d,e)=>{if(d instanceof a){const f=Math.round(Math.random()*(e+1)*c);return rxjs.timer(f).pipe(rxjs.operators.tap(()=>null==b?void 0:b(d,f)))}return rxjs.throwError(()=>d)}})}olympe.Y.operators={qE(a,b=0){return c=>c.pipe(rxjs.operators.map((d,e)=>{e===b&&a(d);return d}))}};olympe.Y.Promise={};olympe.Y.Promise.$i=function(a,b){let c=null;return(...d)=>new Promise((e,f)=>{clearTimeout(c);c=setTimeout(()=>v(function*(){try{const g=yield a(...d);e(g)}catch(g){f(g)}}),b)})};olympe.Y.Promise.tn=function(a,b,c='Promise timeout'){return new Promise((d,e)=>{const f=setTimeout(()=>{e(Error(c))},b);a.then(g=>{clearTimeout(f);d(g)}).catch(g=>{clearTimeout(f);e(g)})})};olympe.Y.promise={};function fb(a){if(0===a.size())a.F.next(!1);else if(a.G()){a.C++;var b=gb(a);b&&b.F.call(a).then(c=>{b.resolve(c)}).catch(c=>{b.C(c)}).finally(()=>{a.C--;0===a.size()&&a.F.next(!1);fb(a)})}}function hb(a,b){return new Promise((c,d)=>{a.Ya.push(new olympe.Y.promise.Ev(c,d,b));fb(a)})}function gb(a){a.F.next(!0);let b;return null!=(b=a.Ya.shift())?b:null}
|
|
237
|
+
olympe.Y.promise.km=class{constructor(){this.Ya=[];this.F=new rxjs.BehaviorSubject(!1);this.C=0}G(){return 0===this.C}clear(){for(;0<this.Ya.length;)this.Ya.shift().C(Error('Canceled by a clearStack'));fb(this)}size(){return this.Ya.length}};olympe.Y.promise.Ev=class{constructor(a,b,c){this.resolve=a;this.C=b;this.F=c}};olympe.Y.promise.Fv=class extends olympe.Y.promise.km{constructor(a){super();if('number'!==typeof a||0>=a)throw Error('StackWindow with an invalid concurrentLimit. It must be a number > 0 for the stack to work properly');this.jj=a}G(){return this.C<this.jj}};olympe.Y.promise.VC=class{constructor(a,...b){this.G=a;this.parameters=b;this.C=this.F=null;this.promise=new Promise((c,d)=>{this.F=c;this.C=d});this.start()}then(a){return this.promise.then(a)}catch(a){return this.promise.catch(a)}finally(a){return this.promise.finally(a)}start(){'undefined'!==typeof Worker?setTimeout(()=>{const a=URL.createObjectURL(new Blob([`
|
|
238
238
|
function onFullfilledCallback(data) {
|
|
239
239
|
self.postMessage({ type: "done", data, });
|
|
240
240
|
self.close();
|
|
@@ -260,133 +260,133 @@ olympe.Y.Ny=function(a){var b=/^(?:(\S*)@)?([^:]+)(?::(\d{2,5}))?$/;const c=/([^
|
|
|
260
260
|
r=decodeURIComponent(r);b[q[1]]=r}return{scheme:a||null,AD:g||null,us:l||null,host:n||null,port:p&&parseInt(p,10)||null,path:h&&'/'!==h?h:null,query:k||null,UD:f||null,parameters:b}};olympe.Y.lE=function(a){a=a.substring(1);return''===a?new Map:new Map(a.split('&').map(b=>b.split('=').map(decodeURIComponent)))};
|
|
261
261
|
olympe.Y.oE=function(a){a=Array.from(a.entries()).filter(([,b])=>null!==b&&void 0!==b).map(([b,c])=>`${encodeURIComponent(b)}=${encodeURIComponent(c)}`).join('&');return 0<a.length?`#${a}`:''};olympe.Y.aE=(a,b)=>{const c=Object.keys(a).find(d=>a[d]===b);return void 0===c?null:c};
|
|
262
262
|
olympe.Y.cs=a=>{var b=qb,c=rb;return v(function*(){return(yield Promise.all(a.map(b))).map(d=>{if('string'!==typeof d)return Object.create(null);try{return JSON.parse(d)}catch(e){const f=null!=c?c:'';return d.split('\n').filter(g=>g.startsWith(f)).reduce((g,h)=>{const [k,l]=h.split('=');g[k.slice(f.length)]=olympe.Y.wr(l);return g},{})}}).reduce((d,e,f)=>{olympe.Y.es(d,e,'version.json'===a[f]?'version.':'');return d},Object.create(null))})};
|
|
263
|
-
olympe.Y.wr=a=>{const b=/^true|false$/i,c=/^\d+(\.\d+)?$/;void 0===a?a=!0:a.startsWith('"')&&a.endsWith('"')?a=a.substring(1,a.length-1):b.test(a)?a='true'===a.toLowerCase():c.test(a)&&(a=parseFloat(a));return a};olympe.Y.es=(a,b,c)=>{if(b instanceof Object)for(const d of Object.keys(b)){const e=c+d,f=b[d];f instanceof Object&&void 0!==a[e]?olympe.Y.es(a[e],f,''):a[e]=f}};olympe.Y.zD=class a{constructor(b,c){this.x=b;this.y=c}add(b){return new a(this.x+b.x,this.y+b.y)}
|
|
264
|
-
olympe.Y.yf=class{constructor(a,b,c,d){this.C=a;this.F=b;this.G=c;this.J=d||null}static parse(a){a=/([0-9]*)\.([0-9]*)\.([0-9]*)-?([A-z\-_0-9]*)/.exec(a);if(null===a||4>a.length)return olympe.Y.yf.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.Y.yf.C:new olympe.Y.yf(b,c,d,a[4])}
|
|
265
|
-
a.G}Fa(a){return this.C===a.C&&this.F===a.F&&this.G===a.G}toString(){return`${this.C}.${this.F}.${this.G}`+(null!==this.J?`-${this.J}`:'')}};olympe.Y.yf.C=new olympe.Y.yf(Number.NaN,Number.NaN,Number.NaN);olympe.Y.R={mg:'utils.binaryConverter',Gs:'utils.base64Converter',Xf:'utils.Profiler'};olympe.W.config(a=>{Pa(a,olympe.Y.R.mg);Oa(a,olympe.Y.R.Gs,olympe.Y.R.mg,!0);C(a,olympe.Y.R.Xf,olympe.Y.$u)},'Utils services');olympe.W.run([olympe.Y.R.mg,olympe.Y.R.Xf],(a,b)=>{olympe.Y.Xe=()=>a;olympe.Yd().isProfilerEnabled=()=>b.C;olympe.Yd().startProfiler=()=>b.start();olympe.Yd().stopProfiler=()=>b.stop();olympe.Yd().getProfilerEvents=()=>({events:b.G,names:Object.fromEntries(b.O.entries()),models:Object.fromEntries(b.J.entries())})});olympe.ka={};olympe.ka.Eb=class{ma(){}O(){}J(){}C(){}ja(){}T(){}
|
|
266
|
-
olympe.ka.Eb.C={Lv:0,Rf:1,su:2,
|
|
267
|
-
olympe.ka.oe.Eb=class{constructor(a,b){this.name=a;const c=b instanceof rxjs.Observable;this.F=c?olympe.ka.Eb.C.
|
|
268
|
-
tb(this,'trace',this.G,a)}debug(...a){this.C()&&tb(this,'debug',this.G,a)}log(...a){this.T()&&tb(this,'log',this.G,a)}info(...a){this.ja()&&tb(this,'info',this.G,a)}warn(...a){this.
|
|
269
|
-
b=new olympe.ka.oe.Eb(a,d.asObservable(),c);this.channels.set(a,b)}return b}};olympe.ka.oe.Ta.ya=[olympe.ka.Ta];olympe.ka.R={Ea:'logging.Manager'};olympe.ka.V={
|
|
270
|
-
olympe.D.K.F=new olympe.D.K(()=>olympe.D.Qa);olympe.D.K.O=new olympe.D.K(()=>olympe.D.fa);olympe.D.K.T=new olympe.D.K(()=>olympe.D.$b);olympe.D.mh=class{U(){return''}Uc(){return''}destroy(){}fb(){return!1}od(){return!1}run(a,...b){return a(...b)}G(a){return a}getParent(){return null}Bf(){}Cc(){}Tc(){}
|
|
271
|
-
olympe.D.Xb=class{constructor(a='SimpleContext',b){++xb;this.hb=new Map;this.
|
|
272
|
-
this.
|
|
273
|
-
this.Ga.get(b)();this.Ga.clear()}onDestroy(a,b){void 0===b&&(++this.ac,b=String(this.ac));this.
|
|
274
|
-
function zb(a,b){a.ea||(a.ea=new Map);a.ea.set(b.U(),b);switch(b.Gc()){case olympe.D.Node.C.wh:break;case olympe.D.Node.C.Ih:break;case olympe.D.Node.C.
|
|
263
|
+
olympe.Y.wr=a=>{const b=/^true|false$/i,c=/^\d+(\.\d+)?$/;void 0===a?a=!0:a.startsWith('"')&&a.endsWith('"')?a=a.substring(1,a.length-1):b.test(a)?a='true'===a.toLowerCase():c.test(a)&&(a=parseFloat(a));return a};olympe.Y.es=(a,b,c)=>{if(b instanceof Object)for(const d of Object.keys(b)){const e=c+d,f=b[d];f instanceof Object&&void 0!==a[e]?olympe.Y.es(a[e],f,''):a[e]=f}};olympe.Y.zD=class a{constructor(b,c){this.x=b;this.y=c}add(b){return new a(this.x+b.x,this.y+b.y)}Sm(){return Math.sqrt(this.x*this.x+this.y*this.y)}toString(){return`Vector(${this.x}, ${this.y})`}};olympe.Y.wu=class{constructor(a,b){this.start=a;this.end=b}};olympe.Y.wu.C={VA:'left',KB:'right',zz:'bottom',TC:'top'};function sb(a){return`${a.C}.${a.F}.${a.G}`}
|
|
264
|
+
olympe.Y.yf=class{constructor(a,b,c,d){this.C=a;this.F=b;this.G=c;this.J=d||null}static parse(a){a=/([0-9]*)\.([0-9]*)\.([0-9]*)-?([A-z\-_0-9]*)/.exec(a);if(null===a||4>a.length)return olympe.Y.yf.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.Y.yf.C:new olympe.Y.yf(b,c,d,a[4])}Ek(a){return this.C!==a.C?this.C>a.C:this.F!==a.F?this.F>a.F:this.G>a.G}pj(a){return this.C!==a.C?this.C<a.C:this.F!==a.F?this.F<a.F:this.G<
|
|
265
|
+
a.G}Fa(a){return this.C===a.C&&this.F===a.F&&this.G===a.G}toString(){return`${this.C}.${this.F}.${this.G}`+(null!==this.J?`-${this.J}`:'')}};olympe.Y.yf.C=new olympe.Y.yf(Number.NaN,Number.NaN,Number.NaN);olympe.Y.R={mg:'utils.binaryConverter',Gs:'utils.base64Converter',Xf:'utils.Profiler'};olympe.W.config(a=>{Pa(a,olympe.Y.R.mg);Oa(a,olympe.Y.R.Gs,olympe.Y.R.mg,!0);C(a,olympe.Y.R.Xf,olympe.Y.$u)},'Utils services');olympe.W.run([olympe.Y.R.mg,olympe.Y.R.Xf],(a,b)=>{olympe.Y.Xe=()=>a;olympe.Yd().isProfilerEnabled=()=>b.C;olympe.Yd().startProfiler=()=>b.start();olympe.Yd().stopProfiler=()=>b.stop();olympe.Yd().getProfilerEvents=()=>({events:b.G,names:Object.fromEntries(b.O.entries()),models:Object.fromEntries(b.J.entries())})});olympe.ka={};olympe.ka.Eb=class{ma(){}O(){}J(){}C(){}ja(){}T(){}va(){}aa(){}ea(){}trace(){}debug(){}log(){}info(){}warn(){}error(){}fatal(){}};olympe.ka.Eb.prototype.fatal=olympe.ka.Eb.prototype.fatal;olympe.ka.Eb.prototype.error=olympe.ka.Eb.prototype.error;olympe.ka.Eb.prototype.warn=olympe.ka.Eb.prototype.warn;olympe.ka.Eb.prototype.info=olympe.ka.Eb.prototype.info;olympe.ka.Eb.prototype.log=olympe.ka.Eb.prototype.log;olympe.ka.Eb.prototype.debug=olympe.ka.Eb.prototype.debug;olympe.ka.Eb.prototype.trace=olympe.ka.Eb.prototype.trace;
|
|
266
|
+
olympe.ka.Eb.C={Lv:0,Rf:1,su:2,Bl:3,$v:4,xb:5,qt:6,Ei:7};olympe.ka.Eb.F={0:'TRACE',1:'DEBUG',2:'LOG',3:'INFO',4:'WARN',5:'ERROR',6:'FATAL',7:'NOTHING'};olympe.ka.Ta=class{Vc(){}};olympe.ka.oe={};function tb(a,b,c,d){a.Ga[b](`[OLYMPE.${c}]:`,d.join(' '));if(0<a.Z.size){var e=new Date;e=('00'+e.getHours()).substring(-2)+':'+('00'+e.getMinutes()).substring(-2)+':'+('00'+e.getSeconds()).substring(-2)+'.'+('00'+e.getMilliseconds()).substring(-3);for(const f of a.Z.values())f(e,c,b,...d)}}
|
|
267
|
+
olympe.ka.oe.Eb=class{constructor(a,b){this.name=a;const c=b instanceof rxjs.Observable;this.F=c?olympe.ka.Eb.C.Bl:b;c&&b.subscribe(d=>{this.F=d});this.G=a.toUpperCase();this.Z=new Map;this.Ga=console}ma(){return this.name}O(){return this.F}J(){return this.F<=olympe.ka.Eb.C.Lv}C(){return this.F<=olympe.ka.Eb.C.Rf}T(){return this.F<=olympe.ka.Eb.C.su}ja(){return this.F<=olympe.ka.Eb.C.Bl}va(){return this.F<=olympe.ka.Eb.C.$v}aa(){return this.F<=olympe.ka.Eb.C.xb}ea(){return this.F<=olympe.ka.Eb.C.qt}trace(...a){this.J()&&
|
|
268
|
+
tb(this,'trace',this.G,a)}debug(...a){this.C()&&tb(this,'debug',this.G,a)}log(...a){this.T()&&tb(this,'log',this.G,a)}info(...a){this.ja()&&tb(this,'info',this.G,a)}warn(...a){this.va()&&tb(this,'warn',this.G,a)}error(...a){this.aa()&&tb(this,'error',this.G,a)}fatal(...a){this.ea()&&tb(this,'error',this.G,a)}};olympe.ka.oe.Eb.ya=[olympe.ka.Eb];olympe.ka.oe.Ta=class{constructor(a,b,c){this.C=a;this.F=parseInt(b,10);this.G=c;this.channels=new Map;this.H=this.Vc('logging');this.H.info('Logging initialized, global log level is '+olympe.ka.Eb.F[b])}Vc(a){var b=this.channels.get(a);if(!b){b=`${olympe.ka.V.Rs}.${a}`;var c;const d=new rxjs.BehaviorSubject(null!=(c=this.C.getParameter(b))?c:this.F);Ka(this.C,b,e=>{d.next(e)});c=this.G;b=`${b}.${olympe.ka.V.xv}`;Object.prototype.hasOwnProperty.call(this.C.parameters,b.toLowerCase())&&(c=!0===this.C.getParameter(b));
|
|
269
|
+
b=new olympe.ka.oe.Eb(a,d.asObservable(),c);this.channels.set(a,b)}return b}};olympe.ka.oe.Ta.ya=[olympe.ka.Ta];olympe.ka.R={Ea:'logging.Manager'};olympe.ka.V={Uo:'logging',Vo:'logging.showLogLevel',Rs:'logging',xv:'showLogLevel'};olympe.W.config(function(a){F(a,olympe.ka.V.Uo,olympe.ka.Eb.C.Bl);F(a,olympe.ka.V.Vo,!0);Na(a,olympe.ka.R.Ea,olympe.ka.oe.Ta,olympe.W.R.og,new olympe.W.oa(olympe.ka.V.Uo),new olympe.W.oa(olympe.ka.V.Vo))},'olympe.logging');olympe.W.run([olympe.ka.R.Ea],a=>{olympe.ka.ab=b=>a.Vc(b)},'Logging singleton getter initialization');olympe.D={};olympe.D.V={Kp:'df.nodeCreationThreshold'};const ub=[];function vb(){}function wb(){}olympe.D.K=class a{constructor(b,c,d){this.C=void 0===b?vb:b;this.F=void 0===c?ub:c;this.Z=d}static J(){var b=[];return void 0===b||0===b.length?olympe.D.K.aa:new a(wb,b)}J(){return this.C?this.C():void 0}G(){return this.F?this.F:ub}O(){return null===this.C&&null===this.F}T(){return this.C===wb}};olympe.D.K.Z=new olympe.D.K;olympe.D.K.C=new olympe.D.K(null,null);olympe.D.K.aa=new olympe.D.K(wb);olympe.D.K.G=new olympe.D.K(()=>olympe.D.ba);
|
|
270
|
+
olympe.D.K.F=new olympe.D.K(()=>olympe.D.Qa);olympe.D.K.O=new olympe.D.K(()=>olympe.D.fa);olympe.D.K.T=new olympe.D.K(()=>olympe.D.$b);olympe.D.mh=class{U(){return''}Uc(){return''}destroy(){}fb(){return!1}od(){return!1}run(a,...b){return a(...b)}G(a){return a}getParent(){return null}Bf(){}Cc(){}Tc(){}vk(){}ja(){}onDestroy(){return''}Mf(){}Z(){return''}Vd(){}};olympe.D.mh.prototype.offDestroy=olympe.D.mh.prototype.Mf;olympe.D.mh.prototype.onDestroy=olympe.D.mh.prototype.onDestroy;let xb=0;olympe.W.run([new olympe.W.oa(olympe.D.V.Kp)],()=>{});
|
|
271
|
+
olympe.D.Xb=class{constructor(a='SimpleContext',b){++xb;this.hb=new Map;this.eb=new Map;this.Ga=new Map;this.ac=0;this.name=a;this.id=String(xb);this.J=this.yb=!1;(this.aa=void 0===b?olympe.D.Wa():b)&&this.aa.Cc(this);this.debug=!1}U(){return this.id}Uc(){return this.name}run(a,...b){if(!this.yb){var c=olympe.D.ps(this);a=a(...b);c&&olympe.D.ps(c);return a}}G(a){return(...b)=>this.run(a,...b)}destroy(){if(!this.yb&&!this.J){this.J=!0;this.ja();for(const a of this.eb.keys())this.eb.has(a)&&this.eb.get(a)();
|
|
272
|
+
this.eb.clear();this.Ga.clear();this.aa&&(this.aa.Tc(this,!1),this.aa=null);this.yb=!0;this.J=!1;this.ja()}}fb(){return this.yb}od(){return this.J}Cc(a){if(!this.yb){var b;olympe.D.jb(a)?b=a.Da:olympe.D.an(a)&&(b=a);b&&this.hb.set(b.U(),b)}}Tc(a,b=!0){let c;olympe.D.jb(a)?c=a.Da:olympe.D.an(a)&&(c=a);c&&this.hb.has(c.U())&&(b&&c.vk(this),this.hb.delete(c.U()))}vk(){this.aa=null;this.destroy()}ja(){const a=this.hb;for(const b of a.keys())a.has(b)&&a.get(b).vk(this);this.hb.clear();for(const b of this.Ga.keys())this.Ga.has(b)&&
|
|
273
|
+
this.Ga.get(b)();this.Ga.clear()}onDestroy(a,b){void 0===b&&(++this.ac,b=String(this.ac));this.eb.set(b,a);return b}Mf(a){this.eb.delete(a)}Z(a){if(void 0===b){++this.ac;var b=String(this.ac)}this.Ga.set(b,a);return b}Vd(a){this.Ga.delete(a)}Bf(a){this.aa&&this.aa.Tc(this,!1);(this.aa=a||null)&&this.aa.Cc(this)}getParent(){return this.aa}};olympe.D.Hq=class extends olympe.D.Xb{constructor(){super('Root',null)}destroy(){}onDestroy(){return''}Mf(){}};olympe.D.mh.ya=[olympe.D.mh];let yb=0;
|
|
274
|
+
function zb(a,b){a.ea||(a.ea=new Map);a.ea.set(b.U(),b);switch(b.Gc()){case olympe.D.Node.C.wh:break;case olympe.D.Node.C.Ih:break;case olympe.D.Node.C.Rj:case olympe.D.Node.C.Sf:olympe.D.H.warn('Not bad as such but should not happen!');break;case olympe.D.Node.C.nh:Ab(a,olympe.D.Node.C.nh);break;case olympe.D.Node.C.OBSOLETE:a.oc=!0;a.C!==olympe.D.Node.C.nh&&Ab(a,olympe.D.Node.C.OBSOLETE);break;case olympe.D.Node.C.Qd:olympe.D.H.warn('Adding a destroyed node as upstream => should never happen!');break;
|
|
275
275
|
default:olympe.D.H.warn('Unknown state, investigate: ',b.Gc())}Bb(b,a)}
|
|
276
|
-
function Cb(a){if(a.Cd){var b=[],c=[];if(a.Nf)if(a.Nf instanceof olympe.D.Node)if(Db(a.Nf))b=a.Nf.Gb;else return;else b=a.Nf;else b=null;if(null!==a.
|
|
276
|
+
function Cb(a){if(a.Cd){var b=[],c=[];if(a.Nf)if(a.Nf instanceof olympe.D.Node)if(Db(a.Nf))b=a.Nf.Gb;else return;else b=a.Nf;else b=null;if(null!==a.va){const e=a.dg;for(let f=0,g=a.va.length;f<g;f++)if(null!==e&&-1<e.indexOf(f)){const h=a.va[f];if(Db(h))c.push(h.Gb);else return}else c.push(a.va[f])}if(a.Cd instanceof Function)var d=a.Cd;else b&&(b[a.Cd]||olympe.D.H.warn('looks like you forget a cast somewhere around '+a.Cd),d=b[a.Cd]);a.run(()=>{a.ja();if(void 0!==d){const e=d.apply(b,c);e&&e.qr?
|
|
277
277
|
Eb(a,e.Da):e instanceof olympe.D.Node?Eb(a,e):(K(a,e),void 0===e&&void 0===a.valueType&&Ab(a,olympe.D.Node.C.Ih))}else Fb(a)})}}function L(a){void 0===a.Ub&&(a.Ub=a.valueType===olympe.D.Proxy?Gb(void 0,a.Ud):Gb(a.valueType,a.Ud),a.Ub.Da=a);return a.Ub}function Hb(a){void 0!==a.O&&(Ib(a.O,a),a.O=void 0)}function Jb(a){if(a.C===olympe.D.Node.C.OBSOLETE&&(a.C=olympe.D.Node.C.Ih,null!==a.T))for(const b of a.T.values())Kb(b)}function Ab(a,b){b!==a.C&&(a.C=b)}
|
|
278
|
-
function Lb(a){if(a.C!==olympe.D.Node.C.OBSOLETE&&a.C!==olympe.D.Node.C.
|
|
278
|
+
function Lb(a){if(a.C!==olympe.D.Node.C.OBSOLETE&&a.C!==olympe.D.Node.C.Rj&&a.C!==olympe.D.Node.C.wh&&a.C!==olympe.D.Node.C.nh){Ab(a,olympe.D.Node.C.Rj);var b=a.T;if(b)for(const c of b.values())b.has(c.U())&&Lb(c);Ab(a,olympe.D.Node.C.OBSOLETE)}}function Mb(a,b,c){if(a.C!==olympe.D.Node.C.Sf)if(b===a.O)K(a,c,!0);else{if(a.C===olympe.D.Node.C.OBSOLETE||a.C===olympe.D.Node.C.Rj)a.oc=!0;Cb(a)}}
|
|
279
279
|
function K(a,b,c){b instanceof olympe.D.Node&&(olympe.D.H.warn('We are setting the value of a node as a node, that should never happen?'),b=b.Gb);a.Fb||c||void 0===a.O||Hb(a);if(void 0!==b){if((a.Fb||a.C===olympe.D.Node.C.Ih||a.C===olympe.D.Node.C.OBSOLETE)&&!olympe.D.jb(b)&&void 0!==a.Gb){if(null===b&&null===a.Gb){Jb(a);return}if(null!==b&&null!==a.Gb&&(b.valueOf()===a.Gb.valueOf()||a.Gb.Fa&&a.Gb.Fa(b))){Jb(a);return}}if(!0===a.Fb)olympe.D.H.error("Circular dependency detected: updating a downstream node caused this node's (#"+
|
|
280
280
|
a.U()+') value to get updated !');else{a.C===olympe.D.Node.C.Qd&&olympe.D.H.warn(`trying to set a value on a destroyed node (#${a.U()} ${a.ld?', '+a.ld:''})`);a.C===olympe.D.Node.C.Sf&&olympe.D.H.warn(`trying to set a value on a node being destroyed (#${a.U()} ${a.ld?', '+a.ld:''})`);a.Fb=!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
|
|
281
281
|
Object?d=!0:b.toLowerCase()!==e.toLowerCase()&&a.valueType!==Object&&(d=!0),d&&('string'===b.toLowerCase()&&a.valueType===olympe.D.Qa?(c=olympe.D.Ab(c),d=!1):'number'===b.toLowerCase()&&a.valueType===olympe.D.ba?(c=olympe.D.ra(c),d=!1):'boolean'===b.toLowerCase()&&a.valueType===olympe.D.fa&&(c=olympe.D.Sb(c),d=!1)));a.Gb=c;Ab(a,olympe.D.Node.C.Ih);if(b=a.T){d=0;for(const f of b.values())0<d&&Lb(f),d++;for(const f of b.values())Mb(f,a,c)}a.Fb=!1}}}
|
|
282
282
|
function Nb(a,b){if(a.C!==olympe.D.Node.C.Sf&&a.C!==olympe.D.Node.C.Qd&&(a.C!==olympe.D.Node.C.wh||a.Cd)){var c=void 0!==a.defaultValue;a.Cd&&b!==a.O&&a.ja();if(c)K(a,a.defaultValue,!0);else if(a.Gb=void 0,Ab(a,olympe.D.Node.C.wh),b=a.T)for(const d of b.values())Nb(d,a)}}function Fb(a){if(a.C!==olympe.D.Node.C.nh){Ab(a,olympe.D.Node.C.nh);var b=a.T;if(b)for(const c of b.values())Fb(c);a.ja();void 0!==a.O&&Hb(a);a.Gb=a.defaultValue}}function Db(a){return a.C===olympe.D.Node.C.Ih}
|
|
283
|
-
function Eb(a,b){b===a?olympe.D.H.error('Setting a node as provider of itself. Ignoring'):(a.O&&a.O!==b&&Hb(a),Bb(b,a),Db(b)?K(a,b.Gb,!0):void 0!==a.defaultValue?K(a,a.defaultValue,!0):Nb(a),a.O=b)}function Ob(a,b){a.Cd&&(a.Cd=void 0);a.ld='Repeater';Eb(a,b)}function Kb(a){a.O?Jb(a):null!==a.ea&&0===Array.from(a.ea.values()).filter(b=>!Db(b)).length&&(a.
|
|
283
|
+
function Eb(a,b){b===a?olympe.D.H.error('Setting a node as provider of itself. Ignoring'):(a.O&&a.O!==b&&Hb(a),Bb(b,a),Db(b)?K(a,b.Gb,!0):void 0!==a.defaultValue?K(a,a.defaultValue,!0):Nb(a),a.O=b)}function Ob(a,b){a.Cd&&(a.Cd=void 0);a.ld='Repeater';Eb(a,b)}function Kb(a){a.O?Jb(a):null!==a.ea&&0===Array.from(a.ea.values()).filter(b=>!Db(b)).length&&(a.oc&&(a.oc=!1,Cb(a)),Jb(a))}
|
|
284
284
|
function Bb(a,b){a.T||(a.T=new Map);a.T.set(b.U(),b);a.C===olympe.D.Node.C.Qd&&olympe.D.H.warn('adding a downstream node on a deleted one (#'+a.U()+') !')}function Ib(a,b){a.T&&(b=b.U(),a.T.has(b)&&(a.T.delete(b),Pb(a)))}function Pb(a){if(null===a.getParent()){var b=a.T;b&&0<b.size||a.destroy()}}
|
|
285
|
-
olympe.D.Node=class extends olympe.D.Xb{constructor({valueType:a,Cd:b,Sy:c=!0,Nf:d,
|
|
285
|
+
olympe.D.Node=class extends olympe.D.Xb{constructor({valueType:a,Cd:b,Sy:c=!0,Nf:d,Xm:e,debug:f=!1,dg:g=null,ld:h='Node',Xi:k}={}){++yb;super(String(yb));this.debug=!!f;this.ld=h;h&&'string'===typeof h||(b?this.ld=b.name?b.name:'anon()':this.ld='Node');this.va=e&&0<e.length?e:null;this.dg=g&&0<g.length?g:null;this.valueType=a;this.Gb=void 0;this.Fb=!1;this.C=olympe.D.Node.C.wh;this.oc=!1;this.T=this.ea=null;this.Cd=b;this.Nf=d||null;this.defaultValue=this.Ub=this.O=void 0;this.Xi=k;d&&d instanceof
|
|
286
286
|
olympe.D.Node&&zb(this,d);if(g)for(b=0;b<g.length;b++)a=e[g[b]],zb(this,a);c&&Cb(this)}eh(a){this.defaultValue=a;this.C===olympe.D.Node.C.wh&&K(this,a,!0);return this}Yi(a){this.valueType=a}Mb(){return this.valueType||Object}asObservable(a=olympe.D.Wa()){return new rxjs.Observable(b=>{const c=a.run(()=>olympe.D.createNode(this.valueType,b.next.bind(b),null,[this],[0],`Observable of ${this.ld}`));c.onDestroy(()=>b.complete());return()=>c.destroy()})}Gc(){return this.C}fb(){return this.C===olympe.D.Node.C.Qd}od(){return this.C===
|
|
287
287
|
olympe.D.Node.C.Sf}Ud(...a){if(this.Xi instanceof Function)return this.Xi(...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.Gc();a!==olympe.D.Node.C.Sf&&a!==olympe.D.Node.C.Qd||olympe.D.H.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.jb(g)&&b.push(g.Da);else for(let h=0,k=a.length;h<k;h++)g=a[h],f=e[g],void 0!==f&&null!==f&&f.Og&&(e[g]=f.Da,b.push(g));return L(new olympe.D.Node({valueType:d.J(),
|
|
288
|
-
Cd:c,Nf:this,
|
|
289
|
-
b.O&&b.O.U()===this.U()?b.O=void 0:b.destroy()}a.clear()}this.T=null;super.destroy();if(this.ea){for(const c of this.ea.values())this.ea.has(c.U())&&Ib(c,this);this.ea.clear()}this.ea=null;this.O&&(Ib(this.O,this),this.O=void 0);this.Gb=void 0;this.
|
|
290
|
-
olympe.D.Node.C={wh:0,Ih:1,nh:3,
|
|
288
|
+
Cd:c,Nf:this,Xm:e,debug:!1,dg:b,ld:'Proxy.'+c+'()'}))}vk(a){if(null===this.getParent())olympe.D.H.warn('context is undefined, investigate');else if(this.getParent()!==a){olympe.D.H.warn('Investigate a potential issue in creator-createe link: create node mismatch',a,this.getParent());return}this.Bf(null);Pb(this)}destroy(){var a=this.C;if(a!==olympe.D.Node.C.Sf&&a!==olympe.D.Node.C.Qd){Ab(this,olympe.D.Node.C.Sf);if(a=this.T){for(const c of a.values())if(a.has(c.U())){var b=c;b.ea&&b.ea.delete(this.U());
|
|
289
|
+
b.O&&b.O.U()===this.U()?b.O=void 0:b.destroy()}a.clear()}this.T=null;super.destroy();if(this.ea){for(const c of this.ea.values())this.ea.has(c.U())&&Ib(c,this);this.ea.clear()}this.ea=null;this.O&&(Ib(this.O,this),this.O=void 0);this.Gb=void 0;this.va&&(this.va.length=0,this.va=null);this.dg&&(this.dg.length=0,this.dg=null);this.Xi=this.Cd=void 0;this.defaultValue=this.Nf=null;this.ld=`** Destroyed ** ${this.ld}`;Ab(this,olympe.D.Node.C.Qd)}}Uc(){return this.ld}};olympe.D.Node.F='rootNode';
|
|
290
|
+
olympe.D.Node.C={wh:0,Ih:1,nh:3,Rj:4,OBSOLETE:5,Sf:6,Qd:7};function Gb(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.H.error('investigate');c=Object.create(Qb(c,a.prototype));c.Lh=a;c.rr=b;return c}function Qb(a,b){Object.prototype.hasOwnProperty.call(b,olympe.D.Proxy.Yl)||Object.defineProperty(b,olympe.D.Proxy.Yl,{enumerable:!1,configurable:!1,writable:!1,value:Rb(a,b)});return b[olympe.D.Proxy.Yl]}
|
|
291
291
|
function Sb(a,b){if(a.Lh!==b){a.Lh=b;b.prototype||olympe.D.H.error('Cast not possible, provided type is not a valid type!');var c=Qb(a,b.prototype);Object.setPrototypeOf?Object.setPrototypeOf(a,c):a.__proto__=c;a.Da&&a.Da.Yi(b)}}
|
|
292
292
|
function Rb(a,b){let c={};if(b.prototype)olympe.D.H.error('first level of prototyping, investigate');else if(b.__proto__)c=Object.create(Qb(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].L;null===e||e&&e.O()?c[d]=function(...f){var g=this.Da;if(g&&Db(g)&&(g=g.Gb)&&g[d]&&'function'===typeof g[d])return g[d].apply(g,f)}:(e=e||b[d].__oSig__||olympe.D.K.Z,c[d]=function(...f){f=this.rr.call(this.Da,
|
|
293
293
|
...f,e,d);const g=e.Z;if(g){const h=this.Da.Gb;h&&h[g]&&Sb(f,h[g])}return e.T()?this:f})}});return c}function Tb(a,b){K(a.Da,b)}function Ub(a){Nb(a.Da)}function Vb(a,b){Ob(a.Da,olympe.D.Jf(b)?b:b.Da)}function Wb(a,b){olympe.D.jb(b)||olympe.D.Jf(b)?Vb(a,b):Tb(a,b)}
|
|
294
|
-
olympe.D.Proxy=class{constructor(a,b){this.Da=null;this.Lh=a;this.rr=b}static jb(a){return!(!a||!a.Og)}Fa(a){return olympe.D.
|
|
295
|
-
olympe.D.ba=class{constructor(a){this.value=void 0===a||null===a?0:a}toJSON(){return'{ "type": "number", "value": '+JSON.stringify(this.value)+' }'}static Pb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.D.ra(b.value)}
|
|
296
|
-
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.
|
|
297
|
-
g===c&&e()}});return d.sb()}ae(a){return olympe.D.
|
|
298
|
-
c.valueOf()),olympe.D.ba,'ONumber.div')}vy(a){return olympe.D.
|
|
299
|
-
a],(b,c)=>olympe.D.Sb(b.Fa(c)),olympe.D.fa,'ONumber.oEquals')}Fa(a){return this.valueOf()===(void 0!==a&&null!==a?a.valueOf():void 0)}valueOf(){return void 0!==this.value?this.value.valueOf():void 0}Fx(){return this.valueOf()}
|
|
300
|
-
a],(b,c)=>b.valueOf()<=c.valueOf()?b:olympe.D.ra(c),olympe.D.ba,'ONumber.returnsSmallest')}my(a){return olympe.D.
|
|
301
|
-
b){return olympe.D.jb(a)||olympe.D.jb(b)?olympe.D.qe([a,b],(c,d)=>olympe.D.ra(this.valueOf()*d.valueOf()+c.valueOf()*(1-d.valueOf())),olympe.D.ba):olympe.D.ra(this.valueOf()*b.valueOf()+a.valueOf()*(1-b.valueOf()))}static cw(a,b,c,d){'number'===typeof a&&(a=olympe.D.$d(a));'number'===typeof b&&(b=olympe.D.$d(b));'number'===typeof c&&(c=olympe.D.$d(c));let e=0;const f=olympe.D.$d(0);let g,h;void 0!==b&&void 0!==c&&olympe.D.ij(b
|
|
302
|
-
const k=(l,n)=>{n=olympe.D.$d(n);const p=olympe.D.ba.animate(n,500);Vb(f,p);Tb(n,olympe.D.ra(l));e=l};olympe.D.qe([a],l=>{e+=l.valueOf();e>h?k(h,e):e<g?k(g,e):Vb(f,olympe.D.$d(e))},olympe.D.ba);void 0!==b&&olympe.D.
|
|
303
|
-
p)}});return f}static offset(a){let b;return olympe.D.qe([a],c=>{void 0===b&&(b=c);return olympe.D.ra(c-b)},olympe.D.ba,'offset')}static Dr(a){let b,c,d;return olympe.D.
|
|
304
|
-
e=window.performance.now();b=b.ae((f.valueOf()+c.valueOf())/2*(e-d));c=f;d=e;return b},olympe.D.ba,'integrate')}static Hw(a){let b;return olympe.D.
|
|
305
|
-
return e=olympe.D.
|
|
306
|
-
olympe.D.
|
|
294
|
+
olympe.D.Proxy=class{constructor(a,b){this.Da=null;this.Lh=a;this.rr=b}static jb(a){return!(!a||!a.Og)}Fa(a){return olympe.D.ua([this,a],(b,c)=>b===c,Boolean)}Ad(a){return olympe.D.ua([this,a],(b,c)=>null===b||null===c?b===c?olympe.D.fa.F:olympe.D.fa.C:b.valueOf()===c.valueOf()?olympe.D.fa.F:olympe.D.fa.C,olympe.D.fa)}asObservable(a){return this.Da.asObservable(a)}qr(){return this.Da}};olympe.D.Proxy.Yl='__opp__';olympe.D.Proxy.prototype.Og=!0;function Xb(a,b){a.node.eh(b);return a}olympe.D.Lj=class{constructor(a,b='FlowSource'){this.node=olympe.D.createNode(a,void 0,void 0,void 0,void 0,b)}update(a){olympe.D.jb(a)?K(this.node,olympe.D.Na(a)):K(this.node,a);return this}repeat(a){Ob(this.node,olympe.D.jb(a)?a.Da:a);return this}clear(){Nb(this.node);return this}sb(){return L(this.node)}getContext(){return this.node}};function Yb(a,b,c=1E3,d,e){const f=olympe.D.ec(olympe.D.ba),g=d||olympe.D.ba.zo.Cp;let h,k,l,n;f.update(olympe.D.ra(a));const p=window.performance.now(),q=b.valueOf();l=q-a.valueOf();if(0!==l&&void 0===n){const r=()=>{f.getContext().fb()||(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.ra(h)),1===k&&void 0!==e&&e(h),1>k&&(n=window.requestAnimationFrame(r)))};n=window.requestAnimationFrame(r)}return f.sb()}
|
|
295
|
+
olympe.D.ba=class{constructor(a){this.value=void 0===a||null===a?0:a}toJSON(){return'{ "type": "number", "value": '+JSON.stringify(this.value)+' }'}static Pb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.D.ra(b.value)}sn(){return'number'===typeof this.value&&!isNaN(this.value)}isNaN(){return olympe.D.Sb(!this.sn())}Oc(){return null===this.value||void 0===this.value||void 0===this.value.toString||isNaN(this.value)?olympe.D.Ab(''):olympe.D.Ab(this.value.toString())}toString(a,b){return void 0!==
|
|
296
|
+
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.sn()?this.valueOf().toFixed(a):''}static max(a){const b=new Map;let c=-Infinity;const d=olympe.D.ec(olympe.D.ba,'ONumber.max result'),e=()=>{c=-Infinity;for(const f of b.values())f>c&&(c=f);d.update(olympe.D.ra(c))};a.forEach((f,g)=>{olympe.D.Nc([f],h=>{b.set(g,h.valueOf());e()})},f=>{if(!d.getContext().fb()){var g=b.get(f);b.delete(f);
|
|
297
|
+
g===c&&e()}});return d.sb()}ae(a){return olympe.D.ua([this,a],(b,c)=>olympe.D.ra(b.valueOf()+c.valueOf()),olympe.D.ba,'ONumber.plus')}bh(a){return olympe.D.ua([this,a],(b,c)=>olympe.D.ra(b.valueOf()-c.valueOf()),olympe.D.ba,'ONumber.minus')}round(){return olympe.D.ra(Math.round(this.valueOf()))}qj(){return olympe.D.ra(-this.valueOf())}Jk(a){return olympe.D.ua([this,a],(b,c)=>olympe.D.ra(b.valueOf()*c.valueOf()),olympe.D.ba,'ONumber.mul')}aj(a){return olympe.D.ua([this,a],(b,c)=>olympe.D.ra(b.valueOf()/
|
|
298
|
+
c.valueOf()),olympe.D.ba,'ONumber.div')}vy(a){return olympe.D.ua([this,a],(b,c)=>olympe.D.ra(b.valueOf()%c.valueOf()),olympe.D.ba,'ONumber.div')}floor(){return olympe.D.ra(Math.floor(this.valueOf()))}ceil(){return olympe.D.ra(Math.ceil(this.valueOf()))}trunc(){return olympe.D.ra(Math.trunc(this.valueOf()))}log(){return olympe.D.ra(Math.log(this.valueOf()))}pow(a){return olympe.D.ua([this,a],(b,c)=>olympe.D.ra(Math.pow(b.valueOf(),c.valueOf())),olympe.D.ba,'ONumber.pow')}exp(){return olympe.D.ra(Math.exp(this.valueOf()))}Ad(a){return olympe.D.ua([this,
|
|
299
|
+
a],(b,c)=>olympe.D.Sb(b.Fa(c)),olympe.D.fa,'ONumber.oEquals')}Fa(a){return this.valueOf()===(void 0!==a&&null!==a?a.valueOf():void 0)}valueOf(){return void 0!==this.value?this.value.valueOf():void 0}Fx(){return this.valueOf()}$m(a){return olympe.D.ua([this,a],(b,c)=>b.valueOf()>c.valueOf()?olympe.D.fa.F:olympe.D.fa.C,olympe.D.fa,'ONumber.isBiggerThan')}Wy(a){return olympe.D.ua([this,a],(b,c)=>b.valueOf()>=c.valueOf()?b:olympe.D.ra(c),olympe.D.ba,'ONumber.returnsBiggest')}ls(a){return olympe.D.ua([this,
|
|
300
|
+
a],(b,c)=>b.valueOf()<=c.valueOf()?b:olympe.D.ra(c),olympe.D.ba,'ONumber.returnsSmallest')}my(a){return olympe.D.ua([this,a],(b,c)=>b.valueOf()<c.valueOf()?olympe.D.fa.F:olympe.D.fa.C,olympe.D.fa,'ONumber.isSmallerThan')}sin(){return olympe.D.ra(Math.sin(this.valueOf()))}cos(){return olympe.D.ra(Math.cos(this.valueOf()))}atan2(a){return olympe.D.jb(a)?olympe.D.qe([a],b=>olympe.D.ra(Math.atan2(this.valueOf(),b.valueOf())),olympe.D.ba):olympe.D.ra(Math.atan2(this.valueOf(),a.valueOf()))}abs(){return olympe.D.ra(Math.abs(this.valueOf()))}kj(a,
|
|
301
|
+
b){return olympe.D.jb(a)||olympe.D.jb(b)?olympe.D.qe([a,b],(c,d)=>olympe.D.ra(this.valueOf()*d.valueOf()+c.valueOf()*(1-d.valueOf())),olympe.D.ba):olympe.D.ra(this.valueOf()*b.valueOf()+a.valueOf()*(1-b.valueOf()))}static cw(a,b,c,d){'number'===typeof a&&(a=olympe.D.$d(a));'number'===typeof b&&(b=olympe.D.$d(b));'number'===typeof c&&(c=olympe.D.$d(c));let e=0;const f=olympe.D.$d(0);let g,h;void 0!==b&&void 0!==c&&olympe.D.ij(b.$m(c),()=>{olympe.ka.ab('df').warn('You have a min bigger than max, cap your inputs')});
|
|
302
|
+
const k=(l,n)=>{n=olympe.D.$d(n);const p=olympe.D.ba.animate(n,500);Vb(f,p);Tb(n,olympe.D.ra(l));e=l};olympe.D.qe([a],l=>{e+=l.valueOf();e>h?k(h,e):e<g?k(g,e):Vb(f,olympe.D.$d(e))},olympe.D.ba);void 0!==b&&olympe.D.dn(b.valueOf(),l=>{if(g!==l&&(g=l,g>e)){const n=olympe.D.$d(e),p=olympe.D.ba.animate(n,400,d);l=olympe.D.ra(g);K(n.Da,l);e=g;Vb(f,p)}});void 0!==c&&olympe.D.dn(c.valueOf(),l=>{if(h!==l&&(h=l,h<e)){const n=olympe.D.$d(e),p=olympe.D.ba.animate(n,400,d);l=olympe.D.ra(h);K(n.Da,l);e=h;Vb(f,
|
|
303
|
+
p)}});return f}static offset(a){let b;return olympe.D.qe([a],c=>{void 0===b&&(b=c);return olympe.D.ra(c-b)},olympe.D.ba,'offset')}static Dr(a){let b,c,d;return olympe.D.ua([a],e=>{if(void 0===b)return b=e,c=window.performance.now(),olympe.D.ra(0);d=window.performance.now();const f=olympe.D.ra((e.valueOf()-b.valueOf())/(d-c));b=e;c=d;return f},olympe.D.ba,'derivative')}static by(a){let b=olympe.D.ra(0),c,d,e;return olympe.D.ua([a],f=>{if(void 0===c)return c=f,d=window.performance.now(),olympe.D.ra(0);
|
|
304
|
+
e=window.performance.now();b=b.ae((f.valueOf()+c.valueOf())/2*(e-d));c=f;d=e;return b},olympe.D.ba,'integrate')}static Hw(a){let b;return olympe.D.ua([a],c=>{void 0===b&&(b=c.valueOf());const d=olympe.D.ra(c.valueOf()-b.valueOf());b=c;return d},olympe.D.ba,'diff')}static xw(a,b,c){return olympe.D.qe([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.ra(d>=e?d<=f?d:f:e)},olympe.D.ba)}static animate(a,b,c,d){let e;
|
|
305
|
+
return e=olympe.D.ua([a],f=>{const g=olympe.D.Na(b,1E3),h=olympe.D.Na(e);return void 0===h?olympe.D.ra(f):Yb(h,f,g,c,k=>{d&&d(k)})},olympe.D.ba)}static nw(a,b,c){let d,e,f,g,h,k,l=olympe.D.$d(),n;olympe.D.Nc([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);Tb(l,olympe.D.ra(g));1===h&&(clearTimeout(n),n=void 0)},0))});return l}static Oc(a){return olympe.D.jb(a)?
|
|
306
|
+
olympe.D.ua([a],b=>olympe.D.Ab(b.valueOf().toString()),olympe.D.Qa):olympe.D.Ab(a)}static qj(a){return olympe.D.jb(a)?olympe.D.ua([a],b=>olympe.D.ra(-b.valueOf()),olympe.D.ba):olympe.D.ra(-a.valueOf())}static ae(a,b){return olympe.D.jb(a)||olympe.D.jb(b)?olympe.D.ua([a,b],(c,d)=>olympe.D.ra(c.valueOf()+d.valueOf()),olympe.D.ba,'plus'):olympe.D.ra(a.valueOf()+b.valueOf())}static bh(a,b){return olympe.D.jb(a)||olympe.D.jb(b)?olympe.D.qe([a,b],(c,d)=>olympe.D.ra(c.valueOf()-d.valueOf()),olympe.D.ba,
|
|
307
307
|
'minus'):olympe.D.ra(a.valueOf()-b.valueOf())}static aj(a,b){return olympe.D.jb(a)||olympe.D.jb(b)?olympe.D.qe([a,b],(c,d)=>olympe.D.ra(c.valueOf()/d.valueOf()),olympe.D.ba,'div'):olympe.D.ra(a.valueOf()/b.valueOf())}static Qy(a,b){if(void 0===b)return a;olympe.D.Nc([b],c=>{c=olympe.D.ra(a.Da.Gb.valueOf()+c.valueOf());K(a.Da,c)},'plusEqual');return a}};olympe.D.ba.ZERO=new olympe.D.ba(0);olympe.D.ba.ONE=new olympe.D.ba(1);olympe.D.ba.Ov=new olympe.D.ba(2);olympe.D.ba.PI=new olympe.D.ba(Math.PI);
|
|
308
|
-
olympe.D.ba.Ht=new olympe.D.ba(Infinity);olympe.D.ba.Du=new olympe.D.ba(-Infinity);olympe.D.ba.Jp=new olympe.D.ba(NaN);olympe.D.ba.DB=olympe.D.ba.Qy;olympe.D.ba.pz=olympe.D.ba.cw;olympe.D.ba.rB=olympe.D.ba.offset;olympe.D.ba.Xz=olympe.D.ba.Dr;olympe.D.ba.MD=olympe.D.ba.Dr;olympe.D.ba.UA=olympe.D.ba.by;olympe.D.ba.Yz=olympe.D.ba.Hw;olympe.D.ba.Fz=olympe.D.ba.xw;olympe.D.ba.qz=olympe.D.ba.animate;olympe.D.ba.rz=olympe.D.ba.nw;olympe.D.ba.WC=olympe.D.ba.Oc;olympe.D.ba.XC=olympe.D.ba.
|
|
308
|
+
olympe.D.ba.Ht=new olympe.D.ba(Infinity);olympe.D.ba.Du=new olympe.D.ba(-Infinity);olympe.D.ba.Jp=new olympe.D.ba(NaN);olympe.D.ba.DB=olympe.D.ba.Qy;olympe.D.ba.pz=olympe.D.ba.cw;olympe.D.ba.rB=olympe.D.ba.offset;olympe.D.ba.Xz=olympe.D.ba.Dr;olympe.D.ba.MD=olympe.D.ba.Dr;olympe.D.ba.UA=olympe.D.ba.by;olympe.D.ba.Yz=olympe.D.ba.Hw;olympe.D.ba.Fz=olympe.D.ba.xw;olympe.D.ba.qz=olympe.D.ba.animate;olympe.D.ba.rz=olympe.D.ba.nw;olympe.D.ba.WC=olympe.D.ba.Oc;olympe.D.ba.XC=olympe.D.ba.qj;
|
|
309
309
|
olympe.D.ba.CB=olympe.D.ba.ae;olympe.D.ba.hB=olympe.D.ba.bh;olympe.D.ba.Zz=olympe.D.ba.aj;
|
|
310
|
-
olympe.D.ba.
|
|
310
|
+
olympe.D.ba.zo={Cp:function(a,b,c,d){return c*a/d+b},sA:function(a,b,c,d){a/=d;return c*a*a+b},CA:function(a,b,c,d){a/=d;return-c*a*(a-2)+b},oA:function(a,b,c,d){a/=d/2;if(1>a)return c/2*a*a+b;a--;return-c/2*(a*(a-2)-1)+b},hA:function(a,b,c,d){a/=d;return c*a*a*a+b},yA:function(a,b,c,d){a/=d;a--;return c*(a*a*a+1)+b},mA:function(a,b,c,d){a/=d/2;if(1>a)return c/2*a*a*a+b;a-=2;return c/2*(a*a*a+2)+b},tA:function(a,b,c,d){a/=d;return c*a*a*a*a+b},DA:function(a,b,c,d){a/=d;a--;return-c*(a*a*a*a-1)+b},
|
|
311
311
|
pA:function(a,b,c,d){a/=d/2;if(1>a)return c/2*a*a*a*a+b;a-=2;return-c/2*(a*a*a*a-2)+b},uA:function(a,b,c,d){a/=d;return c*a*a*a*a*a+b},EA:function(a,b,c,d){a/=d;a--;return c*(a*a*a*a*a+1)+b},qA:function(a,b,c,d){a/=d/2;if(1>a)return c/2*a*a*a*a*a+b;a-=2;return c/2*(a*a*a*a*a+2)+b},vA:function(a,b,c,d){return-c*Math.cos(a/d*(Math.PI/2))+c+b},FA:function(a,b,c,d){return c*Math.sin(a/d*(Math.PI/2))+b},rA:function(a,b,c,d){return-c/2*(Math.cos(Math.PI*a/d)-1)+b},kA:function(a,b,c,d){return c*Math.pow(2,
|
|
312
312
|
10*(a/d-1))+b},BA:function(a,b,c,d){return c*(-Math.pow(2,-10*a/d)+1)+b},nA:function(a,b,c,d){a/=d/2;if(1>a)return c/2*Math.pow(2,10*(a-1))+b;a--;return c/2*(-Math.pow(2,-10*a)+2)+b},gA:function(a,b,c,d){a/=d;return-c*(Math.sqrt(1-a*a)-1)+b},xA:function(a,b,c,d){a/=d;a--;return c*Math.sqrt(1-a*a)+b},lA:function(a,b,c,d){a/=d/2;if(1>a)return-c/2*(Math.sqrt(1-a*a)-1)+b;a-=2;return c/2*(Math.sqrt(1-a*a)+1)+b},bA:function(a,b,c,d){d=(a/=d)*a;return b+c*(4*d*a+-3*d)},cA:function(a,b,c,d){d=(a/=d)*a;return b+
|
|
313
313
|
c*(2*d*d+2*d*a+-3*d)},dA:function(a,b,c,d){d=(a/=d)*a;return b+c*(4*d*a+-9*d+6*a)},eA:function(a,b,c,d){d=(a/=d)*a;return b+c*(-2*d*d+10*d*a+-15*d+8*a)},AA:function(a,b,c,d){d=(a/=d)*a;const e=d*a;return b+c*(33*e*d+-106*d*d+126*e+-67*d+15*a)},zA:function(a,b,c,d){d=(a/=d)*a;const e=d*a;return b+c*(56*e*d+-175*d*d+200*e+-100*d+20*a)},jA:function(a,b,c,d){d=(a/=d)*a;a*=d;return b+c*(33*a*d+-59*d*d+32*a+-5*d)},iA:function(a,b,c,d){d=(a/=d)*a;a*=d;return b+c*(56*a*d+-105*d*d+60*a+-10*d)},wA:function(a,
|
|
314
|
-
b,c,d){return(a/=d)<1/2.75?7.5625*c*a*a+b:a<2/2.75?c*(7.5625*(a-=1.5/2.75)*a+.75)+b:a<2.5/2.75?c*(7.5625*(a-=2.25/2.75)*a+.9375)+b:c*(7.5625*(a-=2.625/2.75)*a+.984375)+b},fA:function(a,b,c,d){a=d-a;d=(a/=d)<1/2.75?7.5625*c*a*a:a<2/2.75?c*(7.5625*(a-=1.5/2.75)*a+.75):a<2.5/2.75?c*(7.5625*(a-=2.25/2.75)*a+.9375):c*(7.5625*(a-=2.625/2.75)*a+.984375);return c-d+b}};m=olympe.D.ba.prototype;m.toJSON.L=olympe.D.K.C;m.
|
|
315
|
-
m.toString.L=new olympe.D.K(()=>String,[]);m.toFixed.L=new olympe.D.K(()=>String,[]);m.ae.L=new olympe.D.K(()=>olympe.D.ba,[0]);m.bh.L=new olympe.D.K(()=>olympe.D.ba,[0]);m.round.L=olympe.D.K.G;m.
|
|
316
|
-
m.Ad.L=new olympe.D.K(()=>olympe.D.fa,[0]);m.Fa.L=olympe.D.K.C;m.valueOf.L=olympe.D.K.C;m.Fx.L=olympe.D.K.C;m.
|
|
317
|
-
a))}rs(){return olympe.D.ra(parseFloat(this.value))}toString(){return this.value}valueOf(){return this.value.valueOf()}Fa(a){return this.value===(void 0===a||null===a?void 0:a.valueOf())}Ad(a){return olympe.D.
|
|
318
|
-
olympe.D.fa,'OString.contains')}startsWith(a,b){return olympe.D.
|
|
319
|
-
olympe.D.ba,'OString.indexOf')}lastIndexOf(a,b){return olympe.D.
|
|
320
|
-
b){return olympe.D.
|
|
314
|
+
b,c,d){return(a/=d)<1/2.75?7.5625*c*a*a+b:a<2/2.75?c*(7.5625*(a-=1.5/2.75)*a+.75)+b:a<2.5/2.75?c*(7.5625*(a-=2.25/2.75)*a+.9375)+b:c*(7.5625*(a-=2.625/2.75)*a+.984375)+b},fA:function(a,b,c,d){a=d-a;d=(a/=d)<1/2.75?7.5625*c*a*a:a<2/2.75?c*(7.5625*(a-=1.5/2.75)*a+.75):a<2.5/2.75?c*(7.5625*(a-=2.25/2.75)*a+.9375):c*(7.5625*(a-=2.625/2.75)*a+.984375);return c-d+b}};m=olympe.D.ba.prototype;m.toJSON.L=olympe.D.K.C;m.sn.L=olympe.D.K.C;m.isNaN.L=olympe.D.K.O;m.Oc.L=olympe.D.K.F;
|
|
315
|
+
m.toString.L=new olympe.D.K(()=>String,[]);m.toFixed.L=new olympe.D.K(()=>String,[]);m.ae.L=new olympe.D.K(()=>olympe.D.ba,[0]);m.bh.L=new olympe.D.K(()=>olympe.D.ba,[0]);m.round.L=olympe.D.K.G;m.qj.L=olympe.D.K.G;m.Jk.L=new olympe.D.K(()=>olympe.D.ba,[0]);m.aj.L=new olympe.D.K(()=>olympe.D.ba,[0]);m.vy.L=new olympe.D.K(()=>olympe.D.ba,[0]);m.floor.L=olympe.D.K.G;m.ceil.L=olympe.D.K.G;m.trunc.L=olympe.D.K.G;m.log.L=olympe.D.K.G;m.pow.L=new olympe.D.K(()=>olympe.D.ba,[0]);m.exp.L=olympe.D.K.G;
|
|
316
|
+
m.Ad.L=new olympe.D.K(()=>olympe.D.fa,[0]);m.Fa.L=olympe.D.K.C;m.valueOf.L=olympe.D.K.C;m.Fx.L=olympe.D.K.C;m.$m.L=new olympe.D.K(()=>olympe.D.fa,[0]);m.Wy.L=new olympe.D.K(()=>olympe.D.ba,[0]);m.ls.L=new olympe.D.K(()=>olympe.D.ba,[0]);m.my.L=new olympe.D.K(()=>olympe.D.fa,[0]);m.sin.L=olympe.D.K.G;m.cos.L=olympe.D.K.G;m.atan2.L=new olympe.D.K(()=>olympe.D.ba,[0]);m.abs.L=olympe.D.K.G;m.kj.L=new olympe.D.K(()=>olympe.D.ba,[0,1]);olympe.D.Qa=class{constructor(a){this.value=a}toJSON(){return'{ "type": "string", "value": '+JSON.stringify(this.value)+' }'}static Pb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.D.Ab(b.value)}Ar(a){return olympe.D.Qa.concat(this,'.',a)}concat(...a){let b;Array.isArray(a[0])?b=a[0]:b=a;return olympe.D.ua([this,...b],(...c)=>{let d='';for(let e=0,f=c.length;e<f;e++)d=c[e]?d+c[e].valueOf():d+c[e];return olympe.D.Ab(d)},olympe.D.Qa,'OString.concat')}Oc(){return this}jz(a){return olympe.D.ra(parseInt(this.value,
|
|
317
|
+
a))}rs(){return olympe.D.ra(parseFloat(this.value))}toString(){return this.value}valueOf(){return this.value.valueOf()}Fa(a){return this.value===(void 0===a||null===a?void 0:a.valueOf())}Ad(a){return olympe.D.ua([this,a],(b,c)=>olympe.D.Sb(c&&b.valueOf()===c.valueOf()),olympe.D.fa,'OString.oEquals')}af(){return olympe.D.Sb(!this.value||0===this.value.length)}contains(a){return olympe.D.ua([this,a],(b,c)=>olympe.D.Sb((c instanceof olympe.D.Qa||'string'===typeof c)&&b.valueOf().includes(c.valueOf())),
|
|
318
|
+
olympe.D.fa,'OString.contains')}startsWith(a,b){return olympe.D.ua([this,a,b||0],(c,d,e)=>olympe.D.Sb(c.valueOf().startsWith(d.valueOf(),e.valueOf())),olympe.D.fa,'OString.startsWith')}endsWith(a,b){return olympe.D.ua([this,a,b||-1],(c,d,e)=>{e=0<=e.valueOf()?e.valueOf():this.Sm().valueOf()+e.valueOf()+1;return olympe.D.Sb(c.valueOf().endsWith(d.valueOf(),e))},olympe.D.fa,'OString.endsWith')}indexOf(a,b){return olympe.D.ua([this,a,b||0],(c,d,e)=>olympe.D.ra(c.valueOf().indexOf(d.valueOf(),e.valueOf())),
|
|
319
|
+
olympe.D.ba,'OString.indexOf')}lastIndexOf(a,b){return olympe.D.ua([this,a,b||Infinity],(c,d,e)=>olympe.D.ra(c.valueOf().lastIndexOf(d.valueOf(),e.valueOf())),olympe.D.ba,'OString.lastIndexOf')}slice(a,b){return olympe.D.ua([this,a,b],(c,d,e)=>olympe.D.Ab(c.valueOf().slice(d.valueOf(),e?e.valueOf():void 0)),olympe.D.Qa,'OString.slice')}Sm(){return olympe.D.ra(this.value.length)}threshold(a){return olympe.D.ua([this,a],(b,c)=>b.valueOf().length>=c.valueOf()?b:olympe.D.Qa.EMPTY,olympe.D.Qa,'OString.threshold')}toLowerCase(){return olympe.D.Ab(this.value.toLowerCase())}toUpperCase(){return olympe.D.Ab(this.value.toUpperCase())}trim(){return olympe.D.Ab(this.value.trim())}padStart(a,
|
|
320
|
+
b){return olympe.D.ua([this,a,b],(c,d,e)=>olympe.D.Ab(c.valueOf().padStart(d.valueOf(),e.valueOf())),olympe.D.Qa,'OString.padStart')}padEnd(a,b){return olympe.D.ua([this,a,b],(c,d,e)=>olympe.D.Ab(c.valueOf().padEnd(d.valueOf(),e.valueOf())),olympe.D.Qa,'OString.padEnd')}replace(a,b){return olympe.D.ua([this,a,b],(c,d,e)=>olympe.D.Ab(c.valueOf().replace(d.valueOf(),e.valueOf())),olympe.D.Qa,'OString.replace')}fz(a,b){return olympe.D.ua([this,a,b],(c,d,e)=>olympe.D.Ab(c.valueOf().substr(d.valueOf(),
|
|
321
321
|
e.valueOf())),olympe.D.Qa,'OString.subOStr')}static concat(...a){return olympe.D.Ab('').concat(...a)}};olympe.D.Qa.EMPTY=new olympe.D.Qa('');olympe.D.Qa.Av=new olympe.D.Qa(' ');m=olympe.D.Qa.prototype;m.toJSON.L=olympe.D.K.C;m.Ar.L=new olympe.D.K(()=>olympe.D.Qa,[0,1]);m.concat.L=olympe.D.K.F;m.Oc.L=olympe.D.K.F;m.jz.L=olympe.D.K.G;m.rs.L=olympe.D.K.G;m.toString.L=olympe.D.K.C;m.valueOf.L=olympe.D.K.C;m.Fa.L=olympe.D.K.C;m.Ad.L=new olympe.D.K(()=>olympe.D.fa,[0]);m.af.L=olympe.D.K.O;
|
|
322
|
-
m.contains.L=new olympe.D.K(()=>olympe.D.fa,[0]);m.startsWith.L=new olympe.D.K(()=>olympe.D.fa,[0,1]);m.endsWith.L=new olympe.D.K(()=>olympe.D.fa,[0,1]);m.indexOf.L=new olympe.D.K(()=>olympe.D.ba,[0,1]);m.lastIndexOf.L=new olympe.D.K(()=>olympe.D.ba,[0,1]);m.slice.L=new olympe.D.K(()=>olympe.D.Qa,[0,1]);m.
|
|
322
|
+
m.contains.L=new olympe.D.K(()=>olympe.D.fa,[0]);m.startsWith.L=new olympe.D.K(()=>olympe.D.fa,[0,1]);m.endsWith.L=new olympe.D.K(()=>olympe.D.fa,[0,1]);m.indexOf.L=new olympe.D.K(()=>olympe.D.ba,[0,1]);m.lastIndexOf.L=new olympe.D.K(()=>olympe.D.ba,[0,1]);m.slice.L=new olympe.D.K(()=>olympe.D.Qa,[0,1]);m.Sm.L=olympe.D.K.G;m.threshold.L=new olympe.D.K(()=>olympe.D.Qa,[0]);m.toLowerCase.L=olympe.D.K.F;m.toUpperCase.L=olympe.D.K.F;m.trim.L=olympe.D.K.F;m.padStart.L=olympe.D.K.F;m.padEnd.L=olympe.D.K.F;
|
|
323
323
|
m.replace.L=olympe.D.K.F;m.fz.L=olympe.D.K.F;olympe.D.fa=class{constructor(a){this.value=a}toJSON(){return`{ "type": "boolean", "value": ${this.value.valueOf()}}`}static Pb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return b.value?olympe.D.fa.F:olympe.D.fa.C}and(a){if(void 0!==a)return olympe.D.jb(a)?olympe.D.qe([a],b=>new olympe.D.fa(this.valueOf()&&b.valueOf()),olympe.D.fa,'and'):this.value&&a.valueOf()?olympe.D.fa.F:olympe.D.fa.C}Fa(a){return this.valueOf()===(void 0!==a?a.valueOf():void 0)}Ad(a){if(void 0!==a)return olympe.D.jb(a)?
|
|
324
324
|
olympe.D.qe([a],b=>new olympe.D.fa(this.valueOf()===b.valueOf()),olympe.D.fa,'oEquals'):this.Fa(a)?olympe.D.fa.F:olympe.D.fa.C}pd(){return this.value?olympe.D.fa.C:olympe.D.fa.F}mw(a){if(void 0!==a)return olympe.D.jb(a)?olympe.D.qe([a],b=>new olympe.D.fa(!(this.valueOf()&&b.valueOf())),olympe.D.fa,'andNot'):this.value&&!a.valueOf()?olympe.D.fa.F:olympe.D.fa.C}or(a){if(void 0!==a)return olympe.D.jb(a)?olympe.D.qe([a],b=>new olympe.D.fa(this.valueOf()||b.valueOf()),olympe.D.fa,'or'):this.value||a.valueOf()?
|
|
325
|
-
olympe.D.fa.F:olympe.D.fa.C}xor(a){return olympe.D.
|
|
325
|
+
olympe.D.fa.F:olympe.D.fa.C}xor(a){return olympe.D.ua([this,a],(b,c)=>{b=b.valueOf();c=c.valueOf();return olympe.D.Sb(b&&!c||!b&&c)},olympe.D.fa,'OBoolean.xor')}Vw(){return this.value}Tr(){return!0===this.value?olympe.D.ba.ONE:olympe.D.ba.ZERO}Oc(){return olympe.D.Ab(this.toString())}toString(){return this.value?'true':'false'}valueOf(){return this.value}};olympe.D.fa.F=new olympe.D.fa(!0);olympe.D.fa.C=new olympe.D.fa(!1);m=olympe.D.fa.prototype;m.toJSON.L=olympe.D.K.C;
|
|
326
326
|
m.and.L=new olympe.D.K(()=>olympe.D.fa,[0]);m.Fa.L=olympe.D.K.C;m.Ad.L=new olympe.D.K(()=>olympe.D.fa,[0]);m.pd.L=olympe.D.K.O;m.mw.L=new olympe.D.K(()=>olympe.D.fa,[0]);m.or.L=new olympe.D.K(()=>olympe.D.fa,[0]);m.xor.L=new olympe.D.K(()=>olympe.D.fa,[0]);m.Vw.L=new olympe.D.K(()=>Boolean,[]);m.Tr.L=olympe.D.K.G;m.Oc.L=olympe.D.K.F;m.toString.L=olympe.D.K.C;m.valueOf.L=olympe.D.K.C;function Zb(a){return new olympe.D.gb(new Date(a))}
|
|
327
|
-
olympe.D.gb=class{constructor(a){this.rb=a}toJSON(){return'{ "type": "dateTime", "value": "'+this.rb.toJSON()+'" }'}static Pb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.D.gb(new Date(b.value.valueOf()))}static now(){return new olympe.D.gb(new Date)}
|
|
328
|
-
olympe.D,b=a.Ab;var c=this.rb.getDate();c=10>c?'0'+c:c;var d=this.rb.getMonth()+1;return b.call(a,`${c}.${10>d?'0'+d:d}.${this.rb.getFullYear()}`)}toLocaleString(a){return void 0===a||'string'===typeof a?olympe.D.Ab(this.rb.toLocaleString(a)):olympe.D.
|
|
329
|
-
olympe.D.Qa)}toLocaleTimeString(a){return void 0===a||'string'===typeof a?olympe.D.Ab(this.rb.toLocaleTimeString(a)):olympe.D.
|
|
330
|
-
a)}jw(a){return this.cg('Seconds',a)}fw(a){return this.cg('Minutes',a)}dw(a){return this.cg('Hours',a)}
|
|
331
|
-
b=>olympe.D.Sb(this.Fa(b)),olympe.D.fa)}Fa(a){return a instanceof olympe.D.gb?this.getTime()===a.getTime()||isNaN(this.getTime())&&isNaN(a.getTime()):!1}xx(){let a=this.rb.getDay();0===a&&(a=7);return olympe.D.ra(a)}ox(a,b){return olympe.D.
|
|
332
|
-
void 0===d&&(olympe.ka.ab('df').warn("[getDiff] '_unit' is not a valid unit! Defaulting to milliseconds"),d=1),c=Math.trunc((this.rb.getTime()-c.rb.getTime())/d));return olympe.D.ra(c)},olympe.D.ba)}hy(a){return olympe.D.
|
|
333
|
-
new Date(this.getTime()):new Date(0)}};olympe.D.gb.C=Zb(0);olympe.D.gb.F=Zb(Number.NaN);m=olympe.D.gb.prototype;m.
|
|
334
|
-
m.iz.L=new olympe.D.K(()=>olympe.D.gb,[]);m.kz.L=new olympe.D.K(()=>olympe.D.gb,[]);m.cg.L=new olympe.D.K(()=>olympe.D.gb,[]);m.ew.L=new olympe.D.K(()=>olympe.D.gb,[]);m.jw.L=new olympe.D.K(()=>olympe.D.gb,[]);m.fw.L=new olympe.D.K(()=>olympe.D.gb,[]);m.dw.L=new olympe.D.K(()=>olympe.D.gb,[]);m.
|
|
327
|
+
olympe.D.gb=class{constructor(a){this.rb=a}toJSON(){return'{ "type": "dateTime", "value": "'+this.rb.toJSON()+'" }'}static Pb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.D.gb(new Date(b.value.valueOf()))}static now(){return new olympe.D.gb(new Date)}tp(){return this.rb&&!isNaN(this.rb.getTime())?olympe.D.fa.F:olympe.D.fa.C}Pt(){return olympe.D.ra(this.rb.getMilliseconds())}Rt(){return olympe.D.ra(this.rb.getSeconds())}Qt(){return olympe.D.ra(this.rb.getMinutes())}Ot(){return olympe.D.ra(this.rb.getHours())}kx(){return olympe.D.ra(this.rb.getDate())}getMonth(){return olympe.D.ra(this.rb.getMonth()+1)}St(){return olympe.D.ra(this.rb.getFullYear())}getTime(){return this.rb.getTime()}cz(){var a=
|
|
328
|
+
olympe.D,b=a.Ab;var c=this.rb.getDate();c=10>c?'0'+c:c;var d=this.rb.getMonth()+1;return b.call(a,`${c}.${10>d?'0'+d:d}.${this.rb.getFullYear()}`)}toLocaleString(a){return void 0===a||'string'===typeof a?olympe.D.Ab(this.rb.toLocaleString(a)):olympe.D.ua([this,a],(b,c)=>olympe.D.Ab(b.rb.toLocaleString(c.valueOf())),olympe.D.Qa)}toLocaleDateString(a){return void 0===a||'string'===typeof a?olympe.D.Ab(this.rb.toLocaleDateString(a)):olympe.D.ua([this,a],(b,c)=>olympe.D.Ab(b.rb.toLocaleDateString(c.valueOf())),
|
|
329
|
+
olympe.D.Qa)}toLocaleTimeString(a){return void 0===a||'string'===typeof a?olympe.D.Ab(this.rb.toLocaleTimeString(a)):olympe.D.ua([this,a],(b,c)=>olympe.D.Ab(b.rb.toLocaleTimeString(c.valueOf())),olympe.D.Qa)}Oc(){return olympe.D.Ab(this.rb.toISOString())}gz(){return new Date(this.getTime())}iz(){return this}kz(){return this}cg(a,b){return olympe.D.ua([b],c=>{const d=new olympe.D.gb(new Date(this.rb.getTime()));d.rb['set'+a](this.rb['get'+a]()+c.valueOf());return d},olympe.D.gb)}ew(a){return this.cg('Milliseconds',
|
|
330
|
+
a)}jw(a){return this.cg('Seconds',a)}fw(a){return this.cg('Minutes',a)}dw(a){return this.cg('Hours',a)}Bm(a){return this.cg('Date',a)}kw(a){return'number'===typeof a?this.Bm(7*a):this.Bm(a.Jk(7))}gw(a){return this.cg('Month',a)}lw(a){return this.cg('FullYear',a)}dz(){let a=this.rb.getDay();a=0===a?6:a-1;return new olympe.D.gb(new Date(this.rb.getFullYear(),this.rb.getMonth(),this.rb.getDate()-a))}ez(){return new olympe.D.gb(new Date(this.rb.getFullYear(),this.rb.getMonth()))}Ad(a){return olympe.D.ua([a],
|
|
331
|
+
b=>olympe.D.Sb(this.Fa(b)),olympe.D.fa)}Fa(a){return a instanceof olympe.D.gb?this.getTime()===a.getTime()||isNaN(this.getTime())&&isNaN(a.getTime()):!1}xx(){let a=this.rb.getDay();0===a&&(a=7);return olympe.D.ra(a)}ox(a,b){return olympe.D.ua([a,b],(c,d)=>{d=d.valueOf();'years'===d?c=this.rb.getFullYear()-c.rb.getFullYear():'months'===d?c=12*(this.rb.getFullYear()-c.rb.getFullYear())+(this.rb.getMonth()-c.rb.getMonth()):(d={milliseconds:1,seconds:1E3,minutes:6E4,hours:36E5,days:864E5,weeks:6048E5}[d],
|
|
332
|
+
void 0===d&&(olympe.ka.ab('df').warn("[getDiff] '_unit' is not a valid unit! Defaulting to milliseconds"),d=1),c=Math.trunc((this.rb.getTime()-c.rb.getTime())/d));return olympe.D.ra(c)},olympe.D.ba)}hy(a){return olympe.D.ua([a],b=>olympe.D.Sb(this.getTime()<b.getTime()),olympe.D.fa)}ey(a){return olympe.D.ua([a],b=>olympe.D.Sb(this.getTime()>b.getTime()),olympe.D.fa)}iy(a,b){return olympe.D.ua([a,b],(c,d)=>olympe.D.Sb(this.getTime()>c.getTime()&&this.getTime()<d.getTime()),olympe.D.fa)}valueOf(){return this.tp().valueOf()?
|
|
333
|
+
new Date(this.getTime()):new Date(0)}};olympe.D.gb.C=Zb(0);olympe.D.gb.F=Zb(Number.NaN);m=olympe.D.gb.prototype;m.tp.L=olympe.D.K.O;m.Pt.L=olympe.D.K.G;m.Rt.L=olympe.D.K.G;m.Qt.L=olympe.D.K.G;m.Ot.L=olympe.D.K.G;m.kx.L=olympe.D.K.G;m.getMonth.L=olympe.D.K.G;m.St.L=olympe.D.K.G;m.getTime.L=olympe.D.K.C;m.cz.L=new olympe.D.K(()=>olympe.D.Qa,[0]);m.toLocaleString.L=olympe.D.K.F;m.toLocaleDateString.L=olympe.D.K.F;m.toLocaleTimeString.L=olympe.D.K.F;m.Oc.L=olympe.D.K.F;m.gz.L=olympe.D.K.C;
|
|
334
|
+
m.iz.L=new olympe.D.K(()=>olympe.D.gb,[]);m.kz.L=new olympe.D.K(()=>olympe.D.gb,[]);m.cg.L=new olympe.D.K(()=>olympe.D.gb,[]);m.ew.L=new olympe.D.K(()=>olympe.D.gb,[]);m.jw.L=new olympe.D.K(()=>olympe.D.gb,[]);m.fw.L=new olympe.D.K(()=>olympe.D.gb,[]);m.dw.L=new olympe.D.K(()=>olympe.D.gb,[]);m.Bm.L=new olympe.D.K(()=>olympe.D.gb,[0]);m.kw.L=new olympe.D.K(()=>olympe.D.gb,[]);m.gw.L=new olympe.D.K(()=>olympe.D.gb,[]);m.lw.L=new olympe.D.K(()=>olympe.D.gb,[0]);
|
|
335
335
|
m.dz.L=new olympe.D.K(()=>olympe.D.gb,[]);m.ez.L=new olympe.D.K(()=>olympe.D.gb,[]);m.Ad.L=olympe.D.K.O;m.Fa.L=olympe.D.K.C;m.xx.L=olympe.D.K.G;m.ox.L=new olympe.D.K(()=>olympe.D.ba,[0,1]);m.hy.L=new olympe.D.K(()=>olympe.D.fa,[0]);m.ey.L=new olympe.D.K(()=>olympe.D.fa,[0]);m.iy.L=new olympe.D.K(()=>olympe.D.fa,[0,1]);m.valueOf.L=olympe.D.K.C;const $b=new Map,ac=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i,bc=/^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i;function cc(a){const b=c=>{let d;c=c.valueOf();6>c.length?(d=17,c=bc.exec(c)):(d=1,c=ac.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.bf(a)?olympe.D.qe([a],b,olympe.D.Color):b(a)}
|
|
336
336
|
olympe.D.Color=class{constructor(a,b,c,d){this.C=olympe.D.ra(void 0!==a?Math.min(255,Math.max(0,Math.round(a))):0);this.F=olympe.D.ra(void 0!==b?Math.min(255,Math.max(0,Math.round(b))):0);this.b=olympe.D.ra(void 0!==c?Math.min(255,Math.max(0,Math.round(c))):0);this.a=olympe.D.ra(void 0!==d?Math.min(1,Math.max(0,d)):1)}toJSON(){return{r:this.C.valueOf(),g:this.F.valueOf(),b:this.b.valueOf(),a:this.a.valueOf()}}static Pb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.D.Color.create(b.r,
|
|
337
|
-
b.g,b.b,b.a)}static create(a,b,c,d=1){return olympe.D.
|
|
338
|
-
b){return olympe.D.Color.create(this.C.
|
|
339
|
-
this.F.valueOf()===a.F.valueOf()&&this.b.valueOf()===a.b.valueOf()&&this.a.valueOf()===a.a.valueOf():!1}compare(a){const b=(this.Wg().valueOf()<<16|this.Tg().valueOf()<<8|this.Qg().valueOf())-(a.Wg().valueOf()<<16|a.Tg().valueOf()<<8|a.Qg().valueOf());return 0===b?this.Pg().valueOf()-a.Pg().valueOf():b}};olympe.D.Color.prototype.equals=olympe.D.Color.prototype.Fa;olympe.D.Color.prototype.toHexString=olympe.D.Color.prototype.
|
|
337
|
+
b.g,b.b,b.a)}static create(a,b,c,d=1){return olympe.D.ua([a,b,c,d],(e,f,g,h)=>{e=olympe.D.ra(void 0!==e?Math.min(255,Math.max(0,Math.round(e.valueOf()))):0);f=olympe.D.ra(void 0!==f?Math.min(255,Math.max(0,Math.round(f.valueOf()))):0);g=olympe.D.ra(void 0!==g?Math.min(255,Math.max(0,Math.round(g.valueOf()))):0);h=olympe.D.ra(void 0!==h?Math.min(1,Math.max(0,h.valueOf())):1);for(let k of $b.values())if(k&&k.C.Fa(e)&&k.F.Fa(f)&&k.b.Fa(g)&&k.a.Fa(h))return k;return new olympe.D.Color(e,f,g,h)},olympe.D.Color)}Wg(){return this.C}Qg(){return this.b}Tg(){return this.F}Pg(){return this.a}qw(a,
|
|
338
|
+
b){return olympe.D.Color.create(this.C.kj(a.Wg(),b),this.F.kj(a.Tg(),b),this.b.kj(a.Qg(),b),this.a.kj(a.Pg(),b))}Ow(a){return olympe.D.Color.create(this.C,this.F,this.b,a)}ss(){return`rgba(${this.C},${this.F},${this.b},${this.a})`}qn(){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);return'#'+(a+b).toUpperCase()}toString(){return this.qn()}Fa(a){return a instanceof olympe.D.Color?this.C.valueOf()===a.C.valueOf()&&
|
|
339
|
+
this.F.valueOf()===a.F.valueOf()&&this.b.valueOf()===a.b.valueOf()&&this.a.valueOf()===a.a.valueOf():!1}compare(a){const b=(this.Wg().valueOf()<<16|this.Tg().valueOf()<<8|this.Qg().valueOf())-(a.Wg().valueOf()<<16|a.Tg().valueOf()<<8|a.Qg().valueOf());return 0===b?this.Pg().valueOf()-a.Pg().valueOf():b}};olympe.D.Color.prototype.equals=olympe.D.Color.prototype.Fa;olympe.D.Color.prototype.toHexString=olympe.D.Color.prototype.qn;olympe.D.Color.prototype.toRGBString=olympe.D.Color.prototype.ss;
|
|
340
340
|
olympe.D.Color.prototype.getAlpha=olympe.D.Color.prototype.Pg;olympe.D.Color.prototype.getGreen=olympe.D.Color.prototype.Tg;olympe.D.Color.prototype.getBlue=olympe.D.Color.prototype.Qg;olympe.D.Color.prototype.getRed=olympe.D.Color.prototype.Wg;olympe.D.Color.create=olympe.D.Color.create;m=olympe.D.Color.prototype;m.toJSON.L=olympe.D.K.C;m.Wg.L=olympe.D.K.G;m.Qg.L=olympe.D.K.G;m.Tg.L=olympe.D.K.G;m.Pg.L=olympe.D.K.G;m.qw.L=new olympe.D.K(()=>olympe.D.Color,[]);
|
|
341
|
-
m.Ow.L=new olympe.D.K(()=>olympe.D.Color,[]);m.ss.L=new olympe.D.K(()=>String,[]);m.
|
|
342
|
-
olympe.D.$b,'Vector2.plus')}bh(a){return olympe.D.
|
|
343
|
-
a+b*b)),olympe.D.ba)}normalize(){return olympe.D.
|
|
344
|
-
this.y.ae(a))}iw(a,b){return new olympe.D.$b(this.x.ae(a),this.y.ae(b))}Oc(){return olympe.D.
|
|
341
|
+
m.Ow.L=new olympe.D.K(()=>olympe.D.Color,[]);m.ss.L=new olympe.D.K(()=>String,[]);m.qn.L=new olympe.D.K(()=>String,[]);m.Fa.L=olympe.D.K.C;m.compare.L=olympe.D.K.C;olympe.D.File=class{ma(){}up(){}vp(){}Sr(){}yk(){}Pm(){}zk(){}rename(){}};olympe.D.$b=class{constructor(a,b){this.x=olympe.D.$d(a);this.y=olympe.D.$d(b)}toJSON(){return'{ "type": "vector2", "x": '+JSON.stringify(olympe.D.Na(this.x).valueOf())+', "y": '+JSON.stringify(olympe.D.Na(this.y).valueOf())+' }'}static Pb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.D.$b(b.x,b.y)}Tt(){return this.x}az(a){Wb(this.x,a)}Ut(){return this.y}bz(a){Wb(this.y,a)}Qx(){return this.x.ls(this.y)}ae(a){return olympe.D.ua([this,a],(b,c)=>new olympe.D.$b(b.x.ae(c.x),b.y.ae(c.y)),
|
|
342
|
+
olympe.D.$b,'Vector2.plus')}bh(a){return olympe.D.ua([this,a],(b,c)=>new olympe.D.$b(b.x.bh(c.x),b.y.bh(c.y)),olympe.D.$b,'Vector2.minus')}xy(a){return new olympe.D.$b(this.x.Jk(a),this.y.Jk(a))}Jw(a){return new olympe.D.$b(this.x.aj(a),this.y.aj(a))}zy(){return new olympe.D.$b(this.x.qj(),this.y.qj())}Kw(a){return olympe.D.ua([this,a],(b,c)=>olympe.D.ua([b.x,b.y,c.x,c.y],(d,e,f,g)=>olympe.D.ra(d*f+e*g),olympe.D.ba),olympe.D.ba)}length(){return olympe.D.ua([this.x,this.y],(a,b)=>olympe.D.ra(Math.sqrt(a*
|
|
343
|
+
a+b*b)),olympe.D.ba)}normalize(){return olympe.D.ua([this.x,this.y],(a,b)=>{const c=Math.sqrt(a*a+b*b);return new olympe.D.$b(a/c,b/c)},olympe.D.$b)}floor(){return olympe.D.ua([this.x,this.y],(a,b)=>new olympe.D.$b(Math.floor(a),Math.floor(b)),olympe.D.$b)}ceil(){return olympe.D.ua([this.x,this.y],(a,b)=>new olympe.D.$b(Math.ceil(a),Math.ceil(b)),olympe.D.$b)}round(){return olympe.D.ua([this.x,this.y],(a,b)=>new olympe.D.$b(Math.round(a),Math.round(b)),olympe.D.$b)}hw(a){return new olympe.D.$b(this.x.ae(a),
|
|
344
|
+
this.y.ae(a))}iw(a,b){return new olympe.D.$b(this.x.ae(a),this.y.ae(b))}Oc(){return olympe.D.ua([this.x,this.y],(a,b)=>olympe.D.Ab(`Vector2[${a.valueOf()}, ${b.valueOf()}]`),olympe.D.Qa)}toString(){return`Vector2[${this.x.Da.Gb}, ${this.y.Da.Gb}]`}Fa(a){return this===a?!0:!1}};m=olympe.D.$b.prototype;m.toJSON.L=olympe.D.K.C;m.Tt.L=olympe.D.K.G;m.az.L=olympe.D.K.C;m.Ut.L=olympe.D.K.G;m.bz.L=olympe.D.K.C;m.Qx.L=olympe.D.K.G;m.ae.L=new olympe.D.K(()=>olympe.D.$b,[0]);
|
|
345
345
|
m.bh.L=new olympe.D.K(()=>olympe.D.$b,[0]);m.xy.L=olympe.D.K.T;m.Jw.L=olympe.D.K.T;m.zy.L=olympe.D.K.T;m.Kw.L=new olympe.D.K(()=>olympe.D.ba,[0]);m.length.L=olympe.D.K.G;m.normalize.L=olympe.D.K.T;m.floor.L=olympe.D.K.T;m.ceil.L=olympe.D.K.T;m.round.L=olympe.D.K.T;m.hw.L=olympe.D.K.T;m.iw.L=olympe.D.K.T;m.Oc.L=olympe.D.K.F;m.toString.L=olympe.D.K.C;m.Fa.L=olympe.D.K.C;olympe.D.sg=class{constructor(){}Mb(){}Hd(){}get(){}Xh(){}has(){}Zg(){}Fc(){}Gf(){}mf(){}fg(){}forEach(){}he(){}};olympe.D.sg.prototype.forEachCurrentValue=olympe.D.sg.prototype.he;olympe.D.sg.prototype.forEach=olympe.D.sg.prototype.forEach;m=olympe.D.sg.prototype;m.has.L=olympe.D.K.O;m.Zg.L=olympe.D.K.C;m.Fc.L=new olympe.D.K(()=>Object,[]);m.Gf.L=new olympe.D.K(()=>String,[]);m.mf.L=olympe.D.K.G;m.fg.L=olympe.D.K.C;m.forEach.L=new olympe.D.K(()=>{},[]);m.he.L=olympe.D.K.C;olympe.D.kd=class extends olympe.D.sg{xd(){}Ff(){}$e(){}Ef(){}ie(){}Ze(){}bj(){}Zh(){}};olympe.D.kd.prototype.getCurrentAt=olympe.D.kd.prototype.Ze;olympe.D.kd.prototype.getAt=olympe.D.kd.prototype.ie;olympe.D.kd.prototype.getCurrentKeyAt=olympe.D.kd.prototype.Ef;olympe.D.kd.prototype.getKeyAt=olympe.D.kd.prototype.$e;olympe.D.kd.prototype.getCurrentRank=olympe.D.kd.prototype.Ff;olympe.D.kd.prototype.getRank=olympe.D.kd.prototype.xd;m=olympe.D.kd.prototype;m.xd.L=olympe.D.K.G;m.Ff.L=olympe.D.K.C;
|
|
346
|
-
m.$e.L=new olympe.D.K(()=>String,[]);m.Ef.L=olympe.D.K.C;m.ie.L=new olympe.D.K(()=>Object,[]);m.Ze.L=olympe.D.K.C;m.bj.L=olympe.D.K.C;m.Zh.L=new olympe.D.K(()=>Array,[]);olympe.D.fi=class{constructor(a,b){this.O=b||olympe.D.Wa();this.valueType=a||Object;this.values={};this.hb=this.
|
|
347
|
-
c)&&Sb(b[c],a)}get(a){const b=c=>{null===this.
|
|
348
|
-
f||this.O.run(()=>{f=olympe.D.Nd(d,void 0,e);a[b]=f;f.Da.onDestroy(()=>delete a[b]);olympe.D.jb(c)?Vb(f,c):Tb(f,c)});return f}Fc(){throw Error('Abstract method getFirstKey needs to be overridden');}Gf(){throw Error('Abstract method getFirstKey needs to be overridden');}mf(){null===this.J&&this.O.run(()=>{this.J=olympe.D.Nd(olympe.D.ba,olympe.D.ra(this.size));this.J.Da.onDestroy(()=>{this.J=null})});return this.J}fg(){return this.size}forEach(a,b){const c=this.
|
|
349
|
-
b){this.yb[a]=b;olympe.D.Wa().Z(()=>{const c=this.Z;for(const d in c)Object.prototype.hasOwnProperty.call(c,d)&&delete c[d][a];delete this.yb[a]});this.he(b)}sr(a,b,c){const d=olympe.D.Wa();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.
|
|
350
|
-
a(b[c],c,this))break}
|
|
351
|
-
e[a]&&Wb(e[a],!1);delete c[a];this.size--;b||this.zf()}a=this.Z[a];if(void 0!==a)for(const f in a)Object.prototype.hasOwnProperty.call(a,f)&&a[f].destroy();return d}zf(){null!==this.J&&Wb(this.J,this.size)}Nh(){var a=this.
|
|
346
|
+
m.$e.L=new olympe.D.K(()=>String,[]);m.Ef.L=olympe.D.K.C;m.ie.L=new olympe.D.K(()=>Object,[]);m.Ze.L=olympe.D.K.C;m.bj.L=olympe.D.K.C;m.Zh.L=new olympe.D.K(()=>Array,[]);olympe.D.fi=class{constructor(a,b){this.O=b||olympe.D.Wa();this.valueType=a||Object;this.values={};this.hb=this.va=null;this.Vd=0;this.Z=Object.create(null);this.yb=Object.create(null);this.size=0;this.J=null;this.O.onDestroy(()=>{const c=this.Z;if(c){const d=Object.keys(c),e=d.length;for(let f=0;f<e;f++){const g=c[d[f]],h=Object.keys(g);for(let k=h.length,l=0;l<k;l++)g[h[l]].destroy()}}})}getContext(){return this.O}Mb(){return this.valueType}Hd(a){this.valueType=a;const b=this.va;if(null!==b)for(const c in b)Object.prototype.hasOwnProperty.call(b,
|
|
347
|
+
c)&&Sb(b[c],a)}get(a){const b=c=>{null===this.va&&(this.va={});return this.ej(this.va,c,this.values[c],this.valueType,'Map.get('+c+')')};return olympe.D.ua([a],c=>b(c),this.valueType)}Xh(a){a=this.values[a];return olympe.D.jb(a)?Db(a.Da)?a.Da.Gb:void 0:a}has(a){const b=c=>{null===this.hb&&(this.hb={});return this.ej(this.hb,c,c in this.values?olympe.D.fa.F:olympe.D.fa.C,olympe.D.fa,'Map.has('+c+')')};return olympe.D.ua([a],c=>b(c),olympe.D.fa)}Zg(a){return a in this.values}ej(a,b,c,d,e){let f=a[b];
|
|
348
|
+
f||this.O.run(()=>{f=olympe.D.Nd(d,void 0,e);a[b]=f;f.Da.onDestroy(()=>delete a[b]);olympe.D.jb(c)?Vb(f,c):Tb(f,c)});return f}Fc(){throw Error('Abstract method getFirstKey needs to be overridden');}Gf(){throw Error('Abstract method getFirstKey needs to be overridden');}mf(){null===this.J&&this.O.run(()=>{this.J=olympe.D.Nd(olympe.D.ba,olympe.D.ra(this.size));this.J.Da.onDestroy(()=>{this.J=null})});return this.J}fg(){return this.size}forEach(a,b){const c=this.xm();a=this.sr(c,a,b);this.wm(c,a)}xm(){return String(++this.Vd)}wm(a,
|
|
349
|
+
b){this.yb[a]=b;olympe.D.Wa().Z(()=>{const c=this.Z;for(const d in c)Object.prototype.hasOwnProperty.call(c,d)&&delete c[d][a];delete this.yb[a]});this.he(b)}sr(a,b,c){const d=olympe.D.Wa();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.Am(a,f,g)})}}Am(a,b,c){void 0===this.Z[b]&&(this.Z[b]={});this.Z[b][a]=c}he(a){const b=this.values;for(const c in b)if(Object.prototype.hasOwnProperty.call(b,c)&&!1===
|
|
350
|
+
a(b[c],c,this))break}sk(a,b){void 0!==this.values[a]&&this.Wi(a,!0);this.values[a]=b;var c=this.va;null!==c&&void 0!==c[a]&&(b&&b instanceof olympe.D.Proxy?Vb(c[a],b):Tb(c[a],b));c=this.hb;null!==c&&void 0!==c[a]&&Wb(c[a],!0);this.size++;c=this.yb;for(const d in c)if(Object.prototype.hasOwnProperty.call(c,d))c[d](b,a,this)}Wi(a,b){const c=this.values;if(Object.prototype.hasOwnProperty.call(c,a)){var d=(d=c[a])&&d.Og?d.Da.Gb:d;var e=this.va;null!==e&&void 0!==e[a]&&Ub(e[a]);e=this.hb;null!==e&&void 0!==
|
|
351
|
+
e[a]&&Wb(e[a],!1);delete c[a];this.size--;b||this.zf()}a=this.Z[a];if(void 0!==a)for(const f in a)Object.prototype.hasOwnProperty.call(a,f)&&a[f].destroy();return d}zf(){null!==this.J&&Wb(this.J,this.size)}Nh(){var a=this.va;if(null!==a)for(const c in a)Object.prototype.hasOwnProperty.call(a,c)&&Ub(a[c]);a=this.hb;if(null!==a)for(var b in a)Object.prototype.hasOwnProperty.call(a,b)&&Wb(a[b],!1);for(const c in this.values)Object.prototype.hasOwnProperty.call(this.values,c)&&delete this.values[c];for(const c in this.Z)if(Object.prototype.hasOwnProperty.call(this.Z,
|
|
352
352
|
c)){b=this.Z[c];for(const d in b)Object.prototype.hasOwnProperty.call(b,d)&&b[d].destroy()}this.size=0;null!==this.J&&Wb(this.J,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.fi.ya=[olympe.D.sg];m=olympe.D.fi.prototype;m.getContext.L=olympe.D.K.C;m.Mb.L=olympe.D.K.C;m.Hd.L=olympe.D.K.C;m.get.L=new olympe.D.K(()=>Object,[],'valueType');m.Xh.L=olympe.D.K.C;m.has.L=olympe.D.K.O;m.Zg.L=olympe.D.K.C;m.ej.L=olympe.D.K.C;
|
|
353
|
-
m.mf.L=olympe.D.K.G;m.fg.L=olympe.D.K.C;m.forEach.L=new olympe.D.K(()=>{},[]);m.
|
|
354
|
-
[a.Da],[0],'onResolved('+(b.name||'')+')')):b(a)}Ff(a){return this.F[a]}$e(a){const b=c=>{const d=c.valueOf(),e=this.Ef(d);null===this.Ga&&(this.Ga=Object.create(null));return this.ej(this.Ga,String(d),e,String,'List.getKeyAt('+c+')')};return olympe.D.
|
|
355
|
-
b||this.O.run(()=>{b=this.get(this.$e(a));this.ja.set(a,b);b.Da.onDestroy(()=>this.ja.delete(a))});return b}Ze(a){return this.Xh(this.Ef(a))}bj(a,b,c,d){let e=this.
|
|
356
|
-
this.ea.Da.onDestroy(()=>{this.J=null})});return this.ea}he(a){if(this.C.length!==this.size)super.he(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}}
|
|
357
|
-
c[a]&&Tb(c[a],olympe.D.ra(f)));null!==d&&(void 0!==e&&null!==e&&void 0!==d[e]&&Ub(d[e]),void 0!==d[b]&&Tb(d[b],a))}}
|
|
358
|
-
a)for(b in a)Ub(a[b]);a=this.Ga;if(null!==a)for(b in a)Ub(a[parseInt(b,10)]);var b=this.ea;null!==b&&(Lb(b.Da),Tb(b,this.C));return olympe.D.fi.prototype.Nh.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.
|
|
359
|
-
m.$e.L=new olympe.D.K(()=>String,[]);m.Ef.L=olympe.D.K.C;m.ie.L=new olympe.D.K(()=>Object,[]);m.Ze.L=olympe.D.K.C;m.bj.L=new olympe.D.K(()=>{},[]);m.ds.L=olympe.D.K.C;m.Zh.L=new olympe.D.K(()=>Array,[]);m.he.L=olympe.D.K.C;m.
|
|
360
|
-
a){const b=this.values[a];b&&b instanceof olympe.D.Proxy?Vb(this.F,b):Tb(this.F,b);Tb(this.C,a)}else void 0!==this.F.Da.Gb&&(Ub(this.F),Ub(this.C))}set(a,b){this.
|
|
361
|
-
m.
|
|
362
|
-
olympe.D.Nd=function(a,b,c){a=olympe.D.createNode(a,void 0,void 0,void 0,void 0,c);olympe.D.Jf(b)?Ob(a,b):olympe.D.jb(b)?Ob(a,b.Da):K(a,b);return L(a)};olympe.D.jb=function(a){return!(!a||!a.Og)};olympe.D.bf=function(a){return!(!a||!(a instanceof olympe.D.Node||a.Og))};olympe.D.
|
|
363
|
-
olympe.D.
|
|
353
|
+
m.mf.L=olympe.D.K.G;m.fg.L=olympe.D.K.C;m.forEach.L=new olympe.D.K(()=>{},[]);m.xm.L=olympe.D.K.C;m.wm.L=olympe.D.K.C;m.sr.L=olympe.D.K.C;m.Am.L=olympe.D.K.C;m.he.L=olympe.D.K.C;m.sk.L=olympe.D.K.C;m.Wi.L=olympe.D.K.C;m.zf.L=olympe.D.K.C;m.Nh.L=olympe.D.K.C;m.vg.L=olympe.D.K.C;olympe.D.uj=class extends olympe.D.fi{constructor(a,b){super(a,b);this.F=Object.create(null);this.C=[];this.ja=this.Ga=this.eb=this.ea=null}Hd(a){super.Hd(a);if(null!==this.ja)for(let b of this.ja.values())Sb(b,a)}Fc(){return this.ie(0)}Gf(){return this.$e(0)}xd(a){const b=c=>{null===this.eb&&(this.eb=Object.create(null));let d=this.Ff(a);d=void 0!==d?olympe.D.ra(d):void 0;return this.ej(this.eb,c,d,olympe.D.ba,`List.getRank(${c})`)};return olympe.D.jb(a)?L(olympe.D.createNode(olympe.D.ba,b,null,
|
|
354
|
+
[a.Da],[0],'onResolved('+(b.name||'')+')')):b(a)}Ff(a){return this.F[a]}$e(a){const b=c=>{const d=c.valueOf(),e=this.Ef(d);null===this.Ga&&(this.Ga=Object.create(null));return this.ej(this.Ga,String(d),e,String,'List.getKeyAt('+c+')')};return olympe.D.ua([a],c=>b(c),String)}Ef(a){return this.C[a.valueOf()]}ie(a){if(olympe.D.jb(a))return this.get(olympe.D.ua([a],c=>{c=this.$e(c);if(!Db(c.Da)){const d=olympe.D.Wa();olympe.D.Jf(d)&&Nb(d)}return c},String));null===this.ja&&(this.ja=new Map);let b=this.ja.get(a);
|
|
355
|
+
b||this.O.run(()=>{b=this.get(this.$e(a));this.ja.set(a,b);b.Da.onDestroy(()=>this.ja.delete(a))});return b}Ze(a){return this.Xh(this.Ef(a))}bj(a,b,c,d){let e=this.xm();a=this.ds(e,a,b,c,d);this.wm(e,a)}ds(a,b,c,d,e){return olympe.D.Wa().G((f,g)=>{let h=!1,k=olympe.D.di([b,c,this.xd(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.Am(a,g,k)})}Zh(){null===this.ea&&this.O.run(()=>{this.ea=olympe.D.Nd(Array,this.C.filter(a=>void 0!==a));
|
|
356
|
+
this.ea.Da.onDestroy(()=>{this.J=null})});return this.ea}he(a){if(this.C.length!==this.size)super.he(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}}zm(a,b){const c=this.eb,d=this.Ga,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]&&Ub(c[g]),void 0!==
|
|
357
|
+
c[a]&&Tb(c[a],olympe.D.ra(f)));null!==d&&(void 0!==e&&null!==e&&void 0!==d[e]&&Ub(d[e]),void 0!==d[b]&&Tb(d[b],a))}}ym(a){var b=this.Ga,c=this.F[a];null!==c&&void 0!==c&&null!==b&&(b=b[c],void 0!==b&&b.Da.Gb===a&&Ub(b));delete this.F[a];this.C.splice(c,1);c=this.eb;null!==c&&void 0!==c[a]&&Ub(c[a])}tr(){if(null!==this.ea){const a=this.C,b=this.ea.Da.Gb;b&&a.join(',')!==b.join(',')&&Tb(this.ea,a)}}zf(){this.tr();super.zf()}Nh(){var a=this.F;for(b in a)delete a[b];this.C.length=0;a=this.eb;if(null!==
|
|
358
|
+
a)for(b in a)Ub(a[b]);a=this.Ga;if(null!==a)for(b in a)Ub(a[parseInt(b,10)]);var b=this.ea;null!==b&&(Lb(b.Da),Tb(b,this.C));return olympe.D.fi.prototype.Nh.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.uj.ya=[olympe.D.kd];m=olympe.D.uj.prototype;m.Hd.L=olympe.D.K.C;m.Fc.L=new olympe.D.K(()=>Object,[]);m.Gf.L=new olympe.D.K(()=>String,[]);m.xd.L=olympe.D.K.G;m.Ff.L=olympe.D.K.C;
|
|
359
|
+
m.$e.L=new olympe.D.K(()=>String,[]);m.Ef.L=olympe.D.K.C;m.ie.L=new olympe.D.K(()=>Object,[]);m.Ze.L=olympe.D.K.C;m.bj.L=new olympe.D.K(()=>{},[]);m.ds.L=olympe.D.K.C;m.Zh.L=new olympe.D.K(()=>Array,[]);m.he.L=olympe.D.K.C;m.zm.L=olympe.D.K.C;m.ym.L=olympe.D.K.C;m.tr.L=olympe.D.K.C;m.zf.L=olympe.D.K.C;m.Nh.L=olympe.D.K.C;m.vg.L=olympe.D.K.C;olympe.D.Map=class extends olympe.D.fi{constructor(a){a===olympe.D.Proxy&&(a=Object);super(a);this.C=this.F=null}Hd(a){a===olympe.D.Proxy&&(a=Object);null!==this.F&&Sb(this.F,a);super.Hd(a)}Fc(){null===this.F&&this.Jm();return this.F}Gf(){null===this.C&&this.Jm();return this.C}Jm(){this.getContext().run(()=>{this.F=olympe.D.Nd(this.Mb());this.C=olympe.D.Nd(String);this.oj(this.Mm())})}Mm(){const a=this.values;let b,c;for(b in a)if(Object.prototype.hasOwnProperty.call(a,b)){c=b;break}return c}oj(a){if(void 0!==
|
|
360
|
+
a){const b=this.values[a];b&&b instanceof olympe.D.Proxy?Vb(this.F,b):Tb(this.F,b);Tb(this.C,a)}else void 0!==this.F.Da.Gb&&(Ub(this.F),Ub(this.C))}set(a,b){this.sk(a,b);1===this.size&&null!==this.C&&this.oj(a);this.zf()}remove(a){const b=this.Wi(a);null!==this.C&&this.C.Da.Gb===a&&this.oj(this.Mm());return b}clear(){this.Nh();null!==this.C&&this.oj()}};m=olympe.D.Map.prototype;m.Hd.L=olympe.D.K.C;m.Fc.L=new olympe.D.K(()=>Object,[]);m.Gf.L=new olympe.D.K(()=>String,[]);m.Jm.L=olympe.D.K.C;
|
|
361
|
+
m.Mm.L=olympe.D.K.C;m.oj.L=olympe.D.K.C;m.set.L=olympe.D.K.C;m.remove.L=new olympe.D.K(()=>Object,[]);m.clear.L=olympe.D.K.C;olympe.D.yg=class extends olympe.D.uj{constructor(a){super(a)}set(a,b,c){this.sk(a,b);void 0!==c&&olympe.D.Nc([c],d=>{this.zm(a,d)});this.zf()}remove(a){this.ym(a);return this.Wi(a)}clear(){this.Nh()}};olympe.D.yg.prototype.remove.L=olympe.D.K.C;olympe.D.yg.prototype.clear.L=olympe.D.K.C;olympe.D.Ds=class extends olympe.D.Lj{constructor(a,b){super(olympe.D.ba,'animatedFlowSource');this.duration=a;this.C=b||olympe.D.ba.zo.Cp}sb(){return olympe.D.By(this.node,this.duration,this.C,void 0)}};let dc=null;olympe.D.H=void 0;olympe.D.gn=void 0;olympe.D.Sh=void 0;olympe.D.Mh=new Map;olympe.D.Mh.set(0,olympe.D.ba.ZERO);olympe.D.Mh.set(1,olympe.D.ba.ONE);olympe.D.Mh.set(2,olympe.D.ba.Ov);olympe.D.rk=new Map;olympe.D.rk.set('',olympe.D.Qa.EMPTY);olympe.D.rk.set(' ',olympe.D.Qa.Av);olympe.D.createNode=function(a,b,c,d,e,f,g,h){return new olympe.D.Node({valueType:a,Cd:b,Nf:c,Xm:d,debug:g,dg:e,ld:f,Xi:h})};olympe.D.Jf=function(a){return a instanceof olympe.D.Node};
|
|
362
|
+
olympe.D.Nd=function(a,b,c){a=olympe.D.createNode(a,void 0,void 0,void 0,void 0,c);olympe.D.Jf(b)?Ob(a,b):olympe.D.jb(b)?Ob(a,b.Da):K(a,b);return L(a)};olympe.D.jb=function(a){return!(!a||!a.Og)};olympe.D.bf=function(a){return!(!a||!(a instanceof olympe.D.Node||a.Og))};olympe.D.an=function(a){return a instanceof olympe.D.Xb||a instanceof olympe.D.Hq||a instanceof olympe.D.Node};olympe.D.$g=function(a){return a instanceof olympe.D.Lj};
|
|
363
|
+
olympe.D.dn=function(a,b){if(void 0!==a){olympe.D.$g(a)&&(a=a.sb().Da);if(!olympe.D.bf(a))return b(a);var c=[];olympe.D.jb(a)?c.push(a.Da):c.push(a);return olympe.D.createNode(void 0,b,null,c,[0],'onResolved')}};olympe.D.Na=function(a,b){let c=a;olympe.D.jb(a)?c=a.Da.Gb:olympe.D.Jf(a)?c=a.Gb:olympe.D.$g(a)&&(c=a.sb().Da.Gb);return void 0===c?b:c};
|
|
364
364
|
olympe.D.eh=function(a,b){let c;olympe.D.jb(a)?c=a.Da:olympe.D.Jf(a)?c=a:olympe.D.$g(a)&&(c=a.sb().Da);c&&olympe.D.Nc([b],d=>{c.eh(d)},'setDefaultValue');return a};olympe.D.di=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.qr?(h=h.Da,g.push(k)):h instanceof olympe.D.Node?g.push(k):olympe.D.$g(h)&&(h=h.sb().Da,g.push(k))),f[k]=h;return olympe.D.createNode(c,b,null,f,g,d||'syncNodes')};
|
|
365
|
-
olympe.D.qe=function(a,b,c,d){return L(olympe.D.di(a,b,c,d||'syncProxies'))};const ec=a=>{for(const b of a)if(olympe.D.bf(b)||olympe.D.$g(b))return!1;return!0};olympe.D.
|
|
365
|
+
olympe.D.qe=function(a,b,c,d){return L(olympe.D.di(a,b,c,d||'syncProxies'))};const ec=a=>{for(const b of a)if(olympe.D.bf(b)||olympe.D.$g(b))return!1;return!0};olympe.D.ua=function(a,b,c,d,e){if(ec(a))return b(...a);const f=olympe.D.di(a,b,c,d||'TransformFlows');e&&olympe.D.Nc([e],g=>{f.eh(g)},'setDefaultValue');return L(f)};olympe.D.Nc=function(a,b,c){ec(a)?b(...a):olympe.D.di(a,b,void 0,c||'processFlows')};
|
|
366
366
|
olympe.D.KD=function(a,b,c){const d=olympe.D.Jf(a)?a.Mb():olympe.D.$g(a)?a.sb().Lh:a.Lh,e=olympe.D.ec(d,c),f=olympe.Y.Promise.$i(g=>{e.getContext().fb()||e.update(g)},b);olympe.D.Nc([a],g=>f(g).then());return e.sb()};olympe.D.hs=function(a,b){if(ec(a))b(...a);else{const c=olympe.D.Wa();olympe.D.di(a,(...d)=>{olympe.D.Wa().destroy();c.run(b,...d)},void 0,'processFlowsOnce')}};
|
|
367
|
-
olympe.D.
|
|
368
|
-
olympe.D.ec=function(a,b='flowSource'){return new olympe.D.
|
|
367
|
+
olympe.D.en=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.jb(g)?(g=g.Da,f.push(h)):g instanceof olympe.D.Node?f.push(h):olympe.D.$g(g)&&(g=g.sb().Da,f.push(h))),e[h]=g;0!==f.length&&new olympe.D.Node({Cd:b,Xm:e,dg:f,Sy:!1,ld:c})};olympe.D.js=function(a,b){const c=olympe.D.Wa();olympe.D.en(a,(...d)=>{olympe.D.Wa().destroy();c.run(b,...d)},'processFutureFlowsOnce')};olympe.D.ID=function(a,b,c){a=new olympe.D.Lj(a,c);b(a);return a.sb()};
|
|
368
|
+
olympe.D.ec=function(a,b='flowSource'){return new olympe.D.Lj(a,b)};olympe.D.pE=function(a,b,c,d){const e=olympe.D.Wa();olympe.D.di(a,(...f)=>{olympe.D.Wa().destroy();e.run(b,...f)},c,d||'syncProxiesOnce')};olympe.D.ij=function(a,b,c){olympe.D.ua([a],d=>d.valueOf()?b.apply(null,void 0):c&&c.apply(null,void 0),Object,'If')};olympe.D.VD=function(a,b,c='from observable'){const d=olympe.D.ec(b,c),e=a.subscribe(f=>d.update(f));d.getContext().onDestroy(()=>e.unsubscribe());return d.sb()};
|
|
369
369
|
olympe.D.SD=function(a,b,...c){return a?a.run(b,...c):b(...c)};olympe.D.tE=function(a){return olympe.D.Wa().G(a)};olympe.D.PD=function(a,b,c){olympe.D.Lw(a?a.Da:a,b,c)};
|
|
370
370
|
olympe.D.Lw=function(a,b,c){if(a){var d=a.U();null===dc&&(dc={});if(dc[d])olympe.D.H.log(`Already started node #${d} dump`+(b?`: ${b}`:''));else{dc[d]=!0;var e=`Starting node #${d} dump`+(b?`: ${b}`:'');c?olympe.D.H.warn(e):olympe.D.H.log(e);var f=`#${d}`+(b?`: ${b}`:'')+':';c=olympe.D.createNode(null,g=>{void 0===g?olympe.D.H.log(f,'undefined'):null===g?olympe.D.H.log(f,'null'):olympe.D.H.log(f,String(g))},null,[a],[0],'DataFlowDump');a.onDestroy(()=>{olympe.D.H.log(`Node #${d} destroyed`+(b?`: ${b}`:
|
|
371
371
|
''))});c.onDestroy(()=>{delete dc[d]})}}else olympe.D.H.log('NOT starting node dump, node is '+String(a))};olympe.D.OD=function(){let a='',b=olympe.D.Wa();for(;null!==b;)a+=b.Uc()+' --\x3e ',b=b.getParent();olympe.D.H.log(a)};
|
|
372
372
|
olympe.D.ra=function(a){if(void 0===a)return olympe.D.ba.ZERO;if(a instanceof olympe.D.ba)return a;a&&a.valueOf&&(a=a.valueOf());if('number'===typeof a){if(isNaN(a))return olympe.D.ba.Jp;if(a===Math.PI)return olympe.D.ba.PI;if(Infinity===a)return olympe.D.ba.Ht;if(-Infinity===a)return olympe.D.ba.Du;if(isNaN(a))var b=!1;else b=parseFloat(a),b=(b|0)===b;return b&&-1<=a&&100>=a?(olympe.D.Mh.has(a)||olympe.D.Mh.set(a,new olympe.D.ba(a)),olympe.D.Mh.get(a)):new olympe.D.ba(a)}return null};
|
|
373
|
-
olympe.D.$d=function(a){return void 0===a?olympe.D.Nd(olympe.D.ba):olympe.D.Nd(olympe.D.ba,olympe.D.bf(a)?a:olympe.D.ra(a))};olympe.D.By=olympe.D.ba.animate;olympe.D.eE=function(a,b){return new olympe.D.Ds(a,b)};olympe.D.Ab=function(a){if(a instanceof olympe.D.Qa)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.
|
|
373
|
+
olympe.D.$d=function(a){return void 0===a?olympe.D.Nd(olympe.D.ba):olympe.D.Nd(olympe.D.ba,olympe.D.bf(a)?a:olympe.D.ra(a))};olympe.D.By=olympe.D.ba.animate;olympe.D.eE=function(a,b){return new olympe.D.Ds(a,b)};olympe.D.Ab=function(a){if(a instanceof olympe.D.Qa)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.rk.has(a)?olympe.D.rk.get(a):new olympe.D.Qa(a)};
|
|
374
374
|
olympe.D.jE=function(a){return void 0===a?olympe.D.Nd(olympe.D.Qa):olympe.D.Nd(olympe.D.Qa,olympe.D.bf(a)?a:olympe.D.Ab(a))};olympe.D.Sb=function(a){return a instanceof olympe.D.fa?a:void 0!==a&&null!==a&&a.valueOf()?olympe.D.fa.F:olympe.D.fa.C};olympe.D.gE=function(a){return void 0===a?olympe.D.Nd(olympe.D.fa):olympe.D.Nd(olympe.D.fa,olympe.D.bf(a)?a:olympe.D.Sb(a))};olympe.D.fE=function(a){if(a instanceof Date)return new olympe.D.gb(a)};
|
|
375
375
|
olympe.D.iE=function(a){return olympe.D.Nd(olympe.D.gb,void 0!==a?new olympe.D.gb(a):null)};olympe.D.Yr=a=>a instanceof olympe.D.fa||a instanceof olympe.D.ba||a instanceof olympe.D.Qa||a instanceof olympe.D.gb;olympe.D.kE=function(a,b){return olympe.D.Nd(olympe.D.$b,void 0===a&&void 0===b?void 0:new olympe.D.$b(a,b))};olympe.D.My=function(a,b,c,d){let e;void 0!==a&&(a instanceof olympe.D.Color?e=a:e=olympe.D.Color.create(a,b,c,d));return olympe.D.Nd(olympe.D.Color,e)};olympe.D.hE=olympe.D.My;
|
|
376
|
-
olympe.D.Cw=function(a){olympe.D.H=a;olympe.D.Sh=olympe.D.Sg()};olympe.D.Sg=function(){olympe.D.
|
|
376
|
+
olympe.D.Cw=function(a){olympe.D.H=a;olympe.D.Sh=olympe.D.Sg()};olympe.D.Sg=function(){olympe.D.gn||(olympe.D.gn=new olympe.D.Hq);return olympe.D.gn};olympe.D.Wa=function(){olympe.D.Sh||(olympe.D.Sh=olympe.D.Sg());return olympe.D.Sh};olympe.D.ps=function(a){const b=olympe.D.Sh;olympe.D.an(a)&&(olympe.D.Sh=a);return null!=b?b:null};
|
|
377
377
|
olympe.D.Pb=a=>{a='string'===typeof a?JSON.parse(a):a;if(a.type){let b=null;switch(a.type){case 'dateTime':b=olympe.D.gb.Pb(a);break;case 'number':b=olympe.D.ba.Pb(a);break;case 'string':b=olympe.D.Qa.Pb(a);break;case 'vector2':b=olympe.D.$b.Pb(a);break;case 'color':b=olympe.D.Color.Pb(a);break;case 'boolean':b=olympe.D.fa.Pb(a)}return b}return null};function fc(a){a.C.fb()||(a.G.forEach(b=>{b.destroy()}),a.G.clear(),a.F.clear(),a.size.clear(),a.O.clear(),a.T.length=0,a.J.length=0)}
|
|
378
|
-
olympe.D.gC=class{constructor(){this.C=new olympe.D.Xb('Slot Manager context');this.G=new Map;this.C.run(()=>{this.F=olympe.D.ec(gc,'Last slot manager entry');this.size=Xb(olympe.D.ec(olympe.D.ba,'SlotManager size').repeat(this.F.sb().
|
|
379
|
-
class gc{constructor(a,b,c,d){this.id=a;this.F=new olympe.D.Xb('Slot manager entry');this.J=c;this.O=d;this.F.run(()=>{const e=Xb(olympe.D.ec(olympe.D.ba),olympe.D.ba.ZERO);olympe.D.jb(b)?e.repeat(b):e.update(b);this.C=olympe.D.ec(olympe.D.ba);this.G=this.C.sb().ae(e.sb())});this.next=null}U(){return this.id}Ux(){return this.C.sb()}
|
|
380
|
-
this.next=null}destroy(){this.F.destroy();this.G=this.C=this.next=null}}m=gc.prototype;m.U.L=olympe.D.K.C;m.Ux.L=new olympe.D.K(()=>olympe.D.ba);m.
|
|
378
|
+
olympe.D.gC=class{constructor(){this.C=new olympe.D.Xb('Slot Manager context');this.G=new Map;this.C.run(()=>{this.F=olympe.D.ec(gc,'Last slot manager entry');this.size=Xb(olympe.D.ec(olympe.D.ba,'SlotManager size').repeat(this.F.sb().Rm()),olympe.D.ba.ZERO);this.O=Xb(olympe.D.ec(olympe.D.ba,'last valid slots'),olympe.D.ra(-1))});this.T=[];this.J=[];this.C.onDestroy(()=>{fc(this)})}};
|
|
379
|
+
class gc{constructor(a,b,c,d){this.id=a;this.F=new olympe.D.Xb('Slot manager entry');this.J=c;this.O=d;this.F.run(()=>{const e=Xb(olympe.D.ec(olympe.D.ba),olympe.D.ba.ZERO);olympe.D.jb(b)?e.repeat(b):e.update(b);this.C=olympe.D.ec(olympe.D.ba);this.G=this.C.sb().ae(e.sb())});this.next=null}U(){return this.id}Ux(){return this.C.sb()}Rm(){return this.G}xd(){return this.J}gy(){return this.O}mz(a){this.J=a}$y(a){null===a?this.C.update(olympe.D.ba.ZERO):(this.C.repeat(a.Rm()),a.next=this)}Vt(){this.C.clear();
|
|
380
|
+
this.next=null}destroy(){this.F.destroy();this.G=this.C=this.next=null}}m=gc.prototype;m.U.L=olympe.D.K.C;m.Ux.L=new olympe.D.K(()=>olympe.D.ba);m.Rm.L=new olympe.D.K(()=>olympe.D.ba);m.xd.L=olympe.D.K.C;m.gy.L=olympe.D.K.C;m.mz.L=olympe.D.K.C;m.$y.L=olympe.D.K.C;m.Vt.L=olympe.D.K.C;m.destroy.L=olympe.D.K.C;olympe.D.R={Ca:'df.Logger'};olympe.W.config(a=>{F(a,olympe.D.V.Kp,Number.POSITIVE_INFINITY);E(a,olympe.D.R.Ca,[olympe.ka.R.Ea],b=>b.Vc('df'))},'olympe.df');olympe.W.run([olympe.D.R.Ca],a=>{olympe.D.Cw(a)},'olympe.df');olympe.host={};const hc=new Map,ic=new Map;olympe.host.Op=class{static register(a,b,...c){hc.set(a,b);0<c.length&&ic.set(a,c)}static create(a,b,c,d){const e=hc.get(a);if(void 0===e)throw Error('Undefined UI element type: '+a);a=ic.get(a);return void 0!==a?new e(b,c,...a.map(f=>Ja(d,f))):new e(b,c)}};function jc(a,b,c){a.H.debug('CREATE #',b,', type=',c);a.C.set(b,olympe.host.Op.create(c,b,a.H,a.J))}function kc(a,b,c,...d){const e=a.C.get(b);if(void 0!==e){a.H.O()<=olympe.ka.Eb.C.Rf&&a.H.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.jb(f))b.push(a.C.get(f.bw)||null);else if('function'===typeof f){const g=f,h=olympe.D.Wa();b.push((...k)=>{h.fb()||g(...k)})}else b.push(f.valueOf());e[c].apply(e,b)}}
|
|
381
381
|
function lc(a){var b=olympe.host.Ee.ud,c=olympe.host.Ee.Np.gr;++a.G;const d=a.G;jc(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.jb(p)?(h.push(n),p=p.Da):olympe.D.Jf(p)&&h.push(n);g[n]=p}0===h.length?e.run(()=>{kc(this,d,k,...g)}):(f=olympe.D.createNode(void 0,(...n)=>{e.run(()=>
|
|
382
|
-
{kc(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.Z(a.O.bind(a,d));a=L(e);a.bw=d;K(e,a);return a}olympe.host.Ta=class{constructor(a,b){this.H=a;this.J=b;this.G=0;this.C=new Map;this.F=new Map;a.debug('Starting host manager')}ab(){return this.H}O(a){this.H.debug('DESTROY #',a);const b=this.C.get(a);this.C.delete(a);b.destroy()}};olympe.host.Jd=class{constructor(a){this.C=a;this.F=olympe.D.Wa()}G(){return this.C}od(){return this.C.Da.od()||this.F.od()}fb(){return this.C.Da.fb()}};olympe.host.Jd.prototype.G.L=new olympe.D.K(()=>olympe.host.Ee.Jd,[]);olympe.host.
|
|
382
|
+
{kc(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.Z(a.O.bind(a,d));a=L(e);a.bw=d;K(e,a);return a}olympe.host.Ta=class{constructor(a,b){this.H=a;this.J=b;this.G=0;this.C=new Map;this.F=new Map;a.debug('Starting host manager')}ab(){return this.H}O(a){this.H.debug('DESTROY #',a);const b=this.C.get(a);this.C.delete(a);b.destroy()}};olympe.host.Jd=class{constructor(a){this.C=a;this.F=olympe.D.Wa()}G(){return this.C}od(){return this.C.Da.od()||this.F.od()}fb(){return this.C.Da.fb()}};olympe.host.Jd.prototype.G.L=new olympe.D.K(()=>olympe.host.Ee.Jd,[]);olympe.host.lk=class{C(){}F(){}};olympe.host.Bt=class{};function mc(a,b){var c=olympe.host.Of;const d=olympe.Y.Mc(),e=new olympe.D.Xb('onTimeout context');c.C.Z(b,d,()=>{e.fb()||e.od()||e.run(a);c.C.G(d)});return new olympe.host.ud.F(c.C,d,e)}function nc(a,b){var c=olympe.host.Of;const d=olympe.Y.Mc(),e=new olympe.D.Xb('onInterval context');c.C.T(b,d,()=>{e.fb()||e.od()?c.C.F(d):e.run(a)})}olympe.host.ud=class{constructor(a){this.C=lc(a)}};olympe.host.ud.C=class{constructor(a,b,c){this.Of=a;this.id=b;this.C=null!=c?c:null}U(){return this.id}cancel(){}};
|
|
383
383
|
olympe.host.ud.J=class extends olympe.host.ud.C{cancel(){this.Of.O(this.id);let a;null==(a=this.C)||a.destroy();this.C=null}};olympe.host.ud.F=class extends olympe.host.ud.C{cancel(){this.Of.G(this.id);let a;null==(a=this.C)||a.destroy();this.C=null}};olympe.host.ud.G=class extends olympe.host.ud.C{cancel(){this.Of.F(this.id);let a;null==(a=this.C)||a.destroy();this.C=null}};olympe.host.ze=class{F(a,b){return null!=b?b:''}ja(a,b){return null!=b?b:''}O(){}C(a,b){return null!=b?b:''}G(){}};olympe.host.ze.C={LIVENESS:'liveness',READINESS:'readiness',ALL:'all'};olympe.host.Ee={};olympe.host.Ee.Jd=class{destroy(){}};olympe.host.Ee.Jd.prototype.destroy=olympe.host.Ee.Jd.prototype.destroy;olympe.host.Ee.Np={uz:100,wz:101,vz:102,yz:103,xz:104,sz:105,YB:201,WB:202,TB:204,aC:205,SB:206,VB:207,ZB:208,bC:209,cC:210,dC:211,UB:212,$B:218,XB:219,eC:220,RB:221,QB:222,lC:300,mC:301,nC:302,rC:303,sC:304,tC:305,oC:310,pC:311,qC:312,sB:400,tB:401,uB:402,iB:450,bB:500,$A:501,eB:502,dB:503,aB:504,cB:505,MC:600,DC:601,HC:602,zC:603,AC:604,xC:605,CC:606,SC:607,KC:608,uC:609,yC:610,BC:611,JC:612,OC:613,vC:614,NC:615,IC:616,RC:617,EC:618,FC:619,GC:620,LC:630,wC:631,PC:632,QC:633,wD:700,$C:701,aD:702,
|
|
384
|
-
bD:703,dD:704,eD:705,fD:706,cD:707,hD:708,gD:709,iD:710,mD:711,uD:712,jD:713,kD:714,nD:715,oD:716,qD:717,rD:718,tD:719,pD:720,sD:721,vD:722,lD:723,xD:724,yD:725,gr:800};olympe.host.Ee.ud=class{O(){}Z(){}G(){}T(){}F(){}};olympe.host.R={
|
|
385
|
-
olympe.W.config(function(a){var b,c;const d='object'===typeof window&&(null==(b=window)?void 0:null==(c=b.location)?void 0:c.hostname)||'127.0.0.1';Ma(a,olympe.host.V.
|
|
386
|
-
e=>{null===olympe.host.Of&&(olympe.host.Of=new olympe.host.ud(e));return olympe.host.Of},!0)},'olympe.host');olympe.W.run([olympe.host.R.Jq],a=>a,'olympe.host.scheduler');olympe.W.run([olympe.host.R.Ea],a=>a,'olympe.host');olympe.W.run([olympe.host.R.Pe],a=>{olympe.host.
|
|
387
|
-
olympe.net.Aa.Yb={Qs:0,xh:200,
|
|
384
|
+
bD:703,dD:704,eD:705,fD:706,cD:707,hD:708,gD:709,iD:710,mD:711,uD:712,jD:713,kD:714,nD:715,oD:716,qD:717,rD:718,tD:719,pD:720,sD:721,vD:722,lD:723,xD:724,yD:725,gr:800};olympe.host.Ee.ud=class{O(){}Z(){}G(){}T(){}F(){}};olympe.host.R={hk:'host.System',bp:'host.HistoryManager',Jq:'host.Scheduler',Ca:'host.platform.Logger',Ea:'host.Manager',Pe:'host.ProcessManager'};olympe.host.V={bk:'role',cp:'host.currentHost',hq:'host.processProbe',Pq:'host.gracefulShutdownTimeout'};olympe.host.Gg={ws:'active',Bh:'preview'};olympe.host.Of=null;
|
|
385
|
+
olympe.W.config(function(a){var b,c;const d='object'===typeof window&&(null==(b=window)?void 0:null==(c=b.location)?void 0:c.hostname)||'127.0.0.1';Ma(a,olympe.host.V.cp,d);b=olympe.host.Gg.ws;c=olympe.host.Gg.Bh;F(a,olympe.host.V.bk,d.startsWith(`${c}.`)?c:b);Pa(a,olympe.host.R.hk);Pa(a,olympe.host.R.bp);C(a,olympe.host.R.Pe,olympe.host.ze);E(a,olympe.host.R.Ca,[olympe.ka.R.Ea],e=>e.Vc('host'));C(a,olympe.host.R.Ea,olympe.host.Ta,olympe.host.R.Ca,olympe.W.R.og);E(a,olympe.host.R.Jq,[olympe.host.R.Ea],
|
|
386
|
+
e=>{null===olympe.host.Of&&(olympe.host.Of=new olympe.host.ud(e));return olympe.host.Of},!0)},'olympe.host');olympe.W.run([olympe.host.R.Jq],a=>a,'olympe.host.scheduler');olympe.W.run([olympe.host.R.Ea],a=>a,'olympe.host');olympe.W.run([olympe.host.R.Pe],a=>{olympe.host.Ck=()=>a});olympe.net={};olympe.net.Aa={};olympe.net.Aa.Id={Ah:'POST',GET:'GET',yt:'HEAD',iq:'PUT',Dc:'DELETE',Xp:'OPTIONS',vB:'PATCH'};olympe.net.Aa.ResponseType={om:'text',Xk:'blob',Ti:'arraybuffer'};olympe.net.Aa.Headers={ki:'content-type',Iz:'content-length',Gn:'authorization',Cs:'access-control-allow-origin',As:'access-control-allow-headers',Bs:'access-control-allow-methods',No:'x-forwarded-host',Oo:'x-forwarded-proto'};olympe.net.Aa.hl={KA:'text/html',JSON:'application/json',aw:'application/zip',$f:'application/octet-stream'};
|
|
387
|
+
olympe.net.Aa.Yb={Qs:0,xh:200,Xn:201,sj:202,Wk:400,Rv:401,Lo:403,Ol:404,fB:405,Li:500,rv:503};function oc(a){return a.host&&encodeURI(a.host)}function pc(a){return encodeURI(a.path).replace(olympe.net.Vi.C,(b,c)=>'%'+c)}function qc(a){return void 0===a.G?443===a.port:a.G}olympe.net.Vi=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`${qc(this)?'wss':'ws'}://${oc(this)}:${this.port}/${pc(this)}`}toString(){return`${oc(this)}:${this.port}/${pc(this)}`}};
|
|
388
388
|
olympe.net.Vi.C=/%25([0-9a-f]{2})/i;olympe.net.WebSocket=class{send(){}close(){}ea(){}aa(){}Z(){}F(){}};function N(a,b,c,d){a=olympe.Y.Ny(a.valueOf());if(!a.host&&!a.path)return null;const e=a.scheme?a.scheme.includes('s'):!1;b=new olympe.net.wi(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=Ua(olympe.Y.Xe(),`${c[0]}:${c[1]}`),rc(b,{Authorization:`Basic ${c}`})));return b}function sc(a){return void 0!==a.query?a.query.replace(/[^=&]+/g,b=>encodeURIComponent(b)):null}function rc(a,b){Object.assign(a.headers,b)}
|
|
389
|
-
olympe.net.wi=class extends olympe.net.Vi{constructor(a,b,c,d,e,f,g,h){super(a,b,c,d);this.method=void 0!==e?e:olympe.net.Aa.Id.GET;this.query=h;this.headers={};this.body=f;this.F=void 0!==g?g:olympe.net.Aa.ResponseType.
|
|
389
|
+
olympe.net.wi=class extends olympe.net.Vi{constructor(a,b,c,d,e,f,g,h){super(a,b,c,d);this.method=void 0!==e?e:olympe.net.Aa.Id.GET;this.query=h;this.headers={};this.body=f;this.F=void 0!==g?g:olympe.net.Aa.ResponseType.om;this.ca=this.cert=this.key=null;this.rejectUnauthorized=!1}fj(){return this.headers}C(){let a=sc(this);a=a?`?${a}`:'';if(!oc(this))return`${pc(this)}${a}`;const b=Number.isInteger(this.port)?`:${this.port}`:'';return`${qc(this)?'https':'http'}://${oc(this)}${b}/${pc(this)}${a}`}toString(){return this.C()}};
|
|
390
390
|
olympe.net.wi.Id={Ah:'POST',GET:'GET',yt:'HEAD',iq:'PUT',Dc:'DELETE',Xp:'OPTIONS'};olympe.net.be=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}Gc(){return this.status}fj(){return this.headers}};function tc(a,b,c){const d=olympe.D.Wa(),e=d.onDestroy(()=>{var f=a.F();const g=f.C.get(b);g&&(f.C.delete(b),g())});return d.G(f=>{d.Mf(e);a.F().C.delete(b);c(f)})}olympe.net.Ta=class{constructor(a){this.H=a;this.J=1;a='Initializing NET layer';this.H.C()&&(a+=' (implementation: '+this.T()+')');this.H.info(a);this.H.log('DONE initializing NET layer (ready to receive connection requests)')}F(){}G(){}C(){}O(){}Kf(){}T(){}};function uc(a){let b;return!(null==(b=a.C)||!b.connected)&&a.J}function vc(a){if(!a.F)throw Error('Cannot build connection options because the configuration is not available yet');const b=()=>({username:`${a.F.vhost}:${a.F.username}`,password:a.F.password});return Object.assign({},a.F,b(),{transformWsUrl:(c,d)=>{null!==a.F&&Object.assign(d,b());return c}})}
|
|
391
391
|
function wc(a,b){if(!uc(a))return Promise.reject(Error('Cannot unsubscribe because the MQTT client is disconnected'));a.H.C()&&a.H.debug(`MQTT unsubscribe topic ${b}`);return new Promise((c,d)=>{a.C.unsubscribe(b,void 0,e=>{a.G.delete(b);e?d(e):c()})})}function xc(a,b){a.T.push(b)}function yc(a,b){a.O.push(b)}function zc(a,b){a.Z.push(b)}
|
|
392
392
|
olympe.net.pf=class{constructor(a){this.H=olympe.ka.ab('MQTT');this.J=!1;this.C=this.F=null;this.O=[];this.Z=[];this.ea=[];this.aa=[];this.T=[];this.G=new Map;const b=olympe.Y.Promise.$i(()=>this.connect(),0);a.subscribe(c=>{this.H.C()&&this.H.debug('New MQTT configuration received',JSON.stringify(c));this.F=c;null!==c&&this.J&&(uc(this)?this.end(!1,()=>b().then()):b().then())})}connect(a){if(uc(this))return null==a||a(),this;a&&this.O.push(a);this.J=!0;null===this.C&&null!==this.F&&(this.C=mqtt.connect(this.F.url,
|
|
@@ -394,749 +394,749 @@ vc(this)),this.C.on(olympe.net.pf.C.Cu,(b,c)=>{this.H.C()&&this.H.debug(`MQTT <
|
|
|
394
394
|
b);this.aa.forEach(c=>c(b))}),this.C.on(olympe.net.pf.C.ee,()=>{this.H.info('Mqtt client is offline');this.ea.forEach(b=>b())}),this.C.on(olympe.net.pf.C.Vs,()=>{this.H.info('Mqtt client is closed');this.T.forEach(b=>b())}),this.C.on(olympe.net.pf.C.Vf,()=>{this.H.info('Mqtt client has ended')}));return this}publish(a,b,c){if(!uc(this))return Promise.reject(Error('Cannot publish message because the MQTT client is disconnected'));const d=JSON.stringify(b);this.H.C()&&this.H.debug(`MQTT > ${d}`);return new Promise((e,
|
|
395
395
|
f)=>{this.C.publish(a,d,c,g=>{g?f(Error('Failed to publish a message '+d)):e()})})}subscribe(a,b){if(!uc(this))return Promise.reject(Error('Cannot subscribe because the MQTT client is disconnected'));this.H.debug(`MQTT subscribe to topic ${a}`);return new Promise((c,d)=>{this.C.subscribe(a,void 0,e=>{e?d(Error(`Failed to subscribe to topic ${a}: ${e}`)):(this.G.set(a,b),c())})})}end(a,b){this.J=!1;this.G.clear();this.C?this.C.end(a,{},()=>{this.C=null;null==b||b()}):null==b||b();return this}};
|
|
396
396
|
olympe.net.pf.C={Ws:'connect',fv:'reconnect',Cu:'message',Vs:'close',Vf:'end',xb:'error',ee:'offline'};olympe.net.Kh=class{constructor(a){this.H=a}start(){return Promise.reject('Try to start web server with the browser implementation.')}J(){return Promise.reject('Try to restart web server with the browser implementation.')}stop(){return Promise.reject('Try to stop web server with the browser implementation.')}G(){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.')}};
|
|
397
|
-
olympe.net.Kh.ALL='*';olympe.net.Dv=class{register(){return v(function*(){throw Error('Service Worker Manager must be overridden by a native layer: called "register"');})}};olympe.net.R={Ea:'net.Manager',Ca:'net.Logger',Ui:'net.WebServer',wv:'net.ServiceWorkerManager',
|
|
398
|
-
olympe.W.config(function(a){F(a,olympe.net.V.lf,3141);F(a,olympe.net.V.
|
|
399
|
-
b],['offlineAutoBackOnline',!b||c]]))},'olympe.net');olympe.Ua.node.host={};olympe.Ua.node.host.Jd=function(a,b){this.H=b};olympe.Ua.node.host.Jd.prototype.constructor=olympe.Ua.node.host.Jd;olympe.Ua.node.host.Jd.prototype.destroy=function(){};olympe.Ua.node.host.Jd.prototype.destroy=olympe.Ua.node.host.Jd.prototype.destroy;olympe.Ua.node.host.Jd.prototype.ab=function(){return this.H};olympe.Ua.node.host.Jd.ya=[olympe.host.Ee.Jd];
|
|
400
|
-
function
|
|
401
|
-
function
|
|
402
|
-
olympe.Ua.node.host.ze=class extends olympe.host.ze{constructor(a,b,c,d=!0){super();this.H=a;this.ea=b;this.
|
|
403
|
-
a);return b}O(a){this.J.has(a)?this.J.delete(a):this.T.delete(a)}};olympe.W.config(function(a){F(a,olympe.host.V.hq,!0);F(a,olympe.host.V.Pq,1E4);Na(a,olympe.host.R.
|
|
397
|
+
olympe.net.Kh.ALL='*';olympe.net.Dv=class{register(){return v(function*(){throw Error('Service Worker Manager must be overridden by a native layer: called "register"');})}};olympe.net.R={Ea:'net.Manager',Ca:'net.Logger',Ui:'net.WebServer',wv:'net.ServiceWorkerManager',Rl:'net.OfflineConfig'};olympe.net.V={lf:'net.httpPort',gp:'net.httpBodyLimit',fr:'net.http2',fp:'net.httpsCertificatesPath',Jl:'net.localNetworkSuffix',Ii:'offline.enabled',Ql:'offline.autoBackOnline',Wp:'offline.downloadBatchSize'};
|
|
398
|
+
olympe.W.config(function(a){F(a,olympe.net.V.lf,3141);F(a,olympe.net.V.gp,100);F(a,olympe.net.V.fr,!1);F(a,olympe.net.V.fp,null);F(a,olympe.net.V.Jl,'frontend');F(a,olympe.net.V.Ii,!1);F(a,olympe.net.V.Ql,!1);F(a,olympe.net.V.Wp,20);Pa(a,olympe.net.R.Ea);E(a,olympe.net.R.Ca,[olympe.ka.R.Ea],b=>b.Vc('net'));C(a,olympe.net.R.Ui,olympe.net.Kh,olympe.net.R.Ca);C(a,olympe.net.R.wv,olympe.net.Dv);E(a,olympe.net.R.Rl,[new olympe.W.oa(olympe.net.V.Ii),new olympe.W.oa(olympe.net.V.Ql)],(b,c)=>new Map([['offlineEnabled',
|
|
399
|
+
b],['offlineAutoBackOnline',!b||c]]))},'olympe.net');olympe.Ua.node.host={};olympe.Ua.node.host.Jd=function(a,b){this.H=b};olympe.Ua.node.host.Jd.prototype.constructor=olympe.Ua.node.host.Jd;olympe.Ua.node.host.Jd.prototype.destroy=function(){};olympe.Ua.node.host.Jd.prototype.destroy=olympe.Ua.node.host.Jd.prototype.destroy;olympe.Ua.node.host.Jd.prototype.ab=function(){return this.H};olympe.Ua.node.host.Jd.ya=[olympe.host.Ee.Jd];olympe.Ua.node.host.Pp=class{constructor(a){this.H=a}};olympe.Ua.node.host.Pp.ya=[olympe.host.Bt];olympe.Ua.node.host.ud=class{constructor(){this.C={};this.J={}}destroy(){}O(a){clearTimeout(this.C[a]);delete this.C[a]}Z(a,b,c){this.C[b]=setTimeout(c,a)}G(a){clearTimeout(this.C[a]);delete this.C[a]}T(a,b,c){this.J[b]=setInterval(c,a)}F(a){clearInterval(this.J[a]);delete this.J[a]}};olympe.host.Op.register(olympe.host.Ee.Np.gr,olympe.Ua.node.host.ud);olympe.Ua.node.host.ud.ya=[olympe.host.Ee.ud];olympe.Ua.node.host.lk=class{constructor(a){this.H=a}C(){return olympe.D.fa.F}F(){return!0}};olympe.Ua.node.host.lk.ya=[olympe.host.lk];function Ac(a){a.ea.G('readinessProbe','/readiness',[olympe.net.Aa.Id.GET],()=>Bc(a,a.aa)).catch(b=>a.H.error(`Failed to add readiness health check route ${b}`));a.ea.G('livenessProbe','/liveness',[olympe.net.Aa.Id.GET],()=>Bc(a,a.Z)).catch(b=>a.H.error(`Failed to add liveness health check route ${b}`));a.F(()=>a.ea.stop())}
|
|
400
|
+
function Cc(a,b){b=Array.from(b.entries()).map(([c,d])=>olympe.Y.Promise.tn(d(),a.va,`Shutdown hook ${c} has timeout`));return Promise.allSettled(b).then(c=>{let d=!1;for(const e of c)'rejected'===e.status&&(d=!0,a.H.warn(`Failed to close some resource: ${e.reason}`));return d})}function Dc(a){return v(function*(){try{const b=yield Cc(a,a.J),c=yield Cc(a,a.T);if(b||c)throw Error('Failed to gracefully close the backend');}finally{a.J.clear(),a.T.clear()}})}
|
|
401
|
+
function Bc(a,b){const c=olympe.net.Aa.Yb.xh,d=olympe.net.Aa.Yb.Li;b=Array.from(b.values()).map(e=>e.apply(a));return 0===b.length?Promise.resolve(new olympe.net.be('No healthCheck is set',c,'Nothing to check')):Promise.allSettled(b).then(e=>{let f=!1,g='Health check result: ';for(const h of e)'rejected'===h.status?(f=!0,e=h.reason,g+=`\n${e}`,a.H.warn(`Health check detected a service which is DOWN: ${e}`)):g+=`\n${h.value}`;return new olympe.net.be(g,f?d:c,f?'Some services are not working':'Everything is OK')})}
|
|
402
|
+
olympe.Ua.node.host.ze=class extends olympe.host.ze{constructor(a,b,c,d=!0){super();this.H=a;this.ea=b;this.va=c;this.Z=new Map;this.aa=new Map;this.J=new Map;this.T=new Map;d&&Ac(this)}C(a,b=olympe.Y.Cf(),c=olympe.host.ze.C.ALL){switch(c){case olympe.host.ze.C.LIVENESS:this.Z.set(b,a);break;case olympe.host.ze.C.READINESS:this.aa.set(b,a);break;default:this.Z.set(b,a),this.aa.set(b,a)}return b}G(a){this.aa.delete(a);this.Z.delete(a)}F(a,b=olympe.Y.Cf()){this.J.set(b,a);return b}ja(a,b=olympe.Y.Cf()){this.T.set(b,
|
|
403
|
+
a);return b}O(a){this.J.has(a)?this.J.delete(a):this.T.delete(a)}};olympe.W.config(function(a){F(a,olympe.host.V.hq,!0);F(a,olympe.host.V.Pq,1E4);Na(a,olympe.host.R.bp,olympe.Ua.node.host.Pp,olympe.host.R.Ca);Na(a,olympe.host.R.hk,olympe.Ua.node.host.lk,olympe.host.R.Ca);C(a,olympe.host.R.Pe,olympe.Ua.node.host.ze,olympe.host.R.Ca,olympe.net.R.Ui,new olympe.W.oa(olympe.host.V.Pq),new olympe.W.oa(olympe.host.V.hq))},'olympe.native.node.host');olympe.W.run([olympe.host.R.Pe],a=>{olympe.Ua.node.host.Ck=()=>a});olympe.net.oe={};olympe.net.oe.Al=class{constructor(a){this.H=a;this.C=new Map}G(){}F(){}};olympe.net.oe.WebSocket=class{constructor(a,b){this.H=b;this.id=a;this.C=null;this.buffer=[];this.O=this.G=this.J=this.T=null}U(){return this.id}open(a){const b=`#${this.id}`,c=this.ja(a);c.binaryType='arraybuffer';c.addEventListener('open',()=>{this.H.info(`Websocket ${b} OPENED`);this.T?(this.H.debug('Notifying upper layer for WebSocket',b),this.T()):this.H.warn('Nothing to notify for WebSocket',b);this.H.debug(b,`Send all buffered messages (n=${this.buffer.length}).`);this.buffer.forEach(c.send.bind(c));
|
|
404
404
|
this.buffer.length=0});c.addEventListener('message',d=>{d='string'===typeof d.data?String(d.data):Va(d.data);(this.H.J()||this.H.C()&&!d.startsWith('pong'))&&this.H.debug(b,'<',d);this.G&&this.G(d)});c.addEventListener('close',()=>{this.H.info(`WebSocket ${b} CLOSED`);this.J&&this.J()});c.addEventListener('error',()=>{this.H.debug(`WebSocket ${b} ERROR`);this.O&&this.O()});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.H.J()||
|
|
405
405
|
this.H.C()&&!a.startsWith('ping'))&&this.H.debug(b,'>',a);this.C.send(a);break;case c.CONNECTING:this.H.debug(b,'- Connecting: BUFFER','>',a);this.buffer.push(a);break;default:return this.H.debug(b,'- Closed','>',a),!1}}else this.H.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.H.debug(`Force closing native websocket ${`#${this.id}`}`);this.C.close(1E3);return}}this.H.debug('Try to force close native websocket, but not open nor connecting')}ea(a){this.T=
|
|
406
|
-
a||null}aa(a){this.G=a||null}F(a){this.O=a||null}Z(a){this.J=a||null}ja(){}};olympe.net.oe.WebSocket.ya=[olympe.net.WebSocket];olympe.Ua.node.net={};olympe.Ua.node.net.Iu=class extends olympe.net.Ta{constructor(a,b){super(a,b);this.Z=new olympe.Ua.node.net.
|
|
407
|
-
b:a.body,r:a.F},b)}O(){this.H.warn('DOWNLOAD FILE not available with node native implementation. URL:')}F(){return this.Z}};const
|
|
408
|
-
olympe.Ua.node.net.
|
|
409
|
-
new Uint8Array(Buffer.from(O,'binary'));M=x===olympe.net.Aa.ResponseType.
|
|
410
|
-
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(y=>{this.H.log('Error loading self signed files:',y)})):this.H.warn('All three self signed files must be specified!'):p(b)}F(a,b,c,d){this.H.debug('Received HTTP response',a,c);return new olympe.net.be(c,a,b,d)}};olympe.Ua.node.net.Ju=class extends olympe.net.oe.WebSocket{ja(a){return new (require('ws'))(a)}};olympe.Ua.node.net.V={ZC:'native.html.net.useWorkers'};olympe.W.config(function(a){a.getParameter(olympe.net.V.Ii)&&Ma(a,olympe.net.V.Ii,!1);Na(a,olympe.net.R.Ea,olympe.Ua.node.net.Iu,olympe.net.R.Ca,olympe.host.R.Ea)},'olympe.native.node.net');olympe.Ua.node.net.http={};const
|
|
411
|
-
function
|
|
412
|
-
k=new olympe.net.wi(q,parseInt(r,10),g.url,'https'===g.protocol,k,p);for(const [t,u]of Object.entries(g.headers))k.headers[t]=u;a.H.debug('< HTTP:',k.toString());n=new Map(Object.entries(g.params));g=new Map(Object.entries(g.query));return d(k,n,g).then(t=>{const u=t.Gc(),x=t.getData();(x instanceof Uint8Array||x instanceof ArrayBuffer||x instanceof
|
|
406
|
+
a||null}aa(a){this.G=a||null}F(a){this.O=a||null}Z(a){this.J=a||null}ja(){}};olympe.net.oe.WebSocket.ya=[olympe.net.WebSocket];olympe.Ua.node.net={};olympe.Ua.node.net.Iu=class extends olympe.net.Ta{constructor(a,b){super(a,b);this.Z=new olympe.Ua.node.net.Al(a)}T(){return'NodeJS'}Kf(){return olympe.D.fa.F}G(a){var b=this.J++;a=a.C();this.H.debug('CREATE Websocket #'+b+' to '+a);b=new olympe.Ua.node.net.Ju(b,this.H);b.open(a);return b}C(a,b){this.H.debug('SEND HTTP '+a.method+' to '+a.C());const c=this.J++;b=tc(this,c,b);this.Z.G(c,{u:a.C(),s:qc(a),h:oc(a),p:a.port,z:pc(a),q:sc(a),m:a.method,v:a.fj(),k:a.key,c:a.cert,a:a.ca,j:a.rejectUnauthorized,
|
|
407
|
+
b:a.body,r:a.F},b)}O(){this.H.warn('DOWNLOAD FILE not available with node native implementation. URL:')}F(){return this.Z}};const Ec=require('fs'),Fc=require('http'),Gc=require('https');
|
|
408
|
+
olympe.Ua.node.net.Al=class extends olympe.net.oe.Al{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,x=b.r;b={host:p,port:q,path:t?r+'?'+t:r,method:f};g&&(b.headers=g);g=(y,z,A)=>new Promise((D,O)=>{Ec.readFile(y,(M,xa)=>{M?O(M):(A[z]=xa,D(A))})});p=y=>{const z=D=>{D.setEncoding(x===olympe.net.Aa.ResponseType.om?'utf-8':'binary');let O='';D.on('data',M=>{O+=M});D.on('end',()=>{if(x!==olympe.net.Aa.ResponseType.om){var M=
|
|
409
|
+
new Uint8Array(Buffer.from(O,'binary'));M=x===olympe.net.Aa.ResponseType.Xk?new Blob(M):M}else M=O;c(this.F(D.statusCode,D.statusMessage,M,D.headers))})},A=d?new Gc.request(y,z):new Fc.request(y,z);this.C.set(a,()=>{A.destroy()});A.on('error',D=>{c(this.F(olympe.net.Aa.Yb.Li,'Connection 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
|
|
410
|
+
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(y=>{this.H.log('Error loading self signed files:',y)})):this.H.warn('All three self signed files must be specified!'):p(b)}F(a,b,c,d){this.H.debug('Received HTTP response',a,c);return new olympe.net.be(c,a,b,d)}};olympe.Ua.node.net.Ju=class extends olympe.net.oe.WebSocket{ja(a){return new (require('ws'))(a)}};olympe.Ua.node.net.V={ZC:'native.html.net.useWorkers'};olympe.W.config(function(a){a.getParameter(olympe.net.V.Ii)&&Ma(a,olympe.net.V.Ii,!1);Na(a,olympe.net.R.Ea,olympe.Ua.node.net.Iu,olympe.net.R.Ca,olympe.host.R.Ea)},'olympe.native.node.net');olympe.Ua.node.net.http={};const Hc=require('fastify'),{Readable:Ic}=require('stream'),Jc={gk:0,fk:1,im:2},Kc=olympe.net.Aa.Id.Xp,Lc=olympe.net.Aa.Headers.Cs,Mc=olympe.net.Aa.Headers.As,Nc=olympe.net.Aa.Headers.Bs,Oc=olympe.net.Aa.Yb.xh;
|
|
411
|
+
function Pc(a,b){const c=b.methods,d=b.Zx,e=b.headers,f=b.origin;a.F.route({bodyLimit:a.aa<<20,url:b.path,method:[...c,Kc],handler:(g,h)=>{a.H.debug('Incoming request:','hostname:',g.hostname,'headers:',JSON.stringify(g.headers));var k=g.method;const l={[Lc]:f,[Nc]:c,[Mc]:e};if(k===Kc)return a.H.debug('< HTTP: OPTIONS'),h.code(Oc).headers(l).send();var n=g.body;if(n instanceof Buffer){var p=new Uint8Array(n.length);n.copy(p)}else if('string'===typeof n||n instanceof Object)p=n;const [q,r]=g.hostname.split(':');
|
|
412
|
+
k=new olympe.net.wi(q,parseInt(r,10),g.url,'https'===g.protocol,k,p);for(const [t,u]of Object.entries(g.headers))k.headers[t]=u;a.H.debug('< HTTP:',k.toString());n=new Map(Object.entries(g.params));g=new Map(Object.entries(g.query));return d(k,n,g).then(t=>{const u=t.Gc(),x=t.getData();(x instanceof Uint8Array||x instanceof ArrayBuffer||x instanceof Ic)&&h.type(olympe.net.Aa.hl.$f);if(u>=olympe.net.Aa.Yb.Li)throw Error(x);u>=olympe.net.Aa.Yb.Wk?a.H.warn('> HTTP: client bad request: reply with error:',
|
|
413
413
|
x):a.H.debug('> HTTP: reply with body:',Buffer.isBuffer(x)?'binary':x);return h.code(u).headers(Object.assign(l,t.fj())).send(x)}).catch(t=>{a.H.error('> HTTP: reply with internal server error:',t);return h.code(olympe.net.Aa.Yb.Li).headers(Object.assign(l,{[olympe.net.Aa.Headers.ki]:'text/plain'})).send('Internal server error')})}})}
|
|
414
|
-
olympe.Ua.node.net.http.Kh=class extends olympe.net.Kh{constructor(a,b,c,d,e){super(a);this.aa=c;this.port=b;this.ea=d;this.T=e;this.F=this.createServer();this.O=new Map;this.C=
|
|
415
|
-
a);return this.F.listen({port:this.port,host:'0.0.0.0'}).then(a=>{this.C=
|
|
416
|
-
yield c.F.close();c.F=c.createServer();yield c.start()})})})}stop(){return this.C===
|
|
417
|
-
d)=>{d(null,c)});return a}$i(a,b=1E3){this.timer&&clearTimeout(this.timer);this.timer=setTimeout(a,b)}};olympe.W.config(function(a){C(a,olympe.net.R.Ui,olympe.Ua.node.net.http.Kh,olympe.net.R.Ca,new olympe.W.oa(olympe.net.V.lf),new olympe.W.oa(olympe.net.V.
|
|
418
|
-
olympe.Ua.node.Y
|
|
419
|
-
{throw Error(`Error while trying to fetch buffer from ObjectURL: ${b}`);})}};olympe.W.config(function(a){Na(a,olympe.Y.R.mg,olympe.Ua.node.Y
|
|
420
|
-
olympe.async.
|
|
414
|
+
olympe.Ua.node.net.http.Kh=class extends olympe.net.Kh{constructor(a,b,c,d,e){super(a);this.aa=c;this.port=b;this.ea=d;this.T=e;this.F=this.createServer();this.O=new Map;this.C=Jc.gk;this.Bd=new Set;this.timer=null}G(a,b,c,d){const e=olympe.net.Kh.ALL;this.O.set(a,{path:b,methods:c,Zx:d,headers:e,origin:e});return this.J()}Z(a){const b=this;return v(function*(){b.O.delete(a);return 0<b.O.size?b.J():b.stop()})}start(){if(this.C===Jc.gk)return this.J();if(this.C===Jc.fk){for(const a of this.O.values())Pc(this,
|
|
415
|
+
a);return this.F.listen({port:this.port,host:'0.0.0.0'}).then(a=>{this.C=Jc.im;this.H.debug('Web server listening on '+a);this.Bd.forEach(b=>b(null))}).catch(a=>{this.stop().then();this.Bd.forEach(b=>b(a))}).finally(()=>this.Bd.clear())}return Promise.reject('Try to start a webservice already started')}J(){return this.C===Jc.fk?(new Promise((a,b)=>{this.Bd.add(c=>c?b(c):a())})).then(()=>this.J()):new Promise((a,b)=>{this.Bd.add(c=>c?b(c):a());this.$i(()=>{const c=this;return v(function*(){c.C=Jc.fk;
|
|
416
|
+
yield c.F.close();c.F=c.createServer();yield c.start()})})})}stop(){return this.C===Jc.im?this.F.close().then(()=>{this.C=Jc.gk}):Promise.resolve()}createServer(){var a={logger:{level:olympe.ka.Eb.F[this.H.O()].toLowerCase()},http2:this.ea};if('string'===typeof this.T){const b=require('fs'),c=require('path');Object.assign(a,{https:{allowHTTP1:!0,key:b.readFileSync(c.join(this.T,'key.pem')),cert:b.readFileSync(c.join(this.T,'cert.pem'))}})}a=Hc(a);a.addContentTypeParser('*',{parseAs:'buffer'},(b,c,
|
|
417
|
+
d)=>{d(null,c)});return a}$i(a,b=1E3){this.timer&&clearTimeout(this.timer);this.timer=setTimeout(a,b)}};olympe.W.config(function(a){C(a,olympe.net.R.Ui,olympe.Ua.node.net.http.Kh,olympe.net.R.Ca,new olympe.W.oa(olympe.net.V.lf),new olympe.W.oa(olympe.net.V.gp),new olympe.W.oa(olympe.net.V.fr),new olympe.W.oa(olympe.net.V.fp))},'olympe.native.node.net.http');olympe.Ua.node.Y={};const Qc=require('stream').Readable,Rc=require('buffer');
|
|
418
|
+
olympe.Ua.node.Y.Zk=class extends olympe.Y.Zk{F(a){return new Uint8Array(Buffer.from(a,'base64'))}C(a){return a instanceof Uint8Array?Buffer.from(a,a.byteOffset,a.byteLength).toString('base64'):Buffer.from(a).toString('base64')}J(a){const b=this,c=()=>super.J;return v(function*(){if(a instanceof Qc){const d=[];for(const e=ha(a);;){const f=yield e.next();if(f.done)break;d.push(f.value)}return Buffer.concat(d)}return c().call(b,a)})}G(a){return Promise.resolve().then(()=>Rc.resolveObjectURL(a)).catch(b=>
|
|
419
|
+
{throw Error(`Error while trying to fetch buffer from ObjectURL: ${b}`);})}};olympe.W.config(function(a){Na(a,olympe.Y.R.mg,olympe.Ua.node.Y.Zk)},'olympe.native.node.utils');olympe.async={};function Sc(a,b){a.J||a.Z.push(a.G.G(b))}
|
|
420
|
+
olympe.async.Go=class{constructor(a,b=void 0===a){this.F=[];this.Z=[];this.G=a||new olympe.D.Xb('Async executor context');this.ja=b;this.C=null;this.env=new Map;this.env.set('Executor',this);this.J=this.O=!1;this.H=null;this.timer=this.timeout=0;this.aa=olympe.Y.Mc()}tn(a){0<=a&&(this.timeout=a);return this}ab(){return this.H}add(a){this.J||this.F.push(this.G.G(a));return this}start(){this.O||(this.H&&this.H.log('Executor started.'),this.O=!0,this.G.onDestroy(()=>{this.C='Context destroyed.';this.complete(!1)},
|
|
421
421
|
this.aa),0<this.timeout&&(this.timer=setTimeout(()=>{this.C='Timeout expired.';this.timer=0;this.complete(!1)},this.timeout)))}clear(){this.F=[];this.Z=[];this.env.clear();this.ja&&this.G.destroy()}complete(a){this.G.Mf(this.aa);if(!this.J){this.J=!0;this.timer&&(clearTimeout(this.timer),this.timer=0);this.H&&this.H.log(a?'Executor completed successfully':`Executor completed with error: ${this.C}`);for(const b of this.Z)b(a,a?null:this.C,this.env);this.clear()}}getContext(){return this.G}};
|
|
422
|
-
function
|
|
423
|
-
olympe.async.
|
|
424
|
-
0<this.F.length){this.T=this.F.length;for(const a of this.F)this.run(a)}else this.complete(!0)}};olympe.Db={};olympe.Db.pu=class{F(){return v(function*(){})}Z(){}O(){}G(){}T(){}forEach(){}has(){}get(){}set(){}remove(){}ea(){}aa(){}clear(){}J(){}};olympe.Db.qu=class{F(){}};olympe.Db.Storage=class{open(){}write(){}close(){}};olympe.Db.zu=class{get(){return null}set(){return this}delete(){}};olympe.Db.R={
|
|
425
|
-
olympe.N.errors.
|
|
426
|
-
olympe.W.config(a=>{F(a,olympe.N.Zb.
|
|
427
|
-
'rest/authorization/roleMembers')});function
|
|
428
|
-
function
|
|
429
|
-
e&&c(e)})})}function
|
|
430
|
-
function
|
|
431
|
-
function
|
|
432
|
-
function
|
|
433
|
-
function
|
|
434
|
-
function
|
|
435
|
-
function
|
|
436
|
-
function
|
|
437
|
-
olympe.N.
|
|
438
|
-
this.ja='';h.get('topicPrefix').subscribe(k=>{this.H.debug(`Bus: new topic prefix: ${k}`);const l=this.ja;this.ja=k;if(
|
|
439
|
-
this.aa=!1;this.T=[];this.ea=new Map;this.
|
|
440
|
-
c(Error('Guest user is not allowed to connect to RabbitMQ, you can allow guest with the bus.allowGuest oConfig parameter!'))})):c(Error('Cannot connect to the bus if working offline'))})}disconnect(){return new Promise(a=>{this.H.debug('Disconnecting from bus');this.O.
|
|
441
|
-
a.
|
|
442
|
-
l)),f=olympe.N.Ce.qg,g=olympe.N.Ce.Vf,h=olympe.N.Ce.xb;let k=0;try{for(const l=ha(b);;){const n=yield l.next();if(n.done)break;const p=n.value;yield e({id:c,i:k++,e:f,c:p})}yield e({id:c,s:k,e:g})}catch(l){yield e({id:c,e:h,reason:`Error to complete the stream: ${l}`})}})})();return c}qd(a,b,c){return this.send(a.ce,a.tb(),b,c,!0)}send(a,b,c,d,e){return this.publish(new olympe.N.
|
|
443
|
-
new olympe.N.
|
|
444
|
-
function
|
|
445
|
-
typeof k?k:typeof k}`);e(k);break;case
|
|
446
|
-
a.H.error(k),500===h.Gc()&&'Connection refused'===h.statusText?f(new olympe.N.errors.
|
|
422
|
+
function Tc(a){if(0<a.F.length){const b=a.F.shift();a.H&&a.H.log(`Executing next task. ${a.F.length} tasks left in the pipeline.`);a.getContext().run(()=>{b(()=>{Promise.resolve().then(()=>{Tc(a)})},c=>{c&&(a.C=c);a.complete(!1)},a.env)})}else a.complete(!0)}olympe.async.Tq=class extends olympe.async.Go{static create(){return new olympe.async.Tq(new olympe.D.Xb('SequencedExecutor'),!0)}start(){this.O||(super.start(),Tc(this))}};
|
|
423
|
+
olympe.async.Xj=class extends olympe.async.Go{constructor(a,b){super(a,b);this.T=0;this.ea=!0}static create(){return new olympe.async.Xj(new olympe.D.Xb('ParallelExecutor'),!0)}run(a){this.H&&this.H.log('Starting a task');this.getContext().run(()=>{a(()=>{this.done()},b=>{this.ea=!1;b&&(this.C=this.C?`${this.C}. ${b}`:b);this.done()},this.env)})}add(a){super.add(a);this.O&&!this.J&&(this.T++,this.run(a));return this}done(){this.T--;0>=this.T&&this.complete(this.ea)}start(){if(!this.O)if(super.start(),
|
|
424
|
+
0<this.F.length){this.T=this.F.length;for(const a of this.F)this.run(a)}else this.complete(!0)}};olympe.Db={};olympe.Db.pu=class{F(){return v(function*(){})}Z(){}O(){}G(){}T(){}forEach(){}has(){}get(){}set(){}remove(){}ea(){}aa(){}clear(){}J(){}};olympe.Db.qu=class{F(){}};olympe.Db.Storage=class{open(){}write(){}close(){}};olympe.Db.zu=class{get(){return null}set(){return this}delete(){}};olympe.Db.R={Oj:'localStorage.KeyValueDatabaseManager',Mi:'localStorage.Storage',Mz:'localStorage.DatacloudStorage',Kl:'localStorage.LocalStorage',Ca:'localStorage.Logger',Jg:'localStorage.prefix'};olympe.W.config(function(a){Pa(a,olympe.Db.R.Oj);E(a,olympe.Db.R.Jg,[],()=>'olympe');E(a,olympe.Db.R.Ca,[olympe.ka.R.Ea],b=>b.Vc('localstorage'));C(a,olympe.Db.R.Kl,olympe.Db.zu)},'olympe.localstorage');olympe.N={};olympe.N.errors={};olympe.N.errors.yo=class extends Error{};olympe.N.errors.aq=class extends Error{};olympe.N.errors.Tp=class extends Error{};olympe.N.errors.mk=class extends Error{};olympe.N.errors.co=class extends Error{};olympe.N.errors.Eq=class extends Error{};olympe.N.errors.fq=class extends Error{};olympe.N.errors.Xv=class extends Error{};olympe.N.errors.mm=class extends Error{constructor(a,b){super(a);this.id=b}U(){return this.id}};olympe.N.errors.Gi=class extends olympe.N.errors.mm{};
|
|
425
|
+
olympe.N.errors.Qn=class extends olympe.N.errors.mm{};olympe.N.errors.ap=class extends olympe.N.errors.mm{};olympe.N.Zb={Jj:'urls.FileSvc',Hn:'urls.BackupSvc',xq:'urls.RestoreBackupSvc',tg:'urls.GetContext',Xo:'urls.GraphDef',Sn:'urls.StaticGraphDef',TRANSACTION:'urls.Transaction',er:'urls.UserTagFromToken',Wv:'urls.UserNameFromTag',Vv:'urls.UserRoles',kv:'urls.RoleMembers',Sj:'urls.OpenIDSvc'};
|
|
426
|
+
olympe.W.config(a=>{F(a,olympe.N.Zb.Jj,'rest/filesvc');F(a,olympe.N.Zb.Hn,'rest/backupsvc');F(a,olympe.N.Zb.xq,'rest/backupsvc/restore');F(a,olympe.N.Zb.Sj,'rest/openid');F(a,olympe.N.Zb.tg,'rest/initialData');F(a,olympe.N.Zb.Xo,'rest/querysvc/graphDef');F(a,olympe.N.Zb.Sn,'rest/querysvc/graphDef/static');F(a,olympe.N.Zb.TRANSACTION,'rest/transaction');F(a,olympe.N.Zb.er,'rest/token');F(a,olympe.N.Zb.Wv,'rest/authorization/getUserTag');F(a,olympe.N.Zb.Vv,'rest/authorization/getUserRoles');F(a,olympe.N.Zb.kv,
|
|
427
|
+
'rest/authorization/roleMembers')});function Uc(a){xc(a.F,()=>{Vc(a)});zc(a.F,()=>{a.aa=!0});yc(a.F,()=>{Wc(a).then(()=>{a.aa=!1;Yc(a)}).catch(b=>{a.H.error(`An error occurred while trying to subscribe to "response topic" on the bus. Close connection: ${b}`);a.F.end()})})}function Zc(a){return $c(a.Fb)&&uc(a.F)}
|
|
428
|
+
function ad(a,b,c){return v(function*(){Zc(a)||(yield a.connect());a.H.debug(`Bus: Subscribe to ${b}`);a.ea.set(b,c);yield a.F.subscribe(a.ja+b,d=>{a.H.C()&&a.H.debug(`BUS < #${b}: ${JSON.stringify(d)}`);let e=null;try{if(bd(a,d.seq,'consumed'),e=olympe.N.ik.F(d,a.eb,f=>cd(a,d.src,f).stream),bd(a,e.ce.toString(),'deserialized',(new Map).set('source',e.tb()).set('messageType',e.getType().toString())),e.getType()===olympe.N.cb.C.$f){dd(a,e);return}}catch(f){a.H.error(`An error occurred while trying to deserialize the request: ${JSON.stringify(d)} with error ${f}`)}null!==
|
|
429
|
+
e&&c(e)})})}function Vc(a){a.H.info('Disconnected from bus');let b;null==(b=a.C)||b.forEach((c,d)=>{null!==c.F&&(a.H.info(`Disconnected from bus: pause keep alive of ${c.C.size} subscriptions for ${d} service.`),ed(c))})}
|
|
430
|
+
function Wc(a){a.H.debug('Connection to bus established. Listening to responses on topic',a.J);return a.F.subscribe(a.J,b=>{a.H.C()&&a.H.debug('BUS <',JSON.stringify(b));bd(a,b.seq,'consumed');const c=olympe.N.cb.F(b,a.eb,d=>cd(a,b.src,d).stream);bd(a,c.ce.toString(),'deserialized',(new Map).set('source',c.tb()).set('messageType',c.getType().toString()));if(c.getType()===olympe.N.cb.C.$f)dd(a,c);else{let d;null==(d=a.G.get(c.ce))||d(c)}})}
|
|
431
|
+
function Yc(a){a.H.debug(`Connected to bus: subscribe to ${a.ea.size} active topics.`);a.ea.forEach((c,d)=>{ad(a,d,c).catch(e=>{a.H.error(`Failed to subscribe topic after connecting to the bus, with error: ${e}`)})});let b;null==(b=a.C)||b.forEach((c,d)=>{null===c.F&&(a.H.debug(`Connected to bus: start keep alive of ${c.C.size} subscriptions for ${d} service.`),fd(c,!0))});a.T.forEach(c=>c(null));a.T=[]}
|
|
432
|
+
function gd(a){a.ac=a.Ga.C(()=>Zc(a)?Promise.resolve('Bus connection OK'):Promise.reject('Bus is disconnected'))}function bd(a,b,c,d=new Map){a.Ub.C&&db(a.Ub,'com',d.set('id',`${b}`).set('channel','bus').set('eventType',c))}function cd(a,b,c){const d=`${b}:${c}`;b=a.va.get(d);b||(b=new olympe.N.eq(()=>a.va.delete(d)),a.va.set(d,b));return b}
|
|
433
|
+
function dd(a,b){const c=olympe.N.Ce.qg,d=olympe.N.Ce.Vf,e=olympe.N.Ce.xb,f=b.C,{id:g,e:h}=f,k=`${b.tb()}:${g}`,l=cd(a,b.tb(),g);if(h===c){Xa(a.va.C,k);const {i:n,c:p}=f;l.write(p,n).catch(q=>{l.throw(q)})}else h===d?l.complete(f.s):h===e&&l.throw(Error(`Received stream error: ${f.reason}`))}function hd(a,b,c,d){const e=id(a.O).wd();a.Z++;return new olympe.N.ik(b,a.J,e,a.Z,c,d)}
|
|
434
|
+
function jd(a,b,c,d){const e=b.ce;let f=null;f=setTimeout(()=>kd(a,e),a.Tc);a.G.set(e,g=>{f&&clearTimeout(f);g.getType()===olympe.N.cb.C.Rk?f=setTimeout(()=>kd(a,e),d):(a.G.delete(e),c(g))})}function kd(a,b){const c=a.G.get(b);a.G.delete(b);null==c||c(new olympe.N.cb(a.J,a.J,b,olympe.N.cb.C.xb,{reason:'Timeout'}))}function ld(a,b){a.Z++;const c=a.Z,d=setTimeout(()=>kd(a,c),a.Tc);a.G.set(c,e=>{a.G.delete(c);clearTimeout(d);b(e)});return a.Z}
|
|
435
|
+
function md(a,b){return v(function*(){let c;const d=null==(c=a.C)?void 0:c.get(b);d&&(ed(d),a.C.delete(b));a.ea.delete(b);a.H.debug(`Bus: Unsubscribe to ${b}`);Zc(a)&&(yield wc(a.F,a.ja+b))})}function nd(a,b,c,d,e){null===a.C&&(a.C=new Map);let f=a.C.get(b);f?(a=f,a.G!==d&&(a.G=d,null!==a.F&&(ed(a),fd(a,!1)))):(f=new olympe.N.Iv(a.H,a,b,d),a.C.set(b,f));d=f;d.C.set(c,e);1===d.C.size&&fd(d,!1)}
|
|
436
|
+
function od(a,b,c){var d;const e=null==(d=a.C)?void 0:d.get(b);if(null==e?0:pd(e,c))d=olympe.N.cb.C.um,Zc(a)&&a.publish(hd(a,b,d,c)).catch(f=>a.H.error(`Impossible to keep alive subscriptions: ${f}`)),0===e.C.size&&(a.C.delete(b),0===a.C.size&&(a.C=null))}function qd(a,b){return new Promise((c,d)=>{a.O.Yg(b.le(),(e,f)=>{e?d(e):c(f)})})}
|
|
437
|
+
olympe.N.Rn=class{constructor(a,b,c,d,e,f,g,h){this.H=a;this.Fb=c;this.O=d;this.Ga=e;this.eb=f;this.Ub=g;this.G=new Map;this.Tc=h.get('shortTimeout');this.Cc=h.get('requestTimeout');this.Uc=h.get('subscriptionsRefreshRate');this.yb=h.get('allowGuest');a=h.get('connection');b=this.O.C.sb().asObservable();c=c.Kf().asObservable();c=rxjs.combineLatest([a,b,c]).pipe(rxjs.operators.map(([k,l,n])=>n.valueOf()?Object.assign({},k,{username:l.Bc(),password:l.wd()}):null));this.F=new olympe.net.pf(c);Uc(this);
|
|
438
|
+
this.ja='';h.get('topicPrefix').subscribe(k=>{this.H.debug(`Bus: new topic prefix: ${k}`);const l=this.ja;this.ja=k;if(Zc(this)){this.H.debug(`Resubscribe to queues with new topic prefix: ${k}`);Promise.all(Array.from(this.ea).map(([p,q])=>{const r=this;return v(function*(){yield ad(r,p,q);yield wc(r.F,l+p)})})).catch(p=>this.H.error(`Failed to subscribe topics after changing the topic prefix: ${p}`));let n;null==(n=this.C)||n.forEach(p=>{rd(p)})}});this.Vd=this.Z=0;this.J=olympe.Y.Mc();this.C=null;
|
|
439
|
+
this.aa=!1;this.T=[];this.ea=new Map;this.va=new olympe.Y.Hh(this.Cc);this.oc=this.ac='';this.hb=!1}connect(){return new Promise((a,b)=>{const c=d=>{b(d);this.T.forEach(e=>e(d));this.T=[]};Zc(this)?a():this.aa||this.hb?this.T.push(d=>d?b(d):a()):$c(this.Fb)?(this.hb=!0,olympe.D.hs([this.O.Ik()],d=>{gd(this);this.hb=!1;d.valueOf()||this.yb?(this.yb||sd(this.O,()=>this.disconnect().then()),this.aa=!0,this.T.push(e=>e?b(e):a()),this.F.connect(),this.oc=this.Ga.ja(()=>this.disconnect(),'Bus websocket')):
|
|
440
|
+
c(Error('Guest user is not allowed to connect to RabbitMQ, you can allow guest with the bus.allowGuest oConfig parameter!'))})):c(Error('Cannot connect to the bus if working offline'))})}disconnect(){return new Promise(a=>{this.H.debug('Disconnecting from bus');this.O.ea.delete('busLogoutCallback');this.Ga.G(this.ac);this.Ga.O(this.oc);this.F.end(!1,()=>a())})}publish(a,b=!1){const c=this;return v(function*(){if(!c.aa||a.getType()!==olympe.N.cb.C.ve){Zc(c)||(yield c.connect());var d=b?a.ic():c.ja+
|
|
441
|
+
a.ic();try{bd(c,a.ce.toString(),'serialize');var e=a.ha(c.eb,c.Ud.bind(c,a));c.H.C()&&c.H.debug(`BUS > #${d}: ${JSON.stringify(e)}`)}catch(f){throw Error(`An error occurred while serializing the message (seqId=${a.ce}): ${f}`);}yield c.F.publish(d,e);bd(c,a.ce.toString(),'publish',(new Map).set('destination',a.ic()).set('messageType',a.getType().toString()))}})}Ud(a,b){const c=this.Vd++;(()=>{const d=this;return v(function*(){const e=l=>d.publish(new olympe.N.cb(a.ic(),a.tb(),a.ce,olympe.N.cb.C.$f,
|
|
442
|
+
l)),f=olympe.N.Ce.qg,g=olympe.N.Ce.Vf,h=olympe.N.Ce.xb;let k=0;try{for(const l=ha(b);;){const n=yield l.next();if(n.done)break;const p=n.value;yield e({id:c,i:k++,e:f,c:p})}yield e({id:c,s:k,e:g})}catch(l){yield e({id:c,e:h,reason:`Error to complete the stream: ${l}`})}})})();return c}qd(a,b,c){return this.send(a.ce,a.tb(),b,c,!0)}send(a,b,c,d,e){return this.publish(new olympe.N.cb(b,this.J,a,c,d),e)}request(a,b,c,d){const e=hd(this,a,b,c);c=olympe.N.cb.C.Rk;if(b===olympe.N.cb.C.PUBLISH){const f=
|
|
443
|
+
new olympe.N.cb(a,this.J,e.ce,c);return this.publish(e).then(()=>f)}return new Promise((f,g)=>{jd(this,e,f,null!=d?d:this.Cc);this.publish(e).catch(g)})}};olympe.N.Rn.C='Timeout';const td=olympe.net.Aa.Headers.Gn,ud=olympe.net.Aa.Yb.xh,vd=olympe.net.Aa.Yb.Xn,wd=olympe.net.Aa.Yb.sj,xd=olympe.net.Aa.Yb.rv,yd=olympe.net.Aa.Yb.Qs,zd=olympe.net.Aa.Yb.Lo,Ad=olympe.net.Aa.Yb.Rv,Bd=olympe.net.Aa.Yb.Ol;function Cd(a,b){let c;return null!=(c=a.G.get(b))?c:''}function Dd(a,b,c,d=new Map){a.C.C&&db(a.C,'com',d.set('id',`${b}`).set('channel','http').set('eventType',c))}
|
|
444
|
+
function Ed(a,b,c){if(null===b)return Promise.reject('No http request to send');rc(b,{[td]:c});const d=b.C();return rxjs.firstValueFrom(rxjs.defer(()=>new Promise((e,f)=>{a.F++;const g=a.F;if(a.H.C()){const h=b.body;a.H.debug('HTTP >',d,`body: ${'string'===typeof h?h:typeof h}`)}Dd(a,g,'request',(new Map).set('destination',b.C()).set('messageType',b.method.toString()));a.J.C(b,h=>{Dd(a,g,'reply');switch(h.Gc()){case ud:case vd:case wd:var k=h.getData();a.H.C()&&a.H.debug('HTTP <',h.Gc(),`content: ${'string'===
|
|
445
|
+
typeof k?k:typeof k}`);e(k);break;case xd:h=`HTTP < Service provider for http request to ${b.C()} is overloaded, retry later`;a.H.warn(h);f(new olympe.N.errors.fq(h));break;case yd:a.H.debug(`HTTP < request canceled (${b.C()}).`);e();break;case zd:case Ad:h=`HTTP < request authorization denied: ${b.C()}`;a.H.error(h);f(new olympe.N.errors.Xv(h));break;case Bd:h=`HTTP < requested resource not found: ${b.C()}`;a.H.error(h);f(new olympe.N.errors.Tp(h));break;default:k=`HTTP < Error: ${h.Gc()}, ${h.statusText}`,
|
|
446
|
+
a.H.error(k),500===h.Gc()&&'Connection refused'===h.statusText?f(new olympe.N.errors.co(k)):f(Error(k))}})})).pipe(eb(olympe.N.errors.fq,(e,f)=>{a.H.warn(`Service overloaded (${d}), retry sending http request after ${f}ms.`)},a.O)))}olympe.N.zt=class{constructor(a,b,c,d,e){this.H=a;this.J=b;this.C=c;this.G=null;d.subscribe(f=>{this.G=f});this.O=e;this.F=0}};function P(a,b){if(a.C!==b)switch(a.H.debug('State change '+a.C+' --\x3e '+b),a.C=b,a.Fb.forEach(c=>c(b)),b){case olympe.N.La.C.qk:case olympe.N.La.C.CONNECTING:case olympe.N.La.C.so:break;case olympe.N.La.C.ng:a.connected.update(olympe.D.fa.F);break;case olympe.N.La.C.Cg:a.J=[0,0,a.J[2]];Fd(a);break;case olympe.N.La.C.xb:let c;a.H.error('Connection to server',null==(c=a.T)?void 0:c.C(),'aborted due to error');a.connected.update(olympe.D.fa.C);break;case olympe.N.La.C.Bn:Fd(a);break;case olympe.N.La.C.Rd:a.connected.update(olympe.D.fa.C);
|
|
447
447
|
break;default:throw Error('State machine error in server manager. Should not get in state '+b);}}
|
|
448
|
-
function
|
|
448
|
+
function Gd(a){const b=olympe.N.La.C.Bn,c=olympe.N.La.C.qk,d=olympe.N.La.C.Rd,e=pc(a.ea);a.H.info(`Trying to wakeup orchestrator with ${e}`);P(a,c);const f=a.Ub.G(a.ea);f.aa(g=>{const h=JSON.parse(g);a.H.info(`${e}: ${null==h?void 0:h.status}`);switch(null==h?void 0:h.status){case 'ready':P(a,b);f.close();break;case 'asleep':a.H.info(`Trying to wakeup orchestrator with ${e}`);f.send('{"action": "wakeup"}');P(a,c);break;case 'waking-up':break;default:a.H.warn(`Invalid message from ${e}: ${g}`),f.close(),
|
|
449
449
|
P(a,d)}});f.F(()=>{a.H.warn(`Communication with ${e} failed.`);f.close();P(a,d)});f.ea(()=>{a.H.info(`Checking orchestrator status with ${e}`);f.send('{"action": "status"}')})}
|
|
450
|
-
function
|
|
451
|
-
{d.c===olympe.N.Di.ev&&'boolean'===typeof d.a&&a.$h.update(olympe.D.Sb(d.a))});olympe.D.ij(a.connected,()=>{let d=!1;olympe.D.ij(a.hb.C(),()=>{d&&(a.
|
|
452
|
-
a.H.log('DONE initializing SERVER layer (waiting for NET layer connection to be opened)')}function
|
|
453
|
-
function
|
|
454
|
-
a.F.Z(()=>{a.F=null;a.C===d?P(a,f):a.C!==h&&a.C!==g&&P(a,e)});a.ea&&a.C===b&&a.F.F(()=>{a.F.F(null);a.C===c&&
|
|
455
|
-
function
|
|
456
|
-
function
|
|
457
|
-
function
|
|
458
|
-
function
|
|
459
|
-
olympe.N.La=class{constructor(a,b,c,d,e,f,g,h){this.H=a;this.Ub=b;this.T=null;e.subscribe(k=>{this.T=k;k=olympe.N.La.C.CONNECTING;if(this.C===olympe.N.La.C.ng||this.C===k){let l;null==(l=this.F)||l.close()}});this.ea=this.F=null;e.subscribe(k=>{this.ea=k;k=olympe.N.La.C.Rd;this.C===olympe.N.La.C.
|
|
460
|
-
olympe.N.La.C.INIT;this.hb=d;this.ac=h.get('getContextMode');this.Vd=1;this.Z=null;this.J=[0,0,0];this.
|
|
461
|
-
|
|
462
|
-
'subscribeEverything:',this.ac?'NO':'YES');
|
|
463
|
-
return;case c.Kv:
|
|
464
|
-
return}this.H.log('Handshake successful. Orchestrator version: ',e,'required:',sb(this.
|
|
450
|
+
function Hd(a,b,c){a.H.info('Initializing COMMUNICATION layer');if(a.H.C()){const d=['Server layer parameters:'];b.forEach((e,f)=>{d.push(f+'="'+e+'"')});a.H.debug(d.join('\n\t'))}Id(a,olympe.N.we.xb,d=>{switch(d.c){case olympe.N.Di.Tv:a.H.error('Unknown message sent to the server:',olympe.N.La.Hb[d.s]);break;case olympe.N.Di.rt:a.H.error('Fatal error, the last message is probably too big according to the websocket config.'),a.G.forEach((e,f)=>{null!==e.hn&&Jd(a,f,d.i)})}});Id(a,olympe.N.we.Hb,d=>
|
|
451
|
+
{d.c===olympe.N.Di.ev&&'boolean'===typeof d.a&&a.$h.update(olympe.D.Sb(d.a))});olympe.D.ij(a.connected,()=>{let d=!1;olympe.D.ij(a.hb.C(),()=>{d&&(a.oc(),a.yb(),d=!1);nc(a.oc.bind(a),a.Uc);nc(a.yb.bind(a),a.Ga)},()=>{a.J=[0,0,a.J[2]];d=!0})},()=>{a.Z=null;mc(a.yb.bind(a),a.Ga)});c.C(()=>Kd(a)?Promise.resolve('WebSocket connection to Orchestrator OK'):Promise.reject(`WebSocket connection to Orchestrator is ${a.C}`));c.ja(()=>a.disconnect(),'Orchestrator websocket');Za(a.O,(d,e)=>{e.throw(Error('Stream timeout'))});
|
|
452
|
+
a.H.log('DONE initializing SERVER layer (waiting for NET layer connection to be opened)')}function Kd(a){return a.C===olympe.N.La.C.ng}function Ld(a,b,c,d=!1){const e=f=>{if(0===b.length||b.includes(f))d&&a.Fb.delete(e),c(f)};a.Fb.add(e);e(a.C)}function Md(a,b,c,d,e){a.ja.C&&db(a.ja,'com',d.set('id',`${b}`).set('channel','ws').set('eventType',c),e)}
|
|
453
|
+
function Fd(a){const b=olympe.N.La.C.INIT,c=olympe.N.La.C.CONNECTING,d=olympe.N.La.C.ng,e=olympe.N.La.C.Rd,f=olympe.N.La.C.Cg,g=olympe.N.La.C.qk,h=olympe.N.La.C.xb;if(null===a.T)a.H.warn('Trying to open a connection to the orchestrator without a valid server request. Ignoring...'),P(a,e);else{null!==a.F&&(a.F.Z(null),a.F.close());var k,l;a.H.log(`Asking NET layer for a connection to ${null==(k=a.T)?void 0:oc(k)}:${null==(l=a.T)?void 0:l.port}...`);a.F=a.Ub.G(a.T);a.F.ea(a.Ud.bind(a));a.F.aa(a.Bf.bind(a));
|
|
454
|
+
a.F.Z(()=>{a.F=null;a.C===d?P(a,f):a.C!==h&&a.C!==g&&P(a,e)});a.ea&&a.C===b&&a.F.F(()=>{a.F.F(null);a.C===c&&Gd(a);a.ea=null});a.C!==f&&P(a,c)}}function Nd(a,b,c,d){const e=a.Vd;a.Vd++;c={message:{seqId:e,messageFamily:b,payload:c},Em:d?Od(d):null,hn:null};a.G.set(e,c);Md(a,e,'publish',(new Map).set('family',b));d=[olympe.N.La.C.CONNECTING,olympe.N.La.C.Cg];(Kd(a)||b===olympe.N.we.Nj&&d.includes(a.C))&&Pd(a,e,c)}
|
|
455
|
+
function Od(a){const b=olympe.N.La.F.Ni;return c=>{if(null!==c&&void 0!==c){var d=null,e=c.s;if(void 0!==e&&e!==b){d=void 0!==olympe.N.La.Hb[e]?`Status code = ${e} [${olympe.N.La.Hb[e]}]`:`Status code = ${e}`;e=olympe.N.errors.Eq;const f=c.error;'string'===typeof f&&0<f.length&&(f.includes('Message timeout')&&(e=olympe.N.errors.mk),d+=`\nReason:\n${f}`);d=new e('Rejected by orchestrator:\n'+d)}a(d,c)}}}
|
|
456
|
+
function Pd(a,b,c){var d=c.message;a.H.C()&&a.H.debug('WS >',JSON.stringify(d.payload));(d=a.F.send(JSON.stringify(d)))?null===c.Em?a.G.delete(b):c.hn=Date.now():olympe.D.Na(a.hb.C()).valueOf()&&P(a,olympe.N.La.C.Cg);return d}function Id(a,b,c,d){void 0===d&&(d=olympe.Y.Mc());let e=a.va.get(b);void 0===e&&(e=new Map,a.va.set(b,e));e.set(d,c)}function Qd(a){a=a.va.get(olympe.N.we.xg);void 0!==a&&a.delete('logoutHandler')}
|
|
457
|
+
function Jd(a,b,c){if(a.G.has(b)){const {Em:d}=a.G.get(b);a.G.delete(b);null==d||d({s:olympe.N.La.F.Kt,error:c})}}function Rd(a,b){a.H.error(b);P(a,olympe.N.La.C.xb)}function Sd(a,b,c){a.Cc=c?1E3*c:-1;let d;a.H.info(`Connected to ${null==(d=a.T)?void 0:d.C()}`,'|',b?`server version: ${b}`:'','|',null!==c?`activity timeout: ${c}s`:'');b=Array.from(a.G).sort(([e],[f])=>e-f);for(const [e,f]of b)if(!Pd(a,e,f))return;P(a,olympe.N.La.C.ng)}
|
|
458
|
+
function Td(a,b){const c=olympe.N.Ce.qg,d=olympe.N.Ce.Vf,e=olympe.N.Ce.xb,{id:f,e:g}=b;let h=a.O.get(f);h||(h=new olympe.N.eq(()=>a.O.delete(f)),a.O.set(f,h));if(g===c){Xa(a.O.C,f);const {i:k,c:l}=b;h.write(l,k).catch(n=>{h.throw(n)})}else g===d?h.complete(b.s):g===e&&h.throw(Error(`Received stream error: ${b.reason}`))}
|
|
459
|
+
olympe.N.La=class{constructor(a,b,c,d,e,f,g,h){this.H=a;this.Ub=b;this.T=null;e.subscribe(k=>{this.T=k;k=olympe.N.La.C.CONNECTING;if(this.C===olympe.N.La.C.ng||this.C===k){let l;null==(l=this.F)||l.close()}});this.ea=this.F=null;e.subscribe(k=>{this.ea=k;k=olympe.N.La.C.Rd;this.C===olympe.N.La.C.qk&&(P(this,k),Gd(this))});this.ja=g;this.Uc=h.get('pingInterval');this.Ga=h.get('messageTimeout');this.aa=olympe.Y.yf.parse(h.get('clientVersion'));this.eb=olympe.Y.yf.parse(h.get('serverVersion'));this.C=
|
|
460
|
+
olympe.N.La.C.INIT;this.hb=d;this.ac=h.get('getContextMode');this.Vd=1;this.Z=null;this.J=[0,0,0];this.va=new Map;this.connected=olympe.D.ec(olympe.D.fa,'Server is connected');this.$h=Xb(olympe.D.ec(olympe.D.fa,'Server is readonly'),olympe.D.fa.C);this.Fb=new Set;this.G=new Map;this.O=new olympe.Y.Hh(this.Ga);this.Tc=new Map;this.Cc=-1;Hd(this,h,c)}connect(){const a=olympe.N.La.C.ng,b=olympe.N.La.C.Rd,c=olympe.N.La.C.xb,d=olympe.N.La.C.INIT;return new Promise((e,f)=>{this.C!==d&&this.C!==b||Fd(this);
|
|
461
|
+
Ld(this,[a,b,c],g=>{g===a?e():f(Error('Was not able to open a connection to the orchestrator'))},!0)})}disconnect(){return new Promise((a,b)=>{const c=olympe.N.La.C.so,d=olympe.N.La.C.Rd,e=olympe.N.La.C.CONNECTING,f=olympe.N.La.C.xb;this.C===olympe.N.La.C.ng||this.C===e||this.C===c?(Ld(this,[d,f],g=>{g===d?a():b(Error('Was not able to disconnect'))},!0),this.C!==c&&(P(this,c),this.F.close())):(P(this,d),a())})}Ud(){this.H.debug('Websocket connected, sending handshake. Client version:',sb(this.aa),
|
|
462
|
+
'subscribeEverything:',this.ac?'NO':'YES');Nd(this,olympe.N.we.Nj,{c:olympe.N.Di.Nj,cv:sb(this.aa),m:this.ac?0:1,s:this.Z,b:this.hb.F()},this.Uh.bind(this))}Uh(a,b){if(a)Rd(this,'Error in receiving handshake response: '+a.message);else{this.H.debug('Handshake response received');var c=olympe.N.La.G;a=b.sv||'undefined';var d=b.activityTimeout?Math.max(b.activityTimeout-60,5):null;switch(b.status){case c.Lt:Rd(this,`Framework version (${sb(this.aa)}) provided to the orchestrator was not valid. See orchestrator logs for more info.`);
|
|
463
|
+
return;case c.Kv:Rd(this,`Framework version (${sb(this.aa)}) is not compatible with the orchestrator in use. See orchestrator logs for more info.`);return;case c.ut:Rd(this,'Handshake failed. See orchestrator logs for more info.');return}if(this.eb.Fa(olympe.Y.yf.C))this.H.warn('Handshake successful but received server version',a,'is invalid. Cannot check against it');else try{var e=olympe.Y.yf.parse(a);if(e.pj(this.eb)){Rd(this,`Framework v${sb(this.aa)} is expecting Orchestrator to be at least in v${sb(this.eb)}`);
|
|
464
|
+
return}this.H.log('Handshake successful. Orchestrator version: ',e,'required:',sb(this.eb))}catch(f){Rd(this,f);return}e=olympe.N.La.C.Rd;if(this.C===olympe.N.La.C.Cg&&null!==this.Z&&this.Z!==b.sessionId)this.H.warn('Trying to do a session recovering, but got another session id so retry from disconnected state'),P(this,e);else{if(e=b.identityProviders)for(const [f,g]of Object.entries(e))this.Tc.set(f,g);this.Z=b.sessionId||null;Sd(this,a,d)}}}oc(){this.J[0]-this.J[1]>this.Uc/2?(this.H.debug('Ping did not get answer, try to reconnect'),
|
|
465
465
|
P(this,olympe.N.La.C.Cg)):(this.J[0]=Date.now(),this.F.send('ping')||(this.H.debug('Impossible to send ping, try to reconnect'),P(this,olympe.N.La.C.Cg)))}Bf(a){this.J[2]=Date.now();if(a.startsWith('pong'))return olympe.D.Na(this.hb.C()).valueOf()&&(this.J[1]=this.J[2]),null;var b=0;this.ja.C&&(b=performance.now()-this.ja.F);try{var c=JSON.parse(a)}catch(g){return this.H.error('Unable to parse response from server: '+g.toString()),Error('Unable to parse response from server')}a=c.seqId;var d=c.stream;
|
|
466
|
-
const e=c.messageFamily;c=c.payload;if(this.H.C()){const g=({id:h,i:k,e:l,c:n})=>l===olympe.N.Ce.qg?`stream[${h}][${k}]: ${JSON.stringify(n)}`:l===olympe.N.Ce.Vf?`stream[${h}]:END`:`stream[${h}]:ERROR`;this.H.debug(`WS < ${JSON.stringify(c)}, ${d?g(d):''}`)}
|
|
467
|
-
null;f=d.stream}this.G.has(a)&&({
|
|
468
|
-
function
|
|
469
|
-
setTimeout(()=>a.connect().catch(k=>a.H.error(k)),g)}else a.H.info('Disconnected, stay offline.')});a.T.F(()=>{a.C.update(f);return Promise.resolve()},'Connectivity manager: shutdown state')}function
|
|
470
|
-
olympe.N.rc=class{constructor(a,b,c,d,e,f){this.H=a;this.G=b;this.T=d;this.storage=e;this.C=olympe.D.ec(Number).update(olympe.N.rc.C.INIT);this.F=f.get('offlineEnabled');this.O=f.get('offlineAutoBackOnline');this.J=f.get('storagePrefix');
|
|
471
|
-
this;return v(function*(){const b=olympe.N.rc.C.Ji,c=olympe.N.rc.C.
|
|
472
|
-
(a.C.update(c),yield olympe.N.Wh().disconnect(),yield a.G.disconnect())})}};olympe.N.rc.C={INIT:0,
|
|
473
|
-
olympe.N.
|
|
474
|
-
olympe.N.Sc=class{constructor(a,b,c){this.C=a;this.F=b;this.J=c;this.G=null}ei(){return null!==this.G?Promise.resolve(this.G):
|
|
475
|
-
|
|
476
|
-
olympe.N.Sc.prototype.notifyOn=olympe.N.Sc.prototype.
|
|
477
|
-
olympe.N.Iv=class{constructor(a,b,c,d){this.H=a;this.J=b;this.O=c;this.G=d;this.C=new Map;this.F=null}cf(){const a=olympe.N.errors.Gi
|
|
478
|
-
olympe.N.fc=class{constructor(){this.T=this.Z=null}ha(a){a=this.F(a);this.Z=null;return a}O(a){a=this.C(a);this.T=null;return a}F(a){switch(!0){case null===a:case void 0===a:return null;case 'string'===typeof a:case 'boolean'===typeof a:case 'number'===typeof a:return a;case a instanceof olympe.D.gb:return Q(olympe.N.fc.C.
|
|
466
|
+
const e=c.messageFamily;c=c.payload;if(this.H.C()){const g=({id:h,i:k,e:l,c:n})=>l===olympe.N.Ce.qg?`stream[${h}][${k}]: ${JSON.stringify(n)}`:l===olympe.N.Ce.Vf?`stream[${h}]:END`:`stream[${h}]:ERROR`;this.H.debug(`WS < ${JSON.stringify(c)}, ${d?g(d):''}`)}Md(this,a,'consumed',new Map,b);Md(this,a,'deserialized',(new Map).set('family',e));if(void 0!==d){var f=d.id;b=this.O.has(f);Td(this,d);if(b)return null;d=this.O.get(f);if(!d)return this.H.error(`Received a stream chunk for an unknown stream id: ${f}`),
|
|
467
|
+
null;f=d.stream}this.G.has(a)&&({Em:d}=this.G.get(a),this.G.delete(a),null==d||d(c,f));a=this.va.get(e);if(void 0!==a)for(const g of a.values())g(c,f);return null}yb(){const a=Date.now();for(const [b,{hn:c}]of this.G)null!==c&&a-c>this.Ga&&(this.H.warn(`No response was received from the server for the seqId = ${b}`),Jd(this,b,'Message timeout: never receive acknowledge'))}};function $c(a){return olympe.D.Na(a.C)===olympe.N.rc.C.Ji}
|
|
468
|
+
function Ud(a,b){const c=olympe.N.rc.C.Wl,d=olympe.N.rc.C.ee,e=olympe.N.rc.C.Rd,f=olympe.N.rc.C.yv,g=b.get('reconnectionDelay');Ld(a.G,[olympe.N.La.C.INIT],()=>{Vd(a)?(a.C.update(c),a.connect().catch(h=>a.H.error(h))):a.G.disconnect().catch(h=>a.H.error(h))},!0);Ld(a.G,[olympe.N.La.C.Rd],()=>{if(olympe.D.Na(a.C)===f)a.H.info('Disconnected, from orchestrator for shutdown');else if(a.C.update(a.F?d:e),Vd(a)&&a.O){const h=`Disconnected, will try to auto reconnect in ${g} ms`;a.F?a.H.log(h):a.H.error(h);
|
|
469
|
+
setTimeout(()=>a.connect().catch(k=>a.H.error(k)),g)}else a.H.info('Disconnected, stay offline.')});a.T.F(()=>{a.C.update(f);return Promise.resolve()},'Connectivity manager: shutdown state')}function Vd(a){return null===a.storage.get(a.J+'olympe_manual_offline')}
|
|
470
|
+
olympe.N.rc=class{constructor(a,b,c,d,e,f){this.H=a;this.G=b;this.T=d;this.storage=e;this.C=olympe.D.ec(Number).update(olympe.N.rc.C.INIT);this.F=f.get('offlineEnabled');this.O=f.get('offlineAutoBackOnline');this.J=f.get('storagePrefix');Ud(this,f)}Kf(){const a=olympe.N.rc.C.Ji,b=olympe.N.rc.C.ee,c=olympe.N.rc.C.Rd;let d=olympe.D.fa.C;return olympe.D.ua([this.C],e=>{if(e===a)d=olympe.D.fa.F;else if(e===b||e===c)d=olympe.D.fa.C;return d},olympe.D.fa)}getState(){return this.C.sb()}connect(){const a=
|
|
471
|
+
this;return v(function*(){const b=olympe.N.rc.C.Ji,c=olympe.N.rc.C.Wl;olympe.D.Na(a.C)!==b&&(a.C.update(c),a.storage.delete(a.J+'olympe_manual_offline'),yield a.G.connect(),yield Wd(),a.C.update(b))})}disconnect(){const a=this;return v(function*(){const b=olympe.N.rc.C.ee,c=olympe.N.rc.C.Wl;if(!a.F)throw Error('Try to go offline manually while the process does not support it. Please add `offline.enabled=true` in the config');a.storage.set(a.J+'olympe_manual_offline','true');olympe.D.Na(a.C)!==b&&
|
|
472
|
+
(a.C.update(c),yield olympe.N.Wh().disconnect(),yield a.G.disconnect())})}};olympe.N.rc.C={INIT:0,Wl:1,Ji:2,ee:3,Rd:4,yv:5};olympe.N.rc.F='olympe_manual_offline';olympe.N.cb=class{constructor(a,b,c,d,e){this.ce=c;this.F=a;this.source=b;this.messageType=d;this.C=null!=e?e:null}static F(a,b,c){let d;var e=olympe.N.cb,f=a.dest,g=a.src,h=a.seq,k=a.type;b.T=c;return new e(f,g,h,k,b.O(null!=(d=a.content)?d:null))}ic(){return this.F}tb(){return this.source}getType(){return this.messageType}ha(a,b){const c={dest:this.F,src:this.source,seq:this.ce,type:this.messageType};null!==this.C&&(a.Z=b,c.content=a.ha(this.C));return c}toString(){return`Message(dest: ${this.F}, src: ${this.source}, seqId: ${this.ce}, type: ${this.messageType})`}};
|
|
473
|
+
olympe.N.cb.C={SEND:0,GET:1,SUBSCRIBE:2,PUBLISH:3,ir:4,$f:5,pm:6,xb:7,Rk:10,Kq:11,ar:12,ve:13,um:14};olympe.N.ik=class extends olympe.N.cb{constructor(a,b,c,d,e,f){super(a,b,d,e,f);this.G=c}static F(a,b,c){let d;var e=olympe.N.ik,f=a.dest,g=a.src,h=a.auth,k=a.seq,l=a.type;b.T=c;return new e(f,g,h,k,l,b.O(null!=(d=a.content)?d:null))}le(){return this.G}ha(a,b){return Object.assign(super.ha(a,b),{auth:this.G})}};olympe.N.ik.Di={SEND:0,GET:1,PUBLISH:2,SUBSCRIBE:3,ve:4,um:5};const Xd=olympe.N.cb.C.SEND,Yd=olympe.N.cb.C.GET,Zd=olympe.N.cb.C.SUBSCRIBE,$d=olympe.N.cb.C.ve,ae=olympe.N.cb.C.Kq,be=olympe.N.cb.C.xb,ce=olympe.N.cb.C.ir,de=olympe.N.cb.C.pm,ee=olympe.N.cb.C.ar;
|
|
474
|
+
olympe.N.Sc=class{constructor(a,b,c){this.C=a;this.F=b;this.J=c;this.G=null}ei(){return null!==this.G?Promise.resolve(this.G):qd(this.F,this.C).then(a=>this.G=a)}ks(){return this.C.getType()}source(){return this.C.tb()}body(){return this.C.C}ur(){return this.C.getType()===Xd?this.F.qd(this.C,ae):Promise.reject('Should only call `ack` on SEND requests')}qd(a){const b=this.C.getType();return b===Yd||b===$d?this.F.qd(this.C,ce,a):Promise.reject('Should only call `reply` on GET requests')}cn(a){if(this.C.getType()!==
|
|
475
|
+
Zd)return Promise.reject('Should only call `notifyOn` on SUBSCRIBE requests');const b=olympe.Y.Mc();return new Promise((c,d)=>{const e={seq:ld(this.F,f=>{switch(f.getType()){case ee:fe(this.J,b);c(b);break;case be:d(f.C.reason);break;default:d('Unsupported response type for a SUBSCRIBE request')}}),topic:a,id:b,refresh:this.F.Uc};this.F.qd(this.C,de,e).catch(d)})}Th(a){return this.F.qd(this.C,be,{reason:a.message})}};olympe.N.Sc.prototype.fail=olympe.N.Sc.prototype.Th;
|
|
476
|
+
olympe.N.Sc.prototype.notifyOn=olympe.N.Sc.prototype.cn;olympe.N.Sc.prototype.reply=olympe.N.Sc.prototype.qd;olympe.N.Sc.prototype.ack=olympe.N.Sc.prototype.ur;olympe.N.Sc.prototype.body=olympe.N.Sc.prototype.body;olympe.N.Sc.prototype.source=olympe.N.Sc.prototype.source;olympe.N.Sc.prototype.requestType=olympe.N.Sc.prototype.ks;olympe.N.Sc.prototype.userTag=olympe.N.Sc.prototype.ei;function rd(a){const b=olympe.N.errors.Gi;a.C.forEach((c,d)=>{pd(a,d);null==c||c(new b(`Subscription ${d} to be refreshed`,d))})}function ed(a){if(null!==a.F){var b=a.F;a.F=null;clearInterval(b)}}function fd(a,b){b&&a.cf();null===a.F&&(a.F=setInterval(a.cf.bind(a),a.G))}function pd(a,b){b=a.C.delete(b);0===a.C.size&&ed(a);return b}function ge(a,b){a.C.forEach((c,d)=>{pd(a,d);c(b)})}
|
|
477
|
+
olympe.N.Iv=class{constructor(a,b,c,d){this.H=a;this.J=b;this.O=c;this.G=d;this.C=new Map;this.F=null}cf(){const a=olympe.N.errors.Gi;Zc(this.J)?this.J.request(this.O,olympe.N.cb.C.ve,Array.from(this.C.keys())).then(b=>{b=b.C;0<b.length&&b.forEach(c=>{const d=this.C.get(c);pd(this,c);null==d||d(new a('Subscription does not exist in the service.',c))})}).catch(b=>{b=`Impossible to keep alive subscriptions: ${b}`;this.H.error(b);ge(this,Error(b))}):ed(this)}};function Q(a,b){return{t:a,v:b}}
|
|
478
|
+
olympe.N.fc=class{constructor(){this.T=this.Z=null}ha(a){a=this.F(a);this.Z=null;return a}O(a){a=this.C(a);this.T=null;return a}F(a){switch(!0){case null===a:case void 0===a:return null;case 'string'===typeof a:case 'boolean'===typeof a:case 'number'===typeof a:return a;case a instanceof olympe.D.gb:return Q(olympe.N.fc.C.jl,a.valueOf().toISOString());case a instanceof Date:return Q(olympe.N.fc.C.jl,a.toISOString());case a instanceof olympe.D.Color:return Q(olympe.N.fc.C.COLOR,a.toJSON());case a instanceof
|
|
479
479
|
Map:return a=Object.fromEntries(Array.from(a).map(([c,d])=>[c,this.F(d)])),Q(olympe.N.fc.C.Gp,a);case a instanceof Set:return a=Array.from(a).map(this.F.bind(this)),Q(olympe.N.fc.C.Ig,a);case Array.isArray(a):return a.map(this.F.bind(this));case a instanceof ArrayBuffer:return a=olympe.Y.Xe().C(new Uint8Array(a)),Q(olympe.N.fc.C.ARRAY_BUFFER,a);case a instanceof Uint8Array:return a=olympe.Y.Xe().C(a),Q(olympe.N.fc.C.Ti,a);case a instanceof olympe.Y.stream.Eg:if(!this.Z)throw Error('No stream handler has been set, so cannot serialize the stream.');
|
|
480
|
-
let b;return Q(olympe.N.fc.C.$f,null==(b=this.Z)?void 0:b.call(this,a));case 'object'===typeof a:return a=Object.entries(a).reduce((c,[d,e])=>{c[d]=this.F(e);return c},{}),Q(olympe.N.fc.C.Up,a);default:throw Error(`Impossible to serialize the following value: ${a}`);}}C(a){switch(!0){case null===a:case void 0===a:return null;case 'string'===typeof a:case 'boolean'===typeof a:case 'number'===typeof a:return a}if(Array.isArray(a))return a.map(d=>this.C(d));if('object'!==typeof a)throw new olympe.N.errors.
|
|
481
|
-
const {t:b,v:c}=a;switch(b){case olympe.N.fc.C.
|
|
482
|
-
(d=this.T)?void 0:d.call(this,c);case olympe.N.fc.C.Up:return Object.entries(c).reduce((e,[f,g])=>{e[f]=this.C(g);return e},{});default:throw new olympe.N.errors.
|
|
483
|
-
function
|
|
484
|
-
olympe.N.wb=class{constructor(a,b){this.F=olympe.N.Wh();this.J=a;this.G=this.C=null;this.O=new olympe.D.Xb(`Service ${a}`,'function'===typeof b.F?b.F():b);this.H=olympe.ka.ab(`Service ${this.J}`)}static observe(a,b,c,d={}){const e='function'===typeof b.F?b.F():b,f=olympe.N.Wh();return(new rxjs.Observable(g=>{let h=null,k=null;const l=()=>{g.complete();k&&
|
|
485
|
-
{switch(n.getType()){case
|
|
486
|
-
return l})).pipe(eb(olympe.N.errors.Gi,(g,h)=>{olympe.ka.ab(`Service ${a}`).debug(`Subscribed to topic ${g.U()} now that we are back online, after waiting for ${h}ms`);let k;null==(k=d.onRetry)||k.call(d)}))}qs(a){this.G=a;return this}stop(){this.O.destroy()}clear(){
|
|
487
|
-
b){return v(function*(){yield olympe.N.Wh().request(a,
|
|
488
|
-
}})}listen(){return new rxjs.Observable(a=>{const b=()=>{a.complete();this.clear()};this.O.onDestroy(b);
|
|
480
|
+
let b;return Q(olympe.N.fc.C.$f,null==(b=this.Z)?void 0:b.call(this,a));case 'object'===typeof a:return a=Object.entries(a).reduce((c,[d,e])=>{c[d]=this.F(e);return c},{}),Q(olympe.N.fc.C.Up,a);default:throw Error(`Impossible to serialize the following value: ${a}`);}}C(a){switch(!0){case null===a:case void 0===a:return null;case 'string'===typeof a:case 'boolean'===typeof a:case 'number'===typeof a:return a}if(Array.isArray(a))return a.map(d=>this.C(d));if('object'!==typeof a)throw new olympe.N.errors.yo(`Impossible to deserialize the following value: ${a}`);
|
|
481
|
+
const {t:b,v:c}=a;switch(b){case olympe.N.fc.C.jl:return new Date(c);case olympe.N.fc.C.COLOR:return olympe.D.Color.Pb(c);case olympe.N.fc.C.Gp:return new Map(Object.entries(c).map(([e,f])=>[e,this.C(f)]));case olympe.N.fc.C.Ig:return new Set(c.map(e=>this.C(e)));case olympe.N.fc.C.ARRAY_BUFFER:return olympe.Y.Xe().F(c).buffer;case olympe.N.fc.C.Ti:return olympe.Y.Xe().F(c);case olympe.N.fc.C.$f:if(!this.T)throw Error('No stream handler has been set, so cannot deserialize the stream.');let d;return null==
|
|
482
|
+
(d=this.T)?void 0:d.call(this,c);case olympe.N.fc.C.Up:return Object.entries(c).reduce((e,[f,g])=>{e[f]=this.C(g);return e},{});default:throw new olympe.N.errors.yo(`Impossible to deserialize the following value: ${c}`);}}};olympe.N.fc.C={jl:1,COLOR:2,Gp:3,Ig:4,ARRAY_BUFFER:5,Ti:6,$f:7,Up:8};const he=olympe.N.cb.C.SEND,ie=olympe.N.cb.C.GET,je=olympe.N.cb.C.PUBLISH,ke=olympe.N.cb.C.SUBSCRIBE,le=olympe.N.cb.C.ve,me=olympe.N.cb.C.um,ne=olympe.N.cb.C.Kq,oe=olympe.N.cb.C.Rk,pe=olympe.N.cb.C.xb,qe=olympe.N.cb.C.ir,re=olympe.N.cb.C.pm;function fe(a,b){a.C||(a.C=Ya(new olympe.Y.sm(a.F.Uc+3E4),c=>{let d;null==(d=a.G)||d.call(a,c)}));a.C.add(b)}
|
|
483
|
+
function se(a,b){const c=olympe.N.cb.C.pm,d=olympe.N.cb.C.ar;return b.getType()!==c?Promise.reject('Should only call `topicAck` on TOPIC responses'):a.send(b.C.seq,b.tb(),d,null,!0)}function te(a){let b,c;a=null!=(c=null==(b=a.C)?void 0:b.reason)?c:'Unknown reason';return'Timeout'===a?new olympe.N.errors.mk(a):Error(a)}
|
|
484
|
+
olympe.N.wb=class{constructor(a,b){this.F=olympe.N.Wh();this.J=a;this.G=this.C=null;this.O=new olympe.D.Xb(`Service ${a}`,'function'===typeof b.F?b.F():b);this.H=olympe.ka.ab(`Service ${this.J}`)}static observe(a,b,c,d={}){const e='function'===typeof b.F?b.F():b,f=olympe.N.Wh();return(new rxjs.Observable(g=>{let h=null,k=null;const l=()=>{g.complete();k&&od(f,a,k);h&&md(f,h).catch(n=>olympe.ka.ab('Service '+a).error('Failed to unsubscribe from a topic '+n))};e.Z(l);f.request(a,ke,c,d.timeout).then(n=>
|
|
485
|
+
{switch(n.getType()){case re:const p=n.C;h=p.topic;ad(f,h,q=>{q.getType()===je?g.next(q.C):(g.error('Unsupported notification message. It should be a publish'),l())}).then(()=>{k=p.id;nd(f,a,k,p.refresh,q=>g.error(q));se(f,n).catch(q=>{g.error(`Was unable to ack the subscription: ${q}`);l()})}).catch(q=>{g.error(`Was not able to subscribe to notification topic ${h}: ${q}`);l()});break;case pe:g.error(te(n));break;default:g.error('Unsupported response type for a SUBSCRIBE request')}}).catch(n=>g.error(n));
|
|
486
|
+
return l})).pipe(eb(olympe.N.errors.Gi,(g,h)=>{olympe.ka.ab(`Service ${a}`).debug(`Subscribed to topic ${g.U()} now that we are back online, after waiting for ${h}ms`);let k;null==(k=d.onRetry)||k.call(d)}))}qs(a){this.G=a;return this}stop(){this.O.destroy()}clear(){md(this.F,this.J).catch(b=>this.H.error('Failed to unsubscribe from '+this.J+', error: '+b));if(this.G){let b;null==(b=this.C)||b.forEach(c=>{let d;return null==(d=this.G)?void 0:d.call(this,c)})}let a;null==(a=this.C)||a.clear()}static publish(a,
|
|
487
|
+
b){return v(function*(){yield olympe.N.Wh().request(a,je,b)})}static send(a,b,c={}){return olympe.N.Wh().request(a,he,b,c.timeout).then(d=>{switch(d.getType()){case ne:break;case pe:throw te(d);default:throw Error('Unsupported response type for a SEND request');}})}static get(a,b,c={}){return olympe.N.Wh().request(a,ie,b,c.timeout).then(d=>{switch(d.getType()){case qe:d=d.C;if(null!==d)return d;throw Error('No payload after request to service: '+a);case pe:throw te(d);default:throw Error('Unsupported response type for a GET request');
|
|
488
|
+
}})}listen(){return new rxjs.Observable(a=>{const b=()=>{a.complete();this.clear()};this.O.onDestroy(b);ad(this.F,this.J,c=>{const d=new olympe.N.Sc(c,this.F,this);switch(c.getType()){case le:var e=d.body().filter(g=>{let h;return!(null==(h=this.C)?0:Xa(h,g))});d.qd(e).catch(g=>this.H.error('Not able to validate subscription keep alive',g));break;case me:c=d.body();null==(e=this.C)||e.delete(c);let f;null==(f=this.G)||f.call(this,c);break;case je:a.next(d);break;default:this.F.qd(c,oe).then(()=>a.next(d))}}).catch(c=>
|
|
489
489
|
{c='Failed to connect to the bus: '+c;this.H.error(c);a.error(Error(c))});return b})}};olympe.N.wb.prototype.listen=olympe.N.wb.prototype.listen;olympe.N.wb.get=olympe.N.wb.get;olympe.N.wb.send=olympe.N.wb.send;olympe.N.wb.publish=olympe.N.wb.publish;olympe.N.wb.prototype.stop=olympe.N.wb.prototype.stop;olympe.N.wb.prototype.setUnsubscriptionHandler=olympe.N.wb.prototype.qs;olympe.N.wb.observe=olympe.N.wb.observe;olympe.N.eq=class{constructor(a){this.C=0;this.buffer=[];this.size=null;this.stream=new olympe.Y.stream.Eg;this.F=null!=a?a:()=>{}}write(a,b){const c=this;return v(function*(){if(b<c.C||null!==c.size&&b>=c.size)throw Error(`Received stream chunk with unexpected index = ${b}. That index has already been processed. Next expected once is ${c.C}`);for(c.buffer[b-c.C]=a;void 0!==c.buffer[0];){c.C++;const d=c.buffer.shift();yield c.stream.write(d)}c.C===c.size&&(c.F(),c.stream.complete())})}complete(a){if(null!==
|
|
490
|
-
this.size)throw Error('The stream has already been completed');if(a<this.C+this.buffer.length)throw Error(`The stream has already reached element n\u00b0${this.C+this.buffer.length}, specified index must be greater or equal to it.`);this.size=a;this.C===this.size&&(this.F(),this.stream.complete())}throw(a){this.F();this.stream.throw(a)}};olympe.N.we={qg:1,Rf:2,xb:3,xg:4,Cz:5,
|
|
490
|
+
this.size)throw Error('The stream has already been completed');if(a<this.C+this.buffer.length)throw Error(`The stream has already reached element n\u00b0${this.C+this.buffer.length}, specified index must be greater or equal to it.`);this.size=a;this.C===this.size&&(this.F(),this.stream.complete())}throw(a){this.F();this.stream.throw(a)}};olympe.N.we={qg:1,Rf:2,xb:3,xg:4,Cz:5,Nj:6,Hb:7};olympe.N.Di={Nj:1,Tv:2,rt:3,ve:5,ev:1,YC:2};olympe.N.Ce={qg:0,Vf:1,xb:2};olympe.N.La.C={INIT:'initialize',CONNECTING:'connecting',Rd:'disconnected',so:'disconnecting',ng:'connected',Cg:'reconnecting',qk:'waking',Bn:'awake',xb:'error'};olympe.N.La.G={xh:1,ut:-1,Lt:-2,Kv:-3};olympe.N.La.F={Ni:0,Kt:23};
|
|
491
491
|
olympe.N.La.Hb={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',
|
|
492
|
-
18:'Try to unsubscribe multiple times',21:'GraphDef Query Failed',22:'Client Request Invalid',23:'Internal Server Error',24:'File Retrieval Error',25:'File Does Not Exists',26:'Restore Failed',27:'Permission Error',14:'Handshake Failed',28:'Client Version Too Old',29:'Client Version Invalid Format',34:'Server overloaded, retry later',35:'Add token error',36:'Keep token alive error',37:'Unknown client message',39:'Fetch data while concurrency transaction'};olympe.N.R={ff:'com.ConnectivityManager',
|
|
493
|
-
olympe.N.V={
|
|
494
|
-
|
|
495
|
-
olympe.W.config(function(a){const b=olympe.host.Gg.Bh;F(a,olympe.N.V.
|
|
496
|
-
null!=g?g:y;n=null!=n?n:y;const z=(y=x.includes(g))||u;u=(x=x.includes(n))||u;f=x?'/':f.split('.')[0];return{
|
|
497
|
-
6E4);F(a,olympe.N.V.
|
|
498
|
-
E(a,'server.wakeUpRequest',[new olympe.W.lh('com.hostConfig'),new olympe.W.oa(olympe.N.V.vv)],(e,f)=>e.pipe(rxjs.operators.map(({
|
|
499
|
-
d.map((p,q)=>{q=f[q];q=(new olympe.net.wi(g,h,`${l}${q?'/'+q:''}`.replace(/\/+/g,'/').replace(/\/$/,''),k)).C();return[p,q]});return new Map(n)})).pipe(rxjs.operators.shareReplay(1)));C(a,olympe.N.R.Be,olympe.N.fc);C(a,olympe.N.R.
|
|
500
|
-
(...e)=>{const f=['pingInterval','messageTimeout','clientVersion','serverVersion','getContextMode'],g=new Map;e.forEach((h,k)=>g.set(f[k],h));return g});C(a,olympe.N.R.
|
|
501
|
-
new olympe.W.lh('com.bus.TopicPrefix'),new olympe.W.oa(olympe.N.V.
|
|
502
|
-
const x='keepalive reschedulePings clientId clean reconnectPeriod connectTimeout queueQoSZero shortTimeout requestTimeout'.split(' ');q=n.reduce((y,z,A)=>{y[x[A]]=z;return y},{});q.url=p;q.vhost=t;return q})).pipe(rxjs.operators.shareReplay(1));return new Map([['connection',e],['topicPrefix',f],['allowGuest',g],['shortTimeout',h],['requestTimeout',k],['subscriptionsRefreshRate',l]])});C(a,olympe.N.R.
|
|
503
|
-
olympe.Y.R.Xf,'com.bus.ManagerConfig');E(a,'com.connectivity.ManagerConfig',[olympe.net.R.
|
|
504
|
-
function
|
|
505
|
-
olympe.N.we.xg,Object.assign({},{c:olympe.auth.jd.C.vu},d&&{idpName:d}),c)}function
|
|
506
|
-
function
|
|
507
|
-
olympe.auth.jd=class{constructor(a,b,c,d,e,f){this.H=a;this.C=b;this.th=c;this.J=d;this.F=e;this.G=f;
|
|
508
|
-
a=N(`${d}/${a}`);
|
|
509
|
-
function
|
|
510
|
-
function
|
|
511
|
-
olympe.D.Na(a.C).Bc();
|
|
512
|
-
a.
|
|
513
|
-
function
|
|
514
|
-
function
|
|
515
|
-
!0)}function
|
|
516
|
-
function
|
|
517
|
-
function
|
|
518
|
-
function
|
|
519
|
-
olympe.auth.Ta=class{constructor(a,b,c,d,e,f,g,h,k
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
this.H.error('Was not able to send the auth keep alive message:',b.message);null==a||a(b)})}
|
|
524
|
-
this.storage)||
|
|
525
|
-
m.me.L=new olympe.D.K(()=>String,[]);m.wd.L=new olympe.D.K(()=>String,[]);m.zi.L=new olympe.D.K(()=>Object,[]);m.Yh.L=new olympe.D.K(()=>String,[]);m.nf.L=new olympe.D.K(()=>String,[]);m.ha.L=new olympe.D.K(()=>String,[]);m.wg.L=new olympe.D.K(()=>String,[]);function
|
|
526
|
-
olympe.auth.Fs=class{constructor(a,b,c){this.G=a;this.H=b;this.C='OlympeToken-'+c.C;this.F=new olympe.Y.promise.
|
|
527
|
-
d.parse;var f=Va(olympe.Y.Xe().F(olympe.Y.pw(b)));const g=e.call(d,f);let h;g.fullToken?h=new olympe.auth.Iq(g.user,g.userTag,g.nonce,g.fullToken,g.payload,g.idpName):g.payload&&g.payload.id_token?h=new olympe.auth.
|
|
528
|
-
olympe.auth.Od.Au=class extends olympe.auth.Ec{constructor(a,b,c){super(a,b);this.storage=c}G(){return olympe.auth.Ec.C.
|
|
529
|
-
olympe.auth.Od.Qu=class extends olympe.auth.Ec{constructor(a,b,c,d){super(a,b);this.O=c;this.T=d}G(){return olympe.auth.Ec.C.OAUTH2}le(a){const b=encodeURIComponent(this.O.C());a=
|
|
530
|
-
function
|
|
531
|
-
null)}})}olympe.auth.Od.SRP=class extends olympe.auth.Ec{G(){return olympe.auth.Ec.C.SRP}le(a,b){const c=a.get('password');a.C.delete('password');this.H.debug('Sending SRP request');
|
|
532
|
-
olympe.W.config(function(a){F(a,olympe.auth.V.
|
|
533
|
-
olympe.auth.R
|
|
534
|
-
|
|
535
|
-
olympe.W.run([olympe.auth.R.Ea],a=>{olympe.auth.je=()=>a});olympe.Ua.node.auth={};olympe.Ua.node.auth.Sp=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.Ua.node.auth.Sp.ya=[olympe.auth.
|
|
492
|
+
18:'Try to unsubscribe multiple times',21:'GraphDef Query Failed',22:'Client Request Invalid',23:'Internal Server Error',24:'File Retrieval Error',25:'File Does Not Exists',26:'Restore Failed',27:'Permission Error',14:'Handshake Failed',28:'Client Version Too Old',29:'Client Version Invalid Format',34:'Server overloaded, retry later',35:'Add token error',36:'Keep token alive error',37:'Unknown client message',39:'Fetch data while concurrency transaction'};olympe.N.R={ff:'com.ConnectivityManager',ek:'com.ServerManager',Mn:'com.BusManager',wl:'com.HttpManager',Be:'com.Serializer',Ca:'com.Logger',Rq:'com.Source',cr:'com.Urls',wB:'com.peerFileSvcUrl'};
|
|
493
|
+
olympe.N.V={ll:'defaultHost',qv:'server.host',tv:'server.port',uv:'server.ssl',Lq:'server.basePath',lr:'server.wsPath',bm:'server.reconnectionDelay',gq:'server.pingInterval',kr:'server.messageTimeout',zq:'server.retryHttpOnOverload',dl:'server.clientVersion',Oq:'server.serverVersion',vv:'server.wakeUpService',Ls:'bus.host',Ms:'bus.path',Ns:'bus.port',Ps:'bus.vhost',Os:'bus.ssl',ve:'bus.keepalive',hv:'bus.reschedulePings',Us:'bus.clientId',Ss:'bus.clean',Xs:'bus.connectTimeout',On:'bus.shortTimeout',
|
|
494
|
+
Nn:'bus.requestTimeout',Pn:'bus.subscriptionRefreshRate',bv:'bus.queueQoSZero',Yk:'bus.allowGuest',br:'bus.topicPrefix'};
|
|
495
|
+
olympe.W.config(function(a){const b=olympe.host.Gg.Bh;F(a,olympe.N.V.ll,a.getParameter(olympe.host.V.cp));F(a,olympe.N.V.Lq,'OlympeServer');F(a,olympe.N.V.br,'');Qa(a,'com.hostConfig',[olympe.host.V.bk,olympe.N.V.ll,olympe.N.V.qv,olympe.N.V.tv,olympe.N.V.uv,olympe.N.V.Lq,olympe.N.V.Ls,olympe.N.V.Ps,olympe.N.V.Ns,olympe.N.V.Ms,olympe.N.V.Os],(e,f,g,h,k,l,n,p,q,r,t)=>{var u=a.getParameter(olympe.net.V.Jl);e=e===olympe.host.Gg.Bh;var x=['localhost','127.0.0.1'],y=(u=f.endsWith(u))&&e?`${f}-${b}`:f;g=
|
|
496
|
+
null!=g?g:y;n=null!=n?n:y;const z=(y=x.includes(g))||u;u=(x=x.includes(n))||u;f=x?'/':f.split('.')[0];return{jn:g,kn:null!=h?h:y?8080:z?e?85:80:443,ln:null!=k?k:!z,ms:l,rw:n,vw:null!=p?p:f,tw:null!=q?q:x?15675:u?e?85:80:443,sw:null!=r?r:x?'':'/mqtt',uw:null!=t?t:!u}});F(a,olympe.N.V.lr,'websocket');F(a,olympe.N.V.bm,5E3);F(a,olympe.N.V.gq,5E3);F(a,olympe.N.V.kr,3E4);F(a,olympe.N.V.zq,4E3);F(a,olympe.N.V.Oq,'7.4.0');F(a,olympe.N.V.ve,30);F(a,olympe.N.V.On,5E3);F(a,olympe.N.V.Nn,3E4);F(a,olympe.N.V.Pn,
|
|
497
|
+
6E4);F(a,olympe.N.V.Yk,!1);const c=a.getParameter(olympe.gg.V.Mo);if(void 0!==c)Ma(a,olympe.N.V.dl,c);else throw Error('Framework version could not be found! Is field "olympe-framework" present in version.json?');E(a,olympe.N.R.Ca,[olympe.ka.R.Ea],e=>e.Vc('communication'));E(a,'server.WebSocketRequest',[new olympe.W.lh('com.hostConfig'),new olympe.W.oa(olympe.N.V.lr)],(e,f)=>e.pipe(rxjs.operators.map(({jn:g,kn:h,ln:k,ms:l})=>new olympe.net.Vi(g,h,(l+'/'+f).replace(/\/+/g,'/').replace(/\/$/,''),k))).pipe(rxjs.operators.shareReplay(1)));
|
|
498
|
+
E(a,'server.wakeUpRequest',[new olympe.W.lh('com.hostConfig'),new olympe.W.oa(olympe.N.V.vv)],(e,f)=>e.pipe(rxjs.operators.map(({jn:g,kn:h,ln:k})=>{if(null===f||void 0===f)return null;const l=f.replace(/\/+/g,'/').replace(/\/$/,'');return new olympe.net.Vi(g,h,l,k)})).pipe(rxjs.operators.shareReplay(1)));const d=Array.from(Object.values(olympe.N.Zb));E(a,olympe.N.R.cr,[new olympe.W.lh('com.hostConfig'),...d.map(e=>new olympe.W.oa(e))],(e,...f)=>e.pipe(rxjs.operators.map(({jn:g,kn:h,ln:k,ms:l})=>{const n=
|
|
499
|
+
d.map((p,q)=>{q=f[q];q=(new olympe.net.wi(g,h,`${l}${q?'/'+q:''}`.replace(/\/+/g,'/').replace(/\/$/,''),k)).C();return[p,q]});return new Map(n)})).pipe(rxjs.operators.shareReplay(1)));C(a,olympe.N.R.Be,olympe.N.fc);C(a,olympe.N.R.wl,olympe.N.zt,olympe.N.R.Ca,olympe.net.R.Ea,olympe.Y.R.Xf,olympe.N.R.cr,new olympe.W.oa(olympe.N.V.zq));E(a,'com.server.ManagerConfig',[new olympe.W.oa(olympe.N.V.gq),new olympe.W.oa(olympe.N.V.kr),new olympe.W.oa(olympe.N.V.dl),new olympe.W.oa(olympe.N.V.Oq),new olympe.W.oa(olympe.dc.V.Gh)],
|
|
500
|
+
(...e)=>{const f=['pingInterval','messageTimeout','clientVersion','serverVersion','getContextMode'],g=new Map;e.forEach((h,k)=>g.set(f[k],h));return g});C(a,olympe.N.R.ek,olympe.N.La,olympe.N.R.Ca,olympe.net.R.Ea,olympe.host.R.Pe,olympe.host.R.hk,'server.WebSocketRequest','server.wakeUpRequest',olympe.Y.R.Xf,'com.server.ManagerConfig');Qa(a,'com.bus.TopicPrefix',[olympe.host.V.bk,olympe.N.V.br],(e,f)=>e===olympe.host.Gg.Bh?`${b}-${f}`:f);E(a,'com.bus.ManagerConfig',[new olympe.W.lh('com.hostConfig'),
|
|
501
|
+
new olympe.W.lh('com.bus.TopicPrefix'),new olympe.W.oa(olympe.N.V.Yk),new olympe.W.oa(olympe.N.V.On),new olympe.W.oa(olympe.N.V.Nn),new olympe.W.oa(olympe.N.V.Pn),new olympe.W.oa(olympe.N.V.ve),new olympe.W.oa(olympe.N.V.hv),new olympe.W.oa(olympe.N.V.Us),new olympe.W.oa(olympe.N.V.Ss),new olympe.W.oa(olympe.N.V.bm),new olympe.W.oa(olympe.N.V.Xs),new olympe.W.oa(olympe.N.V.bv)],(e,f,g,h,k,l,...n)=>{e=e.pipe(rxjs.operators.map(({rw:p,sw:q,tw:r,vw:t,uw:u})=>{p=`${u?'wss://':'ws://'}${p}:${r}${q}/ws`;
|
|
502
|
+
const x='keepalive reschedulePings clientId clean reconnectPeriod connectTimeout queueQoSZero shortTimeout requestTimeout'.split(' ');q=n.reduce((y,z,A)=>{y[x[A]]=z;return y},{});q.url=p;q.vhost=t;return q})).pipe(rxjs.operators.shareReplay(1));return new Map([['connection',e],['topicPrefix',f],['allowGuest',g],['shortTimeout',h],['requestTimeout',k],['subscriptionsRefreshRate',l]])});C(a,olympe.N.R.Mn,olympe.N.Rn,olympe.N.R.Ca,olympe.net.R.Ea,olympe.N.R.ff,olympe.auth.R.Ea,olympe.host.R.Pe,olympe.N.R.Be,
|
|
503
|
+
olympe.Y.R.Xf,'com.bus.ManagerConfig');E(a,'com.connectivity.ManagerConfig',[olympe.net.R.Rl,olympe.Db.R.Jg,new olympe.W.oa(olympe.N.V.bm)],(e,...f)=>['storagePrefix','reconnectionDelay'].reduce((g,h,k)=>g.set(h,f[k]),e));C(a,olympe.N.R.ff,olympe.N.rc,olympe.N.R.Ca,olympe.N.R.ek,olympe.net.R.Ea,olympe.host.R.Pe,olympe.Db.R.Kl,'com.connectivity.ManagerConfig')},'olympe.communication');olympe.W.run([olympe.N.R.Mn,olympe.N.R.ff],(a,b)=>{olympe.N.Wh=()=>a;olympe.N.Om=()=>b});olympe.auth={};function ue(a,b){Qd(a.C);Id(a.C,olympe.N.we.xg,c=>{const d=c.c;d===olympe.auth.jd.C.uu?(a.C.Ud(),b(olympe.auth.Ta.F.sj,c)):d===olympe.auth.jd.C.ov&&b(olympe.auth.Ta.F.jp,c)},'logoutHandler')}
|
|
504
|
+
function ve(a,b,c){const d=null==b?void 0:b.nf();if(b instanceof olympe.auth.Vj){const e=g=>{const h=Object.create(null);h.url=g;h.olympe_token=b.wd();h.access_token=we(b);g=`${Cd(a.th,olympe.N.Zb.Sj)}/logout${d?`?idpName=${d}`:''}`;a.F.redirect(g,h)};c=a.F.C();const f=new URL(c);0!==f.hash.length||0!==f.search.length?(f.hash='',f.search='',a.G.db.set('main',c,'redirectTo').then(()=>{e(f.toString())}).catch(g=>{a.H.error(`Error when trying to set the redirectKey in Auth store: ${g}`)})):e(c)}else Nd(a.C,
|
|
505
|
+
olympe.N.we.xg,Object.assign({},{c:olympe.auth.jd.C.vu},d&&{idpName:d}),c)}function xe(a,b,c,d){olympe.D.Na(a.J.getState())===olympe.N.rc.C.ee?d(new olympe.N.errors.aq('Working offline'),'Working offline'):(c.c=b,Nd(a.C,olympe.N.we.xg,c,d))}
|
|
506
|
+
function ye(a,b,c){if(b.wg()!==olympe.auth.Ec.C.OAUTH2)c(Error('Only oAuth2 tokens can be refreshed'),null);else{var d=`?idpName=${b.nf()}&access_token=${we(b)}`;d=`${Cd(a.th,olympe.N.Zb.Sj)}/refresh${d}`;Ed(a.th,N(d),b.wd()).then(e=>{'string'===typeof e?(e=JSON.parse(e),e=new olympe.auth.Vj(b.Bc(),b.me(),b.wd(),e,b.nf()),c(null,e)):c(null,b)}).catch(e=>c(Error(e),null))}}
|
|
507
|
+
olympe.auth.jd=class{constructor(a,b,c,d,e,f){this.H=a;this.C=b;this.th=c;this.J=d;this.F=e;this.G=f;ze(this.G).then(g=>{g&&this.G.db.remove('main','redirectTo').then(()=>{this.F.redirect(g,null,olympe.auth.dk.C.GET)}).catch(h=>{this.H.error(`Error when trying to remove redirect key from AUTH storage: ${h}`)})}).catch(g=>{this.H.error(`Error when trying to get redirect key from AUTH storage: ${g}`)})}cf(a){Nd(this.C,olympe.N.we.xg,{c:olympe.auth.jd.C.ve},b=>a(b))}Yg(a,b,c){const d=Cd(this.th,olympe.N.Zb.er);
|
|
508
|
+
a=N(`${d}/${a}`);Ed(this.th,a,b).then(e=>c(null,e)).catch(e=>c(Error(e)))}};olympe.auth.jd.C={xg:1,vu:2,xb:3,ve:5,Ni:6,Ct:10,Cv:11,zs:12,SAML:13,ov:14,uu:20};function sd(a,b){var c='busLogoutCallback';void 0===c&&(c=olympe.Y.Vh());a.ea.set(c,b)}function id(a){return olympe.D.Na(a.C.sb())}
|
|
509
|
+
function Wd(){var a=olympe.auth.je();const b=olympe.auth.Ta.C.tj,c=olympe.auth.Ta.C.INIT;Ae(a,b);a.Ga?(a.G=olympe.auth.Ta.G.ys,a.H.log('Connector online, parameter auth.autoLogin=true --\x3e attempting to log with parameters'),Be(a)):(a.G=olympe.auth.Ta.G.Pi,a.H.log('Connector online, attempting to log with token'),Ce(a));return rxjs.firstValueFrom(a.F.sb().asObservable().pipe(rxjs.operators.filter(d=>!(d===b||d===c)))).catch(()=>{})}
|
|
510
|
+
function De(a){a.H.info('Initializing AUTH layer');let b=a.Ub;if('object'===typeof location){const c=location.hash;let d=c.indexOf('authToken=');-1<d&&(b=c.substring(d+10),'&'===c[d-1]&&d--,location.hash=c.substring(0,d))}b&&a.storage&&Ee(a.storage,b).catch(c=>a.H.error(c));a.H.debug('Asking to be notified when auth connector gets online');olympe.D.Nc([a.eb.getState()],c=>{switch(c){case olympe.N.rc.C.ee:a.G=olympe.auth.Ta.G.Pi;a.H.log('Connector offline, attempting to recover sessions from current token');
|
|
511
|
+
Ce(a);break;case olympe.N.rc.C.Rd:switch(olympe.D.Na(a.F)){case olympe.auth.Ta.C.df:c=olympe.D.Na(a.C).Bc();Fe(a,`Disconnected from server - session of user ${c} lost`);break;case olympe.auth.Ta.C.si:a.H.info('Disconnected from server - guest session lost');break;case olympe.auth.Ta.C.tj:Fe(a,'Disconnected from server - authentication aborted');break;case olympe.auth.Ta.C.INIT:Fe(a,'Cannot open auth session - no server connection');break;default:Fe(a,'Should not get there, investigate',!0)}}});ue(a.J,
|
|
512
|
+
(c,d)=>{if(c===olympe.auth.Ta.F.sj){Fe(a,'authentication revoked');let e;null==(e=a.storage)||Ge(e).catch(f=>a.H.error('Failed to clear token',f));a.ea.forEach(f=>{f(c,d)})}else if(c===olympe.auth.Ta.F.jp){a.H.info('Redirection to IDP to invalidate token (SAML)');id(a);let e;null==(e=a.storage)||Ge(e).catch(f=>a.H.error('Failed to clear token',f));a.hb.F()}else throw Error(`Unknown logout step coming from server : ${c}`);});a.va=He(a);a.T.F(()=>a.bi().catch(c=>a.H.error(`Failed to logout ${c}`)),
|
|
513
|
+
'Logout');a.H.log('DONE initializing AUTH layer (waiting for connector to be online)')}function Ie(a,b){let c=null;olympe.D.ij(a.F.sb().Ad(olympe.auth.Ta.C.df).and(b),()=>{const d=id(a);!Je(a)&&d&&(c=a.Od.get(d.wg()).J(d,(e,f)=>{e?(a.H.error('Failed to refresh token, error message: ',e.message),a.bi().catch(g=>a.H.error(`Failed to logout after wrong refresh ${g}`))):f&&Ke(a,f)}))},()=>{let d;null==(d=c)||d()})}
|
|
514
|
+
function Ce(a){null!==a.storage?(a.H.debug('Retrieving token from local storage'),a.storage.le().then(b=>{if(b){const e=new olympe.auth.Request;var c=b.Bc();e.set('username',c);c=e;var d=b.wd();c.set('nonce',d);'string'===typeof b.nf()&&e.set('idpName',b.nf());a.H.debug('Token found, trying login with',e);Le(a,e,olympe.auth.Ec.C.Sl)}else Fe(a,'No token found, cannot perform auto login')}).catch(b=>{Fe(a,b.message,!0)})):Fe(a,'Cannot retrieve token: no storage configured, cannot perform auto login',
|
|
515
|
+
!0)}function Fe(a,b,c=!1){a.C.update(a.aa);Ae(a,olympe.auth.Ta.C.si);b=`Authenticated as guest (${b})`;c?a.H.error(b):a.H.info(b)}function He(a){const b=[olympe.auth.Ta.C.df];a.Ga||b.push(olympe.auth.Ta.C.si);return a.T.C(()=>{const c=Me(a);return b.includes(c)?Promise.resolve('The auth manager is OK'):Promise.reject(`The auth manager is not in valid state, the current state is: ${c}`)})}function Ae(a,b){a.H.log('State change: ',Me(a),'--\x3e',b);a.F.update(b)}
|
|
516
|
+
function Be(a){if(a.Z){const b=new olympe.auth.Request;b.set('username',a.Z);b.set('password',a.yb);a.H.log('Autologin with user "'+a.Z+'"');Le(a,b)}else Fe(a,'No user specified for auto login',!0)}function Je(a){return olympe.D.Na(a.C)===a.aa}function Ke(a,b){if(b){a.C.update(b);let c;null==(c=a.storage)||Ee(c,b).catch(d=>a.H.error(d));a.H.debug('Token updated')}}function Me(a){return olympe.D.Na(a.F.sb())}function Ne(){var a=olympe.public.Ka.get();return new Map(a.J.C.Tc)}
|
|
517
|
+
function Oe(a,b,c,d=!1){b=b+c?':'+c.message:'';a.H.error(b);a.error.update(olympe.D.Ab(b));Ae(a,olympe.auth.Ta.C.xb);if(d)throw Error(b);}function Le(a,b,c,d){void 0===c&&(c=a.Fb);void 0===c&&Oe(a,'No authentication provider specified',null,!0);const e=a.Od.get(c);e||Oe(a,'Undefined authentication provider "'+c+'"',null,!0);d&&a.O.set('login',d);a.H.log('Sending authentication request using "'+c+'" for '+b);e.le(b,a.ac.bind(a));Ae(a,olympe.auth.Ta.C.tj)}
|
|
518
|
+
function Pe(a,b,c){a.O.forEach(d=>{d(b,c)})}
|
|
519
|
+
olympe.auth.Ta=class{constructor(a,b,c,d,e,f,g,h,k){this.H=a;this.eb=b;this.J=c;this.storage=d;this.hb=e;this.Fb=k.get('defaultProvider');this.Ga=!!k.get('autoLogin');this.Z=k.get('autoUser');this.yb=k.get('autoPassword');this.Ub=k.get('autoToken');this.Od=new Map;this.T=f;this.va='';this.F=olympe.D.ec(String).update(olympe.auth.Ta.C.INIT);this.error=olympe.D.ec(olympe.D.Qa);this.G=null;this.aa=new olympe.auth.Ng('guest','0163d9653067b6237f62','e96e099c-55bb-4004-b0e8-bd76b6209218');this.C=olympe.D.ec(olympe.auth.Ng).update(this.aa);
|
|
520
|
+
this.O=new Map;this.ea=new Map;this.ja=new olympe.Y.Hh(k.get('cacheTokenTimeout'));h.forEach(l=>{const n=l.G();if(this.Od.has(n))throw Error('Provider "'+n+'" has already been registered !');this.Od.set(n,l)});De(this);Ie(this,g.C())}Ik(){const a=olympe.auth.Ta.C.df,b=olympe.auth.Ta.C.si,c=olympe.auth.Ta.C.xb,d=olympe.D.ec(olympe.D.fa);olympe.D.Nc([this.F],e=>{e===a?d.update(olympe.D.fa.F):e===b?d.update(olympe.D.fa.C):e===c?(this.H.error('Authentication failed.'),d.update(olympe.D.fa.C)):d.clear()});
|
|
521
|
+
return d.sb()}hg(a){if(olympe.D.Na(this.F)===olympe.auth.Ta.C.df){var b=id(this);!Je(this)&&b&&this.Od.get(b.wg()).hg(b,(c,d)=>{c?(this.H.error('Failed to refresh token, error message: ',c.message),this.bi().catch(e=>this.H.error(`Failed to logout after wrong refresh ${e}`))):d&&Ke(this,d);a(c)})}}getState(){return this.F.sb()}Bc(){return this.C.sb().Bc()}me(){return this.C.sb().me()}Yh(){return this.C.sb().Yh()}Yg(a,b){if(Xa(this.ja.C,a))b(null,this.ja.get(a));else{var c,d=null==(c=olympe.D.Na(this.C.sb()))?
|
|
522
|
+
void 0:c.wd();this.J.Yg(a,d,(e,f)=>{'string'===typeof f&&this.ja.set(a,f);b(e,f)})}}bi(){return Je(this)?(this.H.warn('Logout called for Guest user so it will be ignored'),Promise.resolve()):new Promise((a,b)=>{this.H.debug('Sending logout');let c;null==(c=this.storage)||Ge(c).catch(d=>this.H.error('Failed to clear token',d));ve(this.J,id(this),d=>{d?(Oe(this,'Logout request rejected:',d),b(d)):(this.H.debug('Logout request acknowledged'),a())});this.T.G(this.va)})}cf(a){Me(this)===olympe.auth.Ta.C.df&&
|
|
523
|
+
this.J.cf(b=>{b&&this.H.error('Was not able to send the auth keep alive message:',b.message);null==a||a(b)})}ac(a,b){const c=null===this.G?olympe.auth.Ta.G.Bu:this.G;this.G=null;if(!a||a instanceof olympe.N.errors.aq){null===a?this.H.info(`User ${b.Bc()} (#${b.me()}) successfully authenticated`):this.H.info(`User ${b.Bc()} (#${b.me()}) recovered from token, while offline`);this.C.update(b);Ae(this,olympe.auth.Ta.C.df);Pe(this,a,c);let d;null==(d=this.storage)||Ee(d,b).catch(e=>this.H.error(e))}else{let d;
|
|
524
|
+
null==(d=this.storage)||Ge(d).catch(e=>this.H.error(e));this.error.update(olympe.D.Ab(a.message));Fe(this,'authentication rejected: '+a.message);Pe(this,a,c)}this.O.has('login')&&this.O.delete('login')}};olympe.auth.Ta.C={INIT:'init',tj:'authenticating',si:'guest',df:'authenticated',xb:'error'};olympe.auth.Ta.G={Bu:'manual',ys:'auto',Pi:'tokenOnFirstConnection'};olympe.auth.Ta.F={sj:'accepted',jp:'redirect'};olympe.auth.Ec=class{constructor(a,b){this.H=a;this.F=b;this.C=null}G(){}le(){}J(a,b){const c=()=>{this.C=setTimeout(()=>this.F.cf(d=>{d?b(d,null):(b(null,null),c())}),this.F.C.Cc)};c();return()=>{this.C&&clearTimeout(this.C);this.C=null}}hg(a,b){this.F.cf(c=>{b(c,null)})}};olympe.auth.Ec.C={SAML:'saml',OAUTH2:'openID',SRP:'srp',Sl:'olympeToken'};function Qe(a){return a.get('idpName')}olympe.auth.Request=class{constructor(){this.C=new Map}set(a,b){olympe.D.Nc([b],c=>{this.C.set(a.toLocaleLowerCase(),c.toString())})}get(a){(a=this.C.get(a.toLowerCase()))&&a.Og&&(a=a.Da.Gb);return a?a.valueOf():a}Bc(){return this.get('username')}wd(){return this.get('nonce')}toString(){return this.Bc()+(this.wd()?' with nonce':'')+(this.get('password')?' with password':'')+(Qe(this)?` with idp name ${Qe(this)}`:'')}};olympe.auth.Ng=class{constructor(a,b,c,d={},e=null){this.J=a;this.ei=b;this.F=c;this.C=e;this.G=d}Bc(){return this.J}me(){return this.ei}wd(){return this.F}zi(){return this.G}Yh(){return null}nf(){return this.C}ha(){const a=olympe.Y.Xe(),b=Object.assign({},{user:this.J,userTag:this.ei,nonce:this.F},this.C&&{idpName:this.C},{payload:this.G});return olympe.Y.vr(Ua(a,JSON.stringify(b)))}wg(){return olympe.auth.Ec.C.SRP}};m=olympe.auth.Ng.prototype;m.Bc.L=new olympe.D.K(()=>String,[]);
|
|
525
|
+
m.me.L=new olympe.D.K(()=>String,[]);m.wd.L=new olympe.D.K(()=>String,[]);m.zi.L=new olympe.D.K(()=>Object,[]);m.Yh.L=new olympe.D.K(()=>String,[]);m.nf.L=new olympe.D.K(()=>String,[]);m.ha.L=new olympe.D.K(()=>String,[]);m.wg.L=new olympe.D.K(()=>String,[]);function we(a){return a.zi().access_token||null}function Re(a){return 1E3*parseInt(a.zi().access_token_exp||'0',10)}olympe.auth.Vj=class extends olympe.auth.Ng{constructor(a,b,c,d,e){super(a,b,c,d,e);this.O=Date.now()}Yh(){return we(this)}wg(){return olympe.auth.Ec.C.OAUTH2}};olympe.auth.Iq=class extends olympe.auth.Ng{constructor(a,b,c,d,e,f){super(a,b,c,e,f);this.O=d}Yh(){return this.O}wg(){return olympe.auth.Ec.C.SAML}ha(){const a=olympe.Y.Xe(),b=Object.assign({},{user:this.Bc(),userTag:this.me(),nonce:this.wd()},this.nf()&&{idpName:this.nf()},{payload:this.zi(),fullToken:this.O});return olympe.Y.vr(Ua(a,JSON.stringify(b)))}};function ze(a){let b;return null!=(b=a.db.get('main','redirectTo'))?b:null}function Ee(a,b){return hb(a.F,()=>a.db.set('main','string'===typeof b?b:b.ha(),a.C).catch(c=>{throw Error(`Error when trying to set the token from the auth store: ${c}`);}))}function Ge(a){return hb(a.F,()=>a.db.remove('main',a.C).catch(b=>{a.H.error(`Error when trying to remove the token from the auth store: ${b}`)}))}
|
|
526
|
+
olympe.auth.Fs=class{constructor(a,b,c){this.G=a;this.H=b;this.C='OlympeToken-'+c.C;this.F=new olympe.Y.promise.km;this.db=this.G.F('AUTH')}le(){this.H.debug(`olympe.auth.AuthStorage: retrieve token with key ${this.C}`);return hb(this.F,()=>{const a=this;return v(function*(){let b;try{b=yield a.db.get('main',a.C)}catch(g){throw Error(`Error when trying to get the token from the auth store: ${g}`);}let c=null;if(b)try{a.H.debug('olympe.auth.AuthStorage: Token retrieved successfully');var d=JSON,e=
|
|
527
|
+
d.parse;var f=Va(olympe.Y.Xe().F(olympe.Y.pw(b)));const g=e.call(d,f);let h;g.fullToken?h=new olympe.auth.Iq(g.user,g.userTag,g.nonce,g.fullToken,g.payload,g.idpName):g.payload&&g.payload.id_token?h=new olympe.auth.Vj(g.user,g.userTag,g.nonce,g.payload,g.idpName):h=new olympe.auth.Ng(g.user,g.userTag,g.nonce,g.payload,g.idpName);c=h}catch(g){throw Error(`Error while unserializing token: ${g}`);}else a.H.debug('olympe.auth.AuthStorage: No token found');return c})})}};olympe.auth.dk=class{redirect(){}F(){}C(){}};olympe.auth.dk.C={GET:'GET',Ah:'POST'};olympe.auth.En=class{constructor(a){this.C=a||'default'}};olympe.auth.Od={};function Se(a,b,c){xe(a.F,olympe.auth.jd.C.xg,{token:b.wd()},(d,e)=>{if(null!==d)c(d,null);else switch(e.c){case olympe.auth.jd.C.xb:c(Error('Invalid token'),null);break;case olympe.auth.jd.C.Ni:d=null;if(e=e.payload){const f=e.userName,g=e.userTag,h=e.rndCook,k=e.payload,l=e.protocol;'SAML'===l?d=new olympe.auth.Iq(f,g,h,e.samlToken,k,Qe(b)):'openid'===l&&(d=new olympe.auth.Vj(f,g,h,k,Qe(b)))}c(null,d);break;default:c(Error('Unknown response from server'),null)}})}
|
|
528
|
+
olympe.auth.Od.Au=class extends olympe.auth.Ec{constructor(a,b,c){super(a,b);this.storage=c}G(){return olympe.auth.Ec.C.Sl}le(a,b){this.storage.le().then(c=>{Se(this,a,(d,e)=>{b(d,null!=e?e:c)})}).catch(c=>{b(c,null)})}};function Te(a,b,c){var d=Re(b);const e=Math.max(d-b.O,0),f=olympe.W.getParameter(olympe.auth.V.$q);d=Math.max(Math.round(d-e*(1-Math.max(Math.min((f||50)/100,.95),0))-Date.now()),0);if(0<d)return setTimeout(()=>{a.hg(b,c)},d);a.hg(b,c);return null}
|
|
529
|
+
olympe.auth.Od.Qu=class extends olympe.auth.Ec{constructor(a,b,c,d){super(a,b);this.O=c;this.T=d}G(){return olympe.auth.Ec.C.OAUTH2}le(a){const b=encodeURIComponent(this.O.C());a=Qe(a)?`idpName=${Qe(a)}&`:'';this.O.redirect(`${this.T}/auth?${a}url=${b}`,null,olympe.auth.dk.C.GET)}J(a,b){0<Re(a)?this.C=Te(this,a,b):b(null,a);return this.Z.bind(this)}hg(a,b){ye(this.F,a,(c,d)=>{c?b(c,null):d&&(b(null,d),this.C&&(this.C=Te(this,d,b)))})}Z(){this.C&&clearTimeout(this.C);this.C=null}};function Ue(a,b){xe(a.F,olympe.auth.jd.C.SAML,{},(c,d)=>{null!==c?b(c):d.url&&d.request?b(null,d.url,d.request.replace(/\s/g,''),d.id):b(Error('Missing parameters from server response'))})}olympe.auth.Od.SAML=class extends olympe.auth.Ec{constructor(a,b,c){super(a,b);this.O=c}G(){return olympe.auth.Ec.C.SAML}le(a,b){Ue(this,c=>{c?b(c,null):this.O.F(Qe(a))})}};function Ve(a,b,c){const d=olympe.auth.jd.C.Ct,e=olympe.auth.jd.C.xb,f=olympe.auth.jd.C.Cv,g={I:b.Bc()};xe(a.F,d,g,(h,k)=>{if(null!==h)c(h);else switch(k.c){case e:c(Error(`Username '${b.Bc()}' invalid, or password does not match`));break;case f:h=k.payload;c(null,h.S,h.B);break;default:c(Error('Unknown response from server'))}})}
|
|
530
|
+
function We(a,b,c){const d=olympe.auth.jd.C.zs,e=olympe.auth.jd.C.xb,f=olympe.auth.jd.C.Ni;b={A:b.get('a'),M:b.get('m1'),I:b.Bc()};xe(a.F,d,b,(g,h)=>{if(null!==g)c(g,null);else switch(h.c){case e:a.H.debug('Login failed, invalid username or password');c(Error('Invalid username or password'),null);break;case f:g=h.payload;a.H.debug('Login successful, creating token');h=g.payload?JSON.parse(g.payload):void 0;c(null,new olympe.auth.Ng(g.userName,g.userTag,g.rndCook,h));break;default:c(Error(`Unknown response from server (type ${h.c})`),
|
|
531
|
+
null)}})}olympe.auth.Od.SRP=class extends olympe.auth.Ec{G(){return olympe.auth.Ec.C.SRP}le(a,b){const c=a.get('password');a.C.delete('password');this.H.debug('Sending SRP request');Ve(this,a,(d,e,f)=>{this.H.debug('Received Salt+B message');if(d)b(d,null);else{try{const g=new SRPClient;g.step1(a.Bc(),c);const h=g.step2(e,f);a.set('a',h.A);a.set('m1',h.M1)}catch(g){b(g,null);return}this.H.debug('Sending SRP A+M (proof) message');We(this,a,b)}})}};olympe.auth.R={Ea:'auth.Manager',Ca:'auth.Logger',Mi:'auth.Storage',Tk:'auth.appNameToken',$j:'auth.Redirector',Mq:'auth.ServerConnector'};olympe.auth.V={ml:'auth.defaultProvider',yn:'auth.autoLogin',An:'auth.autoUser',zn:'auth.autoPassword',Pi:'auth.token',Tn:'auth.cacheTokenTimeout',$q:'auth.tokenDurationPercentage'};
|
|
532
|
+
olympe.W.config(function(a){F(a,olympe.auth.V.ml,olympe.auth.Ec.C.SRP);F(a,olympe.auth.V.yn,!1);F(a,olympe.auth.V.An,'');F(a,olympe.auth.V.zn,'');F(a,olympe.auth.V.Pi,'');F(a,olympe.auth.V.$q,50);F(a,olympe.auth.V.Tn,3E5);E(a,olympe.auth.R.Ca,[olympe.ka.R.Ea],b=>b.Vc('auth'));C(a,olympe.auth.R.Tk,olympe.auth.En,olympe.Db.R.Jg);C(a,olympe.auth.R.Mi,olympe.auth.Fs,olympe.Db.R.Oj,olympe.auth.R.Ca,olympe.auth.R.Tk);C(a,olympe.auth.R.Mq,olympe.auth.jd,olympe.auth.R.Ca,olympe.N.R.ek,olympe.N.R.wl,olympe.N.R.ff,
|
|
533
|
+
olympe.auth.R.$j,olympe.auth.R.Mi);Pa(a,olympe.auth.R.$j);E(a,olympe.auth.R.Ea,[olympe.auth.R.Ca,olympe.N.R.ff,olympe.auth.R.Mq,olympe.host.R.Pe,olympe.host.R.hk,new olympe.W.wb(olympe.auth.R.Mi,olympe.W.hh.C.Pl),new olympe.W.wb(olympe.auth.R.$j,olympe.W.hh.C.Pl),new olympe.W.oa(olympe.auth.V.ml),new olympe.W.oa(olympe.auth.V.yn),new olympe.W.oa(olympe.auth.V.An),new olympe.W.oa(olympe.auth.V.zn),new olympe.W.oa(olympe.auth.V.Pi),new olympe.W.oa(olympe.auth.V.Tn)],(b,c,d,e,f,g,h,k,l,n,p,q,r)=>{const t=
|
|
534
|
+
[new olympe.auth.Od.Au(b,d,g),new olympe.auth.Od.SRP(b,d),new olympe.auth.Od.SAML(b,d,h),new olympe.auth.Od.Qu(b,d,h,Cd(d.th,olympe.N.Zb.Sj))];if(!t.map(u=>u.G()).includes(k))throw Error(`Default provider name ${k} given by parameter ${olympe.auth.V.ml} cannot be found`);return new olympe.auth.Ta(b,c,d,g,h,e,f,t,new Map([['defaultProvider',k],['autoLogin',l],['autoUser',n],['autoPassword',p],['autoToken',q],['cacheTokenTimeout',r]]))},!0)},'olympe.auth');
|
|
535
|
+
olympe.W.run([olympe.auth.R.Ea],a=>{olympe.auth.je=()=>a});olympe.Ua.node.auth={};olympe.Ua.node.auth.Sp=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.Ua.node.auth.Sp.ya=[olympe.auth.dk];olympe.W.config(a=>{C(a,olympe.auth.R.$j,olympe.Ua.node.auth.Sp)},'olympe.native.node.auth');olympe.Ua.node.Db={};function Xe(){throw Error('Key-Value Database does not implement this in NodeJS');}
|
|
536
536
|
olympe.Ua.node.Db.Qp=class{constructor(a){this.H=a;this.C=new Map}Z(){return 0}O(a){const b=this;return v(function*(){let c,d;return null!=(d=null==(c=b.C.get(a))?void 0:c.size)?d:0})}G(a){const b=this;return v(function*(){const c=b.C.get(a);return c?Array.from(c.values()):[]})}T(a){const b=this;return v(function*(){const c=b.C.get(a);return c?Array.from(c.keys()):[]})}forEach(a,b){const c=this;return v(function*(){let d;for(const [e,f]of null!=(d=c.C.get(a))?d:new Map)b(f,e)})}has(a,b){const c=this;
|
|
537
|
-
return v(function*(){let d,e;return null!=(e=null==(d=c.C.get(a))?void 0:d.has(b))?e:!1})}get(a,b){const c=this;return v(function*(){let d;return null==(d=c.C.get(a))?void 0:d.get(b)})}set(a,b,c){const d=this;return v(function*(){let e;return null==(e=d.C.get(a))?void 0:e.set(c,b)})}remove(a,b){const c=this;return v(function*(){let d;yield null==(d=c.C.get(a))?void 0:d.delete(b)})}ea(){
|
|
538
|
-
null==(c=b.C.get(a))||c.clear()})}J(){
|
|
539
|
-
function
|
|
540
|
-
function
|
|
541
|
-
|
|
542
|
-
olympe.dc.Nb={NONE:null,
|
|
537
|
+
return v(function*(){let d,e;return null!=(e=null==(d=c.C.get(a))?void 0:d.has(b))?e:!1})}get(a,b){const c=this;return v(function*(){let d;return null==(d=c.C.get(a))?void 0:d.get(b)})}set(a,b,c){const d=this;return v(function*(){let e;return null==(e=d.C.get(a))?void 0:e.set(c,b)})}remove(a,b){const c=this;return v(function*(){let d;yield null==(d=c.C.get(a))?void 0:d.delete(b)})}ea(){Xe();return Promise.resolve()}aa(){Xe();return Promise.resolve()}clear(a){const b=this;return v(function*(){let c;
|
|
538
|
+
null==(c=b.C.get(a))||c.clear()})}J(){Xe();return Promise.resolve([])}F(){return v(function*(){Xe()})}};olympe.Ua.node.Db.Qp.ya=[olympe.Db.pu];olympe.Ua.node.Db.Rp=class{constructor(a){this.C=new Map;this.H=a}F(a){this.C.has(a)||this.C.set(a,new olympe.Ua.node.Db.Qp(this.H));return this.C.get(a)}};olympe.Ua.node.Db.Rp.ya=[olympe.Db.qu];olympe.W.config(function(a){C(a,olympe.Db.R.Oj,olympe.Ua.node.Db.Rp,olympe.Db.R.Ca)},'olympe.native.node.localstorage');olympe.Ua.node.storage={};olympe.Ua.node.storage.Storage=class{constructor(a){this.H=a}write(a,b,c,d,e){e&&e('Not Implemented.')}open(a){a(null)}close(a){a(null)}};olympe.Ua.node.storage.Storage.ya=[olympe.Db.Storage];olympe.W.config(function(a){Na(a,olympe.Db.R.Mi,olympe.Ua.node.storage.Storage,olympe.host.R.Ca)},'olympe.native.html.storage');olympe.gg={};olympe.gg.V={VERSION:'version.version',Js:'version.branch',ef:'version.commit',Jv:'version.tag',Mo:'version.olympe-framework',Ks:'version.build'};olympe.W.config(function(a){F(a,olympe.gg.V.VERSION,'');F(a,olympe.gg.V.Js,'');F(a,olympe.gg.V.ef,'');F(a,olympe.gg.V.Jv,'');F(a,olympe.gg.V.Mo,'');F(a,olympe.gg.V.Ks,'')},'olympe.main');const Ye=require('fs'),Ze=require('fs/promises');let $e;const af=null!=($e=process.env.EXTRA_CONFIG_PATH)?$e:null;let bf;const rb=null!=(bf=process.env.EXTRA_CONFIG_KEY_PREFIX)?bf:'';function qb(a){return Ze.readFile(a,{encoding:'utf8'}).then(b=>'string'===typeof b?b:null).catch(()=>null)}
|
|
539
|
+
function cf(a){var b=df;console.debug(`Start watching config files for changes: ${b}`);b.forEach(c=>{Ze.access(c,Ye.constants.F_OK).then(()=>{Ye.watch(c,d=>v(function*(){if('change'===d){console.log(`Config file "${c}" has changed. Loading new configuration...`);try{const e=yield olympe.Y.cs([c]),f=olympe.W.Pr(e);for(const [g,h]of f)a.rj(g,h)}catch(e){console.error(`Failed to updated config from file ${c} with message: ${e.message}`)}}}))}).catch(()=>{})})}
|
|
540
|
+
function ef(){console.log('The node process received a signal for graceful shutdown');let a,b;null==(b=(a=olympe.Ua.node.host).Ck)||Dc(b.call(a)).then(()=>console.log('The node backend has stopped successfully')).catch(c=>console.warn(c)).finally(()=>process.exit(0))}process.on('SIGTERM',ef);process.on('SIGINT',ef);process.on('SIGBREAK',ef);process.on('SIGHUP',ef);process.on('uncaughtException',a=>{console.error('Uncaught Exception:',a);ef()});const df=['oConfig.json','conf.d/oConfig.json','version.json'];
|
|
541
|
+
af&&df.push(af);olympe.Y.cs(df).catch(a=>{console.error(`Failed to load config files: ${a.message}`);ef()}).then(a=>{const b=Object.create(null),c=process.argv;for(let d=2;d<c.length;d++){const e=/([^?&=]+)(=?([^?&=]+))?/g.exec(c[d]);!Array.isArray(e)||4>e.length?console.warn(`Malformed config parameter "${c[d]}" ignored. It should of the form 'a=b'`):b[e[1]]=olympe.Y.wr(e[3])}a=new olympe.W.dt(a,b);Da(a);a=a.compile();Fa(a);return a}).then(a=>cf(a));olympe.dc={};olympe.dc.wa={ORIGIN:'<',DESTINATION:'>'};w('olympe.dc.Direction',olympe.dc.wa);olympe.dc.mc={Yc:'ff022000000000000000',ni:'ff02200000000000000e',Aj:'ff02200000000000000f'};olympe.dc.sp={VERSION:'@v',Rq:'@s'};olympe.dc.Oe={Me:'?',qh:'~'};olympe.dc.iC={Ji:'online',ee:'offline',QA:'invalidate'};olympe.dc.Sa={SELF:'self',SERVER:'server',sf:'remote',ee:'offline'};
|
|
542
|
+
olympe.dc.Nb={NONE:null,uo:'ff023000000000000037',Dc:'ff023000000000000137',Yf:'ff023000000000000237',zv:'ff023000000000000337',kt:'ff023000000000000437',SA:olympe.dc.Oe.qh+'ff023000000000000037',TA:olympe.dc.Oe.qh+'ff023000000000000237',RA:olympe.dc.Oe.qh+'ff023000000000000437'};olympe.dc.Zp=class extends Error{constructor(a){var b=olympe.dc.ia(),c=olympe.dc.Zd(),d=b.model(a);d=`\n- model: ${d} (${d?b.name(d):'no name'})`;b=b.source(a);c=`\n- source: ${b} (${b?c.tb(b).name():'no name'})`;super(`Trying to use a CloudObject that does not exist:\n- tag: ${a}${d}${c}${''}`)}};olympe.dc.Writable=class{$c(){}Qc(){}F(){}Ma(){}hc(){}};olympe.dc.Xu=class{Jc(){}U(){}O(){}};olympe.dc.uc=class{constructor(a){this.tag='string'===typeof a?a:a.X()}X(){return this.tag}Fa(a){return a instanceof olympe.dc.uc&&this.tag===a.tag}};olympe.dc.uc.ya=[olympe.dc.Ne];olympe.dc.uc.prototype.Fa.L=olympe.D.K.C;olympe.dc.tt=class a{constructor(b,c,d,e,f,g){this.H=b;this.Z=c;this.db=c.view;this.aa=d;this.Wb=e;this.F=f;this.O=g;this.C=new Map;this.G=Za(new olympe.Y.Hh(6E5),(h,k)=>{URL.revokeObjectURL(k);ff(this.db,h,a.C(h))})}ea(b,c,d,e,f){this.Ga(c).then(g=>{this.eb(b,g,d,!!this.O,e,f)}).catch(g=>this.H.error(g))}J(b){const c=this;return v(function*(){const d=f=>{f=`Failed to download file ${b.X()}: ${f}`;c.H.error(f);throw Error(f);},e=b.X();if(Xa(c.G.C,e)){const f=c.G.get(e);return c.F.G(f).then(g=>g.arrayBuffer()).then(g=>
|
|
543
543
|
new Uint8Array(g)).catch(d)}return c.downloadFileContent(b).then(f=>c.F.J(f)).then(f=>{if(c.O){let g;const h=null!=(g=b.get(olympe.dm.File.mimeTypeProp))?g:'application/data';c.T(e,new Blob([f],{type:h}))}return f}).catch(d)})}downloadFileContent(b){var c=b.X(),d=b.get(olympe.dm.File.C);const e=b.get(olympe.dm.File.urlProp);return e.startsWith('stream:')?this.ja(c).then(()=>this.downloadFileContent(b)):e.startsWith('blob:')?this.F.G(e).then(f=>f.arrayBuffer()).then(f=>new Uint8Array(f)):d?(d=this.db.model(b),
|
|
544
|
-
c=new olympe.dc.Request(olympe.dc.Request.C.Tf,olympe.dc.Zd().Fe(b),{tag:c,model:d,url:e.valueOf()}),this.Wb.request(c)):new Promise((f,g)=>{const h=N(e);h.F=olympe.net.Aa.ResponseType.
|
|
545
|
-
return c}hb(b,c){this.F.J(c).then(d=>{d=URL.createObjectURL(new Blob([d]));const e=new olympe.dc.db.tc;e.Qc(b,(new Map).set(olympe.dm.File.urlProp.X(),d));this.Z.xc(
|
|
544
|
+
c=new olympe.dc.Request(olympe.dc.Request.C.Tf,olympe.dc.Zd().Fe(b),{tag:c,model:d,url:e.valueOf()}),this.Wb.request(c)):new Promise((f,g)=>{const h=N(e);h.F=olympe.net.Aa.ResponseType.Xk;this.aa.C(h,k=>{const l=k.Gc();200<=l&&300>l?f(k.getData()):g(`Failed to download file ${b}. Response code ${l}`)})})}va(b){const c=new olympe.Y.stream.Eg;this.J(b).then(d=>{const e=new olympe.Y.stream.Eg;for(let f=0;f<d.length;f+=65536){const g=f+65536;e.write(d.subarray(f,g>d.length?d.length:g))}e.complete();e.G(c)});
|
|
545
|
+
return c}hb(b,c){this.F.J(c).then(d=>{d=URL.createObjectURL(new Blob([d]));const e=new olympe.dc.db.tc;e.Qc(b,(new Map).set(olympe.dm.File.urlProp.X(),d));this.Z.xc(gf(e));let f;null==(f=this.C.get(b))||f.forEach(g=>g(null))}).catch(d=>{let e;null==(e=this.C.get(b))||e.forEach(f=>f(d))}).finally(()=>{this.C.delete(b)})}ja(b){return new Promise((c,d)=>{let e;const f=null!=(e=this.C.get(b))?e:[];f.push(g=>g?d(g):c());this.C.set(b,f)})}eb(b,c,d,e,f,g){const h=e?k=>{this.T(b,new Blob([c],{type:d}));f(k)}:
|
|
546
546
|
f;e=this.db.model(b);e=new olympe.dc.Request(olympe.dc.Request.C.ag,olympe.dc.Zd().Fe(b),{tag:b,model:e,content:c,mimeType:d});this.Wb.request(e).then(k=>h(null!=k?k:'')).catch(null!=g?g:this.H.error.bind(this.H))}Ga(b){return v(function*(){var c=b instanceof olympe.D.Qa?b.valueOf():b;return'string'===typeof c?Ta(c):c instanceof ArrayBuffer?new Uint8Array(c,0,c.byteLength):c instanceof Blob?(c=yield c.arrayBuffer(),new Uint8Array(c,0,c.byteLength)):c})}T(b,c){const d=olympe.dc.ga(b);b=URL.createObjectURL(c);
|
|
547
|
-
this.G.set(d,b);const e=a.C(d);
|
|
548
|
-
olympe.dc.Request.C={Hb:1,tg:10,vt:24
|
|
549
|
-
p.X(),!a.sources.has(h)){const q=new olympe.dc.sources.Dp(a.H,p);a.sources.set(h,q);l=c.C(()=>q.healthCheck(),h,olympe.host.ze.C.READINESS);n=c.F(()=>q.destroy(),`Datasource ${h}`);g.set(h,[l,n]);q.init(a)}});
|
|
550
|
-
olympe.dc.mv=class{constructor(a,b,c,d,e,f,g){this.H=a;this.C=f;this.G=g;this.sources=new Map;this.F=new Map;
|
|
551
|
-
return null!=(b=this.sources.get(a))?b:this.sources.get(olympe.dc.Sa.sf)}};function
|
|
552
|
-
function
|
|
553
|
-
olympe.dc.na=class{constructor(){}static C(a,b,...c){if(
|
|
554
|
-
olympe.dc.Pa.Entry=class{constructor(a,b,c){this.tag=a;this.F=b;this.
|
|
555
|
-
a)}la(a){return new olympe.dc.Pa.Property(a)}sa(a,b=olympe.dc.wa.DESTINATION){
|
|
556
|
-
olympe.dc.Pa.Relation.prototype.getInverse=olympe.dc.Pa.Relation.prototype.bc;olympe.dc.Pa.Relation.prototype.getDirection=olympe.dc.Pa.Relation.prototype.Ia;olympe.dc.Pa.Relation.prototype.getTag=olympe.dc.Pa.Relation.prototype.X;olympe.dc.Pa.Relation.ya=[olympe.dc.Ne];olympe.dc.db={};function
|
|
557
|
-
y===e?t.set(z,u):y===f?t.set(x,u):y===g?u.forEach((A,D)=>{k.Ma(z,D,r)}):y===h&&u.forEach((A,D)=>{k.Ma(z,r,D)})});l=l.source();k.$c(r,l,t)}else{const r=new Map;for(const t of l.Cb().keys()){var q=t[0]===f;const u=q?t.substring(1):t;q=q?
|
|
558
|
-
function
|
|
559
|
-
function
|
|
560
|
-
function
|
|
561
|
-
olympe.dc.db.at=class{constructor(a,b,c,d){this.H=a;this.J=b;this.ia=c;let e;this.T=null!=(e=d.get('debug'))?e:!1;let f;this.O=null!=(f=d.get('bufferTimeout'))?f:0;this.G=[];this.F=new Map;this.C=[];b.addEventListener(olympe.dc.db.Database.C.
|
|
562
|
-
d.F,c),b);this.F.delete(a)}}write(a,b){(new olympe.dc.db.nr(this.H,this.J,this.ia,this.T,b)).write(a)}};class
|
|
563
|
-
function
|
|
564
|
-
class
|
|
565
|
-
class
|
|
566
|
-
olympe.dc.db.Database=class a extends Map{constructor(b,c,d){super();let e;this.id=null!=(e=d.get('selfTag'))?e:olympe.dc.Sa.SELF;this.H=b;this.Tc=olympe.D.Wa();this.Z=olympe.dc.db.Database.G.IDLE;this.ea=new Map;this.Ub=[];this.O=[];this.ja=new Map;var f;b=null!=(f=d.get('garbageCollector'))?f:olympe.dc.db.kf.C.
|
|
567
|
-
c,d,e=!1){var f=this.G(b,!0);if(!f.e&&null!==c&&(null===f.G||f.G===c)){f.G=c;let g;(null==(g=f.model())?0:g.e)&&f.db.aa(f,!0)}e&&f.persist();d&&this.Cc(f,d);this.F(a.C.
|
|
568
|
-
break;case
|
|
569
|
-
{d(...c)})}F(b,c,...d){this.Ga(b,c,...d)}aa(b,c){this.ja.set(b,c)}Uh(b,c,d,e){let f;null!=(f=this.O[0])&&
|
|
570
|
-
a.G.IDLE&&(this.Z=a.G.Hs);this.O.unshift(new olympe.dc.db.pt(this,this.Tc))}Vd(){this.Z=a.G.ef;this.bs();
|
|
571
|
-
e.tag();d?
|
|
572
|
-
g&&null===g.model()&&this.H.error(`\n[DEBUG - DATABASE]\nInstance ${f} created but does not exist !\n${g.toString()}`)});d.clear();e.forEach((f,g)=>{const h=this.get(g);h&&this.H.error(`\n[DEBUG - DATABASE]\nThe model ${g} is extended by other models but does not exist !`+`\nExtension models: ${Array.from(f.values()).join(', ')}`+`\n\n ${h.toString()}`)});e.clear()})}};olympe.dc.db.Database.F={Ki:'$',It:'~',Me:'?',
|
|
573
|
-
olympe.dc.db.Database.C={
|
|
574
|
-
function
|
|
575
|
-
function
|
|
576
|
-
function
|
|
577
|
-
function V(a,b,c,d,e){a=a.C.G(olympe.dc.ga(b));c=c.Ia()+c.X();e=null!=e?e:
|
|
578
|
-
function
|
|
579
|
-
n]=void 0!==b.F?[b.F.tag,b.F.Ja]:null;b=a.C.get(l);k.push([b,n,null,!0])}return k}function
|
|
580
|
-
function
|
|
581
|
-
function
|
|
582
|
-
olympe.dc.lb=class{constructor(a,b){this.H=a;this.C=b}U(){return this.C.U()}F(a,b,c,d=!1){a=U(this,a);if(null!==a){b=b.Ia()+b.X();const e=
|
|
583
|
-
a,!0))&&a.Ve())?a.tag():null}ai(a){a=U(this,a,!0);return!(!a||!a.Ve())}Rb(a,b){a=(a=U(this,a,!0))&&a.model();return!(!a||!this.If(a.tag(),b))}source(a){return(a=U(this,a,!0))&&a.source()}Lf(a){a=U(this,a,!1);return!a||a.O}Oa(a,b,c){let d;a=null==(d=U(this,a,!0))?void 0:d.Oa(olympe.dc.ga(b),c);return void 0!==a?a:null}Cb(a,b=!1){var c=U(this,a,!0);a=new Map;if(c)for(const [d,e]of c)c=d[0],(c===
|
|
584
|
-
...d])=>[c.tag(),...d])}
|
|
585
|
-
U(this,a,!0);const d=b.Ia()+b.X();c=null==c?void 0:c.get(d);if(1<(null==c?void 0:c.size))return this.H.warn(`Relation ${b.X()} to instance ${a} is not unique: found ${c.size} related items`),null;a=null==c?void 0:c.values().next().value;return(null==a?0:a.Ha())?a.tag():null}Vg(a,b,c){a=olympe.dc.ga(a);const d=
|
|
586
|
-
a,b);const d=[olympe.dc.ga(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}
|
|
587
|
-
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}).`);return e.map(f=>f.tag())}If(a,b){const c=olympe.dc.ga(b);return!!this.Gr(a,olympe.dc.CloudObject.extendRel,d=>d===c)}ad(a){return this.
|
|
588
|
-
olympe.dc.lb.prototype.getExtendedModels=olympe.dc.lb.prototype.Mr;olympe.dc.lb.prototype.findAllRelated=olympe.dc.lb.prototype.Pw;olympe.dc.lb.prototype.findRelated=olympe.dc.lb.prototype.
|
|
589
|
-
olympe.dc.lb.prototype.getRelated=olympe.dc.lb.prototype.
|
|
590
|
-
olympe.dc.lb.prototype.name=olympe.dc.lb.prototype.name;olympe.dc.lb.prototype.exist=olympe.dc.lb.prototype.Ha;const
|
|
591
|
-
function
|
|
592
|
-
function
|
|
593
|
-
function
|
|
594
|
-
olympe.dc.db.kf=class{constructor(a,b,c,d){this.H=a;this.C=b;this.F=new Set;this.mode=c;this.delay=d;this.G=!1;c!==olympe.dc.db.kf.C.
|
|
595
|
-
c=olympe.dc.db.Database.C.sq,d=olympe.dc.db.Database.G.IDLE,e=f=>{this.F.add(f);this.C.getState()===d&&
|
|
596
|
-
l?a.Ma(h,f,k,g,e.Vb()):a.
|
|
597
|
-
e).Fb(a,b)}
|
|
598
|
-
b=olympe.dc.Nb.NONE){a=this.
|
|
599
|
-
b)}aa(a,b){const c=olympe.dc.wa.ORIGIN,d=olympe.dc.wa.DESTINATION,e=this.C.get(a);for(const [g,h,k]of e.yd())if(k||!b){e.O(g,d,h);var f=this.C.get(h);f&&f.O(g,c,a)}for(const [g,h,k]of e.hb())if(k||!b)e.O(g,c,h),(f=this.C.get(h))&&f.O(g,d,a)}*Rr(a){let b;for(const [c,d]of(null==(b=this.Lc(a))?void 0:b.
|
|
600
|
-
const h=new Set;for(const l of a){var k=this.C.get(l);if(void 0!==k){for(const [n,p,q]of k.yd())q&&
|
|
601
|
-
olympe.dc.wa.DESTINATION;for(const [c,d]of this.ja(a))if(a=c.tag(),d.zd())this.G(a,d.J());else if(c.zd())d.F()&&this.G(a,c.J());else{c.Cb().forEach((e,f)=>{void 0!==d.Oa(f)&&c.ea(f)});for(const [e,f,g]of c.yd()){const h=d.yb(e,b,f);void 0!==h&&g!==h&&this.T(e,a,f)}}return this}*ja(a){var b=this.C;const c=a.C,d=(a=a.O()>this.O())?c:b;b=a?b:c;for(const [e,f]of b)b=d.get(e),void 0!==b&&(yield[a?f:b,a?b:f])}};olympe.dc.db.tc.ya=[olympe.dc.Writable,olympe.dc.Xu];const
|
|
602
|
-
function
|
|
603
|
-
function
|
|
604
|
-
function
|
|
605
|
-
function
|
|
606
|
-
function
|
|
607
|
-
function
|
|
608
|
-
function
|
|
609
|
-
function
|
|
610
|
-
function
|
|
611
|
-
olympe.dc.db.Instance=class extends Map{constructor(a,b){super();this.C=a;this.G=null;this.e=!1;this.F=void 0;this.c=0;this.O=!1;this.db=b}tag(){return this.C}Ha(){return this.e}J(){return this.db.J(this.C)}source(){return this.G}model(){const a=this.get(X+
|
|
612
|
-
var b=this.model();if(b){var c=b.Oa(olympe.dc.CloudObject.nameProp.X())||'No model name';a+=`\nModel: ${b.C}, Exist: ${b.e}, Model name: ${c}`}else a+='\nModel: no model';(b=this.Ve())?(c=b.Oa(olympe.dc.CloudObject.nameProp.X())||'No extension name',a+=`\nExtension: ${b.C}, Exist: ${b.e}, Extension name: ${c}`):a+='\nExtension: no extension';return a}Oa(a,b=!1){const c=this.get(
|
|
613
|
-
a,d,b,!1),d=
|
|
614
|
-
a,X,b.C),this.db.F(
|
|
615
|
-
b?b:null;return this}delete(b=olympe.dc.Nb.NONE){this.G=a.C.Dc;this.Ob=b;this.properties=null;return this}la(b,c){if(this.G===a.C.Dc)return this;this.properties||(this.properties=new Map);this.properties.set(b,c);return this}
|
|
616
|
-
(c=this.properties)||c.delete(b);0===this.properties.size&&(this.properties=null)}link(b,c){null===this.pb&&(this.pb=new Map);b===olympe.dc.
|
|
617
|
-
b.get(d)}O(b,c,d){const e=(c=c===olympe.dc.wa.ORIGIN?this.C:this.pb)&&c.get(b);e&&e.delete(d);e&&0===e.size&&c.delete(b)}F(){return this.G===a.C.
|
|
618
|
-
d&&d.get(b.X()))for(const [e,f]of d)yield c(e,f)}(b.Ia()===olympe.dc.wa.ORIGIN?this.C:this.pb)}Kb(b){const c=b.Ia()===olympe.dc.wa.ORIGIN?this.C:this.pb;return(b=c&&c.get(b.X()))&&0!==b.size?Array.from(b.keys())[0]:null}yd(b=(c,d,e)=>[c,d,e]){return this.
|
|
619
|
-
this.pb,this.C)}sa(b,c,d,e){if(this.G!==a.C.Dc||!e){var f=b.get(c);if(void 0===f)f=new Map,b.set(c,f);else if(b=f.get(d),void 0!==b&&b!==e){f.delete(d);return}f.set(d,e)}}*
|
|
620
|
-
' (name: '+c.get(e)+') has no model.\nList: '+d.join(' --M--\x3e ')}this.H.info(a)}else this.H.info('[DATABASE] Instance',b,'has never been created or referred by the database')}init(){const a=olympe.dc.db.Database.C.
|
|
621
|
-
k,h,`monitorRelations${k}`)})});this.C.C(c,k=>{this.C.yb(()=>{
|
|
622
|
-
function
|
|
623
|
-
(null!=(g=c)?g:0)+1)}return'{'+(d?d:'')+'}'}function
|
|
624
|
-
class
|
|
625
|
-
|
|
626
|
-
olympe.W.config(function(a){F(a,olympe.dc.db.V.
|
|
627
|
-
(b,c,d,e,f,g,h)=>{e=g?olympe.dc.db.kf.C.
|
|
628
|
-
new olympe.W.oa(olympe.dc.db.V.Eu)],(b,c,d,e,f,g,h,k)=>{g=(new Map).set('active',g).set('counters',h).set('callbacks',k);e=(new Map).set('debug',e).set('bufferTimeout',f);return new olympe.dc.db.lt(b,c,d,e,g)})},'olympe.dc.db');olympe.W.run([olympe.dc.db.R.
|
|
629
|
-
olympe.dc.query.gf=class{constructor(a,b,c){this.db=olympe.dc.ia();this.C=a;this.Ja=b;this.Ai=c}ha(){return{p:this.Ja.X(),o:this.Ai}}toString(){return'sortByQueryPart-'+this.Ai+this.Ja.X()}Rg(){const a=this.db.Kb(this.Ja,olympe.dm.Property.typeRel),b=olympe.dc.ga;if(this.db.If(a,olympe.dm.String))return
|
|
630
|
-
d)=>c.compare(d));olympe.ka.ab('dc.query').warn(`No comparator found for type with tag ${a}`);return
|
|
631
|
-
olympe.dc.query.Ku=class{constructor(a,b,c,d){this.H=a;this.source=b;this.F=c;this.J=d;this.C=this.G=null;this.db=olympe.dc.ia()}watch(a,b){if(this.db.source(a)===this.source){var c=`${this.F}:${a}:notif`;
|
|
547
|
+
this.G.set(d,b);const e=a.C(d);hf(this.db,d,f=>{f||(this.G.delete(d),ff(this.db,d,e))},e)}static C(b){return`cacheBinary${b}`}};function jf(a,b){let c=kf(b),d=null;for(;!c&&b&&b!==d;){d=b;b=a.db.Ve(b);if(null===b)break;c=kf(b)}let e;return null!=(e=c)?e:null}olympe.dc.Nt=class{constructor(a,b,c){this.H=a;this.C=b;this.db=b.view;this.F=c;this.Pa=new FinalizationRegistry(d=>{this.H.J()&&this.H.debug(`Collect instance ${d} (${this.db.name(d)||'no name'})`);this.C.C.Fb([d])})}};function lf(a,b){a.origin=b;return a}function mf(a,b,c){a.F.set(b,c);return a}function nf(a){let b;return null!=(b=a.F)?b:new Map}olympe.dc.Request=class{constructor(a,b,c,d){this.type=a;this.origin=olympe.dc.Sa.SELF;this.C=b;this.content=null!=c?c:null;this.G=null!=d?d:id(olympe.auth.je()).me();this.F=new Map}getType(){return this.type}Bc(){return this.G}ic(){return this.C}toString(){return`Request of type ${this.type}, from ${this.origin} to ${this.C}; content: ${this.content}`}};
|
|
548
|
+
olympe.dc.Request.C={Hb:1,tg:10,vt:24,Yo:25,wt:28,Bg:30,Zj:31,FB:32,Ue:40,Mg:41,In:42,yq:43,UC:44,ii:45,Kn:46,Kj:47,ag:50,Tf:51,rg:52,Sv:60,gv:61,To:62,IA:63,Ts:64,fh:65,ko:91,xt:93,Nl:95,QUERY_RESULT:97};function of(a,b,c,d,e){const f=olympe.D.Sg();a.sources.set(olympe.dc.Sa.SERVER,e.init(a));a.G?a.sources.set(olympe.dc.Sa.sf,d.init(a)):hf(b,a.C,()=>{a.sources.set(olympe.dc.Sa.sf,d.init(a));const g=new Map;olympe.dc.pa.from(a.C,a.C).ib(olympe.dm.DataSource.mj).filter(olympe.dc.query.Ba.Fa(olympe.dm.DataSource.Oh,!0)).observe(f).subscribe(h=>{var k=pf(h);for(var l of k){const [p,q]=g.get(l);c.G(p);c.O(q);k=a.sources.get(l);a.sources.delete(l);var n=void 0;null==(n=k)||n.destroy()}h=qf(h);for(const p of h)if(h=
|
|
549
|
+
p.X(),!a.sources.has(h)){const q=new olympe.dc.sources.Dp(a.H,p);a.sources.set(h,q);l=c.C(()=>q.healthCheck(),h,olympe.host.ze.C.READINESS);n=c.F(()=>q.destroy(),`Datasource ${h}`);g.set(h,[l,n]);q.init(a)}});ff(b,a.C,'router',!0)},'router')}function rf(a,b,c){let d=a.F.get(b);void 0===d&&(d=[],a.F.set(b,d));d.push(c)}
|
|
550
|
+
olympe.dc.mv=class{constructor(a,b,c,d,e,f,g){this.H=a;this.C=f;this.G=g;this.sources=new Map;this.F=new Map;of(this,d,e,b,c)}request(a){this.H.debug('Router: sends',a);return this.tb(a.ic()).request(a)}subscribe(a,b){this.H.debug('Router: subscribes',a);return this.tb(a.ic()).subscribe(a,b)}qd(a){const b=a.ic();if(b===this.C){let c;null==(c=this.F.get(a.getType()))||c.forEach(d=>d(a))}else olympe.N.wb.publish(b,a).catch(c=>{this.H.error(`Error while publishing the message ${a} to remote router: ${c}`)})}tb(a){let b;
|
|
551
|
+
return null!=(b=this.sources.get(a))?b:this.sources.get(olympe.dc.Sa.sf)}};function gf(a,b){return new olympe.dc.kh(a,null!=b?b:null)}function sf(a,b){a=(new olympe.dc.transaction.zh(b)).C(a);return new olympe.dc.kh(a,null)}olympe.dc.kh=class{constructor(a,b){this.C=a;this.F=b}U(){return this.C.U()}qc(){return this.C}static C(a){const b=(new olympe.dc.transaction.zh).C(a.p);return new olympe.dc.kh(b,a.t)}ha(){const a=new olympe.dc.transaction.qf;this.C.Jc(a);return{p:tf(a),t:this.F}}};olympe.dc.Pa={};const uf=olympe.dc.wa.ORIGIN,vf=olympe.dc.wa.DESTINATION,wf=new Map,xf=new Map,yf=new Map,zf=new Map;function kf(a){let b;return null!=(b=wf.get(a))?b:null}function Af(a,b,c){let d=a;'function'===typeof a&&(d=c.entry);a=[...(d.pn||[])];return olympe.dc.na.C(b,c,...a)}function Bf(a,b){zf.set(a,b);return a}function Cf(a){let b,c;return null!=(c=null==(b=wf.get(a))?void 0:b.F)?c:olympe.dc.CloudObject}
|
|
552
|
+
function Df(a,b,c){const d=a+'@'+(b===vf?uf:vf);if(xf.has(d))throw Error(`Try to register the same relation (${b+a}) multiple times.`);xf.set(d,c)}function Ef(a){a=a.X()+'@'+a.Ia();return xf.get(a)||olympe.dc.CloudObject}function R(a,b){b.NAME=a;yf.set(a,b)}function S(a){let b;return null!=(b=a.NAME)?b:null}
|
|
553
|
+
olympe.dc.na=class{constructor(){}static C(a,b,...c){if(wf.has(a))throw Error(`Tag: ${a} - overwriting already defined CloudObject class ${wf.get(a).F.name} with ${b.name}`);let d=null;const e=c.length;if(0<e){d=Array(e);for(let f=0;f<e;f++){let g=c[f];d[f]='string'===typeof g?new olympe.W.wb(g):g}}b=new olympe.dc.Pa.Entry(a,b,d);wf.set(a,b);return b.F.entry=b}static cc(a){let b,c;return null!=(c=null==(b=a.entry)?void 0:b.X())?c:null}};function Ff(a,b){a.C=b}function T(a,b){b=b.bc();Df(b.X(),b.Ia(),a.F);return b}function Gf(a){a.G=!0;return a}
|
|
554
|
+
olympe.dc.Pa.Entry=class{constructor(a,b,c){this.tag=a;this.F=b;this.pn=c||null;this.C=null;this.G=!1}X(){return this.tag}instantiate(a,b){const c=this.F;if(this.Ym()&&b.getParameter(olympe.dc.V.Do)){var d=olympe.dc.ia();d=`Trying to instantiate an abstract class ${d.name(this)} (${this.X()}).`+` This may happen when the implementation of another class extending ${d.name(this)} has not been registered`;olympe.ka.ab('dc').error(d)}return this.pn?(a=[void 0,a].concat(Ga(b,this.pn)),new c(...a)):new c(void 0,
|
|
555
|
+
a)}la(a){return new olympe.dc.Pa.Property(a)}sa(a,b=olympe.dc.wa.DESTINATION){Df(a,b,this.F);return new olympe.dc.da.Qe(a,b)}Ym(){return this.G}};w('olympe.dc.registry.Entry',olympe.dc.Pa.Entry);olympe.dc.Pa.Entry.prototype.addRelation=olympe.dc.Pa.Entry.prototype.sa;olympe.dc.Pa.Entry.prototype.addProperty=olympe.dc.Pa.Entry.prototype.la;olympe.dc.Pa.Entry.ya=[olympe.dc.Ne];olympe.dc.Pa.Property=class{constructor(a){this.tag=a}X(){return this.tag}toString(){return`Property: ${this.tag}`}};olympe.dc.Pa.Property.prototype.getTag=olympe.dc.Pa.Property.prototype.X;olympe.dc.Pa.Property.ya=[olympe.dc.Ne];olympe.dc.Pa.Relation=class{constructor(a,b=olympe.dc.wa.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.CloudObject){this.tag=olympe.dc.ga(a);this.direction=b;this.origin=c;this.J=d}X(){return this.tag}Ia(){return this.direction}type(){return this.J}bc(){return new olympe.dc.Pa.Relation(this.tag,this.direction===olympe.dc.wa.DESTINATION?olympe.dc.wa.ORIGIN:olympe.dc.wa.DESTINATION,this.J,this.origin)}Fa(a){return a instanceof olympe.dc.Pa.Relation?a.X()===this.X()&&a.Ia()===this.Ia():!1}toString(){return`${this.direction}${olympe.dc.ia().name(this.tag)} (${this.tag})`}};
|
|
556
|
+
olympe.dc.Pa.Relation.prototype.getInverse=olympe.dc.Pa.Relation.prototype.bc;olympe.dc.Pa.Relation.prototype.getDirection=olympe.dc.Pa.Relation.prototype.Ia;olympe.dc.Pa.Relation.prototype.getTag=olympe.dc.Pa.Relation.prototype.X;olympe.dc.Pa.Relation.ya=[olympe.dc.Ne];olympe.dc.db={};function Hf(a,b){const c=a.J,d=olympe.dc.ia(),e=olympe.dc.db.Database.F.Ki,f=olympe.dc.db.Database.F.Me,g=olympe.dc.db.Database.F.ORIGIN,h=olympe.dc.db.Database.F.DESTINATION,k=new olympe.dc.db.tc('rev-'+b.U());a.H.debug('Generate the reverse graphLayer of',b.U());b.C.forEach((l,n)=>{if(l.F()){k.F(n,olympe.dc.Nb.NONE);for(const [r,t]of l.yd())k.hc(r,n,t)}else{var p=c.get(n);if(void 0!==p)if(l.zd())for(const r of If(d,n,l.J())){l=c.get(r);const t=new Map;l.forEach((u,x)=>{const y=x[0],z=x.substring(1);
|
|
557
|
+
y===e?t.set(z,u):y===f?t.set(x,u):y===g?u.forEach((A,D)=>{k.Ma(z,D,r)}):y===h&&u.forEach((A,D)=>{k.Ma(z,r,D)})});l=l.source();k.$c(r,l,t)}else{const r=new Map;for(const t of l.Cb().keys()){var q=t[0]===f;const u=q?t.substring(1):t;q=q?Jf(p,u,!0):p.Oa(u,!0);let x;r.set(t,null!=(x=q)?x:null)}0<r.size&&k.Qc(n,r);for(const [t,u,x]of l.yd())x?k.hc(t,n,u):k.Ma(t,n,u)}}});return k}
|
|
558
|
+
function Kf(a,b,c){const d=b.U();if(a.F.has(d))throw Error(`You try to execute the patch ${d} a second times whereas the first execution has not been validated yet.`);const e=new Lf(b,Hf(a,b));a.G.unshift(d);a.F.set(d,e);a.J.$r(c);a.write(b,!1)}
|
|
559
|
+
function Mf(a,b,c){if(0>=a.O||null===c)return b;var d=a.C.findIndex(h=>h.U()===b.U()),e=a.C[d];-1<d&&a.C.splice(d,1);d=0<a.C.length?a.C.findIndex(h=>c>=h.F):0;d=-1<d?d:a.C.length;const f=a.C.slice(0,d).reduce((h,k)=>k.xc(h),b);let g;e=null!=(g=null==e?void 0:e.update(f,c))?g:new Nf(f,c,a.C,a.O);a.C.splice(d,0,e);a.H.J()&&a.H.debug('CommitController buffer:\n',a.C.map(h=>`${h.U()} at ${h.F}`).join('\n'));return f}
|
|
560
|
+
function Of(a,b,c){return a.G.slice(0,c).map(d=>a.F.get(d)).reduce((d,e)=>{let f;return null!=(f=null==e?void 0:e.xc(d))?f:d},b)}
|
|
561
|
+
olympe.dc.db.at=class{constructor(a,b,c,d){this.H=a;this.J=b;this.ia=c;let e;this.T=null!=(e=d.get('debug'))?e:!1;let f;this.O=null!=(f=d.get('bufferTimeout'))?f:0;this.G=[];this.F=new Map;this.C=[];b.addEventListener(olympe.dc.db.Database.C.Qo,g=>{this.C.forEach(h=>{for(const k of g)h.C.G(k)})})}xc(a,b){const c=a.U();this.F.has(c)?this.push(c,b):(a=Mf(this,Of(this,a,this.G.length),b),this.write(a,!0))}push(a,b){const c=this.G.indexOf(a);if(-1<c){const d=this.F.get(a);this.G.splice(c,1);Mf(this,Of(this,
|
|
562
|
+
d.F,c),b);this.F.delete(a)}}write(a,b){(new olympe.dc.db.nr(this.H,this.J,this.ia,this.T,b)).write(a)}};class Pf{U(){}xc(){}}function Qf(a,b,c,d){const e=olympe.dc.wa.DESTINATION;c=c.tag();const f=a.C.Lc(c);b.Cb().forEach((g,h)=>{f.la(h,g);b.ea(h)});for(const [g,h,k,l]of b.ja()){if(!l)continue;const n=h===e?c:k,p=h===e?k:c;a.C.Ma(g,n,p);d.T(g,n,p)}}
|
|
563
|
+
function Rf(a,b,c,d){const e=olympe.dc.wa.DESTINATION,f=c.tag(),g=a.C.Lc(f);b.Cb().forEach((h,k)=>{void 0!==c.Oa(k)&&(g.la(k,h),b.ea(k))});for(const [h,k,l]of b.yd()){const n=c.yb(h,e,k);void 0!==n&&(d.T(h,f,k),n===l&&a.C.T(h,f,k))}}
|
|
564
|
+
class Lf extends Pf{constructor(a,b){super();this.F=a;this.C=b;this.db=olympe.dc.ia()}U(){return this.F.U()}xc(a){for(const [b,c]of this.F.ja(a)){const d=b.tag();c.zd()?b.F()?a.G(d,b.J()):(this.F.G(d,c.J()),this.C.G(d,c.J())):b.zd()?(Qf(this,c,b,a),a.G(d,b.J())):Rf(this,c,b,a)}return a}}function Sf(a){clearTimeout(a.G);a.G=setTimeout(()=>{a.buffer.splice(a.buffer.indexOf(a),1)},a.J)}
|
|
565
|
+
class Nf extends Pf{constructor(a,b,c,d){super();this.C=a;this.F=b;this.buffer=c;this.J=d;this.G=null;Sf(this)}U(){return this.C.U()}xc(a){return a.Z(this.C)}update(a,b){this.F=b;a.Jc(this.C);Sf(this);return this}};const Tf=olympe.dc.mc.Yc,Uf=olympe.dc.mc.ni,Vf=olympe.dc.wa.ORIGIN,Wf=olympe.dc.wa.DESTINATION;
|
|
566
|
+
olympe.dc.db.Database=class a extends Map{constructor(b,c,d){super();let e;this.id=null!=(e=d.get('selfTag'))?e:olympe.dc.Sa.SELF;this.H=b;this.Tc=olympe.D.Wa();this.Z=olympe.dc.db.Database.G.IDLE;this.ea=new Map;this.Ub=[];this.O=[];this.ja=new Map;var f;b=null!=(f=d.get('garbageCollector'))?f:olympe.dc.db.kf.C.ol;let g;f=null!=(g=d.get('garbageCollectorDelay'))?g:5E3;this.Uc=new olympe.dc.db.kf(c,this,b,f);d.get('debug')&&this.Gk()}U(){return this.id}getState(){return this.Z}ab(){return this.H}create(b,
|
|
567
|
+
c,d,e=!1){var f=this.G(b,!0);if(!f.e&&null!==c&&(null===f.G||f.G===c)){f.G=c;let g;(null==(g=f.model())?0:g.e)&&f.db.aa(f,!0)}e&&f.persist();d&&this.Cc(f,d);this.F(a.C.mp,b)}update(b,c){c&&(b=this.G(b,!0),this.Cc(b,c))}va(b){const c=this.get(b);void 0!==c&&(this.aa(c,!1),this.F(a.C.np,b))}link(b,c,d){c=this.G(c,!0);d=this.G(d,!0);switch(b){case Tf:Xf(c,d);break;case Uf:Yf(c,d);break;default:c.link(b,d)}}unlink(b,c,d){c=this.get(c);d=this.get(d);if(void 0!==c&&void 0!==d)switch(b){case Tf:Zf(c,d);
|
|
568
|
+
break;case Uf:$f(c,d);break;default:c.unlink(b,d)}}hb(b){for(const c of b)ag(this.G(c))}Fb(b){for(const c of b)(b=this.get(c))&&bg(b)}$r(b){b.forEach(c=>{this.G(c).persist()})}Ud(b){const c=this.get(b);void 0!==c&&(c.clear(),super.delete(b),this.F(a.C.Bo,b))}G(b,c=!1){let d=this.get(b);void 0===d&&(d=new olympe.dc.db.Instance(b,this),this.set(b,d),this.F(a.C.Ao,b),c&&this.F(a.C.vm,b));return d}yb(b){cg(this.O[0],olympe.Y.Vh(),b)}T(b){this.O[0].C.delete(b)}Ga(b,...c){this.ea.has(b)&&this.ea.get(b).forEach(d=>
|
|
569
|
+
{d(...c)})}F(b,c,...d){this.Ga(b,c,...d)}aa(b,c){this.ja.set(b,c)}Uh(b,c,d,e){let f;null!=(f=this.O[0])&&dg(f,b).la(e?eg+c:c,d)}$h(b,c,d,e,f){let g;null!=(g=this.O[0])&&(d===fg?f?dg(g,b).link(c,e):dg(g,b).unlink(c,e):f?dg(g,b).Fb(c,e):dg(g,b).Ub(c,e))}ac(b,c,d){let e;null!=(e=this.O[0])&&dg(e,b).Uc(c,d)}addEventListener(b,c){let d=this.ea.get(b);void 0===d&&(d=[],this.ea.set(b,d));d.push(c)}C(b,c){this.addEventListener(b,c)}eb(b){this.Ub.push(b)}J(b){return this.O.reduce((c,d)=>d.O.has(b)||c,!1)}Bf(){this.Z===
|
|
570
|
+
a.G.IDLE&&(this.Z=a.G.Hs);this.O.unshift(new olympe.dc.db.pt(this,this.Tc))}Vd(){this.Z=a.G.ef;this.bs();gg(this.O[0]);this.O.shift();0===this.O.length&&(this.Z=a.G.IDLE,this.Ub.forEach(b=>{b()}),hg(this.Uc))}Cc(b,c){const d=a.F.Me;for(const [e,f]of c)void 0!==f&&(e[0]===d?ig(b,e.substring(1),f):b.update(e,f))}bs(){const b=this.O[0];for(const [c,d]of this.ja)this.oc(new Set,c).filter(e=>{var f=d;const g=e.e!==f;g&&(f?(e.e=f,jg(e)):(kg(e),e.e=f),e.db.F(f?lg.ql:lg.Dc,e.C));return g}).forEach(e=>{e=
|
|
571
|
+
e.tag();d?dg(b,e).create():dg(b,e).delete()});this.ja.clear()}oc(b,c,d=[]){const e=c.tag();if(!b.has(e)&&(b.add(e),d.push(c),c=c.get(Vf+Tf)))for(const f of c.values())null!==f.source()&&this.oc(b,f,d);return d}Gk(){const b=a.C.ql,c=a.C.ak,d=new Set,e=new Map;this.C(a.C.mp,f=>{d.add(f)});this.C(b,f=>{d.delete(f);e.delete(f)});this.C(c,(f,...g)=>{if(g[0]===Uf&&g[1]===Wf){const h=g[2];this.get(h).Ha()||(g=e.get(h)||new Set,0===g.size&&e.set(h,g),g.add(f))}});this.eb(()=>{d.forEach(f=>{const g=this.get(f);
|
|
572
|
+
g&&null===g.model()&&this.H.error(`\n[DEBUG - DATABASE]\nInstance ${f} created but does not exist !\n${g.toString()}`)});d.clear();e.forEach((f,g)=>{const h=this.get(g);h&&this.H.error(`\n[DEBUG - DATABASE]\nThe model ${g} is extended by other models but does not exist !`+`\nExtension models: ${Array.from(f.values()).join(', ')}`+`\n\n ${h.toString()}`)});e.clear()})}};olympe.dc.db.Database.F={Ki:'$',It:'~',Me:'?',Sk:'=',kp:'|',cl:'@',ORIGIN:olympe.dc.wa.ORIGIN,DESTINATION:olympe.dc.wa.DESTINATION};
|
|
573
|
+
olympe.dc.db.Database.C={Ao:0,Bo:1,dr:2,vm:3,Un:4,Vn:5,ql:6,Dc:7,ak:8,em:9,mp:10,np:11,sq:12,Ez:13,Dz:14,Nv:15,Qo:16};olympe.dc.db.Database.G={IDLE:0,Hs:1,ef:2};function mg(a,b,c=[]){const d=b.U();Kf(a.F,b,c);return e=>{if(null!==e)a.F.push(d,e);else{e=a.F;var f=e.F.get(d);if(void 0!==f){const g=e.G.indexOf(d);e.G.splice(g,1);f=Of(e,f.C,e.G.length);e.write(Mf(e,f,Date.now()),!1);e.F.delete(d)}}}}function ng(a,b){a.C.eb(b)}olympe.dc.db.lt=class{constructor(a,b,c,d,e){this.H=a;this.C=b;this.view=c;this.F=new olympe.dc.db.at(a,b,c,d);this.wy=new olympe.dc.db.Gu(a,c,b,e)}ab(){return this.H}xc(a){this.F.xc(a.qc(),a.F)}};const og=olympe.dc.db.Database.F.ORIGIN,pg=olympe.dc.db.Database.F.DESTINATION,qg=olympe.dc.db.Database.F.Ki,rg=olympe.dc.db.Database.F.Me,sg=olympe.dc.db.Database.F.Sk,tg=olympe.dc.db.Database.F.kp,ug=og+pg,vg=qg+qg,wg=olympe.dc.db.Database.G;let xg=0;function ff(a,b,c,d=!1){const e=U(a,b);if(null!==e){const f=yg(e,'',c);void 0!==f&&(a.C.getState()!==wg.ef||e.J()&&!d||a.C.T(c),d||!e.Ha()&&!e.J()||f(!1,b))}}
|
|
574
|
+
function hf(a,b,c,d){a=a.C.G(olympe.dc.ga(b));d=null!=d?d:zg();Ag(a,'',d,c)&&a.Ha()&&c(!0,b);return d}function If(a,b,c){return{[Symbol.iterator]:function*(d,e,f){const g=(new Set).add(olympe.dc.ga(e));for(const h of g)yield h,d.Ak(h,f).forEach(([k,,,l])=>{l&&g.add(k)})}.bind(null,a,b,c)}}function zg(){++xg;return String(xg)}
|
|
575
|
+
function Bg(a,b,c,d,e){a=a.C.G(olympe.dc.ga(b));c=olympe.dc.ga(c);b=qg+c;e=null!=e?e:zg();if(Ag(a,b,e,d)&&a.Ha()){let f=!1;b=a.get(b);void 0===b&&(f=!0,b=a.get(sg+c));void 0!==b&&d(b,f)}return e}function U(a,b,c=!1){if(b)return a=a.C.get(olympe.dc.ga(b)),!a||c&&!a.Ha()?null:a;throw Error('DBView: Impossible to get instance, provided tag is null or undefined.');}function Cg(a,b,c,d){b=U(a,b);null!==b&&(c=olympe.dc.ga(c),yg(b,qg+c,d),a.C.getState()===wg.ef&&a.C.T(d))}
|
|
576
|
+
function Dg(a,b,c,d){a=a.C.G(olympe.dc.ga(b));d=null!=d?d:zg();Ag(a,vg,d,c)&&a.Ha()&&a.forEach((e,f)=>{const g=f[0];g!==qg&&g!==sg||c(f.substring(1),e,g===sg)});return d}function Eg(a,b,c){b=U(a,b);null!==b&&(yg(b,vg,c),a.C.getState()===wg.ef&&a.C.T(c))}function Fg(a,b,c,d,e){let f;null==(f=a.get(b))||f.forEach((g,h)=>{if(g.Ha()||!c&&g.J())e?d(b.substring(1),b[0],c,h):d(c,h)})}
|
|
577
|
+
function V(a,b,c,d,e){a=a.C.G(olympe.dc.ga(b));c=c.Ia()+c.X();e=null!=e?e:zg();(d=Gg(a,c,e,d))&&a.Ha()&&Fg(a,c,!0,d,!1);return e}function Hg(a,b,c,d){const e=a.C.G(olympe.dc.ga(b));a=null!=d?d:zg();const f=Gg(e,ug,a,c);f&&e.Ha()&&e.forEach((g,h)=>{g=h[0];g!==og&&g!==pg||Fg(e,h,!0,f,!0)})}function Ig(a,b,c){const d=U(a,b);if(null!==d){const e=yg(d,ug,c);void 0!==e&&(a.C.getState()!==wg.ef||d.J()||a.C.T(c),!d.Ha()&&!d.J()||d.forEach((f,g)=>{f=g[0];(f===og||f===pg)&&e&&Fg(d,g,!1,e,!0)}))}}
|
|
578
|
+
function Jg(a,b,c){b=U(a,b,!1);if(!b||c===olympe.dc.Nb.NONE)return[];const d=olympe.dm.Relation.C.gm,e=olympe.dm.Relation.C.jv,f=olympe.dm.Relation.C.tm,g=olympe.dm.Relation.C.tq,h=c[0]===olympe.dc.Oe.qh,k=[];b.forEach((l,n)=>{const p=n[0];if(!h&&l instanceof olympe.dc.uc&&(p===qg||p===rg))(l=a.C.get(l.X()))&&k.push([l,n.substring(1),null,!0]);else if(p===og||p===pg){const q=n.substring(1),r=Kg(a,q,c),t=p===og?d|e:f|g;t&r&&l.forEach(u=>{k.push([u,q,p,!!(t&10&r)])})}});if(h&&void 0!==b.F){const [l,
|
|
579
|
+
n]=void 0!==b.F?[b.F.tag,b.F.Ja]:null;b=a.C.get(l);k.push([b,n,null,!0])}return k}function Lg(a,b,c,d,e){const f=a.C.G(olympe.dc.ga(b));e=null!=e?e:zg();const g=Gg(f,tg+c,e,d);g&&f.Ha()&&Jg(a,b,c).forEach(([h,...k])=>{h.Ha()&&g(...k,!0,h.tag())})}function Mg(a,b,c,d){const e=U(a,b);if(null!==e){const f=yg(e,tg+c,d);void 0!==f&&(a.C.getState()!==wg.ef||e.J()||a.C.T(d),!e.Ha()&&!e.J()||Jg(a,b,c).forEach(([g,...h])=>{(g.Ha()||g.J())&&f(...h,!1,g.tag())}))}}
|
|
580
|
+
function Ng(a,b){a=U(a,b,!0);b=new Map;if(a)for(const [c,d]of a)c[0]===rg&&b.set(c.substring(1),d);return b}function Kg(a,b,c){if(c===olympe.dc.Nb.NONE)return 0;const d=c[0]===olympe.dc.Oe.qh;c=d?c.substring(1):c;a=a.Oa(b,c,!0)||0;return d?((a&3)<<2)+((a&12)>>2):a}function Og(a,b){return function*(c){if(c)for(const [d,e]of c)if(c=d[0],c===og||c===pg){const f=d.substring(1);for(const g of e.keys())yield[f,c,g]}}(U(a,b,!0))}
|
|
581
|
+
function Pg(a,b,c){if(!a.Ha(b))return a.H.warn(`No instance found with tag ${b}`),new Map;const d=new Map,e=[olympe.dc.ga(b)];for(const f of e){const g=a.bb(f,c);d.set(f,g);for(const h of g.filter(k=>!d.has(k)))e.push(h)}a.H.debug(`Found ${d.size} instances in sub-tree rooted at ${olympe.dc.ga(b)}`);return d}function Qg(a,b,c,d){return(c=(a=U(a,b,!0))&&a.get(d+c))?Array.from(c.values()).filter(e=>e.Ha()).length:0}
|
|
582
|
+
olympe.dc.lb=class{constructor(a,b){this.H=a;this.C=b}U(){return this.C.U()}F(a,b,c,d=!1){a=U(this,a);if(null!==a){b=b.Ia()+b.X();const e=yg(a,b,c);void 0!==e&&(this.C.getState()!==wg.ef||a.J()&&!d||this.C.T(c),d||!a.Ha()&&!a.J()||Fg(a,b,!1,e,!1))}}Ha(a){a=this.C.get(olympe.dc.ga(a));return!(null==a||!a.Ha())}name(a){let b,c;return null!=(c=null==(b=U(this,a))?void 0:b.Oa(olympe.dc.CloudObject.nameProp.X()))?c:''}model(a){return(a=(a=U(this,a,!0))?a.model():null)?a.tag():null}Ve(a){return(a=(a=U(this,
|
|
583
|
+
a,!0))&&a.Ve())?a.tag():null}ai(a){a=U(this,a,!0);return!(!a||!a.Ve())}Rb(a,b){a=(a=U(this,a,!0))&&a.model();return!(!a||!this.If(a.tag(),b))}source(a){return(a=U(this,a,!0))&&a.source()}Lf(a){a=U(this,a,!1);return!a||a.O}Oa(a,b,c){let d;a=null==(d=U(this,a,!0))?void 0:d.Oa(olympe.dc.ga(b),c);return void 0!==a?a:null}Cb(a,b=!1){var c=U(this,a,!0);a=new Map;if(c)for(const [d,e]of c)c=d[0],(c===qg||!b&&c===sg)&&a.set(d.substring(1),e);return a}Ak(a,b){return Jg(this,a,b).filter(([c])=>c.Ha()).map(([c,
|
|
584
|
+
...d])=>[c.tag(),...d])}bb(a,b){a=U(this,a,!0);b=b.Ia()+b.X();b=null==a?void 0:a.get(b);a=[];if(b)for(const c of b.values())c.Ha()&&a.push(c.tag());return a}Zr(a,b,c){let d,e;a=null==(d=U(this,a,!0))?void 0:null==(e=d.get(b.Ia()+b.X()))?void 0:e.get(olympe.dc.ga(c));return!(null==a||!a.Ha())}Um(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.Ia()+c.X()),void 0!==a)for(const e of a.values())e.Ha()&&b.push(e.tag());a=b}return a}Kb(a,b){var c=
|
|
585
|
+
U(this,a,!0);const d=b.Ia()+b.X();c=null==c?void 0:c.get(d);if(1<(null==c?void 0:c.size))return this.H.warn(`Relation ${b.X()} to instance ${a} is not unique: found ${c.size} related items`),null;a=null==c?void 0:c.values().next().value;return(null==a?0:a.Ha())?a.tag():null}Vg(a,b,c){a=olympe.dc.ga(a);const d=Pg(this,a,b);d.delete(a);return c?(c=olympe.dc.ga(c),d.has(c)?Array.from(Pg(this,c,b.bc()).keys()).filter(e=>d.has(e)):[]):Array.from(d.keys())}Gr(a,b,c){if(!this.Ha(a))return null;b=Pg(this,
|
|
586
|
+
a,b);const d=[olympe.dc.ga(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}Nm(a,b,c){return this.Um(a,b).find(c)||null}Pw(a,b,c){return this.Um(a,b).filter(c)}Mr(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.Ve();if(e.includes(c))throw Error(`Cycle detected when following recursively extend relations from base model instance "${a}".`);if(c&&!c.Ha())throw a=`Try to get all extensions of the model ${olympe.dc.ga(a)} but one of them does not exists (${c.tag()})`,
|
|
587
|
+
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}).`);return e.map(f=>f.tag())}If(a,b){const c=olympe.dc.ga(b);return!!this.Gr(a,olympe.dc.CloudObject.extendRel,d=>d===c)}ad(a){return this.bb(a,olympe.dc.CloudObject.instancesRel)}};olympe.dc.lb.prototype.getInstances=olympe.dc.lb.prototype.ad;olympe.dc.lb.prototype.isExtending=olympe.dc.lb.prototype.If;
|
|
588
|
+
olympe.dc.lb.prototype.getExtendedModels=olympe.dc.lb.prototype.Mr;olympe.dc.lb.prototype.findAllRelated=olympe.dc.lb.prototype.Pw;olympe.dc.lb.prototype.findRelated=olympe.dc.lb.prototype.Nm;olympe.dc.lb.prototype.findRecursive=olympe.dc.lb.prototype.Gr;olympe.dc.lb.prototype.getRecursiveRelated=olympe.dc.lb.prototype.Vg;olympe.dc.lb.prototype.getUniqueRelated=olympe.dc.lb.prototype.Kb;olympe.dc.lb.prototype.getMultiRelated=olympe.dc.lb.prototype.Um;olympe.dc.lb.prototype.isRelated=olympe.dc.lb.prototype.Zr;
|
|
589
|
+
olympe.dc.lb.prototype.getRelated=olympe.dc.lb.prototype.bb;olympe.dc.lb.prototype.getProperties=olympe.dc.lb.prototype.Cb;olympe.dc.lb.prototype.getProperty=olympe.dc.lb.prototype.Oa;olympe.dc.lb.prototype.isPersisted=olympe.dc.lb.prototype.Lf;olympe.dc.lb.prototype.instanceOf=olympe.dc.lb.prototype.Rb;olympe.dc.lb.prototype.isModel=olympe.dc.lb.prototype.ai;olympe.dc.lb.prototype.extension=olympe.dc.lb.prototype.Ve;olympe.dc.lb.prototype.model=olympe.dc.lb.prototype.model;
|
|
590
|
+
olympe.dc.lb.prototype.name=olympe.dc.lb.prototype.name;olympe.dc.lb.prototype.exist=olympe.dc.lb.prototype.Ha;const Rg=olympe.dc.db.Database.F.ORIGIN,fg=olympe.dc.db.Database.F.DESTINATION,eg=olympe.dc.db.Database.F.Sk,Sg=olympe.dc.db.Database.F.Ki,Tg=olympe.dc.db.Database.F.kp,Ug=olympe.dc.db.Database.F.cl,Vg=Rg+fg,Wg=Sg+Sg,Xg=Array.from(Object.values(olympe.dc.Nb)).filter(a=>null!==a);function cg(a,b,c){let d=a.C.get(b);void 0===d&&(d=[],a.C.set(b,d));a.buffer.push([b,d.length]);d.push(c)}
|
|
591
|
+
function gg(a){const b=a.J;a.F.forEach((c,d)=>{var e=b.get(d);if(c.F()||c.zd()){var f=e.get(Ug);f&&Yg(a,f,c.F(),d);c.zd()&&a.O.add(d)}for(const [n,p]of c.Cb()){var g=n[0]===eg,h=g?n.substring(1):n;f=a;var k=e,l=p;const q=k.get(Ug+Sg+h);q&&Yg(f,q,l,g);(k=k.get(Ug+Wg))&&Yg(f,k,h,l,g)}for(const n of c.ja())Zg(a,e,...n);(e=c.aa)&&$g(a,b.get(e),c.ac,!c.zd(),d)});a.F.clear();a.G.clear();ah(a)}function dg(a,b){let c=a.F.get(b);void 0===c&&(c=new olympe.dc.db.rh(b),a.F.set(b,c));return c}
|
|
592
|
+
function Yg(a,b,...c){b.forEach((d,e)=>{cg(a,e,d.bind(null,...c))})}function Zg(a,b,c,d,e,f){var g=b.get(Ug+d+c);g&&Yg(a,g,f,e);(g=b.get(Ug+Vg))&&Yg(a,g,c,d,f,e);bh(a,c,d).forEach((h,k)=>{(k=b.get(Ug+Tg+k))&&Yg(a,k,c,d,h,f,e)})}function $g(a,b,c,d,e){Xg.forEach(f=>{(f=b.get(Ug+Tg+f))&&Yg(a,f,c,null,!0,d,e)})}function ah(a){a.T.run(()=>{const b=a.C;for(const [c,d]of a.buffer){let e,f,g;null==(e=b.get(c))||null==(g=(f=e)[d])||g.call(f)}});a.C.clear();a.buffer.length=0}
|
|
593
|
+
function bh(a,b,c){const d=b+c;let e=a.G.get(d);if(!e){const f=a.J.get(b);e=new Map;Xg.forEach(g=>{const h=g[0]===olympe.dc.Oe.qh;var k=h?g.substring(1):g;let l;k=null!=(l=null==f?void 0:f.get(Sg+k))?l:0;k=h?((k&3)<<2)+((k&12)>>2):k;(c===Rg?12:3)&k&&e.set(g,!!((c===Rg?8:2)&k))});a.G.set(d,e)}return e}olympe.dc.db.pt=class{constructor(a,b){this.J=a;this.T=b;this.F=new Map;this.O=new Set;this.C=new Map;this.G=new Map;this.buffer=[]}};function hg(a){if(!a.G&&0<a.F.size)switch(a.mode){case olympe.dc.db.kf.C.wn:a.G=!0;setTimeout(()=>a.run(),a.delay);break;case olympe.dc.db.kf.C.Bv:a.G=!0,a.run()}}
|
|
594
|
+
olympe.dc.db.kf=class{constructor(a,b,c,d){this.H=a;this.C=b;this.F=new Set;this.mode=c;this.delay=d;this.G=!1;c!==olympe.dc.db.kf.C.ol&&this.init()}run(){const a=this.C;this.H.debug('Start garbage collector with',this.F.size,'instances to check');const b=[];for(const c of this.F){const d=a.get(c);!d||0<d.c||(this.H.debug('Remove unused instance',c,'from database'),a.Ud(c),b.push(c))}this.F.clear();this.C.Ga(olympe.dc.db.Database.C.Qo,b);this.G=!1}init(){const a=olympe.dc.db.Database.C.dr,b=olympe.dc.db.Database.C.np,
|
|
595
|
+
c=olympe.dc.db.Database.C.sq,d=olympe.dc.db.Database.G.IDLE,e=f=>{this.F.add(f);this.C.getState()===d&&hg(this)};this.C.C(olympe.dc.db.Database.C.vm,e.bind(this));this.C.C(b,e.bind(this));this.C.C(a,f=>{this.F.delete(f)});this.C.addEventListener(olympe.dc.db.Database.C.Nv,()=>{this.run()});this.C.C(c,(f,...g)=>{this.H.error(g[0])})}};olympe.dc.db.kf.C={ol:0,Bv:1,wn:2};olympe.dc.db.kf.F=5E3;olympe.dc.db.tc=class{constructor(a){this.id=null!=a?a:olympe.Y.Cf();this.C=new Map}U(){return this.id}Jc(a){const b=olympe.dc.db.rh.C.Ml,c=olympe.dc.db.rh.C.Dc,d=olympe.dc.db.rh.C.nk;this.C.forEach((e,f)=>{const g=e.Vb();switch(e.getState()){case b:const h=e.tb();if(null===h)throw Error(`GraphPatch: try to create the instance ${f} with no source`);const k=e.T()?e.Cb():void 0;a.$c(f,h,k,g);break;case d:e.T()&&a.Qc(f,e.Cb(),g);break;case c:a.F(f,e.J(),g)}for(const [h,k,l]of e.yd())e=this.C.get(k),
|
|
596
|
+
l?a.Ma(h,f,k,g,e.Vb()):a.hc(h,f,k,g,e.Vb())})}af(){return 0===this.C.size}O(){let a=0;this.C.forEach(b=>{a+=b.Cc()});return a}$c(a,b,c,d=null){b=this.J(a).create(b);'string'===typeof d&&this.Ma(olympe.dc.mc.Yc,a,d,d,null);c&&b.Cm(c)}Qc(a,b,c=null){b&&this.J(a,c).Cm(b)}F(a,b=olympe.dc.Nb.NONE,c=null){const d=this.C.get(a);if(d&&d.F())this.G(a,b);else{this.J(a,c).delete(b);for(const e of this.Ak(a,b,!1))this.C.get(e).Cb().clear(),this.aa(e,!0)}}Ma(a,b,c,d=null,e=null){this.J(b,d).link(a,c);this.J(c,
|
|
597
|
+
e).Fb(a,b)}hc(a,b,c,d=null,e=null){this.J(b,d).unlink(a,c);this.J(c,e).Ub(a,b)}ea(a){var b=olympe.dc.ia();if(b.Ha(a)){const c=b.model(a),d=b.source(a),e=b.Cb(a,!0);Ng(b,a).forEach((f,g)=>{e.set(`${olympe.dc.Oe.Me}${g}`,f)});this.$c(a,d,e,c);(b=b.Ve(a))&&this.Ma(olympe.dc.mc.ni,a,b);e.forEach(f=>{f instanceof olympe.dc.uc&&this.ea(f.X())})}}ad(){return function*(a){for(const b of a.values())if(b.F()||b.zd()||b.T())yield b}(this.C)}Lc(a){let b;return null!=(b=this.C.get(olympe.dc.ga(a)))?b:null}G(a,
|
|
598
|
+
b=olympe.dc.Nb.NONE){a=this.Ak(a,b);for(const c of a)this.aa(c,!1),this.C.delete(c)}yd(){return function*(a){for(var b=a.next();!b.done;){b=b.value;const c=b.tag();yield*b.yd((d,e,f)=>[d,c,e,f]);b=a.next()}}(this.C.values())}Vg(a,b,c=(d,e)=>[d,e]){return this.va(a,b,c)}*va(a,b,c,d=[]){d.push(a);a=this.Lc(a);for(const [e,f]of a.bb(b))d.includes(e)||(yield*this.va(e,b,c,d),yield c(e,f))}T(a,b,c){const d=this.C.get(b),e=this.C.get(c);d&&d.O(a,olympe.dc.wa.DESTINATION,c);e&&e.O(a,olympe.dc.wa.ORIGIN,
|
|
599
|
+
b)}aa(a,b){const c=olympe.dc.wa.ORIGIN,d=olympe.dc.wa.DESTINATION,e=this.C.get(a);for(const [g,h,k]of e.yd())if(k||!b){e.O(g,d,h);var f=this.C.get(h);f&&f.O(g,c,a)}for(const [g,h,k]of e.hb())if(k||!b)e.O(g,c,h),(f=this.C.get(h))&&f.O(g,d,a)}*Rr(a){let b;for(const [c,d]of(null==(b=this.Lc(a))?void 0:b.bb(olympe.dc.CloudObject.instancesRel))||[])d&&(a=this.C.get(c),a.zd()||(yield a))}Ak(a,b,c=!0){const d=olympe.dm.Relation.C.gm,e=olympe.dm.Relation.C.tm,f=olympe.dc.wa.ORIGIN,g=olympe.dc.ia();a=new Set([a]);
|
|
600
|
+
const h=new Set;for(const l of a){var k=this.C.get(l);if(void 0!==k){for(const [n,p,q]of k.yd())q&&Kg(g,n,b)&e?a.add(p):c||q||h.add(`${l}.${n}.${p}`);for(const [n,p,q]of k.hb())q&&Kg(g,n,b)&d?a.add(p):c||q||h.add(`${p}.${n}.${l}`)}for(const [n,p,q]of Og(g,l))k=p===f?d:e,!h.has(p===f?`${q}.${n}.${l}`:`${l}.${n}.${q}`)&&Kg(g,n,b)&k&&a.add(q)}return Array.from(a).filter(l=>this.C.has(l))}J(a,b){let c=this.C.get(a);void 0===c&&(c=new olympe.dc.db.rh(a),this.C.set(a,c));return b?c.Ga(b):c}Z(a){const b=
|
|
601
|
+
olympe.dc.wa.DESTINATION;for(const [c,d]of this.ja(a))if(a=c.tag(),d.zd())this.G(a,d.J());else if(c.zd())d.F()&&this.G(a,c.J());else{c.Cb().forEach((e,f)=>{void 0!==d.Oa(f)&&c.ea(f)});for(const [e,f,g]of c.yd()){const h=d.yb(e,b,f);void 0!==h&&g!==h&&this.T(e,a,f)}}return this}*ja(a){var b=this.C;const c=a.C,d=(a=a.O()>this.O())?c:b;b=a?b:c;for(const [e,f]of b)b=d.get(e),void 0!==b&&(yield[a?f:b,a?b:f])}};olympe.dc.db.tc.ya=[olympe.dc.Writable,olympe.dc.Xu];const lg=olympe.dc.db.Database.C,ch=olympe.dc.db.Database.F.Ki,dh=olympe.dc.db.Database.F.It,eh=olympe.dc.db.Database.F.Me,fh=olympe.dc.db.Database.F.Sk,gh=olympe.dc.db.Database.F.cl,W=olympe.dc.wa.ORIGIN,X=olympe.dc.wa.DESTINATION,hh=olympe.dc.mc.Yc,ih=olympe.dc.mc.ni;function Jf(a,b,c=!1){const d=a.get(eh+b);return c||void 0!==d?d:a.get(dh+b)}
|
|
602
|
+
function Xf(a,b){const c=a.model();if(null!==c){if(c===b)return;a.unlink(hh,c)}a.link(hh,b);b.forEach((d,e)=>{if(e[0]===eh||e[0]===dh)e=e.substring(1),jh(a,e,d)});null===a.G||!b.e&&b!==a||a.db.aa(a,!0)}function Yf(a,b){const c=a.Ve();if(null!==c){if(c===b)return;a.unlink(ih,c)}a.link(ih,b);const d=new Map;b.forEach((e,f)=>{if(f[0]===eh||f[0]===dh)f=f.substring(1),a.has(eh+f)||(a.set(dh+f,e),d.set(f,e))});kh(a,d)}
|
|
603
|
+
function Zf(a,b){a.unlink(hh,b);a.forEach((c,d)=>{c=d.substring(1);jh(a,c,null)});a.db.aa(a,!1)}function $f(a,b){a.unlink(ih,b);const c=new Map;a.forEach((d,e)=>{e[0]===dh&&(a.delete(e),d=e.substring(1),c.set(d,null))});kh(a,c)}function ag(a){a.c++;1===a.c&&a.db.F(lg.dr,a.C)}
|
|
604
|
+
function bg(a){0<a.c?--a.c:a.db.F(lg.sq,a.C,`Try to decrease references on instance ${a.C} but the reference counter is already 0.\n`+'It happens when you try to remove a callback from an instance multiple times.\nThis counter reference is used for garbage collection of instances in the database.');0===a.c&&a.db.F(lg.vm,a.C)}
|
|
605
|
+
function ig(a,b,c){const d=eh+b;var e=a.get(d);e=void 0===e?null:e;if(!lh(e,c))if(mh(a,b,e,c,!0),e=dh+b,null===c){a.delete(d);let f;c=null==(f=a.Ve())?void 0:Jf(f,b);c=void 0===c?null:c;null!==c&&a.set(e,c);kh(a,(new Map).set(b,c))}else void 0!==a.get(e)&&a.delete(e),a.set(d,c),kh(a,(new Map).set(b,c))}function Ag(a,b,c,d){const e=nh(a,gh+b);return e.has(c)?!1:(e.set(c,d),ag(a),a.db.F(lg.Un,a.C,b,c),!0)}function yg(a,b,c){const d=oh(a,gh+b,c);void 0!==d&&(bg(a),a.db.F(lg.Vn,a.C,b,c));return d}
|
|
606
|
+
function Gg(a,b,c,d){const e=(...f)=>{var g=f.length;const h=f[g-2];(g=a.db.get(f[g-1]))&&(h?ag(g):bg(g));d(...f)};return Ag(a,b,c,e)?e:null}function lh(a,b){return a instanceof Date?b instanceof Date&&a.getTime()===b.getTime():null!==a&&'function'===typeof a.Fa?a.Fa(b):a===b}
|
|
607
|
+
function mh(a,b,c,d,e){c instanceof olympe.dc.uc&&(ph(a.db.get(c.X())),a.db.va(c.X()));d instanceof olympe.dc.uc&&(c=a.db.G(d.X(),!0),c.F&&c.F.tag!==a.C&&a.db.ab().fatal('Instance',d.X(),'referenced multiple times!\nThis instance is currently property of',c.F.tag,'(for the property '+c.F.Ja+')','and is assigned as a property of',a.C,'(for the property '+b+')'),d=c,a=a.C,void 0===d.F&&(ag(d),d.db.ac(d.C,a,b)),d.F={tag:a,Ja:b,jy:e})}function qh(a,b,c,d){a.e&&a.db.Uh(a.C,b,c,d)}
|
|
608
|
+
function kh(a,b,c=[]){const d=a.get(W+hh);void 0!==d&&d.forEach(e=>{b.forEach((f,g)=>jh(e,g,f))});a=a.get(W+ih);void 0!==a&&a.forEach((e,f)=>{if(!c.includes(e.tag())){var g=new Map;b.forEach((h,k)=>{e.has(eh+k)||(g.set(k,h),null!==h?e.set(dh+k,h):e.delete(dh+k))});kh(e,g,[...c,f])}})}function nh(a,b){let c=a.get(b);void 0===c&&(c=new Map,a.set(b,c));return c}function rh(a,b,c,d,e){a.db.$h(a.C,b,c,d.C,e)}
|
|
609
|
+
function oh(a,b,c){const d=a.get(b);if(void 0!==d){const e=d.get(c);d.delete(c);0===d.size&&a.delete(b);return e}}function jh(a,b,c){if(!a.has(ch+b)){const d=fh+b,e=a.get(d);lh(c,void 0!==e?e:null)||(null===c?a.delete(d):a.set(d,c),qh(a,b,c,null!==c))}}function jg(a){a.forEach((b,c)=>{const d=c[0];if(d===W||d===X){const e=c.substring(1),f=d===W?X:W;b.forEach(g=>{g.e&&(rh(a,e,d,g,!0),rh(g,e,f,a,!0))})}else if(d===ch||d===fh)c=c.substring(1),qh(a,c,b,d===fh)})}
|
|
610
|
+
function kg(a){a.forEach((b,c)=>{const d=c[0];if(d!==gh){var e=c.substring(1);d===W?b.forEach(f=>{f.unlink(e,a)}):d===X?b.forEach(f=>{a.unlink(e,f)}):d===ch?a.update(e,null):d===eh&&ig(a,e,null);a.delete(c)}});if(void 0!==a.F){const b=a.db.get(a.F.tag),c=a.F.jy;let d,e;(null==(d=b.get(`${c?eh:ch}${a.F.Ja}`))?void 0:null==(e=d.X)?void 0:e.call(d))===a.C&&(c?ig(b,a.F.Ja,null):b.update(a.F.Ja,null))}}function ph(a){void 0!==a.F&&(bg(a),a.db.ac(a.C,a.F.tag,a.F.Ja),a.F=void 0)}
|
|
611
|
+
olympe.dc.db.Instance=class extends Map{constructor(a,b){super();this.C=a;this.G=null;this.e=!1;this.F=void 0;this.c=0;this.O=!1;this.db=b}tag(){return this.C}Ha(){return this.e}J(){return this.db.J(this.C)}source(){return this.G}model(){const a=this.get(X+hh);let b;return null!=(b=a&&Array.from(a.values())[0])?b:null}Ve(){const a=this.get(X+ih);let b;return null!=(b=a&&Array.from(a.values())[0])?b:null}toString(){var a=this.Oa(olympe.dc.CloudObject.nameProp.X());a=`Instance: ${this.C}, Exist: ${this.e}, Name: ${a}`;
|
|
612
|
+
var b=this.model();if(b){var c=b.Oa(olympe.dc.CloudObject.nameProp.X())||'No model name';a+=`\nModel: ${b.C}, Exist: ${b.e}, Model name: ${c}`}else a+='\nModel: no model';(b=this.Ve())?(c=b.Oa(olympe.dc.CloudObject.nameProp.X())||'No extension name',a+=`\nExtension: ${b.C}, Exist: ${b.e}, Extension name: ${c}`):a+='\nExtension: no extension';return a}Oa(a,b=!1){const c=this.get(ch+a);return b||void 0!==c?c:this.get(fh+a)}update(a,b){const c=ch+a;var d=this.get(c);d=void 0===d?null:d;if(!lh(d,b))if(mh(this,
|
|
613
|
+
a,d,b,!1),d=fh+a,null===b){this.delete(c);let e;b=null==(e=this.model())?void 0:Jf(e,a);void 0!==b?(this.set(d,b),qh(this,a,b,!0)):qh(this,a,null,!1)}else this.set(c,b),this.delete(d),qh(this,a,b,!1)}link(a,b){var c=W+a;const d=nh(this,X+a);c=nh(b,c);d.has(b.C)||(d.set(b.C,b),c.set(this.C,this),this.db.F(lg.ak,this.C,a,X,b.C),this.db.F(lg.ak,b.C,a,W,this.C),this.e&&b.e&&(rh(this,a,X,b,!0),rh(b,a,W,this,!0)))}unlink(a,b){const c=W+a;void 0!==oh(this,X+a,b.C)&&(oh(b,c,this.C),this.db.F(lg.em,this.C,
|
|
614
|
+
a,X,b.C),this.db.F(lg.em,b.C,a,W,this.C),this.e&&b.e&&(rh(this,a,X,b,!1),rh(b,a,W,this,!1)))}persist(){this.O=!0;return this}clear(){this.forEach((a,b)=>{const c=b[0];if(c===W||c===X){const d=b.substring(1),e=c===W?X:W;a.forEach(f=>{const g=f.get(e+d);g.delete(this.C);0===g.size&&f.delete(e+d)})}c===ch&&a instanceof olympe.dc.uc&&ph(this.db.get(a.X()))});void 0!==this.F&&this.db.get(this.F.tag).delete(ch+this.F.Ja)}};olympe.dc.db.Instance.C={PA:'instance',IB:'rel',cl:'cb',cm:'ref',TRANSACTION:'tx'};olympe.dc.db.rh=class a{constructor(b){this.oc=b;this.Z=this.eb=null;this.Ob=olympe.dc.Nb.NONE;this.G=a.C.nk;this.C=this.pb=this.ac=this.aa=this.properties=null}tag(){return this.oc}Vb(){return this.Z}tb(){return this.eb}getState(){return this.G}Ga(b){if(null===this.Z)this.Z=b;else if(this.Z!==b)throw Error(`Try to set a model relation with another model ${b} than the one set initially ${this.Z}`);return this}J(){return this.G===a.C.Dc?this.Ob:olympe.dc.Nb.NONE}create(b){this.G=a.C.Ml;this.eb=null!=
|
|
615
|
+
b?b:null;return this}delete(b=olympe.dc.Nb.NONE){this.G=a.C.Dc;this.Ob=b;this.properties=null;return this}la(b,c){if(this.G===a.C.Dc)return this;this.properties||(this.properties=new Map);this.properties.set(b,c);return this}Cm(b){this.G!==a.C.Dc&&(this.properties||(this.properties=new Map),b.forEach((c,d)=>{this.properties.set(d,c)}))}Uc(b,c){if(null!==this.aa&&this.aa!==b)throw Error('An instance should never be set as complex property of multiple instances');this.aa=b;this.ac=c}ea(b){let c;null==
|
|
616
|
+
(c=this.properties)||c.delete(b);0===this.properties.size&&(this.properties=null)}link(b,c){null===this.pb&&(this.pb=new Map);b===olympe.dc.mc.Yc&&this.Ga(c);this.sa(this.pb,b,c,!0);return this}unlink(b,c){null===this.pb&&(this.pb=new Map);b===olympe.dc.mc.Yc&&this.Ga(c);this.sa(this.pb,b,c,!1);return this}Fb(b,c){null===this.C&&(this.C=new Map);this.sa(this.C,b,c,!0)}Ub(b,c){null===this.C&&(this.C=new Map);this.sa(this.C,b,c,!1)}yb(b,c,d){if(c=c===olympe.dc.wa.ORIGIN?this.C:this.pb)return(b=c.get(b))&&
|
|
617
|
+
b.get(d)}O(b,c,d){const e=(c=c===olympe.dc.wa.ORIGIN?this.C:this.pb)&&c.get(b);e&&e.delete(d);e&&0===e.size&&c.delete(b)}F(){return this.G===a.C.Ml}zd(){return this.G===a.C.Dc}Cc(){let b=this.properties?this.properties.size:0,c;null==(c=this.pb)||c.forEach(d=>{b+=d.size});return b}T(){return null!==this.properties}Tc(){return null!==this.pb||null!==this.C}Cb(){let b;return null!=(b=this.properties)?b:new Map}Oa(b){if(this.properties)return this.properties.get(b)}bb(b,c=(d,e)=>[d,e]){return function*(d){if(d=
|
|
618
|
+
d&&d.get(b.X()))for(const [e,f]of d)yield c(e,f)}(b.Ia()===olympe.dc.wa.ORIGIN?this.C:this.pb)}Kb(b){const c=b.Ia()===olympe.dc.wa.ORIGIN?this.C:this.pb;return(b=c&&c.get(b.X()))&&0!==b.size?Array.from(b.keys())[0]:null}yd(b=(c,d,e)=>[c,d,e]){return this.va(this.pb,b)}hb(b=(c,d,e)=>[c,d,e]){return this.va(this.C,b)}ja(b=(c,d,e,f)=>[c,d,e,f]){const c=olympe.dc.wa.ORIGIN,d=olympe.dc.wa.DESTINATION;return function*(e,f,g){yield*e(f,(h,k,l)=>b(h,d,k,l));yield*e(g,(h,k,l)=>b(h,c,k,l))}(this.va.bind(this),
|
|
619
|
+
this.pb,this.C)}sa(b,c,d,e){if(this.G!==a.C.Dc||!e){var f=b.get(c);if(void 0===f)f=new Map,b.set(c,f);else if(b=f.get(d),void 0!==b&&b!==e){f.delete(d);return}f.set(d,e)}}*va(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.rh.C={Ml:0,nk:1,Dc:2};olympe.dc.db.Gu=class{constructor(a,b,c,d){this.H=a;this.view=b;this.C=c;(this.active=d.get('active'))&&this.init()}debug(a){const b=olympe.dc.ga(a);if(this.C.has(b)){var c=this.C.get(a);a='\n[DEBUG - DATABASE]\n'+c.toString();if(!c.Ha()){const d=[];for(;null!==c&&!d.includes(c.tag());)d.push(c.tag()),c=c.model();c=this.C.get(d[d.length-1]);const e=olympe.dc.db.Database.F.Ki+olympe.dc.CloudObject.nameProp.X();d.push('???');a+='\n\nThe instance <<'+b+'>> does not exists because the instance '+c.tag()+
|
|
620
|
+
' (name: '+c.get(e)+') has no model.\nList: '+d.join(' --M--\x3e ')}this.H.info(a)}else this.H.info('[DATABASE] Instance',b,'has never been created or referred by the database')}init(){const a=olympe.dc.db.Database.C.Bo,b=olympe.dc.db.Database.C.ql,c=olympe.dc.db.Database.C.Dc,d=olympe.dc.db.Database.C.ak,e=olympe.dc.db.Database.C.em,f=olympe.dc.db.Database.C.Un,g=olympe.dc.db.Database.C.Vn,h=()=>{};this.C.C(olympe.dc.db.Database.C.Ao,()=>{});this.C.C(a,()=>{});this.C.C(b,k=>{this.C.yb(()=>{Hg(this.view,
|
|
621
|
+
k,h,`monitorRelations${k}`)})});this.C.C(c,k=>{this.C.yb(()=>{Ig(this.view,k,`monitorRelations${k}`)})});this.C.C(d,()=>{});this.C.C(e,()=>{});this.C.C(f,()=>{});this.C.C(g,()=>{})}};olympe.dc.db.nr=class{constructor(a,b,c,d,e){this.H=a;this.C=b;this.ia=c;this.G=d;this.J=e}write(a){if(this.G){const b=new sh(this.ia);a.Jc(b);this.H.info(b.flush())}this.C.Bf();a.Jc(this);this.C.Vd()}$c(a,b,c){this.C.create(a,b,c,this.J)}Qc(a,b){this.C.update(a,b)}F(a,b=olympe.dc.Nb.NONE){for(const c of If(this.ia,a,b))this.C.va(c)}Ma(a,b,c){this.C.link(a,b,c)}hc(a,b,c){this.C.unlink(a,b,c)}};
|
|
622
|
+
function th(a,b,c){if(!b)return'';let d='';if(c&&1<c)return'...';for(const [e,f]of b)if(d+=(d?', "':'"')+e+'":',!f)d+=JSON.stringify(f);else if(f instanceof olympe.dc.uc||f instanceof olympe.dc.CloudObject)d+='Reference("'+f.X()+'")';else if(f instanceof olympe.D.Color)d+='Color("'+f.Wg()+','+f.Tg()+','+f.Qg()+','+f.Pg()+'")';else if(f.constructor&&Object.prototype.hasOwnProperty.call(f.constructor.prototype,'toString'))d+=JSON.stringify(f.toString());else if('object'===typeof f){let g;d+=th(a,f,
|
|
623
|
+
(null!=(g=c)?g:0)+1)}return'{'+(d?d:'')+'}'}function uh(a,b){let c;return'string'===typeof b?null!=(c=a.db.name(b))?c:b:''}function vh(a,b){let c;return b===olympe.dc.mc.Yc?'Model':null!=(c=a.db.name(b))?c:b}
|
|
624
|
+
class sh{constructor(a){this.db=a;this.output='Applying patch on the local database'}flush(){const a=this.output;this.output='';return a}log(a,b){this.output+=`\ndb.${a};${b?`// ${b}`:''}`}$c(a,b,c,d){this.log(`createInstance(tag: ${a}, source: ${b}, ${th(this,c)})`,uh(this,d))}Qc(a,b,c){this.log(`updateInstance(tag: ${a}, ${th(this,b)})`,uh(this,c))}F(a,b,c){this.log(`deleteInstance("${a}", rule: ${b})`,uh(this,c))}Ma(a,b,c){this.log(`createRelation("${a}", "${b}", "${c}")`,vh(this,a))}hc(a,b,c){this.log(`deleteRelation("${a}", "${b}", "${c}")`,
|
|
625
|
+
vh(this,a))}}olympe.dc.db.nr.ya=[olympe.dc.Writable,olympe.dc.Writable];olympe.dc.db.R={Ca:'dc.db.Logger',ul:'dc.db.gc.Logger',Ea:'dc.db.DatabaseManager',Dj:'dc.db.Database',kl:'dc.db.DBView',JA:'dc.db.Graph',Lz:'dc.db.DatabaseWriter',xB:'dc.db.PermissionProcessor',Ci:'dc.db.GraphMonitor'};olympe.dc.db.V={Ro:'db.garbageCollector',So:'db.garbageCollectorDelay',el:'db.commitBufferTimeout',Ci:'db.monitor',Fu:'db.monitorCounters',Eu:'db.monitorCallbacks',qo:'db.debug'};
|
|
626
|
+
olympe.W.config(function(a){F(a,olympe.dc.db.V.Ro,olympe.dc.db.kf.C.wn);F(a,olympe.dc.db.V.So,5E3);F(a,olympe.dc.db.V.el,3E4);F(a,olympe.dc.db.V.Ci,!1);F(a,olympe.dc.db.V.qo,!1);E(a,olympe.dc.db.R.Ca,[olympe.ka.R.Ea],b=>b.Vc('db'));E(a,olympe.dc.db.R.ul,[olympe.ka.R.Ea],b=>b.Vc('gc'));E(a,olympe.dc.db.R.Dj,[olympe.dc.db.R.Ca,olympe.dc.db.R.ul,new olympe.W.oa(olympe.dc.V.Hg),new olympe.W.oa(olympe.dc.db.V.Ro),new olympe.W.oa(olympe.dc.db.V.So),new olympe.W.oa(olympe.dc.V.Gh),new olympe.W.oa(olympe.dc.db.V.qo)],
|
|
627
|
+
(b,c,d,e,f,g,h)=>{e=g?olympe.dc.db.kf.C.ol:e;d=(new Map).set('selfTag',d).set('garbageCollector',e).set('garbageCollectorDelay',f).set('debug',h);return new olympe.dc.db.Database(b,c,d)});C(a,olympe.dc.db.R.kl,olympe.dc.lb,olympe.dc.db.R.Ca,olympe.dc.db.R.Dj);E(a,olympe.dc.db.R.Ci,[olympe.dc.db.R.Ea],b=>b.wy);E(a,olympe.dc.db.R.Ea,[olympe.dc.db.R.Ca,olympe.dc.db.R.Dj,olympe.dc.db.R.kl,new olympe.W.oa(olympe.dc.V.Rf),new olympe.W.oa(olympe.dc.db.V.el),new olympe.W.oa(olympe.dc.db.V.Ci),new olympe.W.oa(olympe.dc.db.V.Fu),
|
|
628
|
+
new olympe.W.oa(olympe.dc.db.V.Eu)],(b,c,d,e,f,g,h,k)=>{g=(new Map).set('active',g).set('counters',h).set('callbacks',k);e=(new Map).set('debug',e).set('bufferTimeout',f);return new olympe.dc.db.lt(b,c,d,e,g)})},'olympe.dc.db');olympe.W.run([olympe.dc.db.R.Dj,olympe.dc.db.R.Ci],(a,b)=>{olympe.Yd().db=a;olympe.Yd().dbMonitor=b},'DC.DB debug service injection');olympe.dc.query={};function wh(a){return(b,c)=>{const d=null===b,e=null===c;return d||e?d&&e?0:d?1:-1:a(b,c)}}
|
|
629
|
+
olympe.dc.query.gf=class{constructor(a,b,c){this.db=olympe.dc.ia();this.C=a;this.Ja=b;this.Ai=c}ha(){return{p:this.Ja.X(),o:this.Ai}}toString(){return'sortByQueryPart-'+this.Ai+this.Ja.X()}Rg(){const a=this.db.Kb(this.Ja,olympe.dm.Property.typeRel),b=olympe.dc.ga;if(this.db.If(a,olympe.dm.String))return wh((c,d)=>c.localeCompare(d));if(a===b(olympe.dm.Number)||a===b(olympe.dm.Boolean))return wh((c,d)=>c-d);if(a===b(olympe.dm.DateTime))return wh((c,d)=>c.getTime()-d.getTime());if(a===b(olympe.dm.Color))return wh((c,
|
|
630
|
+
d)=>c.compare(d));olympe.ka.ab('dc.query').warn(`No comparator found for type with tag ${a}`);return wh(()=>-1)}Oa(){return this.Ja}};olympe.dc.Ne=class{X(){}};olympe.dc.Ne.prototype.getTag=olympe.dc.Ne.prototype.X;olympe.dc.MA=olympe.dc.Ne;function xh(a){let b;if(null==(b=a.C)?0:b.af())if(a=a.J,!a.O){let c;null==(c=a.T)||c.call(a)}}function yh(a,b,c,d,e){xh(a);let f,g;b?null==(f=a.C)||f.Ma(c,d,e):null==(g=a.C)||g.hc(c,d,e)}
|
|
631
|
+
olympe.dc.query.Ku=class{constructor(a,b,c,d){this.H=a;this.source=b;this.F=c;this.J=d;this.C=this.G=null;this.db=olympe.dc.ia()}watch(a,b){if(this.db.source(a)===this.source){var c=`${this.F}:${a}:notif`;hf(this.db,a,(d,e)=>{if(d){xh(this);let f;null==(f=this.C)||f.ea(e)}else if(b&&Eg(this.db,e,c),!this.db.Ha(e)){xh(this);let f;null==(f=this.C)||f.F(e,olympe.dc.Nb.NONE)}},c);b&&Dg(this.db,a,(d,e,f)=>{xh(this);let g;f||null!=(g=this.C)&&g.Qc(a,new Map([[d,e]]))},c)}}stop(a){ff(this.db,a,`${this.F}:${a}:notif`)}};olympe.dc.query.Wj={ASC:'ASC',DESC:'DESC'};function zh(a){const b=Ah(a.query),c=new Map;for(let e=b.length;0<=e;e--){const f=0<e?b[e-1].U():a.G,g=0<e?b[e-1].C:'root',h=0<e&&b[e-1].T(),k=a.C.get(f),l=new Set(k.ad()),n=new Map,p=a.J.has(f);let q=p?';':'';if(c.has(f)){const [r,t,u]=c.get(f);c.delete(f);q+=u;r.forEach((x,y)=>{for(const z of k.F(y)){let A;n.set(z,Array.from(x).map(D=>p?`${y};${D}`:D).reduce((D,O)=>D.add(O),null!=(A=n.get(z))?A:new Set))}l.delete(y)});t&&l.forEach(x=>{const y=p?`${x};${u}`:u;for(const z of k.F(x)){let A;n.set(z,
|
|
632
632
|
(null!=(A=n.get(z))?A:new Set).add(y))}})}else l.forEach(r=>{const t=p?`${r};`:'';for(const u of k.F(r))n.has(u)?n.get(u).add(t):n.set(u,(new Set).add(t))});if(0<e&&c.has(g)){const [r,t,u]=c.get(g),x=new Map;n.forEach((y,z)=>{let A;null==(A=r.get(z))||A.forEach(D=>{let O;const M=null!=(O=x.get(z))?O:new Set;y.forEach(xa=>M.add(xa+D));x.set(z,M)});n.delete(z);r.delete(z)});t&&n.forEach((y,z)=>{x.set(z,new Set(Array.from(y).map(A=>A+u)))});b[e-1].T()&&r.forEach((y,z)=>{x.set(z,new Set(Array.from(y).map(A=>
|
|
633
|
-
q+A)))});c.set(g,[x,t&&h,q+u])}else c.set(g,[n,h,q])}let d;a=null==(d=c.get('root'))?void 0:d[0].get('root');return Array.from(null!=a?a:[]).map(e=>e.slice(0,-1).split(';'))}function
|
|
634
|
-
function
|
|
635
|
-
function
|
|
636
|
-
function
|
|
637
|
-
olympe.dc.query.kq=class{constructor(a,b){this.H=a;this.query=b;this.G=olympe.Y.vb(b.F);this.ta=new Map;this.C=(new Map).set(this.G,new olympe.dc.query.ta.
|
|
638
|
-
this.C.get(b);if(null==b||!b.has(a))return!0;b.remove(a,c)&&
|
|
639
|
-
function
|
|
640
|
-
a.s,olympe.dc.ia(),a.c);case e:return new olympe.dc.query.$.xi(olympe.dc.ia(),a.p,a.b,a.l,a.s);case f:return new olympe.dc.query.$.de(
|
|
641
|
-
olympe.dc.query.Ba=class{observe(){}ob(){}compile(){return[[this]]}pd(){return new olympe.dc.query.$.de(this)}Cb(){}Kc(){}clear(){}ha(){}Pc(){}toString(){}Fa(a){return this===a}static ay(...a){return new olympe.dc.query.$.
|
|
642
|
-
a,b,!1,c)}static
|
|
643
|
-
return new olympe.dc.query.$.xe(...a)}static pd(a){if(!(a instanceof olympe.dc.query.Ba))throw new olympe.dc.query.Ld(`The specified predicate, while trying to build a NOT query predicate is invalid: ${a}`);return new olympe.dc.query.$.de(a)}};olympe.dc.query.Ba.not=olympe.dc.query.Ba.pd;olympe.dc.query.Ba.or=olympe.dc.query.Ba.or;olympe.dc.query.Ba.and=olympe.dc.query.Ba.and;olympe.dc.query.Ba.smallerThan=olympe.dc.query.Ba.
|
|
644
|
-
olympe.dc.query.Ba.regex=olympe.dc.query.Ba.Uy;olympe.dc.query.Ba.contains=olympe.dc.query.Ba.contains;olympe.dc.query.Ba.equals=olympe.dc.query.Ba.Fa;olympe.dc.query.Ba['in']=olympe.dc.query.Ba.ay;olympe.dc.query.Ba.C={Zq:0,
|
|
645
|
-
function
|
|
646
|
-
b.U();for(c=a.G+1;c<a.ta.length&&a.ta[c].U()!==d;)c++;b=c<a.ta.length?a.ta:a.ta.concat(b);return new olympe.dc.pa(a.F,a.source,b,c,a.J,a.C)}function
|
|
647
|
-
function
|
|
633
|
+
q+A)))});c.set(g,[x,t&&h,q+u])}else c.set(g,[n,h,q])}let d;a=null==(d=c.get('root'))?void 0:d[0].get('root');return Array.from(null!=a?a:[]).map(e=>e.slice(0,-1).split(';'))}function Bh(a){if(null===a.F){const b={Ib:a.query.Rg(),Ed:a.Ed,max:a.query.C.max,offset:a.query.C.offset};a.F=olympe.dc.Ra.from(a.Z,zh(a),b)}return a.F}function Ch(a,b){a.T=b}function Dh(a){if(!a.O){null!==a.F&&(a.Z=a.F);a.F=null;a.O=!0;let b;null==(b=a.T)||b.call(a)}}
|
|
634
|
+
function Eh(a,b){let c;return null!=(c=a.C.get(b).ad())?c:[]}function Fh(a,b,c){let d,e;return null!=(e=null==(d=a.C.get(c))?void 0:d.has(b))?e:!1}function Gh(a,b,c=a.G,d='root'){const e=a.C.get(c);if(!e)return a.H.error('Try to insert result entry to a higher level than possible'),null;const f=!e.has(b);e.G(b,d)&&Dh(a);let g;f&&(null==(g=a.Ge)||g.watch(b,a.J.has(c)));return f}function Hh(a,b,c,d,e,f){null!==a.Ge&&(d===olympe.dc.wa.ORIGIN?yh(a.Ge,b,c,f,e):yh(a.Ge,b,c,e,f))}
|
|
635
|
+
function Ih(a){a.H.C()&&a.H.debug(`Start sending notifications for query ${a.query.U()}`);const b=new olympe.dc.query.Ku(a.H,a.query.tb(),a.query.U(),a);a.C.forEach((c,d)=>{for(const e of c.ad())b.watch(e,a.J.has(d))});null!=b.C||(b.C=new olympe.dc.db.tc);a.Ge=b}function Jh(a){null!==a.Ge&&(a.H.C()&&a.H.debug(`Stop sending notifications for query ${a.query.U()}`),a.C.forEach(b=>{for(const c of b.ad())a.Ge.stop(c)}),a.Ge=null)}
|
|
636
|
+
function Kh(a){a.O=!1;if(null!=(a=a.Ge)){let b;const c=!(null==(b=a.C)?0:b.af());a.G=c?a.C:null;c&&(a.C=new olympe.dc.db.tc,a.H.C()&&a.H.debug(`Commit notification with ${a.G.O()} operations for query ${a.F}`))}}
|
|
637
|
+
olympe.dc.query.kq=class{constructor(a,b){this.H=a;this.query=b;this.G=olympe.Y.vb(b.F);this.ta=new Map;this.C=(new Map).set(this.G,new olympe.dc.query.ta.jm);this.J=new Set(b.J);this.Ed=-1;this.O=!1;this.T=null;this.Z=olympe.dc.Ra.empty();this.Ge=this.F=null;a=Ah(b);a.forEach(c=>{const d=c.U();this.ta.set(d,c.O());this.C.set(d,c.va())});b=b.Rg();if(null!==b){b=b.C;let c=-1;for(const d of[this.G].concat(a.map(e=>e.U())))if(c+=this.J.has(d)?1:0,b===d){this.Ed=c;break}}}remove(a,b=this.G,c='root'){b=
|
|
638
|
+
this.C.get(b);if(null==b||!b.has(a))return!0;b.remove(a,c)&&Dh(this);if(!b.has(a)){let d;null==(d=this.Ge)||d.stop(a);return!0}return!1}Kc(a){const b=a.F,c=olympe.Y.vb(b);a=Ah(a);const d=[];for(const [f,g]of this.C){if(g.O(b))return!0;g.has(b)&&d.push(f)}const e=(new Map).set(c,d);return 0<d.length&&a.every(f=>{let g;const h=(null!=(g=e.get(f.C))?g:[]).flatMap(k=>f.aa(k,this.ta.get(k))).filter(k=>{let l,n;return null!=(n=null==(l=this.ta.get(k))?void 0:l.Kc(f))?n:!1});e.set(f.U(),h);return 0<h.length})}};function Lh(a){if(!olympe.dc.ia().Rb(a,olympe.dm.Property))throw new olympe.dc.query.Ld(`The specified property while trying to build a query predicate is invalid: ${a}`);}
|
|
639
|
+
function Mh(a){var b=olympe.dc.query.Ba.C.Zq;const c=olympe.dc.query.Ba.C.Co,d=olympe.dc.query.Ba.C.Aj,e=olympe.dc.query.Ba.C.lp,f=olympe.dc.query.Ba.C.Lp,g=olympe.dc.query.Ba.C.uq,h=olympe.dc.query.Ba.C.un,k=olympe.dc.query.Ba.C.Yp;switch(a.pr){case b:return new olympe.dc.query.$.qm(a.t);case c:b=a.v;switch(a.t){case 2:b=new Date(b);break;case 3:b=olympe.dc.CloudObject.get(b);break;case 4:b=olympe.D.Color.create(b.r,b.g,b.b,b.a)}return new olympe.dc.query.$.se(a.p,b,olympe.dc.ia());case d:return new olympe.dc.query.$.hf(a.p,
|
|
640
|
+
a.s,olympe.dc.ia(),a.c);case e:return new olympe.dc.query.$.xi(olympe.dc.ia(),a.p,a.b,a.l,a.s);case f:return new olympe.dc.query.$.de(Mh(a.v));case g:return new olympe.dc.query.$.uf(a.p,new RegExp(a.r),olympe.dc.ia(),a.c);case k:return new olympe.dc.query.$.xe(...a.p.map(l=>Mh(l)));case h:return new olympe.dc.query.$.Fd(...a.p.map(l=>Mh(l)));default:return null}}
|
|
641
|
+
olympe.dc.query.Ba=class{observe(){}ob(){}compile(){return[[this]]}pd(){return new olympe.dc.query.$.de(this)}Cb(){}Kc(){}clear(){}ha(){}Pc(){}toString(){}Fa(a){return this===a}static ay(...a){return new olympe.dc.query.$.qm(a)}static Fa(a,b){Lh(a);return new olympe.dc.query.$.se(a,b,olympe.dc.ia())}static contains(a,b,c=!0){Lh(a);return new olympe.dc.query.$.hf(a,b,olympe.dc.ia(),c)}static Uy(a,b,c=!0){Lh(a);return new olympe.dc.query.$.uf(a,b,olympe.dc.ia(),c)}static Ek(a,b,c=!0){Lh(a);return new olympe.dc.query.$.xi(olympe.dc.ia(),
|
|
642
|
+
a,b,!1,c)}static pj(a,b,c=!0){Lh(a);return new olympe.dc.query.$.xi(olympe.dc.ia(),a,b,!0,c)}static and(...a){if(!a.every(b=>b instanceof olympe.dc.query.Ba))throw new olympe.dc.query.Ld(`Some specified predicates, while trying to build an AND query predicate are invalid: ${a}`);return new olympe.dc.query.$.Fd(...a)}static or(...a){if(!a.every(b=>b instanceof olympe.dc.query.Ba))throw new olympe.dc.query.Ld(`Some specified predicates, while trying to build an OR query predicate are invalid: ${a}`);
|
|
643
|
+
return new olympe.dc.query.$.xe(...a)}static pd(a){if(!(a instanceof olympe.dc.query.Ba))throw new olympe.dc.query.Ld(`The specified predicate, while trying to build a NOT query predicate is invalid: ${a}`);return new olympe.dc.query.$.de(a)}};olympe.dc.query.Ba.not=olympe.dc.query.Ba.pd;olympe.dc.query.Ba.or=olympe.dc.query.Ba.or;olympe.dc.query.Ba.and=olympe.dc.query.Ba.and;olympe.dc.query.Ba.smallerThan=olympe.dc.query.Ba.pj;olympe.dc.query.Ba.greaterThan=olympe.dc.query.Ba.Ek;
|
|
644
|
+
olympe.dc.query.Ba.regex=olympe.dc.query.Ba.Uy;olympe.dc.query.Ba.contains=olympe.dc.query.Ba.contains;olympe.dc.query.Ba.equals=olympe.dc.query.Ba.Fa;olympe.dc.query.Ba['in']=olympe.dc.query.Ba.ay;olympe.dc.query.Ba.C={Zq:0,Co:1,Aj:2,lp:3,Lp:4,uq:5,Yp:6,un:7};function Ah(a){return Array.from(a.ta)}
|
|
645
|
+
function Nh(a,b){var c=b.relation,d=olympe.dm.Relation.originModelRel,e=olympe.dm.Relation.destinationModelRel;d=a.db.Kb(c,c.Ia()===olympe.dc.wa.ORIGIN?e:d);if(0>a.G)e=a.C.He;else if(e=a.ta[a.G],null!==e.ja)e=e.ja;else{var f=olympe.dc.wa.ORIGIN;e=olympe.dc.ia().Kb(e.relation,e.relation.Ia()===f?olympe.dm.Relation.originModelRel:olympe.dm.Relation.destinationModelRel)}if(null===d||!a.db.If(d,e)&&!a.db.If(e,d))throw new olympe.dc.query.Ld(`The specified relation "${c}" is invalid at the current level "${a.db.name(e)} (${e})" of the Query you are building. Please make sure you did not forget a .back() or another relation.`);d=
|
|
646
|
+
b.U();for(c=a.G+1;c<a.ta.length&&a.ta[c].U()!==d;)c++;b=c<a.ta.length?a.ta:a.ta.concat(b);return new olympe.dc.pa(a.F,a.source,b,c,a.J,a.C)}function Oh(a,b=a.G){return 0<=b?a.ta[b].U():olympe.Y.vb(a.F)}function Ph(a,b,c,d={}){var e=olympe.dc.Nb.Yf;const f=(null==d?0:d.Pd)?d.Pd:olympe.dc.pa.Zc.Qf;d=(null==d?0:d.nn)?'__code-as-data__':void 0;b=olympe.dc.ga(b);const g=olympe.dc.Zd().Fe(b);b=(new olympe.dc.pa(b,g)).ge();b.ta=[new olympe.dc.query.ta.Td(Oh(b),e,c)];return b.observe(a,{Pd:f,uk:d})}
|
|
647
|
+
function Qh(a){const b=0===a.J.size?a.ge():a;if(null!==b.C.Ed&&!b.J.has(Oh(a,b.C.Ed)))throw new olympe.dc.query.Ld('AndReturn was not called for the current level before sortBy operator');return b}
|
|
648
648
|
olympe.dc.pa=class{constructor(a,b,c=[],d=-1,e=new Set,f={max:-1,offset:0,Ed:null,He:null}){this.db=olympe.dc.ia();this.F=a;this.source=b;this.ta=c;this.G=d;this.J=e;this.C=f;this.id=null}static from(a,b){a=olympe.dc.ga(a);if(!olympe.dc.CloudObject.exists(a))throw new olympe.dc.query.Ld(`Try to create a query from an instance that does not exist (${a}). Please try to use \`Query.fromTag()\` instead.`);b=null!=b?b:olympe.dc.Zd().Fe(a);b=new olympe.dc.pa(a,b);b.C.He=olympe.dc.ia().model(a);return b}static Fe(a,
|
|
649
|
-
b,c){if(!olympe.dc.CloudObject.exists(b))throw new olympe.dc.query.Ld(`Try to create a query from an instance (${a}) with an explicit datatype that does not exist (${b})`);a=olympe.dc.ga(a);c=null!=c?c:olympe.dc.Zd().fromModel(b);c=new olympe.dc.pa(a,c);c.C.He=olympe.dc.ga(b);return c}static
|
|
650
|
-
a=new olympe.dc.pa(d,a);a.C.He=e.model(d);b&&(a=
|
|
651
|
-
b=!1){if(!(a instanceof olympe.dc.Pa.Relation))throw new olympe.dc.query.Ld(`The relation given to follow() is invalid: ${a}`);return
|
|
652
|
-
olympe.dc.query.Ba))throw new olympe.dc.query.Ld(`The specified predicate while trying to filter a query is invalid: ${a}`);const b=Array.from(this.ta);b[this.G]=b[this.G].filter(a);return new olympe.dc.pa(this.F,this.source,b,this.G,this.J,this.C)}Yi(){return this}
|
|
649
|
+
b,c){if(!olympe.dc.CloudObject.exists(b))throw new olympe.dc.query.Ld(`Try to create a query from an instance (${a}) with an explicit datatype that does not exist (${b})`);a=olympe.dc.ga(a);c=null!=c?c:olympe.dc.Zd().fromModel(b);c=new olympe.dc.pa(a,c);c.C.He=olympe.dc.ga(b);return c}static Hk(a,b=!0,c){const d=olympe.dc.ga(a);var e=olympe.dc.ia();if(!e.ai(d))throw new olympe.dc.query.Ld(`Try to create a query to get instances of ${a}, which is not a data type or does not exist.`);a=null!=c?c:olympe.dc.Zd().fromModel(d);
|
|
650
|
+
a=new olympe.dc.pa(d,a);a.C.He=e.model(d);b&&(a=Nh(a,new olympe.dc.query.ta.te(Oh(a),olympe.dc.CloudObject.extendedByRel,!0,!1)));b=a;e=new olympe.dc.query.ta.oh(Oh(a),olympe.dc.CloudObject.instancesRel,!1);e.ja=d;return Nh(b,e)}static Ob(a,b,c,d,e){const f=(null==e?0:e.Pd)?e.Pd:olympe.dc.pa.Zc.Qf;e=(null==e?0:e.nn)?'__code-as-data__':void 0;b=olympe.dc.ga(b);d=null!=d?d:olympe.dc.Zd().Fe(b);d=(new olympe.dc.pa(b,d)).ge();d.ta=[new olympe.dc.query.ta.Td(Oh(d),c)];return d.observe(a,{Pd:f,uk:e})}ib(a,
|
|
651
|
+
b=!1){if(!(a instanceof olympe.dc.Pa.Relation))throw new olympe.dc.query.Ld(`The relation given to follow() is invalid: ${a}`);return Nh(this,new olympe.dc.query.ta.oh(Oh(this),a,b))}eg(a,b=!1,c=!1){if(!(a instanceof olympe.dc.Pa.Relation))throw new olympe.dc.query.Ld(`The relation given to followRecursively() is invalid: ${a}`);return Nh(this,new olympe.dc.query.ta.te(Oh(this),a,b,c))}ge(){const a=(new Set(this.J)).add(Oh(this));return new olympe.dc.pa(this.F,this.source,this.ta,this.G,a,this.C)}filter(a){if(!(a instanceof
|
|
652
|
+
olympe.dc.query.Ba))throw new olympe.dc.query.Ld(`The specified predicate while trying to filter a query is invalid: ${a}`);const b=Array.from(this.ta);b[this.G]=b[this.G].filter(a);return new olympe.dc.pa(this.F,this.source,b,this.G,this.J,this.C)}Yi(){return this}jj(a,b=0){return new olympe.dc.pa(this.F,this.source,this.ta,this.G,this.J,{Ed:this.C.Ed,max:a,offset:b,He:this.C.He})}Pk(a,b=olympe.dc.query.Wj.ASC){if(0>this.G)throw new olympe.dc.query.Ld('You are trying to sort an empty query. Please first follow at least one relation to sort a query.');
|
|
653
653
|
if(!olympe.dc.ia().Rb(a,olympe.dm.Property))throw new olympe.dc.query.Ld(`The specified property while trying to sort a query is invalid: ${a}`);const c=this.ta[this.G],d={Ed:this.G,max:this.C.max,offset:this.C.offset,He:this.C.He},e=Array.from(this.ta);e[this.G]=c.sort(a,b);return new olympe.dc.pa(this.F,this.source,e,this.G,this.J,d)}Rg(){const a=this.C.Ed;let b;return null!==a?null==(b=this.ta[a])?void 0:b.Rg():null}back(a=1){if(0>this.G||1>a)return this;let b=this.G;for(let c=0;c<a;c++){const d=
|
|
654
|
-
this.ta[b].C;for(b--;-1<b&&
|
|
655
|
-
this.C.Ed!==e&&delete g.sort;if(1>=e&&d instanceof olympe.dc.query.ta.oh&&d.relation.Fa(olympe.dc.CloudObject.instancesRel))Object.assign(c,g);else if(0===e&&d instanceof olympe.dc.query.ta.te&&d.relation.Fa(olympe.dc.CloudObject.extendedByRel))Object.assign(c,g),c.inheritance=!0;else{let h;null==(h=a.get(d.C))||h.next.push(g)}});return c}ob(a){const b=(null==a?0:a.Pd)?a.Pd:olympe.dc.pa.Zc.
|
|
656
|
-
a.cacheId,zc:null==a?void 0:a.zc}).then(d=>{let e;return null!=(e=null==d?void 0:
|
|
657
|
-
(this.id=olympe.Y.vb(this.F+
|
|
658
|
-
a.toJSON())}}};olympe.dc.pa.prototype.observe=olympe.dc.pa.prototype.observe;olympe.dc.pa.prototype.executeFromCache=olympe.dc.pa.prototype.md;olympe.dc.pa.prototype.execute=olympe.dc.pa.prototype.ob;olympe.dc.pa.prototype.parse=olympe.dc.pa.prototype.parse;olympe.dc.pa.prototype.back=olympe.dc.pa.prototype.back;olympe.dc.pa.prototype.sortBy=olympe.dc.pa.prototype.
|
|
659
|
-
olympe.dc.pa.prototype.filter=olympe.dc.pa.prototype.filter;olympe.dc.pa.prototype.andReturn=olympe.dc.pa.prototype.ge;olympe.dc.pa.prototype.followRecursively=olympe.dc.pa.prototype.eg;olympe.dc.pa.prototype.follow=olympe.dc.pa.prototype.ib;olympe.dc.pa.followRule=olympe.dc.pa.Ob;olympe.dc.pa.instancesOf=olympe.dc.pa.
|
|
660
|
-
olympe.dc.query.td.prototype.createRelation=olympe.dc.query.td.prototype.Ma;olympe.dc.query.td.prototype.create=olympe.dc.query.td.prototype.create;olympe.dc.query.td.fromQuery=olympe.dc.query.td.cj;function
|
|
661
|
-
function
|
|
662
|
-
{const n=()=>{p&&c.Vd(p);l.complete();if(q){var r=q;const u=a.C.get(g);a.H.debug(`${d} unsubscribed from ${g}`);if(null==u)r=0;else{var t=u;t.J.delete(r)&&t.H.debug(`Remove subscriber ${d} for query ${t.query.U()}, now have ${t.J.size} subscribers`);d!==olympe.dc.Sa.SELF&&(t.Z--,0===t.Z&&
|
|
663
|
-
function
|
|
664
|
-
function
|
|
665
|
-
function
|
|
666
|
-
olympe.dc.query.dv=class{constructor(a,b,c,d,e){this.H=a;this.F=b;this.O=c;this.Wb=d;this.J=e;this.C=new Map;this.G=new Set;
|
|
667
|
-
if(f===olympe.dc.Sa.SELF||b.zc||this.J&&f===olympe.dc.Sa.SERVER)return d(),null;if(a!==olympe.dc.pa.Zc.Qf)return
|
|
668
|
-
let t;null==(t=g)||t.forEach(u=>
|
|
669
|
-
e(String(q))}));return()=>{h=!0;this.H.debug(`Unsubscribe to query ${l} from data source ${f}`);p.unsubscribe()}}};function
|
|
654
|
+
this.ta[b].C;for(b--;-1<b&&Oh(this,b)!==d;)b--}return new olympe.dc.pa(this.F,this.source,Array.from(this.ta),b,this.J,this.C)}parse(){const a=new Map,b=Oh(this,-1),c={limit:this.C.max,offset:this.C.offset,returned:this.J.has(b),filter:[],optional:!1,inheritance:!1,next:[]};a.set(b,c);this.db.ai(this.F)?c.dataType=olympe.dc.ga(this.F):(c.root=olympe.dc.ga(this.F),c.dataType=this.C.He);this.ta.forEach((d,e)=>{const f=d.U(),g=d.Pc();Object.assign(g,{returned:this.J.has(f),next:[]});a.set(f,g);g.sort&&
|
|
655
|
+
this.C.Ed!==e&&delete g.sort;if(1>=e&&d instanceof olympe.dc.query.ta.oh&&d.relation.Fa(olympe.dc.CloudObject.instancesRel))Object.assign(c,g);else if(0===e&&d instanceof olympe.dc.query.ta.te&&d.relation.Fa(olympe.dc.CloudObject.extendedByRel))Object.assign(c,g),c.inheritance=!0;else{let h;null==(h=a.get(d.C))||h.next.push(g)}});return c}ob(a){const b=(null==a?0:a.Pd)?a.Pd:olympe.dc.pa.Zc.Zl;let c;return olympe.dc.query.Dk().executeQuery(Qh(this),b,{Qh:null!=(c=null==a?void 0:a.uk)?c:null==a?void 0:
|
|
656
|
+
a.cacheId,zc:null==a?void 0:a.zc}).then(d=>{let e;return null!=(e=null==d?void 0:Bh(d))?e:olympe.dc.Ra.empty()})}md(){return Bh(Rh(olympe.dc.query.Dk(),Qh(this)))}observe(a,b){const c=(null==b?0:b.Pd)?b.Pd:olympe.dc.pa.Zc.Qf;a='function'===typeof a.F?a.F():a;let d;return Sh(olympe.dc.query.Dk(),Qh(this),a,olympe.dc.Sa.SELF,c,{Qh:null!=(d=null==b?void 0:b.uk)?d:null==b?void 0:b.cacheId,zc:null==b?void 0:b.zc}).pipe(rxjs.operators.map(e=>Bh(e)),rxjs.operators.distinctUntilChanged())}U(){null===this.id&&
|
|
657
|
+
(this.id=olympe.Y.vb(this.F+Ah(this).map(a=>a.J()).join()+Array.from(new Set(this.J)).sort().toString()+this.C.Ed+this.C.max+this.C.offset));return this.id}tb(){return this.source}ha(){let a;return{b:this.F,p:this.ta.map(b=>b.ha()),r:Array.from(this.J),s:this.source,e:{m:this.C.max,o:this.C.offset,s:this.C.Ed,rm:null!=(a=this.C.He)?a:this.db.model(this.F)}}}toString(){return`Query: ${JSON.stringify(this)}`}toJSON(){return{origin:this.db.Ha(this.F)?olympe.dc.CloudObject.get(this.F):this.F,relations:this.ta.map(a=>
|
|
658
|
+
a.toJSON())}}};olympe.dc.pa.prototype.observe=olympe.dc.pa.prototype.observe;olympe.dc.pa.prototype.executeFromCache=olympe.dc.pa.prototype.md;olympe.dc.pa.prototype.execute=olympe.dc.pa.prototype.ob;olympe.dc.pa.prototype.parse=olympe.dc.pa.prototype.parse;olympe.dc.pa.prototype.back=olympe.dc.pa.prototype.back;olympe.dc.pa.prototype.sortBy=olympe.dc.pa.prototype.Pk;olympe.dc.pa.prototype.limit=olympe.dc.pa.prototype.jj;olympe.dc.pa.prototype.cast=olympe.dc.pa.prototype.Yi;
|
|
659
|
+
olympe.dc.pa.prototype.filter=olympe.dc.pa.prototype.filter;olympe.dc.pa.prototype.andReturn=olympe.dc.pa.prototype.ge;olympe.dc.pa.prototype.followRecursively=olympe.dc.pa.prototype.eg;olympe.dc.pa.prototype.follow=olympe.dc.pa.prototype.ib;olympe.dc.pa.followRule=olympe.dc.pa.Ob;olympe.dc.pa.instancesOf=olympe.dc.pa.Hk;olympe.dc.pa.fromTag=olympe.dc.pa.Fe;olympe.dc.pa.from=olympe.dc.pa.from;olympe.dc.pa.Zc={Qf:1,Zl:2,$l:3};olympe.dc.pa.C={al:'cacheBucketName',qp:'isCacheable'};olympe.dc.query.td=class extends olympe.dc.kh{constructor(a,b){super(a,null);this.source=b}static cj(a){const b=new olympe.dc.db.tc(`DataResult_${a.U()}`);return new olympe.dc.query.td(b,a.tb())}static C(a){const b=(new olympe.dc.transaction.zh(a.s)).C(a.p);return new olympe.dc.query.td(b,a.s)}create(a,b,c){this.C.$c(a,this.source,c,b);return this}Ma(a,b,c){this.C.Ma(a,b,c,null,null);return this}ha(){const a=new olympe.dc.transaction.qf;this.C.Jc(a);return{s:this.source,p:tf(a)}}};
|
|
660
|
+
olympe.dc.query.td.prototype.createRelation=olympe.dc.query.td.prototype.Ma;olympe.dc.query.td.prototype.create=olympe.dc.query.td.prototype.create;olympe.dc.query.td.fromQuery=olympe.dc.query.td.cj;function Rh(a,b){const c=new olympe.dc.query.kq(a.H,b);if(a.F.view.Ha(b.F)){Gh(c,b.F);for(const d of Ah(b))d.ob(c)}return c}
|
|
661
|
+
function Sh(a,b,c,d,e,f){const g=b.U();let h=a.C.get(g);if(!h){var k=b.tb();a.H.debug(`Create new subscription for query ${g} for subscriber ${d}, to be executed by the data source ${k}`);k=!1===f.zc||a.J&&k===olympe.dc.Sa.SERVER?[]:Array.from(a.C.values());h=new olympe.dc.query.rq(a.H,a.F,b,a.T.bind(a,e,f));a.C.set(g,h);Th(h,l=>a.G.add(l));h.start(k)&&(null==f?0:f.Qh)&&Uh(a,b,e,f).catch(l=>{a.H.error(`Was not able to get the result of the subscribed query ${g} to add it to the cache: ${l}`)})}return new rxjs.Observable(l=>
|
|
662
|
+
{const n=()=>{p&&c.Vd(p);l.complete();if(q){var r=q;const u=a.C.get(g);a.H.debug(`${d} unsubscribed from ${g}`);if(null==u)r=0;else{var t=u;t.J.delete(r)&&t.H.debug(`Remove subscriber ${d} for query ${t.query.U()}, now have ${t.J.size} subscribers`);d!==olympe.dc.Sa.SELF&&(t.Z--,0===t.Z&&Jh(t.C));r=0===t.J.size}r&&(a.H.debug(`No more subscriber to ${g}, remove the subscription`),a.G.delete(g),a.C.delete(g),u.destroy())}},p=c.Z(n),q=Vh(h,d,l);return n})}
|
|
663
|
+
function Wh(a){a.G.forEach(b=>{let c;null==(c=a.C.get(b))||Xh(c)});a.G.clear()}function Yh(a,b){var c=b.U();b=a.O.J.has(c)?gf(new olympe.dc.db.tc(b.U()),b.F):b;a.F.xc(b)}function Zh(a){a.H.debug('Send GetContext request to the orchestrator');const b=new olympe.dc.Request(olympe.dc.Request.C.tg,olympe.dc.Sa.SERVER);return a.Wb.request(b).then(c=>{a.F.xc(c)})}
|
|
664
|
+
function $h(a,b){const c=b.tb();if(c===olympe.dc.Sa.SELF||a.J&&c===olympe.dc.Sa.SERVER)return Promise.resolve(!0);a=Array.from(a.C.values()).filter(d=>d.Kc(b)).map(d=>new Promise(e=>d.Bd(f=>e(!f))));return Promise.all(a).then(d=>d.some(e=>e))}function Uh(a,b,c,d){return v(function*(){var e=b.tb();e=mf(mf(new olympe.dc.Request(olympe.dc.Request.C.Bg,e,b),olympe.dc.pa.C.qp,c===olympe.dc.pa.Zc.$l),olympe.dc.pa.C.al,null==d?void 0:d.Qh);return a.Wb.request(e)})}
|
|
665
|
+
function ai(a,b,c){const d=[];for(const e of a.C.values())bi(e,b,c)&&d.push(Uh(a,e.query,olympe.dc.pa.Zc.Zl,{}).then(f=>{a.F.xc(f)}));return Promise.all(d).then(()=>{})}
|
|
666
|
+
olympe.dc.query.dv=class{constructor(a,b,c,d,e){this.H=a;this.F=b;this.O=c;this.Wb=d;this.J=e;this.C=new Map;this.G=new Set;ng(b,()=>Wh(this));rf(d,olympe.dc.Request.C.ko,f=>{Yh(this,f.content)})}executeQuery(a,b,c){const d=this;return v(function*(){const e='boolean'===typeof c.zc?c.zc:yield $h(d,a);if(!e||(null==c?0:c.Qh))try{const f=yield Uh(d,a,b,c);e||d.F.xc(f)}catch(f){return d.H.error(`Error while sending a query to data source ${a.tb()}: ${f}`),null}return Rh(d,a)})}T(a,b,c,d,e){const f=c.tb();
|
|
667
|
+
if(f===olympe.dc.Sa.SELF||b.zc||this.J&&f===olympe.dc.Sa.SERVER)return d(),null;if(a!==olympe.dc.pa.Zc.Qf)return Uh(this,c,a,b).then(q=>{this.F.xc(q);d()}).catch(e),null;let g,h=!1;const k=q=>{g=[];q&&this.H.debug(`Resend subscription ${c.U()} after detection of dead subscription in the remote service`);Uh(this,c,a,b).then(r=>{if(h)this.H.warn(`Received data result after query subscription ${c.U()} has been destroyed. Could happen with queries observed multiple times successively quickly.`);else{this.F.xc(r);
|
|
668
|
+
let t;null==(t=g)||t.forEach(u=>Yh(this,u));g=null}d()}).catch(e)},l=c.U();k(!1);const n=mf(new olympe.dc.Request(olympe.dc.Request.C.Zj,f,c),olympe.dc.pa.C.al,null==b?void 0:b.Qh),p=this.Wb.subscribe(n,k.bind(this,!0)).pipe(eb(olympe.N.errors.ap,()=>{},0)).pipe(eb(olympe.N.errors.Qn,(q,r)=>{this.H.debug(`Data Provider: Subscribe to topic ${q.U()} now that we are back online, after waiting for ${r}ms`);k(!0)},0)).subscribe(rxjs.Subscriber.create(q=>{Array.isArray(g)?g.push(q):Yh(this,q)},q=>{this.H.error(`An error occurred with the subscription ${l}: ${q}`);
|
|
669
|
+
e(String(q))}));return()=>{h=!0;this.H.debug(`Unsubscribe to query ${l} from data source ${f}`);p.unsubscribe()}}};function pf(a){return a.J.map(b=>{b=b.split('.');return 1===b.length?b[0]:b})}function qf(a){return a.G.map(b=>a.F.get(a.C[b]))}function ci(a){const b=olympe.dc.ia();let c=!1;const d=a.k.map(e=>{const f=e.split('.').map(g=>b.Ha(g)?olympe.dc.CloudObject.get(g):(olympe.ka.ab('dc.query').error(`CloudObject with tag ${g} not present but required for deserialization`),c=!0,null));return[e,1===f.length?f[0]:f]});return c?null:olympe.dc.Ra.create(d,a.a,a.r)}
|
|
670
670
|
olympe.dc.Ra=class{constructor(){this.C=[];this.F=new Map;this.G=[];this.J=[];this.hash=''}static empty(){return new olympe.dc.Ra}[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()}Ie(){return this.C.map(a=>this.F.get(a))}size(){return this.C.length}has(a){return this.F.has(a)||this.Ie().includes(a)}indexOf(a){return null===
|
|
671
671
|
a||void 0===a?-1:'string'===typeof a?this.C.indexOf(a):this.Ie().indexOf(a)}get(a){return(a=this.F.get(a))?a:null}Fc(){return this.ie(0)}ie(a){return a<this.C.length?this.F.get(this.C[a]):null}push(...a){const b=this.Ie();b.push(...a);return b}pop(){if(0===this.C.length)return[];const a=this.Ie();a.pop();return a}shift(){if(0<this.C.length){const a=this.Ie();a.shift();return a}return[]}filter(a){return this.Ie().filter(a)}find(a){return(a=this.Ie().find(a))?a:null}forEach(a){this.C.forEach((b,c)=>
|
|
672
672
|
a(this.F.get(b),c))}map(a){return this.Ie().map(a)}sort(a){const b=this.entries().sort((c,d)=>a(c[1],d[1]));return olympe.dc.Ra.create(b,Array.from(this.G),Array.from(this.J))}reduce(a,b){return this.Ie().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.J.concat(...a.map(d=>d.J));return olympe.dc.Ra.create(b,c,a)}toString(){return`QueryResult: ${JSON.stringify(this)}`}toJSON(){return this.Ie()}static from(a,
|
|
673
|
-
b,{Ib:c,Ed:d,offset:e,max:f}={}){if(null!==c&&-1<d){const p=olympe.dc.ia(),q=c.Ai===olympe.dc.query.
|
|
673
|
+
b,{Ib:c,Ed:d,offset:e,max:f}={}){if(null!==c&&-1<d){const p=olympe.dc.ia(),q=c.Ai===olympe.dc.query.Wj.ASC?1:-1,r=c.Rg(),t=c.Oa();b.sort((u,x)=>{x=x[d];u=p.Oa(u[d],t);x=p.Oa(x,t);return null===u?-q:null===x?q:q*r(olympe.dc.nb.Ac(u),olympe.dc.nb.Ac(x))})}else b.sort((p,q)=>p.reduce((r,t,u)=>r||t.localeCompare(q[u]),0));if(0<e||-1<f)b=b.slice(e,-1<f?e+f:void 0);c=olympe.Y.vb(b.flat().join(''));if(c===a.hash)return a;const g=p=>''===p?null:olympe.dc.CloudObject.get(p);e=b.map(p=>[p.join('.'),1===p.length?
|
|
674
674
|
g(p[0]):p.map(g)]);const h=new Set(e.map(p=>p[0])),k=new Set(a.keys()),l=[],n=[];e.forEach(([p],q)=>{!k.has(p)&&l.push(q)});k.forEach(p=>{!h.has(p)&&n.push(p)});return olympe.dc.Ra.create(e,l,n,c)}static create(a,b,c,d){const e=new olympe.dc.Ra;e.C=a.map(f=>f[0]);e.F=new Map(a);e.hash=d||olympe.Y.vb(e.C.join(''));e.G=b||e.C.map((f,g)=>g);e.J=c||[];return e}ha(a){a&&this.C.flatMap(b=>b.split('.')).forEach(a);return{k:this.C,a:this.G,r:this.J}}};olympe.dc.Ra.prototype.concat=olympe.dc.Ra.prototype.concat;
|
|
675
675
|
olympe.dc.Ra.prototype.reduce=olympe.dc.Ra.prototype.reduce;olympe.dc.Ra.prototype.sort=olympe.dc.Ra.prototype.sort;olympe.dc.Ra.prototype.map=olympe.dc.Ra.prototype.map;olympe.dc.Ra.prototype.forEach=olympe.dc.Ra.prototype.forEach;olympe.dc.Ra.prototype.find=olympe.dc.Ra.prototype.find;olympe.dc.Ra.prototype.filter=olympe.dc.Ra.prototype.filter;olympe.dc.Ra.prototype.shift=olympe.dc.Ra.prototype.shift;olympe.dc.Ra.prototype.pop=olympe.dc.Ra.prototype.pop;olympe.dc.Ra.prototype.push=olympe.dc.Ra.prototype.push;
|
|
676
676
|
olympe.dc.Ra.prototype.getAt=olympe.dc.Ra.prototype.ie;olympe.dc.Ra.prototype.getFirst=olympe.dc.Ra.prototype.Fc;olympe.dc.Ra.prototype.get=olympe.dc.Ra.prototype.get;olympe.dc.Ra.prototype.indexOf=olympe.dc.Ra.prototype.indexOf;olympe.dc.Ra.prototype.has=olympe.dc.Ra.prototype.has;olympe.dc.Ra.prototype.size=olympe.dc.Ra.prototype.size;olympe.dc.Ra.prototype.toArray=olympe.dc.Ra.prototype.Ie;olympe.dc.Ra.prototype.keys=olympe.dc.Ra.prototype.keys;olympe.dc.Ra.prototype.values=olympe.dc.Ra.prototype.values;
|
|
677
|
-
olympe.dc.Ra.prototype.entries=olympe.dc.Ra.prototype.entries;olympe.dc.Ra.empty=olympe.dc.Ra.empty;function
|
|
678
|
-
olympe.dc.gd.prototype.execute=olympe.dc.gd.prototype.ob;olympe.dc.gd.prototype.cast=olympe.dc.gd.prototype.Yi;olympe.dc.gd.prototype.follow=olympe.dc.gd.prototype.ib;const
|
|
679
|
-
function
|
|
680
|
-
function
|
|
681
|
-
function
|
|
682
|
-
olympe.dc.query.rq=class{constructor(a,b,c,d){this.H=a;this.db=b.view;this.query=c;this.C=new olympe.dc.query.kq(this.H,c);this.Z=0;this.aa=1;this.T=[];this.J=new Map;this.G=[()=>
|
|
683
|
-
a.F)&&this.C.Kc(a))}Bd(a){null!==this.G?this.G.push(a):a();return this}destroy(a){a?this.H.error(`Destroy subscription ${this.query.U()} after error: ${a}`):this.H.debug(`Destroy subscription ${this.query.U()}`);const b=this.T;this.T=null;this.J.forEach(e=>a?e.error(a):e.complete());let c;null==(c=this.F)||c.forEach(e=>
|
|
684
|
-
function
|
|
685
|
-
class
|
|
686
|
-
!this.O&&this.db.Ha(a))){var c;this.C||(this.C=null==(c=this.properties)?void 0:c.some(([d,e])=>b.has(d)&&
|
|
687
|
-
new olympe.dc.Pa.Relation(a),c)){const d=this.G.get(
|
|
677
|
+
olympe.dc.Ra.prototype.entries=olympe.dc.Ra.prototype.entries;olympe.dc.Ra.empty=olympe.dc.Ra.empty;function di(a){return 1<a.size()?(olympe.ka.ab('dc').warn(`a follow() on a QuerySingle has ${a.size()} results (0 or 1 expected) -> returns null`),null):a.Fc()||null}olympe.dc.gd=class{constructor(a){this.query=a}static from(a){return new olympe.dc.gd(olympe.dc.pa.from(a))}ib(a){return new olympe.dc.gd(this.query.ib(a))}Yi(){return this}ob(a){return this.query.ob(a).then(b=>di(b))}md(){return di(this.query.md())}};olympe.dc.gd.prototype.executeFromCache=olympe.dc.gd.prototype.md;
|
|
678
|
+
olympe.dc.gd.prototype.execute=olympe.dc.gd.prototype.ob;olympe.dc.gd.prototype.cast=olympe.dc.gd.prototype.Yi;olympe.dc.gd.prototype.follow=olympe.dc.gd.prototype.ib;const ei=olympe.dc.wa.ORIGIN,fi=olympe.dc.wa.DESTINATION;function Th(a,b){Ch(a.C,()=>{a.fb()||null!==a.G||b(a.query.U())})}function Vh(a,b,c){const d=a.aa;a.aa++;a.J.set(d,c);b===olympe.dc.Sa.SELF?a.Bd(e=>e?c.error(e):c.next(a.C)):(a.Z++,1===a.Z&&a.Bd(()=>Ih(a.C)));a.H.debug(`Add subscriber ${b} for query ${a.query.U()}, now have ${a.J.size} subscribers`);return d}
|
|
679
|
+
function bi(a,b,c){if(a.query.tb()!==b)return!1;c.Jc(a.ea);(b=a.ea.flush())&&a.H.debug(`Subscription ${a.query.U()} is considered as obsolete after the transaction ${c.U()} applied on DB`);return b}function Xh(a){Kh(a.C);a.J.forEach(b=>{b.next(a.C)})}function gi(a,b,c){const d=[];let e=!1;const f=new olympe.async.Xj(olympe.D.Sg());for(const g of b)g.Kc(a.query)&&(e||(e=!0),f.add(h=>g.Bd(k=>{!k&&d.push(g);h()})));Sc(f,g=>c(g?d:[]));f.start();return e}
|
|
680
|
+
function hi(a){const b=a.query.U(),c=new Map,d=q=>{const r=c.get(q);return r?1===r.size?Array.from(r)[0]:(t,u,x,y)=>r.forEach(z=>z(t,u,x,y)):()=>{}},e=Ah(a.query),f=a.C;for(let q=e.length-1;0<=q;q--){var g=e[q];const r=g.U(),t=g.C;g=g.observe(f,d(r));let u;c.set(t,(null!=(u=c.get(t))?u:new Set).add(g))}const h=a.db,k=a.query.F,l=olympe.Y.vb(k),n=hf(h,k,(q,r)=>{q?Gh(f,r):f.remove(r);d(l)(q,r,null,b)});let p;null==(p=a.T)||p.push(()=>{ff(h,k,n)});ii(a)}
|
|
681
|
+
function ji(a){const b=a.ja(a.query,()=>{null===a.G||a.fb()||hi(a)},d=>{a.fb()||(a.H.error(`Error while getting data from data source (${a.query.tb()}) to ensure coverage of the query ${a.query.U()}: ${d}`),ii(a))});let c;b&&(null==(c=a.T)||c.push(b))}function ki(a,b){a.O.delete(b);0===a.O.size&&(a.O=null,Promise.resolve().then(()=>{!a.fb()&&ji(a)}))}function ii(a){const b=a.G;a.G=null;null==b||b.forEach(c=>c())}
|
|
682
|
+
olympe.dc.query.rq=class{constructor(a,b,c,d){this.H=a;this.db=b.view;this.query=c;this.C=new olympe.dc.query.kq(this.H,c);this.Z=0;this.aa=1;this.T=[];this.J=new Map;this.G=[()=>Kh(this.C)];this.ja=d;this.ea=new li(a,this.db,c,this.C);this.F=this.O=null}start(a){return gi(this,a,b=>{0<b.length?(this.O=new Set(b),this.O.forEach(c=>{null===c.F&&(c.F=new Set);c.F.add(this)}),hi(this)):ji(this)})}Kc(a){return!this.fb()&&this.query.tb()===a.tb()&&(this.query.U()===a.U()||(null===this.G||this.query.F===
|
|
683
|
+
a.F)&&this.C.Kc(a))}Bd(a){null!==this.G?this.G.push(a):a();return this}destroy(a){a?this.H.error(`Destroy subscription ${this.query.U()} after error: ${a}`):this.H.debug(`Destroy subscription ${this.query.U()}`);const b=this.T;this.T=null;this.J.forEach(e=>a?e.error(a):e.complete());let c;null==(c=this.F)||c.forEach(e=>ki(e,this));let d;null==(d=this.O)||d.forEach(e=>{e.F.delete(this);0===e.F.size&&(e.F=null)});b.forEach(e=>e())}fb(){return null===this.T}};
|
|
684
|
+
function mi(a,b){return a.G.has(fi+b)||a.G.has(ei+b)}
|
|
685
|
+
class li{constructor(a,b,c,d){this.H=a;this.db=b;this.J=d;this.T=[];this.O=-1<c.C.max||0<c.C.offset;this.G=new Map;this.C=!1;const e=new Map;for(const f of Ah(c)){a=f.U();this.T.push(a);if(f instanceof olympe.dc.query.ta.Eh){a=f.relation;a=`${a.Ia()}${a.X()}`;let g;b=null!=(g=this.G.get(a))?g:[];b.push(f);this.G.set(a,b)}ni(f).forEach(g=>{let h;const k=null!=(h=e.get(g))?h:[];k.push(f.U());e.set(g,k)})}this.properties=Array.from(e.entries())}flush(){const a=this.C;this.C=!1;return a}$c(){}Qc(a,b){if(!(this.C||
|
|
686
|
+
!this.O&&this.db.Ha(a))){var c;this.C||(this.C=null==(c=this.properties)?void 0:c.some(([d,e])=>b.has(d)&&Fh(this.J,a,e)))}}F(a){this.C||this.db.Ha(a)&&!this.O||this.C||(this.C=this.T.some(b=>Fh(this.J,a,b)))}Ma(a,b,c){if(!this.C&&mi(this,a)){var d=this.db.Ha(b),e=this.db.Ha(c);if(d&&!e||!d&&e){const f=this.G.get(fi+a);a=this.G.get(ei+a);this.C||(this.C=d&&(null==f?void 0:f.some(g=>Fh(this.J,b,g.C)))||e&&(null==a?void 0:a.some(g=>Fh(this.J,c,g.C))))}}}hc(a,b,c){if(!this.C&&this.O&&mi(this,a)&&this.db.Zr(b,
|
|
687
|
+
new olympe.dc.Pa.Relation(a),c)){const d=this.G.get(fi+a);a=this.G.get(ei+a);const e=this.J;this.C||(this.C=(null==d?void 0:d.some(f=>Fh(e,b,f.C)&&Fh(e,c,f.U())))||(null==a?void 0:a.some(f=>Fh(e,c,f.C)&&Fh(e,b,f.U()))))}}}olympe.dc.query.rq.ya=[olympe.dc.Writable];function oi(a){return new olympe.dc.query.Relation(a.tag,a.direction,!0)}
|
|
688
688
|
olympe.dc.query.Relation=class extends olympe.dc.Pa.Relation{constructor(a,b,c){super(a,b);this.recursive=c}toJSON(){let a='{ "tag": '+JSON.stringify(this.X())+', ';a+='"direction": '+JSON.stringify(this.Ia())+', ';a+='"recursive": '+JSON.stringify(this.recursive);return a+'}'}static Pb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.dc.query.Relation(b.tag,b.direction,b.recursive)}static from(a,b){return new olympe.dc.query.Relation(a.X(),a.Ia(),null!=b?b:a instanceof olympe.dc.da.Ae)}bc(){const a=
|
|
689
|
-
olympe.dc.wa.DESTINATION,b=olympe.dc.wa.ORIGIN;return new olympe.dc.query.Relation(this.tag,this.direction===a?b:a,this.recursive)}U(){return`${this.direction}${this.tag}${this.recursive?'-r':''}`}};olympe.dc.query.R={Ca:'dc.query.Logger',
|
|
690
|
-
Array(this.$.length).fill(!1);let e=null;const f=(g,h)=>{d[g]=h;g=d.every(k=>k);e!==g&&(e=g,c(g))};this.$.forEach((g,h)=>{g.observe(a,olympe.Y.vb('AND-'+b+a+h),f.bind(null,h))})}ha(){return{pr:olympe.dc.query.Ba.C.
|
|
691
|
-
this.Ja))}observe(a,b,c){
|
|
689
|
+
olympe.dc.wa.DESTINATION,b=olympe.dc.wa.ORIGIN;return new olympe.dc.query.Relation(this.tag,this.direction===a?b:a,this.recursive)}U(){return`${this.direction}${this.tag}${this.recursive?'-r':''}`}};olympe.dc.query.R={Ca:'dc.query.Logger',Yj:'dc.query.QueryProcessor'};olympe.W.config(function(a){E(a,olympe.dc.query.R.Ca,[olympe.ka.R.Ea],b=>b.Vc('query'));C(a,olympe.dc.query.R.Yj,olympe.dc.query.dv,olympe.dc.query.R.Ca,olympe.dc.db.R.Ea,olympe.dc.transaction.R.Ea,olympe.dc.R.Dg,new olympe.W.oa(olympe.dc.V.Gh))});olympe.W.run([olympe.dc.query.R.Yj],a=>{olympe.dc.query.Dk=()=>a});olympe.dc.query.Ld=class extends Error{};olympe.dc.query.$={};olympe.dc.query.$.Fd=class extends olympe.dc.query.Ba{constructor(...a){super();this.$=a}compile(){return this.$.reduce((a,b)=>{const c=[];for(const d of b.compile()){for(const e of a)d.push(...e);c.push(d)}return c},[])}pd(){return new olympe.dc.query.$.xe(...this.$.map(a=>a.pd()))}Cb(){return this.$.flatMap(a=>a.Cb())}Kc(){throw Error('Should not try to check predicate coverage on And (should be removed by compiling predicates');}ob(a){return this.$.reduce((b,c)=>b&&c.ob(a),!0)}observe(a,b,c){const d=
|
|
690
|
+
Array(this.$.length).fill(!1);let e=null;const f=(g,h)=>{d[g]=h;g=d.every(k=>k);e!==g&&(e=g,c(g))};this.$.forEach((g,h)=>{g.observe(a,olympe.Y.vb('AND-'+b+a+h),f.bind(null,h))})}ha(){return{pr:olympe.dc.query.Ba.C.un,p:this.$.map(a=>a.ha())}}Pc(){throw Error('toObject for AND predicate should not be called');}toString(){return'And-'+this.$.reduce((a,b)=>a+'-'+b.toString(),'')}clear(a,b){this.$.forEach((c,d)=>{c.clear(a,olympe.Y.vb('AND-'+b+a+d))})}};olympe.dc.query.$.hf=class extends olympe.dc.query.Ba{constructor(a,b,c,d=!1){super();this.Ja=olympe.dc.ga(a);this.substring=b;this.db=c;this.C=d}Cb(){return[this.Ja]}Kc(a,b){return a instanceof olympe.dc.query.$.hf&&a.Ja===this.Ja?b?a.C?a.substring.toLowerCase().includes(this.substring.toLowerCase()):a.substring.includes(this.substring):this.C?this.substring.toLowerCase().includes(a.substring.toLowerCase()):this.substring.includes(a.substring):!1}Oa(){return this.Ja}ob(a){return this.apply(this.db.Oa(a,
|
|
691
|
+
this.Ja))}observe(a,b,c){Bg(this.db,a,this.Ja,d=>{c(this.apply(d))},olympe.Y.vb(b+a+this.toString()))}apply(a){a=olympe.dc.nb.Ac(a);return'string'===typeof a?this.C?a.includes(this.substring):a.toLowerCase().includes(this.substring.toLowerCase()):!1}toString(){return'Contains'+this.Ja+'-'+this.substring+'-'+this.C}clear(a,b){Cg(this.db,a,this.Ja,olympe.Y.vb(b+a+this.toString()))}Pc(){return{name:'CONTAINS',property:this.Oa(),value:this.substring,caseSensitive:this.C}}ha(){return{pr:olympe.dc.query.Ba.C.Aj,
|
|
692
692
|
p:this.Ja,s:this.substring,c:this.C}}};olympe.dc.query.$.se=class extends olympe.dc.query.Ba{constructor(a,b,c){super();this.Ja=olympe.dc.ga(a);this.C=olympe.dc.nb.Ac(null!=b?b:null);this.db=c}Cb(){return[this.Ja]}Kc(a){if(a instanceof olympe.dc.query.$.se&&this.Ja===a.Ja)if('object'===typeof this.C&&null!==this.C){if(this.C instanceof olympe.dc.CloudObject)return this.C.Fa(a.C);if(this.C instanceof Date)return a.C instanceof Date&&this.C.getTime()===a.C.getTime();if(this.C instanceof olympe.D.Color)return this.C.Fa(a.C)}else return this.C===
|
|
693
|
-
a.C;return!1}ob(a){return this.apply(this.db.Oa(a,this.Ja))}observe(a,b,c){
|
|
694
|
-
this.C}toString(){let a,b;const c=null!=(b=null==(a=this.C)?void 0:a.toString())?b:'null';return'Equals-'+this.Ja+'-'+c}Pc(){return{name:'EQUALS',property:this.Ja,value:this.C}}ha(){let a=1,b=this.C;switch(!0){case this.C instanceof Date:a=2;b=this.C.toJSON();break;case this.C instanceof olympe.dc.CloudObject:a=3;b=this.C.X();break;case this.C instanceof olympe.D.Color:a=4,b=this.C.toJSON()}return{pr:olympe.dc.query.Ba.C.
|
|
693
|
+
a.C;return!1}ob(a){return this.apply(this.db.Oa(a,this.Ja))}observe(a,b,c){Bg(this.db,a,this.Ja,d=>{c(this.apply(d))},olympe.Y.vb(b+a+this.toString()));null===this.C&&null===this.db.Oa(a,this.Ja)&&c(!0)}clear(a,b){Cg(this.db,a,this.Ja,olympe.Y.vb(b+a+this.toString()))}apply(a){a=olympe.dc.nb.Ac(a);return'object'===typeof a&&null!==a?a instanceof olympe.dc.CloudObject?a.Fa(this.C):a instanceof Date?this.C instanceof Date&&this.C.getTime()===a.getTime():a instanceof olympe.D.Color?a.Fa(this.C):!1:a===
|
|
694
|
+
this.C}toString(){let a,b;const c=null!=(b=null==(a=this.C)?void 0:a.toString())?b:'null';return'Equals-'+this.Ja+'-'+c}Pc(){return{name:'EQUALS',property:this.Ja,value:this.C}}ha(){let a=1,b=this.C;switch(!0){case this.C instanceof Date:a=2;b=this.C.toJSON();break;case this.C instanceof olympe.dc.CloudObject:a=3;b=this.C.X();break;case this.C instanceof olympe.D.Color:a=4,b=this.C.toJSON()}return{pr:olympe.dc.query.Ba.C.Co,p:this.Ja,t:a,v:b}}};function pi(a,b,c){return olympe.Y.vb(c+b+a.C+a.Ja)}
|
|
695
695
|
olympe.dc.query.$.xi=class extends olympe.dc.query.Ba{constructor(a,b,c,d=!0,e=!0){super();this.db=a;this.Ja=olympe.dc.ga(b);this.C=(this.G=('object'===typeof c||'string'===typeof c)&&olympe.dc.CloudObject.exists(c))?olympe.dc.ga(c):c;this.F=d;this.J=e}pd(){return new olympe.dc.query.$.xi(this.db,this.Ja,this.C,!this.F,!this.J)}Cb(){return[this.Ja]}Kc(a,b){if(b)throw Error('Check coverage of inequality should not happen with opposite = true');return a instanceof olympe.dc.query.$.xi&&this.Ja===a.Ja?
|
|
696
|
-
typeof this.C!==typeof a.C||this.F!==a.F?!1:this.G?this.C===a.C:this.F&&this.C>=a.C||!this.F&&this.C<=a.C:!1}Oa(){return this.Ja}ob(a){return this.compare(this.db.Oa(a,this.Ja),this.G?this.db.Oa(a,this.C):this.C)}observe(a,b,c){this.G&&
|
|
697
|
-
this.F?a<b:a>b:this.F?a<=b:a>=b}clear(a,b){
|
|
696
|
+
typeof this.C!==typeof a.C||this.F!==a.F?!1:this.G?this.C===a.C:this.F&&this.C>=a.C||!this.F&&this.C<=a.C:!1}Oa(){return this.Ja}ob(a){return this.compare(this.db.Oa(a,this.Ja),this.G?this.db.Oa(a,this.C):this.C)}observe(a,b,c){this.G&&Bg(this.db,a,this.C,d=>{const e=this.db.Oa(a,this.Ja);null!==e&&c(this.compare(e,d))},pi(this,a,b));Bg(this.db,a,this.Ja,d=>{const e=this.G?this.db.Oa(a,this.C):this.C;c(null!==e?this.compare(d,e):!0)},pi(this,a,b))}compare(a,b){return null===a?!1:null===b?!0:this.J?
|
|
697
|
+
this.F?a<b:a>b:this.F?a<=b:a>=b}clear(a,b){Cg(this.db,a,this.Ja,pi(this,a,b));this.G&&Cg(this.db,a,this.C,pi(this,a,b))}Pc(){return{name:'INEQUALITY_OPERATOR',property:this.Oa(),operator:this.F?'<':'>',strict:this.J,value:this.C}}ha(){return{pr:olympe.dc.query.Ba.C.lp,p:this.Ja,b:this.C,l:this.F,s:this.J}}toString(){return(this.F?'LowerThan-':'GreaterThan-')+this.Ja+'-'+this.J+'-'+this.C}};olympe.dc.query.$.de=class extends olympe.dc.query.Ba{constructor(a){super();this.C=a}compile(){const a=this.C.pd();return this.Fa(a)?super.compile():a.compile()}pd(){return this.C}Cb(){return this.C.Cb()}Kc(a,b){return a instanceof olympe.dc.query.$.de?this.C.Kc(a.C,b):this.C.Kc(a,!b)}ob(a){return!this.C.ob(a)}observe(a,b,c){let d=null;this.C.observe(a,olympe.Y.vb('NOT'+b+a),e=>{!e!==d&&(d=!e,c(d))})}Pc(){return{name:'NOT',predicate:this.C.Pc()}}ha(){return{pr:olympe.dc.query.Ba.C.Lp,v:this.C.ha()}}toString(){return`NOT-${this.C.toString()}`}clear(a,
|
|
698
698
|
b){this.C.clear(a,olympe.Y.vb('NOT'+b+a))}Fa(a){return a instanceof olympe.dc.query.$.de?this.C.Fa(a.C):!1}};olympe.dc.query.$.xe=class extends olympe.dc.query.Ba{constructor(...a){super();this.$=a}compile(){return this.$.map(a=>a.compile()).flat()}pd(){return new olympe.dc.query.$.Fd(...this.$.map(a=>a.pd()))}Cb(){return this.$.flatMap(a=>a.Cb())}Kc(){throw Error('Should not try to check predicate coverage on And (should be removed by compiling predicates');}ob(a){return this.$.reduce((b,c)=>b||c.ob(a),!1)}observe(a,b,c){const d=Array(this.$.length).fill(!1);let e=null;const f=(g,h)=>{d[g]=h;g=d.some(k=>
|
|
699
|
-
k);e!==g&&(e=g,c(g))};this.$.forEach((g,h)=>{g.observe(a,olympe.Y.vb('OR-'+b+a+h),f.bind(null,h))})}Pc(){throw Error('toObject for OR predicate should not be called');}ha(){return{pr:olympe.dc.query.Ba.C.Yp,p:this.$.map(a=>a.ha())}}toString(){return'And-'+this.$.reduce((a,b)=>a.toString()+'-'+b.toString(),'')}clear(a,b){this.$.forEach((c,d)=>{c.clear(a,olympe.Y.vb('OR-'+b+a+d))})}};olympe.dc.query.$.uf=class extends olympe.dc.query.Ba{constructor(a,b,c,d=!0){super();this.Ja=olympe.dc.ga(a);this.C='string'===typeof b?new RegExp(d?b:b.toLowerCase()):d?b:new RegExp(b.source.toLowerCase());this.db=c;this.F=d}Cb(){return[this.Ja]}Kc(a){return a instanceof olympe.dc.query.$.uf&&this.Ja===a.Ja&&this.C.toString()===a.C.toString()}ob(a){return this.apply(this.db.Oa(a,this.Ja))}observe(a,b,c){
|
|
700
|
-
return'string'===typeof a?this.C.test(this.F?a:a.toLowerCase()):!1}toString(){return'Regex'+this.Ja+'-'+this.C.toString()+'-'+this.F}Pc(){return{name:'REGEX',property:this.Ja,pattern:this.C,caseSensitive:this.F}}ha(){return{pr:olympe.dc.query.Ba.C.uq,p:this.Ja,r:this.C.source,c:this.F}}clear(a,b){
|
|
701
|
-
function
|
|
702
|
-
olympe.dc.query.ta.
|
|
703
|
-
b,c,d;return`${this.C}-${this.optional}${null!=(c=null==(a=this.F)?void 0:a.toString())?c:''}${null!=(d=null==(b=this.Ib)?void 0:b.toString())?d:''}`}Pc(){}toJSON(){}ha(){const a={i:this.C,o:this.optional};null!==this.F&&(a.p=this.F.ha());null!==this.Ib&&(a.c=this.Ib.ha());return a}Z(){}
|
|
704
|
-
|
|
705
|
-
f,g)}))}Fa(){}};olympe.dc.query.ta.Eh=class extends olympe.dc.query.ta.
|
|
706
|
-
c:0;this.content.set(a,b+1);return 0===b}remove(a,b){if(null===b)return this.content.delete(a);b=this.content.get(a);1<b?this.content.set(a,b-1):this.content.delete(a);return 1===b}};olympe.dc.query.ta.
|
|
707
|
-
c.push(a);return c}ob(a){const b=this.U();for(const c of
|
|
708
|
-
{recursive:!1,relation:this.relation,filter:
|
|
709
|
-
c.push(a);return c}ob(a){const b=this.U();for(const c of
|
|
710
|
-
{s:this.G,t:this.relation.X(),d:this.relation.Ia()})}J(){return`followRecursivelyPart-${this.relation.U()}-${this.G}-${super.J()}`}Pc(){const a={recursive:this.G?'INCLUDE_SELF':'EXCLUDE_SELF',relation:this.relation,filter:
|
|
711
|
-
direction:this.relation.Ia()}}Fa(a){return a instanceof olympe.dc.query.ta.te&&this.relation.Fa(a.relation)&&this.G===a.G}};olympe.dc.query.ta.Td=class extends olympe.dc.query.ta.
|
|
712
|
-
g=olympe.dm.Relation.C.
|
|
713
|
-
l):
|
|
699
|
+
k);e!==g&&(e=g,c(g))};this.$.forEach((g,h)=>{g.observe(a,olympe.Y.vb('OR-'+b+a+h),f.bind(null,h))})}Pc(){throw Error('toObject for OR predicate should not be called');}ha(){return{pr:olympe.dc.query.Ba.C.Yp,p:this.$.map(a=>a.ha())}}toString(){return'And-'+this.$.reduce((a,b)=>a.toString()+'-'+b.toString(),'')}clear(a,b){this.$.forEach((c,d)=>{c.clear(a,olympe.Y.vb('OR-'+b+a+d))})}};olympe.dc.query.$.uf=class extends olympe.dc.query.Ba{constructor(a,b,c,d=!0){super();this.Ja=olympe.dc.ga(a);this.C='string'===typeof b?new RegExp(d?b:b.toLowerCase()):d?b:new RegExp(b.source.toLowerCase());this.db=c;this.F=d}Cb(){return[this.Ja]}Kc(a){return a instanceof olympe.dc.query.$.uf&&this.Ja===a.Ja&&this.C.toString()===a.C.toString()}ob(a){return this.apply(this.db.Oa(a,this.Ja))}observe(a,b,c){Bg(this.db,a,this.Ja,d=>{c(this.apply(d))},olympe.Y.vb(b+a+this.toString()))}apply(a){a=olympe.dc.nb.Ac(a);
|
|
700
|
+
return'string'===typeof a?this.C.test(this.F?a:a.toLowerCase()):!1}toString(){return'Regex'+this.Ja+'-'+this.C.toString()+'-'+this.F}Pc(){return{name:'REGEX',property:this.Ja,pattern:this.C,caseSensitive:this.F}}ha(){return{pr:olympe.dc.query.Ba.C.uq,p:this.Ja,r:this.C.source,c:this.F}}clear(a,b){Cg(this.db,a,this.Ja,olympe.Y.vb(b+a+this.toString()))}};olympe.dc.query.$.qm=class extends olympe.dc.query.Ba{constructor(a){super();this.C=new Set(a.map(olympe.dc.ga))}Cb(){return[]}Kc(a){return a instanceof olympe.dc.query.$.qm&&Array.from(a.C).every(b=>this.C.has(b))}ob(a){return this.C.has(a)}observe(a,b,c){c(this.C.has(a))}clear(){}toString(){return'Tags-'+Array.from(this.C)}Pc(){return{name:'IS',tags:Array.from(this.C)}}ha(){return{pr:olympe.dc.query.Ba.C.Zq,t:Array.from(this.C)}}};olympe.dc.query.ta={};function ni(a){let b,c;const d=new Set(null!=(c=null==(b=a.F)?void 0:b.Cb())?c:[]);let e;a.Ib&&d.add(null==(e=a.Ib)?void 0:e.Oa().X());return d}function qi(a){if(!a.ea){let b,c;a.ea=null!=(c=null==(b=a.F)?void 0:b.compile())?c:[]}return a.ea}function ri(a,b){for(const c of b)if(a.some(d=>d.Kc(c,!1)))return!0;return!1}
|
|
701
|
+
function si(a,b){if(null===a.F)return b;let c=!1;const d=a.toString();return(e,f,g,h)=>{const k=olympe.Y.vb(h+f+d);e?a.F.observe(f,k,l=>{c||b(l,f,g,k)}):(c=!0,a.F.clear(f,k),c=!1,b(!1,f,g,k))}}function ti(a,b,c){if(null===a.Ib)return c;const d=a.toString();return(e,f,g,h)=>{const k=a.Ib.Oa();h=olympe.Y.vb(h+d);e?Bg(a.db,f,k,()=>{Dh(b)},h):Cg(a.db,f,k,h);c(e,f,g,h)}}
|
|
702
|
+
olympe.dc.query.ta.am=class{constructor(a,b){this.db=olympe.dc.ia();this.C=a;this.optional=b;this.ea=this.Ib=this.F=this.id=null}static C(a){var b=a.i;if('string'===typeof a.f)return new olympe.dc.query.ta.Td(b,a.f);var c=a.o;const d=new olympe.dc.Pa.Relation(a.t,a.d);b='boolean'===typeof a.s?new olympe.dc.query.ta.te(b,d,a.s,c):new olympe.dc.query.ta.oh(b,d,c);void 0!==a.p&&(b.F=Mh(a.p));void 0!==a.c&&(c=b.U(),a=a.c,a=new olympe.dc.query.gf(c,new olympe.dc.Pa.Property(a.p),a.o),b.Ib=a);return b}O(){}J(){let a,
|
|
703
|
+
b,c,d;return`${this.C}-${this.optional}${null!=(c=null==(a=this.F)?void 0:a.toString())?c:''}${null!=(d=null==(b=this.Ib)?void 0:b.toString())?d:''}`}Pc(){}toJSON(){}ha(){const a={i:this.C,o:this.optional};null!==this.F&&(a.p=this.F.ha());null!==this.Ib&&(a.c=this.Ib.ha());return a}Z(){}va(){return new olympe.dc.query.ta.jm}aa(){}U(){null===this.id&&(this.id=this.Z());return this.id}T(){return this.optional}Kc(a){const b=qi(this);if(0===b.length)return!0;a=qi(a);if(0===a.length)return!1;for(const c of a)if(!b.some(d=>
|
|
704
|
+
ri(d,c)))return!1;return!0}filter(a){const b=this.O(),c=b.F;null===c?b.F=a:b.F=c instanceof olympe.dc.query.$.Fd?new olympe.dc.query.$.Fd(...Array.from(c.$),a):new olympe.dc.query.$.Fd(b.F,a);return b}sort(a,b){const c=this.O();c.Ib=new olympe.dc.query.gf(this.U(),a,b);return c}Rg(){return this.Ib}ob(a){if(null!==this.F){var b=this.U();for(const c of Eh(a,b))this.F.ob(c)||a.remove(c,b,null)}}observe(a,b){const c=this.U();return si(this,ti(this,a,(d,e,f,g)=>{(d?Gh(a,e,c,f):a.remove(e,c,f))&&b(d,e,
|
|
705
|
+
f,g)}))}Fa(){}};olympe.dc.query.ta.Eh=class extends olympe.dc.query.ta.am{constructor(a,b,c){super(a,c);this.relation=b;this.ja=null}};olympe.dc.query.ta.jq=class{has(){}O(){}F(){}ad(){}G(){}remove(){}};olympe.dc.query.ta.ho=class{constructor(a){this.C=null;this.content=new Map;this.J=null!=a?a:null}ad(){return this.content.keys()}F(a){return this.content.has(a)&&null!==this.C?[this.C].values():[].values()}has(a){return this.content.has(a)}O(a){let b;return(null==(b=this.J)?void 0:b.call(this,a))||!1}G(a,b){if(null===this.C)this.C=b;else if(b!==this.C)throw Error('Should never try to insert multi parent in the same counter part result. To be used with FollowRulePart only');let c;b=null!=(c=this.content.get(a))?
|
|
706
|
+
c:0;this.content.set(a,b+1);return 0===b}remove(a,b){if(null===b)return this.content.delete(a);b=this.content.get(a);1<b?this.content.set(a,b-1):this.content.delete(a);return 1===b}};olympe.dc.query.ta.ho.ya=[olympe.dc.query.ta.jq];olympe.dc.query.ta.oh=class extends olympe.dc.query.ta.Eh{constructor(a,b,c){super(a,olympe.dc.query.Relation.from(b,!1),c)}O(){const a=new olympe.dc.query.ta.oh(this.C,this.relation,this.optional);a.F=this.F;a.Ib=this.Ib;return a}Z(){return olympe.Y.vb(this.C+this.relation.U())}aa(a,b){if(b instanceof olympe.dc.query.ta.Td)return[a];const c=[a+this.relation.U(),a+oi(this.relation).U()+!1,a+oi(this.relation).U()+!0,a+'followRules'].map(d=>olympe.Y.vb(d));b instanceof olympe.dc.query.ta.te&&b.relation.Fa(this.relation)&&
|
|
707
|
+
c.push(a);return c}ob(a){const b=this.U();for(const c of Eh(a,this.C))this.db.bb(c,this.relation).forEach(d=>{Gh(a,d,b,c)});super.ob(a)}observe(a,b){const c=super.observe(a,b),d=this.relation.X(),e=this.relation.Ia();return(f,g,h,k)=>{const l=olympe.Y.vb(k+g+this.toString());f?V(this.db,g,this.relation,(n,p)=>{Hh(a,n,d,e,g,p);c(n,p,g,l)},l):this.db.F(g,this.relation,l)}}ha(){return Object.assign(super.ha(),{t:this.relation.X(),d:this.relation.Ia()})}J(){return`followPart-${this.relation.U()}-${super.J()}`}Pc(){const a=
|
|
708
|
+
{recursive:!1,relation:this.relation,filter:qi(this).map(b=>b.map(c=>c.Pc())),optional:this.T()};this.Ib&&(a.sort={property:this.Ib.Oa(),order:this.Ib.Ai});return a}toString(){return`Follow Part: ${this.relation}`}toJSON(){return{type:'follow',relation:`${this.db.name(this.relation)} (${this.relation.X()})`,direction:this.relation.Ia()}}Fa(a){return a instanceof olympe.dc.query.ta.oh&&this.relation.Fa(a.relation)}};olympe.dc.query.ta.te=class extends olympe.dc.query.ta.Eh{constructor(a,b,c,d){super(a,olympe.dc.query.Relation.from(b,!0),d);this.G=c}O(){const a=new olympe.dc.query.ta.te(this.C,this.relation,this.G,this.optional);a.F=this.F;a.Ib=this.Ib;return a}Z(){return olympe.Y.vb(this.C+this.relation.U()+this.G)}aa(a,b){if(b instanceof olympe.dc.query.ta.Td)return[a];const c=[a+this.relation.U()+this.G,a+'followRules'].map(d=>olympe.Y.vb(d));b instanceof olympe.dc.query.ta.te&&b.relation.Fa(this.relation)&&
|
|
709
|
+
c.push(a);return c}ob(a){const b=this.U();for(const c of Eh(a,this.C))this.G&&Gh(a,c,b,c),this.db.Vg(c,this.relation).forEach(d=>{Gh(a,d,b,c)});super.ob(a)}observe(a,b){const c=super.observe(a,b),d=this.relation.X(),e=this.relation.Ia(),f=new Set,g=(h,k,l,n,p)=>{k=olympe.Y.vb(k+h+p+l);if(this.G||0<l)0<l&&Hh(a,n,d,e,h,p),c(n,p,h,k);n?f.has(p)||(f.add(p),V(this.db,p,this.relation,g.bind(this,h,k,l+1),k)):(f.delete(p),this.db.F(p,this.relation,k))};return(h,k,l,n)=>g(k,n+this.toString(),0,h,k)}ha(){return Object.assign(super.ha(),
|
|
710
|
+
{s:this.G,t:this.relation.X(),d:this.relation.Ia()})}J(){return`followRecursivelyPart-${this.relation.U()}-${this.G}-${super.J()}`}Pc(){const a={recursive:this.G?'INCLUDE_SELF':'EXCLUDE_SELF',relation:this.relation,filter:qi(this).map(b=>b.map(c=>c.Pc())),optional:this.T()};this.Ib&&(a.sort={property:this.Ib.Oa(),order:this.Ib.Ai});return a}toString(){return`FollowRecursively Part: ${this.relation}`}toJSON(){return{type:'follow recursively',relation:`${this.db.name(this.relation)} (${this.relation.X()})`,
|
|
711
|
+
direction:this.relation.Ia()}}Fa(a){return a instanceof olympe.dc.query.ta.te&&this.relation.Fa(a.relation)&&this.G===a.G}};olympe.dc.query.ta.Td=class extends olympe.dc.query.ta.am{constructor(a,b,c){super(a,!1);this.Ob=b;this.G=null!=c?c:null}O(){return new olympe.dc.query.ta.Td(this.C,this.Ob,this.G)}Z(){return olympe.Y.vb(this.C+'followRules')}va(){return new olympe.dc.query.ta.ho(this.G)}aa(a,b){return b instanceof olympe.dc.query.ta.Td?[a]:[olympe.Y.vb(a+'followRules')]}Kc(a){if(a instanceof olympe.dc.query.ta.Eh){const b=olympe.dc.wa.ORIGIN,c=olympe.dc.wa.DESTINATION,d=olympe.dc.mc.Yc,e=olympe.dc.mc.ni,f=olympe.dm.Relation.C.gm,
|
|
712
|
+
g=olympe.dm.Relation.C.tm;a=a.relation;const h=a.Ia(),k=a.X();return h!==c||k!==d&&k!==e?!!(Kg(this.db,a,this.Ob)&(a.Ia()===b?f:g)):!0}return a instanceof olympe.dc.query.ta.Td?this.Ob===a.Ob:!1}ob(a){const b=this.U();for(const c of Eh(a,this.C))for(const d of If(this.db,c,this.Ob))Gh(a,d,b,c)}observe(a,b){const c=this.U(),d=(e,f,g,h,k)=>{const l=`${h}:${g}`;f?Lg(this.db,g,this.Ob,(n,p,q,r,t)=>{q&&!k.includes(t)&&(q=r?Gh(a,t,c,e):a.remove(t,c,e),null!==p&&Hh(a,r,n,p,g,t),q&&d(e,r,t,h,new ui(t,k)))},
|
|
713
|
+
l):Mg(this.db,g,this.Ob,l);b(f,g,e,l)};return(e,f,g,h)=>{g=olympe.Y.vb(h+f+this.toString());(e?Gh(a,f,c,f):a.remove(f,c,f))&&d(f,e,f,g,new ui(f,null))}}ha(){return Object.assign(super.ha(),{f:this.Ob})}J(){return`followRulePart-${this.Ob}-${super.J()}`}Pc(){throw Error('Try to parse a part of an implicit query. Data connectors do not support those queries.');}toString(){return`FollowRule Part: ${this.db.name(this.Ob)} (${this.Ob})`}Fa(a){return a instanceof olympe.dc.query.ta.Td&&this.Ob===a.Ob}toJSON(){return{type:'follow rule',
|
|
714
714
|
rule:`${this.db.name(this.Ob)} (${this.Ob})`}}T(){return!1}filter(){olympe.ka.ab('dc.query').warn('Should never try to filter on queries with follow rules, ignore...');return this}sort(){olympe.ka.ab('dc.query').warn('Should never try to sort queries with follow rules, ignore...');return this}};olympe.dc.query.ta.Td.F='followRules';
|
|
715
|
-
class
|
|
716
|
-
function
|
|
717
|
-
k[
|
|
718
|
-
(O.content=p);break;default:throw Error(`Data Http request type not supported ${n}`);}let M;const xa=null!=(M=k['X-Source-Origin'])?M:olympe.dc.Sa.sf;var q=
|
|
719
|
-
|
|
720
|
-
function
|
|
721
|
-
function
|
|
722
|
-
function
|
|
723
|
-
function
|
|
724
|
-
olympe.dc.sources.At=class{constructor(a,b,c,d,e,f){this.H=a;this.T=b;this.J=c;this.Z=d;this.aa=e;this.F=f;this.G=new Map;new olympe.D.Xb('Http service of remote data provider');this.O=new Map;this.C=new Map;this.ea=new Map([[olympe.dc.Request.C.tg,olympe.N.Zb.tg],[olympe.dc.Request.C.Tf,olympe.N.Zb.
|
|
725
|
-
[olympe.dc.Request.C.Bg,olympe.N.Zb.
|
|
726
|
-
`${f}/${b}`:`${f}?tag=${b}&model=${c}`,
|
|
727
|
-
return
|
|
728
|
-
e).then(h=>{const k=h instanceof ArrayBuffer?new Uint8Array(h,0,h.byteLength):h;let l;null==(l=this.C.get(b))||l.forEach(n=>n.done(k))}).catch(h=>{let k;null==(k=this.C.get(b))||k.forEach(l=>l.Th(`${h}`))}).finally(()=>{this.C.delete(b)});return f}};olympe.dc.sources.
|
|
729
|
-
function
|
|
730
|
-
function
|
|
731
|
-
olympe.dc.sources.Dp=class{constructor(a,b){this.H=a;this.C=b;this.Wb=null;this.O=olympe.dc.query.
|
|
732
|
-
for(const [f,g]of e)this.H.debug(`=> DataType: ${g.name()} (${f})`)}d&&(d=!1,b())},c))})).then(()=>this.C.init(this.G)).catch(b=>{this.H.error(`Error while initialization of DataSource ${this.C.name()} (${this.U()}): ${b}`)});return this}healthCheck(){return this.C.healthCheck().then(()=>`Data source ${this.C.name()} (${this.C.U()}) OK`)}destroy(){this.G.destroy();return this.C.destroy()}request(a){const b=a.content;var c=a.getType();switch(c){case
|
|
733
|
-
return this.C.healthCheck().then(()=>({s:e})).catch(g=>({s:d,r:String(g)}));case
|
|
734
|
-
b.qc());case
|
|
735
|
-
b,this.G,a,olympe.dc.pa.Zc.Qf,{}).pipe(rxjs.operators.map(c=>{let d,e;return null!=(e=null==(d=c.Ge)?void 0:d.G)?e:null}),rxjs.operators.filter(c=>null!==c),rxjs.operators.map(c=>
|
|
736
|
-
function
|
|
737
|
-
class
|
|
738
|
-
olympe.dc.sources.
|
|
739
|
-
q=a.getType();var r=a.
|
|
740
|
-
Array.from(l.qc().yd()).length,'relations');else if(q===e||q===f||q===h)b.H.debug('Data Provider: Persisting graph patch in offline cache after successful transaction'),yield
|
|
741
|
-
|
|
742
|
-
new rxjs.Observable(h=>{olympe.D.js([this.F.Kf()],()=>{h.error(new olympe.N.errors.
|
|
743
|
-
function
|
|
744
|
-
function
|
|
745
|
-
g=yield d.
|
|
746
|
-
olympe.dc.sources.Fq=class extends olympe.dc.sources.
|
|
747
|
-
c)?b.get(c,a):Promise.resolve({s:f});a=
|
|
748
|
-
a):b.get(c,a)).finally(()=>
|
|
749
|
-
b){const c=a.
|
|
750
|
-
!0)).filter(olympe.dc.query.Ba.Fa(olympe.dm.DataSource.Fr,!0)).observe(this.G).subscribe(b=>{
|
|
751
|
-
b.X(),d=new olympe.D.Xb(`Published data provider context ${c}`,this.G);this.ea.set(c,d);let e,f;
|
|
752
|
-
{this.H.warn(`Error occurred while processing request from ${l.source()}: ${n}`);return l.Th(n instanceof Error?n:Error(n))})}))})}
|
|
753
|
-
class
|
|
754
|
-
olympe.dc.sources.fc=class extends olympe.N.fc{constructor(a){super();this.aa=a;this.db=a.view;this.G=new Map}ha(a){a=super.ha(a);if(0<this.G.size){const b=Array.from(this.G.values());this.G.clear();return Object.assign(Q(Y.mr,a),{i:b})}return a}O(a){return(null==a?void 0:a.t)===Y.mr&&Array.isArray(null==a?void 0:a.i)?(
|
|
755
|
-
if(e.startsWith('blob:')||e.startsWith('stream:'))a=olympe.dc.Nr().
|
|
756
|
-
{r:a.getType(),o:a.origin,d:a.
|
|
757
|
-
case Y.
|
|
758
|
-
case Y.
|
|
759
|
-
olympe.dc.Request.C.fh,
|
|
760
|
-
function
|
|
761
|
-
function
|
|
762
|
-
function
|
|
763
|
-
function
|
|
764
|
-
e))})}return b}function
|
|
765
|
-
function
|
|
766
|
-
function
|
|
767
|
-
olympe.dc.sources.Uq=class extends olympe.dc.sources.
|
|
768
|
-
Promise.resolve(
|
|
769
|
-
c)):(this.H.error(`Server is disconnected, backup of instance ${c} is canceled.`),c=Promise.reject('Server is disconnected')),c;case
|
|
770
|
-
b,{});case
|
|
771
|
-
b()}),rxjs.operators.finalize(()=>{this.O.add(d);
|
|
772
|
-
a,b).then(f=>{
|
|
773
|
-
olympe.dc.sources.Uq.ya=[olympe.dc.sources.
|
|
774
|
-
olympe.dc.sources.
|
|
775
|
-
!0;var a=new olympe.dc.Xa;Z(a.create(olympe.dm.DataSource,this.C).ci(this.C),olympe.dm.DataSource.Oh,!0);a.Ma(olympe.dm.DataSource.
|
|
776
|
-
olympe.dc.sources.V={ph:'data.httpHost',lf:'data.httpPort',ti:'data.httpSSL',
|
|
777
|
-
olympe.W.config(function(a){const b=['localhost','127.0.0.1'],c=a.getParameter(olympe.net.V.
|
|
778
|
-
(e,f)=>{if(f)return f;f=b.includes(e);const g=e.endsWith(d);e=e.endsWith(c);return f?3141:g?85:e?80:443});Qa(a,olympe.dc.sources.sh.ti,[olympe.dc.sources.sh.lf,olympe.dc.sources.V.ti],(e,f)=>null!==f?f:443===e);F(a,olympe.dc.sources.V.
|
|
779
|
-
olympe.dc.sources.At,olympe.dc.sources.R.Ca,olympe.net.R.Ui,olympe.N.R.
|
|
780
|
-
olympe.dc.sources.R.Ca,olympe.N.R.
|
|
781
|
-
new olympe.W.oa(olympe.net.V.Wp),new olympe.W.oa(olympe.dc.sources.V.VERSION));C(a,olympe.dc.sources.R.
|
|
782
|
-
olympe.dc.sources.cache.
|
|
783
|
-
return{t:13,i:a.U(),v:
|
|
784
|
-
function
|
|
785
|
-
a.
|
|
786
|
-
function
|
|
787
|
-
function
|
|
788
|
-
f={tag:h,model:g.Vb(),mimeType:l};const n=new olympe.dc.Request(olympe.dc.Request.C.Tf,c,f);f=hb(a.Tc,()=>a.Wb.request(n).then(p=>
|
|
789
|
-
function
|
|
790
|
-
function
|
|
791
|
-
function
|
|
792
|
-
function
|
|
793
|
-
l=yield a.Wb.request(l);b.Qc(k,new Map([[olympe.dm.File.urlProp.X(),l]]))})));d=new olympe.dc.Request(d,c,new olympe.dc.transaction.Ri(b,!1));if(
|
|
794
|
-
function
|
|
715
|
+
class ui{constructor(a,b){this.tag=a;this.C=b}includes(a){let b;return this.tag===a||!(null==(b=this.C)||!b.includes(a))}toString(){return this.C?`${this.C.toString()} -> ${this.tag}`:this.tag}};olympe.dc.query.ta.jm=class{constructor(){this.content=new Map}ad(){return this.content.keys()}F(a){let b,c;return null!=(c=null==(b=this.content.get(a))?void 0:b.values())?c:[]}has(a){return this.content.has(a)}O(){return!1}G(a,b){let c=this.content.get(a);c||(c=new Set,this.content.set(a,c));a=c.size;c.add(b);return a<c.size}remove(a,b){if(null===b)return this.content.delete(a);const c=this.content.get(a);b=c.delete(b);0===c.size&&this.content.delete(a);return b}};olympe.dc.query.ta.jm.ya=[olympe.dc.query.ta.jq];olympe.dc.sources={};olympe.dc.sources.Gq=class extends Error{};olympe.dc.sources.Gj=class{U(){}init(){}destroy(){}request(){return v(function*(){})}subscribe(){}};const vi=olympe.net.Aa.Id.GET,wi=olympe.net.Aa.Id.Ah,xi=olympe.net.Aa.Id.Dc,yi=olympe.net.Aa.Id.iq,zi=olympe.net.Aa.Headers.ki,Ai=olympe.net.Aa.Headers.Gn,Bi=olympe.net.Aa.Yb.xh,Ci=olympe.net.Aa.Yb.Xn,Di=olympe.net.Aa.Yb.Lo,Ei=olympe.net.Aa.Yb.Li,Fi=olympe.net.Aa.Yb.Ol;
|
|
716
|
+
function Gi(a){const b=`/${olympe.W.getParameter(olympe.dc.sources.V.vl)}/:${'sourceId'}/:${'requestType'}`.replace(/\/+/g,'/').replace(/\/$/,'');a.T.G('_DataSourcesHTTPService',b,[vi,wi,xi,yi],(c,d,e)=>v(function*(){const f=d.get('sourceId');var g=a.G.get(d.get('sourceId'));if(!g){var h;g=null!=(h=olympe.dc.ia().name(f))?h:'name unknown';return Promise.resolve(new olympe.net.be(`No handler found for datasource ${f} called '${g}'`,Fi,'Invalid source id'))}h=c.method;const k=c.fj();try{var l=yield Hi(a,
|
|
717
|
+
k[Ai])}catch(r){return new olympe.net.be(`Invalid token ${r}`,Di,'Access denied')}try{var n=Number(d.get('requestType')),p=c.body;const r=olympe.dc.Request.C.Hb,t=olympe.dc.Request.C.Bg,u=olympe.dc.Request.C.Ue,x=olympe.dc.Request.C.Mg,y=olympe.dc.Request.C.fh,z=olympe.dc.Request.C.rg,A=olympe.dc.Request.C.Tf,D=olympe.dc.Request.C.ag;let O;switch(n){case r:break;case t:case u:case y:case x:O=a.F.O(p);break;case D:case z:case A:O={tag:e.get('tag'),model:e.get('model'),mimeType:k[zi]};p instanceof Uint8Array&&
|
|
718
|
+
(O.content=p);break;default:throw Error(`Data Http request type not supported ${n}`);}let M;const xa=null!=(M=k['X-Source-Origin'])?M:olympe.dc.Sa.sf;var q=lf(new olympe.dc.Request(n,f,O,l),xa);const Ra=yield g(q);let Xc;void 0===Ra?Xc='':Ra instanceof Blob||Ra instanceof Uint8Array||Ra instanceof ArrayBuffer||'function'===typeof(null==Ra?void 0:Ra.pipe)?Xc=Ra:Xc=JSON.stringify(a.F.ha(Ra));return new olympe.net.be(Xc,h===yi?Ci:Bi)}catch(r){return r instanceof olympe.dc.sources.Gq?new olympe.net.be(`Authorization error: ${r}`,
|
|
719
|
+
Di,'Forbidden'):new olympe.net.be(`Internal server error: ${r}`,Ei,'Internal server error')}})).catch(c=>a.H.error(`Error while starting the HTTP Service: ${c}`));a.H.debug(`Started HTTP service with path: ${b}`)}function Ii(a){a.T.Z('_DataSourcesHTTPService').catch(b=>{a.H.error(`An error occurred while stopping the data sources http service: ${b}`)})}function Ji(a,b,c){0===a.G.size&&Gi(a);a.G.set(b,c);return()=>{a.G.delete(b);0===a.G.size&&Ii(a)}}
|
|
720
|
+
function Ki(a,b,c){c=b instanceof olympe.dm.DataSource?b.Df(c):Li(b,c);null===c&&a.H.error(`Impossible to build URL for data source ${b}`);return c}
|
|
721
|
+
function Mi(a,b,c){if(b===olympe.dc.Sa.SERVER){var d;return null!=(d=Cd(a.J,a.ea.get(c)))?d:null}var e=a.O.get(b);if(!e){d=a.aa.tb(b);e=olympe.dc.sources.V.ph;const f=olympe.dc.sources.V.lf,g=olympe.dc.sources.V.ti,h=olympe.dc.sources.V.vl;let k;e=`${Ki(a,null!=d?d:b,g)?'https':'http'}://${Ki(a,null!=d?d:b,e)}:${null!=(k=Ki(a,null!=d?d:b,f))?k:Ki(a,null!=d?d:b,g)?443:80}`+`/${Ki(a,null!=d?d:b,h)}/${b}`.replace(/\/+/g,'/').replace(/\/$/,'');a.O.set(b,e)}return`${e}/${c}`}
|
|
722
|
+
function Ni(a,b){return b instanceof olympe.net.wi?Ed(a.J,b,id(a.Z).wd()):Promise.reject('No http request to send')}function Oi(a,b){var c=Mi(a,b.ic(),b.getType());if(!c)return Promise.reject(`No destination URL to send the query to destination: ${b.ic()}`);const d=b.content,e=JSON.stringify(a.F.ha(d));c=N(c,wi,e);rc(c,{['X-Source-Origin']:b.origin,[zi]:'application/json'});return Ni(a,c).then(f=>'string'===typeof f?a.F.O(JSON.parse(f)):olympe.dc.query.td.cj(d))}
|
|
723
|
+
function Pi(a,b){var c=Mi(a,b.ic(),b.getType());if(!c)return Promise.reject(`No destination URL to send the transaction to destination: ${b.ic()}`);const d=JSON.stringify(a.F.ha(b.content));c=N(c,wi,d);rc(c,{['X-Source-Origin']:b.origin,[zi]:'application/json'});return Ni(a,c).then(e=>Number.parseInt(e,10))}function Hi(a,b){return'string'!==typeof b?Promise.reject('Please provide an authorization token.'):new Promise((c,d)=>{a.Z.Yg(b,(e,f)=>{e?d(e):c(f)})})}
|
|
724
|
+
olympe.dc.sources.At=class{constructor(a,b,c,d,e,f){this.H=a;this.T=b;this.J=c;this.Z=d;this.aa=e;this.F=f;this.G=new Map;new olympe.D.Xb('Http service of remote data provider');this.O=new Map;this.C=new Map;this.ea=new Map([[olympe.dc.Request.C.tg,olympe.N.Zb.tg],[olympe.dc.Request.C.Tf,olympe.N.Zb.Jj],[olympe.dc.Request.C.ag,olympe.N.Zb.Jj],[olympe.dc.Request.C.rg,olympe.N.Zb.Jj],[olympe.dc.Request.C.In,olympe.N.Zb.Hn],[olympe.dc.Request.C.yq,olympe.N.Zb.xq],[olympe.dc.Request.C.Yo,olympe.N.Zb.Xo],
|
|
725
|
+
[olympe.dc.Request.C.Bg,olympe.N.Zb.Sn],[olympe.dc.Request.C.Mg,olympe.N.Zb.TRANSACTION]])}Gc(a){var b=Mi(this,a.ic(),a.getType());if(!b)return Promise.reject(`No destination URL to send the status request to destination: ${a.ic()}`);b=N(b,vi);rc(b,{['X-Source-Origin']:a.origin});return Ni(this,b)}uploadFileContent(a){const {tag:b,model:c,content:d}=a.content,e=a.ic(),f=Mi(this,e,a.getType());if(!f)return Promise.reject(`No destination URL to upload the file. ${b}`);const g=N(e===olympe.dc.Sa.SERVER?
|
|
726
|
+
`${f}/${b}`:`${f}?tag=${b}&model=${c}`,yi,d);rc(g,{[zi]:'application/octet-stream'});e!==olympe.dc.Sa.SERVER&&rc(g,{['X-Source-Origin']:a.origin});return Ni(this,g).then(()=>(new URL(g.C())).pathname)}deleteFileContent(a){const {tag:b,model:c}=a.content,d=a.ic();var e=Mi(this,d,a.getType());if(!e)return Promise.reject(`No destination URL to delete the file. ${b}`);e=N(d===olympe.dc.Sa.SERVER?`${e}/${b}`:`${e}?tag=${b}&model=${c}`,xi,b);d!==olympe.dc.Sa.SERVER&&rc(e,{['X-Source-Origin']:a.origin});
|
|
727
|
+
return Ni(this,e).then()}downloadFileContent(a){const {tag:b,model:c}=a.content,d=a.ic();var e=Mi(this,d,a.getType());if(!e)return Promise.reject(Error(`No destination URL to download the file. ${b}`));var f;const g=null!=(f=this.C.get(b))?f:[];f=new Promise((h,k)=>{g.push({done:h,Th:k})});if(this.C.has(b))return f;this.C.set(b,g);e=N(d===olympe.dc.Sa.SERVER?`${e}/${b}`:`${e}?tag=${b}&model=${c}`,vi,b,olympe.net.Aa.ResponseType.Ti);d!==olympe.dc.Sa.SERVER&&rc(e,{['X-Source-Origin']:a.origin});Ni(this,
|
|
728
|
+
e).then(h=>{const k=h instanceof ArrayBuffer?new Uint8Array(h,0,h.byteLength):h;let l;null==(l=this.C.get(b))||l.forEach(n=>n.done(k))}).catch(h=>{let k;null==(k=this.C.get(b))||k.forEach(l=>l.Th(`${h}`))}).finally(()=>{this.C.delete(b)});return f}};olympe.dc.sources.pp=class{constructor(a,b){this.H=a;this.Wb=b}};olympe.dc.sources.pp.Yb={Ni:0,NB:1,OB:3,jB:4};const Qi=olympe.dc.Request.C.Hb,Ri=olympe.dc.Request.C.Bg,Si=olympe.dc.Request.C.Zj,Ti=olympe.dc.Request.C.ag,Ui=olympe.dc.Request.C.Tf,Vi=olympe.dc.Request.C.rg,Wi=olympe.dc.Request.C.ii,Xi=olympe.dc.Request.C.fh,Yi=olympe.dc.Request.C.Ue,Zi=olympe.dc.Request.C.Mg;
|
|
729
|
+
function $i(a,b){const c=b.U();null===a.F&&(a.F=new olympe.Y.Hh(6E4),Za(a.F,(f,g)=>{a.applyTransaction(g,!1).catch(h=>{a.H.error(`Error occurred when applying burst transaction ${f} to the data source: ${h}`)})}),$a(a.F,()=>{a.F=null}));let d;const e=null!=(d=a.F.get(c))?d:new olympe.dc.db.tc(c);b.Jc(e);Xa(a.F.C,c)||a.F.set(c,e)}
|
|
730
|
+
function aj(a,b){const c=b.U();let d,e;const f=null!=(e=null==(d=a.F)?void 0:d.get(c))?e:new olympe.dc.db.tc(c);let g;null==(g=a.F)||g.delete(c);b.Jc(f);return a.applyTransaction(f,!1).catch(h=>{a.H.error(`Error occurred when applying burst transaction ${c} to the data source: ${h}`)})}function bj(a,b){const c=rxjs.defer(()=>a.C.executeQuery(b));return 0<a.T?rxjs.interval(a.T).pipe(rxjs.operators.switchMap(()=>c)):c}
|
|
731
|
+
olympe.dc.sources.Dp=class{constructor(a,b){this.H=a;this.C=b;this.Wb=null;this.O=olympe.dc.query.Dk();this.J=olympe.dc.Jr();this.G=new olympe.D.Xb('Context of source '+this.U());let c;this.T=null!=(c=b.Df(olympe.dc.sources.V.Xl))?c:-1;this.F=null}U(){return this.C.U()}init(a){this.Wb=a;if(this.U()===olympe.dc.Sa.SELF)return this;(new Promise((b,c)=>{let d=!0;cj(this.C,this.G).subscribe(rxjs.Subscriber.create(e=>{if(this.H.C()){this.H.debug(`Data source ${this.C.name()} has loaded ${e.size()} data types in its cache:`);
|
|
732
|
+
for(const [f,g]of e)this.H.debug(`=> DataType: ${g.name()} (${f})`)}d&&(d=!1,b())},c))})).then(()=>this.C.init(this.G)).catch(b=>{this.H.error(`Error while initialization of DataSource ${this.C.name()} (${this.U()}): ${b}`)});return this}healthCheck(){return this.C.healthCheck().then(()=>`Data source ${this.C.name()} (${this.C.U()}) OK`)}destroy(){this.G.destroy();return this.C.destroy()}request(a){const b=a.content;var c=a.getType();switch(c){case Qi:const d=olympe.dm.DataSource.Hb.xb,e=olympe.dm.DataSource.Hb.Dh;
|
|
733
|
+
return this.C.healthCheck().then(()=>({s:e})).catch(g=>({s:d,r:String(g)}));case Ri:return this.C.executeQuery(b);case Wi:return c=b.qc(),$i(this,c),this.J.xc(gf(c)),Promise.resolve();case Yi:case Zi:const f=b.qc();return this.applyTransaction(f,c===Zi).finally(()=>{if(a.origin===olympe.dc.Sa.SELF){var g=f.U();g=lf(new olympe.dc.Request(olympe.dc.Request.C.Kj,olympe.dc.Sa.SELF,{id:g,finalize:olympe.dc.transaction.vf.C.Fi,error:null}),this.U());let h;null==(h=this.Wb)||h.qd(g)}});case Xi:return aj(this,
|
|
734
|
+
b.qc());case Ti:return b.content instanceof Uint8Array?this.C.uploadFileContent(b.tag,b.model,b.content).then(()=>`datasource://${b.tag}`):Promise.reject('File content is undefined');case Ui:return this.C.downloadFileContent(b.tag,b.model);case Vi:return this.C.deleteFileContent(b.tag,b.model);default:return Promise.reject(`Request of type ${a.getType()} is not supported by the data source`)}}subscribe(a){if(a.getType()===Si){const b=a.content;a=a.origin;return a===olympe.dc.Sa.SELF?bj(this,b):Sh(this.O,
|
|
735
|
+
b,this.G,a,olympe.dc.pa.Zc.Qf,{}).pipe(rxjs.operators.map(c=>{let d,e;return null!=(e=null==(d=c.Ge)?void 0:d.G)?e:null}),rxjs.operators.filter(c=>null!==c),rxjs.operators.map(c=>gf(c,Date.now())))}return rxjs.throwError(()=>Error('Subscription request not supported'))}applyTransaction(a,b){const c=this;return v(function*(){var d=dj(a);yield c.C.applyTransaction(d,{batch:b});d=Date.now();yield ai(c.O,c.U(),a);c.J.xc(gf(a,d));return d})}};olympe.dc.sources.Dp.ya=[olympe.dc.sources.Gj];function dj(a){const b=olympe.dc.sources.Zf.C.Ys,c=olympe.dc.sources.Zf.C.Uv,d=olympe.dc.sources.Zf.C.et,e=olympe.dc.sources.Zf.C.Zs,f=olympe.dc.sources.Zf.C.ft,g=[],h=[],k=[],l=[],n=[];a.C.forEach((p,q)=>{const r=p.Vb();p.F()?g.push(ej(b,q,r,p.T()?p.Cb():null)):p.zd()?k.push(ej(d,q,r,null,p.J())):p.T()&&h.push(ej(c,q,r,p.Cb()));for(const [t,u,x]of p.yd())p=a.Lc(u),x?l.push(new fj(e,t,q,u,r,p.Vb())):n.push(new fj(f,t,q,u,r,p.Vb()))});return n.concat(k,g,h,l)}
|
|
736
|
+
function ej(a,b,c,d,e){if('string'!==typeof c)throw Error(`Patch: model of instance ${b} is missing. It is invalid transaction.`);return new gj(a,b,c,d,e)}olympe.dc.sources.Zf=class{constructor(a){this.type=a}};class gj extends olympe.dc.sources.Zf{constructor(a,b,c,d,e){super(a);this.object=b;this.model=c;this.properties=null!=d?d:null;this.deleteRules=null!=e?e:olympe.dc.Nb.NONE}}
|
|
737
|
+
class fj extends olympe.dc.sources.Zf{constructor(a,b,c,d,e,f){super(a);this.relation=b;this.from=c;this.to=d;this.fromModel=e;this.toModel=f}}olympe.dc.sources.Zf.C={Ys:'CREATE',Uv:'UPDATE',et:'DELETE',Zs:'CREATE_RELATION',ft:'DELETE_RELATION'};function hj(a,b){b=lf(new olympe.dc.Request(olympe.dc.Request.C.Kj,olympe.dc.Sa.SELF,{id:b,finalize:olympe.dc.transaction.vf.C.Fi,error:null}),a.U());let c;null==(c=a.Wb)||c.qd(b)}
|
|
738
|
+
olympe.dc.sources.fl=class{constructor(a,b){this.H=a;this.F=b;this.Wb=null}U(){}T(){}Z(){}init(a){this.Wb=a;return this}destroy(){return Promise.resolve()}request(a){const b=this;return v(function*(){if(!b.F.F)return b.T(a);var c=olympe.dc.Request.C.Hb,d=olympe.dc.Request.C.Bg;const e=olympe.dc.Request.C.Ue,f=olympe.dc.Request.C.Mg;var g=olympe.dc.Request.C.ii;const h=olympe.dc.Request.C.fh,k=olympe.dc.Request.C.ag;var l=olympe.dc.Request.C.Tf;const n=olympe.dc.Request.C.rg,p=olympe.dc.sources.Xd(),
|
|
739
|
+
q=a.getType();var r=a.ic();if($c(b.F)){q===d&&(c=a.content,(g=nf(a).get(olympe.dc.pa.C.al))&&(yield ij(p,c.U(),g)),b.H.debug(`Data Provider: Query ${c.U()} will be executed with its default Remote or Server provider`));if(q===l&&(l=a.content,'string'===typeof(null==l?void 0:l.url)&&l.url.startsWith('offline://')))return p.downloadFileContent(l.tag);l=yield b.T(a);if(q===d)d=a.content,yield jj(p,d.U(),r,l.qc(),!0),b.H.C()&&b.H.debug(`Data Provider: Data result for query ${d.U()}`,l.qc().C.size,'instances',
|
|
740
|
+
Array.from(l.qc().yd()).length,'relations');else if(q===e||q===f||q===h)b.H.debug('Data Provider: Persisting graph patch in offline cache after successful transaction'),yield jj(p,null,r,a.content.qc(),!1);return l}b.H.debug(`Data Provider: Request (type: ${q}) will be sent to the cache data provider: ${a.content}`);switch(q){case c:return{s:olympe.dm.DataSource.Hb.ee};case d:return p.executeQuery(a.content);case e:case f:case h:d=a.content;const t=d.qc().U();return p.applyTransaction(d,r).finally(()=>
|
|
741
|
+
hj(b,t));case g:return Promise.resolve();case k:return r=a.content,p.uploadFileContent(r.tag,r.content,r.mimeType);case l:return p.downloadFileContent(a.content.tag);case n:return p.deleteFileContent(a.content.tag);default:return Promise.reject(`Messages of type ${a.getType()} is not supported by the source ${b.U()}`)}})}subscribe(a,b){if(!this.F.F)return this.Z(a,b);const c=olympe.dc.sources.Xd(),d=a.content,e=a.ic();return rxjs.of(null).pipe(rxjs.operators.switchMap(()=>{if($c(this.F)){const f=
|
|
742
|
+
new rxjs.Observable(h=>{olympe.D.js([this.F.Kf()],()=>{h.error(new olympe.N.errors.ap('Go Offline',d.U()))})}),g=this.Z(a,b);return rxjs.merge(f,g)}return new rxjs.Observable(f=>{olympe.D.js([this.F.Kf()],()=>{f.error(new olympe.N.errors.Qn('Back Online',d.U()))})})})).pipe(rxjs.operators.switchMap(f=>rxjs.from(jj(c,d.U(),e,f.qc()).then(()=>f).catch(g=>{this.H.error(`Data Provider: Cache database failed to handle the data result with message: ${g}`);throw g;}))))}};olympe.dc.sources.fl.ya=[olympe.dc.sources.Gj];const kj=olympe.dc.Request.C.Hb,lj=olympe.dc.Request.C.Bg,mj=olympe.dc.Request.C.Zj,nj=olympe.dc.Request.C.Ue,oj=olympe.dc.Request.C.Mg,pj=olympe.dc.Request.C.ii,qj=olympe.dc.Request.C.fh,rj=olympe.dc.Request.C.ag,sj=olympe.dc.Request.C.Tf,tj=olympe.dc.Request.C.rg;function uj(a,b){let c;return(null==(c=a.ja.tb(b))?void 0:c.Df(olympe.dc.sources.V.Ke))!==olympe.dm.DataSource.Ke.ep}function vj(a,b){let c;return(null==(c=a.ja.tb(b))?void 0:c.Df(olympe.dc.sources.V.Ke))!==olympe.dm.DataSource.Ke.Ln}
|
|
743
|
+
function wj(a,b){b=b.Bc();if(b!==olympe.dm.User.C&&a.Df(olympe.dc.sources.V.fm))throw a=`User ${b} has no right to access the restricted data source ${a.name()} (${a.U()}). Please use an admin account instead.`,new olympe.dc.sources.Gq(a);}
|
|
744
|
+
function xj(a,b,c,d,e){return v(function*(){var f=olympe.N.cb.C.SEND,g=olympe.N.cb.C.GET;const h=olympe.N.cb.C.PUBLISH,k=olympe.N.cb.C.SUBSCRIBE,l=d.ks();var n=d.body();if(e!==n.Bc())throw Error('Access denied: try to impersonate a user');wj(c,n);let p;if(null==(p=a.Wb)||!p.sources.has(n.ic()))throw Error(`Try to process a message with destination data source ${n.ic()} coming from remote but not started here`);if(l===k){if(n.getType()===mj)f=n.content.U();else throw Error('Not supported type of subscription');
|
|
745
|
+
g=yield d.cn(f);a.aa.set(g,f);g=a.O.get(f);g||(g=new yj(a.H,f,b,lf(n,olympe.dc.Sa.sf)),a.O.set(f,g));g.subscribe()}else l===g?(n=yield b.request(n),void 0!==n?yield d.qd(n):a.H.warn(`Request from ${d.source()} requires an output value, but got undefined instead.`)):l===f?(yield b.request(n),yield d.ur()):l===h&&(yield b.request(n))})}
|
|
746
|
+
olympe.dc.sources.Fq=class extends olympe.dc.sources.fl{constructor(a,b,c,d,e,f){super(a,d);this.J=b;this.C=c;this.db=e;this.G=new olympe.D.Xb('Remote Provider Context');this.ea=new Map;this.O=new Map;this.aa=new Map;this.ja=f}U(){return olympe.dc.Sa.sf}T(a){var b=olympe.N.wb;const c=a.ic(),d=a.getType();this.H.C()&&this.H.debug(`Request (type: ${d}) will be sent to remote data provider ${c}: ${a.content}`);switch(d){case kj:const e=olympe.dm.DataSource.Hb.xb,f=olympe.dm.DataSource.Hb.Dh;b=uj(this,
|
|
747
|
+
c)?b.get(c,a):Promise.resolve({s:f});a=vj(this,c)?this.C.Gc(a):Promise.resolve({s:f});return Promise.all([b,a]).then(([k,l])=>{if((null==k?void 0:k.s)===e||(null==l?void 0:l.s)===e){let n,p;return{s:e,r:`${null!=(n=null==k?void 0:k.r)?n:''} ${null!=(p=null==l?void 0:l.r)?p:''}`}}return{s:f}});case lj:return vj(this,c)?Oi(this.C,a):b.get(c,a);case nj:const g=a.content.qc().U();return(uj(this,c)?b.get(c,a):Pi(this.C,a)).finally(()=>hj(this,g));case oj:const h=a.content.qc().U();return(vj(this,c)?Pi(this.C,
|
|
748
|
+
a):b.get(c,a)).finally(()=>hj(this,h));case pj:return uj(this,c)?b.publish(c,a).catch(k=>{this.H.error(`An error occurred while sending "burst transaction" to the data source ${c}: ${k}`)}):Promise.resolve();case qj:return uj(this,c)?b.get(c,a):Pi(this.C,a);case rj:return vj(this,c)?this.C.uploadFileContent(a):b.get(c,a);case sj:return vj(this,c)?this.C.downloadFileContent(a):b.get(c,a);case tj:return vj(this,c)?this.C.deleteFileContent(a):b.send(c,a);default:return Promise.reject(`Messages of type ${a.getType()} is not supported by the source ${this.U()}`)}}Z(a,
|
|
749
|
+
b){const c=a.ic(),d=a.getType();if(!uj(this,c))return rxjs.throwError(()=>Error(`Subscription request not supported for data source ${this.db.name(c)} (${c}) which uses HTTP only.`));this.H.C()&&this.H.debug(`Subscription (type: ${d}) will be sent to remote data provider ${c}: ${a.content}`);return d===mj?olympe.N.wb.observe(c,this.G,a,{onRetry:b}):rxjs.throwError(()=>Error(`Do not handle subscription request of type ${d}`))}init(a){super.init(a);if(a.G)return this;olympe.dc.pa.from(this.J,this.J).ib(olympe.dm.DataSource.mj).filter(olympe.dc.query.Ba.Fa(olympe.dm.DataSource.Oh,
|
|
750
|
+
!0)).filter(olympe.dc.query.Ba.Fa(olympe.dm.DataSource.Fr,!0)).observe(this.G).subscribe(b=>{qf(b).forEach(this.Ga.bind(this,a));pf(b).forEach(c=>{let d;null==(d=this.ea.get(c))||d.destroy();this.ea.delete(c)})});this.db.Oa(this.J,olympe.dm.DataSource.Fr)&&(new olympe.N.wb(this.J,this.G)).listen().subscribe(b=>{b=b.body();b instanceof olympe.dc.Request?a.qd(b):this.H.error('Self source received something else than a data request, ignore it.')});return this}destroy(){return v(function*(){})}Ga(a,b){const c=
|
|
751
|
+
b.X(),d=new olympe.D.Xb(`Published data provider context ${c}`,this.G);this.ea.set(c,d);let e,f;zj(b,d).subscribe(g=>{let h;null==(h=e)||h();let k;null==(k=f)||k.stop();g!==olympe.dm.DataSource.Ke.Ln&&(e=Ji(this.C,c,l=>{wj(b,l);return a.request(l)}),d.onDestroy(()=>{let l;return null==(l=e)?void 0:l()}));g!==olympe.dm.DataSource.Ke.ep&&(g=new olympe.D.Xb(`Bus Service of data source ${c}`,d),f=(new olympe.N.wb(c,g)).qs(this.va.bind(this)),f.listen().subscribe(l=>{l.ei().then(n=>xj(this,a,b,l,n)).catch(n=>
|
|
752
|
+
{this.H.warn(`Error occurred while processing request from ${l.source()}: ${n}`);return l.Th(n instanceof Error?n:Error(n))})}))})}va(a){const b=this.aa.get(a);this.aa.delete(a);if(a=b)null==(a=this.O.get(b))?a=0:(0<a.C&&--a.C,0===a.C?(a.H.debug(`Data subscription ${a.F} has more subscriber: unsubscribe`),a.G.unsubscribe(),a=!0):(a.H.debug(`Data subscription ${a.F} has ${a.C} subscribers`),a=!1));a&&this.O.delete(b)}};
|
|
753
|
+
class yj{constructor(a,b,c,d){this.H=a;this.F=b;this.C=0;this.G=c.subscribe(d).subscribe({next:e=>{olympe.N.wb.publish(b,e).catch(f=>a.error(`Error occurred while publishing a data notification: ${f}`))},error:e=>a.error(`Error occurred while trying to subscribe to topic ${b} for a datasource: ${e}`)})}subscribe(){this.C++;this.H.debug(`Data subscription ${this.F} has ${this.C} subscribers`);return this}}olympe.dc.sources.Fq.ya=[olympe.dc.sources.Gj];const Y={mr:10,Wn:11,Ho:12,oq:13,QUERY_RESULT:14,Zo:15,oo:16,Ue:17,pq:18,no:19,cm:20};function Aj(a,b){b=b.reduce((c,d)=>{const e=new Map(Array.from(Object.entries(d.p).map(([f,g])=>[f,a.C(g)])));c.$c(d.t,d.s,e,d.m);d.r.forEach(f=>c.Ma(f.r,d.t,f.d));return c},new olympe.dc.db.tc);a.aa.xc(gf(b))}
|
|
754
|
+
olympe.dc.sources.fc=class extends olympe.N.fc{constructor(a){super();this.aa=a;this.db=a.view;this.G=new Map}ha(a){a=super.ha(a);if(0<this.G.size){const b=Array.from(this.G.values());this.G.clear();return Object.assign(Q(Y.mr,a),{i:b})}return a}O(a){return(null==a?void 0:a.t)===Y.mr&&Array.isArray(null==a?void 0:a.i)?(Aj(this,a.i),this.C(a.v)):this.C(a)}F(a){switch(!0){case a instanceof olympe.dm.File:var b=Y.Ho;{const c=a.X(),d={t:c};if(!this.G.has(c)&&(this.J(c),!this.db.Lf(c))){const e=a.get(olympe.dm.File.urlProp);
|
|
755
|
+
if(e.startsWith('blob:')||e.startsWith('stream:'))a=olympe.dc.Nr().va(a),this.G.get(c).p[olympe.dm.File.urlProp.X()]='stream://'+c,d.s=this.F(a)}a=d}return Q(b,a);case a instanceof olympe.dc.CloudObject:return Q(Y.Wn,this.J(a.X()));case a instanceof olympe.dc.pa:return Q(Y.oq,a.ha());case a instanceof olympe.dc.Ra:return Q(Y.QUERY_RESULT,a.ha(this.J.bind(this)));case a instanceof olympe.dc.db.tc:return b=new olympe.dc.transaction.qf,a.Jc(b),Q(Y.Zo,{i:a.U(),p:tf(b)});case a instanceof olympe.dc.Request:return Q(Y.oo,
|
|
756
|
+
{r:a.getType(),o:a.origin,d:a.ic(),u:a.Bc(),c:this.F(a.content)});case a instanceof olympe.dc.transaction.Ri:return Q(Y.Ue,{r:a.ah(),p:this.F(a.qc())});case a instanceof olympe.dc.query.td:return Q(Y.pq,a.ha());case a instanceof olympe.dc.kh:return Q(Y.no,a.ha());case a instanceof olympe.dc.uc:return Q(Y.cm,this.J(a.X()));default:return super.F(a)}}C(a){if(null===a||'object'!==typeof a)return super.C(a);const {t:b,v:c}=a;switch(b){case Y.Ho:var d=c.t;c.s&&(a=this.C(c.s),olympe.dc.Nr().hb(d,a));return olympe.dc.CloudObject.get(d);
|
|
757
|
+
case Y.Wn:return olympe.dc.CloudObject.get(c);case Y.oq:return d=c.p.map(olympe.dc.query.ta.am.C),a=c.e,new olympe.dc.pa(c.b,c.s,d,d.length-1,new Set(c.r),{max:a.m,offset:a.o,Ed:a.s,He:a.rm});case Y.QUERY_RESULT:return ci(c);case Y.Zo:return(new olympe.dc.transaction.zh).C(c.p,c.i);case Y.oo:return a=null!=(d=this.C(c.c))?d:void 0,lf(new olympe.dc.Request(c.r,c.d,a,c.u),c.o);case Y.Ue:return d=this.C(c.p),new olympe.dc.transaction.Ri(d,c.r);case Y.pq:return olympe.dc.query.td.C(c);case Y.no:return olympe.dc.kh.C(c);
|
|
758
|
+
case Y.cm:return new olympe.dc.uc(c);default:return super.C(a)}}J(a){if(this.G.has(a))return a;if(!this.db.Ha(a))throw new olympe.dc.Zp(a);const b={};this.db.Cb(a).forEach((d,e)=>{b[e]=this.F(d)});const c=[];for(const [d,e,f]of Og(this.db,a))this.G.has(f)&&c.push(e===olympe.dc.wa.DESTINATION?{r:d,o:a,d:f}:{r:d,o:f,d:a});this.G.set(a,{t:a,m:this.db.model(a),s:this.db.source(a),p:b,r:c});return a}};const Bj=olympe.dc.Request.C.tg,Cj=olympe.dc.Request.C.Ue,Dj=olympe.dc.Request.C.Mg,Ej=olympe.dc.Request.C.ii,Fj=olympe.dc.Request.C.In,Gj=olympe.dc.Request.C.yq,Hj=olympe.dc.Request.C.Bg,Ij=olympe.dc.Request.C.Zj,Jj=olympe.dc.Request.C.Yo,Kj=olympe.dc.Request.C.vt,Lj=olympe.dc.Request.C.wt,Mj=olympe.dc.Request.C.xt,Nj=olympe.dc.Request.C.rg,Oj=olympe.dc.Request.C.Tf,Pj=olympe.dc.Request.C.ag,Qj=olympe.dc.Request.C.Kj,Rj=olympe.dc.Request.C.Sv,Sj=olympe.dc.Request.C.gv,Tj=olympe.dc.Request.C.To,Uj=
|
|
759
|
+
olympe.dc.Request.C.fh,Vj=olympe.dc.Request.C.Ts,Wj=olympe.dc.Request.C.Hb;function Xj(a){return Yj(a,olympe.dc.Request.C.tg).then(b=>{b=b.p;const c=sf(b,a.U());a.H.C()&&a.H.debug('< Get Context result',b);a.H.T()&&a.H.log('< Get Context result has',b.length,'operations');return c})}function Zj(a,b){const c=new olympe.dc.transaction.qf({fe:!1,Ph:!1}),d=b.qc(),e=b.C;d.Jc(c);return ak(a,Cj,{i:d.U(),r:b.ah(),p:tf(c),bd:e?!0:void 0}).then(f=>f.ct)}
|
|
760
|
+
function bk(a,b){const c=b.qc(),d=new olympe.dc.transaction.qf({Ok:!0,fe:!1,Ph:!1});c.Jc(d);b=b.C?'bd=true':'';return Yj(a,Dj,tf(d),b).then(e=>e.ct).finally(()=>{ck(a,Qj,{id:c.U(),finalize:olympe.dc.transaction.vf.C.Fi})})}function dk(a,b){const c=new olympe.dc.transaction.qf({fe:!1,Ph:!1}),d=b.qc();d.Jc(c);return ak(a,Ej,{i:d.U(),r:b.ah(),p:tf(c)},!1).catch(e=>a.H.error(`Error while publishing burst transaction: ${e}`))}
|
|
761
|
+
function ek(a,b){const c=new olympe.dc.transaction.qf({fe:!1,Ph:!1});b=b.qc();b.Jc(c);return ak(a,Uj,{i:b.U(),p:tf(c)}).then(d=>d.ct)}function fk(a,b){const c=encodeURI(Ua(olympe.Y.Xe(),JSON.stringify(gk(a,b))));a.H.C()&&a.H.debug(`Static GraphDef query ${b} sent to orchestrator`);return Yj(a,Hj,void 0,`query=${c}&v=${a.version}`).then(d=>hk(a,d))}function ik(a,b){const c=b.U();a.H.C()&&a.H.debug(`Query (${c}) sent to orchestrator: ${b}`);b=gk(a,b);return Yj(a,Jj,b).then(d=>hk(a,d))}
|
|
762
|
+
function ak(a,b,c,d=!0){const e=olympe.N.we.qg,f={c:b};Object.assign(f,c);if(d)return new Promise((g,h)=>{Nd(a.G,e,f,(k,l)=>{k?h(k):g(l)})});Nd(a.G,e,f);return Promise.resolve()}
|
|
763
|
+
function gk(a,b){var c=Ah(b);b={i:b.U(),b:[b.F],m:!0,v:!0};if(c[0]instanceof olympe.dc.query.ta.Td)Object.assign(b,{f:c[0].Ob,q:[]});else{const d=(h,k)=>{h.every(l=>!l.Fa(k))&&h.push(k);return h},e=new Map;for(let h=c.length-1;0<=h;h--){const k=c[h],l=k.C;let n;const p=d(null!=(n=e.get(l))?n:[],k);if(k instanceof olympe.dc.query.ta.te&&k.G){let q;null==(q=e.get(k.U()))||q.forEach(r=>d(p,r))}e.set(l,p)}let f,g;c=null!=(g=e.get(null==(f=c[0])?void 0:f.C))?g:[];Object.assign(b,{f:olympe.dc.Nb.NONE,q:c.map(a.ea.bind(a,
|
|
764
|
+
e))})}return b}function ck(a,b,c){b=lf(new olympe.dc.Request(b,olympe.dc.Sa.SELF,c),a.U());let d;null==(d=a.Wb)||d.qd(b)}
|
|
765
|
+
function Yj(a,b,c,d){const e=Mi(a.C,a.U(),b);if('string'!==typeof e)return Promise.reject(`ServerProvider: no url for type ${b}`);b=N(`${e}${'string'===typeof d&&0<d.length?`?${d}`:''}`,void 0!==c?olympe.net.Aa.Id.Ah:olympe.net.Aa.Id.GET,c&&JSON.stringify(c));rc(b,{[olympe.net.Aa.Headers.ki]:'application/json'});return Ni(a.C,b).then(f=>'string'===typeof f&&0<f.length?JSON.parse(f):f)}
|
|
766
|
+
function hk(a,b){if(!b||'object'!==typeof b)throw Error('Data result can be created only from Object');if(0<b.s)throw Error(b.error);return sf(b.p,a.U())}function jk(a,b,c){return v(function*(){const d=b.pi;let e;if(c instanceof olympe.Y.stream.Eg){e=new olympe.dc.db.tc(d);try{for(const f=ha(c);;){const g=yield f.next();if(g.done)break;a.aa.C(g.value.p,d).Jc(e)}}catch(f){a.H.error(`Error while reading the stream: ${f}`),e=new olympe.dc.db.tc(d)}}else e=a.aa.C(b.p,d);return gf(e,b.ct)})}
|
|
767
|
+
olympe.dc.sources.Uq=class extends olympe.dc.sources.fl{constructor(a,b,c,d,e){super(a,c);this.G=b;this.C=d;this.aa=new olympe.dc.transaction.zh(this.U());this.J=new Map;this.O=new Set;this.version=e||'unknown';olympe.D.ij(this.F.Kf(),()=>{this.J.forEach((f,g)=>{f.error(new olympe.N.errors.Gi('Connection to server has been recovered',g))})})}U(){return olympe.dc.Sa.SERVER}T(a){var b=a.getType(),c=a.content,d=nf(a);switch(b){case Wj:return c=olympe.dm.DataSource.Hb.xb,a=olympe.dm.DataSource.Hb.Dh,
|
|
768
|
+
Promise.resolve(Kd(this.G)?{s:a}:{s:c,r:'Disconnected'});case Bj:return Xj(this);case Cj:return Zj(this,c);case Dj:return bk(this,c);case Ej:return dk(this,c);case Uj:return ek(this,c);case Hj:return d.get(olympe.dc.pa.C.qp)?fk(this,c):ik(this,c);case Fj:return Kd(this.G)?(c=gk(this,olympe.dc.pa.from(c)),c.f=olympe.dc.Nb.uo,c=N(Mi(this.C,olympe.dc.Sa.SERVER,Fj),olympe.net.Aa.Id.Ah,JSON.stringify(c),olympe.net.Aa.ResponseType.Ti),rc(c,{[olympe.net.Aa.Headers.ki]:olympe.net.Aa.hl.JSON}),c=Ni(this.C,
|
|
769
|
+
c)):(this.H.error(`Server is disconnected, backup of instance ${c} is canceled.`),c=Promise.reject('Server is disconnected')),c;case Gj:return a=c.uE,b=c.debug,c=c.optional,Kd(this.G)?(d=Mi(this.C,olympe.dc.Sa.SERVER,Gj),c=N(d+`?debug=${b}&optional=${c}`,olympe.net.Aa.Id.Ah,a),rc(c,{[olympe.net.Aa.Headers.ki]:olympe.net.Aa.hl.aw}),c=Ni(this.C,c)):(this.H.error('Server is disconnected, restore of instance is canceled.'),c=Promise.reject('Server is disconnected')),c;case Rj:case Sj:case Tj:case Vj:return ak(this,
|
|
770
|
+
b,{});case Oj:return this.C.downloadFileContent(a);case Nj:return this.C.deleteFileContent(a);case Pj:return this.C.uploadFileContent(a);default:return Promise.reject(`ServerProvider: Message of type ${b} not supported yet`)}}Z(a,b){if(a.getType()===Ij){const c=a.content,d=c.U();return(new rxjs.Observable(e=>{const f=gk(this,c);this.O.delete(d);this.J.set(d,e);ak(this,Kj,f).catch(g=>e.error(g))})).pipe(eb(olympe.N.errors.Gi,(e,f)=>{this.H.debug(`Subscribe to topic ${e.U()} now that we are back online, after waiting for ${f}ms`);
|
|
771
|
+
b()}),rxjs.operators.finalize(()=>{this.O.add(d);ak(this,Lj,{i:d}).catch(e=>{this.H.warn(`Fail to unsubscribe to graphdef ${d}: ${e}`)}).finally(()=>{this.O.has(d)&&this.J.delete(d);this.O.delete(d)})}))}return rxjs.throwError(()=>Error(`Subscription of type ${a.getType()} is not supported`))}init(a){super.init(a);Id(this.G,olympe.N.we.qg,this.ja.bind(this));return this}destroy(){return v(function*(){})}ja(a,b){const c=olympe.dc.Request.C.Kn,d=olympe.dc.Request.C.Nl,e=a.c;if(e===olympe.dc.Request.C.ko)jk(this,
|
|
772
|
+
a,b).then(f=>{ck(this,e,f)});else if(e===c)b=this.aa.C(a.p,a.i),ck(this,e,{rollback:gf(b,a.ct),error:a.error});else if(e===Mj){const f=a.i;jk(this,a,b).then(g=>{let h;null==(h=this.J.get(f))||h.next(g)})}else e===d&&ck(this,Qj,{id:a.i,finalize:olympe.dc.transaction.vf.C.Nl,error:0<a.s?a.error:null})}ea(a,b){if(b instanceof olympe.dc.query.ta.Eh){const c=b.relation;let d;b=null!=(d=a.get(b.U()))?d:[];return{t:c.X(),d:c.Ia()===olympe.dc.wa.ORIGIN?1:2,v:!0,r:c.recursive,q:b.map(this.ea.bind(this,a))}}return{}}};
|
|
773
|
+
olympe.dc.sources.Uq.ya=[olympe.dc.sources.Gj];function kk(a,b,c){const d=new olympe.D.Xb(`Source solver ${b.X()}`);b.ib(olympe.dm.rd.G.bc()).ib(olympe.dm.rd.F).ge().back().ib(olympe.dm.rd.C).ge().observe(d,{Pd:c,zc:!0}).subscribe(e=>{qf(e).forEach(([f,g])=>{a.F.set(f.X(),g.U())});pf(e).forEach(([f])=>{a.F.delete(f)})});b.ib(olympe.dm.kb.F).observe(d,{Pd:c,zc:!0}).subscribe(e=>{let f,g;a.G=null!=(g=null==(f=e.Fc())?void 0:f.U())?g:null});d.onDestroy(()=>{a.F.clear();a.G=null})}
|
|
774
|
+
olympe.dc.sources.kk=class{constructor(a,b,c){this.db=a;this.C=b;this.O=c;this.F=new Map;this.G=null;this.J=!1}fromModel(a){a=olympe.dc.ga(a);return this.F.has(a)?this.F.get(a):this.G&&this.T(a)?this.G:this.O}Fe(a){let b;return null!=(b=this.db.source(a))?b:this.O}tb(a){return a===this.C?olympe.dc.CloudObject.get(this.C):a===olympe.dc.Sa.SERVER?olympe.dc.CloudObject.get(olympe.dm.DataSource.SERVER):this.db.Ha(a)&&this.db.Rb(a,olympe.dm.DataSource)?olympe.dc.CloudObject.get(a):null}T(){return!1}init(){if(!this.J){this.J=
|
|
775
|
+
!0;var a=new olympe.dc.Xa;Z(a.create(olympe.dm.DataSource,this.C).ci(this.C),olympe.dm.DataSource.Oh,!0);a.Ma(olympe.dm.DataSource.mj,this.C,this.C);a.ob(()=>{olympe.dc.pa.from(this.C).observe(olympe.D.Sg()).subscribe(()=>{})})}}};olympe.dc.sources.R={Ca:'dc.sources.Logger',xl:'dc.sources.HTTPService',Mt:'dc.sources.IOService',wq:'dc.sources.RemoteProvider',Nq:'dc.sources.ServerProvider',kB:'dc.sources.OfflineProvider',Re:'dc.sources.SourceSolver',Be:'dc.sources.Serializer',lo:'dc.sources.cache.Cache',mo:'dc.sources.cache.DATABASE',bl:'dc.sources.cache.Logger'};
|
|
776
|
+
olympe.dc.sources.V={ph:'data.httpHost',lf:'data.httpPort',ti:'data.httpSSL',vl:'data.httpBasePath',Xl:'data.pollingFrequency',Ke:'data.communicationMode',fm:'data.restrictedUse',VERSION:'version.version'};olympe.dc.sources.sh={Uu:'olympe.internal.data.',ph:'olympe.internal.data.httpHost',lf:'olympe.internal.data.httpPort',ti:'olympe.internal.data.httpSSL'};
|
|
777
|
+
olympe.W.config(function(a){const b=['localhost','127.0.0.1'],c=a.getParameter(olympe.net.V.Jl),d=`-${olympe.host.Gg.Bh}`;F(a,olympe.dc.sources.V.ph,null);F(a,olympe.dc.sources.V.lf,null);F(a,olympe.dc.sources.V.ti,null);F(a,olympe.dc.sources.V.vl,'runtime/data');Qa(a,olympe.dc.sources.sh.ph,[olympe.host.V.bk,olympe.N.V.ll,olympe.dc.sources.V.ph],(e,f,g)=>{if(g)return g;e=e===olympe.host.Gg.Bh;return f.endsWith(c)&&e?f+d:f});Qa(a,olympe.dc.sources.sh.lf,[olympe.dc.sources.sh.ph,olympe.dc.sources.V.lf],
|
|
778
|
+
(e,f)=>{if(f)return f;f=b.includes(e);const g=e.endsWith(d);e=e.endsWith(c);return f?3141:g?85:e?80:443});Qa(a,olympe.dc.sources.sh.ti,[olympe.dc.sources.sh.lf,olympe.dc.sources.V.ti],(e,f)=>null!==f?f:443===e);F(a,olympe.dc.sources.V.Xl,null);F(a,olympe.dc.sources.V.Ke,null);F(a,olympe.dc.sources.V.fm,null);E(a,olympe.dc.sources.R.Ca,[olympe.ka.R.Ea],e=>e.Vc('data'));C(a,olympe.dc.sources.R.Be,olympe.dc.sources.fc,olympe.dc.db.R.Ea);Oa(a,olympe.N.R.Be,olympe.dc.sources.R.Be);C(a,olympe.dc.sources.R.xl,
|
|
779
|
+
olympe.dc.sources.At,olympe.dc.sources.R.Ca,olympe.net.R.Ui,olympe.N.R.wl,olympe.auth.R.Ea,olympe.dc.sources.R.Re,olympe.N.R.Be,new olympe.W.oa(olympe.N.V.Yk));C(a,olympe.dc.sources.R.Mt,olympe.dc.sources.pp,olympe.dc.sources.R.Ca,olympe.dc.R.Dg,olympe.net.R.Ea,olympe.auth.R.Ea);C(a,olympe.dc.sources.R.wq,olympe.dc.sources.Fq,olympe.dc.sources.R.Ca,new olympe.W.oa(olympe.dc.V.Hg),olympe.dc.sources.R.xl,olympe.N.R.ff,olympe.dc.R.jh,olympe.dc.sources.R.Re);C(a,olympe.dc.sources.R.Nq,olympe.dc.sources.Uq,
|
|
780
|
+
olympe.dc.sources.R.Ca,olympe.N.R.ek,olympe.N.R.ff,olympe.dc.sources.R.xl,new olympe.W.oa(olympe.dc.sources.V.VERSION));C(a,olympe.dc.sources.R.Re,olympe.dc.sources.kk,olympe.dc.R.jh,new olympe.W.oa(olympe.dc.V.Hg),new olympe.W.oa(olympe.dc.V.nl));E(a,olympe.dc.sources.R.bl,[olympe.ka.R.Ea],e=>e.Vc('datacache'));C(a,olympe.dc.sources.R.lo,olympe.dc.sources.cache.Cache,olympe.dc.sources.R.bl,olympe.dc.R.Dg,olympe.dc.sources.R.mo,olympe.dc.db.R.Ea,olympe.net.R.Ea,olympe.N.R.ff,olympe.Db.R.Kl,olympe.Y.R.mg,
|
|
781
|
+
new olympe.W.oa(olympe.net.V.Wp),new olympe.W.oa(olympe.dc.sources.V.VERSION));C(a,olympe.dc.sources.R.mo,olympe.dc.sources.cache.Uj,olympe.Db.R.Jg,olympe.dc.sources.R.bl,olympe.Db.R.Oj)},'olympe.dc.sources');olympe.W.run([olympe.dc.sources.R.Re,olympe.dc.sources.R.lo],(a,b)=>{olympe.dc.Zd=()=>a;olympe.dc.sources.Xd=()=>b});olympe.dc.sources.cache={};olympe.dc.sources.cache.errors={};olympe.dc.sources.cache.errors.nm=class extends Error{constructor(a){super(a)}};olympe.dc.sources.cache.errors.bt=class extends olympe.dc.sources.cache.errors.nm{};olympe.dc.sources.cache.errors.Pv=class extends olympe.dc.sources.cache.errors.nm{};olympe.dc.sources.cache.errors.Yv=class extends olympe.dc.sources.cache.errors.nm{};function lk(a){switch(!0){case null===a:case void 0===a:return null;case 'string'===typeof a:case 'boolean'===typeof a:case 'number'===typeof a:return a}switch(a.t){case 1:return new Date(a.d);case 2:return olympe.D.Color.Pb(a);case 17:return new olympe.dc.uc(a.v);case 13:return(new olympe.dc.transaction.zh).C(a.v,a.i);default:throw Error(`Impossible to deserialize the following value: ${a}`);}}
|
|
782
|
+
olympe.dc.sources.cache.ip=class{ha(a){switch(!0){case null===a:case void 0===a:return null;case 'string'===typeof a:case 'boolean'===typeof a:case 'number'===typeof a:return a;case a instanceof olympe.D.gb:return{t:1,d:a.valueOf().toISOString()};case a instanceof Date:return{t:1,d:a.toISOString()};case a instanceof olympe.D.Color:return Object.assign({t:2},a.toJSON());case a instanceof olympe.dc.uc:return{t:17,v:a.X()};case a instanceof olympe.dc.db.tc:const b=new olympe.dc.transaction.qf;a.Jc(b);
|
|
783
|
+
return{t:13,i:a.U(),v:tf(b)};default:throw Error(`Impossible to serialize the following value: ${a}`);}}};function ij(a,b,c){return v(function*(){mk(a,'queries',b);yield a.init();const d=a.F.has(c)?a.F.get(c):new Set;d.has(b)||(d.add(b),a.F.set(c,d),a.O.next(nk(a)));return ok(a.C,b,c)})}
|
|
784
|
+
function jj(a,b,c,d,e=!1){return v(function*(){yield a.init();a.H.debug(`Cache: handle query ${b} graph patch: ${d.U()}`);d.Z(a.G);(()=>v(function*(){try{const f=null===b?[]:Array.from(a.F.entries()).filter(([,h])=>h.has(b)).map(([h])=>h),g=1===f.length&&'__code-as-data__'===f[0];if(null===b||!g||a.aa)a.H.debug('Cache: persist graph patch',d.U()),e&&b&&(Array.from(d.ad()).filter(h=>!h.zd()).map(h=>h.tag()),yield pk(a.C)),yield qk(a.C,d,0<f.length?b:null),rk(a,d,c).catch(h=>{a.H.error(`Cache: Failed to download files of a graph patch: ${h}`)})}catch(f){a.H.error(`Cache: Failed to handle graph patch ${d.U()} with message: ${f}`),
|
|
785
|
+
a.oc.next(f)}finally{b&&sk(a,'queries',b)}}))().then(()=>{})})}function tk(){var a=olympe.dc.sources.Xd();a.aa=!0;a.yb=!0}function mk(a,b,c){const d=a.status.getValue();b in d||(d[b]={total:0,processed:0,values:new Set});d[b].total+=1;d[b].values.add(c);d.processing=!0;a.status.next(d)}
|
|
786
|
+
function sk(a,b,c){const d=a.status.getValue();let e,f;null!=(f=null==(e=d[b])?void 0:e.values)&&f.delete(c)&&(d[b].processed+=1,0===d[b].values.size&&(delete d[b],('queries'===b?'files':'queries')in d||(d.processing=!1)),a.status.next(d))}function uk(a){return v(function*(){a.G=new olympe.dc.db.tc;const b=yield vk(a.C);for(const c of b)c.Jc(a.G);a.ea.next(0<b.length)})}
|
|
787
|
+
function rk(a,b,c){return v(function*(){const d=wk(b),e=[];for(const g of d){const h=g.tag();if(!(yield xk(a.C,h)))if(mk(a,'files',h),!1===g.Oa(olympe.dm.File.C.X())&&g.Oa(olympe.dm.File.urlProp.X())){var f=g.Oa(olympe.dm.File.urlProp.X());const k=N(f);k.F=olympe.net.Aa.ResponseType.Xk;e.push(new Promise((l,n)=>{a.Cc.C(k,p=>{p=p.Gc();200<=p&&300>p?l():n(`Failed to download file ${g}. Response code ${p}`);sk(a,'files',h)})}))}else{let k;const l=null!=(k=g.Oa(olympe.dm.File.mimeTypeProp.X()))?k:'application/octet-stream';
|
|
788
|
+
f={tag:h,model:g.Vb(),mimeType:l};const n=new olympe.dc.Request(olympe.dc.Request.C.Tf,c,f);f=hb(a.Tc,()=>a.Wb.request(n).then(p=>yk(a.C,h,p,l))).finally(()=>sk(a,'files',h));e.push(f)}}yield Promise.allSettled(e).then(g=>{g.forEach((h,k)=>{if('rejected'===h.status){let l;a.H.warn(`Cache: File content for ${null==(l=d[k])?void 0:l.tag()} was not found`)}})})})}
|
|
789
|
+
function wk(a){const b=[olympe.dc.ga(olympe.dm.File)];if(olympe.dc.CloudObject.exists(olympe.dm.File))b.push(...olympe.dc.pa.from(olympe.dm.File).eg(olympe.dc.CloudObject.extendedByRel).md().keys());else for(const c of b){let d,e;b.push(...(null!=(e=null==(d=a.Lc(c))?void 0:d.bb(olympe.dc.CloudObject.extendedByRel,f=>f))?e:[]))}return b.reduce((c,d)=>{let e,f;d=Array.from(null!=(f=null==(e=a.Lc(d))?void 0:e.bb(olympe.dc.CloudObject.instancesRel,g=>g))?f:[]).map(g=>a.Lc(g));return c.concat(d)},[])}
|
|
790
|
+
function zk(a,b){return Array.from(a.F.values()).some(c=>c.has(b))}function nk(a){return Array.from(a.F.keys()).filter(b=>'__code-as-data__'!==b)}function Ak(a,b){return v(function*(){yield a.init();if(b){var c,d=Array.from(null!=(c=a.F.get(b))?c:[]);a.F.delete(b);var e=Array.from(a.F.values()).reduce((f,g)=>{g.forEach(h=>f.add(h));return f},new Set);yield Bk(a.C,b);a.O.next(nk(a));d.filter(f=>!e.has(f));yield pk(a.C)}else yield Promise.all(nk(a).map(f=>Ak(a,f)))})}
|
|
791
|
+
function Ck(a){if(!(2>a.length))for(let b=a.length-1;0<b;b--)for(let c=b-1;0<=c;c--)a[c].Z(a[b])}
|
|
792
|
+
function Dk(a,b,c){return v(function*(){var d=olympe.dc.Request.C.Ue;const e=olympe.dc.Request.C.rg,f=olympe.dc.Request.C.ag;a.H.debug('Sync Cache: Applying transaction patch to destination',c,b.U());const g=wk(b);a.H.debug(`Sync Cache: Found ${g.length} files to send`);yield Promise.all(g.map(h=>v(function*(){const k=h.tag();var l=h.Vb();if(h.zd())l=new olympe.dc.Request(e,c,{tag:k,model:l});else{const n=yield Ek(a.C,k);l=new olympe.dc.Request(f,c,{tag:k,model:l,content:n.content,mimeType:n.C})}if(!$c(a.hb))throw Error('Lost connection, stop syncing');
|
|
793
|
+
l=yield a.Wb.request(l);b.Qc(k,new Map([[olympe.dm.File.urlProp.X(),l]]))})));d=new olympe.dc.Request(d,c,new olympe.dc.transaction.Ri(b,!1));if(!$c(a.hb))throw Error('Lost connection, stop syncing');yield a.Wb.request(d)})}
|
|
794
|
+
function Fk(a,b,c){return c instanceof olympe.N.errors.mk||c instanceof olympe.N.errors.co?(a.H.error('Sync Cache: Timeout or Connection error',c),new olympe.dc.sources.cache.errors.bt('The connection has been lost. It can happen when the application loose connectivity or when the remote server is not responding correctly',c.message)):c instanceof olympe.N.errors.Eq?(a.H.error(`Sync Cache: transaction has been rejected by ${b} data source`,c),new olympe.dc.sources.cache.errors.Pv('The transaction has been rejected by the datasource',
|
|
795
795
|
c.message)):new olympe.dc.sources.cache.errors.Yv('Synchronisation error',c.message)}
|
|
796
|
-
function
|
|
797
|
-
h,f),yield
|
|
798
|
-
function
|
|
799
|
-
function
|
|
800
|
-
function
|
|
801
|
-
olympe.dc.sources.cache.Cache=class{constructor(a,b,c,d,e,f,g,h,k,l){this.H=a;this.Wb=b;this.C=c;this.Ga=d;this.Cc=e;this.hb=f;this.
|
|
802
|
-
this.T=!1;this.
|
|
803
|
-
a):b.C.executeQuery(a)})}applyTransaction(a,b){const c=this;return v(function*(){c.H.debug('Cache: apply transaction',a,b);yield c.init();const d=a.qc(),e=Array.from(d.C.keys());let f,g;const h=Array.from(null!=(g=null==(f=c.J)?void 0:f.C.C.keys())?g:[]);let k;b!==(null==(k=c.J)?void 0:k.F)||e.some(l=>!h.includes(l))?(yield
|
|
804
|
-
this;return v(function*(){yield d.init();yield
|
|
805
|
-
function
|
|
806
|
-
function
|
|
807
|
-
function
|
|
808
|
-
function
|
|
809
|
-
function
|
|
810
|
-
a.H.debug(`Offline DB: Data result for query ${b.U()}`,d.qc().C.size,'instances',Array.from(d.qc().yd()).length,'relations');return d})}function
|
|
811
|
-
function
|
|
812
|
-
olympe.dc.sources.cache.
|
|
813
|
-
else{d.H.debug(`Offline DB GC: Round with ${d.F.size} candidates`);var e=Date.now();yield d.db.F().then(()=>{});d.H.debug(`Offline DB GC: has taken ${Date.now()-e}ms to run`)}})},5E3)}static cc(a){const b=new RegExp(`^(${olympe.dc.
|
|
814
|
-
yield b.db.get('instances',a.F),g=olympe.dc.sources.cache.zg.Pb(f);if(!g)return d;f=new Map;const h=new Set([g.tag]);d.create(g.tag,olympe.dc.sources.cache.
|
|
815
|
-
Promise.resolve([]);r.X();return b.db.J().then(z=>z.map(A=>olympe.dc.sources.cache.zg.Pb(A))).then(z=>{x.set(y,z)})})).then(()=>x);for(const [y,z]of l){p instanceof olympe.dc.query.ta.te&&p.G&&k.add(y);for(const A of z)if(l=A.tag,A.source===e){if(p instanceof olympe.dc.query.ta.te&&!k.has(l)){var n=t[t.length-1];n||(n=new Set,t.push(n));n.add(l)}k.add(l);h.has(l)||(h.add(l),n=olympe.dc.sources.cache.
|
|
796
|
+
function Gk(){var a=olympe.dc.sources.Xd();if(a.T)return rxjs.throwError(()=>Error('Another synchronisation is in progress'));a.T=!0;a.H.info('Sync Cache: Start synchronising transactions');const b=new rxjs.BehaviorSubject([null,null]);(()=>v(function*(){yield a.init();const c=yield Hk(a.C);let d=0;const e=Array.from(c.values()).reduce((f,g)=>f+g.length,0);0<e&&b.next([e,d]);for(const [f,g]of c){Ck(g);for(const h of g){a.H.debug(`Sync Cache: Processing patch ${d+1}/${e} (${h.U()})`);try{yield Dk(a,
|
|
797
|
+
h,f),yield Ik(a.C,h)}catch(k){throw Fk(a,f,k);}d+=1;b.next([e,d])}}a.J=null}))().then(()=>{a.T=!1;b.complete()}).catch(c=>{b.error(c.message)}).finally(()=>{uk(a).finally(()=>{a.T=!1})});return b.asObservable()}
|
|
798
|
+
function Jk(){const a=olympe.dc.sources.Xd();return v(function*(){var b=new Set;const c={files:[],patches:[],version:a.version};var d=wk(a.G);for(const e of d)b.has(e.tag())||(d=yield Ek(a.C,e.tag()),c.files.push({t:e.tag(),m:d.C,c:a.va.C(d.content)}),b.add(e.tag()));b=yield Kk(a.C);c.patches.push(...b);return JSON.stringify(c)})}
|
|
799
|
+
function Lk(a){const b=olympe.dc.sources.Xd();return v(function*(){let c;try{c=JSON.parse(a)}catch(e){throw Error('Invalid pending changes, must be a JSON string');}var d=c.files;if(!Array.isArray(c.patches)||!Array.isArray(d))throw Error('Invalid pending changes, must contain a `patches` array and a `files` array');for(const e of c.files)d=b.va.F(e.c),yield yk(b.C,e.t,d,e.m);yield Mk(b.C,c.patches);yield uk(b);b.Ga.xc(gf(b.G))})}
|
|
800
|
+
function Nk(){const a=olympe.dc.sources.Xd();return v(function*(){yield Ok(a.C);yield uk(a)})}
|
|
801
|
+
olympe.dc.sources.cache.Cache=class{constructor(a,b,c,d,e,f,g,h,k,l){this.H=a;this.Wb=b;this.C=c;this.Ga=d;this.Cc=e;this.hb=f;this.eb=g;this.va=h;this.version=l;this.aa=this.version!==this.eb.get('__code-as-data-version__');this.Fb=this.yb=!1;this.F=new Map;this.O=new rxjs.BehaviorSubject([]);this.J=null;this.ea=new rxjs.BehaviorSubject(!1);this.G=new olympe.dc.db.tc;this.Ub=this.ac=!1;this.ja=[];this.Z=0;this.Uc=new rxjs.BehaviorSubject(!1);this.status=new rxjs.BehaviorSubject({processing:!1});
|
|
802
|
+
this.T=!1;this.oc=new rxjs.Subject;this.Tc=new olympe.Y.promise.Fv(k)}Gc(){return this.status.asObservable()}init(){const a=this;return v(function*(){if(!a.ac)if(a.Ub)yield new Promise(b=>{a.ja.push(b)});else{a.Ub=!0;(yield Pk(a.C)).forEach(b=>{a.F.set(b.name,new Set(b.C))});a.O.next(nk(a));yield uk(a);a.Ga.xc(gf(a.G));for(const b of a.ja)b();a.ac=!0;a.ja=[]}})}executeQuery(a){const b=this;return v(function*(){yield b.init();return zk(b,a.U())&&Ah(a).some(c=>c instanceof olympe.dc.query.ta.Td)?Qk(b.C,
|
|
803
|
+
a):b.C.executeQuery(a)})}applyTransaction(a,b){const c=this;return v(function*(){c.H.debug('Cache: apply transaction',a,b);yield c.init();const d=a.qc(),e=Array.from(d.C.keys());let f,g;const h=Array.from(null!=(g=null==(f=c.J)?void 0:f.C.C.keys())?g:[]);let k;b!==(null==(k=c.J)?void 0:k.F)||e.some(l=>!h.includes(l))?(yield Rk(c.C,d,b),c.J=new olympe.dc.sources.cache.$s(d,b),c.ea.next(!0)):(d.Jc(c.J.C),yield Rk(c.C,c.J.C,b));d.Jc(c.G);yield qk(c.C,d,'local-transaction')})}uploadFileContent(a,b,c){const d=
|
|
804
|
+
this;return v(function*(){yield d.init();yield yk(d.C,a,b,c);return`offline://${a}`})}downloadFileContent(a){const b=this;return v(function*(){yield b.init();return Ek(b.C,a).then(c=>c.content)})}deleteFileContent(a){const b=this;return v(function*(){yield b.init();yield Sk(b.C,[a])})}};olympe.dc.sources.cache.$s=class{constructor(a,b){this.C=a;this.F=b}};olympe.dc.sources.cache.Cache.F='__code-as-data-version__';olympe.dc.sources.cache.Cache.C='__code-as-data__';function Pk(a){return v(function*(){return(yield a.db.G('buckets')).map(b=>olympe.dc.sources.cache.$p.Pb(b))})}function vk(a){return v(function*(){return(yield a.db.G('pending-transactions')).map(b=>{b=olympe.dc.sources.cache.yh.Pb(b);return lk(b.C)})})}function ok(a,b,c){return v(function*(){a.H.debug(`Offline DB: Adding query ${b} in bucket ${c}`);return a.db.F()})}function pk(a){return v(function*(){return a.db.F()})}
|
|
805
|
+
function qk(a,b,c){a.H.debug(`Offline DB: Apply patch ${b.U()} on local offline db`);Array.from(b.C.keys());return a.db.F().then(()=>{null===c&&(b.C.forEach((d,e)=>a.F.add(e)),a.G().then(()=>{}))})}function xk(a,b){return new Promise((c,d)=>{null!==a.files?c(a.files.has(b)):a.C.push(e=>{let f;return e?d(e):c(!(null==(f=a.files)||!f.has(b)))})})}
|
|
806
|
+
function yk(a,b,c,d){c=new olympe.dc.sources.cache.Vl(b,c,d);a.files.add(b);return a.db.set('files',c.toJSON()).then(()=>{}).catch(e=>{a.files.delete(b);throw e;})}function Bk(a,b){return v(function*(){return a.db.remove('buckets',b).then(()=>{})})}function Hk(a){return v(function*(){return(yield a.db.G('pending-transactions')).reduce((b,c)=>{c=olympe.dc.sources.cache.yh.Pb(c);const d=c.F;let e;const f=null!=(e=b.get(d))?e:[];f.push(lk(c.C));b.set(d,f);return b},new Map)})}
|
|
807
|
+
function Ik(a,b){return v(function*(){return a.db.remove('pending-transactions',b.U()).then(()=>{})})}function Ek(a,b){return v(function*(){const c=yield a.db.get('files',b);if(!c)throw Error(`File ${b} not found in offline cache database`);return olympe.dc.sources.cache.Vl.Pb(c)})}function Kk(a){return v(function*(){return a.db.G('pending-transactions')})}
|
|
808
|
+
function Mk(a,b){return v(function*(){const c=new Map;for(const d of b){const e=olympe.dc.sources.cache.yh.Pb(d);e&&c.set(e.C.i,d)}yield a.db.ea()})}function Ok(a){return v(function*(){return a.db.clear('pending-transactions').then(()=>{})})}
|
|
809
|
+
function Qk(a,b){return v(function*(){const c=b.tb();a.H.debug(`Offline DB: Executing query ${b.U()} by ID with source ${c}`);const d=olympe.dc.query.td.cj(b);var e=(yield a.db.J(b.U())).map(f=>olympe.dc.sources.cache.zg.Pb(f));for(const f of e){if(f.source!==c)continue;e=olympe.dc.sources.cache.Uj.cc(f);const g=Tk(f.Dd);d.create(f.tag,e,g);for(const h of f.pb)if(e=h.match(/^([a-z0-9]*)(<|>)([a-z0-9]*)$/)){const [,k,l,n]=e;e='<'===l;k===olympe.dc.mc.Yc&&!0===e||d.Ma(k,e?n:f.tag,e?f.tag:n)}}a.H.C()&&
|
|
810
|
+
a.H.debug(`Offline DB: Data result for query ${b.U()}`,d.qc().C.size,'instances',Array.from(d.qc().yd()).length,'relations');return d})}function Rk(a,b,c){b=a.O.ha(b);a.H.debug(`save transaction in destination '${c}'`,JSON.stringify(b));return a.db.set('pending-transactions',(new olympe.dc.sources.cache.yh(c,b,Date.now())).toJSON())}function Uk(a){return v(function*(){return a.db.O('pending-transactions')})}function Sk(a,b){return v(function*(){b.forEach(c=>a.files.delete(c));yield a.db.aa()})}
|
|
811
|
+
function Tk(a){return Object.entries(a).reduce((b,[c,d])=>b.set(c,lk(d)),new Map)}
|
|
812
|
+
olympe.dc.sources.cache.Uj=class{constructor(a,b,c){this.J=`Olympe_Cache_${a}`;this.H=b;this.O=new olympe.dc.sources.cache.ip;this.db=c.F(this.J);this.F=new Set;this.C=[];this.files=null;this.db.T('files').then(d=>{this.files=new Set(d);this.C.forEach(e=>e(null))}).catch(d=>{this.C.forEach(e=>e(d))});this.G=olympe.Y.Promise.$i(()=>{const d=this;return v(function*(){if(!(0===d.F.size||0<(yield Uk(d))))if(0<d.db.Z())d.G().then(()=>{}),d.H.debug('Offline DB GC: Postponing round while the stack is busy');
|
|
813
|
+
else{d.H.debug(`Offline DB GC: Round with ${d.F.size} candidates`);var e=Date.now();yield d.db.F().then(()=>{});d.H.debug(`Offline DB GC: has taken ${Date.now()-e}ms to run`)}})},5E3)}static cc(a){const b=new RegExp(`^(${olympe.dc.mc.Yc})>([a-z0-9]*)$`);for(const c of a.pb)if(a=c.match(b))return a[2];return null}executeQuery(a){const b=this;return v(function*(){const c=Date.now();b.H.debug(`Offline DB: Executing query ${a.U()} with source ${a.tb()}`);const d=olympe.dc.query.td.cj(a),e=a.tb();var f=
|
|
814
|
+
yield b.db.get('instances',a.F),g=olympe.dc.sources.cache.zg.Pb(f);if(!g)return d;f=new Map;const h=new Set([g.tag]);d.create(g.tag,olympe.dc.sources.cache.Uj.cc(g),Tk(g.Dd));for(const p of Ah(a))if(p instanceof olympe.dc.query.ta.Eh){var k=p.relation;g=k.Ia()===olympe.dc.wa.ORIGIN;const q=k.X(),r=k.bc();k=new Set;f.set(p.U(),k);const t=[f.has(p.C)?new Set(f.get(p.C)):new Set([a.F])];for(const u of t){const x=new Map;var l=yield Promise.all(Array.from(u).map(y=>{if(!h.has(y))return b.H.warn(`Offline DB: Instance ${y} not found while processing query part, this should not happen`),
|
|
815
|
+
Promise.resolve([]);r.X();return b.db.J().then(z=>z.map(A=>olympe.dc.sources.cache.zg.Pb(A))).then(z=>{x.set(y,z)})})).then(()=>x);for(const [y,z]of l){p instanceof olympe.dc.query.ta.te&&p.G&&k.add(y);for(const A of z)if(l=A.tag,A.source===e){if(p instanceof olympe.dc.query.ta.te&&!k.has(l)){var n=t[t.length-1];n||(n=new Set,t.push(n));n.add(l)}k.add(l);h.has(l)||(h.add(l),n=olympe.dc.sources.cache.Uj.cc(A),d.create(l,n,Tk(A.Dd)));q===olympe.dc.mc.Yc&&!0===g||d.Ma(q,g?l:y,g?y:l)}}}}else p instanceof
|
|
816
816
|
olympe.dc.query.ta.Td&&b.H.warn(`Offline DB: Trying to execute a query ${a.U()} on the Cache DB that contains a FollowRule part. This is not supported and designed not to happen.`);b.H.C()&&(b.H.debug(`Offline DB: Data result for query ${a.U()}`,d.qc().C.size,'instances',Array.from(d.qc().yd()).length,'relations'),b.H.debug(`Offline DB: Data result for query ${a.U()} took ${Date.now()-c}ms to be executed`));return d})}};
|
|
817
817
|
olympe.dc.sources.cache.$p=class{constructor(a,b){this.name=a;this.C=b}static Pb(a){return a?new olympe.dc.sources.cache.$p(a.name,a.queryIds):null}toJSON(){return{name:this.name,queryIds:this.C}}};
|
|
818
818
|
olympe.dc.sources.cache.zg=class{constructor(a,b,c,d,e){this.tag=a;this.source=b;this.Dd=null!=c?c:{};this.pb=null!=d?d:[];this.C=null!=e?e:[]}static Pb(a){return a?new olympe.dc.sources.cache.zg(a.tag,a.source,a.props,a.relations,a.queryIds):null}toJSON(){return{tag:this.tag,source:this.source,props:this.Dd,relations:this.pb,queryIds:this.C}}};
|
|
819
819
|
olympe.dc.sources.cache.yh=class{constructor(a,b,c){this.F=a;this.C=b;this.timestamp=c}static Pb(a){return a?new olympe.dc.sources.cache.yh(a.destination,a.patch,a.timestamp):null}toJSON(){return{destination:this.F,patch:this.C,timestamp:this.timestamp}}};
|
|
820
820
|
olympe.dc.sources.cache.Pu=class extends olympe.dc.sources.cache.yh{constructor(a,b,c,d){super(a,b,c);this.error=d}static Pb(a){return a?new olympe.dc.sources.cache.Pu(a.destination,a.patch,a.timestamp,a.error):null}toJSON(){return{destination:this.F,patch:this.C,timestamp:this.timestamp,error:this.error}}};
|
|
821
|
-
olympe.dc.sources.cache.
|
|
822
|
-
olympe.dc.sources.cache.Dt=class{constructor(a,b){this.H=a;this.G=b;this.C=new Map;this.T=new Set;this.Z=new Set;this.J=new olympe.dc.sources.cache.
|
|
821
|
+
olympe.dc.sources.cache.Vl=class{constructor(a,b,c){this.tag=a;this.content=b;this.C=c}static Pb(a){return a?new olympe.dc.sources.cache.Vl(a.tag,a.content,a.mimetype):null}toJSON(){return{tag:this.tag,content:this.content,mimetype:this.C}}};function Vk(a,b){let c=a.O.get(b);c||(c=new Set(a.C.get(b).pb),a.O.set(b,c));return c}
|
|
822
|
+
olympe.dc.sources.cache.Dt=class{constructor(a,b){this.H=a;this.G=b;this.C=new Map;this.T=new Set;this.Z=new Set;this.J=new olympe.dc.sources.cache.ip;this.O=new Map}ad(){this.T.forEach(a=>this.C.delete(a));Array.from(this.C.entries()).forEach(([a,b])=>{b||this.C.delete(a)});return this.C}$c(a,b,c){const d=this.C.get(a);d||this.Z.add(a);var e;c=Array.from(null!=c?c:[]).reduce((h,k)=>{h[k[0]]=this.J.ha(k[1]);return h},null!=(e=null==d?void 0:d.Dd)?e:{});let f;e=null!=(f=null==d?void 0:d.C)?f:[];null===
|
|
823
823
|
this.G||e.includes(this.G)||e.push(this.G);let g;b=new olympe.dc.sources.cache.zg(a,b,c,null!=(g=null==d?void 0:d.pb)?g:[],e);this.C.set(a,b)}Qc(a,b){const c=this.C.get(a);if(c){var d;c.Dd=Array.from(b).reduce((e,[f,g])=>{null===g?delete e[f]:e[f]=this.J.ha(g);return e},null!=(d=c.Dd)?d:{})}else this.H.warn(`Trying to update an instance (${a}) which do not exists in the cache database: ignoring.`)}F(a){this.T.add(a)}Ma(a,b,c){var d;const e=null!=(d=this.C.get(b))?d:new olympe.dc.sources.cache.zg(b,
|
|
824
|
-
'unknown',{},[],[]);var f;d=null!=(f=this.C.get(c))?f:new olympe.dc.sources.cache.zg(c,'unknown',{},[],[]);b=`${a}${olympe.dc.wa.ORIGIN}${b}`;f=(g,h)=>{this.C.set(g.tag,g);const k=
|
|
825
|
-
f.pb.indexOf(g);f.pb.splice(k,1);h.delete(g)}};d&&b(d,c);e&&b(e,a)}};olympe.dc.sources.cache.Dt.ya=[olympe.dc.Writable];olympe.dc.transaction={};olympe.dc.ji=class a{constructor(b,c){this.id=null!=b?b:olympe.Y.Mc();this.F=new olympe.D.Xb('BurstTransaction#'+this.id,c);this.yb=
|
|
826
|
-
b,!1);this.J.clear()}ea(b){const c=new Map;b.forEach(d=>{const e=d.split(',');let f=c.get(e[0]);void 0===f&&(f=new Map,c.set(e[0],f));f.set(e[1],this.G.get(d))});return c}aa(b,c,d){this.
|
|
827
|
-
c)=>{this.O((d,e)=>{for(const f of this.Z)f.unsubscribe();d?b():c(e)})})}update(b,c,d){const e=olympe.dc.ga(b),f=olympe.dc.ga(c);void 0===e||void 0===f?olympe.ka.ab('dc').error('Burst transaction: instance tag or property tag is undefined'):(this.F.run(()=>{olympe.D.
|
|
828
|
-
this.ja.length=0}getContext(){return this.F}U(){return this.id}ah(){return!1}O(b){if(this.T){this.T=!1;null!==this.C&&(clearTimeout(this.C),this.C=null);this.J.clear();const c=this.ea(new Set(this.G.keys()));
|
|
824
|
+
'unknown',{},[],[]);var f;d=null!=(f=this.C.get(c))?f:new olympe.dc.sources.cache.zg(c,'unknown',{},[],[]);b=`${a}${olympe.dc.wa.ORIGIN}${b}`;f=(g,h)=>{this.C.set(g.tag,g);const k=Vk(this,g.tag);k.has(h)||(g.pb.push(h),k.add(h));null===this.G||g.C.includes(this.G)||g.C.push(this.G)};f(e,`${a}${olympe.dc.wa.DESTINATION}${c}`);f(d,b)}hc(a,b,c){const d=this.C.get(b),e=this.C.get(c);c=`${a}${olympe.dc.wa.DESTINATION}${c}`;a=`${a}${olympe.dc.wa.ORIGIN}${b}`;b=(f,g)=>{const h=Vk(this,f.tag);if(h.has(g)){const k=
|
|
825
|
+
f.pb.indexOf(g);f.pb.splice(k,1);h.delete(g)}};d&&b(d,c);e&&b(e,a)}};olympe.dc.sources.cache.Dt.ya=[olympe.dc.Writable];olympe.dc.transaction={};olympe.dc.ji=class a{constructor(b,c){this.id=null!=b?b:olympe.Y.Mc();this.F=new olympe.D.Xb('BurstTransaction#'+this.id,c);this.yb=Wk(this);this.T=!1;this.F.onDestroy(()=>this.O());this.Z=new Set;this.G=new Map;this.J=new Set;this.C=null;let d;this.eb=null!=(d=olympe.W.getParameter(olympe.dc.transaction.V.Jn))?d:30;this.ja=[]}static C(b,c){return`${b},${c}`}Fb(b){for(const c of this.ja)c(b);this.stop()}Ga(){null!==this.C&&(clearTimeout(this.C),this.C=null);const b=this.ea(this.J);0<b.size&&Xk(this,
|
|
826
|
+
b,!1);this.J.clear()}ea(b){const c=new Map;b.forEach(d=>{const e=d.split(',');let f=c.get(e[0]);void 0===f&&(f=new Map,c.set(e[0],f));f.set(e[1],this.G.get(d))});return c}aa(b,c,d){this.va(b,c,d);this.yb(b,c,d);null===this.C&&(this.C=setTimeout(this.Ga.bind(this),this.eb))}va(b,c,d){b=a.C(b,c);this.G.set(b,d);this.J.add(b)}hb(b,c){return this.G.get(a.C(b,c))}push(b,c){const d=olympe.dc.ga(b);b=c.subscribe(e=>{for(const [f,g]of e)e=olympe.dc.ga(f),this.hb(d,e)!==g&&this.aa(d,e,g.valueOf())});this.Z.add(b)}complete(){return new Promise((b,
|
|
827
|
+
c)=>{this.O((d,e)=>{for(const f of this.Z)f.unsubscribe();d?b():c(e)})})}update(b,c,d){const e=olympe.dc.ga(b),f=olympe.dc.ga(c);void 0===e||void 0===f?olympe.ka.ab('dc').error('Burst transaction: instance tag or property tag is undefined'):(this.F.run(()=>{olympe.D.en([d],g=>{this.T=!0;if(g instanceof olympe.dc.uc)olympe.ka.ab('dc').error('Cannot send complex property values in burst transactions');else{var h;this.aa(e,f,null!=(h=null==g?void 0:g.valueOf())?h:null)}})}),this.F.Z(()=>{this.O()}))}stop(){this.F.destroy();
|
|
828
|
+
this.ja.length=0}getContext(){return this.F}U(){return this.id}ah(){return!1}O(b){if(this.T){this.T=!1;null!==this.C&&(clearTimeout(this.C),this.C=null);this.J.clear();const c=this.ea(new Set(this.G.keys()));Xk(this,c,!0,b)}else null==b||b(!0)}toString(){return'Burst transaction #'+this.id}};olympe.dc.ji.prototype.complete=olympe.dc.ji.prototype.complete;olympe.dc.ji.prototype.push=olympe.dc.ji.prototype.push;olympe.dc.bq=class{C(){}toString(){}};olympe.dc.transaction.zh=class a{constructor(b){this.F=null!=b?b:olympe.dc.Sa.SERVER}C(b,c){c=new olympe.dc.db.tc(c);this.G(b,c);return c}G(b,c){for(const d of b)switch(d.o){case 1:b=a.C(d.p||{});let e;c.$c(d.t,null!=(e=d.s)?e:this.F,b,d.m);break;case 2:c.Qc(d.t,a.C(d.p),d.m);break;case 3:c.F(d.t,d.f,d.m);break;case 4:c.Ma(d.m,d.l,d.r,d.lm,d.rm);break;case 5:c.hc(d.m,d.l,d.r,d.lm,d.rm);break;case 6:break;default:throw Error('Undefined patch operation: '+d.o);}}static C(b){const c=new Map;for(const [d,
|
|
829
829
|
e]of Object.entries(b)){b=d;let f=typeof e;20<b.length&&b.startsWith('fd')&&(b=olympe.dc.Oe.Me+b.substring(2));'object'===f&&(f=e&&e.c?String(e.c):'untyped');switch(f){case '1':case '2':case '3':throw Error('Complex format for primitive types not supported.');case 'string':c.set(b,String(e));break;case 'boolean':c.set(b,!!e);break;case 'number':c.set(b,Number(e));break;case '4':c.set(b,new Date(Date.UTC(e.y,e.M-1,e.d,e.h,e.m,e.s,e.S)));break;case '5':c.set(b,new Date(Date.UTC(e.y,e.M-1,e.d)));break;
|
|
830
|
-
case '6':c.set(b,new Date(Date.UTC(e.y||1970,e.M&&e.M-1||0,e.d||1,e.h,e.m,e.s,e.S)));break;case '7':c.set(b,new olympe.D.Color(e.r,e.g,e.b,e.a));break;case '8':c.set(b,new olympe.dc.uc(e.t));break;case 'untyped':null===e&&c.set(b,null)}}return c}};function
|
|
831
|
-
function
|
|
832
|
-
olympe.dc.transaction.Yu=class{constructor(a,b,c){this.id=null!=c?c:olympe.Y.Mc();this.J=b;this.db=a;this.F=new Map;this.C=new olympe.dc.db.tc(this.id);this.sources=new Map;this.G=new Map}af(){return 0===this.C.C.size}$c(a,b,c,d){let e;const f=null!=(e=null!=c?c:this.sources.get(a))?e:this.J.fromModel(b);c
|
|
833
|
-
e=
|
|
834
|
-
b)
|
|
835
|
-
class
|
|
836
|
-
typeof a.X?{c:8,t:a.X()}:a}}function
|
|
837
|
-
olympe.dc.transaction.qf=class{constructor({
|
|
838
|
-
b,c=null){b=
|
|
839
|
-
if(!b)throw Error('Cannot delete relation with undefined origin');if(!c)throw Error('Cannot delete relation with undefined destination');a={o:5,m:a,l:b,r:c};this.fe&&d&&(a.lm=d);this.fe&&e&&(a.rm=e);this.J.push(a)}};olympe.dc.transaction.qf.ya=[olympe.dc.Writable];function
|
|
840
|
-
function
|
|
841
|
-
function
|
|
842
|
-
olympe.dc.Xa=class{constructor(a){this.id=null!=a?a:olympe.Y.Mc();this.Ya=[];this.G=new Map;this.Z=!0;this.F=new Map;this.aa=[];this.J=this.O=!1;this.T=[...olympe.dc.hj().Z]}U(){return this.id}model(a){let b;return null!=(b=this.G.get(olympe.dc.ga(a)))?b:olympe.dc.ia().model(a)}C(a){
|
|
843
|
-
olympe.dc.ga(a));let d;this.persist(c,null!=(d=this.F.get(c))?d:this.Z);return b}persist(a,b=!0){const c=olympe.dc.ga(a);var d=olympe.dc.ia();this.F.set(c,b);if(b){let f;b=null!=(f=this.G.get(c))?f:d.model(c);if(null===b)throw Error(`Try to persist an instance that does not exist: ${c}`);var e;d=null!=(e=d.source(a))?e:olympe.dc.Zd().fromModel(b);
|
|
844
|
-
if(!e&&!this.G.has(c))throw Error(`Try to remove persistence of an instance that does not exist and is not part of the transaction: ${c}`);}return this}delete(a,b=olympe.dc.Nb.Dc){
|
|
845
|
-
f);Z(d,olympe.dc.CloudObject.nameProp,c||'');void 0!==e&&this.update(a,olympe.dc.Oe.Me+d.X(),e);this.Ma(olympe.dc.CloudObject.propertyRel,a,d);this.Ma(olympe.dm.Property.typeRel,d,b);this.Ma(olympe.dc.CloudObject.containsRel,a,d);return d}Cr(a,b,c='',{ED:d=olympe.dm.Relation.J.Lu,QD:e=olympe.dm.Relation.C.tq,LD:f=olympe.dm.Relation.C.Is,nE:g=olympe.dm.Relation.C.Et,BD:h=olympe.dm.
|
|
846
|
-
c||''),olympe.dm.Relation.F,d),olympe.dm.Relation.G,k),olympe.dm.Relation.ea,e),olympe.dm.Relation.
|
|
847
|
-
olympe.dc.Xa.ya=[olympe.dc.bq];function
|
|
848
|
-
function
|
|
849
|
-
function
|
|
850
|
-
function
|
|
851
|
-
function
|
|
852
|
-
n.forEach(q=>q(null,`${p}`));
|
|
853
|
-
function
|
|
854
|
-
r();else{var u=n.X(),x,y=null!=(x=n.get(olympe.dm.File.mimeTypeProp))?x:'application/data';a.
|
|
855
|
-
new olympe.dc.db.tc);return
|
|
856
|
-
function
|
|
857
|
-
function
|
|
858
|
-
olympe.dc.transaction.vf=class{constructor(a,b,c,d,e,f,g){this.H=a;this.C=b;this.db=b.view;this.Wb=c;this.ea=d;this.
|
|
859
|
-
b.redo_stack_size)}).catch(b=>this.H.error('Failed to process get stack request',b))).then(()=>{})}};olympe.dc.transaction.vf.C={
|
|
860
|
-
olympe.W.config(function(a){F(a,olympe.dc.transaction.V.Mp,9E4);F(a,olympe.dc.transaction.V.
|
|
861
|
-
olympe.dc.transaction.R.Ca,olympe.dc.db.R.Ea,olympe.dc.R.Dg,olympe.dc.sources.R.Re,olympe.dc.R.
|
|
862
|
-
olympe.dc.transaction.Ya.
|
|
863
|
-
if(!this.F)throw Error('OperationError: Cannot create relation, destination tag is undefined, null or empty string');this.relation.Ia()===olympe.dc.wa.DESTINATION?a.Ma(b,olympe.dc.ga(this.origin),olympe.dc.ga(this.F)):a.Ma(b,olympe.dc.ga(this.F),olympe.dc.ga(this.origin))}toString(){return`CreateRelation('${this.relation.Ia()}${this.relation.X()}, ${olympe.dc.ga(this.origin)}, ${olympe.dc.ga(this.F)})`}};olympe.dc.transaction.Ya.Wz=class extends olympe.dc.transaction.Ya.lg{constructor(a,b=olympe.dc.Nb.Dc){super();this.model=a instanceof olympe.dc.CloudObject?a:olympe.dc.CloudObject.get(a);this.Ob=b}C(a){for(const b of this.ia.ad(this.model))b!==olympe.dc.ga(this.model)&&(new olympe.dc.transaction.Ya.
|
|
864
|
-
a.
|
|
865
|
-
this.relation.Ia()===olympe.dc.wa.DESTINATION?a.
|
|
866
|
-
for(const [e,f]of c){var d=this.ia.Oa(b,e,!0);d instanceof olympe.dc.uc&&
|
|
830
|
+
case '6':c.set(b,new Date(Date.UTC(e.y||1970,e.M&&e.M-1||0,e.d||1,e.h,e.m,e.s,e.S)));break;case '7':c.set(b,new olympe.D.Color(e.r,e.g,e.b,e.a));break;case '8':c.set(b,new olympe.dc.uc(e.t));break;case 'untyped':null===e&&c.set(b,null)}}return c}};function Yk(a,b){let c;return null!=(c=a.sources.get(b))?c:a.J.Fe(b)}function Zk(a,b){let c,d,e;return null!=(e=null!=(d=null==(c=a.C.Lc(b))?void 0:c.Vb())?d:a.db.model(b))?e:null}function $k(a,b){let c;return null!=(c=a.G.get(b))?c:a.db.Lf(b)||!a.db.Ha(b)}function al(a,b){0===a.G.size?a.G=b:b.forEach((c,d)=>a.G.set(d,c))}function bl(a){return Array.from(a.C.ad()).filter(b=>!b.zd()).map(b=>b.tag())}
|
|
831
|
+
function cl(a,b,c,d){d(a.C);c&&b!==olympe.dc.Sa.SELF&&(c=a.F.get(b),c||(c=new olympe.dc.db.tc(a.id),a.F.set(b,c)),d(c))}function dl(a,b,c){const d=Yk(a,b),e=$k(a,b),f=Zk(a,b);cl(a,d,e,g=>{g.F(b,c,f)})}
|
|
832
|
+
olympe.dc.transaction.Yu=class{constructor(a,b,c){this.id=null!=c?c:olympe.Y.Mc();this.J=b;this.db=a;this.F=new Map;this.C=new olympe.dc.db.tc(this.id);this.sources=new Map;this.G=new Map}af(){return 0===this.C.C.size}$c(a,b,c,d){let e;const f=null!=(e=null!=c?c:this.sources.get(a))?e:this.J.fromModel(b);c=$k(this,a);this.sources.set(a,f);cl(this,f,c,g=>{g.$c(a,f,d,b)})}Qc(a,b){const c=Yk(this,a),d=$k(this,a),e=Zk(this,a);cl(this,c,d,f=>{f.Qc(a,null!=b?b:new Map,e)})}Ma(a,b,c){const d=Yk(this,b),
|
|
833
|
+
e=Yk(this,c);var f=$k(this,b)&&$k(this,c)&&d!==olympe.dc.Sa.SELF&&e!==olympe.dc.Sa.SELF;f&&d!==e&&a!==olympe.dc.mc.Yc&&(f=g=>{let h;return null!=(h=olympe.dc.ia().name(g))?h:g},olympe.ka.ab('dc').warn(`Try to create a relation between 2 objects that have different locations: \n ${f(b)} (${b})-[${f(a)} (${a})]->${f(c)} (${c}), originSrc: ${f(d)} (${d}), destinationSrc: ${f(e)} (${e})`),f=!1);cl(this,d,f,g=>{g.Ma(a,b,c,Zk(this,b),Zk(this,c))})}hc(a,b,c){const d=Yk(this,b),e=Yk(this,c);let f=$k(this,
|
|
834
|
+
b)&&$k(this,c)&&d!==olympe.dc.Sa.SELF&&e!==olympe.dc.Sa.SELF;f&&d!==e&&a!==olympe.dc.mc.Yc&&(olympe.ka.ab('dc').warn(`Try to delete a relation between 2 objects that have different locations: ${b}-[${a}]->${c}`),f=!1);cl(this,d,f,g=>{g.hc(a,b,c,Zk(this,b),Zk(this,c))})}};function el(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.sp.Rq)if(e===olympe.dc.Sa.SELF)d[g]=olympe.dc.ia().U();else{if(e===olympe.dc.Sa.SERVER)continue}else g.startsWith(olympe.dc.Oe.Me)&&(g='fd'+g.substring(1));e=a.T(e);c&&e instanceof Object&&8===e.c?a.O.set(g,e):d[g]=e}return d}function fl(a){if(0===a.O.size)return null;const b=Object.create(null);a.O.forEach((c,d)=>{b[d]=c});a.O.clear();return b}
|
|
835
|
+
class gl{constructor(){this.O=new Map}T(a){return a instanceof olympe.D.Qa||a instanceof olympe.D.fa||a instanceof olympe.D.ba?a.valueOf():a instanceof Date||a instanceof olympe.D.gb?(a=a instanceof olympe.D.gb?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.Wg().valueOf(),g:a.Tg().valueOf(),b:a.Qg().valueOf(),a:a.Pg().valueOf()}:a&&'function'===
|
|
836
|
+
typeof a.X?{c:8,t:a.X()}:a}}function tf(a){const b=a.J.concat(a.G).concat(a.O).concat(a.C).concat(a.T);a.O=[];a.G=[];a.C=[];a.T=[];a.J=[];return b}
|
|
837
|
+
olympe.dc.transaction.qf=class{constructor({Ok:a=!1,Ph:b=!0,fe:c=!0}={}){this.O=[];this.G=[];this.C=[];this.T=[];this.J=[];this.Ok=null!=a?a:!1;this.fe=null!=c?c:!0;this.Ph=null!=b?b:!0;this.Z=olympe.D?new gl:new class extends gl{T(d){return d&&'function'===typeof d.X?{c:8,t:d.X()}:d}}}flush(){return JSON.stringify(tf(this))}$c(a,b,c,d=null){c=el(this.Z,null!=c?c:null,this.Ok);c={o:1,t:a,p:c};this.Ph&&(c.s=b);this.fe&&d&&(c.m=d);this.O.push(c);this.Ok&&(b=fl(this.Z))&&this.C.push({o:2,t:a,p:b})}Qc(a,
|
|
838
|
+
b,c=null){b=el(this.Z,b||null,!1);a={o:2,t:a,p:b};this.fe&&c&&(a.m=c);this.C.push(a)}F(a,b,c=null){a={o:3,t:a,f:b};this.fe&&c&&(a.m=c);this.G.push(a)}Ma(a,b,c,d=null,e=null){if(!a)throw Error('Cannot create relation of undefined type');if(!b)throw Error(`Cannot create relation ${a} from undefined origin to ${c}`);if(!c)throw Error(`Cannot create relation ${a} from ${b} to undefined destination`);a={o:4,m:a,l:b,r:c};this.fe&&d&&(a.lm=d);this.fe&&e&&(a.rm=e);this.T.push(a)}hc(a,b,c,d=null,e=null){if(!a)throw Error('Cannot delete relation of undefined type');
|
|
839
|
+
if(!b)throw Error('Cannot delete relation with undefined origin');if(!c)throw Error('Cannot delete relation with undefined destination');a={o:5,m:a,l:b,r:c};this.fe&&d&&(a.lm=d);this.fe&&e&&(a.rm=e);this.J.push(a)}};olympe.dc.transaction.qf.ya=[olympe.dc.Writable];function hl(a){var b=new olympe.dc.Xa;b.Z=a;return b}function il(a,b){b instanceof olympe.dc.Xa&&b.F.forEach((c,d)=>a.F.set(d,c));a.Ya.push(b);return b}
|
|
840
|
+
function jl(a,b,c,d){c=a.create(null!=c?c:olympe.dc.CloudObject,void 0);if('string'===typeof b)b=b||'',Z(c,olympe.dc.CloudObject.nameProp.X(),b);else for(const [f,g]of Object.entries(b))Z(c,f,g);b=c.X();d=null!=d?d:olympe.dc.CloudObject;const e=olympe.dc.CloudObject.extendRel.X();il(a,new olympe.dc.transaction.Ya.wo(e,b));il(a,new olympe.dc.transaction.Ya.il(e,b,d));return c}
|
|
841
|
+
function kl(a,b){if(a.J)throw Error('Operation not permitted: this transaction has already been executed');a.J=!0;const c=[d=>{a.J=d},...a.aa,null!=b?b:()=>{}];return(d,e)=>{c.forEach(f=>f(d,e))}}
|
|
842
|
+
olympe.dc.Xa=class{constructor(a){this.id=null!=a?a:olympe.Y.Mc();this.Ya=[];this.G=new Map;this.Z=!0;this.F=new Map;this.aa=[];this.J=this.O=!1;this.T=[...olympe.dc.hj().Z]}U(){return this.id}model(a){let b;return null!=(b=this.G.get(olympe.dc.ga(a)))?b:olympe.dc.ia().model(a)}C(a){al(a,this.F);for(const b of this.Ya)b.C(a);try{this.T.forEach(b=>b(a))}catch(b){throw Error(`Transaction compilation error: ${b.message}`);}}create(a,b){b=il(this,new olympe.dc.transaction.Ya.io(a,b));const c=b.X();this.G.set(c,
|
|
843
|
+
olympe.dc.ga(a));let d;this.persist(c,null!=(d=this.F.get(c))?d:this.Z);return b}persist(a,b=!0){const c=olympe.dc.ga(a);var d=olympe.dc.ia();this.F.set(c,b);if(b){let f;b=null!=(f=this.G.get(c))?f:d.model(c);if(null===b)throw Error(`Try to persist an instance that does not exist: ${c}`);var e;d=null!=(e=d.source(a))?e:olympe.dc.Zd().fromModel(b);il(this,new olympe.dc.transaction.Ya.Zu(c,d))}else{if((e=d.Ha(c))&&d.Lf(c))throw Error(`Try to remove persistence of an instance already persisted: ${c}`);
|
|
844
|
+
if(!e&&!this.G.has(c))throw Error(`Try to remove persistence of an instance that does not exist and is not part of the transaction: ${c}`);}return this}delete(a,b=olympe.dc.Nb.Dc){il(this,new olympe.dc.transaction.Ya.xo(a,b))}update(a,b,c){return il(this,new olympe.dc.transaction.Ya.Zv(a,b,c))}Ma(a,b,c){il(this,new olympe.dc.transaction.Ya.il(a,b,c))}hc(a,b,c){il(this,new olympe.dc.transaction.Ya.mt(a,b,c))}Km(a,b){il(this,new olympe.dc.transaction.Ya.wo(a,b))}defineProperty(a,b,c,d,e,f){d=this.create(olympe.dm.Property,
|
|
845
|
+
f);Z(d,olympe.dc.CloudObject.nameProp,c||'');void 0!==e&&this.update(a,olympe.dc.Oe.Me+d.X(),e);this.Ma(olympe.dc.CloudObject.propertyRel,a,d);this.Ma(olympe.dm.Property.typeRel,d,b);this.Ma(olympe.dc.CloudObject.containsRel,a,d);return d}Cr(a,b,c='',{ED:d=olympe.dm.Relation.J.Lu,QD:e=olympe.dm.Relation.C.tq,LD:f=olympe.dm.Relation.C.Is,nE:g=olympe.dm.Relation.C.Et,BD:h=olympe.dm.Uk.NONE,mE:k=olympe.dm.Relation.O|h}={},l=olympe.Y.Mc()){c=Z(Z(Z(Z(Z(Z(Z(Z(Z(this.create(olympe.dm.Relation,l),olympe.dc.CloudObject.nameProp,
|
|
846
|
+
c||''),olympe.dm.Relation.F,d),olympe.dm.Relation.G,k),olympe.dm.Relation.ea,e),olympe.dm.Relation.va,e),olympe.dm.Relation.aa,e),olympe.dm.Relation.Z,f),olympe.dm.Relation.ja,g),olympe.dm.Relation.T,h);this.Ma(olympe.dc.CloudObject.lj,a,c);this.Ma(olympe.dm.Relation.destinationModelRel,c,b);this.Ma(olympe.dc.CloudObject.containsRel,a,c);return c}ah(){return!1}Dm(a){this.aa.push(olympe.D.Wa().G(a))}ob(a,b){ll(olympe.dc.hj(),this,kl(this,a),b)}Lm(a){a=kl(this,a);ml(olympe.dc.hj(),this,a,!0)}toString(){return`Transaction #${this.id}`}};
|
|
847
|
+
olympe.dc.Xa.ya=[olympe.dc.bq];function Wk(a){var b=olympe.dc.hj();const c=a.U();b.J.set(c,a);return(d,e,f)=>{const g=new olympe.dc.db.tc(c);g.Qc(d,(new Map).set(e,f),b.db.model(d));b.C.xc(gf(g,Infinity))}}
|
|
848
|
+
function Xk(a,b,c,d){var e=olympe.dc.hj();const f=olympe.dc.Request.C.ii,g=olympe.dc.Request.C.fh,h=a.U();a=a.ah();const k=new Map;for(const l of b.keys()){const n=e.db.source(l);if(n===olympe.dc.Sa.SELF||!e.db.Lf(l))continue;let p=k.get(n);p||(p=new olympe.dc.db.tc(h),k.set(n,p));p.Qc(l,b.get(l),e.db.model(l))}for(const [l,n]of k)b=new olympe.dc.Request(c?g:f,l,new olympe.dc.transaction.Ri(n,a)),b=e.Wb.request(b).catch(p=>null==d?void 0:d(!1,`${p}`)),c&&b.then(p=>{e.C.xc(gf(n,p));null==d||d(!0)})}
|
|
849
|
+
function ll(a,b,c,d){if(d){const e=b.U();a.F.set(e,c);ml(a,b,(f,g)=>{f||(a.F.delete(e),c(f,g))},!1)}else ml(a,b,c,!1)}function nl(a){const b=olympe.dc.Request.C.Kj;rf(a.Wb,olympe.dc.Request.C.Kn,c=>{var d=c.content;c=d.rollback;d=d.error;const e=c.U(),f=a.J.get(e);void 0!==f&&(a.J.delete(e),f.Fb(d));a.C.xc(c);a.H.warn(`Burst update (id=${e}) has been refused and is rolled back. Error: ${d}`)});rf(a.Wb,b,c=>{c=c.content;ol(a,c.id,c.finalize,c.error)})}
|
|
850
|
+
function pl(a,b,c){c&&a.ja.has(c)||a.Z.push(b);return a}
|
|
851
|
+
function ml(a,b,c,d=!1){const e=b.U(),f=new olympe.dc.transaction.Yu(a.db,a.ea,e);try{b.C(f)}catch(p){c(!1,p.message);return}if(f.af()){c(!0);var g;null==(g=a.F.get(e))||g(!0);a.F.delete(e)}else{a.G.set(e,[]);var h=bl(f);a.C.C.hb(h);g=h.filter(p=>$k(f,p));var k=mg(a.C,f.C,g),l=olympe.D.Wa().G((p,q)=>c(null!==p,q)),n=[k,l];ql(a,f,g).then(p=>{n.splice(1,0,p);rl(a,e,h,f.F.size+1);return sl(a,f.F,d,b.ah(),b.O)}).then(p=>{n.forEach(q=>q(p));ol(a,e,olympe.dc.transaction.vf.C.Fi)}).catch(p=>{a.H.error(p);
|
|
852
|
+
n.forEach(q=>q(null,`${p}`));tl(a,e)})}}
|
|
853
|
+
function ql(a,b,c){const d=b.C,e=olympe.dm.File.urlProp.X();c=c.filter(n=>{let p;return a.db.Rb(n,olympe.dm.File)&&void 0!==(null==(p=d.Lc(n))?void 0:p.Oa(e))}).map(olympe.dc.CloudObject.get);if(0===c.length)return Promise.resolve(()=>{});const f=olympe.dm.File.C.X(),g=olympe.dm.File.modificationDateProp.X(),h=Array.from(b.F.values()),k=[],l=olympe.Y.Xe();return Promise.all(c.map(n=>{const p=n.get(e);if(p.startsWith('blob:'))return l.G(p).then(q=>new Promise((r,t)=>{if(null===q)URL.revokeObjectURL(p),
|
|
854
|
+
r();else{var u=n.X(),x,y=null!=(x=n.get(olympe.dm.File.mimeTypeProp))?x:'application/data';a.va.ea(u,q,y,z=>{const A=h.reduce((D,O)=>D||O.Lc(u),null);null!==A&&(z=(new Map).set(e,z).set(f,!0).set(g,new Date),A.Cm(z),k.push([u,z]));URL.revokeObjectURL(p);r()},t)}}));2048<p.length&&a.H.error('Trying to create a file with an URL longer than 2048. It likely is a data url and should be an object url. File tag:',n.X());return Promise.resolve([])})).then(()=>{const n=k.reduce((p,[q,r])=>{p.Qc(q,r);return p},
|
|
855
|
+
new olympe.dc.db.tc);return mg(a.C,n)})}function rl(a,b,c,d){const e=olympe.D.Sg(),f=new olympe.async.Xj(e);0<a.T&&f.tn(a.T);const g=olympe.dc.transaction.vf.C.Hu;let h=!0;const k=a.G.get(b);for(let l=0;l<d;l++)f.add((n,p)=>{k.push(e.G((q,r)=>{h&&(h=q!==g);r?p(r):n()}))});Sc(f,(l,n)=>{l||a.H.warn(`An error occurred while processing the notification of transaction (${b}): ${n}.`);h&&a.C.C.Fb(c);tl(a,b)});f.start()}
|
|
856
|
+
function sl(a,b,c,d,e){if(c&&olympe.D.Na(a.aa.F)!==olympe.auth.Ta.C.df)return Promise.reject('Cannot persist with batch transactions API if not authenticated (aka: `Transaction.executeAsLarge()`).');const f=c?olympe.dc.Request.C.Mg:olympe.dc.Request.C.Ue;return Promise.all(Array.from(b).map(([g,h])=>{g=new olympe.dc.Request(f,g,new olympe.dc.transaction.Ri(h,d,e));return a.Wb.request(g)})).then(g=>g[0])}
|
|
857
|
+
function ol(a,b,c,d){let e,f;null==(f=null==(e=a.G.get(b))?void 0:e.pop())||f(c,null!=d?d:null)}function tl(a,b){var c;null==(c=a.G.get(b))||c.forEach(d=>{d(olympe.dc.transaction.vf.C.Fi,null)});a.G.delete(b);if(0===a.G.size){for(const d of a.O)d();a.O=[]}a.F.has(b)&&(c=a.F.get(b),a.F.delete(b),c(!0))}function ul(a,b){if(0<a.G.size){const c=olympe.D.Wa();a.O.push(()=>{!c.fb()&&c.run(b)})}else b()}
|
|
858
|
+
olympe.dc.transaction.vf=class{constructor(a,b,c,d,e,f,g){this.H=a;this.C=b;this.db=b.view;this.Wb=c;this.ea=d;this.va=e;this.aa=f;this.T=g.get('notificationTimeout');this.Z=[];let h;this.ja=new Set(null!=(h=g.get('disabledCompilers'))?h:[]);this.J=new olympe.Y.Hh(g.get('burstHoldTime'));this.G=new Map;this.O=[];this.F=new Map;this.Ga=new olympe.Y.promise.km;nl(this)}ke(a){hb(this.Ga,()=>this.Wb.request(new olympe.dc.Request(olympe.dc.Request.C.To,olympe.dc.Sa.SERVER)).then(b=>{a(b.ids,b.undo_stack_size,
|
|
859
|
+
b.redo_stack_size)}).catch(b=>this.H.error('Failed to process get stack request',b))).then(()=>{})}};olympe.dc.transaction.vf.C={Nl:0,Fi:1,Hu:2};olympe.dc.transaction.Ri=class{constructor(a,b=!1,c=!1){this.F=a;this.G=b;this.C=c}ah(){return this.G}qc(){return this.F}};olympe.dc.transaction.R={Ca:'dc.transaction.Logger',Ea:'dc.transaction.Manager'};olympe.dc.transaction.V={Mp:'dc.transaction.timeout',Jn:'dc.transaction.burstInterval',ro:'dc.transaction.disabledCompilers'};
|
|
860
|
+
olympe.W.config(function(a){F(a,olympe.dc.transaction.V.Mp,9E4);F(a,olympe.dc.transaction.V.Jn,30);F(a,olympe.dc.transaction.V.ro,[]);E(a,olympe.dc.transaction.R.Ca,[olympe.ka.R.Ea],b=>b.Vc('dc'));E(a,'olympe.dc.transaction.Config',[new olympe.W.oa(olympe.dc.transaction.V.Mp),new olympe.W.oa(olympe.dc.transaction.V.ro),new olympe.W.oa(olympe.dc.db.V.el)],(b,c,d)=>new Map([['notificationTimeout',b],['disabledCompilers',c],['burstHoldTime',d]]));C(a,olympe.dc.transaction.R.Ea,olympe.dc.transaction.vf,
|
|
861
|
+
olympe.dc.transaction.R.Ca,olympe.dc.db.R.Ea,olympe.dc.R.Dg,olympe.dc.sources.R.Re,olympe.dc.R.Ij,olympe.auth.R.Ea,'olympe.dc.transaction.Config')},'olympe.dc.transaction');olympe.dc.transaction.Ya={};function vl(a,b){const c=new Map;for(const [d,e]of b)c.set(d,a.Na(e));return c}olympe.dc.transaction.Ya.lg=class{constructor(){this.ia=olympe.dc.ia()}C(){throw Error('Abstract method build() not override !');}toString(){throw Error('Abstract method toString() not override !');}Na(a){a=olympe.D.Na(a);return void 0===a||null===a?null:olympe.D.Yr(a)?a.valueOf():a}};olympe.dc.transaction.Ya.lg.ya=[olympe.dc.bq];olympe.dc.transaction.Ya.Cn=class extends olympe.dc.transaction.Ya.lg{constructor(a,b){super();this.relation=a instanceof olympe.dc.Pa.Relation?a:new olympe.dc.Pa.Relation(olympe.dc.ga(a));this.origin=this.ia.Ha(b)?olympe.dc.CloudObject.get(b):b}getType(){return this.relation.X()}Ia(){return this.relation.Ia()}C(){throw Error('Abstract method build() not override !');}toString(){throw Error('Abstract method toString() not override !');}};function Z(a,b,c){a.Dd.set(olympe.dc.ga(b),c);return a}olympe.dc.transaction.Ya.io=class extends olympe.dc.transaction.Ya.lg{constructor(a,b){super();let c;this.tag=null!=(c=b&&olympe.dc.ga(b))?c:olympe.Y.Cf();this.model=olympe.dc.ga(a);this.source=null;this.Dd=new Map}X(){return this.tag}cc(){return this.model}ci(a){this.source=a;return this}C(a){const b=this.cc(),c=this.X();if(!b)throw Error('OperationError: Cannot create instance, model tag is undefined');a.$c(c,b,this.source,vl(this,this.Dd))}toString(){return`CreateInstance(${this.cc()}, ${this.X()})`}};
|
|
862
|
+
olympe.dc.transaction.Ya.io.ya=[olympe.dc.Ne];olympe.dc.transaction.Ya.il=class extends olympe.dc.transaction.Ya.Cn{constructor(a,b,c){super(a,b);this.F=this.ia.Ha(c)?olympe.dc.CloudObject.get(c):c}C(a){const b=this.getType();if(''===b)throw Error('OperationError: Cannot create relation, type is undefined, null or empty string');if(b===olympe.dc.mc.Yc)throw Error('OperationError: Cannot create the instance -> model relation');if(!this.origin)throw Error('OperationError: Cannot create relation, origin tag is undefined, null or empty string');
|
|
863
|
+
if(!this.F)throw Error('OperationError: Cannot create relation, destination tag is undefined, null or empty string');this.relation.Ia()===olympe.dc.wa.DESTINATION?a.Ma(b,olympe.dc.ga(this.origin),olympe.dc.ga(this.F)):a.Ma(b,olympe.dc.ga(this.F),olympe.dc.ga(this.origin))}toString(){return`CreateRelation('${this.relation.Ia()}${this.relation.X()}, ${olympe.dc.ga(this.origin)}, ${olympe.dc.ga(this.F)})`}};olympe.dc.transaction.Ya.Wz=class extends olympe.dc.transaction.Ya.lg{constructor(a,b=olympe.dc.Nb.Dc){super();this.model=a instanceof olympe.dc.CloudObject?a:olympe.dc.CloudObject.get(a);this.Ob=b}C(a){for(const b of this.ia.ad(this.model))b!==olympe.dc.ga(this.model)&&(new olympe.dc.transaction.Ya.xo(b,this.Ob)).C(a)}toString(){return`DeleteAllInstances(${this.model.X()}, ${this.Ob})`}};olympe.dc.transaction.Ya.wo=class extends olympe.dc.transaction.Ya.Cn{C(a){const b=this.getType();if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.mc.Yc)throw Error('OperationError: Cannot delete the instance -> model relation');const c=olympe.dc.ga(this.origin);if(!this.origin)throw Error('OperationError: Cannot delete relation, left tag is undefined');const d=this.Ia(),e=this.ia.bb(c,this.relation);for(const f of e)d===olympe.dc.wa.DESTINATION?
|
|
864
|
+
a.hc(b,c,f):a.hc(b,f,c)}toString(){return`DeleteAllRelations(${this.Ia()}${this.getType()})`}};olympe.dc.transaction.Ya.xo=class extends olympe.dc.transaction.Ya.lg{constructor(a,b=olympe.dc.Nb.Dc){super();this.tag=this.ia.Ha(a)?olympe.dc.CloudObject.get(a):a;this.Ob=b}X(){return olympe.dc.ga(this.tag)}C(a){const b=this.X();if(void 0===b)throw Error('OperationError: Cannot delete instance, tag is undefined');this.ia.Ha(b)&&dl(a,b,this.Ob)}toString(){return'DeleteInstance('+this.X()+', '+this.Ob+')'}};olympe.dc.transaction.Ya.mt=class extends olympe.dc.transaction.Ya.il{C(a){const b=this.relation.X();if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.mc.Yc)throw Error('OperationError: Cannot delete the instance -> model relation');const c=olympe.dc.ga(this.origin);if(void 0===c)throw Error('OperationError: Cannot delete relation, left tag is undefined');const d=olympe.dc.ga(this.F);if(void 0===d)throw Error('OperationError: Cannot delete relation, right tag is undefined');
|
|
865
|
+
this.relation.Ia()===olympe.dc.wa.DESTINATION?a.hc(b,c,d):a.hc(b,d,c)}toString(){return'DeleteRelation('+this.relation.Ia()+this.relation.X()+', '+olympe.dc.ga(this.origin)+', '+olympe.dc.ga(this.F)+')'}};olympe.dc.transaction.Ya.Zv=class extends olympe.dc.transaction.Ya.lg{constructor(a,b,c){super();this.tag=this.ia.Ha(a)?olympe.dc.CloudObject.get(a):a;this.Dd=new Map;void 0!==b&&this.Dd.set(olympe.dc.ga(b),c)}X(){return olympe.dc.ga(this.tag)}C(a){const b=this.X();if(void 0===b)throw Error('OperationError: Cannot update instance, tag is undefined');var c;if(!(null!=(c=a.C.Lc(b))&&c.F()||this.ia.Ha(b)))throw Error('OperationError: Instance #'+b+' not found so it cannot be updated');c=vl(this,this.Dd);
|
|
866
|
+
for(const [e,f]of c){var d=this.ia.Oa(b,e,!0);d instanceof olympe.dc.uc&&dl(a,d.X(),olympe.dc.Nb.Dc);f instanceof olympe.dc.uc&&!$k(a,f.X())&&(d=new olympe.dc.Xa,d.persist(f.X()),d.C(a))}a.Qc(b,c)}toString(){return'UpdateInstance('+this.X()+', '+vl(this,this.Dd)+')'}};olympe.dc.transaction.Ya.Zu=class a extends olympe.dc.transaction.Ya.lg{constructor(b,c){super();this.tag=b;this.source=c}C(b){const c=olympe.dc.ia();if($k(b,this.tag)&&c.Ha(this.tag)&&!c.Lf(this.tag)){const e=c.Cb(this.tag,!0);var d;let f;null==(f=null==(d=b.C.Lc(this.tag))?void 0:d.Cb())||f.forEach((g,h)=>{e.set(h,g)});for(const g of e.values())g instanceof olympe.dc.uc&&c.Ha(g.X())&&(new a(g.X(),this.source)).C(b);d=c.model(this.tag);b.$c(this.tag,d,this.source,e);for(const [g,h,k]of Og(c,this.tag))$k(b,
|
|
867
867
|
k)&&(h===olympe.dc.wa.ORIGIN?b.Ma(g,k,this.tag):b.Ma(g,this.tag,k))}}toString(){return`PersistOperation: tag - ${this.tag}, src - ${this.source}`}};olympe.dc.ga=function(a){let b=null;if('string'===typeof a)return a;if('function'===typeof(null==a?void 0:a.X)&&(null==a||!a.Og))b=a.X();else if('function'===typeof a){let d;b=null!=(d=olympe.dc.na.cc(a))?d:''}else if(olympe.D.bf(a)){let d;b=olympe.dc.ga(null==(d=olympe.D.Na(a))?void 0:d.valueOf())}let c;return null!=(c=b)?c:''};w('olympe.dc.instanceToTag',olympe.dc.ga);olympe.dc.ia=function(){return olympe.dc.Jr().view};olympe.dc.register=function(a,b){olympe.dc.na.C(a,b)};
|
|
868
|
-
olympe.dc.defineProperty=function(a){return new olympe.dc.Pa.Property(a)};olympe.dc.Cr=function(a,b=olympe.dc.wa.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.wa.DESTINATION){const e=olympe.dc.wa.DESTINATION;return b===olympe.dc.wa.ORIGIN||b===e?new olympe.dc.Pa.Relation(a,b):new olympe.dc.Pa.Relation(a,d,b,c)};olympe.dc.Ew=function(a){return a.bc()};olympe.dc.nb={};olympe.dc.nb.
|
|
869
|
-
olympe.dc.nb.
|
|
868
|
+
olympe.dc.defineProperty=function(a){return new olympe.dc.Pa.Property(a)};olympe.dc.Cr=function(a,b=olympe.dc.wa.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.wa.DESTINATION){const e=olympe.dc.wa.DESTINATION;return b===olympe.dc.wa.ORIGIN||b===e?new olympe.dc.Pa.Relation(a,b):new olympe.dc.Pa.Relation(a,d,b,c)};olympe.dc.Ew=function(a){return a.bc()};olympe.dc.nb={};olympe.dc.nb.Im=a=>'string'===typeof a||'number'===typeof a||'boolean'===typeof a||a instanceof String?olympe.D.Ab(a):a instanceof olympe.D.Qa?a:null;olympe.dc.nb.Fm=a=>'boolean'===typeof a||a instanceof Boolean?olympe.D.Sb(a):a instanceof olympe.D.fa?a:null;olympe.dc.nb.Hm=a=>'number'===typeof a||a instanceof Number?olympe.D.ra(a):'string'===typeof a||a instanceof String?olympe.D.ra(Number.parseFloat(a.valueOf())):a instanceof olympe.D.ba?a:null;
|
|
869
|
+
olympe.dc.nb.Gm=a=>'number'===typeof a||a instanceof Number?Zb(a.valueOf()):'string'===typeof a||a instanceof String?new olympe.D.gb(new Date(a.valueOf().valueOf())):a instanceof Date?new olympe.D.gb(a):a instanceof olympe.D.gb?a:null;olympe.dc.nb.xr=function(a){return a instanceof olympe.D.Color?a:'string'===typeof a||a instanceof String?cc(a.valueOf()):null};olympe.dc.nb.yr=a=>a instanceof olympe.dc.CloudObject?a:a instanceof olympe.dc.uc?olympe.dc.CloudObject.get(a.tag):null;
|
|
870
870
|
olympe.dc.nb.Zi=a=>a instanceof olympe.dc.uc?olympe.dc.CloudObject.get(a.tag):a;olympe.dc.nb.Ac=a=>{a=a instanceof olympe.dc.uc?olympe.dc.CloudObject.get(a.tag):a;let b;return null!=(b=a instanceof olympe.dc.CloudObject?a.Ac():a)?b:null};
|
|
871
|
-
olympe.dc.nb.Yw=a=>{switch(a){case olympe.D.fa:return olympe.dc.nb.
|
|
872
|
-
olympe.dc.za=class{constructor(a,b,c){void 0===a||null===a?olympe.ka.ab('dc').warn('attempt to create a listdef with a null or undefind basetag. This listdef is thus without effect.'):(this.F=olympe.D.
|
|
873
|
-
{var b=this.C.U();a.H.debug('QueryMGR: [ID:',b,'] - Unregistered');const c=a.C.get(b);if(null==c)var d=0;else 0<c.counter&&c.counter--,d=0===c.counter;d&&(c.C.release(),a.C.delete(b));this.C=null})}return this}
|
|
874
|
-
this.
|
|
875
|
-
this.
|
|
876
|
-
if(c instanceof olympe.dc.Pa.Property)throw Error(`ListDef.transform(): Properties cannot be used as transformer, unlike relations ${c}`);if(!c||'function'!==typeof c.C)break;a.push(c)}b=new olympe.dc.za(this.F,a);b.zc=this.zc;b.Hd(
|
|
877
|
-
let b=this.da;b instanceof Array||(b=b?[b]:[]);a.transform(b);return a}toString(){let a=this.da;a=a?', '+(a.join?a.join(', '):a.toString()):'';return'ListDef(#'+olympe.D.Na(this.F)+a+')'}Wt(){return this.
|
|
871
|
+
olympe.dc.nb.Yw=a=>{switch(a){case olympe.D.fa:return olympe.dc.nb.Fm;case olympe.D.Qa:return olympe.dc.nb.Im;case olympe.D.ba:return olympe.dc.nb.Hm;case olympe.D.gb:return olympe.dc.nb.Gm;case olympe.D.Color:return olympe.dc.nb.xr;case olympe.dc.CloudObject:return olympe.dc.nb.yr;default:return olympe.dc.nb.Zi}};olympe.dc.jc={};olympe.dc.gf=class{ma(){}G(){}compare(){}J(){}ha(){}toString(){}};function wl(a){let b=null;for(a=[...a.da];null===b&&0<a.length;)b=a.pop().Mb();return b}function xl(a,b){a.T()||(a=`Calling "${b}" on subscription with id ${a.U()} while it is not ready (thus no data is available).`+'This call should be made within an onReady callback. You can also consider to use Queries API instead of ListDefs (which are deprecated)',olympe.ka.ab('dc').warn(a))}
|
|
872
|
+
olympe.dc.za=class{constructor(a,b,c){void 0===a||null===a?olympe.ka.ab('dc').warn('attempt to create a listdef with a null or undefind basetag. This listdef is thus without effect.'):(this.F=olympe.D.ua([a],olympe.dc.ga,String),this.da=void 0!==b&&(Array.isArray(b)?b:[b])||[],this.valueType=c||wl(this),this.C=null,this.zc=void 0)}je(){return olympe.dc.je()}ob(){if(null===this.C){const a=olympe.dc.jc.zx();this.C=yl(a,this,this.zc);null!==this.valueType&&this.C.Hd(this.valueType);olympe.D.Wa().Z(()=>
|
|
873
|
+
{var b=this.C.U();a.H.debug('QueryMGR: [ID:',b,'] - Unregistered');const c=a.C.get(b);if(null==c)var d=0;else 0<c.counter&&c.counter--,d=0===c.counter;d&&(c.C.release(),a.C.delete(b));this.C=null})}return this}lc(){null===this.C&&this.ob();return this.C}Hd(a){this.valueType=a;null!==this.C&&this.C.Hd(this.valueType)}Mb(){return null!==this.C?this.C.Mb():null===this.valueType?olympe.dc.CloudObject:this.valueType}Wd(){return this.F}Fl(){return this.da}Bd(a,b){return this.lc().Bd(a,b)}Lk(a){this.lc().Lk(a)}Yt(){return this.lc().Tc()}Xt(){return this.lc().T()}get(a){return this.lc().get(a)}Zh(){return this.lc().Zh()}Xh(a){const b=
|
|
874
|
+
this.lc();xl(b,'getCurrent');return b.Xh(a)}has(a){return this.lc().has(a)}Zg(a){const b=this.lc();xl(b,'hasCurrent');return b.Zg(a)}ie(a){return this.lc().ie(a)}Cy(a){return this.ie(a).asObservable()}Ze(a){const b=this.lc();xl(b,'getCurrentAt');return b.Ze(a)}$e(a){return this.lc().$e(a)}Ef(a){const b=this.lc();xl(b,'getCurrentKeyAt');return b.Ef(a)}xd(a){return this.lc().xd(a)}Hy(a){return this.xd(a).asObservable()}Ff(a){const b=this.lc();xl(b,'getCurrentRank');return b.Ff(a)}Fc(){return this.lc().Fc()}Dy(){return this.Fc().asObservable()}Gf(){return this.lc().Gf()}mf(){return this.lc().mf()}Iy(){return this.mf().asObservable()}fg(){const a=
|
|
875
|
+
this.lc();xl(a,'getCurrentSize');return a.fg()}forEach(a,b){this.lc().forEach(a,b)}he(a){const b=this.lc();xl(b,'forEachCurrentValue');return b.he(a)}bj(a,b,c,d){a=new olympe.dc.da.uh(a,b);(new olympe.dc.za(this.F,[...this.da,a],this.valueType)).forEach(c,d)}transform(...a){var b=a;if(Array.isArray(a[0])){if(1<a.length)throw Error('ListDef.transform() should be called either with one array argument, or with ... arguments, but not both');b=a[0]}a=[...this.da];for(const c of b){if(void 0===c)throw Error('ListDef.transform(): Trying to set an undefined transformer');
|
|
876
|
+
if(c instanceof olympe.dc.Pa.Property)throw Error(`ListDef.transform(): Properties cannot be used as transformer, unlike relations ${c}`);if(!c||'function'!==typeof c.C)break;a.push(c)}b=new olympe.dc.za(this.F,a);b.zc=this.zc;b.Hd(wl(b)||this.valueType||Object);return b}Qk(a){return this.transform(new olympe.dc.da.xf(a))}filter(a){return this.transform(new olympe.dc.da.jf(a))}tk(){const a=new olympe.dc.Pj(this.F,null===this.valueType?void 0:this.valueType);'boolean'===typeof this.zc&&(a.zc=this.zc);
|
|
877
|
+
let b=this.da;b instanceof Array||(b=b?[b]:[]);a.transform(b);return a}toString(){let a=this.da;a=a?', '+(a.join?a.join(', '):a.toString()):'';return'ListDef(#'+olympe.D.Na(this.F)+a+')'}Wt(){return this.lc().vg()}Oc(){return olympe.D.ua([this.mf()],a=>{let b='[';for(let c=0;c<a;c++){const d=this.Ze(c).toString();b=0<c&&c<a?b+(', '+d):b+d}return olympe.D.Ab(b+']')},olympe.D.Qa)}};olympe.dc.za.prototype.filter=olympe.dc.za.prototype.filter;olympe.dc.za.prototype.union=olympe.dc.za.prototype.Qk;
|
|
878
878
|
olympe.dc.za.prototype.transform=olympe.dc.za.prototype.transform;olympe.dc.za.prototype.forEachCurrentValue=olympe.dc.za.prototype.he;olympe.dc.za.prototype.forEach=olympe.dc.za.prototype.forEach;olympe.dc.za.prototype.getCurrentSize=olympe.dc.za.prototype.fg;olympe.dc.za.prototype.observeSize=olympe.dc.za.prototype.Iy;olympe.dc.za.prototype.observeFirst=olympe.dc.za.prototype.Dy;olympe.dc.za.prototype.getCurrentRank=olympe.dc.za.prototype.Ff;olympe.dc.za.prototype.observeRank=olympe.dc.za.prototype.Hy;
|
|
879
|
-
olympe.dc.za.prototype.getCurrentAt=olympe.dc.za.prototype.Ze;olympe.dc.za.prototype.observeAt=olympe.dc.za.prototype.Cy;olympe.dc.za.prototype.offReady=olympe.dc.za.prototype.
|
|
880
|
-
m.Wd.L=new olympe.D.K(()=>String,[]);m.
|
|
881
|
-
m.Ff.L=olympe.D.K.C;m.Fc.L=new olympe.D.K(()=>olympe.dc.CloudObject,[],'valueType');m.Gf.L=new olympe.D.K(()=>String,[]);m.mf.L=olympe.D.K.G;m.fg.L=olympe.D.K.C;m.forEach.L=new olympe.D.K(()=>{},[]);m.he.L=olympe.D.K.C;m.bj.L=new olympe.D.K(()=>{},[]);m.transform.L=new olympe.D.K(()=>olympe.dc.za,[]);m.
|
|
882
|
-
olympe.dc.
|
|
883
|
-
d);if(!d||'function'!==typeof d.C)throw new
|
|
884
|
-
b,c){a=new olympe.dc.da.Ae(a,a.Ia(),b,c);this.da.push(a);this.valueType=a.Mb()||olympe.dc.CloudObject;return this}Qw(a){const b=[];let c;for(let d=0;d<a.length;d++){const e=a[d];b.push(e.X());void 0===c&&(c=e.Ia())}a=new olympe.dc.da.
|
|
885
|
-
olympe.dc.$.Fd?(b=b.$,b.push(a),a=new olympe.dc.$.Fd(...b)):a=new olympe.dc.$.Fd(b,a);b=this.Ya.pop();break;case
|
|
886
|
-
c))}Rb(a){if(!(a instanceof Array))throw new
|
|
887
|
-
Array))throw new
|
|
888
|
-
return this.We(b)}pd(){this.Ya.push(
|
|
889
|
-
new olympe.dc.vc.DateTime(new olympe.dc.$a.li(a,c))}c=d;null!==c&&this.da.push(new olympe.dc.da.Kg(c,b));return this}sort(a,b,c){const d=new class extends olympe.dc.vc.kg{G(e,f){return a(olympe.dc.CloudObject.get(f))}compare(e,f){return b(e,f).valueOf()}};this.da.push(new olympe.dc.da.Kg(d,c));return this}Iw(){this.da.push(new olympe.dc.da.mi);return this}
|
|
890
|
-
function
|
|
891
|
-
m.Mw.L=olympe.D.K.J();m.contains.L=olympe.D.K.J();m.Rb.L=olympe.D.K.J();m.
|
|
892
|
-
function
|
|
893
|
-
function
|
|
894
|
-
function
|
|
895
|
-
function
|
|
896
|
-
e=!0),
|
|
897
|
-
olympe.dc.
|
|
898
|
-
'] - Local subscription, no need for coverage check, booting subscription '),
|
|
899
|
-
olympe.dc.query.Wu=class{constructor(){this.C=0;this.values=null}add(a){let b;b=olympe.D.jb(a)?'n'+a.Da.U():'p'+ ++this.C;null===this.values&&(this.values={});this.values[b]=a;return b}get(a){return this.values[a]}clear(){const a=this.values;if(null!==a)for(let b=Object.keys(a),c=b.length,d=0;d<c;d++)delete a[b[d]]}forEach(a){const b=this.values;if(null!==b)for(let c=Object.keys(b),d=c.length,e=0;e<d;e++)a(b[c[e]],c[e])}};olympe.dc.Ba=class{ma(){}C(){}F(){}ha(){}toString(){}};olympe.dc.
|
|
900
|
-
olympe.dc.Zd(),c=olympe.D.Na(this.Wd());let d;return olympe.dc.CloudObject.instancesRel.Fa(null==(d=this.da)?void 0:d[0])?b.fromModel(c):b.Fe(c)}Uh(){const b=olympe.D.Na(this.G);return b&&b.valueOf()>=olympe.dc.
|
|
901
|
-
()=>{},olympe.D.fa)}T(){const b=this.G.Da.Gb;return b&&b.valueOf()>=olympe.dc.
|
|
902
|
-
0,d=b.length;c<d;c++)this.
|
|
903
|
-
this.Wi(b,!this.T()))}vg(){return this.T()?super.vg():'Subscription is not ready!'}Ud(b){const c=olympe.D.Na(this.Wd());return olympe.dc.
|
|
904
|
-
olympe.dc.da.xf)e=a.F(olympe.D.Na(e.Wd()),c,e.Xg()),b.push(...e);else if(e instanceof olympe.dc.da.jf||e instanceof olympe.dc.da.Kg){const h=e.G();b=b.map(k=>{for(const l of h){for(const n of l)k=n.recursive?k.eg(n,!0,!0):k.ib(n,!0);k=k.back(l.length)}return k})}return b}};olympe.dc.
|
|
905
|
-
olympe.dc.$.
|
|
906
|
-
a.toString()).join(',')+')'}};R('olympe.dc.predicates.And',olympe.dc.$.Fd);olympe.dc.$.Fd.ya=[olympe.dc.Ba];olympe.dc
|
|
907
|
-
return this.ma().replace(/^.+\./,'')+'('+a.toString()+','+this.value.toString()+')'}};R('olympe.dc.predicates.BitMask',olympe.dc
|
|
908
|
-
return'{"c":"'+this.ma()+'","a":['+b+','+c+','+a+']}'}toString(){const a=
|
|
909
|
-
')'}};R('olympe.dc.predicates.Equals',olympe.dc.$.se);olympe.dc.$.se.ya=[olympe.dc.Ba];olympe.dc.$.ot=class extends olympe.dc.$.se{constructor(a,b){super(a,new olympe.dc.$a.Le(b))}};olympe.dc.$.ot.ya=[olympe.dc.Ba];olympe.dc.$.
|
|
910
|
-
c.getContext().fb()||c.getContext().od()||(f+=h?1:-1,c.update(0<f))};const g=this.pb;for(let h=g.length-1;0<=h;h--)a=
|
|
911
|
-
function
|
|
912
|
-
const g=this.pb;for(let k=g.length-1;0<=k;k--)f=
|
|
913
|
-
function
|
|
914
|
-
{e.set(r,(e.get(r)||0)+y);l(y)},q,r),(0>a.C||n<=a.C)&&r!==p&&V(b,r,a,k.bind(a,x,n+1,r),t))}else l(-e.get(r)),f.get(r).delete(d+p),0===f.get(r).size&&(e.delete(r),f.delete(r),b.F(r,a,t))};return(l,n,p)=>k(l,0,'origin',n,p)}class
|
|
915
|
-
this.G.has(k)?(c.update(olympe.D.fa.F),f()):(h=new
|
|
916
|
-
R('olympe.dc.predicates.InstanceOf',olympe.dc.$.yi);olympe.dc.$.yi.ya=[olympe.dc.Ba];olympe.dc.$.de=class{constructor(a){this.G=a}ma(){return S(olympe.dc.$.de)}F(){return this.G.F()}C(a,b){return a.run(()=>olympe.D.
|
|
917
|
-
')'}};R('olympe.dc.predicates.Or',olympe.dc.$.xe);olympe.dc.$.xe.ya=[olympe.dc.Ba];olympe.dc.$.uf=class{constructor(a,b,c){this.source=a;this.J=b;this.G=void 0===c?!0:c}ma(){return S(olympe.dc.$.uf)}F(){return[this.source.C()]}tb(){return this.source}C(a,b){return a.run(()=>olympe.D.
|
|
918
|
-
']}'}toString(){const a=
|
|
919
|
-
[];null!==this.J&&(0<=this.F?Wl(
|
|
920
|
-
function
|
|
921
|
-
olympe.dc.
|
|
922
|
-
g)}null!==e.G&&
|
|
923
|
-
class
|
|
924
|
-
function
|
|
925
|
-
function
|
|
926
|
-
olympe.dc.
|
|
927
|
-
this.J+')');this.J=a;
|
|
928
|
-
a.position;a<c;a++)b[a]=b[a+1],b[a].position=a;b.length=c}}};olympe.dc.
|
|
929
|
-
function
|
|
930
|
-
olympe.dc.
|
|
931
|
-
class
|
|
932
|
-
function
|
|
879
|
+
olympe.dc.za.prototype.getCurrentAt=olympe.dc.za.prototype.Ze;olympe.dc.za.prototype.observeAt=olympe.dc.za.prototype.Cy;olympe.dc.za.prototype.offReady=olympe.dc.za.prototype.Lk;olympe.dc.za.prototype.onReady=olympe.dc.za.prototype.Bd;olympe.dc.za.prototype.getBaseTag=olympe.dc.za.prototype.Wd;olympe.dc.za.ya=[olympe.D.kd];m=olympe.dc.za.prototype;m.je.L=olympe.D.K.C;m.ob.L=olympe.D.K.J();m.lc.L=new olympe.D.K(()=>olympe.dc.jc.Subscription,[]);m.Hd.L=new olympe.D.K(()=>{},[]);
|
|
880
|
+
m.Wd.L=new olympe.D.K(()=>String,[]);m.Fl.L=new olympe.D.K(()=>Array,[]);m.Bd.L=new olympe.D.K(()=>String,[]);m.Lk.L=new olympe.D.K(()=>{},[]);m.Yt.L=olympe.D.K.O;m.Xt.L=olympe.D.K.C;m.get.L=new olympe.D.K(()=>olympe.dc.CloudObject,[],'valueType');m.Zh.L=new olympe.D.K(()=>Array,[]);m.Xh.L=olympe.D.K.C;m.has.L=olympe.D.K.O;m.Zg.L=olympe.D.K.C;m.ie.L=new olympe.D.K(()=>olympe.dc.CloudObject,[],'valueType');m.Ze.L=olympe.D.K.C;m.$e.L=new olympe.D.K(()=>String,[]);m.Ef.L=olympe.D.K.C;m.xd.L=olympe.D.K.G;
|
|
881
|
+
m.Ff.L=olympe.D.K.C;m.Fc.L=new olympe.D.K(()=>olympe.dc.CloudObject,[],'valueType');m.Gf.L=new olympe.D.K(()=>String,[]);m.mf.L=olympe.D.K.G;m.fg.L=olympe.D.K.C;m.forEach.L=new olympe.D.K(()=>{},[]);m.he.L=olympe.D.K.C;m.bj.L=new olympe.D.K(()=>{},[]);m.transform.L=new olympe.D.K(()=>olympe.dc.za,[]);m.Qk.L=new olympe.D.K(()=>olympe.dc.za,[]);m.filter.L=new olympe.D.K(()=>olympe.dc.za,[]);m.tk.L=new olympe.D.K(()=>olympe.dc.Pj,[]);m.toString.L=olympe.D.K.C;m.Wt.L=olympe.D.K.C;m.Oc.L=olympe.D.K.F;const zl={nz:'append',sl:'filter_not',Jo:'filter_and',Ko:'filter_or'};function Al(a,b){a=Bl(a);a=olympe.dc.CloudObject.get(a);return(new olympe.dc.$a.Dn(a,b)).F}
|
|
882
|
+
olympe.dc.Pj=class{constructor(a,b){this.C=Bl(a);this.H=olympe.ka.ab('dc.query');this.valueType=void 0===b?olympe.dc.CloudObject:b;this.da=[];this.Ya=[];this.zc=void 0}Bi(){const a=new olympe.dc.za(this.C,this.da,this.valueType);'boolean'===typeof this.zc&&(a.zc=this.zc);return a}transform(a){for(let b=0,c=a.length,d;b<c;b++){d=a[b];if(void 0===d)throw new Cl('transform','Trying to set an undefined transformer');if(d instanceof olympe.dc.Pa.Property)throw new Cl('transform','Properties cannot be used as transformer, unlike relations '+
|
|
883
|
+
d);if(!d||'function'!==typeof d.C)throw new Cl('transform','one of the argument is not a Transformer '+d);const e=d.Mb();null!==e&&(this.valueType=e);this.da.push(d)}return this}Qk(a){this.da.push(new olympe.dc.da.xf(a));return this}lz(a){this.da.push(new olympe.dc.da.xf(Bl(a)));return this}$t(a){this.valueType=a;return this}ib(a){this.da.push(a);this.valueType=a.Mb()||olympe.dc.CloudObject;return this}Sw(a){for(const b of a)this.da.push(b),this.valueType=b.Mb()||olympe.dc.CloudObject;return this}Rw(a,
|
|
884
|
+
b,c){a=new olympe.dc.da.Ae(a,a.Ia(),b,c);this.da.push(a);this.valueType=a.Mb()||olympe.dc.CloudObject;return this}Qw(a){const b=[];let c;for(let d=0;d<a.length;d++){const e=a[d];b.push(e.X());void 0===c&&(c=e.Ia())}a=new olympe.dc.da.Qj(b,c);this.da.push(a);this.valueType=a.Mb()||olympe.dc.CloudObject;return this}Zt(){this.ib(olympe.dc.CloudObject.instancesRel);return this}We(a){var b=this.Ya.pop();b===zl.sl&&(a=new olympe.dc.$.de(a),b=this.Ya.pop());switch(b){case zl.Jo:b=this.da.pop().F;b instanceof
|
|
885
|
+
olympe.dc.$.Fd?(b=b.$,b.push(a),a=new olympe.dc.$.Fd(...b)):a=new olympe.dc.$.Fd(b,a);b=this.Ya.pop();break;case zl.Ko:b=this.da.pop().F,b instanceof olympe.dc.$.xe?(b=b.$,b.push(a),a=new olympe.dc.$.xe(...b)):a=new olympe.dc.$.xe(b,a),b=this.Ya.pop()}b===zl.sl&&(a=new olympe.dc.$.de(a),this.Ya.pop());this.da.push(new olympe.dc.da.jf(a));return this}Mw(a,b,c){return this.We(new olympe.dc.$.se(Al(a,c),new olympe.dc.$a.Le(b)))}contains(a,b,c=!1,d){return this.We(new olympe.dc.$.hf(Al(a,d),new olympe.dc.$a.Le(b),
|
|
886
|
+
c))}Rb(a){if(!(a instanceof Array))throw new Cl('instanceOf','Provided argument "models" must be an array.');const b=[];for(let c=0;c<a.length;c++)b.push(Bl(a[c]));return this.We(new olympe.dc.$.yi(b))}Fk(a){return this.We(new olympe.dc.$.se(new olympe.dc.$a.Qi,new olympe.dc.$a.Le(Bl(a))))}Nw(a){if(!Array.isArray(a))throw Error('ExcludeInstances should be called with an array');if(0<a.length){this.pd().Fk(a[0]);for(let b=1,c=a.length;b<c;b++)this.and().pd().Fk(a[b])}return this}$x(a,b){if(!(a instanceof
|
|
887
|
+
Array))throw new Cl('hasRelated','Provided argument "relations" must be an array.');const c=[],d=[];a.forEach(e=>{c.push(e);d.push(e.Ia())});return this.We(new olympe.dc.$.vi(c,d,b))}Ek(a,b,c){a=Al(a,c);return this.We(new olympe.dc.$.Mj(a,new olympe.dc.$a.Le(b)))}pj(a,b,c){a=Al(a,c);return this.We(new olympe.dc.$.jk(a,new olympe.dc.$a.Le(b)))}uy(a,b,c,d){a=Al(a,d);return this.We(new olympe.dc.$.uf(a,b,c))}filter(a){const b=new class extends olympe.dc.$.kg{C(c,d){return a(olympe.dc.CloudObject.get(d))}};
|
|
888
|
+
return this.We(b)}pd(){this.Ya.push(zl.sl);return this}and(){this.da[this.da.length-1]instanceof olympe.dc.da.jf&&this.Ya.push(zl.Jo);return this}or(){this.da[this.da.length-1]instanceof olympe.dc.da.jf&&this.Ya.push(zl.Ko);return this}Pk(a,b,c){a=Bl(a);let d=null;switch(olympe.dc.ia().Kb(a,olympe.dm.Property.typeRel)){case olympe.dm.String.P.X():d=new olympe.dc.vc.String(new olympe.dc.$a.Oi(a,c));break;case olympe.dm.Number.P.X():d=new olympe.dc.vc.Number(new olympe.dc.$a.Hi(a,c));break;case olympe.dm.DateTime.P.X():d=
|
|
889
|
+
new olympe.dc.vc.DateTime(new olympe.dc.$a.li(a,c))}c=d;null!==c&&this.da.push(new olympe.dc.da.Kg(c,b));return this}sort(a,b,c){const d=new class extends olympe.dc.vc.kg{G(e,f){return a(olympe.dc.CloudObject.get(f))}compare(e,f){return b(e,f).valueOf()}};this.da.push(new olympe.dc.da.Kg(d,c));return this}Iw(){this.da.push(new olympe.dc.da.mi);return this}jj(a,b){this.da.push(new olympe.dc.da.uh(a,b));return this}};class Cl extends Error{constructor(a,b){super(`ListDefBuilder.${a}(): ${b}`)}}
|
|
890
|
+
function Bl(a){return'string'===typeof a||a instanceof olympe.D.Qa?a:'function'===typeof a?olympe.dc.na.cc(a):olympe.D.jb(a)?a.Lh===olympe.D.Qa?a:olympe.D.ua([a],b=>olympe.D.Ab(olympe.dc.ga(b)),olympe.D.Qa):a.X()}m=olympe.dc.Pj.prototype;m.Bi.L=new olympe.D.K(()=>olympe.dc.za,[]);m.transform.L=olympe.D.K.J();m.Qk.L=olympe.D.K.J();m.lz.L=olympe.D.K.J();m.$t.L=olympe.D.K.J();m.ib.L=olympe.D.K.J();m.Sw.L=olympe.D.K.J();m.Rw.L=olympe.D.K.J();m.Qw.L=olympe.D.K.J();m.Zt.L=olympe.D.K.J();m.We.L=olympe.D.K.J();
|
|
891
|
+
m.Mw.L=olympe.D.K.J();m.contains.L=olympe.D.K.J();m.Rb.L=olympe.D.K.J();m.Fk.L=olympe.D.K.J();m.Nw.L=olympe.D.K.J();m.$x.L=olympe.D.K.J();m.Ek.L=olympe.D.K.J();m.pj.L=olympe.D.K.J();m.uy.L=olympe.D.K.J();m.filter.L=olympe.D.K.J();m.pd.L=olympe.D.K.J();m.and.L=olympe.D.K.J();m.or.L=olympe.D.K.J();m.Pk.L=olympe.D.K.J();m.sort.L=olympe.D.K.J();m.Iw.L=olympe.D.K.J();m.jj.L=olympe.D.K.J();function yl(a,b,c){const d=b.Wd();var e=new olympe.dc.query.Wu;let f;f=d;olympe.D.jb(f)&&(f=e.add(d));b=(b=b.Fl())?Array.isArray(b)?b:[b]:null;e=olympe.dc.jc.Subscription.G(f,b,e);let g,h,k=null!=(h=null==(g=a.C.get(e))?void 0:g.C)?h:null;null===k&&(a.H.debug('QueryMGR: new',a.F?'local':'remote','subscription "',e,'": #',`${f},`,b),k=new olympe.dc.jc.Subscription(e,d,b,a.G));k.getContext().run(()=>a.process(k,c));return k}
|
|
892
|
+
function Dl(a,b){if(b.T())a.H.debug('ListProcessor: [ID:',b.U(),'] - Subscription already booted, ignoring');else{a.H.debug('ListProcessor: [ID:',b.U(),'] - Booting subscription');var c=new olympe.dc.kc.Yq(a.db,a.H),d=b.U();olympe.D.Nc([b.Wd()],e=>{const f=olympe.dc.ga(e);a.H.debug('ListProcessor: [ID:',b.U(),'] - Booting with baseTag',f);b.Uh()||b.Gk();hf(a.db,f,El(a,b,c),d);olympe.D.Wa().Z(()=>ff(a.db,f,d));a.db.Ha(f.valueOf())||Fl(c);b.T()||(Fl(c),b.oc([]))})}}
|
|
893
|
+
function Gl(a,b,c,d,e){const f=[b.Wd()],g=l=>l instanceof olympe.dc.da.xf;let h;const k=(null!=(h=b.Xg())?h:[]).filter(g);for(const l of k){f.push(l.Wd());let n;k.push(...(null!=(n=l.Xg())?n:[]).filter(g))}ul(a.O,()=>{olympe.D.Nc(f,()=>{const l=b.Ud(c);Hl(a,l,b.U(),d,e)})})}
|
|
894
|
+
function Hl(a,b,c,d,e){a.H.debug('CoverageProcessor: [ID:',c,'] - checking coverage of remote query over',b.length,'paths.');const f=olympe.D.Wa(),g=new olympe.async.Xj(f);b.forEach(h=>{g.add((k,l)=>{let n=!1;Sh(a.J,h,f,olympe.dc.Sa.SELF,olympe.dc.pa.Zc.Qf,{zc:e}).subscribe(rxjs.Subscriber.create(()=>{n||(n=!0,f.run(k))},p=>f.run(()=>l(`The query ${c} is not covered by an existing graphdef, `+`and the specific graphdef id ${h.U()} has encountered an error: ${p}`))))})});Sc(g,(h,k)=>d(k));g.start()}
|
|
895
|
+
function El(a,b,c){const d=new olympe.dc.kc.wj;let e=!1;const f=olympe.D.Wa(),g=b.Xg(),h=[];h[g?g.length:0]=(k,l,n,p)=>{f.od()||f.fb()||(k?b.Zg(n)?a.H.warn('Adding the same index twice (should never happen) for sub #',b.U(),', index #',n,', tag #',l):(a.H.debug('ListProcessor: [ID:',b.U(),'] - Adding Instance',l,'to the subscription'),b.Uc(n,l)):(a.H.debug('ListProcessor: [ID:',b.U(),'] - Removing Instance',l,'from the subscription'),b.$h(n)),e||(Il(c,()=>{p.bg();Fl(c)}),f.run(()=>p.je().ig(b.oc.bind(b))),
|
|
896
|
+
e=!0),Jl(c,n))};if(null!==g)for(let k=g.length-1;0<=k;k--)h[k]=g[k].C(f,c,h[k+1]);return(k,l)=>{const n=b.U();c.register(n,null);const p=d.C(k,l,n,null);if(null!==p)h[0](k,l,n,Kl(p,k,l,n))}}
|
|
897
|
+
olympe.dc.jc.xu=class{constructor(a,b,c,d,e,f){this.H=a;this.db=b;this.F=f||e;this.O=c;this.J=d;this.C=new Map;this.G=new olympe.D.Xb('Legacy ListDef processor')}process(a,b){const c=a.U();var d=this.C.get(c);d||(d=new olympe.dc.jc.Hv(a),this.C.set(c,d));d.counter++;Ll(d)?this.H.debug('ListProcessor: [ID:',c,'] - id already processed'):(this.H.debug('ListProcessor: [ID:',c,'] - NOT processed yet.'),d=a.Bf(),b||this.F&&d===olympe.dc.Sa.SERVER||d===olympe.dc.Sa.SELF?(this.H.debug('QueryMGR: [ID:',c,
|
|
898
|
+
'] - Local subscription, no need for coverage check, booting subscription '),Dl(this,a)):Gl(this,a,d,e=>{e?this.H.error(e):Dl(this,a)},b))}};function Ml(a){return olympe.D.jb(a)?'Node#'+a.Da.U():String(a)}function Nl(a,b){return olympe.D.jb(b)?'{"c":"Parameter","v":"'+a.add(b)+'"}':JSON.stringify(b)}
|
|
899
|
+
olympe.dc.query.Wu=class{constructor(){this.C=0;this.values=null}add(a){let b;b=olympe.D.jb(a)?'n'+a.Da.U():'p'+ ++this.C;null===this.values&&(this.values={});this.values[b]=a;return b}get(a){return this.values[a]}clear(){const a=this.values;if(null!==a)for(let b=Object.keys(a),c=b.length,d=0;d<c;d++)delete a[b[d]]}forEach(a){const b=this.values;if(null!==b)for(let c=Object.keys(b),d=c.length,e=0;e<d;e++)a(b[c[e]],c[e])}};olympe.dc.Ba=class{ma(){}C(){}F(){}ha(){}toString(){}};olympe.dc.jc.Subscription=class a extends olympe.D.uj{constructor(b,c,d,e){super(olympe.dc.CloudObject,new olympe.D.Xb('context subscription '+b,e));this.id=b;this.Cc=c;this.da=d||null;this.G=this.O.run(()=>olympe.D.$d(olympe.dc.jc.Subscription.C.INIT));this.Ub=!1;this.aa=this.ac=null}static G(b,c,d){let e;try{e=b;if(c)for(let f=0,g=c.length;f<g;f++)e+='|'+c[f].ha(d);else e+='|null';e=olympe.Y.vb(e)}catch(f){e=olympe.Y.Mc()}return e}U(){return this.id}Wd(){return this.Cc}Xg(){return this.da}Bf(){const b=
|
|
900
|
+
olympe.dc.Zd(),c=olympe.D.Na(this.Wd());let d;return olympe.dc.CloudObject.instancesRel.Fa(null==(d=this.da)?void 0:d[0])?b.fromModel(c):b.Fe(c)}Uh(){const b=olympe.D.Na(this.G);return b&&b.valueOf()>=olympe.dc.jc.Subscription.C.Sq}Gk(){if(this.G.Da.fb())throw Error(`Cannot set destroyed subscription '${this.id}' as subscribed`);const b=this.ac;this.ac=null;for(let c in b)if(Object.prototype.hasOwnProperty.call(b,c))b[c](this);Wb(this.G,olympe.D.$d(olympe.dc.jc.Subscription.C.Sq))}Tc(){return olympe.D.ua([this.G],
|
|
901
|
+
()=>{},olympe.D.fa)}T(){const b=this.G.Da.Gb;return b&&b.valueOf()>=olympe.dc.jc.Subscription.C.Dh}Bd(b,c){this.T()?b(this):(null===this.aa&&(this.aa=new Map),void 0===c&&(c=olympe.Y.Mc()),this.aa.set(c,olympe.D.Wa().G(b)));return c||''}Lk(b){null!==this.aa&&b&&this.aa.delete(b)}Fb(){const b=olympe.dc.jc.Subscription.C.Dh;if(!this.G.Da.fb()&&olympe.D.Na(this.G)!==b&&(this.zf(),Wb(this.G,b),null!==this.aa)){for(const c of this.aa.values())c(this);this.aa=null}}onDestroy(b){this.O.onDestroy(b)}release(){this.O.destroy()}oc(b){if(!this.G.Da.fb()){for(let c=
|
|
902
|
+
0,d=b.length;c<d;c++)this.zm(b[c],c);if(this.T())this.zf();else{this.Ub=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.Fb()}}}Uc(b,c){if(!this.G.Da.fb()&&(this.sk(b,olympe.dc.CloudObject.get(c)),b=this.T(),this.Ub&&!b)){b=!0;for(let d in this.F)if(Object.prototype.hasOwnProperty.call(this.F,d)&&!Object.prototype.hasOwnProperty.call(this.values,d)){b=!1;break}b&&this.Fb()}}$h(b){this.G.Da.fb()||(this.ym(b),
|
|
903
|
+
this.Wi(b,!this.T()))}vg(){return this.T()?super.vg():'Subscription is not ready!'}Ud(b){const c=olympe.D.Na(this.Wd());return olympe.dc.jc.Subscription.F(c,b,this.Xg())}static F(b,c,d){var e=olympe.dc.pa.from(b,c).ge();if(null===d)return[e];b=[];b.push(e);for(let f=0,g=d.length;f<g;f++)if(e=d[f],e instanceof olympe.dc.da.Qe){const h=olympe.dc.query.Relation.from(e);b=b.map(k=>k.ib(h,!0))}else if(e instanceof olympe.dc.da.Ae){const h=olympe.dc.query.Relation.from(e);b=b.map(k=>k.eg(h,!0,!0))}else if(e instanceof
|
|
904
|
+
olympe.dc.da.xf)e=a.F(olympe.D.Na(e.Wd()),c,e.Xg()),b.push(...e);else if(e instanceof olympe.dc.da.jf||e instanceof olympe.dc.da.Kg){const h=e.G();b=b.map(k=>{for(const l of h){for(const n of l)k=n.recursive?k.eg(n,!0,!0):k.ib(n,!0);k=k.back(l.length)}return k})}return b}};olympe.dc.jc.Subscription.C={INIT:0,Sq:1,Dh:2};olympe.dc.jc.Subscription.prototype.vg.L=olympe.D.K.C;function Ll(a){const b=a.F;a.F=!0;return b}olympe.dc.jc.Hv=class{constructor(a){this.counter=0;this.F=!1;this.C=a}};olympe.dc.wf=class{ma(){}Mb(){}C(){}ha(){}toString(){}};olympe.dc.mq=class{G(){}};olympe.dc.pk=class{ma(){}getValue(){}C(){}ha(){}toString(){}};olympe.dc.vc={};let Ol=0;olympe.dc.vc.kg=class{constructor(){this.id=Ol++}ma(){return'CustomLocalComparator#'+Ol}J(){return[]}G(){throw Error('GetComparedValue function was not implemented.');}compare(){throw Error('Compare function was not implemented.');}ha(){return`{"c":"${this.ma()}"}`}toString(){return this.ma()+'()'}};olympe.dc.vc.kg.ya=[olympe.dc.gf];olympe.dc.vc.DateTime=class{constructor(a){this.C=a}ma(){return S(olympe.dc.vc.DateTime)}J(){return this.C.C()}G(a,b){return this.C.getValue(a,b)}compare(a,b){if(!a)return b?-1:0;if(!b)return 1;a=a.getTime();b=b.getTime();return a!==b?a>b?1:-1:0}ha(a){return'{"c":"'+this.ma()+'",a:['+this.C.ha(a)+']}'}toString(){return'Number('+this.C.toString()+')'}};R('olympe.dc.comparators.DateTime',olympe.dc.vc.DateTime);olympe.dc.vc.DateTime.ya=[olympe.dc.gf];olympe.dc.vc.Number=class{constructor(a){this.C=a}ma(){return S(olympe.dc.vc.Number)}J(){return this.C.C()}G(a,b){return this.C.getValue(a,b)}compare(a,b){return a!==b?a>b?1:-1:0}ha(a){return`{"c":"${this.ma()}",a:[${this.C.ha(a)}]}`}toString(){return`Number(${this.C.toString()})`}};R('olympe.dc.comparators.Number',olympe.dc.vc.Number);olympe.dc.vc.Number.ya=[olympe.dc.gf];olympe.dc.vc.String=class{constructor(a){this.C=a}ma(){return S(olympe.dc.vc.String)}J(){return this.C.C()}G(a,b){return olympe.D.ua([this.C.getValue(a,b)],c=>c.toLowerCase(),olympe.D.Qa)}compare(a,b){return void 0===a?void 0===b?0:1:a!==b?a>b?1:-1:0}ha(a){return`{"c":"${this.ma()}",a:[${this.C.ha(a)}]}`}toString(){return`String(${this.C.toString()})`}};R('olympe.dc.comparators.String',olympe.dc.vc.String);olympe.dc.vc.String.ya=[olympe.dc.gf];olympe.dc.$={};let Pl=0;olympe.dc.$.kg=class{constructor(){this.id=Pl++}ma(){return'CustomLocalPredicate#'+this.id}F(){return[]}C(){throw Error('Test function was not implemented.');}ha(){return`{"c":"${this.ma()}"}`}toString(){return this.ma()+'()'}};olympe.dc.$.kg.ya=[olympe.dc.Ba];olympe.dc.$.Vk=class{constructor(a,b){this.G=a;this.J=b}ma(){}F(){return[this.G.C(),this.J.C()]}C(a,b){return a.run(()=>olympe.D.ua([this.G.getValue(a,b),this.J.getValue(a,b)],(c,d)=>{c=c.valueOf();d=d.valueOf();return olympe.D.Sb(this.O('string'===typeof c?c:Number(c),'string'===typeof d?d:Number(d)))},olympe.D.fa))}O(){}ha(a){return'{"c":"'+this.ma()+'","a":['+this.G.ha(a)+','+this.J.ha(a)+']}'}toString(){return this.ma().replace(/^.+\./,'')+'('+this.G.toString()+','+this.J.toString()+')'}};
|
|
905
|
+
olympe.dc.$.Vk.ya=[olympe.dc.Ba];olympe.dc.$.Fd=class{constructor(a){this.$=[];for(let b=arguments.length,c=0;c<b;c++)Array.isArray(arguments[c])?this.$=this.$.concat(arguments[c]):this.$.push(arguments[c])}ma(){return S(olympe.dc.$.Fd)}F(){return this.$.reduce((a,b)=>a.concat(b.F()),[])}C(a,b){return a.run(()=>olympe.D.ua(this.$.map(c=>c.C(a,b)),(...c)=>olympe.D.Sb(c.every(d=>d.valueOf())),olympe.D.fa))}ha(a){const b=this.$.map(c=>c.ha(a));return'{"c":"'+this.ma()+'","a":['+b.join(',')+']}'}toString(){return'And('+this.$.map(a=>
|
|
906
|
+
a.toString()).join(',')+')'}};R('olympe.dc.predicates.And',olympe.dc.$.Fd);olympe.dc.$.Fd.ya=[olympe.dc.Ba];olympe.dc.$.$k=class{constructor(a,b){this.G=a;this.value=b}C(a,b){return a.run(()=>olympe.D.ua([this.G,this.value.getValue(a,b)],(c,d)=>{c=c.valueOf();return olympe.D.Sb((Number(c)&Number(d.valueOf()))===Number(c))},olympe.D.fa))}ma(){return S(olympe.dc.$.$k)}F(){return[this.value.C()]}ha(a){const b=olympe.D.jb(this.G)?this.G.Da.Gb.valueOf():this.G.valueOf();return'{"c":"'+this.ma()+'","a":['+b+','+this.value.ha(a)+']}'}toString(){const a=olympe.D.jb(this.G)?this.G.Da.Gb.valueOf():this.G.valueOf();
|
|
907
|
+
return this.ma().replace(/^.+\./,'')+'('+a.toString()+','+this.value.toString()+')'}};R('olympe.dc.predicates.BitMask',olympe.dc.$.$k);olympe.dc.$.$k.ya=[olympe.dc.Ba];olympe.dc.$.hf=class{constructor(a,b,c){this.source=a;this.value=b;this.G=c?c:!1}ma(){return S(olympe.dc.$.hf)}F(){return[this.source.C(),this.value.C()]}tb(){return this.source}getValue(){return this.value}C(a,b){return a.run(()=>olympe.D.ua([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.Sb(c.includes(d))},olympe.D.fa))}ha(a){const b=this.source.ha(a),c=this.value.ha(a);a=Nl(a,this.G);
|
|
908
|
+
return'{"c":"'+this.ma()+'","a":['+b+','+c+','+a+']}'}toString(){const a=Ml(this.G);return'Contains('+this.source.toString()+','+this.value.toString()+','+a+')'}};R('olympe.dc.predicates.Contains',olympe.dc.$.hf);olympe.dc.$.hf.ya=[olympe.dc.Ba];olympe.dc.$.se=class{constructor(a,b){this.G=a;this.J=b}ma(){return S(olympe.dc.$.se)}F(){return[this.G.C(),this.J.C()]}C(a,b){return a.run(()=>olympe.D.ua([this.G.getValue(a,b),this.J.getValue(a,b)],(c,d)=>'object'===typeof c&&void 0!==c.Ad?c.Ad(d):'object'===typeof d&&void 0!==d.Ad?d.Ad(c):olympe.D.Sb(c.valueOf()===d.valueOf()),olympe.D.fa,'Test equal predicate'))}ha(a){return'{"c":"'+this.ma()+'","a":['+this.G.ha(a)+','+this.J.ha(a)+']}'}toString(){return'Equals('+this.G.toString()+','+this.J.toString()+
|
|
909
|
+
')'}};R('olympe.dc.predicates.Equals',olympe.dc.$.se);olympe.dc.$.se.ya=[olympe.dc.Ba];olympe.dc.$.ot=class extends olympe.dc.$.se{constructor(a,b){super(a,new olympe.dc.$a.Le(b))}};olympe.dc.$.ot.ya=[olympe.dc.Ba];olympe.dc.$.Mj=class extends olympe.dc.$.Vk{constructor(a,b){super(a,b)}ma(){return S(olympe.dc.$.Mj)}O(a,b){return a>b}};R('olympe.dc.predicates.Greater',olympe.dc.$.Mj);olympe.dc.$.vi=class{constructor(a,b,c){this.pb=[];this.G=c instanceof Array?c:void 0!==c?[olympe.dc.ga(c)]:[];a=Array.isArray(a)?a:[a];for(let d=0,e=a.length;d<e;d++)c=a[d],c instanceof olympe.dc.da.Ae?this.pb.push(new Ql(c.X(),c.Ia(),c.G,c.F)):this.pb.push(new Ql(olympe.dc.ga(c),b[d],1,1))}ma(){return S(olympe.dc.$.vi)}F(){return[this.pb.reduce((a,b)=>a.concat(b),[])]}C(a,b){const c=a.run(()=>Xb(olympe.D.ec(Boolean),!1)),d=olympe.Y.Mc(),e=olympe.dc.ia();let f=0;a=(h,k)=>{0!==this.G.length&&!this.G.includes(k)||
|
|
910
|
+
c.getContext().fb()||c.getContext().od()||(f+=h?1:-1,c.update(0<f))};const g=this.pb;for(let h=g.length-1;0<=h;h--)a=Rl(g[h],e,a,d+h);hf(e,b,a,d);c.getContext().onDestroy(()=>{ff(e,b,d)});return c.sb()}ha(){return'{"c":"'+this.ma()+'","a":['+JSON.stringify(this.pb.map(a=>a.ha()))+(0!==this.G.length?',"'+this.G.toString():'')+'"]}'}toString(){return'HasRelated('+(0!==this.G.length?'#'+this.G.toString()+', ':'')+this.pb.map(a=>a.ha())+')'}};R('olympe.dc.predicates.HasRelated',olympe.dc.$.vi);
|
|
911
|
+
function Rl(a,b,c,d){const e=Object.create(null);d+=olympe.Y.Vh();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.F(h,a,l))}};return(g,h)=>f(g,h,0)}class Ql extends olympe.dc.query.Relation{constructor(a,b,c,d){super(a,b,1!==c||1!==d);this.F=c;this.C=d}ha(){return`${this.X()}, ${this.Ia()}, ${this.F}, ${this.C}`}}olympe.dc.$.vi.ya=[olympe.dc.Ba];olympe.dc.$.yl=class{constructor(a,b,c){this.pb=[];this.G=void 0!==c?c.map(olympe.dc.ga):null;a=Array.isArray(a)?a:[a];for(let d=0,e=a.length;d<e;d++)c=a[d],c instanceof olympe.dc.da.Ae?this.pb.push(new Sl(c.X(),c.Ia(),c.G,c.F)):this.pb.push(new Sl(olympe.dc.ga(c),b[d],1,1))}ma(){return S(olympe.dc.$.yl)}F(){return[this.pb.reduce((a,b)=>a.concat(b),[])]}C(a,b){const c=a.run(()=>Xb(olympe.D.ec(Boolean),!1)),d=olympe.dc.ia(),e=olympe.Y.Vh();let f=(k,l,n)=>{l&&(null===this.G||this.G.includes(n))&&k(1)};
|
|
912
|
+
const g=this.pb;for(let k=g.length-1;0<=k;k--)f=Tl(g[k],d,f,e+k);let h=0;hf(d,b,f.bind(null,k=>{c.getContext().od()||c.getContext().fb()||(h+=k,c.update(0<h))}),e);a.onDestroy(()=>ff(d,b,e));return c.sb()}ha(){return'{"c":"'+this.ma()+'","a":['+JSON.stringify(this.pb.map(a=>a.ha()))+(null!==this.G?',"'+this.G.toString():'')+'"]}'}toString(){return'HasRelatedTree('+(null!==this.G?'#['+this.G.toString()+'], ':'')+this.pb.map(a=>a.ha())+')'}};R('olympe.dc.predicates.HasRelatedTree',olympe.dc.$.yl);
|
|
913
|
+
function Tl(a,b,c,d){const e=a.G,f=a.O,g=new Set,h=(l,n,p)=>{f.has(n)?f.get(n).set(d+p,l):f.set(n,(new Map).set(d+p,l))},k=(l,n,p,q,r)=>{const t=olympe.Y.Vh();if(q){const u=p+r,x=y=>{const z=f.get(r);if(g.has(u))throw Error(`Try to use the predicate HasRelatedTree with recursion in a graph cluster containing a loop around instances ${p} and ${r}`);void 0!==z&&null!==z&&(g.add(u),e.set(r,(e.get(r)||0)+y),Array.from(z.values()).forEach(A=>A(y)));g.delete(u)};h(l,r,p);e.has(r)?l(e.get(r)):(n>=a.F&&c(y=>
|
|
914
|
+
{e.set(r,(e.get(r)||0)+y);l(y)},q,r),(0>a.C||n<=a.C)&&r!==p&&V(b,r,a,k.bind(a,x,n+1,r),t))}else l(-e.get(r)),f.get(r).delete(d+p),0===f.get(r).size&&(e.delete(r),f.delete(r),b.F(r,a,t))};return(l,n,p)=>k(l,0,'origin',n,p)}class Sl extends olympe.dc.query.Relation{constructor(a,b,c,d){super(a,b,1!==c||1!==d);this.F=c;this.C=d;this.O=new Map;this.G=new Map}ha(){return`${this.X()}, ${this.Ia()}, ${this.F}, ${this.C}`}}olympe.dc.$.yl.ya=[olympe.dc.Ba];olympe.dc.$.yi=class{constructor(a){this.G=new Set;a instanceof Array?a.forEach(b=>{this.G.add(olympe.dc.ga(b))}):this.G.add(olympe.dc.ga(a))}ma(){return S(olympe.dc.$.yi)}F(){return[]}C(a,b){const c=a.run(()=>Xb(olympe.D.ec(olympe.D.fa),olympe.D.fa.C)),d=olympe.dc.ia();let e=[];const f=()=>{e.forEach(h=>{d.F(h.tag,h.relation,h.id)});e=[]},g=(h,k)=>{if(h)if(k===olympe.dc.ga(olympe.dc.CloudObject))c.update(olympe.D.Sb(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})`);
|
|
915
|
+
this.G.has(k)?(c.update(olympe.D.fa.F),f()):(h=new Ul(k,olympe.dc.CloudObject.extendRel),e.push(h),V(d,h.tag,h.relation,g,h.id))}};a=new Ul(b,olympe.dc.CloudObject.modelRel);e.push(a);V(d,a.tag,a.relation,g,a.id);c.getContext().onDestroy(f);return c.sb()}ha(){return'{"c":"'+this.ma()+'","a":['+JSON.stringify(Array.from(this.G))+']}'}toString(){return'InstanceOf('+Array.from(this.G).join(', ')+')'}};class Ul{constructor(a,b){this.tag=a;this.relation=b;this.id=olympe.Y.Vh()}}
|
|
916
|
+
R('olympe.dc.predicates.InstanceOf',olympe.dc.$.yi);olympe.dc.$.yi.ya=[olympe.dc.Ba];olympe.dc.$.de=class{constructor(a){this.G=a}ma(){return S(olympe.dc.$.de)}F(){return this.G.F()}C(a,b){return a.run(()=>olympe.D.ua([this.G.C(a,b)],c=>olympe.D.Sb(!c.valueOf()),olympe.D.fa))}ha(a){return`{"c":"${this.ma()}","a":[${this.G.ha(a)}]}`}toString(){return'Not('+this.G.toString()+')'}};R('olympe.dc.predicates.Not',olympe.dc.$.de);olympe.dc.$.de.ya=[olympe.dc.Ba];olympe.dc.$.xe=class{constructor(a){this.$=[];for(let b=arguments.length,c=0;c<b;c++)Array.isArray(arguments[c])?this.$=this.$.concat(arguments[c]):this.$.push(arguments[c])}ma(){return S(olympe.dc.$.xe)}F(){return this.$.reduce((a,b)=>a.concat(b.F()),[])}C(a,b){return a.run(()=>olympe.D.ua(this.$.map(c=>c.C(a,b)),(...c)=>olympe.D.Sb(c.some(d=>d.valueOf())),olympe.D.fa))}ha(a){const b=this.$.map(c=>c.ha(a));return'{"c":"'+this.ma()+'","a":['+b.join(',')+']}'}toString(){return'Or('+this.$.map(a=>a.toString()).join(',')+
|
|
917
|
+
')'}};R('olympe.dc.predicates.Or',olympe.dc.$.xe);olympe.dc.$.xe.ya=[olympe.dc.Ba];olympe.dc.$.uf=class{constructor(a,b,c){this.source=a;this.J=b;this.G=void 0===c?!0:c}ma(){return S(olympe.dc.$.uf)}F(){return[this.source.C()]}tb(){return this.source}C(a,b){return a.run(()=>olympe.D.ua([this.source.getValue(a,b),this.J,this.G],(c,d,e)=>{c=String(c);d=String(d);e.valueOf()||(c=c.toLowerCase(),d=d.toLowerCase());return olympe.D.Sb((new RegExp(d)).test(c))},olympe.D.fa))}ha(a){const b=this.source.ha(a),c=Nl(a,this.J);a=Nl(a,this.G);return'{"c":"'+this.ma()+'","a":['+b+','+c+','+a+
|
|
918
|
+
']}'}toString(){const a=Ml(this.G);return'Regex('+this.source.toString()+','+this.J+','+a+')'}};R('olympe.dc.predicates.Regex',olympe.dc.$.uf);olympe.dc.$.uf.ya=[olympe.dc.Ba];olympe.dc.$.jk=class extends olympe.dc.$.Vk{constructor(a,b){super(a,b)}ma(){return S(olympe.dc.$.jk)}O(a,b){return a<b}};R('olympe.dc.predicates.Smaller',olympe.dc.$.jk);olympe.dc.kc={};olympe.dc.kc.wj=class{constructor(){this.T=this.J=this.index=this.F=null}O(){return null!==this.F}Z(a){if(null!==this.F)throw Error('Manager already activated (depth='+this.F+')');this.F=a;this.G()}C(a,b,c){b=this.J;if(a&&null!==b)throw Error('The AutoManger handles only a single item.');a?(b=new olympe.dc.kc.Hj(this),this.index=c,this.J=b):this.J=this.index=null;return b}G(){if(null===this.F)throw Error('Manager not activated, need to set a depth before updating ranks');if(null!==this.T){const a=
|
|
919
|
+
[];null!==this.J&&(0<=this.F?Vl(Wl(this.J,this.F),a):a.push(this.index));this.T(a)}}ig(a){this.T=a}};olympe.dc.kc.wj.ya=[olympe.dc.kc.Ta];function Kl(a,b,c,d){b?a.O[d]=c:delete a.O[d];null===a.F&&(a.F=new olympe.dc.kc.Hj(a.C,a));return a.F}function Wl(a,b){for(let c=0;c<b;c++)if(null!==a.F)a=a.F;else break;return a}function Vl(a,b){a=a.O;if(null!==a)for(let c in a)Object.prototype.hasOwnProperty.call(a,c)&&b.push(c)}olympe.dc.kc.Hj=class{constructor(a,b){this.C=a;this.depth=b?b.depth+1:0;this.O=Object.create(null);this.F=null}je(){return this.C}bg(){this.C.O()?this.C.G():this.C.Z(this.depth-1)}};class Xl extends olympe.dc.kc.Hj{constructor(a,b,c){super(a);this.index=b;this.tag=c;this.Z=this.T=this.J=!1;this.G=null}}
|
|
920
|
+
function Yl(a,b,c,d,e){const f=Object.create(null),g=a.ja,h=a.J;let k,l,n;a.ea=!0;l=0;for(n=g.length;l<n;l++)f[g[l]]=null;g.length=0;l=c;for(n=Math.min(b.length,d);l<n;l++)k=b[l],c=h[k],void 0!==c&&(delete f[k],g.push(k),c.J||(c.J=!0,e(!0,c.tag,c.index,c)));for(k in f)Object.prototype.hasOwnProperty.call(f,k)&&(c=h[k],c.J&&(c.J=!1,e(!1,c.tag,c.index,c)),c.T&&(c.G=null,delete h[k]),delete f[k]);a.ea=!1;null!==a.F&&a.G()}
|
|
921
|
+
olympe.dc.kc.Ll=class{constructor(){this.J={};this.ja=[];this.F=null;this.ea=!1;this.T=[];this.aa=null}O(){return null!==this.F}Z(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.ea){var a=this.ja,b=a.length,c=this.J,d;for(d=this.T.length=0;d<b;d++){var e=c[a[d]];if(0>this.F)this.T.push(e.index);else{if(!e.Z){var f=e,g=this.F;f.Z=!0;f.G=Wl(f,
|
|
922
|
+
g)}null!==e.G&&Vl(e.G,this.T)}}this.aa&&this.aa(this.T)}}ig(a){this.aa=a}C(a,b,c){let d=this.J[c];a?void 0===d?(d=new Xl(this,c,b),this.J[c]=d):(d.tag=b,d.T=!1):void 0!==d&&(d.T=!0);return d}};olympe.dc.kc.Ll.ya=[olympe.dc.kc.Ta];olympe.dc.kc.Ta=class{constructor(){}C(){}O(){}Z(){}G(){}ig(){}};function Zl(a,b){olympe.D.bf(a.value)?(a.node=olympe.D.dn(a.value,b),Db(a.node)||b()):b()}function $l(a,b){if(olympe.D.bf(a.value)){const c=olympe.D.Wa(),d=a.J;olympe.D.Nc([a.value],e=>{d!==e.valueOf()&&(c.run(()=>Zl(a,b)),olympe.D.Wa().destroy())})}}
|
|
923
|
+
class am extends olympe.dc.kc.Hj{constructor(a,b,c){super(a);this.index=b;this.value=c;this.J=this.Na();this.position=this.node=null;this.T=!1;this.G=null}Na(){const a=olympe.D.Na(this.value);return a?a.valueOf():a}destroy(){this.node&&(this.node.destroy(),this.node=null);this.G=this.value=null}fb(){return null===this.value}}
|
|
924
|
+
function bm(a,b){if(!b.fb()){var c=a.F;var d=a.ja,e=b.Na(),f=0;let g=c.length,h=0,k;for(null!==b.position&&--g;g>f;){h=Math.floor((f+g)/2);k=d(c[h].J,e);if(0===k||2>g-f){0>k&&null!==b.position&&b.position<=h&&(k=d(c[g].J,e));h=0>k?g:h;break}0>k?f=h:g=h}c=h;b.J=b.Na();if(c!==b.position){d=a.F;e=d.length;f=b.position;null===f&&(f=e);if(c<f)for(e=f;e>c;e--)d[e]=d[e-1],d[e].position=e;else for(e=f;e<c;e++)d[e]=d[e+1],d[e].position=e;d[c]=b;d[c].position=c;b.T&&a.G()}}}
|
|
925
|
+
function cm(a){const b=a.ja;a.F.sort((c,d)=>b(c.Na(),d.Na()))}
|
|
926
|
+
olympe.dc.kc.Xq=class{constructor(a){this.ja=a;this.J=null;this.F=[];this.T=[];this.aa=null;this.ea=new Map}C(a,b,c,d){b='$'+c;const e=this.F;let f;if(a)f=new am(this,c,d),this.ea.set(b,f),this.O()?Zl(f,()=>bm(this,f)):(f.position=e.length,e.push(f));else{f=this.ea.get(b);if(void 0===f)throw Error('Trying to remove an non-registered item: "'+c+'"');this.ea.delete(b);null!==f.position&&(this.O()?this.remove(f):delete e[f.position]);f.destroy()}return f}O(){return null!==this.J}Z(a){if(null!==this.J)throw Error('Manager already activated (depth='+
|
|
927
|
+
this.J+')');this.J=a;cm(this);for(let b=0,c=this.F.length;b<c;b++){const d=this.F[b];d.position=b;$l(d,()=>bm(this,d))}this.G()}G(){if(null===this.J)throw Error('Manager not activated, need to set a depth before updating ranks');const a=this.F.length;this.T.length=0;for(let d=0;d<a;d++){let e=this.F[d];if(!e.T){var b=e,c=this.J;b.T=!0;b.G=Wl(b,c)}0>this.J?this.T.push(e.index):e.G&&Vl(e.G,this.T)}this.aa&&this.aa(this.T)}ig(a){this.aa=a}remove(a){const b=this.F,c=b.length-1;if(null!==a.position){for(a=
|
|
928
|
+
a.position;a<c;a++)b[a]=b[a+1],b[a].position=a;b.length=c}}};olympe.dc.kc.Xq.ya=[olympe.dc.kc.Ta];function Fl(a){if(!a.F){for(let b in a.G)dm(a.G[b]);a.F=!0}a.J=null;a.O=null}function Il(a,b,c){a.G[c||'root'].T=b}function Jl(a,b,c){a.G[c||'root'].bg(b)}function em(a,b,c,d){const e=a.O,f=b+d+c;let g=e[f];void 0===g&&(g=Qg(a.db,b,c,d),e[f]=g);return g}function fm(a,b){a.F||a.C.bg(b)}function gm(a,b,c,d,e){if(!a.F){let f=em(a,c,d,e||olympe.dc.wa.DESTINATION);e||(f+=em(a,c,d,olympe.dc.wa.ORIGIN));0===f&&fm(a,b)}}
|
|
929
|
+
function hm(a,b){const c=a.G[b];void 0!==c?(a.H&&a.H.debug('Set current block to',b,null!==c.G?'parent = '+c.G.U():''),a.C=c):a.H&&a.H.error('Try to set a block that does not exists:',b)}function im(a){const b=String(++a.T),c=a.C;a.G[b]=new jm(b,c);km(c,b);c.J||(c.J=()=>hm(a,c.U()));return b}function lm(a,b){const c=a.C;a.C.J=()=>{hm(a,c.U());b()}}function mm(a,b){dm(b?a.G[b]:a.C)}
|
|
930
|
+
olympe.dc.kc.Yq=class{constructor(a,b){this.db=a;this.H=b||null;this.J=Object.create(null);this.O=Object.create(null);this.F=!1;this.T=0;this.C=new jm('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=em(this,c,d,e),d=this.J[b]||0,this.J[b]=++d,this.C.C===b&&c<=d&&(this.C.C=a)):this.C.C=a)}};function km(a,b){null===a.F&&(a.F=Object.create(null));a.F[b]=!1}function dm(a){a.O=!0;null!==a.G&&a.G.notify(a.id)}
|
|
931
|
+
class jm{constructor(a,b){this.id=a;this.G=b||null;this.C=this.T=this.J=this.F=null;this.O=!1}U(){return this.id}bg(a){const b=this.T;if(this.O||this.C===a||null===a)b&&b(),!b&&dm(this)}notify(a){const b=this.J,c=this.F;if(this.O)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.$a={};function nm(a,b,c,d){const e=olympe.dc.ia(),f=new olympe.dc.kc.wj,g=new olympe.dc.kc.Yq(e);let h=!1;const k=Object.create(null),l=q=>{if(0<q.length)for(const r in k)q[0]===r&&d(k[r])};let n=(q,r,t,u)=>{a.od()||a.fb()||(h||(Il(g,()=>{u.bg();Fl(g)}),u.je().ig(l),h=!0),q?k[t]=r:delete k[t],Jl(g,t))};if(null!==c)for(let q=c.length-1;0<=q;q--)n=c[q].C(a,g,n);const p=olympe.Y.Mc();hf(e,b,(q,r)=>{g.register(p,null);const t=f.C(q,b,p,null);n(q,r,p,Kl(t,q,b,p))},p);a.onDestroy(()=>{ff(e,b,p)});e.Ha(b)||Fl(g)}
|
|
932
|
+
function om(a,b,c){const d=c.getContext(),e=olympe.dc.ia(),f=a.G(),g=Bg(e,b,a.J,d.G(h=>{null!==h&&(h=f(h));null===h?c.clear():c.update(h)}));d.onDestroy(()=>Cg(e,b,a.J,g))}
|
|
933
933
|
olympe.dc.$a.gi=class{constructor(a,b,c){this.J=a&&a.X?a.X():a;this.da=b&&b.filter(d=>d instanceof olympe.dc.da.Qe||d instanceof olympe.dc.da.Ae)||null;this.F=c||null;this.defaultValue=null}ma(){}Mb(){}G(){}C(){return(this.da||[]).reduce((a,b)=>a.concat(olympe.dc.query.Relation.from(b)),[])}eh(a){this.defaultValue=a;return this}Xg(){return this.da}Wd(){return this.F}getValue(a,b){const c=a.run(()=>olympe.D.ec(this.Mb()||Object,'AbstractProperty valueType'));null!==this.defaultValue&&Xb(c,this.defaultValue);
|
|
934
|
-
b=this.F||b;null!==this.da?
|
|
935
|
-
b);break;case olympe.dm.Boolean.P.X():d=new olympe.dc.$a.
|
|
936
|
-
d(g,h,k,!1),delete e[h]}}ha(a){return'{"c":"'+this.ma()+'","a":['+this.F.ha(a)+']}'}toString(){return'Filter('+this.F.toString()+')'}};R('olympe.dc.transformers.Filter',olympe.dc.da.jf);olympe.dc.da.jf.ya=[olympe.dc.wf,olympe.dc.mq];olympe.dc.da.
|
|
937
|
-
u,x,f,g);c(!0,z,A,D)},y.Xr=r,e[x]=y,null===l||r<l)n&&n(),y()}else if(l===r){n();e[x]=!0;y=Infinity;let A=null;for(let D=Object.keys(e),O=D.length,M=0;M<O;M++){let xa=e[D[M]];xa.Xr<y&&(y=xa.Xr,A=xa)}A&&A()}},q=(r,t,u,x,y)=>{x?e[y]||(e[y]=!0,
|
|
938
|
-
'","'+this.G.toString()+'"]}'}toString(){return'FirstRelated('+this.F.toString()+', '+this.G.toString()+')'}};R('olympe.dc.transformers.FirstRelated',olympe.dc.da.
|
|
939
|
-
this.ma()+'","a":['+
|
|
940
|
-
olympe.dc.da.
|
|
941
|
-
{d.F(g,l,h)})}}ha(){return'{"c":"'+this.ma()+'","a":['+JSON.stringify(
|
|
942
|
-
q,r,h,k||g);null===k&&b.register(y,q,r,h,f)}}},n=(p,q,r,t,u,x)=>{u&&!b.F&&l(p,t,x);p>=this.G?c(u,x,t,
|
|
943
|
-
R('olympe.dc.transformers.RecursiveRelated',olympe.dc.da.Ae);olympe.dc.da.Ae.ya=[olympe.dc.wf];olympe.dc.da.Qe=class extends olympe.dc.Pa.Relation{constructor(a,b){super(a,b||olympe.dc.wa.DESTINATION)}Mb(){return
|
|
944
|
-
this.ma()+'","a":["'+this.X()+'","'+this.Ia()+'"]}'}toString(){return'Related('+this.Ia()+this.X()+')'}};R('olympe.dc.transformers.Related',olympe.dc.da.Qe);olympe.dc.da.Qe.ya=[olympe.dc.wf];olympe.dc.da.Kg=class{constructor(a,b){this.Ib=a;this.F=void 0===b?!0:!!b}Mb(){return null}ma(){return S(olympe.dc.da.Kg)}Rg(){return this.Ib}G(){return[this.Ib.J()]}C(a,b,c){const d=new olympe.dc.
|
|
945
|
-
')'}};R('olympe.dc.transformers.Sort',olympe.dc.da.Kg);olympe.dc.da.Kg.ya=[olympe.dc.wf,olympe.dc.mq];function
|
|
946
|
-
olympe.dc.da.xf=class{constructor(a,b){this.da=this.F=null;a instanceof olympe.dc.za?(this.F=a.Wd(),this.da=a.
|
|
947
|
-
u.fb()||(k||(t.je().ig(x=>{g=x;
|
|
948
|
-
R('olympe.dc.transformers.Union',olympe.dc.da.xf);olympe.dc.da.xf.ya=[olympe.dc.wf];olympe.dc.da.Dq={GA:1,Gt:-1,Ft:0};olympe.dc.da.hC={oz:!0,Pz:!1};olympe.dc.
|
|
949
|
-
olympe.dc.CloudObject=class{constructor(a,b){this.tag=b;this.db=olympe.dc.ia();this.model=null}static $c(a,b,c,...d){b=olympe.dc.ga(b);var e=
|
|
950
|
-
b,c){const d=olympe.dc.ia();let e=null;const f=k=>{null===e&&(e=
|
|
951
|
-
new olympe.dc.Pa.Property(a))}static yd(){const a=olympe.dc.ia();return a.
|
|
952
|
-
(this.model=olympe.dc.CloudObject.get(this.db.model(this)));return this.model}query(){return olympe.dc.pa.from(this)}Lf(){return this.db.Lf(this)}tb(){return this.db.source(this)}wx(){return this.db.ai(this)?olympe.dc.Zd().fromModel(this):null}Lr(){return olympe.D.
|
|
953
|
-
{const f=olympe.dc.nb.Ac(this.db.Oa(this.tag,b));c||null!==f||e.next(f);const g=
|
|
954
|
-
this.tag,d)})}Gy(a){return this.observe(olympe.D.Wa(),a)}get(a){return olympe.dc.nb.Ac(this.db.Oa(this.tag,a))}Oa(a){return this.get(a)}ib(a){return olympe.dc.pa.from(this).ib(a)}
|
|
955
|
-
(f=b(f));null===f||void 0===f?d.clear():d.update(f)}));d.getContext().onDestroy(()=>
|
|
956
|
-
olympe.dc.CloudObject))}
|
|
934
|
+
b=this.F||b;null!==this.da?nm(a,b,this.da,d=>{om(this,d,c)}):om(this,b,c);return c.sb()}ha(a){const b=Nl(a,this.J),c=Nl(a,this.F);let d='null';this.da&&(d=this.da.map(function(e){return e.ha(a)}).join(','));return`{"c":"${this.ma()}","a":["${b}",${d},${c}]}`}toString(){const a=Ml(this.J),b=this.F?','+Ml(this.F):'';let c='';this.da&&(c=','+this.da.join(','));return this.ma().replace(/^.+\./,'')+'('+a+c+b+')'}};olympe.dc.$a.gi.ya=[olympe.dc.pk];olympe.dc.$a.Dn=class{constructor(a,b){if(olympe.D.bf(a))throw Error('Dataflows of Property not supported by AnyProperty');const c=a.X();var d=olympe.dc.ia();const e=d.Kb(a,olympe.dm.Property.typeRel);if(!e)throw Error('Type of property '+a+'unavailable locally, cannot proceed with AnyProperty');a=d.Vg(e,olympe.dc.CloudObject.extendRel,olympe.dm.ye);d=null;switch(1<a.length?a[a.length-2]:e){case olympe.dm.String.P.X():d=new olympe.dc.$a.Oi(c,b);break;case olympe.dm.Number.P.X():d=new olympe.dc.$a.Hi(c,
|
|
935
|
+
b);break;case olympe.dm.Boolean.P.X():d=new olympe.dc.$a.xj(c,b);break;case olympe.dm.DateTime.P.X():d=new olympe.dc.$a.li(c,b)}this.F=d}ma(){return this.F.ma()}C(){return this.F.C()}getValue(a,b){return this.F.getValue(a,b)}ha(a){return this.F.ha(a)}toString(){return this.F.toString()}};olympe.dc.$a.Dn.ya=[olympe.dc.pk];olympe.dc.$a.xj=class extends olympe.dc.$a.gi{constructor(a,b,c){super(a,b,c)}ma(){return S(olympe.dc.$a.xj)}G(){return olympe.dc.nb.Fm}Mb(){return olympe.D.fa}};R('olympe.dc.valuedefs.BooleanProperty',olympe.dc.$a.xj);olympe.dc.$a.Le=class{constructor(a){this.value=a}ma(){return S(olympe.dc.$a.Le)}C(){return[]}getValue(){return this.value}ha(a){a=Nl(a,this.value);return`{"c":"${this.ma()}","a":[${a}]}`}toString(){return`Constant(${Ml(this.value)})`}};R('olympe.dc.valuedefs.Constant',olympe.dc.$a.Le);olympe.dc.$a.Le.ya=[olympe.dc.pk];olympe.dc.$a.li=class extends olympe.dc.$a.gi{constructor(a,b,c){super(a,b,c)}ma(){return S(olympe.dc.$a.li)}G(){return olympe.dc.nb.Gm}Mb(){return olympe.D.gb}};R('olympe.dc.valuedefs.DateTimeProperty',olympe.dc.$a.li);olympe.dc.$a.Hi=class extends olympe.dc.$a.gi{constructor(a,b,c){super(a,b,c)}ma(){return S(olympe.dc.$a.Hi)}G(){return olympe.dc.nb.Hm}Mb(){return olympe.D.ba}};R('olympe.dc.valuedefs.NumberProperty',olympe.dc.$a.Hi);olympe.dc.$a.Oi=class extends olympe.dc.$a.gi{constructor(a,b,c){super(a,b,c)}ma(){return S(olympe.dc.$a.Oi)}G(){return olympe.dc.nb.Im}Mb(){return olympe.D.Qa}};R('olympe.dc.valuedefs.StringProperty',olympe.dc.$a.Oi);olympe.dc.$a.Qi=class{ma(){return S(olympe.dc.$a.Qi)}C(){return[]}getValue(a,b){return b}ha(){return'{"c":"'+this.ma()+'","a":[]}'}toString(){return'Tag()'}};R('olympe.dc.valuedefs.Tag',olympe.dc.$a.Qi);olympe.dc.$a.Qi.ya=[olympe.dc.pk];olympe.dc.da={};olympe.dc.da.mi=class{Mb(){return null}ma(){return S(olympe.dc.da.mi)}C(a,b,c){const d={};return function(e,f,g,h){e?void 0===d[f]?(d[f]=1,b.C.C!==g||b.F||(b.C.C=f),c(!0,f,f,Kl(h,!0,f,f))):(d[f]++,fm(b,g)):void 0!==d[f]&&0>=--d[f]&&(delete d[f],c(!1,f,f,Kl(h,!1,f,f)))}}ha(){return'{"c":"'+this.ma()+'"}'}toString(){return'Distinct()'}};R('olympe.dc.transformers.Distinct',olympe.dc.da.mi);olympe.dc.da.mi.ya=[olympe.dc.wf];olympe.dc.da.jf=class{constructor(a){this.F=a}Mb(){return null}ma(){return S(olympe.dc.da.jf)}G(){return this.F.F()}C(a,b,c){function d(f,g,h,k){k=k.valueOf();!1===k&&fm(b,g);k!==!!e[g]&&(e[g]=k,c(k,f,g,Kl(h,k,f,g)))}const e={};return(f,g,h,k)=>{const l='@'+h;if(f){let n=this.F.C(a,g);olympe.D.jb(n)&&(n=n.Da);olympe.D.Jf(n)?(b.F||void 0!==olympe.D.Na(n)||fm(b,h),e[l]=n,a.run(()=>{olympe.D.Nc([n],p=>{d(g,h,k,p)},'filterResultHandler')})):d(g,h,k,n)}else void 0!==e[l]&&(e[l].destroy(),delete e[l]),
|
|
936
|
+
d(g,h,k,!1),delete e[h]}}ha(a){return'{"c":"'+this.ma()+'","a":['+this.F.ha(a)+']}'}toString(){return'Filter('+this.F.toString()+')'}};R('olympe.dc.transformers.Filter',olympe.dc.da.jf);olympe.dc.da.jf.ya=[olympe.dc.wf,olympe.dc.mq];olympe.dc.da.tl=class{constructor(a,b,c,d){this.F=new olympe.dc.Pa.Relation(olympe.dc.ga(a),c||olympe.dc.wa.DESTINATION);this.G=new olympe.dc.Pa.Relation(olympe.dc.ga(b),d||olympe.dc.wa.DESTINATION)}Mb(){return Ef(this.F)}ma(){return S(olympe.dc.da.tl)}C(a,b,c){const d=olympe.dc.ia(),e={},f=this.F.X(),g=this.F.Ia(),h=this.G.X(),k=this.G.Ia();let l=null,n=null;const p=(r,t,u,x,y,z)=>{if(y){if(y=()=>{const A=olympe.Y.vb(u+g+(f+'_'+r)+z,20),D=Kl(t,!0,z,A);l=r;n=()=>{c(!1,z,A,Kl(t,!1,z,A))};b.register(A,
|
|
937
|
+
u,x,f,g);c(!0,z,A,D)},y.Xr=r,e[x]=y,null===l||r<l)n&&n(),y()}else if(l===r){n();e[x]=!0;y=Infinity;let A=null;for(let D=Object.keys(e),O=D.length,M=0;M<O;M++){let xa=e[D[M]];xa.Xr<y&&(y=xa.Xr,A=xa)}A&&A()}},q=(r,t,u,x,y)=>{x?e[y]||(e[y]=!0,gm(b,u,y,f,g),gm(b,u,y,h,k),V(d,y,this.F,p.bind(this,r,t,u,y),u+'_val'),V(d,y,this.G,q.bind(this,r+1,t,u),u+'_follow')):(d.F(y,this.G,u+'_follow'),d.F(y,this.F,u+'_val'),delete e[y])};return(r,t,u,x)=>q(0,x,u,r,t)}ha(){return'{"c":"'+this.ma()+'","a":["'+this.F.toString()+
|
|
938
|
+
'","'+this.G.toString()+'"]}'}toString(){return'FirstRelated('+this.F.toString()+', '+this.G.toString()+')'}};R('olympe.dc.transformers.FirstRelated',olympe.dc.da.tl);olympe.dc.da.tl.ya=[olympe.dc.wf];olympe.dc.da.uh=class{constructor(a,b){this.start=a;this.F=b}Mb(){return null}ma(){return S(olympe.dc.da.uh)}C(a,b,c){const d=new olympe.dc.kc.Ll;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]);Yl(d,e,f,n,c)}};a.run(()=>olympe.D.Nc([this.start,this.F],(n,p)=>{f=n.valueOf();g=p.valueOf();k()}));lm(b,k);const l=im(b);hm(b,l);return(n,p,q,r)=>{h||(r.je().ig(t=>{e=t;mm(b,l)}),Il(b,()=>r.bg(),l),h=!0);d.C(n,p,q,null);Jl(b,q,l)}}ha(a){return'{"c":"'+
|
|
939
|
+
this.ma()+'","a":['+Nl(a,this.start)+','+Nl(a,this.F)+']}'}toString(){return`Limit(${olympe.D.Na(this.start)},${olympe.D.Na(this.F)})`}};R('olympe.dc.transformers.Limit',olympe.dc.da.uh);olympe.dc.da.uh.ya=[olympe.dc.wf];function pm(a){return a.pb.map(b=>b.X())}
|
|
940
|
+
olympe.dc.da.Qj=class{constructor(a,b){this.direction=b||olympe.dc.wa.DESTINATION;this.pb=a.map(c=>new olympe.dc.Pa.Relation(c,this.direction))}Mb(){return olympe.dc.CloudObject}ma(){return S(olympe.dc.da.Qj)}Ia(){return this.direction}C(a,b,c){const d=olympe.dc.ia(),e=(f,g,h,k)=>V(d,f,k,(l,n)=>{var p=k.X();p=olympe.Y.vb(g+k.Ia()+p+n,20);const q=Kl(h,l,n,p);l&&b.register(p,g,f,k.X(),k.Ia());c(l,n,p,q)},g);return(f,g,h,k)=>{f?this.pb.forEach(l=>{gm(b,h,g,l.X(),l.Ia());e(g,h,k,l)}):this.pb.forEach(l=>
|
|
941
|
+
{d.F(g,l,h)})}}ha(){return'{"c":"'+this.ma()+'","a":['+JSON.stringify(pm(this))+',"'+this.direction+'"]}'}toString(){return'MultiRelated('+this.Ia()+'['+pm(this).join(',')+'])'}};R('olympe.dc.transformers.MultiRelated',olympe.dc.da.Qj);olympe.dc.da.Qj.ya=[olympe.dc.wf];olympe.dc.da.Ae=class extends olympe.dc.Pa.Relation{constructor(a,b=olympe.dc.wa.DESTINATION,c=1,d=-1){super(a,b);this.G=c;this.F=d}Mb(){return Ef(this)}ma(){return S(olympe.dc.da.Ae)}C(a,b,c){const d=olympe.dc.ia(),e=Object.create(null),f=olympe.dc.wa.ORIGIN,g=olympe.dc.wa.DESTINATION,h=this.X(),k=this.Ia(),l=(p,q,r)=>{if(!(0<=this.F&&p>=this.F)){var t=d.bb(r,this);p+=1;for(let u=0,x=t.length;u<x;u++){if(void 0!==e[t[u]]||r===t[u])continue;const y=olympe.Y.vb(q+k+(h+'_'+p)+t[u],20);b.register(y,
|
|
942
|
+
q,r,h,k||g);null===k&&b.register(y,q,r,h,f)}}},n=(p,q,r,t,u,x)=>{u&&!b.F&&l(p,t,x);p>=this.G?c(u,x,t,Kl(r,u,x,t)):gm(b,t,x,h,k);0<=this.F&&p>=this.F||(u?e[x]||(e[x]=!0,V(d,x,this,(y,z)=>{const A=p+1,D=olympe.Y.vb(t+k+(h+'_'+A)+z,20);n(A,x,r,D,y,z)},t)):(d.F(x,this,t),delete e[x]))};return(p,q,r,t)=>n(0,null,t,r,p,q)}ha(){return'{"c":"'+this.ma()+'","a":["'+this.X()+'","'+this.Ia()+'",'+this.G+','+this.F+']}'}toString(){return'RecursiveRelated('+this.Ia()+this.X()+'['+this.G+'..'+this.F+'])'}};
|
|
943
|
+
R('olympe.dc.transformers.RecursiveRelated',olympe.dc.da.Ae);olympe.dc.da.Ae.ya=[olympe.dc.wf];olympe.dc.da.Qe=class extends olympe.dc.Pa.Relation{constructor(a,b){super(a,b||olympe.dc.wa.DESTINATION)}Mb(){return Ef(this)}ma(){return S(olympe.dc.da.Qe)}bc(){return new olympe.dc.da.Qe(this.tag,this.direction===olympe.dc.wa.DESTINATION?olympe.dc.wa.ORIGIN:olympe.dc.wa.DESTINATION)}C(a,b,c){const d=olympe.dc.ia(),e=this.X(),f=this.Ia();return(g,h,k,l)=>{gm(b,k,h,e,f);g?V(d,h,this,(n,p)=>{const q=olympe.Y.vb(k+f+e+p,20),r=Kl(l,n,p,q);n&&b.register(q,k,h,e,f);c(n,p,q,r)},k):d.F(h,this,k)}}ha(){return'{"c":"'+
|
|
944
|
+
this.ma()+'","a":["'+this.X()+'","'+this.Ia()+'"]}'}toString(){return'Related('+this.Ia()+this.X()+')'}};R('olympe.dc.transformers.Related',olympe.dc.da.Qe);olympe.dc.da.Qe.ya=[olympe.dc.wf];olympe.dc.da.Kg=class{constructor(a,b){this.Ib=a;this.F=void 0===b?!0:!!b}Mb(){return null}ma(){return S(olympe.dc.da.Kg)}Rg(){return this.Ib}G(){return[this.Ib.J()]}C(a,b,c){const d=new olympe.dc.kc.Xq(a.G(this.F?this.Ib.compare.bind(this.Ib):(e,f)=>this.Ib.compare(f,e)));return(e,f,g)=>{var h=e?this.Ib.G(a,f):void 0;h=d.C(e,f,g,h);c(e,f,g,h)}}ha(a){return'{"c":"'+this.ma()+'","a":['+this.Ib.ha(a)+','+JSON.stringify(this.F)+']}'}toString(){return'Sort('+this.Ib.toString()+','+JSON.stringify(this.F)+
|
|
945
|
+
')'}};R('olympe.dc.transformers.Sort',olympe.dc.da.Kg);olympe.dc.da.Kg.ya=[olympe.dc.wf,olympe.dc.mq];function qm(a,b,c,d,e,f){function g(n,p){if(l)for(var q=l.length-1;0<=q;q--)f=l[q].C(b,e,f);e.register(h,null);q=d.C(n,p,c,null);f(n,p,h,Kl(q,n,p,h))}const h=olympe.Y.Mc(),k=olympe.dc.ia(),l=a.da;b.run(()=>olympe.D.Nc([a.F],n=>{rm(k,n,g,h);void 0===k.model(n)&&Fl(e)}))}function rm(a,b,c,d){const e=b&&b.valueOf();e&&(hf(a,e,c,d),olympe.D.Wa().Z(()=>ff(a,e,d)))}
|
|
946
|
+
olympe.dc.da.xf=class{constructor(a,b){this.da=this.F=null;a instanceof olympe.dc.za?(this.F=a.Wd(),this.da=a.Fl()):(this.F=a,b&&(this.da=b))}Mb(){return null}ma(){return S(olympe.dc.da.xf)||''}Xg(){return this.da}Wd(){return this.F}C(a,b,c){const d=new olympe.dc.kc.Ll,e=new olympe.dc.kc.wj;let f=[],g=[],h=!1,k=!1;const l=im(b),n=im(b);lm(b,()=>{const p=f.concat(g);0<p.length?b.F||(b.C.C=p[p.length-1]):mm(b);Yl(d,p,0,p.length,c)});hm(b,n);qm(this,a,this.F,e,b,(p,q,r,t)=>{const u=olympe.D.Wa();u.od()||
|
|
947
|
+
u.fb()||(k||(t.je().ig(x=>{g=x;mm(b,n)}),Il(b,()=>t.bg(),n),k=!0),d.C(p,q,r),Jl(b,r,n))});hm(b,l);return(p,q,r,t)=>{h||(t.je().ig(u=>{f=u;mm(b,l)}),Il(b,()=>t.bg(),l),h=!0);d.C(p,q,r,l);Jl(b,r,l)}}ha(a){const b=this.da?'['+this.da.map(c=>c.ha(a)).join(',')+']':'null';return'{"c":"'+this.ma()+'","a":['+Nl(a,this.F)+','+b+']}'}toString(){const a=olympe.D.jb(this.F)?'N:'+this.F.Da.U():this.F.valueOf(),b=this.da?','+this.da.map(c=>c.toString()).join(','):'';return'Union('+a+b+')'}};
|
|
948
|
+
R('olympe.dc.transformers.Union',olympe.dc.da.xf);olympe.dc.da.xf.ya=[olympe.dc.wf];olympe.dc.da.Dq={GA:1,Gt:-1,Ft:0};olympe.dc.da.hC={oz:!0,Pz:!1};olympe.dc.jc.R={zp:'dc.legacy.listdefProcessor'};olympe.dc.jc.V={yp:'dc.legacy.listdefsCovered'};olympe.W.config(a=>{F(a,olympe.dc.jc.V.yp,!1);C(a,olympe.dc.jc.R.zp,olympe.dc.jc.xu,olympe.dc.query.R.Ca,olympe.dc.R.jh,olympe.dc.transaction.R.Ea,olympe.dc.query.R.Yj,new olympe.W.oa(olympe.dc.V.Gh),new olympe.W.oa(olympe.dc.jc.V.yp))});olympe.W.run([olympe.dc.jc.R.zp],a=>{olympe.dc.jc.zx=()=>a});function sm(a){const b=olympe.dc.ia(),c=new Map;b.Mr(a).forEach(d=>{b.bb(d,olympe.dc.CloudObject.propertyRel).forEach(e=>{const f=b.name(e);c.has(f)||c.set(f,e)})});return c}
|
|
949
|
+
olympe.dc.CloudObject=class{constructor(a,b){this.tag=b;this.db=olympe.dc.ia();this.model=null}static $c(a,b,c,...d){b=olympe.dc.ga(b);var e=kf(b);(e=e&&e.C)?e(a,c,...d):(a=a.create(b),void 0!==c&&null!==c&&Z(a,olympe.dc.CloudObject.nameProp,c),a.X())}static get(a){if(a instanceof olympe.dc.CloudObject)var b=a;else{b=olympe.dc.Qr();a=olympe.dc.ga(a);var c=b.db.model(a);c=jf(b,c);if(null===c)throw new olympe.dc.Zp(a);c=c.instantiate(a,b.F);b.C.C.hb([a]);b.Pa.register(c,a);b=c}return b}static exists(a){return olympe.dc.ia().Ha(olympe.dc.ga(a))}static Dw(a,
|
|
950
|
+
b,c){const d=olympe.dc.ia();let e=null;const f=k=>{null===e&&(e=sm(b||this));return e.has(k)?e.get(k):null},g=hl(!1),h=g.create(null!=b?b:this);void 0!==c&&h.ci(c);a.forEach((k,l)=>{d.Ha(olympe.dc.ga(l))?Z(h,l,k):(l=f(l))&&Z(h,l,k)});g.ob((k,l)=>{k||olympe.ka.ab('dc').error(`Error occurred for transaction executed by CloudObject.createWith: ${l}`)});return this.get(h)}static ow(){return this.get(this)}static Hk(a){return olympe.dc.pa.Hk(a)}static Cb(){return olympe.dc.ia().bb(this,olympe.dc.CloudObject.propertyRel).map(a=>
|
|
951
|
+
new olympe.dc.Pa.Property(a))}static yd(){const a=olympe.dc.ia();return a.bb(this,olympe.dc.CloudObject.lj).map(b=>new olympe.dc.Pa.Relation(b)).concat(a.bb(this,olympe.dc.CloudObject.Er).map(b=>new olympe.dc.Pa.Relation(b,olympe.dc.wa.ORIGIN)))}static Lc(a){return olympe.dc.CloudObject.get(a)}static Rr(a){var b=jf(olympe.dc.Qr(),olympe.dc.ga(a));b=b&&b.F;return new olympe.dc.za(olympe.dc.ga(a),olympe.dc.CloudObject.instancesRel,b)}X(){return this.tag}name(){return this.db.name(this)}ma(){return this.zb(olympe.dc.CloudObject.nameProp)}Vb(){this.model||
|
|
952
|
+
(this.model=olympe.dc.CloudObject.get(this.db.model(this)));return this.model}query(){return olympe.dc.pa.from(this)}Lf(){return this.db.Lf(this)}tb(){return this.db.source(this)}wx(){return this.db.ai(this)?olympe.dc.Zd().fromModel(this):null}Lr(){return olympe.D.ua([this.ma()],a=>olympe.D.Ab(a),olympe.D.Qa,'getDisplayName',olympe.D.Ab('('+this.toString()+')'))}cc(){return this.model?this.model.X():this.db.model(this)}observe(a,b,c=!0){const d='function'===typeof a.F?a.F():a;return new rxjs.Observable(e=>
|
|
953
|
+
{const f=olympe.dc.nb.Ac(this.db.Oa(this.tag,b));c||null!==f||e.next(f);const g=Bg(this.db,this.tag,b,h=>{e.next(olympe.dc.nb.Ac(h))});d.Z(()=>{e.complete();Cg(this.db,this.tag,b,g)});return()=>Cg(this.db,this.tag,b,g)})}Fy(a){const b='function'===typeof a.F?a.F():a;return new rxjs.Observable(c=>{const d=Dg(this.db,this.tag,(e,f)=>{null===f||void 0===f?c.next([new olympe.dc.Pa.Property(e),null]):c.next([new olympe.dc.Pa.Property(e),f])});b.Z(()=>{c.complete();Eg(this.db,this.tag,d)});return()=>Eg(this.db,
|
|
954
|
+
this.tag,d)})}Gy(a){return this.observe(olympe.D.Wa(),a)}get(a){return olympe.dc.nb.Ac(this.db.Oa(this.tag,a))}Oa(a){return this.get(a)}ib(a){return olympe.dc.pa.from(this).ib(a)}wk(a){return olympe.dc.gd.from(this).ib(a)}Ac(){return this}ex(){return this.pc(olympe.dc.CloudObject.zw,olympe.dc.CloudObject)}Qm(){return this.bb(olympe.dc.CloudObject.containsRel,olympe.dc.CloudObject)}Hf(a,b,c){const d=olympe.D.ec(c,'Sync valueType'),e=Bg(this.db,this.tag,a,olympe.D.Wa().G(f=>{b&&null!==f&&void 0!==f&&
|
|
955
|
+
(f=b(f));null===f||void 0===f?d.clear():d.update(f)}));d.getContext().onDestroy(()=>Cg(this.db,this.tag,a,e));return d.getContext()}zb(a){return L(this.Hf(a,olympe.dc.nb.Im,olympe.D.Qa))}nd(a){return L(this.Hf(a,olympe.dc.nb.Hm,olympe.D.ba))}Ug(a){return L(this.Hf(a,olympe.dc.nb.Fm,olympe.D.fa))}gj(a){return L(this.Hf(a,olympe.dc.nb.Gm,olympe.D.gb))}Vr(){return L(this.Hf(olympe.dm.Color.valueProp,olympe.dc.nb.xr,olympe.D.Color))}Wr(){return L(this.Hf(olympe.sc.workflow.Transition.processRefProp,olympe.dc.nb.yr,
|
|
956
|
+
olympe.dc.CloudObject))}bb(a,b){a=a instanceof olympe.dc.da.Qe?a:new olympe.dc.da.Qe(a.X(),a.Ia());return new olympe.dc.za(this.X(),a,b)}pc(a,b){return this.bb(a,b).Fc()}Hr(a,b){const c=this.db,d=olympe.Y.Mc(),e=olympe.D.Wa(),f=new Map;V(c,this.tag,a,(g,h)=>{if(g)(g=e.run(b,olympe.dc.CloudObject.get(h)))&&f.set(h,g);else{let k;null==(k=f.get(h))||k();f.delete(h)}},d);e.onDestroy(()=>{c.F(this.tag,a,d)})}hz(){return new olympe.dc.za(this.X(),[],Cf(this.X()))}transform(...a){return(new olympe.dc.za(this.X(),
|
|
957
957
|
[],this.constructor)).transform(...a)}Oc(){return this.Lr()}toString(){return`CloudObject: ${JSON.stringify(this)}`}toJSON(){return this.db.Ha(this.tag)?Object.assign({'#tag':this.X(),'#type':this.Vb().name()},this.Pc(!0,!0)):{'#tag':this.X(),'#error':'The object does not exist in the local database.'}}Pc(a=!1,b=!0){const c={};this.db.Cb(this,b).forEach((d,e)=>{this.db.Ha(e)&&(e=a?this.db.name(e):e,c[e]=olympe.dc.nb.Ac(d))});return c}Fa(a){return a instanceof olympe.dc.CloudObject?this.X()===a.X():
|
|
958
|
-
'function'===typeof a?olympe.dc.na.cc(a)===this.X():!1}Ad(a){return olympe.D.
|
|
959
|
-
olympe.dc.CloudObject.prototype.followSingle=olympe.dc.CloudObject.prototype.
|
|
958
|
+
'function'===typeof a?olympe.dc.na.cc(a)===this.X():!1}Ad(a){return olympe.D.ua([a],b=>olympe.D.Sb(this.Fa(b)),olympe.D.fa)}Gw(a){const b=this.db;let c=!1;if(void 0===a||null===a)a=new olympe.dc.Xa,c=!0;const d=olympe.dc.wa.ORIGIN;for(const [e,f,g]of Og(b,this))f===d?a.hc(e,g,this):e!==olympe.dc.CloudObject.modelRel.X()&&a.hc(e,this,g);a.delete(this,olympe.dc.Nb.NONE);c&&a.ob()}};olympe.dc.CloudObject.prototype.equals=olympe.dc.CloudObject.prototype.Fa;olympe.dc.CloudObject.prototype.toObject=olympe.dc.CloudObject.prototype.Pc;
|
|
959
|
+
olympe.dc.CloudObject.prototype.followSingle=olympe.dc.CloudObject.prototype.wk;olympe.dc.CloudObject.prototype.follow=olympe.dc.CloudObject.prototype.ib;olympe.dc.CloudObject.prototype.getProperty=olympe.dc.CloudObject.prototype.Oa;olympe.dc.CloudObject.prototype.get=olympe.dc.CloudObject.prototype.get;olympe.dc.CloudObject.prototype.observeProperty=olympe.dc.CloudObject.prototype.Gy;olympe.dc.CloudObject.prototype.observeProperties=olympe.dc.CloudObject.prototype.Fy;
|
|
960
960
|
olympe.dc.CloudObject.prototype.observe=olympe.dc.CloudObject.prototype.observe;olympe.dc.CloudObject.prototype.getModelTag=olympe.dc.CloudObject.prototype.cc;olympe.dc.CloudObject.prototype.getSource=olympe.dc.CloudObject.prototype.tb;olympe.dc.CloudObject.prototype.isPersisted=olympe.dc.CloudObject.prototype.Lf;olympe.dc.CloudObject.prototype.query=olympe.dc.CloudObject.prototype.query;olympe.dc.CloudObject.prototype.getModel=olympe.dc.CloudObject.prototype.Vb;
|
|
961
|
-
olympe.dc.CloudObject.prototype.name=olympe.dc.CloudObject.prototype.name;olympe.dc.CloudObject.prototype.getTag=olympe.dc.CloudObject.prototype.X;olympe.dc.CloudObject.getInstancesOf=olympe.dc.CloudObject.Rr;olympe.dc.CloudObject.getInstance=olympe.dc.CloudObject.Lc;olympe.dc.CloudObject.getRelations=olympe.dc.CloudObject.yd;olympe.dc.CloudObject.getProperties=olympe.dc.CloudObject.Cb;olympe.dc.CloudObject.instancesOf=olympe.dc.CloudObject.
|
|
962
|
-
olympe.dc.CloudObject.createWith=olympe.dc.CloudObject.Dw;olympe.dc.CloudObject.exists=olympe.dc.CloudObject.exists;olympe.dc.CloudObject.get=olympe.dc.CloudObject.get;olympe.dc.CloudObject.P=olympe.dc.na.C('ff021000000000000001',olympe.dc.CloudObject);olympe.dc.CloudObject.sE=olympe.dc.CloudObject.P.la(olympe.dc.
|
|
963
|
-
olympe.dc.CloudObject.dE=olympe.dc.CloudObject.P.la('ff023000000000000012');olympe.dc.CloudObject.
|
|
964
|
-
w('olympe.dc.CloudObject.propertyRel',olympe.dc.CloudObject.propertyRel);olympe.dc.CloudObject.typeRel=olympe.dc.CloudObject.P.sa('ff02200000000000000d',olympe.dc.wa.ORIGIN);olympe.dc.CloudObject.modelRel=olympe.dc.CloudObject.P.sa(olympe.dc.
|
|
965
|
-
olympe.dc.CloudObject.extendRel=olympe.dc.CloudObject.P.sa(olympe.dc.
|
|
961
|
+
olympe.dc.CloudObject.prototype.name=olympe.dc.CloudObject.prototype.name;olympe.dc.CloudObject.prototype.getTag=olympe.dc.CloudObject.prototype.X;olympe.dc.CloudObject.getInstancesOf=olympe.dc.CloudObject.Rr;olympe.dc.CloudObject.getInstance=olympe.dc.CloudObject.Lc;olympe.dc.CloudObject.getRelations=olympe.dc.CloudObject.yd;olympe.dc.CloudObject.getProperties=olympe.dc.CloudObject.Cb;olympe.dc.CloudObject.instancesOf=olympe.dc.CloudObject.Hk;olympe.dc.CloudObject.asInstance=olympe.dc.CloudObject.ow;
|
|
962
|
+
olympe.dc.CloudObject.createWith=olympe.dc.CloudObject.Dw;olympe.dc.CloudObject.exists=olympe.dc.CloudObject.exists;olympe.dc.CloudObject.get=olympe.dc.CloudObject.get;olympe.dc.CloudObject.P=olympe.dc.na.C('ff021000000000000001',olympe.dc.CloudObject);olympe.dc.CloudObject.sE=olympe.dc.CloudObject.P.la(olympe.dc.sp.VERSION);olympe.dc.CloudObject.nameProp=olympe.dc.CloudObject.P.la('ff023000000000000011');w('olympe.dc.CloudObject.nameProp',olympe.dc.CloudObject.nameProp);
|
|
963
|
+
olympe.dc.CloudObject.dE=olympe.dc.CloudObject.P.la('ff023000000000000012');olympe.dc.CloudObject.lj=olympe.dc.CloudObject.P.sa('ff02200000000000000a');olympe.dc.CloudObject.Er=olympe.dc.CloudObject.P.sa('ff02200000000000000b',olympe.dc.wa.ORIGIN);olympe.dc.CloudObject.ND=olympe.dc.CloudObject.P.sa('017e9c4ba4c847d71cbf');olympe.dc.CloudObject.DD=olympe.dc.CloudObject.P.sa('017ea013caf8e89cedb2');olympe.dc.CloudObject.propertyRel=olympe.dc.CloudObject.P.sa('ff02200000000000000c');
|
|
964
|
+
w('olympe.dc.CloudObject.propertyRel',olympe.dc.CloudObject.propertyRel);olympe.dc.CloudObject.typeRel=olympe.dc.CloudObject.P.sa('ff02200000000000000d',olympe.dc.wa.ORIGIN);olympe.dc.CloudObject.modelRel=olympe.dc.CloudObject.P.sa(olympe.dc.mc.Yc);w('olympe.dc.CloudObject.modelRel',olympe.dc.CloudObject.modelRel);olympe.dc.CloudObject.instancesRel=T(olympe.dc.CloudObject.P,olympe.dc.CloudObject.modelRel);w('olympe.dc.CloudObject.instancesRel',olympe.dc.CloudObject.instancesRel);
|
|
965
|
+
olympe.dc.CloudObject.extendRel=olympe.dc.CloudObject.P.sa(olympe.dc.mc.ni);w('olympe.dc.CloudObject.extendRel',olympe.dc.CloudObject.extendRel);olympe.dc.CloudObject.extendedByRel=T(olympe.dc.CloudObject.P,olympe.dc.CloudObject.extendRel);w('olympe.dc.CloudObject.extendedByRel',olympe.dc.CloudObject.extendedByRel);olympe.dc.CloudObject.containsRel=olympe.dc.CloudObject.P.sa(olympe.dc.mc.Aj);w('olympe.dc.CloudObject.containsRel',olympe.dc.CloudObject.containsRel);
|
|
966
966
|
olympe.dc.CloudObject.zw=T(olympe.dc.CloudObject.P,olympe.dc.CloudObject.containsRel);olympe.dc.CloudObject.Fw=olympe.dc.CloudObject.P.sa('018282d3ac0a474a0bf4');w('olympe.dc.CloudObject.deleteAlsoRel',olympe.dc.CloudObject.Fw);olympe.dc.jC=olympe.dc.CloudObject;olympe.dc.CloudObject.ya=[olympe.dc.Ne];m=olympe.dc.CloudObject.prototype;m.X.L=new olympe.D.K(()=>String,[]);m.name.L=new olympe.D.K(()=>String,[]);m.ma.L=olympe.D.K.F;m.Vb.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);
|
|
967
|
-
m.tb.L=new olympe.D.K(()=>String,[]);m.wx.L=new olympe.D.K(()=>String,[]);m.Lr.L=olympe.D.K.F;m.cc.L=new olympe.D.K(()=>String,[]);m.ex.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);m.
|
|
968
|
-
m.
|
|
969
|
-
olympe.W.config(function(a){const b='object'===typeof window;F(a,olympe.dc.V.Rf,!1);F(a,olympe.dc.V.Gh,!1);F(a,olympe.dc.V.
|
|
970
|
-
C(a,olympe.dc.R.Dg,olympe.dc.mv,olympe.dc.R.Ca,olympe.dc.sources.R.wq,olympe.dc.sources.R.Nq,olympe.dc.R.jh,olympe.host.R.Pe,new olympe.W.oa(olympe.dc.V.Hg),new olympe.W.oa(olympe.dc.V.
|
|
971
|
-
olympe.W.run([olympe.dc.db.R.Ea,olympe.dc.transaction.R.Ea,olympe.dc.R.
|
|
972
|
-
olympe.dm.Md.F=
|
|
967
|
+
m.tb.L=new olympe.D.K(()=>String,[]);m.wx.L=new olympe.D.K(()=>String,[]);m.Lr.L=olympe.D.K.F;m.cc.L=new olympe.D.K(()=>String,[]);m.ex.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);m.Qm.L=new olympe.D.K(()=>olympe.dc.za,[]);m.Hf.L=new olympe.D.K(()=>olympe.D.Node,[]);m.zb.L=olympe.D.K.F;m.nd.L=olympe.D.K.G;m.Ug.L=olympe.D.K.O;m.gj.L=new olympe.D.K(()=>olympe.D.gb,[]);m.Vr.L=new olympe.D.K(()=>olympe.D.Color,[]);m.Wr.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);
|
|
968
|
+
m.bb.L=new olympe.D.K(()=>olympe.dc.za,[]);m.pc.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);m.Hr.L=new olympe.D.K(()=>Function,[]);m.hz.L=new olympe.D.K(()=>olympe.dc.za,[]);m.transform.L=new olympe.D.K(()=>olympe.dc.za,[]);m.Oc.L=olympe.D.K.F;m.toString.L=olympe.D.K.C;m.Fa.L=olympe.D.K.C;m.Ad.L=olympe.D.K.O;m.Gw.L=new olympe.D.K(()=>{},[]);olympe.dc.R={jh:'dc.DBView',op:'dc.InstanceManager',Ca:'dc.Logger',Mv:'dc.TransactionLogger',Ij:'dc.FileServiceManager',Dg:'dc.Router'};olympe.dc.V={Hg:'dc.tag',Rf:'dc.debug',Gh:'dc.subscribeAll',nl:'dc.defaultSource',Io:'dc.fileCache',jo:'dc.dataConsumerOnly',Do:'dc.errorOnAbstractInstantiation'};
|
|
969
|
+
olympe.W.config(function(a){const b='object'===typeof window;F(a,olympe.dc.V.Rf,!1);F(a,olympe.dc.V.Gh,!1);F(a,olympe.dc.V.nl,olympe.dc.Sa.SERVER);F(a,olympe.dc.V.jo,b);F(a,olympe.dc.V.Io,b);F(a,olympe.dc.V.Do,!0);F(a,olympe.dc.V.Hg,olympe.Y.Mc());E(a,olympe.dc.R.Ca,[olympe.ka.R.Ea],c=>c.Vc('dc'));Oa(a,olympe.dc.R.Mv,olympe.dc.transaction.R.Ca);Oa(a,olympe.dc.R.jh,olympe.dc.db.R.kl);C(a,olympe.dc.R.Ij,olympe.dc.tt,olympe.dc.R.Ca,olympe.dc.db.R.Ea,olympe.net.R.Ea,olympe.dc.R.Dg,olympe.Y.R.mg,new olympe.W.oa(olympe.dc.V.Io));
|
|
970
|
+
C(a,olympe.dc.R.Dg,olympe.dc.mv,olympe.dc.R.Ca,olympe.dc.sources.R.wq,olympe.dc.sources.R.Nq,olympe.dc.R.jh,olympe.host.R.Pe,new olympe.W.oa(olympe.dc.V.Hg),new olympe.W.oa(olympe.dc.V.jo));C(a,olympe.dc.R.op,olympe.dc.Nt,olympe.dc.db.R.ul,olympe.dc.db.R.Ea,olympe.W.R.og)},'olympe.dc');
|
|
971
|
+
olympe.W.run([olympe.dc.db.R.Ea,olympe.dc.transaction.R.Ea,olympe.dc.R.op,olympe.dc.R.Ij,new olympe.W.oa(olympe.dc.V.Hg)],(a,b,c,d,e)=>{olympe.dc.Jr=()=>a;olympe.dc.hj=()=>b;olympe.dc.Qr=()=>c;olympe.dc.Nr=()=>d;olympe.dc.Sa.SELF=e},'DC singleton getter initialization');olympe.dm={};olympe.dm.Md=class extends olympe.dc.CloudObject{ma(){return this.zb(olympe.dc.CloudObject.nameProp)}C(){return olympe.D.Qa.EMPTY}F(){return olympe.D.fa.C}};olympe.dm.Md.P=olympe.dc.na.C('ff021000000000000002',olympe.dm.Md);olympe.dm.Md.O=olympe.dm.Md.P.la('ff023000000000000035');olympe.dm.Md.C=olympe.dm.Md.P.sa('ff022000000000000005');olympe.dm.Md.G=Bf('ff011000000000000001','AUTHENTICATED_USERS');olympe.dm.Md.J=Bf('ff011000000000000002','PROJECT_RUNNER_USERS_ROLE');
|
|
972
|
+
olympe.dm.Md.F=Bf('014831d95f83635090ea','ADMIN_USERS_ROLE');olympe.dm.Md.prototype.ma.L=olympe.D.K.F;olympe.dm.Md.prototype.C.L=olympe.D.K.F;olympe.dm.Md.prototype.F.L=olympe.D.K.O;olympe.dm.Uk={NONE:0,Tz:1,gt:2,Uz:4,Qz:8,Sz:16,Rz:31,pB:32,mB:64,qB:128,nB:256,Nu:512,oB:992,HA:1023};olympe.dm.User=class extends olympe.dc.CloudObject{tx(){return this.Tm()}ma(){return this.Tm()}Tm(){return this.zb(olympe.dm.User.loginProp)}bu(){return this.zb(olympe.dm.User.F)}au(){return olympe.D.Qa.EMPTY}Ox(){return this.zb(olympe.dm.User.saltProp)}Xx(){return this.zb(olympe.dm.User.verifierProp)}Mx(){return this.bb(olympe.dm.User.G,olympe.dm.Md)}};olympe.dm.User.P=olympe.dc.na.C('ff021000000000000003',olympe.dm.User);olympe.dm.User.loginProp=olympe.dm.User.P.la('ff023000000000000001');
|
|
973
973
|
w('olympe.dm.User.loginProp',olympe.dm.User.loginProp);olympe.dm.User.F=olympe.dm.User.P.la('ff023000000000000002');olympe.dm.User.T=olympe.dm.User.P.la('ff023000000000000003');olympe.dm.User.saltProp=olympe.dm.User.P.la('ff023000000000000004');w('olympe.dm.User.saltProp',olympe.dm.User.saltProp);olympe.dm.User.verifierProp=olympe.dm.User.P.la('ff023000000000000005');w('olympe.dm.User.verifierProp',olympe.dm.User.verifierProp);olympe.dm.User.O=olympe.dm.User.P.la('ff023000000000000020');
|
|
974
|
-
olympe.dm.User.SAMLnameIdProp=olympe.dm.User.P.la('ff023000000000000036');w('olympe.dm.User.SAMLnameIdProp',olympe.dm.User.SAMLnameIdProp);olympe.dm.User.G=T(olympe.dm.User.P,olympe.dm.Md.C);olympe.dm.User.Z=olympe.dm.User.P.sa('ff022000000000000002');olympe.dm.User.C=
|
|
975
|
-
m.Xx.L=olympe.D.K.F;m.Mx.L=new olympe.D.K(()=>olympe.dc.za,[]);olympe.dm.Uf=class extends olympe.dc.CloudObject{Z(){return this.
|
|
974
|
+
olympe.dm.User.SAMLnameIdProp=olympe.dm.User.P.la('ff023000000000000036');w('olympe.dm.User.SAMLnameIdProp',olympe.dm.User.SAMLnameIdProp);olympe.dm.User.G=T(olympe.dm.User.P,olympe.dm.Md.C);olympe.dm.User.Z=olympe.dm.User.P.sa('ff022000000000000002');olympe.dm.User.C=Bf('014831d95fd7d12b8568','ADMIN_USER');olympe.dm.User.J=Bf('0163d9653067b6237f62','GUEST_USER');m=olympe.dm.User.prototype;m.tx.L=olympe.D.K.F;m.ma.L=olympe.D.K.F;m.Tm.L=olympe.D.K.F;m.bu.L=olympe.D.K.F;m.au.L=olympe.D.K.F;m.Ox.L=olympe.D.K.F;
|
|
975
|
+
m.Xx.L=olympe.D.K.F;m.Mx.L=new olympe.D.K(()=>olympe.dc.za,[]);olympe.dm.Uf=class extends olympe.dc.CloudObject{Z(){return this.Qm()}eb(){return this.zb(olympe.dm.Uf.va)}};olympe.dm.Uf.P=olympe.dc.na.C('01621fb84e3300000000',olympe.dm.Uf);olympe.dm.Uf.va=olympe.dm.Uf.P.la('01609de3f292e3c2c6ff');olympe.dm.Uf.prototype.Z.L=new olympe.D.K(()=>olympe.D.kd,[]);olympe.dm.Uf.prototype.eb.L=olympe.D.K.F;olympe.dm.BrickMetadata=class extends olympe.dm.Uf{Yx(){return this.zb(olympe.dm.BrickMetadata.ac)}Gc(){return this.zb(olympe.dm.BrickMetadata.ea)}getType(){return this.zb(olympe.dm.BrickMetadata.Fb)}ly(){return this.Ug(olympe.dm.BrickMetadata.yb)}ne(){return null}$w(){return this.bb(olympe.sc.ui.yw.Comment.GD.bc(),olympe.sc.ui.yw.Comment)}Bk(){return this.wk(olympe.dm.BrickMetadata.Ga).md().Bk()}};olympe.dm.BrickMetadata.P=Gf(olympe.dc.na.C('01621fb84e3500000000',olympe.dm.BrickMetadata));
|
|
976
976
|
olympe.dm.BrickMetadata.ac=olympe.dm.BrickMetadata.P.la('01621fb84e320000f001');olympe.dm.BrickMetadata.ea=olympe.dm.BrickMetadata.P.la('01703376c4a81c0e9d94');olympe.dm.BrickMetadata.Fb=olympe.dm.BrickMetadata.P.la('01703376c4a81c0e9d00');olympe.dm.BrickMetadata.yb=olympe.dm.BrickMetadata.P.la('01703376c4a81c0eaea5');olympe.dm.BrickMetadata.Ga=olympe.dm.BrickMetadata.P.sa('0161ae97622bb21f335b');olympe.dm.BrickMetadata.Uc={yB:'private',AB:'public'};
|
|
977
|
-
olympe.dm.BrickMetadata.Yb={aA:'experimental',PB:'stable',Oz:'deprecated'};olympe.dm.BrickMetadata.Tc={Bz:'business',kC:'technical'};m=olympe.dm.BrickMetadata.prototype;m.Yx.L=olympe.D.K.F;m.Gc.L=olympe.D.K.F;m.getType.L=olympe.D.K.F;m.ly.L=olympe.D.K.O;m.ne.L=new olympe.D.K(()=>String,[]);m.$w.L=new olympe.D.K(()=>olympe.dc.za,[]);m.
|
|
978
|
-
function
|
|
979
|
-
function
|
|
980
|
-
olympe.dm.DataSource=class extends olympe.dc.CloudObject{constructor(a,b,c){super(a,b);this.Wb=c;this.Br=new Map([[olympe.dc.sources.V.
|
|
981
|
-
'_')}.${b}`))?d:
|
|
977
|
+
olympe.dm.BrickMetadata.Yb={aA:'experimental',PB:'stable',Oz:'deprecated'};olympe.dm.BrickMetadata.Tc={Bz:'business',kC:'technical'};m=olympe.dm.BrickMetadata.prototype;m.Yx.L=olympe.D.K.F;m.Gc.L=olympe.D.K.F;m.getType.L=olympe.D.K.F;m.ly.L=olympe.D.K.O;m.ne.L=new olympe.D.K(()=>String,[]);m.$w.L=new olympe.D.K(()=>olympe.dc.za,[]);m.Bk.L=olympe.D.K.T;function Li(a,b){b=b.startsWith('data.')?b.substring(5):b;let c,d;return null!=(d=null!=(c=olympe.W.getParameter(`${'data.'}${a}.${b}`))?c:olympe.W.getParameter(`${'data.'}${b}`))?d:olympe.W.getParameter(`${olympe.dc.sources.sh.Uu}${b}`)}
|
|
978
|
+
function cj(a,b){const c=a.query().ib(olympe.dm.rd.C.bc()).ib(olympe.dm.rd.F);a=a.query().ib(olympe.dm.kb.F.bc()).eg(olympe.dm.kb.G,!0).ib(olympe.sc.yc.C.bc());const d=e=>e.ge().eg(olympe.dc.CloudObject.extendRel,!0).ib(olympe.dc.CloudObject.lj,!0).ib(olympe.dm.Relation.destinationModelRel).back(2).ib(olympe.dc.CloudObject.propertyRel,!0).ib(olympe.dm.Property.typeRel).observe(b);return rxjs.combineLatest([d(c),d(a)]).pipe(rxjs.operators.map(([e,...f])=>e.concat(...f)))}
|
|
979
|
+
function zj(a,b){return a.observe(b,olympe.dm.DataSource.zr).pipe(rxjs.operators.map(()=>a.Df(olympe.dc.sources.V.Ke)),rxjs.operators.distinctUntilChanged())}
|
|
980
|
+
olympe.dm.DataSource=class extends olympe.dc.CloudObject{constructor(a,b,c){super(a,b);this.Wb=c;this.Br=new Map([[olympe.dc.sources.V.Xl,olympe.dm.DataSource.Ry],[olympe.dc.sources.V.Ke,olympe.dm.DataSource.zr],[olympe.dc.sources.V.fm,olympe.dm.DataSource.Vy]])}U(){return this.tag===olympe.dm.DataSource.SERVER?olympe.dc.Sa.SERVER:this.tag}Df(a){const b=a.startsWith('data.')?a.split('.')[1]:a,c=`${'data.'}${b}`;let d,e;return null!=(e=null!=(d=olympe.W.getParameter(`${'data.'}${this.name().toLowerCase().replace(/\W/g,
|
|
981
|
+
'_')}.${b}`))?d:Li(this.X(),a))?e:this.Br.has(c)?this.get(this.Br.get(c)):null}Gc(){const a=this;return v(function*(){const b=olympe.dm.DataSource.Hb.jt,c=olympe.dm.DataSource.Hb.xb,d=new olympe.dc.Request(olympe.dc.Request.C.Hb,a.U());return a.Wb.request(d).then(e=>{let f;const g=null!=(f=null==e?void 0:e.s)?f:c;(e=null==e?void 0:e.r)&&olympe.ka.ab('dc').warn(`Source ${a.name()} (${a.U()}) has encountered issues: ${e}`);return g}).catch(e=>{const f=olympe.N.errors.Tp;return e instanceof olympe.N.errors.mk||
|
|
982
982
|
e instanceof f?b:c})})}init(){const a=this;return v(function*(){if(a.constructor===olympe.dm.DataSource)throw Error(`Data source ${a.name()} (${a.tag}) has no implementation (is the file missing ?)`);})}destroy(){return v(function*(){})}healthCheck(){return v(function*(){})}executeQuery(a){return v(function*(){return olympe.dc.query.td.cj(a)})}applyTransaction(){return v(function*(){})}uploadFileContent(){return v(function*(){throw Error('Should not try to upload files with SELF source');})}downloadFileContent(){return v(function*(){throw Error('Should not try to download files with SELF source');
|
|
983
983
|
})}deleteFileContent(){return v(function*(){})}};olympe.dm.DataSource.prototype.deleteFileContent=olympe.dm.DataSource.prototype.deleteFileContent;olympe.dm.DataSource.prototype.downloadFileContent=olympe.dm.DataSource.prototype.downloadFileContent;olympe.dm.DataSource.prototype.uploadFileContent=olympe.dm.DataSource.prototype.uploadFileContent;olympe.dm.DataSource.prototype.applyTransaction=olympe.dm.DataSource.prototype.applyTransaction;olympe.dm.DataSource.prototype.executeQuery=olympe.dm.DataSource.prototype.executeQuery;
|
|
984
984
|
olympe.dm.DataSource.prototype.healthCheck=olympe.dm.DataSource.prototype.healthCheck;olympe.dm.DataSource.prototype.destroy=olympe.dm.DataSource.prototype.destroy;olympe.dm.DataSource.prototype.init=olympe.dm.DataSource.prototype.init;olympe.dm.DataSource.prototype.getConfig=olympe.dm.DataSource.prototype.Df;olympe.dm.DataSource.prototype.getId=olympe.dm.DataSource.prototype.U;olympe.dm.DataSource.P=olympe.dc.na.C('ff021000000000000060',olympe.dm.DataSource,olympe.dc.R.Dg);
|
|
985
985
|
olympe.dm.DataSource.Oh=olympe.dm.DataSource.P.la('ff023000000000000060');w('olympe.dm.DataSource.activatedProp',olympe.dm.DataSource.Oh);olympe.dm.DataSource.JD=olympe.dm.DataSource.P.la('ff023000000000000061');olympe.dm.DataSource.Ry=olympe.dm.DataSource.P.la('ff023000000000000062');olympe.dm.DataSource.zr=olympe.dm.DataSource.P.la('ff023000000000000063');olympe.dm.DataSource.Fr=olympe.dm.DataSource.P.la('ff023000000000000064');olympe.dm.DataSource.Vy=olympe.dm.DataSource.P.la('ff023000000000000065');
|
|
986
|
-
olympe.dm.DataSource.
|
|
987
|
-
olympe.dm.Lb.J=olympe.dm.Lb.P.sa('016a697ef00ce7554692');T(olympe.dc.CloudObject.P,olympe.dm.Lb.J);olympe.dm.Lb.prototype.J.L=new olympe.D.K(()=>olympe.dc.za,[]);olympe.dm.Lb.prototype.C.L=new olympe.D.K(()=>olympe.dc.za,[]);olympe.dm.Lb.prototype.O.L=new olympe.D.K(()=>olympe.dc.za,[]);olympe.dm.Ic=class extends olympe.dm.Lb{C(){return this.X()===olympe.dm.Ic.aa?this.
|
|
988
|
-
olympe.dm.Ic.Ub=
|
|
986
|
+
olympe.dm.DataSource.mj=olympe.dm.DataSource.P.sa('ff022000000000000060');olympe.dm.DataSource.SERVER=Bf('00000000000000000060','Server source');olympe.dm.DataSource.Ke={LA:'hybrid',Ln:'bus',ep:'http'};olympe.dm.DataSource.Hb={Dh:'ready',xb:'error',jt:'down',ee:'offline'};olympe.dm.rd=class extends olympe.dc.CloudObject{};olympe.dm.rd.P=olympe.dc.na.C('ff021000000000000070',olympe.dm.rd);olympe.dm.rd.C=olympe.dm.rd.P.sa('ff023000000000000071');olympe.dm.rd.F=olympe.dm.rd.P.sa('ff023000000000000072');olympe.dm.rd.G=olympe.dm.rd.P.sa('ff023000000000000073');olympe.dm.Lb=class extends olympe.dm.BrickMetadata{J(){return new olympe.dc.za(this.X(),[new olympe.dc.da.Ae(olympe.dm.Lb.C.X(),olympe.dc.wa.DESTINATION,olympe.dc.da.Dq.Ft,olympe.dc.da.Dq.Gt),olympe.dm.Lb.J])}ne(){return olympe.sc.pe.De.st}C(){return this.bb(olympe.dm.Lb.C,olympe.dm.Lb)}O(){return this.bb(olympe.dm.Lb.J)}};olympe.dm.Lb.P=olympe.dc.na.C('01612df1db9749227626',olympe.dm.Lb);olympe.dm.Lb.C=olympe.dm.Lb.P.sa('016a697ef00ce7554691');olympe.dm.Lb.ja=T(olympe.dm.Lb.P,olympe.dm.Lb.C);
|
|
987
|
+
olympe.dm.Lb.J=olympe.dm.Lb.P.sa('016a697ef00ce7554692');T(olympe.dc.CloudObject.P,olympe.dm.Lb.J);olympe.dm.Lb.prototype.J.L=new olympe.D.K(()=>olympe.dc.za,[]);olympe.dm.Lb.prototype.C.L=new olympe.D.K(()=>olympe.dc.za,[]);olympe.dm.Lb.prototype.O.L=new olympe.D.K(()=>olympe.dc.za,[]);olympe.dm.Ic=class extends olympe.dm.Lb{C(){return this.X()===olympe.dm.Ic.aa?this.bb(olympe.dm.Ic.O,olympe.dm.Lb):this.bb(olympe.dm.Ic.T,olympe.dm.Lb)}};olympe.dm.Ic.P=olympe.dc.na.C('ff021000000000000020',olympe.dm.Ic);olympe.dm.Ic.T=olympe.dm.Ic.P.sa('017e9c34cf48bd6965c1');olympe.dm.Ic.O=olympe.dm.Ic.P.sa('017e9c2e013e06bfffd9');olympe.dm.Ic.$h=olympe.dm.Ic.P.sa('01811f12ad77673770d4');olympe.dm.Ic.aa=Bf('10000000000000000000','ROOT_OF_ROOTS');olympe.dm.Ic.oc=Bf('10000000000000000001','OLYMPE_FOLDER');
|
|
988
|
+
olympe.dm.Ic.Ub=Bf('10000000000000000002','INTERNAL_FOLDER');olympe.dm.Ic.prototype.C.L=new olympe.D.K(()=>olympe.dc.za,[]);olympe.dm.Module=class extends olympe.dc.CloudObject{sx(){return this.zb(olympe.dm.Module.O)}Dx(){return this.nd(olympe.dm.Module.T)}cu(){return this.zb(olympe.dm.Module.F)}Hx(){return this.zb(olympe.dm.Module.Z)}ax(){return this.zb(olympe.dm.Module.G)}Ex(){return this.bb(olympe.dm.Module.J,olympe.dm.Module)}Px(){return this.bb(olympe.dm.Module.C,olympe.dm.Gd)}};olympe.dm.Module.P=olympe.dc.na.C('ff021000000000000040',olympe.dm.Module);olympe.dm.Module.O=olympe.dm.Module.P.la('ff023000000000000042');
|
|
989
989
|
olympe.dm.Module.T=olympe.dm.Module.P.la('ff023000000000000043');olympe.dm.Module.F=olympe.dm.Module.P.la('ff023000000000000044');olympe.dm.Module.Z=olympe.dm.Module.P.la('ff023000000000000045');olympe.dm.Module.G=olympe.dm.Module.P.la('ff023000000000000046');olympe.dm.Module.creationDateProp=olympe.dm.Module.P.la('ff023000000000000049');olympe.dm.Module.C=olympe.dm.Module.P.sa('ff022000000000000013');olympe.dm.Module.J=olympe.dm.Module.P.sa('ff022000000000000014');
|
|
990
|
-
olympe.dm.Module.aa=
|
|
991
|
-
b);this.C=c;this.G=d;this.F=e}Sr(){return this.zb(olympe.dm.File.mimeTypeProp)}
|
|
992
|
-
void 0===b||olympe.ka.ab('File.getContentAsString').warn('"onSuccess" and "onFailure" callbacks are deprecated in favor of the returned promise');const c=a&&olympe.D.Wa().G(a),d=b&&olympe.D.Wa().G(e=>null==b?void 0:b(`${e}`));return this.
|
|
990
|
+
olympe.dm.Module.aa=Bf('016a69b9bceabd815b77','OLYMPE_SERVER_MODULE');m=olympe.dm.Module.prototype;m.sx.L=olympe.D.K.F;m.Dx.L=olympe.D.K.G;m.cu.L=olympe.D.K.F;m.Hx.L=olympe.D.K.F;m.ax.L=olympe.D.K.F;m.Ex.L=new olympe.D.K(()=>olympe.dc.za,[]);m.Px.L=new olympe.D.K(()=>olympe.dc.za,[]);olympe.dm.File=class extends olympe.dc.CloudObject{static F(a,b,c,d,e,f,g){e=e||'application/data';d=URL.createObjectURL(new Blob([d],{type:e}));g=null!=g?g:olympe.dc.Zd().fromModel(a);a=b.create(a,f).ci(g);b=olympe.D.gb.now();Z(Z(Z(Z(Z(Z(a,olympe.dm.File.fileNameProp,null!=c?c:'file'),olympe.dm.File.urlProp,d),olympe.dm.File.creationDateProp,b),olympe.dm.File.modificationDateProp,b),olympe.dm.File.mimeTypeProp,e||'application/data'),olympe.dm.File.C,!1);return a.X()}constructor(a,b,c,d,e){super(a,
|
|
991
|
+
b);this.C=c;this.G=d;this.F=e}Sr(){return this.zb(olympe.dm.File.mimeTypeProp)}yk(a,b){void 0===a&&void 0===b||olympe.ka.ab('File.getContentAsBinary').warn('"onSuccess" and "onFailure" callbacks are deprecated in favor of the returned promise');const c=a&&olympe.D.Wa().G(a),d=b&&olympe.D.Wa().G(e=>null==b?void 0:b(`${e}`));return this.C.J(this).then(e=>{e=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);null==c||c(e);return e}).catch(e=>{null==d||d(e.message);throw e;})}Pm(a,b){void 0===a&&
|
|
992
|
+
void 0===b||olympe.ka.ab('File.getContentAsString').warn('"onSuccess" and "onFailure" callbacks are deprecated in favor of the returned promise');const c=a&&olympe.D.Wa().G(a),d=b&&olympe.D.Wa().G(e=>null==b?void 0:b(`${e}`));return this.yk().then(e=>{e=Va(e);null==c||c(e);return e}).catch(e=>{null==d||d(e.message);throw e;})}zk(a,b){void 0===a&&void 0===b||olympe.ka.ab('File.getContentUrl').warn('"onSuccess" and "onFailure" callbacks are deprecated in favor of the returned promise');const c=a&&olympe.D.Wa().G(a),
|
|
993
993
|
d=b&&olympe.D.Wa().G(g=>null==b?void 0:b(`${g}`));a=this.get(olympe.dm.File.C);const e=this.get(olympe.dm.File.urlProp),f=this.get(olympe.dm.File.mimeTypeProp);if(a||(null==e?0:e.startsWith('blob:'))||(null==e?0:e.startsWith('stream:')))return this.C.J(this).then(g=>{g=`data:${f};base64,${this.F.C(g)}`;null==c||c(g);return g}).catch(g=>{null==d||d(g.message);throw g;});if('string'===typeof e)return null==c||c(e),Promise.resolve(e);a=`No content nor URL associated to the file ${this.X()}`;null==d||
|
|
994
994
|
d(a);return Promise.reject(Error(a))}rename(a,b){const c=b&&olympe.D.Wa().G(b);olympe.D.hs([a],d=>{const e=new olympe.dc.Xa;e.update(this,olympe.dc.CloudObject.nameProp,d);e.update(this,olympe.dm.File.fileNameProp,d);e.ob(f=>{c&&c(f)})})}Yy(){this.G.O(this.get(olympe.dm.File.mimeTypeProp))}vp(){return this.zb(olympe.dm.File.urlProp)}up(){return this.zb(olympe.dm.File.fileNameProp)}hx(){return this.gj(olympe.dm.File.creationDateProp)}Cx(){return this.gj(olympe.dm.File.modificationDateProp)}ky(){return this.Ug(olympe.dm.File.C)}};
|
|
995
|
-
olympe.dm.File.prototype.saveAs=olympe.dm.File.prototype.Yy;olympe.dm.File.prototype.getContentUrl=olympe.dm.File.prototype.
|
|
995
|
+
olympe.dm.File.prototype.saveAs=olympe.dm.File.prototype.Yy;olympe.dm.File.prototype.getContentUrl=olympe.dm.File.prototype.zk;olympe.dm.File.prototype.getContentAsString=olympe.dm.File.prototype.Pm;olympe.dm.File.prototype.getContentAsBinary=olympe.dm.File.prototype.yk;olympe.dm.File.P=olympe.dc.na.C('ff021000000000000030',olympe.dm.File,olympe.dc.R.Ij,olympe.net.R.Ea,olympe.Y.R.mg);olympe.dm.File.nameProp=olympe.dm.File.P.la('ff023000000000000050');w('olympe.dm.File.nameProp',olympe.dm.File.nameProp);
|
|
996
996
|
olympe.dm.File.fileNameProp=olympe.dm.File.P.la('ff023000000000000050');w('olympe.dm.File.fileNameProp',olympe.dm.File.fileNameProp);olympe.dm.File.creationDateProp=olympe.dm.File.P.la('ff023000000000000051');w('olympe.dm.File.creationDateProp',olympe.dm.File.creationDateProp);olympe.dm.File.modificationDateProp=olympe.dm.File.P.la('ff023000000000000055');w('olympe.dm.File.modificationDateProp',olympe.dm.File.modificationDateProp);olympe.dm.File.mimeTypeProp=olympe.dm.File.P.la('ff023000000000000052');
|
|
997
|
-
w('olympe.dm.File.mimeTypeProp',olympe.dm.File.mimeTypeProp);olympe.dm.File.urlProp=olympe.dm.File.P.la('ff023000000000000053');w('olympe.dm.File.urlProp',olympe.dm.File.urlProp);olympe.dm.File.C=olympe.dm.File.P.la('ff023000000000000054');olympe.dm.File.P.C=olympe.dm.File.F.bind(null,olympe.dm.File);olympe.dm.File.O='application/data';olympe.dm.File.ya=[olympe.D.File];m=olympe.dm.File.prototype;m.Sr.L=olympe.D.K.F;m.
|
|
998
|
-
m.
|
|
999
|
-
olympe.dm.Gd.prototype.F.L=new olympe.D.K(()=>olympe.dc.za,[]);olympe.dm.kb=class extends olympe.dm.Ic{C(){return this.
|
|
1000
|
-
olympe.dm.kb.
|
|
1001
|
-
olympe.dm.kb.Cc=
|
|
1002
|
-
w('olympe.dm.Property.definingModelRel',olympe.dm.Property.definingModelRel);olympe.dm.Property.typeRel=T(olympe.dm.Property.P,olympe.dc.CloudObject.typeRel);w('olympe.dm.Property.typeRel',olympe.dm.Property.typeRel);olympe.dm.Property.prototype.C.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);olympe.dm.Property.prototype.getType.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);olympe.dm.Property.prototype.F.L=olympe.D.K.C;olympe.dm.Relation=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}yx(){return olympe.D.Qa.EMPTY}Xw(){return this.nd(olympe.dm.Relation.F)}Ix(){return this.nd(olympe.dm.Relation.G)}Kr(){return this.
|
|
1003
|
-
olympe.dm.Relation.G=olympe.dm.Relation.P.la('ff023000000000000030');olympe.dm.Relation.F=olympe.dm.Relation.P.la('ff023000000000000034');olympe.dm.Relation.ea=olympe.dm.Relation.P.la(olympe.dc.Nb.
|
|
1004
|
-
olympe.dm.Relation.originModelRel=T(olympe.dm.Relation.P,olympe.dc.CloudObject.
|
|
1005
|
-
m=olympe.dm.Relation.prototype;m.yx.L=olympe.D.K.F;m.Xw.L=olympe.D.K.G;m.Ix.L=olympe.D.K.G;m.Kr.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);m.Ur.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);function
|
|
997
|
+
w('olympe.dm.File.mimeTypeProp',olympe.dm.File.mimeTypeProp);olympe.dm.File.urlProp=olympe.dm.File.P.la('ff023000000000000053');w('olympe.dm.File.urlProp',olympe.dm.File.urlProp);olympe.dm.File.C=olympe.dm.File.P.la('ff023000000000000054');olympe.dm.File.P.C=olympe.dm.File.F.bind(null,olympe.dm.File);olympe.dm.File.O='application/data';olympe.dm.File.ya=[olympe.D.File];m=olympe.dm.File.prototype;m.Sr.L=olympe.D.K.F;m.yk.L=new olympe.D.K(()=>{},[]);m.Pm.L=new olympe.D.K(()=>{},[]);
|
|
998
|
+
m.zk.L=new olympe.D.K(()=>{},[]);m.rename.L=olympe.D.K.C;m.vp.L=olympe.D.K.F;m.up.L=olympe.D.K.F;m.hx.L=new olympe.D.K(()=>olympe.D.gb,[]);m.Cx.L=new olympe.D.K(()=>olympe.D.gb,[]);m.ky.L=olympe.D.K.O;olympe.dm.Gd=class extends olympe.dc.CloudObject{C(){return this.zb(olympe.dm.Gd.F)}G(){return this.nd(olympe.dm.Gd.G)}F(){return this.bb(olympe.dm.Gd.C,olympe.dm.Module)}};olympe.dm.Gd.P=olympe.dc.na.C('ff021000000000000041',olympe.dm.Gd);olympe.dm.Gd.F=olympe.dm.Gd.P.la('ff023000000000000047');olympe.dm.Gd.G=olympe.dm.Gd.P.la('ff023000000000000048');olympe.dm.Gd.C=olympe.dm.Module.C.bc();olympe.dm.Gd.prototype.C.L=olympe.D.K.F;olympe.dm.Gd.prototype.G.L=olympe.D.K.G;
|
|
999
|
+
olympe.dm.Gd.prototype.F.L=new olympe.D.K(()=>olympe.dc.za,[]);olympe.dm.kb=class extends olympe.dm.Ic{C(){return this.bb(olympe.dm.Lb.C,olympe.dm.Lb)}G(){return this.zb(olympe.dm.kb.Z)}T(){return this.zb(olympe.dm.kb.hb)}F(){return this.bb(olympe.dm.kb.G,olympe.dm.kb)}};olympe.dm.kb.P=olympe.dc.na.C('0163d9594700fcf61e54',olympe.dm.kb);olympe.dm.kb.Z=olympe.dm.kb.P.la('017869c7d2833c9492c1');olympe.dm.kb.bs=olympe.dm.kb.P.la('017869c7d2833c9492c2');olympe.dm.kb.Ud=olympe.dm.kb.P.la('017869c7d2833c9492c3');olympe.dm.kb.hb=olympe.dm.kb.P.la('017869c80bb9929c76d0');
|
|
1000
|
+
olympe.dm.kb.eb=olympe.dm.kb.P.sa('ff02200000000000002a');olympe.dm.kb.G=olympe.dm.kb.P.sa('ff02200000000000002b');olympe.dm.kb.Bf=T(olympe.dm.kb.P,olympe.dm.kb.G);olympe.dm.kb.F=olympe.dm.kb.P.sa('ff02200000000000002c');olympe.dm.kb.Uh=olympe.dm.kb.P.sa('017e9c412e2b944bc48f');olympe.dm.kb.Vd=olympe.dm.kb.P.sa('017e9c412e2b944bd590');olympe.dm.kb.$r=olympe.dm.kb.P.sa('017e9c416872a89d3415');olympe.dm.kb.Gk=olympe.dm.kb.P.sa('017ebf8fe5c506662098');T(olympe.dc.CloudObject.P,olympe.dm.kb.eb);
|
|
1001
|
+
olympe.dm.kb.Cc=Bf('100000000000000000dd','PRIMORDIAL');olympe.dm.kb.prototype.C.L=new olympe.D.K(()=>olympe.dc.za,[]);olympe.dm.kb.prototype.G.L=olympe.D.K.F;olympe.dm.kb.prototype.T.L=olympe.D.K.F;olympe.dm.kb.prototype.F.L=new olympe.D.K(()=>olympe.dc.za,[]);olympe.dm.Property=class extends olympe.dc.CloudObject{C(){return this.pc(olympe.dm.Property.definingModelRel,olympe.dc.CloudObject)}getType(){return this.pc(olympe.dm.Property.typeRel,olympe.dc.CloudObject)}F(){return this.wk(olympe.dm.Property.typeRel).md()}Oc(){return this.C().ma().Ar(this.ma())}};olympe.dm.Property.P=olympe.dc.na.C('ff021000000000000005',olympe.dm.Property);olympe.dm.Property.definingModelRel=T(olympe.dm.Property.P,olympe.dc.CloudObject.propertyRel);
|
|
1002
|
+
w('olympe.dm.Property.definingModelRel',olympe.dm.Property.definingModelRel);olympe.dm.Property.typeRel=T(olympe.dm.Property.P,olympe.dc.CloudObject.typeRel);w('olympe.dm.Property.typeRel',olympe.dm.Property.typeRel);olympe.dm.Property.prototype.C.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);olympe.dm.Property.prototype.getType.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);olympe.dm.Property.prototype.F.L=olympe.D.K.C;olympe.dm.Relation=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}yx(){return olympe.D.Qa.EMPTY}Xw(){return this.nd(olympe.dm.Relation.F)}Ix(){return this.nd(olympe.dm.Relation.G)}Kr(){return this.bb(olympe.dm.Relation.destinationModelRel,olympe.dc.CloudObject).Fc()}Ur(){return this.bb(olympe.dm.Relation.originModelRel,olympe.dc.CloudObject).Fc()}Oc(){return this.Ur().ma().concat(['-',this.ma(),'->',this.Kr().ma()])}};olympe.dm.Relation.P=olympe.dc.na.C('ff021000000000000006',olympe.dm.Relation);
|
|
1003
|
+
olympe.dm.Relation.G=olympe.dm.Relation.P.la('ff023000000000000030');olympe.dm.Relation.F=olympe.dm.Relation.P.la('ff023000000000000034');olympe.dm.Relation.ea=olympe.dm.Relation.P.la(olympe.dc.Nb.uo);olympe.dm.Relation.Z=olympe.dm.Relation.P.la(olympe.dc.Nb.Dc);olympe.dm.Relation.ja=olympe.dm.Relation.P.la(olympe.dc.Nb.Yf);olympe.dm.Relation.va=olympe.dm.Relation.P.la(olympe.dc.Nb.zv);olympe.dm.Relation.aa=olympe.dm.Relation.P.la(olympe.dc.Nb.kt);olympe.dm.Relation.T=olympe.dm.Relation.P.la('ff023000000000000031');
|
|
1004
|
+
olympe.dm.Relation.originModelRel=T(olympe.dm.Relation.P,olympe.dc.CloudObject.lj);w('olympe.dm.Relation.originModelRel',olympe.dm.Relation.originModelRel);olympe.dm.Relation.destinationModelRel=T(olympe.dm.Relation.P,olympe.dc.CloudObject.Er);w('olympe.dm.Relation.destinationModelRel',olympe.dm.Relation.destinationModelRel);olympe.dm.Relation.C={Et:0,Is:5,tq:1,jv:4,tm:2,gm:8,$z:10,GB:6,HB:9,Me:6,JB:9};olympe.dm.Relation.J={lB:3,Lu:4,ZA:5,YA:6};olympe.dm.Relation.O=olympe.dm.Uk.Nu+olympe.dm.Uk.gt;
|
|
1005
|
+
m=olympe.dm.Relation.prototype;m.yx.L=olympe.D.K.F;m.Xw.L=olympe.D.K.G;m.Ix.L=olympe.D.K.G;m.Kr.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);m.Ur.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);function tm(a){a=olympe.dc.ga(a);if(olympe.dc.ia().If(a,olympe.dm.String))return olympe.dm.String.valueProp;switch(a){case olympe.dm.Number.P.X():return olympe.dm.Number.valueProp;case olympe.dm.Boolean.P.X():return olympe.dm.Boolean.valueProp;case olympe.dm.DateTime.P.X():return olympe.dm.DateTime.valueProp;case olympe.dm.Color.P.X():return olympe.dm.Color.valueProp;default:throw Error('Unknown primitive model: '+a);}}olympe.dm.ye=class extends olympe.dc.CloudObject{getValue(){}};
|
|
1006
1006
|
olympe.dm.ye.P=olympe.dc.na.C('ff021000000000000019',olympe.dm.ye);olympe.dm.String=class extends olympe.dm.ye{getValue(){return this.zb(olympe.dm.String.valueProp)}Ac(){return this.get(olympe.dm.String.valueProp)}toString(){let a;return null!=(a=this.get(olympe.dm.String.valueProp))?a:''}};olympe.dm.String.P=olympe.dc.na.C('ff021000000000000011',olympe.dm.String);olympe.dm.String.valueProp=olympe.dm.String.P.la('ff023000000000000026');w('olympe.dm.String.valueProp',olympe.dm.String.valueProp);olympe.dm.String.prototype.getValue.L=olympe.D.K.F;
|
|
1007
|
-
olympe.dm.String.prototype.toString.L=olympe.D.K.C;olympe.dm.Boolean=class extends olympe.dm.ye{getValue(){return this.Ug(olympe.dm.Boolean.valueProp)}Ac(){return this.get(olympe.dm.Boolean.valueProp)}};olympe.dm.Boolean.P=olympe.dc.na.C('ff021000000000000012',olympe.dm.Boolean);olympe.dm.Boolean.valueProp=olympe.dm.Boolean.P.la('ff023000000000000027');w('olympe.dm.Boolean.valueProp',olympe.dm.Boolean.valueProp);olympe.dm.Boolean.prototype.getValue.L=olympe.D.K.O;olympe.dm.Color=class extends olympe.dm.ye{getValue(){return this.Vr()}Ac(){return this.get(olympe.dm.Color.valueProp)}};olympe.dm.Color.P=olympe.dc.na.C('ff021000000000000017',olympe.dm.Color);olympe.dm.Color.valueProp=olympe.dm.Color.P.la('ff023000000000000032');w('olympe.dm.Color.valueProp',olympe.dm.Color.valueProp);olympe.dm.Color.prototype.getValue.L=new olympe.D.K(()=>olympe.D.Color,[]);olympe.dm.DateTime=class extends olympe.dm.ye{getValue(){return this.gj(olympe.dm.DateTime.valueProp)}Ac(){return this.get(olympe.dm.DateTime.valueProp)}};olympe.dm.DateTime.P=olympe.dc.na.C('ff021000000000000014',olympe.dm.DateTime);olympe.dm.DateTime.valueProp=olympe.dm.DateTime.P.la('ff023000000000000029');w('olympe.dm.DateTime.valueProp',olympe.dm.DateTime.valueProp);olympe.dm.DateTime.prototype.getValue.L=new olympe.D.K(()=>olympe.D.gb,[]);olympe.dm.Enum=class extends olympe.dm.String{ma(){return olympe.D.
|
|
1008
|
-
olympe.W.config(a=>{F(a,olympe.sc.V.Je,'');F(a,olympe.sc.V.Rf,!1);F(a,olympe.sc.V.ht,!0);F(a,olympe.sc.V.PRODUCTION,!1);F(a,olympe.sc.V.Mu,2E4);F(a,olympe.sc.V.vq,3E4);F(a,olympe.sc.V.
|
|
1009
|
-
'olympe.sc');olympe.W.run([olympe.sc.R.
|
|
1007
|
+
olympe.dm.String.prototype.toString.L=olympe.D.K.C;olympe.dm.Boolean=class extends olympe.dm.ye{getValue(){return this.Ug(olympe.dm.Boolean.valueProp)}Ac(){return this.get(olympe.dm.Boolean.valueProp)}};olympe.dm.Boolean.P=olympe.dc.na.C('ff021000000000000012',olympe.dm.Boolean);olympe.dm.Boolean.valueProp=olympe.dm.Boolean.P.la('ff023000000000000027');w('olympe.dm.Boolean.valueProp',olympe.dm.Boolean.valueProp);olympe.dm.Boolean.prototype.getValue.L=olympe.D.K.O;olympe.dm.Color=class extends olympe.dm.ye{getValue(){return this.Vr()}Ac(){return this.get(olympe.dm.Color.valueProp)}};olympe.dm.Color.P=olympe.dc.na.C('ff021000000000000017',olympe.dm.Color);olympe.dm.Color.valueProp=olympe.dm.Color.P.la('ff023000000000000032');w('olympe.dm.Color.valueProp',olympe.dm.Color.valueProp);olympe.dm.Color.prototype.getValue.L=new olympe.D.K(()=>olympe.D.Color,[]);olympe.dm.DateTime=class extends olympe.dm.ye{getValue(){return this.gj(olympe.dm.DateTime.valueProp)}Ac(){return this.get(olympe.dm.DateTime.valueProp)}};olympe.dm.DateTime.P=olympe.dc.na.C('ff021000000000000014',olympe.dm.DateTime);olympe.dm.DateTime.valueProp=olympe.dm.DateTime.P.la('ff023000000000000029');w('olympe.dm.DateTime.valueProp',olympe.dm.DateTime.valueProp);olympe.dm.DateTime.prototype.getValue.L=new olympe.D.K(()=>olympe.D.gb,[]);olympe.dm.Enum=class extends olympe.dm.String{ma(){return olympe.D.ua([super.ma(),super.getValue()],(a,b)=>''!==a.valueOf()?a:b,olympe.D.Qa)}xd(){return this.nd(olympe.dm.Enum.rankProp)}};olympe.dm.Enum.P=olympe.dc.na.C('016cdd861b32d56c81f7',olympe.dm.Enum);olympe.dm.Enum.rankProp=olympe.dm.Enum.P.la('017a7690c915975ea995');olympe.dm.Enum.prototype.xd.L=olympe.D.K.G;olympe.dm.Wf=class extends olympe.dm.BrickMetadata{Wx(){return this.ib(olympe.dc.CloudObject.instancesRel).Pk(olympe.dm.Enum.rankProp,olympe.dc.query.Wj.ASC).md()}static create(a,b){b=a.create(olympe.dm.Wf,(new Map).set(olympe.dc.CloudObject.nameProp,b));a.Ma(olympe.dc.CloudObject.extendRel,b,olympe.dm.Enum);return b}};olympe.dm.Wf.create=olympe.dm.Wf.create;olympe.dm.Wf.prototype.getValues=olympe.dm.Wf.prototype.Wx;olympe.dm.Wf.P=olympe.dc.na.C('017a768f966fc08ebb98',olympe.dm.Wf);olympe.dm.Number=class extends olympe.dm.ye{getValue(){return this.nd(olympe.dm.Number.valueProp)}Ac(){return this.get(olympe.dm.Number.valueProp)}};olympe.dm.Number.P=olympe.dc.na.C('ff021000000000000013',olympe.dm.Number);olympe.dm.Number.valueProp=olympe.dm.Number.P.la('ff023000000000000028');w('olympe.dm.Number.valueProp',olympe.dm.Number.valueProp);olympe.dm.Number.prototype.getValue.L=olympe.D.K.G;olympe.sc={};olympe.sc.R={Ca:'sc.Logger',ck:'sc.RootContext',Be:'sc.Serializer'};olympe.sc.V={Je:'sc.app',Rf:'sc.debug',xn:'sc.autostartProfiler',po:'sc.debugger',ht:'sc.disableTheme',PRODUCTION:'sc.production',Mu:'sc.onstartTimeout',vq:'sc.remoteActionTimeout'};
|
|
1008
|
+
olympe.W.config(a=>{F(a,olympe.sc.V.Je,'');F(a,olympe.sc.V.Rf,!1);F(a,olympe.sc.V.ht,!0);F(a,olympe.sc.V.PRODUCTION,!1);F(a,olympe.sc.V.Mu,2E4);F(a,olympe.sc.V.vq,3E4);F(a,olympe.sc.V.xn,!1);E(a,olympe.sc.R.Ca,[olympe.ka.R.Ea],b=>b.Vc('sc'));C(a,olympe.sc.R.Be,olympe.sc.fc,olympe.dc.db.R.Ea);Oa(a,olympe.dc.sources.R.Be,olympe.sc.R.Be);E(a,olympe.sc.R.ck,[new olympe.W.oa(olympe.sc.V.PRODUCTION)],b=>{const c=new olympe.sc.pg('root','root',null);olympe.sc.fn=c;c.set(olympe.sc.xa.C.PRODUCTION,b);return new olympe.sc.xa(c)})},
|
|
1009
|
+
'olympe.sc');olympe.W.run([olympe.sc.R.ck,new olympe.W.oa(olympe.N.V.dl)],(a,b)=>{olympe.Yd().ctx=a;olympe.Yd().oVersion=()=>b});olympe.sc.Zm=()=>null!==olympe.dc.ia().Kb(void 0,olympe.sc.Runnable.C.bc());olympe.sc.HD=(a,b,c,d)=>{c=Z(Z(a.create(olympe.sc.Xc),olympe.sc.Xc.C,c||null),olympe.sc.Xc.G,d||null);a.Ma(olympe.sc.Xc.F,c,b);a.Ma(olympe.dc.CloudObject.containsRel,b,c);return c.X()};olympe.sc.Zi=(a,b)=>{a=olympe.dc.nb.Yw(b)(a);return a instanceof olympe.sc.Kd?a.C():a};
|
|
1010
1010
|
olympe.sc.ZD=function(a){const b=olympe.dc.CloudObject.containsRel.bc();var c=olympe.dc.ga(a);if(void 0===c)return[];a=olympe.dc.ia();const d=[];let e=[];const f=new Set;for(;!a.Rb(c,olympe.dm.Lb);){f.add(c);const g=a.Kb(c,b);if(null===g)return olympe.ka.ab('sc').warn(`Object ${c} has no container`),[];a.Rb(c,olympe.sc.logic.qb)||g===a.Kb(c,olympe.sc.Runnable.C.bc())||d.push(c);c=g;if(f.has(c))throw Error(`Instance ${c} (${a.name(c)}) is part of a cyclic contain pattern`);}e.push(c);e=e.concat(a.Vg(e[0],
|
|
1011
1011
|
olympe.dm.Lb.ja));e=e.concat(a.Vg(e[e.length-1],olympe.dm.Ic.T.bc()));e=e.concat(a.Vg(e[e.length-1],olympe.dm.Ic.O.bc()));return[...d,...e].reverse()};olympe.sc.$D=a=>{a=a&&a.valueOf()||'';return a.startsWith('image/')?olympe.sc.ug:a.startsWith('video/')?olympe.sc.Jh:a.startsWith('font/')||a.startsWith('application/font-woff')?olympe.sc.Hc:olympe.dm.File};
|
|
1012
|
-
olympe.sc.YD=a=>a instanceof olympe.sc.ug?'image/*':a instanceof olympe.sc.Jh?'video/*':a instanceof olympe.sc.Hc?'font/*,application/font-woff':null;olympe.sc.Za={};function
|
|
1013
|
-
olympe.sc.xa=class{constructor(a=olympe.sc.
|
|
1014
|
-
b){this.C.set(a,b);return this}
|
|
1015
|
-
d.next.bind(d),c?void 0:this.C.U(),!1);this.onDestroy(()=>{f();d.complete()});return f})}repeat(a,b){const c=
|
|
1016
|
-
`on the context ${this.U()}:\nStack: ${this.ke()}\n${f}`;f instanceof rxjs.EmptyError&&(g=`The context ${this.U()} has been destroyed while a Promise `+`created from a call to \`waitFor(${olympe.dc.ga(a)})\` `+`has never received any value:\nStack: ${this.ke()}`);e(Error(g))}))})}throw(a){var b=a instanceof Error?a.message:String(a);if(a instanceof Error){var c;const d=(null==(c=a.ke)?void 0:c.call(a))||this.ke();let e,f;c=null!=(f=null==(e=a.Ir)?void 0:e.call(a))?f:0;b=
|
|
1017
|
-
|
|
1018
|
-
|
|
1012
|
+
olympe.sc.YD=a=>a instanceof olympe.sc.ug?'image/*':a instanceof olympe.sc.Jh?'video/*':a instanceof olympe.sc.Hc?'font/*,application/font-woff':null;olympe.sc.Za={};function um(a,b){var c=olympe.sc.xa,d=a.C;a=a.F();b=olympe.dc.ga(b);let e,f=null==(e=d.F)?void 0:e.get(b);if(!f){f=d.Rh(a,void 0,b);for(d=f.getParent();d&&d.ja&&!d.id.startsWith('_');)d=d.getParent();let g;null==(g=d)||vm(g,b,f)}return new c(f)}function wm(a){let b;return null!=(b=a.Na(olympe.sc.xa.C.PRODUCTION))?b:!1}
|
|
1013
|
+
olympe.sc.xa=class{constructor(a=olympe.sc.fn){this.C=a;this.H=olympe.ka.ab('sc');this.G=null}U(){return this.C.U()}getParent(){if(null===this.G){const a=this.C.getParent();this.G=null===a?null:new olympe.sc.xa(a)}return this.G}Zw(a){const b=olympe.dc.ia();let c=this.getParent();if(!c)return this;const d=e=>{e=e.Ye();if('string'!==typeof e)return!1;const f=b.model(e);return f&&b.Oa(f,olympe.sc.Va.aa)||a.modelTag&&!b.Rb(e,a.modelTag)?!1:!0};for(;c&&!d(c);){const e=c.getParent();if(!e)break;c=e}return c}Ye(){return this.C.Ye()}F(){return this.C.C}set(a,
|
|
1014
|
+
b){this.C.set(a,b);return this}rn(a){return this.set(a,Date.now())}remove(a){this.set(a,null)}sb(a,b,c=!1){const d=olympe.dc.ga(a),e=olympe.D.ec(null!=b?b:Object,`Get context value flow source of ${d}`);e.getContext().onDestroy(this.on(a,f=>{null===f?e.clear():e.update(f)},c?this.C.U():void 0));return e.sb()}get(a,b=!1){a=this.Na(a,b);return void 0!==a?a:null}has(a,b=!1){return this.C.has(a,b)}observe(a,b=!0,c=!1){return new rxjs.Observable(d=>{const e=this.get(a);b||null!==e||d.next(e);const f=this.on(a,
|
|
1015
|
+
d.next.bind(d),c?void 0:this.C.U(),!1);this.onDestroy(()=>{f();d.complete()});return f})}repeat(a,b){const c=xm(this.C,a);a=b.subscribe(d=>{null!==d?this.set(c,d):this.remove(c)});this.dh(a.unsubscribe.bind(a));return this}Xy(a){a=a instanceof olympe.sc.Runnable?a:this.get(a);if(!a)return null;const b=this.Rh(`Runner ${a.name()}`);a.run(b);return b}vs(a,b=!0,c=!1){return new Promise((d,e)=>{this.observe(a,b,c).pipe(rxjs.operators.first()).subscribe(rxjs.Subscriber.create(d,f=>{let g=`An error occurred while calling \`waitFor(${olympe.dc.ga(a)})\``+
|
|
1016
|
+
`on the context ${this.U()}:\nStack: ${this.ke()}\n${f}`;f instanceof rxjs.EmptyError&&(g=`The context ${this.U()} has been destroyed while a Promise `+`created from a call to \`waitFor(${olympe.dc.ga(a)})\` `+`has never received any value:\nStack: ${this.ke()}`);e(Error(g))}))})}throw(a){var b=a instanceof Error?a.message:String(a);if(a instanceof Error){var c;const d=(null==(c=a.ke)?void 0:c.call(a))||this.ke();let e,f;c=null!=(f=null==(e=a.Ir)?void 0:e.call(a))?f:0;b=ym(b,c,d);b.stack=a.stack}else b=
|
|
1017
|
+
ym(b,0,this.ke());zm(this.C,b);return this}Zy(a){this.set(olympe.sc.xa.C.og,a);return this}Na(a,b=!0){return this.C.Na(a,b)}on(a,b,c,d=!0){return this.C.on(a,b,c,d)}Rh(a){return new olympe.sc.xa(this.C.Rh(this.F(),a))}Mk(a,b){return this.C.Mk(a,c=>{b(new olympe.sc.xa(c))})}Gx(a){a=Am(this.C,a);return a===this.C?this:a&&new olympe.sc.xa(a)}destroy(){this.C.destroy()}dh(a,b){return this.C.dh(a,b)}Kk(a){this.C.Kk(a)}onDestroy(a){return this.fb()?(a(),'noId'):this.F().onDestroy(a)}Mf(a){this.fb()||this.F().Mf(a)}clear(){this.C.clear()}fb(){return this.F().fb()}Oa(a){a=
|
|
1018
|
+
Bm(this.C,a);return null!==a?new olympe.sc.ui.Hz(a,this):null}qx(a){a=Bm(this.C,a);return null!==a?new olympe.sc.ui.Gz(a,this):null}Ey(...a){return rxjs.combineLatest(a.map(b=>{b=Bm(this.C,b);return null!==b?this.observe(b):rxjs.of(null)}))}Fa(a){return(null==a?void 0:a.constructor)!==this.constructor?!1:this.C===a.C}ke(){const a=olympe.dc.ia();let b;try{const c=[this];let d=this.getParent();for(;null!==d&&d.C!==olympe.sc.fn;)c.push(d),d=d.getParent();b='> '+c.map(e=>{const f=e.Ye();return null!==
|
|
1019
1019
|
f?(e=a.model(f),`${a.name(f)||e&&a.name(e)||f} (${e})`):e.U()}).join('\n> ')}catch(c){b=`No stack available for context ${this.U()}: ${c}`,this.H.warn(b)}return b}};olympe.sc.xa.prototype.observeMany=olympe.sc.xa.prototype.Ey;olympe.sc.xa.prototype.getEvent=olympe.sc.xa.prototype.qx;olympe.sc.xa.prototype.getProperty=olympe.sc.xa.prototype.Oa;olympe.sc.xa.prototype.isDestroyed=olympe.sc.xa.prototype.fb;olympe.sc.xa.prototype.clear=olympe.sc.xa.prototype.clear;olympe.sc.xa.prototype.offDestroy=olympe.sc.xa.prototype.Mf;
|
|
1020
|
-
olympe.sc.xa.prototype.onDestroy=olympe.sc.xa.prototype.onDestroy;olympe.sc.xa.prototype.offClear=olympe.sc.xa.prototype.
|
|
1021
|
-
olympe.sc.xa.prototype['throw']=olympe.sc.xa.prototype.throw;olympe.sc.xa.prototype.waitFor=olympe.sc.xa.prototype.vs;olympe.sc.xa.prototype.runner=olympe.sc.xa.prototype.Xy;olympe.sc.xa.prototype.repeat=olympe.sc.xa.prototype.repeat;olympe.sc.xa.prototype.observe=olympe.sc.xa.prototype.observe;olympe.sc.xa.prototype.has=olympe.sc.xa.prototype.has;olympe.sc.xa.prototype.get=olympe.sc.xa.prototype.get;olympe.sc.xa.prototype.remove=olympe.sc.xa.prototype.remove;olympe.sc.xa.prototype.trigger=olympe.sc.xa.prototype.
|
|
1022
|
-
olympe.sc.xa.prototype.set=olympe.sc.xa.prototype.set;olympe.sc.xa.prototype.getClosest=olympe.sc.xa.prototype.Zw;olympe.sc.xa.prototype.getParent=olympe.sc.xa.prototype.getParent;olympe.sc.xa.C={PRODUCTION:'__production',EDITION:'__editionMode',TRANSACTION:'__transaction',og:'__htmlContainer',Vz:'__dockableElement',
|
|
1023
|
-
function
|
|
1024
|
-
function
|
|
1025
|
-
function
|
|
1026
|
-
function
|
|
1027
|
-
function
|
|
1028
|
-
function
|
|
1029
|
-
olympe.sc.pg=class{constructor(a,b='no name',c=olympe.sc.
|
|
1030
|
-
(d=this.aa)?void 0:d.get('IO#'+g))?k:g;c='$'+a;var e;d=null!=(e=this.data.get(c))?e:null;b=null!=b?b:null;if(e=!this.O.has(c)){a:{if('function'===typeof(null==b?void 0:b.Fa))try{var f=b.Fa(d);break a}catch(l){f=!1;break a}f=b===d}e=!f}e&&(null===b?this.data.delete(c):this.data.set(c,b),null!==this.Za&&0<this.Za.size&&
|
|
1031
|
-
'*';a=
|
|
1032
|
-
b,this));null!==this.Za&&0<this.Za.size&&this.Za.forEach(({
|
|
1033
|
-
else return
|
|
1034
|
-
t])})};b.
|
|
1035
|
-
c);this.O.listen().subscribe(e=>{var f=e.body();if(f.t===olympe.sc.Sd.C.it){e=f.i;f=f.f;if(!this.G.has(f)){const g=this.Z(f,c,b);if(0!==g.length)this.G.set(f,g);else return}null===this.F&&(this.F=olympe.Y.Cf(),f=new olympe.D.Xb(this.F,c.F()),this.J=new olympe.N.wb(this.F,f),this.J.listen().subscribe(g=>{this.aa(g,b,d)}));olympe.N.wb.publish(e,{t:olympe.sc.Sd.C.xs,n:olympe.W.getParameter(olympe.sc.V.
|
|
1036
|
-
d){const e=[],f=olympe.dc.ia(),g=(h,k)=>{
|
|
1037
|
-
b||void 0===b)return'<null>';const c=olympe.dc.ia();if(b instanceof olympe.dc.CloudObject){var d=b.cc();if(!c.Rb(d,olympe.sc.yc))return b.toString();let f=`${b.Vb().name()} (${b.X()})`;var e=olympe.dc.CloudObject.get(d);d=olympe.dc.pa.from(e).eg(olympe.dc.CloudObject.extendRel,!0).ge().ib(olympe.dc.CloudObject.propertyRel).ge().md();e=olympe.dc.pa.from(e).eg(olympe.dc.CloudObject.extendRel,!0).ge().ib(olympe.dc.CloudObject.
|
|
1038
|
-
'<br> ',f+='Properties:<br>',d.forEach(([,g])=>{f+=' ';f+=' - '+c.name(g)+' : '+c.Oa(b.X(),g)+'<br>'}));d=e.filter(([g])=>g instanceof olympe.sc.yc);0!==d.length&&(f+=' ',f+='Relations:<br>',d.forEach(([,g])=>{f+=' ';f+=' - '+c.name(g)+'<br>'}));return f}return b.toString()}};olympe.sc.Sd.J='discovery_debug_id';olympe.sc.Sd.C={it:0,xs:1,Ru:2,Su:3,Jt:4,
|
|
1020
|
+
olympe.sc.xa.prototype.onDestroy=olympe.sc.xa.prototype.onDestroy;olympe.sc.xa.prototype.offClear=olympe.sc.xa.prototype.Kk;olympe.sc.xa.prototype.onClear=olympe.sc.xa.prototype.dh;olympe.sc.xa.prototype.destroy=olympe.sc.xa.prototype.destroy;olympe.sc.xa.prototype.getOtherContext=olympe.sc.xa.prototype.Gx;olympe.sc.xa.prototype.onContext=olympe.sc.xa.prototype.Mk;olympe.sc.xa.prototype.createChild=olympe.sc.xa.prototype.Rh;olympe.sc.xa.prototype.setParentElement=olympe.sc.xa.prototype.Zy;
|
|
1021
|
+
olympe.sc.xa.prototype['throw']=olympe.sc.xa.prototype.throw;olympe.sc.xa.prototype.waitFor=olympe.sc.xa.prototype.vs;olympe.sc.xa.prototype.runner=olympe.sc.xa.prototype.Xy;olympe.sc.xa.prototype.repeat=olympe.sc.xa.prototype.repeat;olympe.sc.xa.prototype.observe=olympe.sc.xa.prototype.observe;olympe.sc.xa.prototype.has=olympe.sc.xa.prototype.has;olympe.sc.xa.prototype.get=olympe.sc.xa.prototype.get;olympe.sc.xa.prototype.remove=olympe.sc.xa.prototype.remove;olympe.sc.xa.prototype.trigger=olympe.sc.xa.prototype.rn;
|
|
1022
|
+
olympe.sc.xa.prototype.set=olympe.sc.xa.prototype.set;olympe.sc.xa.prototype.getClosest=olympe.sc.xa.prototype.Zw;olympe.sc.xa.prototype.getParent=olympe.sc.xa.prototype.getParent;olympe.sc.xa.C={PRODUCTION:'__production',EDITION:'__editionMode',TRANSACTION:'__transaction',og:'__htmlContainer',Vz:'__dockableElement',vn:'__appHasStarted'};olympe.sc.hr=class extends olympe.sc.xa{constructor(a){super(a);this.J=new olympe.D.Xb('SC Update Context',super.F());const b=a.dh(()=>{b&&a.Kk(b);this.J.destroy()})}F(){return this.J}dh(a,b){return this.F().onDestroy(a,null!=b?b:olympe.Y.Mc())}};let Cm=0;function xm(a,b){b=olympe.dc.ga(b);let c,d,e,f;return null!=(f=null!=(e=null==(c=a.aa)?void 0:c.get('I#'+b))?e:null==(d=a.aa)?void 0:d.get('IO#'+b))?f:b}function zm(a,b){if(null===a.J)a.H.error(`An error occurred in a brick: ${b.toString()}`);else if(a.ea){var c=Dm(olympe.dc.CloudObject.get(a.ea));null!==c&&Em(a,c).some(d=>{let e,f;return 0<(null==(e=a.G)?void 0:null==(f=e.get(d))?void 0:f.size)})&&!a.O.has('$'+c)?a.set(c,b):zm(a.J,b)}else zm(a.J,b)}
|
|
1023
|
+
function Am(a,b){if(b===a.id||a.T.has(b)||!b)return a;for(a=a.J;a;){if(b===a.U()||a.T.has(b))return a;const c=Fm(a.F,b);if(c)return c;a=a.getParent()}return null}function Gm(a,b,c=0){null===a.Za&&(a.Za=new Map);a.Za.has(b.U())||(a.Za.set(b.U(),{Nk:b,depth:c}),Hm(a,d=>{(-1===b.G||c<b.G)&&Gm(d,b,c+1)}),a.onDestroy(()=>{Im(a,b.U())}));return b.U()}
|
|
1024
|
+
function Im(a,b){if(null===a.Za||!a.Za.has(b))return!1;const {Nk:c,depth:d}=a.Za.get(b);Hm(a,f=>{Im(f,b)});0===d&&c.F();const e=a.Za.delete(b);0===a.Za.size&&(a.Za=null);return e}function Bm(a,b){let c;return(null==(c=a.aa)?void 0:c.get('IO#'+b))||null}
|
|
1025
|
+
function Jm(a){a.C.Z(()=>{Hm(a,c=>c.destroy())});a.C.onDestroy(()=>{void 0!==a.Na(olympe.sc.xa.C.TRANSACTION,!1)&&a.H.warn(`The context ${a.U()} is being destroyed but still has unreleased transactions. You probably forgot to end a transaction.`);a.clear();let c;if(null!=(c=a.J)){let d;null==(d=c.F)||d.delete(a.U());let e;0===(null==(e=c.F)?void 0:e.size)&&(c.F=null)}a.T.clear()});let b;null==(b=a.J)||Km(b,a)}
|
|
1026
|
+
function Fm(a,b){if(null===a)return null;if(a.has(b))return a.get(b);for(const c of a.values())if(c.ja&&!c.id.startsWith('_')&&(a=Fm(c.F,b)))return a;return null}function Lm(a,b,...c){if(null!==a.Za)for(const {Nk:d,depth:e}of a.Za.values())d.process(a,b,e,...c)}function Mm(a,b){a.ea=olympe.dc.ga(b);a.ja=b.vd().Zm();b.G().forEach(c=>{a.id===c||a.T.has(c)||(a.T.add(c),vm(a,c,a))});a.aa=b.T();Lm(a,olympe.sc.Za.nc.C.INIT)}function Nm(a){a.va=!0;let b;null==(b=a.F)||b.forEach(c=>{Nm(c)})}
|
|
1027
|
+
function Om(a){a.va=!1;let b;null==(b=a.F)||b.forEach(c=>{Om(c)})}function Em(a,b){return['*',a.id,...a.T].map(c=>`${'@'}${c}.${b}`)}function Pm(a,b,c,d){c.forEach(f=>{let g,h;null==(g=a.G)||null==(h=g.get(f))||h.forEach(k=>{k(d)})});let e;null==(e=a.F)||e.forEach(f=>{!f.va&&f.data.has(b)||Pm(f,b,c,d)})}function Qm(a,b,c){a.G||(a.G=new Map);let d=a.G.get(b);void 0===d&&(d=new Map,a.G.set(b,d));Cm++;const e=Cm;d.set(e,c);return()=>{const f=a.G.get(b);f&&(f.delete(e),0===f.size&&a.G.delete(b))}}
|
|
1028
|
+
function vm(a,b,c){a.O.add(b);let d,e;null==(d=a.G)||null==(e=d.get('&'+b))||e.forEach(f=>{f(c)});Hm(a,f=>{f.O.has(b)||vm(f,b,c)});a.O.delete(b)}function Hm(a,b){let c;null==(c=a.F)||c.forEach(b)}function Rm(a,b){a.data.forEach((c,d)=>b(c,d.slice(1)))}function Sm(a){var b=olympe.sc.Za.nc.F.sf;const c=[];if(null!==a.Za)for(const {Nk:d}of a.Za.values())d.getType()===b&&(c.push(d.U()),d.F(),Im(a,d.U()))}function Km(a,b){null===a.F&&(a.F=new Map);a.F.set(b.id,b)}
|
|
1029
|
+
olympe.sc.pg=class{constructor(a,b='no name',c=olympe.sc.fn){this.id=a;this.ld=b;this.T=new Set;this.J=c;this.C=new olympe.D.Xb('SC Context');this.data=new Map;this.ea=this.Z=this.F=this.G=null;this.ja=!1;this.O=new Set;this.va=!1;this.aa=null;this.H=olympe.ka.ab('sc');this.Za=null;Jm(this)}U(){return this.id}getParent(){return this.J}Ye(){return this.ea}set(a,b){if(!this.C.od()&&!this.C.fb()){const g=olympe.dc.ga(a);var c,d;let h,k;a=null!=(k=null!=(h=null==(c=this.aa)?void 0:c.get('O#'+g))?h:null==
|
|
1030
|
+
(d=this.aa)?void 0:d.get('IO#'+g))?k:g;c='$'+a;var e;d=null!=(e=this.data.get(c))?e:null;b=null!=b?b:null;if(e=!this.O.has(c)){a:{if('function'===typeof(null==b?void 0:b.Fa))try{var f=b.Fa(d);break a}catch(l){f=!1;break a}f=b===d}e=!f}e&&(null===b?this.data.delete(c):this.data.set(c,b),null!==this.Za&&0<this.Za.size&&Lm(this,olympe.sc.Za.nc.C.Ig,a,b),f=Em(this,a),this.O.add(c),Pm(this,c,f,b),this.O.delete(c))}}on(a,b,c,d=!0){if(this.C.fb()||this.C.od())return()=>{};const e=xm(this,a),f=c?olympe.dc.ga(c):
|
|
1031
|
+
'*';a=Qm(this,'@'+f+'.'+e,b);c=c?(c=Am(this,f))?c.Na(e,!1):void 0:this.Na(e);void 0!==c&&b(c);if(d)olympe.D.Wa().onDestroy(a);return a}has(a,b=!1){a='$'+xm(this,a);let c=this.data.has(a),d=this.getParent();if(b)for(;!c&&d;)c=d.data.has(a),d=d.getParent();return c}Rh(a,b,c){const d=null!=c?c:'_'+olympe.Y.Mc();if(a.fb()||a.od())throw Error(`Try to create new child context in a destroyed context ${a.U()}, probably because \`runner()\` is called on a destroyed context`);const e=a.run(()=>new olympe.sc.pg(d,
|
|
1032
|
+
b,this));null!==this.Za&&0<this.Za.size&&this.Za.forEach(({Nk:f,depth:g})=>{(-1===f.G||g<f.G)&&Gm(e,f,g+1)});return e}Mk(a,b){const c=Am(this,a);if(c)return b(c),()=>{};const d=Qm(this,'&'+a,e=>{let f;null==(f=d)||f();b(e)});return d}Na(a,b=!0){a='$'+xm(this,a);let c=this.data.get(a),d=this.getParent();if(b)for(;void 0===c&&null!==d;)c=d.data.get(a),d=d.getParent();return c}destroy(){this.C.od()||this.C.fb()||(Lm(this,olympe.sc.Za.nc.C.Ej),this.C.destroy(),Lm(this,olympe.sc.Za.nc.C.Qd))}dh(a,b){if(this.C.fb())a();
|
|
1033
|
+
else return Cm++,b=null!=b?b:String(Cm),null===this.Z&&(this.Z=new Map),this.Z.set(b,a),b;return b||'noId'}Kk(a){null!==this.Z&&this.Z.delete(a)}onDestroy(a){return this.fb()?(a(),'noId'):this.C.onDestroy(a)}clear(){if(!this.C.fb()){Lm(this,olympe.sc.Za.nc.C.yj);let a;null==(a=this.Z)||a.forEach(b=>b());Lm(this,olympe.sc.Za.nc.C.zj)}}fb(){return this.C.fb()}};olympe.sc.pg.prototype.getParent=olympe.sc.pg.prototype.getParent;olympe.sc.pg.C={Cl:'I#',Tl:'O#',OA:'IO#'};function Tm(a,b,c){return(c=c.Ye())?`${a}.${c}.${b}`:`${a}.${b}`}olympe.sc.Za.nc=class{constructor(a=-1){this.id=olympe.Y.Cf();this.active=!0;this.G=a}F(){this.active=!1}U(){return this.id}getType(){}process(){}};olympe.sc.Za.nc.C={INIT:'INIT',Ig:'SET',yj:'CLEAR',zj:'CLEARED',Ej:'DESTROY',Qd:'DESTROYED'};olympe.sc.Za.nc.F={sf:'REMOTE',ru:'LOCAL',Xf:'PROFILER'};olympe.sc.Sd=class a{constructor(){this.F=this.J=this.O=null;this.T=new Map;this.G=new Map;this.C=new olympe.Y.sm(1E4);Ya(this.C,b=>{Sm(b)})}aa(b,c,d){const e=b.body(),f=e.c,g=this.T.get(f);switch(e.t){case olympe.sc.Sd.C.Ru:c=this.G.get(e.f);b.qd(c).catch(l=>{d.error('Unable to reply with paths: ',l)});break;case olympe.sc.Sd.C.Su:const h=f+c,k=(l,n,p=0)=>{Rm(l,(q,r)=>{let t;q instanceof olympe.dc.CloudObject?t=a.G(q):t=q;let u;q=null!=(u=l.Ye())?u:'';0<q.length&&(q+='.');n.push([`${p}.${q}${r}`,
|
|
1034
|
+
t])})};b.cn(h).then(()=>{const l=[];k(g,l,0);Hm(g,p=>{k(p,l,1)});olympe.N.wb.publish(h,{t:olympe.sc.Sd.C.Jt,v:l,ts:0}).catch(p=>{d.error('Error publishing on service : ',p)});const n=new olympe.sc.Za.lv(h);Gm(g,n);this.C.has(g)?Xa(this.C,g):this.C.add(g)}).catch(l=>{d.error('Error notifying on a contextId : ',l)});break;case olympe.sc.Sd.C.Tu:void 0!==g&&this.C.has(g)&&Xa(this.C,g);break;case olympe.sc.Sd.C.Vf:void 0!==g&&(this.C.delete(g),Sm(g))}}ea(b,c,d){this.O=new olympe.N.wb('discovery_debug_id',
|
|
1035
|
+
c);this.O.listen().subscribe(e=>{var f=e.body();if(f.t===olympe.sc.Sd.C.it){e=f.i;f=f.f;if(!this.G.has(f)){const g=this.Z(f,c,b);if(0!==g.length)this.G.set(f,g);else return}null===this.F&&(this.F=olympe.Y.Cf(),f=new olympe.D.Xb(this.F,c.F()),this.J=new olympe.N.wb(this.F,f),this.J.listen().subscribe(g=>{this.aa(g,b,d)}));olympe.N.wb.publish(e,{t:olympe.sc.Sd.C.xs,n:olympe.W.getParameter(olympe.sc.V.po)||'no name',a:b,s:this.F}).catch(g=>{d.error('Error publishing on draw service : '+g)})}})}Z(b,c,
|
|
1036
|
+
d){const e=[],f=olympe.dc.ia(),g=(h,k)=>{Hm(h,l=>{if(null!==l.Ye()){const n=olympe.dc.CloudObject.get(l.Ye()).wk(olympe.sc.Runnable.J).md();if(null!==n){const p=k+'/'+f.name(n);n.X()===b&&(e.push([p,l.U()]),this.T.set(l.U(),l));g(l,p)}}})};g(c.C,f.name(d));return e}static F(b,c,d){let e=d;d instanceof olympe.dc.CloudObject&&(e=a.G(d));olympe.N.wb.publish(b,{t:olympe.sc.Sd.C.nk,k:c,v:e,ts:Date.now()}).catch(f=>{olympe.ka.ab('Debugger').error('Error publishing on service : ',f)})}static G(b){if(null===
|
|
1037
|
+
b||void 0===b)return'<null>';const c=olympe.dc.ia();if(b instanceof olympe.dc.CloudObject){var d=b.cc();if(!c.Rb(d,olympe.sc.yc))return b.toString();let f=`${b.Vb().name()} (${b.X()})`;var e=olympe.dc.CloudObject.get(d);d=olympe.dc.pa.from(e).eg(olympe.dc.CloudObject.extendRel,!0).ge().ib(olympe.dc.CloudObject.propertyRel).ge().md();e=olympe.dc.pa.from(e).eg(olympe.dc.CloudObject.extendRel,!0).ge().ib(olympe.dc.CloudObject.lj).ge().md();d=d.filter(([g])=>g instanceof olympe.sc.yc);0!==d.length&&(f+=
|
|
1038
|
+
'<br> ',f+='Properties:<br>',d.forEach(([,g])=>{f+=' ';f+=' - '+c.name(g)+' : '+c.Oa(b.X(),g)+'<br>'}));d=e.filter(([g])=>g instanceof olympe.sc.yc);0!==d.length&&(f+=' ',f+='Relations:<br>',d.forEach(([,g])=>{f+=' ';f+=' - '+c.name(g)+'<br>'}));return f}return b.toString()}};olympe.sc.Sd.J='discovery_debug_id';olympe.sc.Sd.C={it:0,xs:1,Ru:2,Su:3,Jt:4,nk:5,Tu:6,Vf:7};olympe.sc.Za.XA=class extends olympe.sc.Za.nc{constructor(a=-1){super(a);this.C=new Map}getType(){return olympe.sc.Za.nc.F.ru}process(a,b,c,...d){if(this.active&&b===olympe.sc.Za.nc.C.Ig){a=Tm(c,xm(a,d[0]),a);d=d[1];let e;null==(e=this.C.get(a))||e(d)}}on(a,b){this.C.set(a,b)}};function Um(a,b,c,d=new Map){for(var e=[];b;){const n=b.Ye();if(!n)break;e.push(n);b=b.getParent()}db(a.C,c,d.set('context',e));var f;let g;for(const n of[...e,null==(f=d)?void 0:f.get('propId'),null==(g=d)?void 0:g.get('type')])if(c=n,'string'===typeof c&&!a.J.has(c)){e=a;f=c;e.ia||(e.ia=olympe.dc.ia());d=e.ia.name(f);e=(f=e.ia.model(f))?e.ia.name(f):'';var [h,k,l]=[d,f,e];d=a.C;e=(new Map).set(c,h).set(k,l);c=(new Map).set(c,k);for(const [p,q]of e.entries())d.O.set(p,q);for(const [p,q]of c.entries())d.J.set(p,
|
|
1039
1039
|
q)}}
|
|
1040
|
-
olympe.sc.Za.av=class extends olympe.sc.Za.
|
|
1041
|
-
|
|
1042
|
-
const
|
|
1043
|
-
e,f)});this.C.set(e,()=>{
|
|
1044
|
-
olympe.sc.hd.prototype.C.L=new olympe.D.K(()=>olympe.dc.za,[]);olympe.sc.hd.prototype.F.L=new olympe.D.K(()=>olympe.dc.za,[]);function
|
|
1045
|
-
olympe.sc.Va=class extends olympe.dm.BrickMetadata{gu(a,b,c,d,e=!0){e||olympe.ka.ab('sc').error('parameter own= false ignored, investigate');return olympe.D.eh(L(this.Hf(a,olympe.dc.nb.Zi,c)),d)}Nx(){return this.
|
|
1046
|
-
olympe.sc.logic.Bb)}G(){return[olympe.sc.Va.
|
|
1047
|
-
olympe.sc.Va.F=olympe.sc.Va.P.sa('01621fb84e320000f00b');olympe.sc.Va.Cc=olympe.sc.Va.P.sa('0171838bcfed0000e00e');olympe.sc.Va.
|
|
1048
|
-
function
|
|
1049
|
-
function
|
|
1050
|
-
function
|
|
1051
|
-
function
|
|
1052
|
-
olympe.sc.Runnable=class extends olympe.dm.BrickMetadata{constructor(a,b,c){super(a,b);this.H=c}run(a){a.F().run(()=>{
|
|
1053
|
-
|
|
1054
|
-
this.vd();return
|
|
1055
|
-
this.Hr(d,g=>{var h=g.X();if(h=c.Kb(h,e)||c.Kb(h,f))return
|
|
1056
|
-
T(olympe.sc.Va.P,olympe.sc.Runnable.J);T(olympe.sc.Va.P,olympe.sc.Runnable.C);olympe.sc.Runnable.prototype.vd.L=new olympe.D.K(()=>olympe.sc.Va,[]);olympe.sc.Runnable.prototype.J.L=new olympe.D.K(()=>Object,[]);olympe.sc.Runnable.prototype.hb.L=olympe.D.K.C;function
|
|
1057
|
-
olympe.sc.Kd.C=olympe.sc.Kd.P.sa('0169b5a8a33144fb0b49');T(olympe.dc.CloudObject.P,olympe.sc.Kd.C);olympe.sc.Kd.prototype.F.L=new olympe.D.K(()=>String,[]);olympe.sc.Kd.prototype.C.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);olympe.sc.
|
|
1058
|
-
function
|
|
1059
|
-
else olympe.ka.ab('sc').info(`No business container for application ${a}. You probably miss permissions.`),e(olympe.sc.Wc.Hb.Ei)}).catch(f=>{olympe.ka.ab('sc').error('Error while loading business container:',f.message);e(olympe.sc.Wc.Hb.xb)})}olympe.sc.Wc=class extends olympe.dc.CloudObject{};olympe.sc.Wc.Hb={Ap:0,Ei:1,xb:2};olympe.sc.Wc.P=olympe.dc.na.C('017b3aa8fae1e3d044dc',olympe.sc.Wc);olympe.sc.Wc.C=olympe.sc.Wc.P.sa('017b3aa8fd1659291b92');olympe.sc.Wc.F=olympe.sc.Wc.P.sa('017b3aa8fe7ec3fd52f2');olympe.sc.Map=class extends olympe.dc.CloudObject{};olympe.sc.Map.P=olympe.dc.na.C('018119241abce0e5696e',olympe.sc.Map);olympe.sc.yg=class extends olympe.sc.Map{};olympe.sc.yg.P=olympe.dc.na.C('01631aacd8276ea98490',olympe.sc.yg);olympe.sc.File=class extends olympe.dm.File{static Aw(a,b,c,d,e,f){e=a.create(olympe.sc.File,new Map,e,f);olympe.sc.File.ns(a,e,b,c,d);return e}static Bw(a,b,c,d,e,f){e=a.create(olympe.sc.File,new Map,e,f);olympe.sc.File.
|
|
1060
|
-
h=new Date;c=(new Map).set(olympe.dm.File.fileNameProp,null!=c?c:'file').set(olympe.dm.File.urlProp,d).set(olympe.dm.File.modificationDateProp,h).set(olympe.dm.File.mimeTypeProp,null!=e?e:'application/data');g&&null!==f.Oa(b,olympe.dm.File.urlProp)||c.set(olympe.dm.File.creationDateProp,h).set(olympe.dm.File.C,!1);a.gs(b,c)}};olympe.sc.File.setURLContent=olympe.sc.File.
|
|
1061
|
-
olympe.sc.File.P=
|
|
1062
|
-
olympe.sc.Hc.P.C=(a,b,c,d)=>{c=olympe.sc.File.F(olympe.sc.Hc,a,b,c,d);a.update(c,olympe.sc.Hc.fontFamilyProp,b.split('.')[0]);return c};olympe.sc.Hc.prototype.J.L=olympe.D.K.F;olympe.sc.Hc.prototype.O.L=olympe.D.K.F;olympe.sc.Hc.prototype.T.L=olympe.D.K.G;olympe.sc.Jh=class extends olympe.sc.File{};olympe.sc.Jh.P=
|
|
1063
|
-
olympe.sc.logic.WA=(a,b,c,d,e,f,g)=>{const h=b.X();b=olympe.D.Na(b.getType().X());let k,l;if(b===olympe.dc.ga(olympe.dm.String))k=c.valueOf().toLowerCase(),l=p=>p.zb(h).toLowerCase();else if(b===olympe.dc.ga(olympe.dm.Number))k=c.valueOf(),l=p=>p.nd(h);else if(b===olympe.dc.ga(olympe.dm.DateTime))k=c.getTime(),l=p=>olympe.D.
|
|
1064
|
-
return}let n;if('<'===f)n=(p,q)=>olympe.sc.logic
|
|
1065
|
-
olympe.sc.logic.FD=(a,b)=>{if(a instanceof olympe.D.ba)return a;if(a instanceof olympe.D.Qa)return a.rs();if(a instanceof olympe.D.fa)return a.Tr();if('string'===typeof a||'number'===typeof a)return olympe.D.ra(Number(a));b.error(`Could not parse provided value ${a} into a number`);return olympe.D.ba.Jp};olympe.sc.logic.Pa={};function
|
|
1066
|
-
olympe.sc.logic.na=class{constructor(){}static C(a,b,...c){if(
|
|
1067
|
-
olympe.sc.logic.Error.prototype.getCode=olympe.sc.logic.Error.prototype.Ir;olympe.sc.logic.Error.prototype.getMessage=olympe.sc.logic.Error.prototype.Bx;olympe.sc.logic.Error.create=olympe.sc.logic.Error.create;olympe.sc.logic.ri=class extends olympe.sc.logic.
|
|
1068
|
-
c=>this.db.model(c)===olympe.dc.ga(a));return b?olympe.dc.CloudObject.get(b):null}};olympe.sc.logic.sd.P=
|
|
1069
|
-
olympe.sc.logic.Pf.prototype.O.L=new olympe.D.K(()=>olympe.sc.logic.Bb,[]);olympe.sc.logic.Pf.prototype.T.L=olympe.D.K.O;olympe.sc.logic.
|
|
1040
|
+
olympe.sc.Za.av=class extends olympe.sc.Za.nc{constructor(a){super();this.C=a;this.ia=olympe.dc.ia();this.J=new Set}getType(){return olympe.sc.Za.nc.F.Xf}process(a,b,c,...d){var e=Vm.Cl,f=Vm.Tl,g=Vm.Vu;const h=Vm.INIT,k=Vm.yj,l=Vm.zj,n=Vm.Ej,p=Vm.Qd;c=Vm.Ou;if(b===olympe.sc.Za.nc.C.Ig){const [q,r]=d;b=(d=a.Ye())?olympe.dc.ia().Rb(d,olympe.sc.logic.Function):!1;d=d?olympe.dc.ia().Rb(d,olympe.sc.ui.LB):!1;b?(g=this.ia.Kb(q,olympe.dm.Property.typeRel),b=this.ia.Rb(q,olympe.sc.logic.ub),d=this.ia.Rb(q,olympe.sc.logic.Bb),
|
|
1041
|
+
Um(this,a,b?e:d?f:c,new Map([['propId',q],['value',r],['type',g]]))):d&&(e=this.ia.Rb(q,olympe.dm.Property),f=this.ia.Kb(q,olympe.dm.Property.typeRel),Um(this,a,e?g:c,new Map([['propId',q],['value',r],['type',f]])))}else b===olympe.sc.Za.nc.C.INIT?Um(this,a,h):b===olympe.sc.Za.nc.C.yj?Um(this,a,k):b===olympe.sc.Za.nc.C.zj?Um(this,a,l):b===olympe.sc.Za.nc.C.Ej?Um(this,a,n):b===olympe.sc.Za.nc.C.Qd&&Um(this,a,p)}};
|
|
1042
|
+
const Vm={Cl:'input',Tl:'output',Vu:'prop',INIT:'init',yj:'clear',zj:'cleared',Ej:'destroy',Qd:'destroyed',Ou:'other'};olympe.sc.Za.lv=class extends olympe.sc.Za.nc{constructor(a){super(1);this.J=a;this.C=new Map;this.db=olympe.dc.ia()}getType(){return olympe.sc.Za.nc.F.sf}F(){super.F();for(const a of this.C.values())a();this.C.clear()}process(a,b,c,...d){if(this.active&&b===olympe.sc.Za.nc.C.Ig&&void 0!==d[0]&&null!==d[0]){const e=Tm(c,xm(a,d[0]),a),f=d[1];let g;null==(g=this.C.get(e))||g();this.C.delete(e);if(f instanceof olympe.dc.CloudObject&&f.Vb()instanceof olympe.sc.yc){const h=Dg(this.db,f,()=>{olympe.sc.Sd.F(this.J,
|
|
1043
|
+
e,f)});this.C.set(e,()=>{Eg(this.db,f,h)})}olympe.sc.Sd.F(this.J,e,f)}}};olympe.sc.Metadata=class extends olympe.dc.CloudObject{du(){return this.nd(this.Vm())}eu(){return this.nd(this.Wm())}Bk(){return new olympe.D.$b(this.nd(this.Vm()),this.nd(this.Wm()))}Vm(){}Wm(){}};olympe.sc.Metadata.P=olympe.dc.na.C('0161ae936c62f9fcd131',olympe.sc.Metadata);m=olympe.sc.Metadata.prototype;m.du.L=olympe.D.K.G;m.eu.L=olympe.D.K.G;m.Bk.L=olympe.D.K.T;m.Vm.L=olympe.D.K.C;m.Wm.L=olympe.D.K.C;olympe.sc.Xc=class extends olympe.dc.CloudObject{F(){return this.zb(olympe.sc.Xc.G)}C(){return this.zb(olympe.sc.Xc.C)}};olympe.sc.Xc.P=olympe.dc.na.C('01703376c4a81c0e9d90',olympe.sc.Xc);olympe.sc.Xc.G=olympe.sc.Xc.P.la('01703376c4a81c0e9d91');olympe.sc.Xc.C=olympe.sc.Xc.P.la('01703376c4a81c0e9d92');olympe.sc.Xc.F=olympe.sc.Xc.P.sa('01703376c4a81c0e9d93');T(olympe.dc.CloudObject.P,olympe.sc.Xc.F);olympe.sc.Xc.prototype.F.L=olympe.D.K.F;olympe.sc.Xc.prototype.C.L=olympe.D.K.F;olympe.sc.pe={};olympe.sc.pe.De={st:'folders',pv:'screenflow',Qv:'ui-design',Qq:'software-intelligence',ih:'data-management',zB:'projects'};olympe.sc.tf=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}xd(){return this.nd(olympe.sc.tf.F)}};olympe.sc.tf.P=olympe.dc.na.C('019131fb930466a1ad79',olympe.sc.tf);olympe.sc.tf.F=olympe.sc.tf.P.la('016d1bb681929c2cc3f1');olympe.sc.tf.C=olympe.sc.tf.P.sa('019131fb930466a1ad7a');T(olympe.dc.CloudObject.P,olympe.sc.tf.C);olympe.sc.tf.prototype.xd.L=olympe.D.K.G;olympe.sc.hd=class extends olympe.dm.BrickMetadata{ne(){return olympe.sc.pe.De.Qq}C(){return this.bb(olympe.sc.hd.C,olympe.sc.logic.Ch)}F(){return this.bb(olympe.sc.hd.F,olympe.sc.logic.Ag)}};olympe.sc.hd.P=olympe.dc.na.C('011100000000000adef0',olympe.sc.hd);olympe.sc.hd.C=olympe.sc.hd.P.sa('016ac4f59a2917fdef01');olympe.sc.hd.F=olympe.sc.hd.P.sa('016ac4f59a2917fdef02');olympe.sc.hd.P.C=(a,b)=>jl(a,b||'New function signature',olympe.sc.hd,olympe.sc.logic.sd).X();
|
|
1044
|
+
olympe.sc.hd.prototype.C.L=new olympe.D.K(()=>olympe.dc.za,[]);olympe.sc.hd.prototype.F.L=new olympe.D.K(()=>olympe.dc.za,[]);function Wm(a,b){[].forEach(c=>c.call(a,b,(d,e)=>{null===e?b.remove(d):b.set(d,e)}))}function Xm(a,b){b=b.filter(c=>'string'===typeof c&&a.db.Rb(c,olympe.sc.logic.Tb));b.sort((c,d)=>{let e;c=null!=(e=a.db.Oa(c,olympe.sc.logic.Tb.C,!0))?e:0;let f;d=null!=(f=a.db.Oa(d,olympe.sc.logic.Tb.C,!0))?f:0;return c-d});return b}
|
|
1045
|
+
olympe.sc.Va=class extends olympe.dm.BrickMetadata{gu(a,b,c,d,e=!0){e||olympe.ka.ab('sc').error('parameter own= false ignored, investigate');return olympe.D.eh(L(this.Hf(a,olympe.dc.nb.Zi,c)),d)}Nx(){return this.bb(olympe.sc.Va.O,olympe.sc.Runnable)}bx(){return this.bb(olympe.sc.Va.T,olympe.sc.Runnable)}bn(){return this.db.Oa(this,olympe.sc.Va.aa)}Zm(){return null!==this.db.Kb(this.tag,olympe.sc.Runnable.C.bc())}fu(){return this.bb(olympe.sc.Va.G,olympe.sc.logic.ub)}wp(){return this.bb(olympe.sc.Va.F,
|
|
1046
|
+
olympe.sc.logic.Bb)}G(){return[olympe.sc.Va.eb]}};olympe.sc.Va.P=olympe.dc.na.C('0112000000000000def0',olympe.sc.Va);olympe.sc.Va.aa=olympe.sc.Va.P.la('01692aa71f3108454479');olympe.sc.Va.hb=olympe.sc.Va.P.la('0166446c1f128ebc903a');olympe.sc.Va.eb=olympe.sc.Va.P.la('0166446c1f128ebc904e');olympe.sc.Va.O=olympe.sc.Va.P.sa('01692a4af82e8984742c');olympe.sc.Va.T=olympe.sc.Va.P.sa('01692a4af82e8984742d');olympe.sc.Va.Z=olympe.sc.Va.P.sa('01692a4af82e8984742e');olympe.sc.Va.G=olympe.sc.Va.P.sa('01621fb84e320000f00a');
|
|
1047
|
+
olympe.sc.Va.F=olympe.sc.Va.P.sa('01621fb84e320000f00b');olympe.sc.Va.Cc=olympe.sc.Va.P.sa('0171838bcfed0000e00e');olympe.sc.Va.oc=olympe.sc.Va.P.sa('0171838bcfed0000a00a');m=olympe.sc.Va.prototype;m.gu.L=olympe.D.K.C;m.Nx.L=new olympe.D.K(()=>olympe.dc.za,[]);m.bx.L=new olympe.D.K(()=>olympe.dc.za,[]);m.bn.L=olympe.D.K.C;m.Zm.L=olympe.D.K.C;m.fu.L=new olympe.D.K(()=>olympe.dc.za,[]);m.wp.L=new olympe.D.K(()=>olympe.dc.za,[]);function Dm(a){let b;return null!=(b=a.vd().G().map(olympe.dc.ga)[0])?b:null}function Ym(a){const b=new olympe.dc.Xa;a=b.create(a);b.persist(a,!1);b.ob((d,e)=>{d||olympe.ka.ab('sc').error(`Error occurred for transaction executed by createLocalRunnable: ${e}`)});const c=olympe.dc.CloudObject.get(a);olympe.D.Wa().onDestroy(()=>{const d=new olympe.dc.Xa;d.delete(c);d.ob()});return c}
|
|
1048
|
+
function Zm(a,b){Mm(b.C,a);Wm(a.vd(),b);const c=a.O(),d=$m(b,c),e=[];c.forEach((f,g)=>{f===a.ea?e[0]=g:f===a.aa&&(e[1]=g)});void 0!==e[0]&&void 0!==e[1]&&(an(a,b,d[e[0]],d[e[1]]),c[e[0]]=null,c[e[1]]=null);c.forEach((f,g)=>{f&&f.call(a,b,d[g])})}
|
|
1049
|
+
function bn(a,b){var c=a.cc();const d=a.db.name(c),e=`Brick ${d} successfully run`,f=`Brick ${d} successfully cleared`,g=a.C(b);c=a.setupExecution(b).pipe(rxjs.operators.map(h=>{if(!b.fb()&&(b.clear(),null!==h)){const k=Array.isArray(h)?h:[h],l=new olympe.sc.hr(b.C);l.F().run(()=>v(function*(){try{yield a.update(l,k,g)}catch(n){l.throw(n)}}));return!0}return!1})).subscribe(rxjs.Subscriber.create(h=>h?a.H.debug(e):a.H.debug(f),h=>b.throw(h),()=>a.H.debug(`Brick ${d} completed`)));b.onDestroy(c.unsubscribe.bind(c))}
|
|
1050
|
+
function cn(a,b,c,d){const e=V(a.db,b,c,(f,g)=>{const h=um(d,g);f?olympe.dc.CloudObject.get(g).run(h):h.destroy()});d.F().onDestroy(a.db.F.bind(a.db,b,c,e,!0))}function $m(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)}})}
|
|
1051
|
+
function an(a,b,c,d){b=b.F();const e=Dg(a.db,a.tag,b.G((f,g,h)=>{const k=h?d:c;null!==k&&(k(f,olympe.dc.nb.Ac(g)),h&&c!==k&&(null==c||c(f,null)))}));b.onDestroy(()=>{Eg(a.db,a.tag,e)})}
|
|
1052
|
+
olympe.sc.Runnable=class extends olympe.dm.BrickMetadata{constructor(a,b,c){super(a,b);this.H=c}run(a){a.F().run(()=>{Zm(this,a);this.init(a);a.dh(this.clear.bind(this,a));a.onDestroy(this.destroy.bind(this,a));if(this.vd().bn())bn(this,a);else{const b=new olympe.sc.hr(a.C);this.update(b,[],[])}this.F(a)})}vd(){return this.Vb()}init(a){this.onInit(a)}update(a,b,c){const d=this.vd();if(d.bn())this.onUpdate(a,b,c);else this.H.debug(`Softcoded runnable ${this.db.name(this)} with tag ${this.tag} running in context ${a.U()}`),
|
|
1053
|
+
cn(this,d,olympe.sc.Va.O,a),this.ja()&&cn(this,d,olympe.sc.Va.Z,a)}F(a){a.rn(olympe.sc.Va.hb)}clear(){}destroy(a){this.onDestroy(a)}setupExecution(){return rxjs.of([])}C(){return[]}onInit(){}onUpdate(){const a=this.cc(),b=this.db.name(a),c=this.db.name(this.db.model(a));this.H.error(`No code was found for ${b} (${c}: ${a})\n\n`+'This is probably because the code has not yet been deployed to the environment, or because the package.json does not import the required dependencies.')}onDestroy(){}getInputs(){var a=
|
|
1054
|
+
this.vd();return Xm(a,a.db.bb(a.tag,olympe.sc.Va.G))}getOutputs(){var a=this.vd();return Xm(a,a.db.bb(a.tag,olympe.sc.Va.F))}G(){return[]}T(){return new Map}ja(){return!1}J(a,b,c,d){a=b.sb(a,c,!0);void 0!==d&&olympe.D.eh(a,d);return a}hb(a,b,c,d,e){olympe.D.en([d],f=>{b.set(a,olympe.D.Yr(f)?f.valueOf():f)});return this.J(a,b,c,e)}O(){return[this.ea,this.aa]}ea(a,b){an(this,a,b,null)}aa(a,b){an(this,a,null,b)}yb(a,b){const c=this.db,d=olympe.sc.logic.qb.G.bc(),e=olympe.sc.logic.qb.F,f=olympe.sc.logic.qb.C;
|
|
1055
|
+
this.Hr(d,g=>{var h=g.X();if(h=c.Kb(h,e)||c.Kb(h,f))return dn(g,a,b.bind(null,h))})}};olympe.sc.Runnable.P=Gf(olympe.dc.na.C('01130000000000ca1100',olympe.sc.Runnable));olympe.sc.Runnable.J=olympe.sc.Runnable.P.sa('01692a4af82e8984742b');olympe.sc.Runnable.C=olympe.sc.Runnable.P.sa('01756a18d4921c103111');olympe.sc.Runnable.O=T(olympe.sc.Runnable.P,olympe.sc.Va.O);olympe.sc.Runnable.T=T(olympe.sc.Runnable.P,olympe.sc.Va.T);olympe.sc.Runnable.Z=T(olympe.sc.Runnable.P,olympe.sc.Va.Z);
|
|
1056
|
+
T(olympe.sc.Va.P,olympe.sc.Runnable.J);T(olympe.sc.Va.P,olympe.sc.Runnable.C);olympe.sc.Runnable.prototype.vd.L=new olympe.D.K(()=>olympe.sc.Va,[]);olympe.sc.Runnable.prototype.J.L=new olympe.D.K(()=>Object,[]);olympe.sc.Runnable.prototype.hb.L=olympe.D.K.C;function en(a){if(a){if('string'===typeof a)return a;if(a instanceof olympe.sc.Kd)return(a=a.F())?a.valueOf():null;if('function'===typeof a.X)return a.X()}return null}olympe.sc.Kd=class extends olympe.dc.CloudObject{F(){return this.db.bb(this,olympe.sc.Kd.C)[0]}C(){const a=en(this);return olympe.dc.CloudObject.get(a)}Ac(){return this.C().Ac()}toString(){const a=en(this);let b;a&&(b=this.db.name(a));return b||super.toString()}};olympe.sc.Kd.P=olympe.dc.na.C('0163c9ae01f2d6e9ca49',olympe.sc.Kd);
|
|
1057
|
+
olympe.sc.Kd.C=olympe.sc.Kd.P.sa('0169b5a8a33144fb0b49');T(olympe.dc.CloudObject.P,olympe.sc.Kd.C);olympe.sc.Kd.prototype.F.L=new olympe.D.K(()=>String,[]);olympe.sc.Kd.prototype.C.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);olympe.sc.vo=class extends olympe.dm.Lb{ne(){return olympe.sc.pe.De.ih}};olympe.sc.vo.P=olympe.dc.na.C('0163a68ce44f3d1fa84c',olympe.sc.vo);olympe.sc.yc=class extends olympe.dm.BrickMetadata{};olympe.sc.yc.P=olympe.dc.na.C('016324fde11a836f76c2',olympe.sc.yc);olympe.sc.yc.C=olympe.sc.yc.P.sa('016324fde11a836087c2');olympe.sc.yc.P.C=function(a,b){return jl(a,null!=b?b:'New type',olympe.sc.yc).X()};let fn=null,gn=null;
|
|
1058
|
+
function hn(a,b,c){fn=a;const d=olympe.D.Wa(),e=d.G(c);olympe.dc.gd.from(a).ib(olympe.sc.qa.Rc.C).ib(olympe.sc.Wc.C.bc()).ob({Qh:'__code-as-data__'}).then(f=>{gn=f;if(null!==f)if(b){var g=olympe.dc.ia();Ph(d,f,h=>{h=g.ai(h)?h:g.model(h);return null!==h&&g.Rb(h,olympe.sc.yc)},{nn:!0}).subscribe(rxjs.Subscriber.create(()=>{e(olympe.sc.Wc.Hb.Ap)},()=>{olympe.ka.ab('sc').error('Impossible to load the business container for the application',a,'maybe are you offline?');e(olympe.sc.Wc.Hb.Ei)}))}else olympe.ka.ab('sc').info("Found business container but won't load it's content according to configuration."),e(olympe.sc.Wc.Hb.Ei);
|
|
1059
|
+
else olympe.ka.ab('sc').info(`No business container for application ${a}. You probably miss permissions.`),e(olympe.sc.Wc.Hb.Ei)}).catch(f=>{olympe.ka.ab('sc').error('Error while loading business container:',f.message);e(olympe.sc.Wc.Hb.xb)})}olympe.sc.Wc=class extends olympe.dc.CloudObject{};olympe.sc.Wc.Hb={Ap:0,Ei:1,xb:2};olympe.sc.Wc.P=olympe.dc.na.C('017b3aa8fae1e3d044dc',olympe.sc.Wc);olympe.sc.Wc.C=olympe.sc.Wc.P.sa('017b3aa8fd1659291b92');olympe.sc.Wc.F=olympe.sc.Wc.P.sa('017b3aa8fe7ec3fd52f2');olympe.sc.Map=class extends olympe.dc.CloudObject{};olympe.sc.Map.P=olympe.dc.na.C('018119241abce0e5696e',olympe.sc.Map);olympe.sc.yg=class extends olympe.sc.Map{};olympe.sc.yg.P=olympe.dc.na.C('01631aacd8276ea98490',olympe.sc.yg);olympe.sc.File=class extends olympe.dm.File{static Aw(a,b,c,d,e,f){e=a.create(olympe.sc.File,new Map,e,f);olympe.sc.File.ns(a,e,b,c,d);return e}static Bw(a,b,c,d,e,f){e=a.create(olympe.sc.File,new Map,e,f);olympe.sc.File.mn(a,e,b,c,d);return e}static ns(a,b,c,d,e){e=null!=e?e:'application/data';d=URL.createObjectURL(new Blob([d],{type:e}));olympe.sc.File.mn(a,b,c,d,e)}static mn(a,b,c,d,e){const f=olympe.dc.ia(),g=f.Ha(b);var h;const k=null!=(h=a.model(b))?h:olympe.sc.File;if(null===k||!f.If(k,olympe.dm.File))throw Error(`Try to set the content of an object which is not a file: ${b}`);
|
|
1060
|
+
h=new Date;c=(new Map).set(olympe.dm.File.fileNameProp,null!=c?c:'file').set(olympe.dm.File.urlProp,d).set(olympe.dm.File.modificationDateProp,h).set(olympe.dm.File.mimeTypeProp,null!=e?e:'application/data');g&&null!==f.Oa(b,olympe.dm.File.urlProp)||c.set(olympe.dm.File.creationDateProp,h).set(olympe.dm.File.C,!1);a.gs(b,c)}};olympe.sc.File.setURLContent=olympe.sc.File.mn;olympe.sc.File.setContent=olympe.sc.File.ns;olympe.sc.File.createFromURL=olympe.sc.File.Bw;olympe.sc.File.createFromContent=olympe.sc.File.Aw;
|
|
1061
|
+
olympe.sc.File.P=Af(olympe.dm.File,'ff021000000000000031',olympe.sc.File);olympe.sc.ug=class extends olympe.sc.File{J(){const a=olympe.D.ec(olympe.D.Qa);this.zk(b=>{a.update(olympe.D.Ab(b))});return a.sb()}};olympe.sc.ug.P=Af(olympe.sc.File,'01644b6297305d62fca2',olympe.sc.ug);olympe.sc.ug.P.C=olympe.sc.File.F.bind(null,olympe.sc.ug);olympe.sc.ug.prototype.J.L=olympe.D.K.F;olympe.sc.Hc=class extends olympe.sc.File{J(){return this.zb(olympe.sc.Hc.fontFamilyProp)}O(){return this.zb(olympe.sc.Hc.G)}T(){return this.nd(olympe.sc.Hc.J)}};olympe.sc.Hc.P=Af(olympe.sc.File,'01647e113043c637b541',olympe.sc.Hc);olympe.sc.Hc.fontFamilyProp=olympe.sc.Hc.P.la('01647e35ecd24ef0b88d');olympe.sc.Hc.G=olympe.sc.Hc.P.la('01647e677f5d1cfbdf42');olympe.sc.Hc.J=olympe.sc.Hc.P.la('01647e6780999bf8bd25');
|
|
1062
|
+
olympe.sc.Hc.P.C=(a,b,c,d)=>{c=olympe.sc.File.F(olympe.sc.Hc,a,b,c,d);a.update(c,olympe.sc.Hc.fontFamilyProp,b.split('.')[0]);return c};olympe.sc.Hc.prototype.J.L=olympe.D.K.F;olympe.sc.Hc.prototype.O.L=olympe.D.K.F;olympe.sc.Hc.prototype.T.L=olympe.D.K.G;olympe.sc.Jh=class extends olympe.sc.File{};olympe.sc.Jh.P=Af(olympe.sc.File,'0164643c432146a71d5c',olympe.sc.Jh);olympe.sc.Jh.P.C=olympe.sc.File.F.bind(null,olympe.sc.Jh);olympe.sc.jr=class extends olympe.dc.CloudObject{};olympe.sc.jr.P=olympe.dc.na.C('016421bb3797e22d1c4e',olympe.sc.jr);olympe.sc.logic={};olympe.sc.logic.$o=(a,b)=>a===b?0:a>b?1:-1;
|
|
1063
|
+
olympe.sc.logic.WA=(a,b,c,d,e,f,g)=>{const h=b.X();b=olympe.D.Na(b.getType().X());let k,l;if(b===olympe.dc.ga(olympe.dm.String))k=c.valueOf().toLowerCase(),l=p=>p.zb(h).toLowerCase();else if(b===olympe.dc.ga(olympe.dm.Number))k=c.valueOf(),l=p=>p.nd(h);else if(b===olympe.dc.ga(olympe.dm.DateTime))k=c.getTime(),l=p=>olympe.D.ua([p.gj(h)],q=>q.getTime(),Number,'FilterList Date&DateTime TransformFlows');else{c=olympe.dc.ia().name(b);g.warn(`Properties of type ${c} are not supported. List will not be filtered.`);e(a);
|
|
1064
|
+
return}let n;if('<'===f)n=(p,q)=>olympe.sc.logic.$o(q,p);else if('>'===f)n=(p,q)=>olympe.sc.logic.$o(p,q);else{g.error(`Unknown inequality ${f}. Please use '<' or '>'`);return}e(a.tk().filter(p=>olympe.D.ua([l(p)],q=>{q=n(q.valueOf(),k);return olympe.D.Sb(d.valueOf()?1===q:0<=q)},olympe.D.fa,'FilterList ListDefBuilder Filter TransformFlows')).Bi())};
|
|
1065
|
+
olympe.sc.logic.FD=(a,b)=>{if(a instanceof olympe.D.ba)return a;if(a instanceof olympe.D.Qa)return a.rs();if(a instanceof olympe.D.fa)return a.Tr();if('string'===typeof a||'number'===typeof a)return olympe.D.ra(Number(a));b.error(`Could not parse provided value ${a} into a number`);return olympe.D.ba.Jp};olympe.sc.logic.Pa={};function jn(a){Ff(a.P,(b,c)=>{b=b.create(a.P.F);Z(b,olympe.dc.CloudObject.nameProp,c);return b.X()})}olympe.sc.logic.Pa.Po=class{constructor(a,b,c){this.P=olympe.dc.na.C(a,b,...c);jn(this)}X(){return this.P.X()}};olympe.sc.logic.Pa.Po.ya=[olympe.dc.Ne];const kn=Object.create(null),ln=new Map;function mn(a){if(void 0===kn[a])throw Error(`Tag: ${a} - does not correspond to a registered function`);return Cf(a)}function nn(a,b,c=olympe.sc.logic.Function){if(ln.has(a))throw c=mn(a),Error(`Tag: ${a} - overwriting existing function definition "${c.name}" with "${b.name}"`);const d=olympe.dc.na.C(a,b,...[]);ln.set(a,{P:d,WD:b,CD:c});return d}
|
|
1066
|
+
olympe.sc.logic.na=class{constructor(){}static C(a,b,...c){if(kn[a])throw c=mn(a),Error(`Tag: ${a} - overwriting already defined function "${c.name}" with "${b.name}"`);b=new olympe.sc.logic.Pa.Po(a,b,[olympe.sc.R.Ca].concat(c));return kn[a]=b}};olympe.sc.logic.Kz=class{};olympe.sc.logic.Cj=class extends olympe.dc.CloudObject{};olympe.sc.logic.Cj.P=olympe.dc.na.C('01621fb84e320000cf00',olympe.sc.logic.Cj);function ym(a,b,c){return new olympe.sc.logic.Error(a,b,c)}olympe.sc.logic.Error=class extends Error{constructor(a,b,c){super(a);this.code=b;this.C=null!=c?c:null}static create(a,b){return new olympe.sc.logic.Error(a,b)}Bx(){return this.message}Ir(){return this.code}ke(){let a;return null!=(a=this.C)?a:''}toString(){return`${this.message}\nError found in:\n${this.ke()}\n\n${this.stack}`}};olympe.sc.logic.Error.prototype.getStack=olympe.sc.logic.Error.prototype.ke;
|
|
1067
|
+
olympe.sc.logic.Error.prototype.getCode=olympe.sc.logic.Error.prototype.Ir;olympe.sc.logic.Error.prototype.getMessage=olympe.sc.logic.Error.prototype.Bx;olympe.sc.logic.Error.create=olympe.sc.logic.Error.create;olympe.sc.logic.ri=class extends olympe.sc.logic.Cj{};olympe.sc.logic.ri.P=olympe.dc.na.C('016eeb5ede9f3094d8f0',olympe.sc.logic.ri);olympe.sc.logic.ed=class extends olympe.dc.CloudObject{C(){return this.pc(olympe.sc.logic.ed.C,olympe.dc.CloudObject)}};olympe.sc.logic.ed.P=olympe.dc.na.C('016ac4f59ee8ea2081ba',olympe.sc.logic.ed);olympe.sc.logic.ed.F=olympe.sc.logic.ed.P.la('017bc044aeacce7ffc8f');olympe.sc.logic.ed.C=olympe.sc.logic.ed.P.sa('016ac4f5a0091c4790e2');T(olympe.dc.CloudObject.P,olympe.sc.logic.ed.C);olympe.sc.logic.ed.prototype.C.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.Ch=class extends olympe.sc.logic.ed{};olympe.sc.logic.Ch.P=olympe.dc.na.C('016ac4f59c592b862457',olympe.sc.logic.Ch);olympe.sc.logic.Ch.G=olympe.sc.hd.C.bc();olympe.sc.logic.Ch.P.C=(a,b,c,d,e)=>{b=jl(a,b||'New Predefined Input',olympe.sc.logic.Ch,olympe.sc.logic.ub);Z(b,olympe.sc.logic.ed.F,e);a.Ma(olympe.sc.logic.ed.C,b,c);a.Ma(olympe.sc.hd.C,d,b);return b.X()};olympe.sc.logic.Ag=class extends olympe.sc.logic.ed{};olympe.sc.logic.Ag.P=olympe.dc.na.C('016ac4f59dd99f5df3e1',olympe.sc.logic.Ag);olympe.sc.logic.Ag.G=T(olympe.sc.logic.Ag.P,olympe.sc.hd.F);olympe.sc.logic.Ag.P.C=(a,b,c,d,e)=>{b=jl(a,b||'New Predefined Output',olympe.sc.logic.Ag,olympe.sc.logic.Bb);Z(b,olympe.sc.logic.ed.F,e);a.Ma(olympe.sc.logic.ed.C,b,c);a.Ma(olympe.sc.hd.F,d,b);return b.X()};olympe.sc.logic.sd=class extends olympe.sc.Va{ne(){return olympe.sc.pe.De.Qq}Z(){return this.Qm().tk().Rb([olympe.sc.logic.Function]).and().pd().Rb([olympe.sc.logic.cd,olympe.sc.logic.dd]).Bi()}G(){const a=olympe.dc.ga(olympe.sc.logic.ri);return this.db.bb(this,olympe.sc.logic.sd.F).filter(b=>this.db.Kb(b,olympe.sc.logic.Tb.typeRel)===a)}C(a){const b=this.db.Nm(this,[olympe.sc.Va.G],c=>this.db.model(c)===olympe.dc.ga(a));return b?olympe.dc.CloudObject.get(b):null}F(a){const b=this.db.Nm(this,[olympe.sc.Va.F],
|
|
1068
|
+
c=>this.db.model(c)===olympe.dc.ga(a));return b?olympe.dc.CloudObject.get(b):null}};olympe.sc.logic.sd.P=nn('01621fb84e320000f000',olympe.sc.logic.sd,olympe.sc.logic.Function);olympe.sc.logic.sd.prototype.C.L=new olympe.D.K(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.sd.prototype.F.L=new olympe.D.K(()=>olympe.sc.logic.Bb,[]);olympe.sc.logic.Pf=class extends olympe.sc.logic.sd{J(){return this.C('016ac63229782039429f')}O(){return this.F('016ac6322acf67eebfe7')}T(){return this.wp().tk().ib(olympe.sc.logic.Tb.typeRel).Fk(olympe.sc.logic.ri).Bi().mf().$m(olympe.D.ba.ZERO)}};olympe.sc.logic.Pf.C='016ac63229782039429f';olympe.sc.logic.Pf.J='016ac6322acf67eebfe7';olympe.sc.logic.Pf.P=nn('01621fb84e320000a000',olympe.sc.logic.Pf,olympe.sc.logic.Action);olympe.sc.logic.Pf.prototype.J.L=new olympe.D.K(()=>olympe.sc.logic.ub,[]);
|
|
1069
|
+
olympe.sc.logic.Pf.prototype.O.L=new olympe.D.K(()=>olympe.sc.logic.Bb,[]);olympe.sc.logic.Pf.prototype.T.L=olympe.D.K.O;olympe.sc.logic.ao=class extends olympe.sc.logic.sd{};olympe.sc.logic.ao.P=nn('01621fb84e320000f011',olympe.sc.logic.ao);olympe.sc.logic.$n=class extends olympe.sc.logic.Pf{};olympe.sc.logic.$n.P=nn('01621fb84e320000f012',olympe.sc.logic.$n);olympe.sc.logic.Function=class extends olympe.sc.Runnable{O(){return[this.yb]}T(){const a=olympe.sc.pg.C.Cl,b=olympe.sc.pg.C.Tl,c=this.db,d=new Map,e=this.cc();c.bb(e,olympe.sc.Va.G).forEach(f=>{d.set(a+c.name(f),f)});c.bb(e,olympe.sc.Va.F).forEach(f=>{d.set(b+c.name(f),f)});return d}C(a){const b=olympe.dc.ga(olympe.sc.logic.Cj),c=olympe.dc.ga(olympe.sc.logic.ri);return this.getOutputs().map(d=>{switch(this.db.Kb(d,olympe.sc.logic.Tb.typeRel)){case b:return a.rn.bind(a,d);case c:return a.throw.bind(a);
|
|
1070
1070
|
default:return a.set.bind(a,d)}})}setupExecution(a){const b=this.getInputs();return 0<b.length?rxjs.combineLatest(b.map(c=>a.observe(c))).pipe(rxjs.operators.map(c=>c.includes(null)?null:c)):rxjs.of([])}};olympe.sc.logic.Function.P=olympe.dc.na.C('0168c6f020f2a96f0000',olympe.sc.logic.Function,olympe.sc.R.Ca);olympe.sc.logic.Tb=class extends olympe.dc.CloudObject{getType(){return this.pc(olympe.sc.logic.Tb.typeRel,olympe.dc.CloudObject)}C(){return this.nd(olympe.sc.logic.Tb.C)}};olympe.sc.logic.Tb.P=olympe.dc.na.C('0168a431d25001540000',olympe.sc.logic.Tb);olympe.sc.logic.Tb.C=olympe.sc.logic.Tb.P.la('01740c5d4ae4b520dd01');olympe.sc.logic.Tb.typeRel=olympe.sc.logic.Tb.P.sa('0168a431d3b9b7438424');T(olympe.dc.CloudObject.P,olympe.sc.logic.Tb.typeRel);
|
|
1071
1071
|
olympe.sc.logic.Tb.prototype.getType.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.Tb.prototype.C.L=olympe.D.K.G;olympe.sc.logic.ub=class extends olympe.sc.logic.Tb{};olympe.sc.logic.ub.P=olympe.dc.na.C('0168a431d25001540001',olympe.sc.logic.ub);olympe.sc.logic.ub.T=olympe.sc.logic.Tb.P.la('01740c5d4ae4b520dd02');olympe.sc.logic.ub.O=T(olympe.sc.logic.ub.P,olympe.sc.Va.G);olympe.sc.logic.ub.F=olympe.sc.logic.ub.P.sa('0168a431d91f2578000b',olympe.dc.wa.ORIGIN);olympe.sc.logic.ub.G=olympe.sc.logic.ub.P.sa('01621fb84e32000000a1',olympe.dc.wa.ORIGIN);
|
|
1072
1072
|
olympe.sc.logic.ub.J=olympe.sc.logic.ub.P.sa('01621fb84e32000000d1',olympe.dc.wa.ORIGIN);olympe.sc.logic.ub.P.C=function(a,b,c,d,e,f=olympe.sc.logic.ub){f=a.create(f);Z(f,olympe.dc.CloudObject.nameProp,b||'New input');a.Ma(olympe.sc.logic.Tb.typeRel,f,c);void 0!==e&&Z(f,olympe.sc.logic.Tb.C,e);d&&a.Ma(olympe.sc.Va.G,d,f);return f.X()};olympe.sc.logic.Bb=class extends olympe.sc.logic.Tb{};olympe.sc.logic.Bb.P=olympe.dc.na.C('0168a431d25001540002',olympe.sc.logic.Bb);olympe.sc.logic.Bb.O=T(olympe.sc.logic.Bb.P,olympe.sc.Va.F);olympe.sc.logic.Bb.F=olympe.sc.logic.Bb.P.sa('0168a431d91f25780003',olympe.dc.wa.ORIGIN);olympe.sc.logic.Bb.J=olympe.sc.logic.Bb.P.sa('01621fb84e32000000a2',olympe.dc.wa.ORIGIN);olympe.sc.logic.Bb.G=olympe.sc.logic.Bb.P.sa('01621fb84e32000000d2',olympe.dc.wa.ORIGIN);
|
|
1073
|
-
olympe.sc.logic.Bb.P.C=function(a,b,c,d,e,f=olympe.sc.logic.Bb){f=a.create(f);Z(f,olympe.dc.CloudObject.nameProp,b||'New output');a.Ma(olympe.sc.logic.Tb.typeRel,f,c);void 0!==e&&Z(f,olympe.sc.logic.Tb.C,e);d&&a.Ma(olympe.sc.Va.F,d,f);return f.X()};olympe.sc.logic.Action=class extends olympe.sc.logic.Function{setupExecution(a){const b=this.vd().J().X();return a.observe(b).pipe(rxjs.operators.map(c=>null===c?null:this.getInputs().filter(d=>d!==b).map(d=>a.get(d))))}};olympe.sc.logic.Action.P=olympe.dc.na.C('0168c6f020f2a96a0000',olympe.sc.logic.Action,olympe.sc.R.Ca);olympe.sc.logic.cd=class extends olympe.sc.logic.Function{run(a){
|
|
1074
|
-
olympe.sc.logic.cd.F=T(olympe.sc.logic.cd.P,olympe.sc.logic.Bb.J);olympe.sc.logic.cd.P.C=function(a,b,c){b=a.create(olympe.sc.logic.cd);a.Ma(olympe.sc.logic.cd.F,b,c);return b.X()};olympe.sc.logic.cd.prototype.
|
|
1075
|
-
olympe.sc.logic.dd.G=T(olympe.sc.logic.dd.P,olympe.sc.logic.Bb.G);olympe.sc.logic.dd.P.C=function(a,b,c){b=a.create(olympe.sc.logic.dd);a.Ma(olympe.sc.logic.dd.F,b,c);return b.X()};olympe.sc.logic.dd.prototype.Ga.L=new olympe.D.K(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.dd.prototype.
|
|
1076
|
-
h)}}function
|
|
1073
|
+
olympe.sc.logic.Bb.P.C=function(a,b,c,d,e,f=olympe.sc.logic.Bb){f=a.create(f);Z(f,olympe.dc.CloudObject.nameProp,b||'New output');a.Ma(olympe.sc.logic.Tb.typeRel,f,c);void 0!==e&&Z(f,olympe.sc.logic.Tb.C,e);d&&a.Ma(olympe.sc.Va.F,d,f);return f.X()};olympe.sc.logic.Action=class extends olympe.sc.logic.Function{setupExecution(a){const b=this.vd().J().X();return a.observe(b).pipe(rxjs.operators.map(c=>null===c?null:this.getInputs().filter(d=>d!==b).map(d=>a.get(d))))}};olympe.sc.logic.Action.P=olympe.dc.na.C('0168c6f020f2a96a0000',olympe.sc.logic.Action,olympe.sc.R.Ca);olympe.sc.logic.cd=class extends olympe.sc.logic.Function{run(a){Zm(this,a);const b=a.getParent(),c=this.db.Kb(this,olympe.sc.logic.cd.G),d=this.db.Kb(this,olympe.sc.logic.cd.F);a.on(c,e=>b.set(d,e),this.tag)}va(){return this.pc(olympe.sc.logic.cd.G,olympe.sc.logic.ub)}Ga(){return this.pc(olympe.sc.logic.cd.F,olympe.sc.logic.Bb)}};olympe.sc.logic.cd.P=olympe.dc.na.C('01621fb84e32000000a0',olympe.sc.logic.cd,olympe.sc.R.Ca);olympe.sc.logic.cd.G=T(olympe.sc.logic.cd.P,olympe.sc.logic.ub.G);
|
|
1074
|
+
olympe.sc.logic.cd.F=T(olympe.sc.logic.cd.P,olympe.sc.logic.Bb.J);olympe.sc.logic.cd.P.C=function(a,b,c){b=a.create(olympe.sc.logic.cd);a.Ma(olympe.sc.logic.cd.F,b,c);return b.X()};olympe.sc.logic.cd.prototype.va.L=new olympe.D.K(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.cd.prototype.Ga.L=new olympe.D.K(()=>olympe.sc.logic.Bb,[]);olympe.sc.logic.dd=class extends olympe.sc.logic.Function{run(a){const b=a.getParent(),c=this.db.Kb(this,olympe.sc.logic.dd.F),d=this.db.Kb(this,olympe.sc.logic.dd.G);b.on(c,e=>a.set(d,e),b.U())}Ga(){return this.pc(olympe.sc.logic.dd.F,olympe.sc.logic.ub)}va(){return this.pc(olympe.sc.logic.dd.G,olympe.sc.logic.Bb)}};olympe.sc.logic.dd.P=olympe.dc.na.C('01621fb84e32000000d0',olympe.sc.logic.dd,olympe.sc.R.Ca);olympe.sc.logic.dd.F=T(olympe.sc.logic.dd.P,olympe.sc.logic.ub.J);
|
|
1075
|
+
olympe.sc.logic.dd.G=T(olympe.sc.logic.dd.P,olympe.sc.logic.Bb.G);olympe.sc.logic.dd.P.C=function(a,b,c){b=a.create(olympe.sc.logic.dd);a.Ma(olympe.sc.logic.dd.F,b,c);return b.X()};olympe.sc.logic.dd.prototype.Ga.L=new olympe.D.K(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.dd.prototype.va.L=new olympe.D.K(()=>olympe.sc.logic.Bb,[]);function dn(a,b,c){var d;const e=null!=(d=a.db.Kb(a,olympe.sc.logic.qb.T))?d:a.db.Kb(a,olympe.sc.logic.qb.J),f=a.db.Kb(a,olympe.sc.logic.qb.O);if(null!==e&&null!==f){d=a.db.If(on(a),olympe.dm.ye)?new olympe.D.Xb('Pipe Context'):null;const k=a.C.bind(a,c,d);let l;const n=b.Mk(f,p=>{let q;null==(q=l)||q();l=p.on(e,k,f)});return()=>{k(null);n();let p;null==(p=l)||p()}}const g=k=>c(olympe.dc.nb.Ac(k)),h=Bg(a.db,a,olympe.sc.logic.qb.valueProp,g);return()=>{g(null);Cg(a.db,a,olympe.sc.logic.qb.valueProp,
|
|
1076
|
+
h)}}function on(a){let b=null,c=a.db.Kb(a,olympe.sc.logic.qb.F);c?b=a.db.Kb(c,olympe.dm.Property.typeRel):(c=a.db.Kb(a,olympe.sc.logic.qb.C))&&(b=a.db.Kb(c,olympe.sc.logic.Tb.typeRel));return b||olympe.dc.ga(olympe.dc.CloudObject)}
|
|
1077
1077
|
olympe.sc.logic.qb=class extends olympe.dc.CloudObject{constructor(a,b,c){super(a,b);this.H=c}C(a,b,c){const d=olympe.sc.Zi(c);null==b||b.ja();b&&d instanceof olympe.dm.ye?null==b||b.run(()=>{olympe.D.Nc([d.getValue()],e=>{a(e.valueOf())})}):a(d)}getValue(a){return this.Hf(olympe.sc.logic.qb.valueProp,a||olympe.dc.nb.Zi,Object)}getType(){const a=this.transform(olympe.sc.logic.qb.C,olympe.sc.logic.Tb.typeRel);a.Hd(olympe.dc.CloudObject);return a.Fc()}Tx(){return this.pc(olympe.sc.logic.qb.O,olympe.dc.CloudObject)}Rx(){return this.pc(olympe.sc.logic.qb.T,
|
|
1078
1078
|
olympe.sc.logic.Bb)}Sx(){return this.pc(olympe.sc.logic.qb.J,olympe.dm.Property)}nx(){return this.pc(olympe.sc.logic.qb.G,olympe.dc.CloudObject)}lx(){return this.pc(olympe.sc.logic.qb.C,olympe.sc.logic.ub)}mx(){return this.pc(olympe.sc.logic.qb.F,olympe.dm.Property)}};olympe.sc.logic.qb.P=olympe.dc.na.C('0168a431d91f25780000',olympe.sc.logic.qb,olympe.sc.R.Ca);olympe.sc.logic.qb.valueProp=olympe.sc.logic.qb.P.la('0168a431d91f25780001');olympe.sc.logic.qb.O=olympe.sc.logic.qb.P.sa('0168a431d91f25780002');
|
|
1079
1079
|
olympe.sc.logic.qb.T=T(olympe.sc.logic.qb.P,olympe.sc.logic.Bb.F);olympe.sc.logic.qb.J=olympe.sc.logic.qb.P.sa('0168a431d91f25780004');olympe.sc.logic.qb.G=olympe.sc.logic.qb.P.sa('0168a431d91f2578000a');olympe.sc.logic.qb.C=T(olympe.sc.logic.qb.P,olympe.sc.logic.ub.F);olympe.sc.logic.qb.F=olympe.sc.logic.qb.P.sa('0168a431d91f2578000c');T(olympe.dc.CloudObject.P,olympe.sc.logic.qb.O);T(olympe.dm.Property.P,olympe.sc.logic.qb.J);T(olympe.dc.CloudObject.P,olympe.sc.logic.qb.G);
|
|
1080
|
-
T(olympe.dm.Property.P,olympe.sc.logic.qb.F);m=olympe.sc.logic.qb.prototype;m.getType.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);m.Tx.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);m.Rx.L=new olympe.D.K(()=>olympe.sc.logic.Bb,[]);m.Sx.L=new olympe.D.K(()=>olympe.dm.Property,[]);m.nx.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);m.lx.L=new olympe.D.K(()=>olympe.sc.logic.ub,[]);m.mx.L=new olympe.D.K(()=>olympe.dm.Property,[]);function
|
|
1080
|
+
T(olympe.dm.Property.P,olympe.sc.logic.qb.F);m=olympe.sc.logic.qb.prototype;m.getType.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);m.Tx.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);m.Rx.L=new olympe.D.K(()=>olympe.sc.logic.Bb,[]);m.Sx.L=new olympe.D.K(()=>olympe.dm.Property,[]);m.nx.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);m.lx.L=new olympe.D.K(()=>olympe.sc.logic.ub,[]);m.mx.L=new olympe.D.K(()=>olympe.dm.Property,[]);function pn(a,b){const c=a.vd(),d=c.Gl().X(),e=c.Hl().X(),f=c.Il().X();b.on(d,g=>{if(g){g=new Map(a.getInputs().map(k=>[k,b.get(k)]));const h={timeout:a.timeout};olympe.N.wb.get(a.cc(),g,h).then(k=>{for(const [l,n]of k)l!==e&&l!==f&&b.set(l,n);b.set(e,k.get(e));k=k.get(f);k instanceof olympe.sc.logic.Error&&(k=ym(k.message,k.code,k.ke()+'\n===== Remote Call =====\n'+b.ke()),b.throw(k))}).catch(k=>{k=`RemoteAction "${a.Vb().name()}" (${a.tag}) encountered an error:\n${k}`;a.H.error(k);b.throw(olympe.sc.logic.Error.create(k,
|
|
1081
1081
|
400))})}},b.U())}
|
|
1082
|
-
function
|
|
1083
|
-
olympe.sc.logic.Fh=class extends olympe.sc.logic.Function{constructor(a,b,c,d){super(a,b,c);this.timeout=d}run(a){let b;null!=(b=a.Na(olympe.sc.xa.C.EDITION))&&b||(this.db.Oa(this,olympe.sc.logic.Fh.F)?(
|
|
1084
|
-
k.destroy()},this.timeout);
|
|
1085
|
-
1))})},h=>{const k=this.cc();this.H.error(`Error while listening on remote action ${this.db.name(k)} (${k}): ${h.message}`)}))}};olympe.sc.logic.Fh.P=olympe.dc.na.C('017a7b0c5dcbd8964c5d',olympe.sc.logic.Fh,olympe.sc.R.Ca,new olympe.W.oa(olympe.sc.V.vq));olympe.sc.logic.Fh.F=olympe.sc.logic.Fh.P.la('017a7b0c62a02a89444f');olympe.sc.logic.controllers={};olympe.sc.logic.controllers.
|
|
1086
|
-
olympe.sc.logic.na.C('0171889b060b6cd54300',olympe.sc.logic.
|
|
1087
|
-
olympe.sc.logic.Qb.Fg.P=
|
|
1088
|
-
olympe.sc.workflow.ObjectState.dateTimeProp=olympe.sc.workflow.ObjectState.P.la('017ffdd8f0b1e31fe13b');olympe.sc.workflow.ObjectState.serializedObjectProp=olympe.sc.workflow.ObjectState.P.la('017ffdd8f0b1e31fe13d');olympe.sc.workflow.ObjectState.objectRel=olympe.sc.workflow.ObjectState.P.sa('017ffdd8f0b1e31fe13c');olympe.sc.workflow.ObjectState.currentObjectRel=olympe.sc.workflow.ObjectState.P.sa('017ffdd8f0b1e31fe13f');olympe.sc.workflow.rf=class extends olympe.sc.logic.sd{iu(){return this.C('017ffe02381f9fac5060')}lu(){return this.C('017ffe02381f9fac5061')}mu(){return this.C('017ffe02381f9fac5062')}jx(){return this.C('017ffe02381f9fac5065')}ju(){return this.F('017ffe02381f9fac5063')}ku(){return this.F('017ffe02381f9fac5064')}};olympe.sc.workflow.rf.P=
|
|
1082
|
+
function qn(a,b,c,d,e,f){const g=n=>v(function*(){if(null!==n){e.cancel();let p;null==(p=k)||p();let q;null==(q=l)||q();try{const r=new Map(a.getOutputs().map(t=>[t,b.get(t)]));yield f.qd(r)}catch(r){const t=Error(`Error while trying to send the response of remote action ${a.Vb().name()} (${a.cc()}): ${r}`);f.Th(t).catch(u=>{a.H.error(`Cannot reply with an error to a remote action call ${a.Vb().name()} (${a.cc()}): ${u}`)})}finally{b.destroy()}}}),h=b.U(),k=b.on(c,g,h),l=b.on(d,g,h)}
|
|
1083
|
+
olympe.sc.logic.Fh=class extends olympe.sc.logic.Function{constructor(a,b,c,d){super(a,b,c);this.timeout=d}run(a){let b;null!=(b=a.Na(olympe.sc.xa.C.EDITION))&&b||(this.db.Oa(this,olympe.sc.logic.Fh.F)?(Mm(a.C,this),this.va(a)):(Zm(this,a),pn(this,a)))}va(a){const b=this.cc(),c=this.vd(),d=c.xp().X(),e=c.Gl().X(),f=c.Hl().X(),g=c.Il().X();(new olympe.N.wb(b,a)).listen().subscribe(rxjs.Subscriber.create(h=>{const k=a.Rh('remote call'),l=h.body(),n=mc(()=>{h.Th(Error(`Timeout reached on remote action ${this.db.name(this)} (${this.tag})`));
|
|
1084
|
+
k.destroy()},this.timeout);qn(this,k,f,g,n,h);super.run(k);for(const [p,q]of l)p!==e&&k.set(p,q);h.ei().then(p=>{var q=k.get(d);null!==q&&olympe.dc.ga(q)!==p&&(q=this.cc(),this.H.warn(`Remote action ${this.db.name(q)} ${q}: try to run it with an input user that is not the real authenticated user.`));k.set(d,p);k.set(e,l.get(e))}).catch(p=>{const q=this.cc();this.H.warn(`Remote action ${this.db.name(q)} ${q} Triggered by unrecognized user: ${p}.`);k.set(g,olympe.sc.logic.Error.create('Unrecognized User',
|
|
1085
|
+
1))})},h=>{const k=this.cc();this.H.error(`Error while listening on remote action ${this.db.name(k)} (${k}): ${h.message}`)}))}};olympe.sc.logic.Fh.P=olympe.dc.na.C('017a7b0c5dcbd8964c5d',olympe.sc.logic.Fh,olympe.sc.R.Ca,new olympe.W.oa(olympe.sc.V.vq));olympe.sc.logic.Fh.F=olympe.sc.logic.Fh.P.la('017a7b0c62a02a89444f');olympe.sc.logic.controllers={};olympe.sc.logic.controllers.Dl=class{constructor(a){this.db=olympe.dc.ia();this.typeRel=a}};olympe.sc.logic.controllers.Dl.C={Nz:-1,NA:1};olympe.sc.logic.controllers.EB=class extends olympe.sc.logic.controllers.Dl{constructor(){super(olympe.sc.logic.ed.C)}};olympe.sc.logic.controllers.MB=class extends olympe.sc.logic.controllers.Dl{constructor(){super(olympe.sc.logic.Tb.typeRel)}};olympe.sc.logic.xk={};olympe.sc.logic.xk.Gv=class extends olympe.sc.logic.Function{update(a,[b],[c]){const d=olympe.dc.ga(b);d?olympe.dc.pa.Ob(a,d,olympe.dc.Nb.Yf).subscribe(()=>{c(olympe.dc.CloudObject.get(d))}):this.H.warn('Cannot subscribe to an instance with no tag: '+d)}};olympe.sc.logic.na.C('0174bf4b7e006e4b788a',olympe.sc.logic.xk.Gv);olympe.sc.logic.actions={};olympe.sc.logic.xk.yu=class extends olympe.sc.logic.Function{run(a){Zm(this,a);const [b,c,d]=this.C(a);let e,f=null,g=null;const h=a.getParent(),k=()=>{null===g||0===e?(this.H.warn('No list to iter upon'),this.H.info(a.U())):f<e?(b(g.Ze(f)),f++,c(Date.now())):(Om(h.C),d(Date.now()))};this.getInputs().forEach((l,n)=>a.on(l,p=>{if(p)switch(n){case 0:g=p;break;case 1:e=g.fg();f=0;Nm(h.C);k();break;case 2:k();break;default:this.H.error('Unhandled input')}},this.tag))}};
|
|
1086
|
+
olympe.sc.logic.na.C('0171889b060b6cd54300',olympe.sc.logic.xk.yu);olympe.sc.logic.Qb={};olympe.sc.logic.Qb.rl=class extends olympe.sc.logic.sd{J(){return this.C('016ac638085357047a2d')}};olympe.sc.logic.Qb.rl.P=nn('0169b6876a03f14ae61b',olympe.sc.logic.Qb.rl);olympe.sc.logic.Qb.rl.prototype.J.L=new olympe.D.K(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.Qb.El=class extends olympe.sc.logic.sd{J(){return this.C('016ac63808535703691c')}};olympe.sc.logic.Qb.El.P=nn('0169b6876a03f139d50a',olympe.sc.logic.Qb.El);olympe.sc.logic.Qb.El.prototype.J.L=new olympe.D.K(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.Qb.Ul=class extends olympe.sc.logic.sd{J(){return this.C('016ac63809a9a8e6db96')}O(){return this.F('016ac6380ab003363b3e')}};nn('01646ad602f933b8caaf',olympe.sc.logic.Qb.Ul);olympe.sc.logic.Qb.Ul.prototype.J.L=new olympe.D.K(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.Qb.Ul.prototype.O.L=new olympe.D.K(()=>olympe.sc.logic.Bb,[]);olympe.sc.logic.Qb.Tj=class extends olympe.sc.logic.sd{J(){return this.C('016ac6380bd98f1d91a0')}T(){return this.F('016ac63c589ae38ca3ae')}O(){return this.F('016ac63c5a377fceabaa')}};nn('0168ec42fc01747a98b6',olympe.sc.logic.Qb.Tj);olympe.sc.logic.Qb.Tj.prototype.J.L=new olympe.D.K(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.Qb.Tj.prototype.T.L=new olympe.D.K(()=>olympe.sc.logic.Bb,[]);olympe.sc.logic.Qb.Tj.prototype.O.L=new olympe.D.K(()=>olympe.sc.logic.Bb,[]);olympe.sc.logic.Qb.Fg=class extends olympe.sc.logic.sd{Gl(){return this.C('017a7b07b09e3b22c8b4')}xp(){return this.C('017a7b07ba05807a74b0')}Hl(){return this.F('017a7b0818c12388d731')}Il(){return this.F('017a7b085146d5e69aec')}hu(){return olympe.D.fa.F}};olympe.sc.logic.Qb.Fg.J='017a7b07b09e3b22c8b4';olympe.sc.logic.Qb.Fg.Ub='017a7b07ba05807a74b0';olympe.sc.logic.Qb.Fg.ja='017a7b0818c12388d731';olympe.sc.logic.Qb.Fg.C='017a7b085146d5e69aec';
|
|
1087
|
+
olympe.sc.logic.Qb.Fg.P=nn('017a7b07a948e30508fa',olympe.sc.logic.Qb.Fg,olympe.sc.logic.Fh);m=olympe.sc.logic.Qb.Fg.prototype;m.Gl.L=new olympe.D.K(()=>olympe.sc.logic.ub,[]);m.xp.L=new olympe.D.K(()=>olympe.sc.logic.ub,[]);m.Hl.L=new olympe.D.K(()=>olympe.sc.logic.Bb,[]);m.Il.L=new olympe.D.K(()=>olympe.sc.logic.Bb,[]);m.hu.L=olympe.D.K.O;olympe.sc.logic.Qb.Vq=class extends olympe.sc.logic.sd{J(){return this.C('016ac63c5b3ed0562740')}};nn('016a9766c230916ea5ec',olympe.sc.logic.Qb.Vq);olympe.sc.logic.Qb.Vq.prototype.J.L=new olympe.D.K(()=>olympe.sc.logic.ub,[]);olympe.sc.query={};olympe.sc.query.Fn=class extends olympe.sc.yg{};olympe.sc.query.Fn.P=olympe.dc.na.C('01631aacd8276ea98491',olympe.sc.query.Fn);olympe.sc.query.cq=class extends olympe.dm.Enum{};olympe.sc.query.cq.P=olympe.dc.na.C('01631aacd8276ea98495',olympe.sc.query.cq);olympe.sc.query.nq=class extends olympe.dm.Enum{};olympe.sc.query.nq.P=olympe.dc.na.C('01631aacd8276ea98494',olympe.sc.query.nq);olympe.sc.query.qq=class extends olympe.sc.yg{};olympe.sc.query.qq.P=olympe.dc.na.C('01631aacd8276ea98492',olympe.sc.query.qq);olympe.sc.query.Zc=class extends olympe.dc.CloudObject{};olympe.sc.query.Zc.P=olympe.dc.na.C('01631aacd8276ea98493',olympe.sc.query.Zc);olympe.sc.fo=class extends olympe.dc.CloudObject{};olympe.sc.fo.P=olympe.dc.na.C('018312ceeb3e93618a85',olympe.sc.fo);olympe.sc.workflow={};olympe.sc.workflow.ObjectState=class extends olympe.dc.CloudObject{};olympe.sc.workflow.ObjectState.P=olympe.dc.na.C('017ffdd8f0b1e31fe138',olympe.sc.workflow.ObjectState);olympe.sc.workflow.ObjectState.workflowProp=olympe.sc.workflow.ObjectState.P.la('017ffdd8f0b1e31fe13e');olympe.sc.workflow.ObjectState.stateProp=olympe.sc.workflow.ObjectState.P.la('017ffdd8f0b1e31fe139');olympe.sc.workflow.ObjectState.assigneeProp=olympe.sc.workflow.ObjectState.P.la('017ffdd8f0b1e31fe13a');
|
|
1088
|
+
olympe.sc.workflow.ObjectState.dateTimeProp=olympe.sc.workflow.ObjectState.P.la('017ffdd8f0b1e31fe13b');olympe.sc.workflow.ObjectState.serializedObjectProp=olympe.sc.workflow.ObjectState.P.la('017ffdd8f0b1e31fe13d');olympe.sc.workflow.ObjectState.objectRel=olympe.sc.workflow.ObjectState.P.sa('017ffdd8f0b1e31fe13c');olympe.sc.workflow.ObjectState.currentObjectRel=olympe.sc.workflow.ObjectState.P.sa('017ffdd8f0b1e31fe13f');olympe.sc.workflow.rf=class extends olympe.sc.logic.sd{iu(){return this.C('017ffe02381f9fac5060')}lu(){return this.C('017ffe02381f9fac5061')}mu(){return this.C('017ffe02381f9fac5062')}jx(){return this.C('017ffe02381f9fac5065')}ju(){return this.F('017ffe02381f9fac5063')}ku(){return this.F('017ffe02381f9fac5064')}};olympe.sc.workflow.rf.P=nn('017ffde21f5fe0f704ce',olympe.sc.workflow.rf);olympe.sc.workflow.rf.C='017ffe02381f9fac5060';olympe.sc.workflow.rf.Ud='017ffe02381f9fac5061';
|
|
1089
1089
|
olympe.sc.workflow.rf.Vd='017ffe02381f9fac5062';olympe.sc.workflow.rf.ja='017ffe02381f9fac5065';olympe.sc.workflow.rf.J='017ffe02381f9fac5063';olympe.sc.workflow.rf.Ub='017ffe02381f9fac5064';m=olympe.sc.workflow.rf.prototype;m.iu.L=new olympe.D.K(()=>olympe.sc.logic.ub,[]);m.lu.L=new olympe.D.K(()=>olympe.sc.logic.ub,[]);m.mu.L=new olympe.D.K(()=>olympe.sc.logic.ub,[]);m.jx.L=new olympe.D.K(()=>Map,[]);m.ju.L=new olympe.D.K(()=>olympe.sc.logic.Bb,[]);m.ku.L=new olympe.D.K(()=>olympe.sc.logic.Bb,[]);olympe.sc.workflow.Te=class extends olympe.dm.BrickMetadata{Oc(){return this.pc(olympe.sc.workflow.Workflow.statesRel.bc(),olympe.sc.workflow.Workflow).ma().concat(['.',this.ma()])}};olympe.sc.workflow.Te.P=olympe.dc.na.C('017ffdc2dda51d46b430',olympe.sc.workflow.Te);olympe.sc.workflow.Transition=class extends olympe.dc.CloudObject{F(){return this.Wr()}C(){return this.pc(olympe.sc.workflow.Transition.fromStateRel,olympe.sc.workflow.Te)}G(){return this.pc(olympe.sc.workflow.Transition.toStateRel,olympe.sc.workflow.Te)}Oc(){const a=this.pc(olympe.sc.workflow.Transition.fromStateRel,olympe.sc.workflow.Te);return a.pc(olympe.sc.workflow.Workflow.statesRel.bc(),olympe.sc.workflow.Workflow).ma().concat(['.',a.ma(),'->',this.ma()])}};
|
|
1090
1090
|
olympe.sc.workflow.Transition.P=olympe.dc.na.C('017ffdc633219f16beea',olympe.sc.workflow.Transition);olympe.sc.workflow.Transition.processRefProp=olympe.sc.workflow.Transition.P.la('017ffdc633219f16beec');olympe.sc.workflow.Transition.fromStateRel=olympe.sc.workflow.Transition.P.sa('017ffdc2dda51d46b431');olympe.sc.workflow.Transition.toStateRel=olympe.sc.workflow.Transition.P.sa('017ffdc633219f16beeb');olympe.sc.workflow.Transition.prototype.F.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);
|
|
1091
1091
|
olympe.sc.workflow.Transition.prototype.C.L=new olympe.D.K(()=>olympe.sc.workflow.Te,[]);olympe.sc.workflow.Transition.prototype.G.L=new olympe.D.K(()=>olympe.sc.workflow.Te,[]);olympe.sc.workflow.Workflow=class extends olympe.dm.BrickMetadata{ne(){return olympe.sc.pe.De.ih}G(){return this.Ug(olympe.sc.workflow.Workflow.serializationEnabledProp)}C(){return this.pc(olympe.sc.workflow.Workflow.dataTypeRel,olympe.sc.yc)}F(){return this.pc(olympe.sc.workflow.Workflow.initialStateRel,olympe.sc.workflow.Te)}};olympe.sc.workflow.Workflow.P=olympe.dc.na.C('017ffdc010e5bcc9c971',olympe.sc.workflow.Workflow);olympe.sc.workflow.Workflow.serializationEnabledProp=olympe.sc.workflow.Workflow.P.la('017ffdc010e5bcc9c972');
|
|
1092
1092
|
olympe.sc.workflow.Workflow.dataTypeRel=olympe.sc.workflow.Workflow.P.sa('017ffdc010e5bcc9c973');olympe.sc.workflow.Workflow.statesRel=olympe.sc.workflow.Workflow.P.sa('017ffdc010e5bcc9c974');olympe.sc.workflow.Workflow.initialStateRel=olympe.sc.workflow.Workflow.P.sa('017ffdc010e5bcc9c975');olympe.sc.workflow.Workflow.prototype.G.L=olympe.D.K.O;olympe.sc.workflow.Workflow.prototype.C.L=new olympe.D.K(()=>olympe.sc.yc,[]);
|
|
1093
|
-
olympe.sc.workflow.Workflow.prototype.F.L=new olympe.D.K(()=>olympe.sc.workflow.Te,[]);olympe.sc.qa={};olympe.sc.qa.Rc=class extends olympe.sc.Va{ne(){return olympe.sc.pe.De.pv}};olympe.sc.qa.Rc.P=olympe.dc.na.C('01120300000000adef00',olympe.sc.qa.Rc);olympe.sc.qa.Rc.C=olympe.sc.qa.Rc.P.sa('0171bc1f15da96dfdb89');olympe.sc.qa.Rc.ja=olympe.sc.qa.Rc.P.sa('0171bc1f15da96dfdb90');T(olympe.dm.Ic.P,olympe.sc.qa.Rc.C);olympe.sc.qa.hi=class extends olympe.sc.Runnable{G(){return[this.cc()]}
|
|
1093
|
+
olympe.sc.workflow.Workflow.prototype.F.L=new olympe.D.K(()=>olympe.sc.workflow.Te,[]);olympe.sc.qa={};olympe.sc.qa.Rc=class extends olympe.sc.Va{ne(){return olympe.sc.pe.De.pv}};olympe.sc.qa.Rc.P=olympe.dc.na.C('01120300000000adef00',olympe.sc.qa.Rc);olympe.sc.qa.Rc.C=olympe.sc.qa.Rc.P.sa('0171bc1f15da96dfdb89');olympe.sc.qa.Rc.ja=olympe.sc.qa.Rc.P.sa('0171bc1f15da96dfdb90');T(olympe.dm.Ic.P,olympe.sc.qa.Rc.C);olympe.sc.qa.hi=class extends olympe.sc.Runnable{G(){return[this.cc()]}va(){return olympe.dc.gd.from(this.cc()).ib(olympe.sc.qa.Rc.C).md()}};olympe.sc.qa.hi.P=Gf(olympe.dc.na.C('0113030000000aca1100',olympe.sc.qa.hi));olympe.sc.qa.hi.prototype.va.L=new olympe.D.K(()=>olympe.dm.kb,[]);olympe.sc.qa.mb=class extends olympe.dc.CloudObject{ou(){return this.Ug(olympe.sc.qa.mb.Oh)}yy(){return this.Ug(olympe.sc.qa.mb.ja)}Gc(){return this.nd(olympe.sc.qa.mb.C)}px(){return this.zb(olympe.sc.qa.mb.J)}Lx(){return this.zb(olympe.sc.qa.mb.ea)}Kx(){return this.zb(olympe.sc.qa.mb.Z)}Df(){return this.zb(olympe.sc.qa.mb.aa)}Ax(){return this.zb(olympe.sc.qa.mb.O)}Ww(){return this.zb(olympe.sc.qa.mb.F)}Jx(){return this.zb(olympe.sc.qa.mb.T)}nu(){return this.zb(olympe.sc.qa.mb.G)}};
|
|
1094
1094
|
olympe.sc.qa.mb.P=olympe.dc.na.C('011203300000000adef5',olympe.sc.qa.mb);olympe.sc.qa.mb.Oh=olympe.sc.qa.mb.P.la('011203300000000adef6');olympe.sc.qa.mb.ja=olympe.sc.qa.mb.P.la('011203300000000adef7');olympe.sc.qa.mb.C=olympe.sc.qa.mb.P.la('011203300000000adef8');olympe.sc.qa.mb.J=olympe.sc.qa.mb.P.la('011203300000000adef9');olympe.sc.qa.mb.ea=olympe.sc.qa.mb.P.la('011203300000000adefa');olympe.sc.qa.mb.Z=olympe.sc.qa.mb.P.la('011203300000000adefb');olympe.sc.qa.mb.F=olympe.sc.qa.mb.P.la('011203300000000adefc');
|
|
1095
|
-
olympe.sc.qa.mb.aa=olympe.sc.qa.mb.P.la('011203300000000adefd');olympe.sc.qa.mb.O=olympe.sc.qa.mb.P.la('011203300000000adefe');olympe.sc.qa.mb.T=olympe.sc.qa.mb.P.la('011203300000000adeff');olympe.sc.qa.mb.G=olympe.sc.qa.mb.P.la('011203300000000adee0');olympe.sc.qa.mb.Hb={INIT:0,Az:1,
|
|
1096
|
-
m.Ww.L=olympe.D.K.F;m.Jx.L=olympe.D.K.F;m.nu.L=olympe.D.K.F;olympe.sc.qa.
|
|
1097
|
-
olympe.sc.qa.Se.P.C=(a,b,c)=>{b=
|
|
1095
|
+
olympe.sc.qa.mb.aa=olympe.sc.qa.mb.P.la('011203300000000adefd');olympe.sc.qa.mb.O=olympe.sc.qa.mb.P.la('011203300000000adefe');olympe.sc.qa.mb.T=olympe.sc.qa.mb.P.la('011203300000000adeff');olympe.sc.qa.mb.G=olympe.sc.qa.mb.P.la('011203300000000adee0');olympe.sc.qa.mb.Hb={INIT:0,Az:1,gk:2,fk:3,im:4,fC:5,xb:9};m=olympe.sc.qa.mb.prototype;m.ou.L=olympe.D.K.O;m.yy.L=olympe.D.K.O;m.Gc.L=olympe.D.K.G;m.px.L=olympe.D.K.F;m.Lx.L=olympe.D.K.F;m.Kx.L=olympe.D.K.F;m.Df.L=olympe.D.K.F;m.Ax.L=olympe.D.K.F;
|
|
1096
|
+
m.Ww.L=olympe.D.K.F;m.Jx.L=olympe.D.K.F;m.nu.L=olympe.D.K.F;olympe.sc.qa.zl=class extends olympe.sc.qa.hi{F(a){a.set(olympe.sc.xa.C.vn,!0);super.F(a)}ja(){return!0}};olympe.sc.qa.zl.P=olympe.dc.na.C('0113032000000aca1102',olympe.sc.qa.zl,olympe.sc.R.Ca);olympe.sc.qa.Se=class extends olympe.sc.qa.Rc{C(){return(new olympe.dc.Pj(this.X(),olympe.sc.qa.mb)).ib(olympe.sc.qa.Se.J).Bi().Fc()}};olympe.sc.qa.Se.P=olympe.dc.na.C('011203300000000adef3',olympe.sc.qa.Se);olympe.sc.qa.Se.J=olympe.sc.qa.Se.P.sa('011203300000000adef4');T(olympe.sc.qa.mb.P,olympe.sc.qa.Se.J);
|
|
1097
|
+
olympe.sc.qa.Se.P.C=(a,b,c)=>{b=jl(a,b||'New Service Application model',olympe.sc.qa.Se,olympe.sc.qa.zl);a.Ma(olympe.sc.qa.Rc.C,b,c);c=a.create(olympe.sc.qa.mb).X();a.Ma(olympe.sc.qa.Se.J,b,c);return b.X()};olympe.sc.qa.Se.prototype.C.L=new olympe.D.K(()=>olympe.sc.qa.mb,[]);olympe.sc.Lg=class extends olympe.dc.CloudObject{static get(){return olympe.dc.CloudObject.get('011203300000000adf0f')}};olympe.sc.Lg.P=olympe.dc.na.C('011203300000000adf00',olympe.sc.Lg);olympe.sc.Lg.F=olympe.sc.Lg.P.la('011203300000000adf01');olympe.sc.Lg.C=olympe.sc.Lg.P.la('011203300000000adf02');olympe.sc.Lg.G='011203300000000adf0f';olympe.sc.jg={};olympe.sc.jg.ny=a=>{var b=a.C;const c=olympe.dc.ia();var d=null;for(const e of b.ad())if((b=e.Vb())&&e.F()&&e.tb()===olympe.dc.Sa.SERVER&&$k(a,e.tag())&&c.Rb(b,olympe.sc.yc)){let f,g;null==d&&(d=null,null!==gn?d=gn:'string'===typeof fn&&(d=olympe.dc.gd.from(fn).ib(olympe.sc.qa.Rc.C).ib(olympe.sc.Wc.C.bc()).md()),d=null==(f=d)?void 0:f.X());d=null!=(g=d)?g:null;if(null===d)throw Error(`No business container for new instance of ${olympe.dc.ga(b)}`);a.Ma(olympe.sc.Wc.F.X(),d,e.tag())}};
|
|
1098
1098
|
olympe.sc.jg.Ay=a=>{const b=a.C,c=olympe.dc.ia();for(const d of b.ad()){const e=d.Vb();e&&!d.zd()&&c.Rb(e,olympe.sc.yc)&&d.Cb().forEach((f,g)=>{if(f instanceof olympe.dc.uc){const l=b.Lc(f.X());if(null===l)throw Error(`Try to assign an instance as complex property which is not created within the same transaction: ${f.X()}`);var h;f=null!=(h=null==l?void 0:l.Vb())?h:null;h=l.tag();let n;if(f===olympe.dc.ga(olympe.sc.Kd)){h=l.Kb(olympe.sc.Kd.C);if(!h)throw Error('No object reference found for new ObjectRef');
|
|
1099
|
-
var k;let p;f=null!=(p=null==(k=b.Lc(h))?void 0:k.Vb())?p:c.model(h)}if(c.If(f,olympe.dm.ye)){k=
|
|
1100
|
-
olympe.sc.jg.ww=a=>{const b=a.C,c=olympe.dc.ia(),d=new Set;for(var e of b.C.values()){a=e.tag();let f;const g=null!=(f=e.Vb())?f:c.model(a);if(null!==g&&e.Tc()&&(d.has(g)||c.Rb(g,olympe.sc.yc))){d.add(g);const h=Array.from(e.ja()).flatMap(([k,,l,n])=>n&&k!==olympe.dc.
|
|
1101
|
-
'unknown';throw Error(`Try to link an instance (${a}) of DataType ${c.name(g)} (${g}) to an instance which is not (${h}) a DataType: ${c.name(e)} (${e})`);}}}};olympe.sc.jg.Py=a=>{var b=a.C;const c=olympe.dc.ia();for(const d of b.ad()){b=d.tag();const e=d.Vb();if(e&&!c.Rb(e,olympe.sc.yc)
|
|
1102
|
-
olympe.W.run([olympe.dc.transaction.R.Ea],a=>{
|
|
1103
|
-
return b}update(a,b,c){this.C.update(a,b,c);return this}gs(a,b){a=this.C.update(a);for(const [c,d]of b)b=d,a.Dd.set(olympe.dc.ga(c),b);return this}delete(a){this.C.delete(a);return this}Ma(a,b,c){this.C.Ma(a,b,c);return this}
|
|
1104
|
-
a;return this}model(a){return this.C.model(a)}merge(a){
|
|
1105
|
-
olympe.sc.Xa.prototype.merge=olympe.sc.Xa.prototype.merge;olympe.sc.Xa.prototype.model=olympe.sc.Xa.prototype.model;olympe.sc.Xa.prototype.setSource=olympe.sc.Xa.prototype.ci;olympe.sc.Xa.prototype.persistInstance=olympe.sc.Xa.prototype.Oy;olympe.sc.Xa.prototype.persist=olympe.sc.Xa.prototype.persist;olympe.sc.Xa.prototype.deleteAllRelations=olympe.sc.Xa.prototype.
|
|
1106
|
-
olympe.sc.Xa.prototype['delete']=olympe.sc.Xa.prototype.delete;olympe.sc.Xa.prototype.multiUpdate=olympe.sc.Xa.prototype.gs;olympe.sc.Xa.prototype.update=olympe.sc.Xa.prototype.update;olympe.sc.Xa.prototype.create=olympe.sc.Xa.prototype.create;olympe.sc.Xa.prototype.getId=olympe.sc.Xa.prototype.U;olympe.sc.Xa.process=olympe.sc.Xa.process;olympe.sc.Xa.from=olympe.sc.Xa.from;olympe.sc.Si=class{constructor(a){this.C=a}gx(){return this.C.map(olympe.dc.CloudObject.get)}};olympe.sc.Si.prototype.getCreatedObjects=olympe.sc.Si.prototype.gx;olympe.wc={};olympe.wc.Es=class{run(){}};function
|
|
1107
|
-
olympe.wc.Ta=class{constructor(a,b){this.C=a;this.H=b;this.F=null;this.G='';this.H.info('HC Manager will execute application registered as:',this.C)}
|
|
1108
|
-
this.F.run()):this.H.error('No app registered under name: '+this.C)}};olympe.wc.
|
|
1109
|
-
olympe.W.run([olympe.wc.R.Ea],a=>a.run(),'olympe.hc');olympe.sc.Jb={};function
|
|
1110
|
-
function
|
|
1111
|
-
l&&h.Rb(l,olympe.sc.gh)},{Pd:
|
|
1112
|
-
d.run(f))})});e.add((f,g)=>{if(
|
|
1113
|
-
function
|
|
1114
|
-
a.H.info(`Application ${olympe.dc.ia().name(a.C)} (${a.C}) started`);k=olympe.dc.sources.Xd();k.Fb=!0;k.Z+=0;k.Uc.next(0<k.Z);0===k.Z&&k.aa&&k.Fb&&(k.H.debug(`Cache: set code-as-data version in local storage: ${k.version}`),k.
|
|
1115
|
-
3E4);let e;null==(e=a.Fb)||e.start()}}function
|
|
1116
|
-
olympe.sc.Jb.
|
|
1117
|
-
c=olympe.N.rc.C.ee,d=olympe.N.rc.C.Rd;olympe.D.Nc([this.O.getState()],e=>{switch(e){case b:case c:this.H.debug('Server session opened or working offline, start the application');a||(a=!0,
|
|
1118
|
-
b[olympe.net.Aa.Headers.
|
|
1119
|
-
typeof h?h:h.message}`,olympe.net.Aa.Yb.
|
|
1120
|
-
{};else if('string'===typeof f)try{f=JSON.parse(f)}catch(h){d.H.warn(`Invalid manifest app config for app: ${e}`),f={}}e=Object.assign({},g,d.C,f);return new olympe.net.be(JSON.stringify(e),olympe.net.Aa.Yb.xh,void 0,{'content-type':'application/json'})})}).catch(()=>this.H.error('Error while starting the RuntimeHTTPService'));this.H.debug('Started RuntimeHTTPService')}};function
|
|
1121
|
-
olympe.sc.Jb.
|
|
1122
|
-
new olympe.dc.Xa;
|
|
1123
|
-
olympe.W.config(function(a){F(a,olympe.sc.Jb.V.
|
|
1124
|
-
g:d;return new Map([['offlineEnabled',f],['offlineAutoBackOnline',!f||b]])});Oa(a,olympe.net.R.
|
|
1125
|
-
b],['getContextMode',c],['debuggerName',d],['autostartProfiler',e],['loadBusinessContainer',f]]));C(a,olympe.sc.Jb.R.Yf,olympe.sc.Jb.
|
|
1126
|
-
olympe.net.R.Ui,olympe.sc.R.
|
|
1127
|
-
d)}static hg(){return new Promise((b,c)=>{olympe.public.Ka.get().hg(d=>d?c(d):b())})}static vx(){return olympe.D.Na(olympe.public.Ka.get().Yh())||void 0}static Vx(){const b=
|
|
1128
|
-
b).set('password',c),olympe.auth.Ec.C.SRP)}static sy(b){const c=
|
|
1129
|
-
c),olympe.auth.Ec.C.
|
|
1099
|
+
var k;let p;f=null!=(p=null==(k=b.Lc(h))?void 0:k.Vb())?p:c.model(h)}if(c.If(f,olympe.dm.ye)){k=tm(f);let p;n=null!=(p=l.Oa(k.X()))?p:c.Oa(h,k)}if(void 0===n)throw Error(`Try to set a complex property to an instance of a DataType: ${c.name(e)} (${e})`);a.Qc(d.tag(),new Map([[g,n]]));dl(a,l.tag(),olympe.dc.Nb.Dc)}})}};
|
|
1100
|
+
olympe.sc.jg.ww=a=>{const b=a.C,c=olympe.dc.ia(),d=new Set;for(var e of b.C.values()){a=e.tag();let f;const g=null!=(f=e.Vb())?f:c.model(a);if(null!==g&&e.Tc()&&(d.has(g)||c.Rb(g,olympe.sc.yc))){d.add(g);const h=Array.from(e.ja()).flatMap(([k,,l,n])=>n&&k!==olympe.dc.mc.Yc?[l]:[]).find(k=>{let l,n;const p=null!=(n=null==(l=b.Lc(k))?void 0:l.Vb())?n:c.model(k);return!p||!(d.has(p)||c.Rb(p,olympe.sc.yc))});if(void 0!==h){let k,l,n;e=null!=(n=null!=(l=null==(k=b.Lc(h))?void 0:k.Vb())?l:c.model(h))?n:
|
|
1101
|
+
'unknown';throw Error(`Try to link an instance (${a}) of DataType ${c.name(g)} (${g}) to an instance which is not (${h}) a DataType: ${c.name(e)} (${e})`);}}}};olympe.sc.jg.Py=a=>{var b=a.C;const c=olympe.dc.ia();for(const d of b.ad()){b=d.tag();const e=d.Vb();if(e&&!c.Rb(e,olympe.sc.yc)&&$k(a,b))throw Error(`You are trying to persist an instance of : ${c.name(e)} (${e}), but only instances of DataType can be persisted`);}};
|
|
1102
|
+
olympe.W.run([olympe.dc.transaction.R.Ea],a=>{pl(pl(pl(a,olympe.sc.jg.ww,'businessDataRelations'),olympe.sc.jg.ny),olympe.sc.jg.Ay)});olympe.sc.Bj=class extends olympe.dm.BrickMetadata{ne(){return olympe.sc.pe.De.ih}};olympe.sc.Bj.P=olympe.dc.na.C('01645fe6873aeea59e64',olympe.sc.Bj);olympe.sc.Bj.C=olympe.sc.Bj.P.sa('017ed8ac775f48d4d589');olympe.sc.bo=class extends olympe.dm.Lb{ne(){return olympe.sc.pe.De.ih}};olympe.sc.bo.P=olympe.dc.na.C('0163a68ce44f3d1fa95d',olympe.sc.bo);olympe.sc.gh=class extends olympe.dm.BrickMetadata{};olympe.sc.gh.P=olympe.dc.na.C('016324fde11a836f77d3',olympe.sc.gh);olympe.sc.gh.C=olympe.sc.yc.P.sa('016324fde11a836088d3');olympe.sc.gh.P.C=(a,b)=>jl(a,null!=b?b:'New config type',olympe.sc.gh).X();olympe.sc.Jz=class{};olympe.sc.Fj=class extends olympe.dm.BrickMetadata{ne(){return olympe.sc.pe.De.ih}};olympe.sc.Fj.P=olympe.dc.na.C('017dc8d6c8fd8c8bd2ff',olympe.sc.Fj);olympe.sc.Fj.P.C=(a,b)=>jl(a,null!=b?b:'New data connector',olympe.sc.Fj,olympe.dm.DataSource).X();olympe.sc.re=class extends olympe.sc.Runnable{Ga(){return this.bb(olympe.sc.re.G,olympe.sc.Runnable)}va(){return this.bb(olympe.sc.re.F,olympe.dm.Property)}};olympe.sc.re.P=Gf(olympe.dc.na.C('016c2d996d9ca27fa9d8',olympe.sc.re));olympe.sc.re.G=olympe.sc.re.P.sa('016c3cb7742ec9309e0b');olympe.sc.re.F=olympe.sc.re.P.sa('016c42d3454636f90533');olympe.sc.re.prototype.Ga.L=new olympe.D.K(()=>olympe.dc.za,[]);olympe.sc.re.prototype.va.L=new olympe.D.K(()=>olympe.dc.za,[]);olympe.sc.Fo=class extends olympe.dm.Lb{ne(){return olympe.sc.pe.De.ih}};olympe.sc.Fo.P=olympe.dc.na.C('017a7a9ff057958e5678',olympe.sc.Fo);olympe.sc.oi=class extends olympe.dm.Enum{static create(a,b,c,d,e){const f=olympe.dc.ia();e=void 0!==e?e:f.Ha(b)&&f.ad(b).length||0;c=(new Map).set(olympe.dm.String.valueProp,c).set(olympe.dc.CloudObject.nameProp,d||c).set(olympe.dm.Enum.rankProp,e);return a.create(b,c)}};olympe.sc.oi.create=olympe.sc.oi.create;olympe.sc.oi.P=olympe.dc.na.C('016cdd861b32d56c8208',olympe.sc.oi);olympe.sc.Hp=class extends olympe.dm.Lb{ne(){return olympe.sc.pe.De.Qv}};olympe.sc.Hp.P=olympe.dc.na.C('01644b6d4543b344b857',olympe.sc.Hp);olympe.sc.Ip=class extends olympe.dc.CloudObject{};olympe.sc.Ip.P=olympe.dc.na.C('0162f672366be5ca7a86',olympe.sc.Ip);const rn={Eo:30};olympe.sc.fc=class extends olympe.dc.sources.fc{F(a){return a instanceof olympe.sc.logic.Error?Q(rn.Eo,{c:a.code,m:a.message,s:a.ke()}):super.F(a)}C(a){return(null==a?void 0:a.t)===rn.Eo?(a=a.v,ym(a.m,a.c,a.s)):super.C(a)}J(a){super.J(a);if(this.db.model(a)===olympe.sc.Kd.P.X()){const b=olympe.sc.Kd.C;this.G.get(a).r.push({r:b.X(),d:this.db.Kb(a,b)})}return a}};olympe.sc.Wq=class extends olympe.sc.re{};olympe.sc.Wq.P=olympe.dc.na.C('016d3f37610ae4fc3962',olympe.sc.Wq);olympe.sc.Text=class extends olympe.dm.String{};olympe.sc.Text.P=olympe.dc.na.C('016cfca73e63f9ab5ba4',olympe.sc.Text);olympe.sc.Xa=class{constructor(a=!0){a=hl(a);a.O=!0;a.T.push(olympe.sc.jg.Py);this.C=a;this.F=[];this.source=null}static from(a){const b=olympe.sc.xa.C.TRANSACTION;return a.has(b,!0)?a.get(b,!0):new olympe.sc.Xa}static process(a,b){return a.has(olympe.sc.xa.C.TRANSACTION,!0)?Promise.resolve(!1):b.ob().then(()=>!0)}U(){return this.C.U()}create(a,b=new Map,c=this.source,d){c='string'===typeof c?c:olympe.dc.Zd().fromModel(a);a=this.C.create(a,d).ci(c);for(const [e,f]of b)Z(a,e,f);b=a.X();this.F.push(b);
|
|
1103
|
+
return b}update(a,b,c){this.C.update(a,b,c);return this}gs(a,b){a=this.C.update(a);for(const [c,d]of b)b=d,a.Dd.set(olympe.dc.ga(c),b);return this}delete(a){this.C.delete(a);return this}Ma(a,b,c){this.C.Ma(a,b,c);return this}hc(a,b,c){this.C.hc(a,b,c);return this}Km(a,b){this.C.Km(a,b);return this}persist(a,b=!0){this.C.persist(a,b);return this}Oy(a,b=!0){olympe.ka.ab('dc').warn('Transaction#persistInstance() has been deprecated. Please use Transaction#persist() instead.');return this.persist(a,b)}ci(a){this.source=
|
|
1104
|
+
a;return this}model(a){return this.C.model(a)}merge(a){il(this.C,a.C);return this}Dm(a){this.C.Dm(a);return this}ob(){return new Promise((a,b)=>{this.C.ob((c,d)=>{c?a(new olympe.sc.Si(this.F)):b(d)})})}Lm(){return new Promise((a,b)=>{this.C.Lm((c,d)=>{c?a(new olympe.sc.Si(this.F)):b(d)})})}};olympe.sc.Xa.prototype.executeAsLarge=olympe.sc.Xa.prototype.Lm;olympe.sc.Xa.prototype.execute=olympe.sc.Xa.prototype.ob;olympe.sc.Xa.prototype.afterExecution=olympe.sc.Xa.prototype.Dm;
|
|
1105
|
+
olympe.sc.Xa.prototype.merge=olympe.sc.Xa.prototype.merge;olympe.sc.Xa.prototype.model=olympe.sc.Xa.prototype.model;olympe.sc.Xa.prototype.setSource=olympe.sc.Xa.prototype.ci;olympe.sc.Xa.prototype.persistInstance=olympe.sc.Xa.prototype.Oy;olympe.sc.Xa.prototype.persist=olympe.sc.Xa.prototype.persist;olympe.sc.Xa.prototype.deleteAllRelations=olympe.sc.Xa.prototype.Km;olympe.sc.Xa.prototype.deleteRelation=olympe.sc.Xa.prototype.hc;olympe.sc.Xa.prototype.createRelation=olympe.sc.Xa.prototype.Ma;
|
|
1106
|
+
olympe.sc.Xa.prototype['delete']=olympe.sc.Xa.prototype.delete;olympe.sc.Xa.prototype.multiUpdate=olympe.sc.Xa.prototype.gs;olympe.sc.Xa.prototype.update=olympe.sc.Xa.prototype.update;olympe.sc.Xa.prototype.create=olympe.sc.Xa.prototype.create;olympe.sc.Xa.prototype.getId=olympe.sc.Xa.prototype.U;olympe.sc.Xa.process=olympe.sc.Xa.process;olympe.sc.Xa.from=olympe.sc.Xa.from;olympe.sc.Si=class{constructor(a){this.C=a}gx(){return this.C.map(olympe.dc.CloudObject.get)}};olympe.sc.Si.prototype.getCreatedObjects=olympe.sc.Si.prototype.gx;olympe.wc={};olympe.wc.Es=class{run(){}};function sn(a,b='default'){return a.C===b}
|
|
1107
|
+
olympe.wc.Ta=class{constructor(a,b){this.C=a;this.H=b;this.F=null;this.G='';this.H.info('HC Manager will execute application registered as:',this.C)}nj(a,b,c=''){b||(b='default');b===this.C?(null===this.F?this.H.log('Application',c,'designated to be launched'):this.H.log('OVERRIDE: Application',c,'designated to be launched'),this.F=a,this.G=c):this.H.debug('ignoring application:'+c+' as it is registered under name '+b+' and not '+this.C)}run(){null!==this.F?(this.H.info('Running application:',this.G),
|
|
1108
|
+
this.F.run()):this.H.error('No app registered under name: '+this.C)}};olympe.wc.nj=function(a,b,c='default'){const d=a.ab();c?d.debug('Pre-registering application '+b+' under name '+c+' (use '+olympe.wc.V.Je+'='+c+' to start it)'):d.debug('Pre-registering application '+b+' as default one');a.vd(olympe.wc.R.Ea).config(c,[b],(e,f)=>f.nj(e,c,b),e=>sn(e,c),'olympe.hc.registerApp')};olympe.wc.R={Ea:'hc.Manager',Ca:'hc.Logger'};olympe.wc.V={Je:'hc.app',Wo:'hc.globalToken'};olympe.W.config(function(a){F(a,olympe.wc.V.Je,'default');F(a,olympe.wc.V.Wo,!1);E(a,olympe.wc.R.Ca,[olympe.ka.R.Ea],b=>b.Vc('hc'));E(a,olympe.Db.R.Jg,[new olympe.W.oa(olympe.wc.V.Je)],b=>b);E(a,olympe.auth.R.Tk,[olympe.Db.R.Jg,new olympe.W.oa(olympe.wc.V.Wo)],(b,c)=>new olympe.auth.En(c?'':b));C(a,olympe.wc.R.Ea,olympe.wc.Ta,new olympe.W.oa(olympe.wc.V.Je),olympe.wc.R.Ca)},'olympe.hc');
|
|
1109
|
+
olympe.W.run([olympe.wc.R.Ea],a=>a.run(),'olympe.hc');olympe.sc.Jb={};function tn(a){a.Z=a.G.F(()=>v(function*(){return un(a)}),'Stop application')}function vn(a){a.T=a.G.C(()=>olympe.D.Na(a.aa)===olympe.D.fa.F?Promise.resolve('The application is started'):Promise.reject('The application is not started'),'Application health check',olympe.host.ze.C.READINESS)}
|
|
1110
|
+
function wn(a,b){if(a.ja)a.H.debug('Sending getContext request'),Zh(a.va).then(()=>{a.H.debug('synchronisation request successful');fn=a.C;b()}).catch(c=>{a.H.error('failed to synchronise (authenticated) with server: '+c.message)});else{const c=wm(a.F);!c&&tk();a.H.debug((c?'PULLING':'SUBSCRIBING')+' application '+a.C);const d=a.F.F(),e=new olympe.async.Tq(d);e.add((f,g)=>{const h=olympe.dc.ia(),k=new olympe.D.Xb('Primordial Subscription Context',d);Ph(k,a.C,l=>{l=h.ai(l)?l:h.model(l);return null!==
|
|
1111
|
+
l&&h.Rb(l,olympe.sc.gh)},{Pd:xn(c),nn:!0}).subscribe(rxjs.Subscriber.create(d.G(()=>{h.Rb(a.C,olympe.sc.qa.Rc)?(a.Ga.Z(a.C,c),f()):$c(a.O)?g(`The specified application tag (${a.C}) is not an application or does not exist`):(k.destroy(),a.O.connect().catch(l=>{g(`Failed to load the app while offline, you might want to try again when online: ${l}`)}))}),l=>g(String(l))))});e.add(f=>{olympe.D.Nc([a.ea.me()],g=>{const h=xn(c,!1);olympe.dc.pa.Fe(g,olympe.dm.User).observe(olympe.D.Wa(),{Pd:h,uk:'__code-as-data__'}).subscribe(()=>
|
|
1112
|
+
d.run(f))})});e.add((f,g)=>{if(yn(a.C)){const h=olympe.sc.Wc.Hb.Ap,k=olympe.sc.Wc.Hb.Ei;hn(a.C,a.yb,l=>{l===h||l===k?d.run(f):d.run(()=>g('Error while loading the business container'))})}else f()});Sc(e,(f,g)=>{if(g)throw Error(g);b()});e.start()}}
|
|
1113
|
+
function zn(a){a.H.info('Starting application '+a.C);const b=olympe.dc.ia();if(0<a.C.length){const c=hf(b,a.C,a.F.F().G((f,g)=>{if(f)if(f=Ym(g),f instanceof olympe.sc.qa.hi){a.H.debug('application retrieved: running');g=um(a.F,f);const h=new olympe.sc.Za.av(a.J);ab(a.J,()=>Gm(a.F.C,h));bb(a.J,()=>{var k=h.U();return Im(a.F.C,k)});a.eb&&a.J.start();f.run(g);'string'===typeof a.hb&&(new olympe.sc.Sd).ea(f.X(),g,a.H);g.vs(olympe.sc.xa.C.vn).then(()=>{var k;null==(k=d)||k.cancel();a.aa.update(olympe.D.fa.F);
|
|
1114
|
+
a.H.info(`Application ${olympe.dc.ia().name(a.C)} (${a.C}) started`);k=olympe.dc.sources.Xd();k.Fb=!0;k.Z+=0;k.Uc.next(0<k.Z);0===k.Z&&k.aa&&k.Fb&&(k.H.debug(`Cache: set code-as-data version in local storage: ${k.version}`),k.eb.set('__code-as-data-version__',k.version),k.yb||(k.aa=!1))})}else a.H.error('application retrieved: not an Application with a run() method');else un(a)}));olympe.D.Wa().onDestroy(()=>{ff(b,a.C,c)});const d=mc(()=>{a.H.warn(`requested application ${a.C} may not be available (it may not exist or the logged user may not have the correct permissions)`)},
|
|
1115
|
+
3E4);let e;null==(e=a.Fb)||e.start()}}function xn(a,b=!0){return a?olympe.dc.pa.Zc.$l:b?olympe.dc.pa.Zc.Qf:olympe.dc.pa.Zc.Zl}function un(a){a.H.info('Stop the application');a.F.F().ja();a.G.G(a.T);a.G.O(a.Z)}
|
|
1116
|
+
olympe.sc.Jb.hm=class{constructor(a,b,c,d,e,f,g,h,k,l){this.H=a;this.ea=b;this.O=c;this.va=d;this.G=e;this.Z=this.T='';this.F=f;this.Ga=g;this.J=h;this.Fb=l;this.C=k.get('appTag');this.ja=k.get('getContextMode');let n;this.hb=null!=(n=k.get('debuggerName'))?n:null;this.eb=k.get('autostartProfiler');this.yb=k.get('loadBusinessContainer');this.aa=olympe.D.ec(olympe.D.fa).update(olympe.D.fa.C)}run(){this.H.debug('runtime starting for app #'+this.C);let a=!1;tn(this);vn(this);const b=olympe.N.rc.C.Ji,
|
|
1117
|
+
c=olympe.N.rc.C.ee,d=olympe.N.rc.C.Rd;olympe.D.Nc([this.O.getState()],e=>{switch(e){case b:case c:this.H.debug('Server session opened or working offline, start the application');a||(a=!0,wn(this,()=>zn(this)));break;case d:this.H.debug('Impossible to open a connection to the orchestrator and offline mode is disabled.')}})}};olympe.sc.Jb.hm.C='app_instance';olympe.sc.Jb.hm.ya=[olympe.wc.Es];olympe.sc.Jb.nv=class{constructor(a,b,c,d){this.H=a;this.F=b;this.G=d.get('httpManifestPath');this.C=d.get('manifestCommon');if(!this.C)this.C={};else if('string'===typeof this.C)try{this.C=JSON.parse(this.C)}catch(e){this.H.warn('Invalid manifest common config'),this.C={}}}start(){const a=b=>{this.H.debug('Request URL',b.C());const c=(new URL(b.C())).searchParams.get('origin');if(c)return c;b=b.fj();this.H.debug('Request headers',JSON.stringify(b,null,2));return b.origin?b.origin:b.Ty?(new URL(b.Ty)).origin:
|
|
1118
|
+
b[olympe.net.Aa.Headers.No]&&b[olympe.net.Aa.Headers.Oo]?b[olympe.net.Aa.Headers.Oo]+'://'+b[olympe.net.Aa.Headers.No]:null};this.F.G('manifest',`${this.G}/:${'appTag'}`,[olympe.net.Aa.Id.GET],(b,c)=>{const d=this;return v(function*(){var e=c.get('appTag');d.H.debug('Processing request to serve manifest for app',e);if(20!==e.length)return new olympe.net.be('Invalid appTag',olympe.net.Aa.Yb.Wk);try{var f=yield olympe.dc.pa.Fe(e,olympe.sc.qa.Rc).ob()}catch(h){return new olympe.net.be(`Something went wrong: ${'string'===
|
|
1119
|
+
typeof h?h:h.message}`,olympe.net.Aa.Yb.Wk)}if(0===f.size())return new olympe.net.be('App not found',olympe.net.Aa.Yb.Ol);var g=a(b);f=f.Fc();g={name:f.name(),short_name:f.name(),id:e,start_url:g?`${g}?hc.app=sc.runtime&sc.app=${e}`:void 0,display:'standalone',backgroundColor:'#fff',icons:g?[{src:`${g}/images/logo.svg`,sizes:'150x150',type:'image/png'},{src:`${g}/images/logo.png`,sizes:'1024x1024',type:'image/png',purpose:'maskable any'}]:void 0};f=olympe.W.getParameter(`app.manifest.${e}`);if(!f)f=
|
|
1120
|
+
{};else if('string'===typeof f)try{f=JSON.parse(f)}catch(h){d.H.warn(`Invalid manifest app config for app: ${e}`),f={}}e=Object.assign({},g,d.C,f);return new olympe.net.be(JSON.stringify(e),olympe.net.Aa.Yb.xh,void 0,{'content-type':'application/json'})})}).catch(()=>this.H.error('Error while starting the RuntimeHTTPService'));this.H.debug('Started RuntimeHTTPService')}};function yn(a){var b=olympe.dm.DataSource.SERVER;const c=olympe.dc.pa.from(a).ib(olympe.sc.qa.Rc.C).ib(olympe.dm.rd.G.bc()).ib(olympe.dm.rd.C).md();a=olympe.dc.pa.from(a).ib(olympe.sc.qa.Rc.C).ib(olympe.dm.kb.F).md();return c.concat(a).has(b)}
|
|
1121
|
+
olympe.sc.Jb.kk=class extends olympe.dc.sources.kk{T(a){return this.db.Rb(a,olympe.sc.yc)}Z(a,b){if(!this.J){super.init();var c=olympe.dc.gd.from(a).ib(olympe.sc.qa.Rc.C).md();if(!(c instanceof olympe.dm.kb))throw Error(`Impossible to initialize the source solver for the application ${a}: no project is linked to it`);b=b?olympe.dc.pa.Zc.$l:olympe.dc.pa.Zc.Qf;kk(this,c,b);c=new olympe.D.Xb('deployed data sources');olympe.dc.pa.from(a).ib(olympe.sc.qa.Rc.ja).observe(c,{Pd:b}).subscribe(d=>{const e=
|
|
1122
|
+
new olympe.dc.Xa;qf(d).forEach(f=>{e.Ma(olympe.dm.DataSource.mj,this.C,f)});pf(d).forEach(f=>{e.hc(olympe.dm.DataSource.mj,this.C,f)});e.ob()})}}};olympe.sc.Jb.R={Yf:'sc.runtime.Main',Re:'sc.runtime.SourceSolver',Aq:'sc.runtime.appConfig',Cq:'sc.runtime.runtimeHTTPServiceConfig',Bq:'sc.runtime.RuntimeHTTPService',Vp:'sc.runtime.OfflineAppConfig'};olympe.sc.Jb.V={hp:'app.httpManifestPath',Fp:'app.manifest.common',Bp:'sc.loadBusinessContainer'};
|
|
1123
|
+
olympe.W.config(function(a){F(a,olympe.sc.Jb.V.hp,'/runtime/manifest');F(a,olympe.sc.Jb.V.Fp,null);F(a,olympe.sc.Jb.V.Bp,!0);E(a,olympe.Db.R.Jg,[new olympe.W.oa(olympe.wc.V.Je),new olympe.W.oa(olympe.sc.V.Je)],(b,c)=>`${b}${c?'-'+c:''}`);E(a,olympe.sc.Jb.R.Vp,[new olympe.W.oa(olympe.sc.V.Je),new olympe.W.oa(olympe.net.V.Ii),new olympe.W.oa(olympe.net.V.Ql)],(b,c,d)=>{let e;const f=null!=(e=a.getParameter(`offline.${b}.enabled`))?e:c;let g;b=null!=(g=a.getParameter(`offline.${b}.autoBackOnline`))?
|
|
1124
|
+
g:d;return new Map([['offlineEnabled',f],['offlineAutoBackOnline',!f||b]])});Oa(a,olympe.net.R.Rl,olympe.sc.Jb.R.Vp);C(a,olympe.sc.Jb.R.Re,olympe.sc.Jb.kk,olympe.dc.R.jh,new olympe.W.oa(olympe.dc.V.Hg),new olympe.W.oa(olympe.dc.V.nl));Oa(a,olympe.dc.sources.R.Re,olympe.sc.Jb.R.Re);E(a,olympe.sc.Jb.R.Aq,[new olympe.W.oa(olympe.sc.V.Je),new olympe.W.oa(olympe.dc.V.Gh),new olympe.W.oa(olympe.sc.V.po),new olympe.W.oa(olympe.sc.V.xn),new olympe.W.oa(olympe.sc.Jb.V.Bp)],(b,c,d,e,f)=>new Map([['appTag',
|
|
1125
|
+
b],['getContextMode',c],['debuggerName',d],['autostartProfiler',e],['loadBusinessContainer',f]]));C(a,olympe.sc.Jb.R.Yf,olympe.sc.Jb.hm,olympe.sc.R.Ca,olympe.auth.R.Ea,olympe.N.R.ff,olympe.dc.query.R.Yj,olympe.host.R.Pe,olympe.sc.R.ck,olympe.sc.Jb.R.Re,olympe.Y.R.Xf,olympe.sc.Jb.R.Aq,olympe.sc.Jb.R.Bq);E(a,olympe.sc.Jb.R.Cq,[new olympe.W.oa(olympe.sc.Jb.V.hp),new olympe.W.oa(olympe.sc.Jb.V.Fp)],(b,c)=>new Map([['httpManifestPath',b],['manifestCommon',c]]));C(a,olympe.sc.Jb.R.Bq,olympe.sc.Jb.nv,olympe.sc.R.Ca,
|
|
1126
|
+
olympe.net.R.Ui,olympe.sc.R.ck,olympe.sc.Jb.R.Cq);olympe.wc.nj(a,olympe.sc.Jb.R.Yf,'sc.runtime');olympe.wc.nj(a,olympe.sc.Jb.R.Yf,'sc.headless');olympe.wc.nj(a,olympe.sc.Jb.R.Yf)},'olympe.sc.runtime');olympe.public={};olympe.public.Ka=class a{static Uw(b,c){const d=new SRPClient,e=d.generateRandomSalt();return{username:b,login:b,salt:e,verifier:d.generateVerifier(e,b,c)}}static getState(){return Me(olympe.public.Ka.get())}static Ik(b){return a.F(olympe.public.Ka.get().Ik(),b).pipe(rxjs.operators.map(c=>c.valueOf()))}static ix(){return olympe.D.Na(olympe.public.Ka.get().me())}static Jy(b){return a.F(olympe.public.Ka.get().me(),b)}static le(){var b=olympe.D,c=b.Na;var d=olympe.public.Ka.get().C.sb().wd();return c.call(b,
|
|
1127
|
+
d)}static hg(){return new Promise((b,c)=>{olympe.public.Ka.get().hg(d=>d?c(d):b())})}static vx(){return olympe.D.Na(olympe.public.Ka.get().Yh())||void 0}static Vx(){const b=id(olympe.public.Ka.get());return{user:b.Bc(),userTag:b.me(),nonce:b.wd(),payload:b.zi(),idpName:b.nf(),protocol:b.wg()}}static ux(){return Array.from(Ne().keys())}static cf(){olympe.public.Ka.get().cf()}static Yg(b){return new Promise((c,d)=>{olympe.public.Ka.get().Yg(b,e=>e?d(e):c())})}static qy(b,c){return olympe.public.Ka.C((new Map).set('username',
|
|
1128
|
+
b).set('password',c),olympe.auth.Ec.C.SRP)}static sy(b){const c=Ne();if(0===c.size||b&&!c.has(b)){var d=0===c.size?'There are no available IDPs':`The IDP name ${b} is not valid, the valid names are ${Array.from(c.keys())}`;return Promise.reject(d)}b?(d=b,b=c.get(b)):(b=Array.from(c)[0],d=b[0],b=b[1]);return olympe.public.Ka.C((new Map).set('idpName',d),b)}static py(){return olympe.public.Ka.C(new Map,olympe.auth.Ec.C.SAML)}static ty(b,c){return olympe.public.Ka.C((new Map).set('username',b).set('nonce',
|
|
1129
|
+
c),olympe.auth.Ec.C.Sl)}static oy(){return olympe.public.Ka.C(new Map,olympe.auth.Ec.C.OAUTH2)}static bi(){return olympe.public.Ka.get().bi()}static C(b,c){const d=new olympe.auth.Request;for(const [e,f]of b)d.set(e,f);return new Promise(e=>{Le(olympe.public.Ka.get(),d,c,()=>{e()})})}static get(){return olympe.auth.je()}static F(b,c){return b.asObservable('function'===typeof c.F?c.F():c)}};olympe.public.Ka.logout=olympe.public.Ka.bi;olympe.public.Ka.loginOpenID=olympe.public.Ka.oy;
|
|
1130
1130
|
olympe.public.Ka.loginToken=olympe.public.Ka.ty;olympe.public.Ka.loginSAML=olympe.public.Ka.py;olympe.public.Ka.loginSSO=olympe.public.Ka.sy;olympe.public.Ka.loginSRP=olympe.public.Ka.qy;olympe.public.Ka.getUserFromToken=olympe.public.Ka.Yg;olympe.public.Ka.sendKeepAlive=olympe.public.Ka.cf;olympe.public.Ka.getIDPNames=olympe.public.Ka.ux;olympe.public.Ka.getUserToken=olympe.public.Ka.Vx;olympe.public.Ka.getIDPToken=olympe.public.Ka.vx;olympe.public.Ka.refreshToken=olympe.public.Ka.hg;
|
|
1131
|
-
olympe.public.Ka.getToken=olympe.public.Ka.le;olympe.public.Ka.observeUser=olympe.public.Ka.Jy;olympe.public.Ka.getCurrentUser=olympe.public.Ka.ix;olympe.public.Ka.isAuthenticated=olympe.public.Ka.
|
|
1132
|
-
olympe.public.gf=class{static create(a){return new class extends olympe.dc.vc.kg{G(b,c){return olympe.dc.CloudObject.get(c)}compare(b,c){b=a(b,c);if('number'===typeof b)return b;const d=olympe.D.ec(olympe.D.ba),e=b.subscribe(f=>d.update(olympe.D.ra(f)));olympe.D.Wa().Z(()=>e.unsubscribe());return d.sb()}}}};olympe.public.Process=class{static Ky(a,b){if('string'===typeof b)throw Error('When registering a health check, the options parameter should be an object: string is not supported anymore.');const c=olympe.host.
|
|
1131
|
+
olympe.public.Ka.getToken=olympe.public.Ka.le;olympe.public.Ka.observeUser=olympe.public.Ka.Jy;olympe.public.Ka.getCurrentUser=olympe.public.Ka.ix;olympe.public.Ka.isAuthenticated=olympe.public.Ka.Ik;olympe.public.Ka.getState=olympe.public.Ka.getState;olympe.public.Ka.generateSRPData=olympe.public.Ka.Uw;olympe.public.Ba=class{static create(a){return new class extends olympe.dc.$.kg{C(b,c){b=a(olympe.dc.CloudObject.get(c));if('boolean'===typeof b)return b;const d=olympe.D.ec(olympe.D.fa),e=b.subscribe(f=>d.update(olympe.D.Sb(f)));olympe.D.Wa().Z(()=>e.unsubscribe());return d.sb()}}}};
|
|
1132
|
+
olympe.public.gf=class{static create(a){return new class extends olympe.dc.vc.kg{G(b,c){return olympe.dc.CloudObject.get(c)}compare(b,c){b=a(b,c);if('number'===typeof b)return b;const d=olympe.D.ec(olympe.D.ba),e=b.subscribe(f=>d.update(olympe.D.ra(f)));olympe.D.Wa().Z(()=>e.unsubscribe());return d.sb()}}}};olympe.public.Process=class{static Ky(a,b){if('string'===typeof b)throw Error('When registering a health check, the options parameter should be an object: string is not supported anymore.');const c=olympe.host.Ck(),d=c.C(a,void 0,null==b?void 0:b.type);return()=>c.G(d)}static Ly(a,b){const c=olympe.host.Ck(),d=c.F(a,b);return()=>c.O(d)}static connect(){return olympe.N.Om().connect()}static disconnect(){return olympe.N.Om().disconnect()}static Kf(a){a='function'===typeof a.F?a.F():a;return olympe.N.Om().Kf().asObservable(a).pipe(rxjs.operators.map(b=>
|
|
1133
1133
|
b.valueOf()))}};olympe.public.Process.isOnline=olympe.public.Process.Kf;olympe.public.Process.disconnect=olympe.public.Process.disconnect;olympe.public.Process.connect=olympe.public.Process.connect;olympe.public.Process.onShutdown=olympe.public.Process.Ly;olympe.public.Process.onHealthCheck=olympe.public.Process.Ky;'object'===typeof exports&&(exports={CloudObject:olympe.dc.CloudObject,Relation:olympe.dc.Pa.Relation,Direction:olympe.dc.wa,generateTag:olympe.Y.Cf,tagToString:olympe.dc.ga,register:olympe.dc.register,defineProperty:olympe.dc.defineProperty,defineRelation:olympe.dc.Cr,defineInverseRelation:olympe.dc.Ew,BrickContext:olympe.sc.xa,Brick:olympe.sc.logic.Function,ActionBrick:olympe.sc.logic.Action,GlobalProperties:olympe.sc.xa.C,registerBrick:olympe.sc.logic.na.C,FunctionBrick:olympe.sc.logic.Function,
|
|
1134
1134
|
Context:olympe.sc.xa,Entry:olympe.dc.Pa.Entry,PropertyModel:olympe.dm.Property,RelationModel:olympe.dm.Relation,StringModel:olympe.dm.String,NumberModel:olympe.dm.Number,BooleanModel:olympe.dm.Boolean,DatetimeModel:olympe.dm.DateTime,ColorModel:olympe.dm.Color,File:olympe.sc.File,User:olympe.dm.User,Enum:olympe.dm.Wf,EnumValue:olympe.sc.oi,DataSource:olympe.dm.DataSource,DataResult:olympe.dc.query.td,Workflow:olympe.sc.workflow.Workflow,WorkflowState:olympe.sc.workflow.Te,WorkflowTransition:olympe.sc.workflow.Transition,
|
|
1135
|
-
WorkflowObjectState:olympe.sc.workflow.ObjectState,Transaction:olympe.sc.Xa,BurstTransaction:olympe.dc.ji,TransactionResult:olympe.sc.Si,PredefinedDataSource:olympe.dc.Sa,QueryResult:olympe.dc.Ra,Query:olympe.dc.pa,QuerySingle:olympe.dc.gd,Predicate:olympe.dc.query.Ba,Order:olympe.dc.query.
|
|
1136
|
-
a),getProcessingStatus:()=>olympe.dc.sources.Xd().Gc(),getProcessingErrors:()=>olympe.dc.sources.Xd().
|
|
1135
|
+
WorkflowObjectState:olympe.sc.workflow.ObjectState,Transaction:olympe.sc.Xa,BurstTransaction:olympe.dc.ji,TransactionResult:olympe.sc.Si,PredefinedDataSource:olympe.dc.Sa,QueryResult:olympe.dc.Ra,Query:olympe.dc.pa,QuerySingle:olympe.dc.gd,Predicate:olympe.dc.query.Ba,Order:olympe.dc.query.Wj,Config:class{static getParameter(a){return olympe.W.getParameter(a)}},Process:olympe.public.Process,ProbeType:olympe.host.ze.C,Cache:{getCacheEntries:()=>olympe.dc.sources.Xd().O,clearCache:a=>Ak(olympe.dc.sources.Xd(),
|
|
1136
|
+
a),getProcessingStatus:()=>olympe.dc.sources.Xd().Gc(),getProcessingErrors:()=>olympe.dc.sources.Xd().oc.asObservable(),hasPendingChanges:()=>olympe.dc.sources.Xd().ea.asObservable(),synchroniseChanges:()=>Gk(),getPendingChanges:()=>Jk(),clearPendingChanges:()=>Nk(),loadPendingChanges:a=>Lk(a)},Color:olympe.D.Color,ErrorFlow:olympe.sc.logic.Error,ServiceRequestType:olympe.N.cb.C,ServiceRequest:olympe.N.Sc,Service:olympe.N.wb,Auth:olympe.public.Ka,AuthState:{INIT:olympe.auth.Ta.C.INIT,AUTHENTICATING:olympe.auth.Ta.C.tj,
|
|
1137
1137
|
GUEST:olympe.auth.Ta.C.si,AUTHENTICATED:olympe.auth.Ta.C.df,ERROR:olympe.auth.Ta.C.xb},AuthProtocol:olympe.auth.Ec.C,Sync:olympe.dc.CloudObject,BusinessObject:olympe.dc.CloudObject,StringPrimitive:olympe.dm.String,NumberPrimitive:olympe.dm.Number,BooleanPrimitive:olympe.dm.Boolean,DatetimePrimitive:olympe.dm.DateTime,ColorPrimitive:olympe.dm.Color,PropertyPrimitive:olympe.dm.Property,RelationPrimitive:olympe.dm.Relation,DBView:class extends olympe.dc.lb{static get(){return olympe.dc.ia()}},ListDef:olympe.dc.za,
|
|
1138
1138
|
instanceToTag:olympe.dc.ga,registerSync:olympe.dc.na.C,getUniqueTag:olympe.Y.Cf,onDestroy:a=>olympe.D.Wa().onDestroy(a),offDestroy:a=>olympe.D.Wa().Mf(a),FollowRules:olympe.dc.Nb,transformers:{Related:olympe.dc.da.Qe,RecursiveRelated:olympe.dc.da.Ae,Distinct:olympe.dc.da.mi,Filter:olympe.dc.da.jf,Limit:olympe.dc.da.uh,Sort:olympe.dc.da.Kg,Union:olympe.dc.da.xf},ListDefPredicate:olympe.public.Ba,predicates:{And:olympe.dc.$.Fd,Or:olympe.dc.$.xe,Not:olympe.dc.$.de,Equals:olympe.dc.$.se,Contains:olympe.dc.$.hf,
|
|
1139
|
-
Greater:olympe.dc.$.
|
|
1139
|
+
Greater:olympe.dc.$.Mj,Smaller:olympe.dc.$.jk,HasRelated:olympe.dc.$.vi,InstanceOf:olympe.dc.$.yi,Regex:olympe.dc.$.uf},Comparator:olympe.public.gf,comparators:{Number:olympe.dc.vc.Number,String:olympe.dc.vc.String,DateTime:olympe.dc.vc.DateTime},valuedefs:{BooleanProperty:olympe.dc.$a.xj,StringProperty:olympe.dc.$a.Oi,NumberProperty:olympe.dc.$a.Hi,DateTimeProperty:olympe.dc.$a.li,Constant:olympe.dc.$a.Le,Tag:olympe.dc.$a.Qi}});
|
|
1140
1140
|
|
|
1141
1141
|
|
|
1142
1142
|
}.bind(this))();
|