@olympeio/runtime-node 9.2.1 → 9.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js
CHANGED
|
@@ -211,813 +211,814 @@ ea('String.prototype.padStart',function(a){return a?a:function(b,c){var d=ha(thi
|
|
|
211
211
|
ea('Array.prototype.flatMap',function(a){return a?a:function(b,c){for(var d=[],e=0;e<this.length;e++){var f=b.call(c,this[e],e,this);Array.isArray(f)?d.push.apply(d,f):d.push(f)}return d}});ea('Object.entries',function(a){return a?a:function(b){var c=[],d;for(d in b)Object.prototype.hasOwnProperty.call(b,d)&&c.push([d,b[d]]);return c}});ea('Object.values',function(a){return a?a:function(b){var c=[],d;for(d in b)Object.prototype.hasOwnProperty.call(b,d)&&c.push(b[d]);return c}});
|
|
212
212
|
ea('Promise.prototype.finally',function(a){return a?a:function(b){return this.then(function(c){return Promise.resolve(b()).then(function(){return c})},function(c){return Promise.resolve(b()).then(function(){throw c;})})}});
|
|
213
213
|
ea('Object.fromEntries',function(a){return a?a:function(b){var c={};if(!(Symbol.iterator in b))throw new TypeError(''+b+' is not iterable');b=b[Symbol.iterator].call(b);for(var d=b.next();!d.done;d=b.next()){d=d.value;if(Object(d)!==d)throw new TypeError('iterable for fromEntries should yield objects');c[d[0]]=d[1]}return c}});var ja=this||self;
|
|
214
|
-
function z(a,b){a=a.split('.');let c=ja;a[0]in c||'undefined'==typeof c.execScript||c.execScript('var '+a[0]);for(let d;a.length&&(d=a.shift());)a.length||void 0===b?c[d]&&c[d]!==Object.prototype[d]?c=c[d]:c=c[d]={}:c[d]=b};const olympe={
|
|
215
|
-
!0;for(;void 0!==(e=d());)b(e,[])}};olympe.U.Cf
|
|
216
|
-
olympe.U.gf=class{constructor(a,b,c=2){this.F=a;this.parameters=b;this.C=Object.create(null);this.N=new olympe.U.
|
|
217
|
-
function C(a,b,c,d,e=!1){qa(a.N,'Defining service (as a factory) '+b);a.C(b,d,c,!0,e)}function sa(a,b,c,d=!1){qa(a.N,'Defining service alias '+b);a.C(b,e=>e,[c],!0,d)}function ta(a,b){qa(a.N,'Defining abstract service '+b);a.C(b).
|
|
218
|
-
olympe.U.
|
|
219
|
-
var g=this.Be[f];g.id=g.id+'!!'+ ++olympe.U.
|
|
220
|
-
Object.keys(this.Be).length+' definitions');this.N.debug('Compiling...');this.N.C++;a=this.L;for(let b=0,c=a.length;b<c;b++)this.N.debug('running compilation pass '+(b+1)+': '+a[b].constructor.name),a[b].process(this);oa(this.N);this.N.debug('Compilation done, returning container');return new olympe.U.gf(this.Be,this.parameters,this.G)}};olympe.U.
|
|
221
|
-
e()):e(),g=this.
|
|
222
|
-
olympe.X.
|
|
223
|
-
olympe.X.yg=function(){let a='';for(let b=0;19>b;b++)a+='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'.charAt(Math.floor(62*Math.random()));return'@'+a};olympe.X
|
|
224
|
-
olympe.X.
|
|
214
|
+
function z(a,b){a=a.split('.');let c=ja;a[0]in c||'undefined'==typeof c.execScript||c.execScript('var '+a[0]);for(let d;a.length&&(d=a.shift());)a.length||void 0===b?c[d]&&c[d]!==Object.prototype[d]?c=c[d]:c=c[d]={}:c[d]=b};const olympe={ej:()=>'object'===typeof window?window:'object'===typeof global?global:self};olympe.ej().olympe=olympe;olympe.VC=(a,...b)=>{b.forEach(c=>{Object.getOwnPropertyNames(c.prototype).forEach(d=>{'constructor'!==d&&void 0===a.prototype[d]&&(a.prototype[d]=c.prototype[d])})})};olympe.ka={};olympe.ka.node={};'function'!==typeof require||global.Blob||(global.Blob=require('cross-blob'));olympe.U={};olympe.U.Cf={};olympe.U.Cf.$n=class{process(a){const b=Object.keys(a.Be);let c,d;c=0;for(d=b.length;c<d;c++)if(a.Md(b[c]).jj())throw Error('Service "'+b[c]+'" is defined as abstract and needs to be overridden');}};olympe.U.Cf.$n.ma=[olympe.U.Cf.hq];olympe.U.Cf.ao=class{process(a){function b(g,h){if(0<=h.indexOf(g))throw Error('Circular dependency detected: '+h.join(' > ')+' > '+g);h=h.concat(g);if(f[g]&&(delete f[g],g=a.Md(g),c(g.cj(),h),g=g.Ei,null!==g))for(let k=0,l=g.length;k<l;k++)c(g[k].cj(),h)}function c(g,h){for(let k=0,l=g.length,n;k<l;k++)n=g[k],n instanceof olympe.U.tb&&b(n.Z(),h)}function d(){for(const g in f)if(Object.prototype.hasOwnProperty.call(f,g))return g}var e=Object.keys(a.Be);const f={};for(let g=0,h=e.length;g<h;g++)f[e[g]]=
|
|
215
|
+
!0;for(;void 0!==(e=d());)b(e,[])}};olympe.U.Cf.ao.ma=[olympe.U.Cf.hq];olympe.U.Cf.hq=class{process(){}};const ka=[],la=[];olympe.U.eo=class{constructor(){}static C(a,b){ka.push(new olympe.U.ll(a,b))}static F(a,b,c){a.forEach(d=>{if(null===d||void 0===d)throw Error('Cannot proceed - DI configuration error. '+(c?`Run callback "${c}"`:'A run callback')+' cannot have a null or undefined dependency');});la.push(new olympe.U.ll(b,c,a))}};olympe.U.config=olympe.U.eo.C;olympe.U.run=olympe.U.eo.F;olympe.U.dl=class{constructor(){}getValue(){}};olympe.U.ll=class{constructor(a,b,c){this.F=a;this.G=[];this.C=b;if(void 0!==c){this.G=c;for(let d=0,e=c.length;d<e;d++)'string'===typeof c[d]&&(c[d]=new olympe.U.tb(c[d]))}}cj(){return this.G}};function ma(a,b,c){let d=a.C[b];if(void 0===d){const e=a.F[b];if(void 0===e){if(c===olympe.U.gf.C.Fh)return null;throw Error('Service "'+b+'" not found');}try{d=e.instantiate(a)}catch(f){throw a.N.error('Error during instantiation of service '+b),f;}!e.F&&(a.C[b]=d)}return d}function na(a,b){const c=b.length,d=Array(c);let e,f;for(e=0;e<c;e++)a.N.C++,f=b[e],d[e]=f instanceof olympe.U.dl?f.getValue(a):f,oa(a.N);return d}
|
|
216
|
+
olympe.U.gf=class{constructor(a,b,c=2){this.F=a;this.parameters=b;this.C=Object.create(null);this.N=new olympe.U.Gp(c);a=olympe.U.P.dg;if(void 0!==this.C[a])throw Error('Service "'+a+'" has already been instantiated');this.C[a]=this}Ya(){return this.N}getParameter(a){return this.parameters[a.toLowerCase()]}};olympe.U.gf.C={Ss:'exception',Fh:'null'};function pa(a,b,c){function d(f,g){let h,k,l;for(h in f)Object.prototype.hasOwnProperty.call(f,h)&&(k=f[h],l=g.concat((h.startsWith('#')?h.substring(1):h).toLowerCase()),'object'!==typeof k||null===k||h.startsWith('#')?e[l.join('.')]=k:d(k,l))}const e=a.parameters;d(b,c?[c]:[])}function A(a,b,c,...d){qa(a.N,'Defining service '+b);a.C(b,c,d,!1,!1)}function ra(a,b,c,...d){qa(a.N,'Defining service '+b);a.C(b,c,d,!1,!0)}
|
|
217
|
+
function C(a,b,c,d,e=!1){qa(a.N,'Defining service (as a factory) '+b);a.C(b,d,c,!0,e)}function sa(a,b,c,d=!1){qa(a.N,'Defining service alias '+b);a.C(b,e=>e,[c],!0,d)}function ta(a,b){qa(a.N,'Defining abstract service '+b);a.C(b).Ui=!0}function ua(a,b){a.parameters[olympe.H.Config.Wn.toLowerCase()]=b}function D(a,b,c){b=b.toLowerCase();Object.prototype.hasOwnProperty.call(a.parameters,b)||(a.parameters[b]=c)}
|
|
218
|
+
olympe.U.Es=class{constructor(a){var b=va,c=wa;this.Be=Object.create(null);this.parameters=Object.create(null);this.L=[new olympe.U.Cf.$n,new olympe.U.Cf.ao];this.F=[];b&&pa(this,b);c&&pa(this,c,'version');a&&pa(this,a);a=this.getParameter(olympe.U.Config.Vt);this.G=void 0!==a?a:3;this.N=new olympe.U.Gp(this.G)}Ya(){return this.N}C(a,b,c,d,e){const f=a instanceof olympe.U.tb?a.Z():a;if(3<=arguments.length&&c){const h=c.indexOf(f);if(-1!==h){if(void 0===this.Be[f])throw Error(`ContainerBuilder.define: Service ${f} references itself and is not an override definition!`);
|
|
219
|
+
var g=this.Be[f];g.id=g.id+'!!'+ ++olympe.U.ql.C;g.F=!0;g=g.id;c[h]=g;this.Be[g]=this.Be[f]}}this.Be[f]=new olympe.U.ql(b,c,d||!1,f);return this.Be[f]}Md(a){a=this.Be[a];if(void 0===a)throw Error();return a}getParameter(a){return this.parameters[a.toLowerCase()]}compile(){var a=this.F;this.N.debug('Calling '+a.length+' configure callbacks');this.N.C++;for(let b=0,c=a.length;b<c;b++)qa(this.N,'Calling callback'),this.N.C++,a[b].call(null,this),oa(this.N);oa(this.N);this.N.debug('Configuration summary: '+
|
|
220
|
+
Object.keys(this.Be).length+' definitions');this.N.debug('Compiling...');this.N.C++;a=this.L;for(let b=0,c=a.length;b<c;b++)this.N.debug('running compilation pass '+(b+1)+': '+a[b].constructor.name),a[b].process(this);oa(this.N);this.N.debug('Compilation done, returning container');return new olympe.U.gf(this.Be,this.parameters,this.G)}};olympe.U.ql=class{constructor(a,b,c,d){this.G=a||null;this.L=!!c;this.C=[];this.Ui=!1;this.Ei=null;if(b){this.C=b;for(let e=0,f=b.length;e<f;e++)'string'===typeof b[e]&&(b[e]=new olympe.U.tb(b[e]))}this.id=d||'';this.F=!1}Z(){return this.id}instantiate(a){const b=a.Ya();b.debug('Resolving arguments for '+this.id);const c=this.G;let d=na(a,this.C);const e=()=>{if(this.L)return c.apply(null,d);d.unshift(null);return new (c.bind.apply(c,d))};qa(b,'Instantiating '+this.id);const f=olympe.D?olympe.D.lh().run(()=>
|
|
221
|
+
e()):e(),g=this.Ei;let h,k,l;if(null!==g&&0<g.length){b.C++;qa(b,'Calling configuration callbacks:');k=0;for(l=g.length;k<l;k++)b.C++,h=g[k],qa(b,'Calling additional configuration callback '+h.C),d=na(a,h.cj()),d.push(f),h.F.apply(null,d),oa(b);oa(b)}qa(b,'Done instantiating '+this.id);return f}cj(){return this.C}jj(){return this.Ui}config(a,b,c){null===this.Ei&&(this.Ei=[]);this.Ei.push(new olympe.U.ll(b,c,a))}};olympe.U.ql.C=0;function oa(a){0<a.C&&a.C--}function qa(a,b){1>=a.F&&xa(a,'log','DI: '+b)}function xa(a,b,c){if(console&&console[b]){var d='';for(let e=0;e<a.C;e++)d+=' ';console[b](d+c)}}olympe.U.Gp=class{constructor(a){this.F=a;this.C=0}debug(a){2>=this.F&&xa(this,'log','DI: '+a)}info(a){3>=this.F&&xa(this,'info','DI: '+a)}warn(a){4>=this.F&&xa(this,'warn','DI: '+a)}error(a){5>=this.F&&xa(this,'error','DI: '+a)}};olympe.U.fa=class extends olympe.U.dl{constructor(a){super();this.id=a}Z(){return this.id}getValue(a){return a.getParameter(this.id)}};olympe.U.tb=class extends olympe.U.dl{constructor(a,b){super();this.id=a;this.C=b||olympe.U.gf.C.Ss}Z(){return this.id}getValue(a){return ma(a,this.id,this.C)}};olympe.U.P={dg:'di.Container',OA:'di.PublicContainer'};olympe.U.Config={Vt:'logging.di'};olympe.U.run([olympe.U.P.dg],a=>{olympe.U.getParameter=b=>a.getParameter(b)});olympe.X={};function ya(a){a='0'.repeat(12)+a.toString(16);return a.substring(a.length-12,a.length)}function za(){var a=Math.random();return ya((new Date).getTime())+(a.toString(16)+'0'.repeat(8)).substr(2,8)}let Aa=Math.pow(2,32)-1;olympe.X.ec=function(){return za()};olympe.X.ih=function(){return za()};olympe.X.Ik=function(a,b=1){const c=a.substr(12,a.length-12);return ya(parseInt(a.substr(0,12),16)+b)+c};
|
|
222
|
+
olympe.X.Zw=function(a){return ya(parseInt(a.substr(0,12),16)+1)+(Math.random().toString(16)+'00000000').substr(2,8)};let Ba=0,Ca=0;olympe.X.gw=function(){var a=(new Date).getTime();a<=Ba?4294967295===Ca?(Ca=Math.floor(Math.random()/4*Aa),Ba+=1):Ca=Math.floor(Ca+(4294967295-Ca)/2):(Ca=Math.floor(Math.random()/4*Aa),Ba=a);a='00000000'+Ca.toString(16);return ya(Ba)+a.substr(a.length-8,8)};olympe.X.uD=function(){for(let a=0;1E4>a;a++)console.log(olympe.X.gw())};
|
|
223
|
+
olympe.X.yg=function(){let a='';for(let b=0;19>b;b++)a+='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'.charAt(Math.floor(62*Math.random()));return'@'+a};olympe.X.$C=function(a){let b='';for(let c=0;5>c;c++)b+='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'.charAt(Math.floor(62*Math.random()));return(a?a:'UI')+'-'+b};olympe.X.XC=function(a,b){return(b?b:'UI')+'-'+a};olympe.X.rp=class{constructor(a){this.id=a||olympe.X.rp.C++}nb(a){return a?this.id===a.id:!1}toJSON(){return this.id.toString()}toString(){return this.id.toString()}};olympe.X.rp.C=0;olympe.X.AA=class{constructor(a,b,c,d,e,f){this.C=[a||0,b||0,0,c||0,d||0,0,e||0,f||0,1]}set(a,b,c){this.C[3*a+b]=c}get(a,b){return this.C[3*a+b]}};olympe.X.Dh=function(a,b,c,d,e,f,g,h,k,l,n,p,q){this.values=[a,b,c,0,0,d,e,f,0,0,g,h,k,0,0,l,n,p,q,0]};olympe.X.Dh.F=function(a){return new olympe.X.Dh(.213+.787*a,.715-.715*a,.072-.072*a,.213-.213*a,.715+.285*a,.072-.072*a,.213-.213*a,.715-.715*a,.072+.928*a,0,0,0,1)};olympe.X.Dh.C=function(){return new olympe.X.Dh(0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0)};olympe.X.Dh.prototype.set=function(a,b,c){this.values[5*a+b]=c};olympe.X.Dh.prototype.get=function(a,b){return this.values[5*a+b]};function Da(a){return(new TextEncoder).encode(a).buffer}function Ea(a){return(new TextDecoder('utf8')).decode(a)}olympe.X.hl=class{R(){}C(){}G(){}L(){}F(){}W(){}};olympe.X.rr=a=>a.replace('+','-').replace('/','_');olympe.X.Ev=a=>a.replace('-','+').replace('_','/');function Fa(a){a.C=setTimeout(()=>{const b=Date.now(),c=a.timeout;for(const [d,e]of a.values)b-e>c&&(a.delete(d),a.G&&a.G(d));0<a.values.size?Fa(a):a.F&&a.F()},a.L)}function Ga(a,b){a.values.has(b)&&a.values.set(b,Date.now())}function Ha(a,b){a.G=b;return a}
|
|
224
|
+
olympe.X.om=class{constructor(a,b=a/2){this.timeout=a;this.L=b;this.values=new Map;this.F=this.G=this.C=null}add(a){this.values.set(a,Date.now());null===this.C&&Fa(this)}has(a){return this.values.has(a)}delete(a){a=this.values.delete(a);0===this.values.size&&(this.C&&clearTimeout(this.C),this.C=null,this.F&&this.F());return a}clear(){this.C&&clearTimeout(this.C);this.C=null;this.values.clear();return this}};olympe.X.nm=class{constructor(a){this.F=Ha(new olympe.X.om(a,void 0),b=>{const c=this.values.get(b);this.values.delete(b);this.C&&this.C(b,c)});this.values=new Map;this.C=null}set(a,b){this.values.set(a,b);this.F.add(a);return this}has(a){return this.values.has(a)}get(a){return this.values.get(a)}delete(a){this.values.delete(a);return this.F.delete(a)}clear(){this.F.clear();this.values.clear();return this}};function Ia(a,b){return a+b&4294967295}
|
|
225
225
|
function Ja(a,b){let c=a[0],d=a[1],e=a[2],f=a[3];c=F(c,d,e,f,b[0],7,-680876936);f=F(f,c,d,e,b[1],12,-389564586);e=F(e,f,c,d,b[2],17,606105819);d=F(d,e,f,c,b[3],22,-1044525330);c=F(c,d,e,f,b[4],7,-176418897);f=F(f,c,d,e,b[5],12,1200080426);e=F(e,f,c,d,b[6],17,-1473231341);d=F(d,e,f,c,b[7],22,-45705983);c=F(c,d,e,f,b[8],7,1770035416);f=F(f,c,d,e,b[9],12,-1958414417);e=F(e,f,c,d,b[10],17,-42063);d=F(d,e,f,c,b[11],22,-1990404162);c=F(c,d,e,f,b[12],7,1804603682);f=F(f,c,d,e,b[13],12,-40341101);e=F(e,f,
|
|
226
226
|
c,d,b[14],17,-1502002290);d=F(d,e,f,c,b[15],22,1236535329);c=G(c,d,e,f,b[1],5,-165796510);f=G(f,c,d,e,b[6],9,-1069501632);e=G(e,f,c,d,b[11],14,643717713);d=G(d,e,f,c,b[0],20,-373897302);c=G(c,d,e,f,b[5],5,-701558691);f=G(f,c,d,e,b[10],9,38016083);e=G(e,f,c,d,b[15],14,-660478335);d=G(d,e,f,c,b[4],20,-405537848);c=G(c,d,e,f,b[9],5,568446438);f=G(f,c,d,e,b[14],9,-1019803690);e=G(e,f,c,d,b[3],14,-187363961);d=G(d,e,f,c,b[8],20,1163531501);c=G(c,d,e,f,b[13],5,-1444681467);f=G(f,c,d,e,b[2],9,-51403784);
|
|
227
227
|
e=G(e,f,c,d,b[7],14,1735328473);d=G(d,e,f,c,b[12],20,-1926607734);c=H(d^e^f,c,d,b[5],4,-378558);f=H(c^d^e,f,c,b[8],11,-2022574463);e=H(f^c^d,e,f,b[11],16,1839030562);d=H(e^f^c,d,e,b[14],23,-35309556);c=H(d^e^f,c,d,b[1],4,-1530992060);f=H(c^d^e,f,c,b[4],11,1272893353);e=H(f^c^d,e,f,b[7],16,-155497632);d=H(e^f^c,d,e,b[10],23,-1094730640);c=H(d^e^f,c,d,b[13],4,681279174);f=H(c^d^e,f,c,b[0],11,-358537222);e=H(f^c^d,e,f,b[3],16,-722521979);d=H(e^f^c,d,e,b[6],23,76029189);c=H(d^e^f,c,d,b[9],4,-640364487);
|
|
228
228
|
f=H(c^d^e,f,c,b[12],11,-421815835);e=H(f^c^d,e,f,b[15],16,530742520);d=H(e^f^c,d,e,b[2],23,-995338651);c=J(c,d,e,f,b[0],6,-198630844);f=J(f,c,d,e,b[7],10,1126891415);e=J(e,f,c,d,b[14],15,-1416354905);d=J(d,e,f,c,b[5],21,-57434055);c=J(c,d,e,f,b[12],6,1700485571);f=J(f,c,d,e,b[3],10,-1894986606);e=J(e,f,c,d,b[10],15,-1051523);d=J(d,e,f,c,b[1],21,-2054922799);c=J(c,d,e,f,b[8],6,1873313359);f=J(f,c,d,e,b[15],10,-30611744);e=J(e,f,c,d,b[6],15,-1560198380);d=J(d,e,f,c,b[13],21,1309151649);c=J(c,d,e,f,
|
|
229
229
|
b[4],6,-145523070);f=J(f,c,d,e,b[11],10,-1120210379);e=J(e,f,c,d,b[2],15,718787259);d=J(d,e,f,c,b[9],21,-343485551);a[0]=Ia(c,a[0]);a[1]=Ia(d,a[1]);a[2]=Ia(e,a[2]);a[3]=Ia(f,a[3])}function H(a,b,c,d,e,f){b=Ia(Ia(b,a),Ia(d,f));return Ia(b<<e|b>>>32-e,c)}function F(a,b,c,d,e,f,g){return H(b&c|~b&d,a,b,e,f,g)}function G(a,b,c,d,e,f,g){return H(b&d|c&~d,a,b,e,f,g)}function J(a,b,c,d,e,f,g){return H(c^(b|~d),a,b,e,f,g)}
|
|
230
230
|
function Ka(a,b=32){const c='0123456789abcdef'.split('');var d=a,e=d.length;a=[1732584193,-271733879,-1732584194,271733878];var f;for(f=64;f<=d.length;f+=64){var g=d.substring(f-64,f),h=[];for(let k=0;64>k;k+=4)h[k>>2]=g.charCodeAt(k)+(g.charCodeAt(k+1)<<8)+(g.charCodeAt(k+2)<<16)+(g.charCodeAt(k+3)<<24);Ja(a,h)}d=d.substring(f-64);g=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(f=0;f<d.length;f++)g[f>>2]|=d.charCodeAt(f)<<(f%4<<3);g[f>>2]|=128<<(f%4<<3);if(55<f)for(Ja(a,g),f=0;16>f;f++)g[f]=0;g[14]=8*e;
|
|
231
|
-
Ja(a,g);d='';e=0;b=0<=b?b:32;for(f=0;4>f;f++)for(h=a[f],g=0;4>g;g++){if(++e>b)return d;d+=c[h>>8*g+4&15];if(++e>b)return d;d+=c[h>>8*g&15]}return d}'5d41402abc4b2a76b9719d911017c592'!==Ka('hello')&&(Ia=(a,b)=>{const c=(a&65535)+(b&65535);return(a>>16)+(b>>16)+(c>>16)<<16|c&65535});olympe.X.
|
|
232
|
-
r=decodeURIComponent(r);b[q[1]]=r}return{scheme:a||null,
|
|
233
|
-
olympe.X.
|
|
234
|
-
olympe.X.
|
|
235
|
-
olympe.ra.Ob.C={
|
|
236
|
-
olympe.ra.pd.Ob=class{constructor(a,b,c){this.name=a;this.C=b;this.Sa=c;this.F=a.toUpperCase();this.Ka=new Map;this.
|
|
237
|
-
this.F,a,'#888','debug')}log(...a){this.da()&&Na(this,'log',this.F,a,'#000','log')}info(...a){this.$()&&Na(this,'info',this.F,a,'#00f','info')}warn(...a){this.ta()&&Na(this,'warn',this.F,a,'#684911','warn')}error(...a){this.R()&&Na(this,'error',this.F,a,'#f00','error')}fatal(...a){this.W()&&Na(this,'error',this.F,a,'#f00','fatal')}};olympe.ra.pd.Ob.ma=[olympe.ra.Ob];olympe.ra.pd.pa=class{constructor(a,b,c){this.C=a;this.F=parseInt(b,10);this.G=c;this.channels=new Map;this.N=this.
|
|
238
|
-
c.toLowerCase())&&(d=!0===this.C.getParameter(c));b=new olympe.ra.pd.Ob(a,b,d);this.channels.set(a,b)}return b}};olympe.ra.pd.pa.ma=[olympe.ra.pa];olympe.ra.P={Aa:'logging.Manager'};olympe.ra.Config={
|
|
239
|
-
olympe.D.J.F=new olympe.D.J(()=>olympe.D.Za);olympe.D.J.R=new olympe.D.J(()=>olympe.D.sa);olympe.D.J.W=new olympe.D.J(()=>olympe.D.kc);olympe.D.wh=class{Z(){return''}Xc(){return''}destroy(){}G(){return!1}$(){return!1}run(a,...b){return a(...b)}F(a){return a}getParent(){return null}We(){}jh(){}$d(){}Kd(){}
|
|
240
|
-
olympe.D.Zb=class{constructor(a='SimpleContext',b){++Ra;this.Ab=new Map;this.Hb=new Map;this.
|
|
241
|
-
this.Hb.clear();this.
|
|
242
|
-
this.
|
|
243
|
-
function Ta(a,b){a.ta||(a.ta=new Map);a.ta.set(b.Z(),b);switch(b.Od()){case olympe.D.Node.C.
|
|
231
|
+
Ja(a,g);d='';e=0;b=0<=b?b:32;for(f=0;4>f;f++)for(h=a[f],g=0;4>g;g++){if(++e>b)return d;d+=c[h>>8*g+4&15];if(++e>b)return d;d+=c[h>>8*g&15]}return d}'5d41402abc4b2a76b9719d911017c592'!==Ka('hello')&&(Ia=(a,b)=>{const c=(a&65535)+(b&65535);return(a>>16)+(b>>16)+(c>>16)<<16|c&65535});olympe.X.pb=Ka;olympe.X.ly=function(a){var b=/^(?:(\S*)@)?([^:]+)(?::(\d{2,5}))?$/;const c=/([^&=]+)=([^&=]+)/g,d=/^true|false$/i,e=/^\d+(\.\d+)?$/;var f=a.match(/^(?:([^:/?#]+):)?(?:\/\/([^/?#]*))?\/?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/);a=f[1];const g=f[2],h=f[3],k=f[4];f=f[5];let l=null,n=null;var p=null;g&&(p=g.match(b),l=p[1],n=p[2],p=p[3]);b={};let q;for(;q=c.exec(k);){let r=q[2];void 0===r?r=!0:r.startsWith('"')&&r.endsWith('"')?r=r.substring(1,r.length-1):d.test(r)?r='true'===r.toLowerCase():e.test(r)?r=parseFloat(r):
|
|
232
|
+
r=decodeURIComponent(r);b[q[1]]=r}return{scheme:a||null,LC:g||null,es:l||null,host:n||null,port:p&&parseInt(p,10)||null,path:h&&'/'!==h?h:null,query:k||null,YC:f||null,parameters:b}};olympe.X.pD=function(a){a=a.substring(1);return''===a?new Map:new Map(a.split('&').map(b=>b.split('=')))};olympe.X.sD=function(a){let b='';for(let c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b+=(b?'&':'?')+c+'='+encodeURIComponent(a[c]));return b};
|
|
233
|
+
olympe.X.Hr=(a,b)=>{const c=Object.keys(a).find(d=>a[d]===b);return void 0===c?null:c};olympe.X.gn=(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.X.gn(a[c],d):a[c]=d}};olympe.X.Rm=(a,b,c)=>{const d=Object.create(null);b(a,e=>{olympe.X.gn(d,e);b(`conf.d/${a}`,f=>{olympe.X.gn(d,f);c(d)})})};olympe.X.IC=class a{constructor(b,c){this.x=b;this.y=c}add(b){return new a(this.x+b.x,this.y+b.y)}Ag(){return Math.sqrt(this.x*this.x+this.y*this.y)}toString(){return`Vector(${this.x}, ${this.y})`}};olympe.X.iz=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.X.Yt=class{constructor(a,b){this.start=a;this.end=b}};olympe.X.Yt.C={Fi:'left',Ni:'right',gz:'bottom',dC:'top'};function La(a){a=/([0-9]*)\.([0-9]*)\.([0-9]*)-?([A-z\-_0-9]*)/.exec(a);if(null===a||4>a.length)return olympe.X.Th.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.X.Th.C:new olympe.X.Th(b,c,d,a[4])}function Ma(a){return`${a.C}.${a.F}.${a.G}`}
|
|
234
|
+
olympe.X.Th=class{constructor(a,b,c,d){this.C=a;this.F=b;this.G=c;this.L=d||null}Jk(a){return this.C!==a.C?this.C>a.C:this.F!==a.F?this.F>a.F:this.G>a.G}uj(a){return this.C!==a.C?this.C<a.C:this.F!==a.F?this.F<a.F:this.G<a.G}nb(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.X.Th.C=new olympe.X.Th(Number.NaN,Number.NaN,Number.NaN);olympe.X.P={th:'utils.binaryConverter',ps:'utils.base64Converter'};olympe.U.config(a=>{ta(a,olympe.X.P.th);sa(a,olympe.X.P.ps,olympe.X.P.th,!0)},'Utils services');olympe.U.run([olympe.X.P.th],a=>{olympe.X.bi=()=>a});olympe.ra={};olympe.ra.Ob=class{L(){}ja(){}G(){}$(){}da(){}ta(){}R(){}W(){}trace(){}debug(){}log(){}info(){}warn(){}error(){}fatal(){}};olympe.ra.Ob.prototype.fatal=olympe.ra.Ob.prototype.fatal;olympe.ra.Ob.prototype.error=olympe.ra.Ob.prototype.error;olympe.ra.Ob.prototype.warn=olympe.ra.Ob.prototype.warn;olympe.ra.Ob.prototype.info=olympe.ra.Ob.prototype.info;olympe.ra.Ob.prototype.log=olympe.ra.Ob.prototype.log;olympe.ra.Ob.prototype.debug=olympe.ra.Ob.prototype.debug;olympe.ra.Ob.prototype.trace=olympe.ra.Ob.prototype.trace;
|
|
235
|
+
olympe.ra.Ob.C={av:0,eg:1,Ut:2,mp:3,kv:4,ac:5,Vs:6,Ql:7};olympe.ra.Ob.F={0:'TRACE',1:'DEBUG',2:'LOG',3:'INFO',4:'WARN',5:'ERROR',6:'FATAL',7:'NOTHING'};olympe.ra.pa=class{Nc(){}};olympe.ra.pd={};function Na(a,b,c,d,e,f){var g=new Date;g=('00'+g.getHours()).substr(-2)+':'+('00'+g.getMinutes()).substr(-2)+':'+('00'+g.getSeconds()).substr(-2)+'.'+('00'+g.getMilliseconds()).substr(-3);f=a.Sa?`%c[${g}] [${f.toUpperCase()}] ${c}:%c`:`%c[${g}] ${c}:%c`;for(const h of d)f+=' '+h;a.Wa[b](f,'color: '+e,'color: #444');for(const h of a.Ka.values())h(g,c,b,...d)}
|
|
236
|
+
olympe.ra.pd.Ob=class{constructor(a,b,c){this.name=a;this.C=b;this.Sa=c;this.F=a.toUpperCase();this.Ka=new Map;this.Wa=console}L(){return this.C}ja(){return this.C<=olympe.ra.Ob.C.av}G(){return this.C<=olympe.ra.Ob.C.eg}da(){return this.C<=olympe.ra.Ob.C.Ut}$(){return this.C<=olympe.ra.Ob.C.mp}ta(){return this.C<=olympe.ra.Ob.C.kv}R(){return this.C<=olympe.ra.Ob.C.ac}W(){return this.C<=olympe.ra.Ob.C.Vs}trace(...a){this.ja()&&Na(this,'log',this.F,a,'#99b','trace')}debug(...a){this.G()&&Na(this,'log',
|
|
237
|
+
this.F,a,'#888','debug')}log(...a){this.da()&&Na(this,'log',this.F,a,'#000','log')}info(...a){this.$()&&Na(this,'info',this.F,a,'#00f','info')}warn(...a){this.ta()&&Na(this,'warn',this.F,a,'#684911','warn')}error(...a){this.R()&&Na(this,'error',this.F,a,'#f00','error')}fatal(...a){this.W()&&Na(this,'error',this.F,a,'#f00','fatal')}};olympe.ra.pd.Ob.ma=[olympe.ra.Ob];olympe.ra.pd.pa=class{constructor(a,b,c){this.C=a;this.F=parseInt(b,10);this.G=c;this.channels=new Map;this.N=this.Nc('logging');this.N.info('Logging initialized, global log level is '+olympe.ra.Ob.F[b])}Nc(a){var b=this.channels.get(a);if(!b){b=this.F;var c=`${olympe.ra.Config.vs}.${a}`;Object.prototype.hasOwnProperty.call(this.C.parameters,c.toLowerCase())&&(b=parseInt(this.C.getParameter(c),10));let d=this.G;c=`${c}.${olympe.ra.Config.Pu}`;Object.prototype.hasOwnProperty.call(this.C.parameters,
|
|
238
|
+
c.toLowerCase())&&(d=!0===this.C.getParameter(c));b=new olympe.ra.pd.Ob(a,b,d);this.channels.set(a,b)}return b}};olympe.ra.pd.pa.ma=[olympe.ra.pa];olympe.ra.P={Aa:'logging.Manager'};olympe.ra.Config={Oo:'logging',Po:'logging.showLogLevel',vs:'logging',Pu:'showLogLevel'};olympe.U.config(function(a){D(a,olympe.ra.Config.Oo,olympe.ra.Ob.C.mp);D(a,olympe.ra.Config.Po,!0);ra(a,olympe.ra.P.Aa,olympe.ra.pd.pa,olympe.U.P.dg,new olympe.U.fa(olympe.ra.Config.Oo),new olympe.U.fa(olympe.ra.Config.Po))},'olympe.logging');olympe.U.run([olympe.ra.P.Aa],a=>{olympe.ra.Ya=b=>a.Nc(b)},'Logging singleton getter initialization');olympe.D={};olympe.D.Config={Mp:'df.nodeCreationThreshold'};const Oa=[];function Pa(){}function Qa(){}olympe.D.J=class a{constructor(b,c,d){this.C=void 0===b?Pa:b;this.F=void 0===c?Oa:c;this.$=d}static L(){var b=[];return void 0===b||0===b.length?olympe.D.J.da:new a(Qa,b)}L(){return this.C?this.C():void 0}G(){return this.F?this.F:Oa}R(){return null===this.C&&null===this.F}W(){return this.C===Qa}};olympe.D.J.$=new olympe.D.J;olympe.D.J.C=new olympe.D.J(null,null);olympe.D.J.da=new olympe.D.J(Qa);olympe.D.J.G=new olympe.D.J(()=>olympe.D.ga);
|
|
239
|
+
olympe.D.J.F=new olympe.D.J(()=>olympe.D.Za);olympe.D.J.R=new olympe.D.J(()=>olympe.D.sa);olympe.D.J.W=new olympe.D.J(()=>olympe.D.kc);olympe.D.wh=class{Z(){return''}Xc(){return''}destroy(){}G(){return!1}$(){return!1}run(a,...b){return a(...b)}F(a){return a}getParent(){return null}We(){}jh(){}$d(){}Kd(){}Ck(){}Ka(){}onDestroy(){return''}Xe(){}R(){return''}be(){}};olympe.D.wh.prototype.offDestroy=olympe.D.wh.prototype.Xe;olympe.D.wh.prototype.onDestroy=olympe.D.wh.prototype.onDestroy;let Ra=0;olympe.U.run([new olympe.U.fa(olympe.D.Config.Mp)],()=>{});
|
|
240
|
+
olympe.D.Zb=class{constructor(a='SimpleContext',b){++Ra;this.Ab=new Map;this.Hb=new Map;this.jb=new Map;this.zc=0;this.name=a;this.id=String(Ra);this.Hc=this.Vb=!1;(this.ja=void 0===b?olympe.D.La():b)&&this.ja.$d(this);this.debug=!1}Z(){return this.id}Xc(){return this.name}run(a,...b){if(!this.Vb){var c=olympe.D.Yr(this);a=a(...b);c&&olympe.D.Yr(c);return a}}F(a){return(...b)=>this.run(a,...b)}destroy(){if(!this.Vb&&!this.Hc){this.Hc=!0;this.Ka();for(const a of this.Hb.keys())this.Hb.has(a)&&this.Hb.get(a)();
|
|
241
|
+
this.Hb.clear();this.jb.clear();this.ja&&(this.ja.Kd(this,!1),this.ja=null);this.Vb=!0;this.Hc=!1;this.Ka()}}G(){return this.Vb}$(){return this.Hc}$d(a){if(!this.Vb){var b;olympe.D.ob(a)?b=a.Pa:olympe.D.bn(a)&&(b=a);b&&this.Ab.set(b.Z(),b)}}Kd(a,b=!0){let c;olympe.D.ob(a)?c=a.Pa:olympe.D.bn(a)&&(c=a);c&&this.Ab.has(c.Z())&&(b&&c.Ck(this),this.Ab.delete(c.Z()))}Ck(){this.ja=null;this.destroy()}Ka(){const a=this.Ab;for(const b of a.keys())a.has(b)&&a.get(b).Ck(this);this.Ab.clear();for(const b of this.jb.keys())this.jb.has(b)&&
|
|
242
|
+
this.jb.get(b)();this.jb.clear()}onDestroy(a,b){void 0===b&&(++this.zc,b=String(this.zc));this.Hb.set(b,a);return b}Xe(a){this.Hb.delete(a)}R(a){if(void 0===b){++this.zc;var b=String(this.zc)}this.jb.set(b,a);return b}be(a){this.jb.delete(a)}We(a){this.ja&&this.ja.Kd(this,!1);(this.ja=a||null)&&this.ja.$d(this)}getParent(){return this.ja}jh(){return this.Ab}};olympe.D.yq=class extends olympe.D.Zb{constructor(){super('Root',null)}destroy(){}onDestroy(){return''}Xe(){}};olympe.D.wh.ma=[olympe.D.wh];let Sa=0;
|
|
243
|
+
function Ta(a,b){a.ta||(a.ta=new Map);a.ta.set(b.Z(),b);switch(b.Od()){case olympe.D.Node.C.Eh:break;case olympe.D.Node.C.Sh:break;case olympe.D.Node.C.bk:case olympe.D.Node.C.gg:olympe.D.N.warn('Not bad as such but should not happen!');break;case olympe.D.Node.C.xh:Ua(a,olympe.D.Node.C.xh);break;case olympe.D.Node.C.OBSOLETE:a.od=!0;a.L!==olympe.D.Node.C.xh&&Ua(a,olympe.D.Node.C.OBSOLETE);break;case olympe.D.Node.C.fg:olympe.D.N.warn('Adding a destroyed node as upstream => should never happen!');break;
|
|
244
244
|
default:olympe.D.N.warn('Unknown state, investigate: ',b.Od())}Va(b,a)}
|
|
245
|
-
function Wa(a){if(a.zd){var b=[],c=[];if(a.Yf)if(a.Yf instanceof olympe.D.Node)if(Xa(a.Yf))b=a.Yf.Kb;else return;else b=a.Yf;else b=null;if(null!==a.
|
|
246
|
-
Ya(a,e.Pa):e instanceof olympe.D.Node?Ya(a,e):(K(a,e),void 0===e&&void 0===a.valueType&&Ua(a,olympe.D.Node.C.
|
|
247
|
-
function eb(a){if(a.L!==olympe.D.Node.C.OBSOLETE&&a.L!==olympe.D.Node.C.
|
|
248
|
-
function K(a,b,c){b instanceof olympe.D.Node&&(olympe.D.N.warn('We are setting the value of a node as a node, that should never happen?'),b=b.Kb);a.bc||c||void 0===a.W||ab(a);if(void 0!==b){if((a.bc||a.L===olympe.D.Node.C.
|
|
245
|
+
function Wa(a){if(a.zd){var b=[],c=[];if(a.Yf)if(a.Yf instanceof olympe.D.Node)if(Xa(a.Yf))b=a.Yf.Kb;else return;else b=a.Yf;else b=null;if(null!==a.Wa){const e=a.ug;for(let f=0,g=a.Wa.length;f<g;f++)if(null!==e&&-1<e.indexOf(f)){const h=a.Wa[f];if(Xa(h))c.push(h.Kb);else return}else c.push(a.Wa[f])}if(a.zd instanceof Function)var d=a.zd;else b&&(b[a.zd]||olympe.D.N.warn('looks like you forget a cast somewhere around '+a.zd),d=b[a.zd]);a.run(()=>{a.Ka();if(void 0!==d){const e=d.apply(b,c);e&&e.jr?
|
|
246
|
+
Ya(a,e.Pa):e instanceof olympe.D.Node?Ya(a,e):(K(a,e),void 0===e&&void 0===a.valueType&&Ua(a,olympe.D.Node.C.Sh))}else Za(a)})}}function L(a){void 0===a.vd&&(a.vd=a.valueType===olympe.D.Proxy?$a(void 0,a.fe):$a(a.valueType,a.fe),a.vd.Pa=a);return a.vd}function ab(a){void 0!==a.W&&(bb(a.W,a),a.W=void 0)}function cb(a){if(a.L===olympe.D.Node.C.OBSOLETE&&(a.L=olympe.D.Node.C.Sh,null!==a.da))for(const b of a.da.values())db(b)}function Ua(a,b){b!==a.L&&(a.L=b)}
|
|
247
|
+
function eb(a){if(a.L!==olympe.D.Node.C.OBSOLETE&&a.L!==olympe.D.Node.C.bk&&a.L!==olympe.D.Node.C.Eh&&a.L!==olympe.D.Node.C.xh){Ua(a,olympe.D.Node.C.bk);var b=a.da;if(b)for(const c of b.values())b.has(c.Z())&&eb(c);Ua(a,olympe.D.Node.C.OBSOLETE)}}function fb(a,b,c){if(a.L!==olympe.D.Node.C.gg)if(b===a.W)K(a,c,!0);else{if(a.L===olympe.D.Node.C.OBSOLETE||a.L===olympe.D.Node.C.bk)a.od=!0;Wa(a)}}
|
|
248
|
+
function K(a,b,c){b instanceof olympe.D.Node&&(olympe.D.N.warn('We are setting the value of a node as a node, that should never happen?'),b=b.Kb);a.bc||c||void 0===a.W||ab(a);if(void 0!==b){if((a.bc||a.L===olympe.D.Node.C.Sh||a.L===olympe.D.Node.C.OBSOLETE)&&!olympe.D.ob(b)&&void 0!==a.Kb){if(null===b&&null===a.Kb){cb(a);return}if(null!==b&&null!==a.Kb&&(b.valueOf()===a.Kb.valueOf()||a.Kb.nb&&a.Kb.nb(b))){cb(a);return}}if(!0===a.bc)olympe.D.N.error("Circular dependency detected: updating a downstream node caused this node's (#"+
|
|
249
249
|
a.Z()+') value to get updated !');else{a.L===olympe.D.Node.C.fg&&olympe.D.N.warn(`trying to set a value on a destroyed node (#${a.Z()} ${a.wd?', '+a.wd:''})`);a.L===olympe.D.Node.C.gg&&olympe.D.N.warn(`trying to set a value on a node being destroyed (#${a.Z()} ${a.wd?', '+a.wd:''})`);a.bc=!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
|
|
250
|
-
Object?d=!0:b.toLowerCase()!==e.toLowerCase()&&a.valueType!==Object&&(d=!0),d&&('string'===b.toLowerCase()&&a.valueType===olympe.D.Za?(c=olympe.D.yb(c),d=!1):'number'===b.toLowerCase()&&a.valueType===olympe.D.ga?(c=olympe.D.Ba(c),d=!1):'boolean'===b.toLowerCase()&&a.valueType===olympe.D.sa&&(c=olympe.D.wc(c),d=!1)));a.Kb=c;Ua(a,olympe.D.Node.C.
|
|
251
|
-
function gb(a,b){if(a.L!==olympe.D.Node.C.gg&&a.L!==olympe.D.Node.C.fg&&(a.L!==olympe.D.Node.C.
|
|
250
|
+
Object?d=!0:b.toLowerCase()!==e.toLowerCase()&&a.valueType!==Object&&(d=!0),d&&('string'===b.toLowerCase()&&a.valueType===olympe.D.Za?(c=olympe.D.yb(c),d=!1):'number'===b.toLowerCase()&&a.valueType===olympe.D.ga?(c=olympe.D.Ba(c),d=!1):'boolean'===b.toLowerCase()&&a.valueType===olympe.D.sa&&(c=olympe.D.wc(c),d=!1)));a.Kb=c;Ua(a,olympe.D.Node.C.Sh);if(b=a.da){d=0;for(const f of b.values())0<d&&eb(f),d++;for(const f of b.values())fb(f,a,c)}a.bc=!1}}}
|
|
251
|
+
function gb(a,b){if(a.L!==olympe.D.Node.C.gg&&a.L!==olympe.D.Node.C.fg&&(a.L!==olympe.D.Node.C.Eh||a.zd)){var c=void 0!==a.defaultValue;a.zd&&b!==a.W&&a.Ka();if(c)K(a,a.defaultValue,!0);else if(a.Kb=void 0,Ua(a,olympe.D.Node.C.Eh),b=a.da)for(const d of b.values())gb(d,a)}}function Za(a){if(a.L!==olympe.D.Node.C.xh){Ua(a,olympe.D.Node.C.xh);var b=a.da;if(b)for(const c of b.values())Za(c);a.Ka();void 0!==a.W&&ab(a);a.Kb=a.defaultValue}}function Xa(a){return a.L===olympe.D.Node.C.Sh}
|
|
252
252
|
function Ya(a,b){b===a?olympe.D.N.error('Setting a node as provider of itself. Ignoring'):(a.W&&a.W!==b&&ab(a),Va(b,a),Xa(b)?K(a,b.Kb,!0):void 0!==a.defaultValue?K(a,a.defaultValue,!0):gb(a),a.W=b)}function hb(a,b){a.zd&&(a.zd=void 0);a.wd='Repeater';Ya(a,b)}function db(a){a.W?cb(a):null!==a.ta&&0===Array.from(a.ta.values()).filter(b=>!Xa(b)).length&&(a.od&&(a.od=!1,Wa(a)),cb(a))}
|
|
253
253
|
function Va(a,b){a.da||(a.da=new Map);a.da.set(b.Z(),b);a.L===olympe.D.Node.C.fg&&olympe.D.N.warn('adding a downstream node on a deleted one (#'+a.Z()+') !')}function bb(a,b){a.da&&(b=b.Z(),a.da.has(b)&&(a.da.delete(b),ib(a)))}function ib(a){if(null===a.getParent()){var b=a.da;b&&0<b.size||a.destroy()}}
|
|
254
|
-
olympe.D.Node=class extends olympe.D.Zb{constructor({valueType:a,zd:b,
|
|
255
|
-
olympe.D.Node&&Ta(this,d);if(g)for(b=0;b<g.length;b++)a=e[g[b]],Ta(this,a);c&&Wa(this)}bf(a){this.defaultValue=a;this.L===olympe.D.Node.C.
|
|
256
|
-
a!==olympe.D.Node.C.fg||olympe.D.N.warn('Calling a function on a destroyed node!!!',this);a=d.G();b=[];if(1===a.length&&-1===a[0])for(var g of e)olympe.D.
|
|
257
|
-
a,this.getParent());return}this.We(null);ib(this)}destroy(){var a=this.L;if(a!==olympe.D.Node.C.gg&&a!==olympe.D.Node.C.fg){Ua(this,olympe.D.Node.C.gg);if(a=this.da){for(const c of a.values())if(a.has(c.Z())){var b=c;b.ta&&b.ta.delete(this.Z());b.W&&b.W.Z()===this.Z()?b.W=void 0:b.destroy()}a.clear()}this.da=null;super.destroy();if(this.ta){for(const c of this.ta.values())this.ta.has(c.Z())&&bb(c,this);this.ta.clear()}this.ta=null;this.W&&(bb(this.W,this),this.W=void 0);this.Kb=void 0;this.
|
|
258
|
-
0,this.
|
|
259
|
-
function lb(a,b){if(a.
|
|
260
|
-
function kb(a,b){let c={};if(b.prototype)olympe.D.N.error('first level of prototyping, investigate');else if(b.__proto__)c=Object.create(jb(a,b.__proto__));else return olympe.D.Proxy.prototype;Object.getOwnPropertyNames(b).forEach(d=>{if('function'===typeof b[d]&&'__getReplacementFunction'!==d){var e=b[d].K;null===e||e&&e.R()?c[d]=function(...f){var g=this.Pa;if(g&&Xa(g)&&(g=g.Kb)&&g[d]&&'function'===typeof g[d])return g[d].apply(g,f)}:(e=e||b[d].__oSig__||olympe.D.J.$,c[d]=function(...f){f=this.
|
|
261
|
-
...f,e,d);const g=e.$;if(g){const h=this.Pa.Kb;h&&h[g]&&lb(f,h[g])}return e.W()?this:f})}});return c}function mb(a,b){K(a.Pa,b)}function nb(a){gb(a.Pa)}function ob(a){olympe.D.yc([olympe.D.sa.C],b=>{a.Pa.bf(b)},'setDefaultValue');return a}function pb(a,b){hb(a.Pa,olympe.D.Uf(b)?b:b.Pa)}function qb(a,b){olympe.D.
|
|
262
|
-
olympe.D.Proxy=class{constructor(a,b){this.Pa=null;this.
|
|
263
|
-
olympe.D.ga=class{constructor(a){this.value=void 0===a||null===a?0:a}toJSON(){return'{ "type": "number", "value": '+JSON.stringify(this.value)+' }'}static lc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.D.Ba(b.value)}
|
|
264
|
-
this.value&&null!==this.value?'number'===typeof a?this.value.toString(a):'number'===typeof b?this.value.toFixed(b):this.value.toString():'-'}toFixed(a){return this.
|
|
265
|
-
return d.Ib()}he(a){return olympe.D.Fa([this,a],(b,c)=>olympe.D.Ba(b.valueOf()+c.valueOf()),olympe.D.ga,'ONumber.plus')}qh(a){return olympe.D.Fa([this,a],(b,c)=>olympe.D.Ba(b.valueOf()-c.valueOf()),olympe.D.ga,'ONumber.minus')}round(){return olympe.D.Ba(Math.round(this.valueOf()))}
|
|
266
|
-
olympe.D.ga,'ONumber.div')}
|
|
267
|
-
a],(b,c)=>olympe.D.wc(b.
|
|
268
|
-
a],(b,c)=>b.valueOf()<=c.valueOf()?b:olympe.D.Ba(c),olympe.D.ga,'ONumber.returnsSmallest')}
|
|
269
|
-
b){return olympe.D.
|
|
270
|
-
const k=(l,n)=>{n=olympe.D.ge(n);const p=olympe.D.ga.animate(n,500);pb(f,p);mb(n,olympe.D.Ba(l));e=l};olympe.D.ie([a],l=>{e+=l.valueOf();e>h?k(h,e):e<g?k(g,e):pb(f,olympe.D.ge(e))},olympe.D.ga);void 0!==b&&olympe.D.
|
|
271
|
-
p)}});return f}static offset(a){let b;return olympe.D.ie([a],c=>{void 0===b&&(b=c);return olympe.D.Ba(c-b)},olympe.D.ga,'offset')}static
|
|
272
|
-
e=window.performance.now();b=b.he((f.valueOf()+c.valueOf())/2*(e-d));c=f;d=e;return b},olympe.D.ga,'integrate')}static
|
|
273
|
-
return e=olympe.D.Fa([a],f=>{const g=olympe.D.$a(b,1E3),h=olympe.D.$a(e);return void 0===h?olympe.D.Ba(f):sb(h,f,g,c,k=>{d&&d(k)})},olympe.D.ga)}static
|
|
274
|
-
olympe.D.Fa([a],b=>olympe.D.yb(b.valueOf().toString()),olympe.D.Za):olympe.D.yb(a)}static
|
|
275
|
-
'minus'):olympe.D.Ba(a.valueOf()-b.valueOf())}static
|
|
276
|
-
olympe.D.ga.
|
|
277
|
-
olympe.D.ga.
|
|
278
|
-
olympe.D.ga.
|
|
279
|
-
|
|
280
|
-
10*(a/d-1))+b},
|
|
281
|
-
c*(2*d*d+2*d*a+-3*d)},
|
|
282
|
-
b,c,d){return(a/=d)<1/2.75?7.5625*c*a*a+b:a<2/2.75?c*(7.5625*(a-=1.5/2.75)*a+.75)+b:a<2.5/2.75?c*(7.5625*(a-=2.25/2.75)*a+.9375)+b:c*(7.5625*(a-=2.625/2.75)*a+.984375)+b},
|
|
283
|
-
m.toString.K=new olympe.D.J(()=>String,[]);m.toFixed.K=new olympe.D.J(()=>String,[]);m.he.K=new olympe.D.J(()=>olympe.D.ga,[0]);m.qh.K=new olympe.D.J(()=>olympe.D.ga,[0]);m.round.K=olympe.D.J.G;m.
|
|
284
|
-
m.Pd.K=new olympe.D.J(()=>olympe.D.sa,[0]);m.
|
|
285
|
-
a))}
|
|
254
|
+
olympe.D.Node=class extends olympe.D.Zb{constructor({valueType:a,zd:b,oy:c=!0,Yf:d,Zm:e,debug:f=!1,ug:g=null,wd:h='Node',Vi:k}={}){++Sa;super(String(Sa));this.debug=!!f;this.wd=h;h&&'string'===typeof h||(b?this.wd=b.name?b.name:'anon()':this.wd='Node');this.Wa=e&&0<e.length?e:null;this.ug=g&&0<g.length?g:null;this.valueType=a;this.Kb=void 0;this.bc=!1;this.L=olympe.D.Node.C.Eh;this.od=!1;this.da=this.ta=null;this.zd=b;this.Yf=d||null;this.defaultValue=this.vd=this.W=void 0;this.Vi=k;d&&d instanceof
|
|
255
|
+
olympe.D.Node&&Ta(this,d);if(g)for(b=0;b<g.length;b++)a=e[g[b]],Ta(this,a);c&&Wa(this)}bf(a){this.defaultValue=a;this.L===olympe.D.Node.C.Eh&&K(this,a,!0);return this}Yi(a){this.valueType=a}Wb(){return this.valueType||Object}Od(){return this.L}G(){return this.L===olympe.D.Node.C.fg}$(){return this.L===olympe.D.Node.C.gg}fe(...a){if(this.Vi instanceof Function)return this.Vi(...a);var b=a.length;--b;const c=a[b];--b;const d=a[b],e=Array(b);for(var f=0;f<b;f++)e[f]=a[f];a=this.Od();a!==olympe.D.Node.C.gg&&
|
|
256
|
+
a!==olympe.D.Node.C.fg||olympe.D.N.warn('Calling a function on a destroyed node!!!',this);a=d.G();b=[];if(1===a.length&&-1===a[0])for(var g of e)olympe.D.ob(g)&&b.push(g.Pa);else for(let h=0,k=a.length;h<k;h++)g=a[h],f=e[g],void 0!==f&&null!==f&&f.zf&&(e[g]=f.Pa,b.push(g));return L(new olympe.D.Node({valueType:d.L(),zd:c,Yf:this,Zm:e,debug:!1,ug:b,wd:'Proxy.'+c+'()'}))}Ck(a){if(null===this.getParent())olympe.D.N.warn('context is undefined, investigate');else if(this.getParent()!==a){olympe.D.N.warn('Investigate a potential issue in creator-createe link: create node mismatch',
|
|
257
|
+
a,this.getParent());return}this.We(null);ib(this)}destroy(){var a=this.L;if(a!==olympe.D.Node.C.gg&&a!==olympe.D.Node.C.fg){Ua(this,olympe.D.Node.C.gg);if(a=this.da){for(const c of a.values())if(a.has(c.Z())){var b=c;b.ta&&b.ta.delete(this.Z());b.W&&b.W.Z()===this.Z()?b.W=void 0:b.destroy()}a.clear()}this.da=null;super.destroy();if(this.ta){for(const c of this.ta.values())this.ta.has(c.Z())&&bb(c,this);this.ta.clear()}this.ta=null;this.W&&(bb(this.W,this),this.W=void 0);this.Kb=void 0;this.Wa&&(this.Wa.length=
|
|
258
|
+
0,this.Wa=null);this.ug&&(this.ug.length=0,this.ug=null);this.Vi=this.zd=void 0;this.defaultValue=this.Yf=null;this.wd=`** Destroyed ** ${this.wd}`;Ua(this,olympe.D.Node.C.fg)}}Xc(){return this.wd}};olympe.D.Node.F='rootNode';olympe.D.Node.C={Eh:0,Sh:1,xh:3,bk:4,OBSOLETE:5,gg:6,fg:7};function $a(a,b){if('function'!==typeof a)return new olympe.D.Proxy(a,b);var c=olympe.D.Proxy.prototype;void 0===a.prototype&&olympe.D.N.error('investigate');c=Object.create(jb(c,a.prototype));c.yk=a;c.kr=b;return c}function jb(a,b){Object.prototype.hasOwnProperty.call(b,olympe.D.Proxy.Yl)||Object.defineProperty(b,olympe.D.Proxy.Yl,{enumerable:!1,configurable:!1,writable:!1,value:kb(a,b)});return b[olympe.D.Proxy.Yl]}
|
|
259
|
+
function lb(a,b){if(a.yk!==b){a.yk=b;b.prototype||olympe.D.N.error('Cast not possible, provided type is not a valid type!');var c=jb(a,b.prototype);Object.setPrototypeOf?Object.setPrototypeOf(a,c):a.__proto__=c;a.Pa&&a.Pa.Yi(b)}}
|
|
260
|
+
function kb(a,b){let c={};if(b.prototype)olympe.D.N.error('first level of prototyping, investigate');else if(b.__proto__)c=Object.create(jb(a,b.__proto__));else return olympe.D.Proxy.prototype;Object.getOwnPropertyNames(b).forEach(d=>{if('function'===typeof b[d]&&'__getReplacementFunction'!==d){var e=b[d].K;null===e||e&&e.R()?c[d]=function(...f){var g=this.Pa;if(g&&Xa(g)&&(g=g.Kb)&&g[d]&&'function'===typeof g[d])return g[d].apply(g,f)}:(e=e||b[d].__oSig__||olympe.D.J.$,c[d]=function(...f){f=this.kr.call(this.Pa,
|
|
261
|
+
...f,e,d);const g=e.$;if(g){const h=this.Pa.Kb;h&&h[g]&&lb(f,h[g])}return e.W()?this:f})}});return c}function mb(a,b){K(a.Pa,b)}function nb(a){gb(a.Pa)}function ob(a){olympe.D.yc([olympe.D.sa.C],b=>{a.Pa.bf(b)},'setDefaultValue');return a}function pb(a,b){hb(a.Pa,olympe.D.Uf(b)?b:b.Pa)}function qb(a,b){olympe.D.ob(b)||olympe.D.Uf(b)?pb(a,b):mb(a,b)}
|
|
262
|
+
olympe.D.Proxy=class{constructor(a,b){this.Pa=null;this.yk=a;this.kr=b}static ob(a){return!(!a||!a.zf)}nb(a){return olympe.D.Fa([this,a],(b,c)=>b===c,Boolean)}Pd(a){return olympe.D.Fa([this,a],(b,c)=>null===b||null===c?b===c?olympe.D.sa.F:olympe.D.sa.C:b.valueOf()===c.valueOf()?olympe.D.sa.F:olympe.D.sa.C,olympe.D.sa)}jr(){return this.Pa}};olympe.D.Proxy.Yl='__opp__';olympe.D.Proxy.prototype.zf=!0;function rb(a,b){a.node.bf(b);return a}olympe.D.Oj=class{constructor(a,b='FlowSource'){this.node=olympe.D.createNode(a,void 0,void 0,void 0,void 0,b)}update(a){olympe.D.ob(a)?K(this.node,olympe.D.$a(a)):K(this.node,a);return this}repeat(a){hb(this.node,olympe.D.ob(a)?a.Pa:a);return this}clear(){gb(this.node);return this}Ib(){return L(this.node)}};function sb(a,b,c=1E3,d,e){const f=olympe.D.Qc(olympe.D.ga),g=d||olympe.D.ga.uo.Cp;let h,k,l,n;f.update(olympe.D.Ba(a));const p=window.performance.now(),q=b.valueOf();l=q-a.valueOf();if(0!==l&&void 0===n){const r=()=>{f.node.G()||(l=q-a.valueOf(),k=(window.performance.now()-p)/c,1<=k&&(k=1,n=void 0),h=a.valueOf()+l*g(k,0,1,1),f.update(olympe.D.Ba(h)),1===k&&void 0!==e&&e(h),1>k&&(n=window.requestAnimationFrame(r)))};n=window.requestAnimationFrame(r)}return f.Ib()}
|
|
263
|
+
olympe.D.ga=class{constructor(a){this.value=void 0===a||null===a?0:a}toJSON(){return'{ "type": "number", "value": '+JSON.stringify(this.value)+' }'}static lc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.D.Ba(b.value)}xn(){return'number'===typeof this.value&&!isNaN(this.value)}isNaN(){return olympe.D.wc(!this.xn())}Rc(){return null===this.value||void 0===this.value||void 0===this.value.toString||isNaN(this.value)?olympe.D.yb(''):olympe.D.yb(this.value.toString())}toString(a,b){return void 0!==
|
|
264
|
+
this.value&&null!==this.value?'number'===typeof a?this.value.toString(a):'number'===typeof b?this.value.toFixed(b):this.value.toString():'-'}toFixed(a){return this.xn()?this.valueOf().toFixed(a):''}static max(a){const b=new Map;let c=-Infinity;const d=olympe.D.Qc(olympe.D.ga,'ONumber.max result'),e=()=>{c=-Infinity;for(const f of b.values())f>c&&(c=f);d.update(olympe.D.Ba(c))};a.forEach((f,g)=>{olympe.D.yc([f],h=>{b.set(g,h.valueOf());e()})},f=>{if(!d.node.G()){var g=b.get(f);b.delete(f);g===c&&e()}});
|
|
265
|
+
return d.Ib()}he(a){return olympe.D.Fa([this,a],(b,c)=>olympe.D.Ba(b.valueOf()+c.valueOf()),olympe.D.ga,'ONumber.plus')}qh(a){return olympe.D.Fa([this,a],(b,c)=>olympe.D.Ba(b.valueOf()-c.valueOf()),olympe.D.ga,'ONumber.minus')}round(){return olympe.D.Ba(Math.round(this.valueOf()))}vj(){return olympe.D.Ba(-this.valueOf())}Rk(a){return olympe.D.Fa([this,a],(b,c)=>olympe.D.Ba(b.valueOf()*c.valueOf()),olympe.D.ga,'ONumber.mul')}Zi(a){return olympe.D.Fa([this,a],(b,c)=>olympe.D.Ba(b.valueOf()/c.valueOf()),
|
|
266
|
+
olympe.D.ga,'ONumber.div')}Mx(a){return olympe.D.Fa([this,a],(b,c)=>olympe.D.Ba(b.valueOf()%c.valueOf()),olympe.D.ga,'ONumber.div')}floor(){return olympe.D.Ba(Math.floor(this.valueOf()))}ceil(){return olympe.D.Ba(Math.ceil(this.valueOf()))}trunc(){return olympe.D.Ba(Math.trunc(this.valueOf()))}log(){return olympe.D.Ba(Math.log(this.valueOf()))}pow(a){return olympe.D.Fa([this,a],(b,c)=>olympe.D.Ba(Math.pow(b.valueOf(),c.valueOf())),olympe.D.ga,'ONumber.pow')}exp(){return olympe.D.Ba(Math.exp(this.valueOf()))}Pd(a){return olympe.D.Fa([this,
|
|
267
|
+
a],(b,c)=>olympe.D.wc(b.nb(c)),olympe.D.sa,'ONumber.oEquals')}nb(a){return this.valueOf()===(void 0!==a&&null!==a?a.valueOf():void 0)}valueOf(){return void 0!==this.value?this.value.valueOf():void 0}Qw(){return this.valueOf()}an(a){return olympe.D.Fa([this,a],(b,c)=>b.valueOf()>c.valueOf()?olympe.D.sa.F:olympe.D.sa.C,olympe.D.sa,'ONumber.isBiggerThan')}sy(a){return olympe.D.Fa([this,a],(b,c)=>b.valueOf()>=c.valueOf()?b:olympe.D.Ba(c),olympe.D.ga,'ONumber.returnsBiggest')}Xr(a){return olympe.D.Fa([this,
|
|
268
|
+
a],(b,c)=>b.valueOf()<=c.valueOf()?b:olympe.D.Ba(c),olympe.D.ga,'ONumber.returnsSmallest')}Ax(a){return olympe.D.Fa([this,a],(b,c)=>b.valueOf()<c.valueOf()?olympe.D.sa.F:olympe.D.sa.C,olympe.D.sa,'ONumber.isSmallerThan')}sin(){return olympe.D.Ba(Math.sin(this.valueOf()))}cos(){return olympe.D.Ba(Math.cos(this.valueOf()))}atan2(a){return olympe.D.ob(a)?olympe.D.ie([a],b=>olympe.D.Ba(Math.atan2(this.valueOf(),b.valueOf())),olympe.D.ga):olympe.D.Ba(Math.atan2(this.valueOf(),a.valueOf()))}abs(){return olympe.D.Ba(Math.abs(this.valueOf()))}nj(a,
|
|
269
|
+
b){return olympe.D.ob(a)||olympe.D.ob(b)?olympe.D.ie([a,b],(c,d)=>olympe.D.Ba(this.valueOf()*d.valueOf()+c.valueOf()*(1-d.valueOf())),olympe.D.ga):olympe.D.Ba(this.valueOf()*b.valueOf()+a.valueOf()*(1-b.valueOf()))}static nv(a,b,c,d){'number'===typeof a&&(a=olympe.D.ge(a));'number'===typeof b&&(b=olympe.D.ge(b));'number'===typeof c&&(c=olympe.D.ge(c));let e=0;const f=olympe.D.ge(0);let g,h;void 0!==b&&void 0!==c&&olympe.D.Ym(b.an(c),()=>{olympe.ra.Ya('df').warn('You have a min bigger than max, cap your inputs')});
|
|
270
|
+
const k=(l,n)=>{n=olympe.D.ge(n);const p=olympe.D.ga.animate(n,500);pb(f,p);mb(n,olympe.D.Ba(l));e=l};olympe.D.ie([a],l=>{e+=l.valueOf();e>h?k(h,e):e<g?k(g,e):pb(f,olympe.D.ge(e))},olympe.D.ga);void 0!==b&&olympe.D.Vk(b.valueOf(),l=>{if(g!==l&&(g=l,g>e)){const n=olympe.D.ge(e),p=olympe.D.ga.animate(n,400,d);l=olympe.D.Ba(g);K(n.Pa,l);e=g;pb(f,p)}});void 0!==c&&olympe.D.Vk(c.valueOf(),l=>{if(h!==l&&(h=l,h<e)){const n=olympe.D.ge(e),p=olympe.D.ga.animate(n,400,d);l=olympe.D.Ba(h);K(n.Pa,l);e=h;pb(f,
|
|
271
|
+
p)}});return f}static offset(a){let b;return olympe.D.ie([a],c=>{void 0===b&&(b=c);return olympe.D.Ba(c-b)},olympe.D.ga,'offset')}static Ar(a){let b,c,d;return olympe.D.Fa([a],e=>{if(void 0===b)return b=e,c=window.performance.now(),olympe.D.Ba(0);d=window.performance.now();const f=olympe.D.Ba((e.valueOf()-b.valueOf())/(d-c));b=e;c=d;return f},olympe.D.ga,'derivative')}static vx(a){let b=olympe.D.Ba(0),c,d,e;return olympe.D.Fa([a],f=>{if(void 0===c)return c=f,d=window.performance.now(),olympe.D.Ba(0);
|
|
272
|
+
e=window.performance.now();b=b.he((f.valueOf()+c.valueOf())/2*(e-d));c=f;d=e;return b},olympe.D.ga,'integrate')}static Tv(a){let b;return olympe.D.Fa([a],c=>{void 0===b&&(b=c.valueOf());const d=olympe.D.Ba(c.valueOf()-b.valueOf());b=c;return d},olympe.D.ga,'diff')}static Hv(a,b,c){return olympe.D.ie([a,b,c],(d,e,f)=>{d='number'===typeof d?d:d.valueOf();e='number'===typeof e?e:e.valueOf();f='number'===typeof f?f:f.valueOf();return olympe.D.Ba(d>=e?d<=f?d:f:e)},olympe.D.ga)}static animate(a,b,c,d){let e;
|
|
273
|
+
return e=olympe.D.Fa([a],f=>{const g=olympe.D.$a(b,1E3),h=olympe.D.$a(e);return void 0===h?olympe.D.Ba(f):sb(h,f,g,c,k=>{d&&d(k)})},olympe.D.ga)}static zv(a,b,c){let d,e,f,g,h,k,l=olympe.D.ge(),n;olympe.D.yc([a],p=>{void 0===d?g=d=p.valueOf():d=g;f=window.performance.now();e=p.valueOf();k=e-d;0!==k&&void 0===n&&(n=setInterval(()=>{k=e-d;h=(window.performance.now()-f)/b;1<=h&&(h=1);g=d+k*c(h,0,1,1);mb(l,olympe.D.Ba(g));1===h&&(clearTimeout(n),n=void 0)},0))});return l}static Rc(a){return olympe.D.ob(a)?
|
|
274
|
+
olympe.D.Fa([a],b=>olympe.D.yb(b.valueOf().toString()),olympe.D.Za):olympe.D.yb(a)}static vj(a){return olympe.D.ob(a)?olympe.D.Fa([a],b=>olympe.D.Ba(-b.valueOf()),olympe.D.ga):olympe.D.Ba(-a.valueOf())}static he(a,b){return olympe.D.ob(a)||olympe.D.ob(b)?olympe.D.Fa([a,b],(c,d)=>olympe.D.Ba(c.valueOf()+d.valueOf()),olympe.D.ga,'plus'):olympe.D.Ba(a.valueOf()+b.valueOf())}static qh(a,b){return olympe.D.ob(a)||olympe.D.ob(b)?olympe.D.ie([a,b],(c,d)=>olympe.D.Ba(c.valueOf()-d.valueOf()),olympe.D.ga,
|
|
275
|
+
'minus'):olympe.D.Ba(a.valueOf()-b.valueOf())}static Zi(a,b){return olympe.D.ob(a)||olympe.D.ob(b)?olympe.D.ie([a,b],(c,d)=>olympe.D.Ba(c.valueOf()/d.valueOf()),olympe.D.ga,'div'):olympe.D.Ba(a.valueOf()/b.valueOf())}static my(a,b){if(void 0===b)return a;olympe.D.yc([b],c=>{c=olympe.D.Ba(a.Pa.Kb.valueOf()+c.valueOf());K(a.Pa,c)},'plusEqual');return a}};olympe.D.ga.ZERO=new olympe.D.ga(0);olympe.D.ga.ONE=new olympe.D.ga(1);olympe.D.ga.dv=new olympe.D.ga(2);olympe.D.ga.PI=new olympe.D.ga(Math.PI);
|
|
276
|
+
olympe.D.ga.lt=new olympe.D.ga(Infinity);olympe.D.ga.eu=new olympe.D.ga(-Infinity);olympe.D.ga.Lp=new olympe.D.ga(NaN);olympe.D.ga.QA=olympe.D.ga.my;olympe.D.ga.Xy=olympe.D.ga.nv;olympe.D.ga.GA=olympe.D.ga.offset;olympe.D.ga.zz=olympe.D.ga.Ar;olympe.D.ga.SC=olympe.D.ga.Ar;olympe.D.ga.qA=olympe.D.ga.vx;olympe.D.ga.Az=olympe.D.ga.Tv;olympe.D.ga.lz=olympe.D.ga.Hv;olympe.D.ga.Yy=olympe.D.ga.animate;olympe.D.ga.Zy=olympe.D.ga.zv;olympe.D.ga.eC=olympe.D.ga.Rc;olympe.D.ga.fC=olympe.D.ga.vj;
|
|
277
|
+
olympe.D.ga.PA=olympe.D.ga.he;olympe.D.ga.BA=olympe.D.ga.qh;olympe.D.ga.Bz=olympe.D.ga.Zi;
|
|
278
|
+
olympe.D.ga.uo={Cp:function(a,b,c,d){return c*a/d+b},Uz:function(a,b,c,d){a/=d;return c*a*a+b},dA:function(a,b,c,d){a/=d;return-c*a*(a-2)+b},Qz:function(a,b,c,d){a/=d/2;if(1>a)return c/2*a*a+b;a--;return-c/2*(a*(a-2)-1)+b},Jz:function(a,b,c,d){a/=d;return c*a*a*a+b},$z:function(a,b,c,d){a/=d;a--;return c*(a*a*a+1)+b},Oz:function(a,b,c,d){a/=d/2;if(1>a)return c/2*a*a*a+b;a-=2;return c/2*(a*a*a+2)+b},Vz:function(a,b,c,d){a/=d;return c*a*a*a*a+b},eA:function(a,b,c,d){a/=d;a--;return-c*(a*a*a*a-1)+b},
|
|
279
|
+
Rz:function(a,b,c,d){a/=d/2;if(1>a)return c/2*a*a*a*a+b;a-=2;return-c/2*(a*a*a*a-2)+b},Wz:function(a,b,c,d){a/=d;return c*a*a*a*a*a+b},fA:function(a,b,c,d){a/=d;a--;return c*(a*a*a*a*a+1)+b},Sz:function(a,b,c,d){a/=d/2;if(1>a)return c/2*a*a*a*a*a+b;a-=2;return c/2*(a*a*a*a*a+2)+b},Xz:function(a,b,c,d){return-c*Math.cos(a/d*(Math.PI/2))+c+b},gA:function(a,b,c,d){return c*Math.sin(a/d*(Math.PI/2))+b},Tz:function(a,b,c,d){return-c/2*(Math.cos(Math.PI*a/d)-1)+b},Mz:function(a,b,c,d){return c*Math.pow(2,
|
|
280
|
+
10*(a/d-1))+b},cA:function(a,b,c,d){return c*(-Math.pow(2,-10*a/d)+1)+b},Pz:function(a,b,c,d){a/=d/2;if(1>a)return c/2*Math.pow(2,10*(a-1))+b;a--;return c/2*(-Math.pow(2,-10*a)+2)+b},Iz:function(a,b,c,d){a/=d;return-c*(Math.sqrt(1-a*a)-1)+b},Zz:function(a,b,c,d){a/=d;a--;return c*Math.sqrt(1-a*a)+b},Nz:function(a,b,c,d){a/=d/2;if(1>a)return-c/2*(Math.sqrt(1-a*a)-1)+b;a-=2;return c/2*(Math.sqrt(1-a*a)+1)+b},Dz:function(a,b,c,d){d=(a/=d)*a;return b+c*(4*d*a+-3*d)},Ez:function(a,b,c,d){d=(a/=d)*a;return b+
|
|
281
|
+
c*(2*d*d+2*d*a+-3*d)},Fz:function(a,b,c,d){d=(a/=d)*a;return b+c*(4*d*a+-9*d+6*a)},Gz:function(a,b,c,d){d=(a/=d)*a;return b+c*(-2*d*d+10*d*a+-15*d+8*a)},bA:function(a,b,c,d){d=(a/=d)*a;const e=d*a;return b+c*(33*e*d+-106*d*d+126*e+-67*d+15*a)},aA:function(a,b,c,d){d=(a/=d)*a;const e=d*a;return b+c*(56*e*d+-175*d*d+200*e+-100*d+20*a)},Lz:function(a,b,c,d){d=(a/=d)*a;a*=d;return b+c*(33*a*d+-59*d*d+32*a+-5*d)},Kz:function(a,b,c,d){d=(a/=d)*a;a*=d;return b+c*(56*a*d+-105*d*d+60*a+-10*d)},Yz:function(a,
|
|
282
|
+
b,c,d){return(a/=d)<1/2.75?7.5625*c*a*a+b:a<2/2.75?c*(7.5625*(a-=1.5/2.75)*a+.75)+b:a<2.5/2.75?c*(7.5625*(a-=2.25/2.75)*a+.9375)+b:c*(7.5625*(a-=2.625/2.75)*a+.984375)+b},Hz:function(a,b,c,d){a=d-a;d=(a/=d)<1/2.75?7.5625*c*a*a:a<2/2.75?c*(7.5625*(a-=1.5/2.75)*a+.75):a<2.5/2.75?c*(7.5625*(a-=2.25/2.75)*a+.9375):c*(7.5625*(a-=2.625/2.75)*a+.984375);return c-d+b}};m=olympe.D.ga.prototype;m.toJSON.K=olympe.D.J.C;m.xn.K=olympe.D.J.C;m.isNaN.K=olympe.D.J.R;m.Rc.K=olympe.D.J.F;
|
|
283
|
+
m.toString.K=new olympe.D.J(()=>String,[]);m.toFixed.K=new olympe.D.J(()=>String,[]);m.he.K=new olympe.D.J(()=>olympe.D.ga,[0]);m.qh.K=new olympe.D.J(()=>olympe.D.ga,[0]);m.round.K=olympe.D.J.G;m.vj.K=olympe.D.J.G;m.Rk.K=new olympe.D.J(()=>olympe.D.ga,[0]);m.Zi.K=new olympe.D.J(()=>olympe.D.ga,[0]);m.Mx.K=new olympe.D.J(()=>olympe.D.ga,[0]);m.floor.K=olympe.D.J.G;m.ceil.K=olympe.D.J.G;m.trunc.K=olympe.D.J.G;m.log.K=olympe.D.J.G;m.pow.K=new olympe.D.J(()=>olympe.D.ga,[0]);m.exp.K=olympe.D.J.G;
|
|
284
|
+
m.Pd.K=new olympe.D.J(()=>olympe.D.sa,[0]);m.nb.K=olympe.D.J.C;m.valueOf.K=olympe.D.J.C;m.Qw.K=olympe.D.J.C;m.an.K=new olympe.D.J(()=>olympe.D.sa,[0]);m.sy.K=new olympe.D.J(()=>olympe.D.ga,[0]);m.Xr.K=new olympe.D.J(()=>olympe.D.ga,[0]);m.Ax.K=new olympe.D.J(()=>olympe.D.sa,[0]);m.sin.K=olympe.D.J.G;m.cos.K=olympe.D.J.G;m.atan2.K=new olympe.D.J(()=>olympe.D.ga,[0]);m.abs.K=olympe.D.J.G;m.nj.K=new olympe.D.J(()=>olympe.D.ga,[0,1]);olympe.D.Za=class{constructor(a){this.value=a}toJSON(){return'{ "type": "string", "value": '+JSON.stringify(this.value)+' }'}static lc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.D.yb(b.value)}vr(a){return olympe.D.Za.concat(this,'.',a)}concat(...a){let b;Array.isArray(a[0])?b=a[0]:b=a;return olympe.D.Fa([this,...b],(...c)=>{let d='';for(let e=0,f=c.length;e<f;e++)d=c[e]?d+c[e].valueOf():d+c[e];return olympe.D.yb(d)},olympe.D.Za,'OString.concat')}Rc(){return this}Qy(a){return olympe.D.Ba(parseInt(this.value,
|
|
285
|
+
a))}cs(){return olympe.D.Ba(parseFloat(this.value))}toString(){return this.value}valueOf(){return this.value.valueOf()}nb(a){return this.value===(void 0===a||null===a?void 0:a.valueOf())}Pd(a){return olympe.D.Fa([this,a],(b,c)=>olympe.D.wc(c&&b.valueOf()===c.valueOf()),olympe.D.sa,'OString.oEquals')}Sf(){return olympe.D.wc(!this.value||0===this.value.length)}contains(a){return olympe.D.Fa([this,a],(b,c)=>olympe.D.wc((c instanceof olympe.D.Za||'string'===typeof c)&&b.valueOf().includes(c.valueOf())),
|
|
286
286
|
olympe.D.sa,'OString.contains')}startsWith(a,b){return olympe.D.Fa([this,a,b||0],(c,d,e)=>olympe.D.wc(c.valueOf().startsWith(d.valueOf(),e.valueOf())),olympe.D.sa,'OString.startsWith')}endsWith(a,b){return olympe.D.Fa([this,a,b||-1],(c,d,e)=>{e=0<=e.valueOf()?e.valueOf():this.Ag().valueOf()+e.valueOf()+1;return olympe.D.wc(c.valueOf().endsWith(d.valueOf(),e))},olympe.D.sa,'OString.endsWith')}indexOf(a,b){return olympe.D.Fa([this,a,b||0],(c,d,e)=>olympe.D.Ba(c.valueOf().indexOf(d.valueOf(),e.valueOf())),
|
|
287
287
|
olympe.D.ga,'OString.indexOf')}lastIndexOf(a,b){return olympe.D.Fa([this,a,b||Infinity],(c,d,e)=>olympe.D.Ba(c.valueOf().lastIndexOf(d.valueOf(),e.valueOf())),olympe.D.ga,'OString.lastIndexOf')}slice(a,b){return olympe.D.Fa([this,a,b],(c,d,e)=>olympe.D.yb(c.valueOf().slice(d.valueOf(),e?e.valueOf():void 0)),olympe.D.Za,'OString.slice')}Ag(){return olympe.D.Ba(this.value.length)}threshold(a){return olympe.D.Fa([this,a],(b,c)=>b.valueOf().length>=c.valueOf()?b:olympe.D.Za.EMPTY,olympe.D.Za,'OString.threshold')}toLowerCase(){return olympe.D.yb(this.value.toLowerCase())}toUpperCase(){return olympe.D.yb(this.value.toUpperCase())}trim(){return olympe.D.yb(this.value.trim())}padStart(a,
|
|
288
|
-
b){return olympe.D.Fa([this,a,b],(c,d,e)=>olympe.D.yb(c.valueOf().padStart(d.valueOf(),e.valueOf())),olympe.D.Za,'OString.padStart')}padEnd(a,b){return olympe.D.Fa([this,a,b],(c,d,e)=>olympe.D.yb(c.valueOf().padEnd(d.valueOf(),e.valueOf())),olympe.D.Za,'OString.padEnd')}replace(a,b){return olympe.D.Fa([this,a,b],(c,d,e)=>olympe.D.yb(c.valueOf().replace(d.valueOf(),e.valueOf())),olympe.D.Za,'OString.replace')}
|
|
289
|
-
e.valueOf())),olympe.D.Za,'OString.subOStr')}static concat(...a){return olympe.D.yb('').concat(...a)}};olympe.D.Za.EMPTY=new olympe.D.Za('');olympe.D.Za.
|
|
288
|
+
b){return olympe.D.Fa([this,a,b],(c,d,e)=>olympe.D.yb(c.valueOf().padStart(d.valueOf(),e.valueOf())),olympe.D.Za,'OString.padStart')}padEnd(a,b){return olympe.D.Fa([this,a,b],(c,d,e)=>olympe.D.yb(c.valueOf().padEnd(d.valueOf(),e.valueOf())),olympe.D.Za,'OString.padEnd')}replace(a,b){return olympe.D.Fa([this,a,b],(c,d,e)=>olympe.D.yb(c.valueOf().replace(d.valueOf(),e.valueOf())),olympe.D.Za,'OString.replace')}Ny(a,b){return olympe.D.Fa([this,a,b],(c,d,e)=>olympe.D.yb(c.valueOf().substr(d.valueOf(),
|
|
289
|
+
e.valueOf())),olympe.D.Za,'OString.subOStr')}static concat(...a){return olympe.D.yb('').concat(...a)}};olympe.D.Za.EMPTY=new olympe.D.Za('');olympe.D.Za.Qu=new olympe.D.Za(' ');m=olympe.D.Za.prototype;m.toJSON.K=olympe.D.J.C;m.vr.K=new olympe.D.J(()=>olympe.D.Za,[0,1]);m.concat.K=olympe.D.J.F;m.Rc.K=olympe.D.J.F;m.Qy.K=olympe.D.J.G;m.cs.K=olympe.D.J.G;m.toString.K=olympe.D.J.C;m.valueOf.K=olympe.D.J.C;m.nb.K=olympe.D.J.C;m.Pd.K=new olympe.D.J(()=>olympe.D.sa,[0]);m.Sf.K=olympe.D.J.R;
|
|
290
290
|
m.contains.K=new olympe.D.J(()=>olympe.D.sa,[0]);m.startsWith.K=new olympe.D.J(()=>olympe.D.sa,[0,1]);m.endsWith.K=new olympe.D.J(()=>olympe.D.sa,[0,1]);m.indexOf.K=new olympe.D.J(()=>olympe.D.ga,[0,1]);m.lastIndexOf.K=new olympe.D.J(()=>olympe.D.ga,[0,1]);m.slice.K=new olympe.D.J(()=>olympe.D.Za,[0,1]);m.Ag.K=olympe.D.J.G;m.threshold.K=new olympe.D.J(()=>olympe.D.Za,[0]);m.toLowerCase.K=olympe.D.J.F;m.toUpperCase.K=olympe.D.J.F;m.trim.K=olympe.D.J.F;m.padStart.K=olympe.D.J.F;m.padEnd.K=olympe.D.J.F;
|
|
291
|
-
m.replace.K=olympe.D.J.F;m.
|
|
292
|
-
olympe.D.ie([a],b=>new olympe.D.sa(this.valueOf()===b.valueOf()),olympe.D.sa,'oEquals'):this.
|
|
293
|
-
olympe.D.sa.F:olympe.D.sa.C}xor(a){return olympe.D.Fa([this,a],(b,c)=>{b=b.valueOf();c=c.valueOf();return olympe.D.wc(b&&!c||!b&&c)},olympe.D.sa,'OBoolean.xor')}
|
|
294
|
-
m.and.K=new olympe.D.J(()=>olympe.D.sa,[0]);m.
|
|
295
|
-
olympe.D.ib=class{constructor(a){this.xb=a}toJSON(){return'{ "type": "dateTime", "value": "'+this.xb.toJSON()+'" }'}static lc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.D.ib(new Date(b.value.valueOf()))}static now(){return new olympe.D.ib(new Date)}
|
|
291
|
+
m.replace.K=olympe.D.J.F;m.Ny.K=olympe.D.J.F;olympe.D.sa=class{constructor(a){this.value=a}toJSON(){return`{ "type": "boolean", "value": ${this.value.valueOf()}}`}static lc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return b.value?olympe.D.sa.F:olympe.D.sa.C}and(a){if(void 0!==a)return olympe.D.ob(a)?olympe.D.ie([a],b=>new olympe.D.sa(this.valueOf()&&b.valueOf()),olympe.D.sa,'and'):this.value&&a.valueOf()?olympe.D.sa.F:olympe.D.sa.C}nb(a){return this.valueOf()===(void 0!==a?a.valueOf():void 0)}Pd(a){if(void 0!==a)return olympe.D.ob(a)?
|
|
292
|
+
olympe.D.ie([a],b=>new olympe.D.sa(this.valueOf()===b.valueOf()),olympe.D.sa,'oEquals'):this.nb(a)?olympe.D.sa.F:olympe.D.sa.C}not(){return this.value?olympe.D.sa.C:olympe.D.sa.F}yv(a){if(void 0!==a)return olympe.D.ob(a)?olympe.D.ie([a],b=>new olympe.D.sa(!(this.valueOf()&&b.valueOf())),olympe.D.sa,'andNot'):this.value&&!a.valueOf()?olympe.D.sa.F:olympe.D.sa.C}or(a){if(void 0!==a)return olympe.D.ob(a)?olympe.D.ie([a],b=>new olympe.D.sa(this.valueOf()||b.valueOf()),olympe.D.sa,'or'):this.value||a.valueOf()?
|
|
293
|
+
olympe.D.sa.F:olympe.D.sa.C}xor(a){return olympe.D.Fa([this,a],(b,c)=>{b=b.valueOf();c=c.valueOf();return olympe.D.wc(b&&!c||!b&&c)},olympe.D.sa,'OBoolean.xor')}iw(){return this.value}Ir(){return!0===this.value?olympe.D.ga.ONE:olympe.D.ga.ZERO}Rc(){return olympe.D.yb(this.toString())}toString(){return this.value?'true':'false'}valueOf(){return this.value}};olympe.D.sa.F=new olympe.D.sa(!0);olympe.D.sa.C=new olympe.D.sa(!1);m=olympe.D.sa.prototype;m.toJSON.K=olympe.D.J.C;
|
|
294
|
+
m.and.K=new olympe.D.J(()=>olympe.D.sa,[0]);m.nb.K=olympe.D.J.C;m.Pd.K=new olympe.D.J(()=>olympe.D.sa,[0]);m.not.K=olympe.D.J.R;m.yv.K=new olympe.D.J(()=>olympe.D.sa,[0]);m.or.K=new olympe.D.J(()=>olympe.D.sa,[0]);m.xor.K=new olympe.D.J(()=>olympe.D.sa,[0]);m.iw.K=new olympe.D.J(()=>Boolean,[]);m.Ir.K=olympe.D.J.G;m.Rc.K=olympe.D.J.F;m.toString.K=olympe.D.J.C;m.valueOf.K=olympe.D.J.C;function tb(a){return new olympe.D.ib(new Date(a))}
|
|
295
|
+
olympe.D.ib=class{constructor(a){this.xb=a}toJSON(){return'{ "type": "dateTime", "value": "'+this.xb.toJSON()+'" }'}static lc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.D.ib(new Date(b.value.valueOf()))}static now(){return new olympe.D.ib(new Date)}lj(){return this.xb&&!isNaN(this.xb.getTime())?olympe.D.sa.F:olympe.D.sa.C}tt(){return olympe.D.Ba(this.xb.getMilliseconds())}vt(){return olympe.D.Ba(this.xb.getSeconds())}ut(){return olympe.D.Ba(this.xb.getMinutes())}st(){return olympe.D.Ba(this.xb.getHours())}tw(){return olympe.D.Ba(this.xb.getDate())}getMonth(){return olympe.D.Ba(this.xb.getMonth()+1)}wt(){return olympe.D.Ba(this.xb.getFullYear())}getTime(){return this.xb.getTime()}Ky(){var a=
|
|
296
296
|
olympe.D,b=a.yb;var c=this.xb.getDate();c=10>c?'0'+c:c;var d=this.xb.getMonth()+1;return b.call(a,`${c}.${10>d?'0'+d:d}.${this.xb.getFullYear()}`)}toLocaleString(a){return void 0===a||'string'===typeof a?olympe.D.yb(this.xb.toLocaleString(a)):olympe.D.Fa([this,a],(b,c)=>olympe.D.yb(b.xb.toLocaleString(c.valueOf())),olympe.D.Za)}toLocaleDateString(a){return void 0===a||'string'===typeof a?olympe.D.yb(this.xb.toLocaleDateString(a)):olympe.D.Fa([this,a],(b,c)=>olympe.D.yb(b.xb.toLocaleDateString(c.valueOf())),
|
|
297
|
-
olympe.D.Za)}toLocaleTimeString(a){return void 0===a||'string'===typeof a?olympe.D.yb(this.xb.toLocaleTimeString(a)):olympe.D.Fa([this,a],(b,c)=>olympe.D.yb(b.xb.toLocaleTimeString(c.valueOf())),olympe.D.Za)}Rc(){return olympe.D.yb(this.xb.toISOString())}
|
|
298
|
-
a)}
|
|
299
|
-
b=>olympe.D.wc(this.
|
|
300
|
-
void 0===d&&(olympe.ra.Ya('df').warn("[getDiff] '_unit' is not a valid unit! Defaulting to milliseconds"),d=1),c=Math.trunc((this.xb.getTime()-c.xb.getTime())/d));return olympe.D.Ba(c)},olympe.D.ga)}
|
|
301
|
-
new Date(this.getTime()):new Date(0)}};olympe.D.ib.C=tb(0);olympe.D.ib.F=tb(Number.NaN);m=olympe.D.ib.prototype;m.
|
|
302
|
-
m.
|
|
303
|
-
m.
|
|
297
|
+
olympe.D.Za)}toLocaleTimeString(a){return void 0===a||'string'===typeof a?olympe.D.yb(this.xb.toLocaleTimeString(a)):olympe.D.Fa([this,a],(b,c)=>olympe.D.yb(b.xb.toLocaleTimeString(c.valueOf())),olympe.D.Za)}Rc(){return olympe.D.yb(this.xb.toISOString())}bs(){return new Date(this.getTime())}Py(){return this}Ry(){return this}kg(a,b){return olympe.D.Fa([b],c=>{const d=new olympe.D.ib(new Date(this.xb.getTime()));d.xb['set'+a](this.xb['get'+a]()+c.valueOf());return d},olympe.D.ib)}pv(a){return this.kg('Milliseconds',
|
|
298
|
+
a)}vv(a){return this.kg('Seconds',a)}qv(a){return this.kg('Minutes',a)}ov(a){return this.kg('Hours',a)}zm(a){return this.kg('Date',a)}wv(a){return'number'===typeof a?this.zm(7*a):this.zm(a.Rk(7))}rv(a){return this.kg('Month',a)}xv(a){return this.kg('FullYear',a)}Ly(){let a=this.xb.getDay();a=0===a?6:a-1;return new olympe.D.ib(new Date(this.xb.getFullYear(),this.xb.getMonth(),this.xb.getDate()-a))}My(){return new olympe.D.ib(new Date(this.xb.getFullYear(),this.xb.getMonth()))}Pd(a){return olympe.D.Fa([a],
|
|
299
|
+
b=>olympe.D.wc(this.nb(b)),olympe.D.sa)}nb(a){return a instanceof olympe.D.ib?this.getTime()===a.getTime()||isNaN(this.getTime())&&isNaN(a.getTime()):!1}Jw(){let a=this.xb.getDay();0===a&&(a=7);return olympe.D.Ba(a)}xw(a,b){return olympe.D.Fa([a,b],(c,d)=>{d=d.valueOf();'years'===d?c=this.xb.getFullYear()-c.xb.getFullYear():'months'===d?c=12*(this.xb.getFullYear()-c.xb.getFullYear())+(this.xb.getMonth()-c.xb.getMonth()):(d={milliseconds:1,seconds:1E3,minutes:6E4,hours:36E5,days:864E5,weeks:6048E5}[d],
|
|
300
|
+
void 0===d&&(olympe.ra.Ya('df').warn("[getDiff] '_unit' is not a valid unit! Defaulting to milliseconds"),d=1),c=Math.trunc((this.xb.getTime()-c.xb.getTime())/d));return olympe.D.Ba(c)},olympe.D.ga)}yx(a){return olympe.D.Fa([a],b=>olympe.D.wc(this.getTime()<b.getTime()),olympe.D.sa)}wx(a){return olympe.D.Fa([a],b=>olympe.D.wc(this.getTime()>b.getTime()),olympe.D.sa)}zx(a,b){return olympe.D.Fa([a,b],(c,d)=>olympe.D.wc(this.getTime()>c.getTime()&&this.getTime()<d.getTime()),olympe.D.sa)}valueOf(){return this.lj().valueOf()?
|
|
301
|
+
new Date(this.getTime()):new Date(0)}};olympe.D.ib.C=tb(0);olympe.D.ib.F=tb(Number.NaN);m=olympe.D.ib.prototype;m.lj.K=olympe.D.J.R;m.tt.K=olympe.D.J.G;m.vt.K=olympe.D.J.G;m.ut.K=olympe.D.J.G;m.st.K=olympe.D.J.G;m.tw.K=olympe.D.J.G;m.getMonth.K=olympe.D.J.G;m.wt.K=olympe.D.J.G;m.getTime.K=olympe.D.J.C;m.Ky.K=new olympe.D.J(()=>olympe.D.Za,[0]);m.toLocaleString.K=olympe.D.J.F;m.toLocaleDateString.K=olympe.D.J.F;m.toLocaleTimeString.K=olympe.D.J.F;m.Rc.K=olympe.D.J.F;m.bs.K=olympe.D.J.C;
|
|
302
|
+
m.Py.K=new olympe.D.J(()=>olympe.D.ib,[]);m.Ry.K=new olympe.D.J(()=>olympe.D.ib,[]);m.kg.K=new olympe.D.J(()=>olympe.D.ib,[]);m.pv.K=new olympe.D.J(()=>olympe.D.ib,[]);m.vv.K=new olympe.D.J(()=>olympe.D.ib,[]);m.qv.K=new olympe.D.J(()=>olympe.D.ib,[]);m.ov.K=new olympe.D.J(()=>olympe.D.ib,[]);m.zm.K=new olympe.D.J(()=>olympe.D.ib,[0]);m.wv.K=new olympe.D.J(()=>olympe.D.ib,[]);m.rv.K=new olympe.D.J(()=>olympe.D.ib,[]);m.xv.K=new olympe.D.J(()=>olympe.D.ib,[0]);
|
|
303
|
+
m.Ly.K=new olympe.D.J(()=>olympe.D.ib,[]);m.My.K=new olympe.D.J(()=>olympe.D.ib,[]);m.Pd.K=olympe.D.J.R;m.nb.K=olympe.D.J.C;m.Jw.K=olympe.D.J.G;m.xw.K=new olympe.D.J(()=>olympe.D.ga,[0,1]);m.yx.K=new olympe.D.J(()=>olympe.D.sa,[0]);m.wx.K=new olympe.D.J(()=>olympe.D.sa,[0]);m.zx.K=new olympe.D.J(()=>olympe.D.sa,[0,1]);m.valueOf.K=olympe.D.J.C;const ub=new Map,vb=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i,wb=/^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i;function xb(a){const b=c=>{let d;c=c.valueOf();6>c.length?(d=17,c=wb.exec(c)):(d=1,c=vb.exec(c));c=c?c.slice(1).map(e=>parseInt(e,16)*d):[0,0,0];return olympe.D.Color.create(c[0],c[1],c[2],isNaN(c[3])?1:c[3]/255)};return olympe.D.Vf(a)?olympe.D.ie([a],b,olympe.D.Color):b(a)}
|
|
304
304
|
olympe.D.Color=class{constructor(a,b,c,d){this.C=olympe.D.Ba(void 0!==a?Math.min(255,Math.max(0,Math.round(a))):0);this.F=olympe.D.Ba(void 0!==b?Math.min(255,Math.max(0,Math.round(b))):0);this.b=olympe.D.Ba(void 0!==c?Math.min(255,Math.max(0,Math.round(c))):0);this.a=olympe.D.Ba(void 0!==d?Math.min(1,Math.max(0,d)):1)}toJSON(){return`{ "type": "color", "r": ${this.C.valueOf()}, "g": ${this.F.valueOf()}, "b": ${this.b.valueOf()}, "a": ${this.a.valueOf()} }`}static lc(a){let b;'string'===typeof a?b=
|
|
305
|
-
JSON.parse(a):b=a;return olympe.D.Color.create(b.r,b.g,b.b,b.a)}static create(a,b,c,d=1){return olympe.D.Fa([a,b,c,d],(e,f,g,h)=>{e=olympe.D.Ba(void 0!==e?Math.min(255,Math.max(0,Math.round(e.valueOf()))):0);f=olympe.D.Ba(void 0!==f?Math.min(255,Math.max(0,Math.round(f.valueOf()))):0);g=olympe.D.Ba(void 0!==g?Math.min(255,Math.max(0,Math.round(g.valueOf()))):0);h=olympe.D.Ba(void 0!==h?Math.min(1,Math.max(0,h.valueOf())):1);for(let k of ub.values())if(k&&k.C.
|
|
306
|
-
return new olympe.D.Color(e,f,g,h)},olympe.D.Color)}Qf(){return this.C}Ff(){return this.b}Kf(){return this.F}Ef(){return this.a}
|
|
307
|
-
return'#'+(a+b).toUpperCase()}toString(){return this.
|
|
308
|
-
olympe.D.Color.prototype.getGreen=olympe.D.Color.prototype.Kf;olympe.D.Color.prototype.getBlue=olympe.D.Color.prototype.Ff;olympe.D.Color.prototype.getRed=olympe.D.Color.prototype.Qf;olympe.D.Color.create=olympe.D.Color.create;m=olympe.D.Color.prototype;m.toJSON.K=olympe.D.J.C;m.Qf.K=olympe.D.J.G;m.Ff.K=olympe.D.J.G;m.Kf.K=olympe.D.J.G;m.Ef.K=olympe.D.J.G;m.
|
|
309
|
-
m.
|
|
310
|
-
olympe.D.kc,'Vector2.plus')}qh(a){return olympe.D.Fa([this,a],(b,c)=>new olympe.D.kc(b.x.qh(c.x),b.y.qh(c.y)),olympe.D.kc,'Vector2.minus')}
|
|
311
|
-
a+b*b)),olympe.D.ga)}normalize(){return olympe.D.Fa([this.x,this.y],(a,b)=>{const c=Math.sqrt(a*a+b*b);return new olympe.D.kc(a/c,b/c)},olympe.D.kc)}floor(){return olympe.D.Fa([this.x,this.y],(a,b)=>new olympe.D.kc(Math.floor(a),Math.floor(b)),olympe.D.kc)}ceil(){return olympe.D.Fa([this.x,this.y],(a,b)=>new olympe.D.kc(Math.ceil(a),Math.ceil(b)),olympe.D.kc)}round(){return olympe.D.Fa([this.x,this.y],(a,b)=>new olympe.D.kc(Math.round(a),Math.round(b)),olympe.D.kc)}
|
|
312
|
-
this.y.he(a))}
|
|
313
|
-
m.qh.K=new olympe.D.J(()=>olympe.D.kc,[0]);m.
|
|
314
|
-
m.Hf.K=olympe.D.J.C;m.Ue.K=new olympe.D.J(()=>String,[]);m.Gf.K=olympe.D.J.C;m.qe.K=new olympe.D.J(()=>Object,[]);m.Te.K=olympe.D.J.C;m
|
|
315
|
-
c)&&lb(b[c],a)}get(a){const b=c=>{null===this.Ka&&(this.Ka={});return this.
|
|
316
|
-
f||this.R.run(()=>{f=olympe.D.Jd(d,void 0,e);a[b]=f;f.Pa.onDestroy(()=>delete a[b]);olympe.D.
|
|
317
|
-
b){this.Hb[a]=b;olympe.D.La().R(()=>{const c=this.$;for(const d in c)Object.prototype.hasOwnProperty.call(c,d)&&delete c[d][a];delete this.Hb[a]});this.ae(b)}
|
|
318
|
-
a(b[c],c,this))break}
|
|
319
|
-
e[a]&&qb(e[a],!1);delete c[a];this.size--;b||this.Af()}a=this.$[a];if(void 0!==a)for(const f in a)Object.prototype.hasOwnProperty.call(a,f)&&a[f].destroy();return d}Af(){null!==this.L&&qb(this.L,this.size)}
|
|
320
|
-
c)){b=this.$[c];for(const d in b)Object.prototype.hasOwnProperty.call(b,d)&&b[d].destroy()}this.size=0;null!==this.L&&qb(this.L,this.size)}Ug(){const a=this.values;let b='\n';for(const c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b+=a[c]+'\n');return b}};olympe.D.
|
|
321
|
-
m.nf.K=olympe.D.J.G;m.zg.K=olympe.D.J.C;m.forEach.K=new olympe.D.J(()=>{},[]);m.
|
|
322
|
-
[a.Pa],[0],'onResolved('+(b.name||'')+')')):b(a)}Hf(a){return this.F[a]}Ue(a){const b=c=>{const d=c.valueOf(),e=this.Gf(d);null===this.
|
|
323
|
-
b||this.R.run(()=>{b=this.get(this.Ue(a));this.ta.set(a,b);b.Pa.onDestroy(()=>this.ta.delete(a))});return b}Te(a){return this.kh(this.Gf(a))}
|
|
324
|
-
this.ja.Pa.onDestroy(()=>{this.L=null})});return this.ja}ae(a){if(this.C.length!==this.size)super.ae(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}}
|
|
325
|
-
c[a]&&mb(c[a],olympe.D.Ba(f)));null!==d&&(void 0!==e&&null!==e&&void 0!==d[e]&&nb(d[e]),void 0!==d[b]&&mb(d[b],a))}}
|
|
326
|
-
a)for(b in a)nb(a[b]);a=this.
|
|
327
|
-
m.Ue.K=new olympe.D.J(()=>String,[]);m.Gf.K=olympe.D.J.C;m.qe.K=new olympe.D.J(()=>Object,[]);m.Te.K=olympe.D.J.C;m
|
|
328
|
-
a){const b=this.values[a];b&&b instanceof olympe.D.Proxy?pb(this.F,b):mb(this.F,b);mb(this.C,a)}else void 0!==this.F.Pa.Kb&&(nb(this.F),nb(this.C))}set(a,b){this.
|
|
329
|
-
m.
|
|
330
|
-
olympe.D.Jd=function(a,b,c){a=olympe.D.createNode(a,void 0,void 0,void 0,void 0,c);olympe.D.Uf(b)?hb(a,b):olympe.D.
|
|
331
|
-
olympe.D.
|
|
332
|
-
olympe.D.bf=function(a,b){let c;olympe.D.
|
|
333
|
-
olympe.D.ie=function(a,b,c,d){return L(olympe.D.cf(a,b,c,d||'syncProxies'))};const zb=a=>{for(const b of a)if(olympe.D.Vf(b)||olympe.D.
|
|
334
|
-
olympe.D.
|
|
335
|
-
olympe.D.
|
|
336
|
-
olympe.D.
|
|
337
|
-
olympe.D.
|
|
338
|
-
''))});c.onDestroy(()=>{delete yb[d]})}}else olympe.D.N.log('NOT starting node dump, node is '+String(a))};olympe.D.
|
|
339
|
-
olympe.D.Ba=function(a){if(void 0===a)return olympe.D.ga.ZERO;if(a instanceof olympe.D.ga)return a;a&&a.valueOf&&(a=a.valueOf());if('number'===typeof a){if(isNaN(a))return olympe.D.ga.
|
|
340
|
-
olympe.D.ge=function(a){return void 0===a?olympe.D.Jd(olympe.D.ga):olympe.D.Jd(olympe.D.ga,olympe.D.Vf(a)?a:olympe.D.Ba(a))};olympe.D.
|
|
341
|
-
olympe.D.
|
|
342
|
-
olympe.D.
|
|
343
|
-
olympe.D.
|
|
305
|
+
JSON.parse(a):b=a;return olympe.D.Color.create(b.r,b.g,b.b,b.a)}static create(a,b,c,d=1){return olympe.D.Fa([a,b,c,d],(e,f,g,h)=>{e=olympe.D.Ba(void 0!==e?Math.min(255,Math.max(0,Math.round(e.valueOf()))):0);f=olympe.D.Ba(void 0!==f?Math.min(255,Math.max(0,Math.round(f.valueOf()))):0);g=olympe.D.Ba(void 0!==g?Math.min(255,Math.max(0,Math.round(g.valueOf()))):0);h=olympe.D.Ba(void 0!==h?Math.min(1,Math.max(0,h.valueOf())):1);for(let k of ub.values())if(k&&k.C.nb(e)&&k.F.nb(f)&&k.b.nb(g)&&k.a.nb(h))return k;
|
|
306
|
+
return new olympe.D.Color(e,f,g,h)},olympe.D.Color)}Qf(){return this.C}Ff(){return this.b}Kf(){return this.F}Ef(){return this.a}Fv(a,b){return olympe.D.Color.create(this.C.nj(a.Qf(),b),this.F.nj(a.Kf(),b),this.b.nj(a.Ff(),b),this.a.nj(a.Ef(),b))}aw(a){return olympe.D.Color.create(this.C,this.F,this.b,a)}ds(){return`rgba(${this.C},${this.F},${this.b},${this.a})`}vn(){const a=(16777216|this.b|this.F<<8|this.C<<16).toString(16).slice(1),b=1===this.a.valueOf()?'':(256|255*this.a).toString(16).slice(1);
|
|
307
|
+
return'#'+(a+b).toUpperCase()}toString(){return this.vn()}nb(a){return a instanceof olympe.D.Color?this.C.valueOf()===a.C.valueOf()&&this.F.valueOf()===a.F.valueOf()&&this.b.valueOf()===a.b.valueOf()&&this.a.valueOf()===a.a.valueOf():!1}};olympe.D.Color.prototype.equals=olympe.D.Color.prototype.nb;olympe.D.Color.prototype.toHexString=olympe.D.Color.prototype.vn;olympe.D.Color.prototype.toRGBString=olympe.D.Color.prototype.ds;olympe.D.Color.prototype.getAlpha=olympe.D.Color.prototype.Ef;
|
|
308
|
+
olympe.D.Color.prototype.getGreen=olympe.D.Color.prototype.Kf;olympe.D.Color.prototype.getBlue=olympe.D.Color.prototype.Ff;olympe.D.Color.prototype.getRed=olympe.D.Color.prototype.Qf;olympe.D.Color.create=olympe.D.Color.create;m=olympe.D.Color.prototype;m.toJSON.K=olympe.D.J.C;m.Qf.K=olympe.D.J.G;m.Ff.K=olympe.D.J.G;m.Kf.K=olympe.D.J.G;m.Ef.K=olympe.D.J.G;m.Fv.K=new olympe.D.J(()=>olympe.D.Color,[]);m.aw.K=new olympe.D.J(()=>olympe.D.Color,[]);m.ds.K=new olympe.D.J(()=>String,[]);
|
|
309
|
+
m.vn.K=new olympe.D.J(()=>String,[]);m.nb.K=olympe.D.J.C;olympe.D.File=class{na(){}sp(){}Gl(){}Wm(){}Fk(){}Sm(){}Gk(){}rename(){}};olympe.D.kc=class{constructor(a,b){this.x=olympe.D.ge(a);this.y=olympe.D.ge(b)}toJSON(){return'{ "type": "vector2", "x": '+JSON.stringify(olympe.D.$a(this.x).valueOf())+', "y": '+JSON.stringify(olympe.D.$a(this.y).valueOf())+' }'}static lc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.D.kc(b.x,b.y)}sx(){return this.x}Iy(a){qb(this.x,a)}tx(){return this.y}Jy(a){qb(this.y,a)}hx(){return this.x.Xr(this.y)}he(a){return olympe.D.Fa([this,a],(b,c)=>new olympe.D.kc(b.x.he(c.x),b.y.he(c.y)),
|
|
310
|
+
olympe.D.kc,'Vector2.plus')}qh(a){return olympe.D.Fa([this,a],(b,c)=>new olympe.D.kc(b.x.qh(c.x),b.y.qh(c.y)),olympe.D.kc,'Vector2.minus')}Px(a){return new olympe.D.kc(this.x.Rk(a),this.y.Rk(a))}Wv(a){return new olympe.D.kc(this.x.Zi(a),this.y.Zi(a))}Rx(){return new olympe.D.kc(this.x.vj(),this.y.vj())}Xv(a){return olympe.D.Fa([this,a],(b,c)=>olympe.D.Fa([b.x,b.y,c.x,c.y],(d,e,f,g)=>olympe.D.Ba(d*f+e*g),olympe.D.ga),olympe.D.ga)}length(){return olympe.D.Fa([this.x,this.y],(a,b)=>olympe.D.Ba(Math.sqrt(a*
|
|
311
|
+
a+b*b)),olympe.D.ga)}normalize(){return olympe.D.Fa([this.x,this.y],(a,b)=>{const c=Math.sqrt(a*a+b*b);return new olympe.D.kc(a/c,b/c)},olympe.D.kc)}floor(){return olympe.D.Fa([this.x,this.y],(a,b)=>new olympe.D.kc(Math.floor(a),Math.floor(b)),olympe.D.kc)}ceil(){return olympe.D.Fa([this.x,this.y],(a,b)=>new olympe.D.kc(Math.ceil(a),Math.ceil(b)),olympe.D.kc)}round(){return olympe.D.Fa([this.x,this.y],(a,b)=>new olympe.D.kc(Math.round(a),Math.round(b)),olympe.D.kc)}tv(a){return new olympe.D.kc(this.x.he(a),
|
|
312
|
+
this.y.he(a))}uv(a,b){return new olympe.D.kc(this.x.he(a),this.y.he(b))}Rc(){return olympe.D.Fa([this.x,this.y],(a,b)=>olympe.D.yb(`Vector2[${a.valueOf()}, ${b.valueOf()}]`),olympe.D.Za)}toString(){return`Vector2[${this.x.Pa.Kb}, ${this.y.Pa.Kb}]`}nb(a){return this===a?!0:!1}};m=olympe.D.kc.prototype;m.toJSON.K=olympe.D.J.C;m.sx.K=olympe.D.J.G;m.Iy.K=olympe.D.J.C;m.tx.K=olympe.D.J.G;m.Jy.K=olympe.D.J.C;m.hx.K=olympe.D.J.G;m.he.K=new olympe.D.J(()=>olympe.D.kc,[0]);
|
|
313
|
+
m.qh.K=new olympe.D.J(()=>olympe.D.kc,[0]);m.Px.K=olympe.D.J.W;m.Wv.K=olympe.D.J.W;m.Rx.K=olympe.D.J.W;m.Xv.K=new olympe.D.J(()=>olympe.D.ga,[0]);m.length.K=olympe.D.J.G;m.normalize.K=olympe.D.J.W;m.floor.K=olympe.D.J.W;m.ceil.K=olympe.D.J.W;m.round.K=olympe.D.J.W;m.tv.K=olympe.D.J.W;m.uv.K=olympe.D.J.W;m.Rc.K=olympe.D.J.F;m.toString.K=olympe.D.J.C;m.nb.K=olympe.D.J.C;olympe.D.Pg=class{constructor(){}Wb(){}Ed(){}get(){}kh(){}has(){}Eg(){}Oc(){}If(){}nf(){}zg(){}forEach(){}ae(){}};olympe.D.Pg.prototype.forEachCurrentValue=olympe.D.Pg.prototype.ae;olympe.D.Pg.prototype.forEach=olympe.D.Pg.prototype.forEach;m=olympe.D.Pg.prototype;m.has.K=olympe.D.J.R;m.Eg.K=olympe.D.J.C;m.Oc.K=new olympe.D.J(()=>Object,[]);m.If.K=new olympe.D.J(()=>String,[]);m.nf.K=olympe.D.J.G;m.zg.K=olympe.D.J.C;m.forEach.K=new olympe.D.J(()=>{},[]);m.ae.K=olympe.D.J.C;olympe.D.md=class extends olympe.D.Pg{constructor(){super()}ee(){}Hf(){}Ue(){}Gf(){}qe(){}Te(){}aj(){}di(){}};olympe.D.md.prototype.getCurrentAt=olympe.D.md.prototype.Te;olympe.D.md.prototype.getAt=olympe.D.md.prototype.qe;olympe.D.md.prototype.getCurrentKeyAt=olympe.D.md.prototype.Gf;olympe.D.md.prototype.getKeyAt=olympe.D.md.prototype.Ue;olympe.D.md.prototype.getCurrentRank=olympe.D.md.prototype.Hf;olympe.D.md.prototype.getRank=olympe.D.md.prototype.ee;m=olympe.D.md.prototype;m.ee.K=olympe.D.J.G;
|
|
314
|
+
m.Hf.K=olympe.D.J.C;m.Ue.K=new olympe.D.J(()=>String,[]);m.Gf.K=olympe.D.J.C;m.qe.K=new olympe.D.J(()=>Object,[]);m.Te.K=olympe.D.J.C;m.aj.K=olympe.D.J.C;m.di.K=new olympe.D.J(()=>Array,[]);olympe.D.mi=class{constructor(a,b){this.R=b||olympe.D.La();this.valueType=a||Object;this.values={};this.jb=this.Ka=null;this.fe=0;this.$=Object.create(null);this.Hb=Object.create(null);this.size=0;this.L=null;this.R.onDestroy(()=>{const c=this.$;if(c){const d=Object.keys(c),e=d.length;for(let f=0;f<e;f++){const g=c[d[f]],h=Object.keys(g);for(let k=h.length,l=0;l<k;l++)g[h[l]].destroy()}}})}Bh(){return this.R}Wb(){return this.valueType}Ed(a){this.valueType=a;const b=this.Ka;if(null!==b)for(const c in b)Object.prototype.hasOwnProperty.call(b,
|
|
315
|
+
c)&&lb(b[c],a)}get(a){const b=c=>{null===this.Ka&&(this.Ka={});return this.dj(this.Ka,c,this.values[c],this.valueType,'Map.get('+c+')')};return olympe.D.Fa([a],c=>b(c),this.valueType)}kh(a){a=this.values[a];return olympe.D.ob(a)?Xa(a.Pa)?a.Pa.Kb:void 0:a}has(a){const b=c=>{null===this.jb&&(this.jb={});return this.dj(this.jb,c,c in this.values?olympe.D.sa.F:olympe.D.sa.C,olympe.D.sa,'Map.has('+c+')')};return olympe.D.Fa([a],c=>b(c),olympe.D.sa)}Eg(a){return a in this.values}dj(a,b,c,d,e){let f=a[b];
|
|
316
|
+
f||this.R.run(()=>{f=olympe.D.Jd(d,void 0,e);a[b]=f;f.Pa.onDestroy(()=>delete a[b]);olympe.D.ob(c)?pb(f,c):mb(f,c)});return f}Oc(){throw Error('Abstract method getFirstKey needs to be overridden');}If(){throw Error('Abstract method getFirstKey needs to be overridden');}nf(){null===this.L&&this.R.run(()=>{this.L=olympe.D.Jd(olympe.D.ga,olympe.D.Ba(this.size));this.L.Pa.onDestroy(()=>{this.L=null})});return this.L}zg(){return this.size}forEach(a,b){const c=this.vm();a=this.lr(c,a,b);this.um(c,a)}vm(){return String(++this.fe)}um(a,
|
|
317
|
+
b){this.Hb[a]=b;olympe.D.La().R(()=>{const c=this.$;for(const d in c)Object.prototype.hasOwnProperty.call(c,d)&&delete c[d][a];delete this.Hb[a]});this.ae(b)}lr(a,b,c){const d=olympe.D.La();return(e,f)=>{d.run(()=>{const g=olympe.D.createNode(void 0,b,null,[e,f,this],null,`forEach-${a}-${f}`);if(void 0!==c)g.onDestroy(()=>{c(f)});this.ym(a,f,g)})}}ym(a,b,c){void 0===this.$[b]&&(this.$[b]={});this.$[b][a]=c}ae(a){const b=this.values;for(const c in b)if(Object.prototype.hasOwnProperty.call(b,c)&&!1===
|
|
318
|
+
a(b[c],c,this))break}Ak(a,b){void 0!==this.values[a]&&this.Ti(a,!0);this.values[a]=b;var c=this.Ka;null!==c&&void 0!==c[a]&&(b&&b instanceof olympe.D.Proxy?pb(c[a],b):mb(c[a],b));c=this.jb;null!==c&&void 0!==c[a]&&qb(c[a],!0);this.size++;c=this.Hb;for(const d in c)if(Object.prototype.hasOwnProperty.call(c,d))c[d](b,a,this)}Ti(a,b){const c=this.values;if(Object.prototype.hasOwnProperty.call(c,a)){var d=(d=c[a])&&d.zf?d.Pa.Kb:d;var e=this.Ka;null!==e&&void 0!==e[a]&&nb(e[a]);e=this.jb;null!==e&&void 0!==
|
|
319
|
+
e[a]&&qb(e[a],!1);delete c[a];this.size--;b||this.Af()}a=this.$[a];if(void 0!==a)for(const f in a)Object.prototype.hasOwnProperty.call(a,f)&&a[f].destroy();return d}Af(){null!==this.L&&qb(this.L,this.size)}Wh(){var a=this.Ka;if(null!==a)for(const c in a)Object.prototype.hasOwnProperty.call(a,c)&&nb(a[c]);a=this.jb;if(null!==a)for(var b in a)Object.prototype.hasOwnProperty.call(a,b)&&qb(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.$,
|
|
320
|
+
c)){b=this.$[c];for(const d in b)Object.prototype.hasOwnProperty.call(b,d)&&b[d].destroy()}this.size=0;null!==this.L&&qb(this.L,this.size)}Ug(){const a=this.values;let b='\n';for(const c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b+=a[c]+'\n');return b}};olympe.D.mi.ma=[olympe.D.Pg];m=olympe.D.mi.prototype;m.Bh.K=olympe.D.J.C;m.Wb.K=olympe.D.J.C;m.Ed.K=olympe.D.J.C;m.get.K=new olympe.D.J(()=>Object,[],'valueType');m.kh.K=olympe.D.J.C;m.has.K=olympe.D.J.R;m.Eg.K=olympe.D.J.C;m.dj.K=olympe.D.J.C;
|
|
321
|
+
m.nf.K=olympe.D.J.G;m.zg.K=olympe.D.J.C;m.forEach.K=new olympe.D.J(()=>{},[]);m.vm.K=olympe.D.J.C;m.um.K=olympe.D.J.C;m.lr.K=olympe.D.J.C;m.ym.K=olympe.D.J.C;m.ae.K=olympe.D.J.C;m.Ak.K=olympe.D.J.C;m.Ti.K=olympe.D.J.C;m.Af.K=olympe.D.J.C;m.Wh.K=olympe.D.J.C;m.Ug.K=olympe.D.J.C;olympe.D.zj=class extends olympe.D.mi{constructor(a,b){super(a,b);this.F=Object.create(null);this.C=[];this.ta=this.Wa=this.Sa=this.ja=null}Ed(a){super.Ed(a);if(null!==this.ta)for(let b of this.ta.values())lb(b,a)}Oc(){return this.qe(0)}If(){return this.Ue(0)}ee(a){const b=c=>{null===this.Sa&&(this.Sa=Object.create(null));let d=this.Hf(a);d=void 0!==d?olympe.D.Ba(d):void 0;return this.dj(this.Sa,c,d,olympe.D.ga,`List.getRank(${c})`)};return olympe.D.ob(a)?L(olympe.D.createNode(olympe.D.ga,b,null,
|
|
322
|
+
[a.Pa],[0],'onResolved('+(b.name||'')+')')):b(a)}Hf(a){return this.F[a]}Ue(a){const b=c=>{const d=c.valueOf(),e=this.Gf(d);null===this.Wa&&(this.Wa=Object.create(null));return this.dj(this.Wa,String(d),e,String,'List.getKeyAt('+c+')')};return olympe.D.Fa([a],c=>b(c),String)}Gf(a){return this.C[a.valueOf()]}qe(a){if(olympe.D.ob(a))return this.get(olympe.D.Fa([a],c=>{c=this.Ue(c);if(!Xa(c.Pa)){const d=olympe.D.La();olympe.D.Uf(d)&&gb(d)}return c},String));null===this.ta&&(this.ta=new Map);let b=this.ta.get(a);
|
|
323
|
+
b||this.R.run(()=>{b=this.get(this.Ue(a));this.ta.set(a,b);b.Pa.onDestroy(()=>this.ta.delete(a))});return b}Te(a){return this.kh(this.Gf(a))}aj(a,b,c,d){let e=this.vm();a=this.Sr(e,a,b,c,d);this.um(e,a)}Sr(a,b,c,d,e){return olympe.D.La().F((f,g)=>{let h=!1,k=olympe.D.cf([b,c,this.ee(g)],(l,n,p)=>{p>=l&&p<l+n?h||(d(f,g,this),h=!0):h&&(e(g),h=!1)});if(void 0!==e)k.onDestroy(e.bind(null,g));this.ym(a,g,k)})}di(){null===this.ja&&this.R.run(()=>{this.ja=olympe.D.Jd(Array,this.C.filter(a=>void 0!==a));
|
|
324
|
+
this.ja.Pa.onDestroy(()=>{this.L=null})});return this.ja}ae(a){if(this.C.length!==this.size)super.ae(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}}xm(a,b){const c=this.Sa,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]&&nb(c[g]),void 0!==
|
|
325
|
+
c[a]&&mb(c[a],olympe.D.Ba(f)));null!==d&&(void 0!==e&&null!==e&&void 0!==d[e]&&nb(d[e]),void 0!==d[b]&&mb(d[b],a))}}wm(a){var b=this.Wa,c=this.F[a];null!==c&&void 0!==c&&null!==b&&(b=b[c],void 0!==b&&b.Pa.Kb===a&&nb(b));delete this.F[a];this.C.splice(c,1);c=this.Sa;null!==c&&void 0!==c[a]&&nb(c[a])}mr(){if(null!==this.ja){const a=this.C,b=this.ja.Pa.Kb;b&&a.join(',')!==b.join(',')&&mb(this.ja,a)}}Af(){this.mr();super.Af()}Wh(){var a=this.F;for(b in a)delete a[b];this.C.length=0;a=this.Sa;if(null!==
|
|
326
|
+
a)for(b in a)nb(a[b]);a=this.Wa;if(null!==a)for(b in a)nb(a[parseInt(b,10)]);var b=this.ja;null!==b&&(eb(b.Pa),mb(b,this.C));return olympe.D.mi.prototype.Wh.call(this)}Ug(){const a=this.values,b=this.F;let c='[\n';for(let d in a)Object.prototype.hasOwnProperty.call(a,d)&&(c+=`${b[d]}. ${a[d]}\n`);return c+']'}};olympe.D.zj.ma=[olympe.D.md];m=olympe.D.zj.prototype;m.Ed.K=olympe.D.J.C;m.Oc.K=new olympe.D.J(()=>Object,[]);m.If.K=new olympe.D.J(()=>String,[]);m.ee.K=olympe.D.J.G;m.Hf.K=olympe.D.J.C;
|
|
327
|
+
m.Ue.K=new olympe.D.J(()=>String,[]);m.Gf.K=olympe.D.J.C;m.qe.K=new olympe.D.J(()=>Object,[]);m.Te.K=olympe.D.J.C;m.aj.K=new olympe.D.J(()=>{},[]);m.Sr.K=olympe.D.J.C;m.di.K=new olympe.D.J(()=>Array,[]);m.ae.K=olympe.D.J.C;m.xm.K=olympe.D.J.C;m.wm.K=olympe.D.J.C;m.mr.K=olympe.D.J.C;m.Af.K=olympe.D.J.C;m.Wh.K=olympe.D.J.C;m.Ug.K=olympe.D.J.C;olympe.D.Map=class extends olympe.D.mi{constructor(a){a===olympe.D.Proxy&&(a=Object);super(a);this.C=this.F=null}Ed(a){a===olympe.D.Proxy&&(a=Object);null!==this.F&&lb(this.F,a);super.Ed(a)}Oc(){null===this.F&&this.Im();return this.F}If(){null===this.C&&this.Im();return this.C}Im(){this.Bh().run(()=>{this.F=olympe.D.Jd(this.Wb());this.C=olympe.D.Jd(String);this.tj(this.Nm())})}Nm(){const a=this.values;let b,c;for(b in a)if(Object.prototype.hasOwnProperty.call(a,b)){c=b;break}return c}tj(a){if(void 0!==
|
|
328
|
+
a){const b=this.values[a];b&&b instanceof olympe.D.Proxy?pb(this.F,b):mb(this.F,b);mb(this.C,a)}else void 0!==this.F.Pa.Kb&&(nb(this.F),nb(this.C))}set(a,b){this.Ak(a,b);1===this.size&&null!==this.C&&this.tj(a);this.Af()}remove(a){const b=this.Ti(a);null!==this.C&&this.C.Pa.Kb===a&&this.tj(this.Nm());return b}clear(){this.Wh();null!==this.C&&this.tj()}};m=olympe.D.Map.prototype;m.Ed.K=olympe.D.J.C;m.Oc.K=new olympe.D.J(()=>Object,[]);m.If.K=new olympe.D.J(()=>String,[]);m.Im.K=olympe.D.J.C;
|
|
329
|
+
m.Nm.K=olympe.D.J.C;m.tj.K=olympe.D.J.C;m.set.K=olympe.D.J.C;m.remove.K=new olympe.D.J(()=>Object,[]);m.clear.K=olympe.D.J.C;olympe.D.Vg=class extends olympe.D.zj{constructor(a){super(a)}set(a,b,c){this.Ak(a,b);void 0!==c&&olympe.D.yc([c],d=>{this.xm(a,d)});this.Af()}remove(a){this.wm(a);return this.Ti(a)}clear(){this.Wh()}};olympe.D.Vg.prototype.remove.K=olympe.D.J.C;olympe.D.Vg.prototype.clear.K=olympe.D.J.C;olympe.D.ms=class extends olympe.D.Oj{constructor(a,b){super(olympe.D.ga,'animatedFlowSource');this.duration=a;this.C=b||olympe.D.ga.uo.Cp}Ib(){return olympe.D.Vx(this.node,this.duration,this.C,void 0)}};let yb=null;olympe.D.N=void 0;olympe.D.nn=void 0;olympe.D.$h=void 0;olympe.D.Vh=new Map;olympe.D.Vh.set(0,olympe.D.ga.ZERO);olympe.D.Vh.set(1,olympe.D.ga.ONE);olympe.D.Vh.set(2,olympe.D.ga.dv);olympe.D.zk=new Map;olympe.D.zk.set('',olympe.D.Za.EMPTY);olympe.D.zk.set(' ',olympe.D.Za.Qu);olympe.D.createNode=function(a,b,c,d,e,f,g,h){return new olympe.D.Node({valueType:a,zd:b,Yf:c,Zm:d,debug:g,ug:e,wd:f,Vi:h})};olympe.D.Uf=function(a){return!!(a&&a instanceof olympe.D.Node)};
|
|
330
|
+
olympe.D.Jd=function(a,b,c){a=olympe.D.createNode(a,void 0,void 0,void 0,void 0,c);olympe.D.Uf(b)?hb(a,b):olympe.D.ob(b)?hb(a,b.Pa):K(a,b);return L(a)};olympe.D.ob=function(a){return!(!a||!a.zf)};olympe.D.Vf=function(a){return!(!a||!(a instanceof olympe.D.Node||a.zf))};olympe.D.bn=function(a){return olympe.D.Uf(a)||a instanceof olympe.D.Zb||a instanceof olympe.D.yq};olympe.D.fi=function(a){return a instanceof olympe.D.Oj};
|
|
331
|
+
olympe.D.Vk=function(a,b){if(void 0!==a){olympe.D.fi(a)&&(a=a.Ib().Pa);if(!olympe.D.Vf(a))return b(a);var c=[];olympe.D.ob(a)?c.push(a.Pa):c.push(a);return olympe.D.createNode(void 0,b,null,c,[0],'onResolved')}};olympe.D.$a=function(a,b){let c=a;olympe.D.ob(a)?c=a.Pa.Kb:olympe.D.Uf(a)?c=a.Kb:olympe.D.fi(a)&&(c=a.Ib().Pa.Kb);return void 0===c?b:c};
|
|
332
|
+
olympe.D.bf=function(a,b){let c;olympe.D.ob(a)?c=a.Pa:olympe.D.Uf(a)?c=a:olympe.D.fi(a)&&(c=a.Ib().Pa);c&&olympe.D.yc([b],d=>{c.bf(d)},'setDefaultValue');return a};olympe.D.cf=function(a,b,c,d){const e=a.length,f=Array(e),g=[];let h;for(let k=0;k<e;k++)h=a[k],void 0!==h&&null!==h&&(void 0!==h.jr?(h=h.Pa,g.push(k)):h instanceof olympe.D.Node?g.push(k):olympe.D.fi(h)&&(h=h.Ib().Pa,g.push(k))),f[k]=h;return olympe.D.createNode(c,b,null,f,g,d||'syncNodes')};
|
|
333
|
+
olympe.D.ie=function(a,b,c,d){return L(olympe.D.cf(a,b,c,d||'syncProxies'))};const zb=a=>{for(const b of a)if(olympe.D.Vf(b)||olympe.D.fi(b))return!1;return!0};olympe.D.Fa=function(a,b,c,d,e){if(zb(a))return b(...a);const f=olympe.D.cf(a,b,c,d||'TransformFlows');e&&olympe.D.yc([e],g=>{f.bf(g)},'setDefaultValue');return L(f)};olympe.D.yc=function(a,b,c){zb(a)?b(...a):olympe.D.cf(a,b,void 0,c||'processFlows')};
|
|
334
|
+
olympe.D.Vr=function(a,b){if(zb(a))b(...a);else{const c=olympe.D.La();olympe.D.cf(a,(...d)=>{olympe.D.La().destroy();c.run(b,...d)},void 0,'processFlowsOnce')}};olympe.D.ln=function(a,b,c){const d=a.length,e=Array(d),f=[];let g;for(let h=0;h<d;h++)g=a[h],void 0!==g&&null!==g&&(olympe.D.ob(g)?(g=g.Pa,f.push(h)):g instanceof olympe.D.Node?f.push(h):olympe.D.fi(g)&&(g=g.Ib().Pa,f.push(h))),e[h]=g;0!==f.length&&new olympe.D.Node({zd:b,Zm:e,ug:f,oy:!1,wd:c})};
|
|
335
|
+
olympe.D.qD=function(a,b,c){const d=olympe.D.La();olympe.D.ln(a,(...e)=>{olympe.D.La().destroy();d.run(b,...e)},c||'processFutureFlowsOnce')};olympe.D.RC=function(a,b,c){a=new olympe.D.Oj(a,c);b(a);return a.Ib()};olympe.D.Qc=function(a,b='flowSource'){return new olympe.D.Oj(a,b)};olympe.D.tD=function(a,b,c,d){const e=olympe.D.La();olympe.D.cf(a,(...f)=>{olympe.D.La().destroy();e.run(b,...f)},c,d||'syncProxiesOnce')};
|
|
336
|
+
olympe.D.Ym=function(a,b,c){olympe.D.Fa([a],d=>d.valueOf()?b.apply(null,void 0):c&&c.apply(null,void 0),Object,'If')};olympe.D.WC=function(a,b,...c){return a?a.run(b,...c):b(...c)};olympe.D.yD=function(a){return olympe.D.La().F(a)};olympe.D.UC=function(a,b,c){olympe.D.Yv(a?a.Pa:a,b,c)};
|
|
337
|
+
olympe.D.Yv=function(a,b,c){if(a){var d=a.Z();null===yb&&(yb={});if(yb[d])olympe.D.N.log(`Already started node #${d} dump`+(b?`: ${b}`:''));else{yb[d]=!0;var e=`Starting node #${d} dump`+(b?`: ${b}`:'');c?olympe.D.N.warn(e):olympe.D.N.log(e);var f=`#${d}`+(b?`: ${b}`:'')+':';c=olympe.D.createNode(null,g=>{void 0===g?olympe.D.N.log(f,'undefined'):null===g?olympe.D.N.log(f,'null'):olympe.D.N.log(f,String(g))},null,[a],[0],'DataFlowDump');a.onDestroy(()=>{olympe.D.N.log(`Node #${d} destroyed`+(b?`: ${b}`:
|
|
338
|
+
''))});c.onDestroy(()=>{delete yb[d]})}}else olympe.D.N.log('NOT starting node dump, node is '+String(a))};olympe.D.TC=function(){let a='',b=olympe.D.La();for(;null!==b;)a+=b.Xc()+' --\x3e ',b=b.getParent();olympe.D.N.log(a)};
|
|
339
|
+
olympe.D.Ba=function(a){if(void 0===a)return olympe.D.ga.ZERO;if(a instanceof olympe.D.ga)return a;a&&a.valueOf&&(a=a.valueOf());if('number'===typeof a){if(isNaN(a))return olympe.D.ga.Lp;if(a===Math.PI)return olympe.D.ga.PI;if(Infinity===a)return olympe.D.ga.lt;if(-Infinity===a)return olympe.D.ga.eu;if(isNaN(a))var b=!1;else b=parseFloat(a),b=(b|0)===b;return b&&-1<=a&&100>=a?(olympe.D.Vh.has(a)||olympe.D.Vh.set(a,new olympe.D.ga(a)),olympe.D.Vh.get(a)):new olympe.D.ga(a)}return null};
|
|
340
|
+
olympe.D.ge=function(a){return void 0===a?olympe.D.Jd(olympe.D.ga):olympe.D.Jd(olympe.D.ga,olympe.D.Vf(a)?a:olympe.D.Ba(a))};olympe.D.Vx=olympe.D.ga.animate;olympe.D.kD=function(a,b){return new olympe.D.ms(a,b)};olympe.D.yb=function(a){if(a instanceof olympe.D.Za)return a;a instanceof Object&&(a=a.valueOf());const b=typeof a;if('string'===b||'number'===b||'boolean'===b)return a=String(a),olympe.D.zk.has(a)?olympe.D.zk.get(a):new olympe.D.Za(a)};
|
|
341
|
+
olympe.D.nD=function(a){return void 0===a?olympe.D.Jd(olympe.D.Za):olympe.D.Jd(olympe.D.Za,olympe.D.Vf(a)?a:olympe.D.yb(a))};olympe.D.wc=function(a){return a instanceof olympe.D.sa?a:void 0!==a&&null!==a&&a.valueOf()?olympe.D.sa.F:olympe.D.sa.C};olympe.D.jy=function(a){return void 0===a?olympe.D.Jd(olympe.D.sa):olympe.D.Jd(olympe.D.sa,olympe.D.Vf(a)?a:olympe.D.wc(a))};olympe.D.Wx=function(a){if(a instanceof Date)return new olympe.D.ib(a)};
|
|
342
|
+
olympe.D.mD=function(a){return olympe.D.Jd(olympe.D.ib,void 0!==a?new olympe.D.ib(a):null)};olympe.D.Rr=a=>a instanceof olympe.D.sa||a instanceof olympe.D.ga||a instanceof olympe.D.Za||a instanceof olympe.D.ib;olympe.D.oD=function(a,b){return olympe.D.Jd(olympe.D.kc,void 0===a&&void 0===b?void 0:new olympe.D.kc(a,b))};olympe.D.iy=function(a,b,c,d){let e;void 0!==a&&(a instanceof olympe.D.Color?e=a:e=olympe.D.Color.create(a,b,c,d));return olympe.D.Jd(olympe.D.Color,e)};olympe.D.lD=olympe.D.iy;
|
|
343
|
+
olympe.D.Ov=function(a){olympe.D.N=a;olympe.D.$h=olympe.D.lh()};olympe.D.lh=function(){olympe.D.nn||(olympe.D.nn=new olympe.D.yq);return olympe.D.nn};olympe.D.La=function(){olympe.D.$h||(olympe.D.$h=olympe.D.lh());return olympe.D.$h};olympe.D.Yr=function(a){const b=olympe.D.$h;olympe.D.bn(a)&&(olympe.D.$h=a);return b||null};
|
|
344
344
|
olympe.D.lc=a=>{a='string'===typeof a?JSON.parse(a):a;if(a.type){let b=null;switch(a.type){case 'dateTime':b=olympe.D.ib.lc(a);break;case 'number':b=olympe.D.ga.lc(a);break;case 'string':b=olympe.D.Za.lc(a);break;case 'vector2':b=olympe.D.kc.lc(a);break;case 'color':b=olympe.D.Color.lc(a);break;case 'boolean':b=olympe.D.sa.lc(a)}return b}return null};function Ab(a){a.C.G()||(a.G.forEach(b=>{b.destroy()}),a.G.clear(),a.F.clear(),a.size.clear(),a.R.clear(),a.W.length=0,a.L.length=0)}
|
|
345
|
-
olympe.D.
|
|
346
|
-
class Bb{constructor(a,b,c,d){this.id=a;this.F=new olympe.D.Zb('Slot manager entry');this.L=c;this.R=d;this.F.run(()=>{const e=rb(olympe.D.Qc(olympe.D.ga),olympe.D.ga.ZERO);olympe.D.
|
|
347
|
-
this.next=null}destroy(){this.F.destroy();this.G=this.C=this.next=null}}m=Bb.prototype;m.Z.K=olympe.D.J.C;m.
|
|
348
|
-
function Gb(a){var b=olympe.host.ba.bd,c=olympe.host.ba.
|
|
349
|
-
{Fb(this,d,k,...n)})},void 0,g,h,'Native('+d+').'+k),this.F.set(l,f),f.onDestroy(()=>this.F.delete(l)));return null}.bind(a));e.R(a.R.bind(a,d));a=L(e);a.
|
|
350
|
-
olympe.host.
|
|
351
|
-
olympe.host.bd.C=class{constructor(a,b){this.af=a;this.id=b}Z(){return this.id}cancel(){}};olympe.host.bd.L=class extends olympe.host.bd.C{cancel(){this.af.R(this.id)}};olympe.host.bd.G=class extends olympe.host.bd.C{cancel(){this.af.G(this.id)}};olympe.host.bd.F=class extends olympe.host.bd.C{cancel(){this.af.F(this.id)}};olympe.host.ba={};olympe.host.ba.Fd=class{destroy(){}};olympe.host.ba.Fd.prototype.destroy=olympe.host.ba.Fd.prototype.destroy;olympe.host.ba.
|
|
352
|
-
|
|
353
|
-
olympe.U.run([olympe.host.P.
|
|
354
|
-
olympe.net.
|
|
345
|
+
olympe.D.tB=class{constructor(){this.C=new olympe.D.Zb('Slot Manager context');this.G=new Map;this.C.run(()=>{this.F=olympe.D.Qc(Bb,'Last slot manager entry');this.size=rb(olympe.D.Qc(olympe.D.ga,'SlotManager size').repeat(this.F.Ib().Um()),olympe.D.ga.ZERO);this.R=rb(olympe.D.Qc(olympe.D.ga,'last valid slots'),olympe.D.Ba(-1))});this.W=[];this.L=[];this.C.onDestroy(()=>{Ab(this)})}};
|
|
346
|
+
class Bb{constructor(a,b,c,d){this.id=a;this.F=new olympe.D.Zb('Slot manager entry');this.L=c;this.R=d;this.F.run(()=>{const e=rb(olympe.D.Qc(olympe.D.ga),olympe.D.ga.ZERO);olympe.D.ob(b)?e.repeat(b):e.update(b);this.C=olympe.D.Qc(olympe.D.ga);this.G=this.C.Ib().he(e.Ib())});this.next=null}Z(){return this.id}lx(){return this.C.Ib()}Um(){return this.G}ee(){return this.L}xx(){return this.R}Ty(a){this.L=a}Dy(a){null===a?this.C.update(olympe.D.ga.ZERO):(this.C.repeat(a.Um()),a.next=this)}xt(){this.C.clear();
|
|
347
|
+
this.next=null}destroy(){this.F.destroy();this.G=this.C=this.next=null}}m=Bb.prototype;m.Z.K=olympe.D.J.C;m.lx.K=new olympe.D.J(()=>olympe.D.ga);m.Um.K=new olympe.D.J(()=>olympe.D.ga);m.ee.K=olympe.D.J.C;m.xx.K=olympe.D.J.C;m.Ty.K=olympe.D.J.C;m.Dy.K=olympe.D.J.C;m.xt.K=olympe.D.J.C;m.destroy.K=olympe.D.J.C;olympe.D.P={Ea:'df.Logger'};olympe.U.config(a=>{D(a,olympe.D.Config.Mp,Number.POSITIVE_INFINITY);C(a,olympe.D.P.Ea,[olympe.ra.P.Aa],b=>b.Nc('df'))},'olympe.df');olympe.U.run([olympe.D.P.Ea],a=>{olympe.D.Ov(a)},'olympe.df');olympe.host={};const Cb=new Map,Db=new Map;olympe.host.Qp=class{static register(a,b,...c){Cb.set(a,b);0<c.length&&Db.set(a,c)}static create(a,b,c,d){const e=Cb.get(a);if(void 0===e)throw Error('Undefined UI element type: '+a);a=Db.get(a);return void 0!==a?new e(b,c,...a.map(f=>ma(d,f))):new e(b,c)}};function Eb(a,b,c){a.N.debug('CREATE #',b,', type=',c);a.C.set(b,olympe.host.Qp.create(c,b,a.N,a.L))}function Fb(a,b,c,...d){const e=a.C.get(b);if(void 0!==e){a.N.L()<=olympe.ra.Ob.C.eg&&a.N.debug('CALL #'+b+', '+c+'('+Array.prototype.slice.call(d,0)+')');b=[];for(const f of d)if(void 0===f||null===f)b.push(f);else if(olympe.D.ob(f))b.push(a.C.get(f.mv)||null);else if('function'===typeof f){const g=f,h=olympe.D.La();b.push((...k)=>{h.G()||g(...k)})}else b.push(f.valueOf());e[c].apply(e,b)}}
|
|
348
|
+
function Gb(a){var b=olympe.host.ba.bd,c=olympe.host.ba.Pp.dr;++a.G;const d=a.G;Eb(a,d,c);const e=olympe.D.createNode(b,void 0,void 0,void 0,void 0,'Native('+d+')',!1,function(){var f=arguments.length-2;const g=Array.from({length:f}),h=[],k=arguments[f+1],l=d+'_'+k;this.F.has(l)&&this.F.get(l).destroy();for(let n=0;n<f;n++){let p=arguments[n];olympe.D.ob(p)?(h.push(n),p=p.Pa):olympe.D.Uf(p)&&h.push(n);g[n]=p}0===h.length?e.run(()=>{Fb(this,d,k,...g)}):(f=olympe.D.createNode(void 0,(...n)=>{e.run(()=>
|
|
349
|
+
{Fb(this,d,k,...n)})},void 0,g,h,'Native('+d+').'+k),this.F.set(l,f),f.onDestroy(()=>this.F.delete(l)));return null}.bind(a));e.R(a.R.bind(a,d));a=L(e);a.mv=d;K(e,a);return a}olympe.host.pa=class{constructor(a,b){this.N=a;this.L=b;this.G=0;this.C=new Map;this.F=new Map;a.debug('Starting host manager')}Ya(){return this.N}R(a){this.N.debug('DESTROY #',a);const b=this.C.get(a);this.C.delete(a);b.destroy()}};olympe.host.Fd=class{constructor(a){this.C=a;this.F=olympe.D.La()}L(){return this.C}$(){return this.C.Pa.$()||this.F.$()}G(){return this.C.Pa.G()}};olympe.host.Fd.prototype.L.K=new olympe.D.J(()=>olympe.host.ba.Fd,[]);olympe.host.rk=class{};olympe.host.Di=class{constructor(){}C(){}F(){}lj(){}};function Hb(a){return(a=a.find(b=>'authToken'===b.na()))?a.getValue():null}olympe.host.Di.F=class{constructor(a,b,c=!1){this.name=a;this.value=b;this.C=c}na(){return this.name}getValue(){return this.value}nb(a){return this.na()===a.na()&&this.getValue()===a.getValue()&&this.C===a.C}};function Ib(){const a={}.parameters;return new olympe.host.Di.C(a?a.map(b=>new olympe.host.Di.F(b.name,b.value,b.hidden)):[])}
|
|
350
|
+
olympe.host.Di.C=class{constructor(a){this.parameters=a}fn(a){const b=new Map(this.parameters.map((c,d)=>[c.na(),d]));a.parameters.forEach(c=>{b.has(c.na())?this.parameters[b.get(c.na())]=c:this.parameters.push(c)})}};function Jb(a,b){var c=olympe.host.af;const d=olympe.X.ec(),e=new olympe.D.Zb('onTimeout context');c.C.$(b,d,()=>{e.G()||e.$()||e.run(a);c.C.G(d)});return new olympe.host.bd.G(c.C,d)}function Kb(a,b){var c=olympe.host.af;const d=olympe.X.ec(),e=new olympe.D.Zb('onInterval context');c.C.W(b,d,()=>{e.G()||e.$()?c.C.F(d):e.run(a)});return new olympe.host.bd.F(c.C,d)}function Lb(a){var b=olympe.host.af;a=a instanceof olympe.host.bd.F?a.Z():a;b.C.F(a)}olympe.host.bd=class{constructor(a){this.C=Gb(a)}};
|
|
351
|
+
olympe.host.bd.C=class{constructor(a,b){this.af=a;this.id=b}Z(){return this.id}cancel(){}};olympe.host.bd.L=class extends olympe.host.bd.C{cancel(){this.af.R(this.id)}};olympe.host.bd.G=class extends olympe.host.bd.C{cancel(){this.af.G(this.id)}};olympe.host.bd.F=class extends olympe.host.bd.C{cancel(){this.af.F(this.id)}};olympe.host.ba={};olympe.host.ba.Fd=class{destroy(){}};olympe.host.ba.Fd.prototype.destroy=olympe.host.ba.Fd.prototype.destroy;olympe.host.ba.Pp={bz:100,dz:101,cz:102,fz:103,ez:104,az:105,gB:201,eB:202,bB:204,jB:205,aB:206,dB:207,hB:208,kB:209,lB:210,mB:211,cB:212,iB:218,fB:219,nB:220,$A:221,ZA:222,wB:300,xB:301,yB:302,CB:303,DB:304,EB:305,zB:310,AB:311,BB:312,HA:400,IA:401,JA:402,DA:450,vA:500,tA:501,yA:502,xA:503,uA:504,wA:505,XB:600,OB:601,SB:602,KB:603,LB:604,IB:605,NB:606,cC:607,VB:608,FB:609,JB:610,MB:611,UB:612,ZB:613,GB:614,YB:615,TB:616,bC:617,PB:618,QB:619,RB:620,WB:630,HB:631,$B:632,aC:633,EC:700,hC:701,iC:702,
|
|
352
|
+
jC:703,lC:704,mC:705,nC:706,kC:707,pC:708,oC:709,qC:710,uC:711,CC:712,rC:713,sC:714,vC:715,wC:716,yC:717,zC:718,BC:719,xC:720,AC:721,DC:722,tC:723,FC:724,GC:725,dr:800};olympe.host.ba.bd=class{R(){}$(){}G(){}W(){}F(){}};olympe.host.P={Mq:'host.System',xl:'host.HistoryManager',Aq:'host.Scheduler',Ea:'host.platform.Logger',Aa:'host.Manager'};olympe.host.af=null;olympe.U.config(function(a){ta(a,olympe.host.P.Mq);ta(a,olympe.host.P.xl);C(a,olympe.host.P.Ea,[olympe.ra.P.Aa],function(b){return b.Nc('host')});A(a,olympe.host.P.Aa,olympe.host.pa,olympe.host.P.Ea,olympe.U.P.dg);C(a,olympe.host.P.Aq,[olympe.host.P.Aa],b=>{null===olympe.host.af&&(olympe.host.af=new olympe.host.bd(b));return olympe.host.af},!0)},'olympe.host');
|
|
353
|
+
olympe.U.run([olympe.host.P.Aq],a=>a,'olympe.host.scheduler');olympe.U.run([olympe.host.P.Aa],a=>a,'olympe.host');olympe.net={};olympe.net.eb={};olympe.net.eb.Yd={Xl:'POST',GET:'GET',it:'HEAD',fk:'PUT',Ac:'DELETE',Sl:'OPTIONS',LA:'PATCH'};olympe.net.eb.ResponseType={sk:'text',el:'blob',ARRAY_BUFFER:'arraybuffer'};olympe.net.eb.Headers={Ej:'content-type',oz:'content-length',oi:'authorization',ls:'access-control-allow-origin'};olympe.net.eb.pz={kA:'text/html',JSON:'application/json',JC:'application/zip'};olympe.net.eb.cd={us:0,Hh:200,kl:201,xj:202,$y:400,gv:401,Zs:403,FA:404,zA:405,Bq:500,Nu:503};function Mb(a){return a.host&&encodeURI(a.host)}function Nb(a){return encodeURI(a.path).replace(olympe.net.Si.C,(b,c)=>'%'+c)}function Ob(a){return void 0===a.G?443===a.port:a.G}olympe.net.Si=class{constructor(a,b,c,d){this.host='localhost';this.port=80;this.path='';this.G=!1;void 0!==a&&(this.host=a);void 0!==b&&(this.port=b);void 0!==c&&(this.path=c.replace(/^\/+/,''));void 0!==d&&(this.G=d)}C(){return`${Ob(this)?'wss':'ws'}://${Mb(this)}:${this.port}/${Nb(this)}`}toString(){return`${Mb(this)}:${this.port}/${Nb(this)}`}};
|
|
354
|
+
olympe.net.Si.C=/%25([0-9a-f]{2})/i;olympe.net.WebSocket=class{send(){}close(){}ja(){}da(){}$(){}F(){}};function Pb(a,b,c,d){a=olympe.X.ly(a.valueOf());if(!a.host&&!a.path)return null;const e=a.scheme?a.scheme.includes('s'):!1;b=new olympe.net.Sj(a.host,a.port||(e?443:80),a.path||'',e,b,c,d,a.query||void 0);a.es&&(c=a.es.split(':'),2===c.length&&(c=olympe.X.bi().C(Da(`${c[0]}:${c[1]}`)),Qb(b,{Authorization:`Basic ${c}`})));return b}function Rb(a){return void 0!==a.query?a.query.replace(/[^=&]+/g,b=>encodeURIComponent(b)):null}
|
|
355
355
|
function Qb(a,b){for(let c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a.headers[c]=b[c])}
|
|
356
|
-
olympe.net.
|
|
357
|
-
olympe.net.
|
|
358
|
-
function Yb(a,b){a.client.on(olympe.net.ke.C.
|
|
359
|
-
olympe.net.ke=class{constructor(a,b){this.url=a;this.C=b||null;this.client=null;this.G=[];this.F=new Map;this.N=olympe.ra.Ya('MQTT')}connect(a,b){if(Tb(this))return b&&b(),this;this.C.username=this.C.vhost+':'+a.yd();this.C.password=a.Ve();b&&this.G.push(b);null===this.client&&(this.client=mqtt.connect(this.url,this.C),this.client.on(olympe.net.ke.C.
|
|
360
|
-
()=>{this.G.forEach(c=>c())}),this.client.on(olympe.net.ke.C.
|
|
361
|
-
this;this.client.publish(a,JSON.stringify(b),c,e=>{d&&d(e);e&&this.N.error('Failed to publish a message '+b)});return this}end(a,b){this.client&&this.client.end(a,{},()=>{b&&b();this.client=null});return this}};olympe.net.ke.C={
|
|
362
|
-
olympe.U.config(function(a){const b='object'===typeof window&&window.location&&window.location.hostname||'localhost',c='localhost'===b;D(a,olympe.net.Config.
|
|
363
|
-
olympe.async.
|
|
356
|
+
olympe.net.Sj=class extends olympe.net.Si{constructor(a,b,c,d,e,f,g,h){super(a,b,c,d);this.method=void 0!==e?e:olympe.net.eb.Yd.GET;this.query=h;this.headers={};this.body=f;this.F=void 0!==g?g:olympe.net.eb.ResponseType.sk;this.ca=this.cert=this.key=null;this.rejectUnauthorized=!1}fj(){return this.headers}C(){let a=Rb(this);a=a?`?${a}`:'';return Mb(this)?`${Ob(this)?'https':'http'}://${Mb(this)}:${this.port}/${Nb(this)}${a}`:`${Nb(this)}${a}`}toString(){return this.C()}};
|
|
357
|
+
olympe.net.Sj.Yd={Xl:'POST',GET:'GET',it:'HEAD',fk:'PUT',Ac:'DELETE',Sl:'OPTIONS'};olympe.net.Sg=class{constructor(a,b,c,d){this.data=a;this.status=void 0===b?200:b;this.statusText=void 0===c?'':c;this.headers=void 0===d?{}:d}getData(){return this.data}Od(){return this.status}fj(){return this.headers}};function Sb(a,b,c){const d=olympe.D.La(),e=d.onDestroy(()=>{var f=a.F();const g=f.C.get(b);g&&(f.C.delete(b),g())});return d.F(f=>{d.Xe(e);a.F().C.delete(b);c(f)})}olympe.net.pa=class{constructor(a){this.N=a;this.L=1;a='Initializing NET layer';this.N.G()&&(a+=' (implementation: '+this.W()+')');this.N.info(a);this.N.log('DONE initializing NET layer (ready to receive connection requests)')}F(){}G(){}C(){}R(){}W(){}};function Tb(a){return!(!a.client||!a.client.connected)}function Ub(a,b,c){Tb(a)?a.client.subscribe(b,void 0,d=>{d?a.N.error(`Failed to subscribe to topic ${b}: ${d}`):a.F.set(b,c)}):c&&c(Error('Cannot subscribe because the MQTT client is disconnected'))}function Vb(a,b,c){Tb(a)?(a.client.unsubscribe(b,void 0,c),a.F.delete(b)):c&&c(Error('Cannot unsubscribe because the MQTT client is disconnected'))}function Wb(a,b){a.G.push(b)}function Xb(a,b){a.client.on(olympe.net.ke.C.oq,b)}
|
|
358
|
+
function Yb(a,b){a.client.on(olympe.net.ke.C.Gh,b)}function Zb(a,b){a.client.on(olympe.net.ke.C.ac,b)}
|
|
359
|
+
olympe.net.ke=class{constructor(a,b){this.url=a;this.C=b||null;this.client=null;this.G=[];this.F=new Map;this.N=olympe.ra.Ya('MQTT')}connect(a,b){if(Tb(this))return b&&b(),this;this.C.username=this.C.vhost+':'+a.yd();this.C.password=a.Ve();b&&this.G.push(b);null===this.client&&(this.client=mqtt.connect(this.url,this.C),this.client.on(olympe.net.ke.C.du,(c,d)=>{this.F.has(c)?this.F.get(c)(JSON.parse(d.toString())):this.N.warn('There is no subscriber for topic '+c)}),this.client.on(olympe.net.ke.C.As,
|
|
360
|
+
()=>{this.G.forEach(c=>c())}),this.client.on(olympe.net.ke.C.oq,()=>{this.N.warn('Mqtt client is reconnecting to bus ... ')}),this.client.on(olympe.net.ke.C.ac,c=>{this.N.error('Mqtt client error ',c)}),this.client.on(olympe.net.ke.C.Gh,()=>{this.N.error('Mqtt client is offline')}),this.client.on(olympe.net.ke.C.zs,()=>{this.N.error('Mqtt client is closed')}),this.client.on(olympe.net.ke.C.rl,()=>{this.N.error('Mqtt client has ended')}));return this}publish(a,b,c,d){if(!Tb(this))return d&&d(Error('Cannot publish message because the MQTT client is disconnected')),
|
|
361
|
+
this;this.client.publish(a,JSON.stringify(b),c,e=>{d&&d(e);e&&this.N.error('Failed to publish a message '+b)});return this}end(a,b){this.client&&this.client.end(a,{},()=>{b&&b();this.client=null});return this}};olympe.net.ke.C={As:'connect',oq:'reconnect',du:'message',zs:'close',rl:'end',ac:'error',Gh:'offline'};olympe.net.xk=class{constructor(a){this.N=a}$(){this.N.error('Try to set cors policies on a web server with the browser implementation.');return this}L(){return Promise.reject('Try to open a route on a web server using the browser implementation.')}W(){return Promise.reject('Try to close a route on a web server using the browser implementation.')}};olympe.net.P={Aa:'net.Manager',Ea:'net.Logger',tm:'net.WebServer'};olympe.net.Config={yl:'net.httpHost',zl:'net.httpPort',bp:'net.httpSSL',ap:'net.httpBodyLimit'};
|
|
362
|
+
olympe.U.config(function(a){const b='object'===typeof window&&window.location&&window.location.hostname||'localhost',c='localhost'===b;D(a,olympe.net.Config.yl,b);D(a,olympe.net.Config.zl,c?3141:443);D(a,olympe.net.Config.bp,!c);D(a,olympe.net.Config.ap,100);ta(a,olympe.net.P.Aa);C(a,olympe.net.P.Ea,[olympe.ra.P.Aa],function(d){return d.Nc('net')});A(a,olympe.net.P.tm,olympe.net.xk,olympe.net.P.Ea)},'olympe.net');olympe.async={};function $b(a,b){0<=b&&(a.timeout=b)}function ac(a,b){a.L||a.da.push(a.G.F(b))}
|
|
363
|
+
olympe.async.Co=class{constructor(a,b=void 0===a){this.C=[];this.da=[];this.G=a||new olympe.D.Zb('Async executor context');this.ta=b;this.F=null;this.env=new Map;this.env.set('Executor',this);this.L=this.R=!1;this.N=null;this.W=this.timeout=0}Ya(){return this.N}add(a){this.L||this.C.push(this.G.F(a));return this}start(){this.R||(this.N&&this.N.log('Executor started.'),this.R=!0,0<this.timeout&&(this.W=setTimeout(()=>{this.F='Timeout expired.';this.W=0;this.complete(!1)},this.timeout)))}clear(){this.C=
|
|
364
364
|
[];this.da=[];this.env.clear();this.ta&&this.G.destroy()}complete(a){if(!this.L){this.L=!0;this.W&&(clearTimeout(this.W),this.W=0);this.N&&this.N.log(a?'Executor completed successfully':`Executor completed with error: ${this.F}`);for(const b of this.da)b(a,a?null:this.F,this.env);this.clear()}}};
|
|
365
|
-
function bc(a){if(0<a.C.length){const b=a.C.shift();a.N&&a.N.log(`Executing next task. ${a.C.length} tasks left in the pipeline.`);a.G.run(()=>{b(()=>{Promise.resolve().then(()=>{bc(a)})},c=>{c&&(a.F=c);a.complete(!1)},a.env)})}else a.complete(!0)}olympe.async.
|
|
366
|
-
olympe.async.ng=class extends olympe.async.
|
|
367
|
-
this.C.length;for(const a of this.C)this.run(a)}else this.complete(!0)}};olympe.hc={};olympe.hc.
|
|
368
|
-
a.$);c.
|
|
369
|
-
break;case olympe.auth.pa.C.INIT:a.N.warn('Cannot open auth session - no server connection');break;default:a.N.error('Should not get there, investigate')}nc(a,olympe.auth.pa.C.hg)});a.F.
|
|
365
|
+
function bc(a){if(0<a.C.length){const b=a.C.shift();a.N&&a.N.log(`Executing next task. ${a.C.length} tasks left in the pipeline.`);a.G.run(()=>{b(()=>{Promise.resolve().then(()=>{bc(a)})},c=>{c&&(a.F=c);a.complete(!1)},a.env)})}else a.complete(!0)}olympe.async.pk=class extends olympe.async.Co{static create(){return new olympe.async.pk(new olympe.D.Zb('SequencedExecutor'),!0)}insert(a){this.L||this.C.unshift(a);return this}start(){this.R||(super.start(),bc(this))}};
|
|
366
|
+
olympe.async.ng=class extends olympe.async.Co{constructor(a,b){super(a,b);this.$=0;this.ja=!0}static create(){return new olympe.async.ng(new olympe.D.Zb('ParallelExecutor'),!0)}run(a){this.N&&this.N.log('Starting a task');this.G.run(()=>{a(()=>{this.done()},b=>{this.ja=!1;b&&(this.F=this.F?`${this.F}. ${b}`:b);this.done()},this.env)})}add(a){super.add(a);this.R&&!this.L&&(this.$++,this.run(a));return this}done(){this.$--;0>=this.$&&this.complete(this.ja)}start(){if(!this.R)if(super.start(),0<this.C.length){this.$=
|
|
367
|
+
this.C.length;for(const a of this.C)this.run(a)}else this.complete(!0)}};olympe.hc={};olympe.hc.St=class{constructor(){}set(){}get(){}forEach(){}remove(){}clear(){}close(){}};olympe.hc.Rt=class{constructor(){}C(){}};olympe.hc.Storage=class{open(){}F(){}R(){}write(){}G(){}L(){}C(){}close(){}};function cc(a,b,c){a.storage.F(c)}function dc(a,b,c,d,e){a.storage.write(b,'transactions',c.toJSON(),'text/json',d,e)}function ec(a,b){a.storage.G(b)}function fc(a,b){a.storage.C(b)}function gc(a,b,c,d,e,f){a.storage.write(b,'files',c,d,()=>{e('files/'+b)},f)}function hc(a,b){a.storage.R(b)}olympe.hc.Ns=class{constructor(a){this.storage=a}};olympe.hc.P={Xj:'localStorage.KeyValueManager',Pi:'localStorage.Storage',ko:'localStorage.DatacloudStorage',Ea:'localStorage.Logger'};olympe.U.config(function(a){ta(a,olympe.hc.P.Xj);C(a,olympe.hc.P.Ea,[olympe.ra.P.Aa],function(b){return b.Nc('localstorage')});A(a,olympe.hc.P.ko,olympe.hc.Ns,olympe.hc.P.Pi)},'olympe.localstorage');olympe.auth={};olympe.auth.Wu=class{$(){}R(){}W(){}Sa(){}ja(){}gi(){}mh(){}G(){}Jr(){}};function ic(a){a.N.info('Initializing AUTH layer');let b=a.Vb;if(a.ta){const c=a.ta.C(),d=Hb(c.parameters);b=d||b;d&&a.ta.F(c.parameters.filter(e=>'authToken'!==e.na()))}b&&a.storage&&jc(a.storage,b,c=>{!c&&a.N.error('Could not store authToken')});a.N.debug('Asking to be notified when auth connector gets online');a.F.$(()=>{if(a.Wa)if(a.L=olympe.auth.pa.G.js,a.N.log('Connector online, parameter auth.autoLogin=true --\x3e attempting to log with parameters'),a.$){const c=new olympe.auth.Request;c.set('username',
|
|
368
|
+
a.$);c.sn(a.Sa);a.N.log('Autologin with user "'+a.$+'"');kc(a,c)}else a.N.error('autoLogin: auto user not specified.'),lc(a);else a.L=olympe.auth.pa.G.tk,a.N.log('Connector online, attempting to log with token'),mc(a)});a.F.R(()=>{switch(olympe.D.$a(a.G)){case olympe.auth.pa.C.Mg:a.N.warn('Disconnected from server - session of user '+olympe.D.$a(a.C.Ib()).yd()+' lost');break;case olympe.auth.pa.C.yh:a.N.warn('Disconnected from server - guest session lost');break;case olympe.auth.pa.C.li:a.N.warn('Disconnected from server - authentication aborted');
|
|
369
|
+
break;case olympe.auth.pa.C.INIT:a.N.warn('Cannot open auth session - no server connection');break;default:a.N.error('Should not get there, investigate')}nc(a,olympe.auth.pa.C.hg)});a.F.W(c=>{switch(c){case olympe.H.pa.C.Uh:nc(a,olympe.auth.pa.C.Uh);break;case olympe.H.pa.C.sh:nc(a,olympe.auth.pa.C.sh)}});a.F.Sa((c,d)=>{if(c===olympe.auth.pa.F.xj)a.N.info('Authentication revoked'),lc(a),a.storage&&oc(a.storage),a.W.forEach(e=>{e(c,d)});else if(c===olympe.auth.pa.F.fp)a.N.info('Redirection to IDP to invalidate token (SAML)'),
|
|
370
370
|
a.storage&&oc(a.storage),a.Ka.F();else throw Error(`Unknown logout step coming from server : ${c}`);});a.N.log('DONE initializing AUTH layer (waiting for connector to be online)')}
|
|
371
|
-
function mc(a){null!==a.storage?(a.N.debug('Retrieving token from local storage'),a.storage.Yc(b=>{if(b){const d=new olympe.auth.Request;var c=b.yd();d.set('username',c);b=b.Ve();
|
|
372
|
-
function nc(a,b){a.N.log('State change: ',pc(a),'--\x3e',b);a.G.update(b)}function lc(a){a.C.update(a.ja);nc(a,olympe.auth.pa.C.yh);a.N.info('Authenticated as guest')}function pc(a){return olympe.D.$a(a.G.Ib())}function qc(a){const b=olympe.auth.pa.C.Mg,c=olympe.auth.pa.C.yh,d=olympe.auth.pa.C.
|
|
371
|
+
function mc(a){null!==a.storage?(a.N.debug('Retrieving token from local storage'),a.storage.Yc(b=>{if(b){const d=new olympe.auth.Request;var c=b.yd();d.set('username',c);c=d;b=b.Ve();c.set('nonce',b);a.N.debug('Token found, trying login with',d);kc(a,d,a.Ab)}else a.N.debug('No token found, cannot perform auto login. Falling back in GUEST state'),lc(a)})):(a.N.error('Cannot retrieve token: no storage configured, cannot perform auto login. Falling back in GUEST state'),lc(a))}
|
|
372
|
+
function nc(a,b){a.N.log('State change: ',pc(a),'--\x3e',b);a.G.update(b)}function lc(a){a.C.update(a.ja);nc(a,olympe.auth.pa.C.yh);a.N.info('Authenticated as guest')}function pc(a){return olympe.D.$a(a.G.Ib())}function qc(a){const b=olympe.auth.pa.C.Mg,c=olympe.auth.pa.C.yh,d=olympe.auth.pa.C.li,e=olympe.D.Qc(olympe.D.sa,'auth.isOnline');olympe.D.yc([a.G],f=>{f=olympe.D.wc(f===b||f===c||f===d);const g=olympe.D.$a(e);void 0!==g&&g.nb(f)||e.update(f)},'Router is online');return e.Ib()}
|
|
373
373
|
function rc(a,b,c){void 0===c&&(c=olympe.X.yg());a.W.set(c,b)}function sc(a){return a.C.Ib().Ve()}function tc(a,b,c,d=!1){b=b+c?':'+c.message:'';a.N.error(b);a.error.update(olympe.D.yb(b));nc(a,olympe.auth.pa.C.ac);if(d)throw Error(b);}
|
|
374
|
-
function kc(a,b,c,d){void 0===c&&(c=a.
|
|
375
|
-
olympe.auth.pa=class{constructor(a,b,c,d,e,f,g,h,k,l,n,p){this.N=a;this.F=b;this.storage=c;this.Ka=d;this.ta=e;this.
|
|
376
|
-
q.na();if(this.Jb.has(r))throw Error('Provider "'+r+'" has already been registered !');this.Jb.set(r,q)});ic(this)}getState(){return this.G.Ib()}da(){return this.error.Ib()}yd(){return this.C.Ib().yd()}Dg(){return this.C.Ib().Dg()}
|
|
377
|
-
{a&&this.N.error('Was not able to send the auth keep alive message:',a.message)})}Hb(a,b){const c=null===this.L?olympe.auth.pa.G.
|
|
378
|
-
this.R.delete('login')}};olympe.auth.pa.C={INIT:'init',
|
|
379
|
-
m.
|
|
380
|
-
olympe.auth.
|
|
381
|
-
|
|
382
|
-
return}this.N.debug('Sending SRP A+M (proof) message');this.C.
|
|
383
|
-
olympe.U.config(function(a){D(a,olympe.auth.Config.
|
|
384
|
-
olympe.auth.P.
|
|
385
|
-
olympe.U.gf.C.
|
|
386
|
-
c,e,p,d.
|
|
387
|
-
olympe.dc.gh=function(a,b=olympe.dc.Ca.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.Ca.DESTINATION){const e=olympe.dc.Ca.DESTINATION;return b===olympe.dc.Ca.ORIGIN||b===e?new olympe.dc.ua.Relation(a,b):new olympe.dc.ua.Relation(a,d,b,c)};olympe.dc.
|
|
388
|
-
function
|
|
389
|
-
olympe.dc
|
|
390
|
-
olympe.dc.ha.ia={ac:1,lg:2,Rg:10,
|
|
391
|
-
function
|
|
392
|
-
olympe.dc.ya=class{constructor(){}static C(a,b,...c){if(
|
|
393
|
-
olympe.dc.ua.Entry=class{constructor(a,b,c){this.tag=a;this.C=b;this.
|
|
394
|
-
a)}xa(a){return new olympe.dc.ua.Property(a)}Ga(a,b=olympe.dc.Ca.DESTINATION){
|
|
395
|
-
a.Ra()===this.Ra():!1}toString(){return this.direction+this.tag}};olympe.dc.ua.Relation.prototype.getInverse=olympe.dc.ua.Relation.prototype.Ec;olympe.dc.ua.Relation.prototype.getDirection=olympe.dc.ua.Relation.prototype.Ra;olympe.dc.ua.Relation.prototype.getTag=olympe.dc.ua.Relation.prototype.T;olympe.dc.ua.Relation.ma=[olympe.dc.Ae];olympe.dc.db={};function
|
|
396
|
-
olympe.dc.db.
|
|
397
|
-
olympe.dc.db.Database=class a extends Map{constructor(b,c){super();this.id=olympe.X.ec();this.N=b;this.Ab=olympe.D.La();this.od=c.get('defaultSource')||olympe.dc.Ha.sb;this.R=olympe.dc.db.Database.G.IDLE;this.da=new Map;this.Hb=[];this.G=[];this.Sa=new Map;b=c.get('garbageCollector')||olympe.dc.db.
|
|
398
|
-
c.get(
|
|
399
|
-
d)switch(b){case
|
|
400
|
-
h=olympe.dm.Relation.C.
|
|
401
|
-
this.G[0].C.delete(b)}C(b,c,...d){this.da.has(b)&&this.da.get(b).forEach(e=>{e(c,...d)})}
|
|
402
|
-
this.Ab))}ja(){this.R=a.G.cg;this.fe();
|
|
403
|
-
this.Sa.clear()}be(){const b=a.C.DESTINATION,c=a.F.
|
|
404
|
-
this.N.error(`\n[DEBUG - DATABASE]\nThe model ${h} is extended by other models but does not exist !`+`\nExtension models: ${Array.from(g.values()).join(', ')}`+`\n\n ${k.toString()}`)});f.clear()})}};olympe.dc.db.Database.C={
|
|
405
|
-
olympe.dc.db.Instance=class a extends Map{constructor(b,c){super();this.C=b;this.Xc=olympe.dc.Ha.sb;this.e=!1;this.Hb=0;this.F=void 0;this.c=0;this.Ka=a.C.
|
|
406
|
-
b=`Instance: ${this.C}, Exist: ${this.e}, Name: ${b}`;var c=this.model();if(c){var d=c.cb(olympe.dc.CloudObject.nameProp.T())||'No model name';b+=`\nModel: ${c.C}, Exist: ${c.e}, Model name: ${d}`}else b+='\nModel: no model';(c=this.Df())?(d=c.cb(olympe.dc.CloudObject.nameProp.T())||'No extension name',b+=`\nExtension: ${c.C}, Exist: ${c.e}, Extension name: ${d}`):b+='\nExtension: no extension';return b}cb(b,c=!1){const d=this.get(
|
|
407
|
-
b);return c||void 0!==d?d:this.get(
|
|
408
|
-
b+')'),e.ph(this.C,b)),e=
|
|
409
|
-
b);d=c.Ab(d);e.has(c.C)||(e.set(c.C,c),d.set(this.C,this),this.db.C(Q.
|
|
410
|
-
d)});(b.e||b===this)&&this.db.
|
|
411
|
-
d){const e=(...f)=>{var g=f.length;const h=f[g-2];(g=this.db.get(f[g-1]))&&(h?g.da():g.ja());d(...f)};this.$(b,c,e);return e}$(b,c,d){const e=this.Ab(
|
|
412
|
-
this.c&&this.db.C(Q.
|
|
413
|
-
f=d===R?T:R;b.forEach(g=>{const h=g.get(f+e);h.delete(this.C);0===h.size&&g.delete(f+e)})}d===
|
|
414
|
-
this.L(c,b,d===
|
|
415
|
-
d&&d.forEach(e=>{b.forEach((f,g)=>e.Sa(g,f))});d=this.get(R+
|
|
416
|
-
d.delete(c);0===d.size&&this.delete(b);return e}}};olympe.dc.db.Instance.C={
|
|
417
|
-
function
|
|
418
|
-
function
|
|
419
|
-
olympe.dc.db.
|
|
420
|
-
d.join(' --M--\x3e ')}this.N.info(a)}else this.N.info('[DATABASE] Instance',b,'has never been created or referred by the database')}};olympe.dc.db.
|
|
421
|
-
b.Vb(g)}d.delete(g)}for(const h of d)f=Array.from(b.W(h,c,!0)).map(e),g=Array.from(b.W(h,c)).map(e),f.some(k=>k.ta())?g.filter(k=>!k.persisted()).forEach(k=>{d.delete(k.tag())}):f.concat(g).filter(k=>!k.persisted()).map(k=>k.tag()).forEach(k=>{d.delete(k);b.Vb(k)});d.clear()}R(){this.Na.Ka(this.run.bind(this));const b=olympe.dc.db.Database.F.
|
|
422
|
-
f.bind(this));this.Na.F(c,f.bind(this));this.Na.F(b,g=>{this.F.delete(g)});this.Na.F(d,(g,...h)=>{this.N.error(h[0])})}};olympe.dc.db.
|
|
423
|
-
function
|
|
424
|
-
function
|
|
425
|
-
function
|
|
426
|
-
function V(a,b,c,d,e){b=a.Na.L(olympe.dc.za(b));c=c.Ra()+c.T();e=e||
|
|
427
|
-
function
|
|
428
|
-
function
|
|
429
|
-
olympe.dc.hb=class{constructor(a,b){this.N=a;this.G=new olympe.D.Zb('DB View context');this.Na=b;this.L=0}Z(){return this.Na.Z()}F(a,b,c){a=U(this,a);null!==a&&(b=olympe.dc.za(b),a.R(
|
|
430
|
-
b.cb(olympe.dc.CloudObject.nameProp.T()))?c:''}model(a){return(a=(a=U(this,a,!0))?a.model():null)?a.tag():null}Df(a){return(a=(a=U(this,a,!0))&&a.Df())?a.tag():null}
|
|
431
|
-
a?a:null}dd(a,b=!1){var c=U(this,a,!0);a=new Map;if(c)for(const [d,e]of c)c=d[0],(c===
|
|
432
|
-
null):(a=c?c.values().next().value:null)&&a.Db()?a.tag():null:null}Pf(a,b,c){a=olympe.dc.za(a);const d=
|
|
433
|
-
b).filter(c)}
|
|
434
|
-
return e.map(f=>f.tag())}Tf(a,b){const c=olympe.dc.za(b);return!!this.
|
|
435
|
-
olympe.dc.hb.prototype.findRecursive=olympe.dc.hb.prototype.
|
|
436
|
-
olympe.dc.hb.prototype.isPersisted=olympe.dc.hb.prototype.Wf;olympe.dc.hb.prototype.instanceOf=olympe.dc.hb.prototype.Rf;olympe.dc.hb.prototype.isModel=olympe.dc.hb.prototype.
|
|
437
|
-
function
|
|
438
|
-
a.C.has(n))}function
|
|
439
|
-
olympe.dc.db.uc=class{constructor(a){this.id=a||olympe.X.ih();this.C=new Map}toJSON(){let a='{ "id": '+JSON.stringify(this.id)+', "instances": {';for(const b of this.C.keys()){const c=this.C.get(b);a+=JSON.stringify(b)+': '+c.toJSON()+', '}a.endsWith(', ')&&(a=a.substr(0,a.length-2));return a+'}}'}static lc(a){var b;'string'===typeof a?b=JSON.parse(a):b=a;a=new olympe.dc.db.uc(b.id);b=b.instances;for(const c of Object.keys(b)){const d=olympe.dc.db.jg.lc(b[c]);a.C.set(c,d)}return a}Z(){return this.id}
|
|
440
|
-
olympe.dc.db.jg.C.
|
|
441
|
-
a).delete(b);for(const d of
|
|
442
|
-
a,b,c)}};olympe.dc.db.uc.ma=[olympe.dc.Writable,olympe.dc.
|
|
443
|
-
olympe.dc.db.jg=class a{constructor(b){this.da=b;this.G=a.F(a.C.
|
|
374
|
+
function kc(a,b,c,d){void 0===c&&(c=a.jb);void 0===c&&tc(a,'No authentication provider specified',null,!0);const e=a.Jb.get(c);e||tc(a,'Undefined authentication provider "'+c+'"',null,!0);d&&a.R.set('login',d);a.N.log('Sending authentication request using "'+c+'" for '+b);e.Yc(b,a.Hb.bind(a));nc(a,olympe.auth.pa.C.li)}function uc(a){return olympe.D.$a(a.C)===a.ja}function vc(a,b,c){a.R.forEach(d=>{d(b,c)})}
|
|
375
|
+
olympe.auth.pa=class{constructor(a,b,c,d,e,f,g,h,k,l,n,p){this.N=a;this.F=b;this.storage=c;this.Ka=d;this.ta=e;this.jb=g;this.Ab=h;this.Wa=void 0===k?!0:k;this.$=l;this.Sa=n;this.Vb=p;this.Jb=new Map;this.G=olympe.D.Qc(String).update(olympe.auth.pa.C.INIT);this.error=olympe.D.Qc(olympe.D.Za);this.L=null;this.ja=new olympe.auth.vf('guest','0163d9653067b6237f62','e96e099c-55bb-4004-b0e8-bd76b6209218');this.C=olympe.D.Qc(olympe.auth.vf).update(this.ja);this.R=new Map;this.W=new Map;f.forEach(q=>{const r=
|
|
376
|
+
q.na();if(this.Jb.has(r))throw Error('Provider "'+r+'" has already been registered !');this.Jb.set(r,q)});ic(this)}getState(){return this.G.Ib()}da(){return this.error.Ib()}yd(){return this.C.Ib().yd()}Dg(){return this.C.Ib().Dg()}ci(){return this.C.Ib().ci()}mh(a,b){this.F.mh(a,olympe.D.$a(sc(this)),b)}en(){uc(this)?this.N.warn('Logout called for Guest user so it will be ignored'):(this.N.debug('Sending logout'),oc(this.storage),this.F.ja(olympe.D.$a(this.C.Ib()),a=>{a?tc(this,'Logout request rejected:',
|
|
377
|
+
a):this.N.debug('Logout request acknowledged')}))}gi(){pc(this)===olympe.auth.pa.C.Mg&&this.F.gi(a=>{a&&this.N.error('Was not able to send the auth keep alive message:',a.message)})}Hb(a,b){const c=null===this.L?olympe.auth.pa.G.au:this.L;this.L=null;a?(this.N.warn('Authentication rejected: '+a.message+'. Falling back into GUEST state'),oc(this.storage),this.error.update(olympe.D.yb(a.message)),lc(this),vc(this,a,c)):(this.N.info('User '+b.yd()+' (#'+b.Dg()+') successfully authenticated'),this.C.update(b),
|
|
378
|
+
nc(this,olympe.auth.pa.C.Mg),vc(this,a,c),this.storage&&jc(this.storage,b));this.R.has('login')&&this.R.delete('login')}};olympe.auth.pa.C={INIT:'init',Uh:'waking',sh:'awake',hg:'disconnected',yh:'guest',li:'authenticating',ac:'error',Mg:'authenticated'};olympe.auth.pa.G={au:'manual',js:'auto',tk:'tokenOnFirstConnection'};olympe.auth.pa.F={xj:'accepted',fp:'redirect'};olympe.auth.Mi=class{na(){}Yc(){}};function wc(a){return a.get('idpName')}olympe.auth.Request=class{constructor(){this.C=new Map}set(a,b){olympe.D.yc([b],c=>{this.C.set(a.toLocaleLowerCase(),c.toString())})}get(a){(a=this.C.get(a.toLowerCase()))&&a.zf&&(a=a.Pa.Kb);return a?a.valueOf():a}yd(){return this.get('username')}sn(a){this.set('password',a);return this}Ve(){return this.get('nonce')}toString(){return this.yd()+(this.Ve()?' with nonce':'')+(this.get('password')?' with password':'')+(wc(this)?` with idp name ${wc(this)}`:'')}};olympe.auth.vf=class{constructor(a,b,c,d={}){this.user=a;this.wj=b;this.G=c;this.C=null;this.L=d}yd(){return this.user}Dg(){return this.wj}Ve(){return this.G}Vj(){return this.L}ci(){return null}Ch(){return this.C}la(){var a=olympe.X.bi(),b=Object.assign({},{user:this.user,userTag:this.wj,nonce:this.G},this.C&&{idpName:this.C},{payload:this.L}),c=olympe.X,d=c.rr;b=JSON.stringify(b);a=a.C(Da(b));return d.call(c,a)}};m=olympe.auth.vf.prototype;m.yd.K=new olympe.D.J(()=>String,[]);
|
|
379
|
+
m.Dg.K=new olympe.D.J(()=>String,[]);m.Ve.K=new olympe.D.J(()=>String,[]);m.Vj.K=new olympe.D.J(()=>Object,[]);m.ci.K=new olympe.D.J(()=>String,[]);m.Ch.K=new olympe.D.J(()=>String,[]);m.la.K=new olympe.D.J(()=>String,[]);olympe.auth.Vl=class extends olympe.auth.vf{constructor(a,b,c,d){super(a,b,c,d)}ci(){return this.Vj().access_token||null}};olympe.auth.zq=class extends olympe.auth.vf{constructor(a,b,c,d){super(a,b,c,d);this.F=null}ci(){return this.F}la(){var a=olympe.X.bi(),b=Object.assign({},{user:this.yd(),userTag:this.Dg(),nonce:this.Ve()},this.Ch()&&{idpName:this.Ch()},{payload:this.Vj(),fullToken:this.F}),c=olympe.X,d=c.rr;b=JSON.stringify(b);a=a.C(Da(b));return d.call(c,a)}};function jc(a,b,c){const d=a.C.C('AUTH');d.set(a.key,'string'===typeof b?b:b.la(),e=>{d.close();c&&c(e)})}function oc(a){const b=a.C.C('AUTH');b.remove(a.key,()=>b.close())}
|
|
380
|
+
olympe.auth.pm=class{constructor(a,b,c){this.C=a;this.N=b;this.key='OlympeToken-'+c.C}Yc(a){const b=this.C.C('AUTH');this.N.debug(`olympe.auth.TokenStorage: retrieve token with key ${this.key}`);b.get(this.key,c=>{let d=null;if(c)try{this.N.debug('olympe.auth.TokenStorage: Token retrieved successfully');var e=JSON,f=e.parse;var g=Ea(olympe.X.bi().R(olympe.X.Ev(c)));const h=f.call(e,g);let k;h.fullToken?(k=new olympe.auth.zq(h.user,h.userTag,h.nonce,h.payload),k.F=h.fullToken):h.payload&&h.payload.id_token?
|
|
381
|
+
k=new olympe.auth.Vl(h.user,h.userTag,h.nonce,h.payload):k=new olympe.auth.vf(h.user,h.userTag,h.nonce,h.payload);h.idpName&&(k.C=h.idpName);d=k}catch(h){this.N.error('Error while unserializing token: ',h.message)}else this.N.debug('olympe.auth.TokenStorage: No token found');b.close();a(d)})}};olympe.auth.pm.F='OlympeToken';olympe.auth.pm.C='AUTH';olympe.auth.lk=class{redirect(){}F(){}C(){}};olympe.auth.lk.C={GET:'GET',Xl:'POST'};olympe.auth.cl=class{constructor(a){this.C=a||'default'}};olympe.auth.Jb={};olympe.auth.Jb.qa={};olympe.auth.Jb.qa.Hi=class{da(){}};olympe.auth.Jb.qa.Ne=class{ta(){}};olympe.auth.Jb.qa.Fe=class{Ka(){}Wa(){}};function xc(a,b){return olympe.X.pb(b+'-olympe-'+a.C[b])}olympe.auth.Jb.Gi=class{constructor(a){this.C=a}na(){return'local'}Yc(a,b){const c=a.yd();if(c){const d=a.get('password'),e=a.Ve();a.C.delete('password');if(void 0!==e&&xc(this,c)===e){b(null,new olympe.auth.vf(c,'',xc(this,c)));return}a=olympe.X.pb(d||'');if(this.C[c]===a){b(null,new olympe.auth.vf(c,'',xc(this,c)));return}}b(Error('Invalid login'))}};olympe.auth.Jb.Gi.C='local';olympe.auth.Jb.Gi.ma=[olympe.auth.Mi];olympe.auth.Jb.Hi=class{constructor(a,b){this.C=a;this.storage=b}na(){return'localToken'}Yc(a,b){this.storage.Yc(c=>{this.C.da(a,(d,e)=>{c&&e&&c.Ch()&&(e.C=c.Ch());b(d,e||c)})})}};olympe.auth.Jb.Hi.C='localToken';olympe.auth.Jb.Hi.ma=[olympe.auth.Mi];olympe.auth.Jb.Ul=class{constructor(a,b){this.C=a;this.F=b}na(){return'openID'}Yc(a){const b=encodeURIComponent(this.C.C());a=wc(a)?`idpName=${wc(a)}&`:'';this.C.redirect(`${this.F}/auth?${a}url=${b}`,null,olympe.auth.lk.C.GET)}};olympe.auth.Jb.Ul.C='openID';olympe.auth.Jb.Ul.ma=[olympe.auth.Mi];olympe.auth.Jb.Ne=class{constructor(a,b){this.F=a;this.C=b}na(){return'saml'}Yc(a,b){this.F.ta(a,c=>{c?b(c):this.C.F(wc(a))})}};olympe.auth.Jb.Ne.C='saml';olympe.auth.Jb.Ne.ma=[olympe.auth.Mi];olympe.auth.Jb.Fe=class{static bj(a,b){const c=new SRPClient,d=c.generateRandomSalt();return{username:a,login:a,salt:d,verifier:c.generateVerifier(d,a,b)}}constructor(a){this.C=a;this.N=olympe.ra.Ya('auth')}na(){return'srp'}Yc(a,b){const c=a.get('password');a.C.delete('password');this.N.debug('Sending SRP request');this.C.Ka(a,(d,e,f)=>{this.N.debug('Received Salt+B message');if(d)b(d);else{try{const g=new SRPClient;g.step1(a.yd(),c);const h=g.step2(e,f);a.set('a',h.A);a.set('m1',h.M1)}catch(g){b(g);
|
|
382
|
+
return}this.N.debug('Sending SRP A+M (proof) message');this.C.Wa(a,b)}})}};olympe.auth.Jb.Fe.C='srp';olympe.auth.Jb.Fe.ma=[olympe.auth.Mi];olympe.auth.P={Aa:'auth.Manager',Ea:'auth.Logger',Pi:'auth.Storage',yj:'auth.appNameToken',hk:'auth.Redirector'};olympe.auth.qd={Aa:'auth.ManagerConnector',Ap:'auth.LocalTokenConnector',Fe:'auth.SRPConnector',Ne:'auth.SAMLConnector'};olympe.auth.Config={nl:'auth.defaultProvider',Bp:'auth.localTokenProvider',Bn:'auth.autoLogin',Fn:'auth.autoUser',Cn:'auth.autoPassword',tk:'auth.token',zn:'auth.appToken'};
|
|
383
|
+
olympe.U.config(function(a){D(a,olympe.auth.Config.nl,'srp');D(a,olympe.auth.Config.Bp,'localToken');D(a,olympe.auth.Config.Bn,!1);D(a,olympe.auth.Config.Fn,'');D(a,olympe.auth.Config.Cn,'');D(a,olympe.auth.Config.tk,'');D(a,olympe.auth.Config.zn,'default');C(a,olympe.auth.P.Ea,[olympe.ra.P.Aa],b=>b.Nc('auth'));A(a,olympe.auth.P.yj,olympe.auth.cl,new olympe.U.fa(olympe.auth.Config.zn));A(a,olympe.auth.P.Pi,olympe.auth.pm,olympe.hc.P.Xj,olympe.auth.P.Ea,olympe.auth.P.yj);ta(a,olympe.auth.qd.Aa);ta(a,
|
|
384
|
+
olympe.auth.P.hk);C(a,olympe.auth.P.Aa,[olympe.auth.P.Ea,olympe.auth.qd.Aa,olympe.host.P.xl,new olympe.U.tb(olympe.auth.P.Pi,olympe.U.gf.C.Fh),new olympe.U.fa(olympe.auth.Config.nl),new olympe.U.fa(olympe.auth.Config.Bp),new olympe.U.fa(olympe.auth.Config.Bn),new olympe.U.fa(olympe.auth.Config.Fn),new olympe.U.fa(olympe.auth.Config.Cn),new olympe.U.fa(olympe.auth.Config.tk),new olympe.U.tb(olympe.auth.P.hk,olympe.U.gf.C.Fh),new olympe.U.tb(olympe.auth.qd.Ap,olympe.U.gf.C.Fh),new olympe.U.tb(olympe.auth.qd.Fe,
|
|
385
|
+
olympe.U.gf.C.Fh),new olympe.U.tb(olympe.auth.qd.Ne,olympe.U.gf.C.Fh)],(b,c,d,e,f,g,h,k,l,n,p,q,r,t)=>{const u=[];q&&u.push(new olympe.auth.Jb.Hi(q,e));r&&u.push(new olympe.auth.Jb.Fe(r));t&&p&&u.push(new olympe.auth.Jb.Ne(t,p));p&&c&&u.push(new olympe.auth.Jb.Ul(p,c.Jr()));if(0===u.length)throw Error('At least one provider is needed for auth to start');if(!u.map(v=>v.na()).includes(f))throw Error('Default provider name'+f+'given by parameter'+olympe.auth.Config.nl+'cannot be found');return new olympe.auth.pa(b,
|
|
386
|
+
c,e,p,d.lj()?d:null,u,f,g,h,k,l,n)},!0)},'olympe.auth');olympe.U.run([olympe.auth.P.Aa],a=>{olympe.auth.Pc=()=>a});olympe.dc={};olympe.dc.Ca={ORIGIN:'<',DESTINATION:'>'};z('olympe.dc.Direction',olympe.dc.Ca);olympe.dc.jc={Tc:'ff022000000000000000',wi:'ff02200000000000000e',Xn:'ff02200000000000000f'};olympe.dc.Yb={VERSION:'@v',Gd:'@s'};olympe.dc.Tg={ic:'?'};olympe.dc.qk={Up:'online',Gh:'offline',pt:'invalidate'};olympe.dc.Ha={sb:'self',Lc:'server',$p:'peer',ic:'server'};olympe.dc.za=function(a){if('string'===typeof a)return a;let b=null;a=olympe.D.$a(a);void 0!==a&&null!==a&&(a=a.valueOf(),'string'===typeof a?b=a:a.T?b=a.T():'function'===typeof a&&(b=olympe.dc.ya.Nb(a)));return b||''};z('olympe.dc.instanceToTag',olympe.dc.za);olympe.dc.Ja=function(){return olympe.dc.xd().view};olympe.dc.register=function(a,b){olympe.dc.ya.C(a,b)};olympe.dc.defineProperty=function(a){return new olympe.dc.ua.Property(a)};
|
|
387
|
+
olympe.dc.gh=function(a,b=olympe.dc.Ca.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.Ca.DESTINATION){const e=olympe.dc.Ca.DESTINATION;return b===olympe.dc.Ca.ORIGIN||b===e?new olympe.dc.ua.Relation(a,b):new olympe.dc.ua.Relation(a,d,b,c)};olympe.dc.Qv=function(a){return a.Ec()};olympe.dc.Writable=class{F(){}qc(){}Dc(){}Va(){}cc(){}};olympe.dc.Zl=class{Mc(){}Z(){}G(){}};function yc(a,b,c,d,e,f,g){d=new olympe.dc.ha(olympe.dc.ha.ia.Rh,{file:b,url:null,content:c,Ye:e?h=>{zc(a,b,c);f(h)}:f,mimeType:d,se:g||null},[olympe.dc.Ja().source(b)||olympe.dc.Ha.Lc]);a.F.send(d)}function Ac(a,b,c,d,e,f){c=c instanceof olympe.D.Za?c.valueOf():c;'string'===typeof c?c=new Blob([Da(c)],{type:d}):c instanceof ArrayBuffer&&(c=new Blob([c],{type:d}));yc(a,b,c,d,a.G,e,f)}
|
|
388
|
+
function zc(a,b,c){const d=olympe.dc.za(b);a.C.set(d,c);const e=olympe.X.yg();Bc(olympe.dc.Ja(),d,f=>{f||(a.C.delete(d),Cc(olympe.dc.Ja(),d,e))},e)}function Dc(a,b,c,d){olympe.D.Vr([b.Qr(),b.T(),b.Gl(),b.Wm()],(e,f,g,h)=>{a.C.has(f)?c(a.C.get(f)):(e=new olympe.dc.ha(olympe.dc.ha.ia.vh,{file:f,url:e.valueOf()?null:g,mimeType:h.valueOf(),Ye:a.G?k=>{zc(a,f,k);c(k)}:c,se:d},[olympe.dc.Ja().source(f)||olympe.dc.Ha.Lc]),a.F.send(e))})}
|
|
389
|
+
olympe.dc.bt=class{constructor(a,b,c,d,e){this.N=a;this.F=c;this.G=e;this.C=new Map}};olympe.dc.pa=class{constructor(a){this.N=a}};function Ec(a,b){a.F=b;return a}function M(a,b){a.Xh.unshift(b);return a}olympe.dc.ha=class{constructor(a,b,c){this.type=a;this.content=b;this.C=c;this.Xh=[];this.F=olympe.D.La()}validate(a=null){this.Xh.forEach(b=>{b(a||null)})}toString(){const a=olympe.X.Hr(olympe.dc.ha.ia,this.type);return a?a:'UNKNOWN_MESSAGE'}};
|
|
390
|
+
olympe.dc.ha.ia={ac:1,lg:2,Rg:10,iA:11,Ru:20,rB:21,sB:22,Tu:23,zi:24,yi:25,jA:26,Qo:28,bm:30,em:31,zu:32,dh:40,uk:41,uh:45,Cj:46,Mj:47,Rh:50,vh:51,vi:52,hv:60,Eu:61,dt:62,et:63,xs:64,gl:65,hA:90,ml:91,wl:92,Ro:93,wp:94,ak:95,Su:96,QUERY_RESULT:97,cm:98};olympe.dc.og=class{process(){}};olympe.dc.$l=class{constructor(...a){this.Ub=a}process(a,b,c){const d=this.Ub.length,e=(f,g,h)=>{g||f>=d?c(g,h):this.Ub[f].process(a,h,e.bind(null,f+1))};e(0,null,b)}};olympe.dc.$l.ma=[olympe.dc.og];function Fc(a){return olympe.dc.CloudObject.get(a.tag)}olympe.dc.Cc=class{constructor(a){this.tag='string'===typeof a?a:a.T()}T(){return this.tag}toJSON(){return'{ "type": "reference", "tag": '+JSON.stringify(this.tag)+' }'}nb(a){return a instanceof olympe.dc.Cc&&this.tag===a.tag}static lc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.dc.Cc(b.tag)}};olympe.dc.Cc.ma=[olympe.dc.Ae];olympe.dc.Cc.prototype.toJSON.K=olympe.D.J.C;olympe.dc.Cc.prototype.nb.K=olympe.D.J.C;olympe.dc.pg=class{send(){}C(){}ja(){}};const Gc=olympe.dc.Ca.ORIGIN,Hc=olympe.dc.Ca.DESTINATION,Ic=new Map,Jc=new Map,Kc=new Map,Lc=new Map;function Mc(a,b){var c=olympe.dm.File;let d=c;'function'===typeof c&&(d=b.entry);c=[...(d.un||[])];return olympe.dc.ya.C(a,b,...c)}function Nc(a,b){Lc.set(a,b);return a}function Oc(a){return(a=Ic.get(a))&&a.C||olympe.dc.CloudObject}function Pc(a,b,c){const d=a+'@'+(b===Hc?Gc:Hc);if(Jc.has(d))throw Error(`Try to register the same relation (${b+a}) multiple times.`);Jc.set(d,c)}
|
|
391
|
+
function Qc(a){a=a.T()+'@'+a.Ra();return Jc.get(a)||olympe.dc.CloudObject}function N(a,b){b.NAME=a;Kc.set(a,b)}function O(a){return a.NAME||null}
|
|
392
|
+
olympe.dc.ya=class{constructor(){}static C(a,b,...c){if(Ic.has(a))throw Error(`Tag: ${a} - overwriting already defined sync ${Ic.get(a).C.name} with ${b.name}`);let d=null;const e=c.length;if(0<e){d=Array(e);for(let f=0;f<e;f++){let g=c[f];d[f]='string'===typeof g?new olympe.U.tb(g):g}}b=new olympe.dc.ua.Entry(a,b,d);Ic.set(a,b);return b.C.entry=b}static Nb(a){return(a=a.entry)&&a.T()||null}};olympe.dc.ua={};function P(a,b){b=b.Ec();Pc(b.T(),b.Ra(),a.C);return b}function Rc(a){a.F=!0;return a}
|
|
393
|
+
olympe.dc.ua.Entry=class{constructor(a,b,c){this.tag=a;this.C=b;this.un=c||null;this.F=!1}T(){return this.tag}instantiate(a,b){const c=this.C;if(this.jj()&&b.getParameter(olympe.dc.Config.xo)){var d=olympe.dc.Ja();d=`Trying to instantiate an abstract class ${d.name(this)} (${this.T()}).`+` This may happen when the implementation of another class extending ${d.name(this)} has not been registered`;olympe.ra.Ya('dc').error(d)}return this.un?(a=[void 0,a].concat(na(b,this.un)),new c(...a)):new c(void 0,
|
|
394
|
+
a)}xa(a){return new olympe.dc.ua.Property(a)}Ga(a,b=olympe.dc.Ca.DESTINATION){Pc(a,b,this.C);return new olympe.dc.Y.Sb(a,b)}jj(){return this.F}};z('olympe.dc.registry.Entry',olympe.dc.ua.Entry);olympe.dc.ua.Entry.prototype.addRelation=olympe.dc.ua.Entry.prototype.Ga;olympe.dc.ua.Entry.prototype.addProperty=olympe.dc.ua.Entry.prototype.xa;olympe.dc.ua.Entry.ma=[olympe.dc.Ae];olympe.dc.ua.Property=class{constructor(a){this.tag=a}T(){return this.tag}};olympe.dc.ua.Property.prototype.getTag=olympe.dc.ua.Property.prototype.T;olympe.dc.ua.Property.ma=[olympe.dc.Ae];olympe.dc.ua.Relation=class{constructor(a,b=olympe.dc.Ca.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.CloudObject){this.tag=olympe.dc.za(a);this.direction=b;this.origin=c;this.destination=d}T(){return this.tag}Ra(){return this.direction}type(){return this.destination}Ec(){return new olympe.dc.ua.Relation(this.tag,this.direction===olympe.dc.Ca.DESTINATION?olympe.dc.Ca.ORIGIN:olympe.dc.Ca.DESTINATION,this.destination,this.origin)}nb(a){return a instanceof olympe.dc.ua.Relation?a.T()===this.T()&&
|
|
395
|
+
a.Ra()===this.Ra():!1}toString(){return this.direction+this.tag}};olympe.dc.ua.Relation.prototype.getInverse=olympe.dc.ua.Relation.prototype.Ec;olympe.dc.ua.Relation.prototype.getDirection=olympe.dc.ua.Relation.prototype.Ra;olympe.dc.ua.Relation.prototype.getTag=olympe.dc.ua.Relation.prototype.T;olympe.dc.ua.Relation.ma=[olympe.dc.Ae];olympe.dc.db={};function Sc(a,b,c,d,e,f=olympe.dc.Ha.sb){const g=c.Z();Tc(a.C,b,c,d,e,f);return h=>{if(h)a.C.push(g);else{h=a.C;const k=h.F.get(g);if(void 0!==k){const l=h.C.indexOf(g);h.C.splice(l,1);Uc(h,Vc(h,k.C,h.C.length),k.source);h.F.delete(g)}}}}function Wc(a,b){a.Na.Ka(b)}function Xc(a,b,c){b&&a.Na.bc(b);c&&a.Na.zc(c)}
|
|
396
|
+
olympe.dc.db.Ps=class{constructor(a,b,c,d,e){this.N=a;this.Na=b;this.C=new olympe.dc.db.Ds(a,b,d);this.view=new olympe.dc.hb(a,b);this.Nx=new olympe.dc.db.gu(this.N,this.view,b,e)}Ya(){return this.N}persist(a){this.Na.ta();this.Na.jb(a,olympe.dc.db.Instance.C.cq);this.Na.ja()}$e(a,b){this.C.$e(a,b)}};const Yc=olympe.dc.Yb.VERSION,Zc=olympe.dc.Yb.Gd,$c=olympe.dc.jc.Tc,ad=olympe.dc.jc.wi;
|
|
397
|
+
olympe.dc.db.Database=class a extends Map{constructor(b,c){super();this.id=olympe.X.ec();this.N=b;this.Ab=olympe.D.La();this.od=c.get('defaultSource')||olympe.dc.Ha.sb;this.R=olympe.dc.db.Database.G.IDLE;this.da=new Map;this.Hb=[];this.G=[];this.Sa=new Map;b=c.get('garbageCollector')||olympe.dc.db.Ai.C.pl;new olympe.dc.db.Ai(this,b,this.Ab);c.get('debug')&&this.be()}Z(){return this.id}getState(){return this.R}Ya(){return this.N}create(b,c){const d=this.L(b,!0);d.bc(c&&parseInt(c.get(Yc),10)||1);d.ji(c&&
|
|
398
|
+
c.get(Zc)||this.od);c&&(c.delete(Yc),c.delete(Zc),this.Xc(d,c));this.C(a.F.np,b)}update(b,c,d=!1){if(void 0!==c&&null!==c){b=this.L(b,!0);var e=c&&parseInt(c.get(Yc),10);0>e||!d&&b.version()>=e||(c.delete(Yc),b.bc(isNaN(e)?b.version()+1:e),this.Xc(b,c))}}Dc(b){const c=this.get(b);void 0!==c&&(this.Wa(c,!1),this.C(a.F.op,b))}link(b,c,d){c=this.L(c,!0);d=this.L(d,!0);switch(b){case $c:c.Kd(d);break;case ad:c.$d(d);break;default:c.link(b,d)}}unlink(b,c,d){c=this.get(c);d=this.get(d);if(void 0!==c&&void 0!==
|
|
399
|
+
d)switch(b){case $c:c.Ok(d);break;case ad:c.mj(d);break;default:c.unlink(b,d)}}bc(b){for(const c of b)this.L(c).da()}zc(b){for(const c of b)(b=this.get(c))&&b.ja()}jb(b,c){b.forEach(d=>{this.L(d).We(c)})}Vb(b){const c=this.get(b);void 0!==c&&(c.clear(),super.delete(b),this.C(a.F.wo,b))}L(b,c=!1){let d=this.get(b);void 0===d&&(d=new olympe.dc.db.Instance(b,this),this.set(b,d),this.C(a.F.vo,b),c&&this.C(a.F.wk,b));return d}W(b,c,d=!1,e=null){return{[Symbol.iterator]:function*(f){const g=olympe.dm.Relation.C.vk,
|
|
400
|
+
h=olympe.dm.Relation.C.jk,k=olympe.dc.Ca.ORIGIN,l=olympe.dc.Ca.DESTINATION,n=a.C.Kh+c,p=d?h:g,q=d?g:h,r=(new Map).set(f,!1),t=(v,w)=>(v=this.get(v))&&0!==(v.get(n)&w),u=([v,w])=>!r.has(v)&&(e?e(w):!0);for(const v of r.keys())r.get(v)||(r.set(v,!0),yield v),f=this.get(v),void 0!==f&&f.forEach((w,y)=>{(y[0]===k&&t(y.substring(1),q)||y[0]===l&&t(y.substring(1),p))&&Array.from(w.entries()).filter(u).forEach(([B])=>{r.set(B,!1)})})}.bind(this,b)}}Hc(b){bd(this.G[0],olympe.X.yg(),b)}$(b){if(0===this.G.length)debugger;
|
|
401
|
+
this.G[0].C.delete(b)}C(b,c,...d){this.da.has(b)&&this.da.get(b).forEach(e=>{e(c,...d)})}Wa(b,c){this.Sa.set(b,c)}$d(b,c,d,e){0<this.G.length&&cd(this.G[0],b).xa(e?dd+c:c,d)}Kd(b,c,d,e,f){if(0<this.G.length){var g=this.G[0];d===ed?f?cd(g,b).link(c,e):cd(g,b).unlink(c,e):f?cd(g,b).Sa(c,e):cd(g,b).jb(c,e)}}F(b,c){let d=this.da.get(b);void 0===d&&(d=[],this.da.set(b,d));d.push(c)}Ka(b){this.Hb.push(b)}vd(b){return this.G.reduce((c,d)=>d.G.has(b)||c,!1)}ta(){this.R===a.G.IDLE&&(this.R=a.G.qs);this.G.unshift(new olympe.dc.db.Us(this,
|
|
402
|
+
this.Ab))}ja(){this.R=a.G.cg;this.fe();fd(this.G[0]);this.G.shift();0===this.G.length&&(this.R=a.G.IDLE,this.Hb.forEach(b=>{b()}))}Xc(b,c){const d=a.C.ic;for(const [e,f]of c)void 0!==f&&(e[0]===d?b.Qk(e.substr(1),f):b.update(e,f))}fe(){const b=a.C.ORIGIN,c=new Set,d=(f,g=[])=>{const h=f.tag();if(!c.has(h)&&(c.add(h),g.push(f),f=f.get(b+$c)))for(const k of f.values())d(k,g);return g},e=this.G[0];for(const [f,g]of this.Sa)d(f).filter(h=>h.vd(g)).forEach(h=>{h=h.tag();g?cd(e,h).create():cd(e,h).delete()});
|
|
403
|
+
this.Sa.clear()}be(){const b=a.C.DESTINATION,c=a.F.sl,d=a.F.ik,e=new Set,f=new Map;this.F(a.F.np,g=>{e.add(g)});this.F(c,g=>{e.delete(g);f.delete(g)});this.F(d,(g,...h)=>{if(h[0]===ad&&h[1]===b){const k=h[2];this.get(k).Db()||(h=f.get(k)||new Set,0===h.size&&f.set(k,h),h.add(g))}});this.Ka(()=>{e.forEach(g=>{const h=this.get(g);h&&null===h.model()&&this.N.error(`\n[DEBUG - DATABASE]\nInstance ${g} created but does not exist !\n${h.toString()}`)});e.clear();f.forEach((g,h)=>{const k=this.get(h);k&&
|
|
404
|
+
this.N.error(`\n[DEBUG - DATABASE]\nThe model ${h} is extended by other models but does not exist !`+`\nExtension models: ${Array.from(g.values()).join(', ')}`+`\n\n ${k.toString()}`)});f.clear()})}};olympe.dc.db.Database.C={Kh:'$',mt:'~',ic:'?',al:'=',Tn:'@',ORIGIN:olympe.dc.Ca.ORIGIN,DESTINATION:olympe.dc.Ca.DESTINATION};olympe.dc.db.Database.F={vo:0,wo:1,Xq:2,wk:3,Un:4,Vn:5,sl:6,Ac:7,ik:8,gm:9,np:10,op:11,pq:12};olympe.dc.db.Database.G={IDLE:0,qs:1,cg:2};const Q=olympe.dc.db.Database.F,gd=olympe.dc.db.Database.C.Kh,hd=olympe.dc.db.Database.C.mt,id=olympe.dc.db.Database.C.ic,jd=olympe.dc.db.Database.C.al,kd=olympe.dc.db.Database.C.Tn,R=olympe.dc.Ca.ORIGIN,T=olympe.dc.Ca.DESTINATION,ld=olympe.dc.jc.Tc,md=olympe.dc.jc.wi;
|
|
405
|
+
olympe.dc.db.Instance=class a extends Map{constructor(b,c){super();this.C=b;this.Xc=olympe.dc.Ha.sb;this.e=!1;this.Hb=0;this.F=void 0;this.c=0;this.Ka=a.C.cq;this.db=c}tag(){return this.C}Db(){return this.e}Vb(){return this.db.vd(this.C)}source(){return this.Xc}version(){return this.Hb}model(){const b=this.get(T+ld);return b&&b.values().next().value||null}Df(){const b=this.get(T+md);return b&&b.values().next().value||null}persisted(){return this.Ka!==a.C.fr}toString(){var b=this.cb(olympe.dc.CloudObject.nameProp.T());
|
|
406
|
+
b=`Instance: ${this.C}, Exist: ${this.e}, Name: ${b}`;var c=this.model();if(c){var d=c.cb(olympe.dc.CloudObject.nameProp.T())||'No model name';b+=`\nModel: ${c.C}, Exist: ${c.e}, Model name: ${d}`}else b+='\nModel: no model';(c=this.Df())?(d=c.cb(olympe.dc.CloudObject.nameProp.T())||'No extension name',b+=`\nExtension: ${c.C}, Exist: ${c.e}, Extension name: ${d}`):b+='\nExtension: no extension';return b}cb(b,c=!1){const d=this.get(gd+b);return c||void 0!==d?d:this.get(jd+b)}Wa(b,c=!1){const d=this.get(id+
|
|
407
|
+
b);return c||void 0!==d?d:this.get(hd+b)}update(b,c){const d=gd+b;var e=this.get(d),f=e=void 0===e?null:e;(null!==f&&'function'===typeof f.nb?f.nb(c):f===c)||(e instanceof olympe.dc.Cc&&(this.db.get(e.T()).zc(),this.db.Dc(e.T())),c instanceof olympe.dc.Cc&&(e=this.db.L(c.T(),!0),e.F&&e.F.tag!==this.C&&this.db.Ya().fatal('Instance',c.T(),'referenced multiple times!\nThis instance is currently property of',e.F.tag,'(for the property '+e.F.lb+')','and is assigned as a property of',this.C,'(for the property '+
|
|
408
|
+
b+')'),e.ph(this.C,b)),e=jd+b,null===c?(this.delete(d),c=(c=this.model())&&c.Wa(b),void 0!==c?(this.set(e,c),this.L(b,c,!0)):this.L(b,null,!1)):(this.set(d,c),this.delete(e),this.L(b,c,!1)))}Qk(b,c){const d=id+b;var e=this.get(d);(void 0===e?null:e)!==c&&(e=hd+b,null===c?(this.delete(d),c=(c=this.Df())&&c.Wa(b),c=void 0===c?null:c,null!==c&&this.set(e,c),this.W((new Map).set(b,c))):(void 0!==this.get(e)&&this.delete(e),this.set(d,c),this.W((new Map).set(b,c))))}link(b,c){var d=R+b;const e=this.Ab(T+
|
|
409
|
+
b);d=c.Ab(d);e.has(c.C)||(e.set(c.C,c),d.set(this.C,this),this.db.C(Q.ik,this.C,b,T,c.C),this.db.C(Q.ik,c.C,b,R,this.C),this.e&&c.e&&(this.G(b,T,c,!0),c.G(b,R,this,!0)))}unlink(b,c){const d=R+b;void 0!==this.jb(T+b,c.C)&&(c.jb(d,this.C),this.db.C(Q.gm,this.C,b,T,c.C),this.db.C(Q.gm,c.C,b,R,this.C),this.e&&c.e&&(this.G(b,T,c,!1),c.G(b,R,this,!1)))}Kd(b){const c=this.model();if(null!==c){if(c===b)return;this.unlink(ld,c)}this.link(ld,b);b.forEach((d,e)=>{if(e[0]===id||e[0]===hd)e=e.substring(1),this.Sa(e,
|
|
410
|
+
d)});(b.e||b===this)&&this.db.Wa(this,!0)}Ok(b){this.unlink(ld,b);this.forEach((c,d)=>{c=d.substring(1);this.Sa(c,null)});this.db.Wa(this,!1)}$d(b){const c=this.Df();if(null!==c){if(c===b)return;this.unlink(md,c)}this.link(md,b);const d=new Map;b.forEach((e,f)=>{if(f[0]===id||f[0]===hd)f=f.substring(1),this.has(id+f)||(this.set(hd+f,e),d.set(f,e))});this.W(d)}mj(b){this.unlink(md,b);const c=new Map;this.forEach((d,e)=>{e[0]===hd&&(this.delete(e),d=e.substring(1),c.set(d,null))});this.W(c)}Hc(b,c,
|
|
411
|
+
d){const e=(...f)=>{var g=f.length;const h=f[g-2];(g=this.db.get(f[g-1]))&&(h?g.da():g.ja());d(...f)};this.$(b,c,e);return e}$(b,c,d){const e=this.Ab(kd+b);e.has(c)||(e.set(c,d),this.da(),this.db.C(Q.Un,this.C,b,c))}R(b,c){const d=this.jb(kd+b,c);void 0!==d&&(this.ja(),this.db.C(Q.Vn,this.C,b,c));return d}ji(b){this.Xc=b}bc(b){this.Hb=b}We(b){this.Ka=b;this.ta()||this.db.C(Q.wk,this.C)}vd(b){const c=this.e!==b;c&&(b?(this.e=b,this.fe()):(this.be(),this.e=b),this.od(b));return c}da(){this.c++;1===
|
|
412
|
+
this.c&&this.db.C(Q.Xq,this.C)}ja(){0<this.c?--this.c:this.db.C(Q.pq,this.C,`Try to decrease references on instance ${this.C} but the reference counter is already 0.\n`+'It happens when you try to remove a callback from an instance multiple times.\nThis counter reference is used for garbage collection of instances in the database.');0===this.c&&this.db.C(Q.wk,this.C)}ta(){return 0<this.c||this.Ka===olympe.dc.db.Instance.C.eq}clear(){this.forEach((b,c)=>{const d=c[0];if(d===R||d===T){const e=c.substring(1),
|
|
413
|
+
f=d===R?T:R;b.forEach(g=>{const h=g.get(f+e);h.delete(this.C);0===h.size&&g.delete(f+e)})}d===gd&&b instanceof olympe.dc.Cc&&this.db.get(b.T()).zc()});void 0!==this.F&&this.db.get(this.F.tag).delete(gd+this.F.lb)}ph(b,c){void 0===this.F&&this.da();this.F={tag:b,lb:c}}zc(){void 0!==this.F&&(this.ja(),this.F=void 0)}fe(){this.forEach((b,c)=>{const d=c[0];if(d===R||d===T){const e=c.substring(1),f=d===R?T:R;b.forEach(g=>{g.e&&(this.G(e,d,g,!0),g.G(e,f,this,!0))})}else if(d===gd||d===jd)c=c.substring(1),
|
|
414
|
+
this.L(c,b,d===jd)})}be(){this.forEach((b,c)=>{const d=c[0];if(d!==kd){var e=c.substring(1);d===R?b.forEach(f=>{f.unlink(e,this)}):d===T?b.forEach(f=>{this.unlink(e,f)}):d===gd&&this.update(e,null);this.delete(c)}});this.Hb=0;if(void 0!==this.F){const b=this.db.get(this.F.tag),c=b.get(gd+this.F.lb);c&&c.T&&c.T()===this.C&&b.update(this.F.lb,null)}}od(b){this.db.C(b?Q.sl:Q.Ac,this.C)}L(b,c,d){this.e&&this.db.$d(this.C,b,c,d)}G(b,c,d,e){this.db.Kd(this.C,b,c,d.C,e)}W(b,c=[]){var d=this.get(R+ld);void 0!==
|
|
415
|
+
d&&d.forEach(e=>{b.forEach((f,g)=>e.Sa(g,f))});d=this.get(R+md);void 0!==d&&d.forEach((e,f)=>{if(!c.includes(e.tag())){var g=new Map;b.forEach((h,k)=>{e.has(id+k)||(g.set(k,h),null!==h?e.set(hd+k,h):e.delete(hd+k))});e.W(g,[...c,f])}})}Sa(b,c){if(!this.has(gd+b)){const d=jd+b,e=this.get(d);c!==(void 0!==e?e:null)&&(null===c?this.delete(d):this.set(d,c),this.L(b,c,null!==c))}}Ab(b){let c=this.get(b);void 0===c&&(c=new Map,this.set(b,c));return c}jb(b,c){const d=this.get(b);if(void 0!==d){const e=d.get(c);
|
|
416
|
+
d.delete(c);0===d.size&&this.delete(b);return e}}};olympe.dc.db.Instance.C={fr:0,eq:1,cq:2};const ed=olympe.dc.db.Database.C.DESTINATION,dd=olympe.dc.db.Database.C.al,nd=olympe.dc.db.Database.C.Kh,od=olympe.dc.db.Database.C.Tn,pd=olympe.dc.db.Database.C.ORIGIN+ed,qd=nd+nd;function bd(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)}
|
|
417
|
+
function fd(a){const b=a.Na;a.F.forEach((c,d)=>{const e=b.get(d);if(c.re()||c.L()){var f=e.get(od);f&&rd(a,f,c.re(),d);c.L()&&a.G.add(d)}for(const [l,n]of c.dd()){var g=l[0]===dd;d=a;var h=e;f=g?l.substr(1):l;var k=n;const p=h.get(od+nd+f);p&&rd(d,p,k,g);(h=h.get(od+qd))&&rd(d,h,f,k,g)}for(const l of c.Ka())sd(a,e,...l)});a.F.clear();td(a)}function cd(a,b){let c=a.F.get(b);void 0===c&&(c=new olympe.dc.db.jg(b),a.F.set(b,c));return c}
|
|
418
|
+
function rd(a,b,...c){b.forEach((d,e)=>{bd(a,e,d.bind(null,...c))})}function sd(a,b,c,d,e,f){const g=b.get(od+d+c);g&&rd(a,g,f,e);(b=b.get(od+pd))&&rd(a,b,c,d,f,e)}function td(a){a.L.run(()=>{const b=a.C;for(const [d,e]of a.buffer){var c=b.get(d);(c=c&&c[e])&&c()}});a.C.clear();a.buffer.length=0}olympe.dc.db.Us=class{constructor(a,b){this.Na=a;this.L=b;this.F=new Map;this.G=new Set;this.C=new Map;this.buffer=[]}};function ud(a){const b=olympe.dc.db.Database.F.wo,c=olympe.dc.db.Database.F.sl,d=olympe.dc.db.Database.F.Ac,e=olympe.dc.db.Database.F.ik,f=olympe.dc.db.Database.F.gm,g=olympe.dc.db.Database.F.Un,h=olympe.dc.db.Database.F.Vn,k=()=>{};a.Na.F(olympe.dc.db.Database.F.vo,()=>{});a.Na.F(b,()=>{});a.Na.F(c,l=>{a.Na.Hc(()=>{vd(a.view,l,k,`monitorRelations${l}`)})});a.Na.F(d,l=>{a.Na.Hc(()=>{wd(a.view,l,`monitorRelations${l}`)})});a.Na.F(e,()=>{});a.Na.F(f,()=>{});a.Na.F(g,()=>{});a.Na.F(h,()=>{})}
|
|
419
|
+
olympe.dc.db.gu=class{constructor(a,b,c,d){this.N=a;this.view=b;this.Na=c;d&&ud(this)}debug(a){const b=olympe.dc.za(a);if(this.Na.has(b)){var c=this.Na.get(a);a='\n[DEBUG - DATABASE]\n'+c.toString();if(!c.Db()){const d=[];for(;null!==c&&!d.includes(c.tag());)d.push(c.tag()),c=c.model();c=this.Na.get(d[d.length-1]);const e=olympe.dc.db.Database.C.Kh+olympe.dc.CloudObject.nameProp.T();d.push('???');a+='\n\nThe instance <<'+b+'>> does not exists because the instance '+c.tag()+' (name: '+c.get(e)+') has no model.\nList: '+
|
|
420
|
+
d.join(' --M--\x3e ')}this.N.info(a)}else this.N.info('[DATABASE] Instance',b,'has never been created or referred by the database')}};olympe.dc.db.Ai=class a{constructor(b,c,d){this.N=b.Ya();this.Na=b;this.F=new Set;this.mode=c;this.L=d;this.C=!1;c!==a.C.pl&&this.R()}run(){if(!this.C)switch(this.mode){case a.C.hs:this.C=!0;this.L.run(()=>{Jb(()=>{this.G();this.C=!1},0)});break;case a.C.Kq:this.C=!0,this.G(),this.C=!1}}G(){const b=this.Na,c=olympe.dc.Qb.tf,d=this.F,e=h=>b.get(h);var f=h=>!(h.persisted()||h.ta());for(var g of d){const h=b.get(g);if(h&&!h.ta()){if(!h.persisted())continue;Array.from(b.W(g,c,!1,f)).forEach(k=>{d.add(k)});
|
|
421
|
+
b.Vb(g)}d.delete(g)}for(const h of d)f=Array.from(b.W(h,c,!0)).map(e),g=Array.from(b.W(h,c)).map(e),f.some(k=>k.ta())?g.filter(k=>!k.persisted()).forEach(k=>{d.delete(k.tag())}):f.concat(g).filter(k=>!k.persisted()).map(k=>k.tag()).forEach(k=>{d.delete(k);b.Vb(k)});d.clear()}R(){this.Na.Ka(this.run.bind(this));const b=olympe.dc.db.Database.F.Xq,c=olympe.dc.db.Database.F.op,d=olympe.dc.db.Database.F.pq,e=olympe.dc.db.Database.G.IDLE,f=g=>{this.F.add(g);this.Na.getState()===e&&this.run()};this.Na.F(olympe.dc.db.Database.F.wk,
|
|
422
|
+
f.bind(this));this.Na.F(c,f.bind(this));this.Na.F(b,g=>{this.F.delete(g)});this.Na.F(d,(g,...h)=>{this.N.error(h[0])})}};olympe.dc.db.Ai.C={pl:0,Kq:1,hs:2};const xd=olympe.dc.db.Database.C.ORIGIN,yd=olympe.dc.db.Database.C.DESTINATION,zd=olympe.dc.db.Database.C.Kh,Ad=olympe.dc.db.Database.C.al,Bd=xd+yd,Cd=zd+zd,Dd=olympe.dc.db.Database.G;function Bc(a,b,c,d){const e=a.Na.L(olympe.dc.za(b));d=d||Ed(a);e.$('',d,c);e.Db()&&a.G.run(()=>{c(!0,b)});return d}function Cc(a,b,c,d=!1){const e=U(a,b);if(null!==e){const f=e.R('',c);void 0!==f&&(a.Na.getState()===Dd.cg&&a.Na.$(c),!d&&e.Db()&&a.G.run(()=>{f(!1,b)}))}}
|
|
423
|
+
function vd(a,b,c,d){const e=a.Na.L(olympe.dc.za(b));b=d||Ed(a);const f=e.Hc(Bd,b,c);e.Db()&&e.forEach((g,h)=>{g=h[0];g!==xd&&g!==yd||Fd(a,e,h,!0,f,!0)})}function wd(a,b,c){const d=U(a,b);if(null!==d){const e=d.R(Bd,c);void 0!==e&&(a.Na.getState()!==Dd.cg||d.Vb()||a.Na.$(c),d.Db()&&d.forEach((f,g)=>{f=g[0];(f===xd||f===yd)&&e&&Fd(a,d,g,!1,e,!0)}))}}function Ed(a){++a.L;return String(a.L)}
|
|
424
|
+
function Gd(a,b,c,d,e){b=a.Na.L(olympe.dc.za(b));c=olympe.dc.za(c);const f=zd+c;e=e||Ed(a);b.$(f,e,d);if(b.Db()){let g=!1,h=b.get(f);void 0===h&&(g=!0,h=b.get(Ad+c));if(void 0===h)return e;a.G.run(()=>{d(h,g)})}return e}function U(a,b,c=!1){if(null===b||void 0===b)throw Error('Provided tag is null or undefined.');a=a.Na.get(olympe.dc.za(b));return!a||c&&!a.Db()?null:a}
|
|
425
|
+
function Hd(a,b,c){b=a.Na.L(olympe.dc.za(b));const d=Ed(a);b.$(Cd,d,c);b.Db()&&b.forEach((e,f)=>{const g=f[0];g!==zd&&g!==Ad||a.G.run(()=>{c(f.substr(1),e,g===Ad)})});return d}function Id(a,b,c){b=U(a,b);null!==b&&(b.R(Cd,c),a.Na.getState()===Dd.cg&&a.Na.$(c))}function Fd(a,b,c,d,e,f){(b=b.get(c))&&b.forEach((g,h)=>{g.Db()&&(f?a.G.run(()=>{e(c.substr(1),c[0],d,h)}):a.G.run(()=>{e(d,h)}))})}
|
|
426
|
+
function V(a,b,c,d,e){b=a.Na.L(olympe.dc.za(b));c=c.Ra()+c.T();e=e||Ed(a);d=b.Hc(c,e,d);b.Db()&&Fd(a,b,c,!0,d,!1);return e}function Jd(a,b,c){return c===olympe.dc.Qb.NONE?0:a.cb(b,c,!0)||0}function Kd(a,b){return function*(c){if(c)for(const [d,e]of c)if(c=d[0],c===xd||c===yd){const f=d.substring(1);for(const g of e.keys())yield[f,c,g]}}(U(a,b,!0))}
|
|
427
|
+
function Ld(a,b,c){if(!a.Db(b))return a.N.warn(`No instance found with tag ${b}`),new Map;const d=new Map,e=[olympe.dc.za(b)];for(const f of e){const g=a.ub(f,c);d.set(f,g);for(const h of g.filter(k=>!d.has(k)))e.push(h)}a.N.debug(`Found ${d.size} instances in sub-tree rooted at ${olympe.dc.za(b)}`);return d}function Md(a,b,c){return null!==a.Om(c,olympe.dc.CloudObject.extendRel,d=>olympe.dc.Ja().Nk(d,olympe.dc.CloudObject.propertyRel,b))}
|
|
428
|
+
function Nd(a,b,c,d){return(c=(a=U(a,b,!0))&&a.get(d+c))?Array.from(c.values()).filter(e=>e.Db()).length:0}
|
|
429
|
+
olympe.dc.hb=class{constructor(a,b){this.N=a;this.G=new olympe.D.Zb('DB View context');this.Na=b;this.L=0}Z(){return this.Na.Z()}F(a,b,c){a=U(this,a);null!==a&&(b=olympe.dc.za(b),a.R(zd+b,c),this.Na.getState()===Dd.cg&&this.Na.$(c))}C(a,b,c,d=!1){a=U(this,a);if(null!==a){b=b.Ra()+b.T();const e=a.R(b,c);void 0!==e&&(this.Na.getState()!==Dd.cg||a.Vb()&&!d||this.Na.$(c),!d&&a.Db()&&Fd(this,a,b,!1,e,!1))}}Db(a){a=U(this,a);return!(!a||!a.Db())}name(a){let b,c;return null!=(c=null==(b=U(this,a))?void 0:
|
|
430
|
+
b.cb(olympe.dc.CloudObject.nameProp.T()))?c:''}model(a){return(a=(a=U(this,a,!0))?a.model():null)?a.tag():null}Df(a){return(a=(a=U(this,a,!0))&&a.Df())?a.tag():null}kj(a){a=U(this,a,!0);return!(!a||!a.Df())}Rf(a,b){a=(a=U(this,a,!0))&&a.model();return!(!a||!this.Tf(a.tag(),b))}version(a){return(a=U(this,a,!0))&&a.version()}source(a){return(a=U(this,a,!0))&&a.source()}Wf(a){return(a=U(this,a,!1))?!!a.persisted():!0}cb(a,b,c){let d;a=null==(d=U(this,a,!0))?void 0:d.cb(olympe.dc.za(b),c);return void 0!==
|
|
431
|
+
a?a:null}dd(a,b=!1){var c=U(this,a,!0);a=new Map;if(c)for(const [d,e]of c)c=d[0],(c===zd||!b&&c===Ad)&&a.set(d.substring(1),e);return a}ub(a,b){return this.gj(a,[b])}Nk(a,b,c){return this.ub(a,b).includes(olympe.dc.za(c))}gj(a,b){a=U(this,a,!0);if(!a)return[];a=[a.tag()];for(const c of b){b=[];for(const d of a)if(a=U(this,d,!0).get(c.Ra()+c.T()),void 0!==a)for(const e of a.values())e.Db()&&b.push(e.tag());a=b}return a}fc(a,b){var c=U(this,a,!0);return c?(c=c.get(b.Ra()+b.T()))&&1<c.size?(this.N.warn(`Relation ${b.T()} to instance ${a} is not unique: found ${c.size} related items`),
|
|
432
|
+
null):(a=c?c.values().next().value:null)&&a.Db()?a.tag():null:null}Pf(a,b,c){a=olympe.dc.za(a);const d=Ld(this,a,b);d.delete(a);return c?(c=olympe.dc.za(c),d.has(c)?Array.from(Ld(this,c,b.Ec()).keys()).filter(e=>d.has(e)):[]):Array.from(d.keys())}Om(a,b,c){if(!this.Db(a))return null;b=Ld(this,a,b);const d=[olympe.dc.za(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}Pm(a,b,c){return this.gj(a,b).find(c)||null}bw(a,b,c){return this.gj(a,
|
|
433
|
+
b).filter(c)}Hk(a,b=olympe.dc.CloudObject){var c=U(this,a,!0);const d=b&&U(this,b,!0),e=[c];for(;c&&c!==d;){c=c.Df();if(e.includes(c))throw Error(`Cycle detected when following recursively extend relations from base model instance "${a}".`);if(c&&!c.Db())throw a=`Try to get all extensions of the model ${olympe.dc.za(a)} but one of them does not exists (${c.tag()})`,Error(a);null!==c&&e.push(c)}c=U(this,olympe.dc.CloudObject,!0);if(d!==c&&e[e.length-1]===c)throw Error(`The model "${this.name(a)}" (tag = ${a}) does not extend the expected model "${this.name(b)}" (tag = ${b}).`);
|
|
434
|
+
return e.map(f=>f.tag())}Tf(a,b){const c=olympe.dc.za(b);return!!this.Om(a,olympe.dc.CloudObject.extendRel,d=>d===c)}de(a){return this.ub(a,olympe.dc.CloudObject.instancesRel)}};olympe.dc.hb.prototype.getInstances=olympe.dc.hb.prototype.de;olympe.dc.hb.prototype.isExtending=olympe.dc.hb.prototype.Tf;olympe.dc.hb.prototype.getExtendedModels=olympe.dc.hb.prototype.Hk;olympe.dc.hb.prototype.findAllRelated=olympe.dc.hb.prototype.bw;olympe.dc.hb.prototype.findRelated=olympe.dc.hb.prototype.Pm;
|
|
435
|
+
olympe.dc.hb.prototype.findRecursive=olympe.dc.hb.prototype.Om;olympe.dc.hb.prototype.getRecursiveRelated=olympe.dc.hb.prototype.Pf;olympe.dc.hb.prototype.getUniqueRelated=olympe.dc.hb.prototype.fc;olympe.dc.hb.prototype.getMultiRelated=olympe.dc.hb.prototype.gj;olympe.dc.hb.prototype.isRelated=olympe.dc.hb.prototype.Nk;olympe.dc.hb.prototype.getRelated=olympe.dc.hb.prototype.ub;olympe.dc.hb.prototype.getProperties=olympe.dc.hb.prototype.dd;olympe.dc.hb.prototype.getProperty=olympe.dc.hb.prototype.cb;
|
|
436
|
+
olympe.dc.hb.prototype.isPersisted=olympe.dc.hb.prototype.Wf;olympe.dc.hb.prototype.instanceOf=olympe.dc.hb.prototype.Rf;olympe.dc.hb.prototype.isModel=olympe.dc.hb.prototype.kj;olympe.dc.hb.prototype.extension=olympe.dc.hb.prototype.Df;olympe.dc.hb.prototype.model=olympe.dc.hb.prototype.model;olympe.dc.hb.prototype.name=olympe.dc.hb.prototype.name;olympe.dc.hb.prototype.exist=olympe.dc.hb.prototype.Db;function Od(a,b){let c=a.C.get(b);void 0===c&&(c=new olympe.dc.db.jg(b),a.C.set(b,c));return c}function Pd(a,b,c=olympe.dc.Qb.NONE){b=Qd(a,b,c);for(const d of b)Rd(a,d,!1),a.C.delete(d)}
|
|
437
|
+
function Qd(a,b,c,d=!0){const e=olympe.dm.Relation.C.jk,f=olympe.dm.Relation.C.vk,g=olympe.dc.Ca.ORIGIN,h=olympe.dc.Ja();b=new Set([b]);const k=new Set;for(const n of b){var l=a.C.get(n);if(void 0!==l){for(const [p,q,r]of l.ed())r&&Jd(h,p,c)&f?b.add(q):d||r||k.add(`${n}.${p}.${q}`);for(const [p,q,r]of l.Wa())r&&Jd(h,p,c)&e?b.add(q):d||r||k.add(`${q}.${p}.${n}`)}for(const [p,q,r]of Kd(h,n))l=q===g?e:f,!k.has(q===g?`${r}.${p}.${n}`:`${n}.${p}.${r}`)&&Jd(h,p,c)&l&&b.add(r)}return Array.from(b).filter(n=>
|
|
438
|
+
a.C.has(n))}function Rd(a,b,c){const d=olympe.dc.Ca.ORIGIN,e=olympe.dc.Ca.DESTINATION,f=a.C.get(b);for(const [h,k,l]of f.ed())if(l||!c){f.R(h,e,k);var g=a.C.get(k);g&&g.R(h,d,b)}for(const [h,k,l]of f.Wa())if(l||!c)f.R(h,d,k),(g=a.C.get(k))&&g.R(h,e,b)}function*Sd(a,b,c,d,e=[]){e.push(b);b=a.Lf(b);for(const [f,g]of b.ub(c))e.includes(f)||(yield*Sd(a,f,c,d,e),yield d(f,g))}function Td(a,b,c,d){const e=a.C.get(c);a=a.C.get(d);e&&e.R(b,olympe.dc.Ca.DESTINATION,d);a&&a.R(b,olympe.dc.Ca.ORIGIN,c)}
|
|
439
|
+
olympe.dc.db.uc=class{constructor(a){this.id=a||olympe.X.ih();this.C=new Map}toJSON(){let a='{ "id": '+JSON.stringify(this.id)+', "instances": {';for(const b of this.C.keys()){const c=this.C.get(b);a+=JSON.stringify(b)+': '+c.toJSON()+', '}a.endsWith(', ')&&(a=a.substr(0,a.length-2));return a+'}}'}static lc(a){var b;'string'===typeof a?b=JSON.parse(a):b=a;a=new olympe.dc.db.uc(b.id);b=b.instances;for(const c of Object.keys(b)){const d=olympe.dc.db.jg.lc(b[c]);a.C.set(c,d)}return a}Z(){return this.id}Mc(a){const b=
|
|
440
|
+
olympe.dc.db.jg.C.Pl,c=olympe.dc.db.jg.C.Ac,d=olympe.dc.db.jg.C.Qh;this.C.forEach((e,f)=>{const g=e.getState();switch(g.id){case b:a.F(f,e.W()?e.dd():void 0);break;case d:e.W()&&a.qc(f,e.dd(),g.$i);break;case c:a.Dc(f,g.$i)}for(const [h,k,l]of e.ed())l?a.Va(h,f,k):a.cc(h,f,k)})}G(){let a=0;this.C.forEach(b=>{a+=b.Ab()});return a}F(a,b){a=Od(this,a).create();b&&a.ja(b)}qc(a,b,c){b&&(a=Od(this,a).ja(b),c&&a.Hb())}Dc(a,b=olympe.dc.Qb.NONE){const c=this.C.get(a);if(c&&c.re())Pd(this,a,b);else{Od(this,
|
|
441
|
+
a).delete(b);for(const d of Qd(this,a,b,!1))this.C.get(d).dd().clear(),Rd(this,d,!0)}}Va(a,b,c){Od(this,b).link(a,c);Od(this,c).Sa(a,b)}cc(a,b,c){Od(this,b).unlink(a,c);Od(this,c).jb(a,b)}de(){return function*(a){for(const b of a.values())if(b.re()||b.L()||b.W())yield b}(this.C)}Lf(a){return this.C.get(olympe.dc.za(a))||null}ed(){return function*(a){for(var b=a.next();!b.done;){b=b.value;const c=b.tag();yield*b.ed((d,e,f)=>[d,c,e,f]);b=a.next()}}(this.C.values())}Pf(a,b,c=(d,e)=>[d,e]){return Sd(this,
|
|
442
|
+
a,b,c)}};olympe.dc.db.uc.ma=[olympe.dc.Writable,olympe.dc.Zl];const Ud=new Map;
|
|
443
|
+
olympe.dc.db.jg=class a{constructor(b){this.da=b;this.G=a.F(a.C.Qh,!1);this.F=this.Oa=this.C=null}toJSON(){let b='{ "tag": '+JSON.stringify(this.da)+', "state": '+JSON.stringify(this.G);if(this.C){b+=', "properties": {';for(var c of this.C.keys()){const d=this.C.get(c);b+=JSON.stringify(c)+': ';b=d.toJSON?b+d.toJSON():b+JSON.stringify(d);b+=', '}b.endsWith(', ')&&(b=b.substr(0,b.length-2));b+='}'}if(this.Oa){b+=', "relations": {';for(const d of this.Oa.keys()){c=this.Oa.get(d);b+=JSON.stringify(d)+
|
|
444
444
|
': {';for(const e of c.keys())b+=JSON.stringify(e)+': '+JSON.stringify(c.get(e))+', ';b.endsWith(', ')&&(b=b.substr(0,b.length-2));b+='}, '}b.endsWith(', ')&&(b=b.substr(0,b.length-2));b+='}'}return b+'}'}static lc(b){var c;'string'===typeof b?c=JSON.parse(b):c=b;b=new olympe.dc.db.jg(c.tag);b.G=c.state;const d=c.properties;if(d){b.C=new Map;for(var e of Object.keys(d)){const f=d[e],g=f.type;let h=f;g&&('reference'===g?h=olympe.dc.Cc.lc(f):h=olympe.D.lc(f));null!==h&&void 0!==h&&b.C.set(e,h)}}if(c=
|
|
445
|
-
c.relations){b.Oa=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.Oa.set(f,e)}}return b}static F(b,c){const d=String(b)+','+String(c);let e=
|
|
446
|
-
this.C||(this.C=new Map);this.C.set(b,c);return this}ja(b){this.C||(this.C=new Map);b.forEach((c,d)=>{this.C.set(d,c)});return this}ta(b){let c;null==(c=this.C)||c.delete(b);0===this.C.size&&(this.C=null)}link(b,c){null===this.Oa&&(this.Oa=new Map);this.Ga(this.Oa,b,c,!0);return this}unlink(b,c){null===this.Oa&&(this.Oa=new Map);this.Ga(this.Oa,b,c,!1);return this}Sa(b,c){null===this.F&&(this.F=new Map);this.Ga(this.F,b,c,!0)}
|
|
447
|
-
c===olympe.dc.Ca.ORIGIN?this.F:this.Oa)return(b=c.get(b))&&b.get(d)}R(b,c,d){const e=(c=c===olympe.dc.Ca.ORIGIN?this.F:this.Oa)&&c.get(b);e&&e.delete(d);e&&0===e.size&&c.delete(b)}re(){return this.G.id===a.C.
|
|
448
|
-
f)}(b.Ra()===olympe.dc.Ca.ORIGIN?this.F:this.Oa)}fc(b){const c=b.Ra()===olympe.dc.Ca.ORIGIN?this.F:this.Oa;return(b=c&&c.get(b.T()))&&0!==b.size?Array.from(b.keys())[0]:null}Mf(){return this.fc(olympe.dc.CloudObject.modelRel)}ed(b=(c,d,e)=>[c,d,e]){return this.$(this.Oa,b)}
|
|
449
|
-
this.Oa,this.F)}Ga(b,c,d,e){if(this.G.id!==a.C.Ac||!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)}}*$(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.jg.C={
|
|
450
|
-
function
|
|
451
|
-
function
|
|
452
|
-
q.version()).set(k,q.source());p.forEach((v,w)=>{const y=w[0],B=w.substr(1);y===d?u.set(B,v):y===e?u.set(w,v):y===f?v.forEach((E,S)=>{l.
|
|
453
|
-
olympe.dc.db.
|
|
454
|
-
function
|
|
455
|
-
class
|
|
456
|
-
olympe.U.config(function(a){D(a,olympe.dc.db.Config.
|
|
457
|
-
f);return new olympe.dc.db.Database(b,c)});C(a,olympe.dc.db.P.hb,[olympe.dc.db.P.Aa],b=>b.view);C(a,olympe.dc.db.P.
|
|
458
|
-
olympe.dc.db.P.
|
|
445
|
+
c.relations){b.Oa=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.Oa.set(f,e)}}return b}static F(b,c){const d=String(b)+','+String(c);let e=Ud.get(d);void 0===e&&(e={id:b,$i:c},Ud.set(d,e));return e}tag(){return this.da}getState(){return this.G}create(){this.G=a.F(a.C.Pl);return this}delete(b=olympe.dc.Qb.NONE){this.G=a.F(a.C.Ac,b);this.C=null;return this}Hb(){this.G.id===a.C.Qh&&(this.G=a.F(a.C.Qh,!0))}xa(b,c){if(this.G.type===a.C.Ac)return this;
|
|
446
|
+
this.C||(this.C=new Map);this.C.set(b,c);return this}ja(b){this.C||(this.C=new Map);b.forEach((c,d)=>{this.C.set(d,c)});return this}ta(b){let c;null==(c=this.C)||c.delete(b);0===this.C.size&&(this.C=null)}link(b,c){null===this.Oa&&(this.Oa=new Map);this.Ga(this.Oa,b,c,!0);return this}unlink(b,c){null===this.Oa&&(this.Oa=new Map);this.Ga(this.Oa,b,c,!1);return this}Sa(b,c){null===this.F&&(this.F=new Map);this.Ga(this.F,b,c,!0)}jb(b,c){null===this.F&&(this.F=new Map);this.Ga(this.F,b,c,!1)}Vb(b,c,d){if(c=
|
|
447
|
+
c===olympe.dc.Ca.ORIGIN?this.F:this.Oa)return(b=c.get(b))&&b.get(d)}R(b,c,d){const e=(c=c===olympe.dc.Ca.ORIGIN?this.F:this.Oa)&&c.get(b);e&&e.delete(d);e&&0===e.size&&c.delete(b)}re(){return this.G.id===a.C.Pl}L(){return this.G.id===a.C.Ac}Ab(){let b=this.C?this.C.size:0;this.Oa&&this.Oa.forEach(c=>{b+=c.size});return b}W(){return null!==this.C}dd(){return this.C||new Map}cb(b){if(this.C)return this.C.get(b)}ub(b,c=(d,e)=>[d,e]){return function*(d){if(d=d&&d.get(b.T()))for(const [e,f]of d)yield c(e,
|
|
448
|
+
f)}(b.Ra()===olympe.dc.Ca.ORIGIN?this.F:this.Oa)}fc(b){const c=b.Ra()===olympe.dc.Ca.ORIGIN?this.F:this.Oa;return(b=c&&c.get(b.T()))&&0!==b.size?Array.from(b.keys())[0]:null}Mf(){return this.fc(olympe.dc.CloudObject.modelRel)}ed(b=(c,d,e)=>[c,d,e]){return this.$(this.Oa,b)}Wa(b=(c,d,e)=>[c,d,e]){return this.$(this.F,b)}Ka(b=(c,d,e,f)=>[c,d,e,f]){const c=olympe.dc.Ca.ORIGIN,d=olympe.dc.Ca.DESTINATION;return function*(e,f,g){yield*e(f,(h,k,l)=>b(h,d,k,l));yield*e(g,(h,k,l)=>b(h,c,k,l))}(this.$.bind(this),
|
|
449
|
+
this.Oa,this.F)}Ga(b,c,d,e){if(this.G.id!==a.C.Ac||!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)}}*$(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.jg.C={Pl:0,Qh:1,Ac:2};function Tc(a,b,c,d,e,f=olympe.dc.Ha.sb){const g=olympe.dc.db.Instance.C.eq,h=olympe.dc.db.Instance.C.fr,k=c.Z();if(a.F.has(k))throw Error(`You try to execute the patch ${k} a second times whereas the first execution has not been validated yet.`);const l=new Vd(c,Wd(a,c),f);a.C.push(k);a.F.set(k,l);a.Na.ta();a.Na.jb(d,g);a.Na.jb(e,h);Uc(a,c,f);const n=Array.from(c.de()).filter(p=>p.re()).map(p=>p.tag());a.Na.bc(n);a.Na.ja();0<n.length&&b.R(()=>{a.Na.ta();a.Na.zc(n);a.Na.ja()})}
|
|
450
|
+
function Uc(a,b,c){a.G.process(c,b,d=>{d||a.N.debug('CommitController: Rebase of patch',b.Z(),'done')})}function Vc(a,b,c){return a.C.slice(0,c).map(d=>a.F.get(d)).reduce((d,e)=>e?e.$e(d):d,b)}
|
|
451
|
+
function Wd(a,b){const c=a.Na,d=olympe.dc.db.Database.C.Kh,e=olympe.dc.db.Database.C.ic,f=olympe.dc.db.Database.C.ORIGIN,g=olympe.dc.db.Database.C.DESTINATION,h=olympe.dc.Yb.VERSION,k=olympe.dc.Yb.Gd,l=new olympe.dc.db.uc('rev-'+b.Z());a.N.debug('Generate the reverse graphLayer of',b.Z());b.C.forEach((n,p)=>{if(n.re()){l.Dc(p,olympe.dc.Qb.NONE);for(const [t,u]of n.ed())l.cc(t,p,u)}else{var q=c.get(p);if(void 0!==q)if(n.L()){n=n.getState().$i;for(const t of c.W(p,n)){p=c.get(t);const u=(new Map).set(h,
|
|
452
|
+
q.version()).set(k,q.source());p.forEach((v,w)=>{const y=w[0],B=w.substr(1);y===d?u.set(B,v):y===e?u.set(w,v):y===f?v.forEach((E,S)=>{l.Va(B,S,t,0)}):y===g&&v.forEach((E,S)=>{l.Va(B,t,S,0)})});l.F(t,u,0)}}else{const t=(new Map).set(h,q.version());for(const u of n.dd().keys()){var r=u[0]===e;const v=r?u.substr(1):u;r=r?q.Wa(v,!0):q.cb(v,!0);t.set(u,void 0===r?null:r)}1<t.size&&l.qc(p,t,!0,0);for(const [u,v,w]of n.ed())w?l.cc(u,p,v):l.Va(u,p,v)}}});return l}
|
|
453
|
+
olympe.dc.db.Ds=class{constructor(a,b,c){this.N=a;this.Na=b;this.G=c;this.C=[];this.F=new Map}$e(a,b){Uc(this,Vc(this,a,this.C.length),b)}push(a){const b=this.C.indexOf(a);if(-1<b){const c=this.F.get(a);this.C.splice(b,1);Vc(this,c.F,b);this.F.delete(a)}}};function Xd(a,b,c,d){const e=olympe.dc.Ca.DESTINATION;c=c.tag();const f=a.C.Lf(c);b.dd().forEach((g,h)=>{f.xa(h,g);b.ta(h)});for(const [g,h,k,l]of b.Ka()){if(!l)continue;const n=h===e?c:k,p=h===e?k:c;a.C.Va(g,n,p);Td(d,g,n,p)}}
|
|
454
|
+
function Yd(a,b,c,d){const e=olympe.dc.Ca.DESTINATION,f=c.tag(),g=a.C.Lf(f);b.dd().forEach((h,k)=>{void 0!==c.cb(k)&&(g.xa(k,h),b.ta(k))});for(const [h,k,l]of b.ed()){const n=c.Vb(h,e,k);void 0!==n&&(Td(d,h,f,k),n===l&&Td(a.C,h,f,k))}}
|
|
455
|
+
class Vd{constructor(a,b,c){this.F=a;this.C=b;this.source=c;this.db=olympe.dc.Ja()}Z(){return this.F.Z()}$e(a){var b=this.F.C,c=a.C;const d=b.size>c.size,e=d?b:c;b=d?c:b;for(const [g,h]of b){b=g;var f=e.get(b);void 0!==f&&(c=d?f:h,f=d?h:f,f.L()?c.re()||Pd(this.C,b,f.getState().$i):c.L()?(Xd(this,f,c,a),Pd(a,b,c.getState().$i)):Yd(this,f,c,a))}return a}};olympe.dc.db.P={Ea:'dc.db.Logger',Aa:'dc.db.DatabaseManager',Gj:'dc.db.Database',hb:'dc.db.Driver',ft:'dc.db.Graph',io:'dc.db.DataProcessor',no:'dc.db.DebugProcessor',MA:'dc.db.PermissionProcessor',Ii:'dc.db.GraphMonitor'};olympe.dc.db.Config={Lo:'db.garbageCollector',Ii:'db.monitor',mo:'db.debug'};
|
|
456
|
+
olympe.U.config(function(a){D(a,olympe.dc.db.Config.Lo,olympe.dc.db.Ai.C.Kq);D(a,olympe.dc.db.Config.Ii,!1);D(a,olympe.dc.db.Config.mo,!1);C(a,olympe.dc.db.P.Ea,[olympe.ra.P.Aa],b=>b.Nc('dc.db'));C(a,olympe.dc.db.P.Gj,[olympe.dc.db.P.Ea,new olympe.U.fa(olympe.dc.Config.oo),new olympe.U.fa(olympe.dc.db.Config.Lo),new olympe.U.fa(olympe.dc.Config.Zg),new olympe.U.fa(olympe.dc.db.Config.mo)],(b,c,d,e,f)=>{d=e?olympe.dc.db.Ai.C.pl:d;c=(new Map).set('defaultSource',c).set('garbageCollector',d).set('debug',
|
|
457
|
+
f);return new olympe.dc.db.Database(b,c)});C(a,olympe.dc.db.P.hb,[olympe.dc.db.P.Aa],b=>b.view);C(a,olympe.dc.db.P.Ii,[olympe.dc.db.P.Aa],b=>b.Nx);A(a,olympe.dc.db.P.no,olympe.dc.db.Ub.to,olympe.dc.P.Ea);C(a,olympe.dc.db.P.io,[olympe.dc.db.P.Ea,olympe.dc.db.P.Gj,olympe.U.P.dg,new olympe.U.fa(olympe.dc.Config.eg)],(b,c,d,e)=>{b=new olympe.dc.db.Ub.ir(b,c);e&&(b=new olympe.dc.$l(ma(d,olympe.dc.db.P.no),b));return b});A(a,olympe.dc.db.P.Aa,olympe.dc.db.Ps,olympe.dc.db.P.Ea,olympe.dc.db.P.Gj,olympe.dc.P.ne,
|
|
458
|
+
olympe.dc.db.P.io,new olympe.U.fa(olympe.dc.db.Config.Ii))},'olympe.dc.db');olympe.U.run([olympe.dc.db.P.Gj,olympe.dc.db.P.Ii],(a,b)=>{olympe.ej().db=a;olympe.ej().dbMonitor=b},'DC.DB debug service injection');olympe.dc.db.Ub={};olympe.dc.db.Ub.ir=class{constructor(a,b){this.N=a;this.Na=b;this.buffer=[]}process(a,b,c){this.Na.ta();b.Mc(this);this.Na.ja();c(null,b)}F(a,b){this.Na.create(a,b)}qc(a,b,c){this.Na.update(a,b,c)}Dc(a,b=olympe.dc.Qb.NONE){for(const c of this.Na.W(a,b))this.Na.Dc(c)}Va(a,b,c){this.Na.link(a,b,c)}cc(a,b,c){this.Na.unlink(a,b,c)}};olympe.dc.db.Ub.ir.ma=[olympe.dc.og,olympe.dc.Writable];function Zd(a,b,c){if(!b)return'';let d='';if(c&&1<c)return'...';for(const [e,f]of b)d+=(d?', "':'"')+e+'":',f?f instanceof olympe.dc.Cc||f instanceof olympe.dc.CloudObject?d+='new olympe.dc.Reference("'+f.T()+'")':f instanceof olympe.D.Color?d+='new olympe.df.Color("'+f.Qf()+','+f.Kf()+','+f.Ff()+','+f.Ef()+'")':f.constructor&&Object.prototype.hasOwnProperty.call(f.constructor.prototype,'toString')?d+=JSON.stringify(f.toString()):'object'===typeof f&&(d+=Zd(a,f,(c||0)+1)):d+=JSON.stringify(f);return'{'+
|
|
459
459
|
(d?d:'')+'}'}
|
|
460
|
-
olympe.dc.db.Ub.
|
|
461
|
-
a+'", "'+b+'", "'+c+'")',a===olympe.dc.jc.Tc?'Model':'')}cc(a,b,c){this.log('deleteRelation("'+a+'", "'+b+'", "'+c+'")',a===olympe.dc.jc.Tc?'Model':'')}};olympe.dc.db.Ub.
|
|
462
|
-
new Map;b.forEach(d=>{const e=d.split(',');let f=c.get(e[0]);void 0===f&&(f=new Map,c.set(e[0],f));f.set(e[1],this.G.get(d))});return c}$(b,c,d){this.Ka(b,c,d);this.Ab(b,c,d);null===this.C&&(this.C=setTimeout(this.
|
|
463
|
-
c)=>{this.R((d,e)=>{for(const f of this.ta)f.unsubscribe();d?b():c(e)})})}update(b,c,d){const e=olympe.dc.za(b),f=olympe.dc.za(c);void 0===e||void 0===f?olympe.dc.
|
|
464
|
-
!1;null!==this.C&&(clearTimeout(this.C),this.C=null);this.L.clear();const c=this.da(new Set(this.G.keys()))
|
|
465
|
-
2],this.va[d+3],this.va[d+4]);d+=5;break;case b.
|
|
466
|
-
this.va.push(olympe.dc.transaction.mg.C.
|
|
467
|
-
olympe.dc.transaction.
|
|
468
|
-
d,e=>{e.Dc(a,b)})}
|
|
469
|
-
!1);this.xc(d,f,g=>{g.cc(a,b,c,0)})}xc(a,b,c){c(this.G);b&&this.F&&(b=this.C.get(a),b||(b=new olympe.dc.db.uc(this.id),this.C.set(a,b)),c(b))}};function
|
|
470
|
-
function
|
|
471
|
-
class
|
|
472
|
-
typeof a.T?{c:8,t:a.T()}:a}}function
|
|
473
|
-
olympe.dc.transaction.td=class{constructor(a=!1){this.Hg=[];this.Re=[];this.$f=[];this.Ig=[];this.wg=[];this.G=a;this.C=olympe.D?new
|
|
460
|
+
olympe.dc.db.Ub.to=class{constructor(a){this.N=a;this.output=''}process(a,b,c){this.output='Patch #'+b.Z()+' (source: '+a+')';b.Mc(this);this.N.info(this.output);this.output='';c(null,b)}log(a,b){this.output+='\ndb.'+a+';'+(b?' // '+b:'')}F(a,b){this.log('createInstance("'+a+'", '+Zd(this,b)+')')}qc(a,b){this.log('updateInstance("'+a+'", '+Zd(this,b)+')')}Dc(a,b){var c=olympe.dc.Ja();const d=c.model(a);c=d?c.name(d)+' #'+d:'';this.log('deleteInstance("'+a+'", rule: '+b+')',c)}Va(a,b,c){this.log('createRelation("'+
|
|
461
|
+
a+'", "'+b+'", "'+c+'")',a===olympe.dc.jc.Tc?'Model':'')}cc(a,b,c){this.log('deleteRelation("'+a+'", "'+b+'", "'+c+'")',a===olympe.dc.jc.Tc?'Model':'')}};olympe.dc.db.Ub.to.ma=[olympe.dc.Writable,olympe.dc.og];olympe.dc.transaction={};olympe.dc.pi=class a{constructor(b,c){this.id=b||olympe.X.ec();this.F=new olympe.D.Zb('BurstTransaction#'+this.id,c);this.Ab=$d(this);this.W=!1;this.F.onDestroy(()=>this.R());this.ta=new Set;this.G=new Map;this.L=new Set;this.C=null;this.Sa=olympe.U.getParameter(olympe.dc.transaction.Config.Ln)||30;this.ja=[]}static C(b,c){return`${b},${c}`}Hb(b){for(const c of this.ja)c(b);this.stop()}Wa(){null!==this.C&&(clearTimeout(this.C),this.C=null);const b=this.da(this.L);0<b.size&&ae(this,b,!1);this.L.clear()}da(b){const c=
|
|
462
|
+
new Map;b.forEach(d=>{const e=d.split(',');let f=c.get(e[0]);void 0===f&&(f=new Map,c.set(e[0],f));f.set(e[1],this.G.get(d))});return c}$(b,c,d){this.Ka(b,c,d);this.Ab(b,c,d);null===this.C&&(this.C=setTimeout(this.Wa.bind(this),this.Sa))}Ka(b,c,d){b=a.C(b,c);this.G.set(b,d);this.L.add(b)}jb(b,c){return this.G.get(a.C(b,c))}push(b,c){const d=olympe.dc.za(b);b=c.subscribe(e=>{for(const [f,g]of e)e=olympe.dc.za(f),this.jb(d,e)!==g&&this.$(d,e,g.valueOf())});this.ta.add(b)}complete(){return new Promise((b,
|
|
463
|
+
c)=>{this.R((d,e)=>{for(const f of this.ta)f.unsubscribe();d?b():c(e)})})}update(b,c,d){const e=olympe.dc.za(b),f=olympe.dc.za(c);void 0===e||void 0===f?olympe.dc.ei().Ya().error('Burst transaction: instance tag or property tag is undefined'):(this.F.run(()=>{olympe.D.ln([d],g=>{this.W=!0;g instanceof olympe.dc.Cc?olympe.dc.ei().Ya().error('Cannot send complex property values in burst transactions'):this.$(e,f,g.valueOf())})}),this.F.R(()=>{this.R()}))}stop(){this.F.destroy();this.ja.length=0}Z(){return this.id}oh(){return!1}R(b){if(this.W){this.W=
|
|
464
|
+
!1;null!==this.C&&(clearTimeout(this.C),this.C=null);this.L.clear();const c=this.da(new Set(this.G.keys()));ae(this,c,!0,b)}else b&&b(!0,null)}toString(){return'Burst transaction #'+this.id}};olympe.dc.pi.prototype.complete=olympe.dc.pi.prototype.complete;olympe.dc.pi.prototype.push=olympe.dc.pi.prototype.push;olympe.dc.Yp=class{C(){}toString(){}};olympe.dc.transaction.mg=class{constructor(a){this.id=a||olympe.X.ih();this.va=[];this.size=0}Z(){return this.id}G(){return this.size}concat(a){this.va.push(...a.va)}Mc(a){const b=olympe.dc.transaction.mg.C,c=this.va.length;let d=0;for(;d<c;)switch(this.va[d]){case b.Yn:a.F(this.va[d+1],this.va[d+2],this.va[d+3]);d+=4;break;case b.Wq:a.qc(this.va[d+1],this.va[d+2],this.va[d+3],this.va[d+4]);d+=5;break;case b.po:a.Dc(this.va[d+1],this.va[d+2],this.va[d+3]);d+=4;break;case b.Zn:a.Va(this.va[d+1],this.va[d+
|
|
465
|
+
2],this.va[d+3],this.va[d+4]);d+=5;break;case b.qo:a.cc(this.va[d+1],this.va[d+2],this.va[d+3],this.va[d+4]);d+=5;break;default:throw Error('Invalid Patch operations "'+this.va[d]+'"');}}F(a,b,c){this.va.push(olympe.dc.transaction.mg.C.Yn,a,b,c);this.size++}qc(a,b,c,d){this.va.push(olympe.dc.transaction.mg.C.Wq,a,b,c,d);this.size++}Dc(a,b=olympe.dc.Qb.NONE,c){this.va.push(olympe.dc.transaction.mg.C.po,a,b,c);this.size++}Va(a,b,c,d){if('string'!==typeof a)throw Error('Relation should be created using a tag as string (most likely a relation object is given here instead)');
|
|
466
|
+
this.va.push(olympe.dc.transaction.mg.C.Zn,a,b,c,d);this.size++}cc(a,b,c,d){this.va.push(olympe.dc.transaction.mg.C.qo,a,b,c,d);this.size++}};olympe.dc.transaction.mg.C={Yn:1,Wq:2,po:3,Zn:4,qo:5};olympe.dc.transaction.mg.ma=[olympe.dc.Writable,olympe.dc.Zl];function be(a,b){return a.R.get(b)||a.db.source(b)||olympe.dc.Ha.ic}function ce(a,b){return a.L.has(b)?a.L.get(b):a.db.Wf(b)}function de(a,b,c,d){var e=d&&d.get(olympe.dc.Yb.VERSION);a.versions.set(b,Number(e)||1);d&&a.R.set(b,d.get(olympe.dc.Yb.Gd));e=be(a,b);a.L.set(b,c&&a.F);a.xc(e,c,f=>{f.F(b,d,0)})}
|
|
467
|
+
olympe.dc.transaction.xu=class{constructor(a,b){this.id=b||olympe.X.ec();this.db=a;this.C=new Map;this.G=new olympe.dc.db.uc(b);this.versions=new Map;this.R=new Map;this.L=new Map;this.F=!0}Sf(){return 0===this.G.C.size}persist(a){this.F=a}qc(a,b,c=!1){var d=b&&b.get(olympe.dc.Yb.VERSION);this.versions.set(a,Number(d)||1);d=be(this,a);if(!d)throw Error('Attempt to update an instance which has an unknown source.');this.xc(d,ce(this,a),e=>{e.qc(a,b,c,0)})}Dc(a,b){const c=be(this,a),d=ce(this,a);this.xc(c,
|
|
468
|
+
d,e=>{e.Dc(a,b)})}Va(a,b,c){const d=be(this,b),e=be(this,c);let f=ce(this,b)&&ce(this,c);f&&d!==e&&a!==olympe.dc.jc.Tc&&(olympe.ra.Ya('dc').warn(`Try to create a relation between 2 objects that have different locations: ${b}-[${a}]->${c}`),f=!1);this.xc(d,f,g=>{g.Va(a,b,c,0)})}cc(a,b,c){const d=be(this,b),e=be(this,c);let f=ce(this,b)&&ce(this,c);f&&d!==e&&a!==olympe.dc.jc.Tc&&(olympe.ra.Ya('dc').warn(`Try to delete a relation between 2 objects that have different locations: ${b}-[${a}]->${c}`),f=
|
|
469
|
+
!1);this.xc(d,f,g=>{g.cc(a,b,c,0)})}xc(a,b,c){c(this.G);b&&this.F&&(b=this.C.get(a),b||(b=new olympe.dc.db.uc(this.id),this.C.set(a,b)),c(b))}};function ee(a,b,c){const d=Object.create(null);if(!b)return d;for(const f of Array.from(b.keys()).sort()){let g=f;var e=b.get(f);if(g===olympe.dc.Yb.Gd)if(e===olympe.dc.Ha.sb)d[g]=olympe.dc.Ja().Z();else{if(e===olympe.dc.Ha.Lc)continue}else g.startsWith(olympe.dc.Yb.VERSION)?(g=g.substr(1),e=null===e?1:e):g.startsWith(olympe.dc.Tg.ic)&&(g='fd'+g.substr(1));e=a.$(e);c&&e instanceof Object&&8===e.c?a.W.set(g,e):d[g]=e}return d}
|
|
470
|
+
function fe(a){if(0===a.W.size)return null;const b=Object.create(null);a.W.forEach((c,d)=>{b[d]=c});a.W.clear();return b}
|
|
471
|
+
class ge{constructor(){this.W=new Map}$(a){return a instanceof olympe.D.Za||a instanceof olympe.D.sa||a instanceof olympe.D.ga?a.valueOf():a instanceof Date||a instanceof olympe.D.ib?(a=a instanceof olympe.D.ib?a.valueOf():a,{c:4,y:a.getUTCFullYear(),M:a.getUTCMonth()+1,d:a.getUTCDate(),h:a.getUTCHours(),m:a.getUTCMinutes(),s:a.getUTCSeconds(),S:a.getUTCMilliseconds(),z:0}):a instanceof olympe.D.Color?{c:7,r:a.Qf().valueOf(),g:a.Kf().valueOf(),b:a.Ff().valueOf(),a:a.Ef().valueOf()}:a&&'function'===
|
|
472
|
+
typeof a.T?{c:8,t:a.T()}:a}}function he(a){a.Hg=[];a.Re=[];a.$f=[];a.Ig=[];a.wg=[]}function ie(a){const b={};0<a.wg.length&&(b.wg=a.wg);0<a.Re.length&&(b.Re=a.Re);0<a.Hg.length&&(b.Hg=a.Hg);0<a.$f.length&&(b.$f=a.$f);0<a.Ig.length&&(b.Ig=a.Ig);he(a);return b}function je(a){const b=[...a.wg,...a.Re,...a.Hg,...a.$f,...a.Ig];he(a);return b}
|
|
473
|
+
olympe.dc.transaction.td=class{constructor(a=!1){this.Hg=[];this.Re=[];this.$f=[];this.Ig=[];this.wg=[];this.G=a;this.C=olympe.D?new ge:new class extends ge{$(b){return b&&'function'===typeof b.T?{c:8,t:b.T()}:b}}}flush(){return JSON.stringify(je(this))}F(a,b,c=-1){this.Hg.push({o:1,t:a,p:ee(this.C,b||null,this.G),i:c});this.G&&(b=fe(this.C))&&this.$f.push({o:2,t:a,p:b,i:c})}qc(a,b,c,d=-1){this.$f.push({o:2,t:a,p:ee(this.C,b||null,!1),i:d})}Dc(a,b,c=-1){this.Re.push({o:3,t:a,f:b,i:c})}Va(a,b,c,d=
|
|
474
474
|
-1){if(!a)throw Error('Cannot create relation of undefined type');if(!b)throw Error(`Cannot create relation ${a} from undefined origin to ${c}`);if(!c)throw Error(`Cannot create relation ${a} from ${b} to undefined destination`);this.Ig.push({o:4,m:a,l:b,r:c,i:d})}cc(a,b,c,d=-1){if(!a)throw Error('Cannot delete relation of undefined type');if(!b)throw Error('Cannot delete relation with undefined origin');if(!c)throw Error('Cannot delete relation with undefined destination');this.wg.push({o:5,m:a,
|
|
475
|
-
l:b,r:c,i:d})}};olympe.dc.transaction.td.ma=[olympe.dc.Writable];olympe.dc.transaction.
|
|
476
|
-
}
|
|
477
|
-
function
|
|
478
|
-
olympe.dc.Transaction=class{constructor(a){this.id=a||olympe.X.ec();this.va=[];this.G=!0;this.F=[]}Z(){return this.id}persist(a){this.G=a;return this}C(a){a.persist(this.G);const b=this.va;for(let c=0,d=b.length;c<d;c++)b[c].C(a)}create(a,b){return
|
|
479
|
-
a);if(d.Wf(a))return null;const f=d.source(a)||olympe.dc.Ha.ic;a=this.create(e,a).persist(b).
|
|
480
|
-
d))}
|
|
481
|
-
|
|
482
|
-
c,b);this.
|
|
483
|
-
function
|
|
484
|
-
function
|
|
485
|
-
function
|
|
486
|
-
function
|
|
487
|
-
function
|
|
488
|
-
p,v,u,w=>{const y=h.reduce((B,E)=>B||E.Lf(p),null);null!==y&&(y.xa(e,w).xa(f,!0),k.push([p,w]));q()},w=>{r(w)})}):(2048<t.length&&a.N.error('Trying to create a file with an URL longer than 2048. It likely is a data url and should be an object url. File tag:',p),q())})});ac(l,(p,q)=>{let r=null;if(p){const t=new olympe.dc.db.uc;k.forEach(([u,v])=>{const w=new Map;w.set(e,v).set(f,!0).set(g,olympe.D.ib.now());t.qc(u,w,!0,0)});r=
|
|
489
|
-
function
|
|
490
|
-
function
|
|
491
|
-
function
|
|
492
|
-
olympe.dc.transaction.rg.C={
|
|
493
|
-
olympe.U.config(function(a){D(a,olympe.dc.transaction.Config.TIMEOUT,6E4);D(a,olympe.dc.transaction.Config.
|
|
494
|
-
return this}C(a){const b=olympe.dc.Ja(),c=this.Nb(),d=this.T();if(void 0===c)throw Error('OperationError: Cannot create instance, model tag is undefined');var e=olympe.dc.Yb.Gd;if(!this.F.has(e)){var f=b.source(c);this.F.set(e,null!==f?f:olympe.dc.Ha.ic)}if(b.Db(d)&&!b.Wf(d)&&this.G){e=new Map([...b.dd(d,!0),...
|
|
495
|
-
d,c);for(const [g,h,k]of
|
|
496
|
-
olympe.dc.transaction.va.Td.prototype.getModelTag=olympe.dc.transaction.va.Td.prototype.Nb;olympe.dc.transaction.va.Td.prototype.getTag=olympe.dc.transaction.va.Td.prototype.T;olympe.dc.transaction.va.Td.ma=[olympe.dc.Ae];olympe.dc.transaction.va.
|
|
497
|
-
const d=W(this.G);if(''===d)throw Error('OperationError: Cannot create relation, destination tag is undefined, null or empty string');this.Ra()===olympe.dc.Ca.DESTINATION?a.
|
|
498
|
-
var d=olympe.dc.Ja();const e=this.Ra(),f=this.R;d=d.ub(c,this.F);for(const g of d)e===olympe.dc.Ca.DESTINATION?a.cc(b,c,g):a.cc(b,g,c),null!==f&&0<=f.indexOf(g)||this.L&&(new olympe.dc.transaction.va.
|
|
499
|
-
this.Ra()===olympe.dc.Ca.DESTINATION?a.cc(b,c,d):a.cc(b,d,c);this.L&&(new olympe.dc.transaction.va.
|
|
500
|
-
b+' not found so it cannot be updated');d=
|
|
501
|
-
olympe.dc.transaction.va.
|
|
502
|
-
for(const [d,e,f]of a.r)a=new olympe.dc.query.Relation(d,e,f),f?b.
|
|
503
|
-
olympe.dc.ba.bb=class{observe(){}
|
|
504
|
-
olympe.dc.ba.bb.not=olympe.dc.ba.bb.not;olympe.dc.ba.bb.or=olympe.dc.ba.bb.or;olympe.dc.ba.bb.and=olympe.dc.ba.bb.and;olympe.dc.ba.bb.smallerThan=olympe.dc.ba.bb.
|
|
505
|
-
function
|
|
506
|
-
function
|
|
507
|
-
function
|
|
508
|
-
olympe.dc.gb=class{constructor(a,b=null,c=[],d=new Set,e={max:-1,offset:0}){this.db=olympe.dc.Ja();this.G=olympe.dc.za(a);this.source=b;this.C=c;this.F=d;this.max=-1===e.max?-1:e.max;this.offset=e.offset;this.id=null}static from(a,b){return new olympe.dc.gb(a,b)}static
|
|
509
|
-
a,b));return
|
|
510
|
-
typeof a.Sa?a.C.C:a)}observe(a){return
|
|
511
|
-
olympe.dc.gb.prototype.observe=olympe.dc.gb.prototype.observe;olympe.dc.gb.prototype.execute=olympe.dc.gb.prototype.
|
|
512
|
-
olympe.dc.gb.prototype.follow=olympe.dc.gb.prototype.rb;olympe.dc.gb.instancesOf=olympe.dc.gb.
|
|
513
|
-
function
|
|
514
|
-
function
|
|
475
|
+
l:b,r:c,i:d})}};olympe.dc.transaction.td.ma=[olympe.dc.Writable];olympe.dc.transaction.Ph=class{constructor(a){this.id=a||olympe.X.ec();this.C=new Map;this.Oa=new Map}Z(){return this.id}F(a,b){this.C.has(a)&&console.warn('Try to add twice the same instance in the graph');const c=new olympe.dc.transaction.Ph.Instance(a);if(b)for(const [d,e]of b)c.xa(d,e);this.C.set(a,c)}qc(){throw Error('UpdateInstance should never be called on a SubGraph since it represents the result of a GraphDef Query');}Dc(){throw Error('DeleteInstance should never be called on a SubGraph since it represents the result of a GraphDef Query');
|
|
476
|
+
}Va(a,b,c){a=new olympe.dc.transaction.Ph.Relation(b,c,a);this.Oa.set(a.toString(),a)}cc(a,b,c){a=new olympe.dc.transaction.Ph.Relation(b,c,a);this.Oa.delete(a.F+'.'+a.G+'.'+a.C)}G(){return this.Oa.size+this.C.size}de(){return this.C}Mc(a){const b=new Map;this.C.forEach((c,d)=>{const e=new Map;ke(c,(f,g)=>{if(g instanceof olympe.dc.Cc){const h=b.get(d)||new Map;h.set(f,g);b.set(d,h)}else e.set(f,g)});a.F(d,e)});b.forEach((c,d)=>{a.qc(d,c)});this.Oa.forEach(c=>{a.Va(c.C,c.F,c.G)})}};
|
|
477
|
+
function ke(a,b){a.C.forEach((c,d)=>{b(d,b)})}olympe.dc.transaction.Ph.Instance=class{constructor(a){this.tag=a;this.C=new Map}T(){return this.tag}xa(a,b){this.C.set(a,b);return this}deleteProperty(a){this.C.delete(a);return this}};olympe.dc.transaction.Ph.Relation=class{constructor(a,b,c){this.F=a;this.G=b;this.C=olympe.dc.za(c)}toString(){return this.F+'.'+this.G+'.'+this.C}};olympe.dc.transaction.Ph.ma=[olympe.dc.Writable,olympe.dc.Zl];function le(a,b){b&&a.va.push(b);return b}function me(a){return(b,c)=>a.forEach(d=>d&&d(b,c))}
|
|
478
|
+
olympe.dc.Transaction=class{constructor(a){this.id=a||olympe.X.ec();this.va=[];this.G=!0;this.F=[]}Z(){return this.id}persist(a){this.G=a;return this}C(a){a.persist(this.G);const b=this.va;for(let c=0,d=b.length;c<d;c++)b[c].C(a)}create(a,b){return le(this,new olympe.dc.transaction.va.Td(a,b))}qj(a,b=!0){const c=olympe.dc.za(a);var d=this.va.find(g=>g instanceof olympe.dc.transaction.va.Td&&g.T()===c);if(d)return d.persist(b);d=olympe.dc.Ja();const e=d.model(a);if(null===e)throw Error('Try to persist a instance that does not exist: '+
|
|
479
|
+
a);if(d.Wf(a))return null;const f=d.source(a)||olympe.dc.Ha.ic;a=this.create(e,a).persist(b).ji(f);for(const [g,h,k]of Kd(d,a))g!==olympe.dc.jc.Tc&&d.Wf(k)&&this.Va(g,h===olympe.dc.Ca.DESTINATION?a:k,h===olympe.dc.Ca.DESTINATION?k:a);return a}delete(a,b=olympe.dc.Qb.Ac){le(this,new olympe.dc.transaction.va.Jj(a,b))}update(a,b,c){return le(this,new olympe.dc.transaction.va.Ri(a,b,c))}Va(a,b,c){le(this,new olympe.dc.transaction.va.ho(a,b,c))}cc(a,b,c,d){le(this,new olympe.dc.transaction.va.Rs(a,b,c,
|
|
480
|
+
d))}Jm(a,b,c,d){le(this,new olympe.dc.transaction.va.Qs(a,b,c,d))}defineProperty(a,b,c,d,e,f){d=this.create(olympe.dm.Property,f);d.setProperty(olympe.dc.CloudObject.nameProp,c||'');void 0!==e&&this.update(a,olympe.dc.Tg.ic+d.T(),e);this.Va(olympe.dc.CloudObject.propertyRel,a,d);this.Va(olympe.dm.Property.typeRel,d,b);this.Va(olympe.dc.CloudObject.containsRel,a,d);return d}gh(a,b,c='',{Xi:d=olympe.dm.Relation.F.Rl,Br:e=olympe.dm.Relation.C.qq,zr:f=olympe.dm.Relation.C.fl,sj:g=olympe.dm.Relation.C.Cl,
|
|
481
|
+
Wi:h=olympe.dm.Jc.NONE,pj:k=olympe.dm.Relation.L|h}={},l=olympe.X.ec()){c=this.create(olympe.dm.Relation,l).setProperty(olympe.dc.CloudObject.nameProp,c||'').setProperty(olympe.dm.Relation.Dm,d).setProperty(olympe.dm.Relation.kn,k).setProperty(olympe.dm.Relation.Lm,e).setProperty(olympe.dm.Relation.tn,e).setProperty(olympe.dm.Relation.Km,f).setProperty(olympe.dm.Relation.pn,g).setProperty(olympe.dm.Relation.qr,h);this.Va(olympe.dc.CloudObject.G,a,c);this.Va(olympe.dm.Relation.destinationModelRel,
|
|
482
|
+
c,b);this.Va(olympe.dc.CloudObject.containsRel,a,c);return c}oh(){return!1}Cm(a){this.F.push(olympe.D.La().F(a))}kb(a,b){a=me([...this.F,a]);ne(this,a,b)}Mm(a){a=me([...this.F,a]);oe(olympe.dc.ei(),this,a,!0)}toString(){return`Transaction #${this.id}`}};olympe.dc.Transaction.ma=[olympe.dc.Yp];function $d(a){var b=olympe.dc.ei();const c=a.Z();b.L.set(c,a);a.F.onDestroy(()=>{b.L.delete(c)});return(d,e,f)=>{const g=new olympe.dc.db.uc(c);e=(new Map).set(olympe.dc.Yb.VERSION,b.db.version(d)+1).set(e,f);g.qc(d,e,!1,0);olympe.dc.xd().$e(g,olympe.dc.Ha.sb)}}
|
|
483
|
+
function ae(a,b,c,d){var e=olympe.dc.ei();const f=olympe.dc.Yb.VERSION,g=olympe.dc.ha.ia.uh,h=olympe.dc.ha.ia.gl,k=a.Z(),l=a.oh(),n=new Map;for(const q of b.keys()){var p=e.db.source(q);if(p===olympe.dc.Ha.sb)continue;let r=n.get(p);r||(r=new olympe.dc.db.uc(k),n.set(p,r));p=b.get(q);p.set(f,e.db.version(q)+1);r.qc(q,p,!1,0)}for(const [q,r]of n)b=Ec(new olympe.dc.ha(c?h:g,{xc:r,oh:l},[q]),a.F),c&&d&&M(b,t=>{t?d(!1,t.message):d(!0,null)}),e.G.send(b)}
|
|
484
|
+
function ne(a,b,c){var d=olympe.dc.ei();if(c&&b){const e=a.Z();d.F.set(e,b);oe(d,a,(f,g)=>{f||(d.F.delete(e),b(f,g))},!1)}else oe(d,a,b,!1)}
|
|
485
|
+
function pe(a){const b=olympe.dc.ha.ia.Mj;a.G.C(olympe.dc.ha.ia.Cj,(c,d)=>{c=d.id;var e=d.rollback;d=d.error;const f=a.L.get(c);void 0!==f&&(a.L.delete(c),f.Hb(d));olympe.dc.xd().$e(e,olympe.dc.Ha.sb);a.N.warn(`Fast update (id=${c}) has been refused and is rolled back. Error: ${d}`)});a.G.C(b,(c,d)=>{c=d.finalize;var e=d.error;(d=(d=a.C.get(d.id))&&d.pop())&&d(c,e)})}
|
|
486
|
+
function oe(a,b,c,d=!1){const e=olympe.D.La(),f=c?e.F(c):void 0;c=olympe.dc.xd();const g=b.Z(),h=new olympe.dc.transaction.xu(a.db,g);b.C(h);if(h.Sf())f&&f(!0,null);else{a.C.set(g,[]);const k=[],l=[];for(const p of h.versions.keys())ce(h,p)?k.push(p):l.push(p);const n=Sc(c,e,h.G,k,l);qe(a,h,(p,q,r)=>{q?(re(a,g,k,h.C.size),se(a,h,d,b.oh(),(t,u)=>{t||te(a,g,u);n(t);p&&p(t);f&&f(t,u)})):(a.N.error(r),te(a,g,r),n(!1),f&&f(!1,r))})}}
|
|
487
|
+
function qe(a,b,c){const d=[];for(const p of b.versions.keys())a.db.Rf(p,olympe.dm.File)&&ce(b,p)&&d.push(p);if(0===d.length)c(null,!0,null);else{var e=olympe.dm.File.urlProp.T(),f=olympe.dm.File.C.T(),g=olympe.dm.File.modificationDateProp.T(),h=Array.from(b.C.values()),k=[],l=new olympe.async.ng(olympe.D.lh()),n=olympe.X.bi();d.forEach(p=>{l.add((q,r)=>{const t=a.db.cb(p,e,!0),u=a.db.cb(p,olympe.dm.File.mimeTypeProp)||'application/data';t.startsWith('blob:')?n.F(t,v=>{n.W(t);null===v?q():Ac(a.W,
|
|
488
|
+
p,v,u,w=>{const y=h.reduce((B,E)=>B||E.Lf(p),null);null!==y&&(y.xa(e,w).xa(f,!0),k.push([p,w]));q()},w=>{r(w)})}):(2048<t.length&&a.N.error('Trying to create a file with an URL longer than 2048. It likely is a data url and should be an object url. File tag:',p),q())})});ac(l,(p,q)=>{let r=null;if(p){const t=new olympe.dc.db.uc;k.forEach(([u,v])=>{const w=new Map;w.set(e,v).set(f,!0).set(g,olympe.D.ib.now());t.qc(u,w,!0,0)});r=Sc(olympe.dc.xd(),olympe.D.lh(),t,[],[])}c(r,p,q)});l.start()}}
|
|
489
|
+
function re(a,b,c,d){const e=olympe.D.lh(),f=new olympe.async.ng(e);0<a.timeout&&$b(f,a.timeout);const g=a.C.get(b);for(let h=0;h<d;h++)f.add((k,l,n)=>{g.push(e.F((p,q)=>{n.set('final',p);q?l(q):k()}))});ac(f,(h,k,l)=>{h||a.N.warn(`An error occurred while processing the notification of transaction (${b}): ${k}.`);l.get('final')!==olympe.dc.transaction.rg.C.Op&&olympe.dc.xd().persist(c);te(a,b)});f.start()}
|
|
490
|
+
function se(a,b,c,d,e){b=b.C;if(0===b.size)e(!0,null);else{var f=c?olympe.dc.ha.ia.uk:olympe.dc.ha.ia.dh;c=(h,k,l,n)=>{h=M(new olympe.dc.ha(f,{xc:h,oh:d},[k]),p=>{p instanceof Error?n(p.message):l()});a.G.send(h)};var g=new olympe.async.ng(olympe.D.lh());for(const [h,k]of b)g.add(c.bind(null,k,h));ac(g,e);g.start()}}
|
|
491
|
+
function te(a,b,c){if(void 0!==c){var d;null==(d=a.C.get(b))||d.forEach(e=>{e(olympe.dc.transaction.rg.C.ak,c)})}a.C.delete(b);if(0===a.C.size){for(const e of a.R)e();a.R=[]}a.F.has(b)&&(d=a.F.get(b),a.F.delete(b),d(!0,null))}function ue(a,b){0<a.C.size?a.R.push(olympe.D.La().F(b)):b()}olympe.dc.transaction.rg=class{constructor(a,b,c,d,e){this.N=a;this.db=b;this.G=c;this.W=d;this.timeout=e;this.L=new Map;this.C=new Map;this.R=[];this.F=new Map;pe(this)}Ya(){return this.N}};
|
|
492
|
+
olympe.dc.transaction.rg.C={ak:0,Np:1,Op:2};olympe.dc.transaction.P={Ea:'dc.transaction.Logger',Aa:'dc.transaction.Manager'};olympe.dc.transaction.Config={TIMEOUT:'dc.transaction.timeout',Ln:'dc.transaction.burstInterval'};
|
|
493
|
+
olympe.U.config(function(a){D(a,olympe.dc.transaction.Config.TIMEOUT,6E4);D(a,olympe.dc.transaction.Config.Ln,30);C(a,olympe.dc.transaction.P.Ea,[olympe.ra.P.Aa],b=>b.Nc('dc'));A(a,olympe.dc.transaction.P.Aa,olympe.dc.transaction.rg,olympe.dc.transaction.P.Ea,olympe.dc.P.ti,olympe.dc.P.ne,olympe.dc.P.xi,new olympe.U.fa(olympe.dc.transaction.Config.TIMEOUT))},'olympe.dc.transaction');olympe.dc.transaction.va={};function W(a){return olympe.dc.za(a)}function ve(a,b){const c=new Map;for(const [d,e]of b)c.set(d,a.$a(e));return c}olympe.dc.transaction.va.Og=class{C(){throw Error('Abstract method build() not override !');}toString(){throw Error('Abstract method toString() not override !');}$a(a){a=olympe.D.$a(a);return void 0===a||null===a?null:olympe.D.Rr(a)?a.valueOf():a}};olympe.dc.transaction.va.Og.ma=[olympe.dc.Yp];olympe.dc.transaction.va.Td=class extends olympe.dc.transaction.va.Og{constructor(a,b){super();this.tag=void 0!==b?b:olympe.X.ec();this.model=a;this.F=new Map;this.G=!0;this.F.set(olympe.dc.Yb.VERSION,1)}T(){return W(this.tag)}Nb(){return W(this.model)}persist(a){this.G=a;return this}ji(a){this.F.set(olympe.dc.Yb.Gd,a);return this}Cx(){this.F.set(olympe.dc.Yb.Gd,olympe.dc.Ha.sb)}setProperty(a,b){this.F.set(olympe.dc.za(a),b);return this}Xk(a){this.setProperty(olympe.dc.CloudObject.nameProp.T(),a);
|
|
494
|
+
return this}C(a){const b=olympe.dc.Ja(),c=this.Nb(),d=this.T();if(void 0===c)throw Error('OperationError: Cannot create instance, model tag is undefined');var e=olympe.dc.Yb.Gd;if(!this.F.has(e)){var f=b.source(c);this.F.set(e,null!==f?f:olympe.dc.Ha.ic)}if(b.Db(d)&&!b.Wf(d)&&this.G){e=new Map([...b.dd(d,!0),...ve(this,this.F)]);for(const g of e.values())g instanceof olympe.dc.Cc&&!ce(a,g.T())&&(f=new olympe.dc.Transaction,f.qj(g.T()),f.C(a));de(a,d,this.G,e);a.Va(olympe.dc.CloudObject.modelRel.T(),
|
|
495
|
+
d,c);for(const [g,h,k]of Kd(b,d))ce(a,k)&&(h===olympe.dc.Ca.ORIGIN?a.Va(g,k,d):a.Va(g,d,k))}else b.Db(d)||(de(a,d,this.G,ve(this,this.F)),a.Va(olympe.dc.CloudObject.modelRel.T(),d,c))}toString(){return`CreateInstance(${this.Nb()}, ${this.T()})`}};olympe.dc.transaction.va.Td.prototype.setProperty=olympe.dc.transaction.va.Td.prototype.setProperty;olympe.dc.transaction.va.Td.prototype.localSource=olympe.dc.transaction.va.Td.prototype.Cx;olympe.dc.transaction.va.Td.prototype.persist=olympe.dc.transaction.va.Td.prototype.persist;
|
|
496
|
+
olympe.dc.transaction.va.Td.prototype.getModelTag=olympe.dc.transaction.va.Td.prototype.Nb;olympe.dc.transaction.va.Td.prototype.getTag=olympe.dc.transaction.va.Td.prototype.T;olympe.dc.transaction.va.Td.ma=[olympe.dc.Ae];olympe.dc.transaction.va.ho=class extends olympe.dc.transaction.va.Og{constructor(a,b,c){super();this.type=a.Ra?a:new olympe.dc.Y.Sb(W(a));this.F=b;this.G=c}Ra(){return this.$a(this.type).Ra()}C(a){const b=W(this.type);if(''===b)throw Error('OperationError: Cannot create relation, type is undefined, null or empty string');if(b===olympe.dc.jc.Tc)throw Error('OperationError: Cannot create the instance -> model relation');const c=W(this.F);if(''===c)throw Error('OperationError: Cannot create relation, origin tag is undefined, null or empty string');
|
|
497
|
+
const d=W(this.G);if(''===d)throw Error('OperationError: Cannot create relation, destination tag is undefined, null or empty string');this.Ra()===olympe.dc.Ca.DESTINATION?a.Va(b,c,d):a.Va(b,d,c)}toString(){return`CreateRelation('${this.Ra()}${W(this.type)}, ${W(this.F)}, ${W(this.G)})`}};olympe.dc.transaction.va.yz=class extends olympe.dc.transaction.va.Og{constructor(a,b=olympe.dc.Qb.Ac){super();this.model=a;this.F=b}Nb(){return W(this.model)}C(a){const b=this.Nb();if(void 0===b)throw Error('OperationError: Cannot delete instances of model, model is undefined');const c=olympe.dc.Ja();for(const d of c.de(b))d!==b&&(new olympe.dc.transaction.va.Jj(d,this.F)).C(a)}toString(){return`DeleteAllInstances(${this.Nb()}, ${this.F})`}};olympe.dc.transaction.va.Qs=class extends olympe.dc.transaction.va.Og{constructor(a,b,c,d){super();this.F=a.Ra?a:new olympe.dc.Y.Sb(W(a));this.G=b;this.L=c||!1;this.R=d instanceof Array?d.map(e=>W(e)):null}Ra(){return this.$a(this.F).Ra()}C(a){const b=W(this.F);if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.jc.Tc)throw Error('OperationError: Cannot delete the instance -> model relation');const c=W(this.G);if(void 0===c)throw Error('OperationError: Cannot delete relation, left tag is undefined');
|
|
498
|
+
var d=olympe.dc.Ja();const e=this.Ra(),f=this.R;d=d.ub(c,this.F);for(const g of d)e===olympe.dc.Ca.DESTINATION?a.cc(b,c,g):a.cc(b,g,c),null!==f&&0<=f.indexOf(g)||this.L&&(new olympe.dc.transaction.va.Jj(g,olympe.dc.Qb.Ac)).C(a)}toString(){return`DeleteAllRelations(${this.Ra()}${W(this.F)}, ${W(this.G)}, ${this.L})`}};olympe.dc.transaction.va.Jj=class extends olympe.dc.transaction.va.Og{constructor(a,b=olympe.dc.Qb.Ac){super();this.tag=a;this.F=b}T(){return W(this.tag)}C(a){const b=olympe.dc.Ja(),c=this.T();if(void 0===c)throw Error('OperationError: Cannot delete instance, tag is undefined');const d=b.model(c);0<=b.version(c)&&d&&a.Dc(c,this.F)}toString(){return'DeleteInstance('+this.T()+', '+this.F+')'}};olympe.dc.transaction.va.Rs=class extends olympe.dc.transaction.va.ho{constructor(a,b,c,d=!1){super(a,b,c);this.L=d}C(a){const b=W(this.type);if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.jc.Tc)throw Error('OperationError: Cannot delete the instance -> model relation');const c=W(this.F);if(void 0===c)throw Error('OperationError: Cannot delete relation, left tag is undefined');const d=W(this.G);if(void 0===d)throw Error('OperationError: Cannot delete relation, right tag is undefined');
|
|
499
|
+
this.Ra()===olympe.dc.Ca.DESTINATION?a.cc(b,c,d):a.cc(b,d,c);this.L&&(new olympe.dc.transaction.va.Jj(d,olympe.dc.Qb.Ac)).C(a)}toString(){return'DeleteRelation('+this.Ra()+W(this.type)+', '+W(this.F)+', '+W(this.G)+', '+this.L+')'}};olympe.dc.transaction.va.Ri=class extends olympe.dc.transaction.va.Og{constructor(a,b,c){super();this.tag=a;this.F=new Map;this.F.set(olympe.dc.Yb.VERSION,-1);void 0!==b&&this.setProperty(b,c)}T(){return W(this.tag)}setProperty(a,b){this.F.set(W(a),b);return this}C(a){const b=this.T();if(void 0===b)throw Error('OperationError: Cannot update instance, tag is undefined');const c=olympe.dc.Ja();var d=c.version(b),e=a.versions.get(b);e=void 0!==e?e:d;if(null===e)throw Error('OperationError: Instance #'+
|
|
500
|
+
b+' not found so it cannot be updated');d=ve(this,this.F);0>=d.get(olympe.dc.Yb.VERSION)&&d.set(olympe.dc.Yb.VERSION,e+1);for(const [f,g]of d)e=c.cb(b,f),e instanceof olympe.dc.Cc&&a.Dc(e.T(),olympe.dc.Qb.Ac),g instanceof olympe.dc.Cc&&!ce(a,g.T())&&(e=new olympe.dc.Transaction,e.qj(g.T()),e.C(a));a.qc(b,d)}toString(){return'UpdateInstance('+this.T()+', '+ve(this,this.F)+')'}};olympe.dc.transaction.va.Ri.prototype.setProperty=olympe.dc.transaction.va.Ri.prototype.setProperty;
|
|
501
|
+
olympe.dc.transaction.va.Ri.prototype.getTag=olympe.dc.transaction.va.Ri.prototype.T;olympe.dc.ba={};olympe.dc.Ae=class{T(){}};olympe.dc.Ae.prototype.getTag=olympe.dc.Ae.prototype.T;olympe.dc.lA=olympe.dc.Ae;olympe.dc.ba.ek={ASC:'ASC',DESC:'DESC'};function we(a){switch(a.pr){case 1:const c=a.v;switch(a.t){case 1:var b=c;break;case 2:b=new Date(c);break;case 3:b=olympe.dc.CloudObject.get(c);break;case 4:b=new olympe.D.Color(c.r,c.g,c.b,c.a)}return new olympe.dc.ba.V.Fc(a.p,b,olympe.dc.Ja());case 2:return new olympe.dc.ba.V.Sc(a.p,a.s,olympe.dc.Ja(),a.c);case 3:return new olympe.dc.ba.V.Ah(a.p,a.b,a.l,a.s);case 4:return new olympe.dc.ba.V.jd(we(a.v));case 5:return new olympe.dc.ba.V.ud(a.p,new RegExp(a.r),olympe.dc.Ja(),a.c);case 6:b=new olympe.dc.ba.V.Ee(a.d);
|
|
502
|
+
for(const [d,e,f]of a.r)a=new olympe.dc.query.Relation(d,e,f),f?b.Dk(a):b.rb(a);return b;case 7:return new olympe.dc.ba.V.Zd(...a.p.map(d=>we(d)));case 8:return new olympe.dc.ba.V.Qd(...a.p.map(d=>we(d)));default:return null}}
|
|
503
|
+
olympe.dc.ba.bb=class{observe(){}kb(){}clear(){}la(){}toString(){}static nb(a,b){return new olympe.dc.ba.V.Fc(a,b,olympe.dc.Ja())}static contains(a,b,c=!1){return new olympe.dc.ba.V.Sc(a,b,olympe.dc.Ja(),c)}static Wr(a,b,c=!0){return new olympe.dc.ba.V.ud(a,b,olympe.dc.Ja(),c)}static Jk(a,b,c=!0){return new olympe.dc.ba.V.Ah(a,b,!1,c)}static uj(a,b,c=!0){return new olympe.dc.ba.V.Ah(a,b,!0,c)}static and(...a){return new olympe.dc.ba.V.Qd(...a)}static or(...a){return new olympe.dc.ba.V.Zd(...a)}static not(a){return new olympe.dc.ba.V.jd(a)}};
|
|
504
|
+
olympe.dc.ba.bb.not=olympe.dc.ba.bb.not;olympe.dc.ba.bb.or=olympe.dc.ba.bb.or;olympe.dc.ba.bb.and=olympe.dc.ba.bb.and;olympe.dc.ba.bb.smallerThan=olympe.dc.ba.bb.uj;olympe.dc.ba.bb.greaterThan=olympe.dc.ba.bb.Jk;olympe.dc.ba.bb.regex=olympe.dc.ba.bb.Wr;olympe.dc.ba.bb.contains=olympe.dc.ba.bb.contains;olympe.dc.ba.bb.equals=olympe.dc.ba.bb.nb;function xe(a,b){return new olympe.dc.gb(a.G,a.source,b,a.F,{max:a.max,offset:a.offset})}function ye(a){return a.C.filter(b=>b instanceof olympe.dc.ba.Gb.hf||b instanceof olympe.dc.ba.Gb.jf).length}
|
|
505
|
+
function ze(a){const b=olympe.dc.ba.Gb.Nh,c=olympe.dc.ba.Gb.hf,d=olympe.dc.ba.Gb.jf,e=0===a.F.size?a.Bf():a;let f=-1,g=0;for(const h of a.C)h instanceof b&&(f=g),(h instanceof c||h instanceof d)&&g++;if(0<=f&&!e.F.has(f))throw Error('AndReturn was not called for the current level before sortBy operator');return e}
|
|
506
|
+
function Ae(a,b){const c=olympe.dc.Cd.SUBSCRIBE,d=olympe.dc.Cd.Ki,e=new olympe.dc.kf(a.G,b?c:d);for(const f of a.C)f instanceof olympe.dc.ba.Gb.hf?e.rb(f.Nd()):f instanceof olympe.dc.ba.Gb.jf?e.rb(f.Nd(),!0):f instanceof olympe.dc.ba.Gb.rc&&(a=f.C,a instanceof olympe.dc.ba.V.Ee&&(a=a.ed(),a.forEach(g=>e.rb(g)),Be(e,a.length)));return e}function Ce(a){return a.source||a.db.source(a.G)||olympe.dc.Ha.ic}
|
|
507
|
+
function De(a){return new olympe.dc.gb(a.r,a.s,a.qp.map(b=>Ee(b)),new Set(a.lv),{max:a.lp.m,offset:a.lp.o})}
|
|
508
|
+
olympe.dc.gb=class{constructor(a,b=null,c=[],d=new Set,e={max:-1,offset:0}){this.db=olympe.dc.Ja();this.G=olympe.dc.za(a);this.source=b;this.C=c;this.F=d;this.max=-1===e.max?-1:e.max;this.offset=e.offset;this.id=null}static from(a,b){return new olympe.dc.gb(a,b)}static Lk(a,b=olympe.dc.Ha.ic){return(new olympe.dc.gb(a,b)).rb(olympe.dc.CloudObject.instancesRel)}rb(a){const b=Array.from(this.C);b.push(new olympe.dc.ba.Gb.hf(this.db,a));return xe(this,b)}Qm(a,b=!1){const c=Array.from(this.C);c.push(new olympe.dc.ba.Gb.jf(this.db,
|
|
509
|
+
a,b));return xe(this,c)}Bf(){this.F.add(ye(this));return new olympe.dc.gb(this.G,this.source,this.C,this.F,{max:this.max,offset:this.offset})}filter(a){const b=Array.from(this.C);b.push(new olympe.dc.ba.Gb.rc(a));return xe(this,b)}Yi(){return this}limit(a,b=0){return new olympe.dc.gb(this.G,this.source,this.C,this.F,{max:a,offset:b})}Zk(a,b=olympe.dc.ba.ek.ASC){const c=Array.from(this.C);c.push(new olympe.dc.ba.Gb.Nh(this.db,a,b));return xe(this,c)}kb(a){return Fe(olympe.dc.Nf(),ze(this),'function'===
|
|
510
|
+
typeof a.Sa?a.C.C:a)}observe(a){return Ge(olympe.dc.Nf(),ze(this),'function'===typeof a.Sa?a.C.C:a)}Ic(){var a=ze(this);return olympe.dc.Nf().R.Ic(a)}Z(){null===this.id&&(this.id=olympe.X.pb(this.G+this.C.reduce((a,b)=>a+b.toString(),'')+Array.from(this.F).toString()+this.offset+this.max));return this.id}la(){return{r:this.G,qp:this.C.map(a=>a.la()),lv:Array.from(this.F),s:this.source,lp:{m:this.max,o:this.offset}}}};olympe.dc.gb.prototype.executeFromCache=olympe.dc.gb.prototype.Ic;
|
|
511
|
+
olympe.dc.gb.prototype.observe=olympe.dc.gb.prototype.observe;olympe.dc.gb.prototype.execute=olympe.dc.gb.prototype.kb;olympe.dc.gb.prototype.sortBy=olympe.dc.gb.prototype.Zk;olympe.dc.gb.prototype.limit=olympe.dc.gb.prototype.limit;olympe.dc.gb.prototype.cast=olympe.dc.gb.prototype.Yi;olympe.dc.gb.prototype.filter=olympe.dc.gb.prototype.filter;olympe.dc.gb.prototype.andReturn=olympe.dc.gb.prototype.Bf;olympe.dc.gb.prototype.followRecursively=olympe.dc.gb.prototype.Qm;
|
|
512
|
+
olympe.dc.gb.prototype.follow=olympe.dc.gb.prototype.rb;olympe.dc.gb.instancesOf=olympe.dc.gb.Lk;olympe.dc.gb.from=olympe.dc.gb.from;function Ee(a){const b=olympe.dc.Ja();switch(a.t){case 1:return(a=we(a.p))?new olympe.dc.ba.Gb.rc(a):null;case 2:return new olympe.dc.ba.Gb.hf(b,new olympe.dc.query.Relation(a.r.t,a.r.d,!1));case 3:var c=a.s;return new olympe.dc.ba.Gb.jf(b,new olympe.dc.query.Relation(a.r.t,a.r.d,!0),c);case 4:return c=a.o,new olympe.dc.ba.Gb.Nh(b,new olympe.dc.ua.Property(a.p),c);default:return null}}olympe.dc.ba.gk=class{la(){}F(){}kb(){}observe(){}toString(){}};function He(a){return a.G.map(b=>a.F.get(a.C[b]))}function Ie(a){return a.L.map(b=>{b=b.split('.');return 1===b.length?b[0]:b})}function Je(a){a=Array.from(a.F.values()).flat();return new Set(a.map(b=>b.T()))}function Ke(a){return new Set(a.L.flatMap(b=>b.split('.')))}
|
|
513
|
+
function Le(a,b){var c=olympe.dc.Ja();if(c.Db(a)){b.F(a,c.dd(a,!0),0);b.Va(olympe.dc.jc.Tc,a,c.model(a),0);for(const [d,e,f]of Kd(c,a))(c=b.Lf(f))&&c.re()&&(e===olympe.dc.Ca.DESTINATION?b.Va(d,a,f,0):b.Va(d,f,a,0))}else olympe.ra.Ya('Query Result').error(`Fail to serialize instance with tag ${a} not present in local DBView`)}
|
|
514
|
+
function Me(a,b,c=olympe.dc.Ha.Lc){b&&b((new olympe.dc.X.Ji(c)).C(a.p||[]));const d=olympe.dc.Ja();let e=!1;b=a.k.map(f=>{const g=f.split('.').map(h=>d.Db(h)?olympe.dc.CloudObject.get(h):(olympe.ra.Ya('QueryResult').error(`CloudObject with tag ${h} not present but required for deserialization`),e=!0,null));return[f,1===g.length?g[0]:g]});return e?null:olympe.dc.Xa.create(b,a.a,a.r)}
|
|
515
515
|
olympe.dc.Xa=class{constructor(){this.C=[];this.F=new Map;this.G=[];this.L=[];this.hash=''}static empty(){return new olympe.dc.Xa}[Symbol.iterator](){let a=0;return{next:()=>{var b={done:!0};a<this.C.length&&(b=this.C[a],b={value:[b,this.F.get(b)],done:!1},a++);return b}}}entries(){return this.C.map(a=>[a,this.F.get(a)])}values(){return this.F.values()}keys(){return this.C.values()}df(){return this.C.map(a=>this.F.get(a))}size(){return this.C.length}has(a){return this.F.has(a)||this.df().includes(a)}indexOf(a){return null===
|
|
516
|
-
a||void 0===a?-1:'string'===typeof a?this.C.indexOf(a):this.df().indexOf(a)}get(a){return(a=this.F.get(a))?a:null}
|
|
517
|
-
a(this.F.get(b),c))}map(a){return this.df().map(a)}sort(a){const b=this.entries().sort((c,d)=>a(c[1],d[1]));return olympe.dc.Xa.create(b,Array.from(this.G),Array.from(this.L))}reduce(a,b){return this.df().reduce(a,b)}concat(...a){const b=[this.entries(),...a.map(d=>d.entries())].flat();let c=Array.from(this.G);for(const d of a)c=c.concat(d.G.map(e=>e+c.length));a=this.L.concat(...a.map(d=>d.L));return olympe.dc.Xa.create(b,c,a)}static from(a,b){const c=olympe.dc.Ja();var d=
|
|
518
|
-
order:l,Id:n,
|
|
519
|
-
k[0])),f=new Set(a.keys()),g=[],h=[];d.forEach(([k],l)=>{!f.has(k)&&g.push(l)});f.forEach(k=>{!e.has(k)&&h.push(k)});return olympe.dc.Xa.create(d,g,h,b)}static create(a,b,c,d){const e=new olympe.dc.Xa;e.C=a.map(f=>f[0]);e.F=new Map(a);e.hash=d||olympe.X.
|
|
516
|
+
a||void 0===a?-1:'string'===typeof a?this.C.indexOf(a):this.df().indexOf(a)}get(a){return(a=this.F.get(a))?a:null}Oc(){return this.qe(0)}qe(a){return a<this.C.length?this.F.get(this.C[a]):null}push(...a){const b=this.df();b.push(...a);return b}pop(){if(0===this.C.length)return[];const a=this.df();a.pop();return a}shift(){if(0<this.C.length){const a=this.df();a.shift();return a}return[]}filter(a){return this.df().filter(a)}find(a){return(a=this.df().find(a))?a:null}forEach(a){this.C.forEach((b,c)=>
|
|
517
|
+
a(this.F.get(b),c))}map(a){return this.df().map(a)}sort(a){const b=this.entries().sort((c,d)=>a(c[1],d[1]));return olympe.dc.Xa.create(b,Array.from(this.G),Array.from(this.L))}reduce(a,b){return this.df().reduce(a,b)}concat(...a){const b=[this.entries(),...a.map(d=>d.entries())].flat();let c=Array.from(this.G);for(const d of a)c=c.concat(d.G.map(e=>e+c.length));a=this.L.concat(...a.map(d=>d.L));return olympe.dc.Xa.create(b,c,a)}static from(a,b){const c=olympe.dc.Ja();var d=Ne(b);if(b.Id){const {lb:k,
|
|
518
|
+
order:l,Id:n,Iv:p}=b.Id,q=Array.from(b.G).sort().indexOf(p),r=l===olympe.dc.ba.ek.ASC?1:-1;d.sort((t,u)=>{u=u[q];t=c.cb(t[q],k);u=c.cb(u,k);return null===t?-r:null===u?r:r*n(t,u)})}else d.sort((k,l)=>k.reduce((n,p,q)=>n||p.localeCompare(l[q]),0));0<b.offset&&(d=d.slice(b.offset));-1<b.max&&(d=d.slice(0,b.max));b=olympe.X.pb(d.flat().join(''));if(b===a.hash)return a;d=d.map(k=>[k.join('.'),1===k.length?olympe.dc.CloudObject.get(k[0]):k.map(l=>olympe.dc.CloudObject.get(l))]);const e=new Set(d.map(k=>
|
|
519
|
+
k[0])),f=new Set(a.keys()),g=[],h=[];d.forEach(([k],l)=>{!f.has(k)&&g.push(l)});f.forEach(k=>{!e.has(k)&&h.push(k)});return olympe.dc.Xa.create(d,g,h,b)}static create(a,b,c,d){const e=new olympe.dc.Xa;e.C=a.map(f=>f[0]);e.F=new Map(a);e.hash=d||olympe.X.pb(e.C.join(''));e.G=b||e.C.map((f,g)=>g);e.L=c||[];return e}la(){const a=new olympe.dc.db.uc;var b=new Set(this.G.flatMap(c=>this.C[c].split('.')));for(const c of b)Le(c,a);b=new olympe.dc.transaction.td;a.Mc(b);return{k:this.C,p:je(b),a:this.G,r:this.L}}};
|
|
520
520
|
olympe.dc.Xa.prototype.concat=olympe.dc.Xa.prototype.concat;olympe.dc.Xa.prototype.reduce=olympe.dc.Xa.prototype.reduce;olympe.dc.Xa.prototype.sort=olympe.dc.Xa.prototype.sort;olympe.dc.Xa.prototype.map=olympe.dc.Xa.prototype.map;olympe.dc.Xa.prototype.forEach=olympe.dc.Xa.prototype.forEach;olympe.dc.Xa.prototype.find=olympe.dc.Xa.prototype.find;olympe.dc.Xa.prototype.filter=olympe.dc.Xa.prototype.filter;olympe.dc.Xa.prototype.shift=olympe.dc.Xa.prototype.shift;olympe.dc.Xa.prototype.pop=olympe.dc.Xa.prototype.pop;
|
|
521
|
-
olympe.dc.Xa.prototype.push=olympe.dc.Xa.prototype.push;olympe.dc.Xa.prototype.getAt=olympe.dc.Xa.prototype.qe;olympe.dc.Xa.prototype.getFirst=olympe.dc.Xa.prototype.
|
|
522
|
-
olympe.dc.Xa.prototype.values=olympe.dc.Xa.prototype.values;olympe.dc.Xa.prototype.entries=olympe.dc.Xa.prototype.entries;olympe.dc.Xa.empty=olympe.dc.Xa.empty;function
|
|
523
|
-
function
|
|
524
|
-
olympe.dc.ba.
|
|
525
|
-
null;b=new Set;null!==c&&b.add(c);d.set(a,b);
|
|
526
|
-
null):a.
|
|
527
|
-
olympe.dc.ba.V.Qd.C=8;olympe.dc.ba.V.Qd.ma=[olympe.dc.ba.bb];olympe.dc.ba.V.Sc=class{constructor(a,b,c,d=!1){this.
|
|
528
|
-
a+this.toString()))}la(){return{pr:2,p:this.
|
|
529
|
-
this.C}toString(){return'Equals-'+this.
|
|
530
|
-
olympe.dc.ba.V.Ah=class{constructor(a,b,c=!0,d=!0){this.db=olympe.dc.Ja();this.
|
|
531
|
-
'string'===typeof this.C&&this.db.F(a,this.C,
|
|
532
|
-
olympe.dc.ba.V.Zd.C=7;olympe.dc.ba.V.Zd.ma=[olympe.dc.ba.bb];olympe.dc.ba.V.ud=class{constructor(a,b,c,d=!0){this.
|
|
533
|
-
p:this.
|
|
534
|
-
f,g,h)=>e?f?this.db.Pf(g,h,c):this.db.Pf(g,h):this.db.ub(g,h);for(let e=0;e<this.Oa.length;++e){const f=this.Oa[e],g=this.recursive[e],h=e===this.Oa.length-1;if(0===e)b=d(g,h,a,f);else if(b=b.flatMap(k=>d(g,h,k,f)),0===b.length)return!1}return c?b.includes(c):0<b.length}observe(a,b,c){const d=this.Oa.length;let e=0;const f=new Set,g=(k,l)=>{this.destination&&this.destination!==l||(e+=k?1:-1,1<e||c(0<e))},h=(k,l,n,p)=>{const q=this.Oa[k],r=this.recursive[k-1]?this.Oa[k-1]:null;l=olympe.X.
|
|
535
|
-
const t=olympe.X.
|
|
536
|
-
olympe.dc.ba.V.Ee.prototype.follow=olympe.dc.ba.V.Ee.prototype.rb;olympe.dc.ba.V.Ee.C=6;olympe.dc.ba.V.Ee.ma=[olympe.dc.ba.bb];olympe.dc.ba.Gb={};olympe.dc.ba.Gb.rc=class{constructor(a){this.C=a}F(a){return a}
|
|
537
|
-
olympe.dc.ba.Gb.rc.ma=[olympe.dc.ba.
|
|
538
|
-
olympe.dc.ba.Gb.hf.ma=[olympe.dc.ba.
|
|
539
|
-
h))};return(g,h,k,l)=>f(h,l,0,g,h)}la(){return{t:3,s:this.G,r:{t:this.C.T(),d:this.C.Ra()}}}toString(){return'followRecursivelyQueryPart-'+this.C.Ra()+this.C.T()}};olympe.dc.ba.Gb.jf.C=3;olympe.dc.ba.Gb.jf.ma=[olympe.dc.ba.
|
|
540
|
-
olympe.dc.ba.Gb.
|
|
541
|
-
function
|
|
542
|
-
function
|
|
543
|
-
function
|
|
544
|
-
function
|
|
545
|
-
function
|
|
546
|
-
olympe.dc.kf=class{constructor(a,b=olympe.dc.Cd.SUBSCRIBE){if(void 0===a||null===a)throw Error('Cannot create GraphDef with undefined or null baseTag');this.G=olympe.dc.za(a);this.L=b;this.C='not_defined';this.$=[];this.W=null;this.R=new Map;this.F=new Map;this.da=null;this.ja=(new Map).set(olympe.X.
|
|
547
|
-
b=c=>{const d=Object.create(null),e=c.Nd();d.t=e.T();d.d=e.Ra();d.r=e.recursive;d.c=c.jh().map(b);return d};a.t=this.G;a.o=this.L;a.f=
|
|
548
|
-
c=Array.from(this.R,([,d])=>b(d)).sort().join('');return a(`${this.L}-${this.G}${c}-${
|
|
549
|
-
case olympe.dc.Cd.
|
|
550
|
-
olympe.dc.query.
|
|
551
|
-
b){yield a;for(const c of b)yield*c.de()}(this.C,this.F.values())}da(a){const b=olympe.X.
|
|
552
|
-
k.C.delete(l)))):this.N.error(`A notification contains a block ${e} which is not present in the current graph query ${this.id}`)});
|
|
553
|
-
l))return!1;return!0})}};olympe.dc.query.
|
|
554
|
-
JSON.stringify(b)+', ';a.endsWith(', ')&&(a=a.substr(0,a.length-2));a+=']'}return a+'}'}static lc(a){var b;'string'===typeof a?b=JSON.parse(a):b=a;a=olympe.dc.query.Relation.lc(b.relation);a=new olympe.dc.query.
|
|
555
|
-
this.L.toString()}};function
|
|
556
|
-
olympe.dc.query.
|
|
557
|
-
b=a;a=olympe.dc.db.uc.lc(b.patch);a=new olympe.dc.query.
|
|
558
|
-
olympe.dc.query.
|
|
559
|
-
b=olympe.dm.Relation.C.
|
|
560
|
-
function
|
|
561
|
-
olympe.dc.Da=class{constructor(a,b,c){void 0===a||null===a?olympe.ra.Ya('dc').warn('attempt to create a listdef with a null or undefind basetag. This listdef is thus without effect.'):(this.F=olympe.D.Fa([a],olympe.dc.za,String),this.Y=void 0!==b&&(Array.isArray(b)?b:[b])||[],this.valueType=c||
|
|
562
|
-
null})}return this}nc(){null===this.C&&this.
|
|
563
|
-
this.nc();
|
|
564
|
-
this.nf())}zg(){const a=this.nc();
|
|
565
|
-
c)throw Error('ListDef.transform(): Trying to set an undefined transformer');if(c instanceof olympe.dc.ua.Property)throw Error(`ListDef.transform(): Properties cannot be used as transformer, unlike relations ${c}`);if(!c||'function'!==typeof c.getTransform)break;a.push(c)}b=new olympe.dc.Da(this.F,a);b.Ed(
|
|
566
|
-
void 0:this.valueType);let b=this.Y;b instanceof Array||(b=b?[b]:[]);a.transform(b);return a}toString(){let a=this.Y;a=a?', '+(a.join?a.join(', '):a.toString()):'';return'ListDef(#'+olympe.D.$a(this.F)+a+')'}
|
|
567
|
-
olympe.dc.Da.prototype.transform=olympe.dc.Da.prototype.transform;olympe.dc.Da.prototype.forEachCurrentValue=olympe.dc.Da.prototype.ae;olympe.dc.Da.prototype.forEach=olympe.dc.Da.prototype.forEach;olympe.dc.Da.prototype.getCurrentSize=olympe.dc.Da.prototype.zg;olympe.dc.Da.prototype.observeSize=olympe.dc.Da.prototype
|
|
568
|
-
olympe.dc.Da.prototype.getCurrentAt=olympe.dc.Da.prototype.Te;olympe.dc.Da.prototype.observeAt=olympe.dc.Da.prototype.
|
|
569
|
-
m.Ld.K=new olympe.D.J(()=>String,[]);m.
|
|
570
|
-
m.Hf.K=olympe.D.J.C;m.
|
|
571
|
-
olympe.dc.
|
|
572
|
-
'one of the argument is not a Transformer '+d);const e=d.Wb();null!==e&&(this.valueType=e);this.Y.push(d)}return this}
|
|
573
|
-
a.Wb()||olympe.dc.CloudObject;return this}
|
|
574
|
-
a);b=this.va.pop();break;case
|
|
575
|
-
const b=[];for(let c=0;c<a.length;c++)b.push(
|
|
576
|
-
a.forEach(e=>{c.push(e);d.push(e.Ra())});return this.Se(new olympe.dc.V.lf(c,d,b))}
|
|
577
|
-
olympe.dc.Y.rc&&this.va.push(
|
|
578
|
-
b));return this}sort(a,b,c){const d=new class extends olympe.dc.Bb.Ng{L(e,f){return a(olympe.dc.CloudObject.get(f))}G(e,f){return b(e,f).valueOf()}};this.Y.push(new olympe.dc.Y.Hd(d,c));return this}
|
|
579
|
-
function
|
|
580
|
-
m.
|
|
581
|
-
olympe.dc.query.
|
|
582
|
-
function
|
|
583
|
-
k),a.N.debug('QueryManager: [ID:',e,'] sending GraphQuery to',g),a.C.send(b));return f}function
|
|
584
|
-
function
|
|
585
|
-
function
|
|
586
|
-
function
|
|
587
|
-
function
|
|
588
|
-
function
|
|
589
|
-
function
|
|
590
|
-
function
|
|
591
|
-
function
|
|
592
|
-
e,[c]),d.bind(a,e.Z()));a.C.send(e)})}}olympe.dc.query.
|
|
593
|
-
olympe.dc.Ca.DESTINATION,b=olympe.dc.Ca.ORIGIN;return new olympe.dc.query.Relation(this.tag,this.direction===a?b:a,this.recursive)}toString(){return`${this.direction}${this.tag}${this.recursive?'-r':''}`}};olympe.dc.query.Subscription=class a extends olympe.D.
|
|
594
|
-
olympe.dc.Ja(),c=olympe.D.$a(this.Ld());return c?b.Wf(c)?b.source(c)||olympe.dc.Ha.
|
|
595
|
-
this.G.Pa.Kb;return b&&b.valueOf()>=olympe.dc.query.Subscription.C.
|
|
596
|
-
0,d=b.length;c<d;c++)this.
|
|
597
|
-
d)){b=!1;break}b&&this.Hc()}}bc(b){this.G.Pa.G()||(this.
|
|
598
|
-
else if(g instanceof olympe.dc.Y.wf)d=a.F(olympe.D.$a(g.Ld()),g.Cg()),b.push(...d);else if(g instanceof olympe.dc.Y.rc||g instanceof olympe.dc.Y.Hd){const h=g.F();b.forEach(k=>{for(const l of h){for(const n of l)k.rb(n,n.recursive);
|
|
599
|
-
function
|
|
600
|
-
function
|
|
601
|
-
function
|
|
602
|
-
olympe.U.config(function(a){D(a,olympe.dc.query.Config.
|
|
603
|
-
olympe.dc.query.Ub.
|
|
604
|
-
olympe.dc.query.Lb.
|
|
605
|
-
g,h,k,l,n,p,q)=>new olympe.dc.query.
|
|
606
|
-
olympe.dc.query.ua.
|
|
607
|
-
olympe.dc.query.ua.
|
|
608
|
-
n=!0;break}}n?a.N.debug('CoverageProcessor: [ID:',d,'] - graphPath',k,' is covered'):g(k,!0)});ac(f,(k,l)=>e(l));f.start()}function
|
|
609
|
-
b)}};olympe.dc.query.Ub.
|
|
610
|
-
olympe.dc.query.Ub.
|
|
611
|
-
for(let f=0,g=a.length;f<g;f++){const h=a[f];let k=
|
|
612
|
-
|
|
613
|
-
function
|
|
614
|
-
function
|
|
615
|
-
|
|
616
|
-
olympe.dc.query.Ub.
|
|
617
|
-
d,b,g);else{const p=M(
|
|
618
|
-
function
|
|
619
|
-
null==(h=a.ua.G.get(e))||
|
|
620
|
-
olympe.dc.query.Ub.
|
|
621
|
-
M(
|
|
622
|
-
[];null!==this.L&&(0<=this.F?Hg(
|
|
623
|
-
class
|
|
624
|
-
function
|
|
625
|
-
olympe.dc.pc.
|
|
626
|
-
this.L+')');this.L=a;
|
|
627
|
-
e&&(e=d);if(b<e)for(d=e;d>b;d--)c[d]=c[d-1],c[d].position=d;else for(d=e;d<b;d++)c[d]=c[d+1],c[d].position=d;c[b]=a;c[b].position=b}remove(a){const b=this.F,c=b.length-1;if(null!==a.position){for(a=a.position;a<c;a++)b[a]=b[a+1],b[a].position=a;b.length=c}}};olympe.dc.pc.
|
|
628
|
-
function
|
|
629
|
-
olympe.dc.pc.
|
|
630
|
-
|
|
631
|
-
function
|
|
632
|
-
olympe.dc.pc.
|
|
633
|
-
class
|
|
634
|
-
n(r,t,q,
|
|
635
|
-
olympe.dc.oa.
|
|
636
|
-
b;null!==this.Y
|
|
637
|
-
b);break;case olympe.dm.Boolean.O.T():d=new olympe.dc.oa.ue(c,b);break;case olympe.dm.DateTime.O.T():d=new olympe.dc.oa.je(c,b)}this.F=d}na(){return this.F.na()}C(){return this.F.C()}getValue(a,b){return this.F.getValue(a,b)}la(a){return this.F.la(a)}toString(){return this.F.toString()}};olympe.dc.oa.
|
|
521
|
+
olympe.dc.Xa.prototype.push=olympe.dc.Xa.prototype.push;olympe.dc.Xa.prototype.getAt=olympe.dc.Xa.prototype.qe;olympe.dc.Xa.prototype.getFirst=olympe.dc.Xa.prototype.Oc;olympe.dc.Xa.prototype.get=olympe.dc.Xa.prototype.get;olympe.dc.Xa.prototype.indexOf=olympe.dc.Xa.prototype.indexOf;olympe.dc.Xa.prototype.has=olympe.dc.Xa.prototype.has;olympe.dc.Xa.prototype.size=olympe.dc.Xa.prototype.size;olympe.dc.Xa.prototype.toArray=olympe.dc.Xa.prototype.df;olympe.dc.Xa.prototype.keys=olympe.dc.Xa.prototype.keys;
|
|
522
|
+
olympe.dc.Xa.prototype.values=olympe.dc.Xa.prototype.values;olympe.dc.Xa.prototype.entries=olympe.dc.Xa.prototype.entries;olympe.dc.Xa.empty=olympe.dc.Xa.empty;function Ne(a){var b=new Set(X(a,a.Ag()-1).keys());a.C.push((new Map).set('sink',b));b=[];for(const c of Oe(a,'sink',a.Ag()-1,''))b.push(c.slice(0,-1).split(';'));a.C.pop();return b}function Pe(a,b,c,d,e){a.Id={Id:b,Iv:c,order:d,lb:e}}function Qe(a){a.F||(a.F=!0)}function X(a,b){return b>=a.Ag()?new Map:a.C[b]}
|
|
523
|
+
function Oe(a,b,c,d){if(0===c)return a.G.has(c)?(b=Array.from(X(a,0).keys())[0],(new Set).add(`${b};${d}`)):(new Set).add(d);const e=Re(a,b,c),f=a.G.has(c)?`${b};${d}`:d;return e.reduce((g,h)=>{for(const k of Oe(a,h,c-1,f))g.add(k);return g},new Set)}function Re(a,b,c){return 0===c?null:(a=X(a,c))&&a.has(b)?Array.from(a.get(b)):null}function Se(a,b,c,d){X(a,c+1).forEach((e,f)=>{e.has(d)&&a.remove(f,c+1,b)});X(a,c).delete(d);Qe(a)}
|
|
524
|
+
olympe.dc.ba.gq=class{constructor(a){this.C=Array.from({length:ye(a)+1},()=>new Map);this.G=new Set(Array.from(a.F));this.Id=null;this.F=!1;this.max=a.max;this.offset=a.offset}Ag(){return this.C.length}insert(a,b,c){var d=X(this,b);if(0<b&&(null===c||!X(this,b-1).has(c)))return olympe.ra.Ya('dc').error('Try to insert result entry linked to a non existing parent'),null;if(d.has(a)&&null!==c)return a=d.get(a),d=a.size,a.add(c),a.size>d&&Qe(this),!1;if(b>=this.Ag())return olympe.ra.Ya('dc').error('Try to insert result entry to a higher level than possible'),
|
|
525
|
+
null;b=new Set;null!==c&&b.add(c);d.set(a,b);Qe(this);return!0}remove(a,b,c){var d=X(this,b);if(!d.has(a))return!0;if(0<b&&(null===c||!X(this,b-1).has(c)))return olympe.ra.Ya('dc').error('Try to remove result entry linked to a non existing parent'),null;d=d.get(a);c&&d.delete(c);if(1>d.size)return Se(this,a,b,a),!0;Qe(this);return!1}};olympe.dc.kd=class{constructor(a){this.query=a}static from(a){return new olympe.dc.kd(olympe.dc.gb.from(a))}rb(a){return new olympe.dc.kd(this.query.rb(a))}Yi(){return this}kb(a){return this.query.kb(a).then(b=>{const c=b.size();return 1<c?(olympe.ra.Ya('dc').warn('a follow() on a QuerySingle has '+c+' results (0 or 1 expected) -> returns null'),null):b.Oc()||null})}Ic(){const a=this.query.Ic(),b=a.size();return 1<b?(olympe.ra.Ya('dc').warn('a follow() on a QuerySingle has '+b+' results (0 or 1 expected) -> returns null'),
|
|
526
|
+
null):a.Oc()||null}};olympe.dc.kd.prototype.executeFromCache=olympe.dc.kd.prototype.Ic;olympe.dc.kd.prototype.execute=olympe.dc.kd.prototype.kb;olympe.dc.kd.prototype.cast=olympe.dc.kd.prototype.Yi;olympe.dc.kd.prototype.follow=olympe.dc.kd.prototype.rb;olympe.dc.ba.V={};olympe.dc.ba.V.Qd=class{constructor(...a){this.V=a}kb(a){return this.V.reduce((b,c)=>b&&c.kb(a),!0)}observe(a,b,c){const d=this.V.map(()=>!1),e=this.V.map(()=>null),f=(g,h)=>{d[h]=g;g=d.every(k=>k);e[h]!==g&&(e[h]=g,c(g))};this.V.forEach((g,h)=>{g.observe(a,olympe.X.pb('AND-'+b+a+h),k=>f(k,h))})}la(){return{pr:8,p:this.V.map(a=>a.la())}}toString(){return'And-'+this.V.reduce((a,b)=>a+'-'+b.toString(),'')}clear(a,b){this.V.forEach((c,d)=>{c.clear(a,olympe.X.pb('AND-'+b+a+d))})}};
|
|
527
|
+
olympe.dc.ba.V.Qd.C=8;olympe.dc.ba.V.Qd.ma=[olympe.dc.ba.bb];olympe.dc.ba.V.Sc=class{constructor(a,b,c,d=!1){this.lb=olympe.dc.za(a);this.substring=b;this.db=c;this.C=d}cb(){return this.lb}kb(a){return this.apply(this.db.cb(a,this.lb))}observe(a,b,c){Gd(this.db,a,this.lb,d=>{c(this.apply(d))},olympe.X.pb(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.lb+'-'+this.substring+'-'+this.C}clear(a,b){this.db.F(a,this.lb,olympe.X.pb(b+
|
|
528
|
+
a+this.toString()))}la(){return{pr:2,p:this.lb,s:this.substring,c:this.C}}};olympe.dc.ba.V.Sc.C=2;olympe.dc.ba.V.Sc.ma=[olympe.dc.ba.bb];olympe.dc.ba.V.Fc=class{constructor(a,b,c){this.lb=olympe.dc.za(a);this.C=b;this.db=c}kb(a){return this.apply(this.db.cb(a,this.lb))}observe(a,b,c){Gd(this.db,a,this.lb,d=>{c(this.apply(d))},olympe.X.pb(b+a+this.toString()))}clear(a,b){this.db.F(a,this.lb,olympe.X.pb(b+a+this.toString()))}apply(a){return'object'===typeof a&&null!==a?a instanceof olympe.dc.CloudObject?a.nb(this.C):a instanceof Date?this.C instanceof Date&&this.C.getTime()===a.getTime():a instanceof olympe.D.Color?a.nb(this.C):!1:a===
|
|
529
|
+
this.C}toString(){return'Equals-'+this.lb+'-'+this.C.toString()}cb(){return this.lb}la(){let a=1,b=this.C;switch(!0){case this.C instanceof Date:a=2;b=this.C.toJSON();break;case this.C instanceof olympe.dc.CloudObject:a=3;b=this.C.T();break;case this.C instanceof olympe.D.Color:a=4,b={r:this.C.Qf().valueOf(),g:this.C.Kf().valueOf(),b:this.C.Ff().valueOf(),a:this.C.Ef().valueOf()}}return{pr:1,p:this.lb,t:a,v:b}}};olympe.dc.ba.V.Fc.C=1;olympe.dc.ba.V.Fc.ma=[olympe.dc.ba.bb];function Te(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 Ue(a,b){return'number'===typeof a.C?a.C:a.db.cb(b,a.C)}function Ve(a,b,c){return olympe.X.pb(c+b+a.C+a.lb)}
|
|
530
|
+
olympe.dc.ba.V.Ah=class{constructor(a,b,c=!0,d=!0){this.db=olympe.dc.Ja();this.lb=olympe.dc.za(a);this.C='number'===typeof b?b:olympe.dc.za(b);this.F=c;this.G=d}cb(){return this.lb}kb(a){return Te(this,this.db.cb(a,this.lb),Ue(this,a))}observe(a,b,c){'string'===typeof this.C&&Gd(this.db,a,this.C,d=>{const e=this.db.cb(a,this.lb);null!==e&&c(Te(this,e,d))},Ve(this,a,b));Gd(this.db,a,this.lb,d=>{const e=Ue(this,a);c(null!==e?Te(this,d,e):!0)},Ve(this,a,b))}clear(a,b){this.db.F(a,this.lb,Ve(this,a,b));
|
|
531
|
+
'string'===typeof this.C&&this.db.F(a,this.C,Ve(this,a,b))}la(){return{pr:3,p:this.lb,b:this.C,l:this.F,s:this.G}}toString(){return'GreaterThan-'+this.lb+'-'+this.G+'-'+this.C}};olympe.dc.ba.V.Ah.C=3;olympe.dc.ba.V.Ah.ma=[olympe.dc.ba.bb];olympe.dc.ba.V.jd=class{constructor(a){this.C=a}kb(a){return!this.C.kb(a)}observe(a,b,c){let d=null;this.C.observe(a,olympe.X.pb('NOT'+b+a),e=>{!e!==d&&(d=!e,c(d))})}la(){return{pr:4,v:this.C.la()}}toString(){return`NOT-${this.C.toString()}`}clear(a,b){this.C.clear(a,olympe.X.pb('NOT'+b+a))}};olympe.dc.ba.V.jd.C=4;olympe.dc.ba.V.jd.ma=[olympe.dc.ba.bb];olympe.dc.ba.V.Zd=class{constructor(...a){this.V=a}kb(a){return this.V.reduce((b,c)=>b||c.kb(a),!1)}observe(a,b,c){const d=this.V.map(()=>!1),e=this.V.map(()=>null),f=(g,h)=>{d[h]=g;g=d.some(k=>k);e[h]!==g&&(e[h]=g,c(g))};this.V.forEach((g,h)=>{g.observe(a,olympe.X.pb('OR-'+b+a+h),k=>f(k,h))})}la(){return{pr:7,p:this.V.map(a=>a.la())}}toString(){return'And-'+this.V.reduce((a,b)=>a.toString()+'-'+b.toString(),'')}clear(a,b){this.V.forEach((c,d)=>{c.clear(a,olympe.X.pb('OR-'+b+a+d))})}};
|
|
532
|
+
olympe.dc.ba.V.Zd.C=7;olympe.dc.ba.V.Zd.ma=[olympe.dc.ba.bb];olympe.dc.ba.V.ud=class{constructor(a,b,c,d=!0){this.lb=olympe.dc.za(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.lb}kb(a){return this.apply(this.db.cb(a,this.lb))}observe(a,b,c){Gd(this.db,a,this.lb,d=>{c(this.apply(d))},olympe.X.pb(b+a+this.toString()))}apply(a){return'string'===typeof a?this.F?this.C.test(a):this.C.test(a.toLowerCase()):!1}toString(){return'Regex'+this.lb+'-'+this.C.toString()+'-'+this.F}la(){return{pr:5,
|
|
533
|
+
p:this.lb,r:this.C.source,c:this.F}}clear(a,b){this.db.F(a,this.lb,olympe.X.pb(b+a+this.toString()))}};olympe.dc.ba.V.ud.C=5;olympe.dc.ba.V.ud.ma=[olympe.dc.ba.bb];olympe.dc.ba.V.Ee=class{constructor(a){this.db=olympe.dc.Ja();this.Oa=[];this.recursive=[];this.destination=a?olympe.dc.za(a):null}ed(){return Array.from(this.Oa)}clear(a,b){0<this.Oa.length&&this.db.C(a,this.Oa[0],olympe.X.pb(b+0+a))}rb(a){this.Oa.push(a);this.recursive.push(!1);return this}Dk(a){this.Oa.push(a);this.recursive.push(!0);return this}kb(a){if(1>this.Oa.length)return olympe.ra.Ya('dc').error('RelatedTo executed with less than 1 relation'),!1;let b=[];const c=this.destination||'',d=(e,
|
|
534
|
+
f,g,h)=>e?f?this.db.Pf(g,h,c):this.db.Pf(g,h):this.db.ub(g,h);for(let e=0;e<this.Oa.length;++e){const f=this.Oa[e],g=this.recursive[e],h=e===this.Oa.length-1;if(0===e)b=d(g,h,a,f);else if(b=b.flatMap(k=>d(g,h,k,f)),0===b.length)return!1}return c?b.includes(c):0<b.length}observe(a,b,c){const d=this.Oa.length;let e=0;const f=new Set,g=(k,l)=>{this.destination&&this.destination!==l||(e+=k?1:-1,1<e||c(0<e))},h=(k,l,n,p)=>{const q=this.Oa[k],r=this.recursive[k-1]?this.Oa[k-1]:null;l=olympe.X.pb(l+k+p);
|
|
535
|
+
const t=olympe.X.pb(l+'rec');k===d?g(n,p):n?f.has(p)||(f.add(p),V(this.db,p,q,h.bind(this,k+1,l),l),r&&V(this.db,p,r,h.bind(this,k,t),t)):(f.delete(p),this.db.C(p,q,l),r&&this.db.C(p,r,t))};h(0,b,!0,a);0===e&&c(!1)}la(){return{pr:6,r:this.Oa.map((a,b)=>[a.T(),a.Ra(),this.recursive[b]]),d:this.destination}}toString(){const a=this.Oa.reduce((b,c,d)=>b+c.T()+this.recursive[d],'');return`RelatedTo-${this.destination}-${a}`}};olympe.dc.ba.V.Ee.prototype.followRecursive=olympe.dc.ba.V.Ee.prototype.Dk;
|
|
536
|
+
olympe.dc.ba.V.Ee.prototype.follow=olympe.dc.ba.V.Ee.prototype.rb;olympe.dc.ba.V.Ee.C=6;olympe.dc.ba.V.Ee.ma=[olympe.dc.ba.bb];olympe.dc.ba.Gb={};olympe.dc.ba.Gb.rc=class{constructor(a){this.C=a}F(a){return a}kb(a,b){for(const c of X(a,b).keys())this.C.kb(c)||(0===b?a.remove(c,b,null):Re(a,c,b).forEach(d=>{a.remove(c,b,d)}))}observe(a,b,c){let d=!1;return(e,f,g,h)=>{const k=olympe.X.pb(h+f+this.toString());e?this.C.observe(f,k,l=>{d||(l?a.insert(f,b,g):a.remove(f,b,g),c(l,f,g,k))}):(d=!0,this.C.clear(f,k),d=!1,c(!1,f,g,k))}}la(){return{t:1,p:this.C.la()}}toString(){return'filterQueryPart-'+this.C.toString()}};olympe.dc.ba.Gb.rc.C=1;
|
|
537
|
+
olympe.dc.ba.Gb.rc.ma=[olympe.dc.ba.gk];olympe.dc.ba.Gb.hf=class{constructor(a,b){this.db=a;this.C=b}Nd(){return this.C}F(a){return a+1}kb(a,b){for(const c of X(a,b).keys())this.db.ub(c,this.C).forEach(d=>{a.insert(d,b+1,c)})}observe(a,b,c){return(d,e,f,g)=>{const h=olympe.X.pb(g+e+this.toString());d?V(this.db,e,this.C,(k,l)=>{(k?a.insert(l,b+1,e):a.remove(l,b+1,e))&&c(k,l,e,h)},h):this.db.C(e,this.C,h)}}la(){return{t:2,r:{t:this.C.T(),d:this.C.Ra()}}}toString(){return'followQueryPart-'+this.C.Ra()+this.C.T()}};olympe.dc.ba.Gb.hf.C=2;
|
|
538
|
+
olympe.dc.ba.Gb.hf.ma=[olympe.dc.ba.gk];olympe.dc.ba.Gb.jf=class{constructor(a,b,c=!1){this.db=a;this.C=b;this.G=c}Nd(){return this.C}F(a){return a+1}kb(a,b){for(const c of X(a,b).keys())this.G&&a.insert(c,b+1,c),this.db.Pf(c,this.C).forEach(d=>{a.insert(d,b+1,c)})}observe(a,b,c){const d=(g,h,k,l)=>olympe.X.pb(g+h+k+l+this.toString()),e=new Set,f=(g,h,k,l,n)=>{h=d(h,g,n,k);(this.G||0<k)&&(l?a.insert(n,b+1,g):a.remove(n,b+1,g))&&c(l,n,g,h);l?e.has(n)||(e.add(n),V(this.db,n,this.C,f.bind(this,g,h,k+1),h)):(e.delete(n),this.db.C(n,this.C,
|
|
539
|
+
h))};return(g,h,k,l)=>f(h,l,0,g,h)}la(){return{t:3,s:this.G,r:{t:this.C.T(),d:this.C.Ra()}}}toString(){return'followRecursivelyQueryPart-'+this.C.Ra()+this.C.T()}};olympe.dc.ba.Gb.jf.C=3;olympe.dc.ba.Gb.jf.ma=[olympe.dc.ba.gk];function We(a){a=a.db.fc(a.lb,olympe.dm.Property.typeRel);const b=olympe.dc.za;if(a===b(olympe.dm.String))return Xe((c,d)=>c.localeCompare(d));if(a===b(olympe.dm.Number)||a===b(olympe.dm.Boolean))return Xe((c,d)=>c-d);if(a===b(olympe.dm.DateTime))return Xe((c,d)=>c.getTime()-d.getTime());olympe.ra.Ya('dc').warn(`No comparator found for type with tag ${a}`);return Xe(()=>-1)}function Xe(a){return(b,c)=>{const d=null===b,e=null===c;return d||e?d&&e?0:d?1:-1:a(b,c)}}
|
|
540
|
+
olympe.dc.ba.Gb.Nh=class{constructor(a,b,c){this.db=a;this.lb=b;this.order=c}F(a){return a}kb(a,b){Pe(a,We(this),b,this.order,this.lb)}observe(a,b,c){Pe(a,We(this),b,this.order,this.lb);return(d,e,f,g)=>{g=olympe.X.pb(g+this.toString());d?Gd(this.db,e,this.lb,()=>{Qe(a)},g):this.db.F(e,this.lb,g);c(d,e,f,g)}}la(){return{t:4,p:this.lb.T(),o:this.order}}toString(){return'sortByQueryPart-'+this.order+this.lb.T()}cb(){return this.lb}};olympe.dc.ba.Gb.Nh.C=4;olympe.dc.ba.Gb.Nh.ma=[olympe.dc.ba.gk];olympe.dc.query={};function Ye(a,b,c,d){let e=a.C.get(b);void 0===e&&(e=new Set,a.C.set(b,e));a=olympe.X.ec();e.add(a);d.set(a,c)}function Ze(a,b,c){Ye(a,b,c,a.F)}function $e(a,b,c){if(a.C.has(b)){for(const d of a.C.get(b))c.delete(d);a.C.delete(b)}}function af(a,b,c,d,e){if(a.C.has(b)){if(!a.L.has(b)){a.L.add(b);for(const f of a.C.get(b))e=d.get(f),d.delete(f),c instanceof olympe.dc.query.errors.Rj?e(Error(c.da()),c):'string'===typeof c?e(Error(c),null):e(null,c);a.C.delete(b);a.L.delete(b)}}else a.N.warn(e)}
|
|
541
|
+
function bf(a,b,c){af(a,b,c,a.F,`Graph result of graphdef ${b} has no associated handler in the datacloud`)}function cf(a,b,c){Ye(a,b,c,a.G)}olympe.dc.query.Cs=class{constructor(a){this.N=a;this.C=new Map;this.F=new Map;this.G=new Map;this.L=new Set}};olympe.dc.Me=class{na(){}L(){}G(){}R(){}la(){}toString(){}};olympe.dc.Cd={SUBSCRIBE:0,Ki:1,am:2,pB:0,GET:1};olympe.dc.Cd.toString=function(a){for(const [b,c]of Object.entries(olympe.dc.Cd))if(c===a)return b;return null};function Be(a,b=1){a.validate(olympe.dc.Qb.NONE,'back');let c=a.W;for(let d=0;d<b&&null!==c;d++)c=a.F.get(c.G)||null;a.W=c}function df(a){return'not_defined'===a.C?olympe.dc.Qb.NONE:a.C}function ef(a,b){a.validate(b,'activateFollowRules');return a}function ff(a){return'not_defined'!==a.C&&a.C!==olympe.dc.Qb.NONE}
|
|
542
|
+
function gf(a){if(ff(a))throw Error('An implicit GraphDef has no blocks');return a.F.values()}
|
|
543
|
+
function hf(a,b,c){c=new olympe.dc.query.Relation(b.T(),b.Ra(),c||b instanceof olympe.dc.Y.Bc);b=[];var d;for(var e of jf(a)){if(d=a.F.get(e)){var f=new olympe.dc.query.Qj(c,d.id);d.F.has(f.Z())?d=d.F.get(f.Z()):(d.F.set(f.Z(),f),d=f)}else{d=a;var g=c;const h=olympe.X.pb(d.G);f=olympe.X.pb(h+g.toString());g=d.F.get(f)||new olympe.dc.query.Qj(g,h);d.R.set(f,g);d=g}f=d.Z();a.F.set(f,d);b.push(f)}e=b[0];a.ja.set(e,b);return a.F.get(e)}
|
|
544
|
+
function kf(a,b){if(ff(a))a.$.push(b);else throw Error('You cannot add a "skip predicate" to an explicit graphdef. Please activate a follow rule first.');return a}function lf(a,b){a.da=b;return a}function mf(a){const b=new olympe.dc.kf(a.G,a.L);b.C=a.C;for(const [c,d]of a.R)b.R.set(c,d);for(const [c,d]of a.F)b.F.set(c,d);b.da=a.da;b.$=[...a.$];return b}function nf(a,b){return ff(a)?new olympe.dc.query.El(mf(a),b||olympe.D.La()):new olympe.dc.query.Pj(mf(a),b||olympe.D.La())}
|
|
545
|
+
function jf(a){let b=a.W;const c=[];for(;b&&b.Nd().recursive;)c.push(b.Z()),b=a.F.get(b.G)||null;c.push(b&&b.Z()||olympe.X.pb(a.G));const d=[];c.slice(0,5).forEach(e=>{d.push(...a.ja.get(e))});return d}
|
|
546
|
+
olympe.dc.kf=class{constructor(a,b=olympe.dc.Cd.SUBSCRIBE){if(void 0===a||null===a)throw Error('Cannot create GraphDef with undefined or null baseTag');this.G=olympe.dc.za(a);this.L=b;this.C='not_defined';this.$=[];this.W=null;this.R=new Map;this.F=new Map;this.da=null;this.ja=(new Map).set(olympe.X.pb(this.G),[olympe.X.pb(this.G)])}static Dc(a,b){olympe.dc.kf.Re([a],b)}static Re(a,b){const c=new olympe.dc.Transaction;a.forEach(d=>c.delete(d,olympe.dc.Qb.Ac));c.kb(b)}toJSON(){const a=Object.create(null),
|
|
547
|
+
b=c=>{const d=Object.create(null),e=c.Nd();d.t=e.T();d.d=e.Ra();d.r=e.recursive;d.c=c.jh().map(b);return d};a.t=this.G;a.o=this.L;a.f=df(this);a.b=Array.from(this.R.keys()).map(c=>b(this.F.get(c)));return JSON.stringify(a)}static lc(a){a='string'===typeof a?JSON.parse(a):a;const b=ef(new olympe.dc.kf(a.t,a.o),a.f),c=d=>{const e=new olympe.dc.ua.Relation(d.t,d.d);b.rb(e,d.r);for(const f of d.c)c(f);Be(b)};for(const d of a.b)c(d);return b}Z(){const a=olympe.X.pb,b=d=>d.Z()+d.jh().map(e=>b(e)).sort().join(''),
|
|
548
|
+
c=Array.from(this.R,([,d])=>b(d)).sort().join('');return a(`${this.L}-${this.G}${c}-${df(this)}`)}add(a,b=!1){this.validate(olympe.dc.Qb.NONE,'add');hf(this,a,b);return this}rb(a,b=!1){this.validate(olympe.dc.Qb.NONE,'follow');this.W=hf(this,a,b);return this}kb(a=b=>b){'not_defined'===this.C&&(this.C=olympe.dc.Qb.NONE);const b=olympe.dc.Nf();a=olympe.D.La().F(a);switch(this.L){case olympe.dc.Cd.SUBSCRIBE:case olympe.dc.Cd.Ki:const c=of(b,this,a);olympe.D.La().R(()=>{pf(olympe.dc.Nf(),c.Z())});break;
|
|
549
|
+
case olympe.dc.Cd.am:qf(b,this,a);break;default:throw Error('Wrong graph operation');}}validate(a,b){if('not_defined'!==this.C&&this.C!==a)throw Error(this.C!==olympe.dc.Qb.NONE?`Method ${b} can't be called on an implicit Graphdef`:`Method ${b} can't be called on an explicit Graphdef`);this.C=a}};function rf(a,b){a.data.Mc(b.data);a.C.forEach((c,d)=>{if(b.C.has(d))d=b.C.get(d),d.add.push(...c.add),d.remove.push(...c.remove);else{var e=c.remove;const f=new sf(d);f.add=c.add;f.remove=e;b.C.set(d,f)}})}function tf(a,b){a.C.forEach((c,d)=>b(d,c.add,c.remove))}olympe.dc.query.ht=class{constructor(a,b){this.id=a;this.C=new Map;this.data=b}Z(){return this.id}};class sf{constructor(a){this.id=a;this.add=[];this.remove=[]}Z(){return this.id}};function uf(a){return(a=a.C)&&olympe.dc.Ja().source(a)||olympe.dc.Ha.Lc}function vf(a){return Array.from(a.ta,b=>a.F.get(b))}function wf(a){if(!a.L){for(const b of a.R.values())b();a.R.clear();a.L=!0}}
|
|
550
|
+
olympe.dc.query.Pj=class{constructor(a,b){this.nh=a;this.C=a.G;this.id=a.Z();this.$=new olympe.D.Zb(`GraphSubscription ${this.id}`,b);this.N=olympe.ra.Ya('dc.query');this.ta=[];this.F=new Map;this.L=!1;this.R=new Map;b=olympe.X.pb(this.C);if(!ff(a))for(const c of gf(a))this.F.set(c.Z(),c),c.G===b&&this.ta.push(c.Z())}Z(){return this.id}Ke(a,b){b=b||olympe.X.ec();this.L?a():this.R.set(b,olympe.D.La().F(a));return b}oj(a){return this.R.delete(a)}onDestroy(a){this.$.onDestroy(a)}release(){this.$.destroy()}W(){return function*(a,
|
|
551
|
+
b){yield a;for(const c of b)yield*c.de()}(this.C,this.F.values())}da(a){const b=olympe.X.pb(this.C);xf(a,(c,d)=>{if(b!==c)if(c=this.F.get(c),void 0===c)this.N.error('Try to apply a block result that does not exists in the original query');else for(const e of d)c.C.add(e)})}ja(a){let b=[],c=[];const d=olympe.X.pb(this.C);tf(a,(e,f,g)=>{const h=d===e,k=this.F.get(e);h||void 0!==k?h?(b.push(...f),c.push(...g)):(b=b.concat(f.filter(l=>{k.C.has(l)?l=!1:(k.C.add(l),l=!0);return l})),c=c.concat(g.filter(l=>
|
|
552
|
+
k.C.delete(l)))):this.N.error(`A notification contains a block ${e} which is not present in the current graph query ${this.id}`)});Xc(olympe.dc.xd(),b,c)}wr(a){const b=a.C,c=[],d=this.C;d===b&&c.push(olympe.X.pb(d));this.F.forEach((k,l)=>{k.C.has(b)&&c.push(l)});const e=olympe.X.pb,f=this.F,g=(k,l)=>{const n=l.Nd(),p=[e(k+n),e(k+new olympe.dc.query.Relation(n.tag,n.direction,!0))].filter(q=>f.has(q));return 0<p.length?l.jh().reduce((q,r)=>q&&g(p[0],r),!0):!1},h=vf(a);return void 0!==c.find(k=>{for(const l of h)if(!g(k,
|
|
553
|
+
l))return!1;return!0})}};olympe.dc.query.Qj=class{constructor(a,b){this.L=a;this.F=new Map;this.C=new Set;this.G=b;this.id=olympe.X.pb(b+a.toString());this.apply=!0}toJSON(){let a='{ "id": '+JSON.stringify(this.id)+', "parentId": '+JSON.stringify(this.G)+', "apply": '+JSON.stringify(this.apply)+', ';a+='"relation": '+this.L.toJSON();if(0<this.F.size){a+=', "children": [';for(const b of this.F.values())a+=b.toJSON()+', ';a.endsWith(', ')&&(a=a.substr(0,a.length-2));a+=']'}if(0<this.C.size){a+=', "instances": [';for(const b of this.C)a+=
|
|
554
|
+
JSON.stringify(b)+', ';a.endsWith(', ')&&(a=a.substr(0,a.length-2));a+=']'}return a+'}'}static lc(a){var b;'string'===typeof a?b=JSON.parse(a):b=a;a=olympe.dc.query.Relation.lc(b.relation);a=new olympe.dc.query.Qj(a,b.parentId);a.id=b.id;a.apply=b.apply;if(b.instances)for(const c of b.instances)a.C.add(c);if(b.children)for(const c of b.children)b=olympe.dc.query.Qj.lc(c),a.F.set(b.id,b);return a}Z(){return this.id}Nd(){return this.L}jh(){return Array.from(this.F.values())}de(){return this.C.values()}toString(){return this.G+
|
|
555
|
+
this.L.toString()}};function xf(a,b){a.C.forEach((c,d)=>b(d,c))}
|
|
556
|
+
olympe.dc.query.Bi=class{constructor(a,b,c,d){this.id=a;this.source=b;this.destination=c;this.C=new Map;this.xc=d}toJSON(){let a=`{ "id": "${this.id}", "source": "${this.source}", "destination": "${this.destination}"`;a.endsWith(', ')&&(a=a.substr(0,a.length-2));a+=', "blocks": {';for(const [b,c]of this.C)a+=`"${b}": ${JSON.stringify(Array.from(c))}, `;a.endsWith(', ')&&(a=a.substr(0,a.length-2));a+=`}, "patch": ${this.xc.toJSON()}`;return a+'}'}static lc(a){let b;'string'===typeof a?b=JSON.parse(a):
|
|
557
|
+
b=a;a=olympe.dc.db.uc.lc(b.patch);a=new olympe.dc.query.Bi(b.id,b.source,b.destination,a);for(const [c,d]of Object.entries(b.blocks))a.C.set(c,new Set(d));return a}Z(){return this.id}};const yf=olympe.dc.jc.Tc,zf=olympe.dc.jc.wi,Af=olympe.dc.Ca.ORIGIN,Bf=olympe.dc.Ca.DESTINATION;function Cf(a,b,c){const d=a.nh.$;return c.filter(e=>d.reduce((f,g)=>f&&!g(b,e.Nd()),!0))}
|
|
558
|
+
olympe.dc.query.El=class extends olympe.dc.query.Pj{constructor(a,b){super(a,b);this.G=(new Set).add(a.G)}W(){return this.G.values()}da(a){a=a.xc;for(const b of a.de())b.L()?this.G.delete(b.tag()):b.re()&&this.G.add(b.tag())}ja(a){let b=[],c=[];tf(a,(d,e,f)=>{b=b.concat(e.filter(g=>{if(this.G.has(g)&&this.C!==g)return!1;this.G.add(g);return!0}));c=c.concat(f.filter(g=>this.G.delete(g)))});Xc(olympe.dc.xd(),b,c)}wr(a){var b=a.C,c=Array.from(a.F.values()),d=Cf(this,b,c);if(d.length===c.length&&!this.G.has(b))return!1;
|
|
559
|
+
b=olympe.dm.Relation.C.vk;c=olympe.dm.Relation.C.jk;const e=olympe.dc.Ja();for(const h of d){var f=h.Nd(),g=f.T();d=f.Ra();if(d!==Bf||g!==yf&&g!==zf){if(!e.Db(f))return this.N.info('ImplicitGraphQuery: checking coverage of graphPath',a.Z(),'failed at the relation',g,'which is not in local DB'),!1;f=Jd(e,f,df(this.nh));g=0===h.jh().length;if(!(f&(d===Af?g?12:c:g?3:b)))return!1}}return!0}};function Df(a){let b=null;for(a=[...a.Y];null===b&&0<a.length;)b=a.pop().Wb();return b}function Ef(a,b){a.W()||(a=`Calling "${b}" on subscription with id ${a.Z()} while it is not ready (thus no data is available).`+'This call should be made within an onReady callback.',olympe.ra.Ya('dc').warn(a))}
|
|
560
|
+
function Ff(a,b){const c=new olympe.D.Zb('listDef toObservable',a.nc().Bh());return new rxjs.Observable(d=>{c.run(()=>{olympe.D.yc([b],e=>{d.next(e.valueOf())})});c.onDestroy(()=>{d.complete()});return c.destroy.bind(c)})}
|
|
561
|
+
olympe.dc.Da=class{constructor(a,b,c){void 0===a||null===a?olympe.ra.Ya('dc').warn('attempt to create a listdef with a null or undefind basetag. This listdef is thus without effect.'):(this.F=olympe.D.Fa([a],olympe.dc.za,String),this.Y=void 0!==b&&(Array.isArray(b)?b:[b])||[],this.valueType=c||Df(this),this.C=null)}Pc(){return olympe.dc.Pc()}kb(){if(null===this.C){const a=olympe.dc.Nf();this.C=Gf(a,this);null!==this.valueType&&this.C.Ed(this.valueType);olympe.D.La().R(()=>{Hf(a,this.C.Z());this.C=
|
|
562
|
+
null})}return this}nc(){null===this.C&&this.kb();return this.C}Ed(a){this.valueType=a;null!==this.C&&this.C.Ed(this.valueType)}Wb(){return null!==this.C?this.C.Wb():null===this.valueType?olympe.dc.CloudObject:this.valueType}Ld(){return this.F}Hl(){return this.Y}Ke(a,b){return this.nc().Ke(a,b)}oj(a){this.nc().oj(a)}At(){return this.nc().Kd()}zt(){return this.nc().W()}get(a){return this.nc().get(a)}di(){return this.nc().di()}kh(a){const b=this.nc();Ef(b,'getCurrent');return b.kh(a)}has(a){return this.nc().has(a)}Eg(a){const b=
|
|
563
|
+
this.nc();Ef(b,'hasCurrent');return b.Eg(a)}qe(a){return this.nc().qe(a)}Yx(a){return Ff(this,this.qe(a))}Te(a){const b=this.nc();Ef(b,'getCurrentAt');return b.Te(a)}Ue(a){return this.nc().Ue(a)}Gf(a){const b=this.nc();Ef(b,'getCurrentKeyAt');return b.Gf(a)}ee(a){return this.nc().ee(a)}by(a){return Ff(this,this.ee(a))}Hf(a){const b=this.nc();Ef(b,'getCurrentRank');return b.Hf(a)}Oc(){return this.nc().Oc()}Zx(){return Ff(this,this.Oc())}If(){return this.nc().If()}nf(){return this.nc().nf()}ey(){return Ff(this,
|
|
564
|
+
this.nf())}zg(){const a=this.nc();Ef(a,'getCurrentSize');return a.zg()}forEach(a,b){this.nc().forEach(a,b)}ae(a){const b=this.nc();Ef(b,'forEachCurrentValue');return b.ae(a)}aj(a,b,c,d){a=new olympe.dc.Y.Xd(a,b);(new olympe.dc.Da(this.F,[...this.Y,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.Y];for(const c of b){if(void 0===
|
|
565
|
+
c)throw Error('ListDef.transform(): Trying to set an undefined transformer');if(c instanceof olympe.dc.ua.Property)throw Error(`ListDef.transform(): Properties cannot be used as transformer, unlike relations ${c}`);if(!c||'function'!==typeof c.getTransform)break;a.push(c)}b=new olympe.dc.Da(this.F,a);b.Ed(Df(b)||this.valueType||Object);return b}$k(a){return this.transform(new olympe.dc.Y.wf(a))}filter(a){return this.transform(new olympe.dc.Y.rc(a))}vg(){const a=new olympe.dc.Zj(this.F,null===this.valueType?
|
|
566
|
+
void 0:this.valueType);let b=this.Y;b instanceof Array||(b=b?[b]:[]);a.transform(b);return a}toString(){let a=this.Y;a=a?', '+(a.join?a.join(', '):a.toString()):'';return'ListDef(#'+olympe.D.$a(this.F)+a+')'}yt(){return this.nc().Ug()}Rc(){return olympe.D.Fa([this.nf()],a=>{let b='[';for(let c=0;c<a;c++){const d=this.Te(c).toString();b=0<c&&c<a?b+(', '+d):b+d}return olympe.D.yb(b+']')},olympe.D.Za)}};olympe.dc.Da.prototype.filter=olympe.dc.Da.prototype.filter;olympe.dc.Da.prototype.union=olympe.dc.Da.prototype.$k;
|
|
567
|
+
olympe.dc.Da.prototype.transform=olympe.dc.Da.prototype.transform;olympe.dc.Da.prototype.forEachCurrentValue=olympe.dc.Da.prototype.ae;olympe.dc.Da.prototype.forEach=olympe.dc.Da.prototype.forEach;olympe.dc.Da.prototype.getCurrentSize=olympe.dc.Da.prototype.zg;olympe.dc.Da.prototype.observeSize=olympe.dc.Da.prototype.ey;olympe.dc.Da.prototype.observeFirst=olympe.dc.Da.prototype.Zx;olympe.dc.Da.prototype.getCurrentRank=olympe.dc.Da.prototype.Hf;olympe.dc.Da.prototype.observeRank=olympe.dc.Da.prototype.by;
|
|
568
|
+
olympe.dc.Da.prototype.getCurrentAt=olympe.dc.Da.prototype.Te;olympe.dc.Da.prototype.observeAt=olympe.dc.Da.prototype.Yx;olympe.dc.Da.prototype.offReady=olympe.dc.Da.prototype.oj;olympe.dc.Da.prototype.onReady=olympe.dc.Da.prototype.Ke;olympe.dc.Da.prototype.getBaseTag=olympe.dc.Da.prototype.Ld;olympe.dc.Da.ma=[olympe.D.md];m=olympe.dc.Da.prototype;m.Pc.K=olympe.D.J.C;m.kb.K=olympe.D.J.L();m.nc.K=new olympe.D.J(()=>olympe.dc.query.Subscription,[]);m.Ed.K=new olympe.D.J(()=>{},[]);
|
|
569
|
+
m.Ld.K=new olympe.D.J(()=>String,[]);m.Hl.K=new olympe.D.J(()=>Array,[]);m.Ke.K=new olympe.D.J(()=>String,[]);m.oj.K=new olympe.D.J(()=>{},[]);m.At.K=olympe.D.J.R;m.zt.K=olympe.D.J.C;m.get.K=new olympe.D.J(()=>olympe.dc.CloudObject,[],'valueType');m.di.K=new olympe.D.J(()=>Array,[]);m.kh.K=olympe.D.J.C;m.has.K=olympe.D.J.R;m.Eg.K=olympe.D.J.C;m.qe.K=new olympe.D.J(()=>olympe.dc.CloudObject,[],'valueType');m.Te.K=olympe.D.J.C;m.Ue.K=new olympe.D.J(()=>String,[]);m.Gf.K=olympe.D.J.C;m.ee.K=olympe.D.J.G;
|
|
570
|
+
m.Hf.K=olympe.D.J.C;m.Oc.K=new olympe.D.J(()=>olympe.dc.CloudObject,[],'valueType');m.If.K=new olympe.D.J(()=>String,[]);m.nf.K=olympe.D.J.G;m.zg.K=olympe.D.J.C;m.forEach.K=new olympe.D.J(()=>{},[]);m.ae.K=olympe.D.J.C;m.aj.K=new olympe.D.J(()=>{},[]);m.transform.K=new olympe.D.J(()=>olympe.dc.Da,[]);m.$k.K=new olympe.D.J(()=>olympe.dc.Da,[]);m.filter.K=new olympe.D.J(()=>olympe.dc.Da,[]);m.vg.K=new olympe.D.J(()=>olympe.dc.Zj,[]);m.toString.K=olympe.D.J.C;m.yt.K=olympe.D.J.C;m.Rc.K=olympe.D.J.F;const If={Vy:'append',tl:'filter_not',Go:'filter_and',Ho:'filter_or'};function Jf(a,b){a=Kf(a);a=olympe.dc.CloudObject.get(a);return(new olympe.dc.oa.Gn(a,b)).F}
|
|
571
|
+
olympe.dc.Zj=class{constructor(a,b){this.C=Kf(a);this.N=olympe.dc.Nf().Ya();this.valueType=void 0===b?olympe.dc.CloudObject:b;this.Y=[];this.va=[]}pf(){return new olympe.dc.Da(this.C,this.Y,this.valueType)}transform(a){for(let b=0,c=a.length,d;b<c;b++){d=a[b];if(void 0===d)throw new Lf('transform','Trying to set an undefined transformer');if(d instanceof olympe.dc.ua.Property)throw new Lf('transform','Properties cannot be used as transformer, unlike relations '+d);if(!d||'function'!==typeof d.getTransform)throw new Lf('transform',
|
|
572
|
+
'one of the argument is not a Transformer '+d);const e=d.Wb();null!==e&&(this.valueType=e);this.Y.push(d)}return this}$k(a){this.Y.push(new olympe.dc.Y.wf(a));return this}Sy(a){this.Y.push(new olympe.dc.Y.wf(Kf(a)));return this}Ct(a){this.valueType=a;return this}rb(a){this.Y.push(a);this.valueType=a.Wb()||olympe.dc.CloudObject;return this}ew(a){for(const b of a)this.Y.push(b),this.valueType=b.Wb()||olympe.dc.CloudObject;return this}Dk(a,b,c){a=new olympe.dc.Y.Bc(a,a.Ra(),b,c);this.Y.push(a);this.valueType=
|
|
573
|
+
a.Wb()||olympe.dc.CloudObject;return this}dw(a){const b=[];let c;for(let d=0;d<a.length;d++){const e=a[d];b.push(e.T());void 0===c&&(c=e.Ra())}a=new olympe.dc.Y.Ce(b,c);this.Y.push(a);this.valueType=a.Wb()||olympe.dc.CloudObject;return this}Bt(){this.rb(olympe.dc.CloudObject.instancesRel);return this}Se(a){var b=this.va.pop();b===If.tl&&(a=new olympe.dc.V.jd(a),b=this.va.pop());switch(b){case If.Go:b=this.Y.pop().C;b instanceof olympe.dc.V.Qd?(b=b.V,b.push(a),a=new olympe.dc.V.Qd(...b)):a=new olympe.dc.V.Qd(b,
|
|
574
|
+
a);b=this.va.pop();break;case If.Ho:b=this.Y.pop().C,b instanceof olympe.dc.V.Zd?(b=b.V,b.push(a),a=new olympe.dc.V.Zd(...b)):a=new olympe.dc.V.Zd(b,a),b=this.va.pop()}b===If.tl&&(a=new olympe.dc.V.jd(a),this.va.pop());this.Y.push(new olympe.dc.Y.rc(a));return this}Zv(a,b,c){return this.Se(new olympe.dc.V.Fc(Jf(a,c),new olympe.dc.oa.Bd(b)))}contains(a,b,c=!1,d){return this.Se(new olympe.dc.V.Sc(Jf(a,d),new olympe.dc.oa.Bd(b),c))}Rf(a){if(!(a instanceof Array))throw new Lf('instanceOf','Provided argument "models" must be an array.');
|
|
575
|
+
const b=[];for(let c=0;c<a.length;c++)b.push(Kf(a[c]));return this.Se(new olympe.dc.V.mf(b))}Kk(a){return this.Se(new olympe.dc.V.Fc(new olympe.dc.oa.uf,new olympe.dc.oa.Bd(Kf(a))))}$v(a){if(!Array.isArray(a))throw Error('ExcludeInstances should be called with an array');if(0<a.length){this.not().Kk(a[0]);for(let b=1,c=a.length;b<c;b++)this.and().not().Kk(a[b])}return this}ij(a,b){if(!(a instanceof Array))throw new Lf('hasRelated','Provided argument "relations" must be an array.');const c=[],d=[];
|
|
576
|
+
a.forEach(e=>{c.push(e);d.push(e.Ra())});return this.Se(new olympe.dc.V.lf(c,d,b))}Jk(a,b,c){a=Jf(a,c);return this.Se(new olympe.dc.V.ze(a,new olympe.dc.oa.Bd(b)))}uj(a,b,c){a=Jf(a,c);return this.Se(new olympe.dc.V.Ge(a,new olympe.dc.oa.Bd(b)))}Jx(a,b,c,d){a=Jf(a,d);return this.Se(new olympe.dc.V.ud(a,b,c))}filter(a){const b=new class extends olympe.dc.V.Ng{C(c,d){return a(olympe.dc.CloudObject.get(d))}};return this.Se(b)}not(){this.va.push(If.tl);return this}and(){this.Y[this.Y.length-1]instanceof
|
|
577
|
+
olympe.dc.Y.rc&&this.va.push(If.Go);return this}or(){this.Y[this.Y.length-1]instanceof olympe.dc.Y.rc&&this.va.push(If.Ho);return this}Zk(a,b,c){a=Kf(a);let d=null;switch(olympe.dc.Ja().fc(a,olympe.dm.Property.typeRel)){case olympe.dm.String.O.T():d=new olympe.dc.Bb.String(new olympe.dc.oa.pe(a,c));break;case olympe.dm.Number.O.T():d=new olympe.dc.Bb.Number(new olympe.dc.oa.le(a,c));break;case olympe.dm.DateTime.O.T():d=new olympe.dc.Bb.DateTime(new olympe.dc.oa.je(a,c))}c=d;null!==c&&this.Y.push(new olympe.dc.Y.Hd(c,
|
|
578
|
+
b));return this}sort(a,b,c){const d=new class extends olympe.dc.Bb.Ng{L(e,f){return a(olympe.dc.CloudObject.get(f))}G(e,f){return b(e,f).valueOf()}};this.Y.push(new olympe.dc.Y.Hd(d,c));return this}Vv(){this.Y.push(new olympe.dc.Y.xe);return this}limit(a,b){this.Y.push(new olympe.dc.Y.Xd(a,b));return this}};class Lf extends Error{constructor(a,b){super(`ListDefBuilder.${a}(): ${b}`)}}
|
|
579
|
+
function Kf(a){return'string'===typeof a||a instanceof olympe.D.Za?a:'function'===typeof a?olympe.dc.ya.Nb(a):olympe.D.ob(a)?a.yk===olympe.D.Za?a:olympe.D.Fa([a],b=>olympe.D.yb(olympe.dc.za(b)),olympe.D.Za):a.T()}m=olympe.dc.Zj.prototype;m.pf.K=new olympe.D.J(()=>olympe.dc.Da,[]);m.transform.K=olympe.D.J.L();m.$k.K=olympe.D.J.L();m.Sy.K=olympe.D.J.L();m.Ct.K=olympe.D.J.L();m.rb.K=olympe.D.J.L();m.ew.K=olympe.D.J.L();m.Dk.K=olympe.D.J.L();m.dw.K=olympe.D.J.L();m.Bt.K=olympe.D.J.L();m.Se.K=olympe.D.J.L();
|
|
580
|
+
m.Zv.K=olympe.D.J.L();m.contains.K=olympe.D.J.L();m.Rf.K=olympe.D.J.L();m.Kk.K=olympe.D.J.L();m.$v.K=olympe.D.J.L();m.ij.K=olympe.D.J.L();m.Jk.K=olympe.D.J.L();m.uj.K=olympe.D.J.L();m.Jx.K=olympe.D.J.L();m.filter.K=olympe.D.J.L();m.not.K=olympe.D.J.L();m.and.K=olympe.D.J.L();m.or.K=olympe.D.J.L();m.Zk.K=olympe.D.J.L();m.sort.K=olympe.D.J.L();m.Vv.K=olympe.D.J.L();m.limit.K=olympe.D.J.L();olympe.dc.query.Dp=class{constructor(a){this.id=a;this.C=[];this.data=new olympe.dc.db.uc}F(a){this.C.push(olympe.dc.za(a))}Z(){return this.id}getData(){return this.data}};function Mf(a){return olympe.D.ob(a)?'Node#'+a.Pa.Z():String(a)}function Nf(a,b){return olympe.D.ob(b)?'{"c":"Parameter","v":"'+a.add(b)+'"}':JSON.stringify(b)}
|
|
581
|
+
olympe.dc.query.vu=class{constructor(){this.C=0;this.values=null}add(a){let b;b=olympe.D.ob(a)?'n'+a.Pa.Z():'p'+ ++this.C;null===this.values&&(this.values={});this.values[b]=a;return b}get(a){return this.values[a]}clear(){const a=this.values;if(null!==a)for(let b=Object.keys(a),c=b.length,d=0;d<c;d++)delete a[b[d]]}forEach(a){const b=this.values;if(null!==b)for(let c=Object.keys(b),d=c.length,e=0;e<d;e++)a(b[c[e]],c[e])}};olympe.dc.bb=class{na(){}C(){}F(){}la(){}toString(){}};function Fe(a,b,c){return a.G.run(()=>a.R.kb(b,c))}function Ge(a,b,c){return a.G.run(()=>Of(a.R,b,c))}
|
|
582
|
+
function of(a,b,c){var d=olympe.dc.Ha.sb;const e=b.Z();let f=Pf(a.ua,e),g=olympe.dc.Ha.sb;null===f&&(f=nf(b,a.G),a.L||(g=uf(f)));Qf(a.ua,f,d,g);c&&Ze(a.F,e,c);b=olympe.dc.ha.ia.zi;const h=olympe.dc.ha.ia.yi,k=l=>{if(null!==l){a.N.error(`graph subscription "${e}" failed to subscribe ${l}`);Rf(a.ua,e,d);var n=a.F;$e(n,e,n.F);c(l,null)}};g===olympe.dc.Ha.sb?(a.N.debug('QueryManager: [ID:',e,'] GraphQuery processed locally'),a.W.process(d,f,k)):(b=M(new olympe.dc.ha(f.nh.L===olympe.dc.Cd.Ki?h:b,f,[g]),
|
|
583
|
+
k),a.N.debug('QueryManager: [ID:',e,'] sending GraphQuery to',g),a.C.send(b));return f}function pf(a,b){var c=olympe.dc.Ha.sb;const d=olympe.dc.Ha.sb;if(c===d){const e=Pf(a.ua,b).nh.L,f=Sf(a.ua,b);Rf(a.ua,b,c)&&f!==d&&e===olympe.dc.Cd.SUBSCRIBE&&(c=M(new olympe.dc.ha(olympe.dc.ha.ia.Qo,String(b),[f]),g=>{g&&a.N.error(`Unsubscription of graphdef ${b} failed: ${g.message}`)}),a.C.send(c))}else Rf(a.ua,b,c)}
|
|
584
|
+
function qf(a,b,c){var d=olympe.dc.Ha.sb;b=nf(b,a.G);const e=b.Z();var f=a.F.C.has(e);c&&Ze(a.F,e,c);if(!f){f=h=>{if(h){var k=a.F;$e(k,e,k.F);c(h,null)}};var g=uf(b);g===olympe.dc.Ha.sb?a.W.process(d,b,f):(d=M(new olympe.dc.ha(olympe.dc.ha.ia.yi,b,[g]),f),a.C.send(d))}}
|
|
585
|
+
function Gf(a,b){var c=olympe.dc.Ha.sb;const d=b.Ld();var e=new olympe.dc.query.vu;let f;f=d;olympe.D.ob(f)&&(f=e.add(d));b=(b=b.Hl())?Array.isArray(b)?b:[b]:null;const g=olympe.dc.query.Subscription.G(f,b,e);e=Tf(a.ua,g);null===e&&(a.N.debug('QueryMGR: new',a.L?'local':'remote','subscription "',g,'": #',`${f},`,b),e=new olympe.dc.query.Subscription(g,d,b,a.G),a.L||e.Xc());a.Ka.process(c,e,h=>{h&&(Uf(a.ua,g,c||olympe.dc.Ha.sb),a.N.error(`subscription "${g}" failed to subscribe ${h}`))});return e}
|
|
586
|
+
function Hf(a,b){var c=olympe.dc.Ha.sb;if(c===olympe.dc.Ha.sb){const d=Sf(a.ua,b);a.N.debug('QueryMGR: [ID:',b,'] - Unregistered');Uf(a.ua,b,c)&&d!==olympe.dc.Ha.sb&&(c=M(new olympe.dc.ha(olympe.dc.ha.ia.Tu,String(b),[d]),e=>{e&&a.N.error(`Unsubscription of listdef ${b} failed, ${e.message}`)}),a.C.send(c))}else Uf(a.ua,b,c)}
|
|
587
|
+
function Vf(a){const b=olympe.dc.ha.ia.Ro,c=olympe.dc.ha.ia.ml,d=olympe.dc.ha.ia.wp;a.C.C(olympe.dc.ha.ia.wl,(e,f)=>{Wf(a,f,e)});a.C.C(b,(e,f)=>{Xf(a,f,e)});a.C.C(c,(e,f)=>{a.$.$e(f,e)});a.C.C(d,(e,f)=>{Yf(a,f,e)});a.C.ja((e,f)=>{Zf(a,f,e)})}function $f(a,b){a.N.log('Received subscribeToAll command');b=b?olympe.D.La().F(b):void 0;const c=new olympe.dc.ha(olympe.dc.ha.ia.Rg,null,[olympe.dc.Ha.Lc]);b&&M(c,b);a.C.send(c)}
|
|
588
|
+
function Wf(a,b,c=olympe.dc.Ha.sb){b.destination!==olympe.dc.Ha.sb?a.N.error(`Graphdefs registered from peers is not supported yet ! (id: ${b.Z()})`):a.ja.process(c,b,d=>{d&&a.N.error(`An error occurred during the process of a graphdef result ${b.Z()}: ${d.message}`)})}
|
|
589
|
+
function Xf(a,b,c=olympe.dc.Ha.sb){const d=ag(a.ua,b.Z());0!==d.length&&(1<d.length||d[0]!==olympe.dc.Ha.sb?a.N.error(`Notification received for graphdefs subscription registered from peers. Not supported yet ! (id: ${b.Z()})`):a.da.process(c,b,e=>{e&&a.N.error(`An error occurred during the process of a graphNotification ${b.Z()}`)}))}
|
|
590
|
+
function Yf(a,b,c=olympe.dc.Ha.sb){const d=bg(a.ua,b.Z());1<d.length||d[0]!==olympe.dc.Ha.sb?a.N.error(`Listdefs registered from peers is not supported yet ! (id: ${b.Z()})`):a.ta.process(c,b,e=>{e&&a.N.error(`An error occurred during the process of a listNotification ${b.Z()}`)})}
|
|
591
|
+
function Zf(a,b,c){a.N.debug('Source event',b,'received for source',c);if(b===olympe.dc.qk.Up){const d=(e,f)=>{f&&a.N.error(`Error after trying to resubscribe to ${e}: ${f}`)};cg(a.ua,c).forEach(e=>{Ze(a.F,e.Z(),d.bind(a,e.Z()));a.N.debug(`resubscribing graph subscription ${e.Z()} to destination : ${c}`);e=M(new olympe.dc.ha(olympe.dc.ha.ia.zi,e,[c]),d.bind(a,e.Z()));a.C.send(e)});dg(a.ua,c).forEach(e=>{a.N.debug(`resubscribing list subscription ${e.Z()} to destination : ${c}`);e=M(new olympe.dc.ha(olympe.dc.ha.ia.Ru,
|
|
592
|
+
e,[c]),d.bind(a,e.Z()));a.C.send(e)})}}olympe.dc.query.Bu=class{constructor(a,b,c,d,e,f,g,h){this.N=a;this.L=b;this.C=c;this.$=d;this.ua=e;this.F=f;this.G=new olympe.D.Zb('Query Manager context');this.Ka=g[0];this.W=g[1];this.ja=g[2];this.da=g[3];this.ta=g[4];this.R=h;Vf(this)}Ya(){return this.N}};olympe.dc.query.Relation=class extends olympe.dc.ua.Relation{constructor(a,b,c){super(a,b);this.recursive=c}toJSON(){let a='{ "tag": '+JSON.stringify(this.T())+', ';a+='"direction": '+JSON.stringify(this.Ra())+', ';a+='"recursive": '+JSON.stringify(this.recursive);return a+'}'}static lc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.dc.query.Relation(b.tag,b.direction,b.recursive)}static from(a){return new olympe.dc.query.Relation(a.T(),a.Ra(),a instanceof olympe.dc.Y.Bc)}Ec(){const a=
|
|
593
|
+
olympe.dc.Ca.DESTINATION,b=olympe.dc.Ca.ORIGIN;return new olympe.dc.query.Relation(this.tag,this.direction===a?b:a,this.recursive)}toString(){return`${this.direction}${this.tag}${this.recursive?'-r':''}`}};olympe.dc.query.Subscription=class a extends olympe.D.zj{constructor(b,c,d,e){super(olympe.dc.CloudObject,new olympe.D.Zb('context subscription '+b,e));this.id=b;this.$d=c;this.Y=d||null;this.G=this.R.run(()=>olympe.D.ge(olympe.dc.query.Subscription.C.INIT));this.od=!1;this.da=this.vd=null}static G(b,c,d){let e;try{e=b;if(c)for(let f=0,g=c.length;f<g;f++)e+='|'+c[f].la(d);else e+='|null';e=olympe.X.pb(e)}catch(f){e=olympe.X.ec()}return e}Z(){return this.id}Ld(){return this.$d}Cg(){return this.Y}Xc(){const b=
|
|
594
|
+
olympe.dc.Ja(),c=olympe.D.$a(this.Ld());return c?b.Wf(c)?b.source(c)||olympe.dc.Ha.Lc:olympe.dc.Ha.sb:olympe.dc.Ha.Lc}We(){const b=this.G.Pa.Kb;return b&&b.valueOf()>=olympe.dc.query.Subscription.C.Hq}ph(){if(this.G.Pa.G())throw Error(`Cannot set destroyed subscription '${this.id}' as subscribed`);const b=this.vd;this.vd=null;for(let c in b)if(Object.prototype.hasOwnProperty.call(b,c))b[c](this);qb(this.G,olympe.D.ge(olympe.dc.query.Subscription.C.Hq))}Kd(){return olympe.D.Fa([this.G],()=>{},olympe.D.sa)}W(){const b=
|
|
595
|
+
this.G.Pa.Kb;return b&&b.valueOf()>=olympe.dc.query.Subscription.C.nq}Ke(b,c){this.W()?b(this):(null===this.da&&(this.da=new Map),void 0===c&&(c=olympe.X.ec()),this.da.set(c,olympe.D.La().F(b)));return c||''}oj(b){null!==this.da&&b&&this.da.delete(b)}Hc(){const b=olympe.dc.query.Subscription.C.nq;if(!this.G.Pa.G()&&olympe.D.$a(this.G)!==b&&(this.Af(),qb(this.G,b),null!==this.da)){for(const c of this.da.values())c(this);this.da=null}}onDestroy(b){this.R.onDestroy(b)}release(){this.R.destroy()}Ab(b){if(!this.G.Pa.G()){for(let c=
|
|
596
|
+
0,d=b.length;c<d;c++)this.xm(b[c],c);if(this.W())this.Af();else{this.od=b=!0;for(let c in this.F)if(Object.prototype.hasOwnProperty.call(this.F,c)&&!Object.prototype.hasOwnProperty.call(this.values,c)){b=!1;break}b&&this.Hc()}}}zc(b){const c=this.F;for(let d in c)Object.prototype.hasOwnProperty.call(c,d)&&b(c[d],d)}Vb(b,c){if(!this.G.Pa.G()&&(this.Ak(b,olympe.dc.CloudObject.get(c)),b=this.W(),this.od&&!b)){b=!0;for(let d in this.F)if(Object.prototype.hasOwnProperty.call(this.F,d)&&!Object.prototype.hasOwnProperty.call(this.values,
|
|
597
|
+
d)){b=!1;break}b&&this.Hc()}}bc(b){this.G.Pa.G()||(this.wm(b),this.Ti(b,!this.W()))}Ug(){return this.W()?super.Ug():'Subscription is not ready!'}be(){const b=olympe.D.$a(this.Ld());return olympe.dc.query.Subscription.F(b,this.Cg())}static F(b,c){var d=new olympe.dc.kf(b,olympe.dc.Cd.SUBSCRIBE);if(null===c)return[d];b=[];b.push(d);for(let e=0,f=c.length;e<f;e++){const g=c[e];if(g instanceof olympe.dc.Y.Sb||g instanceof olympe.dc.Y.Bc)b.forEach(h=>{const k=olympe.dc.query.Relation.from(g);h.rb(k,k.recursive)});
|
|
598
|
+
else if(g instanceof olympe.dc.Y.wf)d=a.F(olympe.D.$a(g.Ld()),g.Cg()),b.push(...d);else if(g instanceof olympe.dc.Y.rc||g instanceof olympe.dc.Y.Hd){const h=g.F();b.forEach(k=>{for(const l of h){for(const n of l)k.rb(n,n.recursive);Be(k,l.length)}})}}return b}};olympe.dc.query.Subscription.C={INIT:0,Hq:1,nq:2};olympe.dc.query.Subscription.prototype.Ug.K=olympe.D.J.C;function Tf(a,b){return a.F.has(b)?a.F.get(b).F():null}function Uf(a,b,c){return eg(a,a.F,b,c)}function Sf(a,b){for(const [c,d]of a.L)if(d.has(b))return c;return null}function Pf(a,b){return a.C.has(b)?a.C.get(b).F():null}function Qf(a,b,c,d){const e=b.Z();let f=a.C.get(e);void 0===f&&(f=new olympe.dc.query.ua.gt(b,a.R,a),a.C.set(e,f));f.L(c);fg(a,e,d)}function Rf(a,b,c){return eg(a,a.C,b,c)}function ag(a,b){return(a=a.C.get(b))?Array.from(a.C.keys()):[]}
|
|
599
|
+
function bg(a,b){return(a=a.F.get(b))?Array.from(a.C.keys()):[]}function cg(a,b){const c=new Set;(a.L.get(b)||new Set).forEach(d=>{(d=a.C.get(d))&&c.add(d.F())});return c}function dg(a,b){const c=new Set;(a.L.get(b)||new Set).forEach(d=>{(d=a.F.get(d))&&c.add(d.F())});return c}function gg(a,b,c){a=a.F.get(b);if(void 0===a)throw Error(`Check if the subscription ${b} has been processed, but it has never been registered`);b=a.G.get(c);a.G.set(c,!0);return b||!1}
|
|
600
|
+
function fg(a,b,c){let d=a.L.get(c);d?d.add(b):(d=(new Set).add(b),a.L.set(c,d))}function hg(a,b,c){var d=olympe.dc.Ha.sb;const e=b.Z();let f=a.F.get(e);void 0===f&&(f=new olympe.dc.query.ua.$t(b,a.R),a.F.set(e,f));f.L(c);fg(a,e,d)}function eg(a,b,c,d){if(!b.has(c))return!1;const e=b.get(c);var f=e.C.get(d)-1;0===f?(e.C.delete(d),e.G.delete(d),f=0===e.C.size):(e.C.set(d,f),f=!1);return f?((d=Sf(a,c))&&a.L.get(d).delete(c),e.F().release(),b.delete(c),!0):0===e.C.get(d)}
|
|
601
|
+
function ig(a,b){const c=b.Z();let d=a.G.get(c);d||(d=new olympe.dc.query.ua.Cu(b),a.G.set(c,d));d.counter++;return d}function jg(a){a.G.forEach(b=>b.update())}function kg(a,b,c){const d=a.C.get(b);d?c instanceof olympe.dc.query.Subscription?lg(d,c):mg(d,c):a.N.error(`Try to set the subscription ${c.Z()} as covered by a graphquery that is not registered (${b}).`)}olympe.dc.query.Yu=class{constructor(a,b){this.N=a;this.C=new Map;this.F=new Map;this.G=new Map;this.W=new Set;this.L=new Map;this.R=b}};olympe.dc.Wc=class{na(){}Wb(){}getTransform(){}la(){}toString(){}};olympe.dc.iq=class{F(){}};olympe.dc.yf=class{na(){}getValue(){}C(){}la(){}toString(){}};olympe.dc.query.P={Ea:'olympe.dc.query.Logger',Aa:'olympe.dc.query.QueryManager'};olympe.dc.query.Lb={Oe:'olympe.dc.query.SubscriptionRegistry',Dj:'olympe.dc.query.CallbackRegistry',To:'olympe.dc.query.GraphProcessor',So:'olympe.dc.query.GraphNotificationProcessor',Uo:'olympe.dc.query.GraphResultProcessor',xp:'olympe.dc.query.ListProcessor',Yj:'olympe.dc.query.ListNotificationProcessor',kq:'olympe.dc.query.QueryProcessor',jl:'olympe.dc.query.CoverageProcessor'};olympe.dc.query.Config={Iq:'subscription.debug'};
|
|
602
|
+
olympe.U.config(function(a){D(a,olympe.dc.query.Config.Iq,!1);C(a,olympe.dc.query.P.Ea,[olympe.ra.P.Aa],b=>b.Nc('dc.query'));A(a,olympe.dc.query.Lb.Oe,olympe.dc.query.Yu,olympe.dc.query.P.Ea,new olympe.U.fa(olympe.dc.query.Config.Iq));A(a,olympe.dc.query.Lb.Dj,olympe.dc.query.Cs,olympe.dc.query.P.Ea);A(a,olympe.dc.query.Lb.xp,olympe.dc.query.Ub.Fp,olympe.dc.query.P.Ea,olympe.dc.P.ti,olympe.dc.query.Lb.Oe,olympe.dc.query.Lb.jl,olympe.dc.transaction.P.Aa,new olympe.U.fa(olympe.dc.Config.Zg));A(a,olympe.dc.query.Lb.To,
|
|
603
|
+
olympe.dc.query.Ub.Zo,olympe.dc.query.P.Ea,olympe.dc.query.Lb.Oe,new olympe.U.fa(olympe.dc.Config.Zg));A(a,olympe.dc.query.Lb.Uo,olympe.dc.query.Ub.$o,olympe.dc.query.P.Ea,olympe.dc.query.Lb.Oe,olympe.dc.query.Lb.Dj);A(a,olympe.dc.query.Lb.So,olympe.dc.query.Ub.Yo,olympe.dc.query.P.Ea,olympe.dc.query.Lb.Oe);A(a,olympe.dc.query.Lb.Yj,olympe.dc.query.Ub.Ep,olympe.dc.query.P.Ea,olympe.dc.P.ti,olympe.dc.query.Lb.Oe);A(a,olympe.dc.query.Lb.kq,olympe.dc.query.Ub.Du,olympe.dc.query.P.Ea,olympe.dc.query.Lb.Oe,
|
|
604
|
+
olympe.dc.query.Lb.jl,olympe.dc.query.Lb.Dj,olympe.dc.P.ne,olympe.dc.db.P.Aa);A(a,olympe.dc.query.Lb.jl,olympe.dc.query.Ub.Fs,olympe.dc.query.P.Ea,olympe.dc.query.Lb.Oe,olympe.dc.transaction.P.Aa);C(a,olympe.dc.query.P.Aa,[olympe.dc.query.P.Ea,new olympe.U.fa(olympe.dc.Config.Zg),olympe.dc.P.ne,olympe.dc.db.P.Aa,olympe.dc.query.Lb.Oe,olympe.dc.query.Lb.Dj,olympe.dc.query.Lb.xp,olympe.dc.query.Lb.To,olympe.dc.query.Lb.Uo,olympe.dc.query.Lb.So,olympe.dc.query.Lb.Yj,olympe.dc.query.Lb.kq],(b,c,d,e,f,
|
|
605
|
+
g,h,k,l,n,p,q)=>new olympe.dc.query.Bu(b,c,d,e,f,g,[h,k,l,n,p],q))});olympe.U.run([olympe.dc.query.Lb.Oe],a=>{olympe.ej().subscriptions=a});olympe.dc.query.ua={};function ng(){const a=Error.stackTraceLimit;Error.stackTraceLimit=16;let b=Error().stack||'';b=b.split('\n').map(d=>d.trim());var c='Error'===b[0]?2:1;b=b.slice(c,Error.stackTraceLimit+c).reverse();c=[];for(const d of b)if(c.push(' '+d),d.includes('at ListDef.')||d.includes('at GraphDef.'))break;Error.stackTraceLimit=a;3<c.length&&(c=c.slice(c.length-3));return c.join('\n')||b.join('\n')}
|
|
606
|
+
olympe.dc.query.ua.Rq=class{constructor(a,b){this.C=new Map;this.G=new Map;this.R=a;this.da=b}F(){}L(a){var b=this.C.get(a);this.C.set(a,void 0!==b?b+1:1);b=this.G.get(a);this.G.set(a,void 0!==b?b:!1)}};function lg(a,b){const c=b.Z();a.W.set(c,b);olympe.D.La().onDestroy(()=>{a.W.delete(c)})}function mg(a,b){const c=b.Z();a.$.set(c,b);olympe.D.La().onDestroy(()=>{a.$.delete(c)})}olympe.dc.query.ua.gt=class extends olympe.dc.query.ua.Rq{constructor(a,b,c){super(a,b);this.ua=c;this.W=new Map;this.$=new Map;b&&ng()}F(){return this.R}};olympe.dc.query.ua.$t=class extends olympe.dc.query.ua.Rq{constructor(a,b){super(a,b);this.W=new Map}F(){return this.R}L(a){super.L(a);if(this.da){const b='md_'+olympe.X.ec();this.W.set(b,ng());olympe.D.La().onDestroy(()=>{this.W.delete(b)})}}};function og(a,b){let c;a.C!==b&&(null==(c=a.C)?void 0:c.hash)!==b.hash&&(a.C=b,pg(a,!1),a.G.forEach(d=>d(b)))}function pg(a,b){var c=Ce(a.query);if(c!==olympe.dc.Ha.sb&&c!==olympe.dc.Ha.Lc){var d;c=null!=(d=a.C)?d:olympe.dc.Xa.empty();Xc(a.R,null,b?Je(c):Ke(c))}}function qg(a,b){const c=a.W++;a.G.set(c,b);a.C&&b(a.C);return()=>a.G.delete(c)}
|
|
607
|
+
olympe.dc.query.ua.Cu=class{constructor(a){this.query=a;this.R=olympe.dc.xd();this.id=a.Z();this.C=null;this.F=new olympe.dc.ba.gq(a);this.counter=this.W=0;this.G=new Map;this.L=[]}update(){var a=this.F;a.F?(a.F=!1,a=!0):a=!1;if(a){var b;a=null!=(b=this.C)?b:olympe.dc.Xa.empty();b=olympe.dc.Xa.from(a,this.F);og(this,b)}}onDestroy(a){this.L.push(a)}destroy(){pg(this,!0);this.L.forEach(a=>a())}};olympe.dc.query.Ub={};function rg(a,b,c,d,e){a.N.debug('CoverageProcessor: [ID:',d,'] - checking coverage of remote query over',b.length,'paths.');const f=new olympe.async.ng(olympe.D.La()),g=k=>{f.add((l,n)=>{k.kb(p=>{p?n(`The query ${d} is not covered by an existing graphdef, `+`and the specific graphdef id ${k.Z()} has encountered an error: ${p}`):l()});kg(a.ua,k.Z(),c)})},h=Array.from(cg(a.ua,olympe.dc.Ha.Lc));b.forEach(k=>{const l=nf(k);let n=!1;for(let p=0,q=h.length;p<q;p++){const r=h[p];if(r.wr(l)){g(r.nh,!1);
|
|
608
|
+
n=!0;break}}n?a.N.debug('CoverageProcessor: [ID:',d,'] - graphPath',k,' is covered'):g(k,!0)});ac(f,(k,l)=>e(l));f.start()}function sg(a,b,c){const d=[b.Ld()],e=g=>g instanceof olympe.dc.Y.wf,f=(b.Cg()||[]).filter(e);for(const g of f)d.push(g.Ld()),f.push(...(g.Cg()||[]).filter(e));ue(a.C,()=>{olympe.D.yc(d,()=>{const g=b.be();rg(a,g,b,b.Z(),c)})})}function tg(a,b,c,d){const e=b.Z(),f=[Ae(b,c)];ue(a.C,()=>rg(a,f,b,e,d))}olympe.dc.query.Ub.Fs=class{constructor(a,b,c){this.N=a;this.ua=b;this.C=c}};olympe.dc.query.Ub.Yo=class{constructor(a,b){this.N=a;this.ua=b}process(a,b,c){const d=b.Z();this.ua.C.has(d)?(Pf(this.ua,d).ja(b),olympe.dc.xd().$e(b.data,a),c(null,b)):c(Error(`Received a notification for the graphdef ${d} which does not exist.`),b)}};olympe.dc.query.Ub.Yo.ma=[olympe.dc.og];olympe.dc.query.Ub.Zo=class{constructor(a,b,c){this.N=a;this.ua=b;this.C=c}process(a,b,c){var d=b.Z();if(a===olympe.dc.Ha.sb||this.ua.C.has(d)){if(c(null,b),a=Pf(this.ua,d),this.C||a&&a.L)a=olympe.dc.Ha.sb,d=new olympe.dc.query.Bi(d,a,a,new olympe.dc.db.uc),Wf(olympe.dc.Nf(),d)}else c(Error('The local Graph Engine is not implemented yet. It should handle Graphdefs addressed to instances owned by this local OVM'),b)}};olympe.dc.query.Ub.Zo.ma=[olympe.dc.og];olympe.dc.query.Ub.$o=class{constructor(a,b,c){this.N=a;this.C=b;this.F=c}process(a,b,c){const d=b.Z();if(this.C.C.has(d)){const f=Pf(this.C,d);if(b instanceof olympe.dc.query.errors.Rj)Rf(this.C,d,a);else if(!f.L){f.da(b);const g=olympe.dc.xd();Xc(g,f.W());g.$e(b.xc,b.destination);f.onDestroy(()=>{Xc(g,null,f.W())});wf(f)}}let e;b instanceof olympe.dc.query.errors.Rj&&(e=`graph subscription "${d}" failed to create the initial result: ${b.da()}`,this.N.error(e));bf(this.F,b.Z(),b);c(e?Error(e):null,
|
|
609
|
+
b)}};olympe.dc.query.Ub.$o.ma=[olympe.dc.og];const ug=[],vg=new Map;function wg(a,b,c,d){Bc(a.db,d,e=>{e?b.Eg(c)?a.N.warn('Adding the same index twice (should never happen) for sub #'+b.Z()+', index #'+c+', tag #'+d):b.Vb(c,d):xg(a,b,c,d)},c)}function xg(a,b,c,d){Cc(a.db,d,c,!0);b.bc(c);ug.length=0;b.zc(function(e,f){ug[e]=f});c=a=0;for(d=ug.length;a<d;a++)'string'===typeof ug[a]&&(ug[c++]=ug[a]);ug.length=c;b.Ab(ug)}
|
|
610
|
+
olympe.dc.query.Ub.Ep=class{constructor(a,b,c){this.N=a;this.db=b;this.ua=c}process(a,b,c){const d=b.Z();a=b.C;const e=Tf(this.ua,d);if(null===e)c(Error(`Received list notification for undefined subscription "${d}"`),b);else{ug.length=a.length;e.zc((f,g)=>{if(f=e.kh(g)){f=f.T();var h=vg.get(f);void 0===h?vg.set(f,g):'string'===typeof h?vg.set(f,[h,g]):h.push(g)}else this.N.warn('Subscription #'+d+' has a rank for index #'+g+' but no instance. This is caused by receiving a new list notification before receiving all instances of the previous list notification.')});
|
|
611
|
+
for(let f=0,g=a.length;f<g;f++){const h=a[f];let k=vg.get(h);void 0===k?(k=olympe.X.ec(),wg(this,e,k,h)):'string'===typeof k?vg.delete(h):(k=k.pop(),0===k.length&&vg.delete(h));ug[f]=k}for(const [f,g]of vg){if('string'===typeof g)xg(this,e,g,f);else for(let h=0,k=g.length;h<k;h++)xg(this,e,g[h],f);vg.delete(f)}e.Ab(ug);c(null,b)}}};olympe.dc.query.Ub.Ep.ma=[olympe.dc.og];function yg(a,b,c,d){const e=c.Z();a.N.debug('ListProcessor: [ID:',e,'] - processing with source ',b);hg(a.ua,c,b);if(gg(a.ua,e,olympe.dc.Ha.sb))a.N.debug('ListProcessor: [ID:',e,'] - id already processed');else{a.N.debug('ListProcessor: [ID:',e,'] - NOT processed yet.');const f=c.Xc();a.F||f===olympe.dc.Ha.sb?(a.N.debug('QueryMGR: [ID:',e,'] - Local subscription, no need for coverage check, booting subscription '),zg(a,c)):c.Bh().run(()=>{sg(a.C,c,g=>{g?a.N.error(g):zg(a,c)})})}b===olympe.dc.Ha.sb||
|
|
612
|
+
gg(a.ua,e,b)||a.notify(b,c);d(null,c)}
|
|
613
|
+
function zg(a,b){if(b.W())a.N.debug('ListProcessor: [ID:',b.Z(),'] - Subscription already booted, ignoring');else{a.N.debug('ListProcessor: [ID:',b.Z(),'] - Booting subscription');var c=new olympe.dc.pc.Qq(a.db,a.N),d=Ag(a,b,c),e=b.Z();b.Bh().run(()=>{olympe.D.yc([b.Ld()],f=>{const g=olympe.dc.za(f);a.N.debug('ListProcessor: [ID:',b.Z(),'] - Booting with baseTag',g);b.We()||b.ph();Bc(a.db,g,h=>d(h,g),e);olympe.D.La().R(()=>Cc(a.db,g,e));a.db.Db(g.valueOf())||Bg(c);b.W()||(Bg(c),b.Ab([]))})})}}
|
|
614
|
+
function Ag(a,b,c){const d=new olympe.dc.pc.Bj;let e=!1;const f=b.Bh(),g=b.Cg(),h=[];h[g?g.length:0]=f.F((k,l,n,p)=>{f.$()||f.G()||(k?b.Eg(n)?a.N.warn('Adding the same index twice (should never happen) for sub #',b.Z(),', index #',n,', tag #',l):(a.N.debug('ListProcessor: [ID:',b.Z(),'] - Adding Instance',l,'to the subscription'),b.Vb(n,l)):(a.N.debug('ListProcessor: [ID:',b.Z(),'] - Removing Instance',l,'from the subscription'),b.bc(n)),e||(Cg(c,()=>{p.tg();Bg(c)}),p.Pc().Kg(b.Ab.bind(b)),e=!0),
|
|
615
|
+
Dg(c,n))});if(null!==g){const k=olympe.dc.Pc();for(let l=g.length-1;0<=l;l--)h[l]=f.F(g[l].getTransform(k,c,h[l+1]))}return(k,l)=>{const n=b.Z();c.register(n,null);const p=d.C(k,l,n,null);if(null!==p)h[0](k,l,n,Eg(p,k,l,n))}}
|
|
616
|
+
olympe.dc.query.Ub.Fp=class{constructor(a,b,c,d,e,f){this.N=a;this.db=b;this.ua=c;this.C=d;this.F=f}process(a,b,c){yg(this,a,b,c)}notify(a,b){const c=b.Z();this.N.debug(`Register notification of list subscription ${c} for destination ${a}`);const d=()=>{const f=new olympe.dc.query.Dp(c);b.ae(g=>f.F(g));Yf(olympe.dc.Nf(),f)};let e=!1;b.forEach(()=>{e&&d()});b.Ke(()=>{e=!0;d()})}};olympe.dc.query.Ub.Fp.ma=[olympe.dc.og];function Of(a,b,c){const d=b.Z(),e=Ce(b),f=a.ua.G.has(d),g=ig(a.ua,b);return new rxjs.Observable(h=>{const k=qg(g,h.next.bind(h)),l=()=>{k();h.complete();n&&c.be(n);{var p=a.ua;const r=p.G.get(d);var q;if(q=r)q=r,0<q.counter?q.counter--:olympe.ra.Ya('dc').warn('Try to decrement counter of query metadata below 0. Investigate...'),q=0===q.counter;q&&(r.destroy(),p.G.delete(d),p.W.delete(d))}},n=c.R(l);if(!f)if(e===olympe.dc.Ha.Lc)tg(a.L,b,!0,p=>{p?(h.error(p),l()):Fg(a,d,b,g)});else if(e===olympe.dc.Ha.sb)Fg(a,
|
|
617
|
+
d,b,g);else{const p=M(Ec(new olympe.dc.ha(olympe.dc.ha.ia.em,b,[e]),c),q=>{q&&(h.error(q.message),l())});a.G.send(p)}return l})}
|
|
618
|
+
function Gg(a){const b=olympe.dc.ha.ia.cm,c=(d,e)=>Me(d,f=>{Xc(a.F,Array.from(f.de()).filter(g=>g.re()).map(g=>g.tag()));a.F.$e(f,e)},e);a.G.C(olympe.dc.ha.ia.QUERY_RESULT,(d,{i:e,r:f,s:g})=>{d=c(f,g);null===d?(d=a.C,af(d,e,`Error while deserialization of QueryResult for query ${e}`,d.G,`Query result of query ${e} has no associated handler in the datacloud`)):(f=a.C,af(f,e,d,f.G,`Query result of query ${e} has no associated handler in the datacloud`))});a.G.C(b,(d,{i:e,r:f,s:g})=>{if(d=c(f,g)){let h;
|
|
619
|
+
null==(h=a.ua.G.get(e))||og(h,d)}});Wc(a.F,()=>jg(a.ua))}function Fg(a,b,c,d){let e=(p,q)=>{p?a.N.debug(`New result tuple for query ${b}, ${q}`):a.N.debug(`Removed result tuple for query ${b}, ${q}`)};const f=c.C,g=f.reduce((p,q)=>{p.push(q.F(p[p.length-1]));return p},[0]),h=d.F;for(let p=f.length-1;0<=p;p--)e=f[p].observe(h,g[p],e);const k=a.F.view,l=c.G,n=Bc(k,l,(p,q)=>{p?h.insert(q,0,null):h.remove(q,0,null);e(p,q,null,b)});d.onDestroy(()=>Cc(k,l,n));Qe(h);d.update()}
|
|
620
|
+
olympe.dc.query.Ub.Du=class{constructor(a,b,c,d,e,f){this.N=a;this.ua=b;this.L=c;this.C=d;this.G=e;this.F=f;Gg(this)}kb(a,b){return new Promise((c,d)=>{var e=Ce(a);if(e===olympe.dc.Ha.Lc)tg(this.L,a,!1,f=>{f?d(f):c(this.Ic(a))});else if(e===olympe.dc.Ha.sb)c(this.Ic(a));else{const f=a.Z(),g=this.C.C.has(f),h=l=>{var n=this.C;$e(n,f,n.G);d(l||`The execution of the query ${f} has been interrupted`)},k=b.R(h);cf(this.C,f,(l,n)=>{b.be(k);l?d(l.message):(b.R(()=>{Xc(this.F,null,Je(n))}),c(n))});g||(e=
|
|
621
|
+
M(Ec(new olympe.dc.ha(olympe.dc.ha.ia.bm,a,[e]),b),l=>l&&h(l.message)),this.G.send(e))}})}Ic(a){const b=new olympe.dc.ba.gq(a);b.insert(a.G,0,null);let c=0;for(const d of a.C)d.kb(b,c),c=d.F(c);return olympe.dc.Xa.from(olympe.dc.Xa.empty(),b)}};olympe.dc.query.errors={};olympe.dc.query.errors.Rj=class extends olympe.dc.query.Bi{constructor(a,b,c,d){super(a,b,c,new olympe.dc.db.uc);this.error=d}da(){return this.error}};olympe.dc.pc={};function Eg(a,b,c,d){b?a.W[d]=c:delete a.W[d];null===a.F&&(a.F=new olympe.dc.pc.Ij(a.C,a));return a.F}function Hg(a,b){for(let c=0;c<b;c++)if(null!==a.F)a=a.F;else break;return a}function Ig(a,b){a=a.W;if(null!==a)for(let c in a)Object.prototype.hasOwnProperty.call(a,c)&&b.push(c)}olympe.dc.pc.Ij=class{constructor(a,b){this.C=a;this.depth=b?b.depth+1:0;this.W=Object.create(null);this.F=null}Pc(){return this.C}tg(){this.C.R()?this.C.G():this.C.$(this.depth-1)}};olympe.dc.pc.pa=class{constructor(){}C(){}R(){}$(){}G(){}Kg(){}};olympe.dc.pc.Bj=class{constructor(){this.W=this.L=this.index=this.F=null}R(){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.pc.Ij(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.W){const a=
|
|
622
|
+
[];null!==this.L&&(0<=this.F?Ig(Hg(this.L,this.F),a):a.push(this.index));this.W(a)}}Kg(a){this.W=a}};olympe.dc.pc.Bj.ma=[olympe.dc.pc.pa];function Jg(a,b){olympe.D.Vf(a.value)?(a.node=olympe.D.Vk(a.value,b),Xa(a.node)||b()):b()}function Kg(a,b){if(olympe.D.Vf(a.value)){const c=olympe.D.La(),d=a.R;olympe.D.yc([a.value],e=>{d!==e.valueOf()&&(c.run(()=>Jg(a,b)),olympe.D.La().destroy())})}}
|
|
623
|
+
class Lg extends olympe.dc.pc.Ij{constructor(a,b,c){super(a);this.index=b;this.value=c;this.R=this.$a();this.position=this.node=null;this.$=!1;this.L=null}$a(){const a=olympe.D.$a(this.value);return a?a.valueOf():a}destroy(){this.node&&(this.node.destroy(),this.node=null);this.L=this.value=null}G(){return null===this.value}}
|
|
624
|
+
function Mg(a,b){if(!b.G()){var c=a.F;const d=a.ta,e=b.$a();let f=0,g=c.length,h=0,k;for(null!==b.position&&--g;g>f;){h=Math.floor((f+g)/2);k=d(c[h].R,e);if(0===k||2>g-f){0>k&&null!==b.position&&b.position<=h&&(k=d(c[g].R,e));h=0>k?g:h;break}0>k?f=h:g=h}c=h;b.R=b.$a();c!==b.position&&(a.insert(b,c),b.$&&a.G())}}function Ng(a){const b=a.ta;a.F.sort((c,d)=>b(c.$a(),d.$a()))}
|
|
625
|
+
olympe.dc.pc.Pq=class{constructor(a){this.ta=a;this.L=null;this.F=[];this.W=[];this.da=null;this.ja=new Map}C(a,b,c,d){b='$'+c;const e=this.F;let f;if(a)f=new Lg(this,c,d),this.ja.set(b,f),this.R()?Jg(f,()=>Mg(this,f)):(f.position=e.length,e.push(f));else{f=this.ja.get(b);if(void 0===f)throw Error('Trying to remove an non-registered item: "'+c+'"');this.ja.delete(b);null!==f.position&&(this.R()?this.remove(f):delete e[f.position]);f.destroy()}return f}R(){return null!==this.L}$(a){if(null!==this.L)throw Error('Manager already activated (depth='+
|
|
626
|
+
this.L+')');this.L=a;Ng(this);for(let b=0,c=this.F.length;b<c;b++){const d=this.F[b];d.position=b;Kg(d,()=>Mg(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.W.length=0;for(let d=0;d<a;d++){let e=this.F[d];if(!e.$){var b=e,c=this.L;b.$=!0;b.L=Hg(b,c)}0>this.L?this.W.push(e.index):e.L&&Ig(e.L,this.W)}this.da&&this.da(this.W)}Kg(a){this.da=a}insert(a,b){const c=this.F;var d=c.length;let e=a.position;null===
|
|
627
|
+
e&&(e=d);if(b<e)for(d=e;d>b;d--)c[d]=c[d-1],c[d].position=d;else for(d=e;d<b;d++)c[d]=c[d+1],c[d].position=d;c[b]=a;c[b].position=b}remove(a){const b=this.F,c=b.length-1;if(null!==a.position){for(a=a.position;a<c;a++)b[a]=b[a+1],b[a].position=a;b.length=c}}};olympe.dc.pc.Pq.ma=[olympe.dc.pc.pa];class Og extends olympe.dc.pc.Ij{constructor(a,b,c){super(a);this.index=b;this.tag=c;this.$=this.R=this.L=!1;this.G=null}}
|
|
628
|
+
function Pg(a,b,c,d,e){const f=Object.create(null),g=a.order,h=a.L;let k,l,n;a.ja=!0;l=0;for(n=g.length;l<n;l++)f[g[l]]=null;g.length=0;l=c;for(n=Math.min(b.length,d);l<n;l++)k=b[l],c=h[k],void 0!==c&&(delete f[k],g.push(k),c.L||(c.L=!0,e(!0,c.tag,c.index,c)));for(k in f)Object.prototype.hasOwnProperty.call(f,k)&&(c=h[k],c.L&&(c.L=!1,e(!1,c.tag,c.index,c)),c.R&&(c.G=null,delete h[k]),delete f[k]);a.ja=!1;null!==a.F&&a.G()}
|
|
629
|
+
olympe.dc.pc.Ol=class{constructor(){this.L={};this.order=[];this.F=null;this.ja=!1;this.W=[];this.da=null}R(){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.ja){var a=this.order,b=a.length,c=this.L,d;for(d=this.W.length=0;d<b;d++){var e=c[a[d]];if(0>this.F)this.W.push(e.index);else{if(!e.$){var f=e,g=this.F;f.$=!0;f.G=
|
|
630
|
+
Hg(f,g)}null!==e.G&&Ig(e.G,this.W)}}this.da&&this.da(this.W)}}Kg(a){this.da=a}C(a,b,c){let d=this.L[c];a?void 0===d?(d=new Og(this,c,b),this.L[c]=d):(d.tag=b,d.R=!1):void 0!==d&&(d.R=!0);return d}};olympe.dc.pc.Ol.ma=[olympe.dc.pc.pa];function Bg(a){if(!a.F){for(let b in a.G)Qg(a.G[b]);a.F=!0}a.L=null;a.R=null}function Cg(a,b,c){a.G[c||'root'].W=b}function Dg(a,b,c){a.G[c||'root'].tg(b)}function Rg(a,b,c,d){const e=a.R,f=b+d+c;let g=e[f];void 0===g&&(g=Nd(a.db,b,c,d),e[f]=g);return g}function Sg(a,b){a.F||a.C.tg(b)}function Tg(a,b,c,d,e){if(!a.F){let f=Rg(a,c,d,e||olympe.dc.Ca.DESTINATION);e||(f+=Rg(a,c,d,olympe.dc.Ca.ORIGIN));0===f&&Sg(a,b)}}
|
|
631
|
+
function Ug(a,b){const c=a.G[b];void 0!==c?(a.N&&a.N.debug('Set current block to',b,null!==c.G?'parent = '+c.G.Z():''),a.C=c):a.N&&a.N.error('Try to set a block that does not exists:',b)}function Vg(a){const b=String(++a.W),c=a.C;a.G[b]=new Wg(b,c);Xg(c,b);c.L||(c.L=()=>Ug(a,c.Z()));return b}function Yg(a,b){const c=a.C;a.C.L=()=>{Ug(a,c.Z());b()}}function Zg(a,b){Qg(b?a.G[b]:a.C)}
|
|
632
|
+
olympe.dc.pc.Qq=class{constructor(a,b){this.db=a;this.N=b||null;this.L=Object.create(null);this.R=Object.create(null);this.F=!1;this.W=0;this.C=new Wg('root');this.G=Object.create(null);this.G.root=this.C}register(a,b,c,d,e){this.F||(null!==b&&c&&d&&e?(c=Rg(this,c,d,e),d=this.L[b]||0,this.L[b]=++d,this.C.C===b&&c<=d&&(this.C.C=a)):this.C.C=a)}};function Xg(a,b){null===a.F&&(a.F=Object.create(null));a.F[b]=!1}function Qg(a){a.R=!0;null!==a.G&&a.G.notify(a.id)}
|
|
633
|
+
class Wg{constructor(a,b){this.id=a;this.G=b||null;this.C=this.W=this.L=this.F=null;this.R=!1}Z(){return this.id}tg(a){const b=this.W;if(this.R||this.C===a||null===a)b&&b(),!b&&Qg(this)}notify(a){const b=this.L,c=this.F;if(this.R)b&&b();else if(!c[a]){a=c[a]=!0;for(let d in c)if(!c[d]){a=!1;break}a&&b&&b()}}};olympe.dc.oa={};olympe.dc.oa.uf=class{na(){return O(olympe.dc.oa.uf)}C(){return[]}getValue(a,b){return b}la(){return'{"c":"'+this.na()+'","a":[]}'}toString(){return'Tag()'}};N('olympe.dc.valuedefs.Tag',olympe.dc.oa.uf);olympe.dc.oa.uf.ma=[olympe.dc.yf];olympe.dc.oa.Bd=class{constructor(a){this.value=a}na(){return O(olympe.dc.oa.Bd)}C(){return[]}getValue(){return this.value}la(a){a=Nf(a,this.value);return`{"c":"${this.na()}","a":[${a}]}`}toString(){return`Constant(${Mf(this.value)})`}};N('olympe.dc.valuedefs.Constant',olympe.dc.oa.Bd);olympe.dc.oa.Bd.ma=[olympe.dc.yf];function $g(a,b,c,d){const e=olympe.dc.Ja(),f=new olympe.dc.pc.Bj,g=new olympe.dc.pc.Qq(e);let h=!1;const k=Object.create(null),l=r=>{if(0<r.length)for(const t in k)r[0]===t&&d(k[t])};let n=(r,t,u,v)=>{const w=olympe.D.La();w.$()||w.G()||(h||(Cg(g,()=>{v.tg();Bg(g)}),v.Pc().Kg(l),h=!0),r?k[u]=t:delete k[u],Dg(g,u))};const p=olympe.D.La();if(null!==c)for(let r=c.length-1;0<=r;r--)n=c[r].getTransform(a,g,p.F(n));n=p.F(n);const q=olympe.X.ec();Bc(e,b,(r,t)=>{g.register(q,null);const u=f.C(r,b,q,null);
|
|
634
|
+
n(r,t,q,Eg(u,r,b,q))},q);p.onDestroy(()=>{Cc(e,b,q)});e.Db(b)||Bg(g)}function ah(a,b,c){const d=c.node,e=olympe.dc.Ja(),f=a.G(),g=Gd(e,b,a.Ze,d.F(h=>{null!==h&&(h=f(h));null===h?c.clear():c.update(h)}));d.onDestroy(()=>e.F(b,a.Ze,g))}
|
|
635
|
+
olympe.dc.oa.Kc=class{constructor(a,b,c){this.Ze=a&&a.T?a.T():a;this.Y=b&&b.filter(d=>d instanceof olympe.dc.Y.Sb||d instanceof olympe.dc.Y.Bc)||null;this.F=c||null;this.defaultValue=null}na(){}Wb(){}G(){}C(){return(this.Y||[]).reduce((a,b)=>a.concat(olympe.dc.query.Relation.from(b)),[])}bf(a){this.defaultValue=a;return this}Cg(){return this.Y}Ld(){return this.F}getValue(a,b){const c=olympe.D.Qc(this.Wb()||Object,'AbstractProperty valueType');null!==this.defaultValue&&rb(c,this.defaultValue);b=this.F||
|
|
636
|
+
b;null!==this.Y?$g(a,b,this.Y,d=>{ah(this,d,c)}):ah(this,b,c);return c.Ib()}la(a){const b=Nf(a,this.Ze),c=Nf(a,this.F);let d='null';this.Y&&(d=this.Y.map(function(e){return e.la(a)}).join(','));return`{"c":"${this.na()}","a":["${b}",${d},${c}]}`}toString(){const a=Mf(this.Ze),b=this.F?','+Mf(this.F):'';let c='';this.Y&&(c=','+this.Y.join(','));return this.na().replace(/^.+\./,'')+'('+a+c+b+')'}};olympe.dc.oa.Kc.ma=[olympe.dc.yf];olympe.dc.oa.le=class extends olympe.dc.oa.Kc{constructor(a,b,c){super(a,b,c)}na(){return O(olympe.dc.oa.le)}G(){return olympe.dc.X.Tb.Gm}Wb(){return olympe.D.ga}};N('olympe.dc.valuedefs.NumberProperty',olympe.dc.oa.le);olympe.dc.oa.pe=class extends olympe.dc.oa.Kc{constructor(a,b,c){super(a,b,c)}na(){return O(olympe.dc.oa.pe)}G(){return olympe.dc.X.Tb.Hm}Wb(){return olympe.D.Za}};N('olympe.dc.valuedefs.StringProperty',olympe.dc.oa.pe);olympe.dc.oa.ue=class extends olympe.dc.oa.Kc{constructor(a,b,c){super(a,b,c)}na(){return O(olympe.dc.oa.ue)}G(){return olympe.dc.X.Tb.Em}Wb(){return olympe.D.sa}};N('olympe.dc.valuedefs.BooleanProperty',olympe.dc.oa.ue);olympe.dc.oa.je=class extends olympe.dc.oa.Kc{constructor(a,b,c){super(a,b,c)}na(){return O(olympe.dc.oa.je)}G(){return olympe.dc.X.Tb.Fm}Wb(){return olympe.D.ib}};N('olympe.dc.valuedefs.DateTimeProperty',olympe.dc.oa.je);olympe.dc.oa.Gn=class{constructor(a,b){if(olympe.D.Vf(a))throw Error('Dataflows of Property not supported by AnyProperty');const c=a.T();var d=olympe.dc.Ja();const e=d.fc(a,olympe.dm.Property.typeRel);if(!e)throw Error('Type of property '+a+'unavailable locally, cannot proceed with AnyProperty');a=d.Pf(e,olympe.dc.CloudObject.extendRel,olympe.dm.rf);d=null;switch(1<a.length?a[a.length-2]:e){case olympe.dm.String.O.T():d=new olympe.dc.oa.pe(c,b);break;case olympe.dm.Number.O.T():d=new olympe.dc.oa.le(c,
|
|
637
|
+
b);break;case olympe.dm.Boolean.O.T():d=new olympe.dc.oa.ue(c,b);break;case olympe.dm.DateTime.O.T():d=new olympe.dc.oa.je(c,b)}this.F=d}na(){return this.F.na()}C(){return this.F.C()}getValue(a,b){return this.F.getValue(a,b)}la(a){return this.F.la(a)}toString(){return this.F.toString()}};olympe.dc.oa.Gn.ma=[olympe.dc.yf];olympe.dc.Bb={};olympe.dc.Bb.Number=class{constructor(a){this.C=a}na(){return O(olympe.dc.Bb.Number)}R(){return this.C.C()}L(a,b){return this.C.getValue(a,b)}G(a,b){return a!==b?a>b?1:-1:0}la(a){return`{"c":"${this.na()}",a:[${this.C.la(a)}]}`}toString(){return`Number(${this.C.toString()})`}};N('olympe.dc.comparators.Number',olympe.dc.Bb.Number);olympe.dc.Bb.Number.ma=[olympe.dc.Me];olympe.dc.Bb.String=class{constructor(a){this.C=a}na(){return O(olympe.dc.Bb.String)}R(){return this.C.C()}L(a,b){return olympe.D.Fa([this.C.getValue(a,b)],c=>c.toLowerCase(),olympe.D.Za)}G(a,b){return void 0===a?void 0===b?0:1:a!==b?a>b?1:-1:0}la(a){return`{"c":"${this.na()}",a:[${this.C.la(a)}]}`}toString(){return`String(${this.C.toString()})`}};N('olympe.dc.comparators.String',olympe.dc.Bb.String);olympe.dc.Bb.String.ma=[olympe.dc.Me];olympe.dc.Bb.DateTime=class{constructor(a){this.C=a}na(){return O(olympe.dc.Bb.DateTime)}R(){return this.C.C()}L(a,b){return this.C.getValue(a,b)}G(a,b){if(!a)return b?-1:0;if(!b)return 1;a=a.getTime();b=b.getTime();return a!==b?a>b?1:-1:0}la(a){return'{"c":"'+this.na()+'",a:['+this.C.la(a)+']}'}toString(){return'Number('+this.C.toString()+')'}};N('olympe.dc.comparators.DateTime',olympe.dc.Bb.DateTime);olympe.dc.Bb.DateTime.ma=[olympe.dc.Me];let bh=0;olympe.dc.Bb.Ng=class{constructor(){this.id=bh++}na(){return'CustomLocalComparator#'+bh}R(){return[]}L(){throw Error('GetComparedValue function was not implemented.');}G(){throw Error('Compare function was not implemented.');}la(){return`{"c":"${this.na()}"}`}toString(){return this.na()+'()'}};olympe.dc.Bb.Ng.ma=[olympe.dc.Me];olympe.dc.V={};olympe.dc.V.jd=class{constructor(a){this.G=a}na(){return O(olympe.dc.V.jd)}F(){return this.G.F()}C(a,b){return olympe.D.Vk(this.G.C(a,b),c=>!c.valueOf())}la(a){return`{"c":"${this.na()}","a":[${this.G.la(a)}]}`}toString(){return'Not('+this.G.toString()+')'}};N('olympe.dc.predicates.Not',olympe.dc.V.jd);olympe.dc.V.jd.ma=[olympe.dc.bb];olympe.dc.V.Qd=class{constructor(a){this.V=[];for(let b=arguments.length,c=0;c<b;c++)Array.isArray(arguments[c])?this.V=this.V.concat(arguments[c]):this.V.push(arguments[c])}na(){return O(olympe.dc.V.Qd)}F(){return this.V.reduce((a,b)=>a.concat(b.F()),[])}C(a,b){return olympe.D.cf(this.V.map(c=>c.C(a,b)),function(){for(let c=arguments.length,d=0;d<c;d++)if(!arguments[d].valueOf())return!1;return!0})}la(a){const b=this.V.map(c=>c.la(a));return'{"c":"'+this.na()+'","a":['+b.join(',')+']}'}toString(){return'And('+
|
|
638
638
|
this.V.map(a=>a.toString()).join(',')+')'}};N('olympe.dc.predicates.And',olympe.dc.V.Qd);olympe.dc.V.Qd.ma=[olympe.dc.bb];olympe.dc.V.Zd=class{constructor(a){this.V=[];for(let b=arguments.length,c=0;c<b;c++)Array.isArray(arguments[c])?this.V=this.V.concat(arguments[c]):this.V.push(arguments[c])}na(){return O(olympe.dc.V.Zd)}F(){return this.V.reduce((a,b)=>a.concat(b.F()),[])}C(a,b){return olympe.D.cf(this.V.map(c=>c.C(a,b)),function(){for(let c=arguments.length,d=0;d<c;d++)if(arguments[d].valueOf())return!0;return!1})}la(a){const b=this.V.map(c=>c.la(a));return'{"c":"'+this.na()+'","a":['+b.join(',')+']}'}toString(){return'Or('+
|
|
639
|
-
this.V.map(a=>a.toString()).join(',')+')'}};N('olympe.dc.predicates.Or',olympe.dc.V.Zd);olympe.dc.V.Zd.ma=[olympe.dc.bb];olympe.dc.V
|
|
640
|
-
')'}};N('olympe.dc.predicates.Equals',olympe.dc.V.Fc);olympe.dc.V.Fc.ma=[olympe.dc.bb];olympe.dc.V.
|
|
641
|
-
b+','+c+','+a+']}'}toString(){const a=
|
|
639
|
+
this.V.map(a=>a.toString()).join(',')+')'}};N('olympe.dc.predicates.Or',olympe.dc.V.Zd);olympe.dc.V.Zd.ma=[olympe.dc.bb];olympe.dc.V.bl=class{constructor(a,b){this.G=a;this.L=b}na(){}F(){return[this.G.C(),this.L.C()]}C(a,b){return olympe.D.Fa([this.G.getValue(a,b),this.L.getValue(a,b)],(c,d)=>{c=c.valueOf();d=d.valueOf();return this.R('string'===typeof c?c:Number(c),'string'===typeof d?d:Number(d))},Boolean)}R(){}la(a){return'{"c":"'+this.na()+'","a":['+this.G.la(a)+','+this.L.la(a)+']}'}toString(){return this.na().replace(/^.+\./,'')+'('+this.G.toString()+','+this.L.toString()+')'}};olympe.dc.V.bl.ma=[olympe.dc.bb];olympe.dc.V.Fc=class{constructor(a,b){this.G=a;this.L=b}na(){return O(olympe.dc.V.Fc)}F(){return[this.G.C(),this.L.C()]}C(a,b){return olympe.D.Fa([this.G.getValue(a,b),this.L.getValue(a,b)],(c,d)=>'object'===typeof c&&void 0!==c.Pd?c.Pd(d):'object'===typeof d&&void 0!==d.Pd?d.Pd(c):olympe.D.wc(c.valueOf()===d.valueOf()),olympe.D.sa,'Test equal predicate')}la(a){return'{"c":"'+this.na()+'","a":['+this.G.la(a)+','+this.L.la(a)+']}'}toString(){return'Equals('+this.G.toString()+','+this.L.toString()+
|
|
640
|
+
')'}};N('olympe.dc.predicates.Equals',olympe.dc.V.Fc);olympe.dc.V.Fc.ma=[olympe.dc.bb];olympe.dc.V.Ts=class extends olympe.dc.V.Fc{constructor(a,b){super(a,new olympe.dc.oa.Bd(b))}};olympe.dc.V.Ts.ma=[olympe.dc.bb];olympe.dc.V.ze=class extends olympe.dc.V.bl{constructor(a,b){super(a,b)}na(){return O(olympe.dc.V.ze)}R(a,b){return a>b}};N('olympe.dc.predicates.Greater',olympe.dc.V.ze);olympe.dc.V.Ge=class extends olympe.dc.V.bl{constructor(a,b){super(a,b)}na(){return O(olympe.dc.V.Ge)}R(a,b){return a<b}};N('olympe.dc.predicates.Smaller',olympe.dc.V.Ge);olympe.dc.V.Sc=class{constructor(a,b,c){this.source=a;this.value=b;this.G=c?c:!1}na(){return O(olympe.dc.V.Sc)}F(){return[this.source.C(),this.value.C()]}getValue(){return this.value}C(a,b){return olympe.D.Fa([this.source.getValue(a,b),this.value.getValue(a,b),this.G],(c,d,e)=>{c=String(c);d=String(d);e.valueOf()||(c=c.toLowerCase(),d=d.toLowerCase());return olympe.D.wc(c.includes(d))},olympe.D.sa)}la(a){const b=this.source.la(a),c=this.value.la(a);a=Nf(a,this.G);return'{"c":"'+this.na()+'","a":['+
|
|
641
|
+
b+','+c+','+a+']}'}toString(){const a=Mf(this.G);return'Contains('+this.source.toString()+','+this.value.toString()+','+a+')'}};N('olympe.dc.predicates.Contains',olympe.dc.V.Sc);olympe.dc.V.Sc.ma=[olympe.dc.bb];olympe.dc.V.ud=class{constructor(a,b,c){this.source=a;this.L=b;this.G=void 0===c?!0:c}na(){return O(olympe.dc.V.ud)}F(){return[this.source.C()]}C(a,b){return olympe.D.cf([this.source.getValue(a,b),this.L,this.G],(c,d,e)=>{c=String(c);d=String(d);e.valueOf()||(c=c.toLowerCase(),d=d.toLowerCase());return(new RegExp(d)).test(c)})}la(a){const b=this.source.la(a),c=Nf(a,this.L);a=Nf(a,this.G);return'{"c":"'+this.na()+'","a":['+b+','+c+','+a+']}'}toString(){const a=Mf(this.G);return'Regex('+this.source.toString()+
|
|
642
642
|
','+this.L+','+a+')'}};N('olympe.dc.predicates.Regex',olympe.dc.V.ud);olympe.dc.V.ud.ma=[olympe.dc.bb];olympe.dc.V.mf=class{constructor(a){this.G=new Set;a instanceof Array?a.forEach(b=>{this.G.add(olympe.dc.za(b))}):this.G.add(olympe.dc.za(a))}na(){return O(olympe.dc.V.mf)}F(){return[]}C(a,b){const c=olympe.D.createNode(Boolean),d=olympe.dc.Ja();let e=[];const f=()=>{e.forEach(h=>{d.C(h.tag,h.C,h.id)});e=[]},g=(h,k)=>{if(h)if(k===olympe.dc.za(olympe.dc.CloudObject))K(c,this.G.has(k)),f();else{for(const l of e)if(l.tag===k)throw Error(`You should never extend a model to itself (${k})`);this.G.has(k)?
|
|
643
|
-
(K(c,!0),f()):(h=new
|
|
644
|
-
olympe.dc.V.lf=class{constructor(a,b,c){this.Oa=[];this.G=c instanceof Array?c:void 0!==c?[olympe.dc.za(c)]:[];a=Array.isArray(a)?a:[a];for(let d=0,e=a.length;d<e;d++)c=a[d],c instanceof olympe.dc.Y.Bc?this.Oa.push(new
|
|
645
|
-
c.G()||(f+=h?1:-1,K(c,0<f))};const g=this.Oa;for(let h=g.length-1;0<=h;h--)a=
|
|
646
|
-
function
|
|
647
|
-
'('+a.toString()+','+this.value.toString()+')'}};N('olympe.dc.predicates.BitMask',olympe.dc.V.
|
|
648
|
-
for(let h=f.length-1;0<=h;h--)a=f[h].getTransform(d,a,e+h);let g=0;
|
|
649
|
-
class
|
|
650
|
-
null!==w&&(f.add(t),d.set(q,(d.get(q)||0)+v),Array.from(w.values()).forEach(y=>y(v)));f.delete(t)};g(k,q,n);d.has(q)?k(d.get(q)):(l>=this.F&&b(v=>{d.set(q,(d.get(q)||0)+v);k(v)},p,q),(0>this.C||l<=this.C)&&q!==n&&V(a,q,this,h.bind(this,u,l+1,q),r))}else k(-d.get(q)),e.get(q).delete(c+n),0===e.get(q).size&&(d.delete(q),e.delete(q),a.C(q,this,r))};return(k,l,n)=>h(k,0,'origin',l,n)}la(){return`${this.T()}, ${this.Ra()}, ${this.F}, ${this.C}`}}olympe.dc.V.
|
|
651
|
-
this.na()+'","a":["'+this.T()+'","'+this.Ra()+'"]}'}toString(){return'Related('+this.Ra()+this.T()+')'}};N('olympe.dc.transformers.Related',olympe.dc.Y.Sb);olympe.dc.Y.Sb.ma=[olympe.dc.Wc];olympe.dc.Y.Bc=class extends olympe.dc.ua.Relation{constructor(a,b=olympe.dc.Ca.DESTINATION,c=1,d=-1){super(a,b);this.F=c;this.C=d}Wb(){return
|
|
652
|
-
q,r,h,k||g);null===k&&b.register(w,q,r,h,f)}}},n=(p,q,r,t,u,v)=>{u&&!b.F&&l(p,t,v);p>=this.F?c(u,v,t,
|
|
653
|
-
N('olympe.dc.transformers.RecursiveRelated',olympe.dc.Y.Bc);olympe.dc.Y.Bc.ma=[olympe.dc.Wc];function
|
|
654
|
-
olympe.dc.Y.Ce=class{constructor(a,b){this.direction=b||olympe.dc.Ca.DESTINATION;this.Oa=a.map(c=>new olympe.dc.ua.Relation(c,this.direction))}Wb(){return olympe.dc.CloudObject}na(){return O(olympe.dc.Y.Ce)}Ra(){return this.direction}getTransform(a,b,c){const d=olympe.dc.Ja(),e=(f,g,h,k)=>V(d,f,k,(l,n)=>{var p=k.Ra();var q=k.T();p=olympe.X.
|
|
655
|
-
{d.C(g,l,h)})}}la(){return'{"c":"'+this.na()+'","a":['+JSON.stringify(
|
|
656
|
-
b.register(B,u,v,f,g);c(!0,y,B,E)},w.
|
|
657
|
-
this.C.toString()+'","'+this.F.toString()+'"]}'}toString(){return'FirstRelated('+this.C.toString()+', '+this.F.toString()+')'}};N('olympe.dc.transformers.FirstRelated',olympe.dc.Y.
|
|
658
|
-
N('olympe.dc.transformers.Sort',olympe.dc.Y.Hd);olympe.dc.Y.Hd.ma=[olympe.dc.Wc,olympe.dc.
|
|
659
|
-
this.na()+'","a":['+this.C.la(a)+']}'}toString(){return'Filter('+this.C.toString()+')'}};N('olympe.dc.transformers.Filter',olympe.dc.Y.rc);olympe.dc.Y.rc.ma=[olympe.dc.Wc,olympe.dc.
|
|
660
|
-
this.na()+'","a":['+
|
|
661
|
-
olympe.dc.Y.wf=class{constructor(a,b){this.Y=this.C=null;a instanceof olympe.dc.Da?(this.C=a.Ld(),this.Y=a.
|
|
662
|
-
u.$()||u.G()||(k||(t.
|
|
663
|
-
N('olympe.dc.transformers.Union',olympe.dc.Y.wf);olympe.dc.Y.wf.ma=[olympe.dc.Wc];olympe.dc.Lg={};function
|
|
664
|
-
f.i?f.i:-1,f.o){case 1:const g=a.C(f.p||{});g.has(e)||g.set(e,this.G);c.F(f.t,g,b);break;case 2:c.qc(f.t,a.C(f.p),!0,b);break;case 3:c.Dc(f.t,f.f,b);break;case 4:c.
|
|
643
|
+
(K(c,!0),f()):(h=new ch(k,olympe.dc.CloudObject.extendRel),e.push(h),V(d,h.tag,h.C,g,h.id))}};a=new ch(b,olympe.dc.CloudObject.modelRel);e.push(a);V(d,a.tag,a.C,g,a.id);c.onDestroy(f);Xa(c)||K(c,!1);return c}la(){return'{"c":"'+this.na()+'","a":['+JSON.stringify(Array.from(this.G))+']}'}toString(){return'InstanceOf('+Array.from(this.G).join(', ')+')'}};class ch{constructor(a,b){this.tag=a;this.C=b;this.id=olympe.X.yg()}}N('olympe.dc.predicates.InstanceOf',olympe.dc.V.mf);olympe.dc.V.mf.ma=[olympe.dc.bb];function dh(a){return a.Oa.map(b=>b.T())}function eh(a){return a.Oa.map(b=>b.Ra())}
|
|
644
|
+
olympe.dc.V.lf=class{constructor(a,b,c){this.Oa=[];this.G=c instanceof Array?c:void 0!==c?[olympe.dc.za(c)]:[];a=Array.isArray(a)?a:[a];for(let d=0,e=a.length;d<e;d++)c=a[d],c instanceof olympe.dc.Y.Bc?this.Oa.push(new fh(c.T(),c.Ra(),c.F,c.C)):this.Oa.push(new fh(olympe.dc.za(c),b[d],1,1))}na(){return O(olympe.dc.V.lf)}F(){return[this.Oa.reduce((a,b)=>a.concat(b),[])]}C(a,b){const c=olympe.D.createNode(Boolean),d=olympe.X.ec(),e=olympe.dc.Ja();let f=0;a=(h,k)=>{0!==this.G.length&&!this.G.includes(k)||
|
|
645
|
+
c.G()||(f+=h?1:-1,K(c,0<f))};const g=this.Oa;for(let h=g.length-1;0<=h;h--)a=gh(g[h],e,a,d+h);Bc(e,b,a,d);olympe.D.La().onDestroy(()=>{Cc(e,b,d)});c.bf(!1);return c}la(){return'{"c":"'+this.na()+'","a":['+JSON.stringify(this.Oa.map(a=>a.la()))+(0!==this.G.length?',"'+this.G.toString():'')+'"]}'}toString(){return'HasRelated('+(0!==this.G.length?'#'+this.G.toString()+', ':'')+this.Oa.map(a=>a.la())+')'}};N('olympe.dc.predicates.HasRelated',olympe.dc.V.lf);
|
|
646
|
+
function gh(a,b,c,d){const e=Object.create(null);d+=olympe.X.yg();const f=(g,h,k)=>{k>=a.F&&c(g,h);if(!(0<=a.C&&k>=a.C)){var l=d+k;g?e[h]||(e[h]=!0,V(b,h,a,(n,p)=>{f(n,p,k+1)},l)):(delete e[h],b.C(h,a,l))}};return(g,h)=>f(g,h,0)}class fh extends olympe.dc.query.Relation{constructor(a,b,c,d){super(a,b,1!==c||1!==d);this.F=c;this.C=d}la(){return`${this.T()}, ${this.Ra()}, ${this.F}, ${this.C}`}}olympe.dc.V.lf.ma=[olympe.dc.bb];olympe.dc.V.il=class{constructor(a,b){this.G=a;this.value=b}C(a,b){return olympe.D.cf([this.G,this.value.getValue(a,b)],(c,d)=>{c=c.valueOf();return(Number(c)&Number(d.valueOf()))===Number(c)})}na(){return O(olympe.dc.V.il)}F(){return[this.value.C()]}la(a){const b=olympe.D.ob(this.G)?this.G.Pa.Kb.valueOf():this.G.valueOf();return'{"c":"'+this.na()+'","a":['+b+','+this.value.la(a)+']}'}toString(){const a=olympe.D.ob(this.G)?this.G.Pa.Kb.valueOf():this.G.valueOf();return this.na().replace(/^.+\./,'')+
|
|
647
|
+
'('+a.toString()+','+this.value.toString()+')'}};N('olympe.dc.predicates.BitMask',olympe.dc.V.il);olympe.dc.V.il.ma=[olympe.dc.bb];let hh=0;olympe.dc.V.Ng=class{constructor(){this.id=hh++}na(){return'CustomLocalPredicate#'+this.id}F(){return[]}C(){throw Error('Test function was not implemented.');}la(){return`{"c":"${this.na()}"}`}toString(){return this.na()+'()'}};olympe.dc.V.Ng.ma=[olympe.dc.bb];olympe.dc.V.Al=class{constructor(a,b,c){this.Oa=[];this.G=void 0!==c?c.map(olympe.dc.za):null;a=Array.isArray(a)?a:[a];for(let d=0,e=a.length;d<e;d++)c=a[d],c instanceof olympe.dc.Y.Bc?this.Oa.push(new ih(c.T(),c.Ra(),c.F,c.C)):this.Oa.push(new ih(olympe.dc.za(c),b[d],1,1))}na(){return O(olympe.dc.V.Al)}F(){return[this.Oa.reduce((a,b)=>a.concat(b),[])]}C(a,b){const c=olympe.D.createNode(Boolean),d=olympe.dc.Ja(),e=olympe.X.yg();a=(h,k,l)=>{k&&(null===this.G||this.G.includes(l))&&h(1)};const f=this.Oa;
|
|
648
|
+
for(let h=f.length-1;0<=h;h--)a=f[h].getTransform(d,a,e+h);let g=0;Bc(d,b,a.bind(null,h=>{c.$()||c.G()||(g+=h,K(c,0<g))}),e);olympe.D.La().onDestroy(()=>Cc(d,b,e));c.bf(!1);return c}la(){return'{"c":"'+this.na()+'","a":['+JSON.stringify(this.Oa.map(a=>a.la()))+(null!==this.G?',"'+this.G.toString():'')+'"]}'}toString(){return'HasRelatedTree('+(null!==this.G?'#['+this.G.toString()+'], ':'')+this.Oa.map(a=>a.la())+')'}};N('olympe.dc.predicates.HasRelatedTree',olympe.dc.V.Al);
|
|
649
|
+
class ih extends olympe.dc.query.Relation{constructor(a,b,c,d){super(a,b,1!==c||1!==d);this.F=c;this.C=d;this.L=new Map;this.G=new Map}getTransform(a,b,c){const d=this.G,e=this.L,f=new Set,g=(k,l,n)=>{e.has(l)?e.get(l).set(c+n,k):e.set(l,(new Map).set(c+n,k))},h=(k,l,n,p,q)=>{const r=olympe.X.yg();if(p){const t=n+q,u=v=>{const w=e.get(q);if(f.has(t))throw Error(`Try to use the predicate HasRelatedTree with recursion in a graph cluster containing a loop around instances ${n} and ${q}`);void 0!==w&&
|
|
650
|
+
null!==w&&(f.add(t),d.set(q,(d.get(q)||0)+v),Array.from(w.values()).forEach(y=>y(v)));f.delete(t)};g(k,q,n);d.has(q)?k(d.get(q)):(l>=this.F&&b(v=>{d.set(q,(d.get(q)||0)+v);k(v)},p,q),(0>this.C||l<=this.C)&&q!==n&&V(a,q,this,h.bind(this,u,l+1,q),r))}else k(-d.get(q)),e.get(q).delete(c+n),0===e.get(q).size&&(d.delete(q),e.delete(q),a.C(q,this,r))};return(k,l,n)=>h(k,0,'origin',l,n)}la(){return`${this.T()}, ${this.Ra()}, ${this.F}, ${this.C}`}}olympe.dc.V.Al.ma=[olympe.dc.bb];olympe.dc.Y={};olympe.dc.Y.kk={Ys:1,kt:-1,kp:0};olympe.dc.Y.uB={Wy:!0,vz:!1};olympe.dc.Y.Sb=class extends olympe.dc.ua.Relation{constructor(a,b){super(a,b||olympe.dc.Ca.DESTINATION)}Wb(){return Qc(this)}na(){return O(olympe.dc.Y.Sb)}Ec(){return new olympe.dc.Y.Sb(this.tag,this.direction===olympe.dc.Ca.DESTINATION?olympe.dc.Ca.ORIGIN:olympe.dc.Ca.DESTINATION)}getTransform(a,b,c){const d=olympe.dc.Ja(),e=this.T(),f=this.Ra();return(g,h,k,l)=>{Tg(b,k,h,e,f);g?V(d,h,this,(n,p)=>{const q=olympe.X.pb(k+f+e+p,20),r=Eg(l,n,p,q);n&&b.register(q,k,h,e,f);c(n,p,q,r)},k):d.C(h,this,k)}}la(){return'{"c":"'+
|
|
651
|
+
this.na()+'","a":["'+this.T()+'","'+this.Ra()+'"]}'}toString(){return'Related('+this.Ra()+this.T()+')'}};N('olympe.dc.transformers.Related',olympe.dc.Y.Sb);olympe.dc.Y.Sb.ma=[olympe.dc.Wc];olympe.dc.Y.Bc=class extends olympe.dc.ua.Relation{constructor(a,b=olympe.dc.Ca.DESTINATION,c=1,d=-1){super(a,b);this.F=c;this.C=d}Wb(){return Qc(this)}na(){return O(olympe.dc.Y.Bc)}getTransform(a,b,c){const d=olympe.dc.Ja(),e=Object.create(null),f=olympe.dc.Ca.ORIGIN,g=olympe.dc.Ca.DESTINATION,h=this.T(),k=this.Ra(),l=(p,q,r)=>{if(!(0<=this.C&&p>=this.C)){var t=d.ub(r,this);p+=1;for(let u=0,v=t.length;u<v;u++){if(void 0!==e[t[u]]||r===t[u])continue;const w=olympe.X.pb(q+k+(h+'_'+p)+t[u],20);b.register(w,
|
|
652
|
+
q,r,h,k||g);null===k&&b.register(w,q,r,h,f)}}},n=(p,q,r,t,u,v)=>{u&&!b.F&&l(p,t,v);p>=this.F?c(u,v,t,Eg(r,u,v,t)):Tg(b,t,v,h,k);0<=this.C&&p>=this.C||(u?e[v]||(e[v]=!0,V(d,v,this,(w,y)=>{const B=p+1,E=olympe.X.pb(t+k+(h+'_'+B)+y,20);n(B,v,r,E,w,y)},t)):(d.C(v,this,t),delete e[v]))};return(p,q,r,t)=>n(0,null,t,r,p,q)}la(){return'{"c":"'+this.na()+'","a":["'+this.T()+'","'+this.Ra()+'",'+this.F+','+this.C+']}'}toString(){return'RecursiveRelated('+this.Ra()+this.T()+'['+this.F+'..'+this.C+'])'}};
|
|
653
|
+
N('olympe.dc.transformers.RecursiveRelated',olympe.dc.Y.Bc);olympe.dc.Y.Bc.ma=[olympe.dc.Wc];function jh(a){return a.Oa.map(b=>b.T())}
|
|
654
|
+
olympe.dc.Y.Ce=class{constructor(a,b){this.direction=b||olympe.dc.Ca.DESTINATION;this.Oa=a.map(c=>new olympe.dc.ua.Relation(c,this.direction))}Wb(){return olympe.dc.CloudObject}na(){return O(olympe.dc.Y.Ce)}Ra(){return this.direction}getTransform(a,b,c){const d=olympe.dc.Ja(),e=(f,g,h,k)=>V(d,f,k,(l,n)=>{var p=k.Ra();var q=k.T();p=olympe.X.pb(g+p+q+n,20);q=Eg(h,l,n,p);l&&b.register(p,g,f,k.T(),k.Ra());c(l,n,p,q)},g);return(f,g,h,k)=>{f?this.Oa.forEach(l=>{Tg(b,h,g,l.T(),l.Ra());e(g,h,k,l)}):this.Oa.forEach(l=>
|
|
655
|
+
{d.C(g,l,h)})}}la(){return'{"c":"'+this.na()+'","a":['+JSON.stringify(jh(this))+',"'+this.direction+'"]}'}toString(){return'MultiRelated('+this.Ra()+'['+jh(this).join(',')+'])'}};N('olympe.dc.transformers.MultiRelated',olympe.dc.Y.Ce);olympe.dc.Y.Ce.ma=[olympe.dc.Wc];olympe.dc.Y.ul=class{constructor(a,b,c,d){this.C=new olympe.dc.ua.Relation(olympe.dc.za(a),c||olympe.dc.Ca.DESTINATION);this.F=new olympe.dc.ua.Relation(olympe.dc.za(b),d||olympe.dc.Ca.DESTINATION)}Wb(){return Qc(this.C)}na(){return O(olympe.dc.Y.ul)}getTransform(a,b,c){const d=olympe.dc.Ja(),e={},f=this.C.T(),g=this.C.Ra(),h=this.F.T(),k=this.F.Ra();let l=null,n=null;const p=(r,t,u,v,w,y)=>{if(w){if(w=()=>{const B=olympe.X.pb(u+g+(f+'_'+r)+y,20),E=Eg(t,!0,y,B);l=r;n=()=>{c(!1,y,B,Eg(t,!1,y,B))};
|
|
656
|
+
b.register(B,u,v,f,g);c(!0,y,B,E)},w.Pr=r,e[v]=w,null===l||r<l)n&&n(),w()}else if(l===r){n();e[v]=!0;w=Infinity;let B=null;for(let E=Object.keys(e),S=E.length,I=0;I<S;I++){let aa=e[E[I]];aa.Pr<w&&(w=aa.Pr,B=aa)}B&&B()}},q=(r,t,u,v,w)=>{v?e[w]||(e[w]=!0,Tg(b,u,w,f,g),Tg(b,u,w,h,k),V(d,w,this.C,p.bind(this,r,t,u,w),u+'_val'),V(d,w,this.F,q.bind(this,r+1,t,u),u+'_follow')):(d.C(w,this.F,u+'_follow'),d.C(w,this.C,u+'_val'),delete e[w])};return(r,t,u,v)=>q(0,v,u,r,t)}la(){return'{"c":"'+this.na()+'","a":["'+
|
|
657
|
+
this.C.toString()+'","'+this.F.toString()+'"]}'}toString(){return'FirstRelated('+this.C.toString()+', '+this.F.toString()+')'}};N('olympe.dc.transformers.FirstRelated',olympe.dc.Y.ul);olympe.dc.Y.ul.ma=[olympe.dc.Wc];olympe.dc.Y.xe=class{Wb(){return null}na(){return O(olympe.dc.Y.xe)}getTransform(a,b,c){const d={};return function(e,f,g,h){e?void 0===d[f]?(d[f]=1,b.C.C!==g||b.F||(b.C.C=f),c(!0,f,f,Eg(h,!0,f,f))):(d[f]++,Sg(b,g)):void 0!==d[f]&&0>=--d[f]&&(delete d[f],c(!1,f,f,Eg(h,!1,f,f)))}}la(){return'{"c":"'+this.na()+'"}'}toString(){return'Distinct()'}};N('olympe.dc.transformers.Distinct',olympe.dc.Y.xe);olympe.dc.Y.xe.ma=[olympe.dc.Wc];olympe.dc.Y.Hd=class{constructor(a,b){this.Id=a;this.C=void 0===b?!0:!!b}Wb(){return null}na(){return O(olympe.dc.Y.Hd)}F(){return[this.Id.R()]}getTransform(a,b,c){const d=new olympe.dc.pc.Pq(this.C?this.Id.G.bind(this.Id):(e,f)=>this.Id.G(f,e));return(e,f,g)=>{var h=e?this.Id.L(a,f):void 0;h=d.C(e,f,g,h);c(e,f,g,h)}}la(a){return'{"c":"'+this.na()+'","a":['+this.Id.la(a)+','+JSON.stringify(this.C)+']}'}toString(){return'Sort('+this.Id.toString()+','+JSON.stringify(this.C)+')'}};
|
|
658
|
+
N('olympe.dc.transformers.Sort',olympe.dc.Y.Hd);olympe.dc.Y.Hd.ma=[olympe.dc.Wc,olympe.dc.iq];olympe.dc.Y.rc=class{constructor(a){this.C=a}Wb(){return null}na(){return O(olympe.dc.Y.rc)}F(){return this.C.F()}getTransform(a,b,c){function d(f,g,h,k){k=k.valueOf();!1===k&&Sg(b,g);k!==!!e[g]&&(e[g]=k,c(k,f,g,Eg(h,k,f,g)))}const e={};return(f,g,h,k)=>{const l='@'+h;f?(f=this.C.C(a,g),olympe.D.ob(f)&&(f=f.Pa),olympe.D.Uf(f)?(b.F||void 0!==olympe.D.$a(f)||Sg(b,h),e[l]=f,olympe.D.yc([f],n=>{d(g,h,k,n)},'filterResultHandler')):d(g,h,k,f)):(void 0!==e[l]&&(e[l].destroy(),delete e[l]),d(g,h,k,!1),delete e[h])}}la(a){return'{"c":"'+
|
|
659
|
+
this.na()+'","a":['+this.C.la(a)+']}'}toString(){return'Filter('+this.C.toString()+')'}};N('olympe.dc.transformers.Filter',olympe.dc.Y.rc);olympe.dc.Y.rc.ma=[olympe.dc.Wc,olympe.dc.iq];olympe.dc.Y.Xd=class{constructor(a,b){this.start=a;this.C=b}Wb(){return null}na(){return O(olympe.dc.Y.Xd)}getTransform(a,b,c){const d=new olympe.dc.pc.Ol;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]);Pg(d,e,f,n,c)}};olympe.D.ie([this.start,this.C],(n,p)=>{f=n.valueOf();g=p.valueOf();k()});Yg(b,k);const l=Vg(b);Ug(b,l);return(n,p,q,r)=>{h||(r.Pc().Kg(t=>{e=t;Zg(b,l)}),Cg(b,()=>r.tg(),l),h=!0);d.C(n,p,q,null);Dg(b,q,l)}}la(a){return'{"c":"'+
|
|
660
|
+
this.na()+'","a":['+Nf(a,this.start)+','+Nf(a,this.C)+']}'}toString(){return`Limit(${olympe.D.$a(this.start)},${olympe.D.$a(this.C)})`}};N('olympe.dc.transformers.Limit',olympe.dc.Y.Xd);olympe.dc.Y.Xd.ma=[olympe.dc.Wc];function kh(a,b,c,d,e,f){function g(p,q){if(l)for(var r=l.length-1;0<=r;r--)f=l[r].getTransform(b,e,n.F(f));f=n.F(f);e.register(h,null);r=d.C(p,q,c,null);f(p,q,h,Eg(r,p,q,h))}const h=olympe.X.ec(),k=olympe.dc.Ja(),l=a.Y,n=olympe.D.La();olympe.D.yc([a.C],p=>{lh(k,p,g,h);void 0===k.model(p)&&Bg(e)})}function lh(a,b,c,d){const e=b&&b.valueOf();e&&(Bc(a,e,c,d),olympe.D.La().R(()=>Cc(a,e,d)))}
|
|
661
|
+
olympe.dc.Y.wf=class{constructor(a,b){this.Y=this.C=null;a instanceof olympe.dc.Da?(this.C=a.Ld(),this.Y=a.Hl()):(this.C=a,b&&(this.Y=b))}Wb(){return null}na(){return O(olympe.dc.Y.wf)||''}Cg(){return this.Y}Ld(){return this.C}getTransform(a,b,c){const d=new olympe.dc.pc.Ol,e=new olympe.dc.pc.Bj;let f=[],g=[],h=!1,k=!1;const l=Vg(b),n=Vg(b);Yg(b,()=>{const p=f.concat(g);0<p.length?b.F||(b.C.C=p[p.length-1]):Zg(b);Pg(d,p,0,p.length,c)});Ug(b,n);kh(this,a,this.C,e,b,(p,q,r,t)=>{const u=olympe.D.La();
|
|
662
|
+
u.$()||u.G()||(k||(t.Pc().Kg(v=>{g=v;Zg(b,n)}),Cg(b,()=>t.tg(),n),k=!0),d.C(p,q,r),Dg(b,r,n))});Ug(b,l);return(p,q,r,t)=>{h||(t.Pc().Kg(u=>{f=u;Zg(b,l)}),Cg(b,()=>t.tg(),l),h=!0);d.C(p,q,r,l);Dg(b,r,l)}}la(a){const b=this.Y?'['+this.Y.map(c=>c.la(a)).join(',')+']':'null';return'{"c":"'+this.na()+'","a":['+Nf(a,this.C)+','+b+']}'}toString(){const a=olympe.D.ob(this.C)?'N:'+this.C.Pa.Z():this.C.valueOf(),b=this.Y?','+this.Y.map(c=>c.toString()).join(','):'';return'Union('+a+b+')'}};
|
|
663
|
+
N('olympe.dc.transformers.Union',olympe.dc.Y.wf);olympe.dc.Y.wf.ma=[olympe.dc.Wc];olympe.dc.Lg={};function mh(a,b){let c=Ic.get(b)||null,d=null;for(;!c&&b&&b!==d;){d=b;b=a.db.Df(b);if(null===b)break;c=Ic.get(b)||null}return c||null}olympe.dc.Lg.SyncManager=class{constructor(a,b,c){this.N=a;this.db=b;this.C=c}};olympe.dc.Lg.P={Ea:'dc.syncs.Logger',Aa:'dc.syncs.SyncManager'};olympe.U.config(function(a){C(a,olympe.dc.Lg.P.Ea,[olympe.ra.P.Aa],b=>b.Nc('dc'));A(a,olympe.dc.Lg.P.Aa,olympe.dc.Lg.SyncManager,olympe.dc.Lg.P.Ea,olympe.dc.P.ti,olympe.U.P.dg)});olympe.dc.X={};olympe.dc.X.dD=function(a){a=olympe.dc.za(a);const b=olympe.D.Qc(olympe.D.Za,'getInstanceName'),c=olympe.dc.Ja(),d=Gd(c,a,olympe.dc.CloudObject.nameProp,b.update.bind(b));olympe.D.La().R(c.F.bind(c,a,olympe.dc.CloudObject.nameProp,d));return b.Ib()};olympe.dc.X.gD=function(a){return olympe.D.Fa([a],b=>olympe.D.jy(olympe.dc.Ja().kj(b)),olympe.D.sa)};olympe.dc.X.hD=function(a){return(a=olympe.D.$a(a))?olympe.dc.Ja().kj(a):!1};olympe.dc.X.Ji=class a{constructor(b=olympe.dc.Ha.Lc){this.G=b}C(b){const c=new olympe.dc.db.uc;this.F(b,c);return c}R(b,c,d){const e=new olympe.dc.db.uc(b),f=new olympe.dc.query.Bi(b,this.G,c,e);this.F(d,e,(g,h)=>{h=h||[];const k=f.C.get(g)||new Set;for(const l of h)k.add(l);f.C.set(g,k)});return f}L(b,c){const d=new olympe.dc.db.uc(b),e=new olympe.dc.query.ht(b,d);this.F(c,d,(f,g,h)=>{h=h||[];const k=new sf(f);k.add=g||[];k.remove=h;e.C.set(f,k)});return e}F(b,c,d){const e=olympe.dc.Yb.Gd;for(const f of b)switch(b=
|
|
664
|
+
f.i?f.i:-1,f.o){case 1:const g=a.C(f.p||{});g.has(e)||g.set(e,this.G);c.F(f.t,g,b);break;case 2:c.qc(f.t,a.C(f.p),!0,b);break;case 3:c.Dc(f.t,f.f,b);break;case 4:c.Va(f.m,f.l,f.r,b);break;case 5:c.cc(f.m,f.l,f.r,b);break;case 6:d&&d(f.i,f.a,f.d);break;default:throw Error('Undefined patch operation: '+f.o);}}static C(b){const c=new Map;for(const [d,e]of Object.entries(b)){b=d;if(b===olympe.dc.Yb.Gd||b===olympe.dc.Yb.VERSION){c.set(b,e);continue}else if('v'===d){c.set(olympe.dc.Yb.VERSION,e);continue}let f=
|
|
665
665
|
typeof e;b.startsWith('fd')&&(b=olympe.dc.Tg.ic+b.substr(2));'object'===f&&(f=e&&e.c?String(e.c):'untyped');switch(f){case '1':case '2':case '3':throw Error('Complex format for primitive types not supported.');case 'string':c.set(b,String(e));break;case 'boolean':c.set(b,!!e);break;case 'number':c.set(b,Number(e));break;case '4':c.set(b,new Date(Date.UTC(e.y,e.M-1,e.d,e.h,e.m,e.s,e.S)));break;case '5':c.set(b,new Date(Date.UTC(e.y,e.M-1,e.d)));break;case '6':c.set(b,new Date(Date.UTC(e.y||1970,e.M&&
|
|
666
|
-
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.Cc(e.t));break;case 'untyped':null===e&&c.set(b,null)}}return c}};olympe.dc.X.Tb={};olympe.dc.X.Tb.
|
|
667
|
-
olympe.dc.X.Tb.
|
|
668
|
-
olympe.dc.X.Tb.fh=a=>a instanceof olympe.dc.Cc?
|
|
669
|
-
olympe.dc.X.Tb.
|
|
670
|
-
olympe.U.config(function(a){D(a,olympe.dc.Config.eg,!1);D(a,olympe.dc.Config.Zg,!1);D(a,olympe.dc.Config.
|
|
671
|
-
olympe.dc.P.Ea,olympe.dc.db.P.Aa,olympe.dc.query.P.Aa,olympe.dc.transaction.P.Aa,olympe.dc.Lg.P.Aa,olympe.dc.P.
|
|
666
|
+
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.Cc(e.t));break;case 'untyped':null===e&&c.set(b,null)}}return c}};olympe.dc.X.Tb={};olympe.dc.X.Tb.Hm=a=>'string'===typeof a||'number'===typeof a||'boolean'===typeof a||a instanceof String?olympe.D.yb(a):a instanceof olympe.D.Za?a:null;olympe.dc.X.Tb.Em=a=>'boolean'===typeof a||a instanceof Boolean?olympe.D.wc(a):a instanceof olympe.D.sa?a:null;olympe.dc.X.Tb.Gm=a=>'number'===typeof a||a instanceof Number?olympe.D.Ba(a):'string'===typeof a||a instanceof String?olympe.D.Ba(Number.parseFloat(a.valueOf())):a instanceof olympe.D.ga?a:null;
|
|
667
|
+
olympe.dc.X.Tb.Fm=function(a){return'number'===typeof a||a instanceof Number?tb(a.valueOf()):'string'===typeof a||a instanceof String?new olympe.D.ib(new Date(a.valueOf().valueOf())):a instanceof Date?new olympe.D.ib(a):a instanceof olympe.D.ib?a:null};olympe.dc.X.Tb.sr=function(a){return a instanceof olympe.D.Color?a:'string'===typeof a||a instanceof String?xb(a.valueOf()):null};olympe.dc.X.Tb.tr=a=>a instanceof olympe.dc.CloudObject?a:a instanceof olympe.dc.Cc?Fc(a):null;
|
|
668
|
+
olympe.dc.X.Tb.fh=a=>a instanceof olympe.dc.Cc?Fc(a):a;olympe.dc.X.Tb.OC=a=>{switch(typeof a){case 'boolean':return olympe.D.wc(a);case 'number':return olympe.D.Ba(a);case 'string':return olympe.D.yb(a);case 'object':if(a instanceof Date)return olympe.D.Wx(a)}return a};
|
|
669
|
+
olympe.dc.X.Tb.aD=a=>{switch(a){case olympe.D.sa:return olympe.dc.X.Tb.Em;case olympe.D.Za:return olympe.dc.X.Tb.Hm;case olympe.D.ga:return olympe.dc.X.Tb.Gm;case olympe.D.ib:return olympe.dc.X.Tb.Fm;case olympe.D.Color:return olympe.dc.X.Tb.sr;case olympe.dc.CloudObject:return olympe.dc.X.Tb.tr;default:return olympe.dc.X.Tb.fh}};olympe.dc.P={Aa:'dc.Manager',ft:'dc.Graph',ti:'dc.DBView',Ea:'dc.Logger',bv:'dc.TransactionLogger',xi:'dc.FileServiceManager',ne:'dc.Router'};olympe.dc.Config={eg:'dc.debug',Zg:'dc.subscribeAll',oo:'dc.defaultSource',Eo:'dc.fileCache',xo:'dc.errorOnAbstractInstantiation'};
|
|
670
|
+
olympe.U.config(function(a){D(a,olympe.dc.Config.eg,!1);D(a,olympe.dc.Config.Zg,!1);D(a,olympe.dc.Config.oo,olympe.dc.Ha.Lc);D(a,olympe.dc.Config.Eo,!0);D(a,olympe.dc.Config.xo,!0);C(a,olympe.dc.P.Ea,[olympe.ra.P.Aa],b=>b.Nc('dc'));sa(a,olympe.dc.P.bv,olympe.dc.transaction.P.Ea);sa(a,olympe.dc.P.ti,olympe.dc.db.P.hb);A(a,olympe.dc.P.xi,olympe.dc.bt,olympe.dc.P.Ea,olympe.net.P.Aa,olympe.dc.P.ne,olympe.X.P.th,new olympe.U.fa(olympe.dc.Config.Eo));ta(a,olympe.dc.P.ne);A(a,olympe.dc.P.Aa,olympe.dc.pa,
|
|
671
|
+
olympe.dc.P.Ea,olympe.dc.db.P.Aa,olympe.dc.query.P.Aa,olympe.dc.transaction.P.Aa,olympe.dc.Lg.P.Aa,olympe.dc.P.xi)},'olympe.dc');olympe.U.run([olympe.dc.db.P.Aa,olympe.dc.query.P.Aa,olympe.dc.transaction.P.Aa,olympe.dc.Lg.P.Aa,olympe.dc.P.Aa,olympe.dc.P.xi],(a,b,c,d,e,f)=>{olympe.dc.xd=()=>a;olympe.dc.Nf=()=>b;olympe.dc.ei=()=>c;olympe.dc.Nr=()=>d;olympe.dc.Pc=()=>e;olympe.dc.Cw=()=>f},'DC singleton getter initialization');function nh(a){const b=olympe.dc.Ja(),c=new Map;b.Hk(a).forEach(d=>{b.ub(d,olympe.dc.CloudObject.propertyRel).forEach(e=>{const f=b.name(e);c.has(f)||c.set(f,e)})});return c}olympe.dc.CloudObject=class{constructor(a,b){this.tag=b;this.db=olympe.dc.Ja();this.model=null}static get(a){{var b=olympe.dc.Nr();a=olympe.dc.za(a);const c=mh(b,b.db.model(a));null===c?(b.N.error(`Instantiation of a CloudObject (tag = '${a}') that does not exist (or incompletely exists) in the local database.\n
|
|
672
672
|
This could lead to unwanted behaviour and must be fixed.
|
|
673
|
-
For more information, activate the database debug mode or call "dbMonitor.debug(${a})" from this console.`),b=new olympe.dc.CloudObject(void 0,a)):b=c.instantiate(a,b.C)}return b}static
|
|
674
|
-
g.set(k,h):(k=f(k))&&g.set(k,h)});a=new olympe.sc.Transaction(!1);c=a.create(b||this,g,c);a.
|
|
675
|
-
olympe.dc.CloudObject.R).map(b=>new olympe.dc.ua.Relation(b,olympe.dc.Ca.ORIGIN)))}static Lf(a){return olympe.dc.CloudObject.get(a)}static
|
|
676
|
-
a=>olympe.D.yb(a),olympe.D.Za,'getDisplayName',olympe.D.yb('('+this.toString()+')'))}Nb(){return this.model?this.model.T():this.db.model(this)}observe(a,b,c=!0){const d='function'===typeof a.Sa?a.C.C:a;return new rxjs.Observable(e=>{const f=this.db.cb(this.tag,b);c||null!==f||e.next(f);const g=
|
|
677
|
-
{const d=
|
|
678
|
-
olympe.dc.CloudObject)}Of(a,b,c){const d=olympe.D.Qc(c,'Sync valueType'),e=
|
|
679
|
-
olympe.dc.X.Tb.
|
|
680
|
-
f.has(h)&&(f.get(h).destroy(),f.delete(h))},d);e.R(()=>{c.C(this.tag,a,d)})}
|
|
681
|
-
const a=this.db.model(this.tag),b=this.db.name(a),c=this.db.name(this.tag);return{CloudObject:this.tag,Name:c,Model:`${b} (${a})`}}rh(a=!1,b=!0){const c={};this.db.dd(this,b).forEach((d,e)=>{e=a?this.db.name(e):e;c[e]=d instanceof olympe.dc.Cc?
|
|
682
|
-
for(const [e,f,g]of
|
|
683
|
-
olympe.dc.CloudObject.prototype.get=olympe.dc.CloudObject.prototype.get;olympe.dc.CloudObject.prototype.observeProperty=olympe.dc.CloudObject.prototype.
|
|
684
|
-
olympe.dc.CloudObject.prototype.query=olympe.dc.CloudObject.prototype.query;olympe.dc.CloudObject.prototype.getModel=olympe.dc.CloudObject.prototype.Mf;olympe.dc.CloudObject.prototype.name=olympe.dc.CloudObject.prototype.name;olympe.dc.CloudObject.prototype.getTag=olympe.dc.CloudObject.prototype.T;olympe.dc.CloudObject.getInstancesOf=olympe.dc.CloudObject.
|
|
685
|
-
olympe.dc.CloudObject.getProperties=olympe.dc.CloudObject.dd;olympe.dc.CloudObject.instancesOf=olympe.dc.CloudObject.
|
|
673
|
+
For more information, activate the database debug mode or call "dbMonitor.debug(${a})" from this console.`),b=new olympe.dc.CloudObject(void 0,a)):b=c.instantiate(a,b.C)}return b}static yr(a,b,c=olympe.dc.Ha.ic){if('undefined'===typeof olympe.sc)throw Error('Method CloudObject.createWith should only be used at runtime, when sc package exists');const d=olympe.dc.Ja();let e=null;const f=h=>{null===e&&(e=nh(b||this));return e.has(h)?e.get(h):null},g=new Map;a.forEach((h,k)=>{d.Db(olympe.dc.za(k))?
|
|
674
|
+
g.set(k,h):(k=f(k))&&g.set(k,h)});a=new olympe.sc.Transaction(!1);c=a.create(b||this,g,c);a.kb().catch(h=>olympe.ra.Ya('dc').error(`Error occurred for transaction executed by CloudObject.createWith: ${h}`));return this.get(c)}static Av(){return this.get(this)}static Lk(a){return olympe.dc.gb.Lk(a)}static dd(){return olympe.dc.Ja().ub(this,olympe.dc.CloudObject.propertyRel).map(a=>new olympe.dc.ua.Property(a))}static ed(){const a=olympe.dc.Ja();return a.ub(this,olympe.dc.CloudObject.G).map(b=>new olympe.dc.ua.Relation(b)).concat(a.ub(this,
|
|
675
|
+
olympe.dc.CloudObject.R).map(b=>new olympe.dc.ua.Relation(b,olympe.dc.Ca.ORIGIN)))}static Lf(a){return olympe.dc.CloudObject.get(a)}static Iw(a){var b=mh(olympe.dc.Nr(),olympe.dc.za(a));b=b&&b.C;return new olympe.dc.Da(olympe.dc.za(a),olympe.dc.CloudObject.instancesRel,b)}T(){return this.tag}name(){return this.db.name(this)}na(){return this.Eb(olympe.dc.CloudObject.nameProp)}Mf(){this.model||(this.model=olympe.dc.CloudObject.get(this.db.model(this)));return this.model}query(){return olympe.dc.gb.from(this)}Wf(){return this.db.Wf(this)}qx(){return this.db.version(this)}Dt(){return this.db.source(this)}Gr(){return olympe.D.Fa([this.na()],
|
|
676
|
+
a=>olympe.D.yb(a),olympe.D.Za,'getDisplayName',olympe.D.yb('('+this.toString()+')'))}Nb(){return this.model?this.model.T():this.db.model(this)}observe(a,b,c=!0){const d='function'===typeof a.Sa?a.C.C:a;return new rxjs.Observable(e=>{const f=this.db.cb(this.tag,b);c||null!==f||e.next(f);const g=Gd(this.db,this.tag,b,h=>{null===h||void 0===h?e.next(null):e.next(h)});d.R(()=>{e.complete();this.db.F(this.tag,b,g)});return()=>this.db.F(this.tag,b,g)})}jn(a){const b='function'===typeof a.Sa?a.C.C:a;return new rxjs.Observable(c=>
|
|
677
|
+
{const d=Hd(this.db,this.tag,(e,f)=>{null===f||void 0===f?c.next([new olympe.dc.ua.Property(e),null]):c.next([new olympe.dc.ua.Property(e),f])});b.R(()=>{c.complete();Id(this.db,this.tag,d)});return()=>Id(this.db,this.tag,d)})}ay(a){return this.observe(olympe.D.La(),a)}get(a){return this.db.cb(this.tag,a,!0)}cb(a){return this.get(a)}rb(a){return olympe.dc.gb.from(this).rb(a)}Cr(a){return olympe.dc.kd.from(this).rb(a)}pw(){return this.oc(olympe.dc.CloudObject.Hb,olympe.dc.CloudObject)}Tm(){return this.ub(olympe.dc.CloudObject.containsRel,
|
|
678
|
+
olympe.dc.CloudObject)}Of(a,b,c){const d=olympe.D.Qc(c,'Sync valueType'),e=Gd(this.db,this.tag,a,olympe.D.La().F(f=>{b&&null!==f&&void 0!==f&&(f=b(f));null===f||void 0===f?d.clear():d.update(f)}));d.node.onDestroy(()=>this.db.F(this.tag,a,e));return d.node}Eb(a){return L(this.Of(a,olympe.dc.X.Tb.Hm,olympe.D.Za))}Ie(a){return L(this.Of(a,olympe.dc.X.Tb.Gm,olympe.D.ga))}Bg(a){return L(this.Of(a,olympe.dc.X.Tb.Em,olympe.D.sa))}hj(a){return L(this.Of(a,olympe.dc.X.Tb.Fm,olympe.D.ib))}Lr(){return L(this.Of(olympe.dm.Color.valueProp,
|
|
679
|
+
olympe.dc.X.Tb.sr,olympe.D.Color))}Mr(){return L(this.Of(olympe.sc.workflow.Transition.processRefProp,olympe.dc.X.Tb.tr,olympe.dc.CloudObject))}ub(a,b){a=a instanceof olympe.dc.Y.Sb?a:new olympe.dc.Y.Sb(a.T(),a.Ra());return new olympe.dc.Da(this.T(),a,b)}oc(a,b){return this.ub(a,b).Oc()}Dr(a,b){const c=this.db,d=olympe.X.ec(),e=olympe.D.La(),f=new Map;V(c,this.tag,a,(g,h)=>{g?(g=new olympe.D.Zb(`forEachRelated: (${this.tag})-[:${a.T()}]-(${h})`,e),f.set(h,g),g.run(b,olympe.dc.CloudObject.get(h))):
|
|
680
|
+
f.has(h)&&(f.get(h).destroy(),f.delete(h))},d);e.R(()=>{c.C(this.tag,a,d)})}Oy(){return new olympe.dc.Da(this.T(),[],Oc(this.T()))}transform(...a){return(new olympe.dc.Da(this.T(),[],this.constructor)).transform(...a)}Rc(){return this.Gr()}toString(){if(!this.db.Db(this.tag))return`unknown object #${this.tag||'NULL_TAG'}`;const a=this.db.model(this.tag);var b=this.db.name(this);b=b?` instanceName: '${b}'`:'';return a?`${this.db.name(a)}#${this.tag}${b}`:`orphan object (no model) #${this.tag}${b}`}toJSON(){if(!this.db.Db(this.tag))return{CloudObject:'Unknown tag'};
|
|
681
|
+
const a=this.db.model(this.tag),b=this.db.name(a),c=this.db.name(this.tag);return{CloudObject:this.tag,Name:c,Model:`${b} (${a})`}}rh(a=!1,b=!0){const c={};this.db.dd(this,b).forEach((d,e)=>{e=a?this.db.name(e):e;c[e]=d instanceof olympe.dc.Cc?Fc(d):d});return c}nb(a){return a instanceof olympe.dc.CloudObject?this.T()===a.T():!1}Pd(a){return olympe.D.Fa([a],b=>olympe.D.wc(this.nb(b)),olympe.D.sa)}Sv(a){const b=this.db;let c=!1;if(void 0===a||null===a)a=new olympe.dc.Transaction,c=!0;const d=olympe.dc.Ca.ORIGIN;
|
|
682
|
+
for(const [e,f,g]of Kd(b,this))f===d?a.cc(e,g,this):e!==olympe.dc.CloudObject.modelRel.T()&&a.cc(e,this,g);a.delete(this,olympe.dc.Qb.NONE);c&&a.kb()}};olympe.dc.CloudObject.prototype.equals=olympe.dc.CloudObject.prototype.nb;olympe.dc.CloudObject.prototype.toObject=olympe.dc.CloudObject.prototype.rh;olympe.dc.CloudObject.prototype.followSingle=olympe.dc.CloudObject.prototype.Cr;olympe.dc.CloudObject.prototype.follow=olympe.dc.CloudObject.prototype.rb;olympe.dc.CloudObject.prototype.getProperty=olympe.dc.CloudObject.prototype.cb;
|
|
683
|
+
olympe.dc.CloudObject.prototype.get=olympe.dc.CloudObject.prototype.get;olympe.dc.CloudObject.prototype.observeProperty=olympe.dc.CloudObject.prototype.ay;olympe.dc.CloudObject.prototype.observeProperties=olympe.dc.CloudObject.prototype.jn;olympe.dc.CloudObject.prototype.observe=olympe.dc.CloudObject.prototype.observe;olympe.dc.CloudObject.prototype.getModelTag=olympe.dc.CloudObject.prototype.Nb;olympe.dc.CloudObject.prototype.isPersisted=olympe.dc.CloudObject.prototype.Wf;
|
|
684
|
+
olympe.dc.CloudObject.prototype.query=olympe.dc.CloudObject.prototype.query;olympe.dc.CloudObject.prototype.getModel=olympe.dc.CloudObject.prototype.Mf;olympe.dc.CloudObject.prototype.name=olympe.dc.CloudObject.prototype.name;olympe.dc.CloudObject.prototype.getTag=olympe.dc.CloudObject.prototype.T;olympe.dc.CloudObject.getInstancesOf=olympe.dc.CloudObject.Iw;olympe.dc.CloudObject.getInstance=olympe.dc.CloudObject.Lf;olympe.dc.CloudObject.getRelations=olympe.dc.CloudObject.ed;
|
|
685
|
+
olympe.dc.CloudObject.getProperties=olympe.dc.CloudObject.dd;olympe.dc.CloudObject.instancesOf=olympe.dc.CloudObject.Lk;olympe.dc.CloudObject.asInstance=olympe.dc.CloudObject.Av;olympe.dc.CloudObject.createWith=olympe.dc.CloudObject.yr;olympe.dc.CloudObject.get=olympe.dc.CloudObject.get;olympe.dc.CloudObject.O=olympe.dc.ya.C('ff021000000000000001',olympe.dc.CloudObject);olympe.dc.CloudObject.mj=olympe.dc.CloudObject.O.xa(olympe.dc.Yb.VERSION);olympe.dc.CloudObject.nameProp=olympe.dc.CloudObject.O.xa('ff023000000000000011');
|
|
686
686
|
z('olympe.dc.CloudObject.nameProp',olympe.dc.CloudObject.nameProp);olympe.dc.CloudObject.W=olympe.dc.CloudObject.O.xa('ff023000000000000012');olympe.dc.CloudObject.G=olympe.dc.CloudObject.O.Ga('ff02200000000000000a');olympe.dc.CloudObject.R=olympe.dc.CloudObject.O.Ga('ff02200000000000000b',olympe.dc.Ca.ORIGIN);olympe.dc.CloudObject.$d=olympe.dc.CloudObject.O.Ga('017e9c4ba4c847d71cbf');olympe.dc.CloudObject.vd=olympe.dc.CloudObject.O.Ga('017ea013caf8e89cedb2');olympe.dc.CloudObject.propertyRel=olympe.dc.CloudObject.O.Ga('ff02200000000000000c');
|
|
687
687
|
z('olympe.dc.CloudObject.propertyRel',olympe.dc.CloudObject.propertyRel);olympe.dc.CloudObject.typeRel=olympe.dc.CloudObject.O.Ga('ff02200000000000000d',olympe.dc.Ca.ORIGIN);olympe.dc.CloudObject.modelRel=olympe.dc.CloudObject.O.Ga(olympe.dc.jc.Tc);z('olympe.dc.CloudObject.modelRel',olympe.dc.CloudObject.modelRel);olympe.dc.CloudObject.instancesRel=P(olympe.dc.CloudObject.O,olympe.dc.CloudObject.modelRel);z('olympe.dc.CloudObject.instancesRel',olympe.dc.CloudObject.instancesRel);
|
|
688
|
-
olympe.dc.CloudObject.extendRel=olympe.dc.CloudObject.O.Ga(olympe.dc.jc.
|
|
689
|
-
olympe.dc.CloudObject.Hb=P(olympe.dc.CloudObject.O,olympe.dc.CloudObject.containsRel);olympe.dc.CloudObject.
|
|
690
|
-
m.
|
|
691
|
-
m.ub.K=new olympe.D.J(()=>olympe.dc.Da,[]);m.oc.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.
|
|
692
|
-
new olympe.dc.Y.xe)}
|
|
693
|
-
olympe.dc.
|
|
694
|
-
olympe.dc.ea.Xb=class{constructor(a,b){a=this.C=a;if(a.C)throw b=a.C.na(),a=a.C.T(),Error('Cannot work on a new definition without calling done on the previous one or popping it. '+`Make sure done() method has been called on previous definition ${b} (${a})`);if(void 0===this)throw Error('Current def cannot be set to undefined.');a.C=this;this.tag=b;this.F=new Map;this.$=olympe.dc.CloudObject.O.T();this.ta=new Map;this.ja=new Map;this.W=this.da=!1;this.R=null}
|
|
695
|
-
this.R=a;return this}
|
|
696
|
-
if(a===olympe.dc.CloudObject.containsRel.T())throw Error('Container must be defined using dedicated helpers setContainedIn');b&&this.ta.set(a+'.'+b,[a,b]);return this}
|
|
697
|
-
-1);
|
|
698
|
-
olympe.dc.ea.Xb.prototype.addRelationFrom=olympe.dc.ea.Xb.prototype.
|
|
699
|
-
olympe.dc.ea.Xb.prototype.setContainedIn=olympe.dc.ea.Xb.prototype.
|
|
700
|
-
e).
|
|
701
|
-
f=b.tag;this.C.push();this.C.Gg(f,d).
|
|
702
|
-
olympe.dc.ea.$c.prototype['extends']=olympe.dc.ea.$c.prototype.extends;olympe.dc.ea.$c.prototype.setParentTag=olympe.dc.ea.$c.prototype.
|
|
703
|
-
olympe.dc.ea.
|
|
704
|
-
this.PROPERTY=olympe.dm.Property.O.T();this.RELATION=olympe.dm.Relation.O.T();this.STRING=olympe.dm.String.O.T();this.BOOLEAN=olympe.dm.Boolean.O.T();this.NUMBER=olympe.dm.Number.O.T();this.DATETIME=olympe.dm.DateTime.O.T();this.COLOR=olympe.dm.Color.O.T();this.FILE=olympe.dm.File.O.T();this.ROLE=olympe.dm.ad.O.T();this.USER=olympe.dm.User.O.T();this.ONE_ONE=olympe.dm.Relation.F.
|
|
705
|
-
olympe.dm.
|
|
706
|
-
this.DUMP_REF=olympe.dm.Relation.C.
|
|
707
|
-
olympe.dm.Relation.C.
|
|
708
|
-
this.N&&this.N.error(...a)}
|
|
709
|
-
a)).
|
|
710
|
-
c,b)}gh(a,b,c,d,e,f,{
|
|
711
|
-
olympe.dm.Relation;d={[olympe.dc.CloudObject.nameProp.T()]:d||'',[q.
|
|
712
|
-
Object.keys(b).forEach(e=>{d.set(e,b[e])});this.F.qc(a,d,c,-1)}assign(a,b,c){this.
|
|
713
|
-
b.s=a.getSeconds();b.S=a.getMilliseconds();b.z=-a.getTimezoneOffset();return b}
|
|
714
|
-
}};olympe.dc.ea.
|
|
715
|
-
olympe.dc.ea.
|
|
716
|
-
olympe.dc.ea.
|
|
717
|
-
olympe.dc.ea.
|
|
718
|
-
olympe.dc.ea.
|
|
719
|
-
this.description&&a.setProperty(olympe.sc.mc.C.T(),this.description),this.L&&a.setProperty(olympe.sc.mc.L.T(),this.L),a.
|
|
720
|
-
d.set('newRel',b);return d}Sf(){return 0===this.va.length+this.C.length}static
|
|
721
|
-
1):f.localeCompare(g)):4===f||5===f?(f=d.l,g=e.l,f===g?(f=d.m,g=e.m,f===g?d.r.localeCompare(e.r):f.localeCompare(g)):f.localeCompare(g)):JSON.stringify(f).localeCompare(JSON.stringify(g))},c=Object.create(null);this.va.sort(b);this.C.sort(b);c.rootTag=this.F;c.operations=this.va;c.optionalOperations=this.C;return c}};olympe.dc.ea.xf=class extends olympe.dc.ea.Xb{constructor(a,b){super(a,b);this.password=this.L=null;this.
|
|
722
|
-
this.C.
|
|
723
|
-
olympe.dm.ad.L=
|
|
688
|
+
olympe.dc.CloudObject.extendRel=olympe.dc.CloudObject.O.Ga(olympe.dc.jc.wi);z('olympe.dc.CloudObject.extendRel',olympe.dc.CloudObject.extendRel);olympe.dc.CloudObject.extendedByRel=P(olympe.dc.CloudObject.O,olympe.dc.CloudObject.extendRel);z('olympe.dc.CloudObject.extendedByRel',olympe.dc.CloudObject.extendedByRel);olympe.dc.CloudObject.containsRel=olympe.dc.CloudObject.O.Ga(olympe.dc.jc.Xn);z('olympe.dc.CloudObject.containsRel',olympe.dc.CloudObject.containsRel);
|
|
689
|
+
olympe.dc.CloudObject.Hb=P(olympe.dc.CloudObject.O,olympe.dc.CloudObject.containsRel);olympe.dc.CloudObject.Rv=olympe.dc.CloudObject.O.Ga('018282d3ac0a474a0bf4');z('olympe.dc.CloudObject.deleteAlsoRel',olympe.dc.CloudObject.Rv);olympe.dc.vB=olympe.dc.CloudObject;olympe.dc.CloudObject.ma=[olympe.dc.Ae];m=olympe.dc.CloudObject.prototype;m.T.K=new olympe.D.J(()=>String,[]);m.name.K=new olympe.D.J(()=>String,[]);m.na.K=olympe.D.J.F;m.Mf.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);
|
|
690
|
+
m.qx.K=new olympe.D.J(()=>Number,[]);m.Dt.K=new olympe.D.J(()=>String,[]);m.Gr.K=olympe.D.J.F;m.Nb.K=new olympe.D.J(()=>String,[]);m.pw.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.Tm.K=new olympe.D.J(()=>olympe.dc.Da,[]);m.Of.K=new olympe.D.J(()=>olympe.D.Node,[]);m.Eb.K=olympe.D.J.F;m.Ie.K=olympe.D.J.G;m.Bg.K=olympe.D.J.R;m.hj.K=new olympe.D.J(()=>olympe.D.ib,[]);m.Lr.K=new olympe.D.J(()=>olympe.D.Color,[]);m.Mr.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);
|
|
691
|
+
m.ub.K=new olympe.D.J(()=>olympe.dc.Da,[]);m.oc.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.Dr.K=new olympe.D.J(()=>{},[]);m.Oy.K=new olympe.D.J(()=>olympe.dc.Da,[]);m.transform.K=new olympe.D.J(()=>olympe.dc.Da,[]);m.Rc.K=olympe.D.J.F;m.toString.K=olympe.D.J.C;m.nb.K=olympe.D.J.C;m.Pd.K=olympe.D.J.R;m.Sv.K=new olympe.D.J(()=>{},[]);olympe.dc.$j=class{constructor(a){this.instance=a}T(){return this.instance.T()}jj(){return ob(this.instance.Bg(olympe.dc.CloudObject.W))}Aw(){return this.instance.oc(olympe.dc.CloudObject.extendRel,olympe.dc.CloudObject)}Hk(){return this.instance.transform(new olympe.dc.Y.Bc(olympe.dc.CloudObject.extendRel.T(),olympe.dc.Ca.DESTINATION,olympe.dc.Y.kk.Ys))}Xm(){return this.instance.transform(new olympe.dc.Y.Bc(olympe.dc.CloudObject.extendRel.T(),olympe.dc.Ca.DESTINATION,olympe.dc.Y.kk.kp))}dd(){return this.Xm().transform(olympe.dc.CloudObject.propertyRel,
|
|
692
|
+
new olympe.dc.Y.xe)}Sw(){return this.instance.transform(olympe.dc.CloudObject.propertyRel)}ed(){return this.Xm().transform(olympe.dc.CloudObject.G,new olympe.dc.Y.xe)}Tw(){return this.instance.transform(olympe.dc.CloudObject.G)}static from(a){return olympe.D.Fa([a],b=>{const c=b.T(),d=olympe.dc.Ja();if(!d.kj(c))throw Error(`Instance "${d.name(c)}" (tag=${c}) is not a model.`);return new olympe.dc.$j(b)},olympe.dc.$j,'transformToModelInfo')}static jj(){return ob((void 0).Bg(olympe.dc.CloudObject.W))}};
|
|
693
|
+
olympe.dc.$j.ma=[olympe.dc.Ae];m=olympe.dc.$j.prototype;m.Aw.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.Hk.K=new olympe.D.J(()=>olympe.dc.Da,[]);m.Xm.K=new olympe.D.J(()=>olympe.dc.Da,[]);m.dd.K=new olympe.D.J(()=>olympe.dc.Da,[]);m.Sw.K=new olympe.D.J(()=>olympe.dc.Da,[]);m.ed.K=new olympe.D.J(()=>olympe.dc.Da,[]);m.Tw.K=new olympe.D.J(()=>olympe.dc.Da,[]);olympe.dc.CA=class{};olympe.dc.ea={};olympe.dc.ea.pp=class{constructor(a){this.N=a}};olympe.dc.ea.pp.cd={Qi:0,UA:1,VA:3,EA:4};olympe.dc.ea.Tj=class{};function Y(a){if(a.W)throw Error('Cannot modify definition after definition is written');}
|
|
694
|
+
olympe.dc.ea.Xb=class{constructor(a,b){a=this.C=a;if(a.C)throw b=a.C.na(),a=a.C.T(),Error('Cannot work on a new definition without calling done on the previous one or popping it. '+`Make sure done() method has been called on previous definition ${b} (${a})`);if(void 0===this)throw Error('Current def cannot be set to undefined.');a.C=this;this.tag=b;this.F=new Map;this.$=olympe.dc.CloudObject.O.T();this.ta=new Map;this.ja=new Map;this.W=this.da=!1;this.R=null}rn(a){Y(this);this.$=a;return this}Nb(){return this.$}hi(a){Y(this);
|
|
695
|
+
this.R=a;return this}By(){this.da=!0;return this}Ay(a){Y(this);const b=new Map;if('string'===typeof a){const c=olympe.dc.CloudObject.nameProp.T();b.set(c,a||'')}else Object.keys(a).forEach(c=>{b.set(c,a[c])});this.F=b;return this}ii(a){Y(this);Object.keys(a).forEach(b=>{this.F.set(b,a[b])});return this}setProperty(a,b){Y(this);this.F.set(a,b);return this}Xk(a){Y(this);const b=olympe.dc.CloudObject.nameProp.T();this.F.set(b,a);return this}Bm(a,b){Y(this);if(!a)throw Error('Cannot relate an object to another without a relation tag');
|
|
696
|
+
if(a===olympe.dc.CloudObject.containsRel.T())throw Error('Container must be defined using dedicated helpers setContainedIn');b&&this.ta.set(a+'.'+b,[a,b]);return this}Am(a,b){Y(this);if(!a)throw Error('Cannot relate an object to another without a relation tag');if(a===olympe.dc.CloudObject.containsRel.T())throw Error('Container must be defined using dedicated helper setContainedIn');b&&this.ja.set(a+'.'+b,[a,b]);return this}done(){if(this.W)return this;const a=oh(this.C,this.da);a.F(this.tag,this.F,
|
|
697
|
+
-1);ph(this.C,this);a.Va(olympe.dc.jc.Tc,this.tag,this.$,-1);this.R&&a.Va(olympe.dc.jc.Xn,this.R,this.tag,-1);this.G(-1);this.ta.forEach(b=>{a.Va(b[0],this.tag,b[1],-1)});this.ja.forEach(b=>{a.Va(b[0],b[1],this.tag,-1)});this.W=!0;this.C.C=void 0;return this}G(){}T(){return this.tag}na(){return this.F.get('ff023000000000000011')}};olympe.dc.ea.Xb.prototype.getName=olympe.dc.ea.Xb.prototype.na;olympe.dc.ea.Xb.prototype.getTag=olympe.dc.ea.Xb.prototype.T;olympe.dc.ea.Xb.prototype.done=olympe.dc.ea.Xb.prototype.done;
|
|
698
|
+
olympe.dc.ea.Xb.prototype.addRelationFrom=olympe.dc.ea.Xb.prototype.Am;olympe.dc.ea.Xb.prototype.addRelationTo=olympe.dc.ea.Xb.prototype.Bm;olympe.dc.ea.Xb.prototype.setName=olympe.dc.ea.Xb.prototype.Xk;olympe.dc.ea.Xb.prototype.setProperty=olympe.dc.ea.Xb.prototype.setProperty;olympe.dc.ea.Xb.prototype.setProperties=olympe.dc.ea.Xb.prototype.ii;olympe.dc.ea.Xb.prototype.setNameOrProperties=olympe.dc.ea.Xb.prototype.Ay;olympe.dc.ea.Xb.prototype.setOptional=olympe.dc.ea.Xb.prototype.By;
|
|
699
|
+
olympe.dc.ea.Xb.prototype.setContainedIn=olympe.dc.ea.Xb.prototype.hi;olympe.dc.ea.Xb.prototype.setModelTag=olympe.dc.ea.Xb.prototype.rn;olympe.dc.ea.$c=class extends olympe.dc.ea.Xb{constructor(a,b){super(a,b);this.Ka=this.C.OBJECT;this.Wa=new Map;this.Sa=new Map}Zr(a){Y(this);this.Ka=a;return this}extends(a){return this.Zr(a)}Ui(){Y(this);this.setProperty(olympe.dc.CloudObject.W.T(),!0);return this}defineProperty(a,b,c,d,e){Y(this);this.Wa.set(a,new olympe.dc.ea.$c.Property(a,b,c,d));void 0!==d&&super.setProperty(olympe.dc.Tg.ic+a,d);void 0!==e&&(this.C.push(),this.C.Gg(this.C.Ik(a),olympe.sc.mc.O.T()).setProperty(olympe.sc.mc.C.T(),
|
|
700
|
+
e).hi(this.tag).Bm(olympe.sc.mc.F.T(),a).done(),this.C.pop());return this}gh(a,b,c,d,e,{Xi:f=0,sj:g=0,Yk:h=d,Wi:k=olympe.dm.Jc.NONE,pj:l=olympe.dm.Relation.L|k}={}){Y(this);b=new olympe.dc.ea.$c.Relation(a,this.T(),b,c||'',d,e,g,h,f,l,k);this.Sa.set(a,b);return this}G(a){super.G(a);oh(this.C).Va(olympe.dc.CloudObject.extendRel.T(),this.tag,this.Ka,a);this.Wa.forEach(b=>{const c={[olympe.dc.CloudObject.nameProp.T()]:b.name||''},d=olympe.dc.za(olympe.dm.Property),e=olympe.dc.CloudObject.propertyRel.T(),
|
|
701
|
+
f=b.tag;this.C.push();this.C.Gg(f,d).ii(c).done();this.C.pop();b=b.type;oh(this.C).Va(e,this.T(),f,a);oh(this.C).Va(olympe.dm.Property.typeRel.T(),f,b,a)});this.Sa.forEach(b=>{this.C.gh(b.C,b.G,b.F,b.name,b.Br,b.zr,{sj:b.sj,Yk:b.Yk,Xi:b.Xi,pj:b.pj,Wi:b.Wi},a)})}};olympe.dc.ea.$c.prototype.defineRelation=olympe.dc.ea.$c.prototype.gh;olympe.dc.ea.$c.prototype.defineProperty=olympe.dc.ea.$c.prototype.defineProperty;olympe.dc.ea.$c.prototype['abstract']=olympe.dc.ea.$c.prototype.Ui;
|
|
702
|
+
olympe.dc.ea.$c.prototype['extends']=olympe.dc.ea.$c.prototype.extends;olympe.dc.ea.$c.prototype.setParentTag=olympe.dc.ea.$c.prototype.Zr;olympe.dc.ea.$c.Property=class{constructor(a,b,c,d){this.tag=a;this.type=b;this.name=c||'';this.defaultValue=d}};olympe.dc.ea.$c.Relation=class{constructor(a,b,c,d,e,f,g,h,k,l,n){this.C=a;this.G=b;this.F=c;this.name=d;this.Br=e;this.zr=f;this.sj=g;this.Yk=h;this.Xi=k;this.pj=l;this.Wi=n}};function oh(a,b){return b?a.W:a.F}function ph(a,b){0<a.L.length&&(b.R||a.F.Va(olympe.dc.CloudObject.containsRel.T(),a.L[a.L.length-1].T(),b.T(),-1))}
|
|
703
|
+
olympe.dc.ea.Ua=class{constructor(a){if(a&&void 0===a.log)throw Error('Argument of OSaveFileBuilder is not a logger - might be a source, adapt implementing classes');this.F=new olympe.dc.transaction.td(!0);this.W=new olympe.dc.transaction.td(!0);this.N=a||null;this.ta=!1;this.G=null;this.ja=new Map;this.$=null;this.da=Object.create(null);this.C=void 0;this.L=[];this.R=!0;this.Wr=/eval \(eval at process .*<anonymous>:(\d+):(\d+)\)/m;this.DEFAULT=olympe.dc.Tg.ic;this.OBJECT=olympe.dc.CloudObject.O.T();
|
|
704
|
+
this.PROPERTY=olympe.dm.Property.O.T();this.RELATION=olympe.dm.Relation.O.T();this.STRING=olympe.dm.String.O.T();this.BOOLEAN=olympe.dm.Boolean.O.T();this.NUMBER=olympe.dm.Number.O.T();this.DATETIME=olympe.dm.DateTime.O.T();this.COLOR=olympe.dm.Color.O.T();this.FILE=olympe.dm.File.O.T();this.ROLE=olympe.dm.ad.O.T();this.USER=olympe.dm.User.O.T();this.ONE_ONE=olympe.dm.Relation.F.ju;this.ONE_MANY=olympe.dm.Relation.F.Rl;this.MANY_ONE=olympe.dm.Relation.F.bu;this.MANY_MANY=olympe.dm.Relation.F.Nl;this.NONE=
|
|
705
|
+
olympe.dm.Jc.NONE;this.DESTINATION_READ=olympe.dm.Jc.Js;this.DESTINATION_CREATE=olympe.dm.Jc.ro;this.DESTINATION_WRITE=olympe.dm.Jc.Ks;this.DESTINATION_DELETE=olympe.dm.Jc.Gs;this.DESTINATION_LINK=olympe.dm.Jc.Is;this.DESTINATION_FULL=olympe.dm.Jc.Hs;this.ORIGIN_READ=olympe.dm.Jc.ou;this.ORIGIN_CREATE=olympe.dm.Jc.lu;this.ORIGIN_WRITE=olympe.dm.Jc.pu;this.ORIGIN_DELETE=olympe.dm.Jc.mu;this.ORIGIN_LINK=olympe.dm.Jc.Xp;this.ORIGIN_FULL=olympe.dm.Jc.nu;this.FULL=olympe.dm.Jc.$s;this.DUMP_IGNORE=olympe.dm.Relation.C.Cl;
|
|
706
|
+
this.DUMP_REF=olympe.dm.Relation.C.qq;this.DUMP_REVERSE_REF=olympe.dm.Relation.C.Ju;this.DUMP_UNILATERAL=olympe.dm.Relation.C.vk;this.DUMP_REVERSE_UNILATERAL=olympe.dm.Relation.C.jk;this.DUMP_EVERYTHING=olympe.dm.Relation.C.yo;this.DUMP_DEFAULT=olympe.dm.Relation.C.ic;this.DUMP_REV_DEFAULT=olympe.dm.Relation.C.Iu;this.DELETE_REF=this.DUMP_BOTH_REF=olympe.dm.Relation.C.fl;this.DELETE_REF_AND_DESTINATION=olympe.dm.Relation.C.Fu;this.DELETE_REF_AND_ORIGIN=olympe.dm.Relation.C.Gu;this.DELETE_EVERYTHING=
|
|
707
|
+
olympe.dm.Relation.C.yo;this.OLYMPE_AUTHENTICATED_USERS=olympe.dm.ad.F}push(){this.L.push(this.C);this.C=void 0}pop(){if(this.C)throw Error('Cannot unstack definition: current definition not closed');this.C=this.L.pop()}cw(){const a=new Map,b=olympe.dc.ea.Vu.C(this.$,this.F,this.W);for(const [c,d]of b.entries())a.set(c,d.rh());return a}ax(){return this.$}zy(a){this.R=a}log(...a){this.R&&this.N&&this.N.log(...a)}dn(...a){this.R&&this.N&&this.N.debug(...a)}Dx(...a){this.R&&this.N&&this.N.warn(...a)}Pk(...a){this.R&&
|
|
708
|
+
this.N&&this.N.error(...a)}Cv(a){if(a&&20===a.length&&!this.ta){if(this.da[a])throw Error('Tag '+a+' is used to define more than one keyword');return this.da[a]=a}this.G=null===this.G?olympe.X.ih():olympe.X.Zw(this.G);this.log('Generating new tag to replace '+a+'. New tag is: '+this.G);return this.G}Ik(a){const b=this.ja.get(a)||1,c=olympe.X.Ik(a,b);this.ja.set(a,b+1);return c}Gy(a){this.ta=a}Uv(){}Ey(a){this.$=a}Gg(a,b){return(new olympe.dc.ea.Xb(this,a)).rn(b)}Tx(a,b){return(new olympe.dc.ea.$c(this,
|
|
709
|
+
a)).Xk(b)}Sx(a,b){return(new olympe.dc.ea.$c(this,a)).Xk(b).Ui()}Ux(a){return new olympe.dc.ea.xf(this,a)}Sk(a,b,c){this.F.Va(a,b,c,-1)}defineProperty(a,b,c,d,e){this.dn('Defining property ',d,' on model ',a);d={[olympe.dc.CloudObject.nameProp.T()]:d||''};void 0!==e&&this.qc(a,{[olympe.dc.Tg.ic+c]:e});this.C?(this.push(),this.Gg(c,olympe.dm.Property.O.T()).ii(d).done(),this.pop()):this.Gg(c,olympe.dm.Property.O.T()).ii(d).hi(a).done();this.Sk(olympe.dc.CloudObject.propertyRel.T(),a,c);this.Sk(olympe.dm.Property.typeRel.T(),
|
|
710
|
+
c,b)}gh(a,b,c,d,e,f,{Xi:g=olympe.dm.Relation.F.Rl,sj:h=olympe.dm.Relation.C.Cl,Yk:k=e,Wi:l=olympe.dm.Jc.NONE,pj:n=olympe.dm.Relation.L|l}={},p=-1){if(void 0===e||null===e)throw Error('Cannot define a relation without defining the dump follow rules (must be set to db.DUMP_<something> and cannot be undefined or null)');if(void 0===f||null===f)throw Error('Cannot define a relation without defining the delete follow rules (must be set to db.DELETE_<something> and cannot be undefined or null)');const q=
|
|
711
|
+
olympe.dm.Relation;d={[olympe.dc.CloudObject.nameProp.T()]:d||'',[q.Dm.T()]:g,[q.kn.T()]:n,[q.Lm.T()]:e,[q.Km.T()]:f,[q.pn.T()]:h,[q.tn.T()]:k,[q.qr.T()]:l};this.C?(this.push(),this.Gg(a,q.O.T()).ii(d).done(),this.pop()):this.Gg(a,q.O.T()).ii(d).hi(b).done();this.F.Va(q.originModelRel.T(),b,a,p);this.F.Va(q.destinationModelRel.T(),a,c,p)}Bx(a,b){this.F.Va(olympe.dm.ad.C.T(),a,b,-1)}qc(a,b,c=!1){this.dn('Updating instance ',a);delete b[olympe.dc.Yb.Gd];delete b[olympe.dc.Yb.VERSION];const d=new Map;
|
|
712
|
+
Object.keys(b).forEach(e=>{d.set(e,b[e])});this.F.qc(a,d,c,-1)}assign(a,b,c){this.Sk(b,a,c)}Bv(a,b,c){this.W.Va(b,a,c,-1)}Pv(a){return new olympe.dc.Cc(a)}Kv(a,b,c,d){const e={c:7};e.r=a;e.g=b;e.b=c;e.a=d;return e}Lv({year:a=1970,month:b=1,day:c=1,hour:d=1,minute:e=0,second:f=0,jD:g=0,vD:h=0}={}){const k={c:4};k.y=a;k.M=b;k.d=c;k.h=d;k.m=e;k.s=f;k.S=g;k.z=h;return k}fw(a){a=new Date(Date.parse(a));const b={c:4};b.y=a.getFullYear();b.M=a.getMonth()+1;b.d=a.getDate();b.h=a.getHours();b.m=a.getMinutes();
|
|
713
|
+
b.s=a.getSeconds();b.S=a.getMilliseconds();b.z=-a.getTimezoneOffset();return b}Mv(a){a='number'===typeof a?new Date(a):a;const b={c:4};b.h=a.getHours();b.m=a.getMinutes();b.s=a.getSeconds();b.S=a.getMilliseconds();b.z=a.getTimezoneOffset();b.y=a.getFullYear();b.M=a.getMonth()+1;b.d=a.getDate();return b}bj(a,b,c){return olympe.auth.Jb.Fe.bj(a,c)}Er(a,b){return olympe.auth.Jb.Fe.bj(a,b)}cc(){throw Error('DeleteRelation method on OSaveFile is deprecated');}Dc(){throw Error('DeleteInstance method on OSaveFile is deprecated');
|
|
714
|
+
}};olympe.dc.ea.Ua.prototype.deleteInstance=olympe.dc.ea.Ua.prototype.Dc;olympe.dc.ea.Ua.prototype.deleteRelation=olympe.dc.ea.Ua.prototype.cc;olympe.dc.ea.Ua.prototype.generateAuthenticationData=olympe.dc.ea.Ua.prototype.Er;olympe.dc.ea.Ua.prototype.generateAuthData=olympe.dc.ea.Ua.prototype.bj;olympe.dc.ea.Ua.prototype.createDateTimeLegacy=olympe.dc.ea.Ua.prototype.Mv;olympe.dc.ea.Ua.prototype.fromISODate=olympe.dc.ea.Ua.prototype.fw;olympe.dc.ea.Ua.prototype.createDateTime=olympe.dc.ea.Ua.prototype.Lv;
|
|
715
|
+
olympe.dc.ea.Ua.prototype.createColor=olympe.dc.ea.Ua.prototype.Kv;olympe.dc.ea.Ua.prototype.createReference=olympe.dc.ea.Ua.prototype.Pv;olympe.dc.ea.Ua.prototype.assignOptional=olympe.dc.ea.Ua.prototype.Bv;olympe.dc.ea.Ua.prototype.assign=olympe.dc.ea.Ua.prototype.assign;olympe.dc.ea.Ua.prototype.updateInstance=olympe.dc.ea.Ua.prototype.qc;olympe.dc.ea.Ua.prototype.linkRoleToUser=olympe.dc.ea.Ua.prototype.Bx;olympe.dc.ea.Ua.prototype.defineRelation=olympe.dc.ea.Ua.prototype.gh;
|
|
716
|
+
olympe.dc.ea.Ua.prototype.defineProperty=olympe.dc.ea.Ua.prototype.defineProperty;olympe.dc.ea.Ua.prototype.newRelation=olympe.dc.ea.Ua.prototype.Sk;olympe.dc.ea.Ua.prototype.newUser=olympe.dc.ea.Ua.prototype.Ux;olympe.dc.ea.Ua.prototype.newAbstractModel=olympe.dc.ea.Ua.prototype.Sx;olympe.dc.ea.Ua.prototype.newModel=olympe.dc.ea.Ua.prototype.Tx;olympe.dc.ea.Ua.prototype.newInstance=olympe.dc.ea.Ua.prototype.Gg;olympe.dc.ea.Ua.prototype.setRootInstanceTag=olympe.dc.ea.Ua.prototype.Ey;
|
|
717
|
+
olympe.dc.ea.Ua.prototype.disableChecks=olympe.dc.ea.Ua.prototype.Uv;olympe.dc.ea.Ua.prototype.setUseNewTags=olympe.dc.ea.Ua.prototype.Gy;olympe.dc.ea.Ua.prototype.assignTag=olympe.dc.ea.Ua.prototype.Cv;olympe.dc.ea.Ua.prototype.logError=olympe.dc.ea.Ua.prototype.Pk;olympe.dc.ea.Ua.prototype.logWarn=olympe.dc.ea.Ua.prototype.Dx;olympe.dc.ea.Ua.prototype.logDebug=olympe.dc.ea.Ua.prototype.dn;olympe.dc.ea.Ua.prototype.log=olympe.dc.ea.Ua.prototype.log;olympe.dc.ea.Ua.prototype.setLoggingEnabled=olympe.dc.ea.Ua.prototype.zy;
|
|
718
|
+
olympe.dc.ea.Ua.prototype.getRootInstanceTag=olympe.dc.ea.Ua.prototype.ax;olympe.dc.ea.Ua.prototype.flushContents=olympe.dc.ea.Ua.prototype.cw;olympe.dc.ea.qg=class extends olympe.dc.ea.$c{constructor(a,b,c){super(a,b);this.L=this.description=null;this.setProperty(olympe.dm.BrickMetadata.Sa.T(),olympe.dm.BrickMetadata.Ab.uu);null!==c&&this.nr(c)}nr(a){this.hi(a);this.Am(olympe.dm.Pb.C.T(),a);return this}yy(a){this.F.set(olympe.dm.we.Wa.T(),a);return this}wy(a){Y(this);this.description=a;return this}Fy(a){Y(this);this.L=a;return this}G(a){super.G(a);if(null!==this.description||null!==this.L)this.C.push(),a=this.C.Gg(this.C.Ik(this.tag),olympe.sc.mc.O.T()),
|
|
719
|
+
this.description&&a.setProperty(olympe.sc.mc.C.T(),this.description),this.L&&a.setProperty(olympe.sc.mc.L.T(),this.L),a.hi(this.tag).Bm(olympe.sc.mc.F.T(),this.tag).done(),this.C.pop()}};olympe.dc.ea.qg.prototype.setSummary=olympe.dc.ea.qg.prototype.Fy;olympe.dc.ea.qg.prototype.setDescription=olympe.dc.ea.qg.prototype.wy;olympe.dc.ea.qg.prototype.setIcon=olympe.dc.ea.qg.prototype.yy;olympe.dc.ea.qg.prototype.addToFolder=olympe.dc.ea.qg.prototype.nr;olympe.dc.ea.Vu=class a{constructor(b,c,d){this.F=b;this.va=c||[];this.C=d||[]}static C(b,c,d){if(c instanceof olympe.dc.transaction.td&&d instanceof olympe.dc.transaction.td){c=ie(c);var e=ie(d)}else e=new olympe.dc.transaction.td(!0),c.Mc(e),c=ie(e),d.Mc(e),e=ie(e);d=new Map;var f=new a(b,c.wg,e.wg);f.Sf()||d.set('delRel',f);f=new a(b,c.Re,e.Re);f.Sf()||d.set('detInst',f);f=new a(b,c.Hg,e.Hg);f.Sf()||d.set('newInst',f);f=new a(b,c.$f,e.$f);f.Sf()||d.set('updateInst',f);b=new a(b,c.Ig,e.Ig);b.Sf()||
|
|
720
|
+
d.set('newRel',b);return d}Sf(){return 0===this.va.length+this.C.length}static fn(b){const c=Object.create(null),d=[],e=[];b.forEach(f=>{0===Object.keys(c).length&&(c.rootTag=f.rootTag);d.push(...(f.operations||[]));e.push(...(f.optionalOperations||[]))});0!==d.length&&(c.operations=d);0!==e.length&&(c.optionalOperations=e);return c}rh(){const b=(d,e)=>{var f=d.o,g=e.o;return f!==g?f<g?-1:1:1===f||2===f||3===f?(f=d.t,g=e.t,f===g?(d=Object.keys(d.p)[0],e=Object.keys(e.p)[0],void 0!==d?d.localeCompare(e):
|
|
721
|
+
1):f.localeCompare(g)):4===f||5===f?(f=d.l,g=e.l,f===g?(f=d.m,g=e.m,f===g?d.r.localeCompare(e.r):f.localeCompare(g)):f.localeCompare(g)):JSON.stringify(f).localeCompare(JSON.stringify(g))},c=Object.create(null);this.va.sort(b);this.C.sort(b);c.rootTag=this.F;c.operations=this.va;c.optionalOperations=this.C;return c}};olympe.dc.ea.xf=class extends olympe.dc.ea.Xb{constructor(a,b){super(a,b);this.password=this.L=null;this.rn(olympe.dc.za(olympe.dm.User))}Hy(a){Y(this);this.L=a;return this}sn(a){Y(this);this.password=a;return this}xy(){return this}Dv(a){Y(this);this.Am(olympe.dm.User.C.T(),a);return this}G(a){super.G(a);if(null==this.L||''===this.L)throw Error('A username must be set when calling new User');if(null==this.password||''===this.password)throw Error('A password must be set when calling new User');const b=
|
|
722
|
+
this.C.Er(this.L,this.password),c=new Map;c.set(olympe.dm.User.loginProp.T(),b.login);c.set(olympe.dm.User.saltProp.T(),b.salt);c.set(olympe.dm.User.verifierProp.T(),b.verifier);oh(this.C).qc(this.T(),c,!1,a)}};olympe.dc.ea.xf.prototype.awardRole=olympe.dc.ea.xf.prototype.Dv;olympe.dc.ea.xf.prototype.setDomain=olympe.dc.ea.xf.prototype.xy;olympe.dc.ea.xf.prototype.setPassword=olympe.dc.ea.xf.prototype.sn;olympe.dc.ea.xf.prototype.setUsername=olympe.dc.ea.xf.prototype.Hy;olympe.dc.ea.P={rt:'dc.io.IOService',zh:'dc.io.IOUrlsProvider'};olympe.U.config(function(a){ta(a,olympe.dc.ea.P.zh);C(a,olympe.dc.ea.P.rt,[olympe.ra.P.Aa,olympe.net.P.Aa,olympe.auth.P.Aa,olympe.dc.ea.P.zh],b=>new olympe.dc.ea.pp(b.Nc('dc.io')))},'olympe.dc.io');olympe.dc.ea.iD=function(a,b,c=!1){if(a.startsWith('@')||a.startsWith('v'))return!1;a.startsWith(olympe.dc.Tg.ic)&&(a=a.substring(1));const d=olympe.dc.Ja();return b?c?Md(d,a,b):Md(d,a,d.model(b)):d.Db(a)};olympe.dm={};olympe.dm.Jc={NONE:0,Js:1,ro:2,Ks:4,Gs:8,Is:16,Hs:31,ou:32,lu:64,pu:128,mu:256,Xp:512,nu:992,$s:1023};olympe.dm.ad=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}na(){return this.Eb(olympe.dc.CloudObject.nameProp)}C(){return olympe.D.Za.EMPTY}F(){return olympe.D.sa.C}};olympe.dm.ad.O=olympe.dc.ya.C('ff021000000000000002',olympe.dm.ad);olympe.dm.ad.da=olympe.dm.ad.O.xa('ff023000000000000035');olympe.dm.ad.C=olympe.dm.ad.O.Ga('ff022000000000000005');olympe.dm.ad.F=Nc('ff011000000000000001','AUTHENTICATED_USERS');olympe.dm.ad.$=Nc('ff011000000000000002','PROJECT_RUNNER_USERS_ROLE');
|
|
723
|
+
olympe.dm.ad.L=Nc('014831d95f83635090ea','ADMIN_USERS_ROLE');olympe.dm.ad.prototype.na.K=olympe.D.J.F;olympe.dm.ad.prototype.C.K=olympe.D.J.F;olympe.dm.ad.prototype.F.K=olympe.D.J.R;olympe.dm.User=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}Dw(){return this.Vm()}na(){return this.Vm()}Vm(){return this.Eb(olympe.dm.User.loginProp)}Ft(){return this.Eb(olympe.dm.User.F)}Et(){return olympe.D.Za.EMPTY}ex(){return this.Eb(olympe.dm.User.saltProp)}px(){return this.Eb(olympe.dm.User.verifierProp)}$w(){return this.ub(olympe.dm.User.C,olympe.dm.ad)}};olympe.dm.User.O=olympe.dc.ya.C('ff021000000000000003',olympe.dm.User);olympe.dm.User.loginProp=olympe.dm.User.O.xa('ff023000000000000001');
|
|
724
724
|
z('olympe.dm.User.loginProp',olympe.dm.User.loginProp);olympe.dm.User.F=olympe.dm.User.O.xa('ff023000000000000002');olympe.dm.User.da=olympe.dm.User.O.xa('ff023000000000000003');olympe.dm.User.saltProp=olympe.dm.User.O.xa('ff023000000000000004');z('olympe.dm.User.saltProp',olympe.dm.User.saltProp);olympe.dm.User.verifierProp=olympe.dm.User.O.xa('ff023000000000000005');z('olympe.dm.User.verifierProp',olympe.dm.User.verifierProp);olympe.dm.User.$=olympe.dm.User.O.xa('ff023000000000000020');
|
|
725
|
-
olympe.dm.User.SAMLnameIdProp=olympe.dm.User.O.xa('ff023000000000000036');z('olympe.dm.User.SAMLnameIdProp',olympe.dm.User.SAMLnameIdProp);olympe.dm.User.C=P(olympe.dm.User.O,olympe.dm.ad.C);olympe.dm.User.ja=olympe.dm.User.O.Ga('ff022000000000000002');olympe.dm.User.L=
|
|
726
|
-
m.
|
|
727
|
-
olympe.dm.BrickMetadata.Ab={
|
|
728
|
-
P(olympe.dc.CloudObject.O,olympe.dm.Pb.C);olympe.dm.Pb.prototype.R.K=new olympe.D.J(()=>olympe.dc.Da,[]);olympe.dm.Pb.prototype.F.K=new olympe.D.J(()=>olympe.dc.Da,[]);olympe.dm.Pb.prototype.W.K=new olympe.D.J(()=>olympe.dc.Da,[]);olympe.dm.Vc=class extends olympe.dm.Pb{F(){return this.T()===olympe.dm.Vc.ta?this.ub(olympe.dm.Vc.$,olympe.dm.Pb):this.ub(olympe.dm.Vc.da,olympe.dm.Pb)}};olympe.dm.Vc.O=olympe.dc.ya.C('ff021000000000000020',olympe.dm.Vc);olympe.dm.Vc.da=olympe.dm.Vc.O.Ga('017e9c34cf48bd6965c1');olympe.dm.Vc.$=olympe.dm.Vc.O.Ga('017e9c2e013e06bfffd9');olympe.dm.Vc.fe=olympe.dm.Vc.O.Ga('01811f12ad77673770d4');olympe.dm.Vc.ta=
|
|
729
|
-
olympe.dm.Vc.prototype.F.K=new olympe.D.J(()=>olympe.dc.Da,[]);olympe.dm.Module=class extends olympe.dc.CloudObject{
|
|
725
|
+
olympe.dm.User.SAMLnameIdProp=olympe.dm.User.O.xa('ff023000000000000036');z('olympe.dm.User.SAMLnameIdProp',olympe.dm.User.SAMLnameIdProp);olympe.dm.User.C=P(olympe.dm.User.O,olympe.dm.ad.C);olympe.dm.User.ja=olympe.dm.User.O.Ga('ff022000000000000002');olympe.dm.User.L=Nc('0163d9653067b6237f62','GUEST_USER');m=olympe.dm.User.prototype;m.Dw.K=olympe.D.J.F;m.na.K=olympe.D.J.F;m.Vm.K=olympe.D.J.F;m.Ft.K=olympe.D.J.F;m.Et.K=olympe.D.J.F;m.ex.K=olympe.D.J.F;m.px.K=olympe.D.J.F;
|
|
726
|
+
m.$w.K=new olympe.D.J(()=>olympe.dc.Da,[]);olympe.dm.we=class extends olympe.dc.CloudObject{da(){return this.Tm()}jb(){return this.Eb(olympe.dm.we.Wa)}};olympe.dm.we.O=olympe.dc.ya.C('01621fb84e3300000000',olympe.dm.we);olympe.dm.we.Wa=olympe.dm.we.O.xa('01609de3f292e3c2c6ff');olympe.dm.we.prototype.da.K=new olympe.D.J(()=>olympe.D.md,[]);olympe.dm.we.prototype.jb.K=olympe.D.J.F;olympe.dm.BrickMetadata=class extends olympe.dm.we{Hb(){return this.Eb(olympe.dm.BrickMetadata.Sa)}Od(){return this.Eb(olympe.dm.BrickMetadata.jb)}C(){return null}};olympe.dm.BrickMetadata.O=Rc(olympe.dc.ya.C('01621fb84e3500000000',olympe.dm.BrickMetadata));olympe.dm.BrickMetadata.Sa=olympe.dm.BrickMetadata.O.xa('01621fb84e320000f001');olympe.dm.BrickMetadata.jb=olympe.dm.BrickMetadata.O.xa('01703376c4a81c0e9d94');olympe.dm.BrickMetadata.be=olympe.dm.BrickMetadata.O.Ga('0161ae97622bb21f335b');
|
|
727
|
+
olympe.dm.BrickMetadata.Ab={NA:'private',uu:'public'};olympe.dm.BrickMetadata.Hc=Nc('01703376c4a81c0e9d95','BRICK_STATUS');olympe.dm.BrickMetadata.cd={Cz:'experimental',YA:'stable',uz:'deprecated'};olympe.dm.BrickMetadata.prototype.Hb.K=olympe.D.J.F;olympe.dm.BrickMetadata.prototype.Od.K=olympe.D.J.F;olympe.dm.BrickMetadata.prototype.C.K=new olympe.D.J(()=>String,[]);olympe.dm.Pb=class extends olympe.dm.BrickMetadata{R(){return new olympe.dc.Da(this.T(),[new olympe.dc.Y.Bc(olympe.dm.Pb.F.T(),olympe.dc.Ca.DESTINATION,olympe.dc.Y.kk.kp,olympe.dc.Y.kk.kt),olympe.dm.Pb.C])}C(){return null}F(){return this.ub(olympe.dm.Pb.F,olympe.dm.Pb)}W(){return this.ub(olympe.dm.Pb.C)}};olympe.dm.Pb.O=olympe.dc.ya.C('01612df1db9749227626',olympe.dm.Pb);olympe.dm.Pb.F=olympe.dm.Pb.O.Ga('016a697ef00ce7554691');olympe.dm.Pb.Ka=P(olympe.dm.Pb.O,olympe.dm.Pb.F);olympe.dm.Pb.C=olympe.dm.Pb.O.Ga('016a697ef00ce7554692');
|
|
728
|
+
P(olympe.dc.CloudObject.O,olympe.dm.Pb.C);olympe.dm.Pb.prototype.R.K=new olympe.D.J(()=>olympe.dc.Da,[]);olympe.dm.Pb.prototype.F.K=new olympe.D.J(()=>olympe.dc.Da,[]);olympe.dm.Pb.prototype.W.K=new olympe.D.J(()=>olympe.dc.Da,[]);olympe.dm.Vc=class extends olympe.dm.Pb{F(){return this.T()===olympe.dm.Vc.ta?this.ub(olympe.dm.Vc.$,olympe.dm.Pb):this.ub(olympe.dm.Vc.da,olympe.dm.Pb)}};olympe.dm.Vc.O=olympe.dc.ya.C('ff021000000000000020',olympe.dm.Vc);olympe.dm.Vc.da=olympe.dm.Vc.O.Ga('017e9c34cf48bd6965c1');olympe.dm.Vc.$=olympe.dm.Vc.O.Ga('017e9c2e013e06bfffd9');olympe.dm.Vc.fe=olympe.dm.Vc.O.Ga('01811f12ad77673770d4');olympe.dm.Vc.ta=Nc('10000000000000000000','ROOT_OF_ROOTS');olympe.dm.Vc.zc=Nc('10000000000000000001','OLYMPE_FOLDER');
|
|
729
|
+
olympe.dm.Vc.prototype.F.K=new olympe.D.J(()=>olympe.dc.Da,[]);olympe.dm.Module=class extends olympe.dc.CloudObject{Bw(){return this.Eb(olympe.dm.Module.da)}Ow(){return this.Ie(olympe.dm.Module.ja)}Gt(){return this.Eb(olympe.dm.Module.F)}Uw(){return this.Eb(olympe.dm.Module.ta)}nw(){return this.Eb(olympe.dm.Module.L)}Pw(){return this.ub(olympe.dm.Module.$,olympe.dm.Module)}gx(){return this.ub(olympe.dm.Module.C,olympe.dm.Dd)}};olympe.dm.Module.O=olympe.dc.ya.C('ff021000000000000040',olympe.dm.Module);olympe.dm.Module.da=olympe.dm.Module.O.xa('ff023000000000000042');
|
|
730
730
|
olympe.dm.Module.ja=olympe.dm.Module.O.xa('ff023000000000000043');olympe.dm.Module.F=olympe.dm.Module.O.xa('ff023000000000000044');olympe.dm.Module.ta=olympe.dm.Module.O.xa('ff023000000000000045');olympe.dm.Module.L=olympe.dm.Module.O.xa('ff023000000000000046');olympe.dm.Module.creationDateProp=olympe.dm.Module.O.xa('ff023000000000000049');olympe.dm.Module.C=olympe.dm.Module.O.Ga('ff022000000000000013');olympe.dm.Module.$=olympe.dm.Module.O.Ga('ff022000000000000014');
|
|
731
|
-
olympe.dm.Module.Ka=
|
|
732
|
-
e=this.db.cb(this,olympe.dm.File.urlProp),f=g=>{const h=this.db.cb(this,olympe.dm.File.mimeTypeProp);this.C.G(g,k=>{c(`data:${h};base64,${this.C.C(k)}`)})};d&&d.valueOf()?
|
|
733
|
-
b,c,d,e,f){d=d||'application/data';c=olympe.X.
|
|
734
|
-
olympe.dm.File.createFromContent=olympe.dm.File.
|
|
731
|
+
olympe.dm.Module.Ka=Nc('016a69b9bceabd815b77','OLYMPE_SERVER_MODULE');m=olympe.dm.Module.prototype;m.Bw.K=olympe.D.J.F;m.Ow.K=olympe.D.J.G;m.Gt.K=olympe.D.J.F;m.Uw.K=olympe.D.J.F;m.nw.K=olympe.D.J.F;m.Pw.K=new olympe.D.J(()=>olympe.dc.Da,[]);m.gx.K=new olympe.D.J(()=>olympe.dc.Da,[]);olympe.dm.File=class extends olympe.dc.CloudObject{constructor(a,b,c,d,e){super(a,b);this.F=c;this.G=d;this.C=e}Wm(){return this.Eb(olympe.dm.File.mimeTypeProp)}Fk(a,b){const c=olympe.D.La().F(a),d=b&&olympe.D.La().F(b);(a=this.db.cb(this,olympe.dm.File.urlProp,!0))&&a.startsWith('blob:')?this.C.F(a,e=>{this.C.G(e,c)},d):Dc(this.F,this,e=>{this.C.G(e,c)},e=>{d&&d(e)})}Sm(a,b){this.Fk(c=>{a(Ea(c))},b)}Gk(a,b){const c=olympe.D.La().F(a);b=b&&olympe.D.La().F(b);const d=this.db.cb(this,olympe.dm.File.C),
|
|
732
|
+
e=this.db.cb(this,olympe.dm.File.urlProp),f=g=>{const h=this.db.cb(this,olympe.dm.File.mimeTypeProp);this.C.G(g,k=>{c(`data:${h};base64,${this.C.C(k)}`)})};d&&d.valueOf()?Dc(this.F,this,f.bind(this),b):e&&e.startsWith('blob:')?this.C.F(e,f.bind(this),b):a(e)}rename(a,b){const c=b&&olympe.D.La().F(b);olympe.D.Vr([a],d=>{const e=new olympe.dc.Transaction;e.update(this,olympe.dc.CloudObject.nameProp,d);e.update(this,olympe.dm.File.nameProp,d);e.kb(f=>{c&&c(f)})})}vy(){this.G.R(this.db.cb(this,olympe.dm.File.mimeTypeProp))}Gl(){return this.Eb(olympe.dm.File.urlProp)}sp(){return this.Eb(olympe.dm.File.nameProp)}qw(){return this.hj(olympe.dm.File.creationDateProp)}Nw(){return this.hj(olympe.dm.File.modificationDateProp)}Qr(){return this.Bg(olympe.dm.File.C)}static Nv(a,
|
|
733
|
+
b,c,d,e,f){d=d||'application/data';c=olympe.X.bi().L(new Blob([c],{type:d}));return olympe.dm.File.xr(a,b,c,d,e,f)}static xr(a,b,c,d,e,f){const g=olympe.D.ib.now();b=(new Map).set(olympe.dm.File.nameProp,b||'file').set(olympe.dm.File.urlProp,c).set(olympe.dm.File.creationDateProp,g).set(olympe.dm.File.modificationDateProp,g).set(olympe.dm.File.mimeTypeProp,d||'application/data').set(olympe.dm.File.C,!1);return a.create(olympe.dm.File,b,e||olympe.dc.Ha.ic,f)}};olympe.dm.File.createFromURL=olympe.dm.File.xr;
|
|
734
|
+
olympe.dm.File.createFromContent=olympe.dm.File.Nv;olympe.dm.File.prototype.saveAs=olympe.dm.File.prototype.vy;olympe.dm.File.prototype.getContentUrl=olympe.dm.File.prototype.Gk;olympe.dm.File.prototype.getContentAsString=olympe.dm.File.prototype.Sm;olympe.dm.File.prototype.getContentAsBinary=olympe.dm.File.prototype.Fk;olympe.dm.File.O=olympe.dc.ya.C('ff021000000000000030',olympe.dm.File,olympe.dc.P.xi,olympe.net.P.Aa,olympe.X.P.th);olympe.dm.File.nameProp=olympe.dm.File.O.xa('ff023000000000000050');
|
|
735
735
|
z('olympe.dm.File.nameProp',olympe.dm.File.nameProp);olympe.dm.File.creationDateProp=olympe.dm.File.O.xa('ff023000000000000051');z('olympe.dm.File.creationDateProp',olympe.dm.File.creationDateProp);olympe.dm.File.modificationDateProp=olympe.dm.File.O.xa('ff023000000000000055');z('olympe.dm.File.modificationDateProp',olympe.dm.File.modificationDateProp);olympe.dm.File.mimeTypeProp=olympe.dm.File.O.xa('ff023000000000000052');z('olympe.dm.File.mimeTypeProp',olympe.dm.File.mimeTypeProp);
|
|
736
|
-
olympe.dm.File.urlProp=olympe.dm.File.O.xa('ff023000000000000053');z('olympe.dm.File.urlProp',olympe.dm.File.urlProp);olympe.dm.File.C=olympe.dm.File.O.xa('ff023000000000000054');olympe.dm.File.ma=[olympe.D.File];m=olympe.dm.File.prototype;m.
|
|
737
|
-
m.
|
|
736
|
+
olympe.dm.File.urlProp=olympe.dm.File.O.xa('ff023000000000000053');z('olympe.dm.File.urlProp',olympe.dm.File.urlProp);olympe.dm.File.C=olympe.dm.File.O.xa('ff023000000000000054');olympe.dm.File.ma=[olympe.D.File];m=olympe.dm.File.prototype;m.Wm.K=olympe.D.J.F;m.Fk.K=new olympe.D.J(()=>{},[]);m.Sm.K=new olympe.D.J(()=>{},[]);m.Gk.K=new olympe.D.J(()=>{},[]);m.rename.K=olympe.D.J.C;m.Gl.K=olympe.D.J.F;m.sp.K=olympe.D.J.F;m.qw.K=new olympe.D.J(()=>olympe.D.ib,[]);
|
|
737
|
+
m.Nw.K=new olympe.D.J(()=>olympe.D.ib,[]);m.Qr.K=olympe.D.J.R;olympe.dm.Dd=class extends olympe.dc.CloudObject{C(){return this.Eb(olympe.dm.Dd.F)}G(){return this.Ie(olympe.dm.Dd.L)}F(){return this.ub(olympe.dm.Dd.C,olympe.dm.Module)}};olympe.dm.Dd.O=olympe.dc.ya.C('ff021000000000000041',olympe.dm.Dd);olympe.dm.Dd.F=olympe.dm.Dd.O.xa('ff023000000000000047');olympe.dm.Dd.L=olympe.dm.Dd.O.xa('ff023000000000000048');olympe.dm.Dd.C=olympe.dm.Module.C.Ec();olympe.dm.Dd.prototype.C.K=olympe.D.J.F;olympe.dm.Dd.prototype.G.K=olympe.D.J.G;
|
|
738
738
|
olympe.dm.Dd.prototype.F.K=new olympe.D.J(()=>olympe.dc.Da,[]);olympe.dm.Mb=class extends olympe.dm.Vc{F(){return this.ub(olympe.dm.Pb.F,olympe.dm.Pb)}L(){return this.Eb(olympe.dm.Mb.ja)}$(){return this.Eb(olympe.dm.Mb.bc)}G(){return this.ub(olympe.dm.Mb.L,olympe.dm.Mb)}};olympe.dm.Mb.O=olympe.dc.ya.C('0163d9594700fcf61e54',olympe.dm.Mb);olympe.dm.Mb.ja=olympe.dm.Mb.O.xa('017869c7d2833c9492c1');olympe.dm.Mb.bc=olympe.dm.Mb.O.xa('017869c80bb9929c76d0');olympe.dm.Mb.L=olympe.dm.Mb.O.Ga('ff02200000000000002b');olympe.dm.Mb.Kd=P(olympe.dm.Mb.O,olympe.dm.Mb.L);
|
|
739
|
-
olympe.dm.Mb.Vb=olympe.dm.Mb.O.Ga('ff02200000000000002a');olympe.dm.Mb.od=olympe.dm.Mb.O.Ga('017e9c412e2b944bd590');olympe.dm.Mb.ph=olympe.dm.Mb.O.Ga('017e9c416872a89d3415');olympe.dm.Mb.We=olympe.dm.Mb.O.Ga('017ebf8fe5c506662098');P(olympe.dc.CloudObject.O,olympe.dm.Mb.Vb);olympe.dm.Mb.Xc=
|
|
740
|
-
olympe.dm.Mb.prototype.G.K=new olympe.D.J(()=>olympe.dc.Da,[]);olympe.dm.Property=class extends olympe.dc.CloudObject{F(){return this.oc(olympe.dm.Property.definingModelRel,olympe.dc.CloudObject)}C(){return this.oc(olympe.dm.Property.typeRel,olympe.dc.CloudObject)}Rc(){return this.F().na().
|
|
741
|
-
olympe.dm.Property.typeRel=P(olympe.dm.Property.O,olympe.dc.CloudObject.typeRel);z('olympe.dm.Property.typeRel',olympe.dm.Property.typeRel);olympe.dm.Property.prototype.F.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.dm.Property.prototype.C.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.dm.Relation=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}
|
|
742
|
-
olympe.dm.Relation.
|
|
743
|
-
olympe.dm.Relation.originModelRel=P(olympe.dm.Relation.O,olympe.dc.CloudObject.G);z('olympe.dm.Relation.originModelRel',olympe.dm.Relation.originModelRel);olympe.dm.Relation.destinationModelRel=P(olympe.dm.Relation.O,olympe.dc.CloudObject.R);z('olympe.dm.Relation.destinationModelRel',olympe.dm.Relation.destinationModelRel);olympe.dc.Qb={NONE:null,
|
|
744
|
-
olympe.dc.Qb.toString=function(a){for(const [b,c]of Object.entries(olympe.dc.Qb))if(c===a)return b;return null};olympe.dm.Relation.C={
|
|
745
|
-
olympe.dm.Enum.O=olympe.dc.ya.C('016cdd861b32d56c81f7',olympe.dm.Enum);olympe.dm.Enum.rankProp=olympe.dm.Enum.O.xa('017a7690c915975ea995');olympe.dm.Enum.prototype.ee.K=olympe.D.J.G;olympe.dm.ig=class extends olympe.dm.BrickMetadata{
|
|
746
|
-
function
|
|
747
|
-
function
|
|
748
|
-
function
|
|
749
|
-
olympe.ab.
|
|
750
|
-
v);h.qc(r,w);this.F.storage.C(q)})})};for(const n of c)(c=a.Lf(n))&&c.re()&&k.add(l.bind(this,c));ac(k,(n,p)=>{n?(n=M(new olympe.dc.ha(f,a,[b.Z()]),q=>{q?e(q.message):(this.C(b.Z(),g,h),q=Array.from(a.de()).map(r=>r.tag()),olympe.dc.xd().persist(q),d())}),b.L(n)):e(`Transaction synchronisation failed! ${p?p:''}`)});k.start()}Z(){return olympe.dc.Ha.sb}L(a){var b=olympe.dc.ha.ia.dh,c=olympe.dc.ha.ia.uh;const d=olympe.dc.ha.ia.
|
|
751
|
-
k=olympe.dc.ha.ia.
|
|
752
|
-
t=a.content;a.validate(null);cc(this.F,t.Z(),v=>{this.N.warn('No graphresult for subscription : '+t.Z(),v,'\n',t.nh.toJSON());this.N.warn();this.C(r,g,new olympe.dc.query.
|
|
753
|
-
function
|
|
754
|
-
function
|
|
755
|
-
function
|
|
756
|
-
function
|
|
757
|
-
olympe.ab.
|
|
758
|
-
b,f);c===
|
|
759
|
-
this.da.buffer(b));this.ta(b)}C(b,c){const d=olympe.X.ec();let e=this.F.get(b);void 0===e&&(e=new Map,this.F.set(b,e));e.set(d,c)}ja(b){this.$.set(olympe.X.yg(),b)}Ka(b,c,d){this.F.has(c)&&this.F.get(c).forEach(e=>{e(b,d)})}Ab(b,c){this.L.set(b,c);c.C=this.Ka.bind(this);c.R=this.
|
|
760
|
-
d=olympe.dc.ha.ia.
|
|
761
|
-
g===a.F.
|
|
762
|
-
l).set('destinations',n),h.push(n),l===a.F.
|
|
763
|
-
olympe.ab.pg.F={ic:'default',
|
|
764
|
-
olympe.U.config(function(a){D(a,olympe.ab.Config.
|
|
765
|
-
h);return new olympe.ab.
|
|
766
|
-
olympe.U.run([olympe.ab.P.ne,olympe.ab.P.
|
|
767
|
-
olympe.H.
|
|
768
|
-
(g=new URL(f.C()),d(g.pathname)):e&&(g=`Failed to create file ${a}. Response code ${g}`,this.N.error(g),e(g))})}R(a,b,c,d,e){const f=olympe.D.La();d={Ye:f.F(d),se:e&&f.F(e)};if(this.C.has(a))this.C.get(a).push(d);else{this.C.set(a,[d]);if(null===b){var g=Pb(
|
|
769
|
-
300>k){const n=h.getData();l&&l.forEach(p=>{if(f.G()){const q=f.Xc(),r=f.Z();this.N.warn(`Context ${q} ${r} is being destroyed while file tag ${a} is being downloaded`)}p.Ye(n)})}else{const n=`Failed to download file ${a}. Response code ${k}`;l&&l.forEach(p=>{p.se&&p.se(n)})}this.C.delete(a)})})}}L(a,b,c){const d=Pb(
|
|
770
|
-
c&&c(e))})}Yc(a){const b=this.$.get(a);b&&this.$.delete(a);return b||olympe.D.$a(sc(this.ja))}};olympe.H.
|
|
771
|
-
function
|
|
772
|
-
function
|
|
773
|
-
a.F.delete(e);d(l?Error(l):null)});c.start()}function
|
|
774
|
-
olympe.H.ah=class extends olympe.ab.ah{constructor(a,b,c,d,e){super(a);this.G=b;this.ja=c;new olympe.H.aa.gb;this.$=new olympe.dc.X.
|
|
775
|
-
this.Ka,olympe.dc.ha.ia.Rg,!1,null,c);break;case
|
|
776
|
-
|
|
777
|
-
b,a)):h===c?(g=a.error.reason,b=this.$.C(a.p),this.C(this.Z(),c,{id:a.i,rollback:b,error:g})):h===
|
|
778
|
-
|
|
779
|
-
function
|
|
780
|
-
olympe.H.wa.pa=class{constructor(a,b,c,d){b=d.get('connectionOptions');this.N=a;this.F=c;a=new olympe.X.
|
|
739
|
+
olympe.dm.Mb.Vb=olympe.dm.Mb.O.Ga('ff02200000000000002a');olympe.dm.Mb.od=olympe.dm.Mb.O.Ga('017e9c412e2b944bd590');olympe.dm.Mb.ph=olympe.dm.Mb.O.Ga('017e9c416872a89d3415');olympe.dm.Mb.We=olympe.dm.Mb.O.Ga('017ebf8fe5c506662098');P(olympe.dc.CloudObject.O,olympe.dm.Mb.Vb);olympe.dm.Mb.Xc=Nc('100000000000000000dd','PRIMORDIAL');olympe.dm.Mb.prototype.F.K=new olympe.D.J(()=>olympe.dc.Da,[]);olympe.dm.Mb.prototype.L.K=olympe.D.J.F;olympe.dm.Mb.prototype.$.K=olympe.D.J.F;
|
|
740
|
+
olympe.dm.Mb.prototype.G.K=new olympe.D.J(()=>olympe.dc.Da,[]);olympe.dm.Property=class extends olympe.dc.CloudObject{F(){return this.oc(olympe.dm.Property.definingModelRel,olympe.dc.CloudObject)}C(){return this.oc(olympe.dm.Property.typeRel,olympe.dc.CloudObject)}Rc(){return this.F().na().vr(this.na())}};olympe.dm.Property.O=olympe.dc.ya.C('ff021000000000000005',olympe.dm.Property);olympe.dm.Property.definingModelRel=P(olympe.dm.Property.O,olympe.dc.CloudObject.propertyRel);z('olympe.dm.Property.definingModelRel',olympe.dm.Property.definingModelRel);
|
|
741
|
+
olympe.dm.Property.typeRel=P(olympe.dm.Property.O,olympe.dc.CloudObject.typeRel);z('olympe.dm.Property.typeRel',olympe.dm.Property.typeRel);olympe.dm.Property.prototype.F.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.dm.Property.prototype.C.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.dm.Relation=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}Kw(){return olympe.D.Za.EMPTY}kw(){return this.Ie(olympe.dm.Relation.Dm)}Vw(){return this.Ie(olympe.dm.Relation.kn)}Fr(){return this.ub(olympe.dm.Relation.destinationModelRel,olympe.dc.CloudObject).Oc()}Kr(){return this.ub(olympe.dm.Relation.originModelRel,olympe.dc.CloudObject).Oc()}Rc(){return this.Kr().na().concat(['-',this.na(),'->',this.Fr().na()])}};olympe.dm.Relation.O=olympe.dc.ya.C('ff021000000000000006',olympe.dm.Relation);
|
|
742
|
+
olympe.dm.Relation.kn=olympe.dm.Relation.O.xa('ff023000000000000030');olympe.dm.Relation.Dm=olympe.dm.Relation.O.xa('ff023000000000000034');olympe.dm.Relation.Lm=olympe.dm.Relation.O.xa('ff023000000000000037');olympe.dm.Relation.Km=olympe.dm.Relation.O.xa('ff023000000000000137');olympe.dm.Relation.pn=olympe.dm.Relation.O.xa('ff023000000000000237');olympe.dm.Relation.tn=olympe.dm.Relation.O.xa('ff023000000000000337');olympe.dm.Relation.qr=olympe.dm.Relation.O.xa('ff023000000000000031');
|
|
743
|
+
olympe.dm.Relation.originModelRel=P(olympe.dm.Relation.O,olympe.dc.CloudObject.G);z('olympe.dm.Relation.originModelRel',olympe.dm.Relation.originModelRel);olympe.dm.Relation.destinationModelRel=P(olympe.dm.Relation.O,olympe.dc.CloudObject.R);z('olympe.dm.Relation.destinationModelRel',olympe.dm.Relation.destinationModelRel);olympe.dc.Qb={NONE:null,xz:olympe.dm.Relation.Lm.T(),Ac:olympe.dm.Relation.Km.T(),tf:olympe.dm.Relation.pn.T(),XA:olympe.dm.Relation.tn.T()};
|
|
744
|
+
olympe.dc.Qb.toString=function(a){for(const [b,c]of Object.entries(olympe.dc.Qb))if(c===a)return b;return null};olympe.dm.Relation.C={Cl:0,fl:5,qq:1,Ju:4,vk:2,jk:8,yo:10,Fu:6,Gu:9,ic:6,Iu:9};olympe.dm.Relation.F={ju:3,Rl:4,bu:5,Nl:6};olympe.dm.Relation.L=olympe.dm.Jc.Xp+olympe.dm.Jc.ro;m=olympe.dm.Relation.prototype;m.Kw.K=olympe.D.J.F;m.kw.K=olympe.D.J.G;m.Vw.K=olympe.D.J.G;m.Fr.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.Kr.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.dm.rf=class extends olympe.dc.CloudObject{getValue(){}};olympe.dm.rf.O=olympe.dc.ya.C('ff021000000000000019',olympe.dm.rf);olympe.dm.String=class extends olympe.dm.rf{getValue(){return this.Eb(olympe.dm.String.valueProp)}toString(){return this.get(olympe.dm.String.valueProp)}};olympe.dm.String.O=olympe.dc.ya.C('ff021000000000000011',olympe.dm.String);olympe.dm.String.valueProp=olympe.dm.String.O.xa('ff023000000000000026');z('olympe.dm.String.valueProp',olympe.dm.String.valueProp);olympe.dm.String.prototype.getValue.K=olympe.D.J.F;olympe.dm.String.prototype.toString.K=olympe.D.J.C;olympe.dm.Boolean=class extends olympe.dm.rf{getValue(){return this.Bg(olympe.dm.Boolean.valueProp)}};olympe.dm.Boolean.O=olympe.dc.ya.C('ff021000000000000012',olympe.dm.Boolean);olympe.dm.Boolean.valueProp=olympe.dm.Boolean.O.xa('ff023000000000000027');z('olympe.dm.Boolean.valueProp',olympe.dm.Boolean.valueProp);olympe.dm.Boolean.prototype.getValue.K=olympe.D.J.R;olympe.dm.Color=class extends olympe.dm.rf{getValue(){return this.Lr()}};olympe.dm.Color.O=olympe.dc.ya.C('ff021000000000000017',olympe.dm.Color);olympe.dm.Color.valueProp=olympe.dm.Color.O.xa('ff023000000000000032');z('olympe.dm.Color.valueProp',olympe.dm.Color.valueProp);olympe.dm.Color.prototype.getValue.K=new olympe.D.J(()=>olympe.D.Color,[]);olympe.dm.DateTime=class extends olympe.dm.rf{getValue(){return this.hj(olympe.dm.DateTime.valueProp)}};olympe.dm.DateTime.O=olympe.dc.ya.C('ff021000000000000014',olympe.dm.DateTime);olympe.dm.DateTime.valueProp=olympe.dm.DateTime.O.xa('ff023000000000000029');z('olympe.dm.DateTime.valueProp',olympe.dm.DateTime.valueProp);olympe.dm.DateTime.prototype.getValue.K=new olympe.D.J(()=>olympe.D.ib,[]);olympe.dm.Enum=class extends olympe.dm.String{na(){return olympe.D.Fa([super.na(),super.getValue()],(a,b)=>''!==a.valueOf()?a:b,olympe.D.Za)}ee(){return this.Ie(olympe.dm.Enum.rankProp)}static create(a,b,c,d,e){const f=olympe.dc.Ja();e=void 0!==e?e:f.Db(b)&&f.de(b).length||0;c=(new Map).set(olympe.dm.String.valueProp,c).set(olympe.dc.CloudObject.nameProp,d||c).set(olympe.dm.Enum.rankProp,e);return a.create(b,c)}};olympe.dm.Enum.create=olympe.dm.Enum.create;
|
|
745
|
+
olympe.dm.Enum.O=olympe.dc.ya.C('016cdd861b32d56c81f7',olympe.dm.Enum);olympe.dm.Enum.rankProp=olympe.dm.Enum.O.xa('017a7690c915975ea995');olympe.dm.Enum.prototype.ee.K=olympe.D.J.G;olympe.dm.ig=class extends olympe.dm.BrickMetadata{ox(){return this.rb(olympe.dc.CloudObject.instancesRel).Zk(olympe.dm.Enum.rankProp,olympe.dc.ba.ek.ASC).Ic()}static create(a,b){b=a.create(olympe.dm.ig,(new Map).set(olympe.dc.CloudObject.nameProp,b));a.Va(olympe.dc.CloudObject.extendRel,b,olympe.dm.Enum);return b}};olympe.dm.ig.create=olympe.dm.ig.create;olympe.dm.ig.prototype.getValues=olympe.dm.ig.prototype.ox;olympe.dm.ig.O=olympe.dc.ya.C('017a768f966fc08ebb98',olympe.dm.ig);olympe.dm.Number=class extends olympe.dm.rf{getValue(){return this.Ie(olympe.dm.Number.valueProp)}};olympe.dm.Number.O=olympe.dc.ya.C('ff021000000000000013',olympe.dm.Number);olympe.dm.Number.valueProp=olympe.dm.Number.O.xa('ff023000000000000028');z('olympe.dm.Number.valueProp',olympe.dm.Number.valueProp);olympe.dm.Number.prototype.getValue.K=olympe.D.J.G;olympe.ab={};olympe.ab.ah=class{constructor(a){this.N=a;this.W=new olympe.D.Zb(`${this.Z()} source context`);this.R=this.C=null}Z(){}L(){}close(){this.R&&this.R(this.Z(),olympe.dc.qk.pt);this.W.destroy()}};function qh(a){olympe.D.yc([qc(a.ja)],b=>{if(b.valueOf()){const c=a.G.keys();rh(a,d=>{if(d)a.N.error('An error occurred while auto synchronising:\n'+d.message);else if(a.N.debug('Auto synchronise transactions successfully'),a.$)for(const e of c)fc(a.F,f=>{a.N.error(`Could not clear transactions for ${e}: ${f}.`)})})}})}
|
|
746
|
+
function sh(a){let b;olympe.D.yc([qc(a.ja)],c=>{c.valueOf()?(a.$=!1,b&&(Lb(b),b=null)):(a.$=!0,b=Kb(()=>{if(a.da){a.da=!1;for(const d of a.G.keys())dc(a.F,d,a.G.get(d),()=>{},e=>{a.N.error(`Could persist transaction for ${d}: ${e}`)})}},5E3))})}
|
|
747
|
+
function rh(a,b){const c=olympe.async.pk.create(),d=c.G;c.add((e,f)=>{a.F.storage.L(f)});c.add((e,f,g)=>{const h=olympe.dc.Ha.sb,k=g.get('files'),l=new olympe.async.ng(d);a.G.forEach((n,p)=>{if(p!==h){const q=a.ta.R(p);null!==q?(l.add(a.Ka.bind(a,n,q,k)),a.F.storage.C()):f(`The source: ${p} is not reachable.`)}});ac(l,(n,p)=>{n?e():f(p||void 0)});l.start()});ac(c,(e,f)=>{b(e?null:Error(f));e&&(a.da=!1,a.G.clear())});c.start()}
|
|
748
|
+
function th(a,b){const c=new olympe.async.pk(olympe.D.La());c.add((d,e)=>{ec(a.F,f=>null===f?d():e(f))});c.add(d=>{const e=olympe.dc.xd();a.G.forEach((f,g)=>{const h=Array.from(f.de()).map(k=>k.tag());Sc(e,olympe.D.La(),f,h,[],g)(!0)});d()});ac(c,(d,e)=>{b(e?Error(e):null)});c.start()}
|
|
749
|
+
olympe.ab.Gi=class extends olympe.ab.ah{constructor(a,b,c,d,e){super(a);this.G=new Map;this.ja=c;this.F=d;this.ta=b;this.da=this.$=!1;e.get('syncTimeout');e.get('autoSync')&&qh(this);e.get('autoPersist')&&sh(this)}Ka(a,b,c,d,e){const f=olympe.dc.ha.ia.uk,g=olympe.dc.ha.ia.ml,h=new olympe.dc.db.uc,k=new olympe.async.ng(olympe.D.La()),l=(n,p,q)=>{const r=n.tag(),t=n.cb(olympe.dm.File.mimeTypeProp.T());hc(this.F,u=>{Ac(olympe.dc.Cw(),r,u,t,v=>{n.xa(olympe.dm.File.urlProp.T(),v);const w=new Map;w.set(olympe.dm.File.urlProp.T(),
|
|
750
|
+
v);h.qc(r,w);this.F.storage.C(q)})})};for(const n of c)(c=a.Lf(n))&&c.re()&&k.add(l.bind(this,c));ac(k,(n,p)=>{n?(n=M(new olympe.dc.ha(f,a,[b.Z()]),q=>{q?e(q.message):(this.C(b.Z(),g,h),q=Array.from(a.de()).map(r=>r.tag()),olympe.dc.xd().persist(q),d())}),b.L(n)):e(`Transaction synchronisation failed! ${p?p:''}`)});k.start()}Z(){return olympe.dc.Ha.sb}L(a){var b=olympe.dc.ha.ia.dh,c=olympe.dc.ha.ia.uh;const d=olympe.dc.ha.ia.zi,e=olympe.dc.ha.ia.yi,f=olympe.dc.ha.ia.Rg,g=olympe.dc.ha.ia.wl,h=olympe.dc.ha.ia.Rh,
|
|
751
|
+
k=olympe.dc.ha.ia.vi,l=olympe.dc.ha.ia.vh;var n=olympe.dc.ha.ia.Mj;const p=a.type;switch(p){case f:a.validate(null);this.F.storage.F();th(this,v=>{null!==v&&this.N.error(`Could not load transactions: ${v.message}`)});break;case b:case c:const q=a.content;a.C.forEach(v=>{let w=this.G.get(v);void 0===w&&(w=new olympe.dc.db.uc,this.G.set(v,w));q.Mc(w);this.$&&(this.da=!0)});a.validate(null);a=olympe.dc.transaction.rg.C.Op;this.C(olympe.dc.Ha.sb,n,{id:q.Z(),finalize:a});break;case e:case d:const r=a.C[0],
|
|
752
|
+
t=a.content;a.validate(null);cc(this.F,t.Z(),v=>{this.N.warn('No graphresult for subscription : '+t.Z(),v,'\n',t.nh.toJSON());this.N.warn();this.C(r,g,new olympe.dc.query.Bi(t.Z(),r,olympe.dc.Ha.sb,new olympe.dc.db.uc))});break;case h:case l:case k:n=a.content;b=n.file;const u=n.Ye;c=n.se;p===h?gc(this.F,b,n.content,n.mimeType,u,c):p===l?hc(this.F,v=>{u(v)}):this.F.storage.C(c);a.validate(null)}}};olympe.ab.Gi.C='context';const uh=olympe.dc.ha.ia.bm,vh=olympe.dc.ha.ia.em,wh=olympe.dc.ha.ia.QUERY_RESULT,xh=olympe.dc.ha.ia.cm,yh=olympe.dc.ha.ia.dh,zh=olympe.dc.ha.ia.uk,Ah=olympe.dc.ha.ia.Mj,Bh=olympe.dc.ha.ia.uh,Ch=olympe.dc.ha.ia.Cj,Dh=olympe.dc.ha.ia.gl,Eh=olympe.dc.ha.ia.Rh,Fh=olympe.dc.ha.ia.vh,Gh=olympe.dc.ha.ia.vi,Hh=olympe.dc.ha.ia.lg;
|
|
753
|
+
function Ih(a,b,c,d,e){const f=c.Z();c={t:uh,q:c.la()};olympe.H.wa.fb.tb.get(b,c).then(g=>{g.t===wh?(d(null),a.C(b,e||wh,{i:f,r:g.r,s:b})):d(Error(g.e))}).catch(g=>d(Error(g)))}function Jh(a,b,c,d,e){const f=c.Z();Ih(a,b,c,g=>{if(g)e(g);else{Kh(a,b,f);g={t:vh,q:c.la()};var h=olympe.H.wa.fb.tb.observe(b,d,g).subscribe(k=>{const l=k.t;l===xh?(e(null),a.C(b,l,{i:f,r:k.r,s:b})):e(Error(k.e))});d.R(()=>h.unsubscribe())}},xh)}
|
|
754
|
+
function Lh(a,b,c,d){const e=c.xc;c=new olympe.dc.transaction.td;e.Mc(c);c={t:yh,i:e.Z(),p:je(c)};olympe.H.wa.fb.tb.send(b,c).then(()=>{d(null);a.C(b,Ah,{id:e.Z(),finalize:olympe.dc.transaction.rg.C.Np})}).catch(f=>d(Error(f)))}function Mh(a,b,c,d,e){var f=c.xc;c=f.Z();const g=new olympe.dc.transaction.td;f.Mc(g);f={t:Bh,i:c,p:je(g)};olympe.H.wa.fb.tb.publish(b,f).then(()=>e(null)).catch(h=>e(Error(h)));Nh(a,c,b,d)}
|
|
755
|
+
function Kh(a,b,c){const d=()=>{const f=setInterval(()=>{0===a.F.size?clearInterval(f):a.F.forEach((g,h)=>{olympe.H.wa.fb.tb.send(h,{t:Hh,s:Array.from(g)}).catch(k=>a.N.warn(`Error occurred while keeping alive subscription list: ${k}`))})},a.$)},e=a.F.get(b)||new Set;e.add(c);a.F.set(b,e);1===a.F.size&&d()}
|
|
756
|
+
function Nh(a,b,c,d){const e=new olympe.H.wa.fb.tb(b,d);e.listen().subscribe(f=>{f=f.body();if(f.t===Ch){a.N.error(`Burst Transaction ${b} failed. Local rollback is not supported yet. Refresh the application`);const g=new olympe.dc.db.uc;a.C(c,Ch,{id:b,rollback:g,error:f.r})}});d.R(()=>e.stop())}
|
|
757
|
+
olympe.ab.yu=class extends olympe.ab.ah{constructor(a,b,c){super(a);this.F=new Map;this.G=b;this.$=c}Z(){return olympe.dc.Ha.$p}L(a){const b=a.C[0],c=a.type,d=a.validate.bind(a),e=a.content;a=a.F;switch(c){case uh:Ih(this,b,e,d);break;case vh:Jh(this,b,e,a,d);break;case yh:case zh:Lh(this,b,e,d);break;case Bh:Mh(this,b,e,a,d);break;case Dh:e.t=c;olympe.H.wa.fb.tb.publish(b,e).then(d).catch(f=>d(Error(f)));break;case Eh:case Fh:case Gh:olympe.H.wa.fb.tb.get(b,{t:c,f:e.file}).then(f=>{this.G.da(e.file,
|
|
758
|
+
b,f);c===Eh?this.G.W(e.file,e.content,e.mimeType,e.Ye,e.se):c===Fh?this.G.R(e.file,e.url,e.mimeType,e.Ye,e.se):this.G.L(e.file,e.Ye,e.se)}).catch(e.se);break;default:this.N.info(`Messages of type ${c} is not supported by the source ${this.Z()}`)}}};olympe.ab.Buffer=class{constructor(){this.counter=0;this.Fb=new Map}buffer(a){const b=this.counter++;this.Fb.set(b,a);return this.clear.bind(this,b)}clear(a){this.Fb.delete(a)}};olympe.ab.pg=class a{constructor(b,c,d){this.N=b;this.W=c;this.da=new olympe.ab.Buffer(this);this.L=new Map;this.G=this.Hb(d);new olympe.D.Zb('Data Router context');this.F=new Map;this.$=new Map;this.Sa()}Sa(){this.N.info('Initializing DR layer');olympe.D.Ym(qc(this.W),()=>{this.N.info('Router: ONLINE')},()=>{this.N.log('Router: OFFLINE (no auth layer not online)');for(const b of this.da.Fb.values())this.ta(b)});this.N.log('DONE initializing DR layer (waiting for AUTH layer session to be established)')}send(b){M(b,
|
|
759
|
+
this.da.buffer(b));this.ta(b)}C(b,c){const d=olympe.X.ec();let e=this.F.get(b);void 0===e&&(e=new Map,this.F.set(b,e));e.set(d,c)}ja(b){this.$.set(olympe.X.yg(),b)}Ka(b,c,d){this.F.has(c)&&this.F.get(c).forEach(e=>{e(b,d)})}Ab(b,c){this.L.set(b,c);c.C=this.Ka.bind(this);c.R=this.Wa.bind(this)}R(b){return this.L.get(b)||this.L.get(olympe.dc.Ha.$p)}Wa(b,c){this.$.forEach(d=>{d(b,c)})}ta(b){this.N.debug('Processing message',b.toString());this.jb(b).forEach(c=>{(c=this.R(c))&&c.L(b)})}jb(b){var c=olympe.dc.ha.ia.Rg,
|
|
760
|
+
d=olympe.dc.ha.ia.yi,e=olympe.dc.ha.ia.zi,f=olympe.dc.ha.ia.dh,g=olympe.dc.ha.ia.uh;const h=olympe.dc.ha.ia.Rh,k=olympe.dc.ha.ia.vi,l=olympe.dc.ha.ia.vh;switch(b.type){case c:d=this.G.get(a.C.Rg)||[];break;case d:case e:d=this.G.get(a.C.am)||[];break;case f:case g:d=this.G.get(a.C.TRANSACTION)||[];break;case h:case l:case k:d=this.G.get(a.C.Xs)||[];break;default:d=[]}c=b.content;e=olympe.auth.pa.C.Mg;f=olympe.auth.pa.C.yh;g=pc(this.W);e=!(g===e||g===f);for(var n of d)if(d=n,f=c&&c.Z&&c.Z(),g=d.get('type'),
|
|
761
|
+
g===a.F.Gh&&e||g===a.F.ep&&d.get('id')===f||g===a.F.ic)return n=n.get('destinations'),this.N.debug('Message',b.toString(),'is redirect to',n),n;this.N.debug('Message',b.toString(),'not redirect');return b.C}Hb(b){const c=Object.values(olympe.ab.pg.C),d=Object.values(olympe.ab.pg.F);b=Object.entries(b);const e=new Map;b.forEach(([f,g])=>{if(c.includes(f))if(g instanceof Array){var h=[];e.set(f,h);g.forEach(k=>{const l=k.type;if(d.includes(l)){var n=k.destinations;n instanceof Array?(n=(new Map).set('type',
|
|
762
|
+
l).set('destinations',n),h.push(n),l===a.F.ep&&n.set('id',k.id)):this.N.error('Routing rule',f,l,'is not valid. Destinations must be stored in an array')}else this.N.error('Routing rule',f,l,'is not valid. Valid rules are',d.toString())})}else this.N.error('Routing rule',f,'is not valid. Rules must be ordered in an array');else this.N.error('Routing rule',f,'is not valid. Valid messages are',c.toString())});return e}};olympe.ab.pg.C={Rg:'getContext',am:'query',TRANSACTION:'transaction',Xs:'file'};
|
|
763
|
+
olympe.ab.pg.F={ic:'default',Gh:'offline',ep:'id'};olympe.ab.pg.ma=[olympe.dc.pg];olympe.ab.Nj=class{da(){}W(){}R(){}L(){}};olympe.ab.P={Aa:'dr.Manager',Ea:'dr.Logger',ne:'dr.sources.Router',zp:'dr.sources.Local',jm:'dr.sources.Server',bq:'dr.sources.Peer',Qg:'dr.sources.FileSource'};olympe.ab.Config={Ml:'dr.keepAliveTimeout',En:'dr.autoSync',Dn:'dr.autoPersist',Lq:'dr.syncTimeout',xq:'dr.routing'};
|
|
764
|
+
olympe.U.config(function(a){D(a,olympe.ab.Config.xq,{});D(a,olympe.ab.Config.Ml,3E5);D(a,olympe.ab.Config.En,!1);D(a,olympe.ab.Config.Dn,!1);D(a,olympe.ab.Config.Lq,3E4);C(a,olympe.ab.P.Ea,[olympe.ra.P.Aa],b=>b.Nc('dr'));C(a,olympe.ab.P.zp,[olympe.ab.P.Ea,olympe.ab.P.ne,olympe.auth.P.Aa,olympe.hc.P.ko,new olympe.U.fa(olympe.ab.Config.En),new olympe.U.fa(olympe.ab.Config.Dn),new olympe.U.fa(olympe.ab.Config.Lq)],(b,c,d,e,f,g,h)=>{f=(new Map).set('autoSync',f).set('autoPersist',g).set('syncTimeout',
|
|
765
|
+
h);return new olympe.ab.Gi(b,c,d,e,f)});ta(a,olympe.ab.P.jm);A(a,olympe.ab.P.bq,olympe.ab.yu,olympe.ab.P.Ea,olympe.ab.P.Qg,new olympe.U.fa(olympe.ab.Config.Ml));ta(a,olympe.ab.P.Qg);A(a,olympe.ab.P.ne,olympe.ab.pg,olympe.ab.P.Ea,olympe.auth.P.Aa,new olympe.U.fa(olympe.ab.Config.xq));sa(a,olympe.dc.P.ne,olympe.ab.P.ne);C(a,olympe.dc.query.Lb.Yj,[olympe.dc.query.Lb.Yj],b=>new olympe.dc.$l(b))},'olympe.dr');
|
|
766
|
+
olympe.U.run([olympe.ab.P.ne,olympe.ab.P.zp,olympe.ab.P.jm,olympe.ab.P.bq],(a,...b)=>{b.forEach(c=>a.Ab(c.Z(),c))});olympe.H={};olympe.H.Uc={si:1,eg:2,ac:3,qf:4,kz:5,Ci:6,KA:7};olympe.H.ia={Ci:1,jv:2,Ws:3,lg:5};olympe.H.pa=class{Ab(){}connect(){}disconnect(){}$d(){}mj(){}Kd(){}W(){}Hc(){}bc(){}ta(){}od(){}vd(){}};olympe.H.pa.C={INIT:'initialize',CONNECTING:'connecting',hg:'disconnected',ri:'connected',Xg:'reconnecting',Uh:'waking',sh:'awake',ac:'error'};olympe.H.pa.G={Hh:1,ct:-1,qt:-2,$u:-3};function Oh(a,b){const c=a.G.get(b)||a.Ka;a.G.delete(b);return`${c}/${b}`}
|
|
767
|
+
olympe.H.Nj=class{constructor(a,b,c,d,e){this.N=a;this.F=b;this.ja=c;this.Ka=d;this.Wa=e;this.C=new Map;this.G=new Map;this.$=new Map;this.ta=new olympe.D.Zb('File manager context')}da(a,b,c){b&&this.G.set(a,`${this.Wa}/${b}`);c&&this.$.set(a,c)}W(a,b,c,d,e){const f=Pb(Oh(this,a),olympe.net.eb.Yd.fk,b,olympe.net.eb.ResponseType.el);Qb(f,{[olympe.net.eb.Headers.oi]:this.Yc(a),[olympe.net.eb.Headers.Ej]:c||'application/octet-stream'});this.F.C(f,g=>{g=g.Od();g===olympe.net.eb.cd.Hh||g===olympe.net.eb.cd.kl?
|
|
768
|
+
(g=new URL(f.C()),d(g.pathname)):e&&(g=`Failed to create file ${a}. Response code ${g}`,this.N.error(g),e(g))})}R(a,b,c,d,e){const f=olympe.D.La();d={Ye:f.F(d),se:e&&f.F(e)};if(this.C.has(a))this.C.get(a).push(d);else{this.C.set(a,[d]);if(null===b){var g=Pb(Oh(this,a));Qb(g,{[olympe.net.eb.Headers.oi]:this.Yc(a)})}else g=Pb(b);g.F=olympe.net.eb.ResponseType.el;Qb(g,{[olympe.net.eb.Headers.Ej]:c||'application/octet-stream'});this.ta.run(()=>{this.F.C(g,h=>{const k=h.Od(),l=this.C.get(a);if(200<=k&&
|
|
769
|
+
300>k){const n=h.getData();l&&l.forEach(p=>{if(f.G()){const q=f.Xc(),r=f.Z();this.N.warn(`Context ${q} ${r} is being destroyed while file tag ${a} is being downloaded`)}p.Ye(n)})}else{const n=`Failed to download file ${a}. Response code ${k}`;l&&l.forEach(p=>{p.se&&p.se(n)})}this.C.delete(a)})})}}L(a,b,c){const d=Pb(Oh(this,a),olympe.net.eb.Yd.Ac);Qb(d,{[olympe.net.eb.Headers.oi]:this.Yc(a)});this.F.C(d,e=>{e=e.Od();200<=e&&300>e?b():(e=`Failed to delete file ${a}. Response code ${e}`,this.N.error(e),
|
|
770
|
+
c&&c(e))})}Yc(a){const b=this.$.get(a);b&&this.$.delete(a);return b||olympe.D.$a(sc(this.ja))}};olympe.H.Nj.ma=[olympe.ab.Nj];const Ph=olympe.dc.ha.ia.Rg,Qh=olympe.dc.ha.ia.dh,Rh=olympe.dc.ha.ia.uk,Sh=olympe.dc.ha.ia.uh,Th=olympe.dc.ha.ia.yi,Uh=olympe.dc.ha.ia.zi,Vh=olympe.dc.ha.ia.Qo,Wh=olympe.dc.ha.ia.Ro,Xh=olympe.dc.ha.ia.wl,Yh=olympe.dc.ha.ia.vi,Zh=olympe.dc.ha.ia.vh,$h=olympe.dc.ha.ia.Rh,ai=olympe.dc.ha.ia.Mj,bi=olympe.dc.ha.ia.hv,ci=olympe.dc.ha.ia.Eu,di=olympe.dc.ha.ia.dt,ei=olympe.dc.ha.ia.gl,fi=olympe.dc.ha.ia.xs;
|
|
771
|
+
function gi(a){a.G.ta(olympe.H.Uc.si,a.Wa.bind(a));olympe.D.yc([qc(a.ja)],b=>{b=b.valueOf()?olympe.dc.qk.Up:olympe.dc.qk.Gh;a.R&&a.R(a.Z(),b)},'Server source is online')}function hi(a,b,c){const d=b.xc;b=new olympe.dc.transaction.td(!0);d.Mc(b);ii(a,a.jb,Qh,!0,je(b),e=>{c&&c(e);a.C(a.Z(),ai,{id:d.Z(),finalize:olympe.dc.transaction.rg.C.Np})})}
|
|
772
|
+
function ji(a,b,c,d){const e=c.Z();a.N.log('Graphdef (ID ',e,') sent: ',c);const f=c instanceof olympe.dc.query.El?a.Sa:a.ta,g=(new olympe.H.aa.Pj).la(c);c=new olympe.async.ng(a.W);b===Uh&&c.add((k,l)=>{a.F.set(e,{notification:null,hy:a.W.F(n=>n?l(n):k())});ki(a,b,g,n=>n&&l(n.message))});const h=olympe.D.La();c.add((k,l)=>{h.run(()=>{ii(a,f,Th,!1,g,a.W.F(n=>n?l(n.message):k()))})});ac(c,(k,l)=>{const n=a.F.get(e);k&&n&&n.notification?a.C(a.Z(),Wh,n.notification):!k&&n&&li(a,Vh,e,p=>p&&a.N.warn(p));
|
|
773
|
+
a.F.delete(e);d(l?Error(l):null)});c.start()}function li(a,b,c,d){a.N.log('Unsubscribe to: ',c);ki(a,b,{i:c},d)}function ki(a,b,c,d){b={c:b};Object.assign(b,c);a.G.W(olympe.H.Uc.si,b,d&&(e=>{d(e)}))}function ii(a,b,c,d,e,f){if(a.G.Ab()){const g=olympe.H.Uc.si;!d&&e&&Object.assign(e,{c});c=olympe.D.$a(sc(a.ja)).valueOf();a.G.Hc(b,g,c,d,e,f)}else a.N.error('Server is disconnected, data request of type',c,'on url',b,'is canceled.'),f(Error('Server is disconnected'))}
|
|
774
|
+
olympe.H.ah=class extends olympe.ab.ah{constructor(a,b,c,d,e){super(a);this.G=b;this.ja=c;new olympe.H.aa.gb;this.$=new olympe.dc.X.Ji(this.Z());this.da=d;if(4!==e.length)throw Error('Some HTTP end points to the orchestrator are not specified ! Please check DI of olympe.communication module; wants 4 urls but got: '+e.length);this.Ka=e[0];this.Sa=e[1];this.ta=e[2];this.jb=e[3];this.F=new Map;gi(this)}Z(){return olympe.dc.Ha.Lc}L(a){var b=a.type;const c=a.validate.bind(a);a=a.content;switch(b){case Ph:ii(this,
|
|
775
|
+
this.Ka,olympe.dc.ha.ia.Rg,!1,null,c);break;case Sh:b=new olympe.dc.transaction.td;var d=a.xc;a=a.oh;d.Mc(b);ki(this,Sh,{i:d.Z(),r:a,p:je(b)});c(null);break;case ei:b=new olympe.dc.transaction.td;a=a.xc;a.Mc(b);ki(this,ei,{i:a.Z(),p:je(b)},c);break;case Qh:b=new olympe.dc.transaction.td;d=a.xc;a=a.oh;d.Mc(b);ki(this,olympe.dc.ha.ia.dh,{i:d.Z(),r:a,p:je(b)},c);break;case Rh:hi(this,a,c);break;case Th:case Uh:ji(this,b,a,c);break;case Vh:li(this,b,a,c);break;case bi:ki(this,bi,{},c);break;case ci:ki(this,
|
|
776
|
+
ci,{},c);break;case di:ki(this,di,{},c);break;case fi:ki(this,fi,{},c);break;case Zh:this.da.R(a.file,a.url,a.mimeType,a.Ye,a.se);break;case Yh:this.da.L(a.file,a.Ye,a.se);break;case $h:this.da.W(a.file,a.content,a.mimeType,a.Ye,a.se);break;default:this.N.info(`Message of type ${b} not supported yet`)}}Wa(a){var b=olympe.dc.ha.ia.ml,c=olympe.dc.ha.ia.Cj;const d=olympe.dc.ha.ia.ak,e=olympe.dc.ha.ia.Su,f=olympe.dc.ha.ia.wp;var g=olympe.dc.ha.ia.et;const h=a.c;h===b?(a=this.$.C(a.p),this.C(this.Z(),
|
|
777
|
+
b,a)):h===c?(g=a.error.reason,b=this.$.C(a.p),this.C(this.Z(),c,{id:a.i,rollback:b,error:g})):h===Xh?(g=olympe.dc.Ha.sb,c=olympe.dc.Ha.Lc,b=a.i,0<a.s?g=new olympe.dc.query.errors.Rj(b,c,g,a.info.error.reason):(g=this.$.R(b,g,a.p),this.N.debug('< Graphdef Result (ID ',g.Z(),'):',a.p),this.N.log('< Graphdef Result (ID ',g.Z(),') with',g.xc.G(),'operations')),this.C(this.Z(),Xh,g)):h===Wh?(g=a.i,a=this.$.L(g,a.p),this.F.has(g)?(g=this.F.get(g),g.notification?rf(a,g.notification):g.notification=a):this.C(this.Z(),
|
|
778
|
+
Wh,a)):h===f?(g=new olympe.dc.query.Dp(a.i),a.l.forEach(g.F.bind(g)),this.C(this.Z(),f,g)):h===d?(g=olympe.dc.transaction.rg.C.ak,c=0<a.s?a.info.error.reason:null,this.C(this.Z(),ai,{id:a.i,finalize:g,error:c})):h===e?(g=this.F.get(a.i))&&g.hy(0<a.s?a.info.error.reason:null):h===g&&(c=a.ids,b=a.undo_stack_size,a=a.redo_stack_size,this.C(this.Z(),g,{fD:c,wD:b,rD:a}))}};olympe.H.ah.F={oA:1,qB:2};olympe.H.ah.C={100:'Insufficient Rights',200:'Constraints',300:'IOException',400:'Unexpected',500:'Non Existing Subscription'};olympe.H.Tj=class{constructor(){}};olympe.H.Tj.ma=[olympe.dc.ea.Tj];olympe.H.wa={};function mi(a,b,c,d,e){b=new olympe.H.wa.Fb.Response(c,a.L,b,d,e);return a.publish(b)}function ni(a,b,c){a.N.debug(`Bus: Subscribe to ${b}`);Ub(a.C,b,d=>{d=new olympe.H.wa.Fb.Request(d.dest,d.src,d.auth,d.seq,d.type,d.content);a.N.debug('Bus: Received',d);c(d)})}function oi(a,b,c){a.$.set(b,c)}function pi(a,b){return new Promise((c,d)=>{Vb(a.C,b,e=>e?d(e):c())})}
|
|
779
|
+
function qi(a,b){return new Promise((c,d)=>{const e=b.Yc(),f=a.ja.get(e);void 0!==f?c(f):a.F.mh(b.Yc(),(g,h)=>{g?d(g):(a.ja.set(e,h),c(h))})})}
|
|
780
|
+
olympe.H.wa.pa=class{constructor(a,b,c,d){b=d.get('connectionOptions');this.N=a;this.F=c;a=new olympe.X.nm(b.messageTimeout);a.C=this.ta.bind(this);this.$=a;a=d.get('url');this.C=new olympe.net.ke(a,b);this.ja=new olympe.X.nm(b.tokenTimeout);this.da=d.get('allowGuest');this.W=1;this.L=olympe.X.ec();this.G=!1;this.R=[]}connect(){return new Promise((a,b)=>{!this.da&&uc(this.F)?b(Error('Guest user is not allowed to connect to RabbitMQ, you can allow guest with the bus.allowGuest oConfig parameter !!!')):
|
|
781
781
|
Tb(this.C)||this.G?a():(this.da||rc(this.F,()=>this.disconnect().then(),'busLogoutCallback'),this.C.connect(olympe.D.$a(this.F.C.Ib()),()=>{this.N.debug('Connection to bus established. Listening to',this.L);Zb(this.C,c=>{this.N.error('Failed to connect/re-connect to the bus:',c)});Ub(this.C,this.L,c=>{c=new olympe.H.wa.Fb.Response(c.dest,c.src,c.seq,c.type,c.content);this.N.debug('Bus received message:',c);const d=c.G,e=this.$.get(d);this.$.delete(d);e&&e(c)});Yb(this.C,()=>{this.G=!0});Xb(this.C,
|
|
782
782
|
()=>{this.G=!0});Wb(this.C,()=>{if(this.G){this.G=!1;this.N.debug(`Reconnected to bus: Sending ${this.R.length} pending messages.`);for(const c of this.R)this.C.publish(c.L(),c.la());this.R=[]}});a()}))})}disconnect(){return new Promise(a=>{this.N.debug('Disconnecting from bus');this.F.W.delete('busLogoutCallback');this.C.end(!1,()=>a())})}publish(a){this.N.debug('Publishing on bus',a);return this.G?(this.N.debug('Disconnected, storing message in queue'),this.R.push(a),Promise.resolve()):new Promise((b,
|
|
783
|
-
c)=>{this.C.publish(a.L(),a.la(),void 0,d=>d?c(d):b())})}te(a,b,c){return
|
|
784
|
-
olympe.H.wa.Fb.Response.ia={
|
|
785
|
-
olympe.H.wa.fb.tb=class{constructor(a,b){this.C=olympe.H.wa.
|
|
786
|
-
c));return b})}stop(){this.G.destroy()}static publish(a,b){const c=olympe.H.wa.
|
|
787
|
-
e.request(a,
|
|
788
|
-
f.request(a,
|
|
789
|
-
olympe.H.wa.fb.tb.send=olympe.H.wa.fb.tb.send;olympe.H.wa.fb.tb.publish=olympe.H.wa.fb.tb.publish;olympe.H.wa.fb.tb.prototype.stop=olympe.H.wa.fb.tb.prototype.stop;olympe.H.wa.fb.tb.prototype.listen=olympe.H.wa.fb.tb.prototype.listen;const
|
|
790
|
-
olympe.H.wa.fb.ha=class{constructor(a,b){this.request=a;this.C=b;this.user=null}
|
|
791
|
-
|
|
792
|
-
olympe.H.wa.fb.ha.prototype.reply=olympe.H.wa.fb.ha.prototype.te;olympe.H.wa.fb.ha.prototype.ack=olympe.H.wa.fb.ha.prototype.
|
|
793
|
-
olympe.H.qa.
|
|
794
|
-
b)},'logoutHandler')}
|
|
795
|
-
{I:a.yd()},(c,d)=>{if(null!==c)b(c);else switch(d.c){case olympe.H.qa.
|
|
796
|
-
break;case olympe.H.qa.
|
|
797
|
-
olympe.auth.
|
|
798
|
-
'/'+a,olympe.H.Uc.qf,b,!1,null,(d,e)=>{c(d,e)})}
|
|
783
|
+
c)=>{this.C.publish(a.L(),a.la(),void 0,d=>d?c(d):b())})}te(a,b,c){return mi(this,a.G,a.source,b,c)}request(a,b,c){const d=this.W;this.W++;const e=olympe.D.$a(sc(this.F));a=new olympe.H.wa.Fb.Request(a,this.L,e,d,b,c);return this.publish(a).then(()=>d)}notify(a,b,c){const d=this.W;this.W++;a=new olympe.H.wa.Fb.Response(b,a,d,olympe.H.wa.Fb.Response.ia.qm,c);return this.publish(a)}ta(a,b){b(new olympe.H.wa.Fb.Response(this.L,this.L,a,olympe.H.wa.Fb.Response.ia.ac,{reason:'Timeout'}))}};olympe.H.wa.Fb={};olympe.H.wa.Fb.Request=class{constructor(a,b,c,d,e,f){this.G=d;this.destination=a;this.source=b;this.R=c;this.C=e;this.F=f||null}L(){return this.destination}Yc(){return this.R}la(){return{dest:this.destination,src:this.source,seq:this.G,auth:this.R,type:this.C,content:this.F}}toString(){return JSON.stringify(this)}};olympe.H.wa.Fb.Request.ia={SEND:0,GET:1,PUBLISH:2,SUBSCRIBE:3};function ri(a){const b=olympe.H.wa.Fb.Response.ia.Tq;return a.F!==olympe.H.wa.Fb.Response.ia.mm?Promise.reject('Should only call `topicAck` on TOPIC responses'):mi(olympe.H.wa.Pc(),a.G,a.source,b)}olympe.H.wa.Fb.Response=class{constructor(a,b,c,d,e){this.G=c;this.destination=a;this.source=b;this.F=d;this.C=e||null}L(){return this.destination}la(){return{dest:this.destination,src:this.source,seq:this.G,type:this.F,content:this.C}}toString(){return JSON.stringify(this)}};
|
|
784
|
+
olympe.H.wa.Fb.Response.ia={qm:0,yn:1,mm:2,Tq:3,ac:4};olympe.H.wa.fb={};const si=olympe.H.wa.Fb.Response.ia.yn,ti=olympe.H.wa.Fb.Response.ia.ac,ui=olympe.H.wa.Fb.Response.ia.qm,vi=olympe.H.wa.Fb.Response.ia.mm,wi=olympe.H.wa.Fb.Request.ia.SEND,xi=olympe.H.wa.Fb.Request.ia.GET,yi=olympe.H.wa.Fb.Request.ia.PUBLISH,zi=olympe.H.wa.Fb.Request.ia.SUBSCRIBE;
|
|
785
|
+
olympe.H.wa.fb.tb=class{constructor(a,b){this.C=olympe.H.wa.Pc();this.F=a;this.G=new olympe.D.Zb(`Service ${a}`,'function'===typeof b.Sa?b.C.C:b);this.N=olympe.ra.Ya(`Service ${this.F}`)}listen(){return new rxjs.Observable(a=>{const b=()=>{a.complete();pi(this.C,this.F).catch(c=>this.N.error('Failed to unsubscribe from '+this.F+', error: '+c))};this.G.onDestroy(b);this.C.connect().then(()=>{ni(this.C,this.F,c=>a.next(new olympe.H.wa.fb.ha(c,this.C)))}).catch(c=>this.N.error('Failed to connect to the bus: '+
|
|
786
|
+
c));return b})}stop(){this.G.destroy()}static publish(a,b){const c=olympe.H.wa.Pc();return c.connect().then(()=>c.request(a,yi,b)).then(()=>Promise.resolve())}static send(a,b){return new Promise((c,d)=>{const e=olympe.H.wa.Pc();e.connect().then(()=>e.request(a,wi,b)).then(f=>{oi(e,f,g=>{switch(g.F){case si:c();break;case ti:d(g.C.reason);break;default:d('Unsupported response type for a SEND request')}})}).catch(f=>d(f))})}static get(a,b){return new Promise((c,d)=>{const e=olympe.H.wa.Pc();e.connect().then(()=>
|
|
787
|
+
e.request(a,xi,b)).then(f=>{oi(e,f,g=>{switch(g.F){case ui:(g=g.C)?c(g):d('No payload after request to service: '+a);break;case ti:d(g.C.reason);break;default:d('Unsupported response type for a GET request')}})}).catch(f=>d(f))})}static observe(a,b,c){const d='function'===typeof b.Sa?b.C.C:b;return new rxjs.Observable(e=>{const f=olympe.H.wa.Pc();let g=null;const h=()=>{e.complete();g&&pi(f,g).catch(k=>olympe.ra.Ya('Service '+a).error('Failed to unsubscribe from a topic '+k))};d.R(h);f.connect().then(()=>
|
|
788
|
+
f.request(a,zi,c)).then(k=>{oi(f,k,l=>{switch(l.F){case vi:g=l.C.topic;ni(f,g,n=>{n.C===yi?e.next(n.F):(e.error('Unsupported notification message. It should be a publish'),h())});ri(l).catch(n=>{e.error(`Was unable to ack the subscription: ${n}`);h()});break;case ti:e.error(l.C.reason);break;default:e.error('Unsupported response type for a SUBSCRIBE request')}})}).catch(k=>e.error(k));return h})}};olympe.H.wa.fb.tb.observe=olympe.H.wa.fb.tb.observe;olympe.H.wa.fb.tb.get=olympe.H.wa.fb.tb.get;
|
|
789
|
+
olympe.H.wa.fb.tb.send=olympe.H.wa.fb.tb.send;olympe.H.wa.fb.tb.publish=olympe.H.wa.fb.tb.publish;olympe.H.wa.fb.tb.prototype.stop=olympe.H.wa.fb.tb.prototype.stop;olympe.H.wa.fb.tb.prototype.listen=olympe.H.wa.fb.tb.prototype.listen;const Ai=olympe.H.wa.Fb.Response.ia.yn,Bi=olympe.H.wa.Fb.Response.ia.ac,Ci=olympe.H.wa.Fb.Response.ia.qm,Di=olympe.H.wa.Fb.Response.ia.mm,Ei=olympe.H.wa.Fb.Response.ia.Tq,Fi=olympe.H.wa.Fb.Request.ia.SEND,Gi=olympe.H.wa.Fb.Request.ia.GET,Hi=olympe.H.wa.Fb.Request.ia.SUBSCRIBE;
|
|
790
|
+
olympe.H.wa.fb.ha=class{constructor(a,b){this.request=a;this.C=b;this.user=null}wj(){return null!==this.user?Promise.resolve(this.user):qi(this.C,this.request).then(a=>this.user=a)}source(){return this.request.source}body(){return this.request.F}Bk(){return this.request.C===Fi?this.C.te(this.request,Ai,void 0):Promise.reject('Should only call `ack` on SEND requests')}te(a){return this.request.C===Gi?this.C.te(this.request,Ci,a):Promise.reject('Should only call `reply` on GET requests')}hn(a){return this.request.C!==
|
|
791
|
+
Hi?Promise.reject('Should only call `notifyOn` on SUBSCRIBE requests'):this.C.te(this.request,Di,{topic:a}).then(()=>new Promise((b,c)=>{oi(this.C,this.request.G,d=>{switch(d.F){case Ei:b();break;case Bi:c(d.C.reason);break;default:c('Unsupported response type for a SUBSCRIBE request')}})}))}xg(a){return this.C.te(this.request,Bi,{reason:a.message})}};olympe.H.wa.fb.ha.prototype.fail=olympe.H.wa.fb.ha.prototype.xg;olympe.H.wa.fb.ha.prototype.notifyOn=olympe.H.wa.fb.ha.prototype.hn;
|
|
792
|
+
olympe.H.wa.fb.ha.prototype.reply=olympe.H.wa.fb.ha.prototype.te;olympe.H.wa.fb.ha.prototype.ack=olympe.H.wa.fb.ha.prototype.Bk;olympe.H.wa.fb.ha.prototype.body=olympe.H.wa.fb.ha.prototype.body;olympe.H.wa.fb.ha.prototype.source=olympe.H.wa.fb.ha.prototype.source;olympe.H.wa.fb.ha.prototype.userTag=olympe.H.wa.fb.ha.prototype.wj;olympe.H.qa={};function Ii(a,b,c,d){c.c=b;a.C.W(olympe.H.Uc.qf,c,d)}
|
|
793
|
+
olympe.H.qa.Ta=class{constructor(a,b,c,d,e,f,g,h,k){this.N=a;this.C=b;this.F=h;this.jb=c;this.L=g;this.storage=k;const l=this.storage.C('AUTH');l&&(l.get('redirectTo',n=>{n&&(l.remove('redirectTo'),l.close(),this.F.redirect(n,null,olympe.auth.lk.C.GET))}),l.close())}$(a){this.C.$d(a)}R(a){this.C.mj(a)}W(a){this.C.Kd(a)}Sa(a){this.C.od(olympe.H.Uc.qf,'logoutHandler');this.C.ta(olympe.H.Uc.qf,b=>{const c=b.c;c===olympe.H.qa.Ta.C.Wt?(this.C.bc(),a(olympe.auth.pa.F.xj,b)):c===olympe.H.qa.Ta.C.Lu&&a(olympe.auth.pa.F.fp,
|
|
794
|
+
b)},'logoutHandler')}da(a,b){Ii(this,olympe.H.qa.Ta.C.qf,{token:a.Ve()},(c,d)=>{if(null!==c)b(c);else switch(d.c){case olympe.H.qa.Ta.C.ac:b(Error('Invalid token'));break;case olympe.H.qa.Ta.C.Qi:c=null;var e=d.payload;if(e){d=e.userName;const f=e.userTag,g=e.rndCook,h=e.payload,k=e.protocol;'SAML'===k?(e=e.samlToken,c=new olympe.auth.zq(d,f,g,h),c.F=e):'openid'===k&&(c=new olympe.auth.Vl(d,f,g,h))}b(null,c);break;default:b(Error('Unknown response from server'))}})}Ka(a,b){Ii(this,olympe.H.qa.Ta.C.jt,
|
|
795
|
+
{I:a.yd()},(c,d)=>{if(null!==c)b(c);else switch(d.c){case olympe.H.qa.Ta.C.ac:b(Error(`Username '${a.yd()}' invalid, or password does not match`));break;case olympe.H.qa.Ta.C.Uu:c=d.payload;b(null,c.S,c.B);break;default:b(Error('Unknown response from server'))}})}Wa(a,b){Ii(this,olympe.H.qa.Ta.C.ks,{A:a.get('a'),M:a.get('m1'),I:a.yd()},(c,d)=>{if(null!==c)b(c);else switch(d.c){case olympe.H.qa.Ta.C.ac:this.N.debug('Login failed, invalid username or password');b(Error('Invalid username or password'));
|
|
796
|
+
break;case olympe.H.qa.Ta.C.Qi:c=d.payload;this.N.debug('Login successful, creating token');d=c.payload?JSON.parse(c.payload):void 0;b(null,new olympe.auth.vf(c.userName,c.userTag,c.rndCook,d));break;default:b(Error(`Unknown response from server (type ${d.c})`))}})}ta(a,b){Ii(this,olympe.H.qa.Ta.C.Ne,wc(a)?{idpName:wc(a)}:{},(c,d)=>{null!==c?b(c):d.url&&d.request?b(null,d.url,d.request.replace(/\s/g,''),d.id):b(Error('Missing parameters from server response'))})}ja(a,b){const c=null==a?void 0:a.Ch();
|
|
797
|
+
if(a instanceof olympe.auth.Vl){const d=f=>{const g=Object.create(null);g.url=f;g.olympe_token=a.Ve();g.access_token=a.Vj().access_token||null;this.F.redirect(`${this.L}/logout${c?`?idpName=${c}`:''}`,g)};b=this.F.C();const e=new URL(b);if(0!==e.hash.length||0!==e.search.length){const f=this.storage.C('AUTH');e.hash='';e.search='';f&&f.set('redirectTo',b,()=>{f.close();d(e.toString())})}else d(b)}else this.C.W(olympe.H.Uc.qf,Object.assign({},{c:olympe.H.qa.Ta.C.Xt},c&&{idpName:c}),b)}gi(a){this.C.W(olympe.H.Uc.qf,
|
|
798
|
+
{c:olympe.H.qa.Ta.C.lg},a)}mh(a,b,c){this.C.Hc(this.jb+'/'+a,olympe.H.Uc.qf,b,!1,null,(d,e)=>{c(d,e)})}G(){return this.C.vd()}Jr(){return this.L}};olympe.H.qa.Ta.C={qf:1,Xt:2,ac:3,lg:5,Qi:6,jt:10,Uu:11,ks:12,Ne:13,Lu:14,Wt:20};olympe.H.qa.Ta.ma=[olympe.auth.Wu,olympe.auth.Jb.qa.Hi,olympe.auth.Jb.qa.Fe,olympe.auth.Jb.qa.Ne];olympe.H.aa={};olympe.H.aa.Wc=function(){};olympe.H.aa.Wc.prototype.la=function(){};olympe.H.aa.Me=function(){};olympe.H.aa.Me.prototype.la=function(){};olympe.H.aa.bb=function(){};olympe.H.aa.bb.prototype.la=function(){};olympe.H.aa.yf=function(){};olympe.H.aa.yf.prototype.la=function(){};olympe.H.aa.gb=function(){this.Y={};this.Bb={};this.V={};this.oa=Object.create(null);var a=new olympe.H.aa.Y.Sb;this.Y[O(olympe.dc.Y.Sb)]=a;a=new olympe.H.aa.Y.Ce;this.Y[O(olympe.dc.Y.Ce)]=a;a=new olympe.H.aa.Y.Bc;this.Y[O(olympe.dc.Y.Bc)]=a;this.Y[O(olympe.dc.Y.Hd)]=new olympe.H.aa.Y.Hd;this.Y[O(olympe.dc.Y.rc)]=new olympe.H.aa.Y.rc;this.Y[O(olympe.dc.Y.Xd)]=new olympe.H.aa.Y.Xd;this.Y[O(olympe.dc.Y.xe)]=new olympe.H.aa.Y.xe;a=new olympe.H.aa.Bb.Number;this.Bb[O(olympe.dc.Bb.Number)]=a;a=new olympe.H.aa.Bb.String;
|
|
799
799
|
this.Bb[O(olympe.dc.Bb.String)]=a;a=new olympe.H.aa.V.Fc;this.V[O(olympe.dc.V.Fc)]=a;this.V[O(olympe.dc.V.ze)]=new olympe.H.aa.V.ze;this.V[O(olympe.dc.V.Ge)]=new olympe.H.aa.V.Ge;a=new olympe.H.aa.V.Sc;this.V[O(olympe.dc.V.Sc)]=a;a=new olympe.H.aa.V.ud;this.V[O(olympe.dc.V.ud)]=a;this.V[O(olympe.dc.V.jd)]=new olympe.H.aa.V.jd;a=new olympe.H.aa.V.lf;this.V[O(olympe.dc.V.lf)]=a;a=new olympe.H.aa.V.mf;this.V[O(olympe.dc.V.mf)]=a;this.oa[O(olympe.dc.oa.Bd)]=new olympe.H.aa.oa.Bd;a=new olympe.H.aa.oa.le;
|
|
800
|
-
this.oa[O(olympe.dc.oa.le)]=a;a=new olympe.H.aa.oa.pe;this.oa[O(olympe.dc.oa.pe)]=a;a=new olympe.H.aa.oa.ue;this.oa[O(olympe.dc.oa.ue)]=a;a=new olympe.H.aa.oa.je;this.oa[O(olympe.dc.oa.je)]=a;this.oa[O(olympe.dc.oa.uf)]=new olympe.H.aa.oa.uf};olympe.H.aa.gb.prototype.constructor=olympe.H.aa.gb;function
|
|
801
|
-
function
|
|
802
|
-
function
|
|
803
|
-
'}':a instanceof olympe.dc.Cc?'{"c":8,"t":"'+a.T()+'"}':JSON.stringify(a)};olympe.H.aa.
|
|
804
|
-
olympe.H.aa.oa.
|
|
805
|
-
a.connect());olympe.D.
|
|
806
|
-
function Z(a,b){if(a.C!==b){a.N.debug('State change '+a.C+' --\x3e '+b);a.C=b;var c;null==(c=a.
|
|
800
|
+
this.oa[O(olympe.dc.oa.le)]=a;a=new olympe.H.aa.oa.pe;this.oa[O(olympe.dc.oa.pe)]=a;a=new olympe.H.aa.oa.ue;this.oa[O(olympe.dc.oa.ue)]=a;a=new olympe.H.aa.oa.je;this.oa[O(olympe.dc.oa.je)]=a;this.oa[O(olympe.dc.oa.uf)]=new olympe.H.aa.oa.uf};olympe.H.aa.gb.prototype.constructor=olympe.H.aa.gb;function Ji(a,b,c){var d=b.na(),e=a.V[d];if(void 0===e)throw Error('No predicate registered for predicate: '+d);return e.la(b,c,a)}
|
|
801
|
+
function Ki(a,b,c){var d=b.na(),e=a.oa[d];if(void 0===e)throw Error('No valueDef registered for valueDef: '+d);return e.la(b,c,a)}
|
|
802
|
+
function Li(a,b){return a&&a.zf?'"$'+b.add(a)+'"':a instanceof olympe.D.sa||a instanceof olympe.D.ga?String(a):a instanceof olympe.D.Za?'"'+a+'"':a instanceof olympe.D.ib?(a=a.bs(),String(`{"c":4,"y":${a.getUTCFullYear()},"M":${a.getUTCMonth()+1},"d":${a.getUTCDate()},"h":${a.getUTCHours()},"m":${a.getUTCMinutes()},"s":${a.getUTCSeconds()},"S":${a.getUTCMilliseconds()},"z":0}`)):a instanceof olympe.D.Color?'{"c":7,"r":'+a.Qf().valueOf()+',"g":'+a.Kf().valueOf()+',"b":'+a.Ff().valueOf()+',"a":'+a.Ef().valueOf()+
|
|
803
|
+
'}':a instanceof olympe.dc.Cc?'{"c":8,"t":"'+a.T()+'"}':JSON.stringify(a)};olympe.H.aa.Pj=class{la(a){const b=Object.create(null);b.i=a.Z();b.b=[a.C];b.m=!0;b.v=!0;b.f=a instanceof olympe.dc.query.El?df(a.nh):olympe.dc.Qb.NONE;b.q=vf(a).map(this.C.bind(this));return b}C(a){const b=a.Nd(),c=b.Ra()===olympe.dc.Ca.ORIGIN?olympe.H.aa.Y.Sb.C.Fi:olympe.H.aa.Y.Sb.C.Ni,d=Object.create(null);d.t=b.T();d.d=c;d.v=a.apply;d.r=b.recursive;d.q=a.jh().map(this.C.bind(this));return d}};olympe.H.aa.Y={};olympe.H.aa.Y.xe=class{la(){return'{"y":15}'}};olympe.H.aa.Y.xe.ma=[olympe.H.aa.Wc];olympe.H.aa.Y.rc=function(){};olympe.H.aa.Y.rc.prototype.constructor=olympe.H.aa.Y.rc;olympe.H.aa.Y.rc.prototype.la=function(a,b,c){return'{"y":21,"p":'+Ji(c,a.C,b)+'}'};olympe.H.aa.Y.rc.ma=[olympe.H.aa.Wc];olympe.H.aa.Y.Ce=function(){};olympe.H.aa.Y.Ce.prototype.constructor=olympe.H.aa.Y.Ce;olympe.H.aa.Y.Ce.prototype.la=function(a){var b=null!==a.Ra()?a.Ra()===olympe.dc.Ca.ORIGIN?olympe.H.aa.Y.Sb.C.Fi:olympe.H.aa.Y.Sb.C.Ni:olympe.H.aa.Y.Sb.C.Kn;return'{"y":12,"t":'+JSON.stringify(jh(a))+',"d":'+b+'}'};olympe.H.aa.Y.Ce.ma=[olympe.H.aa.Wc];olympe.H.aa.Y.Bc=function(){};olympe.H.aa.Y.Bc.prototype.constructor=olympe.H.aa.Y.Bc;olympe.H.aa.Y.Bc.prototype.la=function(a){const b=null!==a.Ra()?a.Ra()===olympe.dc.Ca.ORIGIN?olympe.H.aa.Y.Sb.C.Fi:olympe.H.aa.Y.Sb.C.Ni:olympe.H.aa.Y.Sb.C.Kn;return'{"y":11,"t":"'+a.T()+'","d":'+b+',"s":'+a.F+',"e":'+a.C+'}'};olympe.H.aa.Y.Bc.ma=[olympe.H.aa.Wc];olympe.H.aa.Y.Sb=function(){};olympe.H.aa.Y.Sb.C={Kn:0,Fi:1,Ni:2};olympe.H.aa.Y.Sb.prototype.constructor=olympe.H.aa.Y.Sb;olympe.H.aa.Y.Sb.prototype.la=function(a){const b=a.Ra()===olympe.dc.Ca.ORIGIN?olympe.H.aa.Y.Sb.C.Fi:olympe.H.aa.Y.Sb.C.Ni;return'{"y":10,"t":"'+a.T()+'","d":'+b+'}'};olympe.H.aa.Y.Sb.ma=[olympe.H.aa.Wc];olympe.H.aa.Y.Hd=function(){};olympe.H.aa.Y.Hd.prototype.constructor=olympe.H.aa.Y.Hd;olympe.H.aa.Y.Hd.prototype.la=function(a,b,c){var d=a.Id;const e=d.na();var f=c.Bb[e];if(void 0===f)throw Error('No comparator registered for comparator: '+e);return'{"y":20,"o":'+f.la(d,b,c)+(a.C?'':',"a":false')+'}'};olympe.H.aa.Y.Hd.ma=[olympe.H.aa.Wc];olympe.H.aa.Y.Xd=function(){};olympe.H.aa.Y.Xd.prototype.constructor=olympe.H.aa.Y.Xd;olympe.H.aa.Y.Xd.prototype.la=function(a,b){var c=a.start;c=c&&c.zf?'"$'+b.add(c)+'"':JSON.stringify(c);a=(a=a.C)&&a.zf?'"$'+b.add(a)+'"':JSON.stringify(a);return'{"y":22,"s":'+c+',"n":'+a+'}'};olympe.H.aa.Y.Xd.ma=[olympe.H.aa.Wc];olympe.H.aa.Bb={};olympe.H.aa.Bb.Number=class{constructor(){}la(a,b,c){return`{"y":11,"v":${Ki(c,a.C,b)}}`}};olympe.H.aa.Bb.Number.ma=[olympe.H.aa.Me];olympe.H.aa.Bb.String=class{constructor(){}la(a,b,c){return`{"y":10,"v":${Ki(c,a.C,b)}}`}};olympe.H.aa.Bb.String.ma=[olympe.H.aa.Me];olympe.H.aa.V={};olympe.H.aa.V.Sc=function(){};olympe.H.aa.V.Sc.prototype.constructor=olympe.H.aa.V.Sc;olympe.H.aa.V.Sc.prototype.la=function(a,b,c){const d=Ki(c,a.source,b);c=Ki(c,a.getValue(),b);a=Li(a.G,b);return'{"y":20,"s":'+d+',"v":'+c+',"a":'+a+'}'};olympe.H.aa.V.Sc.ma=[olympe.H.aa.bb];olympe.H.aa.V.Fc=function(){};olympe.H.aa.V.Fc.prototype.constructor=olympe.H.aa.V.Fc;olympe.H.aa.V.Fc.prototype.la=function(a,b,c){const d=Ki(c,a.G,b);a=Ki(c,a.L,b);return'{"y":10,"l":'+d+',"r":'+a+'}'};olympe.H.aa.V.Fc.ma=[olympe.H.aa.bb];olympe.H.aa.V.ze=function(){};olympe.H.aa.V.ze.prototype.constructor=olympe.H.aa.V.ze;olympe.H.aa.V.ze.prototype.la=function(a,b,c){const d=Ki(c,a.G,b);a=Ki(c,a.L,b);return'{"y":11,"l":'+d+',"r":'+a+'}'};olympe.H.aa.V.ze.ma=[olympe.H.aa.bb];olympe.H.aa.V.lf=class{la(a){const b=dh(a).map(d=>'"'+d+'"'),c=eh(a).map(d=>d===olympe.dc.Ca.DESTINATION?'2':'1');a=a.G;return'{"y":81,"r":['+b.toString()+'],"d":['+c.toString()+']'+(0!==a.length?',"t":"'+a.toString()+'"':'')+'}'}};olympe.H.aa.V.lf.ma=[olympe.H.aa.bb];olympe.H.aa.V.mf=class{la(a){return'{"y":80,"m":['+Array.from(a.G).map(b=>'"'+b+'"').toString()+']}'}};olympe.H.aa.V.mf.ma=[olympe.H.aa.bb];olympe.H.aa.V.jd=class{la(a,b,c){return'{"y":30,"p":'+Ji(c,a.G,b)+'}'}};olympe.H.aa.V.jd.ma=[olympe.H.aa.bb];olympe.H.aa.V.ud=class{la(a,b,c){c=Ki(c,a.source,b);const d=a.L;a=Li(a.G,b);return'{"y":23,"s":'+c+',"r":"'+d+'","a":'+a+'}'}};olympe.H.aa.V.ud.ma=[olympe.H.aa.bb];olympe.H.aa.V.Ge=function(){};olympe.H.aa.V.Ge.prototype.constructor=olympe.H.aa.V.Ge;olympe.H.aa.V.Ge.prototype.la=function(a,b,c){var d=Ki(c,a.G,b);a=Ki(c,a.L,b);return'{"y":12,"l":'+d+',"r":'+a+'}'};olympe.H.aa.V.Ge.ma=[olympe.H.aa.bb];olympe.H.aa.oa={};olympe.H.aa.oa.Kc=function(){};olympe.H.aa.oa.Kc.prototype.constructor=olympe.H.aa.oa.Kc;olympe.H.aa.oa.Kc.prototype.C=function(){};
|
|
804
|
+
olympe.H.aa.oa.Kc.prototype.la=function(a,b,c){var d=Li(a.Ze,b),e=a.Ld();e=e?',"b":'+Li(e,b):'';if(a=a.Cg()){var f='[';for(let n=0,p=a.length;n<p;n++){var g=0===n?'':',';var h=c;var k=a[n],l=b;const q=k.na(),r=h.Y[q];if(void 0===r)throw Error('No serializer registered for transformer: '+q);h=r.la(k,l,h);f+=g+h}b=',"q":'+(f+']')}else b='';return'{"y":'+this.C()+',"t":'+d+e+b+'}'};olympe.H.aa.oa.Kc.ma=[olympe.H.aa.yf];olympe.H.aa.oa.ue=function(){olympe.H.aa.oa.Kc.call(this)};olympe.H.aa.oa.ue.prototype=Object.create(olympe.H.aa.oa.Kc.prototype);olympe.H.aa.oa.ue.prototype.constructor=olympe.H.aa.oa.ue;olympe.H.aa.oa.ue.prototype.C=function(){return 13};olympe.H.aa.oa.Bd=class{la(a,b){return'{"y":10,"v":'+Li(a.value,b)+'}'}};olympe.H.aa.oa.Bd.ma=[olympe.H.aa.yf];olympe.H.aa.oa.je=function(){olympe.H.aa.oa.Kc.call(this)};olympe.H.aa.oa.je.prototype=Object.create(olympe.H.aa.oa.Kc.prototype);olympe.H.aa.oa.je.prototype.constructor=olympe.H.aa.oa.je;olympe.H.aa.oa.je.prototype.C=function(){return 14};olympe.H.aa.oa.le=function(){olympe.H.aa.oa.Kc.call(this)};olympe.H.aa.oa.le.prototype=Object.create(olympe.H.aa.oa.Kc.prototype);olympe.H.aa.oa.le.prototype.constructor=olympe.H.aa.oa.le;olympe.H.aa.oa.le.prototype.C=function(){return 11};olympe.H.aa.oa.pe=function(){olympe.H.aa.oa.Kc.call(this)};olympe.H.aa.oa.pe.prototype=Object.create(olympe.H.aa.oa.Kc.prototype);olympe.H.aa.oa.pe.prototype.constructor=olympe.H.aa.oa.pe;olympe.H.aa.oa.pe.prototype.C=function(){return 12};olympe.H.aa.oa.uf=class{la(){return'{"y":19}'}};olympe.H.aa.oa.uf.ma=[olympe.H.aa.yf];olympe.H.pd={};function Mi(a,b){a.N.info('Initializing SERVER layer');if(a.N.G()){const c=['Server layer parameters:'];b.forEach((d,e)=>{c.push(e+'="'+d+'"')});a.N.debug(c.join('\n\t'))}a.ta(olympe.H.Uc.ac,c=>{switch(c.c){case olympe.H.ia.jv:a.N.error('Unknown message sent to the server:',olympe.H.pa.F[c.s]);break;case olympe.H.ia.Ws:a.N.error('Fatal error, the last message is probably too big according to the websocket config.'),a.G.forEach((d,e)=>{null!==d.qn&&Ni(a,e,c.i)})}});b.get('autoConnect')&&(a.N.debug('Connecting automatically'),
|
|
805
|
+
a.connect());olympe.D.Ym(a.R.Ib(),()=>{a.Ok.forEach(c=>c());Kb(a.Xx.bind(a),a.py);Kb(a.be.bind(a),a.We)},()=>{a.$=null;a.ph.forEach(c=>c(a.L[2]));a.be()});a.N.log('DONE initializing SERVER layer (waiting for NET layer connection to be opened)')}
|
|
806
|
+
function Z(a,b){if(a.C!==b){a.N.debug('State change '+a.C+' --\x3e '+b);a.C=b;var c;null==(c=a.Ur)||c.call(a,b);switch(b){case olympe.H.pa.C.CONNECTING:break;case olympe.H.pa.C.ri:a.R.update(olympe.D.sa.F);break;case olympe.H.pa.C.Xg:a.L[0]=0;a.L[1]=0;a.connect();break;case olympe.H.pa.C.ac:a.N.error('Connection to server',a.ja.C(),'aborted due to error');a.R.update(olympe.D.sa.C);break;case olympe.H.pa.C.Uh:break;case olympe.H.pa.C.sh:a.connect();break;case olympe.H.pa.C.hg:a.R.update(olympe.D.sa.C);
|
|
807
807
|
a.Hb&&(a.N.info('Disconnected, will try to auto reconnect in',a.Vb,'ms'),Jb(()=>{a.connect()},a.Vb));break;default:throw Error('State machine error in server manager. Should not get in state '+b);}}}
|
|
808
|
-
function
|
|
809
|
-
h=g.error.detailedReason;'string'===typeof h&&0<h.length&&(f+=`\nDetails:\n${g.error.detailedReason}`)}f=Error('Rejected by orchestrator:\n'+f)}b(f,e)}}}function
|
|
810
|
-
function
|
|
811
|
-
function
|
|
812
|
-
olympe.H.pd.pa=class{constructor(a,b,c,d,e){this.N=a;this.
|
|
813
|
-
this.R=olympe.D.Qc(olympe.D.sa,'Server is online');this.
|
|
814
|
-
this.F.ja(this.bc.bind(this));this.F.da(this.Xc.bind(this));this.F.$(()=>{this.F=null;this.C===c?Z(this,e):this.C!==h&&this.C!==f&&Z(this,d)});this.Sa&&this.C===a&&this.F.F(()=>{this.F.F(null);if(this.C===b){var k=Nb(this.Sa);this.N.info(`Trying to wakeup orchestrator with ${k}`);Z(this,f);var l=this.
|
|
815
|
-
l.send('{"action": "wakeup"}');Z(this,f);break;case 'waking-up':break;default:this.N.warn(`Invalid message from ${k}: ${n}`),l.close(),Z(this,d)}});l.F(()=>{this.N.warn(`Communication with ${k} failed.`);l.close();Z(this,d)});l.ja(()=>{this.N.info(`Checking orchestrator status with ${k}`);l.send('{"action": "status"}')})}this.Sa=null});this.C!==e&&Z(this,b)}disconnect(){const a=olympe.H.pa.C.CONNECTING;if(this.C===olympe.H.pa.C.
|
|
816
|
-
this.
|
|
817
|
-
this.G.set(d,b);c=[olympe.H.pa.C.CONNECTING,olympe.H.pa.C.Xg];(this.Ab()||a===olympe.H.Uc.
|
|
818
|
-
Qb(g,{Authorization:c});const h=()=>{this.
|
|
819
|
-
f&&f(k)}})};h()}ta(a,b,c){void 0===c&&(c=olympe.X.ec());let d=this.Ka.get(a);void 0===d&&(d=new Map,this.Ka.set(a,d));d.set(c,b)}
|
|
820
|
-
return;case c
|
|
821
|
-
return}this.N.log('Handshake successful. Orchestrator version: ',e,'required:',Ma(this.
|
|
822
|
-
Z(this,olympe.H.pa.C.Xg)):(this.N.trace('Sending Ping'),this.L[0]=Date.now(),this.F.send('ping')||(this.N.debug('Impossible to send ping, try to reconnect'),Z(this,olympe.H.pa.C.Xg)))}Xc(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.N.error('Unable to parse response from server: '+d.toString()),Error('Unable to parse response from server')}this.N.G()&&this.N.debug('<',
|
|
823
|
-
if(this.G.has(a)){const {
|
|
808
|
+
function Oi(a,b){const c=olympe.H.pa.L.Qi,d=olympe.H.pa.L.fu;return e=>{if(null!==e&&void 0!==e){var f=null,g=e.s;if(g===d)a.N.debug(`Try to unsubscribe multiple times. This could be because you logged out before unsubscribe. ${e.info.error.reason}`);else if(void 0!==g&&g!==c){f=void 0!==olympe.H.pa.F[g]?`Status code = ${g} [${olympe.H.pa.F[g]}]`:`Status code = ${g}`;g=e.info;if(void 0!==g&&void 0!==g.error){var h=g.error.reason;'string'===typeof h&&0<h.length&&(f+=`\nReason:\n${g.error.reason}`);
|
|
809
|
+
h=g.error.detailedReason;'string'===typeof h&&0<h.length&&(f+=`\nDetails:\n${g.error.detailedReason}`)}f=Error('Rejected by orchestrator:\n'+f)}b(f,e)}}}function Pi(a,b,c){var d=c.message;a.N.G()&&a.N.debug('>',Qi(d));(d=a.F.send(JSON.stringify(d)))?null===c.Xh?a.G.delete(b):c.qn=Date.now():Z(a,olympe.H.pa.C.Xg);return d}
|
|
810
|
+
function Qi(a){var b=JSON.parse(JSON.stringify(a));a=olympe.X.Hr;const c=b.messageFamily,d=a(olympe.H.Uc,c),e=b.payload;b='';switch(c){case olympe.H.Uc.si:b=a(olympe.dc.ha.ia,e.c);break;case olympe.H.Uc.ac:b=a(olympe.H.ia,e.c);break;case olympe.H.Uc.qf:b=a(olympe.H.qa.Ta.C,e.c);break;case olympe.H.Uc.Ci:2===e.c&&(b=a(olympe.H.pa.G,e.status))}a=`${d} message`;b&&0<b.length&&(a+=` with payload "${b}"`);return a}
|
|
811
|
+
function Ni(a,b,c){if(a.G.has(b)){const {Xh:d}=a.G.get(b);a.G.delete(b);d&&d({s:23,info:c})}}function Ri(a,b){a.N.error(b);Z(a,olympe.H.pa.C.ac)}function Si(a,b,c){a.N.info('Connected to',a.ja.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(!Pi(a,d,e))return;Z(a,olympe.H.pa.C.ri)}
|
|
812
|
+
olympe.H.pd.pa=class{constructor(a,b,c,d,e){this.N=a;this.jb=b;this.ja=c;this.F=null;this.config=e;this.Vb=this.config.get('reconnectionDelay');this.Sa=d;this.Ur=null;this.py=this.config.get('pingInterval');this.qy=this.Vb/2;this.Hb=e.get('autoConnect');this.uy=e.get('retryHttpOverload');this.We=e.get('messageTimeout');this.da=La(e.get('clientVersion'));this.Wa=La(e.get('serverVersion'));this.C=olympe.H.pa.C.INIT;this.zc=e.get('getContextMode');this.Qk=1;this.$=null;this.L=[0,0,0];this.Ka=new Map;
|
|
813
|
+
this.R=olympe.D.Qc(olympe.D.sa,'Server is online');this.Ok=new Map;this.ph=new Map;this.G=new Map;this.fe=new Map;Mi(this,e)}Ab(){return this.C===olympe.H.pa.C.ri}connect(){const a=olympe.H.pa.C.INIT,b=olympe.H.pa.C.CONNECTING,c=olympe.H.pa.C.ri,d=olympe.H.pa.C.hg,e=olympe.H.pa.C.Xg,f=olympe.H.pa.C.Uh,g=olympe.H.pa.C.sh,h=olympe.H.pa.C.ac;null!==this.F&&(this.F.$(null),this.F.close());this.Hb=!0;this.N.log(`Asking NET layer for a connection to ${Mb(this.ja)}:${this.ja.port}...`);this.F=this.jb.G(this.ja);
|
|
814
|
+
this.F.ja(this.bc.bind(this));this.F.da(this.Xc.bind(this));this.F.$(()=>{this.F=null;this.C===c?Z(this,e):this.C!==h&&this.C!==f&&Z(this,d)});this.Sa&&this.C===a&&this.F.F(()=>{this.F.F(null);if(this.C===b){var k=Nb(this.Sa);this.N.info(`Trying to wakeup orchestrator with ${k}`);Z(this,f);var l=this.jb.G(this.Sa);l.da(n=>{const p=JSON.parse(n);this.N.info(`${k}: ${null==p?void 0:p.status}`);switch(null==p?void 0:p.status){case 'ready':Z(this,g);l.close();break;case 'asleep':this.N.info(`Trying to wakeup orchestrator with ${k}`);
|
|
815
|
+
l.send('{"action": "wakeup"}');Z(this,f);break;case 'waking-up':break;default:this.N.warn(`Invalid message from ${k}: ${n}`),l.close(),Z(this,d)}});l.F(()=>{this.N.warn(`Communication with ${k} failed.`);l.close();Z(this,d)});l.ja(()=>{this.N.info(`Checking orchestrator status with ${k}`);l.send('{"action": "status"}')})}this.Sa=null});this.C!==e&&Z(this,b)}disconnect(){const a=olympe.H.pa.C.CONNECTING;if(this.C===olympe.H.pa.C.ri||this.C===a)this.Hb=!1,Z(this,olympe.H.pa.C.hg)}$d(a){const b=olympe.X.ec();
|
|
816
|
+
this.Ok.set(b,a);olympe.D.$a(this.R)===olympe.D.sa.F&&a()}mj(a){var b;void 0===b&&(b=olympe.X.ec());this.ph.set(b,a);olympe.D.$a(this.R)===olympe.D.sa.C&&a(this.L[2])}bc(){this.N.debug('Websocket connected, sending handshake. Client version:',Ma(this.da),'subscribeEverything:',this.zc?'NO':'YES');this.W(olympe.H.Uc.Ci,{c:olympe.H.ia.Ci,cv:Ma(this.da),m:this.zc?0:1,s:this.$},this.ky.bind(this))}W(a,b,c){const d=this.Qk;this.Qk++;b={message:{seqId:d,messageFamily:a,payload:b},Xh:c?Oi(this,c):null,qn:null};
|
|
817
|
+
this.G.set(d,b);c=[olympe.H.pa.C.CONNECTING,olympe.H.pa.C.Xg];(this.Ab()||a===olympe.H.Uc.Ci&&c.includes(this.C))&&Pi(this,d,b)}Hc(a,b,c,d,e,f){c&&''!==c||this.N.warn('Trying to send an http request with an invalid authorizationToken');const g=Pb(a);if(e){g.method=olympe.net.eb.Yd.Xl;e=d?e:{messageFamily:b,seqId:1,payload:e};const k=JSON.stringify(e);g.body=k;Qb(g,{'Content-Type':'application/json'});this.N.log('HTTP POST >',Qi(e))}else this.N.log('HTTP GET call to',a);g.F=olympe.net.eb.ResponseType.sk;
|
|
818
|
+
Qb(g,{Authorization:c});const h=()=>{this.jb.C(g,k=>{switch(k.Od()){case olympe.net.eb.cd.Hh:case olympe.net.eb.cd.kl:case olympe.net.eb.cd.xj:k=k.getData();if(b!==olympe.H.Uc.si||d){f&&f(null,k);break}k=this.Xc(k);f&&f(k);k&&this.N.error(k.message);break;case olympe.net.eb.cd.Nu:Jb(h,this.uy);break;case olympe.net.eb.cd.us:this.N.debug(`HTTP request canceled (${a}).`);f&&f(null);break;case olympe.net.eb.cd.gv:k=Error(`HTTP request authorization denied: ${a}`);f&&f(k);break;default:k=Error(`Server is currently not available, http status: ${k.Od()}`),
|
|
819
|
+
f&&f(k)}})};h()}ta(a,b,c){void 0===c&&(c=olympe.X.ec());let d=this.Ka.get(a);void 0===d&&(d=new Map,this.Ka.set(a,d));d.set(c,b)}od(a,b){a=this.Ka.get(a);void 0!==a&&a.delete(b)}Kd(a){this.Ur=a}ky(a,b){if(a)Ri(this,'Error in receiving handshake response: '+a.message);else{this.N.debug('Handshake response received');var c=olympe.H.pa.G;a=b.sv||'undefined';var d=b.activityTimeout?Math.max(b.activityTimeout-60,5):null;switch(b.status){case c.qt:Ri(this,`Framework version (${Ma(this.da)}) provided to the orchestrator was not valid. See orchestrator logs for more info.`);
|
|
820
|
+
return;case c.$u:Ri(this,`Framework version (${Ma(this.da)}) is not compatible with the orchestrator in use. See orchestrator logs for more info.`);return;case c.ct:Ri(this,'Handshake failed. See orchestrator logs for more info.');return}if(this.Wa.nb(olympe.X.Th.C))this.N.warn('Handshake successful but received server version',a,'is invalid. Cannot check against it');else try{var e=La(a);if(e.uj(this.Wa)){Ri(this,`Framework v${Ma(this.da)} is expecting Orchestrator to be at least in v${Ma(this.Wa)}`);
|
|
821
|
+
return}this.N.log('Handshake successful. Orchestrator version: ',e,'required:',Ma(this.Wa))}catch(f){Ri(this,f);return}e=olympe.H.pa.C.hg;if(this.C===olympe.H.pa.C.Xg&&null!==this.$&&this.$!==b.sessionId)this.N.warn('Trying to do a session recovering, but got another session id so retry from disconnected state'),Z(this,e);else{if(e=b.identityProviders)for(const [f,g]of Object.entries(e))this.fe.set(f,g);this.$=b.sessionId||null;Si(this,a,d)}}}vd(){return new Map(this.fe)}Xx(){this.L[0]-this.L[1]>
|
|
822
|
+
this.qy?(this.N.debug('Ping did not get answer, try to reconnect'),Z(this,olympe.H.pa.C.Xg)):(this.N.trace('Sending Ping'),this.L[0]=Date.now(),this.F.send('ping')||(this.N.debug('Impossible to send ping, try to reconnect'),Z(this,olympe.H.pa.C.Xg)))}Xc(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.N.error('Unable to parse response from server: '+d.toString()),Error('Unable to parse response from server')}this.N.G()&&this.N.debug('<',
|
|
823
|
+
Qi(b));a=b.seqId;const c=b.messageFamily;b=b.payload;if(this.G.has(a)){const {Xh:d}=this.G.get(a);this.G.delete(a);d&&d(b)}a=this.Ka.get(c);if(void 0!==a)for(const d of a.values())d(b);return null}be(){const a=Date.now();for(const [b,{qn:c}]of this.G)null!==c&&a-c>this.We&&(this.N.warn(`No response was received from the server for the seqId = ${b}`),Ni(this,b,{error:{reason:'Message timeout: never receive acknowledge'}}))}};olympe.H.pa.L={Qi:0,fu:18,pA:23};
|
|
824
824
|
olympe.H.pa.F={0:'OK',1:'SRP Authentication First Step Failed',2:'SRP Authentication Last Step Failed',3:'SRP Authentication Bad Credentials',4:'AutoLogin Authentication Failed',5:'AutoLogin Authentication Token Invalid',6:'Logout Failed',7:'SAML Request Generation Failed',8:'SAML Authentication Save Failed',9:'Invalid SAML Response',10:'SAML User Not Found',11:'Transaction Failed',12:'GetContext Failed',13:'Notification Failed',15:'FileService Clean Failed',17:'Try to subscribe multiple times',18:'Try to unsubscribe multiple times',
|
|
825
|
-
21:'GraphDef Query Failed',22:'Client Request Invalid',23:'Internal Server Error',24:'File Retrieval Error',25:'File Does Not Exists',26:'Restore Failed',27:'Permission Error',14:'Handshake Failed',28:'Client Version Too Old',29:'Client Version Invalid Format',34:'Server overloaded, retry later',35:'Add token error',36:'Keep token alive error',37:'Unknown client message',39:'Fetch data while concurrency transaction'};olympe.H.pd.pa.ma=[olympe.H.pa];olympe.H.P={Aa:'server.Manager',
|
|
826
|
-
|
|
827
|
-
olympe.H.Config={hd:'server.host',sd:'server.port',ld:'server.ssl',
|
|
828
|
-
olympe.H.
|
|
829
|
-
olympe.U.config(function(a){var b='object'===typeof window&&window.location&&window.location.hostname||'localhost';const c='localhost'===b;D(a,olympe.H.Config.hd,b);D(a,olympe.H.Config.sd,c?8080:443);D(a,olympe.H.Config.ld,'localhost'!==b);D(a,olympe.H.
|
|
830
|
-
'rest/querysvc/graphDefImplicit');D(a,olympe.H.
|
|
831
|
-
'');D(a,olympe.H.Config.
|
|
832
|
-
[new olympe.U.fa(olympe.H.Config.hd),new olympe.U.fa(olympe.H.Config.sd),new olympe.U.fa(olympe.H.Config.ld),new olympe.U.fa(olympe.H.
|
|
833
|
-
'/').replace(/\/$/,'');return new olympe.net.
|
|
834
|
-
new olympe.U.fa(olympe.H.
|
|
835
|
-
new olympe.U.fa(olympe.H.Config.ld),new olympe.U.fa(olympe.H.
|
|
836
|
-
[new olympe.U.fa(olympe.H.Config.hd),new olympe.U.fa(olympe.H.Config.sd),new olympe.U.fa(olympe.H.Config.ld),new olympe.U.fa(olympe.H.
|
|
837
|
-
new olympe.U.fa(olympe.H.
|
|
838
|
-
new olympe.U.fa(olympe.net.Config.
|
|
839
|
-
f=new Map;d.forEach((g,h)=>f.set(e[h],g));return f});C(a,'server.bus.ManagerConfig',[new olympe.U.fa(olympe.H.Config.hd),new olympe.U.fa(olympe.H.Config.
|
|
840
|
-
new olympe.U.fa(olympe.H.Config.
|
|
841
|
-
p);d.set('allowGuest',n);return d});A(a,olympe.H.P.Aa,olympe.H.pd.pa,olympe.H.P.Ea,olympe.net.P.Aa,'server.WebSocketRequest','server.wakeUpRequest','server.ManagerConfig');A(a,olympe.H.qd.
|
|
842
|
-
olympe.H.qd.
|
|
843
|
-
sa(a,olympe.dc.ea.P.zh,olympe.H.P.zh);sa(a,olympe.ab.P.
|
|
844
|
-
olympe.U.config(a=>{D(a,olympe.sc.Config.ef,'');D(a,olympe.sc.Config.
|
|
845
|
-
b);return new olympe.sc.Qa(c)})},'olympe.sc');olympe.U.run([olympe.sc.P.
|
|
846
|
-
olympe.sc.
|
|
847
|
-
}g.push(d);h.push(a.fc(g[0],b))}h=h.concat(a.Pf(h[0],olympe.dm.Pb.Ka));h=h.concat(a.Pf(h[h.length-1],olympe.dm.Vc.da.Ec()));h=h.concat(a.Pf(h[h.length-1],olympe.dm.Vc.$.Ec()));return[...f,...g,...h].reverse()};olympe.sc.
|
|
848
|
-
olympe.sc.Qa=class{constructor(a=olympe.sc.
|
|
849
|
-
b.model(e.He());if(f&&b.cb(f,olympe.sc.
|
|
850
|
-
this.$a(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,d.next.bind(d),c?void 0:this.C.Z(),!1);this.onDestroy(()=>{f();d.complete()});return f})}repeat(a,b){const c=
|
|
851
|
-
'')}`);a.run(b);return b}
|
|
852
|
-
|
|
853
|
-
olympe.sc.Qa.prototype.clear=olympe.sc.Qa.prototype.clear;olympe.sc.Qa.prototype.offDestroy=olympe.sc.Qa.prototype.Xe;olympe.sc.Qa.prototype.onDestroy=olympe.sc.Qa.prototype.onDestroy;olympe.sc.Qa.prototype.offClear=olympe.sc.Qa.prototype.
|
|
854
|
-
olympe.sc.Qa.prototype.createChild=olympe.sc.Qa.prototype.
|
|
855
|
-
olympe.sc.Qa.prototype.trigger=olympe.sc.Qa.prototype.
|
|
856
|
-
function
|
|
857
|
-
function
|
|
858
|
-
function
|
|
859
|
-
function
|
|
860
|
-
function
|
|
861
|
-
function
|
|
862
|
-
olympe.sc.Sd=class{constructor(a,b='no name',c=olympe.sc.
|
|
863
|
-
e.get('IO#'+c))||c;d='$'+a;(e=this.data.get(d))&&e.valueOf&&(e=e.valueOf());void 0===b||null===b?void 0!==e&&(this.data.delete(d),null!==this.zb&&0<this.zb.size&&
|
|
864
|
-
'*';a=
|
|
865
|
-
()=>{};const d=
|
|
866
|
-
this.C.Xe(a)}clear(){if(!this.C.$()&&!this.C.G()){let a;null==(a=this.$)||a.forEach(b=>b());this.C.Ka()}}G(){return this.C.G()}};olympe.sc.Sd.prototype.getParent=olympe.sc.Sd.prototype.getParent;olympe.sc.Sd.C=0;olympe.sc.Sd.F={
|
|
867
|
-
t])})};b.
|
|
868
|
-
c);this.R.listen().subscribe(e=>{var f=e.body();if(f.t===olympe.sc.Vd.C.
|
|
869
|
-
[],f=olympe.dc.Ja(),g=(h,k)=>{
|
|
870
|
-
void 0===b)return'<null>';const c=olympe.dc.Ja();if(b instanceof olympe.dc.CloudObject){var d=b.Nb();if(!c.Rf(d,olympe.sc.ff))return b.toString();let f=`${b.Mf().name()} (${b.T()})`;var e=olympe.dc.CloudObject.get(d);d=olympe.dc.gb.from(e).
|
|
871
|
-
f+='Properties:<br>',d.forEach(([,g])=>{f+=' ';f+=' - '+c.name(g)+' : '+c.cb(b.T(),g)+'<br>'}));d=e.filter(([g])=>g instanceof olympe.sc.ff);0!==d.length&&(f+=' ',f+='Relations:<br>',d.forEach(([,g])=>{f+=' ';f+=' - '+c.name(g)+'<br>'}));return f}return b.toString()}};olympe.sc.Vd.L='discovery_debug_id';olympe.sc.Vd.C={
|
|
872
|
-
e,f)});this.C.set(e,()=>{
|
|
873
|
-
olympe.sc.X.
|
|
874
|
-
l=olympe.net.eb.Headers.
|
|
875
|
-
h,'Internal server error')))});this.F.onDestroy(()=>{this.G.W(n).catch(p=>this.N.error(`An error occurred while stopping the file service: ${p}`))});return b}stop(){this.F.destroy()}};olympe.sc.Je={};olympe.sc.Je.sg={
|
|
876
|
-
olympe.sc.
|
|
877
|
-
olympe.sc.logic.Rb)}};olympe.sc.
|
|
878
|
-
olympe.sc.
|
|
879
|
-
function
|
|
880
|
-
function
|
|
881
|
-
function
|
|
882
|
-
olympe.sc.Runnable=class extends olympe.dm.BrickMetadata{constructor(a,b,c){super(a,b);this.N=c}run(a){const b=()=>{
|
|
883
|
-
|
|
884
|
-
b,c,d){a=b.Ib(a,c,!0);void 0!==d&&olympe.D.bf(a,d);return a}Ab(a,b,c,d,e){olympe.D.
|
|
885
|
-
let f=a.getParent();for(;null!==f&&f.C!==olympe.sc.
|
|
886
|
-
olympe.sc.Runnable.F=olympe.sc.Runnable.O.Ga('01756a18d4921c103111');olympe.sc.Runnable.R=P(olympe.sc.Runnable.O,olympe.sc.
|
|
887
|
-
P(olympe.dc.CloudObject.O,olympe.sc.De.C);olympe.sc.De.prototype.F.K=new olympe.D.J(()=>String,[]);olympe.sc.De.prototype.C.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.sc.
|
|
888
|
-
function
|
|
889
|
-
b(olympe.sc.gd.C.
|
|
890
|
-
olympe.sc.rd.prototype.W.K=olympe.D.J.G;olympe.sc.
|
|
891
|
-
olympe.sc.logic.
|
|
892
|
-
return}let n;if('<'===f)n=(p,q)=>olympe.sc.logic.
|
|
893
|
-
olympe.sc.logic.
|
|
894
|
-
olympe.sc.logic.ya=class{constructor(){}static C(a,b,...c){if(
|
|
895
|
-
olympe.sc.logic.
|
|
896
|
-
this.db.
|
|
897
|
-
m.ce.K=new olympe.D.J(()=>olympe.sc.logic.Cb,[]);m.Jf.K=new olympe.D.J(()=>olympe.sc.logic.Rb,[]);m.
|
|
898
|
-
olympe.sc.logic.bg.prototype.F.K=new olympe.D.J(()=>olympe.sc.logic.Cb,[]);olympe.sc.logic.bg.prototype.G.K=new olympe.D.J(()=>olympe.sc.logic.Rb,[]);olympe.sc.logic.bg.prototype.L.K=olympe.D.J.R;olympe.sc.logic.
|
|
825
|
+
21:'GraphDef Query Failed',22:'Client Request Invalid',23:'Internal Server Error',24:'File Retrieval Error',25:'File Does Not Exists',26:'Restore Failed',27:'Permission Error',14:'Handshake Failed',28:'Client Version Too Old',29:'Client Version Invalid Format',34:'Server overloaded, retry later',35:'Add token error',36:'Keep token alive error',37:'Unknown client message',39:'Fetch data while concurrency transaction'};olympe.H.pd.pa.ma=[olympe.H.pa];olympe.H.P={Aa:'server.Manager',On:'server.bus.Manager',Ea:'server.Logger',Gd:'server.Source',Qg:'server.FileSource',jp:'server.ImportFileSvcHttpRequest',Jn:'server.BackupSvcHttpRequest',Wp:'server.OpenIDSvcHttpRequest',No:'server.GetContextSvcPathRequest',gp:'server.ImplicitGDSvcPathRequest',zo:'server.ExplicitGDSvcPathRequest',Vq:'server.TransactionOverHttpPathRequest',cr:'server.UserTokenRequest',ar:'server.UserTagRequest',Zq:'server.UserRolesRequest',wq:'server.RoleMembersRequest',zh:'server.IOUrlsProvider',
|
|
826
|
+
Fo:'server.fileSvcUrl',aq:'communication.peerFileSvcUrl'};olympe.H.qd={ki:'server.connectors.Auth',WA:'server.connectors.Signaling'};
|
|
827
|
+
olympe.H.Config={hd:'server.host',sd:'server.port',ld:'server.ssl',An:'server.autoConnect',fm:'server.reconnectionDelay',fq:'server.pingInterval',sm:'server.messageTimeout',uq:'server.retryHttpOnOverload',Wn:'server.clientVersion',Cq:'server.serverVersion',Ou:'server.wakeUpService',Nn:'bus.host',Pn:'bus.path',Qn:'bus.port',Sn:'bus.vhost',Rn:'bus.ssl',lg:'bus.keepalive',Hu:'bus.reschedulePings',ys:'bus.clientId',ws:'bus.clean',Bs:'bus.connectTimeout',Sq:'bus.tokenTimeout',Au:'bus.queueQoSZero',Mn:'bus.allowGuest'};
|
|
828
|
+
olympe.H.qb={Ad:'server.basePath',hr:'server.wsPath',Do:'server.filePath',ip:'server.importFilePath',In:'server.backupSvcPath',Vp:'server.openIDSvcPath',Mo:'server.GetContextSvcPath',hp:'server.ImplicitGraphdefSvcPath',Ao:'server.ExplicitGraphdefSvcPath',Uq:'server.TransactionOverHttpPath',br:'server.userTokenSvcPath',$q:'server.userTagPath',Yq:'server.userRolesPath',vq:'server.roleMembersPath',Wl:'communication.peerFileSvcPath'};
|
|
829
|
+
olympe.U.config(function(a){var b='object'===typeof window&&window.location&&window.location.hostname||'localhost';const c='localhost'===b;D(a,olympe.H.Config.hd,b);D(a,olympe.H.Config.sd,c?8080:443);D(a,olympe.H.Config.ld,'localhost'!==b);D(a,olympe.H.qb.Ad,'OlympeServer');D(a,olympe.H.qb.hr,'websocket');D(a,olympe.H.qb.Do,'rest/filesvc');D(a,olympe.H.qb.ip,'rest/importsvc');D(a,olympe.H.qb.In,'rest/backupsvc');D(a,olympe.H.qb.Vp,'rest/openid');D(a,olympe.H.qb.Mo,'rest/initialData');D(a,olympe.H.qb.hp,
|
|
830
|
+
'rest/querysvc/graphDefImplicit');D(a,olympe.H.qb.Ao,'rest/querysvc/graphDefExplicit');D(a,olympe.H.qb.Uq,'rest/transaction');D(a,olympe.H.qb.br,'rest/token');D(a,olympe.H.qb.$q,'rest/authorization/getUserTag');D(a,olympe.H.qb.Yq,'rest/authorization/getUserRoles');D(a,olympe.H.qb.vq,'rest/authorization/roleMembers');D(a,olympe.H.Config.An,!0);D(a,olympe.H.Config.fm,5E3);D(a,olympe.H.Config.fq,5E3);D(a,olympe.H.Config.sm,15E3);D(a,olympe.H.Config.uq,5E3);D(a,olympe.H.Config.Cq,'6.5.0');D(a,olympe.H.Config.Nn,
|
|
831
|
+
'');D(a,olympe.H.Config.Pn,c?'':'/mqtt');D(a,olympe.H.Config.Qn,c?15675:443);D(a,olympe.H.Config.Rn,null);D(a,olympe.H.Config.Sn,c?'/':'');D(a,olympe.H.Config.lg,30);D(a,olympe.H.Config.Sq,3E5);D(a,olympe.H.Config.Mn,!1);D(a,olympe.H.qb.Wl,'nodes/files');b=a.getParameter(olympe.Fg.Config.Jo);if(void 0!==b)ua(a,b);else throw Error('Framework version could not be found! Is field "olympe-framework" present in version.json?');C(a,olympe.H.P.Ea,[olympe.ra.P.Aa],d=>d.Nc('communication'));C(a,'server.WebSocketRequest',
|
|
832
|
+
[new olympe.U.fa(olympe.H.Config.hd),new olympe.U.fa(olympe.H.Config.sd),new olympe.U.fa(olympe.H.Config.ld),new olympe.U.fa(olympe.H.qb.Ad),new olympe.U.fa(olympe.H.qb.hr)],(d,e,f,g,h)=>new olympe.net.Si(d,e,(g+'/'+h).replace(/\/+/g,'/').replace(/\/$/,''),f));C(a,'server.wakeUpRequest',[new olympe.U.fa(olympe.H.Config.hd),new olympe.U.fa(olympe.H.Config.sd),new olympe.U.fa(olympe.H.Config.ld),new olympe.U.fa(olympe.H.Config.Ou)],(d,e,f,g)=>{if(null===g||void 0===g)return null;g=g.replace(/\/+/g,
|
|
833
|
+
'/').replace(/\/$/,'');return new olympe.net.Si(d,e,g,f)});b=(d,e,f,g,h)=>(new olympe.net.Sj(d,e,`${g}${h?'/'+h:''}`.replace(/\/+/g,'/').replace(/\/$/,''),f)).C();C(a,olympe.H.P.jp,[new olympe.U.fa(olympe.H.Config.hd),new olympe.U.fa(olympe.H.Config.sd),new olympe.U.fa(olympe.H.Config.ld),new olympe.U.fa(olympe.H.qb.Ad),new olympe.U.fa(olympe.H.qb.ip)],b);C(a,olympe.H.P.Jn,[new olympe.U.fa(olympe.H.Config.hd),new olympe.U.fa(olympe.H.Config.sd),new olympe.U.fa(olympe.H.Config.ld),new olympe.U.fa(olympe.H.qb.Ad),
|
|
834
|
+
new olympe.U.fa(olympe.H.qb.In)],b);C(a,olympe.H.P.Wp,[new olympe.U.fa(olympe.H.Config.hd),new olympe.U.fa(olympe.H.Config.sd),new olympe.U.fa(olympe.H.Config.ld),new olympe.U.fa(olympe.H.qb.Ad),new olympe.U.fa(olympe.H.qb.Vp)],b);C(a,olympe.H.P.No,[new olympe.U.fa(olympe.H.Config.hd),new olympe.U.fa(olympe.H.Config.sd),new olympe.U.fa(olympe.H.Config.ld),new olympe.U.fa(olympe.H.qb.Ad),new olympe.U.fa(olympe.H.qb.Mo)],b);C(a,olympe.H.P.gp,[new olympe.U.fa(olympe.H.Config.hd),new olympe.U.fa(olympe.H.Config.sd),
|
|
835
|
+
new olympe.U.fa(olympe.H.Config.ld),new olympe.U.fa(olympe.H.qb.Ad),new olympe.U.fa(olympe.H.qb.hp)],b);C(a,olympe.H.P.zo,[new olympe.U.fa(olympe.H.Config.hd),new olympe.U.fa(olympe.H.Config.sd),new olympe.U.fa(olympe.H.Config.ld),new olympe.U.fa(olympe.H.qb.Ad),new olympe.U.fa(olympe.H.qb.Ao)],b);C(a,olympe.H.P.Vq,[new olympe.U.fa(olympe.H.Config.hd),new olympe.U.fa(olympe.H.Config.sd),new olympe.U.fa(olympe.H.Config.ld),new olympe.U.fa(olympe.H.qb.Ad),new olympe.U.fa(olympe.H.qb.Uq)],b);C(a,olympe.H.P.cr,
|
|
836
|
+
[new olympe.U.fa(olympe.H.Config.hd),new olympe.U.fa(olympe.H.Config.sd),new olympe.U.fa(olympe.H.Config.ld),new olympe.U.fa(olympe.H.qb.Ad),new olympe.U.fa(olympe.H.qb.br)],b);C(a,olympe.H.P.ar,[new olympe.U.fa(olympe.H.Config.hd),new olympe.U.fa(olympe.H.Config.sd),new olympe.U.fa(olympe.H.Config.ld),new olympe.U.fa(olympe.H.qb.Ad),new olympe.U.fa(olympe.H.qb.$q)],b);C(a,olympe.H.P.Zq,[new olympe.U.fa(olympe.H.Config.hd),new olympe.U.fa(olympe.H.Config.sd),new olympe.U.fa(olympe.H.Config.ld),new olympe.U.fa(olympe.H.qb.Ad),
|
|
837
|
+
new olympe.U.fa(olympe.H.qb.Yq)],b);C(a,olympe.H.P.wq,[new olympe.U.fa(olympe.H.Config.hd),new olympe.U.fa(olympe.H.Config.sd),new olympe.U.fa(olympe.H.Config.ld),new olympe.U.fa(olympe.H.qb.Ad),new olympe.U.fa(olympe.H.qb.vq)],b);C(a,olympe.H.P.Fo,[new olympe.U.fa(olympe.H.Config.hd),new olympe.U.fa(olympe.H.Config.sd),new olympe.U.fa(olympe.H.Config.ld),new olympe.U.fa(olympe.H.qb.Ad),new olympe.U.fa(olympe.H.qb.Do)],b);C(a,olympe.H.P.aq,[new olympe.U.fa(olympe.net.Config.yl),new olympe.U.fa(olympe.net.Config.zl),
|
|
838
|
+
new olympe.U.fa(olympe.net.Config.bp),new olympe.U.fa(olympe.H.qb.Wl)],b);C(a,'server.ManagerConfig',[new olympe.U.fa(olympe.H.Config.An),new olympe.U.fa(olympe.H.Config.fm),new olympe.U.fa(olympe.H.Config.fq),new olympe.U.fa(olympe.H.Config.sm),new olympe.U.fa(olympe.H.Config.Wn),new olympe.U.fa(olympe.H.Config.Cq),new olympe.U.fa(olympe.dc.Config.Zg),new olympe.U.fa(olympe.H.Config.uq)],(...d)=>{const e='autoConnect reconnectionDelay pingInterval messageTimeout clientVersion serverVersion getContextMode retryHttpOverload'.split(' '),
|
|
839
|
+
f=new Map;d.forEach((g,h)=>f.set(e[h],g));return f});C(a,'server.bus.ManagerConfig',[new olympe.U.fa(olympe.H.Config.hd),new olympe.U.fa(olympe.H.Config.Nn),new olympe.U.fa(olympe.H.Config.Pn),new olympe.U.fa(olympe.H.Config.Qn),new olympe.U.fa(olympe.H.Config.Sn),new olympe.U.fa(olympe.H.Config.Rn),new olympe.U.fa(olympe.H.Config.ld),new olympe.U.fa(olympe.H.Config.Mn),new olympe.U.fa(olympe.H.Config.lg),new olympe.U.fa(olympe.H.Config.Hu),new olympe.U.fa(olympe.H.Config.ys),new olympe.U.fa(olympe.H.Config.ws),
|
|
840
|
+
new olympe.U.fa(olympe.H.Config.fm),new olympe.U.fa(olympe.H.Config.Bs),new olympe.U.fa(olympe.H.Config.Au),new olympe.U.fa(olympe.H.Config.sm),new olympe.U.fa(olympe.H.Config.Sq)],(d,e,f,g,h,k,l,n,...p)=>{e=`${(null!=k?k:l)?'wss://':'ws://'}${e||d}:${g}${f}/ws`;const q='keepalive reschedulePings clientId clean reconnectPeriod connectTimeout queueQoSZero messageTimeout tokenTimeout'.split(' ');p=p.reduce((r,t,u)=>{r[q[u]]=t;return r},{});p.vhost=`${h||d.split('.')[0]}`;d=new Map;d.set('url',e);d.set('connectionOptions',
|
|
841
|
+
p);d.set('allowGuest',n);return d});A(a,olympe.H.P.Aa,olympe.H.pd.pa,olympe.H.P.Ea,olympe.net.P.Aa,'server.WebSocketRequest','server.wakeUpRequest','server.ManagerConfig');A(a,olympe.H.qd.ki,olympe.H.qa.Ta,olympe.H.P.Ea,olympe.H.P.Aa,olympe.H.P.cr,olympe.H.P.ar,olympe.H.P.Zq,olympe.H.P.wq,olympe.H.P.Wp,olympe.auth.P.hk,olympe.hc.P.Xj);A(a,olympe.H.P.On,olympe.H.wa.pa,olympe.H.P.Ea,olympe.net.P.Aa,olympe.auth.P.Aa,'server.bus.ManagerConfig');sa(a,olympe.auth.qd.Aa,olympe.H.qd.ki);sa(a,olympe.auth.qd.Ap,
|
|
842
|
+
olympe.H.qd.ki);sa(a,olympe.auth.qd.Fe,olympe.H.qd.ki);sa(a,olympe.auth.qd.Ne,olympe.H.qd.ki);A(a,olympe.H.P.Qg,olympe.H.Nj,olympe.H.P.Ea,olympe.net.P.Aa,olympe.auth.P.Aa,olympe.H.P.Fo,olympe.H.P.aq);sa(a,olympe.ab.P.Qg,olympe.H.P.Qg);C(a,olympe.H.P.Gd,[olympe.ra.P.Aa,olympe.H.P.Aa,olympe.auth.P.Aa,olympe.ab.P.Qg,olympe.H.P.No,olympe.H.P.gp,olympe.H.P.zo,olympe.H.P.Vq],(d,e,f,g,h,k,l,n)=>new olympe.H.ah(d.Nc('server.source'),e,f,g,[h,k,l,n]));A(a,olympe.H.P.zh,olympe.H.Tj,olympe.H.P.jp,olympe.H.P.Jn);
|
|
843
|
+
sa(a,olympe.dc.ea.P.zh,olympe.H.P.zh);sa(a,olympe.ab.P.jm,olympe.H.P.Gd)},'olympe.communication');olympe.U.run([olympe.H.P.On],a=>{olympe.H.wa.Pc=()=>a});olympe.sc={};olympe.sc.P={Ea:'sc.Logger',hm:'sc.RootContext'};olympe.sc.Config={ef:'sc.app',eg:'sc.debug',lo:'sc.debugger',Ls:'sc.disableTheme',PRODUCTION:'sc.production',ku:'sc.onstartTimeout',tq:'sc.remoteActionTimeout',Tp:'sc.offlineStart',cu:'google.apikey'};
|
|
844
|
+
olympe.U.config(a=>{D(a,olympe.sc.Config.ef,'');D(a,olympe.sc.Config.Tp,!1);D(a,olympe.sc.Config.eg,!1);D(a,olympe.sc.Config.Ls,!1);D(a,olympe.sc.Config.PRODUCTION,!1);D(a,olympe.sc.Config.ku,2E4);D(a,olympe.sc.Config.cu,'AIzaSyD0rTnF3Tq-ZjgdaqyvC8Jg-RSgpZM2jBU');D(a,olympe.sc.Config.tq,1E4);C(a,olympe.sc.P.Ea,[olympe.ra.P.Aa],b=>b.Nc('sc'));C(a,olympe.sc.P.hm,[new olympe.U.fa(olympe.sc.Config.PRODUCTION)],b=>{const c=new olympe.sc.Sd('root','root',null);olympe.sc.mn=c;c.set(olympe.sc.Qa.C.PRODUCTION,
|
|
845
|
+
b);return new olympe.sc.Qa(c)})},'olympe.sc');olympe.U.run([olympe.sc.P.hm],a=>{olympe.ej().ctx=a});olympe.sc.$m=()=>null!==olympe.dc.Ja().fc(void 0,olympe.sc.Runnable.F.Ec());olympe.sc.QC=(a,b,c,d)=>{c=a.create(olympe.sc.mc).setProperty(olympe.sc.mc.C,c||null).setProperty(olympe.sc.mc.L,d||null);a.Va(olympe.sc.mc.F,c,b);a.Va(olympe.dc.CloudObject.containsRel,b,c);return c.T()};olympe.sc.fh=a=>{a=olympe.dc.X.Tb.fh(a);return a instanceof olympe.sc.De?a.C():a};olympe.sc.eD=a=>{a=Fc(a);return a instanceof olympe.sc.De?a.C():a};
|
|
846
|
+
olympe.sc.bD=function(a){const b=olympe.dm.Pb.C.Ec(),c=olympe.dc.CloudObject.containsRel.Ec();var d=olympe.dc.za(a);if(void 0===d)return[];a=olympe.dc.Ja();var e=a.model(d);const f=[],g=[];let h=[];if(a.Tf(e,olympe.dm.Pb))h.push(d);else{for(e=[];null===a.fc(d,b);){e.push(d);const k=a.fc(d,c);if(null===k)return olympe.ra.Ya('sc').warn(`Object ${d} has no container`),[];k===a.fc(d,olympe.dc.CloudObject.instancesRel)?(f.push(d),d=a.fc(k,c)):d=k;if(e.includes(d))throw Error(`Instance ${d} (${a.name(d)}) is part of a cyclic contain pattern`);
|
|
847
|
+
}g.push(d);h.push(a.fc(g[0],b))}h=h.concat(a.Pf(h[0],olympe.dm.Pb.Ka));h=h.concat(a.Pf(h[h.length-1],olympe.dm.Vc.da.Ec()));h=h.concat(a.Pf(h[h.length-1],olympe.dm.Vc.$.Ec()));return[...f,...g,...h].reverse()};olympe.sc.cD=a=>{a=a&&a.valueOf()||'';return a.startsWith('image/')?olympe.sc.Uj:a.startsWith('video/')?olympe.sc.rm:a.startsWith('font/')||a.startsWith('application/font-woff')?olympe.sc.rd:olympe.dm.File};olympe.sc.zb={};function Ti(a,b){var c=olympe.sc.Qa;a=a.C;b=olympe.dc.za(b);var d;let e=null==(d=a.F)?void 0:d.get(b);if(!e){e=a.Zh(void 0,b);for(d=e.getParent();d&&d.Ka&&!d.id.startsWith('_');)d=d.getParent();d&&Ui(d,b,e)}return new c(e)}function Vi(a){let b;return null!=(b=a.$a(olympe.sc.Qa.C.PRODUCTION))?b:!1}
|
|
848
|
+
olympe.sc.Qa=class{constructor(a=olympe.sc.mn){this.C=a;this.N=olympe.ra.Ya('sc');this.F=null;this.onDestroy(()=>{null!==this.get(olympe.sc.Qa.C.TRANSACTION)&&this.N.warn(`The context ${this.C.Z()} is being destroyed but still has unreleased transactions. You probably forgot to end a transaction.`)})}Z(){return this.C.Z()}getParent(){if(null===this.F){const a=this.C.getParent();this.F=null===a?null:new olympe.sc.Qa(a)}return this.F}lw(a){const b=olympe.dc.Ja();let c=this.getParent();const d=e=>{if(e.He()){const f=
|
|
849
|
+
b.model(e.He());if(f&&b.cb(f,olympe.sc.mb.Ka)||a.modelTag&&!b.Rf(e.He(),a.modelTag))return!1}return!0};for(;c&&!d(c);)c=c.getParent();return c}He(){return this.C.He()}Sa(){return this.C.C}set(a,b){this.C.set(a,b);return this}wn(a){return this.set(a,Date.now())}remove(a){this.set(a,null)}Ib(a,b,c=!1){const d=olympe.dc.za(a),e=olympe.D.Qc(b||Object,`Get context value flow source of ${d}`);e.node.onDestroy(this.on(a,f=>{null===f?e.clear():e.update(f)},c?this.C.Z():void 0));return e.Ib()}get(a,b=!1){a=
|
|
850
|
+
this.$a(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,d.next.bind(d),c?void 0:this.C.Z(),!1);this.onDestroy(()=>{f();d.complete()});return f})}repeat(a,b){const c=Wi(this.C,a);a=b.subscribe(d=>{null!==d?this.set(c,d):this.remove(c)});this.Xf(a.unsubscribe.bind(a));return this}ty(a){a=a instanceof olympe.sc.Runnable?a:this.get(a);if(!a)return null;const b=this.Zh(`Runner ${olympe.D.$a(a.na(),
|
|
851
|
+
'')}`);a.run(b);return b}Uy(a,b=!0,c=!1){return rxjs.firstValueFrom(this.observe(a,b,c))}Cy(a){this.set(olympe.sc.Qa.C.dg,a);return this}$a(a,b=!0){return this.C.$a(a,b)}on(a,b,c,d=!0){return this.C.on(a,b,c,d)}Zh(a){return new olympe.sc.Qa(this.C.Zh(a))}Uk(a,b){return this.C.Uk(a,c=>{b(new olympe.sc.Qa(c))})}Rw(a){a=Xi(this.C,a);return a===this.C?this:a&&new olympe.sc.Qa(a)}destroy(){this.C.destroy()}Xf(a,b){return this.C.Xf(a,b)}Tk(a){this.C.Tk(a)}onDestroy(a){return this.C.onDestroy(a)}Xe(a){this.C.Xe(a)}clear(){this.C.clear()}G(){return this.C.G()}cb(a){a=
|
|
852
|
+
Yi(this.C,a);return null!==a?new olympe.sc.ui.nz(a,this):null}zw(a){a=Yi(this.C,a);return null!==a?new olympe.sc.ui.mz(a,this):null}$x(...a){return rxjs.combineLatest(a.map(b=>{b=Yi(this.C,b);return null!==b?this.observe(b):rxjs.of(null)}))}nb(a){return(null==a?void 0:a.constructor)!==this.constructor?!1:this.C===a.C}};olympe.sc.Qa.prototype.observeMany=olympe.sc.Qa.prototype.$x;olympe.sc.Qa.prototype.getEvent=olympe.sc.Qa.prototype.zw;olympe.sc.Qa.prototype.getProperty=olympe.sc.Qa.prototype.cb;
|
|
853
|
+
olympe.sc.Qa.prototype.clear=olympe.sc.Qa.prototype.clear;olympe.sc.Qa.prototype.offDestroy=olympe.sc.Qa.prototype.Xe;olympe.sc.Qa.prototype.onDestroy=olympe.sc.Qa.prototype.onDestroy;olympe.sc.Qa.prototype.offClear=olympe.sc.Qa.prototype.Tk;olympe.sc.Qa.prototype.onClear=olympe.sc.Qa.prototype.Xf;olympe.sc.Qa.prototype.destroy=olympe.sc.Qa.prototype.destroy;olympe.sc.Qa.prototype.getOtherContext=olympe.sc.Qa.prototype.Rw;olympe.sc.Qa.prototype.onContext=olympe.sc.Qa.prototype.Uk;
|
|
854
|
+
olympe.sc.Qa.prototype.createChild=olympe.sc.Qa.prototype.Zh;olympe.sc.Qa.prototype.setParentElement=olympe.sc.Qa.prototype.Cy;olympe.sc.Qa.prototype.waitFor=olympe.sc.Qa.prototype.Uy;olympe.sc.Qa.prototype.runner=olympe.sc.Qa.prototype.ty;olympe.sc.Qa.prototype.repeat=olympe.sc.Qa.prototype.repeat;olympe.sc.Qa.prototype.observe=olympe.sc.Qa.prototype.observe;olympe.sc.Qa.prototype.has=olympe.sc.Qa.prototype.has;olympe.sc.Qa.prototype.get=olympe.sc.Qa.prototype.get;olympe.sc.Qa.prototype.remove=olympe.sc.Qa.prototype.remove;
|
|
855
|
+
olympe.sc.Qa.prototype.trigger=olympe.sc.Qa.prototype.wn;olympe.sc.Qa.prototype.set=olympe.sc.Qa.prototype.set;olympe.sc.Qa.prototype.getClosest=olympe.sc.Qa.prototype.lw;olympe.sc.Qa.prototype.getParent=olympe.sc.Qa.prototype.getParent;olympe.sc.Qa.C={PRODUCTION:'__production',EDITION:'__editionMode',TRANSACTION:'__transaction',dg:'__htmlContainer',wz:'__dockableElement'};olympe.sc.er=class extends olympe.sc.Qa{Xf(a,b){const c=b||olympe.X.ec();return super.Xf(()=>{this.Tk(c);a()},c)}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,d.next.bind(d),c?void 0:this.Z(),!1);this.Xf(()=>{f();d.complete()});return f})}};function Wi(a,b){b=olympe.dc.za(b);let c,d;return(null==(c=a.ja)?void 0:c.get('I#'+b))||(null==(d=a.ja)?void 0:d.get('IO#'+b))||b}function Xi(a,b){if(b===a.id||a.W.has(b)||!b)return a;for(a=a.ta;a;){if(b===a.Z()||a.W.has(b))return a;const c=Zi(a.F,b);if(c)return c;a=a.getParent()}return null}function $i(a,b,c){a.L||(a.L=new Map);const d=a.L.get(b);d?d[0]+=1:(a.L.set(b,[1,c]),Xc(olympe.dc.xd(),c))}
|
|
856
|
+
function aj(a,b){if(a.L&&a.L.has(b)){var c=a.L.get(b);--c[0];0===c[0]&&(a.L.delete(b),0===a.L.size&&(a.L=null),Xc(olympe.dc.xd(),null,c[1]))}}function Yi(a,b){let c;return(null==(c=a.ja)?void 0:c.get('IO#'+b))||null}function bj(a){a.C.R(()=>{cj(a,c=>c.destroy())});a.C.onDestroy(()=>{let c;null==(c=a.L)||c.forEach(([e],f)=>{for(let g=0;g<e;g++)aj(a,f)});let d;null==(d=a.ta)||dj(d,a);a.W.clear();a.ta=null});let b;null==(b=a.ta)||ej(b,a)}
|
|
857
|
+
function Zi(a,b){if(null===a)return null;if(a.has(b))return a.get(b);for(const c of a.values())if(c.Ka&&!c.id.startsWith('_')&&(a=Zi(c.F,b)))return a;return null}function fj(a,b){a.Sa=olympe.dc.za(b);a.Ka=b.Md().$m();b.G().forEach(c=>{a.id===c||a.W.has(c)||(a.W.add(c),Ui(a,c,a))});a.ja=b.$()}function gj(a){a.Wa=!0;let b;null==(b=a.F)||b.forEach(c=>{gj(c)})}function hj(a){a.Wa=!1;let b;null==(b=a.F)||b.forEach(c=>{hj(c)})}
|
|
858
|
+
function ij(a,...b){var c=olympe.sc.zb.Pe.C.km;if(null!==a.zb)for(const {Wk:d,depth:e}of a.zb.values())d.process(a,c,e,...b)}function jj(a,b,c,d){const e='$'+b;a.da.add(b);c.map(f=>'@'+f+'.'+b).forEach(f=>{let g,h;null==(g=a.R)||null==(h=g.get(f))||h.forEach(k=>{k(d)})});cj(a,f=>{!f.Wa&&f.da.has(b)||f.data.has(e)||jj(f,b,c,d)});a.da.delete(b)}
|
|
859
|
+
function kj(a,b,c){a.R||(a.R=new Map);let d=a.R.get(b);void 0===d&&(d=new Map,a.R.set(b,d));olympe.sc.Sd.C+=1;const e=olympe.sc.Sd.C;d.set(e,c);return()=>{const f=a.R.get(b);f&&(f.delete(e),0===f.size&&a.R.delete(b))}}function Ui(a,b,c){a.da.add(b);let d;const e=null==(d=a.R)?void 0:d.get('&'+b);if(e)for(const f of e.values())f(c);cj(a,f=>{f.da.has(b)||Ui(f,b,c)});a.da.delete(b)}function cj(a,b){let c;null==(c=a.F)||c.forEach(b)}function lj(a,b){a.data.forEach((c,d)=>b(c,d.slice(1)))}
|
|
860
|
+
function mj(a,b){if(null!==a.zb&&a.zb.has(b)){var {Wk:c,depth:d}=a.zb.get(b);cj(a,e=>{mj(e,b)});0===d&&c.F();a.zb.delete(b);0===a.zb.size&&(a.zb=null)}}function nj(a,b,c=0){null===a.zb&&(a.zb=new Map);a.zb.has(b.Z())||(a.zb.set(b.Z(),{Wk:b,depth:c}),cj(a,d=>{(-1===b.G||c<b.G)&&nj(d,b,c+1)}),a.onDestroy(()=>{mj(a,b.Z())}));b.Z()}function oj(a){var b=olympe.sc.zb.Pe.F.sq;const c=[];if(null!==a.zb)for(const {Wk:d}of a.zb.values())d.L()===b&&(c.push(d.Z()),d.F(),mj(a,d.Z()))}
|
|
861
|
+
function ej(a,b){null===a.F&&(a.F=new Map);a.F.set(b.id,b)}function dj(a,b){let c;null==(c=a.F)||c.delete(b.Z());let d;0===(null==(d=a.F)?void 0:d.size)&&(a.F=null)}
|
|
862
|
+
olympe.sc.Sd=class{constructor(a,b='no name',c=olympe.sc.mn){this.id=a;this.wd=b;this.W=new Set;this.ta=c;this.C=new olympe.D.Zb('SC Context');this.data=new Map;this.Sa=this.$=this.L=this.F=this.R=null;this.Ka=!1;this.da=new Set;this.Wa=!1;this.ja=null;this.N=olympe.ra.Ya('sc');this.zb=null;bj(this)}Z(){return this.id}getParent(){return this.ta}He(){return this.Sa}set(a,b){if(!this.C.$()&&!this.C.G()){var c=olympe.dc.za(a),d,e;a=(null==(d=this.ja)?void 0:d.get('O#'+c))||(null==(e=this.ja)?void 0:
|
|
863
|
+
e.get('IO#'+c))||c;d='$'+a;(e=this.data.get(d))&&e.valueOf&&(e=e.valueOf());void 0===b||null===b?void 0!==e&&(this.data.delete(d),null!==this.zb&&0<this.zb.size&&ij(this,a,null),jj(this,a,['*',this.id,...this.W],null)):((c=void 0===e)||(c=!('function'===typeof b.nb?b.nb(e):b.valueOf()===e.valueOf())),c&&(this.data.set(d,b),null!==this.zb&&0<this.zb.size&&ij(this,a,b),jj(this,a,['*',this.id,...this.W],b)))}}on(a,b,c,d=!0){if(this.C.G()||this.C.$())return()=>{};const e=Wi(this,a),f=c?olympe.dc.za(c):
|
|
864
|
+
'*';a=kj(this,'@'+f+'.'+e,b);c=c?(c=Xi(this,f))?c.$a(e,!1):void 0:this.$a(e);void 0!==c&&b(c);if(d)olympe.D.La().onDestroy(a);return a}has(a,b=!1){a='$'+Wi(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}Zh(a,b){const c=null!=b?b:'_'+olympe.X.ec(),d=this.C.run(()=>new olympe.sc.Sd(c,a,this));null!==this.zb&&0<this.zb.size&&this.zb.forEach(({Wk:e,depth:f})=>{(-1===e.G||f<e.G)&&nj(d,e,f+1)});return d}Uk(a,b){const c=Xi(this,a);if(c)return b(c),
|
|
865
|
+
()=>{};const d=kj(this,'&'+a,e=>{d&&d();b(e)});return d}$a(a,b=!0){a='$'+Wi(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.$()||this.C.G()||this.C.destroy()}Xf(a,b){if(this.C.G())a();else return++olympe.sc.Sd.C,b=b||String(olympe.sc.Sd.C),null===this.$&&(this.$=new Map),this.$.set(b,a),b;return b||'noId'}Tk(a){null!==this.$&&this.$.delete(a)}onDestroy(a){return this.G()?(a(),'noId'):this.C.onDestroy(a)}Xe(a){this.G()||
|
|
866
|
+
this.C.Xe(a)}clear(){if(!this.C.$()&&!this.C.G()){let a;null==(a=this.$)||a.forEach(b=>b());this.C.Ka()}}G(){return this.C.G()}};olympe.sc.Sd.prototype.getParent=olympe.sc.Sd.prototype.getParent;olympe.sc.Sd.C=0;olympe.sc.Sd.F={ot:'I#',qu:'O#',nA:'IO#'};function pj(a,b,c){return(c=c.He())?`${a}.${c}.${b}`:`${a}.${b}`}olympe.sc.zb.Pe=class{constructor(a=-1){this.id=olympe.X.ih();this.active=!0;this.G=a}F(){this.active=!1}Z(){return this.id}L(){}process(){}};olympe.sc.zb.Pe.C={km:'SET'};olympe.sc.zb.Pe.F={sq:'REMOTE',Tt:'LOCAL'};olympe.sc.Vd=class a{constructor(){this.F=this.L=this.R=null;this.W=new Map;this.G=new Map;this.C=new olympe.X.om(1E4);Ha(this.C,b=>{oj(b)})}$(b,c,d){const e=b.body(),f=e.c,g=this.W.get(f);switch(e.t){case olympe.sc.Vd.C.ru:c=this.G.get(e.f);b.te(c).catch(l=>{d.error('Unable to reply with paths: ',l)});break;case olympe.sc.Vd.C.su:const h=f+c,k=(l,n,p=0)=>{lj(l,(q,r)=>{let t;q instanceof olympe.dc.CloudObject?t=a.G(q):t=q;let u;q=null!=(u=l.He())?u:'';0<q.length&&(q+='.');n.push([`${p}.${q}${r}`,
|
|
867
|
+
t])})};b.hn(h).then(()=>{const l=[];k(g,l,0);cj(g,p=>{k(p,l,1)});olympe.H.wa.fb.tb.publish(h,{t:olympe.sc.Vd.C.nt,v:l,ts:0}).catch(p=>{d.error('Error publishing on service : ',p)});const n=new olympe.sc.zb.Ku(h);nj(g,n);this.C.has(g)?Ga(this.C,g):this.C.add(g)}).catch(l=>{d.error('Error notifying on a contextId : ',l)});break;case olympe.sc.Vd.C.tu:void 0!==g&&this.C.has(g)&&Ga(this.C,g);break;case olympe.sc.Vd.C.rl:void 0!==g&&(this.C.delete(g),oj(g))}}ja(b,c,d){this.R=new olympe.H.wa.fb.tb('discovery_debug_id',
|
|
868
|
+
c);this.R.listen().subscribe(e=>{var f=e.body();if(f.t===olympe.sc.Vd.C.Ms){e=f.i;f=f.f;if(!this.G.has(f)){const g=this.da(f,c,b);if(0!==g.length)this.G.set(f,g);else return}null===this.F&&(this.F=olympe.X.ih(),this.L=new olympe.H.wa.fb.tb(this.F,Ti(c,this.F)),this.L.listen().subscribe(g=>{this.$(g,b,d)}),olympe.H.wa.fb.tb.publish(e,{t:olympe.sc.Vd.C.gs,n:olympe.U.getParameter(olympe.sc.Config.lo)||'no name',a:b,s:this.F}).catch(g=>{d.error('Error publishing on draw service : '+g)}))}})}da(b,c,d){const e=
|
|
869
|
+
[],f=olympe.dc.Ja(),g=(h,k)=>{cj(h,l=>{if(null!==l.He()){const n=olympe.dc.CloudObject.get(l.He()).Cr(olympe.sc.Runnable.L).Ic();if(null!==n){const p=k+'/'+f.name(n);n.T()===b&&(e.push([p,l.Z()]),this.W.set(l.Z(),l));g(l,p)}}})};g(c.C,f.name(d));return e}static F(b,c,d){let e=d;d instanceof olympe.dc.CloudObject&&(e=a.G(d));olympe.H.wa.fb.tb.publish(b,{t:olympe.sc.Vd.C.Qh,k:c,v:e,ts:Date.now()}).catch(f=>{olympe.ra.Ya('Debugger').error('Error publishing on service : ',f)})}static G(b){if(null===b||
|
|
870
|
+
void 0===b)return'<null>';const c=olympe.dc.Ja();if(b instanceof olympe.dc.CloudObject){var d=b.Nb();if(!c.Rf(d,olympe.sc.ff))return b.toString();let f=`${b.Mf().name()} (${b.T()})`;var e=olympe.dc.CloudObject.get(d);d=olympe.dc.gb.from(e).Qm(olympe.dc.CloudObject.extendRel,!0).Bf().rb(olympe.dc.CloudObject.propertyRel).Bf().Ic();e=olympe.dc.gb.from(e).Qm(olympe.dc.CloudObject.extendRel,!0).Bf().rb(olympe.dc.CloudObject.G).Bf().Ic();d=d.filter(([g])=>g instanceof olympe.sc.ff);0!==d.length&&(f+='<br> ',
|
|
871
|
+
f+='Properties:<br>',d.forEach(([,g])=>{f+=' ';f+=' - '+c.name(g)+' : '+c.cb(b.T(),g)+'<br>'}));d=e.filter(([g])=>g instanceof olympe.sc.ff);0!==d.length&&(f+=' ',f+='Relations:<br>',d.forEach(([,g])=>{f+=' ';f+=' - '+c.name(g)+'<br>'}));return f}return b.toString()}};olympe.sc.Vd.L='discovery_debug_id';olympe.sc.Vd.C={Ms:0,gs:1,ru:2,su:3,nt:4,Qh:5,tu:6,rl:7};olympe.sc.zb.sA=class extends olympe.sc.zb.Pe{constructor(a=-1){super(a);this.C=new Map}L(){return olympe.sc.zb.Pe.F.Tt}process(a,b,c,...d){if(this.active)switch(b){case olympe.sc.zb.Pe.C.km:a=pj(c,Wi(a,d[0]),a);d=d[1];let e;null==(e=this.C.get(a))||e(d)}}on(a,b){this.C.set(a,b)}};olympe.sc.zb.Ku=class extends olympe.sc.zb.Pe{constructor(a){super(1);this.R=a;this.C=new Map;this.db=olympe.dc.Ja()}L(){return olympe.sc.zb.Pe.F.sq}F(){super.F();for(const a of this.C.values())a();this.C.clear()}process(a,b,c,...d){if(this.active)switch(b){case olympe.sc.zb.Pe.C.km:if(void 0!==d[0]&&null!==d[0]){const e=pj(c,Wi(a,d[0]),a),f=d[1];let g;null==(g=this.C.get(e))||g();this.C.delete(e);if(f instanceof olympe.dc.CloudObject&&f.Mf()instanceof olympe.sc.ff){const h=Hd(this.db,f,()=>{olympe.sc.Vd.F(this.R,
|
|
872
|
+
e,f)});this.C.set(e,()=>{Id(this.db,f,h)})}olympe.sc.Vd.F(this.R,e,f)}}}};olympe.sc.Metadata=class extends olympe.dc.CloudObject{};olympe.sc.Metadata.O=olympe.dc.ya.C('0161ae936c62f9fcd131',olympe.sc.Metadata);olympe.sc.mc=class extends olympe.dc.CloudObject{F(){return this.Eb(olympe.sc.mc.L)}C(){return this.Eb(olympe.sc.mc.C)}};olympe.sc.mc.O=olympe.dc.ya.C('01703376c4a81c0e9d90',olympe.sc.mc);olympe.sc.mc.L=olympe.sc.mc.O.xa('01703376c4a81c0e9d91');olympe.sc.mc.C=olympe.sc.mc.O.xa('01703376c4a81c0e9d92');olympe.sc.mc.F=olympe.sc.mc.O.Ga('01703376c4a81c0e9d93');P(olympe.dc.CloudObject.O,olympe.sc.mc.F);olympe.sc.mc.prototype.F.K=olympe.D.J.F;olympe.sc.mc.prototype.C.K=olympe.D.J.F;olympe.sc.X={};function qj(a,b){const c=Math.random().toString(36).substr(2)+Math.random().toString(36).substr(2);a.C.set(c,b);return c}
|
|
873
|
+
olympe.sc.X.at=class{constructor(a,b,c){const d=olympe.net.eb.Yd.GET,e=olympe.net.eb.Yd.Ac,f=olympe.net.eb.Yd.fk,g=olympe.net.eb.Yd.Sl,h=olympe.net.eb.Headers.Ej,k=olympe.net.eb.Headers.oi;this.N=a;this.G=b.$([d,e,f,g],[h,k]);this.L=c;this.C=new olympe.X.nm(3E4);this.F=new olympe.D.Zb('FileService context')}start(a){var b=olympe.net.eb.Yd.GET;const c=olympe.net.eb.Yd.Ac,d=olympe.net.eb.Yd.fk,e=olympe.net.eb.Yd.Sl,f=olympe.net.eb.cd.Hh,g=olympe.net.eb.cd.Zs,h=olympe.net.eb.cd.Bq,k=olympe.net.eb.Headers.oi,
|
|
874
|
+
l=olympe.net.eb.Headers.ls,n=`fileServer_${a}`;a=`/${this.L}/${a}/:${'fileTag'}`.replace(/\/+/g,'/').replace(/\/$/,'');this.N.debug(`Started file service with path : ${a}`);b=this.G.L(n,a,[b,c,d,e],(p,q)=>{if(p.method===e)return Promise.resolve(new olympe.net.Sg('',f,'',{[l]:'*'}));const r=p.fj()[k],t=this.C.get(r);if(!t)return Promise.resolve(new olympe.net.Sg('Invalid token',g,'Access denied'));this.C.delete(r);return t(p.fj(),q.get('fileTag'),p.body).catch(u=>Promise.resolve(new olympe.net.Sg(`Internal server error: ${u}`,
|
|
875
|
+
h,'Internal server error')))});this.F.onDestroy(()=>{this.G.W(n).catch(p=>this.N.error(`An error occurred while stopping the file service: ${p}`))});return b}stop(){this.F.destroy()}};olympe.sc.Je={};olympe.sc.Je.sg={jz:null,Mu:'screenflow',fv:'ui-design',Dq:'software-intelligence',Hj:'data-management'};olympe.sc.oe=class extends olympe.dm.BrickMetadata{C(){return olympe.sc.Je.sg.Dq}F(){return this.ub(olympe.sc.oe.C,olympe.sc.logic.Li)}G(){return this.ub(olympe.sc.oe.F,olympe.sc.logic.Lh)}};olympe.sc.oe.O=olympe.dc.ya.C('011100000000000adef0',olympe.sc.oe);olympe.sc.oe.C=olympe.sc.oe.O.Ga('016ac4f59a2917fdef01');olympe.sc.oe.F=olympe.sc.oe.O.Ga('016ac4f59a2917fdef02');olympe.sc.oe.prototype.F.K=new olympe.D.J(()=>olympe.dc.Da,[]);olympe.sc.oe.prototype.G.K=new olympe.D.J(()=>olympe.dc.Da,[]);function rj(a,b){[].forEach(c=>c.call(a,b,(d,e)=>{null===e?b.remove(d):b.set(d,e)}))}function sj(a,b){const c=[];for(const d of b)b=a.db.cb(d,olympe.sc.logic.Gc.C,!0),c[b]=d;return c}
|
|
876
|
+
olympe.sc.mb=class extends olympe.dm.BrickMetadata{Ht(a,b,c,d,e=!0){e||olympe.ra.Ya('sc').error('parameter own= false ignored, investigate');return olympe.D.bf(L(this.Of(a,olympe.dc.X.Tb.fh,c)),d)}bx(){return this.ub(olympe.sc.mb.$,olympe.sc.Runnable)}ow(){return this.ub(olympe.sc.mb.da,olympe.sc.Runnable)}cn(){return this.db.cb(this,olympe.sc.mb.Ka)}$m(){return null!==this.db.fc(this.tag,olympe.sc.Runnable.F.Ec())}Il(){return this.ub(olympe.sc.mb.F,olympe.sc.logic.Cb)}Wj(){return this.ub(olympe.sc.mb.L,
|
|
877
|
+
olympe.sc.logic.Rb)}};olympe.sc.mb.O=olympe.dc.ya.C('0112000000000000def0',olympe.sc.mb);olympe.sc.mb.Ka=olympe.sc.mb.O.xa('01692aa71f3108454479');olympe.sc.mb.Vb=olympe.sc.mb.O.xa('0166446c1f128ebc903a');olympe.sc.mb.$=olympe.sc.mb.O.Ga('01692a4af82e8984742c');olympe.sc.mb.da=olympe.sc.mb.O.Ga('01692a4af82e8984742d');olympe.sc.mb.ta=olympe.sc.mb.O.Ga('01692a4af82e8984742e');olympe.sc.mb.F=olympe.sc.mb.O.Ga('01621fb84e320000f00a');olympe.sc.mb.L=olympe.sc.mb.O.Ga('01621fb84e320000f00b');
|
|
878
|
+
olympe.sc.mb.od=olympe.sc.mb.O.Ga('0171838bcfed0000e00e');olympe.sc.mb.Xc=olympe.sc.mb.O.Ga('0171838bcfed0000a00a');m=olympe.sc.mb.prototype;m.Ht.K=olympe.D.J.C;m.bx.K=new olympe.D.J(()=>olympe.dc.Da,[]);m.ow.K=new olympe.D.J(()=>olympe.dc.Da,[]);m.cn.K=olympe.D.J.C;m.$m.K=olympe.D.J.C;m.Il.K=new olympe.D.J(()=>olympe.dc.Da,[]);m.Wj.K=new olympe.D.J(()=>olympe.dc.Da,[]);function tj(a){const b=olympe.dc.CloudObject.yr(new Map,a);olympe.D.La().onDestroy(()=>{const c=new olympe.dc.Transaction;c.delete(b);c.kb()});return b}function uj(a,b){fj(b.C,a);rj(a.Md(),b);const c=a.R(),d=vj(b,c),e=[];c.forEach((f,g)=>{f===a.ta?e[0]=g:f===a.ja&&(e[1]=g)});void 0!==e[0]&&void 0!==e[1]&&(wj(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])})}
|
|
879
|
+
function xj(a,b){var c=a.Nb();const d=a.db.name(c),e=`Brick ${d} successfully run`,f=`Brick ${d} successfully cleared`,g=a.F(b);c=a.setupExecution(b).pipe(rxjs.operators.map(h=>{if(!b.G()&&(b.clear(),null!==h)){h=Array.isArray(h)?h:[h];const k=new olympe.sc.er(b.C);b.C.C.run(a.update.bind(a,k,h,g));return!0}return!1})).subscribe(rxjs.Subscriber.create(h=>h?a.N.debug(e):a.N.debug(f),a.Wa.bind(a,b),()=>a.N.debug(`Brick ${d} completed`)));b.onDestroy(c.unsubscribe.bind(c))}
|
|
880
|
+
function yj(a,b,c,d){const e=d.C.C,f=V(a.db,b,c,e.F((g,h)=>{const k=Ti(d,h);g?olympe.dc.CloudObject.get(h).run(k):k.destroy()}));e.R(a.db.C.bind(a.db,b,c,f,!0))}function vj(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)}})}
|
|
881
|
+
function wj(a,b,c){const d=olympe.D.La(),e=Hd(a.db,a.tag,d.F((f,g,h)=>{const k=h?c:b;null!==k&&(h&&b&&b(f,null),null===g||void 0===g?k(f,null):k(f,olympe.sc.fh(g)))}));d.onDestroy(()=>{Id(a.db,a.tag,e)})}
|
|
882
|
+
olympe.sc.Runnable=class extends olympe.dm.BrickMetadata{constructor(a,b,c){super(a,b);this.N=c}run(a){const b=()=>{uj(this,a);this.init(a);if(this.Md().cn())xj(this,a);else{const d=new olympe.sc.er(a.C);a.C.C.run(this.update.bind(this,d,[],[]))}a.wn(olympe.sc.mb.Vb);a.Xf(this.clear.bind(this,a));a.onDestroy(this.destroy.bind(this,a))},c=a.getParent();c?c.C.C.run(b):b()}Md(){return this.Mf()}init(a){this.onInit(a)}update(a,b,c){const d=this.Md();if(d.cn())this.onUpdate(a,b,c);else this.N.debug(`Softcoded runnable ${this.db.name(this)} with tag ${this.tag} running in context ${a.Z()}`),
|
|
883
|
+
yj(this,d,olympe.sc.mb.$,a),this.Ka()&&yj(this,d,olympe.sc.mb.ta,a)}clear(){}destroy(a){this.onDestroy(a)}setupExecution(){return rxjs.of([])}F(){return[]}onInit(){}onUpdate(){this.N.error(`Brick ${this.db.name(this.Nb())} (${this.Nb()}) is flagged as hardcoded, but method update() has not been overridden.`)}onDestroy(){}getInputs(){var a=this.Md();return sj(a,a.db.ub(a.tag,olympe.sc.mb.F))}getOutputs(){var a=this.Md();return sj(a,a.db.ub(a.tag,olympe.sc.mb.L))}G(){return[]}$(){return new Map}Ka(){return!1}L(a,
|
|
884
|
+
b,c,d){a=b.Ib(a,c,!0);void 0!==d&&olympe.D.bf(a,d);return a}Ab(a,b,c,d,e){olympe.D.ln([d],f=>{b.set(a,olympe.D.Rr(f)?f.valueOf():f)});return this.L(a,b,c,e)}R(){return[this.ta,this.ja]}ta(a,b){wj(this,b,null)}ja(a,b){wj(this,null,b)}Vb(a,b){const c=this.db,d=olympe.sc.logic.wb.L.Ec(),e=olympe.sc.logic.wb.F,f=olympe.sc.logic.wb.C;this.Dr(d,g=>{var h=g.T();if(h=c.fc(h,e)||c.fc(h,f))g=zj(g,a,b.bind(null,h)),olympe.D.La().onDestroy(g)})}Wa(a,b){const c=this.Nb();let d=this.db.name(c);try{const e=[a.He()];
|
|
885
|
+
let f=a.getParent();for(;null!==f&&f.C!==olympe.sc.mn;)e.unshift(f.He()),f=f.getParent();d=e.map(g=>{if(null!==g){const h=this.db.model(g);return this.db.name(g)||h&&this.db.name(h)||g}return'?'}).join(' > ')}catch(e){this.N.warn(`Impossible to retrieve the stack for brick ${this.db.name(c)}.`)}this.N.error(`An error occurred in brick ${d} (${c}): ${b}\n${b.stack}`)}};olympe.sc.Runnable.O=Rc(olympe.dc.ya.C('01130000000000ca1100',olympe.sc.Runnable));olympe.sc.Runnable.L=olympe.sc.Runnable.O.Ga('01692a4af82e8984742b');
|
|
886
|
+
olympe.sc.Runnable.F=olympe.sc.Runnable.O.Ga('01756a18d4921c103111');olympe.sc.Runnable.R=P(olympe.sc.Runnable.O,olympe.sc.mb.$);olympe.sc.Runnable.W=P(olympe.sc.Runnable.O,olympe.sc.mb.da);olympe.sc.Runnable.$=P(olympe.sc.Runnable.O,olympe.sc.mb.ta);P(olympe.sc.mb.O,olympe.sc.Runnable.L);P(olympe.sc.mb.O,olympe.sc.Runnable.F);olympe.sc.Runnable.prototype.Md.K=new olympe.D.J(()=>olympe.sc.mb,[]);olympe.sc.Runnable.prototype.L.K=new olympe.D.J(()=>Object,[]);olympe.sc.Runnable.prototype.Ab.K=olympe.D.J.C;function Aj(a){if(a){if('string'===typeof a)return a;if(a instanceof olympe.sc.De)return(a=a.F())?a.valueOf():null;if('function'===typeof a.T)return a.T()}return null}olympe.sc.De=class extends olympe.dc.CloudObject{F(){return this.db.ub(this,olympe.sc.De.C)[0]}C(){return olympe.dc.CloudObject.get(Aj(this))}toString(){const a=Aj(this);let b;a&&(b=this.db.name(a));return b||super.toString()}};olympe.sc.De.O=olympe.dc.ya.C('0163c9ae01f2d6e9ca49',olympe.sc.De);olympe.sc.De.C=olympe.sc.De.O.Ga('0169b5a8a33144fb0b49');
|
|
887
|
+
P(olympe.dc.CloudObject.O,olympe.sc.De.C);olympe.sc.De.prototype.F.K=new olympe.D.J(()=>String,[]);olympe.sc.De.prototype.C.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.sc.so=class extends olympe.dm.Pb{C(){return olympe.sc.Je.sg.Hj}};olympe.sc.so.O=olympe.dc.ya.C('0163a68ce44f3d1fa84c',olympe.sc.so);olympe.sc.ff=class extends olympe.dm.BrickMetadata{};olympe.sc.ff.O=olympe.dc.ya.C('016324fde11a836f76c2',olympe.sc.ff);let Bj=null;
|
|
888
|
+
function Cj(a,b){Bj=a;(new olympe.dc.kf(a,olympe.dc.Cd.Ki)).rb(olympe.sc.Ma.Le.C).rb(olympe.sc.gd.F.Ec()).kb((c,d)=>{if(c)olympe.ra.Ya('sc').error('Error while loading business container:',c.message),b(olympe.sc.gd.C.ac);else{c=null;for(const [e,f]of d.xc.ed())e===olympe.sc.gd.F.T()&&(c=f);null!==c?kf(ef(new olympe.dc.kf(c),olympe.dc.Qb.tf),(e,f)=>{const g=olympe.dc.jc.Tc,h=olympe.dc.jc.wi,k=f.T();f=f.Ra();return olympe.dc.Ja().Rf(e,olympe.sc.ff)&&f===olympe.dc.Ca.ORIGIN&&(k===g||k===h)}).kb(()=>
|
|
889
|
+
b(olympe.sc.gd.C.yp)):(olympe.ra.Ya('sc').error('No container found for the application',a),b(olympe.sc.gd.C.Ql))}})}olympe.sc.gd=class extends olympe.dc.CloudObject{};olympe.sc.gd.C={yp:0,Ql:1,ac:2};olympe.sc.gd.O=olympe.dc.ya.C('017b3aa8fae1e3d044dc',olympe.sc.gd);olympe.sc.gd.F=olympe.sc.gd.O.Ga('017b3aa8fd1659291b92');olympe.sc.gd.L=olympe.sc.gd.O.Ga('017b3aa8fe7ec3fd52f2');olympe.sc.Map=class extends olympe.dc.CloudObject{};olympe.sc.Map.O=olympe.dc.ya.C('018119241abce0e5696e',olympe.sc.Map);olympe.sc.Vg=class extends olympe.sc.Map{};olympe.sc.Vg.O=olympe.dc.ya.C('01631aacd8276ea98490',olympe.sc.Vg);olympe.sc.Uj=class extends olympe.dm.File{L(){const a=olympe.D.Qc(olympe.D.Za);this.Gk(b=>{a.update(olympe.D.yb(b))});return a.Ib()}};olympe.sc.Uj.O=Mc('01644b6297305d62fca2',olympe.sc.Uj);olympe.sc.Uj.prototype.L.K=olympe.D.J.F;olympe.sc.rd=class extends olympe.dm.File{L(){return this.Eb(olympe.sc.rd.fontFamilyProp)}R(){return this.Eb(olympe.sc.rd.F)}W(){return this.Ie(olympe.sc.rd.L)}};olympe.sc.rd.O=Mc('01647e113043c637b541',olympe.sc.rd);olympe.sc.rd.fontFamilyProp=olympe.sc.rd.O.xa('01647e35ecd24ef0b88d');olympe.sc.rd.F=olympe.sc.rd.O.xa('01647e677f5d1cfbdf42');olympe.sc.rd.L=olympe.sc.rd.O.xa('01647e6780999bf8bd25');olympe.sc.rd.prototype.L.K=olympe.D.J.F;olympe.sc.rd.prototype.R.K=olympe.D.J.F;
|
|
890
|
+
olympe.sc.rd.prototype.W.K=olympe.D.J.G;olympe.sc.rm=class extends olympe.dm.File{};olympe.sc.rm.O=Mc('0164643c432146a71d5c',olympe.sc.rm);olympe.sc.gr=class extends olympe.dc.CloudObject{};olympe.sc.gr.O=olympe.dc.ya.C('016421bb3797e22d1c4e',olympe.sc.gr);olympe.sc.logic={};olympe.sc.logic.Xo=(a,b)=>a===b?0:a>b?1:-1;
|
|
891
|
+
olympe.sc.logic.rA=(a,b,c,d,e,f,g)=>{const h=b.T();b=olympe.D.$a(b.C().T());let k,l;if(b===olympe.dc.za(olympe.dm.String))k=c.valueOf().toLowerCase(),l=p=>p.Eb(h).toLowerCase();else if(b===olympe.dc.za(olympe.dm.Number))k=c.valueOf(),l=p=>p.Ie(h);else if(b===olympe.dc.za(olympe.dm.DateTime))k=c.getTime(),l=p=>olympe.D.Fa([p.hj(h)],q=>q.getTime(),Number,'FilterList Date&DateTime TransformFlows');else{c=olympe.dc.Ja().name(b);g.warn(`Properties of type ${c} are not supported. List will not be filtered.`);e(a);
|
|
892
|
+
return}let n;if('<'===f)n=(p,q)=>olympe.sc.logic.Xo(q,p);else if('>'===f)n=(p,q)=>olympe.sc.logic.Xo(p,q);else{g.error(`Unknown inequality ${f}. Please use '<' or '>'`);return}e(a.vg().filter(p=>olympe.D.Fa([l(p)],q=>{q=n(q.valueOf(),k);return olympe.D.wc(d.valueOf()?1===q:0<=q)},olympe.D.sa,'FilterList ListDefBuilder Filter TransformFlows')).pf())};
|
|
893
|
+
olympe.sc.logic.NC=(a,b)=>{if(a instanceof olympe.D.ga)return a;if(a instanceof olympe.D.Za)return a.cs();if(a instanceof olympe.D.sa)return a.Ir();if('string'===typeof a||'number'===typeof a)return olympe.D.Ba(Number(a));b.error(`Could not parse provided value ${a} into a number`);return olympe.D.ga.Lp};olympe.sc.logic.ua={};olympe.sc.logic.ua.Ko=class{constructor(a,b,c){this.O=olympe.dc.ya.C(a,b,...c)}T(){return this.O.T()}};olympe.sc.logic.ua.Ko.ma=[olympe.dc.Ae];const Dj=Object.create(null),Ej=new Map;function Fj(a){if(void 0===Dj[a])throw Error(`Tag: ${a} - does not correspond to a registered function`);return Oc(a)}function Gj(a,b,c=olympe.sc.logic.Function){if(Ej.has(a))throw c=Fj(a),Error(`Tag: ${a} - overwriting existing function definition "${c.name}" with "${b.name}"`);const d=olympe.dc.ya.C(a,b,...[]);Ej.set(a,{O:d,ZC:b,MC:c});return d}
|
|
894
|
+
olympe.sc.logic.ya=class{constructor(){}static C(a,b,...c){if(Dj[a])throw c=Fj(a),Error(`Tag: ${a} - overwriting already defined function "${c.name}" with "${b.name}"`);b=new olympe.sc.logic.ua.Ko(a,b,[olympe.sc.P.Ea].concat(c));return Dj[a]=b}};olympe.sc.logic.rz=class{};olympe.sc.logic.Fj=class extends olympe.dc.CloudObject{};olympe.sc.logic.Fj.O=olympe.dc.ya.C('01621fb84e320000cf00',olympe.sc.logic.Fj);olympe.sc.logic.Error=class{constructor(a,b){this.code=a;this.Tr=b}static create(a,b){return new olympe.sc.logic.Error(b,a)}Mw(){return this.Tr}mw(){return this.code}};z('olympe.sc.logic.Error',olympe.sc.logic.Error);olympe.sc.logic.Error.prototype.getCode=olympe.sc.logic.Error.prototype.mw;olympe.sc.logic.Error.prototype.getMessage=olympe.sc.logic.Error.prototype.Mw;olympe.sc.logic.Error.create=olympe.sc.logic.Error.create;
|
|
895
|
+
olympe.sc.logic.Kj=class extends olympe.sc.logic.Fj{static create(a,b){return new olympe.sc.logic.Error(b,a)}};olympe.sc.logic.Kj.O=olympe.dc.ya.C('016eeb5ede9f3094d8f0',olympe.sc.logic.Kj);olympe.sc.logic.me=class extends olympe.dc.CloudObject{C(){return this.oc(olympe.sc.logic.me.C,olympe.dc.CloudObject)}};olympe.sc.logic.me.O=olympe.dc.ya.C('016ac4f59ee8ea2081ba',olympe.sc.logic.me);olympe.sc.logic.me.L=olympe.sc.logic.me.O.xa('017bc044aeacce7ffc8f');olympe.sc.logic.me.C=olympe.sc.logic.me.O.Ga('016ac4f5a0091c4790e2');P(olympe.dc.CloudObject.O,olympe.sc.logic.me.C);olympe.sc.logic.me.prototype.C.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.Li=class extends olympe.sc.logic.me{};olympe.sc.logic.Li.O=olympe.dc.ya.C('016ac4f59c592b862457',olympe.sc.logic.Li);olympe.sc.logic.Li.F=olympe.sc.oe.C.Ec();olympe.sc.logic.Lh=class extends olympe.sc.logic.me{};olympe.sc.logic.Lh.O=olympe.dc.ya.C('016ac4f59dd99f5df3e1',olympe.sc.logic.Lh);olympe.sc.logic.Lh.F=P(olympe.sc.logic.Lh.O,olympe.sc.oe.F);olympe.sc.logic.ye=class extends olympe.sc.mb{C(){return olympe.sc.Je.sg.Dq}da(){return this.Tm().vg().Rf([olympe.sc.logic.Function]).and().not().Rf([olympe.sc.logic.Rd,olympe.sc.logic.Wd]).pf()}Ew(){return this.Il().vg().ij([olympe.dc.CloudObject.modelRel,olympe.sc.logic.Li.F]).pf()}Fw(){return this.Wj().vg().ij([olympe.dc.CloudObject.modelRel,olympe.sc.logic.Lh.F]).pf()}ce(a){const b=this.db.Pm(this,[olympe.sc.mb.F],c=>this.db.model(c)===olympe.dc.za(a));return b?olympe.dc.CloudObject.get(b):null}Jf(a){const b=
|
|
896
|
+
this.db.Pm(this,[olympe.sc.mb.L],c=>this.db.model(c)===olympe.dc.za(a));return b?olympe.dc.CloudObject.get(b):null}mx(){return this.Il().vg().ij([olympe.dc.CloudObject.modelRel],olympe.sc.logic.Cb).pf()}nx(){return this.Wj().vg().ij([olympe.dc.CloudObject.modelRel],olympe.sc.logic.Rb).pf()}};Gj('01621fb84e320000f000',olympe.sc.logic.ye,olympe.sc.logic.Function);m=olympe.sc.logic.ye.prototype;m.Ew.K=new olympe.D.J(()=>olympe.dc.Da,[]);m.Fw.K=new olympe.D.J(()=>olympe.dc.Da,[]);
|
|
897
|
+
m.ce.K=new olympe.D.J(()=>olympe.sc.logic.Cb,[]);m.Jf.K=new olympe.D.J(()=>olympe.sc.logic.Rb,[]);m.mx.K=new olympe.D.J(()=>olympe.dc.Da,[]);m.nx.K=new olympe.D.J(()=>olympe.dc.Da,[]);olympe.sc.logic.bg=class extends olympe.sc.logic.ye{F(){return this.ce('016ac63229782039429f')}G(){return this.Jf('016ac6322acf67eebfe7')}L(){return this.Wj().vg().rb(olympe.sc.logic.Gc.typeRel).Kk(olympe.sc.logic.Kj).pf().nf().an(olympe.D.ga.ZERO)}};olympe.sc.logic.bg.C='016ac63229782039429f';olympe.sc.logic.bg.ja='016ac6322acf67eebfe7';olympe.sc.logic.bg.O=Gj('01621fb84e320000a000',olympe.sc.logic.bg,olympe.sc.logic.Action);
|
|
898
|
+
olympe.sc.logic.bg.prototype.F.K=new olympe.D.J(()=>olympe.sc.logic.Cb,[]);olympe.sc.logic.bg.prototype.G.K=new olympe.D.J(()=>olympe.sc.logic.Rb,[]);olympe.sc.logic.bg.prototype.L.K=olympe.D.J.R;olympe.sc.logic.co=class extends olympe.sc.logic.ye{};olympe.sc.logic.co.O=Gj('01621fb84e320000f011',olympe.sc.logic.co);olympe.sc.logic.bo=class extends olympe.sc.logic.bg{};olympe.sc.logic.bo.O=Gj('01621fb84e320000f012',olympe.sc.logic.bo);olympe.sc.logic.Function=class extends olympe.sc.Runnable{R(){return[this.Vb]}$(){const a=olympe.sc.Sd.F.ot,b=olympe.sc.Sd.F.qu,c=this.db,d=new Map;this.getInputs().forEach(e=>{d.set(a+c.name(e),e)});this.getOutputs().forEach(e=>{d.set(b+c.name(e),e)});return d}F(a){return this.getOutputs().map(b=>this.db.Nk(b,olympe.sc.logic.Gc.typeRel,olympe.sc.logic.Fj)?a.wn.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=>
|
|
899
899
|
c.includes(null)?null:c)):rxjs.of([])}};olympe.sc.logic.Function.O=olympe.dc.ya.C('0168c6f020f2a96f0000',olympe.sc.logic.Function,olympe.sc.P.Ea);olympe.sc.logic.Gc=class extends olympe.dc.CloudObject{C(){return this.oc(olympe.sc.logic.Gc.typeRel,olympe.dc.CloudObject)}F(){return this.Ie(olympe.sc.logic.Gc.C)}};olympe.sc.logic.Gc.O=olympe.dc.ya.C('0168a431d25001540000',olympe.sc.logic.Gc);olympe.sc.logic.Gc.C=olympe.sc.logic.Gc.O.xa('01740c5d4ae4b520dd01');olympe.sc.logic.Gc.typeRel=olympe.sc.logic.Gc.O.Ga('0168a431d3b9b7438424');P(olympe.dc.CloudObject.O,olympe.sc.logic.Gc.typeRel);
|
|
900
|
-
olympe.sc.logic.Gc.prototype.C.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.Gc.prototype.F.K=olympe.D.J.G;olympe.sc.logic.Cb=class extends olympe.sc.logic.Gc{};olympe.sc.logic.Cb.O=olympe.dc.ya.C('0168a431d25001540001',olympe.sc.logic.Cb);olympe.sc.logic.Cb.ja=olympe.sc.logic.Gc.O.xa('01740c5d4ae4b520dd02');olympe.sc.logic.Cb.da=P(olympe.sc.logic.Cb.O,olympe.sc.
|
|
901
|
-
olympe.sc.logic.Cb.$=olympe.sc.logic.Cb.O.Ga('01621fb84e32000000d1',olympe.dc.Ca.ORIGIN);olympe.sc.logic.Rb=class extends olympe.sc.logic.Gc{};olympe.sc.logic.Rb.O=olympe.dc.ya.C('0168a431d25001540002',olympe.sc.logic.Rb);olympe.sc.logic.Rb.da=P(olympe.sc.logic.Rb.O,olympe.sc.
|
|
900
|
+
olympe.sc.logic.Gc.prototype.C.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.Gc.prototype.F.K=olympe.D.J.G;olympe.sc.logic.Cb=class extends olympe.sc.logic.Gc{};olympe.sc.logic.Cb.O=olympe.dc.ya.C('0168a431d25001540001',olympe.sc.logic.Cb);olympe.sc.logic.Cb.ja=olympe.sc.logic.Gc.O.xa('01740c5d4ae4b520dd02');olympe.sc.logic.Cb.da=P(olympe.sc.logic.Cb.O,olympe.sc.mb.F);olympe.sc.logic.Cb.F=olympe.sc.logic.Cb.O.Ga('0168a431d91f2578000b',olympe.dc.Ca.ORIGIN);olympe.sc.logic.Cb.L=olympe.sc.logic.Cb.O.Ga('01621fb84e32000000a1',olympe.dc.Ca.ORIGIN);
|
|
901
|
+
olympe.sc.logic.Cb.$=olympe.sc.logic.Cb.O.Ga('01621fb84e32000000d1',olympe.dc.Ca.ORIGIN);olympe.sc.logic.Rb=class extends olympe.sc.logic.Gc{};olympe.sc.logic.Rb.O=olympe.dc.ya.C('0168a431d25001540002',olympe.sc.logic.Rb);olympe.sc.logic.Rb.da=P(olympe.sc.logic.Rb.O,olympe.sc.mb.L);olympe.sc.logic.Rb.F=olympe.sc.logic.Rb.O.Ga('0168a431d91f25780003',olympe.dc.Ca.ORIGIN);olympe.sc.logic.Rb.$=olympe.sc.logic.Rb.O.Ga('01621fb84e32000000a2',olympe.dc.Ca.ORIGIN);olympe.sc.logic.Rb.L=olympe.sc.logic.Rb.O.Ga('01621fb84e32000000d2',olympe.dc.Ca.ORIGIN);olympe.sc.logic.Action=class extends olympe.sc.logic.Function{setupExecution(a){const b=this.Md().F().T();return a.observe(b).pipe(rxjs.operators.map(c=>null===c?null:this.getInputs().filter(d=>d!==b).map(d=>a.get(d))))}};olympe.sc.logic.Action.O=olympe.dc.ya.C('0168c6f020f2a96a0000',olympe.sc.logic.Action,olympe.sc.P.Ea);olympe.sc.logic.Rd=class extends olympe.sc.logic.Function{run(a){uj(this,a);const b=a.getParent(),c=this.db.fc(this,olympe.sc.logic.Rd.C),d=this.db.fc(this,olympe.sc.logic.Rd.G);a.on(c,e=>b.set(d,e),this.tag)}W(){return this.oc(olympe.sc.logic.Rd.C,olympe.sc.logic.Cb)}Sa(){return this.oc(olympe.sc.logic.Rd.G,olympe.sc.logic.Rb)}};olympe.sc.logic.Rd.O=olympe.dc.ya.C('01621fb84e32000000a0',olympe.sc.logic.Rd,olympe.sc.P.Ea);olympe.sc.logic.Rd.C=P(olympe.sc.logic.Rd.O,olympe.sc.logic.Cb.L);
|
|
902
902
|
olympe.sc.logic.Rd.G=P(olympe.sc.logic.Rd.O,olympe.sc.logic.Rb.$);olympe.sc.logic.Rd.prototype.W.K=new olympe.D.J(()=>olympe.sc.logic.Cb,[]);olympe.sc.logic.Rd.prototype.Sa.K=new olympe.D.J(()=>olympe.sc.logic.Rb,[]);olympe.sc.logic.Wd=class extends olympe.sc.logic.Function{run(a){const b=a.getParent(),c=this.db.fc(this,olympe.sc.logic.Wd.G),d=this.db.fc(this,olympe.sc.logic.Wd.C);b.on(c,e=>a.set(d,e),b.Z())}Sa(){return this.oc(olympe.sc.logic.Wd.G,olympe.sc.logic.Cb)}W(){return this.oc(olympe.sc.logic.Wd.C,olympe.sc.logic.Rb)}};olympe.sc.logic.Wd.O=olympe.dc.ya.C('01621fb84e32000000d0',olympe.sc.logic.Wd,olympe.sc.P.Ea);olympe.sc.logic.Wd.G=P(olympe.sc.logic.Wd.O,olympe.sc.logic.Cb.$);
|
|
903
|
-
olympe.sc.logic.Wd.C=P(olympe.sc.logic.Wd.O,olympe.sc.logic.Rb.L);olympe.sc.logic.Wd.prototype.Sa.K=new olympe.D.J(()=>olympe.sc.logic.Cb,[]);olympe.sc.logic.Wd.prototype.W.K=new olympe.D.J(()=>olympe.sc.logic.Rb,[]);function
|
|
904
|
-
{g(null);l();k&&k()}}const h=
|
|
905
|
-
olympe.sc.logic.wb=class extends olympe.dc.CloudObject{constructor(a,b,c){super(a,b);this.N=c;this.C=`detachObject${this.tag}`}F(a,b,c,d){null!==c&&c.Ka();const e=a.get(this.C);e&&(e(),a.remove(this.C));const f=olympe.sc.fh(d);if(f instanceof olympe.dc.CloudObject){if(d=f.T(),
|
|
906
|
-
a||olympe.dc.X.Tb.fh,Object)}
|
|
903
|
+
olympe.sc.logic.Wd.C=P(olympe.sc.logic.Wd.O,olympe.sc.logic.Rb.L);olympe.sc.logic.Wd.prototype.Sa.K=new olympe.D.J(()=>olympe.sc.logic.Cb,[]);olympe.sc.logic.Wd.prototype.W.K=new olympe.D.J(()=>olympe.sc.logic.Rb,[]);function zj(a,b,c){const d=a.db.fc(a,olympe.sc.logic.wb.ja)||a.db.fc(a,olympe.sc.logic.wb.$),e=a.db.fc(a,olympe.sc.logic.wb.da),f=a.db.Tf((()=>{let k=null,l=a.db.fc(a,olympe.sc.logic.wb.F);l?k=a.db.fc(l,olympe.dm.Property.typeRel):(l=a.db.fc(a,olympe.sc.logic.wb.C))&&(k=a.db.fc(l,olympe.sc.logic.Gc.typeRel));return k||olympe.dc.CloudObject.O.T()})(),olympe.dm.rf)?new olympe.D.Zb('Pipe Context'):null,g=a.F.bind(a,b,c,f);if(null!==d&&null!==e){let k;const l=b.Uk(e,n=>{k&&k();k=n.on(d,g,e)});return()=>
|
|
904
|
+
{g(null);l();k&&k()}}const h=Gd(a.db,a,olympe.sc.logic.wb.valueProp,g);return()=>{g(null);a.db.F(a,olympe.sc.logic.wb.valueProp,h)}}function Hj(a,b,c,d){const e=b.getParent();$i(e.C,c,d);b.set(a.C,()=>{aj(e.C,c)})}
|
|
905
|
+
olympe.sc.logic.wb=class extends olympe.dc.CloudObject{constructor(a,b,c){super(a,b);this.N=c;this.C=`detachObject${this.tag}`}F(a,b,c,d){null!==c&&c.Ka();const e=a.get(this.C);e&&(e(),a.remove(this.C));const f=olympe.sc.fh(d);if(f instanceof olympe.dc.CloudObject){if(d=f.T(),Hj(this,a,d,[d]),null!==c&&'function'===typeof f.getValue){c.run(()=>{olympe.D.yc([f.getValue()],g=>{b(g.valueOf())})});return}}else f instanceof olympe.dc.Xa&&Hj(this,a,`qr-${f.hash}`,Je(f));b(f)}getValue(a){return this.Of(olympe.sc.logic.wb.valueProp,
|
|
906
|
+
a||olympe.dc.X.Tb.fh,Object)}It(){const a=this.transform(olympe.sc.logic.wb.C,olympe.sc.logic.Gc.typeRel);a.Ed(olympe.dc.CloudObject);return a.Oc()}kx(){return this.oc(olympe.sc.logic.wb.da,olympe.dc.CloudObject)}ix(){return this.oc(olympe.sc.logic.wb.ja,olympe.sc.logic.Rb)}jx(){return this.oc(olympe.sc.logic.wb.$,olympe.dm.Property)}ww(){return this.oc(olympe.sc.logic.wb.L,olympe.dc.CloudObject)}uw(){return this.oc(olympe.sc.logic.wb.C,olympe.sc.logic.Cb)}vw(){return this.oc(olympe.sc.logic.wb.F,
|
|
907
907
|
olympe.dm.Property)}};olympe.sc.logic.wb.O=olympe.dc.ya.C('0168a431d91f25780000',olympe.sc.logic.wb,olympe.sc.P.Ea);olympe.sc.logic.wb.valueProp=olympe.sc.logic.wb.O.xa('0168a431d91f25780001');olympe.sc.logic.wb.da=olympe.sc.logic.wb.O.Ga('0168a431d91f25780002');olympe.sc.logic.wb.ja=P(olympe.sc.logic.wb.O,olympe.sc.logic.Rb.F);olympe.sc.logic.wb.$=olympe.sc.logic.wb.O.Ga('0168a431d91f25780004');olympe.sc.logic.wb.L=olympe.sc.logic.wb.O.Ga('0168a431d91f2578000a');
|
|
908
|
-
olympe.sc.logic.wb.C=P(olympe.sc.logic.wb.O,olympe.sc.logic.Cb.F);olympe.sc.logic.wb.F=olympe.sc.logic.wb.O.Ga('0168a431d91f2578000c');P(olympe.dc.CloudObject.O,olympe.sc.logic.wb.da);P(olympe.dm.Property.O,olympe.sc.logic.wb.$);P(olympe.dc.CloudObject.O,olympe.sc.logic.wb.L);P(olympe.dm.Property.O,olympe.sc.logic.wb.F);m=olympe.sc.logic.wb.prototype;m.
|
|
909
|
-
m.
|
|
910
|
-
function
|
|
911
|
-
olympe.sc.logic.
|
|
912
|
-
k.destroy()},this.timeout);
|
|
913
|
-
|
|
914
|
-
function
|
|
915
|
-
function
|
|
916
|
-
olympe.sc.logic.
|
|
917
|
-
r:a.Qf().valueOf(),g:a.Kf().valueOf(),b:a.Ff().valueOf(),a:a.Ef().valueOf()};case a instanceof olympe.sc.logic.Error:return{t:3,c:a.code,m:a.
|
|
918
|
-
a:case void 0===a:return null;case 'object'===typeof a:return Object.entries(a).reduce((c,[d,e])=>{c[d]=this.C(e);return c},{});default:return a}}};olympe.sc.logic.controllers={};olympe.sc.logic.controllers.
|
|
919
|
-
olympe.sc.logic.ya.C('0171889b060b6cd54300',olympe.sc.logic.
|
|
920
|
-
olympe.sc.logic.$b.Yg.O=
|
|
921
|
-
olympe.sc.workflow.ObjectState.dateTimeProp=olympe.sc.workflow.ObjectState.O.xa('017ffdd8f0b1e31fe13b');olympe.sc.workflow.ObjectState.serializedObjectProp=olympe.sc.workflow.ObjectState.O.xa('017ffdd8f0b1e31fe13d');olympe.sc.workflow.ObjectState.objectRel=olympe.sc.workflow.ObjectState.O.Ga('017ffdd8f0b1e31fe13c');olympe.sc.workflow.ObjectState.currentObjectRel=olympe.sc.workflow.ObjectState.O.Ga('017ffdd8f0b1e31fe13f');olympe.sc.workflow.sf=class extends olympe.sc.logic.ye{
|
|
922
|
-
olympe.sc.workflow.sf.fe='017ffe02381f9fac5062';olympe.sc.workflow.sf.bc='017ffe02381f9fac5065';olympe.sc.workflow.sf.ja='017ffe02381f9fac5063';olympe.sc.workflow.sf.zc='017ffe02381f9fac5064';m=olympe.sc.workflow.sf.prototype;m.
|
|
923
|
-
m.
|
|
908
|
+
olympe.sc.logic.wb.C=P(olympe.sc.logic.wb.O,olympe.sc.logic.Cb.F);olympe.sc.logic.wb.F=olympe.sc.logic.wb.O.Ga('0168a431d91f2578000c');P(olympe.dc.CloudObject.O,olympe.sc.logic.wb.da);P(olympe.dm.Property.O,olympe.sc.logic.wb.$);P(olympe.dc.CloudObject.O,olympe.sc.logic.wb.L);P(olympe.dm.Property.O,olympe.sc.logic.wb.F);m=olympe.sc.logic.wb.prototype;m.It.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.kx.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);
|
|
909
|
+
m.ix.K=new olympe.D.J(()=>olympe.sc.logic.Rb,[]);m.jx.K=new olympe.D.J(()=>olympe.dm.Property,[]);m.ww.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.uw.K=new olympe.D.J(()=>olympe.sc.logic.Cb,[]);m.vw.K=new olympe.D.J(()=>olympe.dm.Property,[]);olympe.sc.logic.Ud=class extends olympe.sc.logic.Function{};olympe.sc.logic.Ud.O=olympe.dc.ya.C('017dc8c114aa61a0e27f',olympe.sc.logic.Ud);olympe.sc.logic.Ud.C=olympe.sc.logic.Ud.O.Ga('017dc8d6d8ef9135f08a');olympe.sc.logic.Ud.G=olympe.sc.logic.Ud.O.Ga('017dc8d6d8ef9135f08b');P(olympe.dm.Mb.O,olympe.sc.logic.Ud.G);function Ij(a,b){const c=a.Md(),d=c.Jl().T(),e=c.Kl().T(),f=c.Ll().T();b.on(d,g=>{g&&(g=new Map(a.getInputs().map(h=>[h,b.get(h)])),g=olympe.sc.logic.mk.la(g),olympe.H.wa.fb.tb.get(a.Nb(),g).then(h=>{h=Jj(h,a.W.bind(a,b));for(const [k,l]of h)k!==e&&k!==f&&b.set(k,l);b.set(e,h.get(e));b.set(f,h.get(f))}).catch(h=>{b.set(f,olympe.sc.logic.Kj.create(h.toString(),1))}))},b.Z())}
|
|
910
|
+
function Kj(a,b,c,d,e,f){const g=n=>{if(null!==n){e.cancel();k&&k();l&&l();try{const p=new Map(a.getOutputs().map(r=>[r,b.get(r)])),q=olympe.sc.logic.mk.la(p);f.te(q).finally(()=>b.destroy())}catch(p){n=Error(`Error while serializing the response from remote action ${a.Nb()}: ${p.message}`),f.xg(n).finally(()=>b.destroy())}}},h=b.Z(),k=b.on(c,g,h),l=b.on(d,g,h)}
|
|
911
|
+
olympe.sc.logic.Mh=class extends olympe.sc.logic.Function{constructor(a,b,c,d,e){super(a,b,c);this.Sa=d;this.timeout=e}run(a){let b;null!=(b=a.$a(olympe.sc.Qa.C.EDITION))&&b||(this.db.cb(this,olympe.sc.logic.Mh.C)?this.bc(a):(uj(this,a),Ij(this,a)))}bc(a){const b=this.Nb(),c=this.Md(),d=c.tp().T(),e=c.Jl().T(),f=c.Kl().T(),g=c.Ll().T();(new olympe.H.wa.fb.tb(b,a)).listen().subscribe(rxjs.Subscriber.create(h=>{const k=a.Zh('remote call'),l=Jj(h.body(),this.W.bind(this,k)),n=Jb(()=>{h.xg(Error(`Timeout reached on remote action ${this.db.name(this)} (${this.tag})`));
|
|
912
|
+
k.destroy()},this.timeout);Kj(this,k,f,g,n,h);super.run(k);for(const [p,q]of l)p!==e&&k.set(p,q);h.wj().then(p=>{var q=k.get(d);null!==q&&olympe.dc.za(q)!==p&&(q=this.Nb(),this.N.warn(`Remote action ${this.db.name(q)} ${q}: try to run it with an input user that is not the real authenticated user.`));k.set(d,p);k.set(e,l.get(e))})},h=>{const k=this.Nb();this.N.error(`Error while listening on remote action ${this.db.name(k)} (${k}): ${h.message}`)}))}W(a,b){const c=Array.from(b.de()).map(d=>d.tag());
|
|
913
|
+
Sc(this.Sa,a.C.C,b,[],c)}};olympe.sc.logic.Mh.O=olympe.dc.ya.C('017a7b0c5dcbd8964c5d',olympe.sc.logic.Mh,olympe.sc.P.Ea,olympe.dc.db.P.Aa,new olympe.U.fa(olympe.sc.Config.tq));olympe.sc.logic.Mh.C=olympe.sc.logic.Mh.O.xa('017a7b0c62a02a89444f');function Jj(a,b){var c=(new olympe.dc.X.Ji(olympe.dc.Ha.Lc)).C(a.p||[]);b&&b(c);c=new Map;for(const [d,e]of Object.entries(a.v||{}))c.set(d,Lj(olympe.sc.logic.mk,e,b));return c}function Mj(a){a.xc=new olympe.dc.db.uc;a.values=Object.create(null)}
|
|
914
|
+
function Lj(a,b,c){if(null===b||void 0===b)return null;switch(b.t){case 1:return new Date(b.d);case 2:return olympe.D.Color.create(b.r,b.g,b.b,b.a);case 3:return olympe.sc.logic.Error.create(b.m,b.c);case 4:return olympe.dc.CloudObject.get(b.v);case 5:return De(b.v);case 6:return Me(b.v,c);case 7:return new Map(Object.entries(b.m).map(([d,e])=>[d,Lj(a,e,c)]));default:return Array.isArray(b)?b.map(d=>Lj(a,d,c)):'object'===typeof b?Object.entries(b).reduce((d,[e,f])=>{d[e]=Lj(a,f,c);return d},{}):b}}
|
|
915
|
+
function Nj(a,b){var c=a.db;a=a.xc;if(c.Db(b)){a.F(b,c.dd(b,!0),0);a.Va(olympe.dc.jc.Tc,b,c.model(b),0);for(const [d,e,f]of Kd(c,b))(c=a.Lf(f))&&c.re()&&(e===olympe.dc.Ca.DESTINATION?a.Va(d,b,f,0):a.Va(d,f,b,0))}else olympe.ra.Ya('Remote Action').error(`Try to serialize an instance ${b} that does not exist in the local datacloud.`)}
|
|
916
|
+
olympe.sc.logic.mk=class{constructor(){this.db=olympe.dc.Ja();Mj(this)}static la(a){const b=new olympe.sc.logic.mk;a.forEach((c,d)=>{null!==c&&void 0!==c&&(b.values[d]=b.C(c))});return b.flush()}flush(){const a=Object.create(null),b=new olympe.dc.transaction.td;this.xc.Mc(b);a.p=je(b);a.v=this.values;Mj(this);return a}C(a){switch(!0){case a instanceof olympe.D.ib:return{t:1,d:a.valueOf().toISOString()};case a instanceof Date:return{t:1,d:a.toISOString()};case a instanceof olympe.D.Color:return{t:2,
|
|
917
|
+
r:a.Qf().valueOf(),g:a.Kf().valueOf(),b:a.Ff().valueOf(),a:a.Ef().valueOf()};case a instanceof olympe.sc.logic.Error:return{t:3,c:a.code,m:a.Tr};case a&&'function'===typeof a.T:return a=a.T(),Nj(this,a),{t:4,v:a};case a instanceof olympe.dc.gb:return{t:5,v:a.la()};case a instanceof olympe.dc.Xa:return{t:6,v:a.la()};case Array.isArray(a):return a.map(this.C.bind(this));case a instanceof Map:const b=Object.create(null);for(const [c,d]of a)'string'===typeof c&&(b[c]=this.C(d));return{t:7,m:b};case null===
|
|
918
|
+
a:case void 0===a:return null;case 'object'===typeof a:return Object.entries(a).reduce((c,[d,e])=>{c[d]=this.C(e);return c},{});default:return a}}};olympe.sc.logic.controllers={};olympe.sc.logic.controllers.Dl=class{constructor(a){this.db=olympe.dc.Ja();this.typeRel=a}};olympe.sc.logic.controllers.Dl.C={sz:-1,mA:1};olympe.sc.logic.controllers.RA=class extends olympe.sc.logic.controllers.Dl{constructor(){super(olympe.sc.logic.me.C)}};olympe.sc.logic.controllers.TA=class extends olympe.sc.logic.controllers.Dl{constructor(){super(olympe.sc.logic.Gc.typeRel)}};olympe.sc.logic.Ek={};olympe.sc.logic.Ek.Xu=class extends olympe.sc.logic.Function{update(a,[b,c],[d]){const e=olympe.dc.za(b);e?lf(ef(new olympe.dc.kf(e),olympe.dc.Qb.tf),c).kb(()=>{d(olympe.dc.CloudObject.get(e))}):this.N.warn('Cannot subscribe to an instance with no tag: '+e)}};olympe.sc.logic.ya.C('0174bf4b7e006e4b788a',olympe.sc.logic.Ek.Xu);olympe.sc.logic.actions={};olympe.sc.logic.Ek.Zt=class extends olympe.sc.logic.Function{run(a){uj(this,a);const [b,c,d]=this.F(a);let e,f=null,g=null;const h=a.getParent(),k=()=>{null===g||0===e?(this.N.warn('No list to iter upon'),this.N.info(a.Z())):f<e?(b(g.Te(f)),f++,c((new Date).getTime())):(hj(h.C),d((new Date).getTime()))};this.getInputs().forEach((l,n)=>a.on(l,p=>{if(p)switch(n){case 0:g=p;break;case 1:e=g.zg();f=0;gj(h.C);k();break;case 2:k();break;default:this.N.error('Unhandled input')}},this.tag))}};
|
|
919
|
+
olympe.sc.logic.ya.C('0171889b060b6cd54300',olympe.sc.logic.Ek.Zt);olympe.sc.logic.$b={};olympe.sc.logic.$b.jo=class extends olympe.sc.logic.ye{F(){return this.ce('017dc92292107fb98b21')}};Gj('017dc8d6c8fd8c8bd2f0',olympe.sc.logic.$b.jo);olympe.sc.logic.$b.jo.prototype.F.K=new olympe.D.J(()=>olympe.sc.logic.Cb,[]);olympe.sc.logic.$b.Fl=class extends olympe.sc.logic.ye{F(){return this.ce('016ac63808535703691c')}};olympe.sc.logic.$b.Fl.O=Gj('0169b6876a03f139d50a',olympe.sc.logic.$b.Fl);olympe.sc.logic.$b.Fl.prototype.F.K=new olympe.D.J(()=>olympe.sc.logic.Cb,[]);olympe.sc.logic.$b.Tl=class extends olympe.sc.logic.ye{F(){return this.ce('016ac63809a9a8e6db96')}G(){return this.Jf('016ac6380ab003363b3e')}};Gj('01646ad602f933b8caaf',olympe.sc.logic.$b.Tl);olympe.sc.logic.$b.Tl.prototype.F.K=new olympe.D.J(()=>olympe.sc.logic.Cb,[]);olympe.sc.logic.$b.Tl.prototype.G.K=new olympe.D.J(()=>olympe.sc.logic.Rb,[]);olympe.sc.logic.$b.dk=class extends olympe.sc.logic.ye{F(){return this.ce('016ac6380bd98f1d91a0')}L(){return this.Jf('016ac63c589ae38ca3ae')}G(){return this.Jf('016ac63c5a377fceabaa')}};Gj('0168ec42fc01747a98b6',olympe.sc.logic.$b.dk);olympe.sc.logic.$b.dk.prototype.F.K=new olympe.D.J(()=>olympe.sc.logic.Cb,[]);olympe.sc.logic.$b.dk.prototype.L.K=new olympe.D.J(()=>olympe.sc.logic.Rb,[]);olympe.sc.logic.$b.dk.prototype.G.K=new olympe.D.J(()=>olympe.sc.logic.Rb,[]);olympe.sc.logic.$b.Yg=class extends olympe.sc.logic.ye{Jl(){return this.ce('017a7b07b09e3b22c8b4')}tp(){return this.ce('017a7b07ba05807a74b0')}Kl(){return this.Jf('017a7b0818c12388d731')}Ll(){return this.Jf('017a7b085146d5e69aec')}Jt(){return olympe.D.sa.F}};olympe.sc.logic.$b.Yg.ja='017a7b07b09e3b22c8b4';olympe.sc.logic.$b.Yg.zc='017a7b07ba05807a74b0';olympe.sc.logic.$b.Yg.bc='017a7b0818c12388d731';olympe.sc.logic.$b.Yg.C='017a7b085146d5e69aec';
|
|
920
|
+
olympe.sc.logic.$b.Yg.O=Gj('017a7b07a948e30508fa',olympe.sc.logic.$b.Yg,olympe.sc.logic.Mh);m=olympe.sc.logic.$b.Yg.prototype;m.Jl.K=new olympe.D.J(()=>olympe.sc.logic.Cb,[]);m.tp.K=new olympe.D.J(()=>olympe.sc.logic.Cb,[]);m.Kl.K=new olympe.D.J(()=>olympe.sc.logic.Rb,[]);m.Ll.K=new olympe.D.J(()=>olympe.sc.logic.Rb,[]);m.Jt.K=olympe.D.J.R;olympe.sc.logic.$b.Nq=class extends olympe.sc.logic.ye{F(){return this.ce('016ac63c5b3ed0562740')}};Gj('016a9766c230916ea5ec',olympe.sc.logic.$b.Nq);olympe.sc.logic.$b.Nq.prototype.F.K=new olympe.D.J(()=>olympe.sc.logic.Cb,[]);olympe.sc.query={};olympe.sc.query.Hn=class extends olympe.sc.Vg{};olympe.sc.query.Hn.O=olympe.dc.ya.C('01631aacd8276ea98491',olympe.sc.query.Hn);olympe.sc.query.Zp=class extends olympe.dm.Enum{};olympe.sc.query.Zp.O=olympe.dc.ya.C('01631aacd8276ea98495',olympe.sc.query.Zp);olympe.sc.query.jq=class extends olympe.dm.Enum{};olympe.sc.query.jq.O=olympe.dc.ya.C('01631aacd8276ea98494',olympe.sc.query.jq);olympe.sc.query.lq=class extends olympe.sc.Vg{};olympe.sc.query.lq.O=olympe.dc.ya.C('01631aacd8276ea98492',olympe.sc.query.lq);olympe.sc.query.mq=class extends olympe.dc.CloudObject{};olympe.sc.query.mq.O=olympe.dc.ya.C('01631aacd8276ea98493',olympe.sc.query.mq);olympe.sc.fo=class extends olympe.dc.CloudObject{};olympe.sc.fo.O=olympe.dc.ya.C('018312ceeb3e93618a85',olympe.sc.fo);olympe.sc.workflow={};olympe.sc.workflow.ObjectState=class extends olympe.dc.CloudObject{};olympe.sc.workflow.ObjectState.O=olympe.dc.ya.C('017ffdd8f0b1e31fe138',olympe.sc.workflow.ObjectState);olympe.sc.workflow.ObjectState.workflowProp=olympe.sc.workflow.ObjectState.O.xa('017ffdd8f0b1e31fe13e');olympe.sc.workflow.ObjectState.stateProp=olympe.sc.workflow.ObjectState.O.xa('017ffdd8f0b1e31fe139');olympe.sc.workflow.ObjectState.assigneeProp=olympe.sc.workflow.ObjectState.O.xa('017ffdd8f0b1e31fe13a');
|
|
921
|
+
olympe.sc.workflow.ObjectState.dateTimeProp=olympe.sc.workflow.ObjectState.O.xa('017ffdd8f0b1e31fe13b');olympe.sc.workflow.ObjectState.serializedObjectProp=olympe.sc.workflow.ObjectState.O.xa('017ffdd8f0b1e31fe13d');olympe.sc.workflow.ObjectState.objectRel=olympe.sc.workflow.ObjectState.O.Ga('017ffdd8f0b1e31fe13c');olympe.sc.workflow.ObjectState.currentObjectRel=olympe.sc.workflow.ObjectState.O.Ga('017ffdd8f0b1e31fe13f');olympe.sc.workflow.sf=class extends olympe.sc.logic.ye{Kt(){return this.ce('017ffe02381f9fac5060')}Nt(){return this.ce('017ffe02381f9fac5061')}Ot(){return this.ce('017ffe02381f9fac5062')}sw(){return this.ce('017ffe02381f9fac5065')}Lt(){return this.Jf('017ffe02381f9fac5063')}Mt(){return this.Jf('017ffe02381f9fac5064')}};olympe.sc.workflow.sf.O=Gj('017ffde21f5fe0f704ce',olympe.sc.workflow.sf);olympe.sc.workflow.sf.C='017ffe02381f9fac5060';olympe.sc.workflow.sf.Kd='017ffe02381f9fac5061';
|
|
922
|
+
olympe.sc.workflow.sf.fe='017ffe02381f9fac5062';olympe.sc.workflow.sf.bc='017ffe02381f9fac5065';olympe.sc.workflow.sf.ja='017ffe02381f9fac5063';olympe.sc.workflow.sf.zc='017ffe02381f9fac5064';m=olympe.sc.workflow.sf.prototype;m.Kt.K=new olympe.D.J(()=>olympe.sc.logic.Cb,[]);m.Nt.K=new olympe.D.J(()=>olympe.sc.logic.Cb,[]);m.Ot.K=new olympe.D.J(()=>olympe.sc.logic.Cb,[]);m.sw.K=new olympe.D.J(()=>Map,[]);m.Lt.K=new olympe.D.J(()=>olympe.sc.logic.Rb,[]);
|
|
923
|
+
m.Mt.K=new olympe.D.J(()=>olympe.sc.logic.Rb,[]);olympe.sc.workflow.Qe=class extends olympe.dm.BrickMetadata{Rc(){return this.oc(olympe.sc.workflow.Workflow.statesRel.Ec(),olympe.sc.workflow.Workflow).na().concat(['.',this.na()])}};olympe.sc.workflow.Qe.O=olympe.dc.ya.C('017ffdc2dda51d46b430',olympe.sc.workflow.Qe);olympe.sc.workflow.Transition=class extends olympe.dc.CloudObject{F(){return this.Mr()}C(){return this.oc(olympe.sc.workflow.Transition.fromStateRel,olympe.sc.workflow.Qe)}G(){return this.oc(olympe.sc.workflow.Transition.toStateRel,olympe.sc.workflow.Qe)}Rc(){const a=this.oc(olympe.sc.workflow.Transition.fromStateRel,olympe.sc.workflow.Qe);return a.oc(olympe.sc.workflow.Workflow.statesRel.Ec(),olympe.sc.workflow.Workflow).na().concat(['.',a.na(),'->',this.na()])}};
|
|
924
924
|
olympe.sc.workflow.Transition.O=olympe.dc.ya.C('017ffdc633219f16beea',olympe.sc.workflow.Transition);olympe.sc.workflow.Transition.processRefProp=olympe.sc.workflow.Transition.O.xa('017ffdc633219f16beec');olympe.sc.workflow.Transition.fromStateRel=olympe.sc.workflow.Transition.O.Ga('017ffdc2dda51d46b431');olympe.sc.workflow.Transition.toStateRel=olympe.sc.workflow.Transition.O.Ga('017ffdc633219f16beeb');olympe.sc.workflow.Transition.prototype.F.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);
|
|
925
|
-
olympe.sc.workflow.Transition.prototype.C.K=new olympe.D.J(()=>olympe.sc.workflow.Qe,[]);olympe.sc.workflow.Transition.prototype.G.K=new olympe.D.J(()=>olympe.sc.workflow.Qe,[]);olympe.sc.workflow.Workflow=class extends olympe.dm.BrickMetadata{C(){return olympe.sc.Je.sg.
|
|
925
|
+
olympe.sc.workflow.Transition.prototype.C.K=new olympe.D.J(()=>olympe.sc.workflow.Qe,[]);olympe.sc.workflow.Transition.prototype.G.K=new olympe.D.J(()=>olympe.sc.workflow.Qe,[]);olympe.sc.workflow.Workflow=class extends olympe.dm.BrickMetadata{C(){return olympe.sc.Je.sg.Hj}L(){return this.Bg(olympe.sc.workflow.Workflow.serializationEnabledProp)}F(){return this.oc(olympe.sc.workflow.Workflow.dataTypeRel,olympe.sc.ff)}G(){return this.oc(olympe.sc.workflow.Workflow.initialStateRel,olympe.sc.workflow.Qe)}};olympe.sc.workflow.Workflow.O=olympe.dc.ya.C('017ffdc010e5bcc9c971',olympe.sc.workflow.Workflow);olympe.sc.workflow.Workflow.serializationEnabledProp=olympe.sc.workflow.Workflow.O.xa('017ffdc010e5bcc9c972');
|
|
926
926
|
olympe.sc.workflow.Workflow.dataTypeRel=olympe.sc.workflow.Workflow.O.Ga('017ffdc010e5bcc9c973');olympe.sc.workflow.Workflow.statesRel=olympe.sc.workflow.Workflow.O.Ga('017ffdc010e5bcc9c974');olympe.sc.workflow.Workflow.initialStateRel=olympe.sc.workflow.Workflow.O.Ga('017ffdc010e5bcc9c975');olympe.sc.workflow.Workflow.prototype.L.K=olympe.D.J.R;olympe.sc.workflow.Workflow.prototype.F.K=new olympe.D.J(()=>olympe.sc.ff,[]);
|
|
927
|
-
olympe.sc.workflow.Workflow.prototype.G.K=new olympe.D.J(()=>olympe.sc.workflow.Qe,[]);olympe.sc.Ma={};olympe.sc.Ma.Le=class extends olympe.sc.
|
|
928
|
-
olympe.sc.Ma.vb.O=olympe.dc.ya.C('011203300000000adef5',olympe.sc.Ma.vb);olympe.sc.Ma.vb.F=olympe.sc.Ma.vb.O.xa('011203300000000adef6');olympe.sc.Ma.vb.
|
|
929
|
-
olympe.sc.Ma.vb.
|
|
930
|
-
m.
|
|
931
|
-
f);c===olympe.dc.Ha.
|
|
932
|
-
b);return this}persist(a=!0){this.C.persist(a);return this}
|
|
933
|
-
olympe.sc.Transaction.prototype.execute=olympe.sc.Transaction.prototype.
|
|
934
|
-
olympe.sc.Transaction.prototype.persist=olympe.sc.Transaction.prototype.persist;olympe.sc.Transaction.prototype.deleteAllRelations=olympe.sc.Transaction.prototype.
|
|
935
|
-
olympe.sc.Transaction.prototype.update=olympe.sc.Transaction.prototype.update;olympe.sc.Transaction.prototype.create=olympe.sc.Transaction.prototype.create;olympe.sc.Transaction.prototype.getId=olympe.sc.Transaction.prototype.Z;olympe.sc.Transaction.process=olympe.sc.Transaction.process;olympe.sc.Transaction.from=olympe.sc.Transaction.from;olympe.sc.Je.BrickMetadata=olympe.dm.BrickMetadata;olympe.sc.Je.we=olympe.dm.we;olympe.ka.node.qa={};const
|
|
936
|
-
function
|
|
937
|
-
case
|
|
938
|
-
(t,u,v)=>{a.N.debug(`Received a file service upload request for file : ${u}`);return p!==u?Promise.reject('The file sent is not the same as the one initially requested'):v instanceof Uint8Array||'string'===typeof v?
|
|
939
|
-
return q!==u?Promise.reject('The file to download is not the same as the one initially requested'):
|
|
940
|
-
break;default:h.xg(Error(`Unsupported message type: ${k.t}`)).then()}})}function
|
|
941
|
-
function
|
|
942
|
-
function
|
|
943
|
-
function
|
|
944
|
-
olympe.ka.node.qa.
|
|
945
|
-
b),h=knex({client:d,connection:{host:e,port:c(
|
|
946
|
-
a.C,f=new olympe.ka.node.qa.Ia.
|
|
947
|
-
olympe.ka.node.qa.
|
|
948
|
-
class
|
|
949
|
-
f=new Set(k);c(h)}}),setTimeout(g,d))};setTimeout(g,d)}};olympe.ka.node.qa.Ia={};olympe.ka.node.qa.Ia.vc={EQUAL:'equal',
|
|
950
|
-
function
|
|
951
|
-
function
|
|
952
|
-
function
|
|
953
|
-
function
|
|
954
|
-
function
|
|
955
|
-
f])=>{a.Oa.get(c).add(e.T());a.Oa.get(f.T()).add(e.T());e=e.T();var g=
|
|
956
|
-
function
|
|
957
|
-
function
|
|
958
|
-
function
|
|
959
|
-
olympe.ka.node.qa.Ia.
|
|
960
|
-
d.T()),
|
|
961
|
-
function
|
|
962
|
-
b=b.includes(0)||b.includes(1)&&f;var k=[];if(b){const l=a.query.Z(),n=
|
|
963
|
-
function
|
|
964
|
-
function
|
|
965
|
-
eh:w,name:v,
|
|
966
|
-
function
|
|
967
|
-
olympe.ka.node.qa.Ia.
|
|
968
|
-
Promise.resolve(a.cb()).then(h=>[h,
|
|
969
|
-
recursive:f[k],
|
|
970
|
-
a.G;return Promise.resolve([h,a.F?l?Mk:Lk:
|
|
971
|
-
function
|
|
972
|
-
function
|
|
973
|
-
l=b}else h===parseInt(t[0],10)&&(t=t[1],p.get(l).push([t,b]))}return[p,q,r]}olympe.ka.node.qa.Ia.
|
|
974
|
-
function
|
|
927
|
+
olympe.sc.workflow.Workflow.prototype.G.K=new olympe.D.J(()=>olympe.sc.workflow.Qe,[]);olympe.sc.Ma={};olympe.sc.Ma.Le=class extends olympe.sc.mb{C(){return olympe.sc.Je.sg.Mu}};olympe.sc.Ma.Le.O=Rc(olympe.dc.ya.C('01120300000000adef00',olympe.sc.Ma.Le));olympe.sc.Ma.Le.C=olympe.sc.Ma.Le.O.Ga('0171bc1f15da96dfdb89');P(olympe.dm.Vc.O,olympe.sc.Ma.Le.C);olympe.sc.Ma.ni=class extends olympe.sc.Runnable{G(){return[this.Nb()]}W(){return olympe.dc.kd.from(this.Nb()).rb(olympe.sc.Ma.Le.C).Ic()}};olympe.sc.Ma.ni.O=Rc(olympe.dc.ya.C('0113030000000aca1100',olympe.sc.Ma.ni));olympe.sc.Ma.ni.prototype.W.K=new olympe.D.J(()=>olympe.dm.Mb,[]);olympe.sc.Ma.vb=class extends olympe.dc.CloudObject{Qt(){return this.Bg(olympe.sc.Ma.vb.F)}Qx(){return this.Bg(olympe.sc.Ma.vb.jb)}Od(){return this.Ie(olympe.sc.Ma.vb.C)}yw(){return this.Eb(olympe.sc.Ma.vb.da)}Yw(){return this.Eb(olympe.sc.Ma.vb.Sa)}Xw(){return this.Eb(olympe.sc.Ma.vb.Ka)}Rm(){this.Eb(olympe.sc.Ma.vb.Wa)}Lw(){return this.Eb(olympe.sc.Ma.vb.ja)}jw(){return this.Eb(olympe.sc.Ma.vb.L)}Ww(){return this.Eb(olympe.sc.Ma.vb.ta)}Pt(){return this.Eb(olympe.sc.Ma.vb.$)}};
|
|
928
|
+
olympe.sc.Ma.vb.O=olympe.dc.ya.C('011203300000000adef5',olympe.sc.Ma.vb);olympe.sc.Ma.vb.F=olympe.sc.Ma.vb.O.xa('011203300000000adef6');olympe.sc.Ma.vb.jb=olympe.sc.Ma.vb.O.xa('011203300000000adef7');olympe.sc.Ma.vb.C=olympe.sc.Ma.vb.O.xa('011203300000000adef8');olympe.sc.Ma.vb.da=olympe.sc.Ma.vb.O.xa('011203300000000adef9');olympe.sc.Ma.vb.Sa=olympe.sc.Ma.vb.O.xa('011203300000000adefa');olympe.sc.Ma.vb.Ka=olympe.sc.Ma.vb.O.xa('011203300000000adefb');olympe.sc.Ma.vb.L=olympe.sc.Ma.vb.O.xa('011203300000000adefc');
|
|
929
|
+
olympe.sc.Ma.vb.Wa=olympe.sc.Ma.vb.O.xa('011203300000000adefd');olympe.sc.Ma.vb.ja=olympe.sc.Ma.vb.O.xa('011203300000000adefe');olympe.sc.Ma.vb.ta=olympe.sc.Ma.vb.O.xa('011203300000000adeff');olympe.sc.Ma.vb.$=olympe.sc.Ma.vb.O.xa('011203300000000adee0');olympe.sc.Ma.vb.Ab={INIT:0,hz:1,Oi:2,lm:3,nk:4,oB:5,ac:9};m=olympe.sc.Ma.vb.prototype;m.Qt.K=olympe.D.J.R;m.Qx.K=olympe.D.J.R;m.Od.K=olympe.D.J.G;m.yw.K=olympe.D.J.F;m.Yw.K=olympe.D.J.F;m.Xw.K=olympe.D.J.F;m.Rm.K=olympe.D.J.F;m.Lw.K=olympe.D.J.F;
|
|
930
|
+
m.jw.K=olympe.D.J.F;m.Ww.K=olympe.D.J.F;m.Pt.K=olympe.D.J.F;olympe.sc.Ma.cp=class extends olympe.sc.Ma.ni{Ka(){return!0}};olympe.sc.Ma.cp.O=olympe.dc.ya.C('0113032000000aca1102',olympe.sc.Ma.cp,olympe.sc.P.Ea);olympe.sc.Ma.$g=class extends olympe.sc.Ma.Le{F(){return(new olympe.dc.Zj(this.T(),olympe.sc.Ma.vb)).rb(olympe.sc.Ma.$g.ja).pf().Oc()}};olympe.sc.Ma.$g.O=olympe.dc.ya.C('011203300000000adef3',olympe.sc.Ma.$g);olympe.sc.Ma.$g.ja=olympe.sc.Ma.$g.O.Ga('011203300000000adef4');P(olympe.sc.Ma.vb.O,olympe.sc.Ma.$g.ja);olympe.sc.Ma.$g.prototype.F.K=new olympe.D.J(()=>olympe.sc.Ma.vb,[]);olympe.sc.bh=class extends olympe.dc.CloudObject{static get(){return olympe.dc.CloudObject.get('011203300000000adf0f')}};olympe.sc.bh.O=olympe.dc.ya.C('011203300000000adf00',olympe.sc.bh);olympe.sc.bh.F=olympe.sc.bh.O.xa('011203300000000adf01');olympe.sc.bh.C=olympe.sc.bh.O.xa('011203300000000adf02');olympe.sc.bh.L='011203300000000adf0f';olympe.sc.qz=class{};olympe.sc.ve=class extends olympe.sc.Runnable{Sa(){return this.ub(olympe.sc.ve.G,olympe.sc.Runnable)}W(){return this.ub(olympe.sc.ve.C,olympe.dm.Property)}};olympe.sc.ve.O=Rc(olympe.dc.ya.C('016c2d996d9ca27fa9d8',olympe.sc.ve));olympe.sc.ve.G=olympe.sc.ve.O.Ga('016c3cb7742ec9309e0b');olympe.sc.ve.C=olympe.sc.ve.O.Ga('016c42d3454636f90533');olympe.sc.ve.prototype.Sa.K=new olympe.D.J(()=>olympe.dc.Da,[]);olympe.sc.ve.prototype.W.K=new olympe.D.J(()=>olympe.dc.Da,[]);olympe.sc.Bo=class extends olympe.dm.Pb{C(){return olympe.sc.Je.sg.Hj}};olympe.sc.Bo.O=olympe.dc.ya.C('017a7a9ff057958e5678',olympe.sc.Bo);olympe.sc.Jp=class extends olympe.dm.Pb{C(){return olympe.sc.Je.sg.fv}};olympe.sc.Jp.O=olympe.dc.ya.C('01644b6d4543b344b857',olympe.sc.Jp);olympe.sc.Kp=class extends olympe.dc.CloudObject{};olympe.sc.Kp.O=olympe.dc.ya.C('0162f672366be5ca7a86',olympe.sc.Kp);olympe.sc.Oq=class extends olympe.sc.ve{};olympe.sc.Oq.O=olympe.dc.ya.C('016d3f37610ae4fc3962',olympe.sc.Oq);olympe.sc.Oh=class extends olympe.dm.BrickMetadata{C(){return olympe.sc.Je.sg.Hj}};olympe.sc.Oh.O=olympe.dc.ya.C('01645fe6873aeea59e64',olympe.sc.Oh);olympe.sc.Oh.C=olympe.sc.Oh.O.Ga('017ed8ac775f48d4d589');olympe.sc.Oh.F=olympe.sc.Oh.O.Ga('017ed8ac775f48d4d590');olympe.sc.Text=class extends olympe.dm.String{};olympe.sc.Text.O=olympe.dc.ya.C('016cfca73e63f9ab5ba4',olympe.sc.Text);olympe.sc.Transaction=class{constructor(a=!0){this.C=(new olympe.dc.Transaction).persist(a);this.F=new Map;this.source=olympe.dc.Ha.ic}static from(a){const b=olympe.sc.Qa.C.TRANSACTION;return a.has(b,!0)?a.get(b,!0):new olympe.sc.Transaction}static process(a,b){return a.has(olympe.sc.Qa.C.TRANSACTION,!0)?Promise.resolve(!1):b.kb().then(()=>!0)}Z(){return this.C.Z()}create(a,b=new Map,c=this.source,d){d=this.C.create(a,d).ji(c);this.F.set(d.T(),olympe.dc.za(a));for(const [e,f]of b)d.setProperty(e,
|
|
931
|
+
f);c===olympe.dc.Ha.Lc&&(b=olympe.dc.Ja(),b=null!==Bj?b.gj(Bj,[olympe.sc.Ma.Le.C,olympe.sc.gd.F.Ec()])[0]||null:null,null!==b?this.Va(olympe.sc.gd.L,b,d):olympe.ra.Ya('sc').warn('No business container for new instance of',olympe.dc.za(a)));return d.T()}update(a,b,c){this.C.update(a,b,c);return this}Ox(a,b){a=this.C.update(a);for(const [c,d]of b)a.setProperty(c,d);return this}delete(a){this.C.delete(a);return this}Va(a,b,c){this.C.Va(a,b,c);return this}cc(a,b,c){this.C.cc(a,b,c);return this}Jm(a,b){this.C.Jm(a,
|
|
932
|
+
b);return this}persist(a=!0){this.C.persist(a);return this}qj(a,b=!0){this.C.qj(a,b);return this}ji(a){this.source=a;return this}model(a){return this.F.get(olympe.dc.za(a))||olympe.dc.Ja().model(a)}fn(a){le(this.C,a.C);return this}Cm(a){this.C.Cm(a);return this}kb(){return new Promise((a,b)=>{this.C.kb((c,d)=>{c?a():b(d)})})}Mm(){return new Promise((a,b)=>{this.C.Mm((c,d)=>{c?a():b(d)})})}};olympe.sc.Transaction.prototype.executeAsLarge=olympe.sc.Transaction.prototype.Mm;
|
|
933
|
+
olympe.sc.Transaction.prototype.execute=olympe.sc.Transaction.prototype.kb;olympe.sc.Transaction.prototype.afterExecution=olympe.sc.Transaction.prototype.Cm;olympe.sc.Transaction.prototype.merge=olympe.sc.Transaction.prototype.fn;olympe.sc.Transaction.prototype.model=olympe.sc.Transaction.prototype.model;olympe.sc.Transaction.prototype.setSource=olympe.sc.Transaction.prototype.ji;olympe.sc.Transaction.prototype.persistInstance=olympe.sc.Transaction.prototype.qj;
|
|
934
|
+
olympe.sc.Transaction.prototype.persist=olympe.sc.Transaction.prototype.persist;olympe.sc.Transaction.prototype.deleteAllRelations=olympe.sc.Transaction.prototype.Jm;olympe.sc.Transaction.prototype.deleteRelation=olympe.sc.Transaction.prototype.cc;olympe.sc.Transaction.prototype.createRelation=olympe.sc.Transaction.prototype.Va;olympe.sc.Transaction.prototype['delete']=olympe.sc.Transaction.prototype.delete;olympe.sc.Transaction.prototype.multiUpdate=olympe.sc.Transaction.prototype.Ox;
|
|
935
|
+
olympe.sc.Transaction.prototype.update=olympe.sc.Transaction.prototype.update;olympe.sc.Transaction.prototype.create=olympe.sc.Transaction.prototype.create;olympe.sc.Transaction.prototype.getId=olympe.sc.Transaction.prototype.Z;olympe.sc.Transaction.process=olympe.sc.Transaction.process;olympe.sc.Transaction.from=olympe.sc.Transaction.from;olympe.sc.Je.BrickMetadata=olympe.dm.BrickMetadata;olympe.sc.Je.we=olympe.dm.we;olympe.ka.node.qa={};const Oj={client:'client',hostname:'host',port:'port',user:'user',password:'password',Na:'database',schema:'schema',ny:'pollingFrequency',Gv:'burstTransactionInterval',Lx:'minConnections',Kx:'maxConnections',Jv:'connectionsTimeout'},Pj=olympe.dc.ha.ia.bm,Qj=olympe.dc.ha.ia.em,Rj=olympe.dc.ha.ia.QUERY_RESULT,Sj=olympe.dc.ha.ia.cm,Tj=olympe.dc.ha.ia.lg,Uj=olympe.dc.ha.ia.Rh,Vj=olympe.dc.ha.ia.vh,Wj=olympe.dc.ha.ia.vi,Xj=olympe.dc.ha.ia.uh,Yj=olympe.dc.ha.ia.dh,Zj=olympe.dc.ha.ia.Cj,ak=olympe.dc.ha.ia.zu;
|
|
936
|
+
function bk(a,b,c,d,e){const f=new olympe.H.wa.fb.tb(a.tag,b),g=new olympe.sc.X.at(a.N,a.zc,a.Sa);g.start(a.tag).catch(h=>a.N.error(`Error occurred while starting the file service of SQLConnector ${e}: ${h}`));f.listen().subscribe(h=>{var k=h.body();a.N.debug(`Serving a new message : ${k.t}`);switch(k.t){case Pj:var l=c.queryBuilder().withSchema(d);k=De(k.q);a.W(b,l,k,(t,u)=>{(u?h.xg(Error(u)):h.te({t:Rj,r:t})).then()});break;case Qj:k=De(k.q);ck(a,b,()=>c.queryBuilder().withSchema(d),k,h);break;
|
|
937
|
+
case ak:dk(b,k.i,h.source());h.Bk().then();break;case Yj:k=(new olympe.dc.X.Ji(a.Nb())).C(k.p);ek(a,b,c,d,k,t=>(t?h.xg(Error(t)):h.Bk()).then());break;case Xj:l=k.i;k=(new olympe.dc.X.Ji(a.Nb())).C(k.p);fk(a,b,l,k,c,d);break;case Tj:const n=b.get('_subscription_cache');k=k.s.reduce((t,u)=>{n.has(u)?gk(n.get(u),h.source()):t.push(u);return t},[]);(0<k.length?h.xg(Error(`These subscriptions was not kept alive: ${k}`)):h.Bk()).then();break;case Uj:const p=k.f;a.N.debug(`Uploading a file: ${p}`);k=qj(g,
|
|
938
|
+
(t,u,v)=>{a.N.debug(`Received a file service upload request for file : ${u}`);return p!==u?Promise.reject('The file sent is not the same as the one initially requested'):v instanceof Uint8Array||'string'===typeof v?hk(a,b,c,d,p,v).then(()=>new olympe.net.Sg('',olympe.net.eb.cd.kl)):Promise.reject(`Try to upload content for file ${p} but body is not a Uint8Array or a string`)});h.te(k).then();break;case Vj:const q=k.f;a.N.debug(`Serving a file: ${q}`);k=qj(g,(t,u)=>{a.N.debug(`File service received a download request for file : ${u}`);
|
|
939
|
+
return q!==u?Promise.reject('The file to download is not the same as the one initially requested'):ik(b,c.queryBuilder().withSchema(d),q).then(v=>{a.N.debug('File service download request, content is:',v);return new olympe.net.Sg(v,olympe.net.eb.cd.Hh)})});h.te(k).then();break;case Wj:const r=k.f;a.N.debug(`Deleting a file: ${r}`);k=qj(g,(t,u)=>r!==u?Promise.reject('The file to download is not the same as the one initially requested'):Promise.resolve(new olympe.net.Sg('',olympe.net.eb.cd.Hh)));h.te(k).then();
|
|
940
|
+
break;default:h.xg(Error(`Unsupported message type: ${k.t}`)).then()}})}function ck(a,b,c,d,e){const f=d.Z(),g=`sub${f}`;e.hn(g).then(()=>{const h=b.get('_subscription_cache');let k=h.get(f);k||(k=new jk(f,d,c,b.get('_polling_frequency'),a.W.bind(a,b),a.bc.bind(a,g,f),()=>h.delete(f)),h.set(f,k));gk(k,e.source())}).catch(h=>e.xg(Error(h)).then())}
|
|
941
|
+
function dk(a,b,c){(a=a.get('_subscription_cache').get(b))&&(a.C.delete(c)||olympe.ra.Ya('Subscription Cache').warn(`Try to unsubscribe to the subscription ${a.id} which is not registered.`))}function ek(a,b,c,d,e,f){b=b.get('_data_model_observer');a=new olympe.ka.node.qa.Ia.Gq(a.N,b);e.Mc(a);kk(a,c,d).then(()=>f(null)).catch(g=>f(g))}
|
|
942
|
+
function fk(a,b,c,d,e,f){const g=`_burst.${c}`,h=b.get(g);null===h?(b.set(g,d),setTimeout(()=>{const k=b.get(g);b.remove(g);ek(a,b,e,f,k,l=>{l&&olympe.H.wa.fb.tb.publish(c,{t:Zj,r:l})})},b.get('_burst_interval'))):d.Mc(h)}function hk(a,b,c,d,e,f){const g=olympe.ka.node.qa.Ia.Zc.Lj,h=new olympe.dc.db.uc;h.F(e,(new Map).set(g,f),0);h.Va(olympe.dc.jc.Tc,e,olympe.dc.za(olympe.dm.File));return new Promise((k,l)=>{ek(a,b,c,d,h,n=>n?l(n):k())})}
|
|
943
|
+
function ik(a,b,c){return x(function*(){var d=olympe.ka.node.qa.Ia.Zc.Lj,e=olympe.ka.node.qa.Ia.Zc.Jh;const f=yield lk(a.get('_data_model_observer').C,olympe.dc.za(olympe.dm.File));if((e=(yield b.from(f).select(d).where(e,c))[0])&&e[d])return d=e[d],d.buffer.slice(d.byteOffset,d.byteOffset+d.byteLength);throw Error(`File ${c} not found in the database`);}())}
|
|
944
|
+
olympe.ka.node.qa.Fq=class extends olympe.sc.logic.Ud{constructor(a,b,c,d){super(a,b,c);this.zc=d;this.Sa=olympe.U.getParameter(olympe.H.qb.Wl)}update(a,[b]){var c=(k,l)=>{let n,p;return null!=(p=null!=(n=olympe.U.getParameter(`${'dbconnector'}.${b}.${k}`))?n:olympe.U.getParameter(`${'dbconnector'}.${k}`))?p:l};a.set('_burst_interval',olympe.U.getParameter(`${'dbconnector'}.${b}.${Oj.Gv}`)||5E3);a.set('_polling_frequency',c(Oj.ny,6E5));const d=c(Oj.client,'pg'),e=c(Oj.hostname,''),f=c(Oj.Na),g=c(Oj.schema,
|
|
945
|
+
b),h=knex({client:d,connection:{host:e,port:c(Oj.port),user:c(Oj.user),password:c(Oj.password),database:f},pool:{min:c(Oj.Lx,0),max:c(Oj.Kx,10)},acquireConnectionTimeout:c(Oj.Jv,6E4)});this.N.info(`SQLConnector ${b} started with host ${e}, database ${f} on schema ${g}`);this.Hc=olympe.ra.Ya('sql');a.Xf(()=>h.destroy().then());c=new olympe.ka.node.qa.Ia.Os(h,g,this);a.set('_data_model_observer',c);a.set('_subscription_cache',new Map);bk(this,a,h,g,b)}W(a,b,c,d){a=a.get('_data_model_observer');const e=
|
|
946
|
+
a.C,f=new olympe.ka.node.qa.Ia.wu(c,e);mk(a).then(()=>nk(f)).then(g=>{if(0===g.length)return[[],g];const h=ok(new olympe.ka.node.qa.Ia.Eq(f,b,g));this.Hc.debug(`Sending a sql query with the following text: ${h.toString()}`);return h.then(k=>[k,g])}).then(([g,h])=>pk(c.Z(),g,h,e)).then(g=>d(g,null)).catch(g=>d({},g))}bc(a,b,c){olympe.H.wa.fb.tb.publish(a,{t:Sj,i:b,r:c}).then().catch(d=>this.N.error('Error occurred while publishing query result update: '+d))}};
|
|
947
|
+
olympe.ka.node.qa.Fq.O=olympe.dc.ya.C('017dc8db8074471acb7a',olympe.ka.node.qa.Fq,olympe.sc.P.Ea,olympe.net.P.tm);function gk(a,b){a.C.has(b)?Ga(a.C,b):a.C.add(b)}
|
|
948
|
+
class jk{constructor(a,b,c,d,e,f,g){this.id=a;this.query=b;a=new olympe.X.om(olympe.U.getParameter(olympe.ab.Config.Ml)+6E4);a.F=g;this.C=a;this.start(c,e,f,d)}start(a,b,c,d){let e=null,f=new Set;const g=()=>{0<this.C.values.size&&(b(a(),this.query,(h,k)=>{if(k)olympe.ra.Ya('Subscription Cache').error(`Error occurred while updating subscription cache update: ${k}`);else if(k=olympe.X.pb(JSON.stringify(h)),k!==e){e=k;k=h.k;const l=[];k.forEach((n,p)=>{f.has(n)?f.delete(n):l.push(p)});h.a=l;h.r=Array.from(f);
|
|
949
|
+
f=new Set(k);c(h)}}),setTimeout(g,d))};setTimeout(g,d)}};olympe.ka.node.qa.Ia={};olympe.ka.node.qa.Ia.vc={EQUAL:'equal',Jq:'substring',Io:'filter',up:'<=',vp:'<',Vo:'>=',Wo:'>',ag:'and',Ih:'or',Wg:'not',rq:'regex'};olympe.ka.node.qa.Ia.Zc={Jh:'tagOlympe',ck:'tagOlympeOrig',ol:'tagOlympeDest',Lj:'fileContent'};const qk=olympe.ka.node.qa.Ia.Zc.ck,rk=olympe.ka.node.qa.Ia.Zc.ol,sk=olympe.ka.node.qa.Ia.Zc.Jh,tk=olympe.ka.node.qa.Ia.Zc.Lj;function mk(a){return new Promise(b=>{0<a.F?a.R.add(()=>b()):b()})}
|
|
950
|
+
function uk(a){vk(a,olympe.dc.za(olympe.dm.File));const b=new Map;a.G.rb(olympe.sc.logic.Ud.C).observe(a.L).subscribe(c=>{He(c).forEach(d=>{const e=d.T();wk(a,()=>{var g=xk;const h=[{name:sk,Ze:sk,Mk:!1}];e===olympe.dc.za(olympe.dm.File)&&h.push({name:tk,Ze:tk,Mk:!1});return g(a,e,e,h)},`Create Table for ${e}`);const f=new olympe.D.Zb('Business model context',a.L);b.set(e,f);f.run(()=>yk(a,f,e))});Ie(c).forEach(d=>{b.get(d).destroy();wk(a,()=>zk(a,d),`Delete Table for ${d}`)})})}
|
|
951
|
+
function Ak(a){a.F++;1===a.F&&a.N.debug('Data model observer is busy')}function Bk(a){a.F--;if(0===a.F){a.N.debug('Data model observer is free');for(const b of a.R)b();a.R.clear()}}function vk(a,b){if(!a.db.Nk(a.G,olympe.sc.logic.Ud.C,b)){Ak(a);const c=new olympe.dc.Transaction;c.Va(olympe.sc.logic.Ud.C,a.G,b);c.kb((d,e)=>{d||a.N.error(`Error while linking the business model ${b} to the SQLConnector: ${e}`);Bk(a)},!0)}}function Ck(a){return a.client.schema.withSchema(a.schema)}
|
|
952
|
+
function wk(a,b,c){if(!a.L.$()&&!a.L.G()){a.N.debug(`Push operation:${c}`);Ak(a);var d=a.W,e=()=>{d.shift();Bk(a);if(0<d.length)d[0]()},f=()=>{b().then(()=>{a.N.debug(`Operation ${c} succeed`);e()}).catch(g=>{a.N.error(`Error for operation ${c}: ${g}`);e()})};d.push(f);1===d.length&&f()}}
|
|
953
|
+
function xk(a,b,c,d){return x(function*(){if(yield Ck(a).hasTable(b))return a.N.debug(`Table ${c} already exist`),Promise.resolve().then(()=>{var e=a.C;e.C.set(c,b);e.G.set(b,c)});a.N.debug('Create table for : '+c);return Ck(a).createTable(b,e=>{d.forEach(({name:f,Ze:g,ur:h,$r:k,Mk:l})=>{Dk(a,e,f,g,l,k,h)})}).then(()=>{var e=a.C;e.C.set(c,b);e.G.set(b,c)})}())}
|
|
954
|
+
function yk(a,b,c){b.onDestroy(()=>{wk(a,()=>Promise.all(Array.from(a.Oa.get(c)).map(d=>zk(a,d))).then(()=>{a.Oa.delete(c)}),`Destroy relation tables of business model ${c}: relations: ${a.Oa.get(c)}`)});a.jn(c,b);a.Oa.set(c,new Set);olympe.dc.gb.from(c).rb(olympe.dc.CloudObject.G).Bf().rb(olympe.dm.Relation.destinationModelRel).Bf().filter((new olympe.dc.ba.V.Ee(a.G)).rb(olympe.sc.logic.Ud.C.Ec())).observe(b).subscribe(d=>{0<He(d).length&&(a.N.debug('Handle new relations : '+He(d)),wk(a,()=>Promise.all(He(d).map(([e,
|
|
955
|
+
f])=>{a.Oa.get(c).add(e.T());a.Oa.get(f.T()).add(e.T());e=e.T();var g=xk;f=f.T();return g(a,e,e,[{name:qk,Ze:qk,$r:c,ur:sk,Mk:!0},{name:rk,Ze:rk,$r:f,ur:sk,Mk:!0}])})).then(),`Add relation tables for business model ${c}: ${He(d)}`));0<Ie(d).length&&(a.N.debug('Handle relations to remove : '+Ie(d)),wk(a,()=>Promise.all(Ie(d).map(([e,f])=>{a.Oa.get(c).delete(e);a.Oa.get(f).delete(e);return zk(a,e)})).then(),`Delete relation tables for business model ${c}: ${Ie(d)}`))})}
|
|
956
|
+
function zk(a,b){return x(function*(){try{var c=yield lk(a.C,b)}catch(d){a.N.warn(`Try to delete a table not registered: ${d}`);return}if(yield Ck(a).hasTable(c)){Ck(a).dropTable(c);c=a.C;const d=c.C.get(b);c.G.delete(d)||c.C.delete(b)}}())}
|
|
957
|
+
function Ek(a,b,c,d){return x(function*(){const e=yield lk(a.C,b),f=yield Promise.all(c.map(k=>Promise.resolve(k))),g=yield Promise.all(d.map(k=>Promise.resolve(k))),h=yield a.client.queryBuilder().withSchema(a.schema).table(e).columnInfo();return Ck(a).table(e,k=>{const l=new Set(Object.keys(h));f.forEach((n,p)=>{!l.has(n)&&Dk(a,k,n,c[p])});g.forEach(n=>{l.has(n)&&k.dropColumn(n)})})}())}
|
|
958
|
+
function Dk(a,b,c,d,e=!1,f='',g=''){if(c===sk)b.string(c,21).primary();else if(c===qk||c===rk){if(e)b.string(c).notNullable().references(g).inTable(`${a.schema}.${f}`).onDelete('CASCADE')}else c===tk?b.binary(c):d&&(a=a.db,d=olympe.dc.kd.from(d).rb(olympe.dm.Property.typeRel).Ic(),a.Tf(d,olympe.dm.String)?b.string(c,1E3):a.Tf(d,olympe.dm.Number)?b.double(c):a.Tf(d,olympe.dm.Boolean)?b.boolean(c):a.Tf(d,olympe.dm.DateTime)?b.string(c):a.Tf(d,olympe.dm.Color)&&b.string(c,50))}
|
|
959
|
+
olympe.ka.node.qa.Ia.Os=class{constructor(a,b,c){this.N=olympe.ra.Ya('sql');this.client=a;this.schema=b;this.G=c;this.C=new olympe.ka.node.qa.Ia.ev;this.L=new olympe.D.Zb(`Data Model Observer of ${c.T()}`);this.W=[];this.F=0;this.Oa=new Map;this.R=new Set;this.db=olympe.dc.Ja();uk(this)}jn(a,b){this.N.debug('Observe properties for '+a);olympe.dc.gb.from(a).rb(olympe.dc.CloudObject.propertyRel).observe(b).subscribe(c=>{this.N.debug('New properties for '+a+' '+He(c));wk(this,()=>Ek(this,a,He(c).map(d=>
|
|
960
|
+
d.T()),Ie(c)),`Update columns of ${a}: added: ${He(c)}, removed: ${Ie(c)}`)})}};const Fk=olympe.ka.node.qa.Ia.vc.EQUAL,Gk=olympe.ka.node.qa.Ia.vc.ag,Hk=olympe.ka.node.qa.Ia.vc.Ih,Ik=olympe.ka.node.qa.Ia.vc.Wg,Jk=olympe.ka.node.qa.Ia.vc.Io,Kk=olympe.ka.node.qa.Ia.vc.Vo,Lk=olympe.ka.node.qa.Ia.vc.Wo,Mk=olympe.ka.node.qa.Ia.vc.up,Nk=olympe.ka.node.qa.Ia.vc.vp,Ok=olympe.ka.node.qa.Ia.vc.rq,Pk=olympe.ka.node.qa.Ia.vc.Jq,Qk=olympe.ka.node.qa.Ia.Zc.Jh;
|
|
961
|
+
function nk(a){return x(function*(){var b=a.query.G;let c=b;var d=[];const e=a.query.C;let f=olympe.dc.Ja().kj(b);!f&&e[0]instanceof olympe.dc.ba.Gb.hf&&(f=e[0].Nd().nb(olympe.dc.CloudObject.instancesRel));if(f){try{var g=yield lk(a.F,b)}catch(l){return[]}f=!0;e.shift()}else{try{var h=yield a.F.Nb(b,'')}catch(l){return[]}c=h;g=yield Promise.resolve([['tagOlympe',b]]);1<g.length?d.push(['',Gk,g.map(([l,n])=>[l,Fk,Rk(n)])]):d.push([g[0][0],Fk,Rk(g[0][1])]);g=yield lk(a.F,h)}h=Sk(a,g);b=Array.from(a.query.F);
|
|
962
|
+
b=b.includes(0)||b.includes(1)&&f;var k=[];if(b){const l=a.query.Z(),n=Tk(a.F,l,c,Qk);k=olympe.dc.gb.from(c).rb(olympe.dc.CloudObject.propertyRel).Ic().map(q=>q.T());const p=yield Promise.all(k.map(q=>Promise.resolve(q)));k=k.map(q=>Tk(a.F,l,c,q)).map((q,r)=>[q,p[r]]);k.unshift([n,Qk])}a.G.limit=a.query.max;a.G.offset=a.query.offset;a.C.push({Jg:b,recursive:!1,filters:d,hh:'',ai:'',Yh:k,eh:h,name:g});d=0;for(const l of e)d=yield Uk(a,l,d,f);return a.C}())}
|
|
963
|
+
function Sk(a,b){a.R++;return`alias-${b.charAt(0)}${a.R}`}function Uk(a,b,c,d){let e=c;switch(!0){case b instanceof olympe.dc.ba.Gb.hf:case b instanceof olympe.dc.ba.Gb.jf:e+=1;a=Vk(a,b,e,d);break;case b instanceof olympe.dc.ba.Gb.rc:a=Wk(a,b);break;case b instanceof olympe.dc.ba.Gb.Nh:a=Xk(a,b);break;default:a=Promise.reject(`Query part ${b.toString()} could not be parsed`)}return a.then(()=>e)}
|
|
964
|
+
function Vk(a,b,c,d){const e=b.Nd().T(),f=b.Nd().Ra()===olympe.dc.Ca.ORIGIN?olympe.dm.Relation.originModelRel:olympe.dm.Relation.destinationModelRel;let g=b instanceof olympe.dc.ba.Gb.jf;const h=olympe.dm.Relation.F.Nl,k=olympe.dc.kd.from(e).rb(f).Ic();c=d?c+1:c;const l=Array.from(a.query.F).includes(c),[n,p]=['',''];return lk(a.F,k.T()).then(q=>x(function*(){const r=Sk(a,q),t=[];let u=Promise.resolve();h===olympe.dm.Relation.F.Nl&&(u=lk(a.F,e).then(v=>{const w=Sk(a,v),[y,B]=Yk(b.Nd().Ra());a.C.push({Jg:!1,
|
|
965
|
+
eh:w,name:v,Yh:[],hh:y,ai:B,filters:[],recursive:g});g=!1}));return u.then(()=>x(function*(){let v=[];var w=Promise.resolve([]);let y=[];if(l){const B=a.query.Z(),E=Tk(a.F,B,k.T(),Qk);w=olympe.dc.gb.from(k.T()).rb(olympe.dc.CloudObject.propertyRel).Bf().Ic().map(I=>I.T());v=w.map(I=>Tk(a.F,B,k.T(),I));w=Promise.all(w.map(I=>Promise.resolve(I)));y.push([Tk(a.F,B,k.T(),Qk),Qk]);const S=yield w;y=v.map((I,aa)=>[I,S[aa]]);y.unshift([E,Qk])}a.C.push({Jg:l,eh:r,name:q,Yh:y,hh:n,ai:p,filters:t,recursive:g})}()))}()))}
|
|
966
|
+
function Wk(a,b){return a.L(b.C).then(c=>{a.C[a.C.length-1].filters.push(c)})}function Xk(a,b){a.G.order=b.order;a.G.aliasSorting=a.C[a.C.length-1].eh;return Promise.resolve(b.cb().T()).then(c=>{a.G.columnSorting=c})}function Yk(a){const b=olympe.ka.node.qa.Ia.Zc.ck,c=olympe.ka.node.qa.Ia.Zc.ol;return a===olympe.dc.Ca.ORIGIN?[c,b]:[b,c]}
|
|
967
|
+
olympe.ka.node.qa.Ia.wu=class{constructor(a,b){this.query=a;this.R=0;this.F=b;this.C=[];this.G={}}L(a){switch(!0){case a instanceof olympe.dc.ba.V.Fc:const c=a.C;return Promise.resolve(a.cb()).then(h=>[h,Fk,Rk(c)]);case a instanceof olympe.dc.ba.V.Sc:const d=a.substring;return Promise.resolve(a.cb()).then(h=>[h,Pk,d]);case a instanceof olympe.dc.ba.V.ud:var b=a.C.source;return/^\^?([-_%\u0153\u0152\u00e6\u00c6\u00e5\u00c5\u00f8\u00d8&/\u00df\u00a1\u00bf=\u00e0\u00c0\u00e2\u00c2\u00e4\u00c4\u00e1\u00c1\u00e9\u00c9\u00e8\u00c8\u00ea\u00ca\u00eb\u00cb\u00ec\u00cc\u00ee\u00ce\u00ef\u00cf\u00f2\u00d2\u00f4\u00d4\u00f6\u00d6\u00f9\u00d9\u00fb\u00db\u00fc\u00dc\u00e7\u00c7\u2019\u00f1\u00e3\u00f5\u00c3\u00d5\u00d1]|\w|\s|\d|\\'|\\"|\.\+\?|\.\*|\.\+|\\\/|\\\\|\\\^|\\\$|\\\.|\\\?|\\\*|\\\+|\\\(|\\\)|\\\||\\\[|\\\]|\\\{|\\\})*\$*?$/.test(b)?
|
|
968
|
+
Promise.resolve(a.cb()).then(h=>[h,Ok,a.C]):Promise.reject(`Query not supported for regex : ${b}`);case a instanceof olympe.dc.ba.V.jd:return this.L(a.C).then(h=>['',Ik,h]);case a instanceof olympe.dc.ba.V.Ee:const e=a.destination,f=Array.from(a.recursive);if(f.reduce((h,k)=>h||k,!1))return Promise.reject('Recursive relation in RelatedTo predicate is not supported');b=a.ed().map((h,k)=>Promise.resolve(h.T()).then(l=>{const [n,p]=Yk(h.Ra());let q=[];e&&k===a.ed().length-1&&(q=[[p,Fk,Rk(e)]]);return{name:l,
|
|
969
|
+
recursive:f[k],Yh:[],hh:n,ai:p,filters:q,eh:Sk(this,l),Jg:!1}}),this);let g;g=e?Promise.resolve([['tagOlympe',e]]):Promise.resolve([]);return Promise.all(b).then(h=>{var k=this.C[this.C.length-1];k={name:k.name,recursive:!1,Yh:[[Qk,Qk]],hh:'',ai:'',filters:[],eh:Sk(this,k.name),Jg:!0};h.unshift(k);return g.then(l=>['',Jk,{target:l,Oa:h}])});case a instanceof olympe.dc.ba.V.Ah:return Promise.resolve(a.cb()).then(h=>('number'===typeof a.C?Promise.resolve(a.C):Promise.resolve(a.C.T())).then(k=>{var l=
|
|
970
|
+
a.G;return Promise.resolve([h,a.F?l?Nk:Mk:l?Lk:Kk,k])}));case a instanceof olympe.dc.ba.V.Qd:return b=Array.from(a.V).flatMap(this.L.bind(this)),Promise.all(b).then(h=>['',Gk,h]);case a instanceof olympe.dc.ba.V.Zd:return b=Array.from(a.V).flatMap(this.L.bind(this)),Promise.all(b).then(h=>['',Hk,h]);default:return Promise.reject('Failed to parse predicate')}}};function pk(a,b,c,d){const e=[],f=new olympe.dc.transaction.td;let g,h,k,l;const n=null==(g=c[0])?void 0:null==(h=g.filters)?void 0:null==(k=h[0])?void 0:null==(l=k[2])?void 0:l.v;return Zk(c,d).then(p=>{for(const r of b){const [t,u,v]=$k(a,r,p,d,c,n);for(const [w,y,B]of v)f.Va(w,y,B);var q=Array.from(t.keys()).map(w=>w).join('.');e.push(q);for(const [w,y]of t.entries())q=u.get(w),d.L.set(w,q),f.F(w,new Map(y),0),f.Va(olympe.dc.CloudObject.modelRel.T(),w,q,0)}d.F.delete(a);return{k:e,p:je(f)}})}
|
|
971
|
+
function Zk(a,b){const c=[],d=[],e=[],f=[];for(let g=1;g<a.length-1;g+=2)(a[g-1].Jg||1===g)&&a[g+1].Jg&&(d.push(b.Mf(a[g-1].name)),e.push(b.Mf(a[g+1].name)),c.push(Promise.resolve(b.G.get(a[g].name))),f.push(a[g].hh===olympe.ka.node.qa.Ia.Zc.ck?olympe.dc.Ca.DESTINATION:olympe.dc.Ca.ORIGIN));return Promise.all([Promise.all(c),Promise.all(d),Promise.all(e)]).then(([g,h,k])=>g.map((l,n)=>[l,h[n],k[n],f[n]]))}
|
|
972
|
+
function $k(a,b,c,d,e,f){const g=olympe.ka.node.qa.Ia.Zc.Jh;let h=0;let k='',l='',n=0;const p=new Map,q=new Map,r=[];for(const [u,v]of Object.entries(b)){b=v;var t=u.split(';');if(t[1]===g){h=parseInt(t[0],10);t=al(d,a,h);if(n<c.length){const w=c[n][3],y=c[n][0];if(k===c[n][1]&&t===c[n][2])r.push(w===olympe.dc.Ca.DESTINATION?[y,l,b]:[y,b,l]),n++;else{let B;!k&&t===(null==(B=e[2])?void 0:B.name)&&f&&(r.push(w===olympe.dc.Ca.DESTINATION?[y,f,b]:[y,b,f]),n++)}}p.set(b,[]);q.set(b,t);d.L.set(b,t);k=t;
|
|
973
|
+
l=b}else h===parseInt(t[0],10)&&(t=t[1],p.get(l).push([t,b]))}return[p,q,r]}olympe.ka.node.qa.Ia.SA=class{};function ok(a){const b=a.C,{offset:c,limit:d,PC:e,order:f,KC:g}=a.R.G;-1<d&&b.limit(d);0<c&&b.offset(c);e&&f&&b.orderBy(`${g}.${e}`,f.toLowerCase());for(const [h,{Jg:k,eh:l,name:n,filters:p,recursive:q,Yh:r,hh:t,ai:u}]of a.W.entries())bl(a,b,k,l,n,p,q,0===h,t,u,r);return b}
|
|
974
|
+
function bl(a,b,c,d,e,f,g,h,k,l,n){if(c){if(!n||1>n.length)throw Error('Trying to return an element without providing mappings in SQLBuilder:BuildNodes');c=n.map(([p,q])=>b.client.raw('??.?? as ??',[d,q,p])).join(',');b.select(b.client.raw(c))}0<f.length&&cl(a,b,d,f,olympe.ka.node.qa.Ia.nd.NONE);h?(b.from(`${e} as ${d}`),a.G=d,a.F=l):(g&&(f=`cte${a.L++}`,dl(a,b,f,d,e)),b.join(`${e} as ${d}`,p=>{var q=a.G,r=a.F;p.on(''===r?`${q}.tagOlympe`:`${q}.${r}`,''===k?`${d}.tagOlympe`:`${d}.${k}`);a.G=d;a.F=
|
|
975
975
|
l}))}
|
|
976
|
-
function
|
|
977
|
-
y.v,!1);break;case u:a=
|
|
978
|
-
typeof y);break;case r:
|
|
979
|
-
function
|
|
980
|
-
function
|
|
981
|
-
function
|
|
982
|
-
function
|
|
983
|
-
a=a.source;a.startsWith('^')?a=a.substring(1,a.length):c='%';for(a.endsWith('$')?a=a.substring(0,a.length-1):e='%';''!==a;){{var l=a;var n=b,p=k,q=h,r=f;const v=g.exec(l);if(v)l=[`\\${v[0]}`,v[0].length];else if(p=p.exec(l))l=[
|
|
984
|
-
a.length)}return c+d+e}olympe.ka.node.qa.Ia.
|
|
985
|
-
olympe.ka.node.qa.Ia.
|
|
986
|
-
d);var e=olympe.dc.gb.from(d).rb(olympe.dc.CloudObject.G).Ic();for(var f of e.keys())e=yield Promise.resolve(f),yield b.table(e).where(
|
|
987
|
-
(e.C.L.set(b,c),yield d.table(g).insert(e.rh(b,f,!0))):yield d.table(g).where(
|
|
988
|
-
olympe.ka.node.qa.Ia.
|
|
976
|
+
function cl(a,b,c,d,e){const f=olympe.ka.node.qa.Ia.vc.EQUAL,g=olympe.ka.node.qa.Ia.vc.ag,h=olympe.ka.node.qa.Ia.vc.Ih,k=olympe.ka.node.qa.Ia.vc.Wg,l=olympe.ka.node.qa.Ia.vc.Io,n=olympe.ka.node.qa.Ia.vc.Vo,p=olympe.ka.node.qa.Ia.vc.Wo,q=olympe.ka.node.qa.Ia.vc.up,r=olympe.ka.node.qa.Ia.vc.vp,t=olympe.ka.node.qa.Ia.vc.rq,u=olympe.ka.node.qa.Ia.vc.Jq;if(1<d.length)el(b,olympe.ka.node.qa.Ia.nd.ag,fl(a,d,olympe.ka.node.qa.Ia.nd.ag,c));else{var [v,w,y]=d[0];d=`${c}.${v}`;switch(w){case f:gl(b,e,d,'=',
|
|
977
|
+
y.v,!1);break;case u:a=hl('.*',b.client.dialect);gl(b,e,d,'LIKE',`${a}${y}${a}`,!1);break;case l:const B=y.relations,E=`cte${a.L++}`,S=new olympe.ka.node.qa.Ia.Eq(a.R,a.C,B),I=olympe.ka.node.qa.Ia.Zc.Jh;a.C.with(E,aa=>{for(const [ul,{Jg:vl,eh:wl,name:xl,filters:yl,recursive:zl,Yh:Al,hh:Bl,ai:Cl}]of B.entries())bl(S,aa,vl,wl,xl,yl,zl,0===ul,Bl,Cl,Al);return aa});a.C.whereIn(b.client.raw('??.??',[c,I]),function(aa){aa.select(b.client.raw('??.??',[E,I])).from(E)});break;case q:gl(b,e,d,'<=',y,'string'===
|
|
978
|
+
typeof y);break;case r:gl(b,e,d,'<',y,'string'===typeof y);break;case n:gl(b,e,d,'>=',y,'string'===typeof y);break;case p:gl(b,e,d,'>',y,'string'===typeof y);break;case g:el(b,e,fl(a,y,olympe.ka.node.qa.Ia.nd.ag,c));break;case h:el(b,e,fl(a,y,olympe.ka.node.qa.Ia.nd.Ih,c));break;case k:el(b,olympe.ka.node.qa.Ia.nd.Wg,fl(a,[y],olympe.ka.node.qa.Ia.nd.Wg,c));break;case t:e=il(y,b.client.dialect),b.whereRaw('?? LIKE ?',[d,e])}}}
|
|
979
|
+
function dl(a,b,c,d,e){var f=['tagOlympe'];const g=jl(f,d),h=jl(f,c),k=g.map((l,n)=>[l,h[n]]);b.withRecursive(c,g,l=>{l.select(g).from({[d]:e}).xD(n=>n.select(g).from({[d]:e}).join(c,()=>{a.on(Object.fromEntries(k))}))})}function jl(a,b){return a.map(c=>`${b}.${c}`)}
|
|
980
|
+
function el(a,b,c){switch(b){case olympe.ka.node.qa.Ia.nd.NONE:a.where(c);break;case olympe.ka.node.qa.Ia.nd.ag:a.andWhere(c);break;case olympe.ka.node.qa.Ia.nd.Ih:a.orWhere(c);break;case olympe.ka.node.qa.Ia.nd.Wg:a.whereNot(c);break;default:olympe.ra.Ya('storage').error(`Where operand ${b} not recognized`)}}function fl(a,b,c,d){return e=>{for(let f=0;f<b.length;++f)cl(a,e,d,[b[f]],0===f?olympe.ka.node.qa.Ia.nd.NONE:c)}}
|
|
981
|
+
function gl(a,b,c,d,e,f){e=f?a.client.raw(e):e;switch(b){case olympe.ka.node.qa.Ia.nd.NONE:a.where(c,d,e);break;case olympe.ka.node.qa.Ia.nd.ag:a.andWhere(c,d,e);break;case olympe.ka.node.qa.Ia.nd.Ih:a.orWhere(c,d,e);break;case olympe.ka.node.qa.Ia.nd.Wg:a.whereNot(c,d,e);break;default:olympe.ra.Ya('storage').error(`Where operand ${b} not recognized`)}}function hl(a,b){const c={'.+?':'_','.*':'%','.+':'_%'},d={'.+?':'?','.*':'*','.+':'?*'};return'mssql'===b?d[a]:c[a]}
|
|
982
|
+
function il(a,b){let c='',d='',e='';const f=/^([-\u0153\u0152\u00e6\u00c6\u00e5\u00c5\u00f8\u00d8&/\u00df\u00a1\u00bf=\u00e0\u00c0\u00e2\u00c2\u00e4\u00c4\u00e1\u00c1\u00e9\u00c9\u00e8\u00c8\u00ea\u00ca\u00eb\u00cb\u00ec\u00cc\u00ee\u00ce\u00ef\u00cf\u00f2\u00d2\u00f4\u00d4\u00f6\u00d6\u00f9\u00d9\u00fb\u00db\u00fc\u00dc\u00e7\u00c7\u2019\u00f1\u00e3\u00f5\u00c3\u00d5\u00d1]|\w|\s|\d|\\\\)/,g=/^[%_'"]/,h=/^(\\\^|\\\/|\\\$|\\\.|\\\?|\\\*|\\\+|\\\(|\\\)|\\\[|\\\]|\\\{|\\\}])/,k=/^(\.\+\?|\.\*|\.\+)/;
|
|
983
|
+
a=a.source;a.startsWith('^')?a=a.substring(1,a.length):c='%';for(a.endsWith('$')?a=a.substring(0,a.length-1):e='%';''!==a;){{var l=a;var n=b,p=k,q=h,r=f;const v=g.exec(l);if(v)l=[`\\${v[0]}`,v[0].length];else if(p=p.exec(l))l=[hl(p[0],n),p[0].length];else if(q=q.exec(l))l=q[0],l='mssql'!==n||'['!==l[1]&&']'!==l[1]?[l.substring(1,l.length),l.length]:[l,q[0].length];else if(n=r.exec(l))l=[n[0],n[0].length];else throw Error(`Could find a match for character ${l.charAt(0)}`);}const [t,u]=l;d+=t;a=a.substring(u,
|
|
984
|
+
a.length)}return c+d+e}olympe.ka.node.qa.Ia.Eq=class{constructor(a,b,c){this.R=a;this.C=b;this.G=this.F='';this.L=0;this.W=c}};olympe.ka.node.qa.Ia.nd={ag:'&',Ih:'|',Wg:'!',NONE:''};const kl=olympe.ka.node.qa.Ia.Zc.ck,ll=olympe.ka.node.qa.Ia.Zc.ol,ml=olympe.ka.node.qa.Ia.Zc.Jh,nl=olympe.ka.node.qa.Ia.Zc.Lj,ol=olympe.dc.Yb.VERSION,pl=olympe.dc.Yb.Gd;function kk(a,b,c){return x(function*(){yield mk(a.L);return b.transaction(d=>x(function*(){for(const e of a.va)yield e(d.withSchema(c));a.N.debug('Transaction just before commit: ',d.toString());return d}())).finally(()=>{a.va.length=0;a.G.clear();a.N.debug('Transaction completed')})}())}
|
|
985
|
+
olympe.ka.node.qa.Ia.Gq=class{constructor(a,b){this.N=a;this.L=b;this.C=b.C;this.G=new Map;this.va=[]}rh(a,b,c=!0){a=c?{[ml]:a}:{};for(const [d,e]of b)b=Rk(e),a[d]=b.v;return a}F(a,b){b.delete(pl);b.delete(ol);this.G.set(a,b||new Map)}qc(a,b){this.va.push(c=>{const d=this;return x(function*(){b.delete(ol);var e=yield d.C.Nb(a,'');e=yield lk(d.C,e);yield c.table(e).where(ml,a).update(d.rh(a,b,!1))}())})}Dc(a){this.va.push(b=>{const c=this;return x(function*(){var d=yield c.C.Nb(a,'');d=yield lk(c.C,
|
|
986
|
+
d);var e=olympe.dc.gb.from(d).rb(olympe.dc.CloudObject.G).Ic();for(var f of e.keys())e=yield Promise.resolve(f),yield b.table(e).where(kl,a).del();f=olympe.dc.gb.from(d).rb(olympe.dc.CloudObject.R).Ic();for(const g of f.keys())f=yield Promise.resolve(g),yield b.table(f).where(ll,a).del();yield b.table(d).where(ml,a).del()}())})}Va(a,b,c){a===olympe.dc.jc.Tc?(vk(this.L,c),this.va.push(d=>{const e=this;return x(function*(){const f=e.G.get(b),g=yield lk(e.C,c);c!==olympe.dc.za(olympe.dm.File)||f.has(nl)?
|
|
987
|
+
(e.C.L.set(b,c),yield d.table(g).insert(e.rh(b,f,!0))):yield d.table(g).where(ml,b).update(e.rh(b,f,!1))}())})):this.va.push(d=>x(function*(){const e=yield Promise.resolve(a);yield d.table(e).insert({[kl]:b,[ll]:c})}()))}cc(a,b,c){this.va.push(d=>x(function*(){const e=yield Promise.resolve(a);yield d.table(e).where({[kl]:b,[ll]:c}).del()}()))}};olympe.ka.node.qa.Ia.Gq.ma=[olympe.dc.Writable];function lk(a,b){return(a=a.C.get(b))?Promise.resolve(a):Promise.reject(`No table were found for model ${a}`)}function Tk(a,b,c,d){let e=a.F.get(b);e||(e=new Map,a.F.set(b,e));a=e.get(c);a||(a=e.size+1,e.set(c,a));return`${a};${d}`}function al(a,b,c){a=a.F.get(b)||new Map;return(a=Array.from(a).find(([,d])=>d===c))&&a[0]||null}
|
|
988
|
+
olympe.ka.node.qa.Ia.ev=class{constructor(){this.L=new Map;this.F=new Map;this.C=new Map;this.G=new Map}static T(a,b,c){return c?b[0][1]:''}Mf(a){return Promise.resolve(a)}cb(a){return Promise.resolve(a)}Nb(a){return(a=this.L.get(a))?Promise.resolve(a):Promise.reject('GET MODEL TAG OF INSTANCE NOT IMPLEMENTED')}};function Rk(a){let b=1,c=a;switch(!0){case a instanceof Date:b=2;c=a.toJSON();break;case a instanceof olympe.D.Color:b=3,c=`${a.Qf().valueOf()}.${a.Kf().valueOf()}.${a.Ff().valueOf()}.${a.Ef().valueOf()}`}return{t:b,v:c}}olympe.ka.node.qa.Ia.HC=class{};olympe.ka.node.host={};olympe.ka.node.host.Fd=function(a,b){this.N=b};olympe.ka.node.host.Fd.prototype.constructor=olympe.ka.node.host.Fd;olympe.ka.node.host.Fd.prototype.destroy=function(){};olympe.ka.node.host.Fd.prototype.destroy=olympe.ka.node.host.Fd.prototype.destroy;olympe.ka.node.host.Fd.prototype.Ya=function(){return this.N};olympe.ka.node.host.Fd.ma=[olympe.host.ba.Fd];olympe.ka.node.host.Rp=class{constructor(a){this.N=a}lj(){return!1}Pk(){this.N.error('No history manager implemented in Node')}C(){this.Pk();return Ib()}F(){this.Pk()}};olympe.ka.node.host.Rp.ma=[olympe.host.Di];olympe.ka.node.host.bd=class{constructor(){this.C={};this.L={}}destroy(){}R(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]}W(a,b,c){this.L[b]=setInterval(c,a)}F(a){clearInterval(this.L[a]);delete this.L[a]}};olympe.host.Qp.register(olympe.host.ba.Pp.dr,olympe.ka.node.host.bd);olympe.ka.node.host.bd.ma=[olympe.host.ba.bd];olympe.ka.node.host.rk=class{constructor(a){this.N=a}};olympe.ka.node.host.rk.ma=[olympe.host.rk];olympe.U.config(function(a){ra(a,olympe.host.P.xl,olympe.ka.node.host.Rp,olympe.host.P.Ea);ra(a,olympe.host.P.Mq,olympe.ka.node.host.rk,olympe.host.P.Ea)},'olympe.native.node.host');olympe.net.pd={};olympe.net.pd.Bl=class{constructor(a){this.N=a;this.C=new Map}G(){}F(){}};olympe.net.pd.WebSocket=class{constructor(a,b){this.N=b;this.id=a;this.C=null;this.buffer=[];this.R=this.G=this.L=this.W=null}Z(){return this.id}open(a){const b=`#${this.id}`,c=this.ta(a);c.binaryType='arraybuffer';c.onopen=()=>{this.N.info('Websocket OPENED');this.W?(this.N.debug('Notifying upper layer for WebSocket',b),this.W()):this.N.warn('Nothing to notify for WebSocket',b);this.N.debug(b,`Send all buffered messages (n=${this.buffer.length}).`);this.buffer.forEach(c.send.bind(c));this.buffer.length=
|
|
989
989
|
0};c.onmessage=d=>{d='string'===typeof d.data?String(d.data):Ea(d.data);this.N.debug(b,'<',d);this.G&&this.G(d)};c.onclose=()=>{this.N.debug(`WebSocket ${b} CLOSED`);this.L&&this.L()};c.onerror=()=>{this.N.debug(`WebSocket ${b} ERROR`);this.R&&this.R()};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.N.debug(b,'>',a);this.C.send(a);break;case c.CONNECTING:this.N.debug(b,'- Connecting: BUFFER','>',a);this.buffer.push(a);
|
|
990
990
|
break;default:return this.N.debug(b,'- Closed','>',a),!1}}else this.N.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.N.debug(`Force closing native websocket ${`#${this.id}`}`);this.C.close(1E3);return}}this.N.debug('Try to force close native websocket, but not open nor connecting')}ja(a){this.W=a||null}da(a){this.G=a||null}F(a){this.R=a||null}$(a){this.L=a||null}ta(){}};
|
|
991
|
-
olympe.net.pd.WebSocket.ma=[olympe.net.WebSocket];olympe.ka.node.net={};olympe.ka.node.net.
|
|
992
|
-
olympe.ka.node.net.
|
|
993
|
-
(new Uint8Array(Buffer.from(S,'binary'))).buffer;I=v===olympe.net.eb.ResponseType.
|
|
994
|
-
ArrayBuffer?Buffer.from(E):E);B.end()})};d&&(h||k||l)?h&&k&&l?(b.rejectUnauthorized=n,g(h,'key',b).then(g.bind(null,k,'cert')).then(g.bind(null,l,'ca')).then(p).catch(w=>{this.N.log('Error loading self signed files:',w)})):this.N.warn('All three self signed files must be specified!'):p(b)}F(a,b,c,d){this.N.debug('Received HTTP response',a,c);return new olympe.net.Sg(c,a,b,d)}};olympe.ka.node.net.
|
|
995
|
-
function
|
|
996
|
-
ArrayBuffer?'binary':l);d.code(k.Od()).headers(k.
|
|
997
|
-
olympe.ka.node.net.http.
|
|
998
|
-
default:return Promise.reject('Webservice in unknown state')}}W(a){this.G.delete(a);this.stop();return 0===this.G.size?Promise.resolve():this.start()}stop(){this.C===
|
|
999
|
-
d),a())})}):Promise.reject('Try to start a webservice already started')}createServer(){const a=
|
|
1000
|
-
b&&b(!0)}clear(){this.C||this.open();this.db.setState({})}};olympe.ka.node.hc.
|
|
1001
|
-
function
|
|
1002
|
-
f.toLowerCase():e.test(f)&&(f=parseFloat(f));a[g[1]]=f}a=new olympe.U.
|
|
1003
|
-
e),oa(c);c.debug('done calling run callbacks. DI process completed!')}}olympe.X.
|
|
1004
|
-
this.F.run()):this.N.error('No app registered under name: '+this.C)}};olympe.tc.
|
|
1005
|
-
olympe.U.run([olympe.tc.P.Aa],a=>a.run(),'olympe.hc');olympe.sc.Zf={};function
|
|
991
|
+
olympe.net.pd.WebSocket.ma=[olympe.net.WebSocket];olympe.ka.node.net={};olympe.ka.node.net.hu=class extends olympe.net.pa{constructor(a,b){super(a,b);this.$=new olympe.ka.node.net.Bl(a)}W(){return'NodeJS'}G(a){var b=this.L++;a=a.C();this.N.debug('CREATE Websocket #'+b+' to '+a);b=new olympe.ka.node.net.iu(b,this.N);b.open(a);return b}C(a,b){this.N.debug('SEND HTTP '+a.method+' to '+a.C());const c=this.L++;b=Sb(this,c,b);this.$.G(c,{u:a.C(),s:Ob(a),h:Mb(a),p:a.port,z:Nb(a),q:Rb(a),m:a.method,v:a.fj(),k:a.key,c:a.cert,a:a.ca,j:a.rejectUnauthorized,b:a.body,r:a.F},b)}R(){this.N.warn('DOWNLOAD FILE not available with node native implementation. URL:')}F(){return this.$}};const ql=require('fs'),rl=require('http'),sl=require('https');
|
|
992
|
+
olympe.ka.node.net.Bl=class extends olympe.net.pd.Bl{G(a,b,c){const d=b.s,e=b.b,f=b.m;var g=b.v;const h=b.k,k=b.c,l=b.a,n=b.j;var p=b.h;const q=b.p;let r=b.z;r.startsWith('/')||(r=`/${r}`);const t=b.q,u=b.u,v=b.r;b={host:p,port:q,path:t?r+'?'+t:r,method:f};g&&(b.headers=g);g=(w,y,B)=>new Promise((E,S)=>{ql.readFile(w,(I,aa)=>{I?S(I):(B[y]=aa,E(B))})});p=w=>{const y=E=>{E.setEncoding(v===olympe.net.eb.ResponseType.sk?'utf-8':'binary');let S='';E.on('data',I=>{S+=I});E.on('end',()=>{if(v!==olympe.net.eb.ResponseType.sk){var I=
|
|
993
|
+
(new Uint8Array(Buffer.from(S,'binary'))).buffer;I=v===olympe.net.eb.ResponseType.el?new Blob([I]):I}else I=S;c(this.F(E.statusCode,E.statusMessage,I,E.headers))})},B=d?new sl.request(w,y):new rl.request(w,y);this.C.set(a,()=>{B.destroy()});B.on('error',E=>{c(this.F(0,'Conection refused','Error connecting to '+u+' with method '+f+', code = '+E.code+', message = '+E.message,''))});!e||'POST'!==f&&'PUT'!==f?B.end():(e instanceof Blob?e.arrayBuffer():Promise.resolve(e)).then(E=>{B.write(E instanceof
|
|
994
|
+
ArrayBuffer?Buffer.from(E):E);B.end()})};d&&(h||k||l)?h&&k&&l?(b.rejectUnauthorized=n,g(h,'key',b).then(g.bind(null,k,'cert')).then(g.bind(null,l,'ca')).then(p).catch(w=>{this.N.log('Error loading self signed files:',w)})):this.N.warn('All three self signed files must be specified!'):p(b)}F(a,b,c,d){this.N.debug('Received HTTP response',a,c);return new olympe.net.Sg(c,a,b,d)}};olympe.ka.node.net.iu=class extends olympe.net.pd.WebSocket{ta(a){return new (require('ws'))(a)}};olympe.ka.node.net.Config={gC:'native.html.net.useWorkers'};olympe.U.config(function(a){ra(a,olympe.net.P.Aa,olympe.ka.node.net.hu,olympe.net.P.Ea,olympe.host.P.Aa)},'olympe.native.node.net');olympe.ka.node.net.http={};const tl=require('fastify'),Dl=require('fastify-cors'),El={Oi:0,lm:1,nk:2};
|
|
995
|
+
function Fl(a,b){a.F.route({bodyLimit:1048576*a.da,url:b.path,method:b.methods,handler:(c,d)=>{a.N.debug('< HTTP:',c);var e=c.body,f='';e instanceof Buffer?(f=new Uint8Array(e.length),e.copy(f)):'string'===typeof e&&(f=e);const [g,h]=c.hostname.split(':');e=new olympe.net.Sj(g,parseInt(h,10),c.url,'https'===c.protocol,c.method,f);for(const [k,l]of Object.entries(c.headers))e.headers[k]=l;b.ux(e,new Map(Object.entries(c.params))).then(k=>{const l=k.getData();a.N.debug('> HTTP: reply with body:',l instanceof
|
|
996
|
+
ArrayBuffer?'binary':l);d.code(k.Od()).headers(k.fj()).send(l instanceof ArrayBuffer?Buffer.from(l):l)}).catch(k=>{a.N.debug('> HTTP: reply with internal server error:',k);d.code(olympe.net.eb.cd.Bq).header(olympe.net.eb.Headers.Ej,'text/plain').send({error:`Internal server error: ${k}`})})}})}
|
|
997
|
+
olympe.ka.node.net.http.xk=class extends olympe.net.xk{constructor(a,b,c,d){super(a);this.da=d;this.F=this.createServer();this.host=b;this.port=c;this.G=new Map;this.R=null;this.C=El.Oi;this.Ke=new Set}$(a,b){this.R={origin:'*',methods:a,allowedHeaders:b};return this}L(a,b,c,d){this.G.set(a,{path:b,methods:c,ux:d});switch(this.C){case El.Oi:return this.start();case El.nk:return this.stop(),this.start();case El.lm:return(new Promise((e,f)=>{this.Ke.add(g=>g?f(g):e())})).then(()=>{this.stop();return this.start()});
|
|
998
|
+
default:return Promise.reject('Webservice in unknown state')}}W(a){this.G.delete(a);this.stop();return 0===this.G.size?Promise.resolve():this.start()}stop(){this.C===El.nk&&(this.F.close(),this.C=El.Oi,this.F=this.createServer())}start(){return this.C===El.Oi?new Promise((a,b)=>{this.F.register(Dl,this.R);for(const c of this.G.values())Fl(this,c);this.C=El.lm;this.F.listen(this.port,'0.0.0.0',(c,d)=>{this.C=El.nk;this.Ke.forEach(e=>e(c));this.Ke.clear();c?(this.stop(),b(c)):(this.N.debug('Web server listening on '+
|
|
999
|
+
d),a())})}):Promise.reject('Try to start a webservice already started')}createServer(){const a=tl({logger:!0});a.addContentTypeParser('*',{parseAs:'buffer'},(b,c,d)=>{d(null,c)});return a}};olympe.U.config(function(a){A(a,olympe.net.P.tm,olympe.ka.node.net.http.xk,olympe.net.P.Ea,new olympe.U.fa(olympe.net.Config.yl),new olympe.U.fa(olympe.net.Config.zl),new olympe.U.fa(olympe.net.Config.ap))},'olympe.native.node.net.http');olympe.ka.node.X={};const Gl=new Map;olympe.ka.node.X.hl=class extends olympe.X.hl{R(a){return(new Uint8Array(Buffer.from(a,'base64'))).buffer}C(a){return Buffer.from(a).toString('base64')}G(a,b){a.arrayBuffer().then(olympe.D.La().F(b))}L(a){var b=()=>Math.random().toString(16).slice(-4);b=`blob://${`${b()}${b()}-${b()}-${b()}-${b()}-${b()}${b()}${b()}`}`;Gl.set(b,a);return b}F(a,b,c){Gl.has(a)?b(Gl.get(a)):c&&c('No object has been found for that url. Maybe the URL has already been revoked')}W(a){Gl.delete(a)}};olympe.U.config(function(a){ra(a,olympe.X.P.th,olympe.ka.node.X.hl)},'olympe.native.node.utils');olympe.ka.node.auth={};olympe.ka.node.auth.Sp=class{redirect(){console.warn('Redirection n/a in Node.JS')}F(){console.warn('Redirection n/a in Node.JS')}C(){console.warn('Redirection n/a in Node.JS');return''}};olympe.ka.node.auth.Sp.ma=[olympe.auth.lk];olympe.U.config(a=>{A(a,olympe.auth.P.hk,olympe.ka.node.auth.Sp)},'olympe.native.node.auth');olympe.ka.node.hc={};olympe.ka.node.hc.Hp=class{constructor(a){this.F={};this.N=a}C(a){void 0===this.F[a]&&(this.F[a]=new olympe.ka.node.hc.Ip(a,this.N));return this.F[a].open()}};olympe.ka.node.hc.Hp.ma=[olympe.hc.Rt];olympe.ka.node.hc.Ip=class{constructor(a,b){this.name=a;this.N=b;this.C=!1;this.db=null}open(){if(this.C)return this;const a=require('lowdb');this.C=!0;const b=require('lowdb/adapters/Memory');this.db=a(new b);return this}close(){}get(a,b){this.C||this.open();b(this.db.get(a).value(),a)}set(a,b,c){this.C||this.open();this.db.set(a,b).write();c&&c(!0)}forEach(a,b){this.C||this.open();const c=this.db.getState();for(const [d,e]of Object.entries(c))a(e,d);b()}remove(a,b){this.C||this.open();this.db.unset(a).write();
|
|
1000
|
+
b&&b(!0)}clear(){this.C||this.open();this.db.setState({})}};olympe.ka.node.hc.Ip.ma=[olympe.hc.St];olympe.U.config(function(a){A(a,olympe.hc.P.Xj,olympe.ka.node.hc.Hp,olympe.hc.P.Ea)},'olympe.native.node.localstorage');olympe.ka.node.storage={};olympe.ka.node.storage.Storage=class{constructor(a){this.N=a}F(a){a&&a('Not Implemented.')}R(a){a&&a('Not Implemented.')}write(a,b,c,d,e){e&&e('Not Implemented.')}G(a){a&&a('Not Implemented.')}L(a){a&&a('Not Implemented.')}C(a){a&&a('Not Implemented.')}open(a){a(null)}close(a){a(null)}};olympe.ka.node.storage.Storage.ma=[olympe.hc.Storage];olympe.U.config(function(a){ra(a,olympe.hc.P.Pi,olympe.ka.node.storage.Storage,olympe.host.P.Ea)},'olympe.native.html.storage');olympe.Fg={};olympe.Fg.Config={VERSION:'version.version',rs:'version.branch',cg:'version.commit',Zu:'version.tag',Jo:'version.olympe-framework',ss:'version.build'};olympe.U.config(function(a){D(a,olympe.Fg.Config.VERSION,'');D(a,olympe.Fg.Config.rs,'');D(a,olympe.Fg.Config.cg,'');D(a,olympe.Fg.Config.Zu,'');D(a,olympe.Fg.Config.Jo,'');D(a,olympe.Fg.Config.ss,'')},'olympe.main');const Hl=require('fs');let wa,va;function Il(a,b){Hl.readFile(a,(c,d)=>{c?b(Object.create(null)):(d=JSON.parse(d),b(d))})}
|
|
1001
|
+
function Jl(){if(void 0!==wa&&void 0!==va){0===Object.keys(va).length&&console.warn('No configuration found. Check presence of oConfig.json');0===Object.keys(wa).length&&console.warn('No version found. Check presence of version.json');var a=Object.create(null),b=process.argv;for(var c=2;c<b.length;c++){var d=/^true|false$/i,e=/^\d+(\.\d+)?$/;let f;const g=/([^?&=]+)(=?([^?&=]+))?/g.exec(b[c]);f=g[3];void 0===f?f=!0:f.startsWith('"')&&f.endsWith('"')?f=f.substring(1,f.length-1):d.test(f)?f='true'===
|
|
1002
|
+
f.toLowerCase():e.test(f)&&(f=parseFloat(f));a[g[1]]=f}a=new olympe.U.Es(a);d=a.Ya();d.debug('Registering configurations...');d.C++;for(let f=0,g=ka.length;f<g;f++)b=a,c=ka[f],qa(b.N,'Registering configure callback '+(c.C?'for module '+c.C:'')),b.F.push(c.F);oa(d);d.debug('done registering');a=a.compile();c=a.Ya();c.debug('Running run callbacks of container...');for(let f=0,g=la.length;f<g;f++)c.C++,d=la[f],b=a,e=na(b,d.cj()),b.N.debug('Calling run callback '+(d.C?'for module '+d.C:'')),d.F.apply(null,
|
|
1003
|
+
e),oa(c);c.debug('done calling run callbacks. DI process completed!')}}olympe.X.Rm('oConfig.json',Il,function(a){va=a;Jl()});Il('version.json',function(a){wa=a;Jl()});olympe.tc={};olympe.tc.ns=class{run(){}};olympe.tc.pa=class{constructor(a,b){this.C=a;this.N=b;this.F=null;this.G='';this.N.info('HC Manager will execute application registered as:',this.C)}rj(a,b,c=''){b||(b='default');b===this.C?(null===this.F?this.N.log('Application',c,'designated to be launched'):this.N.log('OVERRIDE: Application',c,'designated to be launched'),this.F=a,this.G=c):this.N.debug('ignoring application:'+c+' as it is registered under name '+b+' and not '+this.C)}run(){null!==this.F?(this.N.info('Running application:',this.G),
|
|
1004
|
+
this.F.run()):this.N.error('No app registered under name: '+this.C)}};olympe.tc.rj=function(a,b,c){const d=a.Ya();c?d.debug('Pre-registering application '+b+' under name '+c+' (use '+olympe.tc.Config.ef+'='+c+' to start it)'):d.debug('Pre-registering application '+b+' as default one');a.Md(olympe.tc.P.Aa).config([b],function(e,f){f.rj(e,c,b)},'olympe.hc.registerApp')};olympe.tc.P={Aa:'hc.Manager',Ea:'hc.Logger'};olympe.tc.Config={ef:'hc.app',vl:'hc.globalToken'};olympe.U.config(function(a){D(a,olympe.tc.Config.ef,'default');D(a,olympe.tc.Config.vl,!1);C(a,olympe.tc.P.Ea,[olympe.ra.P.Aa],b=>b.Nc('hc'));C(a,olympe.auth.P.yj,[new olympe.U.fa(olympe.tc.Config.ef),new olympe.U.fa(olympe.tc.Config.vl)],(b,c)=>new olympe.auth.cl(c?'':b));A(a,olympe.tc.P.Aa,olympe.tc.pa,new olympe.U.fa(olympe.tc.Config.ef),olympe.tc.P.Ea)},'olympe.hc');
|
|
1005
|
+
olympe.U.run([olympe.tc.P.Aa],a=>a.run(),'olympe.hc');olympe.sc.Zf={};function Kl(a){a.N.info('Starting application '+a.C);let b=!1;const c=olympe.dc.Ja();if(0<a.C.length){const d=Bc(c,a.C,a.F.C.C.F((e,f)=>{e?(e=tj(f),e instanceof olympe.sc.Ma.ni?(a.N.debug('application retrieved: running'),b=!0,f=Ti(a.F,e),e.run(f),'string'===typeof a.W&&(new olympe.sc.Vd).ja(e.T(),f,a.N)):a.N.error('application retrieved: not an Application with a run() method')):Ll(a)}));olympe.D.La().onDestroy(()=>{Cc(c,a.C,d)});Jb(()=>{b||a.N.warn(`requested application ${a.C} may not be available (it may not exist or the logged user may not have the correct permissions)`)},
|
|
1006
1006
|
1E4)}}
|
|
1007
|
-
function
|
|
1008
|
-
olympe.dc.Ha.
|
|
1009
|
-
olympe.sc.Zf.
|
|
1010
|
-
|
|
1011
|
-
olympe.U.config(function(a){C(a,olympe.auth.P.
|
|
1012
|
-
'sc.runtime');olympe.tc.
|
|
1013
|
-
olympe.public.
|
|
1014
|
-
void 0}static
|
|
1015
|
-
|
|
1016
|
-
olympe.public.
|
|
1017
|
-
olympe.public.
|
|
1007
|
+
function Ml(a,b){if(a.L)a.N.debug('Sending getContext request'),$f(a.R,d=>{d?a.N.error('failed to synchronise (authenticated) with server: '+d.message):(a.N.debug('synchronisation request successful'),Bj=a.C,b())});else{var c=olympe.dc.Cd.SUBSCRIBE;const d=olympe.dc.Cd.Ki,e=Vi(a.F)?d:c;a.N.debug((Vi(a.F)?'PULLING':'SUBSCRIBING')+' application '+a.C);const f=olympe.D.La();c=new olympe.async.pk(f);c.add((g,h)=>{ef(new olympe.dc.kf(a.C,e),olympe.dc.Qb.tf).kb(k=>{var l=olympe.dc.Ha;var n=(n=olympe.dc.kd.from(a.C).rb(olympe.sc.Ma.Le.C).rb(olympe.sc.logic.Ud.G.Ec()).Ic())&&n.T()||
|
|
1008
|
+
olympe.dc.Ha.Lc;l.ic=n;k?h(k.message):g()})});c.add(g=>{olympe.D.yc([a.G.Dg()],h=>{(new olympe.dc.Da(h)).Ke(f.F(g))})});c.add((g,h)=>{const k=olympe.sc.gd.C.yp,l=olympe.sc.gd.C.Ql;Cj(a.C,n=>{switch(n){case k:case l:g();break;default:h('Error while loading the business container')}})});ac(c,(g,h)=>{if(h)throw Error(h);b()});c.start()}}function Ll(a){a.N.debug('Stop the application');a.F.C.C.Ka()}
|
|
1009
|
+
olympe.sc.Zf.im=class{constructor(a,b,c,d,e,f,g,h){this.G=a;this.R=b;this.N=c;this.F=d;this.C=e;this.L=f;this.$=null!=g?g:!1;this.W=null!=h?h:null}run(){const a=olympe.auth.pa.C.Mg,b=olympe.auth.pa.C.hg,c=olympe.auth.pa.C.yh,d=olympe.auth.pa.C.li,e=olympe.auth.pa.C.Uh,f=olympe.auth.pa.C.sh;this.N.debug('runtime starting for app #'+this.C);let g=!1;const h=()=>{g||(Kl(this),g=!0)};olympe.D.yc([this.G.getState()],k=>{switch(k){case e:case f:break;case a:case c:this.N.debug('Server session opened, calling once connected callback');
|
|
1010
|
+
Ml(this,h);break;case b:this.N.debug('Disconnected, working offline.');this.$&&!g&&Ml(this,h);break;case d:this.N.debug('waiting for authentication');break;default:this.N.debug('No server session available, waiting for connection'),g=!1,Ll(this)}},'Runtime initial auth state listener')}};olympe.sc.Zf.im.C='app_instance';olympe.sc.Zf.im.ma=[olympe.tc.ns];olympe.sc.Zf.Aj={tf:'sc.runtime.Main'};
|
|
1011
|
+
olympe.U.config(function(a){C(a,olympe.auth.P.yj,[new olympe.U.fa(olympe.tc.Config.ef),new olympe.U.fa(olympe.sc.Config.ef),new olympe.U.fa(olympe.tc.Config.vl)],(b,c,d)=>new olympe.auth.cl(d?'':b+(c?'-'+c:'')));A(a,olympe.sc.Zf.Aj.tf,olympe.sc.Zf.im,olympe.auth.P.Aa,olympe.dc.query.P.Aa,olympe.sc.P.Ea,olympe.sc.P.hm,new olympe.U.fa(olympe.sc.Config.ef),new olympe.U.fa(olympe.dc.Config.Zg),new olympe.U.fa(olympe.sc.Config.Tp),new olympe.U.fa(olympe.sc.Config.lo));olympe.tc.rj(a,olympe.sc.Zf.Aj.tf,
|
|
1012
|
+
'sc.runtime');olympe.tc.rj(a,olympe.sc.Zf.Aj.tf,'sc.headless');olympe.tc.rj(a,olympe.sc.Zf.Aj.tf)},'olympe.sc.runtime');olympe.public={};function Nl(a,b){const c=new olympe.auth.Request;for(const [d,e]of a)c.set(d,e);return new Promise(d=>{kc(olympe.public.Ta.get(),c,b,()=>{d()})})}
|
|
1013
|
+
olympe.public.Ta=class{static hw(a,b){return olympe.auth.Jb.Fe.bj(a,b)}static getState(){return pc(olympe.public.Ta.get())}static rw(){return olympe.D.$a(olympe.public.Ta.get().Dg())}static gy(a){const b=new olympe.D.Zb('Observe user tag','function'===typeof a.Sa?a.C.C:a);return new rxjs.Observable(c=>{b.run(()=>olympe.D.yc([olympe.public.Ta.get().Dg()],d=>{c.next(d);olympe.D.La().onDestroy(()=>c.complete())}));return()=>b.destroy()})}static Yc(){return olympe.D.$a(sc(olympe.public.Ta.get()))}static Hw(){return olympe.D.$a(olympe.public.Ta.get().ci())||
|
|
1014
|
+
void 0}static Gw(){return Array.from(olympe.public.Ta.get().F.G().keys())}static gi(){olympe.public.Ta.get().gi()}static mh(a){return new Promise((b,c)=>{olympe.public.Ta.get().mh(a,d=>d?c(d):b())})}static Gx(a,b){return Nl((new Map).set('username',a).set('password',b),'srp')}static Hx(a){const b=olympe.public.Ta.get().F.G();if(0===b.size||a&&!b.has(a)){var c=0===b.size?'There are no available IDPs':`The IDP name ${a} is not valid, the valid names are ${Array.from(b.keys())}`;return Promise.reject(c)}a?
|
|
1015
|
+
(c=a,a=b.get(a)):(a=Array.from(b)[0],c=a[0],a=a[1]);return Nl((new Map).set('idpName',c),a)}static Fx(){return Nl(new Map,'saml')}static Ix(a,b){return Nl((new Map).set('username',a).set('nonce',b),'localToken')}static Ex(){return Nl(new Map,'openID')}static en(){return new Promise(a=>{rc(olympe.public.Ta.get(),()=>{olympe.public.Ta.get().W.delete('logoutCallback');a()},'logoutCallback');olympe.public.Ta.get().en()})}static get(){return olympe.auth.Pc()}};olympe.public.Ta.logout=olympe.public.Ta.en;
|
|
1016
|
+
olympe.public.Ta.loginOpenID=olympe.public.Ta.Ex;olympe.public.Ta.loginToken=olympe.public.Ta.Ix;olympe.public.Ta.loginSAML=olympe.public.Ta.Fx;olympe.public.Ta.loginSSO=olympe.public.Ta.Hx;olympe.public.Ta.loginSRP=olympe.public.Ta.Gx;olympe.public.Ta.getUserFromToken=olympe.public.Ta.mh;olympe.public.Ta.sendKeepAlive=olympe.public.Ta.gi;olympe.public.Ta.getIDPNames=olympe.public.Ta.Gw;olympe.public.Ta.getIDPToken=olympe.public.Ta.Hw;olympe.public.Ta.getToken=olympe.public.Ta.Yc;
|
|
1017
|
+
olympe.public.Ta.observeUser=olympe.public.Ta.gy;olympe.public.Ta.getCurrentUser=olympe.public.Ta.rw;olympe.public.Ta.getState=olympe.public.Ta.getState;olympe.public.Ta.generateSRPData=olympe.public.Ta.hw;olympe.public.bb=class{static create(a){return new class extends olympe.dc.V.Ng{C(b,c){b=a(olympe.dc.CloudObject.get(c));if('boolean'===typeof b)return b;const d=olympe.D.Qc(olympe.D.sa),e=b.subscribe(f=>d.update(olympe.D.wc(f)));olympe.D.La().R(()=>e.unsubscribe());return d.Ib()}}}};
|
|
1018
|
+
olympe.public.Me=class{static create(a){return new class extends olympe.dc.Bb.Ng{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.Qc(olympe.D.ga),e=b.subscribe(f=>d.update(olympe.D.Ba(f)));olympe.D.La().R(()=>e.unsubscribe());return d.Ib()}}}};'object'===typeof exports&&(exports={CloudObject:olympe.dc.CloudObject,Relation:olympe.dc.ua.Relation,Direction:olympe.dc.Ca,generateTag:olympe.X.ih,tagToString:olympe.dc.za,register:olympe.dc.register,defineProperty:olympe.dc.defineProperty,defineRelation:olympe.dc.gh,defineInverseRelation:olympe.dc.Qv,BrickContext:olympe.sc.Qa,Brick:olympe.sc.logic.Function,ActionBrick:olympe.sc.logic.Action,GlobalProperties:olympe.sc.Qa.C,registerBrick:olympe.sc.logic.ya.C,FunctionBrick:olympe.sc.logic.Function,
|
|
1018
1019
|
Context:olympe.sc.Qa,Entry:olympe.dc.ua.Entry,PropertyModel:olympe.dm.Property,RelationModel:olympe.dm.Relation,StringModel:olympe.dm.String,NumberModel:olympe.dm.Number,BooleanModel:olympe.dm.Boolean,DatetimeModel:olympe.dm.DateTime,ColorModel:olympe.dm.Color,File:olympe.dm.File,User:olympe.dm.User,Enum:olympe.dm.ig,EnumValue:olympe.dm.Enum,Workflow:olympe.sc.workflow.Workflow,WorkflowState:olympe.sc.workflow.Qe,WorkflowTransition:olympe.sc.workflow.Transition,WorkflowObjectState:olympe.sc.workflow.ObjectState,
|
|
1019
|
-
Transaction:olympe.sc.Transaction,BurstTransaction:olympe.dc.
|
|
1020
|
-
AUTHENTICATING:olympe.auth.pa.C.
|
|
1020
|
+
Transaction:olympe.sc.Transaction,BurstTransaction:olympe.dc.pi,QueryResult:olympe.dc.Xa,Query:olympe.dc.gb,QuerySingle:olympe.dc.kd,Predicate:olympe.dc.ba.bb,RelatedTo:olympe.dc.ba.V.Ee,Order:olympe.dc.ba.ek,Config:class{static getParameter(a){return olympe.U.getParameter(a)}},Color:olympe.D.Color,ErrorFlow:olympe.sc.logic.Error,ServiceRequest:olympe.H.wa.fb.ha,Service:olympe.H.wa.fb.tb,Auth:olympe.public.Ta,AuthState:{INIT:olympe.auth.pa.C.INIT,DISCONNECTED:olympe.auth.pa.C.hg,GUEST:olympe.auth.pa.C.yh,
|
|
1021
|
+
AUTHENTICATING:olympe.auth.pa.C.li,ERROR:olympe.auth.pa.C.ac,AUTHENTICATED:olympe.auth.pa.C.Mg},Sync:olympe.dc.CloudObject,BusinessObject:olympe.dc.CloudObject,StringPrimitive:olympe.dm.String,NumberPrimitive:olympe.dm.Number,BooleanPrimitive:olympe.dm.Boolean,DatetimePrimitive:olympe.dm.DateTime,ColorPrimitive:olympe.dm.Color,PropertyPrimitive:olympe.dm.Property,RelationPrimitive:olympe.dm.Relation,DBView:class extends olympe.dc.hb{static get(){return olympe.dc.Ja()}},ListDef:olympe.dc.Da,instanceToTag:olympe.dc.za,
|
|
1021
1022
|
registerSync:olympe.dc.ya.C,getUniqueTag:olympe.X.ih,onDestroy:a=>olympe.D.La().onDestroy(a),offDestroy:a=>olympe.D.La().Xe(a),FollowRules:olympe.dc.Qb,transformers:{Related:olympe.dc.Y.Sb,RecursiveRelated:olympe.dc.Y.Bc,Distinct:olympe.dc.Y.xe,Filter:olympe.dc.Y.rc,Limit:olympe.dc.Y.Xd,Sort:olympe.dc.Y.Hd,Union:olympe.dc.Y.wf},ListDefPredicate:olympe.public.bb,predicates:{And:olympe.dc.V.Qd,Or:olympe.dc.V.Zd,Not:olympe.dc.V.jd,Equals:olympe.dc.V.Fc,Contains:olympe.dc.V.Sc,Greater:olympe.dc.V.ze,
|
|
1022
1023
|
Smaller:olympe.dc.V.Ge,HasRelated:olympe.dc.V.lf,InstanceOf:olympe.dc.V.mf,Regex:olympe.dc.V.ud},Comparator:olympe.public.Me,comparators:{Number:olympe.dc.Bb.Number,String:olympe.dc.Bb.String,DateTime:olympe.dc.Bb.DateTime},valuedefs:{BooleanProperty:olympe.dc.oa.ue,StringProperty:olympe.dc.oa.pe,NumberProperty:olympe.dc.oa.le,DateTimeProperty:olympe.dc.oa.je,Constant:olympe.dc.oa.Bd,Tag:olympe.dc.oa.uf}});
|
|
1023
1024
|
|