@olympeio/runtime-node 9.4.3 → 9.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js
CHANGED
|
@@ -232,16 +232,16 @@ Oa(a,g);d='';e=0;b=0<=b?b:32;for(f=0;4>f;f++)for(h=a[f],g=0;4>g;g++){if(++e>b)re
|
|
|
232
232
|
r=decodeURIComponent(r);b[q[1]]=r}return{scheme:a||null,WA:g||null,Hq:m||null,host:n||null,port:p&&parseInt(p,10)||null,path:h&&'/'!==h?h:null,query:k||null,oB:f||null,parameters:b}};olympe.Z.HB=function(a){a=a.substring(1);return''===a?new Map:new Map(a.split('&').map(b=>b.split('=')))};olympe.Z.MB=function(a){let b='';for(let c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b+=(b?'&':'?')+c+'='+encodeURIComponent(a[c]));return b};
|
|
233
233
|
olympe.Z.Yu=a=>{var b=olympe.O.ae;const c=Object.keys(b).find(d=>b[d]===a);return void 0===c?null:c};olympe.Z.pm=(a,b)=>{if(b instanceof Object)for(const c of Object.keys(b)){const d=b[c];d instanceof Object&&void 0!==a[c]?olympe.Z.pm(a[c],d):a[c]=d}};olympe.Z.Cd=(a,b,c)=>{const d=Object.create(null);b(a,e=>{olympe.Z.pm(d,e);b(`conf.d/${a}`,f=>{olympe.Z.pm(d,f);c(d)})})};olympe.Z.VA=class a{constructor(b,c){this.x=b;this.y=c}add(b){return new a(this.x+b.x,this.y+b.y)}Zl(){return Math.sqrt(this.x*this.x+this.y*this.y)}toString(){return`Vector(${this.x}, ${this.y})`}};olympe.Z.Vw=class{constructor(a,b,c,d){this.from=a;this.target=b;this.C=c;this.F=d}toString(){return`(${this.from.toString()}, ${this.target.toString()}, ${this.C.toString()}, ${this.F.toString()})`}};olympe.Z.Ds=class{constructor(a,b){this.start=a;this.end=b}};olympe.Z.Ds.C={ty:'left',iz:'right',Tw:'bottom',rA:'top'};function Qa(a){return`${a.C}.${a.F}.${a.G}`}
|
|
234
234
|
olympe.Z.bf=class{constructor(a,b,c,d){this.C=a;this.F=b;this.G=c;this.L=d||null}static parse(a){a=/([0-9]*)\.([0-9]*)\.([0-9]*)-?([A-z\-_0-9]*)/.exec(a);if(null===a||4>a.length)return olympe.Z.bf.C;const b=Number.parseInt(a[1],10),c=Number.parseInt(a[2],10),d=Number.parseInt(a[3],10);return isNaN(b)||isNaN(c)||isNaN(d)?olympe.Z.bf.C:new olympe.Z.bf(b,c,d,a[4])}Tj(a){return this.C!==a.C?this.C>a.C:this.F!==a.F?this.F>a.F:this.G>a.G}Ci(a){return this.C!==a.C?this.C<a.C:this.F!==a.F?this.F<a.F:this.G<
|
|
235
|
-
a.G}Ha(a){return this.C===a.C&&this.F===a.F&&this.G===a.G}toString(){return`${this.C}.${this.F}.${this.G}`+(null!==this.L?`-${this.L}`:'')}};olympe.Z.bf.C=new olympe.Z.bf(Number.NaN,Number.NaN,Number.NaN);olympe.Z.R={Cg:'utils.binaryConverter',Tq:'utils.base64Converter'};olympe.V.config(a=>{wa(a,olympe.Z.R.Cg);va(a,olympe.Z.R.Tq,olympe.Z.R.Cg,!0)},'Utils services');olympe.V.run([olympe.Z.R.Cg],a=>{olympe.Z.De=()=>a});olympe.la={};olympe.la.Ab=class{$(){}L(){}C(){}na(){}P(){}Da(){}da(){}
|
|
235
|
+
a.G}Ha(a){return this.C===a.C&&this.F===a.F&&this.G===a.G}toString(){return`${this.C}.${this.F}.${this.G}`+(null!==this.L?`-${this.L}`:'')}};olympe.Z.bf.C=new olympe.Z.bf(Number.NaN,Number.NaN,Number.NaN);olympe.Z.R={Cg:'utils.binaryConverter',Tq:'utils.base64Converter'};olympe.V.config(a=>{wa(a,olympe.Z.R.Cg);va(a,olympe.Z.R.Tq,olympe.Z.R.Cg,!0)},'Utils services');olympe.V.run([olympe.Z.R.Cg],a=>{olympe.Z.De=()=>a});olympe.la={};olympe.la.Ab=class{$(){}L(){}C(){}na(){}P(){}Da(){}da(){}ga(){}trace(){}debug(){}log(){}info(){}warn(){}error(){}fatal(){}};olympe.la.Ab.prototype.fatal=olympe.la.Ab.prototype.fatal;olympe.la.Ab.prototype.error=olympe.la.Ab.prototype.error;olympe.la.Ab.prototype.warn=olympe.la.Ab.prototype.warn;olympe.la.Ab.prototype.info=olympe.la.Ab.prototype.info;olympe.la.Ab.prototype.log=olympe.la.Ab.prototype.log;olympe.la.Ab.prototype.debug=olympe.la.Ab.prototype.debug;olympe.la.Ab.prototype.trace=olympe.la.Ab.prototype.trace;
|
|
236
236
|
olympe.la.Ab.C={vt:0,uf:1,zs:2,bo:3,It:4,Db:5,wr:6,bl:7};olympe.la.Ab.F={0:'TRACE',1:'DEBUG',2:'LOG',3:'INFO',4:'WARN',5:'ERROR',6:'FATAL',7:'NOTHING'};olympe.la.Ba=class{Fc(){}};olympe.la.Vd={};function Ra(a,b,c,d){a.Wa[b](`[OLYMPE.${c}]:`,d.join(' '));if(0<a.T.size){var e=new Date;e=('00'+e.getHours()).substring(-2)+':'+('00'+e.getMinutes()).substring(-2)+':'+('00'+e.getSeconds()).substring(-2)+'.'+('00'+e.getMilliseconds()).substring(-3);for(const f of a.T.values())f(e,c,b,...d)}}
|
|
237
|
-
olympe.la.Vd.Ab=class{constructor(a,b){this.name=a;this.F=b;this.G=a.toUpperCase();this.T=new Map;this.Wa=console}$(){return this.F}L(){return this.F<=olympe.la.Ab.C.vt}C(){return this.F<=olympe.la.Ab.C.uf}P(){return this.F<=olympe.la.Ab.C.zs}na(){return this.F<=olympe.la.Ab.C.bo}Da(){return this.F<=olympe.la.Ab.C.It}da(){return this.F<=olympe.la.Ab.C.Db}
|
|
238
|
-
Ra(this,'log',this.G,a)}info(...a){this.na()&&Ra(this,'info',this.G,a)}warn(...a){this.Da()&&Ra(this,'warn',this.G,a)}error(...a){this.da()&&Ra(this,'error',this.G,a)}fatal(...a){this.
|
|
237
|
+
olympe.la.Vd.Ab=class{constructor(a,b){this.name=a;this.F=b;this.G=a.toUpperCase();this.T=new Map;this.Wa=console}$(){return this.F}L(){return this.F<=olympe.la.Ab.C.vt}C(){return this.F<=olympe.la.Ab.C.uf}P(){return this.F<=olympe.la.Ab.C.zs}na(){return this.F<=olympe.la.Ab.C.bo}Da(){return this.F<=olympe.la.Ab.C.It}da(){return this.F<=olympe.la.Ab.C.Db}ga(){return this.F<=olympe.la.Ab.C.wr}trace(...a){this.L()&&Ra(this,'trace',this.G,a)}debug(...a){this.C()&&Ra(this,'debug',this.G,a)}log(...a){this.P()&&
|
|
238
|
+
Ra(this,'log',this.G,a)}info(...a){this.na()&&Ra(this,'info',this.G,a)}warn(...a){this.Da()&&Ra(this,'warn',this.G,a)}error(...a){this.da()&&Ra(this,'error',this.G,a)}fatal(...a){this.ga()&&Ra(this,'error',this.G,a)}};olympe.la.Vd.Ab.va=[olympe.la.Ab];olympe.la.Vd.Ba=class{constructor(a,b,c){this.C=a;this.F=parseInt(b,10);this.G=c;this.channels=new Map;this.K=this.Fc('logging');this.K.info('Logging initialized, global log level is '+olympe.la.Ab.F[b])}Fc(a){var b=this.channels.get(a);if(!b){b=this.F;var c=`${olympe.la.U.Zq}.${a}`;Object.prototype.hasOwnProperty.call(this.C.parameters,c.toLowerCase())&&(b=parseInt(this.C.getParameter(c),10));let d=this.G;c=`${c}.${olympe.la.U.kt}`;Object.prototype.hasOwnProperty.call(this.C.parameters,c.toLowerCase())&&
|
|
239
239
|
(d=!0===this.C.getParameter(c));b=new olympe.la.Vd.Ab(a,b,d);this.channels.set(a,b)}return b}};olympe.la.Vd.Ba.va=[olympe.la.Ba];olympe.la.R={Ga:'logging.Manager'};olympe.la.U={On:'logging',Pn:'logging.showLogLevel',Zq:'logging',kt:'showLogLevel'};olympe.V.config(function(a){F(a,olympe.la.U.On,olympe.la.Ab.C.bo);F(a,olympe.la.U.Pn,!0);ua(a,olympe.la.R.Ga,olympe.la.Vd.Ba,olympe.V.R.Sf,new olympe.V.ma(olympe.la.U.On),new olympe.V.ma(olympe.la.U.Pn))},'olympe.logging');olympe.V.run([olympe.la.R.Ga],a=>{olympe.la.fb=b=>a.Fc(b)},'Logging singleton getter initialization');olympe.D={};olympe.D.U={Ao:'df.nodeCreationThreshold'};const Sa=[];function Ua(){}function Va(){}olympe.D.H=class a{constructor(b,c,d){this.C=void 0===b?Ua:b;this.F=void 0===c?Sa:c;this.$=d}static L(){var b=[];return void 0===b||0===b.length?olympe.D.H.da:new a(Va,b)}L(){return this.C?this.C():void 0}G(){return this.F?this.F:Sa}P(){return null===this.C&&null===this.F}T(){return this.C===Va}};olympe.D.H.$=new olympe.D.H;olympe.D.H.C=new olympe.D.H(null,null);olympe.D.H.da=new olympe.D.H(Va);olympe.D.H.G=new olympe.D.H(()=>olympe.D.aa);
|
|
240
240
|
olympe.D.H.F=new olympe.D.H(()=>olympe.D.Ka);olympe.D.H.P=new olympe.D.H(()=>olympe.D.ea);olympe.D.H.T=new olympe.D.H(()=>olympe.D.Kb);olympe.D.Ig=class{W(){return''}zd(){return''}destroy(){}gb(){return!1}Bc(){return!1}run(a,...b){return a(...b)}G(a){return a}getParent(){return null}Lf(){}jd(){}qd(){}Hj(){}na(){}onDestroy(){return''}pf(){}$(){return''}ze(){}};olympe.D.Ig.prototype.offDestroy=olympe.D.Ig.prototype.pf;olympe.D.Ig.prototype.onDestroy=olympe.D.Ig.prototype.onDestroy;let Wa=0;olympe.V.run([new olympe.V.ma(olympe.D.U.Ao)],()=>{});
|
|
241
241
|
olympe.D.Jb=class{constructor(a='SimpleContext',b){++Wa;this.ub=new Map;this.mb=new Map;this.Wa=new Map;this.Wb=0;this.name=a;this.id=String(Wa);this.L=this.Eb=!1;(this.da=void 0===b?olympe.D.Ma():b)&&this.da.jd(this);this.debug=!1}W(){return this.id}zd(){return this.name}run(a,...b){if(!this.Eb){var c=olympe.D.Dq(this);a=a(...b);c&&olympe.D.Dq(c);return a}}G(a){return(...b)=>this.run(a,...b)}destroy(){if(!this.Eb&&!this.L){this.L=!0;this.na();for(const a of this.mb.keys())this.mb.has(a)&&this.mb.get(a)();
|
|
242
242
|
this.mb.clear();this.Wa.clear();this.da&&(this.da.qd(this,!1),this.da=null);this.Eb=!0;this.L=!1;this.na()}}gb(){return this.Eb}Bc(){return this.L}jd(a){if(!this.Eb){var b;olympe.D.Ya(a)?b=a.Aa:olympe.D.jm(a)&&(b=a);b&&this.ub.set(b.W(),b)}}qd(a,b=!0){let c;olympe.D.Ya(a)?c=a.Aa:olympe.D.jm(a)&&(c=a);c&&this.ub.has(c.W())&&(b&&c.Hj(this),this.ub.delete(c.W()))}Hj(){this.da=null;this.destroy()}na(){const a=this.ub;for(const b of a.keys())a.has(b)&&a.get(b).Hj(this);this.ub.clear();for(const b of this.Wa.keys())this.Wa.has(b)&&
|
|
243
243
|
this.Wa.get(b)();this.Wa.clear()}onDestroy(a,b){void 0===b&&(++this.Wb,b=String(this.Wb));this.mb.set(b,a);return b}pf(a){this.mb.delete(a)}$(a){if(void 0===b){++this.Wb;var b=String(this.Wb)}this.Wa.set(b,a);return b}ze(a){this.Wa.delete(a)}Lf(a){this.da&&this.da.qd(this,!1);(this.da=a||null)&&this.da.jd(this)}getParent(){return this.da}};olympe.D.pp=class extends olympe.D.Jb{constructor(){super('Root',null)}destroy(){}onDestroy(){return''}pf(){}};olympe.D.Ig.va=[olympe.D.Ig];let Xa=0;
|
|
244
|
-
function Ya(a,b){a.
|
|
244
|
+
function Ya(a,b){a.ga||(a.ga=new Map);a.ga.set(b.W(),b);switch(b.Rc()){case olympe.D.Node.C.Og:break;case olympe.D.Node.C.Yg:break;case olympe.D.Node.C.cj:case olympe.D.Node.C.wf:olympe.D.K.warn('Not bad as such but should not happen!');break;case olympe.D.Node.C.Jg:Za(a,olympe.D.Node.C.Jg);break;case olympe.D.Node.C.OBSOLETE:a.uc=!0;a.C!==olympe.D.Node.C.Jg&&Za(a,olympe.D.Node.C.OBSOLETE);break;case olympe.D.Node.C.vf:olympe.D.K.warn('Adding a destroyed node as upstream => should never happen!');break;
|
|
245
245
|
default:olympe.D.K.warn('Unknown state, investigate: ',b.Rc())}$a(b,a)}
|
|
246
246
|
function ab(a){if(a.cd){var b=[],c=[];if(a.qf)if(a.qf instanceof olympe.D.Node)if(bb(a.qf))b=a.qf.xb;else return;else b=a.qf;else b=null;if(null!==a.Da){const e=a.Jf;for(let f=0,g=a.Da.length;f<g;f++)if(null!==e&&-1<e.indexOf(f)){const h=a.Da[f];if(bb(h))c.push(h.xb);else return}else c.push(a.Da[f])}if(a.cd instanceof Function)var d=a.cd;else b&&(b[a.cd]||olympe.D.K.warn('looks like you forget a cast somewhere around '+a.cd),d=b[a.cd]);a.run(()=>{a.na();if(void 0!==d){const e=d.apply(b,c);e&&e.Up?
|
|
247
247
|
cb(a,e.Aa):e instanceof olympe.D.Node?cb(a,e):(L(a,e),void 0===e&&void 0===a.valueType&&Za(a,olympe.D.Node.C.Yg))}else db(a)})}}function N(a){void 0===a.ac&&(a.ac=a.valueType===olympe.D.Proxy?eb(void 0,a.ye):eb(a.valueType,a.ye),a.ac.Aa=a);return a.ac}function fb(a){void 0!==a.P&&(gb(a.P,a),a.P=void 0)}function hb(a){if(a.C===olympe.D.Node.C.OBSOLETE&&(a.C=olympe.D.Node.C.Yg,null!==a.T))for(const b of a.T.values())ib(b)}function Za(a,b){b!==a.C&&(a.C=b)}
|
|
@@ -250,12 +250,12 @@ function L(a,b,c){b instanceof olympe.D.Node&&(olympe.D.K.warn('We are setting t
|
|
|
250
250
|
a.W()+') value to get updated !');else{a.C===olympe.D.Node.C.vf&&olympe.D.K.warn(`trying to set a value on a destroyed node (#${a.W()} ${a.Xc?', '+a.Xc:''})`);a.C===olympe.D.Node.C.wf&&olympe.D.K.warn(`trying to set a value on a node being destroyed (#${a.W()} ${a.Xc?', '+a.Xc:''})`);a.Qb=!0;c=b;var d=!1,e=(f,g)=>f instanceof g?!0:!1;void 0===a.valueType||null===c||e(c,a.valueType)||(e=a.valueType&&a.valueType.name?a.valueType.name:'undefined',b='object'===typeof c?b.constructor.name:typeof c,c instanceof
|
|
251
251
|
Object?d=!0:b.toLowerCase()!==e.toLowerCase()&&a.valueType!==Object&&(d=!0),d&&('string'===b.toLowerCase()&&a.valueType===olympe.D.Ka?(c=olympe.D.sb(c),d=!1):'number'===b.toLowerCase()&&a.valueType===olympe.D.aa?(c=olympe.D.oa(c),d=!1):'boolean'===b.toLowerCase()&&a.valueType===olympe.D.ea&&(c=olympe.D.Ib(c),d=!1)));a.xb=c;Za(a,olympe.D.Node.C.Yg);if(b=a.T){d=0;for(const f of b.values())0<d&&jb(f),d++;for(const f of b.values())kb(f,a,c)}a.Qb=!1}}}
|
|
252
252
|
function lb(a,b){if(a.C!==olympe.D.Node.C.wf&&a.C!==olympe.D.Node.C.vf&&(a.C!==olympe.D.Node.C.Og||a.cd)){var c=void 0!==a.defaultValue;a.cd&&b!==a.P&&a.na();if(c)L(a,a.defaultValue,!0);else if(a.xb=void 0,Za(a,olympe.D.Node.C.Og),b=a.T)for(const d of b.values())lb(d,a)}}function db(a){if(a.C!==olympe.D.Node.C.Jg){Za(a,olympe.D.Node.C.Jg);var b=a.T;if(b)for(const c of b.values())db(c);a.na();void 0!==a.P&&fb(a);a.xb=a.defaultValue}}function bb(a){return a.C===olympe.D.Node.C.Yg}
|
|
253
|
-
function cb(a,b){b===a?olympe.D.K.error('Setting a node as provider of itself. Ignoring'):(a.P&&a.P!==b&&fb(a),$a(b,a),bb(b)?L(a,b.xb,!0):void 0!==a.defaultValue?L(a,a.defaultValue,!0):lb(a),a.P=b)}function mb(a,b){a.cd&&(a.cd=void 0);a.Xc='Repeater';cb(a,b)}function ib(a){a.P?hb(a):null!==a.
|
|
253
|
+
function cb(a,b){b===a?olympe.D.K.error('Setting a node as provider of itself. Ignoring'):(a.P&&a.P!==b&&fb(a),$a(b,a),bb(b)?L(a,b.xb,!0):void 0!==a.defaultValue?L(a,a.defaultValue,!0):lb(a),a.P=b)}function mb(a,b){a.cd&&(a.cd=void 0);a.Xc='Repeater';cb(a,b)}function ib(a){a.P?hb(a):null!==a.ga&&0===Array.from(a.ga.values()).filter(b=>!bb(b)).length&&(a.uc&&(a.uc=!1,ab(a)),hb(a))}
|
|
254
254
|
function $a(a,b){a.T||(a.T=new Map);a.T.set(b.W(),b);a.C===olympe.D.Node.C.vf&&olympe.D.K.warn('adding a downstream node on a deleted one (#'+a.W()+') !')}function gb(a,b){a.T&&(b=b.W(),a.T.has(b)&&(a.T.delete(b),nb(a)))}function nb(a){if(null===a.getParent()){var b=a.T;b&&0<b.size||a.destroy()}}
|
|
255
|
-
olympe.D.Node=class extends olympe.D.Jb{constructor({valueType:a,cd:b,mw:c=!0,qf:d,fm:e,debug:f=!1,Jf:g=null,Xc:h='Node',fi:k}={}){++Xa;super(String(Xa));this.debug=!!f;this.Xc=h;h&&'string'===typeof h||(b?this.Xc=b.name?b.name:'anon()':this.Xc='Node');this.Da=e&&0<e.length?e:null;this.Jf=g&&0<g.length?g:null;this.valueType=a;this.xb=void 0;this.Qb=!1;this.C=olympe.D.Node.C.Og;this.uc=!1;this.T=this.
|
|
255
|
+
olympe.D.Node=class extends olympe.D.Jb{constructor({valueType:a,cd:b,mw:c=!0,qf:d,fm:e,debug:f=!1,Jf:g=null,Xc:h='Node',fi:k}={}){++Xa;super(String(Xa));this.debug=!!f;this.Xc=h;h&&'string'===typeof h||(b?this.Xc=b.name?b.name:'anon()':this.Xc='Node');this.Da=e&&0<e.length?e:null;this.Jf=g&&0<g.length?g:null;this.valueType=a;this.xb=void 0;this.Qb=!1;this.C=olympe.D.Node.C.Og;this.uc=!1;this.T=this.ga=null;this.cd=b;this.qf=d||null;this.defaultValue=this.ac=this.P=void 0;this.fi=k;d&&d instanceof
|
|
256
256
|
olympe.D.Node&&Ya(this,d);if(g)for(b=0;b<g.length;b++)a=e[g[b]],Ya(this,a);c&&ab(this)}zg(a){this.defaultValue=a;this.C===olympe.D.Node.C.Og&&L(this,a,!0);return this}gi(a){this.valueType=a}Hb(){return this.valueType||Object}Rc(){return this.C}gb(){return this.C===olympe.D.Node.C.vf}Bc(){return this.C===olympe.D.Node.C.wf}ye(...a){if(this.fi instanceof Function)return this.fi(...a);var b=a.length;--b;const c=a[b];--b;const d=a[b],e=Array(b);for(var f=0;f<b;f++)e[f]=a[f];a=this.Rc();a!==olympe.D.Node.C.wf&&
|
|
257
257
|
a!==olympe.D.Node.C.vf||olympe.D.K.warn('Calling a function on a destroyed node!!!',this);a=d.G();b=[];if(1===a.length&&-1===a[0])for(var g of e)olympe.D.Ya(g)&&b.push(g.Aa);else for(let h=0,k=a.length;h<k;h++)g=a[h],f=e[g],void 0!==f&&null!==f&&f.bh&&(e[g]=f.Aa,b.push(g));return N(new olympe.D.Node({valueType:d.L(),cd:c,qf:this,fm:e,debug:!1,Jf:b,Xc:'Proxy.'+c+'()'}))}Hj(a){if(null===this.getParent())olympe.D.K.warn('context is undefined, investigate');else if(this.getParent()!==a){olympe.D.K.warn('Investigate a potential issue in creator-createe link: create node mismatch',
|
|
258
|
-
a,this.getParent());return}this.Lf(null);nb(this)}destroy(){var a=this.C;if(a!==olympe.D.Node.C.wf&&a!==olympe.D.Node.C.vf){Za(this,olympe.D.Node.C.wf);if(a=this.T){for(const c of a.values())if(a.has(c.W())){var b=c;b.
|
|
258
|
+
a,this.getParent());return}this.Lf(null);nb(this)}destroy(){var a=this.C;if(a!==olympe.D.Node.C.wf&&a!==olympe.D.Node.C.vf){Za(this,olympe.D.Node.C.wf);if(a=this.T){for(const c of a.values())if(a.has(c.W())){var b=c;b.ga&&b.ga.delete(this.W());b.P&&b.P.W()===this.W()?b.P=void 0:b.destroy()}a.clear()}this.T=null;super.destroy();if(this.ga){for(const c of this.ga.values())this.ga.has(c.W())&&gb(c,this);this.ga.clear()}this.ga=null;this.P&&(gb(this.P,this),this.P=void 0);this.xb=void 0;this.Da&&(this.Da.length=
|
|
259
259
|
0,this.Da=null);this.Jf&&(this.Jf.length=0,this.Jf=null);this.fi=this.cd=void 0;this.defaultValue=this.qf=null;this.Xc=`** Destroyed ** ${this.Xc}`;Za(this,olympe.D.Node.C.vf)}}zd(){return this.Xc}};olympe.D.Node.F='rootNode';olympe.D.Node.C={Og:0,Yg:1,Jg:3,cj:4,OBSOLETE:5,wf:6,vf:7};function eb(a,b){if('function'!==typeof a)return new olympe.D.Proxy(a,b);var c=olympe.D.Proxy.prototype;void 0===a.prototype&&olympe.D.K.error('investigate');c=Object.create(ob(c,a.prototype));c.Ej=a;c.Vp=b;return c}function ob(a,b){Object.prototype.hasOwnProperty.call(b,olympe.D.Proxy.il)||Object.defineProperty(b,olympe.D.Proxy.il,{enumerable:!1,configurable:!1,writable:!1,value:pb(a,b)});return b[olympe.D.Proxy.il]}
|
|
260
260
|
function qb(a,b){if(a.Ej!==b){a.Ej=b;b.prototype||olympe.D.K.error('Cast not possible, provided type is not a valid type!');var c=ob(a,b.prototype);Object.setPrototypeOf?Object.setPrototypeOf(a,c):a.__proto__=c;a.Aa&&a.Aa.gi(b)}}
|
|
261
261
|
function pb(a,b){let c={};if(b.prototype)olympe.D.K.error('first level of prototyping, investigate');else if(b.__proto__)c=Object.create(ob(a,b.__proto__));else return olympe.D.Proxy.prototype;Object.getOwnPropertyNames(b).forEach(d=>{if('function'===typeof b[d]&&'__getReplacementFunction'!==d){var e=b[d].J;null===e||e&&e.P()?c[d]=function(...f){var g=this.Aa;if(g&&bb(g)&&(g=g.xb)&&g[d]&&'function'===typeof g[d])return g[d].apply(g,f)}:(e=e||b[d].__oSig__||olympe.D.H.$,c[d]=function(...f){f=this.Vp.call(this.Aa,
|
|
@@ -319,12 +319,12 @@ b){this.Eb[a]=b;olympe.D.Ma().$(()=>{const c=this.$;for(const d in c)Object.prot
|
|
|
319
319
|
a(b[c],c,this))break}Gj(a,b){void 0!==this.values[a]&&this.ei(a,!0);this.values[a]=b;var c=this.Da;null!==c&&void 0!==c[a]&&(b&&b instanceof olympe.D.Proxy?sb(c[a],b):O(c[a],b));c=this.ub;null!==c&&void 0!==c[a]&&tb(c[a],!0);this.size++;c=this.Eb;for(const d in c)if(Object.prototype.hasOwnProperty.call(c,d))c[d](b,a,this)}ei(a,b){const c=this.values;if(Object.prototype.hasOwnProperty.call(c,a)){var d=(d=c[a])&&d.bh?d.Aa.xb:d;var e=this.Da;null!==e&&void 0!==e[a]&&rb(e[a]);e=this.ub;null!==e&&void 0!==
|
|
320
320
|
e[a]&&tb(e[a],!1);delete c[a];this.size--;b||this.cf()}a=this.$[a];if(void 0!==a)for(const f in a)Object.prototype.hasOwnProperty.call(a,f)&&a[f].destroy();return d}cf(){null!==this.L&&tb(this.L,this.size)}dh(){var a=this.Da;if(null!==a)for(const c in a)Object.prototype.hasOwnProperty.call(a,c)&&rb(a[c]);a=this.ub;if(null!==a)for(var b in a)Object.prototype.hasOwnProperty.call(a,b)&&tb(a[b],!1);for(const c in this.values)Object.prototype.hasOwnProperty.call(this.values,c)&&delete this.values[c];for(const c in this.$)if(Object.prototype.hasOwnProperty.call(this.$,
|
|
321
321
|
c)){b=this.$[c];for(const d in b)Object.prototype.hasOwnProperty.call(b,d)&&b[d].destroy()}this.size=0;null!==this.L&&tb(this.L,this.size)}Yf(){const a=this.values;let b='\n';for(const c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b+=a[c]+'\n');return b}};olympe.D.xh.va=[olympe.D.Vf];l=olympe.D.xh.prototype;l.getContext.J=olympe.D.H.C;l.Hb.J=olympe.D.H.C;l.md.J=olympe.D.H.C;l.get.J=new olympe.D.H(()=>Object,[],'valueType');l.lh.J=olympe.D.H.C;l.has.J=olympe.D.H.P;l.vg.J=olympe.D.H.C;l.li.J=olympe.D.H.C;
|
|
322
|
-
l.Te.J=olympe.D.H.G;l.Nf.J=olympe.D.H.C;l.forEach.J=new olympe.D.H(()=>{},[]);l.Dl.J=olympe.D.H.C;l.Cl.J=olympe.D.H.C;l.Wp.J=olympe.D.H.C;l.Gl.J=olympe.D.H.C;l.Pd.J=olympe.D.H.C;l.Gj.J=olympe.D.H.C;l.ei.J=olympe.D.H.C;l.cf.J=olympe.D.H.C;l.dh.J=olympe.D.H.C;l.Yf.J=olympe.D.H.C;olympe.D.Hi=class extends olympe.D.xh{constructor(a,b){super(a,b);this.F=Object.create(null);this.C=[];this.na=this.Wa=this.mb=this.
|
|
322
|
+
l.Te.J=olympe.D.H.G;l.Nf.J=olympe.D.H.C;l.forEach.J=new olympe.D.H(()=>{},[]);l.Dl.J=olympe.D.H.C;l.Cl.J=olympe.D.H.C;l.Wp.J=olympe.D.H.C;l.Gl.J=olympe.D.H.C;l.Pd.J=olympe.D.H.C;l.Gj.J=olympe.D.H.C;l.ei.J=olympe.D.H.C;l.cf.J=olympe.D.H.C;l.dh.J=olympe.D.H.C;l.Yf.J=olympe.D.H.C;olympe.D.Hi=class extends olympe.D.xh{constructor(a,b){super(a,b);this.F=Object.create(null);this.C=[];this.na=this.Wa=this.mb=this.ga=null}md(a){super.md(a);if(null!==this.na)for(let b of this.na.values())qb(b,a)}xc(){return this.Qd(0)}hf(){return this.He(0)}Ed(a){const b=c=>{null===this.mb&&(this.mb=Object.create(null));let d=this.gf(a);d=void 0!==d?olympe.D.oa(d):void 0;return this.li(this.mb,c,d,olympe.D.aa,`List.getRank(${c})`)};return olympe.D.Ya(a)?N(olympe.D.createNode(olympe.D.aa,b,null,
|
|
323
323
|
[a.Aa],[0],'onResolved('+(b.name||'')+')')):b(a)}gf(a){return this.F[a]}He(a){const b=c=>{const d=c.valueOf(),e=this.ff(d);null===this.Wa&&(this.Wa=Object.create(null));return this.li(this.Wa,String(d),e,String,'List.getKeyAt('+c+')')};return olympe.D.sa([a],c=>b(c),String)}ff(a){return this.C[a.valueOf()]}Qd(a){if(olympe.D.Ya(a))return this.get(olympe.D.sa([a],c=>{c=this.He(c);if(!bb(c.Aa)){const d=olympe.D.Ma();olympe.D.mf(d)&&lb(d)}return c},String));null===this.na&&(this.na=new Map);let b=this.na.get(a);
|
|
324
|
-
b||this.P.run(()=>{b=this.get(this.He(a));this.na.set(a,b);b.Aa.onDestroy(()=>this.na.delete(a))});return b}Fe(a){return this.lh(this.ff(a))}ii(a,b,c,d){let e=this.Dl();a=this.yq(e,a,b,c,d);this.Cl(e,a)}yq(a,b,c,d,e){return olympe.D.Ma().G((f,g)=>{let h=!1,k=olympe.D.vh([b,c,this.Ed(g)],(m,n,p)=>{p>=m&&p<m+n?h||(d(f,g,this),h=!0):h&&(e(g),h=!1)});if(void 0!==e)k.onDestroy(e.bind(null,g));this.Gl(a,g,k)})}nh(){null===this.
|
|
325
|
-
this.
|
|
326
|
-
c[a]&&O(c[a],olympe.D.oa(f)));null!==d&&(void 0!==e&&null!==e&&void 0!==d[e]&&rb(d[e]),void 0!==d[b]&&O(d[b],a))}}El(a){var b=this.Wa,c=this.F[a];null!==c&&void 0!==c&&null!==b&&(b=b[c],void 0!==b&&b.Aa.xb===a&&rb(b));delete this.F[a];this.C.splice(c,1);c=this.mb;null!==c&&void 0!==c[a]&&rb(c[a])}Xp(){if(null!==this.
|
|
327
|
-
a=this.Wa;if(null!==a)for(b in a)rb(a[parseInt(b,10)]);var b=this.
|
|
324
|
+
b||this.P.run(()=>{b=this.get(this.He(a));this.na.set(a,b);b.Aa.onDestroy(()=>this.na.delete(a))});return b}Fe(a){return this.lh(this.ff(a))}ii(a,b,c,d){let e=this.Dl();a=this.yq(e,a,b,c,d);this.Cl(e,a)}yq(a,b,c,d,e){return olympe.D.Ma().G((f,g)=>{let h=!1,k=olympe.D.vh([b,c,this.Ed(g)],(m,n,p)=>{p>=m&&p<m+n?h||(d(f,g,this),h=!0):h&&(e(g),h=!1)});if(void 0!==e)k.onDestroy(e.bind(null,g));this.Gl(a,g,k)})}nh(){null===this.ga&&this.P.run(()=>{this.ga=olympe.D.rd(Array,this.C.filter(a=>void 0!==a));
|
|
325
|
+
this.ga.Aa.onDestroy(()=>{this.L=null})});return this.ga}Pd(a){if(this.C.length!==this.size)super.Pd(a);else{var b=this.values;for(let c of this.C.filter(d=>void 0!==d))if(Object.prototype.hasOwnProperty.call(b,c)&&!1===a(b[c],c,this))break}}Fl(a,b){const c=this.mb,d=this.Wa,e=this.F[a],f=b.valueOf();if(e!==f||this.C[e]!==a){var g=this.C[f];void 0!==g&&delete this.F[g];void 0!==e&&null!==e&&this.C[e]===a&&(this.C[e]=void 0);this.F[a]=f;this.C[f]=a;null!==c&&(void 0!==g&&void 0!==c[g]&&rb(c[g]),void 0!==
|
|
326
|
+
c[a]&&O(c[a],olympe.D.oa(f)));null!==d&&(void 0!==e&&null!==e&&void 0!==d[e]&&rb(d[e]),void 0!==d[b]&&O(d[b],a))}}El(a){var b=this.Wa,c=this.F[a];null!==c&&void 0!==c&&null!==b&&(b=b[c],void 0!==b&&b.Aa.xb===a&&rb(b));delete this.F[a];this.C.splice(c,1);c=this.mb;null!==c&&void 0!==c[a]&&rb(c[a])}Xp(){if(null!==this.ga){const a=this.C,b=this.ga.Aa.xb;b&&a.join(',')!==b.join(',')&&O(this.ga,a)}}cf(){this.Xp();super.cf()}dh(){var a=this.F;for(b in a)delete a[b];this.C.length=0;a=this.mb;if(null!==a)for(b in a)rb(a[b]);
|
|
327
|
+
a=this.Wa;if(null!==a)for(b in a)rb(a[parseInt(b,10)]);var b=this.ga;null!==b&&(jb(b.Aa),O(b,this.C));return olympe.D.xh.prototype.dh.call(this)}Yf(){const a=this.values,b=this.F;let c='[\n';for(let d in a)Object.prototype.hasOwnProperty.call(a,d)&&(c+=`${b[d]}. ${a[d]}\n`);return c+']'}};olympe.D.Hi.va=[olympe.D.Qc];l=olympe.D.Hi.prototype;l.md.J=olympe.D.H.C;l.xc.J=new olympe.D.H(()=>Object,[]);l.hf.J=new olympe.D.H(()=>String,[]);l.Ed.J=olympe.D.H.G;l.gf.J=olympe.D.H.C;
|
|
328
328
|
l.He.J=new olympe.D.H(()=>String,[]);l.ff.J=olympe.D.H.C;l.Qd.J=new olympe.D.H(()=>Object,[]);l.Fe.J=olympe.D.H.C;l.ii.J=new olympe.D.H(()=>{},[]);l.yq.J=olympe.D.H.C;l.nh.J=new olympe.D.H(()=>Array,[]);l.Pd.J=olympe.D.H.C;l.Fl.J=olympe.D.H.C;l.El.J=olympe.D.H.C;l.Xp.J=olympe.D.H.C;l.cf.J=olympe.D.H.C;l.dh.J=olympe.D.H.C;l.Yf.J=olympe.D.H.C;olympe.D.Map=class extends olympe.D.xh{constructor(a){a===olympe.D.Proxy&&(a=Object);super(a);this.C=this.F=null}md(a){a===olympe.D.Proxy&&(a=Object);null!==this.F&&qb(this.F,a);super.md(a)}xc(){null===this.F&&this.Pl();return this.F}hf(){null===this.C&&this.Pl();return this.C}Pl(){this.getContext().run(()=>{this.F=olympe.D.rd(this.Hb());this.C=olympe.D.rd(String);this.Bi(this.Sl())})}Sl(){const a=this.values;let b,c;for(b in a)if(Object.prototype.hasOwnProperty.call(a,b)){c=b;break}return c}Bi(a){if(void 0!==
|
|
329
329
|
a){const b=this.values[a];b&&b instanceof olympe.D.Proxy?sb(this.F,b):O(this.F,b);O(this.C,a)}else void 0!==this.F.Aa.xb&&(rb(this.F),rb(this.C))}set(a,b){this.Gj(a,b);1===this.size&&null!==this.C&&this.Bi(a);this.cf()}remove(a){const b=this.ei(a);null!==this.C&&this.C.Aa.xb===a&&this.Bi(this.Sl());return b}clear(){this.dh();null!==this.C&&this.Bi()}};l=olympe.D.Map.prototype;l.md.J=olympe.D.H.C;l.xc.J=new olympe.D.H(()=>Object,[]);l.hf.J=new olympe.D.H(()=>String,[]);l.Pl.J=olympe.D.H.C;l.Sl.J=olympe.D.H.C;
|
|
330
330
|
l.Bi.J=olympe.D.H.C;l.set.J=olympe.D.H.C;l.remove.J=new olympe.D.H(()=>Object,[]);l.clear.J=olympe.D.H.C;olympe.D.$f=class extends olympe.D.Hi{constructor(a){super(a)}set(a,b,c){this.Gj(a,b);void 0!==c&&olympe.D.pc([c],d=>{this.Fl(a,d)});this.cf()}remove(a){this.El(a);return this.ei(a)}clear(){this.dh()}};olympe.D.$f.prototype.remove.J=olympe.D.H.C;olympe.D.$f.prototype.clear.J=olympe.D.H.C;olympe.D.Qq=class extends olympe.D.Si{constructor(a,b){super(olympe.D.aa,'animatedFlowSource');this.duration=a;this.C=b||olympe.D.aa.zn.qo}vb(){return olympe.D.Xv(this.node,this.duration,this.C,void 0)}};let Bb=null;olympe.D.K=void 0;olympe.D.vm=void 0;olympe.D.hh=void 0;olympe.D.ah=new Map;olympe.D.ah.set(0,olympe.D.aa.ZERO);olympe.D.ah.set(1,olympe.D.aa.ONE);olympe.D.ah.set(2,olympe.D.aa.xt);olympe.D.Fj=new Map;olympe.D.Fj.set('',olympe.D.Ka.EMPTY);olympe.D.Fj.set(' ',olympe.D.Ka.mt);olympe.D.createNode=function(a,b,c,d,e,f,g,h){return new olympe.D.Node({valueType:a,cd:b,qf:c,fm:d,debug:g,Jf:e,Xc:f,fi:h})};olympe.D.mf=function(a){return!!(a&&a instanceof olympe.D.Node)};
|
|
@@ -354,7 +354,7 @@ xA:703,zA:704,AA:705,BA:706,yA:707,DA:708,CA:709,EA:710,IA:711,QA:712,FA:713,GA:
|
|
|
354
354
|
olympe.V.config(function(a){wa(a,olympe.host.R.sl);wa(a,olympe.host.R.Lk);D(a,olympe.host.R.Xe,olympe.host.kj);E(a,olympe.host.R.za,[olympe.la.R.Ga],function(b){return b.Fc('host')});D(a,olympe.host.R.Ga,olympe.host.Ba,olympe.host.R.za,olympe.V.R.Sf);E(a,olympe.host.R.rp,[olympe.host.R.Ga],b=>{null===olympe.host.sf&&(olympe.host.sf=new olympe.host.Wc(b));return olympe.host.sf},!0)},'olympe.host');olympe.V.run([olympe.host.R.rp],a=>a,'olympe.host.scheduler');olympe.V.run([olympe.host.R.Ga],a=>a,'olympe.host');
|
|
355
355
|
olympe.V.run([olympe.host.R.Xe],a=>{olympe.host.Rj=()=>a});olympe.net={};olympe.net.Fa={};olympe.net.Fa.Kd={Pg:'POST',GET:'GET',Er:'HEAD',To:'PUT',qc:'DELETE',Jo:'OPTIONS',Wy:'PATCH'};olympe.net.Fa.ResponseType={ul:'text',lk:'blob',yt:'arraybuffer'};olympe.net.Fa.Headers={Eh:'content-type',bx:'content-length',Mm:'authorization',Pq:'access-control-allow-origin',Nq:'access-control-allow-headers',Oq:'access-control-allow-methods'};olympe.net.Fa.nn={ky:'text/html',JSON:'application/json',Jt:'application/zip'};
|
|
356
356
|
olympe.net.Fa.$b={Yq:0,Uh:200,fn:201,Ei:202,Sq:400,At:401,Jn:403,Co:404,Ey:405,Xh:500,it:503};function Ob(a){return a.host&&encodeURI(a.host)}function Pb(a){return encodeURI(a.path).replace(olympe.net.di.C,(b,c)=>'%'+c)}function Qb(a){return void 0===a.F?443===a.port:a.F}olympe.net.di=class{constructor(a,b,c,d){this.host='localhost';this.port=80;this.path='';this.F=!1;void 0!==a&&(this.host=a);void 0!==b&&(this.port=b);void 0!==c&&(this.path=c.replace(/^\/+/,''));void 0!==d&&(this.F=d)}C(){return`${Qb(this)?'wss':'ws'}://${Ob(this)}:${this.port}/${Pb(this)}`}toString(){return`${Ob(this)}:${this.port}/${Pb(this)}`}};
|
|
357
|
-
olympe.net.di.C=/%25([0-9a-f]{2})/i;olympe.net.WebSocket=class{send(){}close(){}
|
|
357
|
+
olympe.net.di.C=/%25([0-9a-f]{2})/i;olympe.net.WebSocket=class{send(){}close(){}ga(){}da(){}$(){}F(){}};function P(a,b,c,d){a=olympe.Z.jw(a.valueOf());if(!a.host&&!a.path)return null;const e=a.scheme?a.scheme.includes('s'):!1;b=new olympe.net.Mh(a.host,a.port||(e?443:80),a.path||'',e,b,c,d,a.query||void 0);a.Hq&&(c=a.Hq.split(':'),2===c.length&&(c=Ga(olympe.Z.De(),`${c[0]}:${c[1]}`),Q(b,{Authorization:`Basic ${c}`})));return b}function Rb(a){return void 0!==a.query?a.query.replace(/[^=&]+/g,b=>encodeURIComponent(b)):null}function Q(a,b){Object.assign(a.headers,b)}
|
|
358
358
|
olympe.net.Mh=class extends olympe.net.di{constructor(a,b,c,d,e,f,g,h){super(a,b,c,d);this.method=void 0!==e?e:olympe.net.Fa.Kd.GET;this.query=h;this.headers={};this.body=f;this.G=void 0!==g?g:olympe.net.Fa.ResponseType.ul;this.ca=this.cert=this.key=null;this.rejectUnauthorized=!1}Nj(){return this.headers}C(){let a=Rb(this);a=a?`?${a}`:'';return Ob(this)?`${Qb(this)?'https':'http'}://${Ob(this)}:${this.port}/${Pb(this)}${a}`:`${Pb(this)}${a}`}toString(){return this.C()}};
|
|
359
359
|
olympe.net.Mh.Kd={Pg:'POST',GET:'GET',Er:'HEAD',To:'PUT',qc:'DELETE',Jo:'OPTIONS'};olympe.net.Se=class{constructor(a,b,c,d){this.data=a;this.status=void 0===b?200:b;this.statusText=void 0===c?'':c;this.headers=void 0===d?{}:d}getData(){return this.data}Rc(){return this.status}Nj(){return this.headers}};function Sb(a,b,c){const d=olympe.D.Ma(),e=d.onDestroy(()=>{var f=a.F();const g=f.C.get(b);g&&(f.C.delete(b),g())});return d.G(f=>{d.pf(e);a.F().C.delete(b);c(f)})}function Tb(a,b){return new olympe.net.We(a,b)}olympe.net.Ba=class{constructor(a){this.K=a;this.L=1;a='Initializing NET layer';this.K.C()&&(a+=' (implementation: '+this.T()+')');this.K.info(a);this.K.log('DONE initializing NET layer (ready to receive connection requests)')}F(){}G(){}C(){}P(){}T(){}};function Ub(a){let b;return!(null==(b=a.C)||!b.connected)}function Vb(a,b){const c=()=>{const d=b(),e=d.Yc();return{username:`${a.T.vhost}:${d.oc()}`,password:e}};return Object.assign({},a.T,c(),{transformWsUrl:(d,e,f)=>{Object.assign(f.options,c());return d}})}
|
|
360
360
|
function Wb(a,b,c){Ub(a)?(a.K.C()&&a.K.debug(`MQTT subscribe to topic ${b}`),a.C.subscribe(b,void 0,d=>{d?a.K.error(`Failed to subscribe to topic ${b}: ${d}`):a.F.set(b,c)})):null==c||c(Error('Cannot subscribe because the MQTT client is disconnected'))}function Xb(a,b,c){Ub(a)?(a.K.C()&&a.K.debug(`MQTT unsubscribe topic ${b}`),a.C.unsubscribe(b,void 0,c),a.F.delete(b)):c&&c(Error('Cannot unsubscribe because the MQTT client is disconnected'))}function Yb(a,b){a.G.push(b)}
|
|
@@ -363,12 +363,12 @@ olympe.net.We=class{constructor(a,b){this.url=a;this.T=b||null;this.C=null;this.
|
|
|
363
363
|
()=>{this.K.info('Mqtt client is connected to bus');this.G.forEach(c=>c())}),this.C.on(olympe.net.We.C.at,()=>{this.K.info('Mqtt client is reconnecting to bus ... ');this.P.forEach(c=>c())}),this.C.on(olympe.net.We.C.Db,c=>{this.K.error('Mqtt client error ',c);this.da.forEach(d=>d(c))}),this.C.on(olympe.net.We.C.Th,()=>{this.K.info('Mqtt client is offline');this.L.forEach(c=>c())}),this.C.on(olympe.net.We.C.cr,()=>{this.K.info('Mqtt client is closed');this.$.forEach(c=>c())}),this.C.on(olympe.net.We.C.Dk,
|
|
364
364
|
()=>{this.K.info('Mqtt client has ended')}));return this}publish(a,b,c,d){if(!Ub(this))return null==d||d(Error('Cannot publish message because the MQTT client is disconnected')),this;const e=JSON.stringify(b);this.K.C()&&this.K.debug(`MQTT > ${e}`);this.C.publish(a,e,c,f=>{null==d||d(f);f&&this.K.error('Failed to publish a message '+e)});return this}end(a,b){this.F.clear();this.C?this.C.end(a,{},()=>{b&&b();this.C=null}):null==b||b();return this}};
|
|
365
365
|
olympe.net.We.C={dr:'connect',at:'reconnect',Hs:'message',cr:'close',Dk:'end',Db:'error',Th:'offline'};olympe.net.ci=class{constructor(a){this.K=a}start(){return Promise.reject('Try to start web server with the browser implementation.')}F(){return Promise.reject('Try to restart web server with the browser implementation.')}stop(){return Promise.reject('Try to stop web server with the browser implementation.')}P(){return Promise.reject('Try to open a route on a web server using the browser implementation.')}T(){return Promise.reject('Try to close a route on a web server using the browser implementation.')}};
|
|
366
|
-
olympe.net.ci.C='*';olympe.net.R={Ga:'net.Manager',za:'net.Logger',Dj:'net.WebServer'};olympe.net.U={Jh:'net.httpPort',Un:'net.httpBodyLimit',Zi:'net.localNetworkSuffix'};olympe.V.config(function(a){F(a,olympe.net.U.Jh,3141);F(a,olympe.net.U.Un,100);F(a,olympe.net.U.Zi,'frontend');wa(a,olympe.net.R.Ga);E(a,olympe.net.R.za,[olympe.la.R.Ga],b=>b.Fc('net'));D(a,olympe.net.R.Dj,olympe.net.ci,olympe.net.R.za)},'olympe.net');olympe.Na.node.host={};olympe.Na.node.host.od=function(a,b){this.K=b};olympe.Na.node.host.od.prototype.constructor=olympe.Na.node.host.od;olympe.Na.node.host.od.prototype.destroy=function(){};olympe.Na.node.host.od.prototype.destroy=olympe.Na.node.host.od.prototype.destroy;olympe.Na.node.host.od.prototype.fb=function(){return this.K};olympe.Na.node.host.od.va=[olympe.host.fe.od];function ac(a){a.K.error('No history manager implemented in Node')}olympe.Na.node.host.Fo=class{constructor(a){this.K=a}ti(){return!1}C(){ac(this);return Lb()}F(){ac(this)}back(){ac(this)}};olympe.Na.node.host.Fo.va=[olympe.host.Lh];olympe.Na.node.host.Wc=class{constructor(){this.C={};this.L={}}destroy(){}P(a){clearTimeout(this.C[a]);delete this.C[a]}$(a,b,c){this.C[b]=setTimeout(c,a)}G(a){clearTimeout(this.C[a]);delete this.C[a]}T(a,b,c){this.L[b]=setInterval(c,a)}F(a){clearInterval(this.L[a]);delete this.L[a]}};olympe.host.Eo.register(olympe.host.fe.Do.Np,olympe.Na.node.host.Wc);olympe.Na.node.host.Wc.va=[olympe.host.fe.Wc];olympe.Na.node.host.yj=class{constructor(a){this.K=a}qh(){return olympe.D.ea.F}};olympe.Na.node.host.yj.va=[olympe.host.yj];function bc(a){const b=olympe.net.Fa.$b.Uh,c=olympe.net.Fa.$b.Xh;a.
|
|
367
|
-
f?c:b,f?'Some services are not working':'Everything is OK')})}).catch(d=>a.K.error(`Failed to add health check route ${d}`));a.F(()=>a.
|
|
366
|
+
olympe.net.ci.C='*';olympe.net.R={Ga:'net.Manager',za:'net.Logger',Dj:'net.WebServer'};olympe.net.U={Jh:'net.httpPort',Un:'net.httpBodyLimit',Zi:'net.localNetworkSuffix'};olympe.V.config(function(a){F(a,olympe.net.U.Jh,3141);F(a,olympe.net.U.Un,100);F(a,olympe.net.U.Zi,'frontend');wa(a,olympe.net.R.Ga);E(a,olympe.net.R.za,[olympe.la.R.Ga],b=>b.Fc('net'));D(a,olympe.net.R.Dj,olympe.net.ci,olympe.net.R.za)},'olympe.net');olympe.Na.node.host={};olympe.Na.node.host.od=function(a,b){this.K=b};olympe.Na.node.host.od.prototype.constructor=olympe.Na.node.host.od;olympe.Na.node.host.od.prototype.destroy=function(){};olympe.Na.node.host.od.prototype.destroy=olympe.Na.node.host.od.prototype.destroy;olympe.Na.node.host.od.prototype.fb=function(){return this.K};olympe.Na.node.host.od.va=[olympe.host.fe.od];function ac(a){a.K.error('No history manager implemented in Node')}olympe.Na.node.host.Fo=class{constructor(a){this.K=a}ti(){return!1}C(){ac(this);return Lb()}F(){ac(this)}back(){ac(this)}};olympe.Na.node.host.Fo.va=[olympe.host.Lh];olympe.Na.node.host.Wc=class{constructor(){this.C={};this.L={}}destroy(){}P(a){clearTimeout(this.C[a]);delete this.C[a]}$(a,b,c){this.C[b]=setTimeout(c,a)}G(a){clearTimeout(this.C[a]);delete this.C[a]}T(a,b,c){this.L[b]=setInterval(c,a)}F(a){clearInterval(this.L[a]);delete this.L[a]}};olympe.host.Eo.register(olympe.host.fe.Do.Np,olympe.Na.node.host.Wc);olympe.Na.node.host.Wc.va=[olympe.host.fe.Wc];olympe.Na.node.host.yj=class{constructor(a){this.K=a}qh(){return olympe.D.ea.F}};olympe.Na.node.host.yj.va=[olympe.host.yj];function bc(a){const b=olympe.net.Fa.$b.Uh,c=olympe.net.Fa.$b.Xh;a.ga.P('healthcheck','/readiness',[olympe.net.Fa.Kd.GET],()=>{const d=Array.from(a.$.values()).map(e=>e.apply(a));return 0===d.length?Promise.resolve(new olympe.net.Se('No healthCheck is set',b,'Nothing to check')):Promise.allSettled(d).then(e=>{let f=!1,g='Health check result: ';for(const h of e)'rejected'===h.status?(f=!0,e=h.reason,g+=`\n${e}`,a.K.warn(`Health check detected a service which is DOWN: ${e}`)):g+=`\n${h.value}`;return new olympe.net.Se(g,
|
|
367
|
+
f?c:b,f?'Some services are not working':'Everything is OK')})}).catch(d=>a.K.error(`Failed to add health check route ${d}`));a.F(()=>a.ga.stop())}function cc(a,b){b=Array.from(b.values()).map(c=>olympe.Z.Promise.Cm(c(),a.na,'Some shutdown hook has timeout'));return Promise.allSettled(b).then(c=>{let d=!1;for(const e of c)'rejected'===e.status&&(d=!0,a.K.warn(`Failed to close some resource: ${e.reason}`));return d})}
|
|
368
368
|
function dc(a){return v(function*(){try{const b=yield cc(a,a.L),c=yield cc(a,a.T);if(b||c)throw Error('Failed to gracefully close the backend');}finally{a.L.clear(),a.T.clear()}})}
|
|
369
|
-
olympe.Na.node.host.kj=class extends olympe.host.kj{constructor(a,b,c,d=!0){super();this.K=a;this.
|
|
369
|
+
olympe.Na.node.host.kj=class extends olympe.host.kj{constructor(a,b,c,d=!0){super();this.K=a;this.ga=b;this.na=c;this.$=new Map;this.L=new Map;this.T=new Map;d&&bc(this)}C(a){const b=olympe.Z.ef();this.$.set(b,a);return b}G(a){this.$.delete(a)}F(a){const b=olympe.Z.ef();this.L.set(b,a);return b}da(a){const b=olympe.Z.ef();this.T.set(b,a);return b}P(a){this.L.has(a)?this.L.delete(a):this.T.delete(a)}};olympe.V.config(function(a){F(a,olympe.host.U.So,!0);F(a,olympe.host.U.wp,1E4);ua(a,olympe.host.R.Lk,olympe.Na.node.host.Fo,olympe.host.R.za);ua(a,olympe.host.R.sl,olympe.Na.node.host.yj,olympe.host.R.za);D(a,olympe.host.R.Xe,olympe.Na.node.host.kj,olympe.host.R.za,olympe.net.R.Dj,new olympe.V.ma(olympe.host.U.wp),new olympe.V.ma(olympe.host.U.So))},'olympe.native.node.host');olympe.V.run([olympe.host.R.Xe],a=>{olympe.Na.node.host.Rj=()=>a});olympe.net.Vd={};olympe.net.Vd.Rk=class{constructor(a){this.K=a;this.C=new Map}G(){}F(){}};olympe.net.Vd.WebSocket=class{constructor(a,b){this.K=b;this.id=a;this.C=null;this.buffer=[];this.P=this.G=this.L=this.T=null}W(){return this.id}open(a){const b=`#${this.id}`,c=this.na(a);c.binaryType='arraybuffer';c.onopen=()=>{this.K.info('Websocket OPENED');this.T?(this.K.debug('Notifying upper layer for WebSocket',b),this.T()):this.K.warn('Nothing to notify for WebSocket',b);this.K.debug(b,`Send all buffered messages (n=${this.buffer.length}).`);this.buffer.forEach(c.send.bind(c));this.buffer.length=
|
|
370
370
|
0};c.onmessage=d=>{d='string'===typeof d.data?String(d.data):Ha(d.data);(this.K.L()||this.K.C()&&!d.startsWith('pong'))&&this.K.debug(b,'<',d);this.G&&this.G(d)};c.onclose=()=>{this.K.debug(`WebSocket ${b} CLOSED`);this.L&&this.L()};c.onerror=()=>{this.K.debug(`WebSocket ${b} ERROR`);this.P&&this.P()};this.C=c}send(a){const b=`#${this.id}`;if(null!==this.C){const c=this.C.constructor;switch(this.C.readyState){case c.OPEN:(this.K.L()||this.K.C()&&!a.startsWith('ping'))&&this.K.debug(b,'>',a);this.C.send(a);
|
|
371
|
-
break;case c.CONNECTING:this.K.debug(b,'- Connecting: BUFFER','>',a);this.buffer.push(a);break;default:return this.K.debug(b,'- Closed','>',a),!1}}else this.K.debug(b,'- Not opened yet: BUFFER','>',a),this.buffer.push(a);return!0}close(){if(null!==this.C){const a=this.C.constructor,b=this.C.readyState;if(b===a.OPEN||b===a.CONNECTING){this.K.debug(`Force closing native websocket ${`#${this.id}`}`);this.C.close(1E3);return}}this.K.debug('Try to force close native websocket, but not open nor connecting')}
|
|
371
|
+
break;case c.CONNECTING:this.K.debug(b,'- Connecting: BUFFER','>',a);this.buffer.push(a);break;default:return this.K.debug(b,'- Closed','>',a),!1}}else this.K.debug(b,'- Not opened yet: BUFFER','>',a),this.buffer.push(a);return!0}close(){if(null!==this.C){const a=this.C.constructor,b=this.C.readyState;if(b===a.OPEN||b===a.CONNECTING){this.K.debug(`Force closing native websocket ${`#${this.id}`}`);this.C.close(1E3);return}}this.K.debug('Try to force close native websocket, but not open nor connecting')}ga(a){this.T=
|
|
372
372
|
a||null}da(a){this.G=a||null}F(a){this.P=a||null}$(a){this.L=a||null}na(){}};olympe.net.Vd.WebSocket.va=[olympe.net.WebSocket];olympe.Na.node.net={};olympe.Na.node.net.Ls=class extends olympe.net.Ba{constructor(a,b){super(a,b);this.$=new olympe.Na.node.net.Rk(a)}T(){return'NodeJS'}G(a){var b=this.L++;a=a.C();this.K.debug('CREATE Websocket #'+b+' to '+a);b=new olympe.Na.node.net.Ms(b,this.K);b.open(a);return b}C(a,b){this.K.debug('SEND HTTP '+a.method+' to '+a.C());const c=this.L++;b=Sb(this,c,b);this.$.G(c,{u:a.C(),s:Qb(a),h:Ob(a),p:a.port,z:Pb(a),q:Rb(a),m:a.method,v:a.Nj(),k:a.key,c:a.cert,a:a.ca,j:a.rejectUnauthorized,b:a.body,r:a.G},b)}P(){this.K.warn('DOWNLOAD FILE not available with node native implementation. URL:')}F(){return this.$}};const ec=require('fs'),fc=require('http'),gc=require('https');
|
|
373
373
|
olympe.Na.node.net.Rk=class extends olympe.net.Vd.Rk{G(a,b,c){const d=b.s,e=b.b,f=b.m;var g=b.v;const h=b.k,k=b.c,m=b.a,n=b.j;var p=b.h;const q=b.p;let r=b.z;r.startsWith('/')||(r=`/${r}`);const t=b.q,u=b.u,w=b.r;b={host:p,port:q,path:t?r+'?'+t:r,method:f};g&&(b.headers=g);g=(x,y,z)=>new Promise((A,M)=>{ec.readFile(x,(K,pa)=>{K?M(K):(z[y]=pa,A(z))})});p=x=>{const y=A=>{A.setEncoding(w===olympe.net.Fa.ResponseType.ul?'utf-8':'binary');let M='';A.on('data',K=>{M+=K});A.on('end',()=>{if(w!==olympe.net.Fa.ResponseType.ul){var K=
|
|
374
374
|
new Uint8Array(Buffer.from(M,'binary'));K=w===olympe.net.Fa.ResponseType.lk?new Blob(K):K}else K=M;c(this.F(A.statusCode,A.statusMessage,K,A.headers))})},z=d?new gc.request(x,y):new fc.request(x,y);this.C.set(a,()=>{z.destroy()});z.on('error',A=>{c(this.F(olympe.net.Fa.$b.Xh,'Connection refused','Error connecting to '+u+' with method '+f+', code = '+A.code+', message = '+A.message,''))});!e||'POST'!==f&&'PUT'!==f?z.end():(e instanceof Blob?e.arrayBuffer():Promise.resolve(e)).then(A=>{z.write(A instanceof
|
|
@@ -382,20 +382,20 @@ ic.rl?this.G.close().then(()=>{this.C=ic.uj}):Promise.resolve()}createServer(){c
|
|
|
382
382
|
olympe.async.Fn=class{constructor(a,b=void 0===a){this.F=[];this.$=[];this.G=a||new olympe.D.Jb('Async executor context');this.na=b;this.C=null;this.env=new Map;this.env.set('Executor',this);this.L=this.P=!1;this.K=null;this.timer=this.timeout=0;this.da=olympe.Z.hc()}Cm(a){0<=a&&(this.timeout=a);return this}fb(){return this.K}add(a){this.L||this.F.push(this.G.G(a));return this}start(){this.P||(this.K&&this.K.log('Executor started.'),this.P=!0,this.G.onDestroy(()=>{this.C='Context destroyed.';this.complete(!1)},
|
|
383
383
|
this.da),0<this.timeout&&(this.timer=setTimeout(()=>{this.C='Timeout expired.';this.timer=0;this.complete(!1)},this.timeout)))}clear(){this.F=[];this.$=[];this.env.clear();this.na&&this.G.destroy()}complete(a){this.G.pf(this.da);if(!this.L){this.L=!0;this.timer&&(clearTimeout(this.timer),this.timer=0);this.K&&this.K.log(a?'Executor completed successfully':`Executor completed with error: ${this.C}`);for(const b of this.$)b(a,a?null:this.C,this.env);this.clear()}}getContext(){return this.G}};
|
|
384
384
|
function rc(a){if(0<a.F.length){const b=a.F.shift();a.K&&a.K.log(`Executing next task. ${a.F.length} tasks left in the pipeline.`);a.getContext().run(()=>{b(()=>{Promise.resolve().then(()=>{rc(a)})},c=>{c&&(a.C=c);a.complete(!1)},a.env)})}else a.complete(!0)}olympe.async.Ap=class extends olympe.async.Fn{static create(){return new olympe.async.Ap(new olympe.D.Jb('SequencedExecutor'),!0)}start(){this.P||(super.start(),rc(this))}};
|
|
385
|
-
olympe.async.ij=class extends olympe.async.Fn{constructor(a,b){super(a,b);this.T=0;this.
|
|
385
|
+
olympe.async.ij=class extends olympe.async.Fn{constructor(a,b){super(a,b);this.T=0;this.ga=!0}static create(){return new olympe.async.ij(new olympe.D.Jb('ParallelExecutor'),!0)}run(a){this.K&&this.K.log('Starting a task');this.getContext().run(()=>{a(()=>{this.done()},b=>{this.ga=!1;b&&(this.C=this.C?`${this.C}. ${b}`:b);this.done()},this.env)})}add(a){super.add(a);this.P&&!this.L&&(this.T++,this.run(a));return this}done(){this.T--;0>=this.T&&this.complete(this.ga)}start(){if(!this.P)if(super.start(),
|
|
386
386
|
0<this.F.length){this.T=this.F.length;for(const a of this.F)this.run(a)}else this.complete(!0)}};olympe.jc={};olympe.jc.xs=class{constructor(){}set(){}get(){}forEach(){}remove(){}clear(){}close(){}};olympe.jc.ws=class{constructor(){}C(){}};olympe.jc.Storage=class{open(){}write(){}close(){}};olympe.jc.R={Yi:'localStorage.KeyValueManager',vj:'localStorage.Storage',ix:'localStorage.DatacloudStorage',za:'localStorage.Logger'};olympe.V.config(function(a){wa(a,olympe.jc.R.Yi);E(a,olympe.jc.R.za,[olympe.la.R.Ga],function(b){return b.Fc('localstorage')})},'olympe.localstorage');olympe.O={};olympe.O.errors={};olympe.O.errors.Ry=class extends Error{};olympe.O.errors.Ho=class extends Error{};olympe.O.errors.Ip=class extends Error{};olympe.O.errors.Qo=class extends Error{};olympe.O.errors.Gt=class extends Error{};olympe.O.errors.el=class extends Error{constructor(a,b){super(a);this.id=b}W(){return this.id}};olympe.O.Mb={Ri:'urls.FileSvc',Nm:'urls.BackupSvc',hp:'urls.RestoreBackupSvc',oe:'urls.GetContext',Qn:'urls.GraphDef',$m:'urls.StaticGraphDef',TRANSACTION:'urls.Transaction',Mp:'urls.UserTagFromToken',Ft:'urls.UserNameFromTag',Et:'urls.UserRoles',et:'urls.RoleMembers',dj:'urls.OpenIDSvc'};
|
|
387
387
|
olympe.V.config(a=>{F(a,olympe.O.Mb.Ri,'rest/filesvc');F(a,olympe.O.Mb.Nm,'rest/backupsvc');F(a,olympe.O.Mb.hp,'rest/backupsvc/restore');F(a,olympe.O.Mb.dj,'rest/openid');F(a,olympe.O.Mb.oe,'rest/initialData');F(a,olympe.O.Mb.Qn,'rest/querysvc/graphDef');F(a,olympe.O.Mb.$m,'rest/querysvc/graphDef/static');F(a,olympe.O.Mb.TRANSACTION,'rest/transaction');F(a,olympe.O.Mb.Mp,'rest/token');F(a,olympe.O.Mb.Ft,'rest/authorization/getUserTag');F(a,olympe.O.Mb.Et,'rest/authorization/getUserRoles');F(a,olympe.O.Mb.et,
|
|
388
388
|
'rest/authorization/roleMembers')});function sc(a){a.K.info('Disconnected from bus');a.G=!0;let b;null==(b=a.F)||b.forEach((c,d)=>{c.qh()&&(a.K.info(`Disconnected from bus: pause keep alive of ${c.C.size} subscriptions for ${d} service.`),tc(c))})}function uc(a){a.K.debug('Connection to bus established. Listening to responses on topic',a.P);Wb(a.C,a.P,b=>{a.K.C()&&a.K.debug('BUS <',JSON.stringify(b));b=new olympe.O.Response(b.dest,b.src,b.seq,b.type,a.Da.G(b.content));let c;null==(c=a.L.get(b.sg()))||c(b)})}
|
|
389
|
-
function vc(a){a.K.debug(`Reconnected to bus: Sending ${a.
|
|
389
|
+
function vc(a){a.K.debug(`Reconnected to bus: Sending ${a.ga.length} pending messages and resubscribe to ${a.da.size} active topics.`);for(const c of a.ga){let d;try{d=c.ha(a.Da)}catch(e){a.K.error(`An error occurred while serializing a message that was pending (seqId=${c.sg()}: ${e}`)}a.C.publish(c.Nb(),d)}a.ga=[];a.da.forEach((c,d)=>{wc(a,d,c)});a.da.clear();let b;null==(b=a.F)||b.forEach((c,d)=>{c.qh()||(a.K.info(`Reconnected to bus: restart keep alive of ${c.C.size} subscriptions for ${d} service.`),
|
|
390
390
|
xc(c,!0))})}function yc(a){a.ub=a.na.C(()=>Ub(a.C)?Promise.resolve('Bus connection OK'):Promise.reject('Bus is disconnected'))}
|
|
391
391
|
function wc(a,b,c){a.G||a.Wa?a.da.set(b,c):a.connect().then(()=>{a.K.debug(`Bus: Subscribe to ${b}`);Wb(a.C,b,d=>{a.K.C()&&a.K.debug(`BUS < #${b}: ${JSON.stringify(d)}`);let e=null;try{e=new olympe.O.Request(d.dest,d.src,d.auth,d.seq,d.type,a.Da.G(d.content))}catch(f){a.K.error(`An error occurred while trying to deserialize the request: ${JSON.stringify(d)}`)}null!==e&&c(e)})})}function zc(a,b,c,d,e){b=new olympe.O.Response(c,a.P,b,d,e);return a.publish(b)}
|
|
392
392
|
function Ac(a,b,c,d){const e=Bc(a.T).Yc();a.$++;return new olympe.O.Request(b,a.P,e,a.$,c,d)}function Cc(a,b,c,d){const e=b.sg(),f=olympe.O.Response.jb.dk;let g=null;g=setTimeout(()=>Dc(a,e),a.Qb);a.L.set(e,h=>{g&&clearTimeout(g);h.getType()===f?g=setTimeout(()=>Dc(a,e),d):(a.L.delete(e),c(h))})}function Dc(a,b){const c=a.L.get(b);a.L.delete(b);null==c||c(new olympe.O.Response(a.P,a.P,b,olympe.O.Response.jb.Db,{reason:'Timeout'}))}
|
|
393
393
|
function Ec(a,b){a.$++;const c=a.$,d=setTimeout(()=>Dc(a,c),a.Qb);a.L.set(c,e=>{a.L.delete(c);clearTimeout(d);b(e)});return a.$}function Fc(a,b){a.da.delete(b);let c;null==(c=a.F)||c.delete(b);a.K.debug(`Bus: Unsubscribe to ${b}`);return a.G||a.Wa?Promise.resolve():new Promise((d,e)=>{Xb(a.C,b,f=>f?e(f):d())})}
|
|
394
394
|
function Gc(a,b,c,d,e){null===a.F&&(a.F=new Map);let f=a.F.get(b);f?(a=f,a.G!==d&&(a.G=d,a.qh()&&(tc(a),xc(a,!1)))):(f=new olympe.O.st(a.K,a,b,d),a.F.set(b,f));d=f;d.C.set(c,e);1===d.C.size&&xc(d,!1)}function Hc(a,b,c){let d;const e=null==(d=a.F)?void 0:d.get(b);if(null==e?0:Ic(e,c))a.publish(Ac(a,b,olympe.O.Request.jb.Jp,c)).catch(f=>a.K.error(`Impossible to keep alive subscriptions: ${f}`)),0===e.C.size&&(a.F.delete(b),0===a.F.size&&(a.F=null))}
|
|
395
395
|
function Jc(a,b){return rxjs.operators.retry({resetOnSuccess:!0,delay:c=>{if(c instanceof olympe.O.errors.el){const d=Math.round(5E3*Math.random());a.K.debug(`Subscription topic ${c.W()} not registered in the service, re-subscribe in ${d}ms`);return rxjs.timer(d).pipe(rxjs.operators.tap(()=>null==b?void 0:b()))}return rxjs.throwError(()=>c)}})}function Kc(a,b){return new Promise((c,d)=>{a.T.ug(b.Td(),(e,f)=>{e?d(e):c(f)})})}
|
|
396
|
-
olympe.O.Zm=class{constructor(a,b,c,d,e,f){b=f.get('connectionOptions');this.K=a;this.T=c;this.na=d;this.Da=e;this.Qb=f.get('shortTimeout');this.ac=f.get('requestTimeout');this.Wb=f.get('subscriptionsRefreshRate');this.L=new Map;this.C=Tb(f.get('url'),b);this.mb=f.get('allowGuest');this.$=1;this.P=olympe.Z.hc();this.F=null;this.G=!1;this.
|
|
396
|
+
olympe.O.Zm=class{constructor(a,b,c,d,e,f){b=f.get('connectionOptions');this.K=a;this.T=c;this.na=d;this.Da=e;this.Qb=f.get('shortTimeout');this.ac=f.get('requestTimeout');this.Wb=f.get('subscriptionsRefreshRate');this.L=new Map;this.C=Tb(f.get('url'),b);this.mb=f.get('allowGuest');this.$=1;this.P=olympe.Z.hc();this.F=null;this.G=!1;this.ga=[];this.da=new Map;this.Eb=this.ub='';this.Wa=!1;$b(this.C,()=>{sc(this)});Zb(this.C,()=>{sc(this)});Yb(this.C,()=>{this.G&&(this.Wa=!1,uc(this),this.G=!1,vc(this))})}connect(){const a=
|
|
397
397
|
olympe.auth.Ba.C.INIT,b=olympe.auth.Ba.C.Db,c=olympe.auth.Ba.C.ke,d=olympe.auth.Ba.C.Af,e=olympe.auth.Ba.C.Pe;return new Promise((f,g)=>{Ub(this.C)||this.G?f():olympe.D.pc([this.T.getState()],h=>{const k=olympe.D.Ma();if(this.mb||h!==d)switch(h){case a:this.Wa=!0;break;case b:case e:g(Error('Authentication failed.'));k.destroy();break;case c:case d:yc(this),this.mb||Lc(this.T,()=>this.disconnect().then()),this.G=!0,this.C.connect(()=>Bc(this.T),()=>{k.destroy();f()}),this.Eb=this.na.da(()=>this.disconnect())}else yc(this),
|
|
398
|
-
g(Error('Guest user is not allowed to connect to RabbitMQ, you can allow guest with the bus.allowGuest oConfig parameter !!!')),k.destroy()})})}disconnect(){return new Promise(a=>{this.K.debug('Disconnecting from bus');this.T.Da.delete('busLogoutCallback');this.C.end(!1,()=>a());this.na.G(this.ub);this.na.P(this.Eb)})}publish(a){return this.G?(a.getType()!==olympe.O.Request.jb.qe&&(this.K.debug('Bus disconnected, storing message in queue'),this.
|
|
398
|
+
g(Error('Guest user is not allowed to connect to RabbitMQ, you can allow guest with the bus.allowGuest oConfig parameter !!!')),k.destroy()})})}disconnect(){return new Promise(a=>{this.K.debug('Disconnecting from bus');this.T.Da.delete('busLogoutCallback');this.C.end(!1,()=>a());this.na.G(this.ub);this.na.P(this.Eb)})}publish(a){return this.G?(a.getType()!==olympe.O.Request.jb.qe&&(this.K.debug('Bus disconnected, storing message in queue'),this.ga.push(a)),Promise.resolve()):new Promise((b,c)=>{try{const d=
|
|
399
399
|
a.ha(this.Da),e=a.Nb();this.K.C()&&this.K.debug(`BUS > #${e}: ${JSON.stringify(d)}`);this.C.publish(e,d,void 0,f=>{f?c(f):b()})}catch(d){c(`An error occurred while serializing the message (seqId=${a.sg()}): ${d}`)}})}ed(a,b,c){return zc(this,a.sg(),a.zb(),b,c)}request(a,b,c,d){const e=Ac(this,a,b,c);if(b===olympe.O.Request.jb.PUBLISH){const f=new olympe.O.Response(a,this.P,e.sg(),olympe.O.Response.jb.dk);return this.publish(e).then(()=>f)}return new Promise((f,g)=>{Cc(this,e,f,null!=d?d:this.ac);
|
|
400
400
|
this.publish(e).catch(g)})}};olympe.O.Zm.C='Timeout';const Mc=olympe.net.Fa.Headers.Mm,Nc=olympe.net.Fa.$b.Uh,Oc=olympe.net.Fa.$b.fn,Pc=olympe.net.Fa.$b.Ei,Qc=olympe.net.Fa.$b.it,Rc=olympe.net.Fa.$b.Yq,Sc=olympe.net.Fa.$b.Jn,Tc=olympe.net.Fa.$b.At,Uc=olympe.net.Fa.$b.Co;function Vc(a,b){let c;return null!=(c=a.G.get(b))?c:''}
|
|
401
401
|
function Wc(a,b,c){if(null===b)return Promise.reject('No http request to send');Q(b,{[Mc]:c});return rxjs.firstValueFrom(rxjs.defer(()=>new Promise((d,e)=>{const f=b.C();if(a.K.C()){const g=b.body;a.K.debug('HTTP >',f,`body: ${'string'===typeof g?g:typeof g}`)}a.C.C(b,g=>{switch(g.Rc()){case Nc:case Oc:case Pc:const h=g.getData();a.K.C()&&a.K.debug('HTTP <',g.Rc(),`content: ${'string'===typeof h?h:typeof h}`);d(h);break;case Qc:g=`HTTP < Service provider for http request to ${b.C()} is overloaded, retry later`;
|
|
@@ -407,18 +407,18 @@ function R(a,b){if(a.C!==b){a.K.debug('State change '+a.C+' --\x3e '+b);a.C=b;va
|
|
|
407
407
|
a.Wa&&(a.K.info('Disconnected, will try to auto reconnect in',a.mb,'ms'),Mb(()=>{a.connect()},a.mb));break;default:throw Error('State machine error in server manager. Should not get in state '+b);}}}function ad(a,b){const c=olympe.Z.hc();a.qd.set(c,b);olympe.D.Ta(a.P)===olympe.D.ea.F&&b()}function bd(a,b){var c;void 0===c&&(c=olympe.Z.hc());a.jd.set(c,b);olympe.D.Ta(a.P)===olympe.D.ea.C&&b(a.L[2])}
|
|
408
408
|
function cd(a,b,c,d){const e=a.ye;a.ye++;c={message:{seqId:e,messageFamily:b,payload:c},Kl:d?dd(a,d):null,wm:null};a.G.set(e,c);d=[olympe.O.cb.C.CONNECTING,olympe.O.cb.C.cg];($c(a)||b===olympe.O.ae.Ui&&d.includes(a.C))&&ed(a,e,c)}
|
|
409
409
|
function dd(a,b){const c=olympe.O.cb.G.Yh;return d=>{if(null!==d&&void 0!==d){var e=null,f,g=null==(f=d.info)?void 0:f.warn;f=d.s;'string'===typeof g?a.K.debug(`A message has raised a warning in the orchestrator: ${g}. Investigate.`):void 0!==f&&f!==c&&(e=void 0!==olympe.O.cb.Pb[f]?`Status code = ${f} [${olympe.O.cb.Pb[f]}]`:`Status code = ${f}`,g=d.info,void 0!==g&&void 0!==g.error&&(f=g.error.reason,'string'===typeof f&&0<f.length&&(e+=`\nReason:\n${g.error.reason}`),f=g.error.detailedReason,'string'===
|
|
410
|
-
typeof f&&0<f.length&&(e+=`\nDetails:\n${g.error.detailedReason}`)),e=Error('Rejected by orchestrator:\n'+e));b(e,d)}}}function ed(a,b,c){var d=c.message;a.K.C()&&a.K.debug('WS >',fd(d));(d=a.F.send(JSON.stringify(d)))?null===c.Kl?a.G.delete(b):c.wm=Date.now():R(a,olympe.O.cb.C.cg);return d}function Yc(a,b,c,d){void 0===d&&(d=olympe.Z.hc());let e=a.
|
|
410
|
+
typeof f&&0<f.length&&(e+=`\nDetails:\n${g.error.detailedReason}`)),e=Error('Rejected by orchestrator:\n'+e));b(e,d)}}}function ed(a,b,c){var d=c.message;a.K.C()&&a.K.debug('WS >',fd(d));(d=a.F.send(JSON.stringify(d)))?null===c.Kl?a.G.delete(b):c.wm=Date.now():R(a,olympe.O.cb.C.cg);return d}function Yc(a,b,c,d){void 0===d&&(d=olympe.Z.hc());let e=a.ga.get(b);void 0===e&&(e=new Map,a.ga.set(b,e));e.set(d,c)}function gd(a){a=a.ga.get(olympe.O.ae.Zf);void 0!==a&&a.delete('logoutHandler')}
|
|
411
411
|
function Zc(a,b,c){if(a.G.has(b)){const {Kl:d}=a.G.get(b);a.G.delete(b);d&&d({s:23,info:c})}}function hd(a,b){a.ze=b}function id(a,b){a.K.error(b);R(a,olympe.O.cb.C.Db)}function jd(a,b,c){a.Qb=null!=c?c:-1;a.K.info('Connected to',a.da.C(),' | ',b?'server version:'+b:'',null!==c?`activity timeout: ${c}s`:'');b=Array.from(a.G).sort(([d],[e])=>d-e);for(const [d,e]of b)if(!ed(a,d,e))return;R(a,olympe.O.cb.C.Dh)}
|
|
412
412
|
function fd(a){a=JSON.parse(JSON.stringify(a));return`${olympe.Z.Yu(a.messageFamily)}: ${JSON.stringify(a.payload)}`}
|
|
413
413
|
olympe.O.cb=class{constructor(a,b,c,d,e,f){this.K=a;this.Eb=b;this.da=d;this.F=null;this.config=f;this.mb=this.config.get('reconnectionDelay');this.Da=e;this.ze=null;this.pi=this.config.get('pingInterval');this.nm=this.mb/2;this.Wa=f.get('autoConnect');f.get('retryHttpOverload');this.uc=f.get('messageTimeout');this.$=olympe.Z.bf.parse(f.get('clientVersion'));this.na=olympe.Z.bf.parse(f.get('serverVersion'));this.C=olympe.O.cb.C.INIT;this.ub=f.get('getContextMode');this.ye=1;this.T=null;this.L=[0,
|
|
414
|
-
0,0];this.
|
|
415
|
-
this.F.
|
|
416
|
-
m.send('{"action": "wakeup"}');R(this,f);break;case 'waking-up':break;default:this.K.warn(`Invalid message from ${k}: ${n}`),m.close(),R(this,d)}});m.F(()=>{this.K.warn(`Communication with ${k} failed.`);m.close();R(this,d)});m.
|
|
414
|
+
0,0];this.ga=new Map;this.P=olympe.D.ec(olympe.D.ea,'Server is online');this.qd=new Map;this.jd=new Map;this.G=new Map;this.ac=new Map;this.Qb=-1;Xc(this,f,c)}connect(){const a=olympe.O.cb.C.INIT,b=olympe.O.cb.C.CONNECTING,c=olympe.O.cb.C.Dh,d=olympe.O.cb.C.Pe,e=olympe.O.cb.C.cg,f=olympe.O.cb.C.$g,g=olympe.O.cb.C.Ag,h=olympe.O.cb.C.Db;null!==this.F&&(this.F.$(null),this.F.close());this.Wa=!0;this.K.log(`Asking NET layer for a connection to ${Ob(this.da)}:${this.da.port}...`);this.F=this.Eb.G(this.da);
|
|
415
|
+
this.F.ga(this.zd.bind(this));this.F.da(this.Lf.bind(this));this.F.$(()=>{this.F=null;this.C===c?R(this,e):this.C!==h&&this.C!==f&&R(this,d)});this.Da&&this.C===a&&this.F.F(()=>{this.F.F(null);if(this.C===b){var k=Pb(this.Da);this.K.info(`Trying to wakeup orchestrator with ${k}`);R(this,f);var m=this.Eb.G(this.Da);m.da(n=>{const p=JSON.parse(n);this.K.info(`${k}: ${null==p?void 0:p.status}`);switch(null==p?void 0:p.status){case 'ready':R(this,g);m.close();break;case 'asleep':this.K.info(`Trying to wakeup orchestrator with ${k}`);
|
|
416
|
+
m.send('{"action": "wakeup"}');R(this,f);break;case 'waking-up':break;default:this.K.warn(`Invalid message from ${k}: ${n}`),m.close(),R(this,d)}});m.F(()=>{this.K.warn(`Communication with ${k} failed.`);m.close();R(this,d)});m.ga(()=>{this.K.info(`Checking orchestrator status with ${k}`);m.send('{"action": "status"}')})}this.Da=null});this.C!==e&&R(this,b)}disconnect(){const a=olympe.O.cb.C.CONNECTING;if(this.C===olympe.O.cb.C.Dh||this.C===a)this.Wa=!1,R(this,olympe.O.cb.C.Pe),this.F.close()}zd(){this.K.debug('Websocket connected, sending handshake. Client version:',
|
|
417
417
|
Qa(this.$),'subscribeEverything:',this.ub?'NO':'YES');cd(this,olympe.O.ae.Ui,{c:olympe.O.jb.Ui,cv:Qa(this.$),m:this.ub?0:1,s:this.T},this.ni.bind(this))}ni(a,b){if(a)id(this,'Error in receiving handshake response: '+a.message);else{this.K.debug('Handshake response received');var c=olympe.O.cb.F;a=b.sv||'undefined';var d=b.activityTimeout?Math.max(b.activityTimeout-60,5):null;switch(b.status){case c.Qr:id(this,`Framework version (${Qa(this.$)}) provided to the orchestrator was not valid. See orchestrator logs for more info.`);
|
|
418
418
|
return;case c.ut:id(this,`Framework version (${Qa(this.$)}) is not compatible with the orchestrator in use. See orchestrator logs for more info.`);return;case c.Ar:id(this,'Handshake failed. See orchestrator logs for more info.');return}if(this.na.Ha(olympe.Z.bf.C))this.K.warn('Handshake successful but received server version',a,'is invalid. Cannot check against it');else try{var e=olympe.Z.bf.parse(a);if(e.Ci(this.na)){id(this,`Framework v${Qa(this.$)} is expecting Orchestrator to be at least in v${Qa(this.na)}`);
|
|
419
419
|
return}this.K.log('Handshake successful. Orchestrator version: ',e,'required:',Qa(this.na))}catch(f){id(this,f);return}e=olympe.O.cb.C.Pe;if(this.C===olympe.O.cb.C.cg&&null!==this.T&&this.T!==b.sessionId)this.K.warn('Trying to do a session recovering, but got another session id so retry from disconnected state'),R(this,e);else{if(e=b.identityProviders)for(const [f,g]of Object.entries(e))this.ac.set(f,g);this.T=b.sessionId||null;jd(this,a,d)}}}ji(){this.L[0]-this.L[1]>this.nm?(this.K.debug('Ping did not get answer, try to reconnect'),
|
|
420
420
|
R(this,olympe.O.cb.C.cg)):(this.L[0]=Date.now(),this.F.send('ping')||(this.K.debug('Impossible to send ping, try to reconnect'),R(this,olympe.O.cb.C.cg)))}Lf(a){this.L[2]=Date.now();if(a.startsWith('pong'))return this.L[1]=this.L[2],null;try{var b=JSON.parse(a)}catch(d){return this.K.error('Unable to parse response from server: '+d.toString()),Error('Unable to parse response from server')}this.K.C()&&this.K.debug('WS <',fd(b));a=b.seqId;const c=b.messageFamily;b=b.payload;if(this.G.has(a)){const {Kl:d}=
|
|
421
|
-
this.G.get(a);this.G.delete(a);d&&d(b)}a=this.
|
|
421
|
+
this.G.get(a);this.G.delete(a);d&&d(b)}a=this.ga.get(c);if(void 0!==a)for(const d of a.values())d(b);return null}Wb(){const a=Date.now();for(const [b,{wm:c}]of this.G)null!==c&&a-c>this.uc&&(this.K.warn(`No response was received from the server for the seqId = ${b}`),Zc(this,b,{error:{reason:'Message timeout: never receive acknowledge'}}))}};olympe.O.Request=class{constructor(a,b,c,d,e,f){this.F=d;this.C=a;this.source=b;this.L=c;this.th=e;this.G=f||null}Nb(){return this.C}zb(){return this.source}sg(){return this.F}getType(){return this.th}td(){return this.G}Td(){return this.L}ha(a){return{dest:this.C,src:this.source,seq:this.F,auth:this.L,type:this.th,content:a.ha(this.G)}}toString(){return`Request(dest: ${this.C}, src: ${this.source}, seqId: ${this.F}, type: ${this.th})`}};
|
|
422
422
|
olympe.O.Request.jb={SEND:0,GET:1,PUBLISH:2,SUBSCRIBE:3,qe:4,Jp:5};function kd(a){const b=olympe.O.Response.jb.Hp;return a.F!==olympe.O.Response.jb.vl?Promise.reject('Should only call `topicAck` on TOPIC responses'):zc(olympe.O.kh(),a.C.seq,a.source,b)}olympe.O.Response=class{constructor(a,b,c,d,e){this.L=c;this.G=a;this.source=b;this.F=d;this.C=null!=e?e:null}Nb(){return this.G}zb(){return this.source}sg(){return this.L}getType(){return this.F}td(){return this.C}ha(a){return{dest:this.G,src:this.source,seq:this.L,type:this.F,content:a.ha(this.C)}}toString(){return JSON.stringify(this)}};
|
|
423
423
|
olympe.O.Response.jb={dk:0,sp:1,Pp:2,vl:3,Hp:4,Db:5};const ld=olympe.O.Response.jb.sp,md=olympe.O.Response.jb.Db,nd=olympe.O.Response.jb.Pp,od=olympe.O.Response.jb.vl,pd=olympe.O.Response.jb.Hp,qd=olympe.O.Request.jb.SEND,rd=olympe.O.Request.jb.GET,sd=olympe.O.Request.jb.SUBSCRIBE,td=olympe.O.Request.jb.qe;
|
|
424
424
|
olympe.O.zc=class{constructor(a,b,c){this.request=a;this.C=b;this.G=c;this.F=null}wh(){return null!==this.F?Promise.resolve(this.F):Kc(this.C,this.request).then(a=>this.F=a)}th(){return this.request.getType()}source(){return this.request.zb()}body(){return this.request.td()}Yp(){return this.request.getType()===qd?this.C.ed(this.request,ld):Promise.reject('Should only call `ack` on SEND requests')}ed(a){const b=this.request.getType();return b===rd||b===td?this.C.ed(this.request,nd,a):Promise.reject('Should only call `reply` on GET requests')}qm(a){if(this.request.getType()!==
|
|
@@ -451,15 +451,15 @@ function Jd(a,b,c){const d=null==b?void 0:b.Ue();if(b instanceof olympe.auth.fj)
|
|
|
451
451
|
d&&{idpName:d}),c)}function Ld(a,b,c,d){c.c=b;cd(a.C,olympe.O.ae.Zf,c,d)}function Md(a,b,c){if(b.Lg()!==olympe.auth.kc.C.OAUTH2)c(Error('Only oAuth2 tokens can be refreshed'));else{var d=`?idpName=${b.Ue()}&access_token=${Kd(b)}`;d=`${Vc(a.Kg,olympe.O.Mb.dj)}/refresh${d}`;Wc(a.Kg,P(d),b.Yc()).then(e=>{'string'===typeof e?(e=JSON.parse(e),e=new olympe.auth.fj(b.oc(),b.ie(),b.Yc(),e,b.Ue()),c(null,e)):c(null,b)}).catch(e=>c(Error(e)))}}
|
|
452
452
|
olympe.auth.Pc=class{constructor(a,b,c,d,e){this.K=a;this.C=b;this.Kg=c;this.F=d;this.storage=e;const f=this.storage.C('AUTH');f&&(f.get('redirectTo',g=>{g&&(f.remove('redirectTo'),f.close(),this.F.redirect(g,null,olympe.auth.pj.C.GET))}),f.close())}Wd(a){cd(this.C,olympe.O.ae.Zf,{c:olympe.auth.Pc.C.qe},b=>a(b))}ug(a,b,c){const d=Vc(this.Kg,olympe.O.Mb.Mp);a=P(`${d}/${a}`);Wc(this.Kg,a,b).then(e=>c(null,e)).catch(e=>c(Error(e)))}};
|
|
453
453
|
olympe.auth.Pc.C={Zf:1,Cs:2,Db:3,qe:5,Yh:6,Hr:10,pt:11,Mq:12,SAML:13,gt:14,Bs:20};function Lc(a,b){var c='busLogoutCallback';void 0===c&&(c=olympe.Z.jh());a.Da.set(c,b)}function Bc(a){return olympe.D.Ta(a.C.vb())}
|
|
454
|
-
function Nd(a){a.K.info('Initializing AUTH layer');let b=a.uc;if(a.na){const c=a.na.C(),d=Kb(c.parameters);b=d||b;d&&a.na.F(c.parameters.filter(e=>'authToken'!==e.ia()))}b&&a.storage&&Od(a.storage,b,c=>{!c&&a.K.error('Could not store authToken')});a.K.debug('Asking to be notified when auth connector gets online');ad(a.L,()=>{if(a.ub)if(a.G=olympe.auth.Ba.G.Jq,a.K.log('Connector online, parameter auth.autoLogin=true --\x3e attempting to log with parameters'),a.
|
|
455
|
-
a.
|
|
454
|
+
function Nd(a){a.K.info('Initializing AUTH layer');let b=a.uc;if(a.na){const c=a.na.C(),d=Kb(c.parameters);b=d||b;d&&a.na.F(c.parameters.filter(e=>'authToken'!==e.ia()))}b&&a.storage&&Od(a.storage,b,c=>{!c&&a.K.error('Could not store authToken')});a.K.debug('Asking to be notified when auth connector gets online');ad(a.L,()=>{if(a.ub)if(a.G=olympe.auth.Ba.G.Jq,a.K.log('Connector online, parameter auth.autoLogin=true --\x3e attempting to log with parameters'),a.ga){const c=new olympe.auth.Request;c.set('username',
|
|
455
|
+
a.ga);c.set('password',a.Qb);a.K.log('Autologin with user "'+a.ga+'"');Pd(a,c)}else Qd(a,'No user specified for auto login',!0);else a.G=olympe.auth.Ba.G.zj,a.K.log('Connector online, attempting to log with token'),Rd(a)});bd(a.L,()=>{switch(olympe.D.Ta(a.F)){case olympe.auth.Ba.C.ke:const c=olympe.D.Ta(a.C.vb()).oc();a.K.warn(`Disconnected from server - session of user ${c} lost`);break;case olympe.auth.Ba.C.Af:a.K.warn('Disconnected from server - guest session lost');break;case olympe.auth.Ba.C.Gi:a.K.warn('Disconnected from server - authentication aborted');
|
|
456
456
|
break;case olympe.auth.Ba.C.INIT:a.K.warn('Cannot open auth session - no server connection');break;default:a.K.error('Should not get there, investigate')}Sd(a,olympe.auth.Ba.C.Pe)});hd(a.L,c=>{switch(c){case olympe.O.cb.C.$g:Sd(a,olympe.auth.Ba.C.$g);break;case olympe.O.cb.C.Ag:Sd(a,olympe.auth.Ba.C.Ag)}});Id(a.P,(c,d)=>{if(c===olympe.auth.Ba.F.Ei)Qd(a,'authentication revoked'),a.storage&&Td(a.storage),a.Da.forEach(e=>{e(c,d)});else if(c===olympe.auth.Ba.F.Yn)a.K.info('Redirection to IDP to invalidate token (SAML)'),
|
|
457
457
|
Bc(a),a.storage&&Td(a.storage),a.Eb.F();else throw Error(`Unknown logout step coming from server : ${c}`);});a.mb=Ud(a);a.da.F(()=>a.wi().catch(c=>a.K.error(`Failed to logout ${c}`)));a.K.log('DONE initializing AUTH layer (waiting for connector to be online)')}function Vd(a,b){let c=null;olympe.D.em(a.F.vb().ad(olympe.auth.Ba.C.ke).and(b),()=>{c=a.Ie(d=>{d&&a.K.error('Failed to refresh token when returning to active mode')})},()=>{let d;null==(d=c)||d()})}
|
|
458
458
|
function Rd(a){null!==a.storage?(a.K.debug('Retrieving token from local storage'),a.storage.Td(b=>{if(b){const e=new olympe.auth.Request;var c=b.oc();e.set('username',c);c=e;var d=b.Yc();c.set('nonce',d);'string'===typeof b.Ue()&&e.set('idpName',b.Ue());a.K.debug('Token found, trying login with',e);Pd(a,e,olympe.auth.kc.C.fl)}else Qd(a,'No token found, cannot perform auto login')})):Qd(a,'Cannot retrieve token: no storage configured, cannot perform auto login',!0)}
|
|
459
459
|
function Sd(a,b){a.K.log('State change: ',Wd(a),'--\x3e',b);a.F.update(b)}function Qd(a,b,c=!1){a.C.update(a.$);Sd(a,olympe.auth.Ba.C.Af);b=`Authenticated as guest (${b})`;c?a.K.error(b):a.K.info(b)}function Ud(a){const b=[olympe.auth.Ba.C.ke];a.ub||b.push(olympe.auth.Ba.C.Af);return a.da.C(()=>{const c=Wd(a);return b.includes(c)?Promise.resolve('The auth manager is OK'):Promise.reject(`The auth manager is not in valid state, the current state is: ${c}`)})}
|
|
460
460
|
function Wd(a){return olympe.D.Ta(a.F.vb())}function Xd(){var a=olympe.public.Va.get();return new Map(a.L.ac)}function Yd(a,b){if(b){a.C.update(b);let c;null==(c=a.storage)||Od(c,b);a.K.debug('Token updated')}}function Zd(a,b,c,d=!1){b=b+c?':'+c.message:'';a.K.error(b);a.error.update(olympe.D.sb(b));Sd(a,olympe.auth.Ba.C.Db);if(d)throw Error(b);}
|
|
461
461
|
function Pd(a,b,c,d){void 0===c&&(c=a.Wb);void 0===c&&Zd(a,'No authentication provider specified',null,!0);const e=a.Hc.get(c);e||Zd(a,'Undefined authentication provider "'+c+'"',null,!0);d&&a.T.set('login',d);a.K.log('Sending authentication request using "'+c+'" for '+b);e.Td(b,a.ac.bind(a));Sd(a,olympe.auth.Ba.C.Gi)}function $d(a,b,c){a.T.forEach(d=>{d(b,c)})}
|
|
462
|
-
olympe.auth.Ba=class{constructor(a,b,c,d,e,f,g,h,k,m){this.K=a;this.L=b;this.P=c;this.storage=d;this.Eb=e;this.na=f;this.Wb=m.get('defaultProvider');this.ub=!!m.get('autoLogin');this.
|
|
462
|
+
olympe.auth.Ba=class{constructor(a,b,c,d,e,f,g,h,k,m){this.K=a;this.L=b;this.P=c;this.storage=d;this.Eb=e;this.na=f;this.Wb=m.get('defaultProvider');this.ub=!!m.get('autoLogin');this.ga=m.get('autoUser');this.Qb=m.get('autoPassword');this.uc=m.get('autoToken');this.Hc=new Map;this.da=g;this.mb='';this.F=olympe.D.ec(String).update(olympe.auth.Ba.C.INIT);this.error=olympe.D.ec(olympe.D.Ka);this.G=null;this.$=new olympe.auth.ig('guest','0163d9653067b6237f62','e96e099c-55bb-4004-b0e8-bd76b6209218');this.C=
|
|
463
463
|
olympe.D.ec(olympe.auth.ig).update(this.$);this.T=new Map;this.Da=new Map;this.Wa=new olympe.Z.xl(m.get('cacheTokenTimeout'));h.forEach(n=>{const p=n.C();if(this.Hc.has(p))throw Error('Provider "'+p+'" has already been registered !');this.Hc.set(p,n)});Nd(this);Vd(this,k)}getState(){return this.F.vb()}oc(){return this.C.vb().oc()}ie(){return this.C.vb().ie()}Ie(a){const b=Bc(this);return olympe.D.Ta(this.C)!==this.$&&b?this.Hc.get(b.Lg()).Ie(b,(c,d)=>{c?(this.K.error('Failed to refresh token, error message: ',
|
|
464
464
|
c.message),this.wi().catch(e=>this.K.error(`Failed to logout after wrong refresh ${e}`)),a(c)):(d&&Yd(this,d),a(null))}):null}mh(){return this.C.vb().mh()}ug(a,b){if(Ja(this.Wa.C,a))b(null,this.Wa.get(a));else{var c,d=null==(c=olympe.D.Ta(this.C.vb()))?void 0:c.Yc();this.P.ug(a,d,(e,f)=>{'string'===typeof f&&this.Wa.set(a,f);b(e,f)})}}wi(){return olympe.D.Ta(this.C)===this.$?(this.K.warn('Logout called for Guest user so it will be ignored'),Promise.resolve()):new Promise((a,b)=>{this.K.debug('Sending logout');
|
|
465
465
|
Td(this.storage);Jd(this.P,Bc(this),c=>{c?(Zd(this,'Logout request rejected:',c),b(c)):(this.K.debug('Logout request acknowledged'),a())});this.da.G(this.mb)})}Wd(a){Wd(this)===olympe.auth.Ba.C.ke&&this.P.Wd(b=>{b&&this.K.error('Was not able to send the auth keep alive message:',b.message);null==a||a(b)})}ac(a,b){const c=null===this.G?olympe.auth.Ba.G.Gs:this.G;this.G=null;a?(Td(this.storage),this.error.update(olympe.D.sb(a.message)),Qd(this,'authentication rejected: '+a.message),$d(this,a,c)):(this.K.info('User '+
|
|
@@ -478,49 +478,49 @@ olympe.V.run([olympe.auth.R.Ga],a=>{olympe.auth.ge=()=>a});olympe.Na.node.auth={
|
|
|
478
478
|
b&&b(!0)}clear(){this.C||this.open();this.db.setState({})}};olympe.Na.node.jc.wo.va=[olympe.jc.xs];olympe.V.config(function(a){D(a,olympe.jc.R.Yi,olympe.Na.node.jc.vo,olympe.jc.R.za)},'olympe.native.node.localstorage');olympe.Na.node.storage={};olympe.Na.node.storage.Storage=class{constructor(a){this.K=a}write(a,b,c,d,e){e&&e('Not Implemented.')}open(a){a(null)}close(a){a(null)}};olympe.Na.node.storage.Storage.va=[olympe.jc.Storage];olympe.V.config(function(a){ua(a,olympe.jc.R.vj,olympe.Na.node.storage.Storage,olympe.host.R.za)},'olympe.native.html.storage');olympe.Pf={};olympe.Pf.U={VERSION:'version.version',Wq:'version.branch',Le:'version.commit',tt:'version.tag',Kn:'version.olympe-framework',Xq:'version.build'};olympe.V.config(function(a){F(a,olympe.Pf.U.VERSION,'');F(a,olympe.Pf.U.Wq,'');F(a,olympe.Pf.U.Le,'');F(a,olympe.Pf.U.tt,'');F(a,olympe.Pf.U.Kn,'');F(a,olympe.Pf.U.Xq,'')},'olympe.main');const ie=require('fs');let za,ya;function je(a,b){ie.readFile(a,(c,d)=>{c?b(Object.create(null)):(d=JSON.parse(d),b(d))})}
|
|
479
479
|
function ke(){if(void 0!==za&&void 0!==ya){0===Object.keys(ya).length&&console.warn('No configuration found. Check presence of oConfig.json');0===Object.keys(za).length&&console.warn('No version found. Check presence of version.json');var a=Object.create(null);const b=process.argv;for(let c=2;c<b.length;c++){const d=/^true|false$/i,e=/^\d+(\.\d+)?$/;let f;const g=/([^?&=]+)(=?([^?&=]+))?/g.exec(b[c]);!Array.isArray(g)||4>g.length?console.warn(`Malformed config parameter "${b[c]}" ignored. It should of the form 'a=b'`):
|
|
480
480
|
(f=g[3],void 0===f?f=!0:f.startsWith('"')&&f.endsWith('"')?f=f.substring(1,f.length-1):d.test(f)?f='true'===f.toLowerCase():e.test(f)&&(f=parseFloat(f)),a[g[1]]=f)}a=new olympe.V.ir(a);na(a);qa(a.compile())}}function le(){console.log('The node process received a signal for graceful shutdown');let a,b;null==(b=(a=olympe.Na.node.host).Rj)||dc(b.call(a)).then(()=>{console.log('The node backend has stopped successfully');process.exit(0)}).catch(c=>process.exit(1,c))}
|
|
481
|
-
olympe.Z.Cd('oConfig.json',je,function(a){ya=a;ke()});je('version.json',function(a){za=a;ke()});process.on('SIGTERM',le);process.on('SIGINT',le);process.on('SIGBREAK',le);process.on('SIGHUP',le);process.on('uncaughtException',a=>{console.error('Uncaught Exception:',a);le()});olympe.dc={};olympe.dc.wa={ORIGIN:'<',DESTINATION:'>'};B('olympe.dc.Direction',olympe.dc.wa);olympe.dc.mc={nd:'ff022000000000000000',Hh:'ff02200000000000000e',Li:'ff02200000000000000f'};olympe.dc.jo={VERSION:'@v',yp:'@s'};olympe.dc.Wi={Id:'?'};olympe.dc.Hz={Ly:'online',Th:'offline',qy:'invalidate'};olympe.dc.Ra={SELF:'self',SERVER:'server',Df:'remote',Th:'offline'};olympe.dc.Ob={NONE:null,vn:'ff023000000000000037',qc:'ff023000000000000137',Ef:'ff023000000000000237',lt:'ff023000000000000337'};olympe.dc.Mo=class extends Error{constructor(a){var b=olympe.dc.ta(),c=olympe.dc.Fd(),d=b.model(a);d=`\n- model: ${d} (${d?b.name(d):'no name'})`;b=b.source(a);c=`\n- source: ${b} (${b?c.zb(b).name():'no name'})`;super(`Trying to use an CloudObject that does not exist:\n- tag: ${a}${d}${c}${''}`)}};olympe.dc.Writable=class{Ec(){}hd(){}F(){}Ea(){}Xb(){}};olympe.dc.Ws=class{Od(){}W(){}G(){}};function me(a){return olympe.dc.CloudObject.get(a.tag)}olympe.dc.lc=class{constructor(a){this.tag='string'===typeof a?a:a.X()}X(){return this.tag}toJSON(){return'{ "type": "reference", "tag": '+JSON.stringify(this.tag)+' }'}Ha(a){return a instanceof olympe.dc.lc&&this.tag===a.tag}static wc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.dc.lc(b.tag)}};olympe.dc.lc.va=[olympe.dc.pe];olympe.dc.lc.prototype.toJSON.J=olympe.D.H.C;olympe.dc.lc.prototype.Ha.J=olympe.D.H.C;olympe.dc.zr=class a{constructor(b,c,d,e,f,g){this.K=b;this.db=c;this.T=d;this.fc=e;this.P=f;this.G=g;this.C=La(new olympe.Z.xl(6E5),(h,k)=>{URL.revokeObjectURL(k);ne(this.db,h,a.C(h))})}$(b,c,d,e,f){this.da(c).then(g=>{this.
|
|
482
|
-
e,f);else{var n=p=>{p=p instanceof Uint8Array?new Blob([p],{type:m}):p;this.G&&this.L(h,p);e(p)};g.valueOf()?(g=this.db.model(b),g=new olympe.dc.Request(olympe.dc.Request.C.Uf,olympe.dc.Fd().Ce(b),{tag:h,model:g}),this.fc.request(g).then(n).catch(f)):(g=P(k),g.G=olympe.net.Fa.ResponseType.lk,this.T.C(g,p=>{const q=p.Rc();200<=q&&300>q?n(p.getData()):f(`Failed to download file ${b}. Response code ${q}`)}))}})}
|
|
483
|
-
new olympe.dc.Request(olympe.dc.Request.C.jg,olympe.dc.Fd().Ce(b),{tag:b,model:h,content:c,mimeType:d});this.fc.request(h).then(e).catch(null!=g?g:this.K.error.bind(this.K))}da(b){return v(function*(){var c=b instanceof olympe.D.Ka?b.valueOf():b;return'string'===typeof c?(new TextEncoder).encode(c):c instanceof ArrayBuffer?new Uint8Array(c,0,c.byteLength):c instanceof Blob?(c=yield c.arrayBuffer(),new Uint8Array(c,0,c.byteLength)):c})}L(b,c){const d=olympe.dc.
|
|
481
|
+
olympe.Z.Cd('oConfig.json',je,function(a){ya=a;ke()});je('version.json',function(a){za=a;ke()});process.on('SIGTERM',le);process.on('SIGINT',le);process.on('SIGBREAK',le);process.on('SIGHUP',le);process.on('uncaughtException',a=>{console.error('Uncaught Exception:',a);le()});olympe.dc={};olympe.dc.wa={ORIGIN:'<',DESTINATION:'>'};B('olympe.dc.Direction',olympe.dc.wa);olympe.dc.mc={nd:'ff022000000000000000',Hh:'ff02200000000000000e',Li:'ff02200000000000000f'};olympe.dc.jo={VERSION:'@v',yp:'@s'};olympe.dc.Wi={Id:'?'};olympe.dc.Hz={Ly:'online',Th:'offline',qy:'invalidate'};olympe.dc.Ra={SELF:'self',SERVER:'server',Df:'remote',Th:'offline'};olympe.dc.Ob={NONE:null,vn:'ff023000000000000037',qc:'ff023000000000000137',Ef:'ff023000000000000237',lt:'ff023000000000000337'};olympe.dc.Mo=class extends Error{constructor(a){var b=olympe.dc.ta(),c=olympe.dc.Fd(),d=b.model(a);d=`\n- model: ${d} (${d?b.name(d):'no name'})`;b=b.source(a);c=`\n- source: ${b} (${b?c.zb(b).name():'no name'})`;super(`Trying to use an CloudObject that does not exist:\n- tag: ${a}${d}${c}${''}`)}};olympe.dc.Writable=class{Ec(){}hd(){}F(){}Ea(){}Xb(){}};olympe.dc.Ws=class{Od(){}W(){}G(){}};function me(a){return olympe.dc.CloudObject.get(a.tag)}olympe.dc.lc=class{constructor(a){this.tag='string'===typeof a?a:a.X()}X(){return this.tag}toJSON(){return'{ "type": "reference", "tag": '+JSON.stringify(this.tag)+' }'}Ha(a){return a instanceof olympe.dc.lc&&this.tag===a.tag}static wc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.dc.lc(b.tag)}};olympe.dc.lc.va=[olympe.dc.pe];olympe.dc.lc.prototype.toJSON.J=olympe.D.H.C;olympe.dc.lc.prototype.Ha.J=olympe.D.H.C;olympe.dc.zr=class a{constructor(b,c,d,e,f,g){this.K=b;this.db=c;this.T=d;this.fc=e;this.P=f;this.G=g;this.C=La(new olympe.Z.xl(6E5),(h,k)=>{URL.revokeObjectURL(k);ne(this.db,h,a.C(h))})}$(b,c,d,e,f){this.da(c).then(g=>{this.ga(b,g,d,!!this.G,e,f)}).catch(g=>this.K.error(g))}F(b,c,d){const e=olympe.D.Ma().G(c),f=olympe.D.Ma().G(g=>{g=`Failed to download file ${b.X()}: ${g}`;this.K.error(g);null==d||d(g)});olympe.D.Aq([b.wq(),b.X(),b.Uk(),b.am()],(g,h,k,m)=>{if(Ja(this.C.C,h))g=this.C.get(h),this.P.C(g,
|
|
482
|
+
e,f);else{var n=p=>{p=p instanceof Uint8Array?new Blob([p],{type:m}):p;this.G&&this.L(h,p);e(p)};g.valueOf()?(g=this.db.model(b),g=new olympe.dc.Request(olympe.dc.Request.C.Uf,olympe.dc.Fd().Ce(b),{tag:h,model:g}),this.fc.request(g).then(n).catch(f)):(g=P(k),g.G=olympe.net.Fa.ResponseType.lk,this.T.C(g,p=>{const q=p.Rc();200<=q&&300>q?n(p.getData()):f(`Failed to download file ${b}. Response code ${q}`)}))}})}ga(b,c,d,e,f,g){e=e?k=>{this.L(b,new Blob([c],{type:d}));f(k)}:f;var h=this.db.model(b);h=
|
|
483
|
+
new olympe.dc.Request(olympe.dc.Request.C.jg,olympe.dc.Fd().Ce(b),{tag:b,model:h,content:c,mimeType:d});this.fc.request(h).then(e).catch(null!=g?g:this.K.error.bind(this.K))}da(b){return v(function*(){var c=b instanceof olympe.D.Ka?b.valueOf():b;return'string'===typeof c?(new TextEncoder).encode(c):c instanceof ArrayBuffer?new Uint8Array(c,0,c.byteLength):c instanceof Blob?(c=yield c.arrayBuffer(),new Uint8Array(c,0,c.byteLength)):c})}L(b,c){const d=olympe.dc.fa(b);b=URL.createObjectURL(c);this.C.set(d,
|
|
484
484
|
b);const e=a.C(d);oe(this.db,d,f=>{f||(this.C.delete(d),ne(this.db,d,e))},e)}static C(b){return`cacheBinary${b}`}};function pe(a,b){let c=qe.get(b)||null,d=null;for(;!c&&b&&b!==d;){d=b;b=a.db.Ae(b);if(null===b)break;c=qe.get(b)||null}let e;return null!=(e=c)?e:null}olympe.dc.Sr=class{constructor(a,b,c){this.K=a;this.C=b;this.db=b.view;this.F=c;this.Oa=new FinalizationRegistry(d=>{this.K.L()&&this.K.debug(`Collect instance ${d} (${this.db.name(d)||'no name'})`);this.C.C.Qb([d])})}};function re(a,b){a.origin=b;return a}olympe.dc.Request=class{constructor(a,b,c,d){this.type=a;this.origin=olympe.dc.Ra.SELF;this.C=b;this.content=null!=c?c:null;this.F=null!=d?d:Bc(olympe.auth.ge()).ie()}getType(){return this.type}oc(){return this.F}Nb(){return this.C}toString(){return`Request of type ${this.type}, from ${this.origin} to ${this.C}; content: ${this.content}`}};
|
|
485
|
-
olympe.dc.Request.C={Pb:1,oe:10,Rn:24,Kk:25,Cr:28,Rg:30,mj:31,ez:32,Ki:33,Xg:40,$h:41,Om:42,ip:43,Ah:45,Qm:46,Gk:47,jg:50,Uf:51,Hg:52,Bt:60,bt:61,Br:62,iy:63,ar:64,Bh:65,sn:91,Dr:93,cl:95,QUERY_RESULT:97};olympe.dc.Wh=class a{constructor(b,c,d,e,f,g,h,k){this.K=b;this.$=c;this.C=h;this.sources=new Map;this.F=this.na(k);this.G=new Map;this.
|
|
485
|
+
olympe.dc.Request.C={Pb:1,oe:10,Rn:24,Kk:25,Cr:28,Rg:30,mj:31,ez:32,Ki:33,Xg:40,$h:41,Om:42,ip:43,Ah:45,Qm:46,Gk:47,jg:50,Uf:51,Hg:52,Bt:60,bt:61,Br:62,iy:63,ar:64,Bh:65,sn:91,Dr:93,cl:95,QUERY_RESULT:97};olympe.dc.Wh=class a{constructor(b,c,d,e,f,g,h,k){this.K=b;this.$=c;this.C=h;this.sources=new Map;this.F=this.na(k);this.G=new Map;this.ga(f,g,d,e)}request(b){this.K.debug('Router: sends',b);const c=this.P(b);return this.zb(c).request(b)}T(b,c){this.K.debug('Router: subscribes',b);const d=this.P(b);return this.zb(d).L(b,c)}ed(b){const c=b.Nb();if(c===this.C){let d;null==(d=this.G.get(b.getType()))||d.forEach(e=>e(b))}else olympe.O.qb.publish(c,b).catch(d=>{this.K.error(`Error while publishing the message ${b} to remote router: ${d}`)})}L(b,
|
|
486
486
|
c){let d=this.G.get(b);void 0===d&&(d=[],this.G.set(b,d));d.push(c)}da(b){return this.sources.has(b)}zb(b){let c;return null!=(c=this.sources.get(b))?c:this.sources.get(olympe.dc.Ra.Df)}P(b){var c=olympe.dc.Request.C.oe,d=olympe.dc.Request.C.Kk,e=olympe.dc.Request.C.Rn,f=olympe.dc.Request.C.Ki,g=olympe.dc.Request.C.Xg;const h=olympe.dc.Request.C.Ah,k=olympe.dc.Request.C.jg,m=olympe.dc.Request.C.Hg,n=olympe.dc.Request.C.Uf;switch(b.getType()){case c:d=this.F.get(a.C.oe)||[];break;case d:case f:case e:d=
|
|
487
487
|
this.F.get(a.C.Ys)||[];break;case g:case h:d=this.F.get(a.C.TRANSACTION)||[];break;case k:case n:case m:d=this.F.get(a.C.yr)||[];break;default:d=[]}c=b.content;e=olympe.auth.Ba.C.ke;f=olympe.auth.Ba.C.Af;g=Wd(this.$);e=!(g===e||g===f);for(var p of d){let q;d=p;f=c&&(null==(q=c)?void 0:q.W)&&c.W();g=d.get('type');if(g===a.F.Th&&e||g===a.F.Xn&&d.get('id')===f||g===a.F.Id)return p=p.get('destination'),this.K.debug('Request type',b.getType(),'with original destination',b.Nb(),'is redirected to',p),p}return b.Nb()}na(b){const c=
|
|
488
488
|
Object.values(olympe.dc.Wh.C),d=Object.values(olympe.dc.Wh.F);b=Object.entries(b);const e=new Map;b.forEach(([f,g])=>{if(c.includes(f))if(g instanceof Array){var h=[];e.set(f,h);g.forEach(k=>{const m=k.type;if(d.includes(m)){var n=k.destinations;n instanceof Array?(n=(new Map).set('type',m).set('destinations',n),h.push(n),m===a.F.Xn&&n.set('id',k.id)):this.K.error('Routing rule',f,m,'is not valid. Destinations must be stored in an array')}else this.K.error('Routing rule',f,m,'is not valid. Valid rules are',
|
|
489
|
-
d.toString())})}else this.K.error('Routing rule',f,'is not valid. Rules must be ordered in an array');else this.K.error('Routing rule',f,'is not valid. Valid messages are',c.toString())});return e}
|
|
489
|
+
d.toString())})}else this.K.error('Routing rule',f,'is not valid. Rules must be ordered in an array');else this.K.error('Routing rule',f,'is not valid. Valid messages are',c.toString())});return e}ga(b,c,d,e){const f=olympe.D.og();this.sources.set(olympe.dc.Ra.SERVER,e.init(this));oe(b,this.C,()=>{this.sources.set(olympe.dc.Ra.Df,d.init(this));const g=new Map;olympe.dc.ra.from(this.C,this.C).eb(olympe.dm.DataSource.yi).filter(olympe.dc.query.Ca.Ha(olympe.dm.DataSource.eh,!0)).observe(f).subscribe(h=>
|
|
490
490
|
{var k=se(h);for(var m of k){const [p,q]=g.get(m);c.G(p);c.P(q);k=this.sources.get(m);this.sources.delete(m);var n=void 0;null==(n=k)||n.destroy()}h=te(h);for(const p of h)if(h=p.X(),!this.sources.has(h)){const q=new olympe.dc.sources.ro(this.K,p);this.sources.set(h,q);m=c.C(()=>q.healthCheck());n=c.F(()=>q.destroy());g.set(h,[m,n]);q.init(this)}});ne(b,this.C,'router',!0)},'router')}};olympe.dc.Wh.C={oe:'getContext',Ys:'query',TRANSACTION:'transaction',yr:'file'};
|
|
491
491
|
olympe.dc.Wh.F={Id:'default',Th:'offline',Xn:'id'};olympe.dc.Oa={};const ue=olympe.dc.wa.ORIGIN,ve=olympe.dc.wa.DESTINATION,qe=new Map,we=new Map,xe=new Map,ye=new Map;function ze(a,b,c){let d=a;'function'===typeof a&&(d=c.entry);a=[...(d.ym||[])];return olympe.dc.ka.C(b,c,...a)}function Ae(a,b){ye.set(a,b);return a}function Be(a){return(a=qe.get(a))&&a.F||olympe.dc.CloudObject}function Ce(a,b,c){const d=a+'@'+(b===ve?ue:ve);if(we.has(d))throw Error(`Try to register the same relation (${b+a}) multiple times.`);we.set(d,c)}
|
|
492
492
|
function De(a){a=a.X()+'@'+a.Pa();return we.get(a)||olympe.dc.CloudObject}function S(a,b){b.NAME=a;xe.set(a,b)}function T(a){return a.NAME||null}
|
|
493
493
|
olympe.dc.ka=class{constructor(){}static C(a,b,...c){if(qe.has(a))throw Error(`Tag: ${a} - overwriting already defined CloudObject class ${qe.get(a).F.name} with ${b.name}`);let d=null;const e=c.length;if(0<e){d=Array(e);for(let f=0;f<e;f++){let g=c[f];d[f]='string'===typeof g?new olympe.V.qb(g):g}}b=new olympe.dc.Oa.Entry(a,b,d);qe.set(a,b);return b.F.entry=b}static nc(a){return(a=a.entry)&&a.X()||null}};function Ee(a,b){a.C=b}function U(a,b){b=b.Rb();Ce(b.X(),b.Pa(),a.F);return b}function Fe(a){a.G=!0;return a}
|
|
494
494
|
olympe.dc.Oa.Entry=class{constructor(a,b,c){this.tag=a;this.F=b;this.ym=c||null;this.C=null;this.G=!1}X(){return this.tag}instantiate(a,b){const c=this.F;if(this.gm()&&b.getParameter(olympe.dc.U.Dn)){var d=olympe.dc.ta();d=`Trying to instantiate an abstract class ${d.name(this)} (${this.X()}).`+` This may happen when the implementation of another class extending ${d.name(this)} has not been registered`;olympe.la.fb('dc').error(d)}return this.ym?(a=[void 0,a].concat(ra(b,this.ym)),new c(...a)):new c(void 0,
|
|
495
|
-
a)}ja(a){return new olympe.dc.Oa.Property(a)}pa(a,b=olympe.dc.wa.DESTINATION){Ce(a,b,this.F);return new olympe.dc.ba.se(a,b)}gm(){return this.G}};B('olympe.dc.registry.Entry',olympe.dc.Oa.Entry);olympe.dc.Oa.Entry.prototype.addRelation=olympe.dc.Oa.Entry.prototype.pa;olympe.dc.Oa.Entry.prototype.addProperty=olympe.dc.Oa.Entry.prototype.ja;olympe.dc.Oa.Entry.va=[olympe.dc.pe];olympe.dc.Oa.Property=class{constructor(a){this.tag=a}X(){return this.tag}};olympe.dc.Oa.Property.prototype.getTag=olympe.dc.Oa.Property.prototype.X;olympe.dc.Oa.Property.va=[olympe.dc.pe];olympe.dc.Oa.Relation=class{constructor(a,b=olympe.dc.wa.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.CloudObject){this.tag=olympe.dc.
|
|
495
|
+
a)}ja(a){return new olympe.dc.Oa.Property(a)}pa(a,b=olympe.dc.wa.DESTINATION){Ce(a,b,this.F);return new olympe.dc.ba.se(a,b)}gm(){return this.G}};B('olympe.dc.registry.Entry',olympe.dc.Oa.Entry);olympe.dc.Oa.Entry.prototype.addRelation=olympe.dc.Oa.Entry.prototype.pa;olympe.dc.Oa.Entry.prototype.addProperty=olympe.dc.Oa.Entry.prototype.ja;olympe.dc.Oa.Entry.va=[olympe.dc.pe];olympe.dc.Oa.Property=class{constructor(a){this.tag=a}X(){return this.tag}};olympe.dc.Oa.Property.prototype.getTag=olympe.dc.Oa.Property.prototype.X;olympe.dc.Oa.Property.va=[olympe.dc.pe];olympe.dc.Oa.Relation=class{constructor(a,b=olympe.dc.wa.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.CloudObject){this.tag=olympe.dc.fa(a);this.direction=b;this.origin=c;this.L=d}X(){return this.tag}Pa(){return this.direction}type(){return this.L}Rb(){return new olympe.dc.Oa.Relation(this.tag,this.direction===olympe.dc.wa.DESTINATION?olympe.dc.wa.ORIGIN:olympe.dc.wa.DESTINATION,this.L,this.origin)}Ha(a){return a instanceof olympe.dc.Oa.Relation?a.X()===this.X()&&a.Pa()===this.Pa():!1}toString(){return this.direction+
|
|
496
496
|
this.tag}};olympe.dc.Oa.Relation.prototype.getInverse=olympe.dc.Oa.Relation.prototype.Rb;olympe.dc.Oa.Relation.prototype.getDirection=olympe.dc.Oa.Relation.prototype.Pa;olympe.dc.Oa.Relation.prototype.getTag=olympe.dc.Oa.Relation.prototype.X;olympe.dc.Oa.Relation.va=[olympe.dc.pe];olympe.dc.db={};function Ge(a,b){const c=a.G,d=olympe.dc.ta(),e=olympe.dc.db.Database.C.Vh,f=olympe.dc.db.Database.C.Id,g=olympe.dc.db.Database.C.ORIGIN,h=olympe.dc.db.Database.C.DESTINATION,k=new olympe.dc.db.Lc('rev-'+b.W());a.K.debug('Generate the reverse graphLayer of',b.W());b.C.forEach((m,n)=>{if(m.L()){k.F(n,olympe.dc.Ob.NONE);for(const [r,t]of m.he())k.Xb(r,n,t)}else{var p=c.get(n);if(void 0!==p)if(m.lf())for(const r of He(d,n,m.$())){m=c.get(r);const t=new Map;m.forEach((u,w)=>{const x=w[0],y=w.substring(1);
|
|
497
497
|
x===e?t.set(y,u):x===f?t.set(w,u):x===g?u.forEach((z,A)=>{k.Ea(y,A,r)}):x===h&&u.forEach((z,A)=>{k.Ea(y,r,A)})});m=m.source();k.Ec(r,m,t)}else{const r=new Map;for(const t of m.Cb().keys()){var q=t[0]===f;const u=q?t.substring(1):t;q=q?Ie(p,u,!0):p.Qa(u,!0);let w;r.set(t,null!=(w=q)?w:null)}0<r.size&&k.hd(n,r);for(const [t,u,w]of m.he())w?k.Xb(t,n,u):k.Ea(t,n,u)}}});return k}
|
|
498
498
|
function Je(a,b,c){const d=b.W();if(a.F.has(d))throw Error(`You try to execute the patch ${d} a second times whereas the first execution has not been validated yet.`);const e=new Ke(b,Ge(a,b));a.C.push(d);a.F.set(d,e);a.G.pi(c);a.write(b,!1)}function Le(a,b,c){return a.C.slice(0,c).map(d=>a.F.get(d)).reduce((d,e)=>e?e.dd(d):d,b)}
|
|
499
499
|
olympe.dc.db.hr=class{constructor(a,b,c,d){this.K=a;this.G=b;this.ta=c;this.L=d;this.C=[];this.F=new Map}dd(a){const b=a.W();this.C.includes(b)?this.push(b):this.write(Le(this,a,this.C.length),!0)}push(a){const b=this.C.indexOf(a);if(-1<b){const c=this.F.get(a);this.C.splice(b,1);Le(this,c.F,b);this.F.delete(a)}}write(a,b){(new olympe.dc.db.Tp(this.K,this.G,this.ta,this.L,b)).write(a)}};
|
|
500
500
|
function Me(a,b,c,d){const e=olympe.dc.wa.DESTINATION;c=c.tag();const f=a.C.Ge(c);b.Cb().forEach((g,h)=>{f.ja(h,g);b.ub(h)});for(const [g,h,k,m]of b.Eb()){if(!m)continue;const n=h===e?c:k,p=h===e?k:c;a.C.Ea(g,n,p);Ne(d,g,n,p)}}function Oe(a,b,c,d){const e=olympe.dc.wa.DESTINATION,f=c.tag(),g=a.C.Ge(f);b.Cb().forEach((h,k)=>{void 0!==c.Qa(k)&&(g.ja(k,h),b.ub(k))});for(const [h,k,m]of b.he()){const n=c.qd(h,e,k);void 0!==n&&(Ne(d,h,f,k),n===m&&Ne(a.C,h,f,k))}}
|
|
501
501
|
class Ke{constructor(a,b){this.F=a;this.C=b;this.db=olympe.dc.ta()}W(){return this.F.W()}dd(a){var b=this.F.C,c=a.C;const d=b.size>c.size,e=d?b:c;b=d?c:b;for(const [g,h]of b){b=g;var f=e.get(b);void 0!==f&&(c=d?f:h,f=d?h:f,f.lf()?c.L()||Pe(this.C,b,f.$()):c.lf()?(Me(this,f,c,a),Pe(a,b,c.$())):Oe(this,f,c,a))}return a}};const Qe=olympe.dc.mc.nd,Re=olympe.dc.mc.Hh,Se=olympe.dc.wa.ORIGIN,Te=olympe.dc.wa.DESTINATION;
|
|
502
|
-
olympe.dc.db.Database=class a extends Map{constructor(b,c,d){super();let e;this.id=null!=(e=d.get('selfTag'))?e:olympe.dc.Ra.SELF;this.K=b;this.jd=olympe.D.Ma();this.$=olympe.dc.db.Database.G.IDLE;this.
|
|
502
|
+
olympe.dc.db.Database=class a extends Map{constructor(b,c,d){super();let e;this.id=null!=(e=d.get('selfTag'))?e:olympe.dc.Ra.SELF;this.K=b;this.jd=olympe.D.Ma();this.$=olympe.dc.db.Database.G.IDLE;this.ga=new Map;this.Da=[];this.P=[];this.na=new Map;var f;b=null!=(f=d.get('garbageCollector'))?f:olympe.dc.db.Re.C.Ak;let g;f=null!=(g=d.get('garbageCollectorDelay'))?g:5E3;this.ze=new olympe.dc.db.Re(c,this,b,f);d.get('debug')&&this.ni()}W(){return this.id}getState(){return this.$}fb(){return this.K}create(b,
|
|
503
503
|
c,d,e=!1){var f=this.G(b,!0);if(!f.e&&(null===f.G||f.G===c)){f.G=c;let g;(null==(g=f.model())?0:g.e)&&f.db.da(f,!0)}e&&f.persist();d&&this.uc(f,d);this.F(a.F.co,b)}update(b,c){c&&(b=this.G(b,!0),this.uc(b,c))}Wa(b){const c=this.get(b);void 0!==c&&(this.da(c,!1),this.F(a.F.eo,b))}link(b,c,d){c=this.G(c,!0);d=this.G(d,!0);switch(b){case Qe:Ue(c,d);break;case Re:Ve(c,d);break;default:c.link(b,d)}}unlink(b,c,d){c=this.get(c);d=this.get(d);if(void 0!==c&&void 0!==d)switch(b){case Qe:We(c,d);break;case Re:Xe(c,
|
|
504
|
-
d);break;default:c.unlink(b,d)}}ub(b){for(const c of b)Ye(this.G(c))}Qb(b){for(const c of b)(b=this.get(c))&&Ze(b)}pi(b){b.forEach(c=>{this.G(c).persist()})}qd(b){const c=this.get(b);void 0!==c&&(c.clear(),super.delete(b),this.F(a.F.Bn,b))}G(b,c=!1){let d=this.get(b);void 0===d&&(d=new olympe.dc.db.Instance(b,this),this.set(b,d),this.F(a.F.An,b),c&&this.F(a.F.Bl,b));return d}Eb(b){$e(this.P[0],olympe.Z.jh(),b)}T(b){this.P[0].C.delete(b)}F(b,c,...d){this.
|
|
505
|
-
c){this.na.set(b,c)}Lf(b,c,d,e){let f;null!=(f=this.P[0])&&af(f,b).ja(e?bf+c:c,d)}ji(b,c,d,e,f){let g;null!=(g=this.P[0])&&(d===cf?f?af(g,b).link(c,e):af(g,b).unlink(c,e):f?af(g,b).Wb(c,e):af(g,b).uc(c,e))}Wb(b,c,d){let e;null!=(e=this.P[0])&&af(e,b).zd(c,d)}C(b,c){let d=this.
|
|
504
|
+
d);break;default:c.unlink(b,d)}}ub(b){for(const c of b)Ye(this.G(c))}Qb(b){for(const c of b)(b=this.get(c))&&Ze(b)}pi(b){b.forEach(c=>{this.G(c).persist()})}qd(b){const c=this.get(b);void 0!==c&&(c.clear(),super.delete(b),this.F(a.F.Bn,b))}G(b,c=!1){let d=this.get(b);void 0===d&&(d=new olympe.dc.db.Instance(b,this),this.set(b,d),this.F(a.F.An,b),c&&this.F(a.F.Bl,b));return d}Eb(b){$e(this.P[0],olympe.Z.jh(),b)}T(b){this.P[0].C.delete(b)}F(b,c,...d){this.ga.has(b)&&this.ga.get(b).forEach(e=>{e(c,...d)})}da(b,
|
|
505
|
+
c){this.na.set(b,c)}Lf(b,c,d,e){let f;null!=(f=this.P[0])&&af(f,b).ja(e?bf+c:c,d)}ji(b,c,d,e,f){let g;null!=(g=this.P[0])&&(d===cf?f?af(g,b).link(c,e):af(g,b).unlink(c,e):f?af(g,b).Wb(c,e):af(g,b).uc(c,e))}Wb(b,c,d){let e;null!=(e=this.P[0])&&af(e,b).zd(c,d)}C(b,c){let d=this.ga.get(b);void 0===d&&(d=[],this.ga.set(b,d));d.push(c)}mb(b){this.Da.push(b)}L(b){return this.P.reduce((c,d)=>d.P.has(b)||c,!1)}ye(){this.$===a.G.IDLE&&(this.$=a.G.Uq);this.P.unshift(new olympe.dc.db.vr(this,this.jd))}zd(){this.$=
|
|
506
506
|
a.G.Le;this.nm();df(this.P[0]);this.P.shift();0===this.P.length&&(this.$=a.G.IDLE,this.Da.forEach(b=>{b()}),ef(this.ze))}uc(b,c){const d=a.C.Id;for(const [h,k]of c)if(void 0!==k)if(h[0]===d){c=b;var e=h.substring(1),f=k;const m=ff+e;var g=c.get(m);(void 0===g?null:g)!==f&&(g=gf+e,null===f?(c.delete(m),f=(f=c.Ae())&&Ie(f,e),f=void 0===f?null:f,null!==f&&c.set(g,f),hf(c,(new Map).set(e,f))):(void 0!==c.get(g)&&c.delete(g),c.set(m,f),hf(c,(new Map).set(e,f))))}else b.update(h,k)}nm(){const b=this.P[0];
|
|
507
507
|
for(const [c,d]of this.na)this.ac(new Set,c).filter(e=>{var f=d;const g=e.e!==f;g&&(f?(e.e=f,jf(e)):(kf(e),e.e=f),e.db.F(f?lf.Ek:lf.qc,e.C));return g}).forEach(e=>{e=e.tag();d?af(b,e).create():af(b,e).delete()});this.na.clear()}ac(b,c,d=[]){const e=c.tag();if(!b.has(e)&&(b.add(e),d.push(c),c=c.get(Se+Qe)))for(const f of c.values())this.ac(b,f,d);return d}ni(){const b=a.F.Ek,c=a.F.oj,d=new Set,e=new Map;this.C(a.F.co,f=>{d.add(f)});this.C(b,f=>{d.delete(f);e.delete(f)});this.C(c,(f,...g)=>{if(g[0]===
|
|
508
508
|
Re&&g[1]===Te){const h=g[2];this.get(h).Ia()||(g=e.get(h)||new Set,0===g.size&&e.set(h,g),g.add(f))}});this.mb(()=>{d.forEach(f=>{const g=this.get(f);g&&null===g.model()&&this.K.error(`\n[DEBUG - DATABASE]\nInstance ${f} created but does not exist !\n${g.toString()}`)});d.clear();e.forEach((f,g)=>{const h=this.get(g);h&&this.K.error(`\n[DEBUG - DATABASE]\nThe model ${g} is extended by other models but does not exist !`+`\nExtension models: ${Array.from(f.values()).join(', ')}`+`\n\n ${h.toString()}`)});
|
|
509
509
|
e.clear()})}};olympe.dc.db.Database.C={Vh:'$',Mr:'~',Id:'?',ek:'=',Zn:'|',bn:'@',ORIGIN:olympe.dc.wa.ORIGIN,DESTINATION:olympe.dc.wa.DESTINATION};olympe.dc.db.Database.F={An:0,Bn:1,Lp:2,Bl:3,cn:4,dn:5,Ek:6,qc:7,oj:8,ll:9,co:10,eo:11,bp:12};olympe.dc.db.Database.G={IDLE:0,Uq:1,Le:2};function mf(a,b,c=[]){const d=b.W();Je(a.F,b,c);return e=>{if(e)a.F.push(d);else{e=a.F;const f=e.F.get(d);if(void 0!==f){const g=e.C.indexOf(d);e.C.splice(g,1);e.write(Le(e,f.C,e.C.length),!1);e.F.delete(d)}}}}function nf(a,b){a.C.mb(b)}olympe.dc.db.rr=class{constructor(a,b,c,d,e){this.K=a;this.C=b;this.view=c;this.F=new olympe.dc.db.hr(a,b,c,d);this.Tv=new olympe.dc.db.Js(a,c,b,e)}fb(){return this.K}dd(a){this.F.dd(a)}};const of=olympe.dc.db.Database.C.ORIGIN,pf=olympe.dc.db.Database.C.DESTINATION,qf=olympe.dc.db.Database.C.Vh,rf=olympe.dc.db.Database.C.Id,sf=olympe.dc.db.Database.C.ek,tf=olympe.dc.db.Database.C.Zn,uf=of+pf,vf=qf+qf,wf=olympe.dc.db.Database.G;let xf=0;function ne(a,b,c,d=!1){const e=V(a,b);if(null!==e){const f=yf(e,'',c);void 0!==f&&(a.C.getState()!==wf.Le||e.L()&&!d||a.C.T(c),d||!e.Ia()&&!e.L()||f(!1,b))}}
|
|
510
|
-
function oe(a,b,c,d){a=a.C.G(olympe.dc.
|
|
511
|
-
function Bf(a,b,c,d,e){a=a.C.G(olympe.dc.
|
|
512
|
-
function Df(a,b,c,d){a=a.C.G(olympe.dc.
|
|
513
|
-
function W(a,b,c,d,e){a=a.C.G(olympe.dc.
|
|
510
|
+
function oe(a,b,c,d){a=a.C.G(olympe.dc.fa(b));d=null!=d?d:zf();Af(a,'',d,c)&&a.Ia()&&c(!0,b);return d}function He(a,b,c){return{[Symbol.iterator]:function*(d,e,f){const g=(new Set).add(e);for(const h of g)yield h,d.Oj(h,f).forEach(([k,,,m])=>{m&&g.add(k)})}.bind(null,a,b,c)}}function zf(){++xf;return String(xf)}
|
|
511
|
+
function Bf(a,b,c,d,e){a=a.C.G(olympe.dc.fa(b));c=olympe.dc.fa(c);b=qf+c;e=null!=e?e:zf();if(Af(a,b,e,d)&&a.Ia()){let f=!1;b=a.get(b);void 0===b&&(f=!0,b=a.get(sf+c));void 0!==b&&d(b,f)}return e}function V(a,b,c=!1){if(null===b||void 0===b)throw Error('Provided tag is null or undefined.');a=a.C.get(olympe.dc.fa(b));return!a||c&&!a.Ia()?null:a}function Cf(a,b,c,d){b=V(a,b);null!==b&&(c=olympe.dc.fa(c),yf(b,qf+c,d),a.C.getState()===wf.Le&&a.C.T(d))}
|
|
512
|
+
function Df(a,b,c,d){a=a.C.G(olympe.dc.fa(b));d=null!=d?d:zf();Af(a,vf,d,c)&&a.Ia()&&a.forEach((e,f)=>{const g=f[0];g!==qf&&g!==sf||c(f.substring(1),e,g===sf)});return d}function Ef(a,b,c){b=V(a,b);null!==b&&(yf(b,vf,c),a.C.getState()===wf.Le&&a.C.T(c))}function Ff(a,b,c,d,e){let f;null==(f=a.get(b))||f.forEach((g,h)=>{if(g.Ia()||!c&&g.L())e?d(b.substring(1),b[0],c,h):d(c,h)})}
|
|
513
|
+
function W(a,b,c,d,e){a=a.C.G(olympe.dc.fa(b));c=c.Pa()+c.X();e=null!=e?e:zf();(d=Gf(a,c,e,d))&&a.Ia()&&Ff(a,c,!0,d,!1);return e}function Hf(a,b,c,d){const e=a.C.G(olympe.dc.fa(b));a=null!=d?d:zf();const f=Gf(e,uf,a,c);f&&e.Ia()&&e.forEach((g,h)=>{g=h[0];g!==of&&g!==pf||Ff(e,h,!0,f,!0)})}function If(a,b,c){const d=V(a,b);if(null!==d){const e=yf(d,uf,c);void 0!==e&&(a.C.getState()!==wf.Le||d.L()||a.C.T(c),!d.Ia()&&!d.L()||d.forEach((f,g)=>{f=g[0];(f===of||f===pf)&&e&&Ff(d,g,!1,e,!0)}))}}
|
|
514
514
|
function Jf(a,b,c){b=V(a,b,!1);if(!b)return[];const d=olympe.dm.Relation.C.nl,e=olympe.dm.Relation.C.dt,f=olympe.dm.Relation.C.Al,g=olympe.dm.Relation.C.cp,h=qf+c,k=[];b.forEach((m,n)=>{const p=n[0];if(m instanceof olympe.dc.lc&&p===qf)(m=a.C.get(m.X()))&&k.push([m,n.substring(1),null,!0]);else if(p===of){const q=n.substring(1);let r,t;const u=null!=(t=null==(r=a.C.get(q))?void 0:r.get(h))?t:0;(d|e)&u&&m.forEach(w=>{k.push([w,q,p,!!(d&u)])})}else if(p===pf){const q=n.substring(1);let r,t;const u=
|
|
515
|
-
null!=(t=null==(r=a.C.get(q))?void 0:r.get(h))?t:0;(f|g)&u&&m.forEach(w=>{k.push([w,q,p,!!(f&u)])})}});return k}function Kf(a,b,c,d,e){const f=a.C.G(olympe.dc.
|
|
515
|
+
null!=(t=null==(r=a.C.get(q))?void 0:r.get(h))?t:0;(f|g)&u&&m.forEach(w=>{k.push([w,q,p,!!(f&u)])})}});return k}function Kf(a,b,c,d,e){const f=a.C.G(olympe.dc.fa(b));e=null!=e?e:zf();const g=Gf(f,tf+c,e,d);g&&f.Ia()&&Jf(a,b,c).forEach(([h,...k])=>{h.Ia()&&g(...k,!0,h.tag())})}function Lf(a,b,c,d){const e=V(a,b);if(null!==e){const f=yf(e,tf+c,d);void 0!==f&&(a.C.getState()!==wf.Le||e.L()||a.C.T(d),!e.Ia()&&!e.L()||Jf(a,b,c).forEach(([g,...h])=>{(g.Ia()||g.L())&&f(...h,!1,g.tag())}))}}
|
|
516
516
|
function Mf(a,b){a=V(a,b,!0);b=new Map;if(a)for(const [c,d]of a)c[0]===rf&&b.set(c.substring(1),d);return b}function Nf(a,b,c){return c===olympe.dc.Ob.NONE?0:a.Qa(b,c,!0)||0}function Of(a,b){return function*(c){if(c)for(const [d,e]of c)if(c=d[0],c===of||c===pf){const f=d.substring(1);for(const g of e.keys())yield[f,c,g]}}(V(a,b,!0))}
|
|
517
|
-
function Pf(a,b,c){if(!a.Ia(b))return a.K.warn(`No instance found with tag ${b}`),new Map;const d=new Map,e=[olympe.dc.
|
|
518
|
-
olympe.dc.$a=class{constructor(a,b){this.K=a;this.C=b}W(){return this.C.W()}F(a,b,c,d=!1){a=V(this,a);if(null!==a){b=b.Pa()+b.X();const e=yf(a,b,c);void 0!==e&&(this.C.getState()!==wf.Le||a.L()&&!d||this.C.T(c),d||!a.Ia()&&!a.L()||Ff(a,b,!1,e,!1))}}Ia(a){a=this.C.get(olympe.dc.
|
|
519
|
-
a,!0))&&a.Ae())?a.tag():null}si(a){a=V(this,a,!0);return!(!a||!a.Ae())}$c(a,b){a=(a=V(this,a,!0))&&a.model();return!(!a||!this.ri(a.tag(),b))}source(a){return(a=V(this,a,!0))&&a.source()}Of(a){a=V(this,a,!1);return!a||a.P}Qa(a,b,c){let d;a=null==(d=V(this,a,!0))?void 0:d.Qa(olympe.dc.
|
|
520
|
-
...d])=>[c.tag(),...d])}ib(a,b){return this.Pj(a,[b])}mm(a,b,c){let d,e;a=null==(d=V(this,a,!0))?void 0:null==(e=d.get(b.Pa()+b.X()))?void 0:e.get(olympe.dc.
|
|
521
|
-
null):(a=c?c.values().next().value:null)&&a.Ia()?a.tag():null:null}qg(a,b,c){a=olympe.dc.
|
|
522
|
-
b).filter(c)}pq(a,b=olympe.dc.CloudObject){var c=V(this,a,!0);const d=b&&V(this,b,!0),e=[c];for(;c&&c!==d;){c=c.Ae();if(e.includes(c))throw Error(`Cycle detected when following recursively extend relations from base model instance "${a}".`);if(c&&!c.Ia())throw a=`Try to get all extensions of the model ${olympe.dc.
|
|
523
|
-
return e.map(f=>f.tag())}ri(a,b){const c=olympe.dc.
|
|
517
|
+
function Pf(a,b,c){if(!a.Ia(b))return a.K.warn(`No instance found with tag ${b}`),new Map;const d=new Map,e=[olympe.dc.fa(b)];for(const f of e){const g=a.ib(f,c);d.set(f,g);for(const h of g.filter(k=>!d.has(k)))e.push(h)}a.K.debug(`Found ${d.size} instances in sub-tree rooted at ${olympe.dc.fa(b)}`);return d}function Qf(a,b,c,d){return(c=(a=V(a,b,!0))&&a.get(d+c))?Array.from(c.values()).filter(e=>e.Ia()).length:0}
|
|
518
|
+
olympe.dc.$a=class{constructor(a,b){this.K=a;this.C=b}W(){return this.C.W()}F(a,b,c,d=!1){a=V(this,a);if(null!==a){b=b.Pa()+b.X();const e=yf(a,b,c);void 0!==e&&(this.C.getState()!==wf.Le||a.L()&&!d||this.C.T(c),d||!a.Ia()&&!a.L()||Ff(a,b,!1,e,!1))}}Ia(a){a=this.C.get(olympe.dc.fa(a));return!(null==a||!a.Ia())}name(a){let b,c;return null!=(c=null==(b=V(this,a))?void 0:b.Qa(olympe.dc.CloudObject.nameProp.X()))?c:''}model(a){return(a=(a=V(this,a,!0))?a.model():null)?a.tag():null}Ae(a){return(a=(a=V(this,
|
|
519
|
+
a,!0))&&a.Ae())?a.tag():null}si(a){a=V(this,a,!0);return!(!a||!a.Ae())}$c(a,b){a=(a=V(this,a,!0))&&a.model();return!(!a||!this.ri(a.tag(),b))}source(a){return(a=V(this,a,!0))&&a.source()}Of(a){a=V(this,a,!1);return!a||a.P}Qa(a,b,c){let d;a=null==(d=V(this,a,!0))?void 0:d.Qa(olympe.dc.fa(b),c);return void 0!==a?a:null}Cb(a,b=!1){var c=V(this,a,!0);a=new Map;if(c)for(const [d,e]of c)c=d[0],(c===qf||!b&&c===sf)&&a.set(d.substring(1),e);return a}Oj(a,b){return Jf(this,a,b).filter(([c])=>c.Ia()).map(([c,
|
|
520
|
+
...d])=>[c.tag(),...d])}ib(a,b){return this.Pj(a,[b])}mm(a,b,c){let d,e;a=null==(d=V(this,a,!0))?void 0:null==(e=d.get(b.Pa()+b.X()))?void 0:e.get(olympe.dc.fa(c));return!(null==a||!a.Ia())}Pj(a,b){a=V(this,a,!0);if(!a)return[];a=[a.tag()];for(const c of b){b=[];for(const d of a)if(a=V(this,d,!0).get(c.Pa()+c.X()),void 0!==a)for(const e of a.values())e.Ia()&&b.push(e.tag());a=b}return a}Tb(a,b){var c=V(this,a,!0);return c?(c=c.get(b.Pa()+b.X()))&&1<c.size?(this.K.warn(`Relation ${b.X()} to instance ${a} is not unique: found ${c.size} related items`),
|
|
521
|
+
null):(a=c?c.values().next().value:null)&&a.Ia()?a.tag():null:null}qg(a,b,c){a=olympe.dc.fa(a);const d=Pf(this,a,b);d.delete(a);return c?(c=olympe.dc.fa(c),d.has(c)?Array.from(Pf(this,c,b.Rb()).keys()).filter(e=>d.has(e)):[]):Array.from(d.keys())}lq(a,b,c){if(!this.Ia(a))return null;b=Pf(this,a,b);const d=[olympe.dc.fa(a)];for(const e of d){if(c(e))return e;if(a=b.get(e))for(const f of a.filter(g=>!d.includes(g)))d.push(f)}return null}Tl(a,b,c){return this.Pj(a,b).find(c)||null}pu(a,b,c){return this.Pj(a,
|
|
522
|
+
b).filter(c)}pq(a,b=olympe.dc.CloudObject){var c=V(this,a,!0);const d=b&&V(this,b,!0),e=[c];for(;c&&c!==d;){c=c.Ae();if(e.includes(c))throw Error(`Cycle detected when following recursively extend relations from base model instance "${a}".`);if(c&&!c.Ia())throw a=`Try to get all extensions of the model ${olympe.dc.fa(a)} but one of them does not exists (${c.tag()})`,Error(a);null!==c&&e.push(c)}c=V(this,olympe.dc.CloudObject,!0);if(d!==c&&e[e.length-1]===c)throw Error(`The model "${this.name(a)}" (tag = ${a}) does not extend the expected model "${this.name(b)}" (tag = ${b}).`);
|
|
523
|
+
return e.map(f=>f.tag())}ri(a,b){const c=olympe.dc.fa(b);return!!this.lq(a,olympe.dc.CloudObject.extendRel,d=>d===c)}Sd(a){return this.ib(a,olympe.dc.CloudObject.instancesRel)}};olympe.dc.$a.prototype.getInstances=olympe.dc.$a.prototype.Sd;olympe.dc.$a.prototype.isExtending=olympe.dc.$a.prototype.ri;olympe.dc.$a.prototype.getExtendedModels=olympe.dc.$a.prototype.pq;olympe.dc.$a.prototype.findAllRelated=olympe.dc.$a.prototype.pu;olympe.dc.$a.prototype.findRelated=olympe.dc.$a.prototype.Tl;
|
|
524
524
|
olympe.dc.$a.prototype.findRecursive=olympe.dc.$a.prototype.lq;olympe.dc.$a.prototype.getRecursiveRelated=olympe.dc.$a.prototype.qg;olympe.dc.$a.prototype.getUniqueRelated=olympe.dc.$a.prototype.Tb;olympe.dc.$a.prototype.getMultiRelated=olympe.dc.$a.prototype.Pj;olympe.dc.$a.prototype.isRelated=olympe.dc.$a.prototype.mm;olympe.dc.$a.prototype.getRelated=olympe.dc.$a.prototype.ib;olympe.dc.$a.prototype.getProperties=olympe.dc.$a.prototype.Cb;olympe.dc.$a.prototype.getProperty=olympe.dc.$a.prototype.Qa;
|
|
525
525
|
olympe.dc.$a.prototype.isPersisted=olympe.dc.$a.prototype.Of;olympe.dc.$a.prototype.instanceOf=olympe.dc.$a.prototype.$c;olympe.dc.$a.prototype.isModel=olympe.dc.$a.prototype.si;olympe.dc.$a.prototype.extension=olympe.dc.$a.prototype.Ae;olympe.dc.$a.prototype.model=olympe.dc.$a.prototype.model;olympe.dc.$a.prototype.name=olympe.dc.$a.prototype.name;olympe.dc.$a.prototype.exist=olympe.dc.$a.prototype.Ia;const Rf=olympe.dc.db.Database.C.ORIGIN,cf=olympe.dc.db.Database.C.DESTINATION,bf=olympe.dc.db.Database.C.ek,Sf=olympe.dc.db.Database.C.Vh,Tf=olympe.dc.db.Database.C.Zn,Uf=olympe.dc.db.Database.C.bn,Vf=Rf+cf,Wf=Sf+Sf,Xf=Array.from(Object.values(olympe.dc.Ob)).filter(a=>null!==a);function $e(a,b,c){let d=a.C.get(b);void 0===d&&(d=[],a.C.set(b,d));a.buffer.push([b,d.length]);d.push(c)}
|
|
526
526
|
function df(a){const b=a.L;a.F.forEach((c,d)=>{var e=b.get(d);if(c.L()||c.lf()){var f=e.get(Uf);f&&Yf(a,f,c.L(),d);c.lf()&&a.P.add(d)}for(const [n,p]of c.Cb()){var g=n[0]===bf,h=g?n.substring(1):n;f=a;var k=e,m=p;const q=k.get(Uf+Sf+h);q&&Yf(f,q,m,g);(k=k.get(Uf+Wf))&&Yf(f,k,h,m,g)}for(const n of c.Eb())Zf(a,e,...n);(e=c.na)&&$f(a,b.get(e),c.ac,!c.lf(),d)});a.F.clear();a.G.clear();ag(a)}function af(a,b){let c=a.F.get(b);void 0===c&&(c=new olympe.dc.db.Bf(b),a.F.set(b,c));return c}
|
|
@@ -533,7 +533,7 @@ function eg(a,b){var c=olympe.dc.ta();if(c.Ia(b)){const d=c.model(b),e=c.source(
|
|
|
533
533
|
olympe.dc.db.Lc=class{constructor(a){this.id=null!=a?a:olympe.Z.ef();this.C=new Map}toJSON(){let a='{ "id": '+JSON.stringify(this.id)+', "instances": {';for(const b of this.C.keys()){const c=this.C.get(b);a+=JSON.stringify(b)+': '+c.toJSON()+', '}a.endsWith(', ')&&(a=a.substring(0,a.length-2));return a+'}}'}static wc(a){var b;'string'===typeof a?b=JSON.parse(a):b=a;a=new olympe.dc.db.Lc(b.id);b=b.instances;for(const c of Object.keys(b)){const d=olympe.dc.db.Bf.wc(b[c]);a.C.set(c,d)}return a}W(){return this.id}Od(a){const b=
|
|
534
534
|
olympe.dc.db.Bf.C.al,c=olympe.dc.db.Bf.C.qc,d=olympe.dc.db.Bf.C.Bj;this.C.forEach((e,f)=>{const g=e.Dd();switch(e.getState()){case b:const h=e.zb();if(null===h)throw Error(`GraphPatch: try to create the instance ${f} with no source`);const k=e.da()?e.Cb():void 0;a.Ec(f,h,k,g);break;case d:e.da()&&a.hd(f,e.Cb(),g);break;case c:a.F(f,e.$(),g)}for(const [h,k,m]of e.he())e=this.C.get(k),m?a.Ea(h,f,k,g,e.Dd()):a.Xb(h,f,k,g,e.Dd())})}rh(){return 0===this.C.size}G(){let a=0;this.C.forEach(b=>{a+=b.jd()});
|
|
535
535
|
return a}Ec(a,b,c,d=null){b=dg(this,a).create(b);'string'===typeof d&&this.Ea(olympe.dc.mc.nd,a,d,d,null);c&&b.Il(c)}hd(a,b,c=null){b&&dg(this,a,c).Il(b)}F(a,b=olympe.dc.Ob.NONE,c=null){const d=this.C.get(a);if(d&&d.L())Pe(this,a,b);else{dg(this,a,c).delete(b);for(const e of this.Oj(a,b,!1))this.C.get(e).Cb().clear(),cg(this,e,!0)}}Ea(a,b,c,d=null,e=null){dg(this,b,d).link(a,c);dg(this,c,e).Wb(a,b)}Xb(a,b,c,d=null,e=null){dg(this,b,d).unlink(a,c);dg(this,c,e).uc(a,b)}Sd(){return function*(a){for(const b of a.values())if(b.L()||
|
|
536
|
-
b.lf()||b.da())yield b}(this.C)}Ge(a){return this.C.get(olympe.dc.
|
|
536
|
+
b.lf()||b.da())yield b}(this.C)}Ge(a){return this.C.get(olympe.dc.fa(a))||null}he(){return function*(a){for(var b=a.next();!b.done;){b=b.value;const c=b.tag();yield*b.he((d,e,f)=>[d,c,e,f]);b=a.next()}}(this.C.values())}qg(a,b,c=(d,e)=>[d,e]){return fg(this,a,b,c)}Oj(a,b,c=!0){const d=olympe.dm.Relation.C.nl,e=olympe.dm.Relation.C.Al,f=olympe.dc.wa.ORIGIN,g=olympe.dc.ta();a=new Set([a]);const h=new Set;for(const m of a){var k=this.C.get(m);if(void 0!==k){for(const [n,p,q]of k.he())q&&Nf(g,n,b)&e?
|
|
537
537
|
a.add(p):c||q||h.add(`${m}.${n}.${p}`);for(const [n,p,q]of k.Qb())q&&Nf(g,n,b)&d?a.add(p):c||q||h.add(`${p}.${n}.${m}`)}for(const [n,p,q]of Of(g,m))k=p===f?d:e,!h.has(p===f?`${q}.${n}.${m}`:`${m}.${n}.${q}`)&&Nf(g,n,b)&k&&a.add(q)}return Array.from(a).filter(m=>this.C.has(m))}};olympe.dc.db.Lc.va=[olympe.dc.Writable,olympe.dc.Ws];const lf=olympe.dc.db.Database.F,gg=olympe.dc.db.Database.C.Vh,gf=olympe.dc.db.Database.C.Mr,ff=olympe.dc.db.Database.C.Id,hg=olympe.dc.db.Database.C.ek,ig=olympe.dc.db.Database.C.bn,X=olympe.dc.wa.ORIGIN,Y=olympe.dc.wa.DESTINATION,jg=olympe.dc.mc.nd,kg=olympe.dc.mc.Hh;function Ie(a,b,c=!1){const d=a.get(ff+b);return c||void 0!==d?d:a.get(gf+b)}
|
|
538
538
|
function Ue(a,b){const c=a.model();if(null!==c){if(c===b)return;a.unlink(jg,c)}a.link(jg,b);b.forEach((d,e)=>{if(e[0]===ff||e[0]===gf)e=e.substring(1),lg(a,e,d)});null===a.G||!b.e&&b!==a||a.db.da(a,!0)}function Ve(a,b){const c=a.Ae();if(null!==c){if(c===b)return;a.unlink(kg,c)}a.link(kg,b);const d=new Map;b.forEach((e,f)=>{if(f[0]===ff||f[0]===gf)f=f.substring(1),a.has(ff+f)||(a.set(gf+f,e),d.set(f,e))});hf(a,d)}
|
|
539
539
|
function We(a,b){a.unlink(jg,b);a.forEach((c,d)=>{c=d.substring(1);lg(a,c,null)});a.db.da(a,!1)}function Xe(a,b){a.unlink(kg,b);const c=new Map;a.forEach((d,e)=>{e[0]===gf&&(a.delete(e),d=e.substring(1),c.set(d,null))});hf(a,c)}function Ye(a){a.c++;1===a.c&&a.db.F(lf.Lp,a.C)}
|
|
@@ -546,14 +546,14 @@ olympe.dc.db.Instance=class extends Map{constructor(a,b){super();this.C=a;this.G
|
|
|
546
546
|
var b=this.model();if(b){var c=b.Qa(olympe.dc.CloudObject.nameProp.X())||'No model name';a+=`\nModel: ${b.C}, Exist: ${b.e}, Model name: ${c}`}else a+='\nModel: no model';(b=this.Ae())?(c=b.Qa(olympe.dc.CloudObject.nameProp.X())||'No extension name',a+=`\nExtension: ${b.C}, Exist: ${b.e}, Extension name: ${c}`):a+='\nExtension: no extension';return a}Qa(a,b=!1){const c=this.get(gg+a);return b||void 0!==c?c:this.get(hg+a)}update(a,b){const c=gg+a;var d=this.get(c),e=d=void 0===d?null:d;(e instanceof
|
|
547
547
|
Date?b instanceof Date&&e.getTime()===b.getTime():null!==e&&'function'===typeof e.Ha?e.Ha(b):e===b)||(d instanceof olympe.dc.lc&&(og(this.db.get(d.X())),this.db.Wa(d.X())),b instanceof olympe.dc.lc&&(d=this.db.G(b.X(),!0),d.F&&d.F.tag!==this.C&&this.db.fb().fatal('Instance',b.X(),'referenced multiple times!\nThis instance is currently property of',d.F.tag,'(for the property '+d.F.Ja+')','and is assigned as a property of',this.C,'(for the property '+a+')'),e=this.C,void 0===d.F&&(Ye(d),d.db.Wb(d.C,
|
|
548
548
|
e,a)),d.F={tag:e,Ja:a}),d=hg+a,null===b?(this.delete(c),b=(b=this.model())&&Ie(b,a),void 0!==b?(this.set(d,b),pg(this,a,b,!0)):pg(this,a,null,!1)):(this.set(c,b),this.delete(d),pg(this,a,b,!1)))}link(a,b){var c=X+a;const d=mg(this,Y+a);c=mg(b,c);d.has(b.C)||(d.set(b.C,b),c.set(this.C,this),this.db.F(lf.oj,this.C,a,Y,b.C),this.db.F(lf.oj,b.C,a,X,this.C),this.e&&b.e&&(qg(this,a,Y,b,!0),qg(b,a,X,this,!0)))}unlink(a,b){const c=X+a;void 0!==ng(this,Y+a,b.C)&&(ng(b,c,this.C),this.db.F(lf.ll,this.C,a,Y,
|
|
549
|
-
b.C),this.db.F(lf.ll,b.C,a,X,this.C),this.e&&b.e&&(qg(this,a,Y,b,!1),qg(b,a,X,this,!1)))}persist(){this.P=!0;return this}clear(){this.forEach((a,b)=>{const c=b[0];if(c===X||c===Y){const d=b.substring(1),e=c===X?Y:X;a.forEach(f=>{const g=f.get(e+d);g.delete(this.C);0===g.size&&f.delete(e+d)})}c===gg&&a instanceof olympe.dc.lc&&og(this.db.get(a.X()))});void 0!==this.F&&this.db.get(this.F.tag).delete(gg+this.F.Ja)}};olympe.dc.db.Bf=class a{constructor(b){this.mb=b;this.P=this.
|
|
550
|
-
b+=', '}b.endsWith(', ')&&(b=b.substring(0,b.length-2));b+='}'}if(this.C){b+=', "relations": {';for(const d of this.C.keys()){c=this.C.get(d);b+=JSON.stringify(d)+': {';for(const e of c.keys())b+=JSON.stringify(e)+': '+JSON.stringify(c.get(e))+', ';b.endsWith(', ')&&(b=b.substring(0,b.length-2));b+='}, '}b.endsWith(', ')&&(b=b.substring(0,b.length-2));b+='}'}return b+'}'}static wc(b){var c;'string'===typeof b?c=JSON.parse(b):c=b;b=new olympe.dc.db.Bf(c.tag);b.P=c.model;b.
|
|
551
|
-
c.properties;if(d){b.properties=new Map;for(var e of Object.keys(d)){const f=d[e],g=f.type;let h=f;g&&('reference'===g?h=olympe.dc.lc.wc(f):h=olympe.D.wc(f));null!==h&&void 0!==h&&b.properties.set(e,h)}}if(c=c.relations){b.C=new Map;for(const f of Object.keys(c)){e=new Map;for(const g of Object.keys(c[f]))e.set(g,c[f][g]);b.C.set(f,e)}}return b}tag(){return this.mb}Dd(){return this.P}zb(){return this.
|
|
552
|
-
return this}$(){return this.G===a.C.qc?this.cc:olympe.dc.Ob.NONE}create(b){this.G=a.C.al;this.
|
|
549
|
+
b.C),this.db.F(lf.ll,b.C,a,X,this.C),this.e&&b.e&&(qg(this,a,Y,b,!1),qg(b,a,X,this,!1)))}persist(){this.P=!0;return this}clear(){this.forEach((a,b)=>{const c=b[0];if(c===X||c===Y){const d=b.substring(1),e=c===X?Y:X;a.forEach(f=>{const g=f.get(e+d);g.delete(this.C);0===g.size&&f.delete(e+d)})}c===gg&&a instanceof olympe.dc.lc&&og(this.db.get(a.X()))});void 0!==this.F&&this.db.get(this.F.tag).delete(gg+this.F.Ja)}};olympe.dc.db.Bf=class a{constructor(b){this.mb=b;this.P=this.ga=null;this.cc=olympe.dc.Ob.NONE;this.G=a.C.Bj;this.F=this.C=this.ac=this.na=this.properties=null}toJSON(){let b='{ "tag": '+JSON.stringify(this.mb)+', "model": '+JSON.stringify(this.P)+', "src": '+JSON.stringify(this.ga)+', "state": '+JSON.stringify(this.G);if(this.properties){b+=', "properties": {';for(var c of this.properties.keys()){const d=this.properties.get(c);b+=JSON.stringify(c)+': ';b=d.toJSON?b+d.toJSON():b+JSON.stringify(d);
|
|
550
|
+
b+=', '}b.endsWith(', ')&&(b=b.substring(0,b.length-2));b+='}'}if(this.C){b+=', "relations": {';for(const d of this.C.keys()){c=this.C.get(d);b+=JSON.stringify(d)+': {';for(const e of c.keys())b+=JSON.stringify(e)+': '+JSON.stringify(c.get(e))+', ';b.endsWith(', ')&&(b=b.substring(0,b.length-2));b+='}, '}b.endsWith(', ')&&(b=b.substring(0,b.length-2));b+='}'}return b+'}'}static wc(b){var c;'string'===typeof b?c=JSON.parse(b):c=b;b=new olympe.dc.db.Bf(c.tag);b.P=c.model;b.ga=c.src;b.G=c.state;const d=
|
|
551
|
+
c.properties;if(d){b.properties=new Map;for(var e of Object.keys(d)){const f=d[e],g=f.type;let h=f;g&&('reference'===g?h=olympe.dc.lc.wc(f):h=olympe.D.wc(f));null!==h&&void 0!==h&&b.properties.set(e,h)}}if(c=c.relations){b.C=new Map;for(const f of Object.keys(c)){e=new Map;for(const g of Object.keys(c[f]))e.set(g,c[f][g]);b.C.set(f,e)}}return b}tag(){return this.mb}Dd(){return this.P}zb(){return this.ga}getState(){return this.G}Wa(b){if(null===this.P)this.P=b;else if(this.P!==b)throw Error(`Try to set a model relation with another model ${b} than the one set initially ${this.P}`);
|
|
552
|
+
return this}$(){return this.G===a.C.qc?this.cc:olympe.dc.Ob.NONE}create(b){this.G=a.C.al;this.ga=null!=b?b:null;return this}delete(b=olympe.dc.Ob.NONE){this.G=a.C.qc;this.cc=b;this.properties=null;return this}ja(b,c){if(this.G===a.C.qc)return this;this.properties||(this.properties=new Map);this.properties.set(b,c);return this}Il(b){this.G!==a.C.qc&&(this.properties||(this.properties=new Map),b.forEach((c,d)=>{this.properties.set(d,c)}))}zd(b,c){if(null!==this.na&&this.na!==b)throw Error('An instance should never be set as complex property of multiple instances');
|
|
553
553
|
this.na=b;this.ac=c}ub(b){let c;null==(c=this.properties)||c.delete(b);0===this.properties.size&&(this.properties=null)}link(b,c){null===this.C&&(this.C=new Map);b===olympe.dc.mc.nd&&this.Wa(c);this.pa(this.C,b,c,!0);return this}unlink(b,c){null===this.C&&(this.C=new Map);b===olympe.dc.mc.nd&&this.Wa(c);this.pa(this.C,b,c,!1);return this}Wb(b,c){null===this.F&&(this.F=new Map);this.pa(this.F,b,c,!0)}uc(b,c){null===this.F&&(this.F=new Map);this.pa(this.F,b,c,!1)}qd(b,c,d){if(c=c===olympe.dc.wa.ORIGIN?
|
|
554
554
|
this.F:this.C)return(b=c.get(b))&&b.get(d)}T(b,c,d){const e=(c=c===olympe.dc.wa.ORIGIN?this.F:this.C)&&c.get(b);e&&e.delete(d);e&&0===e.size&&c.delete(b)}L(){return this.G===a.C.al}lf(){return this.G===a.C.qc}jd(){let b=this.properties?this.properties.size:0;this.C&&this.C.forEach(c=>{b+=c.size});return b}da(){return null!==this.properties}Cb(){let b;return null!=(b=this.properties)?b:new Map}Qa(b){if(this.properties)return this.properties.get(b)}ib(b,c=(d,e)=>[d,e]){return function*(d){if(d=d&&d.get(b.X()))for(const [e,
|
|
555
555
|
f]of d)yield c(e,f)}(b.Pa()===olympe.dc.wa.ORIGIN?this.F:this.C)}Tb(b){const c=b.Pa()===olympe.dc.wa.ORIGIN?this.F:this.C;return(b=c&&c.get(b.X()))&&0!==b.size?Array.from(b.keys())[0]:null}he(b=(c,d,e)=>[c,d,e]){return this.Da(this.C,b)}Qb(b=(c,d,e)=>[c,d,e]){return this.Da(this.F,b)}Eb(b=(c,d,e,f)=>[c,d,e,f]){const c=olympe.dc.wa.ORIGIN,d=olympe.dc.wa.DESTINATION;return function*(e,f,g){yield*e(f,(h,k,m)=>b(h,d,k,m));yield*e(g,(h,k,m)=>b(h,c,k,m))}(this.Da.bind(this),this.C,this.F)}pa(b,c,d,e){if(this.G!==
|
|
556
|
-
a.C.qc||!e){var f=b.get(c);if(void 0===f)f=new Map,b.set(c,f);else if(b=f.get(d),void 0!==b&&b!==e){f.delete(d);return}f.set(d,e)}}*Da(b,c){if(null!==b)for(const [d,e]of b){b=e.entries();for(const [f,g]of b)yield c(d,f,g)}}};olympe.dc.db.Bf.C={al:0,Bj:1,qc:2};olympe.dc.db.Js=class{constructor(a,b,c,d){this.K=a;this.view=b;this.C=c;d&&this.init()}debug(a){const b=olympe.dc.
|
|
556
|
+
a.C.qc||!e){var f=b.get(c);if(void 0===f)f=new Map,b.set(c,f);else if(b=f.get(d),void 0!==b&&b!==e){f.delete(d);return}f.set(d,e)}}*Da(b,c){if(null!==b)for(const [d,e]of b){b=e.entries();for(const [f,g]of b)yield c(d,f,g)}}};olympe.dc.db.Bf.C={al:0,Bj:1,qc:2};olympe.dc.db.Js=class{constructor(a,b,c,d){this.K=a;this.view=b;this.C=c;d&&this.init()}debug(a){const b=olympe.dc.fa(a);if(this.C.has(b)){var c=this.C.get(a);a='\n[DEBUG - DATABASE]\n'+c.toString();if(!c.Ia()){const d=[];for(;null!==c&&!d.includes(c.tag());)d.push(c.tag()),c=c.model();c=this.C.get(d[d.length-1]);const e=olympe.dc.db.Database.C.Vh+olympe.dc.CloudObject.nameProp.X();d.push('???');a+='\n\nThe instance <<'+b+'>> does not exists because the instance '+c.tag()+' (name: '+c.get(e)+') has no model.\nList: '+
|
|
557
557
|
d.join(' --M--\x3e ')}this.K.info(a)}else this.K.info('[DATABASE] Instance',b,'has never been created or referred by the database')}init(){const a=olympe.dc.db.Database.F.Bn,b=olympe.dc.db.Database.F.Ek,c=olympe.dc.db.Database.F.qc,d=olympe.dc.db.Database.F.oj,e=olympe.dc.db.Database.F.ll,f=olympe.dc.db.Database.F.cn,g=olympe.dc.db.Database.F.dn,h=()=>{};this.C.C(olympe.dc.db.Database.F.An,()=>{});this.C.C(a,()=>{});this.C.C(b,k=>{this.C.Eb(()=>{Hf(this.view,k,h,`monitorRelations${k}`)})});this.C.C(c,
|
|
558
558
|
k=>{this.C.Eb(()=>{If(this.view,k,`monitorRelations${k}`)})});this.C.C(d,()=>{});this.C.C(e,()=>{});this.C.C(f,()=>{});this.C.C(g,()=>{})}};olympe.dc.db.Tp=class{constructor(a,b,c,d,e){this.K=a;this.C=b;this.ta=c;this.G=d;this.L=e}write(a){if(this.G){const b=new rg(this.ta);a.Od(b);this.K.info(b.flush())}this.C.ye();a.Od(this);this.C.zd()}Ec(a,b,c){this.C.create(a,b,c,this.L)}hd(a,b){this.C.update(a,b)}F(a,b=olympe.dc.Ob.NONE){for(const c of He(this.ta,a,b))this.C.Wa(c)}Ea(a,b,c){this.C.link(a,b,c)}Xb(a,b,c){this.C.unlink(a,b,c)}};
|
|
559
559
|
function sg(a,b,c){if(!b)return'';let d='';if(c&&1<c)return'...';for(const [e,f]of b)if(d+=(d?', "':'"')+e+'":',!f)d+=JSON.stringify(f);else if(f instanceof olympe.dc.lc||f instanceof olympe.dc.CloudObject)d+='Reference("'+f.X()+'")';else if(f instanceof olympe.D.Color)d+='Color("'+f.rg()+','+f.pg()+','+f.mg()+','+f.lg()+'")';else if(f.constructor&&Object.prototype.hasOwnProperty.call(f.constructor.prototype,'toString'))d+=JSON.stringify(f.toString());else if('object'===typeof f){let g;d+=sg(a,f,
|
|
@@ -563,7 +563,7 @@ ug(this,a))}}olympe.dc.db.Tp.va=[olympe.dc.Writable,olympe.dc.Writable];olympe.d
|
|
|
563
563
|
olympe.V.config(function(a){F(a,olympe.dc.db.U.Mn,olympe.dc.db.Re.C.Fm);F(a,olympe.dc.db.U.Nn,5E3);F(a,olympe.dc.db.U.Rh,!1);F(a,olympe.dc.db.U.un,!1);E(a,olympe.dc.db.R.za,[olympe.la.R.Ga],b=>b.Fc('db'));E(a,olympe.dc.db.R.Ik,[olympe.la.R.Ga],b=>b.Fc('gc'));E(a,olympe.dc.db.R.Ni,[olympe.dc.db.R.za,olympe.dc.db.R.Ik,new olympe.V.ma(olympe.dc.U.eg),new olympe.V.ma(olympe.dc.db.U.Mn),new olympe.V.ma(olympe.dc.db.U.Nn),new olympe.V.ma(olympe.dc.U.Wg),new olympe.V.ma(olympe.dc.db.U.un)],(b,c,d,e,f,g,
|
|
564
564
|
h)=>{e=g?olympe.dc.db.Re.C.Ak:e;d=(new Map).set('selfTag',d).set('garbageCollector',e).set('garbageCollectorDelay',f).set('debug',h);return new olympe.dc.db.Database(b,c,d)});D(a,olympe.dc.db.R.wk,olympe.dc.$a,olympe.dc.db.R.za,olympe.dc.db.R.Ni);E(a,olympe.dc.db.R.Rh,[olympe.dc.db.R.Ga],b=>b.Tv);D(a,olympe.dc.db.R.Ga,olympe.dc.db.rr,olympe.dc.db.R.za,olympe.dc.db.R.Ni,olympe.dc.db.R.wk,new olympe.V.ma(olympe.dc.U.uf),new olympe.V.ma(olympe.dc.db.U.Rh))},'olympe.dc.db');
|
|
565
565
|
olympe.V.run([olympe.dc.db.R.Ni,olympe.dc.db.R.Rh],(a,b)=>{olympe.Mj().db=a;olympe.Mj().dbMonitor=b},'DC.DB debug service injection');olympe.dc.query={};function vg(a){return(b,c)=>{const d=null===b,e=null===c;return d||e?d&&e?0:d?1:-1:a(b,c)}}
|
|
566
|
-
olympe.dc.query.Me=class{constructor(a,b,c){this.db=olympe.dc.ta();this.C=a;this.Ja=b;this.Qh=c}ha(){return{p:this.Ja.X(),o:this.Qh}}toString(){return'sortByQueryPart-'+this.Qh+this.Ja.X()}ng(){const a=this.db.Tb(this.Ja,olympe.dm.Property.typeRel),b=olympe.dc.
|
|
566
|
+
olympe.dc.query.Me=class{constructor(a,b,c){this.db=olympe.dc.ta();this.C=a;this.Ja=b;this.Qh=c}ha(){return{p:this.Ja.X(),o:this.Qh}}toString(){return'sortByQueryPart-'+this.Qh+this.Ja.X()}ng(){const a=this.db.Tb(this.Ja,olympe.dm.Property.typeRel),b=olympe.dc.fa;if(a===b(olympe.dm.String))return vg((c,d)=>c.localeCompare(d));if(a===b(olympe.dm.Number)||a===b(olympe.dm.Boolean))return vg((c,d)=>c-d);if(a===b(olympe.dm.DateTime))return vg((c,d)=>c.getTime()-d.getTime());olympe.la.fb('dc.query').warn(`No comparator found for type with tag ${a}`);
|
|
567
567
|
return vg(()=>-1)}Qa(){return this.Ja}};function wg(a,b){return new olympe.dc.query.wd((new olympe.dc.transaction.gj(b)).C(a),b)}olympe.dc.query.wd=class{constructor(a,b){this.C=a;this.source=b}static Ul(a){return new olympe.dc.query.wd(new olympe.dc.db.Lc(`DataResult_${a.W()}`),a.zb())}create(a,b,c){this.C.Ec(a,this.source,c,b);return this}Ea(a,b,c){this.C.Ea(a,b,c,null,null);return this}Zc(){return this.C}ha(){const a=new olympe.dc.transaction.ag;this.C.Od(a);return{s:this.source,p:xg(a)}}};
|
|
568
568
|
olympe.dc.query.wd.prototype.createRelation=olympe.dc.query.wd.prototype.Ea;olympe.dc.query.wd.prototype.create=olympe.dc.query.wd.prototype.create;olympe.dc.query.wd.fromQuery=olympe.dc.query.wd.Ul;olympe.dc.pe=class{X(){}};olympe.dc.pe.prototype.getTag=olympe.dc.pe.prototype.X;olympe.dc.my=olympe.dc.pe;function yg(a){let b;if(null==(b=a.C)?0:b.rh())if(a=a.L,!a.P){let c;null==(c=a.T)||c.call(a)}}function zg(a,b,c,d,e){yg(a);let f,g;b?null==(f=a.C)||f.Ea(c,d,e):null==(g=a.C)||g.Xb(c,d,e)}
|
|
569
569
|
olympe.dc.query.Ns=class{constructor(a,b,c,d){this.K=a;this.source=b;this.G=c;this.L=d;this.C=this.F=null;this.db=olympe.dc.ta()}watch(a,b){if(this.db.source(a)===this.source){var c=`${this.G}:${a}:notif`;oe(this.db,a,(d,e)=>{if(d){yg(this);let f;null==(f=this.C)||eg(f,e)}else if(b&&Ef(this.db,e,c),!this.db.Ia(e)){yg(this);let f;null==(f=this.C)||f.F(e,olympe.dc.Ob.NONE)}},c);b&&Df(this.db,a,(d,e,f)=>{yg(this);let g;f||null!=(g=this.C)&&g.hd(a,new Map([[d,e]]))},c)}}stop(a){ne(this.db,a,`${this.G}:${a}:notif`)}};olympe.dc.query.hj={ASC:'ASC',DESC:'DESC'};function Ag(a){const b=Bg(a.query),c=new Map;for(let e=b.length;0<=e;e--){const f=0<e?b[e-1].W():a.G,g=0<e?b[e-1].C:'root',h=0<e&&b[e-1].T(),k=a.C.get(f),m=new Set(k.Sd()),n=new Map,p=a.L.has(f);let q=p?';':'';if(c.has(f)){const [r,t,u]=c.get(f);c.delete(f);q+=u;r.forEach((w,x)=>{for(const y of k.F(x)){let z;n.set(y,Array.from(w).map(A=>p?`${x};${A}`:A).reduce((A,M)=>A.add(M),null!=(z=n.get(y))?z:new Set))}m.delete(x)});t&&m.forEach(w=>{const x=p?`${w};${u}`:u;for(const y of k.F(w)){let z;n.set(y,
|
|
@@ -577,13 +577,13 @@ this.C.get(b);if(null==b||!b.has(a))return!0;b.remove(a,c)&&Eg(this);if(!b.has(a
|
|
|
577
577
|
a.s,olympe.dc.ta(),a.c);case e:return new olympe.dc.query.Y.Nh(olympe.dc.ta(),a.p,a.b,a.l,a.s);case f:return new olympe.dc.query.Y.Ld(Mg(a.v));case g:return new olympe.dc.query.Y.Ze(a.p,new RegExp(a.r),olympe.dc.ta(),a.c);case k:return new olympe.dc.query.Y.ce(...a.p.map(m=>Mg(m)));case h:return new olympe.dc.query.Y.kd(...a.p.map(m=>Mg(m)));default:return null}}
|
|
578
578
|
olympe.dc.query.Ca=class{observe(){}lb(){}compile(){return[[this]]}Sc(){return new olympe.dc.query.Y.Ld(this)}Cb(){}vc(){}clear(){}ha(){}Cc(){}toString(){}Ha(a){return this===a}static Fv(...a){return new olympe.dc.query.Y.wl(a)}static Ha(a,b){return new olympe.dc.query.Y.Zd(a,b,olympe.dc.ta())}static contains(a,b,c=!0){return new olympe.dc.query.Y.Ne(a,b,olympe.dc.ta(),c)}static nw(a,b,c=!0){return new olympe.dc.query.Y.Ze(a,b,olympe.dc.ta(),c)}static Tj(a,b,c=!0){return new olympe.dc.query.Y.Nh(olympe.dc.ta(),
|
|
579
579
|
a,b,!1,c)}static Ci(a,b,c=!0){return new olympe.dc.query.Y.Nh(olympe.dc.ta(),a,b,!0,c)}static and(...a){return new olympe.dc.query.Y.kd(...a)}static or(...a){return new olympe.dc.query.Y.ce(...a)}static Sc(a){return new olympe.dc.query.Y.Ld(a)}};olympe.dc.query.Ca.not=olympe.dc.query.Ca.Sc;olympe.dc.query.Ca.or=olympe.dc.query.Ca.or;olympe.dc.query.Ca.and=olympe.dc.query.Ca.and;olympe.dc.query.Ca.smallerThan=olympe.dc.query.Ca.Ci;olympe.dc.query.Ca.greaterThan=olympe.dc.query.Ca.Tj;
|
|
580
|
-
olympe.dc.query.Ca.regex=olympe.dc.query.Ca.nw;olympe.dc.query.Ca.contains=olympe.dc.query.Ca.contains;olympe.dc.query.Ca.equals=olympe.dc.query.Ca.Ha;olympe.dc.query.Ca['in']=olympe.dc.query.Ca.Fv;olympe.dc.query.Ca.C={Gp:0,Cn:1,Li:2,ao:3,Bo:4,ep:5,Ko:6,Dm:7};function Bg(a){return Array.from(a.ya)}function Ng(a,b=a.G){return 0<=b?a.ya[b].W():olympe.Z.nb(a.F)}function Og(a,b,c,d=!1){var e=olympe.dc.Ob.Ef;d=d?olympe.dc.ra.tc.Qg:olympe.dc.ra.tc.Tf;b=olympe.dc.
|
|
580
|
+
olympe.dc.query.Ca.regex=olympe.dc.query.Ca.nw;olympe.dc.query.Ca.contains=olympe.dc.query.Ca.contains;olympe.dc.query.Ca.equals=olympe.dc.query.Ca.Ha;olympe.dc.query.Ca['in']=olympe.dc.query.Ca.Fv;olympe.dc.query.Ca.C={Gp:0,Cn:1,Li:2,ao:3,Bo:4,ep:5,Ko:6,Dm:7};function Bg(a){return Array.from(a.ya)}function Ng(a,b=a.G){return 0<=b?a.ya[b].W():olympe.Z.nb(a.F)}function Og(a,b,c,d=!1){var e=olympe.dc.Ob.Ef;d=d?olympe.dc.ra.tc.Qg:olympe.dc.ra.tc.Tf;b=olympe.dc.fa(b);const f=olympe.dc.Fd().Ce(b);b=(new olympe.dc.ra(b,f)).Nd();b.ya=[new olympe.dc.query.ya.ne(Ng(b),e,c)];return b.observe(a,d)}
|
|
581
581
|
function Pg(a,b){const c=b.W();let d=a.G+1;for(;d<a.ya.length&&a.ya[d].W()!==c;)d++;b=d<a.ya.length?a.ya:a.ya.concat(b);return new olympe.dc.ra(a.F,a.source,b,d,a.L,a.C)}function Qg(a){const b=0===a.L.size?a.Nd():a;if(null!==b.C.gd&&!b.L.has(Ng(a,b.C.gd)))throw Error('AndReturn was not called for the current level before sortBy operator');return b}
|
|
582
|
-
olympe.dc.ra=class{constructor(a,b,c=[],d=-1,e=new Set,f={max:-1,offset:0,gd:null,rf:null}){this.db=olympe.dc.ta();this.F=a;this.source=b;this.ya=c;this.G=d;this.L=e;this.C=f;this.id=null}static from(a,b){a=olympe.dc.
|
|
583
|
-
a=olympe.dc.
|
|
582
|
+
olympe.dc.ra=class{constructor(a,b,c=[],d=-1,e=new Set,f={max:-1,offset:0,gd:null,rf:null}){this.db=olympe.dc.ta();this.F=a;this.source=b;this.ya=c;this.G=d;this.L=e;this.C=f;this.id=null}static from(a,b){a=olympe.dc.fa(a);if(!olympe.dc.CloudObject.exists(a))throw Error(`Try to create a query from an instance that does not exist (${a}). Please try to use \`Query.fromTag()\` instead.`);b=null!=b?b:olympe.dc.Fd().Ce(a);b=new olympe.dc.ra(a,b);b.C.rf=olympe.dc.ta().model(a);return b}static Ce(a,b,c){if(!olympe.dc.CloudObject.exists(b))throw Error(`Try to create a query from an instance (${a}) with an explicit datatype that does not exist (${b})`);
|
|
583
|
+
a=olympe.dc.fa(a);c=null!=c?c:olympe.dc.Fd().fromModel(b);c=new olympe.dc.ra(a,c);c.C.rf=olympe.dc.fa(b);return c}static Vj(a,b=!0,c){a=olympe.dc.fa(a);c=null!=c?c:olympe.dc.Fd().fromModel(a);return b?(new olympe.dc.ra(a,c)).Mf(olympe.dc.CloudObject.extendedByRel,!0).eb(olympe.dc.CloudObject.instancesRel):(new olympe.dc.ra(a,c)).eb(olympe.dc.CloudObject.instancesRel)}static cc(a,b,c,d,e=!1){e=e?olympe.dc.ra.tc.Qg:olympe.dc.ra.tc.Tf;b=olympe.dc.fa(b);d=null!=d?d:olympe.dc.Fd().Ce(b);d=(new olympe.dc.ra(b,
|
|
584
584
|
d)).Nd();d.ya=[new olympe.dc.query.ya.ne(Ng(d),c)];return d.observe(a,e)}eb(a,b=!1){return Pg(this,new olympe.dc.query.ya.Wf(Ng(this),a,b))}Mf(a,b=!1,c=!1){return Pg(this,new olympe.dc.query.ya.zf(Ng(this),a,b,c))}Nd(){const a=(new Set(this.L)).add(Ng(this));return new olympe.dc.ra(this.F,this.source,this.ya,this.G,a,this.C)}filter(a){const b=Array.from(this.ya);b[this.G]=b[this.G].filter(a);return new olympe.dc.ra(this.F,this.source,b,this.G,this.L,this.C)}gi(){return this}om(a,b=0){return new olympe.dc.ra(this.F,
|
|
585
585
|
this.source,this.ya,this.G,this.L,{gd:this.C.gd,max:a,offset:b,rf:this.C.rf})}bk(a,b=olympe.dc.query.hj.ASC){if(0>this.G)throw Error('You are trying to sort an empty query. Please first follow at least one relation to sort a query.');const c=this.ya[this.G],d={gd:this.G,max:this.C.max,offset:this.C.offset,rf:this.C.rf},e=Array.from(this.ya);e[this.G]=c.sort(a,b);return new olympe.dc.ra(this.F,this.source,e,this.G,this.L,d)}ng(){const a=this.C.gd;let b;return null!==a?null==(b=this.ya[a])?void 0:b.ng():
|
|
586
|
-
null}back(a=1){if(0>this.G||1>a)return this;let b=this.G;for(let c=0;c<a;c++){const d=this.ya[b].C;for(b--;-1<b&&Ng(this,b)!==d;)b--}return new olympe.dc.ra(this.F,this.source,Array.from(this.ya),b,this.L,this.C)}parse(){const a=new Map,b=Ng(this,-1),c={limit:this.C.max,offset:this.C.offset,returned:this.L.has(b),optional:!1,inheritance:!1,next:[]};a.set(b,c);this.db.si(this.F)?c.dataType=olympe.dc.
|
|
586
|
+
null}back(a=1){if(0>this.G||1>a)return this;let b=this.G;for(let c=0;c<a;c++){const d=this.ya[b].C;for(b--;-1<b&&Ng(this,b)!==d;)b--}return new olympe.dc.ra(this.F,this.source,Array.from(this.ya),b,this.L,this.C)}parse(){const a=new Map,b=Ng(this,-1),c={limit:this.C.max,offset:this.C.offset,returned:this.L.has(b),optional:!1,inheritance:!1,next:[]};a.set(b,c);this.db.si(this.F)?c.dataType=olympe.dc.fa(this.F):(c.root=olympe.dc.fa(this.F),c.dataType=this.C.rf);this.ya.forEach((d,e)=>{const f=d.W(),
|
|
587
587
|
g=d.Cc();Object.assign(g,{returned:this.L.has(f),next:[]});a.set(f,g);g.sort&&this.C.gd!==e&&delete g.sort;if(1>=e&&d instanceof olympe.dc.query.ya.Wf&&d.P().Ha(olympe.dc.CloudObject.instancesRel))Object.assign(c,g);else if(0===e&&d instanceof olympe.dc.query.ya.zf&&d.P().Ha(olympe.dc.CloudObject.extendedByRel))Object.assign(c,g),c.inheritance=!0;else{let h;null==(h=a.get(d.C))||h.next.push(g)}});return c}lb(a,b=!1){a='function'===typeof a.F?a.F():a;b=b?olympe.dc.ra.tc.Qg:olympe.dc.ra.tc.jl;return olympe.dc.query.Sj().executeQuery(Qg(this),
|
|
588
588
|
a,b).then(c=>{let d;return null!=(d=null==c?void 0:Cg(c))?d:olympe.dc.La.empty()})}Ad(){return Cg(Rg(olympe.dc.query.Sj(),Qg(this)))}observe(a,b=olympe.dc.ra.tc.Tf){a='function'===typeof a.F?a.F():a;return Sg(olympe.dc.query.Sj(),Qg(this),a,olympe.dc.Ra.SELF,b).pipe(rxjs.operators.map(c=>Cg(c)),rxjs.operators.distinctUntilChanged())}W(){null===this.id&&(this.id=olympe.Z.nb(this.F+Bg(this).map(a=>a.toString()).join()+Array.from(new Set(this.L)).sort().toString()+this.C.gd+this.C.max+this.C.offset));
|
|
589
589
|
return this.id}zb(){return this.source}ha(){let a;return{b:this.F,p:this.ya.map(b=>b.ha()),r:Array.from(this.L),s:this.source,e:{m:this.C.max,o:this.C.offset,s:this.C.gd,rm:null!=(a=this.C.rf)?a:this.db.model(this.F)}}}toString(){return`Query: ${JSON.stringify(this.ha())}`}};olympe.dc.ra.prototype.observe=olympe.dc.ra.prototype.observe;olympe.dc.ra.prototype.executeFromCache=olympe.dc.ra.prototype.Ad;olympe.dc.ra.prototype.execute=olympe.dc.ra.prototype.lb;olympe.dc.ra.prototype.parse=olympe.dc.ra.prototype.parse;
|
|
@@ -604,10 +604,10 @@ q)=>{!k.has(p)&&m.push(q)});k.forEach(p=>{!h.has(p)&&n.push(p)});return olympe.d
|
|
|
604
604
|
olympe.dc.La.prototype.map=olympe.dc.La.prototype.map;olympe.dc.La.prototype.forEach=olympe.dc.La.prototype.forEach;olympe.dc.La.prototype.find=olympe.dc.La.prototype.find;olympe.dc.La.prototype.filter=olympe.dc.La.prototype.filter;olympe.dc.La.prototype.shift=olympe.dc.La.prototype.shift;olympe.dc.La.prototype.pop=olympe.dc.La.prototype.pop;olympe.dc.La.prototype.push=olympe.dc.La.prototype.push;olympe.dc.La.prototype.getAt=olympe.dc.La.prototype.Qd;olympe.dc.La.prototype.getFirst=olympe.dc.La.prototype.xc;
|
|
605
605
|
olympe.dc.La.prototype.get=olympe.dc.La.prototype.get;olympe.dc.La.prototype.indexOf=olympe.dc.La.prototype.indexOf;olympe.dc.La.prototype.has=olympe.dc.La.prototype.has;olympe.dc.La.prototype.size=olympe.dc.La.prototype.size;olympe.dc.La.prototype.toArray=olympe.dc.La.prototype.Je;olympe.dc.La.prototype.keys=olympe.dc.La.prototype.keys;olympe.dc.La.prototype.values=olympe.dc.La.prototype.values;olympe.dc.La.prototype.entries=olympe.dc.La.prototype.entries;olympe.dc.La.empty=olympe.dc.La.empty;function dh(a){return 1<a.size()?(olympe.la.fb('dc').warn(`a follow() on a QuerySingle has ${a.size()} results (0 or 1 expected) -> returns null`),null):a.xc()||null}olympe.dc.Nc=class{constructor(a){this.query=a}static from(a){return new olympe.dc.Nc(olympe.dc.ra.from(a))}eb(a){return new olympe.dc.Nc(this.query.eb(a))}gi(){return this}lb(a,b){return this.query.lb(a,b).then(c=>dh(c))}Ad(){return dh(this.query.Ad())}};olympe.dc.Nc.prototype.executeFromCache=olympe.dc.Nc.prototype.Ad;
|
|
606
606
|
olympe.dc.Nc.prototype.execute=olympe.dc.Nc.prototype.lb;olympe.dc.Nc.prototype.cast=olympe.dc.Nc.prototype.gi;olympe.dc.Nc.prototype.follow=olympe.dc.Nc.prototype.eb;const eh=olympe.dc.wa.ORIGIN,fh=olympe.dc.wa.DESTINATION;function Tg(a,b){Dg(a.C,()=>b(a.query.W()))}function Ug(a,b,c){const d=a.da;a.da++;a.G.set(d,c);b===olympe.dc.Ra.SELF?a.bd(e=>e?c.error(e):c.next(a.C)):(a.$++,1===a.$&&a.bd(()=>Jg(a.C)));a.K.debug(`Add subscriber ${b} for query ${a.query.W()}, now have ${a.G.size} subscribers`);return d}
|
|
607
|
-
function bh(a,b,c){if(a.query.zb()!==b)return!1;c.Od(a.
|
|
607
|
+
function bh(a,b,c){if(a.query.zb()!==b)return!1;c.Od(a.ga);(b=a.ga.flush())&&a.K.debug(`Subscription ${a.query.W()} is considered as obsolete after the transaction ${c.W()} applied on DB`);return b}function Wg(a){Lg(a.C);a.G.forEach(b=>{b.next(a.C)})}function gh(a,b,c){const d=[],e=new olympe.async.ij(olympe.D.og());for(const f of b)f.vc(a.query)&&e.add(g=>f.bd(h=>{!h&&d.push(f);g()}));qc(e,f=>c(f?d:[]));e.start()}
|
|
608
608
|
function hh(a){const b=a.query.W(),c=new Map,d=q=>{const r=c.get(q);return r?1===r.size?Array.from(r)[0]:(t,u,w,x)=>r.forEach(y=>y(t,u,w,x)):()=>{}},e=Bg(a.query),f=a.C;for(let q=e.length-1;0<=q;q--){var g=e[q];const r=g.W(),t=g.C;g=g.observe(f,d(r));let u;c.set(t,(null!=(u=c.get(t))?u:new Set).add(g))}const h=a.db,k=a.query.F,m=olympe.Z.nb(k),n=oe(h,k,(q,r)=>{q?Hg(f,r):f.remove(r);d(m)(q,r,null,b)});let p;null==(p=a.T)||p.push(()=>{ne(h,k,n)});ih(a)}
|
|
609
609
|
function jh(a){const b=a.na(a.query,()=>{null!==a.P&&hh(a)},d=>{a.K.error(`Error while ensuring coverage of a query to data source ${a.query.zb()}: ${d}`);ih(a)});let c;b&&(null==(c=a.T)||c.push(b))}function kh(a,b){a.L.delete(b);0===a.L.size&&(a.L=null,Promise.resolve().then(()=>{!a.gb()&&jh(a)}))}function ih(a){const b=a.P;a.P=null;null==b||b.forEach(c=>c())}
|
|
610
|
-
olympe.dc.query.ap=class{constructor(a,b,c,d){this.K=a;this.db=b.view;this.query=c;this.C=new olympe.dc.query.Vo(this.K,c);this.$=0;this.da=1;this.T=[];this.G=new Map;this.P=[()=>Lg(this.C)];this.na=d;this.
|
|
610
|
+
olympe.dc.query.ap=class{constructor(a,b,c,d){this.K=a;this.db=b.view;this.query=c;this.C=new olympe.dc.query.Vo(this.K,c);this.$=0;this.da=1;this.T=[];this.G=new Map;this.P=[()=>Lg(this.C)];this.na=d;this.ga=new lh(a,this.db,c,this.C);this.F=this.L=null}start(a){gh(this,a,b=>{0<b.length?(this.L=new Set(b),this.L.forEach(c=>{null===c.F&&(c.F=new Set);c.F.add(this)}),hh(this)):jh(this)})}vc(a){return!this.gb()&&this.query.zb()===a.zb()&&(this.query.W()===a.W()||(null===this.P||this.query.F===a.F)&&
|
|
611
611
|
this.C.vc(a))}bd(a){null!==this.P?this.P.push(a):a();return this}destroy(a){a?this.K.error(`Destroy subscription ${this.query.W()} after error: ${a}`):this.K.debug(`Destroy subscription ${this.query.W()}`);const b=this.T;this.T=null;this.G.forEach(e=>a?e.error(a):e.complete());let c;null==(c=this.F)||c.forEach(e=>kh(e,this));let d;null==(d=this.L)||d.forEach(e=>{e.F.delete(this);0===e.F.size&&(e.F=null)});b.forEach(e=>e())}gb(){return null===this.T}};
|
|
612
612
|
function mh(a,b){return a.G.has(fh+b)||a.G.has(eh+b)}
|
|
613
613
|
class lh{constructor(a,b,c,d){this.K=a;this.db=b;this.L=d;this.T=[];this.P=-1<c.C.max||0<c.C.offset;this.G=new Map;this.C=!1;const e=new Map;for(const f of Bg(c)){a=f.W();this.T.push(a);if(f instanceof olympe.dc.query.ya.Wf||f instanceof olympe.dc.query.ya.zf){a=f.P();a=`${a.Pa()}${a.X()}`;let g;b=null!=(g=this.G.get(a))?g:[];b.push(f);this.G.set(a,b)}nh(f).forEach(g=>{let h;const k=null!=(h=e.get(g))?h:[];k.push(f.W());e.set(g,k)})}this.properties=Array.from(e.entries())}flush(){const a=this.C;this.C=
|
|
@@ -615,19 +615,19 @@ class lh{constructor(a,b,c,d){this.K=a;this.db=b;this.L=d;this.T=[];this.P=-1<c.
|
|
|
615
615
|
c){if(!this.C&&this.P&&mh(this,a)&&this.db.mm(b,new olympe.dc.Oa.Relation(a),c)){const d=this.G.get(fh+a);a=this.G.get(eh+a);const e=this.L;this.C||(this.C=(null==d?void 0:d.some(f=>Gg(e,b,f.C)&&Gg(e,c,f.W())))||(null==a?void 0:a.some(f=>Gg(e,c,f.C)&&Gg(e,b,f.W()))))}}}olympe.dc.query.ap.va=[olympe.dc.Writable];function oh(a){return new olympe.dc.query.Relation(a.tag,a.direction,!0)}
|
|
616
616
|
olympe.dc.query.Relation=class extends olympe.dc.Oa.Relation{constructor(a,b,c){super(a,b);this.recursive=c}toJSON(){let a='{ "tag": '+JSON.stringify(this.X())+', ';a+='"direction": '+JSON.stringify(this.Pa())+', ';a+='"recursive": '+JSON.stringify(this.recursive);return a+'}'}static wc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.dc.query.Relation(b.tag,b.direction,b.recursive)}static from(a,b){return new olympe.dc.query.Relation(a.X(),a.Pa(),null!=b?b:a instanceof olympe.dc.ba.de)}Rb(){const a=
|
|
617
617
|
olympe.dc.wa.DESTINATION,b=olympe.dc.wa.ORIGIN;return new olympe.dc.query.Relation(this.tag,this.direction===a?b:a,this.recursive)}toString(){return`${this.direction}${this.tag}${this.recursive?'-r':''}`}};olympe.dc.query.R={za:'dc.query.Logger',lj:'dc.query.QueryProcessor'};olympe.V.config(function(a){E(a,olympe.dc.query.R.za,[olympe.la.R.Ga],b=>b.Fc('query'));D(a,olympe.dc.query.R.lj,olympe.dc.query.$s,olympe.dc.query.R.za,olympe.dc.db.R.Ga,olympe.dc.R.Tg,new olympe.V.ma(olympe.dc.U.Wg))});olympe.V.run([olympe.dc.query.R.lj],a=>{olympe.dc.query.Sj=()=>a});olympe.dc.query.Y={};olympe.dc.query.Y.kd=class extends olympe.dc.query.Ca{constructor(...a){super();this.Y=a}compile(){return this.Y.reduce((a,b)=>{const c=[];for(const d of b.compile()){for(const e of a)d.push(...e);c.push(d)}return c},[])}Sc(){return new olympe.dc.query.Y.ce(...this.Y.map(a=>a.Sc()))}Cb(){return this.Y.flatMap(a=>a.Cb())}vc(){throw Error('Should not try to check predicate coverage on And (should be removed by compiling predicates');}lb(a){return this.Y.reduce((b,c)=>b&&c.lb(a),!0)}observe(a,b,c){const d=
|
|
618
|
-
Array(this.Y.length).fill(!1);let e=null;const f=(g,h)=>{d[g]=h;g=d.every(k=>k);e!==g&&(e=g,c(g))};this.Y.forEach((g,h)=>{g.observe(a,olympe.Z.nb('AND-'+b+a+h),f.bind(null,h))})}ha(){return{pr:olympe.dc.query.Ca.C.Dm,p:this.Y.map(a=>a.ha())}}Cc(){throw Error('toObject for AND predicate should not be called');}toString(){return'And-'+this.Y.reduce((a,b)=>a+'-'+b.toString(),'')}clear(a,b){this.Y.forEach((c,d)=>{c.clear(a,olympe.Z.nb('AND-'+b+a+d))})}};olympe.dc.query.Y.Ne=class extends olympe.dc.query.Ca{constructor(a,b,c,d=!1){super();this.Ja=olympe.dc.
|
|
618
|
+
Array(this.Y.length).fill(!1);let e=null;const f=(g,h)=>{d[g]=h;g=d.every(k=>k);e!==g&&(e=g,c(g))};this.Y.forEach((g,h)=>{g.observe(a,olympe.Z.nb('AND-'+b+a+h),f.bind(null,h))})}ha(){return{pr:olympe.dc.query.Ca.C.Dm,p:this.Y.map(a=>a.ha())}}Cc(){throw Error('toObject for AND predicate should not be called');}toString(){return'And-'+this.Y.reduce((a,b)=>a+'-'+b.toString(),'')}clear(a,b){this.Y.forEach((c,d)=>{c.clear(a,olympe.Z.nb('AND-'+b+a+d))})}};olympe.dc.query.Y.Ne=class extends olympe.dc.query.Ca{constructor(a,b,c,d=!1){super();this.Ja=olympe.dc.fa(a);this.substring=b;this.db=c;this.C=d}Cb(){return[this.Ja]}vc(a,b){return a instanceof olympe.dc.query.Y.Ne&&a.Ja===this.Ja?b?a.C?a.substring.toLowerCase().includes(this.substring.toLowerCase()):a.substring.includes(this.substring):this.C?this.substring.toLowerCase().includes(a.substring.toLowerCase()):this.substring.includes(a.substring):!1}Qa(){return this.Ja}lb(a){return this.apply(this.db.Qa(a,
|
|
619
619
|
this.Ja))}observe(a,b,c){Bf(this.db,a,this.Ja,d=>{c(this.apply(d))},olympe.Z.nb(b+a+this.toString()))}apply(a){return'string'===typeof a?this.C?a.includes(this.substring):a.toLowerCase().includes(this.substring.toLowerCase()):!1}toString(){return'Contains'+this.Ja+'-'+this.substring+'-'+this.C}clear(a,b){Cf(this.db,a,this.Ja,olympe.Z.nb(b+a+this.toString()))}Cc(){return{name:'CONTAINS',property:this.Qa(),value:this.substring,caseSensitive:this.C}}ha(){return{pr:olympe.dc.query.Ca.C.Li,p:this.Ja,s:this.substring,
|
|
620
|
-
c:this.C}}};olympe.dc.query.Y.Zd=class extends olympe.dc.query.Ca{constructor(a,b,c){super();this.Ja=olympe.dc.
|
|
620
|
+
c:this.C}}};olympe.dc.query.Y.Zd=class extends olympe.dc.query.Ca{constructor(a,b,c){super();this.Ja=olympe.dc.fa(a);this.C=null!=b?b:null;this.db=c}Cb(){return[this.Ja]}vc(a){if(a instanceof olympe.dc.query.Y.Zd&&this.Ja===a.Ja)if('object'===typeof this.C&&null!==this.C){if(this.C instanceof olympe.dc.CloudObject)return this.C.Ha(a.C);if(this.C instanceof Date)return a.C instanceof Date&&this.C.getTime()===a.C.getTime();if(this.C instanceof olympe.D.Color)return this.C.Ha(a.C)}else return this.C===a.C;return!1}lb(a){return this.apply(this.db.Qa(a,
|
|
621
621
|
this.Ja))}observe(a,b,c){Bf(this.db,a,this.Ja,d=>{c(this.apply(d))},olympe.Z.nb(b+a+this.toString()));null===this.C&&null===this.db.Qa(a,this.Ja)&&c(!0)}clear(a,b){Cf(this.db,a,this.Ja,olympe.Z.nb(b+a+this.toString()))}apply(a){return'object'===typeof a&&null!==a?a instanceof olympe.dc.CloudObject?a.Ha(this.C):a instanceof Date?this.C instanceof Date&&this.C.getTime()===a.getTime():a instanceof olympe.D.Color?a.Ha(this.C):!1:a===this.C}toString(){let a,b;const c=null!=(b=null==(a=this.C)?void 0:a.toString())?
|
|
622
622
|
b:'null';return'Equals-'+this.Ja+'-'+c}Cc(){return{name:'EQUALS',property:this.Ja,value:this.C}}ha(){let a=1,b=this.C;switch(!0){case this.C instanceof Date:a=2;b=this.C.toJSON();break;case this.C instanceof olympe.dc.CloudObject:a=3;b=this.C.X();break;case this.C instanceof olympe.D.Color:a=4,b={r:this.C.rg().valueOf(),g:this.C.pg().valueOf(),b:this.C.mg().valueOf(),a:this.C.lg().valueOf()}}return{pr:olympe.dc.query.Ca.C.Cn,p:this.Ja,t:a,v:b}}};function ph(a,b,c){return null===b?!1:null===c?!0:a.G?a.F?b<c:b>c:a.F?b<=c:b>=c}function qh(a,b){return'number'===typeof a.C?a.C:a.db.Qa(b,a.C)}function rh(a,b,c){return olympe.Z.nb(c+b+a.C+a.Ja)}
|
|
623
|
-
olympe.dc.query.Y.Nh=class extends olympe.dc.query.Ca{constructor(a,b,c,d=!0,e=!0){super();this.db=a;this.Ja=olympe.dc.
|
|
623
|
+
olympe.dc.query.Y.Nh=class extends olympe.dc.query.Ca{constructor(a,b,c,d=!0,e=!0){super();this.db=a;this.Ja=olympe.dc.fa(b);this.C='number'===typeof c?c:olympe.dc.fa(c);this.F=d;this.G=e}Sc(){return new olympe.dc.query.Y.Nh(this.db,this.Ja,this.C,!this.F,!this.G)}Cb(){return[this.Ja]}vc(a,b){if(b)throw Error('Check coverage of inequality should not happen with opposite = true');return a instanceof olympe.dc.query.Y.Nh&&this.Ja===a.Ja?typeof this.C!==typeof a.C||this.F!==a.F?!1:'number'===typeof this.C?
|
|
624
624
|
this.F&&this.C>=a.C||!this.F&&this.C<=a.C:this.C===a.C:!1}Qa(){return this.Ja}lb(a){return ph(this,this.db.Qa(a,this.Ja),qh(this,a))}observe(a,b,c){'string'===typeof this.C&&Bf(this.db,a,this.C,d=>{const e=this.db.Qa(a,this.Ja);null!==e&&c(ph(this,e,d))},rh(this,a,b));Bf(this.db,a,this.Ja,d=>{const e=qh(this,a);c(null!==e?ph(this,d,e):!0)},rh(this,a,b))}clear(a,b){Cf(this.db,a,this.Ja,rh(this,a,b));'string'===typeof this.C&&Cf(this.db,a,this.C,rh(this,a,b))}Cc(){return{name:'INEQUALITY_OPERATOR',
|
|
625
625
|
property:this.Qa(),operator:this.F?'<':'>',strict:this.G,value:this.C}}ha(){return{pr:olympe.dc.query.Ca.C.ao,p:this.Ja,b:this.C,l:this.F,s:this.G}}toString(){return'GreaterThan-'+this.Ja+'-'+this.G+'-'+this.C}};olympe.dc.query.Y.Ld=class extends olympe.dc.query.Ca{constructor(a){super();this.C=a}compile(){const a=this.C.Sc();return this.Ha(a)?super.compile():a.compile()}Sc(){return this.C}Cb(){return this.C.Cb()}vc(a,b){return a instanceof olympe.dc.query.Y.Ld?this.C.vc(a.C,b):this.C.vc(a,!b)}lb(a){return!this.C.lb(a)}observe(a,b,c){let d=null;this.C.observe(a,olympe.Z.nb('NOT'+b+a),e=>{!e!==d&&(d=!e,c(d))})}Cc(){return{name:'NOT',predicate:this.C.Cc()}}ha(){return{pr:olympe.dc.query.Ca.C.Bo,v:this.C.ha()}}toString(){return`NOT-${this.C.toString()}`}clear(a,
|
|
626
626
|
b){this.C.clear(a,olympe.Z.nb('NOT'+b+a))}Ha(a){return a instanceof olympe.dc.query.Y.Ld?this.C.Ha(a.C):!1}};olympe.dc.query.Y.ce=class extends olympe.dc.query.Ca{constructor(...a){super();this.Y=a}compile(){return this.Y.map(a=>a.compile()).flat()}Sc(){return new olympe.dc.query.Y.kd(...this.Y.map(a=>a.Sc()))}Cb(){return this.Y.flatMap(a=>a.Cb())}vc(){throw Error('Should not try to check predicate coverage on And (should be removed by compiling predicates');}lb(a){return this.Y.reduce((b,c)=>b||c.lb(a),!1)}observe(a,b,c){const d=Array(this.Y.length).fill(!1);let e=null;const f=(g,h)=>{d[g]=h;g=d.some(k=>
|
|
627
|
-
k);e!==g&&(e=g,c(g))};this.Y.forEach((g,h)=>{g.observe(a,olympe.Z.nb('OR-'+b+a+h),f.bind(null,h))})}Cc(){throw Error('toObject for OR predicate should not be called');}ha(){return{pr:olympe.dc.query.Ca.C.Ko,p:this.Y.map(a=>a.ha())}}toString(){return'And-'+this.Y.reduce((a,b)=>a.toString()+'-'+b.toString(),'')}clear(a,b){this.Y.forEach((c,d)=>{c.clear(a,olympe.Z.nb('OR-'+b+a+d))})}};olympe.dc.query.Y.Ze=class extends olympe.dc.query.Ca{constructor(a,b,c,d=!0){super();this.Ja=olympe.dc.
|
|
628
|
-
typeof a?this.F?this.C.test(a):this.C.test(a.toLowerCase()):!1}toString(){return'Regex'+this.Ja+'-'+this.C.toString()+'-'+this.F}Cc(){return{name:'REGEX',property:this.Ja,pattern:this.C,caseSensitive:this.F}}ha(){return{pr:olympe.dc.query.Ca.C.ep,p:this.Ja,r:this.C.source,c:this.F}}clear(a,b){Cf(this.db,a,this.Ja,olympe.Z.nb(b+a+this.toString()))}};olympe.dc.query.Y.wl=class extends olympe.dc.query.Ca{constructor(a){super();this.C=new Set(a.map(olympe.dc.
|
|
627
|
+
k);e!==g&&(e=g,c(g))};this.Y.forEach((g,h)=>{g.observe(a,olympe.Z.nb('OR-'+b+a+h),f.bind(null,h))})}Cc(){throw Error('toObject for OR predicate should not be called');}ha(){return{pr:olympe.dc.query.Ca.C.Ko,p:this.Y.map(a=>a.ha())}}toString(){return'And-'+this.Y.reduce((a,b)=>a.toString()+'-'+b.toString(),'')}clear(a,b){this.Y.forEach((c,d)=>{c.clear(a,olympe.Z.nb('OR-'+b+a+d))})}};olympe.dc.query.Y.Ze=class extends olympe.dc.query.Ca{constructor(a,b,c,d=!0){super();this.Ja=olympe.dc.fa(a);this.C=RegExp('');try{this.C=new RegExp(b)}catch(e){if(!(e instanceof SyntaxError))throw e;}this.db=c;this.F=d}Cb(){return[this.Ja]}vc(a){return a instanceof olympe.dc.query.Y.Ze&&this.Ja===a.Ja&&this.C.toString()===a.C.toString()}lb(a){return this.apply(this.db.Qa(a,this.Ja))}observe(a,b,c){Bf(this.db,a,this.Ja,d=>{c(this.apply(d))},olympe.Z.nb(b+a+this.toString()))}apply(a){return'string'===
|
|
628
|
+
typeof a?this.F?this.C.test(a):this.C.test(a.toLowerCase()):!1}toString(){return'Regex'+this.Ja+'-'+this.C.toString()+'-'+this.F}Cc(){return{name:'REGEX',property:this.Ja,pattern:this.C,caseSensitive:this.F}}ha(){return{pr:olympe.dc.query.Ca.C.ep,p:this.Ja,r:this.C.source,c:this.F}}clear(a,b){Cf(this.db,a,this.Ja,olympe.Z.nb(b+a+this.toString()))}};olympe.dc.query.Y.wl=class extends olympe.dc.query.Ca{constructor(a){super();this.C=new Set(a.map(olympe.dc.fa))}Cb(){return[]}vc(a){return a instanceof olympe.dc.query.Y.wl&&Array.from(a.C).every(b=>this.C.has(b))}lb(a){return this.C.has(a)}observe(a,b,c){c(this.C.has(a))}clear(){}toString(){return'Tags-'+Array.from(this.C)}Cc(){return{name:'IS',tags:Array.from(this.C)}}ha(){return{pr:olympe.dc.query.Ca.C.Gp,t:Array.from(this.C)}}};olympe.dc.query.ya={};function nh(a){let b,c;const d=new Set(null!=(c=null==(b=a.F)?void 0:b.Cb())?c:[]);let e;a.yb&&d.add(null==(e=a.yb)?void 0:e.Qa().X());return d}function sh(a){if(!a.ga){let b,c;a.ga=null!=(c=null==(b=a.F)?void 0:b.compile())?c:[]}return a.ga}function th(a,b){for(const c of b)if(a.some(d=>d.vc(c,!1)))return!0;return!1}
|
|
629
629
|
function uh(a,b){if(null===a.F)return b;let c=!1;const d=a.toString();return(e,f,g,h)=>{const k=olympe.Z.nb(h+f+d);e?a.F.observe(f,k,m=>{c||b(m,f,g,k)}):(c=!0,a.F.clear(f,k),c=!1,b(!1,f,g,k))}}function vh(a,b,c){if(null===a.yb)return c;const d=a.toString();return(e,f,g,h)=>{const k=a.yb.Qa();h=olympe.Z.nb(h+d);e?Bf(a.db,f,k,()=>{Eg(b)},h):Cf(a.db,f,k,h);c(e,f,g,h)}}
|
|
630
|
-
olympe.dc.query.ya.jj=class{constructor(a,b){this.db=olympe.dc.ta();this.C=a;this.optional=b;this.
|
|
630
|
+
olympe.dc.query.ya.jj=class{constructor(a,b){this.db=olympe.dc.ta();this.C=a;this.optional=b;this.ga=this.yb=this.F=this.id=null}static C(a){var b=a.i;if('string'===typeof a.f)return new olympe.dc.query.ya.ne(b,a.f);var c=a.o;const d=new olympe.dc.Oa.Relation(a.t,a.d);b='boolean'===typeof a.s?new olympe.dc.query.ya.zf(b,d,a.s,c):new olympe.dc.query.ya.Wf(b,d,c);void 0!==a.p&&(b.F=Mg(a.p));void 0!==a.c&&(c=b.W(),a=a.c,a=new olympe.dc.query.Me(c,new olympe.dc.Oa.Property(a.p),a.o),b.yb=a);return b}L(){}toString(){let a,
|
|
631
631
|
b,c,d;return`${this.C}-${this.optional}${null!=(c=null==(a=this.F)?void 0:a.toString())?c:''}${null!=(d=null==(b=this.yb)?void 0:b.toString())?d:''}`}Cc(){}ha(){const a={i:this.C,o:this.optional};null!==this.F&&(a.p=this.F.ha());null!==this.yb&&(a.c=this.yb.ha());return a}$(){}na(){return new olympe.dc.query.ya.tl}da(){}W(){null===this.id&&(this.id=this.$());return this.id}T(){return this.optional}vc(a){const b=sh(this);if(0===b.length)return!0;a=sh(a);if(0===a.length)return!1;for(const c of a)if(!b.some(d=>
|
|
632
632
|
th(d,c)))return!1;return!0}filter(a){const b=this.L(),c=b.F;null===c?b.F=a:b.F=c instanceof olympe.dc.query.Y.kd?new olympe.dc.query.Y.kd(...Array.from(c.Y),a):new olympe.dc.query.Y.kd(b.F,a);return b}sort(a,b){const c=this.L();c.yb=new olympe.dc.query.Me(this.W(),a,b);return c}ng(){return this.yb}lb(a){if(null!==this.F){var b=this.W();for(const c of Fg(a,b))this.F.lb(c)||a.remove(c,b,null)}}observe(a,b){const c=this.W();return uh(this,vh(this,a,(d,e,f,g)=>{(d?Hg(a,e,c,f):a.remove(e,c,f))&&b(d,e,
|
|
633
633
|
f,g)}))}};olympe.dc.query.ya.Uo=class{has(){}P(){}F(){}Sd(){}G(){}remove(){}};olympe.dc.query.ya.qn=class{constructor(a){this.C=null;this.content=new Map;this.L=null!=a?a:null}Sd(){return this.content.keys()}F(a){return this.content.has(a)&&null!==this.C?[this.C].values():[].values()}has(a){return this.content.has(a)}P(a){let b;return(null==(b=this.L)?void 0:b.call(this,a))||!1}G(a,b){if(null===this.C)this.C=b;else if(b!==this.C)throw Error('Should never try to insert multi parent in the same counter part result. To be used with FollowRulePart only');let c;b=null!=(c=this.content.get(a))?
|
|
@@ -644,12 +644,12 @@ Eh,'Access denied');try{var m=yield Jh(a,k[Bh])}catch(r){return new olympe.net.S
|
|
|
644
644
|
mimeType:k[Ah]};p instanceof Uint8Array&&(M.content=p);break;default:throw Error(`Data Http request type not supported ${n}`);}let K;const pa=null!=(K=k['X-Source-Origin'])?K:olympe.dc.Ra.Df;var q=re(new olympe.dc.Request(n,f,M,m),pa);const Ta=yield g(q),Hj=Ta instanceof Blob||Ta instanceof Uint8Array||Ta instanceof ArrayBuffer||void 0===Ta?null!=Ta?Ta:'':JSON.stringify(a.F.ha(Ta));return new olympe.net.Se(Hj,h===zh?Dh:Ch)}catch(r){return r instanceof olympe.dc.sources.op?new olympe.net.Se(`Authorization error: ${r}`,
|
|
645
645
|
Eh,'Forbidden'):new olympe.net.Se(`Internal server error: ${r}`,Fh,'Internal server error')}})).catch(c=>a.K.error(`Error while starting the HTTP Service: ${c}`));a.K.debug(`Started HTTP service with path: ${b}`)}function Kh(a){a.da.T('_DataSourcesHTTPService').catch(b=>{a.K.error(`An error occurred while stopping the data sources http service: ${b}`)})}function Lh(a,b,c){0===a.G.size&&Hh(a);a.G.set(b,c);return()=>{a.G.delete(b);0===a.G.size&&Kh(a)}}
|
|
646
646
|
function Mh(a,b,c){c=b.Cd(c);null===c&&a.K.error(`Impossible to build URL for data source ${b}`);return c}
|
|
647
|
-
function Nh(a,b,c){if(b===olympe.dc.Ra.SERVER){var d;return null!=(d=Vc(a.T,a.
|
|
647
|
+
function Nh(a,b,c){if(b===olympe.dc.Ra.SERVER){var d;return null!=(d=Vc(a.T,a.ga.get(c)))?d:null}var e=a.$.get(b);if(!e){d=a.L.zb(b);if(null===d)return null;e=olympe.dc.sources.U.Nk;const f=olympe.dc.sources.U.Jh,g=olympe.dc.sources.U.Wn,h=olympe.dc.sources.U.Mk;let k;e=`${Mh(a,d,g)?'https':'http'}://${Mh(a,d,e)}:${null!=(k=Mh(a,d,f))?k:Mh(a,d,g)?443:80}`+`/${Mh(a,d,h)}/${b}`.replace(/\/+/g,'/').replace(/\/$/,'');a.$.set(b,e)}return`${e}/${c}`}
|
|
648
648
|
function Oh(a,b){let c;a=null==(c=a.L.zb(b))?void 0:c.Cd(olympe.dc.sources.U.Vn);return a instanceof Object?a:{}}function Ph(a,b){return b instanceof olympe.net.Mh?Wc(a.T,b,Bc(a.P).Yc()):Promise.reject('No http request to send')}
|
|
649
649
|
function Qh(a,b){var c=Nh(a,b.Nb(),b.getType());if(!c)return Promise.reject(`No destination URL to send the query to destination: ${b.Nb()}`);const d=b.content,e=JSON.stringify(a.F.ha(d));c=P(c,xh,e);Q(c,Object.assign({},{['X-Source-Origin']:b.origin,[Ah]:'application/json'},Oh(a,b.Nb())));return Ph(a,c).then(f=>'string'===typeof f?a.F.G(JSON.parse(f)):olympe.dc.query.wd.Ul(d))}
|
|
650
650
|
function Rh(a,b){var c=Nh(a,b.Nb(),b.getType());if(!c)return Promise.reject(`No destination URL to send the transaction to destination: ${b.Nb()}`);const d=JSON.stringify(a.F.ha(b.content));c=P(c,xh,d);Q(c,Object.assign({},{['X-Source-Origin']:b.origin,[Ah]:'application/json'},Oh(a,b.Nb())));return Ph(a,c).then()}function Ih(a,b){let c;a=null==(c=a.L.zb(b))?void 0:c.Cd(olympe.dc.sources.U.$n);return a instanceof Object?a:{}}
|
|
651
651
|
function Jh(a,b){return'string'!==typeof b?Promise.reject('Please provide an authorization token.'):new Promise((c,d)=>{a.P.ug(b,(e,f)=>{e?d(e):c(f)})})}
|
|
652
|
-
olympe.dc.sources.Gr=class{constructor(a,b,c,d,e,f){this.K=a;this.da=b;this.T=c;this.P=d;this.L=e;this.F=f;this.G=new Map;new olympe.D.Jb('Http service of remote data provider');this.$=new Map;this.C=new Map;this.
|
|
652
|
+
olympe.dc.sources.Gr=class{constructor(a,b,c,d,e,f){this.K=a;this.da=b;this.T=c;this.P=d;this.L=e;this.F=f;this.G=new Map;new olympe.D.Jb('Http service of remote data provider');this.$=new Map;this.C=new Map;this.ga=new Map([[olympe.dc.Request.C.oe,olympe.O.Mb.oe],[olympe.dc.Request.C.Uf,olympe.O.Mb.Ri],[olympe.dc.Request.C.jg,olympe.O.Mb.Ri],[olympe.dc.Request.C.Hg,olympe.O.Mb.Ri],[olympe.dc.Request.C.Om,olympe.O.Mb.Nm],[olympe.dc.Request.C.ip,olympe.O.Mb.hp],[olympe.dc.Request.C.Kk,olympe.O.Mb.Qn],
|
|
653
653
|
[olympe.dc.Request.C.Ki,olympe.O.Mb.$m],[olympe.dc.Request.C.$h,olympe.O.Mb.TRANSACTION]])}Rc(a){const b=a.Nb();var c=Nh(this,b,a.getType());if(!c)return Promise.reject(`No destination URL to send the status request to destination: ${a.Nb()}`);c=P(c,wh);Q(c,Object.assign({},{['X-Source-Origin']:a.origin},Oh(this,b)));return Ph(this,c)}uploadFileContent(a){const {tag:b,model:c,content:d}=a.content,e=a.Nb(),f=Nh(this,e,a.getType());if(!f)return Promise.reject(`No destination URL to upload the file. ${b}`);
|
|
654
654
|
const g=P(e===olympe.dc.Ra.SERVER?`${f}/${b}`:`${f}?tag=${b}&model=${c}`,zh,d);Q(g,{[Ah]:'application/octet-stream'});e!==olympe.dc.Ra.SERVER&&Q(g,Object.assign({},{['X-Source-Origin']:a.origin},Oh(this,a.Nb())));return Ph(this,g).then(()=>(new URL(g.C())).pathname)}deleteFileContent(a){const {tag:b,model:c}=a.content,d=a.Nb();var e=Nh(this,d,a.getType());if(!e)return Promise.reject(`No destination URL to delete the file. ${b}`);e=P(d===olympe.dc.Ra.SERVER?`${e}/${b}`:`${e}?tag=${b}&model=${c}`,yh,
|
|
655
655
|
b);d!==olympe.dc.Ra.SERVER&&Q(e,Object.assign({},{['X-Source-Origin']:a.origin},Oh(this,a.Nb())));return Ph(this,e).then()}downloadFileContent(a){const {tag:b,model:c}=a.content,d=a.Nb();var e=Nh(this,d,a.getType());if(!e)return Promise.reject(`No destination URL to download the file. ${b}`);var f;const g=null!=(f=this.C.get(b))?f:[];f=new Promise((h,k)=>{g.push({done:h,ih:k})});if(this.C.has(b))return f;this.C.set(b,g);e=P(d===olympe.dc.Ra.SERVER?`${e}/${b}`:`${e}?tag=${b}&model=${c}`,wh,b,olympe.net.Fa.ResponseType.yt);
|
|
@@ -673,7 +673,7 @@ a)).finally(()=>vi(this,h));case ni:return ti(this,c)?b.publish(c,a).catch(k=>{t
|
|
|
673
673
|
c)?this.C.deleteFileContent(a):b.send(c,a);default:return Promise.reject(`Messages of type ${a.getType()} is not supported by the source ${this.W()}`)}}L(a,b){const c=a.Nb(),d=a.getType();if(!ti(this,c))return rxjs.throwError(()=>Error(`Subscription request not supported for data source ${this.db.name(c)} (${c}) which uses HTTP only.`));this.K.C()&&this.K.debug(`Subscription (type: ${d}) will be sent to remote data provider ${c}: ${a.content}`);return d===ki?olympe.O.qb.observe(c,this.F,a,{onRetry:b}):
|
|
674
674
|
rxjs.throwError(()=>Error(`Do not handle subscription request of type ${d}`))}init(a){this.fc=a;olympe.dc.ra.from(this.G,this.G).eb(olympe.dm.DataSource.yi).filter(olympe.dc.query.Ca.Ha(olympe.dm.DataSource.eh,!0)).filter(olympe.dc.query.Ca.Ha(olympe.dm.DataSource.kq,!0)).observe(this.F).subscribe(b=>{te(b).forEach(this.na.bind(this,a));se(b).forEach(c=>{let d;null==(d=this.$.get(c))||d.destroy();this.$.delete(c)})});this.db.Qa(this.G,olympe.dm.DataSource.kq)&&(new olympe.O.qb(this.G,this.F)).listen().subscribe(b=>
|
|
675
675
|
{b=b.body();b instanceof olympe.dc.Request?a.ed(b):this.K.error('Self source received something else than a data request, ignore it.')});return this}destroy(){return v(function*(){})}na(a,b){const c=b.X(),d=new olympe.D.Jb(`Published data provider context ${c}`,this.F);this.$.set(c,d);let e,f;zi(b,d).subscribe(g=>{let h;null==(h=e)||h();let k;null==(k=f)||k.stop();g!==olympe.dm.DataSource.le.Rm&&(e=Lh(this.C,c,m=>{wi(b,m);return a.request(m)}),d.onDestroy(()=>{let m;return null==(m=e)?void 0:m()}));
|
|
676
|
-
g!==olympe.dm.DataSource.le.Tn&&(g=new olympe.D.Jb(`Bus Service of data source ${c}`,d),f=(new olympe.O.qb(c,g)).Eq(this.
|
|
676
|
+
g!==olympe.dm.DataSource.le.Tn&&(g=new olympe.D.Jb(`Bus Service of data source ${c}`,d),f=(new olympe.O.qb(c,g)).Eq(this.ga.bind(this)),f.listen().subscribe(m=>{m.wh().then(n=>xi(this,a,b,m,n)).catch(n=>{this.K.warn(`Error occurred while processing request from ${m.source()}: ${n}`);return m.ih(n instanceof Error?n:Error(n))})}))})}ga(a){const b=this.T.get(a);this.T.delete(a);if(a=b)null==(a=this.P.get(b))?a=0:(0<a.C&&--a.C,0===a.C?(a.K.debug(`Data subscription ${a.F} has more subscriber: unsubscribe`),
|
|
677
677
|
a.G.unsubscribe(),a=!0):(a.K.debug(`Data subscription ${a.F} has ${a.C} subscribers`),a=!1));a&&this.P.delete(b)}};class yi{constructor(a,b,c,d){this.K=a;this.F=b;this.C=0;this.G=c.T(d).subscribe({next:e=>{olympe.O.qb.publish(b,e).catch(f=>a.error(`Error occurred while publishing a data notification: ${f}`))},error:e=>a.error(`Error occurred while trying to subscribe to topic ${b} for a datasource: ${e}`)})}}olympe.dc.sources.np.va=[olympe.dc.sources.Bk];olympe.dc.sources.fg=class extends olympe.O.fg{constructor(a){super();this.db=a;this.L=new Map}ha(a){a=this.C(a);if(0<this.L.size){const b=Array.from(this.L.values());this.L.clear();return{t:0,i:b,v:a}}return a}G(a){if(0===(null==a?void 0:a.t)){const b=a.i.reduce((c,d)=>{const e=new Map(Array.from(Object.entries(d.p).map(([f,g])=>[f,this.F(g)])));c.Ec(d.t,d.s,e,d.m);d.r.forEach(f=>c.Ea(f.r,d.t,f.d));return c},new olympe.dc.db.Lc);olympe.dc.Xl().dd(b);return this.F(a.v)}return this.F(a)}C(a){switch(!0){case a instanceof
|
|
678
678
|
olympe.dc.CloudObject:return a=a.X(),this.P(a),{t:10,v:a};case a instanceof olympe.dc.ra:return{t:11,v:a.ha()};case a instanceof olympe.dc.La:return{t:12,v:a.ha(this.P.bind(this))};case a instanceof olympe.dc.db.Lc:const b=new olympe.dc.transaction.ag;a.Od(b);return{t:13,i:a.W(),v:xg(b)};case a instanceof olympe.dc.Request:return{t:14,r:a.getType(),o:a.origin,d:a.Nb(),u:a.oc(),c:this.C(a.content)};case a instanceof olympe.dc.transaction.Aj:return{t:15,r:a.wg(),p:this.C(a.Zc())};case a instanceof olympe.dc.query.wd:return{t:16,
|
|
679
679
|
v:a.ha()};default:return super.C(a)}}F(a){if('object'!==typeof a||'number'!==typeof(null==a?void 0:a.t))return super.F(a);switch(a.t){case 10:return olympe.dc.CloudObject.get(a.v);case 11:a=a.v;var b=a.p.map(olympe.dc.query.ya.jj.C),c=a.e;return new olympe.dc.ra(a.b,a.s,b,b.length-1,new Set(a.r),{max:c.m,offset:c.o,gd:c.s,rf:c.rm});case 12:return ch(a.v);case 13:return(new olympe.dc.transaction.gj).C(a.v,a.i);case 14:return c=null!=(b=this.F(a.c))?b:void 0,re(new olympe.dc.Request(a.r,a.d,c,a.u),
|
|
@@ -691,19 +691,19 @@ olympe.dc.sources.Bp=class{constructor(a,b,c,d,e,f){this.K=a;this.F=b;this.da=c;
|
|
|
691
691
|
olympe.dm.DataSource.Pb.Db,a=olympe.dm.DataSource.Pb.Sg,Promise.resolve($c(this.F)?{s:a}:{s:c,r:'Disconnected'});case Ai:return Xi(this);case Bi:return a=new olympe.dc.transaction.ag({Md:!1,fh:!1}),b=c.Zc(),b.Od(a),bj(this,Bi,{i:b.W(),r:c.wg(),p:xg(a)}).then();case Ci:return Zi(this,c);case Di:return aj(this,c);case Ui:return a=new olympe.dc.transaction.ag({Md:!1,fh:!1}),c=c.Zc(),c.Od(a),bj(this,Ui,{i:c.W(),p:xg(a)}).then();case Gi:return cj(this,c);case Hi:return fj(this,c);case Ei:return $c(this.F)?
|
|
692
692
|
(c=dj(this,olympe.dc.ra.from(c)),c.f=olympe.dc.Ob.vn,c=P(Nh(this.C,olympe.dc.Ra.SERVER,Ei),olympe.net.Fa.Kd.Pg,JSON.stringify(c),olympe.net.Fa.ResponseType.lk),Q(c,{[olympe.net.Fa.Headers.Eh]:olympe.net.Fa.nn.JSON}),c=Ph(this.C,c)):(this.K.error(`Server is disconnected, backup of instance ${c} is canceled.`),c=Promise.reject('Server is disconnected')),c;case Fi:a=c.TB;b=c.debug;c=c.optional;if($c(this.F)){var d=Nh(this.C,olympe.dc.Ra.SERVER,Fi);c=P(d+`?debug=${b}&optional=${c}`,olympe.net.Fa.Kd.Pg,
|
|
693
693
|
a);Q(c,{[olympe.net.Fa.Headers.Eh]:olympe.net.Fa.nn.Jt});c=Ph(this.C,c)}else this.K.error('Server is disconnected, restore of instance is canceled.'),c=Promise.reject('Server is disconnected');return c;case Ri:case Si:case Ti:case Vi:return bj(this,b,{});case Oi:return this.C.downloadFileContent(a);case Ni:return this.C.deleteFileContent(a);case Pi:return this.C.uploadFileContent(a);default:return Promise.reject(`ServerProvider: Message of type ${b} not supported yet`)}}L(a,b){if(a.getType()===Ii){const c=
|
|
694
|
-
a.content,d=c.W();return(new rxjs.Observable(e=>{const f=dj(this,c);this.G.set(d,e);bj(this,Ki,f).catch(g=>e.error(g))})).pipe(Jc(this.da,b),rxjs.operators.finalize(()=>{bj(this,Li,{i:d}).catch(e=>{this.K.warn(`Fail to unsubscribe to graphdef ${d}: ${e}`)}).finally(()=>{this.G.delete(d)})}))}return rxjs.throwError(()=>Error(`Subscription of type ${a.getType()} is not supported`))}init(a){this.fc=a;Yc(this.F,olympe.O.ae.rn,this.
|
|
694
|
+
a.content,d=c.W();return(new rxjs.Observable(e=>{const f=dj(this,c);this.G.set(d,e);bj(this,Ki,f).catch(g=>e.error(g))})).pipe(Jc(this.da,b),rxjs.operators.finalize(()=>{bj(this,Li,{i:d}).catch(e=>{this.K.warn(`Fail to unsubscribe to graphdef ${d}: ${e}`)}).finally(()=>{this.G.delete(d)})}))}return rxjs.throwError(()=>Error(`Subscription of type ${a.getType()} is not supported`))}init(a){this.fc=a;Yc(this.F,olympe.O.ae.rn,this.ga.bind(this));return this}destroy(){return v(function*(){})}ga(a){var b=
|
|
695
695
|
olympe.dc.Request.C.Qm;const c=olympe.dc.Request.C.cl;var d=a.c;if(d===olympe.dc.Request.C.sn)a=this.P.C(a.p),$i(this,d,a);else if(d===b){var e=a.error.reason;b=this.P.C(a.p);$i(this,d,{id:a.i,rollback:b,error:e})}else d===Mi?(d=a.i,a=this.P.C(a.p),null==(e=this.G.get(d))||e.next(a)):d===c&&$i(this,Qi,{id:a.i,finalize:olympe.dc.transaction.Gf.C.cl,error:0<a.s?a.info.error.reason:null})}T(a,b){if(b instanceof olympe.dc.query.ya.Wf||b instanceof olympe.dc.query.ya.zf){const c=b.P();let d;b=Array.from(null!=
|
|
696
696
|
(d=a.get(b.W()))?d:[]);return{t:c.X(),d:c.Pa()===olympe.dc.wa.ORIGIN?1:2,v:!0,r:c.recursive,q:b.map(this.T.bind(this,a))}}return{}}};olympe.dc.sources.Bp.va=[olympe.dc.sources.Bk];function gj(a,b,c){const d=new olympe.D.Jb(`Source solver ${b.X()}`);b.eb(olympe.dm.xd.G.Rb()).eb(olympe.dm.xd.C).Nd().back().eb(olympe.dm.xd.F).Nd().observe(d,c).subscribe(e=>{te(e).forEach(([f,g])=>{a.F.set(f.X(),g.W())});se(e).forEach(([f])=>{a.F.delete(f)})});b.eb(olympe.dm.pb.L).observe(d,c).subscribe(e=>{let f,g;a.G=null!=(g=null==(f=e.xc())?void 0:f.W())?g:null});d.onDestroy(()=>{a.F.clear();a.G=null})}
|
|
697
|
-
olympe.dc.sources.xj=class{constructor(a,b,c){this.db=a;this.C=b;this.P=c;this.F=new Map;this.G=null;this.L=!1}fromModel(a){a=olympe.dc.
|
|
697
|
+
olympe.dc.sources.xj=class{constructor(a,b,c){this.db=a;this.C=b;this.P=c;this.F=new Map;this.G=null;this.L=!1}fromModel(a){a=olympe.dc.fa(a);return this.F.has(a)?this.F.get(a):this.G&&this.T(a)?this.G:this.P}Ce(a){let b;return null!=(b=this.db.source(a))?b:this.P}zb(a){return a===this.C?olympe.dc.CloudObject.get(this.C):a===olympe.dc.Ra.SERVER?olympe.dc.CloudObject.get(olympe.dm.DataSource.SERVER):this.db.Ia(a)&&this.db.$c(a,olympe.dm.DataSource)?olympe.dc.CloudObject.get(a):null}T(){return!1}init(){if(!this.L){this.L=
|
|
698
698
|
!0;var a=new olympe.dc.Sa;Z(a.create(olympe.dm.DataSource,this.C).uh(this.C),olympe.dm.DataSource.eh,!0);a.Ea(olympe.dm.DataSource.yi,this.C,this.C);a.lb(()=>{olympe.dc.ra.from(this.C).observe(olympe.D.og()).subscribe(()=>{})})}}};olympe.dc.sources.R={za:'dc.sources.Logger',Pk:'dc.sources.HTTPService',Rr:'dc.sources.IOService',gp:'dc.sources.RemoteProvider',up:'dc.sources.ServerProvider',Jy:'dc.sources.OfflineProvider',te:'dc.sources.SourceSolver',ee:'dc.sources.Serializer'};
|
|
699
699
|
olympe.dc.sources.U={Nk:'data.httpHost',Jh:'data.httpPort',Wn:'data.httpSSL',Mk:'data.httpBasePath',hl:'data.pollingFrequency',le:'data.communicationMode',ml:'data.restrictedUse',Vn:'data.HTTPExtraHeaders',$n:'data.incomingAuthHeaders',Lq:'offline.autoSync',Kq:'offline.autoPersist',ot:'offline.syncTimeout',VERSION:'version.version'};
|
|
700
700
|
olympe.V.config(function(a){F(a,olympe.dc.sources.U.Lq,!1);F(a,olympe.dc.sources.U.Kq,!1);F(a,olympe.dc.sources.U.ot,3E4);var b=a.getParameter(olympe.O.U.xk);F(a,olympe.dc.sources.U.Nk,b);var c=a.getParameter(olympe.dc.sources.U.Nk);c=(b='localhost'===c)||c.endsWith(a.getParameter(olympe.net.U.Zi));F(a,olympe.dc.sources.U.Jh,b?3141:c?80:443);F(a,olympe.dc.sources.U.Wn,!c);F(a,olympe.dc.sources.U.Mk,'runtime/data');F(a,olympe.dc.sources.U.hl,null);F(a,olympe.dc.sources.U.le,null);F(a,olympe.dc.sources.U.ml,
|
|
701
701
|
null);F(a,olympe.dc.sources.U.Vn,{});F(a,olympe.dc.sources.U.$n,{});E(a,olympe.dc.sources.R.za,[olympe.la.R.Ga],d=>d.Fc('data'));D(a,olympe.dc.sources.R.ee,olympe.dc.sources.fg,olympe.dc.R.Oe);va(a,olympe.O.R.ee,olympe.dc.sources.R.ee);D(a,olympe.dc.sources.R.Pk,olympe.dc.sources.Gr,olympe.dc.sources.R.za,olympe.net.R.Dj,olympe.O.R.Ok,olympe.auth.R.Ga,olympe.dc.sources.R.te,olympe.O.R.ee,new olympe.V.ma(olympe.O.U.mk));D(a,olympe.dc.sources.R.Rr,olympe.dc.sources.ho,olympe.dc.sources.R.za,olympe.dc.R.Tg,
|
|
702
702
|
olympe.net.R.Ga,olympe.auth.R.Ga);D(a,olympe.dc.sources.R.gp,olympe.dc.sources.np,olympe.dc.sources.R.za,new olympe.V.ma(olympe.dc.U.eg),olympe.dc.sources.R.Pk,olympe.dc.R.Oe,olympe.dc.sources.R.te);D(a,olympe.dc.sources.R.up,olympe.dc.sources.Bp,olympe.dc.sources.R.za,olympe.O.R.qj,olympe.O.R.pk,olympe.auth.R.Ga,olympe.dc.sources.R.Pk,new olympe.V.ma(olympe.dc.sources.U.VERSION));D(a,olympe.dc.sources.R.te,olympe.dc.sources.xj,olympe.dc.R.Oe,new olympe.V.ma(olympe.dc.U.eg),new olympe.V.ma(olympe.dc.U.zk))},
|
|
703
|
-
'olympe.dc.sources');olympe.V.run([olympe.dc.sources.R.te],a=>{olympe.dc.Fd=()=>a});olympe.dc.transaction={};olympe.dc.Ch=class a{constructor(b,c){this.id=null!=b?b:olympe.Z.hc();this.F=new olympe.D.Jb('BurstTransaction#'+this.id,c);this.Eb=hj(this);this.T=!1;this.F.onDestroy(()=>this.P());this.$=new Set;this.G=new Map;this.L=new Set;this.C=null;let d;this.mb=null!=(d=olympe.V.getParameter(olympe.dc.transaction.U.Pm))?d:30;this.na=[]}static C(b,c){return`${b},${c}`}Qb(b){for(const c of this.na)c(b);this.stop()}Wa(){null!==this.C&&(clearTimeout(this.C),this.C=null);const b=this.
|
|
704
|
-
b,!1);this.L.clear()}
|
|
705
|
-
c)=>{this.P((d,e)=>{for(const f of this.$)f.unsubscribe();d?b():c(e)})})}update(b,c,d){const e=olympe.dc.
|
|
706
|
-
!1;null!==this.C&&(clearTimeout(this.C),this.C=null);this.L.clear();const c=this.
|
|
703
|
+
'olympe.dc.sources');olympe.V.run([olympe.dc.sources.R.te],a=>{olympe.dc.Fd=()=>a});olympe.dc.transaction={};olympe.dc.Ch=class a{constructor(b,c){this.id=null!=b?b:olympe.Z.hc();this.F=new olympe.D.Jb('BurstTransaction#'+this.id,c);this.Eb=hj(this);this.T=!1;this.F.onDestroy(()=>this.P());this.$=new Set;this.G=new Map;this.L=new Set;this.C=null;let d;this.mb=null!=(d=olympe.V.getParameter(olympe.dc.transaction.U.Pm))?d:30;this.na=[]}static C(b,c){return`${b},${c}`}Qb(b){for(const c of this.na)c(b);this.stop()}Wa(){null!==this.C&&(clearTimeout(this.C),this.C=null);const b=this.ga(this.L);0<b.size&&ij(this,
|
|
704
|
+
b,!1);this.L.clear()}ga(b){const c=new Map;b.forEach(d=>{const e=d.split(',');let f=c.get(e[0]);void 0===f&&(f=new Map,c.set(e[0],f));f.set(e[1],this.G.get(d))});return c}da(b,c,d){this.Da(b,c,d);this.Eb(b,c,d);null===this.C&&(this.C=setTimeout(this.Wa.bind(this),this.mb))}Da(b,c,d){b=a.C(b,c);this.G.set(b,d);this.L.add(b)}ub(b,c){return this.G.get(a.C(b,c))}push(b,c){const d=olympe.dc.fa(b);b=c.subscribe(e=>{for(const [f,g]of e)e=olympe.dc.fa(f),this.ub(d,e)!==g&&this.da(d,e,g.valueOf())});this.$.add(b)}complete(){return new Promise((b,
|
|
705
|
+
c)=>{this.P((d,e)=>{for(const f of this.$)f.unsubscribe();d?b():c(e)})})}update(b,c,d){const e=olympe.dc.fa(b),f=olympe.dc.fa(c);void 0===e||void 0===f?olympe.dc.ph().fb().error('Burst transaction: instance tag or property tag is undefined'):(this.F.run(()=>{olympe.D.tm([d],g=>{this.T=!0;g instanceof olympe.dc.lc?olympe.dc.ph().fb().error('Cannot send complex property values in burst transactions'):this.da(e,f,g.valueOf())})}),this.F.$(()=>{this.P()}))}stop(){this.F.destroy();this.na.length=0}getContext(){return this.F}W(){return this.id}wg(){return!1}P(b){if(this.T){this.T=
|
|
706
|
+
!1;null!==this.C&&(clearTimeout(this.C),this.C=null);this.L.clear();const c=this.ga(new Set(this.G.keys()));ij(this,c,!0,b)}else null==b||b(!0)}toString(){return'Burst transaction #'+this.id}};olympe.dc.Ch.prototype.complete=olympe.dc.Ch.prototype.complete;olympe.dc.Ch.prototype.push=olympe.dc.Ch.prototype.push;olympe.dc.Oo=class{C(){}toString(){}};olympe.dc.transaction.gj=class a{constructor(b){this.F=null!=b?b:olympe.dc.Ra.SERVER}C(b,c){c=new olympe.dc.db.Lc(c);this.G(b,c);return c}G(b,c){for(const d of b)switch(d.o){case 1:b=a.C(d.p||{});let e;c.Ec(d.t,null!=(e=d.s)?e:this.F,b,d.m);break;case 2:c.hd(d.t,a.C(d.p),d.m);break;case 3:c.F(d.t,d.f,d.m);break;case 4:c.Ea(d.m,d.l,d.r,d.lm,d.rm);break;case 5:c.Xb(d.m,d.l,d.r,d.lm,d.rm);break;case 6:break;default:throw Error('Undefined patch operation: '+d.o);}}static C(b){const c=new Map;for(const [d,
|
|
707
707
|
e]of Object.entries(b)){b=d;let f=typeof e;20<b.length&&b.startsWith('fd')&&(b=olympe.dc.Wi.Id+b.substring(2));'object'===f&&(f=e&&e.c?String(e.c):'untyped');switch(f){case '1':case '2':case '3':throw Error('Complex format for primitive types not supported.');case 'string':c.set(b,String(e));break;case 'boolean':c.set(b,!!e);break;case 'number':c.set(b,Number(e));break;case '4':c.set(b,new Date(Date.UTC(e.y,e.M-1,e.d,e.h,e.m,e.s,e.S)));break;case '5':c.set(b,new Date(Date.UTC(e.y,e.M-1,e.d)));break;
|
|
708
708
|
case '6':c.set(b,new Date(Date.UTC(e.y||1970,e.M&&e.M-1||0,e.d||1,e.h,e.m,e.s,e.S)));break;case '7':c.set(b,new olympe.D.Color(e.r,e.g,e.b,e.a));break;case '8':c.set(b,new olympe.dc.lc(e.t));break;case 'untyped':null===e&&c.set(b,null)}}return c}};function jj(a,b){let c;return null!=(c=a.sources.get(b))?c:a.L.Ce(b)}function kj(a,b){let c,d,e;return null!=(e=null!=(d=null==(c=a.C.Ge(b))?void 0:c.Dd())?d:a.db.model(b))?e:null}function lj(a,b){let c;return null!=(c=a.P.get(b))?c:a.db.Of(b)||!a.db.Ia(b)}function mj(a){return Array.from(a.C.Sd()).filter(b=>!b.lf()).map(b=>b.tag())}function nj(a,b,c,d){d(a.C);c&&a.G&&b!==olympe.dc.Ra.SELF&&(c=a.F.get(b),c||(c=new olympe.dc.db.Lc(a.id),a.F.set(b,c)),d(c))}
|
|
709
709
|
function oj(a,b,c){const d=jj(a,b),e=lj(a,b),f=kj(a,b);nj(a,d,e,g=>{g.F(b,c,f)})}
|
|
@@ -716,10 +716,10 @@ olympe.dc.transaction.ag=class{constructor({ak:a=!1,fh:b=!0,Md:c=!0}={}){this.P=
|
|
|
716
716
|
b,c=null){b=pj(this.$,b||null,!1);a={o:2,t:a,p:b};this.Md&&c&&(a.m=c);this.C.push(a)}F(a,b,c=null){a={o:3,t:a,f:b};this.Md&&c&&(a.m=c);this.G.push(a)}Ea(a,b,c,d=null,e=null){if(!a)throw Error('Cannot create relation of undefined type');if(!b)throw Error(`Cannot create relation ${a} from undefined origin to ${c}`);if(!c)throw Error(`Cannot create relation ${a} from ${b} to undefined destination`);a={o:4,m:a,l:b,r:c};this.Md&&d&&(a.lm=d);this.Md&&e&&(a.rm=e);this.T.push(a)}Xb(a,b,c,d=null,e=null){if(!a)throw Error('Cannot delete relation of undefined type');
|
|
717
717
|
if(!b)throw Error('Cannot delete relation with undefined origin');if(!c)throw Error('Cannot delete relation with undefined destination');a={o:5,m:a,l:b,r:c};this.Md&&d&&(a.lm=d);this.Md&&e&&(a.rm=e);this.L.push(a)}};olympe.dc.transaction.ag.va=[olympe.dc.Writable];function sj(a,b){b&&a.ab.push(b);return b}function tj(a,b,c,d){c=a.create(null!=c?c:olympe.dc.CloudObject,void 0);if('string'===typeof b)b=b||'',Z(c,olympe.dc.CloudObject.nameProp.X(),b);else for(const [f,g]of Object.entries(b))Z(c,f,g);b=c.X();d=null!=d?d:olympe.dc.CloudObject;const e=olympe.dc.CloudObject.extendRel.X();sj(a,new olympe.dc.transaction.ab.xn(e,b));sj(a,new olympe.dc.transaction.ab.vk(e,b,d));return c}
|
|
718
718
|
function uj(a){return 0<a.length?(b,c)=>{a.forEach(d=>null==d?void 0:d(b,c))}:void 0}
|
|
719
|
-
olympe.dc.Sa=class{constructor(a){this.id=a||olympe.Z.hc();this.ab=[];this.G=new Map;this.L=!0;this.F=[]}W(){return this.id}model(a){let b;return null!=(b=this.G.get(olympe.dc.
|
|
719
|
+
olympe.dc.Sa=class{constructor(a){this.id=a||olympe.Z.hc();this.ab=[];this.G=new Map;this.L=!0;this.F=[]}W(){return this.id}model(a){let b;return null!=(b=this.G.get(olympe.dc.fa(a)))?b:olympe.dc.ta().model(a)}persist(a){this.L=a;return this}C(a){a.persist(this.L);const b=this.ab;for(let c=0,d=b.length;c<d;c++)b[c].C(a)}create(a,b){b=sj(this,new olympe.dc.transaction.ab.uk(a,b));this.G.set(b.X(),olympe.dc.fa(a));return b}zi(a,b=!0){const c=olympe.dc.fa(a);var d=this.ab.find(h=>h instanceof olympe.dc.transaction.ab.uk&&
|
|
720
720
|
h.X()===c);if(d)return d.persist(b);d=olympe.dc.ta();const e=d.model(a);if(null===e)throw Error('Try to persist a instance that does not exist: '+a);if(d.Of(a))return null;let f;const g=null!=(f=d.source(a))?f:olympe.dc.Fd().fromModel(e);a=this.create(e,a).persist(b).uh(g);for(const [h,k,m]of Of(d,a))h!==olympe.dc.mc.nd&&d.Of(m)&&this.Ea(h,k===olympe.dc.wa.DESTINATION?a:m,k===olympe.dc.wa.DESTINATION?m:a);return a}delete(a,b=olympe.dc.Ob.qc){sj(this,new olympe.dc.transaction.ab.yn(a,b))}update(a,
|
|
721
721
|
b,c){return sj(this,new olympe.dc.transaction.ab.Ht(a,b,c))}Ea(a,b,c){sj(this,new olympe.dc.transaction.ab.vk(a,b,c))}Xb(a,b,c){sj(this,new olympe.dc.transaction.ab.sr(a,b,c))}Ql(a,b){sj(this,new olympe.dc.transaction.ab.xn(a,b))}defineProperty(a,b,c,d,e,f){d=this.create(olympe.dm.Property,f);Z(d,olympe.dc.CloudObject.nameProp,c||'');void 0!==e&&this.update(a,olympe.dc.Wi.Id+d.X(),e);this.Ea(olympe.dc.CloudObject.propertyRel,a,d);this.Ea(olympe.dm.Property.typeRel,d,b);this.Ea(olympe.dc.CloudObject.containsRel,
|
|
722
|
-
a,d);return d}hq(a,b,c='',{$A:d=olympe.dm.Relation.L.Os,kB:e=olympe.dm.Relation.C.cp,fB:f=olympe.dm.Relation.C.Vq,LB:g=olympe.dm.Relation.C.Ir,XA:h=olympe.dm.fk.NONE,IB:k=olympe.dm.Relation.P|h}={},m=olympe.Z.hc()){c=Z(Z(Z(Z(Z(Z(Z(Z(this.create(olympe.dm.Relation,m),olympe.dc.CloudObject.nameProp,c||''),olympe.dm.Relation.F,d),olympe.dm.Relation.G,k),olympe.dm.Relation.da,e),olympe.dm.Relation.na,e),olympe.dm.Relation.$,f),olympe.dm.Relation.
|
|
722
|
+
a,d);return d}hq(a,b,c='',{$A:d=olympe.dm.Relation.L.Os,kB:e=olympe.dm.Relation.C.cp,fB:f=olympe.dm.Relation.C.Vq,LB:g=olympe.dm.Relation.C.Ir,XA:h=olympe.dm.fk.NONE,IB:k=olympe.dm.Relation.P|h}={},m=olympe.Z.hc()){c=Z(Z(Z(Z(Z(Z(Z(Z(this.create(olympe.dm.Relation,m),olympe.dc.CloudObject.nameProp,c||''),olympe.dm.Relation.F,d),olympe.dm.Relation.G,k),olympe.dm.Relation.da,e),olympe.dm.Relation.na,e),olympe.dm.Relation.$,f),olympe.dm.Relation.ga,g),olympe.dm.Relation.T,h);this.Ea(olympe.dc.CloudObject.xi,
|
|
723
723
|
a,c);this.Ea(olympe.dm.Relation.destinationModelRel,c,b);this.Ea(olympe.dc.CloudObject.containsRel,a,c);return c}wg(){return!1}Jl(a){this.F.push(olympe.D.Ma().G(a))}lb(a,b){a=uj([...this.F,a].filter(c=>'function'===typeof c));vj(this,a,b)}Rl(a){a=uj([...this.F,a]);wj(olympe.dc.ph(),this,a,!0)}toString(){return`Transaction #${this.id}`}};olympe.dc.Sa.va=[olympe.dc.Oo];function hj(a){var b=olympe.dc.ph();const c=a.W();b.L.set(c,a);a.getContext().onDestroy(()=>{b.L.delete(c)});return(d,e,f)=>{const g=new olympe.dc.db.Lc(c);g.hd(d,(new Map).set(e,f),b.db.model(d));b.F.dd(g)}}
|
|
724
724
|
function ij(a,b,c,d){var e=olympe.dc.ph();const f=olympe.dc.Request.C.Ah,g=olympe.dc.Request.C.Bh,h=a.W();a=a.wg();const k=new Map;for(const m of b.keys()){const n=e.db.source(m);if(n===olympe.dc.Ra.SELF)continue;let p=k.get(n);p||(p=new olympe.dc.db.Lc(h),k.set(n,p));p.hd(m,b.get(m),e.db.model(m))}for(const [m,n]of k)b=new olympe.dc.Request(c?g:f,m,new olympe.dc.transaction.Aj(n,a)),b=e.fc.request(b).catch(p=>null==d?void 0:d(!1,`${p}`)),c&&b.then(()=>null==d?void 0:d(!0))}
|
|
725
725
|
function vj(a,b,c){var d=olympe.dc.ph();if(c&&'function'===typeof b){const e=a.W();d.G.set(e,b);wj(d,a,(f,g)=>{f||(d.G.delete(e),b(f,g))},!1)}else wj(d,a,b,!1)}function xj(a){const b=olympe.dc.Request.C.Gk;a.fc.L(olympe.dc.Request.C.Qm,c=>{var d=c.content;c=d.id;var e=d.rollback;d=d.error;const f=a.L.get(c);void 0!==f&&(a.L.delete(c),f.Qb(d));a.F.dd(e);a.K.warn(`Fast update (id=${c}) has been refused and is rolled back. Error: ${d}`)});a.fc.L(b,c=>{c=c.content;yj(a,c.id,c.finalize,c.error)})}
|
|
@@ -729,19 +729,19 @@ else{var u=n.X(),w,x=null!=(w=n.get(olympe.dm.File.mimeTypeProp))?w:'application
|
|
|
729
729
|
new olympe.dc.db.Lc);return mf(a.F,n)})}function Aj(a,b,c,d){const e=olympe.D.og(),f=new olympe.async.ij(e);0<a.timeout&&f.Cm(a.timeout);const g=olympe.dc.transaction.Gf.C.Ks;let h=!0;const k=a.C.get(b);for(let m=0;m<d;m++)f.add((n,p)=>{k.push(e.G((q,r)=>{h&&(h=q!==g);r?p(r):n()}))});qc(f,(m,n)=>{m||a.K.warn(`An error occurred while processing the notification of transaction (${b}): ${n}.`);h&&a.F.C.Qb(c);Cj(a,b)});f.start()}
|
|
730
730
|
function Bj(a,b,c,d){const e=c?olympe.dc.Request.C.$h:olympe.dc.Request.C.Xg;return Promise.all(Array.from(b.F).map(([f,g])=>a.fc.request(new olympe.dc.Request(e,f,new olympe.dc.transaction.Aj(g,d))))).then()}function yj(a,b,c,d){(a=(a=a.C.get(b))&&a.pop())&&a(c,d)}function Cj(a,b){var c;null==(c=a.C.get(b))||c.forEach(d=>{d(olympe.dc.transaction.Gf.C.bj,null)});a.C.delete(b);if(0===a.C.size){for(const d of a.P)d();a.P=[]}a.G.has(b)&&(c=a.G.get(b),a.G.delete(b),c(!0))}
|
|
731
731
|
function Dj(a,b){0<a.C.size?a.P.push(olympe.D.Ma().G(b)):b()}olympe.dc.transaction.Gf=class{constructor(a,b,c,d,e,f){this.K=a;this.F=b;this.db=b.view;this.fc=c;this.T=d;this.$=e;this.timeout=f;this.L=new Map;this.C=new Map;this.P=[];this.G=new Map;xj(this)}fb(){return this.K}};olympe.dc.transaction.Gf.C={cl:0,bj:1,Ks:2};olympe.dc.transaction.Aj=class{constructor(a,b=!1){this.C=a;this.F=b}wg(){return this.F}Zc(){return this.C}};olympe.dc.transaction.R={za:'dc.transaction.Logger',Ga:'dc.transaction.Manager'};olympe.dc.transaction.U={TIMEOUT:'dc.transaction.timeout',Pm:'dc.transaction.burstInterval'};
|
|
732
|
-
olympe.V.config(function(a){F(a,olympe.dc.transaction.U.TIMEOUT,6E4);F(a,olympe.dc.transaction.U.Pm,30);E(a,olympe.dc.transaction.R.za,[olympe.la.R.Ga],b=>b.Fc('dc'));D(a,olympe.dc.transaction.R.Ga,olympe.dc.transaction.Gf,olympe.dc.transaction.R.za,olympe.dc.db.R.Ga,olympe.dc.R.Tg,olympe.dc.sources.R.te,olympe.dc.R.Qi,new olympe.V.ma(olympe.dc.transaction.U.TIMEOUT))},'olympe.dc.transaction');olympe.dc.transaction.ab={};function Ej(a,b){const c=new Map;for(const [d,e]of b)c.set(d,a.Ta(e));return c}olympe.dc.transaction.ab.Bg=class{constructor(){this.ta=olympe.dc.ta()}C(){throw Error('Abstract method build() not override !');}toString(){throw Error('Abstract method toString() not override !');}Ta(a){a=olympe.D.Ta(a);return void 0===a||null===a?null:olympe.D.xq(a)?a.valueOf():a}};olympe.dc.transaction.ab.Bg.va=[olympe.dc.Oo];olympe.dc.transaction.ab.Jm=class extends olympe.dc.transaction.ab.Bg{constructor(a,b){super();this.relation=a instanceof olympe.dc.Oa.Relation?a:new olympe.dc.Oa.Relation(olympe.dc.
|
|
733
|
-
olympe.dc.transaction.ab.uk=class extends olympe.dc.transaction.ab.Bg{constructor(a,b){super();let c;this.tag=null!=(c=b&&olympe.dc.
|
|
732
|
+
olympe.V.config(function(a){F(a,olympe.dc.transaction.U.TIMEOUT,6E4);F(a,olympe.dc.transaction.U.Pm,30);E(a,olympe.dc.transaction.R.za,[olympe.la.R.Ga],b=>b.Fc('dc'));D(a,olympe.dc.transaction.R.Ga,olympe.dc.transaction.Gf,olympe.dc.transaction.R.za,olympe.dc.db.R.Ga,olympe.dc.R.Tg,olympe.dc.sources.R.te,olympe.dc.R.Qi,new olympe.V.ma(olympe.dc.transaction.U.TIMEOUT))},'olympe.dc.transaction');olympe.dc.transaction.ab={};function Ej(a,b){const c=new Map;for(const [d,e]of b)c.set(d,a.Ta(e));return c}olympe.dc.transaction.ab.Bg=class{constructor(){this.ta=olympe.dc.ta()}C(){throw Error('Abstract method build() not override !');}toString(){throw Error('Abstract method toString() not override !');}Ta(a){a=olympe.D.Ta(a);return void 0===a||null===a?null:olympe.D.xq(a)?a.valueOf():a}};olympe.dc.transaction.ab.Bg.va=[olympe.dc.Oo];olympe.dc.transaction.ab.Jm=class extends olympe.dc.transaction.ab.Bg{constructor(a,b){super();this.relation=a instanceof olympe.dc.Oa.Relation?a:new olympe.dc.Oa.Relation(olympe.dc.fa(a));this.origin=this.ta.Ia(b)?olympe.dc.CloudObject.get(b):b}getType(){return this.relation.X()}Pa(){return this.relation.Pa()}C(){throw Error('Abstract method build() not override !');}toString(){throw Error('Abstract method toString() not override !');}};function Z(a,b,c){a.G.set(olympe.dc.fa(b),c);return a}
|
|
733
|
+
olympe.dc.transaction.ab.uk=class extends olympe.dc.transaction.ab.Bg{constructor(a,b){super();let c;this.tag=null!=(c=b&&olympe.dc.fa(b))?c:olympe.Z.ef();this.model=olympe.dc.fa(a);this.source=null;this.G=new Map;this.F=!0}X(){return this.tag}nc(){return this.model}persist(a){this.F=a;return this}uh(a){this.source=a;return this}C(a){const b=olympe.dc.ta(),c=this.nc(),d=this.X();if(!c)throw Error('OperationError: Cannot create instance, model tag is undefined');if(b.Ia(d)&&!b.Of(d)&&this.F){const e=
|
|
734
734
|
new Map([...b.Cb(d,!0),...Ej(this,this.G)]);for(const f of e.values())if(f instanceof olympe.dc.lc&&!lj(a,f.X())){const g=new olympe.dc.Sa;g.zi(f.X());g.C(a)}a.Ec(d,c,this.F,this.source,e);for(const [f,g,h]of Of(b,d))lj(a,h)&&(g===olympe.dc.wa.ORIGIN?a.Ea(f,h,d):a.Ea(f,d,h))}else b.Ia(d)||a.Ec(d,c,this.F,this.source,Ej(this,this.G))}toString(){return`CreateInstance(${this.nc()}, ${this.X()})`}};olympe.dc.transaction.ab.uk.va=[olympe.dc.pe];olympe.dc.transaction.ab.vk=class extends olympe.dc.transaction.ab.Jm{constructor(a,b,c){super(a,b);this.F=this.ta.Ia(c)?olympe.dc.CloudObject.get(c):c}C(a){const b=this.getType();if(''===b)throw Error('OperationError: Cannot create relation, type is undefined, null or empty string');if(b===olympe.dc.mc.nd)throw Error('OperationError: Cannot create the instance -> model relation');if(!this.origin)throw Error('OperationError: Cannot create relation, origin tag is undefined, null or empty string');
|
|
735
|
-
if(!this.F)throw Error('OperationError: Cannot create relation, destination tag is undefined, null or empty string');this.relation.Pa()===olympe.dc.wa.DESTINATION?a.Ea(b,olympe.dc.
|
|
736
|
-
a.Xb(b,c,f):a.Xb(b,f,c)}toString(){return`DeleteAllRelations(${this.Pa()}${this.getType()})`}};olympe.dc.transaction.ab.yn=class extends olympe.dc.transaction.ab.Bg{constructor(a,b=olympe.dc.Ob.qc){super();this.tag=this.ta.Ia(a)?olympe.dc.CloudObject.get(a):a;this.cc=b}X(){return olympe.dc.
|
|
737
|
-
this.relation.Pa()===olympe.dc.wa.DESTINATION?a.Xb(b,c,d):a.Xb(b,d,c)}toString(){return'DeleteRelation('+this.relation.Pa()+this.relation.X()+', '+olympe.dc.
|
|
738
|
-
for(const [e,f]of c){var d=this.ta.Qa(b,e);d instanceof olympe.dc.lc&&oj(a,d.X(),olympe.dc.Ob.qc);f instanceof olympe.dc.lc&&!lj(a,f.X())&&(d=new olympe.dc.Sa,d.zi(f.X()),d.C(a))}a.hd(b,c)}toString(){return'UpdateInstance('+this.X()+', '+Ej(this,this.F)+')'}};olympe.dc.
|
|
735
|
+
if(!this.F)throw Error('OperationError: Cannot create relation, destination tag is undefined, null or empty string');this.relation.Pa()===olympe.dc.wa.DESTINATION?a.Ea(b,olympe.dc.fa(this.origin),olympe.dc.fa(this.F)):a.Ea(b,olympe.dc.fa(this.F),olympe.dc.fa(this.origin))}toString(){return`CreateRelation('${this.relation.Pa()}${this.relation.X()}, ${olympe.dc.fa(this.origin)}, ${olympe.dc.fa(this.F)})`}};olympe.dc.transaction.ab.tx=class extends olympe.dc.transaction.ab.Bg{constructor(a,b=olympe.dc.Ob.qc){super();this.model=a instanceof olympe.dc.CloudObject?a:olympe.dc.CloudObject.get(a);this.cc=b}C(a){for(const b of this.ta.Sd(this.model))b!==olympe.dc.fa(this.model)&&(new olympe.dc.transaction.ab.yn(b,this.cc)).C(a)}toString(){return`DeleteAllInstances(${this.model.X()}, ${this.cc})`}};olympe.dc.transaction.ab.xn=class extends olympe.dc.transaction.ab.Jm{C(a){const b=this.getType();if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.mc.nd)throw Error('OperationError: Cannot delete the instance -> model relation');const c=olympe.dc.fa(this.origin);if(!this.origin)throw Error('OperationError: Cannot delete relation, left tag is undefined');const d=this.Pa(),e=this.ta.ib(c,this.relation);for(const f of e)d===olympe.dc.wa.DESTINATION?
|
|
736
|
+
a.Xb(b,c,f):a.Xb(b,f,c)}toString(){return`DeleteAllRelations(${this.Pa()}${this.getType()})`}};olympe.dc.transaction.ab.yn=class extends olympe.dc.transaction.ab.Bg{constructor(a,b=olympe.dc.Ob.qc){super();this.tag=this.ta.Ia(a)?olympe.dc.CloudObject.get(a):a;this.cc=b}X(){return olympe.dc.fa(this.tag)}C(a){const b=this.X();if(void 0===b)throw Error('OperationError: Cannot delete instance, tag is undefined');this.ta.Ia(b)&&oj(a,b,this.cc)}toString(){return'DeleteInstance('+this.X()+', '+this.cc+')'}};olympe.dc.transaction.ab.sr=class extends olympe.dc.transaction.ab.vk{C(a){const b=this.relation.X();if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.mc.nd)throw Error('OperationError: Cannot delete the instance -> model relation');const c=olympe.dc.fa(this.origin);if(void 0===c)throw Error('OperationError: Cannot delete relation, left tag is undefined');const d=olympe.dc.fa(this.F);if(void 0===d)throw Error('OperationError: Cannot delete relation, right tag is undefined');
|
|
737
|
+
this.relation.Pa()===olympe.dc.wa.DESTINATION?a.Xb(b,c,d):a.Xb(b,d,c)}toString(){return'DeleteRelation('+this.relation.Pa()+this.relation.X()+', '+olympe.dc.fa(this.origin)+', '+olympe.dc.fa(this.F)+')'}};olympe.dc.transaction.ab.Ht=class extends olympe.dc.transaction.ab.Bg{constructor(a,b,c){super();this.tag=this.ta.Ia(a)?olympe.dc.CloudObject.get(a):a;this.F=new Map;void 0!==b&&this.F.set(olympe.dc.fa(b),c)}X(){return olympe.dc.fa(this.tag)}C(a){const b=this.X();if(void 0===b)throw Error('OperationError: Cannot update instance, tag is undefined');var c;if(!(null!=(c=a.C.Ge(b))&&c.L()||this.ta.Ia(b)))throw Error('OperationError: Instance #'+b+' not found so it cannot be updated');c=Ej(this,this.F);
|
|
738
|
+
for(const [e,f]of c){var d=this.ta.Qa(b,e);d instanceof olympe.dc.lc&&oj(a,d.X(),olympe.dc.Ob.qc);f instanceof olympe.dc.lc&&!lj(a,f.X())&&(d=new olympe.dc.Sa,d.zi(f.X()),d.C(a))}a.hd(b,c)}toString(){return'UpdateInstance('+this.X()+', '+Ej(this,this.F)+')'}};olympe.dc.fa=function(a){if('string'===typeof a)return a;let b=null;a=olympe.D.Ta(a);void 0!==a&&null!==a&&(a=a.valueOf(),'string'===typeof a?b=a:a.X?b=a.X():'function'===typeof a&&(b=olympe.dc.ka.nc(a)));return b||''};B('olympe.dc.instanceToTag',olympe.dc.fa);olympe.dc.ta=function(){return olympe.dc.Xl().view};olympe.dc.register=function(a,b){olympe.dc.ka.C(a,b)};olympe.dc.defineProperty=function(a){return new olympe.dc.Oa.Property(a)};
|
|
739
739
|
olympe.dc.hq=function(a,b=olympe.dc.wa.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.wa.DESTINATION){const e=olympe.dc.wa.DESTINATION;return b===olympe.dc.wa.ORIGIN||b===e?new olympe.dc.Oa.Relation(a,b):new olympe.dc.Oa.Relation(a,d,b,c)};olympe.dc.eu=function(a){return a.Rb()};olympe.dc.Fb={};olympe.dc.Fb.Ol=a=>'string'===typeof a||'number'===typeof a||'boolean'===typeof a||a instanceof String?olympe.D.sb(a):a instanceof olympe.D.Ka?a:null;olympe.dc.Fb.Ll=a=>'boolean'===typeof a||a instanceof Boolean?olympe.D.Ib(a):a instanceof olympe.D.ea?a:null;olympe.dc.Fb.Nl=a=>'number'===typeof a||a instanceof Number?olympe.D.oa(a):'string'===typeof a||a instanceof String?olympe.D.oa(Number.parseFloat(a.valueOf())):a instanceof olympe.D.aa?a:null;
|
|
740
740
|
olympe.dc.Fb.Ml=function(a){return'number'===typeof a||a instanceof Number?wb(a.valueOf()):'string'===typeof a||a instanceof String?new olympe.D.Za(new Date(a.valueOf().valueOf())):a instanceof Date?new olympe.D.Za(a):a instanceof olympe.D.Za?a:null};olympe.dc.Fb.$p=function(a){return a instanceof olympe.D.Color?a:'string'===typeof a||a instanceof String?Ab(a.valueOf()):null};olympe.dc.Fb.aq=a=>a instanceof olympe.dc.CloudObject?a:a instanceof olympe.dc.lc?me(a):null;
|
|
741
741
|
olympe.dc.Fb.kg=a=>a instanceof olympe.dc.lc?me(a):a;olympe.dc.Fb.bB=a=>{switch(typeof a){case 'boolean':return olympe.D.Ib(a);case 'number':return olympe.D.oa(a);case 'string':return olympe.D.sb(a);case 'object':if(a instanceof Date)return olympe.D.Yv(a)}return a};
|
|
742
742
|
olympe.dc.Fb.tB=a=>{switch(a){case olympe.D.ea:return olympe.dc.Fb.Ll;case olympe.D.Ka:return olympe.dc.Fb.Ol;case olympe.D.aa:return olympe.dc.Fb.Nl;case olympe.D.Za:return olympe.dc.Fb.Ml;case olympe.D.Color:return olympe.dc.Fb.$p;case olympe.dc.CloudObject:return olympe.dc.Fb.aq;default:return olympe.dc.Fb.kg}};olympe.dc.ic={};olympe.dc.Me=class{ia(){}L(){}G(){}P(){}ha(){}toString(){}};function Fj(a){let b=null;for(a=[...a.ba];null===b&&0<a.length;)b=a.pop().Hb();return b}function Gj(a,b){a.T()||(a=`Calling "${b}" on subscription with id ${a.W()} while it is not ready (thus no data is available).`+'This call should be made within an onReady callback. You can also consider to use Queries API instead of ListDefs (which are deprecated)',olympe.la.fb('dc').warn(a))}
|
|
743
743
|
function Ij(a){const b=new olympe.D.Jb('listDef toObservable');return new rxjs.Observable(c=>{b.run(()=>{olympe.D.pc([a],d=>{c.next(d.valueOf())})});b.onDestroy(()=>{c.complete()});return()=>b.destroy()})}
|
|
744
|
-
olympe.dc.ua=class{constructor(a,b,c){void 0===a||null===a?olympe.la.fb('dc').warn('attempt to create a listdef with a null or undefind basetag. This listdef is thus without effect.'):(this.F=olympe.D.sa([a],olympe.dc.
|
|
744
|
+
olympe.dc.ua=class{constructor(a,b,c){void 0===a||null===a?olympe.la.fb('dc').warn('attempt to create a listdef with a null or undefind basetag. This listdef is thus without effect.'):(this.F=olympe.D.sa([a],olympe.dc.fa,String),this.ba=void 0!==b&&(Array.isArray(b)?b:[b])||[],this.valueType=c||Fj(this),this.C=null)}ge(){return olympe.dc.ge()}lb(){if(null===this.C){const a=olympe.dc.ic.$u();this.C=Jj(a,this);null!==this.valueType&&this.C.md(this.valueType);olympe.D.Ma().$(()=>{var b=this.C.W();a.K.debug('QueryMGR: [ID:',
|
|
745
745
|
b,'] - Unregistered');const c=a.C.get(b);if(null==c)var d=0;else 0<c.counter&&c.counter--,d=0===c.counter;d&&(c.C.release(),a.C.delete(b));this.C=null})}return this}Vb(){null===this.C&&this.lb();return this.C}md(a){this.valueType=a;null!==this.C&&this.C.md(this.valueType)}Hb(){return null!==this.C?this.C.Hb():null===this.valueType?olympe.dc.CloudObject:this.valueType}Bd(){return this.F}Vk(){return this.ba}bd(a,b){return this.Vb().bd(a,b)}Yj(a){this.Vb().Yj(a)}bs(){return this.Vb().qd()}$r(){return this.Vb().T()}get(a){return this.Vb().get(a)}nh(){return this.Vb().nh()}lh(a){const b=
|
|
746
746
|
this.Vb();Gj(b,'getCurrent');return b.lh(a)}has(a){return this.Vb().has(a)}vg(a){const b=this.Vb();Gj(b,'hasCurrent');return b.vg(a)}Qd(a){return this.Vb().Qd(a)}Zv(a){return Ij(this.Qd(a))}Fe(a){const b=this.Vb();Gj(b,'getCurrentAt');return b.Fe(a)}He(a){return this.Vb().He(a)}ff(a){const b=this.Vb();Gj(b,'getCurrentKeyAt');return b.ff(a)}Ed(a){return this.Vb().Ed(a)}dw(a){return Ij(this.Ed(a))}gf(a){const b=this.Vb();Gj(b,'getCurrentRank');return b.gf(a)}xc(){return this.Vb().xc()}$v(){return Ij(this.xc())}hf(){return this.Vb().hf()}Te(){return this.Vb().Te()}ew(){return Ij(this.Te())}Nf(){const a=
|
|
747
747
|
this.Vb();Gj(a,'getCurrentSize');return a.Nf()}forEach(a,b){this.Vb().forEach(a,b)}Pd(a){const b=this.Vb();Gj(b,'forEachCurrentValue');return b.Pd(a)}ii(a,b,c,d){a=new olympe.dc.ba.Mg(a,b);(new olympe.dc.ua(this.F,[...this.ba,a],this.valueType)).forEach(c,d)}transform(...a){var b=a;if(Array.isArray(a[0])){if(1<a.length)throw Error('ListDef.transform() should be called either with one array argument, or with ... arguments, but not both');b=a[0]}a=[...this.ba];for(const c of b){if(void 0===c)throw Error('ListDef.transform(): Trying to set an undefined transformer');
|
|
@@ -759,9 +759,9 @@ a=new olympe.dc.Y.kd(b,a);b=this.ab.pop();break;case Kj.In:b=this.ba.pop().F,b i
|
|
|
759
759
|
const c=[],d=[];a.forEach(e=>{c.push(e);d.push(e.Pa())});return this.Be(new olympe.dc.Y.Kh(c,d,b))}Tj(a,b,c){a=Lj(a,c);return this.Be(new olympe.dc.Y.Ti(a,new olympe.dc.Ua.me(b)))}Ci(a,b,c){a=Lj(a,c);return this.Be(new olympe.dc.Y.wj(a,new olympe.dc.Ua.me(b)))}Rv(a,b,c,d){a=Lj(a,d);return this.Be(new olympe.dc.Y.Ze(a,b,c))}filter(a){const b=new class extends olympe.dc.Y.Rf{C(c,d){return a(olympe.dc.CloudObject.get(d))}};return this.Be(b)}Sc(){this.ab.push(Kj.Fk);return this}and(){this.ba[this.ba.length-
|
|
760
760
|
1]instanceof olympe.dc.ba.Qe&&this.ab.push(Kj.Hn);return this}or(){this.ba[this.ba.length-1]instanceof olympe.dc.ba.Qe&&this.ab.push(Kj.In);return this}bk(a,b,c){a=Mj(a);let d=null;switch(olympe.dc.ta().Tb(a,olympe.dm.Property.typeRel)){case olympe.dm.String.N.X():d=new olympe.dc.bc.String(new olympe.dc.Ua.Zh(a,c));break;case olympe.dm.Number.N.X():d=new olympe.dc.bc.Number(new olympe.dc.Ua.Sh(a,c));break;case olympe.dm.DateTime.N.X():d=new olympe.dc.bc.DateTime(new olympe.dc.Ua.Fh(a,c))}c=d;null!==
|
|
761
761
|
c&&this.ba.push(new olympe.dc.ba.gg(c,b));return this}sort(a,b,c){const d=new class extends olympe.dc.bc.Rf{L(e,f){return a(olympe.dc.CloudObject.get(f))}G(e,f){return b(e,f).valueOf()}};this.ba.push(new olympe.dc.ba.gg(d,c));return this}iu(){this.ba.push(new olympe.dc.ba.Gh);return this}om(a,b){this.ba.push(new olympe.dc.ba.Mg(a,b));return this}};class Nj extends Error{constructor(a,b){super(`ListDefBuilder.${a}(): ${b}`)}}
|
|
762
|
-
function Mj(a){return'string'===typeof a||a instanceof olympe.D.Ka?a:'function'===typeof a?olympe.dc.ka.nc(a):olympe.D.Ya(a)?a.Ej===olympe.D.Ka?a:olympe.D.sa([a],b=>olympe.D.sb(olympe.dc.
|
|
762
|
+
function Mj(a){return'string'===typeof a||a instanceof olympe.D.Ka?a:'function'===typeof a?olympe.dc.ka.nc(a):olympe.D.Ya(a)?a.Ej===olympe.D.Ka?a:olympe.D.sa([a],b=>olympe.D.sb(olympe.dc.fa(b)),olympe.D.Ka):a.X()}l=olympe.dc.$i.prototype;l.Ve.J=new olympe.D.H(()=>olympe.dc.ua,[]);l.transform.J=olympe.D.H.L();l.ck.J=olympe.D.H.L();l.Fw.J=olympe.D.H.L();l.ds.J=olympe.D.H.L();l.eb.J=olympe.D.H.L();l.su.J=olympe.D.H.L();l.ru.J=olympe.D.H.L();l.qu.J=olympe.D.H.L();l.cs.J=olympe.D.H.L();l.Be.J=olympe.D.H.L();
|
|
763
763
|
l.mu.J=olympe.D.H.L();l.contains.J=olympe.D.H.L();l.$c.J=olympe.D.H.L();l.Uj.J=olympe.D.H.L();l.nu.J=olympe.D.H.L();l.oi.J=olympe.D.H.L();l.Tj.J=olympe.D.H.L();l.Ci.J=olympe.D.H.L();l.Rv.J=olympe.D.H.L();l.filter.J=olympe.D.H.L();l.Sc.J=olympe.D.H.L();l.and.J=olympe.D.H.L();l.or.J=olympe.D.H.L();l.bk.J=olympe.D.H.L();l.sort.J=olympe.D.H.L();l.iu.J=olympe.D.H.L();l.om.J=olympe.D.H.L();function Jj(a,b){const c=b.Bd();var d=new olympe.dc.query.Vs;let e;e=c;olympe.D.Ya(e)&&(e=d.add(c));b=(b=b.Vk())?Array.isArray(b)?b:[b]:null;d=olympe.dc.ic.Subscription.G(e,b,d);let f,g,h=null!=(g=null==(f=a.C.get(d))?void 0:f.C)?g:null;null===h&&(a.K.debug('QueryMGR: new',a.F?'local':'remote','subscription "',d,'": #',`${e},`,b),h=new olympe.dc.ic.Subscription(d,c,b,a.G));h.getContext().run(()=>a.process(h));return h}
|
|
764
|
-
function Oj(a,b){if(b.T())a.K.debug('ListProcessor: [ID:',b.W(),'] - Subscription already booted, ignoring');else{a.K.debug('ListProcessor: [ID:',b.W(),'] - Booting subscription');var c=new olympe.dc.Ub.Fp(a.db,a.K),d=b.W();olympe.D.pc([b.Bd()],e=>{const f=olympe.dc.
|
|
764
|
+
function Oj(a,b){if(b.T())a.K.debug('ListProcessor: [ID:',b.W(),'] - Subscription already booted, ignoring');else{a.K.debug('ListProcessor: [ID:',b.W(),'] - Booting subscription');var c=new olympe.dc.Ub.Fp(a.db,a.K),d=b.W();olympe.D.pc([b.Bd()],e=>{const f=olympe.dc.fa(e);a.K.debug('ListProcessor: [ID:',b.W(),'] - Booting with baseTag',f);b.ji()||b.pi();oe(a.db,f,Pj(a,b,c),d);olympe.D.Ma().$(()=>ne(a.db,f,d));a.db.Ia(f.valueOf())||Qj(c);b.T()||(Qj(c),b.uc([]))})}}
|
|
765
765
|
function Rj(a,b,c,d){const e=[b.Bd()],f=k=>k instanceof olympe.dc.ba.af;let g;const h=(null!=(g=b.tg())?g:[]).filter(f);for(const k of h){e.push(k.Bd());let m;h.push(...(null!=(m=k.tg())?m:[]).filter(f))}Dj(a.P,()=>{olympe.D.pc(e,()=>{const k=b.ye(c);Sj(a,k,b.W(),d)})})}
|
|
766
766
|
function Sj(a,b,c,d){a.K.debug('CoverageProcessor: [ID:',c,'] - checking coverage of remote query over',b.length,'paths.');const e=olympe.D.Ma(),f=new olympe.async.ij(e);b.forEach(g=>{f.add((h,k)=>{let m=!1;Sg(a.L,g,e,olympe.dc.Ra.SELF,olympe.dc.ra.tc.Tf).subscribe(rxjs.Subscriber.create(()=>{m||(m=!0,e.run(h))},n=>e.run(()=>k(`The query ${c} is not covered by an existing graphdef, `+`and the specific graphdef id ${g.W()} has encountered an error: ${n}`))))})});qc(f,(g,h)=>d(h));f.start()}
|
|
767
767
|
function Pj(a,b,c){const d=new olympe.dc.Ub.Ii;let e=!1;const f=olympe.D.Ma(),g=b.tg(),h=[];h[g?g.length:0]=(k,m,n,p)=>{f.Bc()||f.gb()||(k?b.vg(n)?a.K.warn('Adding the same index twice (should never happen) for sub #',b.W(),', index #',n,', tag #',m):(a.K.debug('ListProcessor: [ID:',b.W(),'] - Adding Instance',m,'to the subscription'),b.zd(n,m)):(a.K.debug('ListProcessor: [ID:',b.W(),'] - Removing Instance',m,'from the subscription'),b.ni(n)),e||(Tj(c,()=>{p.Hf();Qj(c)}),f.run(()=>p.ge().Qf(b.uc.bind(b))),
|
|
@@ -778,24 +778,24 @@ olympe.dc.Y.hk.va=[olympe.dc.Ca];olympe.dc.Y.kd=class{constructor(a){this.Y=[];f
|
|
|
778
778
|
a.toString()).join(',')+')'}};S('olympe.dc.predicates.And',olympe.dc.Y.kd);olympe.dc.Y.kd.va=[olympe.dc.Ca];olympe.dc.Y.rk=class{constructor(a,b){this.G=a;this.value=b}C(a,b){return a.run(()=>olympe.D.sa([this.G,this.value.getValue(a,b)],(c,d)=>{c=c.valueOf();return olympe.D.Ib((Number(c)&Number(d.valueOf()))===Number(c))},olympe.D.ea))}ia(){return T(olympe.dc.Y.rk)}F(){return[this.value.C()]}ha(a){const b=olympe.D.Ya(this.G)?this.G.Aa.xb.valueOf():this.G.valueOf();return'{"c":"'+this.ia()+'","a":['+b+','+this.value.ha(a)+']}'}toString(){const a=olympe.D.Ya(this.G)?this.G.Aa.xb.valueOf():this.G.valueOf();
|
|
779
779
|
return this.ia().replace(/^.+\./,'')+'('+a.toString()+','+this.value.toString()+')'}};S('olympe.dc.predicates.BitMask',olympe.dc.Y.rk);olympe.dc.Y.rk.va=[olympe.dc.Ca];olympe.dc.Y.Ne=class{constructor(a,b,c){this.source=a;this.value=b;this.G=c?c:!1}ia(){return T(olympe.dc.Y.Ne)}F(){return[this.source.C(),this.value.C()]}zb(){return this.source}getValue(){return this.value}C(a,b){return a.run(()=>olympe.D.sa([this.source.getValue(a,b),this.value.getValue(a,b),this.G],(c,d,e)=>{c=String(c);d=String(d);e.valueOf()||(c=c.toLowerCase(),d=d.toLowerCase());return olympe.D.Ib(c.includes(d))},olympe.D.ea))}ha(a){const b=this.source.ha(a),c=this.value.ha(a);a=Yj(a,this.G);
|
|
780
780
|
return'{"c":"'+this.ia()+'","a":['+b+','+c+','+a+']}'}toString(){const a=Xj(this.G);return'Contains('+this.source.toString()+','+this.value.toString()+','+a+')'}};S('olympe.dc.predicates.Contains',olympe.dc.Y.Ne);olympe.dc.Y.Ne.va=[olympe.dc.Ca];olympe.dc.Y.Zd=class{constructor(a,b){this.G=a;this.L=b}ia(){return T(olympe.dc.Y.Zd)}F(){return[this.G.C(),this.L.C()]}C(a,b){return a.run(()=>olympe.D.sa([this.G.getValue(a,b),this.L.getValue(a,b)],(c,d)=>'object'===typeof c&&void 0!==c.ad?c.ad(d):'object'===typeof d&&void 0!==d.ad?d.ad(c):olympe.D.Ib(c.valueOf()===d.valueOf()),olympe.D.ea,'Test equal predicate'))}ha(a){return'{"c":"'+this.ia()+'","a":['+this.G.ha(a)+','+this.L.ha(a)+']}'}toString(){return'Equals('+this.G.toString()+','+this.L.toString()+
|
|
781
|
-
')'}};S('olympe.dc.predicates.Equals',olympe.dc.Y.Zd);olympe.dc.Y.Zd.va=[olympe.dc.Ca];olympe.dc.Y.ur=class extends olympe.dc.Y.Zd{constructor(a,b){super(a,new olympe.dc.Ua.me(b))}};olympe.dc.Y.ur.va=[olympe.dc.Ca];olympe.dc.Y.Ti=class extends olympe.dc.Y.hk{constructor(a,b){super(a,b)}ia(){return T(olympe.dc.Y.Ti)}P(a,b){return a>b}};S('olympe.dc.predicates.Greater',olympe.dc.Y.Ti);olympe.dc.Y.Kh=class{constructor(a,b,c){this.G=[];this.L=c instanceof Array?c:void 0!==c?[olympe.dc.
|
|
781
|
+
')'}};S('olympe.dc.predicates.Equals',olympe.dc.Y.Zd);olympe.dc.Y.Zd.va=[olympe.dc.Ca];olympe.dc.Y.ur=class extends olympe.dc.Y.Zd{constructor(a,b){super(a,new olympe.dc.Ua.me(b))}};olympe.dc.Y.ur.va=[olympe.dc.Ca];olympe.dc.Y.Ti=class extends olympe.dc.Y.hk{constructor(a,b){super(a,b)}ia(){return T(olympe.dc.Y.Ti)}P(a,b){return a>b}};S('olympe.dc.predicates.Greater',olympe.dc.Y.Ti);olympe.dc.Y.Kh=class{constructor(a,b,c){this.G=[];this.L=c instanceof Array?c:void 0!==c?[olympe.dc.fa(c)]:[];a=Array.isArray(a)?a:[a];for(let d=0,e=a.length;d<e;d++)c=a[d],c instanceof olympe.dc.ba.de?this.G.push(new bk(c.X(),c.Pa(),c.G,c.F)):this.G.push(new bk(olympe.dc.fa(c),b[d],1,1))}ia(){return T(olympe.dc.Y.Kh)}F(){return[this.G.reduce((a,b)=>a.concat(b),[])]}C(a,b){const c=a.run(()=>ub(olympe.D.ec(Boolean),!1)),d=olympe.Z.hc(),e=olympe.dc.ta();let f=0;a=(h,k)=>{0!==this.L.length&&!this.L.includes(k)||
|
|
782
782
|
c.getContext().gb()||c.getContext().Bc()||(f+=h?1:-1,c.update(0<f))};const g=this.G;for(let h=g.length-1;0<=h;h--)a=ck(g[h],e,a,d+h);oe(e,b,a,d);c.getContext().onDestroy(()=>{ne(e,b,d)});return c.vb()}ha(){return'{"c":"'+this.ia()+'","a":['+JSON.stringify(this.G.map(a=>a.ha()))+(0!==this.L.length?',"'+this.L.toString():'')+'"]}'}toString(){return'HasRelated('+(0!==this.L.length?'#'+this.L.toString()+', ':'')+this.G.map(a=>a.ha())+')'}};S('olympe.dc.predicates.HasRelated',olympe.dc.Y.Kh);
|
|
783
|
-
function ck(a,b,c,d){const e=Object.create(null);d+=olympe.Z.jh();const f=(g,h,k)=>{k>=a.F&&c(g,h);if(!(0<=a.C&&k>=a.C)){var m=d+k;g?e[h]||(e[h]=!0,W(b,h,a,(n,p)=>{f(n,p,k+1)},m)):(delete e[h],b.F(h,a,m))}};return(g,h)=>f(g,h,0)}class bk extends olympe.dc.query.Relation{constructor(a,b,c,d){super(a,b,1!==c||1!==d);this.F=c;this.C=d}ha(){return`${this.X()}, ${this.Pa()}, ${this.F}, ${this.C}`}}olympe.dc.Y.Kh.va=[olympe.dc.Ca];olympe.dc.Y.Qk=class{constructor(a,b,c){this.G=[];this.L=void 0!==c?c.map(olympe.dc.
|
|
783
|
+
function ck(a,b,c,d){const e=Object.create(null);d+=olympe.Z.jh();const f=(g,h,k)=>{k>=a.F&&c(g,h);if(!(0<=a.C&&k>=a.C)){var m=d+k;g?e[h]||(e[h]=!0,W(b,h,a,(n,p)=>{f(n,p,k+1)},m)):(delete e[h],b.F(h,a,m))}};return(g,h)=>f(g,h,0)}class bk extends olympe.dc.query.Relation{constructor(a,b,c,d){super(a,b,1!==c||1!==d);this.F=c;this.C=d}ha(){return`${this.X()}, ${this.Pa()}, ${this.F}, ${this.C}`}}olympe.dc.Y.Kh.va=[olympe.dc.Ca];olympe.dc.Y.Qk=class{constructor(a,b,c){this.G=[];this.L=void 0!==c?c.map(olympe.dc.fa):null;a=Array.isArray(a)?a:[a];for(let d=0,e=a.length;d<e;d++)c=a[d],c instanceof olympe.dc.ba.de?this.G.push(new dk(c.X(),c.Pa(),c.G,c.F)):this.G.push(new dk(olympe.dc.fa(c),b[d],1,1))}ia(){return T(olympe.dc.Y.Qk)}F(){return[this.G.reduce((a,b)=>a.concat(b),[])]}C(a,b){const c=a.run(()=>ub(olympe.D.ec(Boolean),!1)),d=olympe.dc.ta(),e=olympe.Z.jh();let f=(k,m,n)=>{m&&(null===this.L||this.L.includes(n))&&k(1)};
|
|
784
784
|
const g=this.G;for(let k=g.length-1;0<=k;k--)f=ek(g[k],d,f,e+k);let h=0;oe(d,b,f.bind(null,k=>{c.getContext().Bc()||c.getContext().gb()||(h+=k,c.update(0<h))}),e);a.onDestroy(()=>ne(d,b,e));return c.vb()}ha(){return'{"c":"'+this.ia()+'","a":['+JSON.stringify(this.G.map(a=>a.ha()))+(null!==this.L?',"'+this.L.toString():'')+'"]}'}toString(){return'HasRelatedTree('+(null!==this.L?'#['+this.L.toString()+'], ':'')+this.G.map(a=>a.ha())+')'}};S('olympe.dc.predicates.HasRelatedTree',olympe.dc.Y.Qk);
|
|
785
785
|
function ek(a,b,c,d){const e=a.G,f=a.P,g=new Set,h=(m,n,p)=>{f.has(n)?f.get(n).set(d+p,m):f.set(n,(new Map).set(d+p,m))},k=(m,n,p,q,r)=>{const t=olympe.Z.jh();if(q){const u=p+r,w=x=>{const y=f.get(r);if(g.has(u))throw Error(`Try to use the predicate HasRelatedTree with recursion in a graph cluster containing a loop around instances ${p} and ${r}`);void 0!==y&&null!==y&&(g.add(u),e.set(r,(e.get(r)||0)+x),Array.from(y.values()).forEach(z=>z(x)));g.delete(u)};h(m,r,p);e.has(r)?m(e.get(r)):(n>=a.F&&c(x=>
|
|
786
|
-
{e.set(r,(e.get(r)||0)+x);m(x)},q,r),(0>a.C||n<=a.C)&&r!==p&&W(b,r,a,k.bind(a,w,n+1,r),t))}else m(-e.get(r)),f.get(r).delete(d+p),0===f.get(r).size&&(e.delete(r),f.delete(r),b.F(r,a,t))};return(m,n,p)=>k(m,0,'origin',n,p)}class dk extends olympe.dc.query.Relation{constructor(a,b,c,d){super(a,b,1!==c||1!==d);this.F=c;this.C=d;this.P=new Map;this.G=new Map}ha(){return`${this.X()}, ${this.Pa()}, ${this.F}, ${this.C}`}}olympe.dc.Y.Qk.va=[olympe.dc.Ca];olympe.dc.Y.Oh=class{constructor(a){this.G=new Set;a instanceof Array?a.forEach(b=>{this.G.add(olympe.dc.
|
|
786
|
+
{e.set(r,(e.get(r)||0)+x);m(x)},q,r),(0>a.C||n<=a.C)&&r!==p&&W(b,r,a,k.bind(a,w,n+1,r),t))}else m(-e.get(r)),f.get(r).delete(d+p),0===f.get(r).size&&(e.delete(r),f.delete(r),b.F(r,a,t))};return(m,n,p)=>k(m,0,'origin',n,p)}class dk extends olympe.dc.query.Relation{constructor(a,b,c,d){super(a,b,1!==c||1!==d);this.F=c;this.C=d;this.P=new Map;this.G=new Map}ha(){return`${this.X()}, ${this.Pa()}, ${this.F}, ${this.C}`}}olympe.dc.Y.Qk.va=[olympe.dc.Ca];olympe.dc.Y.Oh=class{constructor(a){this.G=new Set;a instanceof Array?a.forEach(b=>{this.G.add(olympe.dc.fa(b))}):this.G.add(olympe.dc.fa(a))}ia(){return T(olympe.dc.Y.Oh)}F(){return[]}C(a,b){const c=a.run(()=>ub(olympe.D.ec(olympe.D.ea),olympe.D.ea.C)),d=olympe.dc.ta();let e=[];const f=()=>{e.forEach(h=>{d.F(h.tag,h.relation,h.id)});e=[]},g=(h,k)=>{if(h)if(k===olympe.dc.fa(olympe.dc.CloudObject))c.update(olympe.D.Ib(this.G.has(k))),f();else{for(const m of e)if(m.tag===k)throw Error(`You should never extend a model to itself (${k})`);
|
|
787
787
|
this.G.has(k)?(c.update(olympe.D.ea.F),f()):(h=new fk(k,olympe.dc.CloudObject.extendRel),e.push(h),W(d,h.tag,h.relation,g,h.id))}};a=new fk(b,olympe.dc.CloudObject.modelRel);e.push(a);W(d,a.tag,a.relation,g,a.id);c.getContext().onDestroy(f);return c.vb()}ha(){return'{"c":"'+this.ia()+'","a":['+JSON.stringify(Array.from(this.G))+']}'}toString(){return'InstanceOf('+Array.from(this.G).join(', ')+')'}};class fk{constructor(a,b){this.tag=a;this.relation=b;this.id=olympe.Z.jh()}}
|
|
788
788
|
S('olympe.dc.predicates.InstanceOf',olympe.dc.Y.Oh);olympe.dc.Y.Oh.va=[olympe.dc.Ca];olympe.dc.Y.Ld=class{constructor(a){this.G=a}ia(){return T(olympe.dc.Y.Ld)}F(){return this.G.F()}C(a,b){return a.run(()=>olympe.D.sa([this.G.C(a,b)],c=>olympe.D.Ib(!c.valueOf()),olympe.D.ea))}ha(a){return`{"c":"${this.ia()}","a":[${this.G.ha(a)}]}`}toString(){return'Not('+this.G.toString()+')'}};S('olympe.dc.predicates.Not',olympe.dc.Y.Ld);olympe.dc.Y.Ld.va=[olympe.dc.Ca];olympe.dc.Y.ce=class{constructor(a){this.Y=[];for(let b=arguments.length,c=0;c<b;c++)Array.isArray(arguments[c])?this.Y=this.Y.concat(arguments[c]):this.Y.push(arguments[c])}ia(){return T(olympe.dc.Y.ce)}F(){return this.Y.reduce((a,b)=>a.concat(b.F()),[])}C(a,b){return a.run(()=>olympe.D.sa(this.Y.map(c=>c.C(a,b)),(...c)=>olympe.D.Ib(c.some(d=>d.valueOf())),olympe.D.ea))}ha(a){const b=this.Y.map(c=>c.ha(a));return'{"c":"'+this.ia()+'","a":['+b.join(',')+']}'}toString(){return'Or('+this.Y.map(a=>a.toString()).join(',')+
|
|
789
789
|
')'}};S('olympe.dc.predicates.Or',olympe.dc.Y.ce);olympe.dc.Y.ce.va=[olympe.dc.Ca];olympe.dc.Y.Ze=class{constructor(a,b,c){this.source=a;this.L=b;this.G=void 0===c?!0:c}ia(){return T(olympe.dc.Y.Ze)}F(){return[this.source.C()]}zb(){return this.source}C(a,b){return a.run(()=>olympe.D.sa([this.source.getValue(a,b),this.L,this.G],(c,d,e)=>{c=String(c);d=String(d);e.valueOf()||(c=c.toLowerCase(),d=d.toLowerCase());return olympe.D.Ib((new RegExp(d)).test(c))},olympe.D.ea))}ha(a){const b=this.source.ha(a),c=Yj(a,this.L);a=Yj(a,this.G);return'{"c":"'+this.ia()+'","a":['+b+','+c+','+a+
|
|
790
790
|
']}'}toString(){const a=Xj(this.G);return'Regex('+this.source.toString()+','+this.L+','+a+')'}};S('olympe.dc.predicates.Regex',olympe.dc.Y.Ze);olympe.dc.Y.Ze.va=[olympe.dc.Ca];olympe.dc.Y.wj=class extends olympe.dc.Y.hk{constructor(a,b){super(a,b)}ia(){return T(olympe.dc.Y.wj)}P(a,b){return a<b}};S('olympe.dc.predicates.Smaller',olympe.dc.Y.wj);olympe.dc.Ub={};olympe.dc.Ub.Ii=class{constructor(){this.T=this.L=this.index=this.F=null}P(){return null!==this.F}$(a){if(null!==this.F)throw Error('Manager already activated (depth='+this.F+')');this.F=a;this.G()}C(a,b,c){b=this.L;if(a&&null!==b)throw Error('The AutoManger handles only a single item.');a?(b=new olympe.dc.Ub.Pi(this),this.index=c,this.L=b):this.L=this.index=null;return b}G(){if(null===this.F)throw Error('Manager not activated, need to set a depth before updating ranks');if(null!==this.T){const a=
|
|
791
791
|
[];null!==this.L&&(0<=this.F?gk(hk(this.L,this.F),a):a.push(this.index));this.T(a)}}Qf(a){this.T=a}};olympe.dc.Ub.Ii.va=[olympe.dc.Ub.Ba];function Vj(a,b,c,d){b?a.P[d]=c:delete a.P[d];null===a.F&&(a.F=new olympe.dc.Ub.Pi(a.C,a));return a.F}function hk(a,b){for(let c=0;c<b;c++)if(null!==a.F)a=a.F;else break;return a}function gk(a,b){a=a.P;if(null!==a)for(let c in a)Object.prototype.hasOwnProperty.call(a,c)&&b.push(c)}olympe.dc.Ub.Pi=class{constructor(a,b){this.C=a;this.depth=b?b.depth+1:0;this.P=Object.create(null);this.F=null}ge(){return this.C}Hf(){this.C.P()?this.C.G():this.C.$(this.depth-1)}};class ik extends olympe.dc.Ub.Pi{constructor(a,b,c){super(a);this.index=b;this.tag=c;this.$=this.T=this.L=!1;this.G=null}}
|
|
792
|
-
function jk(a,b,c,d,e){const f=Object.create(null),g=a.na,h=a.L;let k,m,n;a.
|
|
793
|
-
olympe.dc.Ub.$k=class{constructor(){this.L={};this.na=[];this.F=null;this.
|
|
792
|
+
function jk(a,b,c,d,e){const f=Object.create(null),g=a.na,h=a.L;let k,m,n;a.ga=!0;m=0;for(n=g.length;m<n;m++)f[g[m]]=null;g.length=0;m=c;for(n=Math.min(b.length,d);m<n;m++)k=b[m],c=h[k],void 0!==c&&(delete f[k],g.push(k),c.L||(c.L=!0,e(!0,c.tag,c.index,c)));for(k in f)Object.prototype.hasOwnProperty.call(f,k)&&(c=h[k],c.L&&(c.L=!1,e(!1,c.tag,c.index,c)),c.T&&(c.G=null,delete h[k]),delete f[k]);a.ga=!1;null!==a.F&&a.G()}
|
|
793
|
+
olympe.dc.Ub.$k=class{constructor(){this.L={};this.na=[];this.F=null;this.ga=!1;this.T=[];this.da=null}P(){return null!==this.F}$(a){if(null!==this.F)throw Error('Manager already activated (depth='+this.F+')');this.F=a;this.G()}G(){if(null===this.F)throw Error('Manager not activated, need to set a depth before updating ranks');if(!this.ga){var a=this.na,b=a.length,c=this.L,d;for(d=this.T.length=0;d<b;d++){var e=c[a[d]];if(0>this.F)this.T.push(e.index);else{if(!e.$){var f=e,g=this.F;f.$=!0;f.G=hk(f,
|
|
794
794
|
g)}null!==e.G&&gk(e.G,this.T)}}this.da&&this.da(this.T)}}Qf(a){this.da=a}C(a,b,c){let d=this.L[c];a?void 0===d?(d=new ik(this,c,b),this.L[c]=d):(d.tag=b,d.T=!1):void 0!==d&&(d.T=!0);return d}};olympe.dc.Ub.$k.va=[olympe.dc.Ub.Ba];olympe.dc.Ub.Ba=class{constructor(){}C(){}P(){}$(){}G(){}Qf(){}};function kk(a,b){olympe.D.nf(a.value)?(a.node=olympe.D.sm(a.value,b),bb(a.node)||b()):b()}function lk(a,b){if(olympe.D.nf(a.value)){const c=olympe.D.Ma(),d=a.L;olympe.D.pc([a.value],e=>{d!==e.valueOf()&&(c.run(()=>kk(a,b)),olympe.D.Ma().destroy())})}}
|
|
795
795
|
class mk extends olympe.dc.Ub.Pi{constructor(a,b,c){super(a);this.index=b;this.value=c;this.L=this.Ta();this.position=this.node=null;this.T=!1;this.G=null}Ta(){const a=olympe.D.Ta(this.value);return a?a.valueOf():a}destroy(){this.node&&(this.node.destroy(),this.node=null);this.G=this.value=null}gb(){return null===this.value}}
|
|
796
796
|
function nk(a,b){if(!b.gb()){var c=a.F;var d=a.na,e=b.Ta(),f=0;let g=c.length,h=0,k;for(null!==b.position&&--g;g>f;){h=Math.floor((f+g)/2);k=d(c[h].L,e);if(0===k||2>g-f){0>k&&null!==b.position&&b.position<=h&&(k=d(c[g].L,e));h=0>k?g:h;break}0>k?f=h:g=h}c=h;b.L=b.Ta();if(c!==b.position){d=a.F;e=d.length;f=b.position;null===f&&(f=e);if(c<f)for(e=f;e>c;e--)d[e]=d[e-1],d[e].position=e;else for(e=f;e<c;e++)d[e]=d[e+1],d[e].position=e;d[c]=b;d[c].position=c;b.T&&a.G()}}}
|
|
797
797
|
function ok(a){const b=a.na;a.F.sort((c,d)=>b(c.Ta(),d.Ta()))}
|
|
798
|
-
olympe.dc.Ub.Ep=class{constructor(a){this.na=a;this.L=null;this.F=[];this.T=[];this.da=null;this.
|
|
798
|
+
olympe.dc.Ub.Ep=class{constructor(a){this.na=a;this.L=null;this.F=[];this.T=[];this.da=null;this.ga=new Map}C(a,b,c,d){b='$'+c;const e=this.F;let f;if(a)f=new mk(this,c,d),this.ga.set(b,f),this.P()?kk(f,()=>nk(this,f)):(f.position=e.length,e.push(f));else{f=this.ga.get(b);if(void 0===f)throw Error('Trying to remove an non-registered item: "'+c+'"');this.ga.delete(b);null!==f.position&&(this.P()?this.remove(f):delete e[f.position]);f.destroy()}return f}P(){return null!==this.L}$(a){if(null!==this.L)throw Error('Manager already activated (depth='+
|
|
799
799
|
this.L+')');this.L=a;ok(this);for(let b=0,c=this.F.length;b<c;b++){const d=this.F[b];d.position=b;lk(d,()=>nk(this,d))}this.G()}G(){if(null===this.L)throw Error('Manager not activated, need to set a depth before updating ranks');const a=this.F.length;this.T.length=0;for(let d=0;d<a;d++){let e=this.F[d];if(!e.T){var b=e,c=this.L;b.T=!0;b.G=hk(b,c)}0>this.L?this.T.push(e.index):e.G&&gk(e.G,this.T)}this.da&&this.da(this.T)}Qf(a){this.da=a}remove(a){const b=this.F,c=b.length-1;if(null!==a.position){for(a=
|
|
800
800
|
a.position;a<c;a++)b[a]=b[a+1],b[a].position=a;b.length=c}}};olympe.dc.Ub.Ep.va=[olympe.dc.Ub.Ba];function Qj(a){if(!a.F){for(let b in a.G)pk(a.G[b]);a.F=!0}a.L=null;a.P=null}function Tj(a,b,c){a.G[c||'root'].T=b}function Uj(a,b,c){a.G[c||'root'].Hf(b)}function qk(a,b,c,d){const e=a.P,f=b+d+c;let g=e[f];void 0===g&&(g=Qf(a.db,b,c,d),e[f]=g);return g}function rk(a,b){a.F||a.C.Hf(b)}function sk(a,b,c,d,e){if(!a.F){let f=qk(a,c,d,e||olympe.dc.wa.DESTINATION);e||(f+=qk(a,c,d,olympe.dc.wa.ORIGIN));0===f&&rk(a,b)}}
|
|
801
801
|
function tk(a,b){const c=a.G[b];void 0!==c?(a.K&&a.K.debug('Set current block to',b,null!==c.G?'parent = '+c.G.W():''),a.C=c):a.K&&a.K.error('Try to set a block that does not exists:',b)}function uk(a){const b=String(++a.T),c=a.C;a.G[b]=new vk(b,c);wk(c,b);c.L||(c.L=()=>tk(a,c.W()));return b}function xk(a,b){const c=a.C;a.C.L=()=>{tk(a,c.W());b()}}function yk(a,b){pk(b?a.G[b]:a.C)}
|
|
@@ -805,7 +805,7 @@ function Ak(a,b,c){const d=c.getContext(),e=olympe.dc.ta(),f=a.G(),g=Bf(e,b,a.L,
|
|
|
805
805
|
olympe.dc.Ua.yh=class{constructor(a,b,c){this.L=a&&a.X?a.X():a;this.ba=b&&b.filter(d=>d instanceof olympe.dc.ba.se||d instanceof olympe.dc.ba.de)||null;this.F=c||null;this.defaultValue=null}ia(){}Hb(){}G(){}C(){return(this.ba||[]).reduce((a,b)=>a.concat(olympe.dc.query.Relation.from(b)),[])}zg(a){this.defaultValue=a;return this}tg(){return this.ba}Bd(){return this.F}getValue(a,b){const c=a.run(()=>olympe.D.ec(this.Hb()||Object,'AbstractProperty valueType'));null!==this.defaultValue&&ub(c,this.defaultValue);
|
|
806
806
|
b=this.F||b;null!==this.ba?zk(a,b,this.ba,d=>{Ak(this,d,c)}):Ak(this,b,c);return c.vb()}ha(a){const b=Yj(a,this.L),c=Yj(a,this.F);let d='null';this.ba&&(d=this.ba.map(function(e){return e.ha(a)}).join(','));return`{"c":"${this.ia()}","a":["${b}",${d},${c}]}`}toString(){const a=Xj(this.L),b=this.F?','+Xj(this.F):'';let c='';this.ba&&(c=','+this.ba.join(','));return this.ia().replace(/^.+\./,'')+'('+a+c+b+')'}};olympe.dc.Ua.yh.va=[olympe.dc.Cj];olympe.dc.Ua.Km=class{constructor(a,b){if(olympe.D.nf(a))throw Error('Dataflows of Property not supported by AnyProperty');const c=a.X();var d=olympe.dc.ta();const e=d.Tb(a,olympe.dm.Property.typeRel);if(!e)throw Error('Type of property '+a+'unavailable locally, cannot proceed with AnyProperty');a=d.qg(e,olympe.dc.CloudObject.extendRel,olympe.dm.re);d=null;switch(1<a.length?a[a.length-2]:e){case olympe.dm.String.N.X():d=new olympe.dc.Ua.Zh(c,b);break;case olympe.dm.Number.N.X():d=new olympe.dc.Ua.Sh(c,
|
|
807
807
|
b);break;case olympe.dm.Boolean.N.X():d=new olympe.dc.Ua.Ji(c,b);break;case olympe.dm.DateTime.N.X():d=new olympe.dc.Ua.Fh(c,b)}this.F=d}ia(){return this.F.ia()}C(){return this.F.C()}getValue(a,b){return this.F.getValue(a,b)}ha(a){return this.F.ha(a)}toString(){return this.F.toString()}};olympe.dc.Ua.Km.va=[olympe.dc.Cj];olympe.dc.Ua.Ji=class extends olympe.dc.Ua.yh{constructor(a,b,c){super(a,b,c)}ia(){return T(olympe.dc.Ua.Ji)}G(){return olympe.dc.Fb.Ll}Hb(){return olympe.D.ea}};S('olympe.dc.valuedefs.BooleanProperty',olympe.dc.Ua.Ji);olympe.dc.Ua.me=class{constructor(a){this.value=a}ia(){return T(olympe.dc.Ua.me)}C(){return[]}getValue(){return this.value}ha(a){a=Yj(a,this.value);return`{"c":"${this.ia()}","a":[${a}]}`}toString(){return`Constant(${Xj(this.value)})`}};S('olympe.dc.valuedefs.Constant',olympe.dc.Ua.me);olympe.dc.Ua.me.va=[olympe.dc.Cj];olympe.dc.Ua.Fh=class extends olympe.dc.Ua.yh{constructor(a,b,c){super(a,b,c)}ia(){return T(olympe.dc.Ua.Fh)}G(){return olympe.dc.Fb.Ml}Hb(){return olympe.D.Za}};S('olympe.dc.valuedefs.DateTimeProperty',olympe.dc.Ua.Fh);olympe.dc.Ua.Sh=class extends olympe.dc.Ua.yh{constructor(a,b,c){super(a,b,c)}ia(){return T(olympe.dc.Ua.Sh)}G(){return olympe.dc.Fb.Nl}Hb(){return olympe.D.aa}};S('olympe.dc.valuedefs.NumberProperty',olympe.dc.Ua.Sh);olympe.dc.Ua.Zh=class extends olympe.dc.Ua.yh{constructor(a,b,c){super(a,b,c)}ia(){return T(olympe.dc.Ua.Zh)}G(){return olympe.dc.Fb.Ol}Hb(){return olympe.D.Ka}};S('olympe.dc.valuedefs.StringProperty',olympe.dc.Ua.Zh);olympe.dc.Ua.ai=class{ia(){return T(olympe.dc.Ua.ai)}C(){return[]}getValue(a,b){return b}ha(){return'{"c":"'+this.ia()+'","a":[]}'}toString(){return'Tag()'}};S('olympe.dc.valuedefs.Tag',olympe.dc.Ua.ai);olympe.dc.Ua.ai.va=[olympe.dc.Cj];olympe.dc.ba={};olympe.dc.ba.Gh=class{Hb(){return null}ia(){return T(olympe.dc.ba.Gh)}C(a,b,c){const d={};return function(e,f,g,h){e?void 0===d[f]?(d[f]=1,b.C.C!==g||b.F||(b.C.C=f),c(!0,f,f,Vj(h,!0,f,f))):(d[f]++,rk(b,g)):void 0!==d[f]&&0>=--d[f]&&(delete d[f],c(!1,f,f,Vj(h,!1,f,f)))}}ha(){return'{"c":"'+this.ia()+'"}'}toString(){return'Distinct()'}};S('olympe.dc.transformers.Distinct',olympe.dc.ba.Gh);olympe.dc.ba.Gh.va=[olympe.dc.$e];olympe.dc.ba.Qe=class{constructor(a){this.F=a}Hb(){return null}ia(){return T(olympe.dc.ba.Qe)}G(){return this.F.F()}C(a,b,c){function d(f,g,h,k){k=k.valueOf();!1===k&&rk(b,g);k!==!!e[g]&&(e[g]=k,c(k,f,g,Vj(h,k,f,g)))}const e={};return(f,g,h,k)=>{const m='@'+h;if(f){let n=this.F.C(a,g);olympe.D.Ya(n)&&(n=n.Aa);olympe.D.mf(n)?(b.F||void 0!==olympe.D.Ta(n)||rk(b,h),e[m]=n,a.run(()=>{olympe.D.pc([n],p=>{d(g,h,k,p)},'filterResultHandler')})):d(g,h,k,n)}else void 0!==e[m]&&(e[m].destroy(),delete e[m]),
|
|
808
|
-
d(g,h,k,!1),delete e[h]}}ha(a){return'{"c":"'+this.ia()+'","a":['+this.F.ha(a)+']}'}toString(){return'Filter('+this.F.toString()+')'}};S('olympe.dc.transformers.Filter',olympe.dc.ba.Qe);olympe.dc.ba.Qe.va=[olympe.dc.$e,olympe.dc.Xo];olympe.dc.ba.Hk=class{constructor(a,b,c,d){this.F=new olympe.dc.Oa.Relation(olympe.dc.
|
|
808
|
+
d(g,h,k,!1),delete e[h]}}ha(a){return'{"c":"'+this.ia()+'","a":['+this.F.ha(a)+']}'}toString(){return'Filter('+this.F.toString()+')'}};S('olympe.dc.transformers.Filter',olympe.dc.ba.Qe);olympe.dc.ba.Qe.va=[olympe.dc.$e,olympe.dc.Xo];olympe.dc.ba.Hk=class{constructor(a,b,c,d){this.F=new olympe.dc.Oa.Relation(olympe.dc.fa(a),c||olympe.dc.wa.DESTINATION);this.G=new olympe.dc.Oa.Relation(olympe.dc.fa(b),d||olympe.dc.wa.DESTINATION)}Hb(){return De(this.F)}ia(){return T(olympe.dc.ba.Hk)}C(a,b,c){const d=olympe.dc.ta(),e={},f=this.F.X(),g=this.F.Pa(),h=this.G.X(),k=this.G.Pa();let m=null,n=null;const p=(r,t,u,w,x,y)=>{if(x){if(x=()=>{const z=olympe.Z.nb(u+g+(f+'_'+r)+y,20),A=Vj(t,!0,y,z);m=r;n=()=>{c(!1,y,z,Vj(t,!1,y,z))};b.register(z,
|
|
809
809
|
u,w,f,g);c(!0,y,z,A)},x.vq=r,e[w]=x,null===m||r<m)n&&n(),x()}else if(m===r){n();e[w]=!0;x=Infinity;let z=null;for(let A=Object.keys(e),M=A.length,K=0;K<M;K++){let pa=e[A[K]];pa.vq<x&&(x=pa.vq,z=pa)}z&&z()}},q=(r,t,u,w,x)=>{w?e[x]||(e[x]=!0,sk(b,u,x,f,g),sk(b,u,x,h,k),W(d,x,this.F,p.bind(this,r,t,u,x),u+'_val'),W(d,x,this.G,q.bind(this,r+1,t,u),u+'_follow')):(d.F(x,this.G,u+'_follow'),d.F(x,this.F,u+'_val'),delete e[x])};return(r,t,u,w)=>q(0,w,u,r,t)}ha(){return'{"c":"'+this.ia()+'","a":["'+this.F.toString()+
|
|
810
810
|
'","'+this.G.toString()+'"]}'}toString(){return'FirstRelated('+this.F.toString()+', '+this.G.toString()+')'}};S('olympe.dc.transformers.FirstRelated',olympe.dc.ba.Hk);olympe.dc.ba.Hk.va=[olympe.dc.$e];olympe.dc.ba.Mg=class{constructor(a,b){this.start=a;this.F=b}Hb(){return null}ia(){return T(olympe.dc.ba.Mg)}C(a,b,c){const d=new olympe.dc.Ub.$k;let e,f,g,h=!1;const k=()=>{if(void 0!==f&&void 0!==g&&void 0!==e){var n=f+g;b.F||(b.C.C=e[0>n-1?0:Math.min(e.length,n)-1]);jk(d,e,f,n,c)}};a.run(()=>olympe.D.pc([this.start,this.F],(n,p)=>{f=n.valueOf();g=p.valueOf();k()}));xk(b,k);const m=uk(b);tk(b,m);return(n,p,q,r)=>{h||(r.ge().Qf(t=>{e=t;yk(b,m)}),Tj(b,()=>r.Hf(),m),h=!0);d.C(n,p,q,null);Uj(b,q,m)}}ha(a){return'{"c":"'+
|
|
811
811
|
this.ia()+'","a":['+Yj(a,this.start)+','+Yj(a,this.F)+']}'}toString(){return`Limit(${olympe.D.Ta(this.start)},${olympe.D.Ta(this.F)})`}};S('olympe.dc.transformers.Limit',olympe.dc.ba.Mg);olympe.dc.ba.Mg.va=[olympe.dc.$e];function Bk(a){return a.F.map(b=>b.X())}
|
|
@@ -818,10 +818,10 @@ S('olympe.dc.transformers.Sort',olympe.dc.ba.gg);olympe.dc.ba.gg.va=[olympe.dc.$
|
|
|
818
818
|
olympe.dc.ba.af=class{constructor(a,b){this.ba=this.F=null;a instanceof olympe.dc.ua?(this.F=a.Bd(),this.ba=a.Vk()):(this.F=a,b&&(this.ba=b))}Hb(){return null}ia(){return T(olympe.dc.ba.af)||''}tg(){return this.ba}Bd(){return this.F}C(a,b,c){const d=new olympe.dc.Ub.$k,e=new olympe.dc.Ub.Ii;let f=[],g=[],h=!1,k=!1;const m=uk(b),n=uk(b);xk(b,()=>{const p=f.concat(g);0<p.length?b.F||(b.C.C=p[p.length-1]):yk(b);jk(d,p,0,p.length,c)});tk(b,n);Ck(this,a,this.F,e,b,(p,q,r,t)=>{const u=olympe.D.Ma();u.Bc()||
|
|
819
819
|
u.gb()||(k||(t.ge().Qf(w=>{g=w;yk(b,n)}),Tj(b,()=>t.Hf(),n),k=!0),d.C(p,q,r),Uj(b,r,n))});tk(b,m);return(p,q,r,t)=>{h||(t.ge().Qf(u=>{f=u;yk(b,m)}),Tj(b,()=>t.Hf(),m),h=!0);d.C(p,q,r,m);Uj(b,r,m)}}ha(a){const b=this.ba?'['+this.ba.map(c=>c.ha(a)).join(',')+']':'null';return'{"c":"'+this.ia()+'","a":['+Yj(a,this.F)+','+b+']}'}toString(){const a=olympe.D.Ya(this.F)?'N:'+this.F.Aa.W():this.F.valueOf(),b=this.ba?','+this.ba.map(c=>c.toString()).join(','):'';return'Union('+a+b+')'}};
|
|
820
820
|
S('olympe.dc.transformers.Union',olympe.dc.ba.af);olympe.dc.ba.af.va=[olympe.dc.$e];olympe.dc.ba.mp={gy:1,Kr:-1,Jr:0};olympe.dc.ba.Gz={Jw:!0,lx:!1};olympe.dc.ic.R={oo:'dc.legacy.listdefProcessor'};olympe.V.config(a=>{D(a,olympe.dc.ic.R.oo,olympe.dc.ic.Es,olympe.dc.query.R.za,olympe.dc.R.Oe,olympe.dc.transaction.R.Ga,olympe.dc.query.R.lj,new olympe.V.ma(olympe.dc.U.Wg))});olympe.V.run([olympe.dc.ic.R.oo],a=>{olympe.dc.ic.$u=()=>a});function Ek(a){const b=olympe.dc.ta(),c=new Map;b.pq(a).forEach(d=>{b.ib(d,olympe.dc.CloudObject.propertyRel).forEach(e=>{const f=b.name(e);c.has(f)||c.set(f,e)})});return c}
|
|
821
|
-
olympe.dc.CloudObject=class{constructor(a,b){this.tag=b;this.db=olympe.dc.ta();this.model=null}static Ec(a,b,c,...d){b=olympe.dc.
|
|
822
|
-
b.C.C.ub([a]);b.Oa.register(c,a);b=c}return b}static exists(a){return olympe.dc.ta().Ia(olympe.dc.
|
|
821
|
+
olympe.dc.CloudObject=class{constructor(a,b){this.tag=b;this.db=olympe.dc.ta();this.model=null}static Ec(a,b,c,...d){b=olympe.dc.fa(b);var e=qe.get(b)||null;(e=e&&e.C)?e(a,c,...d):(a=a.create(b),void 0!==c&&null!==c&&Z(a,olympe.dc.CloudObject.nameProp,c),a.X())}static get(a){if(a instanceof olympe.dc.CloudObject)var b=a;else{b=olympe.dc.qq();a=olympe.dc.fa(a);var c=pe(b,b.db.model(a));if(null===c)throw new olympe.dc.Mo(a);c=c.instantiate(a,b.F);Object.defineProperty(c,'tag',{value:a,writable:!1});
|
|
822
|
+
b.C.C.ub([a]);b.Oa.register(c,a);b=c}return b}static exists(a){return olympe.dc.ta().Ia(olympe.dc.fa(a))}static fq(a,b,c){if('undefined'===typeof olympe.sc)throw Error('Method CloudObject.createWith should only be used at runtime, when sc package exists');const d=olympe.dc.ta();let e=null;const f=h=>{null===e&&(e=Ek(b||this));return e.has(h)?e.get(h):null},g=new Map;a.forEach((h,k)=>{d.Ia(olympe.dc.fa(k))?g.set(k,h):(k=f(k))&&g.set(k,h)});a=new olympe.sc.Sa(!1);c=a.create(null!=b?b:this,g,c);a.lb().catch(h=>
|
|
823
823
|
olympe.la.fb('dc').error(`Error occurred for transaction executed by CloudObject.createWith: ${h}`));return this.get(c)}static Xt(){return this.get(this)}static Vj(a){return olympe.dc.ra.Vj(a)}static Cb(){return olympe.dc.ta().ib(this,olympe.dc.CloudObject.propertyRel).map(a=>new olympe.dc.Oa.Property(a))}static he(){const a=olympe.dc.ta();return a.ib(this,olympe.dc.CloudObject.xi).map(b=>new olympe.dc.Oa.Relation(b)).concat(a.ib(this,olympe.dc.CloudObject.jq).map(b=>new olympe.dc.Oa.Relation(b,olympe.dc.wa.ORIGIN)))}static Ge(a){return olympe.dc.CloudObject.get(a)}static Vu(a){var b=
|
|
824
|
-
pe(olympe.dc.qq(),olympe.dc.
|
|
824
|
+
pe(olympe.dc.qq(),olympe.dc.fa(a));b=b&&b.F;return new olympe.dc.ua(olympe.dc.fa(a),olympe.dc.CloudObject.instancesRel,b)}X(){return this.tag}name(){return this.db.name(this)}ia(){return this.rb(olympe.dc.CloudObject.nameProp)}Dd(){this.model||(this.model=olympe.dc.CloudObject.get(this.db.model(this)));return this.model}query(){return olympe.dc.ra.from(this)}Of(){return this.db.Of(this)}zb(){return this.db.source(this)}Wu(){return this.db.si(this)?olympe.dc.Fd().fromModel(this):null}oq(){return olympe.D.sa([this.ia()],
|
|
825
825
|
a=>olympe.D.sb(a),olympe.D.Ka,'getDisplayName',olympe.D.sb('('+this.toString()+')'))}nc(){return this.model?this.model.X():this.db.model(this)}observe(a,b,c=!0){const d='function'===typeof a.F?a.F():a;return new rxjs.Observable(e=>{const f=this.db.Qa(this.tag,b);c||null!==f||e.next(f);const g=Bf(this.db,this.tag,b,h=>{null===h||void 0===h?e.next(null):e.next(h)});d.$(()=>{e.complete();Cf(this.db,this.tag,b,g)});return()=>Cf(this.db,this.tag,b,g)})}bw(a){const b='function'===typeof a.F?a.F():a;return new rxjs.Observable(c=>
|
|
826
826
|
{const d=Df(this.db,this.tag,(e,f)=>{null===f||void 0===f?c.next([new olympe.dc.Oa.Property(e),null]):c.next([new olympe.dc.Oa.Property(e),f])});b.$(()=>{c.complete();Ef(this.db,this.tag,d)});return()=>Ef(this.db,this.tag,d)})}cw(a){return this.observe(olympe.D.Ma(),a)}get(a){return this.db.Qa(this.tag,a)}Qa(a){return this.get(a)}eb(a){return olympe.dc.ra.from(this).eb(a)}Ij(a){return olympe.dc.Nc.from(this).eb(a)}Du(){return this.Yb(olympe.dc.CloudObject.au,olympe.dc.CloudObject)}Wl(){return this.ib(olympe.dc.CloudObject.containsRel,
|
|
827
827
|
olympe.dc.CloudObject)}kf(a,b,c){const d=olympe.D.ec(c,'Sync valueType'),e=Bf(this.db,this.tag,a,olympe.D.Ma().G(f=>{b&&null!==f&&void 0!==f&&(f=b(f));null===f||void 0===f?d.clear():d.update(f)}));d.getContext().onDestroy(()=>Cf(this.db,this.tag,a,e));return d.getContext()}rb(a){return N(this.kf(a,olympe.dc.Fb.Ol,olympe.D.Ka))}Gc(a){return N(this.kf(a,olympe.dc.Fb.Nl,olympe.D.aa))}oh(a){return N(this.kf(a,olympe.dc.Fb.Ll,olympe.D.ea))}mi(a){return N(this.kf(a,olympe.dc.Fb.Ml,olympe.D.Za))}tq(){return N(this.kf(olympe.dm.Color.valueProp,
|
|
@@ -844,8 +844,8 @@ olympe.V.run([olympe.dc.db.R.Ga,olympe.dc.transaction.R.Ga,olympe.dc.R.fo,olympe
|
|
|
844
844
|
olympe.dm.pd.F=Ae('014831d95f83635090ea','ADMIN_USERS_ROLE');olympe.dm.pd.prototype.ia.J=olympe.D.H.F;olympe.dm.pd.prototype.C.J=olympe.D.H.F;olympe.dm.pd.prototype.F.J=olympe.D.H.P;olympe.dm.User=class extends olympe.dc.CloudObject{Qu(){return this.$l()}ia(){return this.$l()}$l(){return this.rb(olympe.dm.User.loginProp)}gs(){return this.rb(olympe.dm.User.F)}es(){return olympe.D.Ka.EMPTY}qv(){return this.rb(olympe.dm.User.saltProp)}Cv(){return this.rb(olympe.dm.User.verifierProp)}ov(){return this.ib(olympe.dm.User.G,olympe.dm.pd)}};olympe.dm.User.N=olympe.dc.ka.C('ff021000000000000003',olympe.dm.User);olympe.dm.User.loginProp=olympe.dm.User.N.ja('ff023000000000000001');
|
|
845
845
|
B('olympe.dm.User.loginProp',olympe.dm.User.loginProp);olympe.dm.User.F=olympe.dm.User.N.ja('ff023000000000000002');olympe.dm.User.T=olympe.dm.User.N.ja('ff023000000000000003');olympe.dm.User.saltProp=olympe.dm.User.N.ja('ff023000000000000004');B('olympe.dm.User.saltProp',olympe.dm.User.saltProp);olympe.dm.User.verifierProp=olympe.dm.User.N.ja('ff023000000000000005');B('olympe.dm.User.verifierProp',olympe.dm.User.verifierProp);olympe.dm.User.P=olympe.dm.User.N.ja('ff023000000000000020');
|
|
846
846
|
olympe.dm.User.SAMLnameIdProp=olympe.dm.User.N.ja('ff023000000000000036');B('olympe.dm.User.SAMLnameIdProp',olympe.dm.User.SAMLnameIdProp);olympe.dm.User.G=U(olympe.dm.User.N,olympe.dm.pd.C);olympe.dm.User.$=olympe.dm.User.N.pa('ff022000000000000002');olympe.dm.User.C=Ae('014831d95fd7d12b8568','ADMIN_USER');olympe.dm.User.L=Ae('0163d9653067b6237f62','GUEST_USER');l=olympe.dm.User.prototype;l.Qu.J=olympe.D.H.F;l.ia.J=olympe.D.H.F;l.$l.J=olympe.D.H.F;l.gs.J=olympe.D.H.F;l.es.J=olympe.D.H.F;l.qv.J=olympe.D.H.F;
|
|
847
|
-
l.Cv.J=olympe.D.H.F;l.ov.J=new olympe.D.H(()=>olympe.dc.ua,[]);olympe.dm.xf=class extends olympe.dc.CloudObject{$(){return this.Wl()}mb(){return this.rb(olympe.dm.xf.Wa)}};olympe.dm.xf.N=olympe.dc.ka.C('01621fb84e3300000000',olympe.dm.xf);olympe.dm.xf.Wa=olympe.dm.xf.N.ja('01609de3f292e3c2c6ff');olympe.dm.xf.prototype.$.J=new olympe.D.H(()=>olympe.D.Qc,[]);olympe.dm.xf.prototype.mb.J=olympe.D.H.F;olympe.dm.BrickMetadata=class extends olympe.dm.xf{Dv(){return this.rb(olympe.dm.BrickMetadata.Eb)}Rc(){return this.rb(olympe.dm.BrickMetadata.na)}Ud(){return null}Au(){return this.ib(olympe.sc.Gb.Comment.C.Rb(),olympe.sc.Gb.Comment)}Qj(){return this.Ij(olympe.dm.BrickMetadata.
|
|
848
|
-
olympe.dm.BrickMetadata.
|
|
847
|
+
l.Cv.J=olympe.D.H.F;l.ov.J=new olympe.D.H(()=>olympe.dc.ua,[]);olympe.dm.xf=class extends olympe.dc.CloudObject{$(){return this.Wl()}mb(){return this.rb(olympe.dm.xf.Wa)}};olympe.dm.xf.N=olympe.dc.ka.C('01621fb84e3300000000',olympe.dm.xf);olympe.dm.xf.Wa=olympe.dm.xf.N.ja('01609de3f292e3c2c6ff');olympe.dm.xf.prototype.$.J=new olympe.D.H(()=>olympe.D.Qc,[]);olympe.dm.xf.prototype.mb.J=olympe.D.H.F;olympe.dm.BrickMetadata=class extends olympe.dm.xf{Dv(){return this.rb(olympe.dm.BrickMetadata.Eb)}Rc(){return this.rb(olympe.dm.BrickMetadata.na)}Ud(){return null}Au(){return this.ib(olympe.sc.Gb.Comment.C.Rb(),olympe.sc.Gb.Comment)}Qj(){return this.Ij(olympe.dm.BrickMetadata.ga).Ad().Qj()}};olympe.dm.BrickMetadata.N=Fe(olympe.dc.ka.C('01621fb84e3500000000',olympe.dm.BrickMetadata));olympe.dm.BrickMetadata.Eb=olympe.dm.BrickMetadata.N.ja('01621fb84e320000f001');olympe.dm.BrickMetadata.na=olympe.dm.BrickMetadata.N.ja('01703376c4a81c0e9d94');
|
|
848
|
+
olympe.dm.BrickMetadata.ga=olympe.dm.BrickMetadata.N.pa('0161ae97622bb21f335b');olympe.dm.BrickMetadata.uc={Zy:'private',$y:'public'};olympe.dm.BrickMetadata.Qb=Ae('01703376c4a81c0e9d95','BRICK_STATUS');olympe.dm.BrickMetadata.$b={yx:'experimental',mz:'stable',kx:'deprecated'};l=olympe.dm.BrickMetadata.prototype;l.Dv.J=olympe.D.H.F;l.Rc.J=olympe.D.H.F;l.Ud.J=new olympe.D.H(()=>String,[]);l.Au.J=new olympe.D.H(()=>olympe.dc.ua,[]);l.Qj.J=olympe.D.H.T;function di(a,b){const c=a.query().eb(olympe.dm.xd.F.Rb()).eb(olympe.dm.xd.C);a=a.query().eb(olympe.dm.pb.L.Rb()).Mf(olympe.dm.pb.G,!0).eb(olympe.sc.Jc.C.Rb());const d=e=>e.Nd().Mf(olympe.dc.CloudObject.extendRel,!0).eb(olympe.dc.CloudObject.xi,!0).eb(olympe.dm.Relation.destinationModelRel).back(2).eb(olympe.dc.CloudObject.propertyRel,!0).eb(olympe.dm.Property.typeRel).observe(b);return rxjs.combineLatest([d(c),d(a)]).pipe(rxjs.operators.map(([e,...f])=>e.concat(...f)))}
|
|
849
849
|
function zi(a,b){return a.observe(b,olympe.dm.DataSource.bq).pipe(rxjs.operators.map(()=>a.Cd(olympe.dc.sources.U.le)),rxjs.operators.distinctUntilChanged())}
|
|
850
850
|
olympe.dm.DataSource=class extends olympe.dc.CloudObject{constructor(a,b,c){super(a,b);this.fc=c;this.eq=new Map([[olympe.dc.sources.U.hl,olympe.dm.DataSource.lw],[olympe.dc.sources.U.le,olympe.dm.DataSource.bq],[olympe.dc.sources.U.ml,olympe.dm.DataSource.ow]])}W(){return this.tag===olympe.dm.DataSource.SERVER?olympe.dc.Ra.SERVER:this.tag}Cd(a){a=a.startsWith('data.')?a.split('.')[1]:a;const b=`${'data.'}${a}`;let c,d,e;return null!=(e=null!=(d=null!=(c=olympe.V.getParameter(`${'data.'}${this.name().toLowerCase().replace(/\W/g,
|
|
851
851
|
'_')}.${a}`))?c:olympe.V.getParameter(`${'data.'}${this.X()}.${a}`))?d:olympe.V.getParameter(b))?e:this.eq.has(b)?this.get(this.eq.get(b)):null}Rc(){const a=this;return v(function*(){const b=olympe.dm.DataSource.Pb.qr,c=olympe.dm.DataSource.Pb.Db,d=new olympe.dc.Request(olympe.dc.Request.C.Pb,a.W());return a.fc.request(d).then(e=>{let f;const g=null!=(f=null==e?void 0:e.s)?f:c;(e=null==e?void 0:e.r)&&olympe.la.fb('dc').warn(`Source ${a.name()} (${a.W()}) has encountered issues: ${e}`);return g}).catch(e=>
|
|
@@ -869,36 +869,37 @@ olympe.dm.ld.prototype.F.J=new olympe.D.H(()=>olympe.dc.ua,[]);olympe.dm.pb=clas
|
|
|
869
869
|
olympe.dm.pb.qd=U(olympe.dm.pb.N,olympe.dm.pb.G);olympe.dm.pb.L=olympe.dm.pb.N.pa('ff02200000000000002c');olympe.dm.pb.jd=olympe.dm.pb.N.pa('017e9c412e2b944bd590');olympe.dm.pb.ze=olympe.dm.pb.N.pa('017e9c416872a89d3415');olympe.dm.pb.ye=olympe.dm.pb.N.pa('017ebf8fe5c506662098');U(olympe.dc.CloudObject.N,olympe.dm.pb.mb);olympe.dm.pb.ac=Ae('100000000000000000dd','PRIMORDIAL');olympe.dm.pb.prototype.C.J=new olympe.D.H(()=>olympe.dc.ua,[]);olympe.dm.pb.prototype.G.J=olympe.D.H.F;
|
|
870
870
|
olympe.dm.pb.prototype.T.J=olympe.D.H.F;olympe.dm.pb.prototype.F.J=new olympe.D.H(()=>olympe.dc.ua,[]);olympe.dm.Property=class extends olympe.dc.CloudObject{C(){return this.Yb(olympe.dm.Property.definingModelRel,olympe.dc.CloudObject)}getType(){return this.Yb(olympe.dm.Property.typeRel,olympe.dc.CloudObject)}F(){return this.Ij(olympe.dm.Property.typeRel).Ad()}yc(){return this.C().ia().cq(this.ia())}};olympe.dm.Property.N=olympe.dc.ka.C('ff021000000000000005',olympe.dm.Property);olympe.dm.Property.definingModelRel=U(olympe.dm.Property.N,olympe.dc.CloudObject.propertyRel);
|
|
871
871
|
B('olympe.dm.Property.definingModelRel',olympe.dm.Property.definingModelRel);olympe.dm.Property.typeRel=U(olympe.dm.Property.N,olympe.dc.CloudObject.typeRel);B('olympe.dm.Property.typeRel',olympe.dm.Property.typeRel);olympe.dm.Property.prototype.C.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);olympe.dm.Property.prototype.getType.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);olympe.dm.Property.prototype.F.J=olympe.D.H.C;olympe.dm.Relation=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}Zu(){return olympe.D.Ka.EMPTY}xu(){return this.Gc(olympe.dm.Relation.F)}kv(){return this.Gc(olympe.dm.Relation.G)}nq(){return this.ib(olympe.dm.Relation.destinationModelRel,olympe.dc.CloudObject).xc()}sq(){return this.ib(olympe.dm.Relation.originModelRel,olympe.dc.CloudObject).xc()}yc(){return this.sq().ia().concat(['-',this.ia(),'->',this.nq().ia()])}};olympe.dm.Relation.N=olympe.dc.ka.C('ff021000000000000006',olympe.dm.Relation);
|
|
872
|
-
olympe.dm.Relation.G=olympe.dm.Relation.N.ja('ff023000000000000030');olympe.dm.Relation.F=olympe.dm.Relation.N.ja('ff023000000000000034');olympe.dm.Relation.da=olympe.dm.Relation.N.ja(olympe.dc.Ob.vn);olympe.dm.Relation.$=olympe.dm.Relation.N.ja(olympe.dc.Ob.qc);olympe.dm.Relation.
|
|
872
|
+
olympe.dm.Relation.G=olympe.dm.Relation.N.ja('ff023000000000000030');olympe.dm.Relation.F=olympe.dm.Relation.N.ja('ff023000000000000034');olympe.dm.Relation.da=olympe.dm.Relation.N.ja(olympe.dc.Ob.vn);olympe.dm.Relation.$=olympe.dm.Relation.N.ja(olympe.dc.Ob.qc);olympe.dm.Relation.ga=olympe.dm.Relation.N.ja(olympe.dc.Ob.Ef);olympe.dm.Relation.na=olympe.dm.Relation.N.ja(olympe.dc.Ob.lt);olympe.dm.Relation.T=olympe.dm.Relation.N.ja('ff023000000000000031');
|
|
873
873
|
olympe.dm.Relation.originModelRel=U(olympe.dm.Relation.N,olympe.dc.CloudObject.xi);B('olympe.dm.Relation.originModelRel',olympe.dm.Relation.originModelRel);olympe.dm.Relation.destinationModelRel=U(olympe.dm.Relation.N,olympe.dc.CloudObject.jq);B('olympe.dm.Relation.destinationModelRel',olympe.dm.Relation.destinationModelRel);olympe.dm.Relation.C={Ir:0,Vq:5,cp:1,dt:4,Al:2,nl:8,xx:10,fz:6,gz:9,Id:6,hz:9};olympe.dm.Relation.L={Ky:3,Os:4,xy:5,wy:6};olympe.dm.Relation.P=olympe.dm.fk.Qs+olympe.dm.fk.lr;
|
|
874
874
|
l=olympe.dm.Relation.prototype;l.Zu.J=olympe.D.H.F;l.xu.J=olympe.D.H.G;l.kv.J=olympe.D.H.G;l.nq.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);l.sq.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);olympe.dm.re=class extends olympe.dc.CloudObject{getValue(){}};olympe.dm.re.N=olympe.dc.ka.C('ff021000000000000019',olympe.dm.re);olympe.dm.String=class extends olympe.dm.re{getValue(){return this.rb(olympe.dm.String.valueProp)}toString(){return this.get(olympe.dm.String.valueProp)}};olympe.dm.String.N=olympe.dc.ka.C('ff021000000000000011',olympe.dm.String);olympe.dm.String.valueProp=olympe.dm.String.N.ja('ff023000000000000026');B('olympe.dm.String.valueProp',olympe.dm.String.valueProp);olympe.dm.String.prototype.getValue.J=olympe.D.H.F;olympe.dm.String.prototype.toString.J=olympe.D.H.C;olympe.dm.Boolean=class extends olympe.dm.re{getValue(){return this.oh(olympe.dm.Boolean.valueProp)}};olympe.dm.Boolean.N=olympe.dc.ka.C('ff021000000000000012',olympe.dm.Boolean);olympe.dm.Boolean.valueProp=olympe.dm.Boolean.N.ja('ff023000000000000027');B('olympe.dm.Boolean.valueProp',olympe.dm.Boolean.valueProp);olympe.dm.Boolean.prototype.getValue.J=olympe.D.H.P;olympe.dm.Color=class extends olympe.dm.re{getValue(){return this.tq()}};olympe.dm.Color.N=olympe.dc.ka.C('ff021000000000000017',olympe.dm.Color);olympe.dm.Color.valueProp=olympe.dm.Color.N.ja('ff023000000000000032');B('olympe.dm.Color.valueProp',olympe.dm.Color.valueProp);olympe.dm.Color.prototype.getValue.J=new olympe.D.H(()=>olympe.D.Color,[]);olympe.dm.DateTime=class extends olympe.dm.re{getValue(){return this.mi(olympe.dm.DateTime.valueProp)}};olympe.dm.DateTime.N=olympe.dc.ka.C('ff021000000000000014',olympe.dm.DateTime);olympe.dm.DateTime.valueProp=olympe.dm.DateTime.N.ja('ff023000000000000029');B('olympe.dm.DateTime.valueProp',olympe.dm.DateTime.valueProp);olympe.dm.DateTime.prototype.getValue.J=new olympe.D.H(()=>olympe.D.Za,[]);olympe.dm.Enum=class extends olympe.dm.String{ia(){return olympe.D.sa([super.ia(),super.getValue()],(a,b)=>''!==a.valueOf()?a:b,olympe.D.Ka)}Ed(){return this.Gc(olympe.dm.Enum.rankProp)}static create(a,b,c,d,e){const f=olympe.dc.ta();e=void 0!==e?e:f.Ia(b)&&f.Sd(b).length||0;c=(new Map).set(olympe.dm.String.valueProp,c).set(olympe.dc.CloudObject.nameProp,d||c).set(olympe.dm.Enum.rankProp,e);return a.create(b,c)}};olympe.dm.Enum.create=olympe.dm.Enum.create;
|
|
875
875
|
olympe.dm.Enum.N=olympe.dc.ka.C('016cdd861b32d56c81f7',olympe.dm.Enum);olympe.dm.Enum.rankProp=olympe.dm.Enum.N.ja('017a7690c915975ea995');olympe.dm.Enum.prototype.Ed.J=olympe.D.H.G;olympe.dm.yf=class extends olympe.dm.BrickMetadata{Bv(){return this.eb(olympe.dc.CloudObject.instancesRel).bk(olympe.dm.Enum.rankProp,olympe.dc.query.hj.ASC).Ad()}static create(a,b){b=a.create(olympe.dm.yf,(new Map).set(olympe.dc.CloudObject.nameProp,b));a.Ea(olympe.dc.CloudObject.extendRel,b,olympe.dm.Enum);return b}};olympe.dm.yf.create=olympe.dm.yf.create;olympe.dm.yf.prototype.getValues=olympe.dm.yf.prototype.Bv;olympe.dm.yf.N=olympe.dc.ka.C('017a768f966fc08ebb98',olympe.dm.yf);olympe.dm.Number=class extends olympe.dm.re{getValue(){return this.Gc(olympe.dm.Number.valueProp)}};olympe.dm.Number.N=olympe.dc.ka.C('ff021000000000000013',olympe.dm.Number);olympe.dm.Number.valueProp=olympe.dm.Number.N.ja('ff023000000000000028');B('olympe.dm.Number.valueProp',olympe.dm.Number.valueProp);olympe.dm.Number.prototype.getValue.J=olympe.D.H.G;olympe.sc={};olympe.sc.R={za:'sc.Logger',ol:'sc.RootContext',ee:'sc.Serializer'};olympe.sc.U={Ke:'sc.app',uf:'sc.debug',tn:'sc.debugger',mr:'sc.disableTheme',PRODUCTION:'sc.production',Ps:'sc.onstartTimeout',fp:'sc.remoteActionTimeout',Io:'sc.offlineStart'};
|
|
876
876
|
olympe.V.config(a=>{F(a,olympe.sc.U.Ke,'');F(a,olympe.sc.U.Io,!1);F(a,olympe.sc.U.uf,!1);F(a,olympe.sc.U.mr,!0);F(a,olympe.sc.U.PRODUCTION,!1);F(a,olympe.sc.U.Ps,2E4);F(a,olympe.sc.U.fp,1E4);E(a,olympe.sc.R.za,[olympe.la.R.Ga],b=>b.Fc('sc'));D(a,olympe.sc.R.ee,olympe.sc.fg,olympe.dc.R.Oe);va(a,olympe.dc.sources.R.ee,olympe.sc.R.ee);E(a,olympe.sc.R.ol,[new olympe.V.ma(olympe.sc.U.PRODUCTION)],b=>{const c=new olympe.sc.vd('root','root',null);olympe.sc.um=c;c.set(olympe.sc.xa.C.PRODUCTION,b);return new olympe.sc.xa(c)})},
|
|
877
877
|
'olympe.sc');olympe.V.run([olympe.sc.R.ol],a=>{olympe.Mj().ctx=a});olympe.sc.hm=()=>null!==olympe.dc.ta().Tb(void 0,olympe.sc.Runnable.C.Rb());olympe.sc.cB=(a,b,c,d)=>{c=Z(Z(a.create(olympe.sc.Dc),olympe.sc.Dc.C,c||null),olympe.sc.Dc.G,d||null);a.Ea(olympe.sc.Dc.F,c,b);a.Ea(olympe.dc.CloudObject.containsRel,b,c);return c.X()};olympe.sc.kg=a=>{a=olympe.dc.Fb.kg(a);return a instanceof olympe.sc.be?a.C():a};olympe.sc.yB=a=>{a=me(a);return a instanceof olympe.sc.be?a.C():a};
|
|
878
|
-
olympe.sc.uB=function(a){const b=olympe.dm.Bb.C.Rb(),c=olympe.dc.CloudObject.containsRel.Rb();var d=olympe.dc.
|
|
878
|
+
olympe.sc.uB=function(a){const b=olympe.dm.Bb.C.Rb(),c=olympe.dc.CloudObject.containsRel.Rb();var d=olympe.dc.fa(a);if(void 0===d)return[];a=olympe.dc.ta();var e=a.model(d);const f=[],g=[];let h=[];if(a.ri(e,olympe.dm.Bb))h.push(d);else{for(e=[];null===a.Tb(d,b);){e.push(d);const k=a.Tb(d,c);if(null===k)return olympe.la.fb('sc').warn(`Object ${d} has no container`),[];a.$c(d,olympe.sc.logic.hb)||k===a.Tb(d,olympe.sc.Runnable.C.Rb())||f.push(d);d=k;if(e.includes(d))throw Error(`Instance ${d} (${a.name(d)}) is part of a cyclic contain pattern`);
|
|
879
879
|
}g.push(d);h.push(a.Tb(g[0],b))}h=h.concat(a.qg(h[0],olympe.dm.Bb.Da));h=h.concat(a.qg(h[h.length-1],olympe.dm.Ac.T.Rb()));h=h.concat(a.qg(h[h.length-1],olympe.dm.Ac.P.Rb()));return[...f,...g,...h].reverse()};olympe.sc.wB=a=>{a=a&&a.valueOf()||'';return a.startsWith('image/')?olympe.sc.Xf:a.startsWith('video/')?olympe.sc.Zg:a.startsWith('font/')||a.startsWith('application/font-woff')?olympe.sc.rc:olympe.dm.File};
|
|
880
880
|
olympe.sc.sB=a=>a instanceof olympe.sc.Xf?'image/*':a instanceof olympe.sc.Zg?'video/*':a instanceof olympe.sc.rc?'font/*,application/font-woff':null;olympe.sc.tb={};function Fk(a){const b=olympe.dc.ta();let c;try{const d=[a];let e=a.getParent();for(;null!==e&&e.C!==olympe.sc.um;)d.unshift(e),e=e.getParent();c=d.map(f=>{const g=f.Ee();return null!==g?(f=b.model(g),b.name(g)||f&&b.name(f)||g):f.W()}).join(' > ')}catch(d){c=`No stack available for context ${a.W()}: ${d}`,a.K.warn(c)}return c}
|
|
881
|
-
function Gk(a,b){var c=olympe.sc.xa,d=a.C;a=a.F();b=olympe.dc.
|
|
881
|
+
function Gk(a,b){var c=olympe.sc.xa,d=a.C;a=a.F();b=olympe.dc.fa(b);let e,f=null==(e=d.F)?void 0:e.get(b);if(!f){f=d.gh(a,void 0,b);for(d=f.getParent();d&&d.ga&&!d.id.startsWith('_');)d=d.getParent();let g;null==(g=d)||Hk(g,b,f)}return new c(f)}function Ik(a){let b;return null!=(b=a.Ta(olympe.sc.xa.C.PRODUCTION))?b:!1}
|
|
882
882
|
olympe.sc.xa=class{constructor(a=olympe.sc.um){this.C=a;this.K=olympe.la.fb('sc');this.G=null}W(){return this.C.W()}getParent(){if(null===this.G){const a=this.C.getParent();this.G=null===a?null:new olympe.sc.xa(a)}return this.G}yu(a){const b=olympe.dc.ta();let c=this.getParent();const d=e=>{if(e.Ee()){const f=b.model(e.Ee());if(f&&b.Qa(f,olympe.sc.Xa.da)||a.modelTag&&!b.$c(e.Ee(),a.modelTag))return!1}return!0};for(;c&&!d(c);)c=c.getParent();return c}Ee(){return this.C.Ee()}F(){return this.C.C}set(a,
|
|
883
|
-
b){this.C.set(a,b);return this}Am(a){return this.set(a,Date.now())}remove(a){this.set(a,null)}vb(a,b,c=!1){const d=olympe.dc.
|
|
884
|
-
d.next.bind(d),c?void 0:this.C.W(),!1);this.onDestroy(()=>{f();d.complete()});return f})}repeat(a,b){const c=Jk(this.C,a);a=b.subscribe(d=>{null!==d?this.set(c,d):this.remove(c)});this.yg(a.unsubscribe.bind(a));return this}qw(a){a=a instanceof olympe.sc.Runnable?a:this.get(a);if(!a)return null;const b=this.gh(`Runner ${a.name()}`);a.run(b);return b}Hw(a,b=!0,c=!1){return
|
|
885
|
-
a);return this}Ta(a,b=!0){return this.C.Ta(a,b)}on(a,b,c,d=!0){return this.C.on(a,b,c,d)}gh(a){return new olympe.sc.xa(this.C.gh(this.F(),a))}Zj(a,b){return this.C.Zj(a,c=>{b(new olympe.sc.xa(c))})}hv(a){a=
|
|
886
|
-
a);return null!==a?new olympe.sc.ui.ax(a,this):null}Ou(a){a=Lk(this.C,a);return null!==a?new olympe.sc.ui.$w(a,this):null}aw(...a){return rxjs.combineLatest(a.map(b=>{b=Lk(this.C,b);return null!==b?this.observe(b):
|
|
887
|
-
|
|
888
|
-
olympe.sc.xa.prototype.
|
|
889
|
-
olympe.sc.xa.prototype.
|
|
883
|
+
b){this.C.set(a,b);return this}Am(a){return this.set(a,Date.now())}remove(a){this.set(a,null)}vb(a,b,c=!1){const d=olympe.dc.fa(a),e=olympe.D.ec(b||Object,`Get context value flow source of ${d}`);e.getContext().onDestroy(this.on(a,f=>{null===f?e.clear():e.update(f)},c?this.C.W():void 0));return e.vb()}get(a,b=!1){a=this.Ta(a,b);return void 0!==a?a:null}has(a,b=!1){return this.C.has(a,b)}observe(a,b=!0,c=!1){return new rxjs.Observable(d=>{const e=this.get(a);b||null!==e||d.next(e);const f=this.on(a,
|
|
884
|
+
d.next.bind(d),c?void 0:this.C.W(),!1);this.onDestroy(()=>{f();d.complete()});return f})}repeat(a,b){const c=Jk(this.C,a);a=b.subscribe(d=>{null!==d?this.set(c,d):this.remove(c)});this.yg(a.unsubscribe.bind(a));return this}qw(a){a=a instanceof olympe.sc.Runnable?a:this.get(a);if(!a)return null;const b=this.gh(`Runner ${a.name()}`);a.run(b);return b}Hw(a,b=!0,c=!1){return new Promise((d,e)=>{this.observe(a,b,c).pipe(rxjs.operators.first()).subscribe(rxjs.Subscriber.create(d,f=>{let g=`An error occurred while calling \`waitFor(${olympe.dc.fa(a)})\``+
|
|
885
|
+
`on the context ${this.W()}:\nStack: ${Fk(this)}\n${f}`;f instanceof rxjs.EmptyError&&(g=`The context ${this.W()} has been destroyed while a Promise `+`created from a call to \`waitFor(${olympe.dc.fa(a)})\` `+`has never received any value:\nStack: ${Fk(this)}`);e(Error(g))}))})}sw(a){this.set(olympe.sc.xa.C.Sf,a);return this}Ta(a,b=!0){return this.C.Ta(a,b)}on(a,b,c,d=!0){return this.C.on(a,b,c,d)}gh(a){return new olympe.sc.xa(this.C.gh(this.F(),a))}Zj(a,b){return this.C.Zj(a,c=>{b(new olympe.sc.xa(c))})}hv(a){a=
|
|
886
|
+
Kk(this.C,a);return a===this.C?this:a&&new olympe.sc.xa(a)}destroy(){this.C.destroy()}yg(a,b){return this.C.yg(a,b)}Xj(a){this.C.Xj(a)}onDestroy(a){return this.gb()?(a(),'noId'):this.F().onDestroy(a)}pf(a){this.gb()||this.F().pf(a)}clear(){this.C.clear()}gb(){return this.F().gb()}Qa(a){a=Lk(this.C,a);return null!==a?new olympe.sc.ui.ax(a,this):null}Ou(a){a=Lk(this.C,a);return null!==a?new olympe.sc.ui.$w(a,this):null}aw(...a){return rxjs.combineLatest(a.map(b=>{b=Lk(this.C,b);return null!==b?this.observe(b):
|
|
887
|
+
rxjs.of(null)}))}Ha(a){return(null==a?void 0:a.constructor)!==this.constructor?!1:this.C===a.C}};olympe.sc.xa.prototype.observeMany=olympe.sc.xa.prototype.aw;olympe.sc.xa.prototype.getEvent=olympe.sc.xa.prototype.Ou;olympe.sc.xa.prototype.getProperty=olympe.sc.xa.prototype.Qa;olympe.sc.xa.prototype.isDestroyed=olympe.sc.xa.prototype.gb;olympe.sc.xa.prototype.clear=olympe.sc.xa.prototype.clear;olympe.sc.xa.prototype.offDestroy=olympe.sc.xa.prototype.pf;olympe.sc.xa.prototype.onDestroy=olympe.sc.xa.prototype.onDestroy;
|
|
888
|
+
olympe.sc.xa.prototype.offClear=olympe.sc.xa.prototype.Xj;olympe.sc.xa.prototype.onClear=olympe.sc.xa.prototype.yg;olympe.sc.xa.prototype.destroy=olympe.sc.xa.prototype.destroy;olympe.sc.xa.prototype.getOtherContext=olympe.sc.xa.prototype.hv;olympe.sc.xa.prototype.onContext=olympe.sc.xa.prototype.Zj;olympe.sc.xa.prototype.createChild=olympe.sc.xa.prototype.gh;olympe.sc.xa.prototype.setParentElement=olympe.sc.xa.prototype.sw;olympe.sc.xa.prototype.waitFor=olympe.sc.xa.prototype.Hw;
|
|
889
|
+
olympe.sc.xa.prototype.runner=olympe.sc.xa.prototype.qw;olympe.sc.xa.prototype.repeat=olympe.sc.xa.prototype.repeat;olympe.sc.xa.prototype.observe=olympe.sc.xa.prototype.observe;olympe.sc.xa.prototype.has=olympe.sc.xa.prototype.has;olympe.sc.xa.prototype.get=olympe.sc.xa.prototype.get;olympe.sc.xa.prototype.remove=olympe.sc.xa.prototype.remove;olympe.sc.xa.prototype.trigger=olympe.sc.xa.prototype.Am;olympe.sc.xa.prototype.set=olympe.sc.xa.prototype.set;olympe.sc.xa.prototype.getClosest=olympe.sc.xa.prototype.yu;
|
|
890
|
+
olympe.sc.xa.prototype.getParent=olympe.sc.xa.prototype.getParent;olympe.sc.xa.C={PRODUCTION:'__production',EDITION:'__editionMode',TRANSACTION:'__transaction',Sf:'__htmlContainer',sx:'__dockableElement'};olympe.sc.Op=class extends olympe.sc.xa{constructor(a){super(a);this.L=new olympe.D.Jb('SC Update Context',super.F());const b=a.yg(()=>{b&&a.Xj(b);this.L.destroy()})}F(){return this.L}yg(a,b){return this.F().onDestroy(a,null!=b?b:olympe.Z.hc())}};function Jk(a,b){b=olympe.dc.fa(b);let c,d,e,f;return null!=(f=null!=(e=null==(c=a.$)?void 0:c.get('I#'+b))?e:null==(d=a.$)?void 0:d.get('IO#'+b))?f:b}function Kk(a,b){if(b===a.id||a.L.has(b)||!b)return a;for(a=a.da;a;){if(b===a.W()||a.L.has(b))return a;const c=Mk(a.F,b);if(c)return c;a=a.getParent()}return null}function Lk(a,b){let c;return(null==(c=a.$)?void 0:c.get('IO#'+b))||null}
|
|
890
891
|
function Nk(a){a.C.$(()=>{Ok(a,c=>c.destroy())});a.C.onDestroy(()=>{void 0!==a.Ta(olympe.sc.xa.C.TRANSACTION,!1)&&a.K.warn(`The context ${a.W()} is being destroyed but still has unreleased transactions. You probably forgot to end a transaction.`);let c;if(null!=(c=a.da)){let d;null==(d=c.F)||d.delete(a.W());let e;0===(null==(e=c.F)?void 0:e.size)&&(c.F=null)}a.L.clear()});let b;null==(b=a.da)||Pk(b,a)}
|
|
891
|
-
function Mk(a,b){if(null===a)return null;if(a.has(b))return a.get(b);for(const c of a.values())if(c.
|
|
892
|
+
function Mk(a,b){if(null===a)return null;if(a.has(b))return a.get(b);for(const c of a.values())if(c.ga&&!c.id.startsWith('_')&&(a=Mk(c.F,b)))return a;return null}function Qk(a,b){a.Da=olympe.dc.fa(b);a.ga=b.sd().hm();b.F().forEach(c=>{a.id===c||a.L.has(c)||(a.L.add(c),Hk(a,c,a))});a.$=b.T()}function Rk(a){a.na=!0;let b;null==(b=a.F)||b.forEach(c=>{Rk(c)})}function Sk(a){a.na=!1;let b;null==(b=a.F)||b.forEach(c=>{Sk(c)})}
|
|
892
893
|
function Tk(a,...b){var c=olympe.sc.tb.ue.C.ql;if(null!==a.tb)for(const {$j:d,depth:e}of a.tb.values())d.process(a,c,e,...b)}function Uk(a,b,c,d){const e='$'+b;a.T.add(b);c.map(f=>'@'+f+'.'+b).forEach(f=>{let g,h;null==(g=a.G)||null==(h=g.get(f))||h.forEach(k=>{k(d)})});Ok(a,f=>{!f.na&&f.T.has(b)||f.data.has(e)||Uk(f,b,c,d)});a.T.delete(b)}
|
|
893
894
|
function Vk(a,b,c){a.G||(a.G=new Map);let d=a.G.get(b);void 0===d&&(d=new Map,a.G.set(b,d));olympe.sc.vd.C+=1;const e=olympe.sc.vd.C;d.set(e,c);return()=>{const f=a.G.get(b);f&&(f.delete(e),0===f.size&&a.G.delete(b))}}function Hk(a,b,c){a.T.add(b);let d;const e=null==(d=a.G)?void 0:d.get('&'+b);if(e)for(const f of e.values())f(c);Ok(a,f=>{f.T.has(b)||Hk(f,b,c)});a.T.delete(b)}function Ok(a,b){let c;null==(c=a.F)||c.forEach(b)}function Wk(a,b){a.data.forEach((c,d)=>b(c,d.slice(1)))}
|
|
894
895
|
function Xk(a,b){if(null!==a.tb&&a.tb.has(b)){var {$j:c,depth:d}=a.tb.get(b);Ok(a,e=>{Xk(e,b)});0===d&&c.F();a.tb.delete(b);0===a.tb.size&&(a.tb=null)}}function Yk(a,b,c=0){null===a.tb&&(a.tb=new Map);a.tb.has(b.W())||(a.tb.set(b.W(),{$j:b,depth:c}),Ok(a,d=>{(-1===b.G||c<b.G)&&Yk(d,b,c+1)}),a.onDestroy(()=>{Xk(a,b.W())}));b.W()}function Zk(a){var b=olympe.sc.tb.ue.F.Df;const c=[];if(null!==a.tb)for(const {$j:d}of a.tb.values())d.getType()===b&&(c.push(d.W()),d.F(),Xk(a,d.W()))}
|
|
895
896
|
function Pk(a,b){null===a.F&&(a.F=new Map);a.F.set(b.id,b)}
|
|
896
|
-
olympe.sc.vd=class{constructor(a,b='no name',c=olympe.sc.um){this.id=a;this.Xc=b;this.L=new Set;this.da=c;this.C=new olympe.D.Jb('SC Context');this.data=new Map;this.Da=this.P=this.F=this.G=null;this.
|
|
897
|
+
olympe.sc.vd=class{constructor(a,b='no name',c=olympe.sc.um){this.id=a;this.Xc=b;this.L=new Set;this.da=c;this.C=new olympe.D.Jb('SC Context');this.data=new Map;this.Da=this.P=this.F=this.G=null;this.ga=!1;this.T=new Set;this.na=!1;this.$=null;this.K=olympe.la.fb('sc');this.tb=null;Nk(this)}W(){return this.id}getParent(){return this.da}Ee(){return this.Da}set(a,b){if(!this.C.Bc()&&!this.C.gb()){const f=olympe.dc.fa(a);var c,d,e;let g;a=null!=(g=null!=(e=null==(c=this.$)?void 0:c.get('O#'+f))?e:null==
|
|
897
898
|
(d=this.$)?void 0:d.get('IO#'+f))?g:f;c='$'+a;(d=this.data.get(c))&&d.valueOf&&(d=d.valueOf());void 0===b||null===b?void 0!==d&&(this.data.delete(c),null!==this.tb&&0<this.tb.size&&Tk(this,a,null),Uk(this,a,['*',this.id,...this.L],null)):((e=void 0===d)||(e=!('function'===typeof b.Ha?b.Ha(d):b.valueOf()===d.valueOf())),e&&(this.data.set(c,b),null!==this.tb&&0<this.tb.size&&Tk(this,a,b),Uk(this,a,['*',this.id,...this.L],b)))}}on(a,b,c,d=!0){if(this.C.gb()||this.C.Bc())return()=>{};const e=Jk(this,
|
|
898
|
-
a),f=c?olympe.dc.
|
|
899
|
+
a),f=c?olympe.dc.fa(c):'*';a=Vk(this,'@'+f+'.'+e,b);c=c?(c=Kk(this,f))?c.Ta(e,!1):void 0:this.Ta(e);void 0!==c&&b(c);if(d)olympe.D.Ma().onDestroy(a);return a}has(a,b=!1){a='$'+Jk(this,a);let c=this.data.has(a),d=this.getParent();if(b)for(;!c&&d;)c=d.data.has(a),d=d.getParent();return c}gh(a,b,c){const d=null!=c?c:'_'+olympe.Z.hc();if(a.gb()||a.Bc())throw Error(`Try to create new child context in a destroyed context ${a.W()}, probably because \`runner()\` is called on a destroyed context`);const e=
|
|
899
900
|
a.run(()=>new olympe.sc.vd(d,b,this));null!==this.tb&&0<this.tb.size&&this.tb.forEach(({$j:f,depth:g})=>{(-1===f.G||g<f.G)&&Yk(e,f,g+1)});return e}Zj(a,b){const c=Kk(this,a);if(c)return b(c),()=>{};const d=Vk(this,'&'+a,e=>{d&&d();b(e)});return d}Ta(a,b=!0){a='$'+Jk(this,a);let c=this.data.get(a),d=this.getParent();if(b)for(;void 0===c&&null!==d;)c=d.data.get(a),d=d.getParent();return c}destroy(){this.C.Bc()||this.C.gb()||this.C.destroy()}yg(a,b){if(this.C.gb())a();else return++olympe.sc.vd.C,b=b||
|
|
900
901
|
String(olympe.sc.vd.C),null===this.P&&(this.P=new Map),this.P.set(b,a),b;return b||'noId'}Xj(a){null!==this.P&&this.P.delete(a)}onDestroy(a){return this.gb()?(a(),'noId'):this.C.onDestroy(a)}clear(){if(!this.C.Bc()&&!this.C.gb()){let a;null==(a=this.P)||a.forEach(b=>b())}}gb(){return this.C.gb()}};olympe.sc.vd.prototype.getParent=olympe.sc.vd.prototype.getParent;olympe.sc.vd.C=0;olympe.sc.vd.F={Pr:'I#',Rs:'O#',oy:'IO#'};function $k(a,b,c){return(c=c.Ee())?`${a}.${c}.${b}`:`${a}.${b}`}olympe.sc.tb.ue=class{constructor(a=-1){this.id=olympe.Z.ef();this.active=!0;this.G=a}F(){this.active=!1}W(){return this.id}getType(){}process(){}};olympe.sc.tb.ue.C={ql:'SET'};olympe.sc.tb.ue.F={Df:'REMOTE',ys:'LOCAL'};olympe.sc.yd=class a{constructor(){this.F=this.L=this.P=null;this.T=new Map;this.G=new Map;this.C=new olympe.Z.yl(1E4);Ka(this.C,b=>{Zk(b)})}da(b,c,d){const e=b.body(),f=e.c,g=this.T.get(f);switch(e.t){case olympe.sc.yd.C.Ss:c=this.G.get(e.f);b.ed(c).catch(m=>{d.error('Unable to reply with paths: ',m)});break;case olympe.sc.yd.C.Ts:const h=f+c,k=(m,n,p=0)=>{Wk(m,(q,r)=>{let t;q instanceof olympe.dc.CloudObject?t=a.G(q):t=q;let u;q=null!=(u=m.Ee())?u:'';0<q.length&&(q+='.');n.push([`${p}.${q}${r}`,
|
|
901
|
-
t])})};b.qm(h).then(()=>{const m=[];k(g,m,0);Ok(g,p=>{k(p,m,1)});olympe.O.qb.publish(h,{t:olympe.sc.yd.C.Nr,v:m,ts:0}).catch(p=>{d.error('Error publishing on service : ',p)});const n=new olympe.sc.tb.ft(h);Yk(g,n);this.C.has(g)?Ja(this.C,g):this.C.add(g)}).catch(m=>{d.error('Error notifying on a contextId : ',m)});break;case olympe.sc.yd.C.Us:void 0!==g&&this.C.has(g)&&Ja(this.C,g);break;case olympe.sc.yd.C.Dk:void 0!==g&&(this.C.delete(g),Zk(g))}}
|
|
902
|
+
t])})};b.qm(h).then(()=>{const m=[];k(g,m,0);Ok(g,p=>{k(p,m,1)});olympe.O.qb.publish(h,{t:olympe.sc.yd.C.Nr,v:m,ts:0}).catch(p=>{d.error('Error publishing on service : ',p)});const n=new olympe.sc.tb.ft(h);Yk(g,n);this.C.has(g)?Ja(this.C,g):this.C.add(g)}).catch(m=>{d.error('Error notifying on a contextId : ',m)});break;case olympe.sc.yd.C.Us:void 0!==g&&this.C.has(g)&&Ja(this.C,g);break;case olympe.sc.yd.C.Dk:void 0!==g&&(this.C.delete(g),Zk(g))}}ga(b,c,d){this.P=new olympe.O.qb('discovery_debug_id',
|
|
902
903
|
c);this.P.listen().subscribe(e=>{var f=e.body();if(f.t===olympe.sc.yd.C.nr){e=f.i;f=f.f;if(!this.G.has(f)){const g=this.$(f,c,b);if(0!==g.length)this.G.set(f,g);else return}null===this.F&&(this.F=olympe.Z.ef(),f=new olympe.D.Jb(this.F,c.F()),this.L=new olympe.O.qb(this.F,f),this.L.listen().subscribe(g=>{this.da(g,b,d)}));olympe.O.qb.publish(e,{t:olympe.sc.yd.C.Iq,n:olympe.V.getParameter(olympe.sc.U.tn)||'no name',a:b,s:this.F}).catch(g=>{d.error('Error publishing on draw service : '+g)})}})}$(b,c,
|
|
903
904
|
d){const e=[],f=olympe.dc.ta(),g=(h,k)=>{Ok(h,m=>{if(null!==m.Ee()){const n=olympe.dc.CloudObject.get(m.Ee()).Ij(olympe.sc.Runnable.L).Ad();if(null!==n){const p=k+'/'+f.name(n);n.X()===b&&(e.push([p,m.W()]),this.T.set(m.W(),m));g(m,p)}}})};g(c.C,f.name(d));return e}static F(b,c,d){let e=d;d instanceof olympe.dc.CloudObject&&(e=a.G(d));olympe.O.qb.publish(b,{t:olympe.sc.yd.C.Bj,k:c,v:e,ts:Date.now()}).catch(f=>{olympe.la.fb('Debugger').error('Error publishing on service : ',f)})}static G(b){if(null===
|
|
904
905
|
b||void 0===b)return'<null>';const c=olympe.dc.ta();if(b instanceof olympe.dc.CloudObject){var d=b.nc();if(!c.$c(d,olympe.sc.Jc))return b.toString();let f=`${b.Dd().name()} (${b.X()})`;var e=olympe.dc.CloudObject.get(d);d=olympe.dc.ra.from(e).Mf(olympe.dc.CloudObject.extendRel,!0).Nd().eb(olympe.dc.CloudObject.propertyRel).Nd().Ad();e=olympe.dc.ra.from(e).Mf(olympe.dc.CloudObject.extendRel,!0).Nd().eb(olympe.dc.CloudObject.xi).Nd().Ad();d=d.filter(([g])=>g instanceof olympe.sc.Jc);0!==d.length&&(f+=
|
|
@@ -907,13 +908,13 @@ e,f)});this.C.set(e,()=>{Ef(this.db,f,h)})}olympe.sc.yd.F(this.L,e,f)}}};olympe.
|
|
|
907
908
|
olympe.sc.Oc.prototype.C.J=new olympe.D.H(()=>olympe.dc.ua,[]);olympe.sc.Oc.prototype.F.J=new olympe.D.H(()=>olympe.dc.ua,[]);function al(a,b){[].forEach(c=>c.call(a,b,(d,e)=>{null===e?b.remove(d):b.set(d,e)}))}function bl(a,b){b=b.filter(c=>'string'===typeof c&&a.db.$c(c,olympe.sc.logic.Lb));b.sort((c,d)=>{let e;c=null!=(e=a.db.Qa(c,olympe.sc.logic.Lb.C,!0))?e:0;let f;d=null!=(f=a.db.Qa(d,olympe.sc.logic.Lb.C,!0))?f:0;return c-d});return b}
|
|
908
909
|
olympe.sc.Xa=class extends olympe.dm.BrickMetadata{ls(a,b,c,d,e=!0){e||olympe.la.fb('sc').error('parameter own= false ignored, investigate');return olympe.D.zg(N(this.kf(a,olympe.dc.Fb.kg,c)),d)}pv(){return this.ib(olympe.sc.Xa.P,olympe.sc.Runnable)}Cu(){return this.ib(olympe.sc.Xa.T,olympe.sc.Runnable)}km(){return this.db.Qa(this,olympe.sc.Xa.da)}hm(){return null!==this.db.Tb(this.tag,olympe.sc.Runnable.C.Rb())}Wk(){return this.ib(olympe.sc.Xa.F,olympe.sc.logic.ob)}Xi(){return this.ib(olympe.sc.Xa.G,
|
|
909
910
|
olympe.sc.logic.wb)}};olympe.sc.Xa.N=olympe.dc.ka.C('0112000000000000def0',olympe.sc.Xa);olympe.sc.Xa.da=olympe.sc.Xa.N.ja('01692aa71f3108454479');olympe.sc.Xa.mb=olympe.sc.Xa.N.ja('0166446c1f128ebc903a');olympe.sc.Xa.P=olympe.sc.Xa.N.pa('01692a4af82e8984742c');olympe.sc.Xa.T=olympe.sc.Xa.N.pa('01692a4af82e8984742d');olympe.sc.Xa.$=olympe.sc.Xa.N.pa('01692a4af82e8984742e');olympe.sc.Xa.F=olympe.sc.Xa.N.pa('01621fb84e320000f00a');olympe.sc.Xa.G=olympe.sc.Xa.N.pa('01621fb84e320000f00b');
|
|
910
|
-
olympe.sc.Xa.ac=olympe.sc.Xa.N.pa('0171838bcfed0000e00e');olympe.sc.Xa.Wb=olympe.sc.Xa.N.pa('0171838bcfed0000a00a');l=olympe.sc.Xa.prototype;l.ls.J=olympe.D.H.C;l.pv.J=new olympe.D.H(()=>olympe.dc.ua,[]);l.Cu.J=new olympe.D.H(()=>olympe.dc.ua,[]);l.km.J=olympe.D.H.C;l.hm.J=olympe.D.H.C;l.Wk.J=new olympe.D.H(()=>olympe.dc.ua,[]);l.Xi.J=new olympe.D.H(()=>olympe.dc.ua,[]);function cl(a){const b=olympe.dc.CloudObject.fq(new Map,a);olympe.D.Ma().onDestroy(()=>{const c=new olympe.dc.Sa;c.delete(b);c.lb()});return b}function dl(a,b){Qk(b.C,a);al(a.sd(),b);const c=a.L(),d=el(b,c),e=[];c.forEach((f,g)=>{f===a.
|
|
911
|
+
olympe.sc.Xa.ac=olympe.sc.Xa.N.pa('0171838bcfed0000e00e');olympe.sc.Xa.Wb=olympe.sc.Xa.N.pa('0171838bcfed0000a00a');l=olympe.sc.Xa.prototype;l.ls.J=olympe.D.H.C;l.pv.J=new olympe.D.H(()=>olympe.dc.ua,[]);l.Cu.J=new olympe.D.H(()=>olympe.dc.ua,[]);l.km.J=olympe.D.H.C;l.hm.J=olympe.D.H.C;l.Wk.J=new olympe.D.H(()=>olympe.dc.ua,[]);l.Xi.J=new olympe.D.H(()=>olympe.dc.ua,[]);function cl(a){const b=olympe.dc.CloudObject.fq(new Map,a);olympe.D.Ma().onDestroy(()=>{const c=new olympe.dc.Sa;c.delete(b);c.lb()});return b}function dl(a,b){Qk(b.C,a);al(a.sd(),b);const c=a.L(),d=el(b,c),e=[];c.forEach((f,g)=>{f===a.ga?e[0]=g:f===a.da&&(e[1]=g)});void 0!==e[0]&&void 0!==e[1]&&(fl(a,d[e[0]],d[e[1]]),c[e[0]]=null,c[e[1]]=null);c.forEach((f,g)=>{f&&f.call(a,b,d[g])})}
|
|
911
912
|
function gl(a,b){var c=a.nc();const d=a.db.name(c),e=`Brick ${d} successfully run`,f=`Brick ${d} successfully cleared`,g=a.C(b);c=a.setupExecution(b).pipe(rxjs.operators.map(h=>{if(!b.gb()&&(b.clear(),null!==h)){const k=Array.isArray(h)?h:[h],m=new olympe.sc.Op(b.C);m.F().run(()=>v(function*(){try{yield a.update(m,k,g)}catch(n){a.P(m,n)}}));return!0}return!1})).subscribe(rxjs.Subscriber.create(h=>h?a.K.debug(e):a.K.debug(f),a.P.bind(a,b),()=>a.K.debug(`Brick ${d} completed`)));b.onDestroy(c.unsubscribe.bind(c))}
|
|
912
913
|
function hl(a,b,c,d){const e=d.F(),f=W(a.db,b,c,e.G((g,h)=>{const k=Gk(d,h);g?olympe.dc.CloudObject.get(h).run(k):k.destroy()}));e.onDestroy(a.db.F.bind(a.db,b,c,f,!0))}function el(a,b){if(1===b.length)return[(d,e)=>{null!==e?a.set(d,e):a.remove(d)}];const c=b.map(()=>new Map);return c.map(d=>(e,f)=>{null!==f?d.set(e,f):d.delete(e);a:{for(const g of c)if(f=g.get(e),void 0!==f){a.set(e,f);break a}a.remove(e)}})}
|
|
913
914
|
function fl(a,b,c){const d=olympe.D.Ma(),e=Df(a.db,a.tag,d.G((f,g,h)=>{const k=h?c:b;null!==k&&(null===g||void 0===g?k(f,null):k(f,olympe.sc.kg(g)),h&&b&&b(f,null))}));d.onDestroy(()=>{Ef(a.db,a.tag,e)})}
|
|
914
915
|
olympe.sc.Runnable=class extends olympe.dm.BrickMetadata{constructor(a,b,c){super(a,b);this.K=c}run(a){a.F().run(()=>{dl(this,a);this.init(a);if(this.sd().km())gl(this,a);else{const b=new olympe.sc.Op(a.C);b.F().run(()=>this.update(b,[],[]))}a.Am(olympe.sc.Xa.mb);a.yg(this.clear.bind(this,a));a.onDestroy(this.destroy.bind(this,a))})}sd(){return this.Dd()}init(a){this.onInit(a)}update(a,b,c){const d=this.sd();if(d.km())this.onUpdate(a,b,c);else this.K.debug(`Softcoded runnable ${this.db.name(this)} with tag ${this.tag} running in context ${a.W()}`),
|
|
915
916
|
hl(this,d,olympe.sc.Xa.P,a),this.na()&&hl(this,d,olympe.sc.Xa.$,a)}clear(){}destroy(a){this.onDestroy(a)}setupExecution(){return rxjs.of([])}C(){return[]}onInit(){}onUpdate(){const a=this.nc(),b=this.db.name(a),c=this.db.name(this.db.model(a));this.K.error(`No code was found for the following brick: ${b}: ${c} (${a})\n\n`+'This is probably because the code has not yet been deployed to the environment, or because the package.json does not import the required dependencies.')}onDestroy(){}getInputs(){var a=
|
|
916
|
-
this.sd();return bl(a,a.db.ib(a.tag,olympe.sc.Xa.F))}getOutputs(){var a=this.sd();return bl(a,a.db.ib(a.tag,olympe.sc.Xa.G))}F(){return[]}T(){return new Map}na(){return!1}G(a,b,c,d){a=b.vb(a,c,!0);void 0!==d&&olympe.D.zg(a,d);return a}ub(a,b,c,d,e){olympe.D.tm([d],f=>{b.set(a,olympe.D.xq(f)?f.valueOf():f)});return this.G(a,b,c,e)}L(){return[this.
|
|
917
|
+
this.sd();return bl(a,a.db.ib(a.tag,olympe.sc.Xa.F))}getOutputs(){var a=this.sd();return bl(a,a.db.ib(a.tag,olympe.sc.Xa.G))}F(){return[]}T(){return new Map}na(){return!1}G(a,b,c,d){a=b.vb(a,c,!0);void 0!==d&&olympe.D.zg(a,d);return a}ub(a,b,c,d,e){olympe.D.tm([d],f=>{b.set(a,olympe.D.xq(f)?f.valueOf():f)});return this.G(a,b,c,e)}L(){return[this.ga,this.da]}ga(a,b){fl(this,b,null)}da(a,b){fl(this,null,b)}Eb(a,b){const c=this.db,d=olympe.sc.logic.hb.G.Rb(),e=olympe.sc.logic.hb.F,f=olympe.sc.logic.hb.C;
|
|
917
918
|
this.mq(d,g=>{var h=g.X();if(h=c.Tb(h,e)||c.Tb(h,f))return il(g,a,b.bind(null,h))})}P(a,b){b=b instanceof Error?`${b.message}\n${b.stack}`:b;this.K.error(`An error occurred in brick ${Fk(a)} (${this.nc()}):\n${b}`)}};olympe.sc.Runnable.N=Fe(olympe.dc.ka.C('01130000000000ca1100',olympe.sc.Runnable));olympe.sc.Runnable.L=olympe.sc.Runnable.N.pa('01692a4af82e8984742b');olympe.sc.Runnable.C=olympe.sc.Runnable.N.pa('01756a18d4921c103111');olympe.sc.Runnable.P=U(olympe.sc.Runnable.N,olympe.sc.Xa.P);
|
|
918
919
|
olympe.sc.Runnable.T=U(olympe.sc.Runnable.N,olympe.sc.Xa.T);olympe.sc.Runnable.$=U(olympe.sc.Runnable.N,olympe.sc.Xa.$);U(olympe.sc.Xa.N,olympe.sc.Runnable.L);U(olympe.sc.Xa.N,olympe.sc.Runnable.C);olympe.sc.Runnable.prototype.sd.J=new olympe.D.H(()=>olympe.sc.Xa,[]);olympe.sc.Runnable.prototype.G.J=new olympe.D.H(()=>Object,[]);olympe.sc.Runnable.prototype.ub.J=olympe.D.H.C;function jl(a){if(a){if('string'===typeof a)return a;if(a instanceof olympe.sc.be)return(a=a.F())?a.valueOf():null;if('function'===typeof a.X)return a.X()}return null}olympe.sc.be=class extends olympe.dc.CloudObject{F(){return this.db.ib(this,olympe.sc.be.C)[0]}C(){return olympe.dc.CloudObject.get(jl(this))}toString(){const a=jl(this);let b;a&&(b=this.db.name(a));return b||super.toString()}};olympe.sc.be.N=olympe.dc.ka.C('0163c9ae01f2d6e9ca49',olympe.sc.be);olympe.sc.be.C=olympe.sc.be.N.pa('0169b5a8a33144fb0b49');
|
|
919
920
|
U(olympe.dc.CloudObject.N,olympe.sc.be.C);olympe.sc.be.prototype.F.J=new olympe.D.H(()=>String,[]);olympe.sc.be.prototype.C.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);olympe.sc.wn=class extends olympe.dm.Bb{Ud(){return olympe.sc.ud.xe.Gg}};olympe.sc.wn.N=olympe.dc.ka.C('0163a68ce44f3d1fa84c',olympe.sc.wn);olympe.sc.Jc=class extends olympe.dm.BrickMetadata{};olympe.sc.Jc.N=olympe.dc.ka.C('016324fde11a836f76c2',olympe.sc.Jc);olympe.sc.Jc.C=olympe.sc.Jc.N.pa('016324fde11a836087c2');olympe.sc.Jc.N.C=function(a,b){return tj(a,null!=b?b:'New type',olympe.sc.Jc).X()};let kl=null;
|
|
@@ -922,12 +923,12 @@ olympe.sc.Vc=class extends olympe.dc.CloudObject{};olympe.sc.Vc.Pb={po:0,bl:1,Db
|
|
|
922
923
|
h=new Date;c=(new Map).set(olympe.dm.File.fileNameProp,null!=c?c:'file').set(olympe.dm.File.urlProp,d).set(olympe.dm.File.modificationDateProp,h).set(olympe.dm.File.mimeTypeProp,null!=e?e:'application/data');g&&null!==f.Qa(b,olympe.dm.File.urlProp)||c.set(olympe.dm.File.creationDateProp,h).set(olympe.dm.File.C,!1);a.zq(b,c)}};olympe.sc.File.setURLContent=olympe.sc.File.xm;olympe.sc.File.setContent=olympe.sc.File.Cq;olympe.sc.File.createFromURL=olympe.sc.File.cu;olympe.sc.File.createFromContent=olympe.sc.File.bu;
|
|
923
924
|
olympe.sc.File.N=ze(olympe.dm.File,'ff021000000000000031',olympe.sc.File);olympe.sc.Xf=class extends olympe.sc.File{L(){const a=olympe.D.ec(olympe.D.Ka);this.Lj(b=>{a.update(olympe.D.sb(b))});return a.vb()}};olympe.sc.Xf.N=ze(olympe.sc.File,'01644b6297305d62fca2',olympe.sc.Xf);olympe.sc.Xf.N.C=olympe.sc.File.F.bind(null,olympe.sc.Xf);olympe.sc.Xf.prototype.L.J=olympe.D.H.F;olympe.sc.rc=class extends olympe.sc.File{L(){return this.rb(olympe.sc.rc.fontFamilyProp)}P(){return this.rb(olympe.sc.rc.G)}T(){return this.Gc(olympe.sc.rc.L)}};olympe.sc.rc.N=ze(olympe.sc.File,'01647e113043c637b541',olympe.sc.rc);olympe.sc.rc.fontFamilyProp=olympe.sc.rc.N.ja('01647e35ecd24ef0b88d');olympe.sc.rc.G=olympe.sc.rc.N.ja('01647e677f5d1cfbdf42');olympe.sc.rc.L=olympe.sc.rc.N.ja('01647e6780999bf8bd25');
|
|
924
925
|
olympe.sc.rc.N.C=(a,b,c,d)=>{c=olympe.sc.File.F(olympe.sc.rc,a,b,c,d);a.update(c,olympe.sc.rc.fontFamilyProp,b.split('.')[0]);return c};olympe.sc.rc.prototype.L.J=olympe.D.H.F;olympe.sc.rc.prototype.P.J=olympe.D.H.F;olympe.sc.rc.prototype.T.J=olympe.D.H.G;olympe.sc.Zg=class extends olympe.sc.File{};olympe.sc.Zg.N=ze(olympe.sc.File,'0164643c432146a71d5c',olympe.sc.Zg);olympe.sc.Zg.N.C=olympe.sc.File.F.bind(null,olympe.sc.Zg);olympe.sc.Qp=class extends olympe.dc.CloudObject{};olympe.sc.Qp.N=olympe.dc.ka.C('016421bb3797e22d1c4e',olympe.sc.Qp);olympe.sc.logic={};olympe.sc.logic.Sn=(a,b)=>a===b?0:a>b?1:-1;
|
|
925
|
-
olympe.sc.logic.uy=(a,b,c,d,e,f,g)=>{const h=b.X();b=olympe.D.Ta(b.getType().X());let k,m;if(b===olympe.dc.
|
|
926
|
+
olympe.sc.logic.uy=(a,b,c,d,e,f,g)=>{const h=b.X();b=olympe.D.Ta(b.getType().X());let k,m;if(b===olympe.dc.fa(olympe.dm.String))k=c.valueOf().toLowerCase(),m=p=>p.rb(h).toLowerCase();else if(b===olympe.dc.fa(olympe.dm.Number))k=c.valueOf(),m=p=>p.Gc(h);else if(b===olympe.dc.fa(olympe.dm.DateTime))k=c.getTime(),m=p=>olympe.D.sa([p.mi(h)],q=>q.getTime(),Number,'FilterList Date&DateTime TransformFlows');else{c=olympe.dc.ta().name(b);g.warn(`Properties of type ${c} are not supported. List will not be filtered.`);e(a);
|
|
926
927
|
return}let n;if('<'===f)n=(p,q)=>olympe.sc.logic.Sn(q,p);else if('>'===f)n=(p,q)=>olympe.sc.logic.Sn(p,q);else{g.error(`Unknown inequality ${f}. Please use '<' or '>'`);return}e(a.Kf().filter(p=>olympe.D.sa([m(p)],q=>{q=n(q.valueOf(),k);return olympe.D.Ib(d.valueOf()?1===q:0<=q)},olympe.D.ea,'FilterList ListDefBuilder Filter TransformFlows')).Ve())};
|
|
927
928
|
olympe.sc.logic.aB=(a,b)=>{if(a instanceof olympe.D.aa)return a;if(a instanceof olympe.D.Ka)return a.Fq();if(a instanceof olympe.D.ea)return a.rq();if('string'===typeof a||'number'===typeof a)return olympe.D.oa(Number(a));b.error(`Could not parse provided value ${a} into a number`);return olympe.D.aa.zo};olympe.sc.logic.Oa={};function ml(a){Ee(a.N,(b,c)=>{b=b.create(a.N.F);Z(b,olympe.dc.CloudObject.nameProp,c);return b.X()})}olympe.sc.logic.Oa.Ln=class{constructor(a,b,c){this.N=olympe.dc.ka.C(a,b,...c);ml(this)}X(){return this.N.X()}};olympe.sc.logic.Oa.Ln.va=[olympe.dc.pe];const nl=Object.create(null),ol=new Map;function pl(a){if(void 0===nl[a])throw Error(`Tag: ${a} - does not correspond to a registered function`);return Be(a)}function ql(a,b,c=olympe.sc.logic.Function){if(ol.has(a))throw c=pl(a),Error(`Tag: ${a} - overwriting existing function definition "${c.name}" with "${b.name}"`);const d=olympe.dc.ka.C(a,b,...[]);ol.set(a,{N:d,qB:b,YA:c});return d}
|
|
928
929
|
olympe.sc.logic.ka=class{constructor(){}static C(a,b,...c){if(nl[a])throw c=pl(a),Error(`Tag: ${a} - overwriting already defined function "${c.name}" with "${b.name}"`);b=new olympe.sc.logic.Oa.Ln(a,b,[olympe.sc.R.za].concat(c));return nl[a]=b}};olympe.sc.logic.gx=class{};olympe.sc.logic.Mi=class extends olympe.dc.CloudObject{};olympe.sc.logic.Mi.N=olympe.dc.ka.C('01621fb84e320000cf00',olympe.sc.logic.Mi);olympe.sc.logic.Error=class{constructor(a,b){this.code=a;this.C=b}static create(a,b){return new olympe.sc.logic.Error(b,a)}bv(){return this.C}zu(){return this.code}};B('olympe.sc.logic.Error',olympe.sc.logic.Error);olympe.sc.logic.Error.prototype.getCode=olympe.sc.logic.Error.prototype.zu;olympe.sc.logic.Error.prototype.getMessage=olympe.sc.logic.Error.prototype.bv;olympe.sc.logic.Error.create=olympe.sc.logic.Error.create;
|
|
929
|
-
olympe.sc.logic.Ih=class extends olympe.sc.logic.Mi{static create(a,b){return new olympe.sc.logic.Error(b,a)}};olympe.sc.logic.Ih.N=olympe.dc.ka.C('016eeb5ede9f3094d8f0',olympe.sc.logic.Ih);olympe.sc.logic.Mc=class extends olympe.dc.CloudObject{C(){return this.Yb(olympe.sc.logic.Mc.C,olympe.dc.CloudObject)}};olympe.sc.logic.Mc.N=olympe.dc.ka.C('016ac4f59ee8ea2081ba',olympe.sc.logic.Mc);olympe.sc.logic.Mc.F=olympe.sc.logic.Mc.N.ja('017bc044aeacce7ffc8f');olympe.sc.logic.Mc.C=olympe.sc.logic.Mc.N.pa('016ac4f5a0091c4790e2');U(olympe.dc.CloudObject.N,olympe.sc.logic.Mc.C);olympe.sc.logic.Mc.prototype.C.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.bg=class extends olympe.sc.logic.Mc{};olympe.sc.logic.bg.N=olympe.dc.ka.C('016ac4f59c592b862457',olympe.sc.logic.bg);olympe.sc.logic.bg.G=olympe.sc.Oc.C.Rb();olympe.sc.logic.bg.N.C=(a,b,c,d,e)=>{b=tj(a,b||'New Predefined Input',olympe.sc.logic.bg,olympe.sc.logic.ob);Z(b,olympe.sc.logic.Mc.F,e);a.Ea(olympe.sc.logic.Mc.C,b,c);a.Ea(olympe.sc.Oc.C,d,b);return b.X()};olympe.sc.logic.Cf=class extends olympe.sc.logic.Mc{};olympe.sc.logic.Cf.N=olympe.dc.ka.C('016ac4f59dd99f5df3e1',olympe.sc.logic.Cf);olympe.sc.logic.Cf.G=U(olympe.sc.logic.Cf.N,olympe.sc.Oc.F);olympe.sc.logic.Cf.N.C=(a,b,c,d,e)=>{b=tj(a,b||'New Predefined Output',olympe.sc.logic.Cf,olympe.sc.logic.wb);Z(b,olympe.sc.logic.Mc.F,e);a.Ea(olympe.sc.logic.Mc.C,b,c);a.Ea(olympe.sc.Oc.F,d,b);return b.X()};olympe.sc.logic.Jd=class extends olympe.sc.Xa{Ud(){return olympe.sc.ud.xe.xp}$(){return this.Wl().Kf().$c([olympe.sc.logic.Function]).and().Sc().$c([olympe.sc.logic.Ic,olympe.sc.logic.Kc]).Ve()}Ru(){return this.Wk().Kf().oi([olympe.dc.CloudObject.modelRel,olympe.sc.logic.bg.G]).Ve()}Su(){return this.Xi().Kf().oi([olympe.dc.CloudObject.modelRel,olympe.sc.logic.Cf.G]).Ve()}Rd(a){const b=this.db.Tl(this,[olympe.sc.Xa.F],c=>this.db.model(c)===olympe.dc.
|
|
930
|
-
this.db.Tl(this,[olympe.sc.Xa.G],c=>this.db.model(c)===olympe.dc.
|
|
930
|
+
olympe.sc.logic.Ih=class extends olympe.sc.logic.Mi{static create(a,b){return new olympe.sc.logic.Error(b,a)}};olympe.sc.logic.Ih.N=olympe.dc.ka.C('016eeb5ede9f3094d8f0',olympe.sc.logic.Ih);olympe.sc.logic.Mc=class extends olympe.dc.CloudObject{C(){return this.Yb(olympe.sc.logic.Mc.C,olympe.dc.CloudObject)}};olympe.sc.logic.Mc.N=olympe.dc.ka.C('016ac4f59ee8ea2081ba',olympe.sc.logic.Mc);olympe.sc.logic.Mc.F=olympe.sc.logic.Mc.N.ja('017bc044aeacce7ffc8f');olympe.sc.logic.Mc.C=olympe.sc.logic.Mc.N.pa('016ac4f5a0091c4790e2');U(olympe.dc.CloudObject.N,olympe.sc.logic.Mc.C);olympe.sc.logic.Mc.prototype.C.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.bg=class extends olympe.sc.logic.Mc{};olympe.sc.logic.bg.N=olympe.dc.ka.C('016ac4f59c592b862457',olympe.sc.logic.bg);olympe.sc.logic.bg.G=olympe.sc.Oc.C.Rb();olympe.sc.logic.bg.N.C=(a,b,c,d,e)=>{b=tj(a,b||'New Predefined Input',olympe.sc.logic.bg,olympe.sc.logic.ob);Z(b,olympe.sc.logic.Mc.F,e);a.Ea(olympe.sc.logic.Mc.C,b,c);a.Ea(olympe.sc.Oc.C,d,b);return b.X()};olympe.sc.logic.Cf=class extends olympe.sc.logic.Mc{};olympe.sc.logic.Cf.N=olympe.dc.ka.C('016ac4f59dd99f5df3e1',olympe.sc.logic.Cf);olympe.sc.logic.Cf.G=U(olympe.sc.logic.Cf.N,olympe.sc.Oc.F);olympe.sc.logic.Cf.N.C=(a,b,c,d,e)=>{b=tj(a,b||'New Predefined Output',olympe.sc.logic.Cf,olympe.sc.logic.wb);Z(b,olympe.sc.logic.Mc.F,e);a.Ea(olympe.sc.logic.Mc.C,b,c);a.Ea(olympe.sc.Oc.F,d,b);return b.X()};olympe.sc.logic.Jd=class extends olympe.sc.Xa{Ud(){return olympe.sc.ud.xe.xp}$(){return this.Wl().Kf().$c([olympe.sc.logic.Function]).and().Sc().$c([olympe.sc.logic.Ic,olympe.sc.logic.Kc]).Ve()}Ru(){return this.Wk().Kf().oi([olympe.dc.CloudObject.modelRel,olympe.sc.logic.bg.G]).Ve()}Su(){return this.Xi().Kf().oi([olympe.dc.CloudObject.modelRel,olympe.sc.logic.Cf.G]).Ve()}Rd(a){const b=this.db.Tl(this,[olympe.sc.Xa.F],c=>this.db.model(c)===olympe.dc.fa(a));return b?olympe.dc.CloudObject.get(b):null}jf(a){const b=
|
|
931
|
+
this.db.Tl(this,[olympe.sc.Xa.G],c=>this.db.model(c)===olympe.dc.fa(a));return b?olympe.dc.CloudObject.get(b):null}yv(){return this.Wk().Kf().oi([olympe.dc.CloudObject.modelRel],olympe.sc.logic.ob).Ve()}zv(){return this.Xi().Kf().oi([olympe.dc.CloudObject.modelRel],olympe.sc.logic.wb).Ve()}};olympe.sc.logic.Jd.N=ql('01621fb84e320000f000',olympe.sc.logic.Jd,olympe.sc.logic.Function);l=olympe.sc.logic.Jd.prototype;l.Ru.J=new olympe.D.H(()=>olympe.dc.ua,[]);l.Su.J=new olympe.D.H(()=>olympe.dc.ua,[]);
|
|
931
932
|
l.Rd.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);l.jf.J=new olympe.D.H(()=>olympe.sc.logic.wb,[]);l.yv.J=new olympe.D.H(()=>olympe.dc.ua,[]);l.zv.J=new olympe.D.H(()=>olympe.dc.ua,[]);olympe.sc.logic.tf=class extends olympe.sc.logic.Jd{C(){return this.Rd('016ac63229782039429f')}F(){return this.jf('016ac6322acf67eebfe7')}G(){return this.Xi().Kf().eb(olympe.sc.logic.Lb.typeRel).Uj(olympe.sc.logic.Ih).Ve().Te().im(olympe.D.aa.ZERO)}};olympe.sc.logic.tf.C='016ac63229782039429f';olympe.sc.logic.tf.L='016ac6322acf67eebfe7';olympe.sc.logic.tf.N=ql('01621fb84e320000a000',olympe.sc.logic.tf,olympe.sc.logic.Action);olympe.sc.logic.tf.prototype.C.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);
|
|
932
933
|
olympe.sc.logic.tf.prototype.F.J=new olympe.D.H(()=>olympe.sc.logic.wb,[]);olympe.sc.logic.tf.prototype.G.J=olympe.D.H.P;olympe.sc.logic.kn=class extends olympe.sc.logic.Jd{};olympe.sc.logic.kn.N=ql('01621fb84e320000f011',olympe.sc.logic.kn);olympe.sc.logic.jn=class extends olympe.sc.logic.tf{};olympe.sc.logic.jn.N=ql('01621fb84e320000f012',olympe.sc.logic.jn);olympe.sc.logic.Function=class extends olympe.sc.Runnable{L(){return[this.Eb]}T(){const a=olympe.sc.vd.F.Pr,b=olympe.sc.vd.F.Rs,c=this.db,d=new Map;this.getInputs().forEach(e=>{d.set(a+c.name(e),e)});this.getOutputs().forEach(e=>{d.set(b+c.name(e),e)});return d}C(a){return this.getOutputs().map(b=>this.db.mm(b,olympe.sc.logic.Lb.typeRel,olympe.sc.logic.Mi)?a.Am.bind(a,b):a.set.bind(a,b))}setupExecution(a){const b=this.getInputs();return 0<b.length?rxjs.combineLatest(b.map(c=>a.observe(c))).pipe(rxjs.operators.map(c=>
|
|
933
934
|
c.includes(null)?null:c)):rxjs.of([])}};olympe.sc.logic.Function.N=olympe.dc.ka.C('0168c6f020f2a96f0000',olympe.sc.logic.Function,olympe.sc.R.za);olympe.sc.logic.Lb=class extends olympe.dc.CloudObject{getType(){return this.Yb(olympe.sc.logic.Lb.typeRel,olympe.dc.CloudObject)}C(){return this.Gc(olympe.sc.logic.Lb.C)}};olympe.sc.logic.Lb.N=olympe.dc.ka.C('0168a431d25001540000',olympe.sc.logic.Lb);olympe.sc.logic.Lb.C=olympe.sc.logic.Lb.N.ja('01740c5d4ae4b520dd01');olympe.sc.logic.Lb.typeRel=olympe.sc.logic.Lb.N.pa('0168a431d3b9b7438424');U(olympe.dc.CloudObject.N,olympe.sc.logic.Lb.typeRel);
|
|
@@ -936,17 +937,17 @@ olympe.sc.logic.ob.L=olympe.sc.logic.ob.N.pa('01621fb84e32000000d1',olympe.dc.wa
|
|
|
936
937
|
olympe.sc.logic.wb.N.C=function(a,b,c,d,e,f=olympe.sc.logic.wb){f=a.create(f);Z(f,olympe.dc.CloudObject.nameProp,b||'New output');a.Ea(olympe.sc.logic.Lb.typeRel,f,c);void 0!==e&&Z(f,olympe.sc.logic.Lb.C,e);d&&a.Ea(olympe.sc.Xa.G,d,f);return f.X()};olympe.sc.logic.Action=class extends olympe.sc.logic.Function{setupExecution(a){const b=this.sd().C().X();return a.observe(b).pipe(rxjs.operators.map(c=>null===c?null:this.getInputs().filter(d=>d!==b).map(d=>a.get(d))))}};olympe.sc.logic.Action.N=olympe.dc.ka.C('0168c6f020f2a96a0000',olympe.sc.logic.Action,olympe.sc.R.za);olympe.sc.logic.Ic=class extends olympe.sc.logic.Function{run(a){dl(this,a);const b=a.getParent(),c=this.db.Tb(this,olympe.sc.logic.Ic.G),d=this.db.Tb(this,olympe.sc.logic.Ic.F);a.on(c,e=>b.set(d,e),this.tag)}Da(){return this.Yb(olympe.sc.logic.Ic.G,olympe.sc.logic.ob)}Wa(){return this.Yb(olympe.sc.logic.Ic.F,olympe.sc.logic.wb)}};olympe.sc.logic.Ic.N=olympe.dc.ka.C('01621fb84e32000000a0',olympe.sc.logic.Ic,olympe.sc.R.za);olympe.sc.logic.Ic.G=U(olympe.sc.logic.Ic.N,olympe.sc.logic.ob.G);
|
|
937
938
|
olympe.sc.logic.Ic.F=U(olympe.sc.logic.Ic.N,olympe.sc.logic.wb.L);olympe.sc.logic.Ic.N.C=function(a,b,c){b=a.create(olympe.sc.logic.Ic);a.Ea(olympe.sc.logic.Ic.F,b,c);return b.X()};olympe.sc.logic.Ic.prototype.Da.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);olympe.sc.logic.Ic.prototype.Wa.J=new olympe.D.H(()=>olympe.sc.logic.wb,[]);olympe.sc.logic.Kc=class extends olympe.sc.logic.Function{run(a){const b=a.getParent(),c=this.db.Tb(this,olympe.sc.logic.Kc.F),d=this.db.Tb(this,olympe.sc.logic.Kc.G);b.on(c,e=>a.set(d,e),b.W())}Wa(){return this.Yb(olympe.sc.logic.Kc.F,olympe.sc.logic.ob)}Da(){return this.Yb(olympe.sc.logic.Kc.G,olympe.sc.logic.wb)}};olympe.sc.logic.Kc.N=olympe.dc.ka.C('01621fb84e32000000d0',olympe.sc.logic.Kc,olympe.sc.R.za);olympe.sc.logic.Kc.F=U(olympe.sc.logic.Kc.N,olympe.sc.logic.ob.L);
|
|
938
939
|
olympe.sc.logic.Kc.G=U(olympe.sc.logic.Kc.N,olympe.sc.logic.wb.G);olympe.sc.logic.Kc.N.C=function(a,b,c){b=a.create(olympe.sc.logic.Kc);a.Ea(olympe.sc.logic.Kc.F,b,c);return b.X()};olympe.sc.logic.Kc.prototype.Wa.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);olympe.sc.logic.Kc.prototype.Da.J=new olympe.D.H(()=>olympe.sc.logic.wb,[]);function il(a,b,c){const d=a.db.Tb(a,olympe.sc.logic.hb.T)||a.db.Tb(a,olympe.sc.logic.hb.L),e=a.db.Tb(a,olympe.sc.logic.hb.P),f=a.db.ri(rl(a),olympe.dm.re)?new olympe.D.Jb('Pipe Context'):null,g=a.C.bind(a,c,f);if(null!==d&&null!==e){let k;const m=b.Zj(e,n=>{k&&k();k=n.on(d,g,e)});return()=>{g(null);m();k&&k()}}const h=Bf(a.db,a,olympe.sc.logic.hb.valueProp,g);return()=>{g(null);Cf(a.db,a,olympe.sc.logic.hb.valueProp,h)}}
|
|
939
|
-
function rl(a){let b=null,c=a.db.Tb(a,olympe.sc.logic.hb.F);c?b=a.db.Tb(c,olympe.dm.Property.typeRel):(c=a.db.Tb(a,olympe.sc.logic.hb.C))&&(b=a.db.Tb(c,olympe.sc.logic.Lb.typeRel));return b||olympe.dc.
|
|
940
|
+
function rl(a){let b=null,c=a.db.Tb(a,olympe.sc.logic.hb.F);c?b=a.db.Tb(c,olympe.dm.Property.typeRel):(c=a.db.Tb(a,olympe.sc.logic.hb.C))&&(b=a.db.Tb(c,olympe.sc.logic.Lb.typeRel));return b||olympe.dc.fa(olympe.dc.CloudObject)}
|
|
940
941
|
olympe.sc.logic.hb=class extends olympe.dc.CloudObject{constructor(a,b,c){super(a,b);this.K=c}C(a,b,c){const d=olympe.sc.kg(c);null==b||b.na();b&&d instanceof olympe.dm.re?null==b||b.run(()=>{olympe.D.pc([d.getValue()],e=>{a(e.valueOf())})}):a(d)}getValue(a){return this.kf(olympe.sc.logic.hb.valueProp,a||olympe.dc.Fb.kg,Object)}getType(){const a=this.transform(olympe.sc.logic.hb.C,olympe.sc.logic.Lb.typeRel);a.md(olympe.dc.CloudObject);return a.xc()}wv(){return this.Yb(olympe.sc.logic.hb.P,olympe.dc.CloudObject)}uv(){return this.Yb(olympe.sc.logic.hb.T,
|
|
941
942
|
olympe.sc.logic.wb)}vv(){return this.Yb(olympe.sc.logic.hb.L,olympe.dm.Property)}Lu(){return this.Yb(olympe.sc.logic.hb.G,olympe.dc.CloudObject)}Ju(){return this.Yb(olympe.sc.logic.hb.C,olympe.sc.logic.ob)}Ku(){return this.Yb(olympe.sc.logic.hb.F,olympe.dm.Property)}};olympe.sc.logic.hb.N=olympe.dc.ka.C('0168a431d91f25780000',olympe.sc.logic.hb,olympe.sc.R.za);olympe.sc.logic.hb.valueProp=olympe.sc.logic.hb.N.ja('0168a431d91f25780001');olympe.sc.logic.hb.P=olympe.sc.logic.hb.N.pa('0168a431d91f25780002');
|
|
942
943
|
olympe.sc.logic.hb.T=U(olympe.sc.logic.hb.N,olympe.sc.logic.wb.F);olympe.sc.logic.hb.L=olympe.sc.logic.hb.N.pa('0168a431d91f25780004');olympe.sc.logic.hb.G=olympe.sc.logic.hb.N.pa('0168a431d91f2578000a');olympe.sc.logic.hb.C=U(olympe.sc.logic.hb.N,olympe.sc.logic.ob.F);olympe.sc.logic.hb.F=olympe.sc.logic.hb.N.pa('0168a431d91f2578000c');U(olympe.dc.CloudObject.N,olympe.sc.logic.hb.P);U(olympe.dm.Property.N,olympe.sc.logic.hb.L);U(olympe.dc.CloudObject.N,olympe.sc.logic.hb.G);
|
|
943
944
|
U(olympe.dm.Property.N,olympe.sc.logic.hb.F);l=olympe.sc.logic.hb.prototype;l.getType.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);l.wv.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);l.uv.J=new olympe.D.H(()=>olympe.sc.logic.wb,[]);l.vv.J=new olympe.D.H(()=>olympe.dm.Property,[]);l.Lu.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);l.Ju.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);l.Ku.J=new olympe.D.H(()=>olympe.dm.Property,[]);function sl(a,b){const c=a.sd(),d=c.Xk().X(),e=c.Yk().X(),f=c.Zk().X();b.on(d,g=>{if(g){g=new Map(a.getInputs().map(k=>[k,b.get(k)]));const h={timeout:a.timeout};olympe.O.qb.get(a.nc(),g,h).then(k=>{for(const [m,n]of k)m!==e&&m!==f&&b.set(m,n);b.set(e,k.get(e));b.set(f,k.get(f))}).catch(k=>{k=`RemoteAction "${a.name()}" (${a.tag}) encountered an error:\n${k}`;a.K.error(k);b.set(f,olympe.sc.logic.Ih.create(k,400))})}},b.W())}
|
|
944
945
|
function tl(a,b,c,d,e,f){const g=n=>{if(null!==n){e.cancel();k&&k();m&&m();try{const p=new Map(a.getOutputs().map(q=>[q,b.get(q)]));f.ed(p).finally(()=>b.destroy())}catch(p){n=Error(`Error while serializing the response from remote action ${a.nc()}: ${p.message}`),f.ih(n).finally(()=>b.destroy())}}},h=b.W(),k=b.on(c,g,h),m=b.on(d,g,h)}
|
|
945
946
|
olympe.sc.logic.Ug=class extends olympe.sc.logic.Function{constructor(a,b,c,d){super(a,b,c);this.timeout=d}run(a){let b;null!=(b=a.Ta(olympe.sc.xa.C.EDITION))&&b||(this.db.Qa(this,olympe.sc.logic.Ug.F)?this.Da(a):(dl(this,a),sl(this,a)))}Da(a){const b=this.nc(),c=this.sd(),d=c.no().X(),e=c.Xk().X(),f=c.Yk().X(),g=c.Zk().X();(new olympe.O.qb(b,a)).listen().subscribe(rxjs.Subscriber.create(h=>{const k=a.gh('remote call'),m=h.body(),n=Mb(()=>{h.ih(Error(`Timeout reached on remote action ${this.db.name(this)} (${this.tag})`));
|
|
946
|
-
k.destroy()},this.timeout);tl(this,k,f,g,n,h);super.run(k);for(const [p,q]of m)p!==e&&k.set(p,q);h.wh().then(p=>{var q=k.get(d);null!==q&&olympe.dc.
|
|
947
|
-
1))})},h=>{const k=this.nc();this.K.error(`Error while listening on remote action ${this.db.name(k)} (${k}): ${h.message}`)}))}};olympe.sc.logic.Ug.N=olympe.dc.ka.C('017a7b0c5dcbd8964c5d',olympe.sc.logic.Ug,olympe.sc.R.za,new olympe.V.ma(olympe.sc.U.fp));olympe.sc.logic.Ug.F=olympe.sc.logic.Ug.N.ja('017a7b0c62a02a89444f');olympe.sc.logic.controllers={};olympe.sc.logic.controllers.Sk=class{constructor(a){this.db=olympe.dc.ta();this.typeRel=a}};olympe.sc.logic.controllers.Sk.C={jx:-1,ny:1};olympe.sc.logic.controllers.dz=class extends olympe.sc.logic.controllers.Sk{constructor(){super(olympe.sc.logic.Mc.C)}};olympe.sc.logic.controllers.jz=class extends olympe.sc.logic.controllers.Sk{constructor(){super(olympe.sc.logic.Lb.typeRel)}};olympe.sc.logic.Jj={};olympe.sc.logic.Jj.qt=class extends olympe.sc.logic.Function{update(a,[b],[c]){const d=olympe.dc.
|
|
947
|
+
k.destroy()},this.timeout);tl(this,k,f,g,n,h);super.run(k);for(const [p,q]of m)p!==e&&k.set(p,q);h.wh().then(p=>{var q=k.get(d);null!==q&&olympe.dc.fa(q)!==p&&(q=this.nc(),this.K.warn(`Remote action ${this.db.name(q)} ${q}: try to run it with an input user that is not the real authenticated user.`));k.set(d,p);k.set(e,m.get(e))}).catch(p=>{const q=this.nc();this.K.warn(`Remote action ${this.db.name(q)} ${q} Triggered by unrecognized user: ${p}.`);k.set(g,olympe.sc.logic.Ih.create('Unrecognized User',
|
|
948
|
+
1))})},h=>{const k=this.nc();this.K.error(`Error while listening on remote action ${this.db.name(k)} (${k}): ${h.message}`)}))}};olympe.sc.logic.Ug.N=olympe.dc.ka.C('017a7b0c5dcbd8964c5d',olympe.sc.logic.Ug,olympe.sc.R.za,new olympe.V.ma(olympe.sc.U.fp));olympe.sc.logic.Ug.F=olympe.sc.logic.Ug.N.ja('017a7b0c62a02a89444f');olympe.sc.logic.controllers={};olympe.sc.logic.controllers.Sk=class{constructor(a){this.db=olympe.dc.ta();this.typeRel=a}};olympe.sc.logic.controllers.Sk.C={jx:-1,ny:1};olympe.sc.logic.controllers.dz=class extends olympe.sc.logic.controllers.Sk{constructor(){super(olympe.sc.logic.Mc.C)}};olympe.sc.logic.controllers.jz=class extends olympe.sc.logic.controllers.Sk{constructor(){super(olympe.sc.logic.Lb.typeRel)}};olympe.sc.logic.Jj={};olympe.sc.logic.Jj.qt=class extends olympe.sc.logic.Function{update(a,[b],[c]){const d=olympe.dc.fa(b);d?olympe.dc.ra.cc(a,d,olympe.dc.Ob.Ef).subscribe(()=>{c(olympe.dc.CloudObject.get(d))}):this.K.warn('Cannot subscribe to an instance with no tag: '+d)}};olympe.sc.logic.ka.C('0174bf4b7e006e4b788a',olympe.sc.logic.Jj.qt);olympe.sc.logic.actions={};olympe.sc.logic.Jj.Fs=class extends olympe.sc.logic.Function{run(a){dl(this,a);const [b,c,d]=this.C(a);let e,f=null,g=null;const h=a.getParent(),k=()=>{null===g||0===e?(this.K.warn('No list to iter upon'),this.K.info(a.W())):f<e?(b(g.Fe(f)),f++,c((new Date).getTime())):(Sk(h.C),d((new Date).getTime()))};this.getInputs().forEach((m,n)=>a.on(m,p=>{if(p)switch(n){case 0:g=p;break;case 1:e=g.Nf();f=0;Rk(h.C);k();break;case 2:k();break;default:this.K.error('Unhandled input')}},this.tag))}};
|
|
948
949
|
olympe.sc.logic.ka.C('0171889b060b6cd54300',olympe.sc.logic.Jj.Fs);olympe.sc.logic.Sb={};olympe.sc.logic.Sb.Tk=class extends olympe.sc.logic.Jd{C(){return this.Rd('016ac63808535703691c')}};olympe.sc.logic.Sb.Tk.N=ql('0169b6876a03f139d50a',olympe.sc.logic.Sb.Tk);olympe.sc.logic.Sb.Tk.prototype.C.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);olympe.sc.logic.Sb.gl=class extends olympe.sc.logic.Jd{C(){return this.Rd('016ac63809a9a8e6db96')}F(){return this.jf('016ac6380ab003363b3e')}};ql('01646ad602f933b8caaf',olympe.sc.logic.Sb.gl);olympe.sc.logic.Sb.gl.prototype.C.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);olympe.sc.logic.Sb.gl.prototype.F.J=new olympe.D.H(()=>olympe.sc.logic.wb,[]);olympe.sc.logic.Sb.ej=class extends olympe.sc.logic.Jd{C(){return this.Rd('016ac6380bd98f1d91a0')}G(){return this.jf('016ac63c589ae38ca3ae')}F(){return this.jf('016ac63c5a377fceabaa')}};ql('0168ec42fc01747a98b6',olympe.sc.logic.Sb.ej);olympe.sc.logic.Sb.ej.prototype.C.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);olympe.sc.logic.Sb.ej.prototype.G.J=new olympe.D.H(()=>olympe.sc.logic.wb,[]);olympe.sc.logic.Sb.ej.prototype.F.J=new olympe.D.H(()=>olympe.sc.logic.wb,[]);olympe.sc.logic.Sb.dg=class extends olympe.sc.logic.Jd{Xk(){return this.Rd('017a7b07b09e3b22c8b4')}no(){return this.Rd('017a7b07ba05807a74b0')}Yk(){return this.jf('017a7b0818c12388d731')}Zk(){return this.jf('017a7b085146d5e69aec')}ms(){return olympe.D.ea.F}};olympe.sc.logic.Sb.dg.L='017a7b07b09e3b22c8b4';olympe.sc.logic.Sb.dg.ub='017a7b07ba05807a74b0';olympe.sc.logic.Sb.dg.Da='017a7b0818c12388d731';olympe.sc.logic.Sb.dg.C='017a7b085146d5e69aec';
|
|
949
|
-
olympe.sc.logic.Sb.dg.N=ql('017a7b07a948e30508fa',olympe.sc.logic.Sb.dg,olympe.sc.logic.Ug);l=olympe.sc.logic.Sb.dg.prototype;l.Xk.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);l.no.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);l.Yk.J=new olympe.D.H(()=>olympe.sc.logic.wb,[]);l.Zk.J=new olympe.D.H(()=>olympe.sc.logic.wb,[]);l.ms.J=olympe.D.H.P;olympe.sc.logic.Sb.Cp=class extends olympe.sc.logic.Jd{C(){return this.Rd('016ac63c5b3ed0562740')}};ql('016a9766c230916ea5ec',olympe.sc.logic.Sb.Cp);olympe.sc.logic.Sb.Cp.prototype.C.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);olympe.sc.query={};olympe.sc.query.Lm=class extends olympe.sc.$f{};olympe.sc.query.Lm.N=olympe.dc.ka.C('01631aacd8276ea98491',olympe.sc.query.Lm);olympe.sc.query.Po=class extends olympe.dm.Enum{};olympe.sc.query.Po.N=olympe.dc.ka.C('01631aacd8276ea98495',olympe.sc.query.Po);olympe.sc.query.Zo=class extends olympe.dm.Enum{};olympe.sc.query.Zo.N=olympe.dc.ka.C('01631aacd8276ea98494',olympe.sc.query.Zo);olympe.sc.query.$o=class extends olympe.sc.$f{};olympe.sc.query.$o.N=olympe.dc.ka.C('01631aacd8276ea98492',olympe.sc.query.$o);olympe.sc.query.tc=class extends olympe.dc.CloudObject{};olympe.sc.query.tc.N=olympe.dc.ka.C('01631aacd8276ea98493',olympe.sc.query.tc);olympe.sc.pn=class extends olympe.dc.CloudObject{};olympe.sc.pn.N=olympe.dc.ka.C('018312ceeb3e93618a85',olympe.sc.pn);olympe.sc.Gb={};olympe.sc.Gb.Comment=class extends olympe.dm.BrickMetadata{getType(){return this.rb(olympe.sc.Gb.Comment.L)}F(){return this.rb(olympe.sc.Gb.Comment.G)}C(){return new olympe.D.Kb(this.Gc(olympe.sc.Gb.Comment.P),this.Gc(olympe.sc.Gb.Comment.F))}static Ec(a,b,c,...d){c=d[0];d=d[1];b=a.create(b);b.X();a.Ea(olympe.dc.CloudObject.containsRel,c,b);a.Ea(olympe.sc.Gb.Comment.C,b,c);c=a.create(olympe.sc.ui.ud.Yo);Z(c,olympe.sc.ui.ud.Yo.RB,d.lo());Z(c,olympe.sc.ui.ud.Yo.SB,d.mo());a.Ea(olympe.dm.BrickMetadata.
|
|
950
|
+
olympe.sc.logic.Sb.dg.N=ql('017a7b07a948e30508fa',olympe.sc.logic.Sb.dg,olympe.sc.logic.Ug);l=olympe.sc.logic.Sb.dg.prototype;l.Xk.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);l.no.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);l.Yk.J=new olympe.D.H(()=>olympe.sc.logic.wb,[]);l.Zk.J=new olympe.D.H(()=>olympe.sc.logic.wb,[]);l.ms.J=olympe.D.H.P;olympe.sc.logic.Sb.Cp=class extends olympe.sc.logic.Jd{C(){return this.Rd('016ac63c5b3ed0562740')}};ql('016a9766c230916ea5ec',olympe.sc.logic.Sb.Cp);olympe.sc.logic.Sb.Cp.prototype.C.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);olympe.sc.query={};olympe.sc.query.Lm=class extends olympe.sc.$f{};olympe.sc.query.Lm.N=olympe.dc.ka.C('01631aacd8276ea98491',olympe.sc.query.Lm);olympe.sc.query.Po=class extends olympe.dm.Enum{};olympe.sc.query.Po.N=olympe.dc.ka.C('01631aacd8276ea98495',olympe.sc.query.Po);olympe.sc.query.Zo=class extends olympe.dm.Enum{};olympe.sc.query.Zo.N=olympe.dc.ka.C('01631aacd8276ea98494',olympe.sc.query.Zo);olympe.sc.query.$o=class extends olympe.sc.$f{};olympe.sc.query.$o.N=olympe.dc.ka.C('01631aacd8276ea98492',olympe.sc.query.$o);olympe.sc.query.tc=class extends olympe.dc.CloudObject{};olympe.sc.query.tc.N=olympe.dc.ka.C('01631aacd8276ea98493',olympe.sc.query.tc);olympe.sc.pn=class extends olympe.dc.CloudObject{};olympe.sc.pn.N=olympe.dc.ka.C('018312ceeb3e93618a85',olympe.sc.pn);olympe.sc.Gb={};olympe.sc.Gb.Comment=class extends olympe.dm.BrickMetadata{getType(){return this.rb(olympe.sc.Gb.Comment.L)}F(){return this.rb(olympe.sc.Gb.Comment.G)}C(){return new olympe.D.Kb(this.Gc(olympe.sc.Gb.Comment.P),this.Gc(olympe.sc.Gb.Comment.F))}static Ec(a,b,c,...d){c=d[0];d=d[1];b=a.create(b);b.X();a.Ea(olympe.dc.CloudObject.containsRel,c,b);a.Ea(olympe.sc.Gb.Comment.C,b,c);c=a.create(olympe.sc.ui.ud.Yo);Z(c,olympe.sc.ui.ud.Yo.RB,d.lo());Z(c,olympe.sc.ui.ud.Yo.SB,d.mo());a.Ea(olympe.dm.BrickMetadata.ga,
|
|
950
951
|
b,c);a.Ea(olympe.dc.CloudObject.containsRel,b,c)}};olympe.sc.Gb.Comment.$=100;olympe.sc.Gb.Comment.T=66;olympe.sc.Gb.Comment.N=olympe.dc.ka.C('0184bd886ee1c7adfe09',olympe.sc.Gb.Comment);olympe.sc.Gb.Comment.L=olympe.sc.Gb.Comment.N.ja('0184c80e29ed08a16c5e');olympe.sc.Gb.Comment.G=olympe.sc.Gb.Comment.N.ja('0184bd889f33359cfe75');olympe.sc.Gb.Comment.P=olympe.sc.Gb.Comment.N.ja('0184c3f9406e25a41512');olympe.sc.Gb.Comment.F=olympe.sc.Gb.Comment.N.ja('0184c3f942e4cc136ce8');
|
|
951
952
|
olympe.sc.Gb.Comment.C=olympe.sc.Gb.Comment.N.pa('0184be3f135a83fd6cc3');olympe.sc.Gb.Comment.prototype.getType.J=olympe.D.H.F;olympe.sc.Gb.Comment.prototype.F.J=olympe.D.H.F;olympe.sc.Gb.Comment.prototype.C.J=olympe.D.H.T;olympe.sc.Gb.tk=class extends olympe.dm.Enum{};olympe.sc.Gb.tk.C={Ww:'Comment',qA:'Todo'};olympe.sc.Gb.tk.N=olympe.dc.ka.C('0184cc42e06205501bc7',olympe.sc.Gb.tk);olympe.sc.workflow={};olympe.sc.workflow.ObjectState=class extends olympe.dc.CloudObject{};olympe.sc.workflow.ObjectState.N=olympe.dc.ka.C('017ffdd8f0b1e31fe138',olympe.sc.workflow.ObjectState);olympe.sc.workflow.ObjectState.workflowProp=olympe.sc.workflow.ObjectState.N.ja('017ffdd8f0b1e31fe13e');olympe.sc.workflow.ObjectState.stateProp=olympe.sc.workflow.ObjectState.N.ja('017ffdd8f0b1e31fe139');olympe.sc.workflow.ObjectState.assigneeProp=olympe.sc.workflow.ObjectState.N.ja('017ffdd8f0b1e31fe13a');
|
|
952
953
|
olympe.sc.workflow.ObjectState.dateTimeProp=olympe.sc.workflow.ObjectState.N.ja('017ffdd8f0b1e31fe13b');olympe.sc.workflow.ObjectState.serializedObjectProp=olympe.sc.workflow.ObjectState.N.ja('017ffdd8f0b1e31fe13d');olympe.sc.workflow.ObjectState.objectRel=olympe.sc.workflow.ObjectState.N.pa('017ffdd8f0b1e31fe13c');olympe.sc.workflow.ObjectState.currentObjectRel=olympe.sc.workflow.ObjectState.N.pa('017ffdd8f0b1e31fe13f');olympe.sc.workflow.Ye=class extends olympe.sc.logic.Jd{ns(){return this.Rd('017ffe02381f9fac5060')}rs(){return this.Rd('017ffe02381f9fac5061')}ss(){return this.Rd('017ffe02381f9fac5062')}Hu(){return this.Rd('017ffe02381f9fac5065')}ps(){return this.jf('017ffe02381f9fac5063')}qs(){return this.jf('017ffe02381f9fac5064')}};olympe.sc.workflow.Ye.N=ql('017ffde21f5fe0f704ce',olympe.sc.workflow.Ye);olympe.sc.workflow.Ye.C='017ffe02381f9fac5060';olympe.sc.workflow.Ye.jd='017ffe02381f9fac5061';
|
|
@@ -954,23 +955,23 @@ olympe.sc.workflow.Ye.qd='017ffe02381f9fac5062';olympe.sc.workflow.Ye.Da='017ffe
|
|
|
954
955
|
olympe.sc.workflow.Transition.N=olympe.dc.ka.C('017ffdc633219f16beea',olympe.sc.workflow.Transition);olympe.sc.workflow.Transition.processRefProp=olympe.sc.workflow.Transition.N.ja('017ffdc633219f16beec');olympe.sc.workflow.Transition.fromStateRel=olympe.sc.workflow.Transition.N.pa('017ffdc2dda51d46b431');olympe.sc.workflow.Transition.toStateRel=olympe.sc.workflow.Transition.N.pa('017ffdc633219f16beeb');olympe.sc.workflow.Transition.prototype.F.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);
|
|
955
956
|
olympe.sc.workflow.Transition.prototype.C.J=new olympe.D.H(()=>olympe.sc.workflow.we,[]);olympe.sc.workflow.Transition.prototype.G.J=new olympe.D.H(()=>olympe.sc.workflow.we,[]);olympe.sc.workflow.Workflow=class extends olympe.dm.BrickMetadata{Ud(){return olympe.sc.ud.xe.Gg}G(){return this.oh(olympe.sc.workflow.Workflow.serializationEnabledProp)}C(){return this.Yb(olympe.sc.workflow.Workflow.dataTypeRel,olympe.sc.Jc)}F(){return this.Yb(olympe.sc.workflow.Workflow.initialStateRel,olympe.sc.workflow.we)}};olympe.sc.workflow.Workflow.N=olympe.dc.ka.C('017ffdc010e5bcc9c971',olympe.sc.workflow.Workflow);olympe.sc.workflow.Workflow.serializationEnabledProp=olympe.sc.workflow.Workflow.N.ja('017ffdc010e5bcc9c972');
|
|
956
957
|
olympe.sc.workflow.Workflow.dataTypeRel=olympe.sc.workflow.Workflow.N.pa('017ffdc010e5bcc9c973');olympe.sc.workflow.Workflow.statesRel=olympe.sc.workflow.Workflow.N.pa('017ffdc010e5bcc9c974');olympe.sc.workflow.Workflow.initialStateRel=olympe.sc.workflow.Workflow.N.pa('017ffdc010e5bcc9c975');olympe.sc.workflow.Workflow.prototype.G.J=olympe.D.H.P;olympe.sc.workflow.Workflow.prototype.C.J=new olympe.D.H(()=>olympe.sc.Jc,[]);
|
|
957
|
-
olympe.sc.workflow.Workflow.prototype.F.J=new olympe.D.H(()=>olympe.sc.workflow.we,[]);olympe.sc.qa={};olympe.sc.qa.Uc=class extends olympe.sc.Xa{Ud(){return olympe.sc.ud.xe.ht}};olympe.sc.qa.Uc.N=Fe(olympe.dc.ka.C('01120300000000adef00',olympe.sc.qa.Uc));olympe.sc.qa.Uc.C=olympe.sc.qa.Uc.N.pa('0171bc1f15da96dfdb89');olympe.sc.qa.Uc.Da=olympe.sc.qa.Uc.N.pa('0171bc1f15da96dfdb90');U(olympe.dm.Ac.N,olympe.sc.qa.Uc.C);olympe.sc.qa.zh=class extends olympe.sc.Runnable{F(){return[this.nc()]}Da(){return olympe.dc.Nc.from(this.nc()).eb(olympe.sc.qa.Uc.C).Ad()}};olympe.sc.qa.zh.N=Fe(olympe.dc.ka.C('0113030000000aca1100',olympe.sc.qa.zh));olympe.sc.qa.zh.prototype.Da.J=new olympe.D.H(()=>olympe.dm.pb,[]);olympe.sc.qa.bb=class extends olympe.dc.CloudObject{vs(){return this.oh(olympe.sc.qa.bb.eh)}Vv(){return this.oh(olympe.sc.qa.bb.na)}Rc(){return this.Gc(olympe.sc.qa.bb.C)}Nu(){return this.rb(olympe.sc.qa.bb.L)}nv(){return this.rb(olympe.sc.qa.bb.
|
|
958
|
-
olympe.sc.qa.bb.N=olympe.dc.ka.C('011203300000000adef5',olympe.sc.qa.bb);olympe.sc.qa.bb.eh=olympe.sc.qa.bb.N.ja('011203300000000adef6');olympe.sc.qa.bb.na=olympe.sc.qa.bb.N.ja('011203300000000adef7');olympe.sc.qa.bb.C=olympe.sc.qa.bb.N.ja('011203300000000adef8');olympe.sc.qa.bb.L=olympe.sc.qa.bb.N.ja('011203300000000adef9');olympe.sc.qa.bb.
|
|
958
|
+
olympe.sc.workflow.Workflow.prototype.F.J=new olympe.D.H(()=>olympe.sc.workflow.we,[]);olympe.sc.qa={};olympe.sc.qa.Uc=class extends olympe.sc.Xa{Ud(){return olympe.sc.ud.xe.ht}};olympe.sc.qa.Uc.N=Fe(olympe.dc.ka.C('01120300000000adef00',olympe.sc.qa.Uc));olympe.sc.qa.Uc.C=olympe.sc.qa.Uc.N.pa('0171bc1f15da96dfdb89');olympe.sc.qa.Uc.Da=olympe.sc.qa.Uc.N.pa('0171bc1f15da96dfdb90');U(olympe.dm.Ac.N,olympe.sc.qa.Uc.C);olympe.sc.qa.zh=class extends olympe.sc.Runnable{F(){return[this.nc()]}Da(){return olympe.dc.Nc.from(this.nc()).eb(olympe.sc.qa.Uc.C).Ad()}};olympe.sc.qa.zh.N=Fe(olympe.dc.ka.C('0113030000000aca1100',olympe.sc.qa.zh));olympe.sc.qa.zh.prototype.Da.J=new olympe.D.H(()=>olympe.dm.pb,[]);olympe.sc.qa.bb=class extends olympe.dc.CloudObject{vs(){return this.oh(olympe.sc.qa.bb.eh)}Vv(){return this.oh(olympe.sc.qa.bb.na)}Rc(){return this.Gc(olympe.sc.qa.bb.C)}Nu(){return this.rb(olympe.sc.qa.bb.L)}nv(){return this.rb(olympe.sc.qa.bb.ga)}mv(){return this.rb(olympe.sc.qa.bb.$)}Cd(){return this.rb(olympe.sc.qa.bb.da)}av(){return this.rb(olympe.sc.qa.bb.P)}wu(){return this.rb(olympe.sc.qa.bb.F)}lv(){return this.rb(olympe.sc.qa.bb.T)}us(){return this.rb(olympe.sc.qa.bb.G)}};
|
|
959
|
+
olympe.sc.qa.bb.N=olympe.dc.ka.C('011203300000000adef5',olympe.sc.qa.bb);olympe.sc.qa.bb.eh=olympe.sc.qa.bb.N.ja('011203300000000adef6');olympe.sc.qa.bb.na=olympe.sc.qa.bb.N.ja('011203300000000adef7');olympe.sc.qa.bb.C=olympe.sc.qa.bb.N.ja('011203300000000adef8');olympe.sc.qa.bb.L=olympe.sc.qa.bb.N.ja('011203300000000adef9');olympe.sc.qa.bb.ga=olympe.sc.qa.bb.N.ja('011203300000000adefa');olympe.sc.qa.bb.$=olympe.sc.qa.bb.N.ja('011203300000000adefb');olympe.sc.qa.bb.F=olympe.sc.qa.bb.N.ja('011203300000000adefc');
|
|
959
960
|
olympe.sc.qa.bb.da=olympe.sc.qa.bb.N.ja('011203300000000adefd');olympe.sc.qa.bb.P=olympe.sc.qa.bb.N.ja('011203300000000adefe');olympe.sc.qa.bb.T=olympe.sc.qa.bb.N.ja('011203300000000adeff');olympe.sc.qa.bb.G=olympe.sc.qa.bb.N.ja('011203300000000adee0');olympe.sc.qa.bb.Pb={INIT:0,Uw:1,uj:2,tj:3,rl:4,Ez:5,Db:9};l=olympe.sc.qa.bb.prototype;l.vs.J=olympe.D.H.P;l.Vv.J=olympe.D.H.P;l.Rc.J=olympe.D.H.G;l.Nu.J=olympe.D.H.F;l.nv.J=olympe.D.H.F;l.mv.J=olympe.D.H.F;l.Cd.J=olympe.D.H.F;l.av.J=olympe.D.H.F;
|
|
960
961
|
l.wu.J=olympe.D.H.F;l.lv.J=olympe.D.H.F;l.us.J=olympe.D.H.F;olympe.sc.qa.Vi=class extends olympe.sc.qa.zh{na(){return!0}};olympe.sc.qa.Vi.N=olympe.dc.ka.C('0113032000000aca1102',olympe.sc.qa.Vi,olympe.sc.R.za);olympe.sc.qa.ve=class extends olympe.sc.qa.Uc{C(){return(new olympe.dc.$i(this.X(),olympe.sc.qa.bb)).eb(olympe.sc.qa.ve.L).Ve().xc()}};olympe.sc.qa.ve.N=olympe.dc.ka.C('011203300000000adef3',olympe.sc.qa.ve);olympe.sc.qa.ve.L=olympe.sc.qa.ve.N.pa('011203300000000adef4');U(olympe.sc.qa.bb.N,olympe.sc.qa.ve.L);
|
|
961
962
|
olympe.sc.qa.ve.N.C=(a,b,c)=>{b=tj(a,b||'New Service Application model',olympe.sc.qa.ve,olympe.sc.qa.Vi);a.Ea(olympe.sc.qa.Uc.C,b,c);c=a.create(olympe.sc.qa.bb).X();a.Ea(olympe.sc.qa.ve.L,b,c);return b.X()};olympe.sc.qa.ve.prototype.C.J=new olympe.D.H(()=>olympe.sc.qa.bb,[]);olympe.sc.hg=class extends olympe.dc.CloudObject{static get(){return olympe.dc.CloudObject.get('011203300000000adf0f')}};olympe.sc.hg.N=olympe.dc.ka.C('011203300000000adf00',olympe.sc.hg);olympe.sc.hg.F=olympe.sc.hg.N.ja('011203300000000adf01');olympe.sc.hg.C=olympe.sc.hg.N.ja('011203300000000adf02');olympe.sc.hg.G='011203300000000adf0f';olympe.sc.Dg=class extends olympe.dm.BrickMetadata{Ud(){return olympe.sc.ud.xe.Gg}};olympe.sc.Dg.N=olympe.dc.ka.C('01645fe6873aeea59e64',olympe.sc.Dg);olympe.sc.Dg.C=olympe.sc.Dg.N.pa('017ed8ac775f48d4d589');olympe.sc.Dg.F=olympe.sc.Dg.N.pa('017ed8ac775f48d4d590');olympe.sc.ln=class extends olympe.dm.Bb{Ud(){return olympe.sc.ud.xe.Gg}};olympe.sc.ln.N=olympe.dc.ka.C('0163a68ce44f3d1fa95d',olympe.sc.ln);olympe.sc.Eg=class extends olympe.dm.BrickMetadata{};olympe.sc.Eg.N=olympe.dc.ka.C('016324fde11a836f77d3',olympe.sc.Eg);olympe.sc.Eg.C=olympe.sc.Jc.N.pa('016324fde11a836088d3');olympe.sc.Eg.N.C=(a,b)=>tj(a,null!=b?b:'New config type',olympe.sc.Eg).X();olympe.sc.ex=class{};olympe.sc.Oi=class extends olympe.dm.BrickMetadata{Ud(){return olympe.sc.ud.xe.Gg}};olympe.sc.Oi.N=olympe.dc.ka.C('017dc8d6c8fd8c8bd2ff',olympe.sc.Oi);olympe.sc.Oi.N.C=(a,b)=>tj(a,null!=b?b:'New data connector',olympe.sc.Oi,olympe.dm.DataSource).X();olympe.sc.Yd=class extends olympe.sc.Runnable{Wa(){return this.ib(olympe.sc.Yd.G,olympe.sc.Runnable)}Da(){return this.ib(olympe.sc.Yd.F,olympe.dm.Property)}};olympe.sc.Yd.N=Fe(olympe.dc.ka.C('016c2d996d9ca27fa9d8',olympe.sc.Yd));olympe.sc.Yd.G=olympe.sc.Yd.N.pa('016c3cb7742ec9309e0b');olympe.sc.Yd.F=olympe.sc.Yd.N.pa('016c42d3454636f90533');olympe.sc.Yd.prototype.Wa.J=new olympe.D.H(()=>olympe.dc.ua,[]);olympe.sc.Yd.prototype.Da.J=new olympe.D.H(()=>olympe.dc.ua,[]);olympe.sc.En=class extends olympe.dm.Bb{Ud(){return olympe.sc.ud.xe.Gg}};olympe.sc.En.N=olympe.dc.ka.C('017a7a9ff057958e5678',olympe.sc.En);olympe.sc.xo=class extends olympe.dm.Bb{Ud(){return olympe.sc.ud.xe.zt}};olympe.sc.xo.N=olympe.dc.ka.C('01644b6d4543b344b857',olympe.sc.xo);olympe.sc.yo=class extends olympe.dc.CloudObject{};olympe.sc.yo.N=olympe.dc.ka.C('0162f672366be5ca7a86',olympe.sc.yo);olympe.sc.fg=class extends olympe.dc.sources.fg{C(a){return a instanceof olympe.sc.logic.Error?{t:20,c:a.code,m:a.C}:super.C(a)}F(a){return 20===(null==a?void 0:a.t)?olympe.sc.logic.Error.create(a.m,a.c):super.F(a)}};olympe.sc.Dp=class extends olympe.sc.Yd{};olympe.sc.Dp.N=olympe.dc.ka.C('016d3f37610ae4fc3962',olympe.sc.Dp);olympe.sc.Text=class extends olympe.dm.String{};olympe.sc.Text.N=olympe.dc.ka.C('016cfca73e63f9ab5ba4',olympe.sc.Text);olympe.sc.Sa=class{constructor(a=!0){this.C=(new olympe.dc.Sa).persist(a);this.F=[];this.source=null}static from(a){const b=olympe.sc.xa.C.TRANSACTION;return a.has(b,!0)?a.get(b,!0):new olympe.sc.Sa}static process(a,b){return a.has(olympe.sc.xa.C.TRANSACTION,!0)?Promise.resolve(!1):b.lb().then(()=>!0)}W(){return this.C.W()}create(a,b=new Map,c=this.source,d){c='string'===typeof c?c:olympe.dc.Fd().fromModel(a);d=this.C.create(a,d).uh(c);for(const [f,g]of b)Z(d,f,g);if(c===olympe.dc.Ra.SERVER){if('string'===
|
|
962
|
-
typeof kl){var e;let f;b=null!=(f=null==(e=olympe.dc.Nc.from(kl).eb(olympe.sc.qa.Uc.C).eb(olympe.sc.Vc.C.Rb()).Ad())?void 0:e.X())?f:null}else b=null;e=b;null!==e?this.Ea(olympe.sc.Vc.F,e,d):olympe.la.fb('sc').warn('No business container for new instance of',olympe.dc.
|
|
963
|
+
typeof kl){var e;let f;b=null!=(f=null==(e=olympe.dc.Nc.from(kl).eb(olympe.sc.qa.Uc.C).eb(olympe.sc.Vc.C.Rb()).Ad())?void 0:e.X())?f:null}else b=null;e=b;null!==e?this.Ea(olympe.sc.Vc.F,e,d):olympe.la.fb('sc').warn('No business container for new instance of',olympe.dc.fa(a))}a=d.X();this.F.push(a);return a}update(a,b,c){this.C.update(a,b,c);return this}zq(a,b){a=this.C.update(a);for(const [c,d]of b)b=d,a.F.set(olympe.dc.fa(c),b);return this}delete(a){this.C.delete(a);return this}Ea(a,b,c){this.C.Ea(a,
|
|
963
964
|
b,c);return this}Xb(a,b,c){this.C.Xb(a,b,c);return this}Ql(a,b){this.C.Ql(a,b);return this}persist(a=!0){this.C.persist(a);return this}zi(a,b=!0){this.C.zi(a,b);return this}uh(a){this.source=a;return this}model(a){return this.C.model(a)}merge(a){sj(this.C,a.C);return this}Jl(a){this.C.Jl(a);return this}lb(){return new Promise((a,b)=>{this.C.lb((c,d)=>{c?a(new olympe.sc.bi(this.F)):b(d)})})}Rl(){return new Promise((a,b)=>{this.C.Rl((c,d)=>{c?a(new olympe.sc.bi(this.F)):b(d)})})}};
|
|
964
965
|
olympe.sc.Sa.prototype.executeAsLarge=olympe.sc.Sa.prototype.Rl;olympe.sc.Sa.prototype.execute=olympe.sc.Sa.prototype.lb;olympe.sc.Sa.prototype.afterExecution=olympe.sc.Sa.prototype.Jl;olympe.sc.Sa.prototype.merge=olympe.sc.Sa.prototype.merge;olympe.sc.Sa.prototype.model=olympe.sc.Sa.prototype.model;olympe.sc.Sa.prototype.setSource=olympe.sc.Sa.prototype.uh;olympe.sc.Sa.prototype.persistInstance=olympe.sc.Sa.prototype.zi;olympe.sc.Sa.prototype.persist=olympe.sc.Sa.prototype.persist;
|
|
965
966
|
olympe.sc.Sa.prototype.deleteAllRelations=olympe.sc.Sa.prototype.Ql;olympe.sc.Sa.prototype.deleteRelation=olympe.sc.Sa.prototype.Xb;olympe.sc.Sa.prototype.createRelation=olympe.sc.Sa.prototype.Ea;olympe.sc.Sa.prototype['delete']=olympe.sc.Sa.prototype.delete;olympe.sc.Sa.prototype.multiUpdate=olympe.sc.Sa.prototype.zq;olympe.sc.Sa.prototype.update=olympe.sc.Sa.prototype.update;olympe.sc.Sa.prototype.create=olympe.sc.Sa.prototype.create;olympe.sc.Sa.prototype.getId=olympe.sc.Sa.prototype.W;
|
|
966
967
|
olympe.sc.Sa.process=olympe.sc.Sa.process;olympe.sc.Sa.from=olympe.sc.Sa.from;olympe.sc.bi=class{constructor(a){this.C=a}Eu(){return this.C.map(olympe.dc.CloudObject.get)}};olympe.sc.bi.prototype.getCreatedObjects=olympe.sc.bi.prototype.Eu;olympe.Zb={};olympe.Zb.Rq=class{run(){}};olympe.Zb.Ba=class{constructor(a,b){this.C=a;this.K=b;this.F=null;this.G='';this.K.info('HC Manager will execute application registered as:',this.C)}Ai(a,b,c=''){b||(b='default');b===this.C?(null===this.F?this.K.log('Application',c,'designated to be launched'):this.K.log('OVERRIDE: Application',c,'designated to be launched'),this.F=a,this.G=c):this.K.debug('ignoring application:'+c+' as it is registered under name '+b+' and not '+this.C)}run(){null!==this.F?(this.K.info('Running application:',this.G),
|
|
967
968
|
this.F.run()):this.K.error('No app registered under name: '+this.C)}};olympe.Zb.Ai=function(a,b,c){const d=a.fb();c?d.debug('Pre-registering application '+b+' under name '+c+' (use '+olympe.Zb.U.Ke+'='+c+' to start it)'):d.debug('Pre-registering application '+b+' as default one');a.sd(olympe.Zb.R.Ga).config([b],function(e,f){f.Ai(e,c,b)},'olympe.hc.registerApp')};olympe.Zb.R={Ga:'hc.Manager',za:'hc.Logger'};olympe.Zb.U={Ke:'hc.app',Jk:'hc.globalToken'};olympe.V.config(function(a){F(a,olympe.Zb.U.Ke,'default');F(a,olympe.Zb.U.Jk,!1);E(a,olympe.Zb.R.za,[olympe.la.R.Ga],b=>b.Fc('hc'));E(a,olympe.auth.R.Fi,[new olympe.V.ma(olympe.Zb.U.Ke),new olympe.V.ma(olympe.Zb.U.Jk)],(b,c)=>new olympe.auth.ik(c?'':b));D(a,olympe.Zb.R.Ga,olympe.Zb.Ba,new olympe.V.ma(olympe.Zb.U.Ke),olympe.Zb.R.za)},'olympe.hc');olympe.V.run([olympe.Zb.R.Ga],a=>a.run(),'olympe.hc');olympe.sc.Tc={};function ul(a,b){if(a.$)a.K.debug('Sending getContext request'),Xg(a.da).then(()=>{a.K.debug('synchronisation request successful');kl=a.C;b()}).catch(c=>{a.K.error('failed to synchronise (authenticated) with server: '+c.message)});else{const c=Ik(a.F);a.K.debug((c?'PULLING':'SUBSCRIBING')+' application '+a.C);const d=a.F.F(),e=new olympe.async.Ap(d);e.add((f,g)=>{const h=olympe.dc.ta();Og(d,a.C,k=>{k=h.si(k)?k:h.model(k);return null!==k&&h.$c(k,olympe.sc.Eg)},c).subscribe(rxjs.Subscriber.create(d.G(()=>
|
|
968
|
-
{h.$c(a.C,olympe.sc.qa.Uc)?(a.
|
|
969
|
+
{h.$c(a.C,olympe.sc.qa.Uc)?(a.ga.$(a.C,c),f()):g(`The specified application tag (${a.C}) is not an application or does not exist`)}),k=>g(String(k))))});e.add(f=>{olympe.D.pc([a.G.ie()],g=>{olympe.dc.ra.Ce(g,olympe.dm.User).observe(olympe.D.Ma(),olympe.dc.ra.tc.jl).subscribe(()=>d.run(f))})});e.add((f,g)=>{const h=olympe.sc.Vc.Pb.po,k=olympe.sc.Vc.Pb.bl;ll(a.C,m=>{switch(m){case h:case k:d.run(f);break;default:d.run(()=>g('Error while loading the business container'))}})});qc(e,(f,g)=>{if(g)throw Error(g);
|
|
969
970
|
b()});e.start()}}
|
|
970
|
-
function vl(a){a.K.info('Starting application '+a.C);const b=olympe.D.ec(olympe.D.ea).update(olympe.D.ea.C),c=olympe.dc.ta();if(0<a.C.length){const d=oe(c,a.C,a.F.F().G((e,f)=>{e?(e=cl(f),e instanceof olympe.sc.qa.zh?(a.K.debug('application retrieved: running'),f=Gk(a.F,e),e.run(f),'string'===typeof a.na&&(new olympe.sc.yd).
|
|
971
|
+
function vl(a){a.K.info('Starting application '+a.C);const b=olympe.D.ec(olympe.D.ea).update(olympe.D.ea.C),c=olympe.dc.ta();if(0<a.C.length){const d=oe(c,a.C,a.F.F().G((e,f)=>{e?(e=cl(f),e instanceof olympe.sc.qa.zh?(a.K.debug('application retrieved: running'),f=Gk(a.F,e),e.run(f),'string'===typeof a.na&&(new olympe.sc.yd).ga(e.X(),f,a.K),e instanceof olympe.sc.qa.Vi&&(e=olympe.V.getParameter(olympe.auth.U.gk),f=a.G.L.Qb,!0===e&&0<f&&Nb(()=>{a.G.Wd()},Math.max(1E3,1E4<f?f-1E3:f-100))),b.update(olympe.D.ea.F)):
|
|
971
972
|
a.K.error('application retrieved: not an Application with a run() method')):wl(a)}));olympe.D.Ma().onDestroy(()=>{ne(c,a.C,d)});Mb(()=>{olympe.D.Ta(b)===olympe.D.ea.C&&a.K.warn(`requested application ${a.C} may not be available (it may not exist or the logged user may not have the correct permissions)`)},3E4)}xl(a);yl(a,b)}function wl(a){a.K.info('Stop the application');a.F.F().na();a.L.G(a.P);a.L.P(a.T)}function xl(a){a.T=a.L.F(()=>v(function*(){return wl(a)}))}
|
|
972
973
|
function yl(a,b){a.P=a.L.C(()=>olympe.D.Ta(b)===olympe.D.ea.F?Promise.resolve('The application is started'):Promise.reject('The application is not started'))}
|
|
973
|
-
olympe.sc.Tc.pl=class{constructor(a,b,c,d,e,f,g){this.G=a;this.da=b;this.L=c;this.T=this.P='';this.K=d;this.F=e;this.
|
|
974
|
+
olympe.sc.Tc.pl=class{constructor(a,b,c,d,e,f,g){this.G=a;this.da=b;this.L=c;this.T=this.P='';this.K=d;this.F=e;this.ga=f;this.C=g.get('appTag');this.$=g.get('getContextMode');let h;this.Da=null!=(h=g.get('offlineMode'))?h:!1;let k;this.na=null!=(k=g.get('debuggerName'))?k:null}run(){const a=olympe.auth.Ba.C.INIT,b=olympe.auth.Ba.C.ke,c=olympe.auth.Ba.C.Pe,d=olympe.auth.Ba.C.Af,e=olympe.auth.Ba.C.Gi,f=olympe.auth.Ba.C.$g,g=olympe.auth.Ba.C.Ag;this.K.debug('runtime starting for app #'+this.C);let h=
|
|
974
975
|
!1;const k=()=>{h||(h=!0,ul(this,()=>vl(this)))};olympe.D.pc([this.G.getState()],m=>{switch(m){case f:case g:case a:break;case b:case d:this.K.debug('Server session opened, calling once connected callback');k();break;case c:this.K.debug('Disconnected, working offline.');this.Da&&k();break;case e:this.K.debug('waiting for authentication');break;default:this.K.debug('No server session available, waiting for connection'),h=!1,wl(this)}},'Runtime initial auth state listener')}};olympe.sc.Tc.pl.C='app_instance';
|
|
975
976
|
olympe.sc.Tc.pl.va=[olympe.Zb.Rq];olympe.sc.Tc.xj=class extends olympe.dc.sources.xj{T(a){return this.db.$c(a,olympe.sc.Jc)}$(a,b){if(!this.L){super.init();var c=olympe.dc.Nc.from(a).eb(olympe.sc.qa.Uc.C).Ad();if(!(c instanceof olympe.dm.pb))throw Error(`Impossible to initialize the source solver for the application ${a}: no project is linked to it`);b=b?olympe.dc.ra.tc.Qg:olympe.dc.ra.tc.Tf;gj(this,c,b);c=new olympe.D.Jb('deployed data sources');olympe.dc.ra.from(a).eb(olympe.sc.qa.Uc.Da).observe(c,b).subscribe(d=>{const e=new olympe.dc.Sa;
|
|
976
977
|
te(d).forEach(f=>{e.Ea(olympe.dm.DataSource.yi,this.C,f)});se(d).forEach(f=>{e.Xb(olympe.dm.DataSource.yi,this.C,f)});e.lb()})}}};olympe.sc.Tc.R={Ef:'sc.runtime.Main',te:'sc.runtime.SourceSolver',lp:'sc.runtime.appConfig'};
|
|
@@ -982,11 +983,11 @@ c)=>{olympe.public.Va.get().ug(a,d=>d?c(d):b())})}static Ov(a,b){return zl((new
|
|
|
982
983
|
b){return zl((new Map).set('username',a).set('nonce',b),olympe.auth.kc.C.fl)}static Mv(){return zl(new Map,olympe.auth.kc.C.OAUTH2)}static wi(){return olympe.public.Va.get().wi()}static get(){return olympe.auth.ge()}};olympe.public.Va.logout=olympe.public.Va.wi;olympe.public.Va.loginOpenID=olympe.public.Va.Mv;olympe.public.Va.loginToken=olympe.public.Va.Qv;olympe.public.Va.loginSAML=olympe.public.Va.Nv;olympe.public.Va.loginSSO=olympe.public.Va.Pv;olympe.public.Va.loginSRP=olympe.public.Va.Ov;
|
|
983
984
|
olympe.public.Va.getUserFromToken=olympe.public.Va.ug;olympe.public.Va.sendKeepAlive=olympe.public.Va.Wd;olympe.public.Va.getIDPNames=olympe.public.Va.Tu;olympe.public.Va.getUserToken=olympe.public.Va.Av;olympe.public.Va.getIDPToken=olympe.public.Va.Uu;olympe.public.Va.refreshToken=olympe.public.Va.Ie;olympe.public.Va.getToken=olympe.public.Va.Td;olympe.public.Va.observeUser=olympe.public.Va.fw;olympe.public.Va.getCurrentUser=olympe.public.Va.Gu;olympe.public.Va.getState=olympe.public.Va.getState;
|
|
984
985
|
olympe.public.Va.generateSRPData=olympe.public.Va.uu;olympe.public.Ca=class{static create(a){return new class extends olympe.dc.Y.Rf{C(b,c){b=a(olympe.dc.CloudObject.get(c));if('boolean'===typeof b)return b;const d=olympe.D.ec(olympe.D.ea),e=b.subscribe(f=>d.update(olympe.D.Ib(f)));olympe.D.Ma().$(()=>e.unsubscribe());return d.vb()}}}};
|
|
985
|
-
olympe.public.Me=class{static create(a){return new class extends olympe.dc.bc.Rf{L(b,c){return olympe.dc.CloudObject.get(c)}G(b,c){b=a(b,c);if('number'===typeof b)return b;const d=olympe.D.ec(olympe.D.aa),e=b.subscribe(f=>d.update(olympe.D.oa(f)));olympe.D.Ma().$(()=>e.unsubscribe());return d.vb()}}}};olympe.public.Process=class{static gw(a){const b=olympe.host.Rj(),c=b.C(a);return()=>b.G(c)}static hw(a){const b=olympe.host.Rj(),c=b.F(a);return()=>b.P(c)}};olympe.public.Process.onShutdown=olympe.public.Process.hw;olympe.public.Process.onHealthCheck=olympe.public.Process.gw;'object'===typeof exports&&(exports={CloudObject:olympe.dc.CloudObject,Relation:olympe.dc.Oa.Relation,Direction:olympe.dc.wa,generateTag:olympe.Z.ef,tagToString:olympe.dc.
|
|
986
|
+
olympe.public.Me=class{static create(a){return new class extends olympe.dc.bc.Rf{L(b,c){return olympe.dc.CloudObject.get(c)}G(b,c){b=a(b,c);if('number'===typeof b)return b;const d=olympe.D.ec(olympe.D.aa),e=b.subscribe(f=>d.update(olympe.D.oa(f)));olympe.D.Ma().$(()=>e.unsubscribe());return d.vb()}}}};olympe.public.Process=class{static gw(a){const b=olympe.host.Rj(),c=b.C(a);return()=>b.G(c)}static hw(a){const b=olympe.host.Rj(),c=b.F(a);return()=>b.P(c)}};olympe.public.Process.onShutdown=olympe.public.Process.hw;olympe.public.Process.onHealthCheck=olympe.public.Process.gw;'object'===typeof exports&&(exports={CloudObject:olympe.dc.CloudObject,Relation:olympe.dc.Oa.Relation,Direction:olympe.dc.wa,generateTag:olympe.Z.ef,tagToString:olympe.dc.fa,register:olympe.dc.register,defineProperty:olympe.dc.defineProperty,defineRelation:olympe.dc.hq,defineInverseRelation:olympe.dc.eu,BrickContext:olympe.sc.xa,Brick:olympe.sc.logic.Function,ActionBrick:olympe.sc.logic.Action,GlobalProperties:olympe.sc.xa.C,registerBrick:olympe.sc.logic.ka.C,FunctionBrick:olympe.sc.logic.Function,
|
|
986
987
|
Context:olympe.sc.xa,Entry:olympe.dc.Oa.Entry,PropertyModel:olympe.dm.Property,RelationModel:olympe.dm.Relation,StringModel:olympe.dm.String,NumberModel:olympe.dm.Number,BooleanModel:olympe.dm.Boolean,DatetimeModel:olympe.dm.DateTime,ColorModel:olympe.dm.Color,File:olympe.sc.File,User:olympe.dm.User,Enum:olympe.dm.yf,EnumValue:olympe.dm.Enum,DataSource:olympe.dm.DataSource,DataResult:olympe.dc.query.wd,Workflow:olympe.sc.workflow.Workflow,WorkflowState:olympe.sc.workflow.we,WorkflowTransition:olympe.sc.workflow.Transition,
|
|
987
988
|
WorkflowObjectState:olympe.sc.workflow.ObjectState,Transaction:olympe.sc.Sa,BurstTransaction:olympe.dc.Ch,TransactionResult:olympe.sc.bi,PredefinedDataSource:olympe.dc.Ra,QueryResult:olympe.dc.La,Query:olympe.dc.ra,QuerySingle:olympe.dc.Nc,Predicate:olympe.dc.query.Ca,Order:olympe.dc.query.hj,Config:class{static getParameter(a){return olympe.V.getParameter(a)}},Process:olympe.public.Process,Color:olympe.D.Color,ErrorFlow:olympe.sc.logic.Error,ServiceRequestType:olympe.O.Request.jb,ServiceRequest:olympe.O.zc,
|
|
988
989
|
Service:olympe.O.qb,Auth:olympe.public.Va,AuthState:{INIT:olympe.auth.Ba.C.INIT,DISCONNECTED:olympe.auth.Ba.C.Pe,GUEST:olympe.auth.Ba.C.Af,AUTHENTICATING:olympe.auth.Ba.C.Gi,ERROR:olympe.auth.Ba.C.Db,AUTHENTICATED:olympe.auth.Ba.C.ke},AuthProtocol:olympe.auth.kc.C,Sync:olympe.dc.CloudObject,BusinessObject:olympe.dc.CloudObject,StringPrimitive:olympe.dm.String,NumberPrimitive:olympe.dm.Number,BooleanPrimitive:olympe.dm.Boolean,DatetimePrimitive:olympe.dm.DateTime,ColorPrimitive:olympe.dm.Color,PropertyPrimitive:olympe.dm.Property,
|
|
989
|
-
RelationPrimitive:olympe.dm.Relation,DBView:class extends olympe.dc.$a{static get(){return olympe.dc.ta()}},ListDef:olympe.dc.ua,instanceToTag:olympe.dc.
|
|
990
|
+
RelationPrimitive:olympe.dm.Relation,DBView:class extends olympe.dc.$a{static get(){return olympe.dc.ta()}},ListDef:olympe.dc.ua,instanceToTag:olympe.dc.fa,registerSync:olympe.dc.ka.C,getUniqueTag:olympe.Z.ef,onDestroy:a=>olympe.D.Ma().onDestroy(a),offDestroy:a=>olympe.D.Ma().pf(a),FollowRules:olympe.dc.Ob,transformers:{Related:olympe.dc.ba.se,RecursiveRelated:olympe.dc.ba.de,Distinct:olympe.dc.ba.Gh,Filter:olympe.dc.ba.Qe,Limit:olympe.dc.ba.Mg,Sort:olympe.dc.ba.gg,Union:olympe.dc.ba.af},ListDefPredicate:olympe.public.Ca,
|
|
990
991
|
predicates:{And:olympe.dc.Y.kd,Or:olympe.dc.Y.ce,Not:olympe.dc.Y.Ld,Equals:olympe.dc.Y.Zd,Contains:olympe.dc.Y.Ne,Greater:olympe.dc.Y.Ti,Smaller:olympe.dc.Y.wj,HasRelated:olympe.dc.Y.Kh,InstanceOf:olympe.dc.Y.Oh,Regex:olympe.dc.Y.Ze},Comparator:olympe.public.Me,comparators:{Number:olympe.dc.bc.Number,String:olympe.dc.bc.String,DateTime:olympe.dc.bc.DateTime},valuedefs:{BooleanProperty:olympe.dc.Ua.Ji,StringProperty:olympe.dc.Ua.Zh,NumberProperty:olympe.dc.Ua.Sh,DateTimeProperty:olympe.dc.Ua.Fh,Constant:olympe.dc.Ua.me,
|
|
991
992
|
Tag:olympe.dc.Ua.ai}});
|
|
992
993
|
|