@olympeio/runtime-node 9.10.5 → 9.10.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js
CHANGED
|
@@ -665,49 +665,49 @@ olympe.W.config(function(a){F(a,olympe.dc.db.U.fp,olympe.dc.db.vf.j.Ln);F(a,olym
|
|
|
665
665
|
(b,c,d,e,f,g,h)=>{e=g?olympe.dc.db.vf.j.Hl:e;d=(new Map).set('selfTag',d).set('garbageCollector',e).set('garbageCollectorDelay',f).set('debug',h);return new olympe.dc.db.Database(b,c,d)});D(a,olympe.dc.db.P.Dl,olympe.dc.kb,olympe.dc.db.P.Ca,olympe.dc.db.P.Qj);E(a,olympe.dc.db.P.Li,[olympe.dc.db.P.Da],b=>b.Xy);E(a,olympe.dc.db.P.Da,[olympe.dc.db.P.Ca,olympe.dc.db.P.Qj,olympe.dc.db.P.Dl,new olympe.W.pa(olympe.dc.U.Xf),new olympe.W.pa(olympe.dc.db.U.xl),new olympe.W.pa(olympe.dc.db.U.Li),new olympe.W.pa(olympe.dc.db.U.av),
|
|
666
666
|
new olympe.W.pa(olympe.dc.db.U.$u)],(b,c,d,e,f,g,h,k)=>{g=(new Map).set('active',g).set('counters',h).set('callbacks',k);e=(new Map).set('debug',e).set('bufferTimeout',f);return new olympe.dc.db.Ht(b,c,d,e,g)})},'olympe.dc.db');olympe.W.run([olympe.dc.db.P.Qj,olympe.dc.db.P.Li],(a,b)=>{olympe.$d().db=a;olympe.$d().dbMonitor=b},'DC.DB debug service injection');olympe.dc.query={};function Jh(a){return(b,c)=>{const d=null===b,e=null===c;return d||e?d&&e?0:d?1:-1:a(b,c)}}
|
|
667
667
|
olympe.dc.query.sf=class{constructor(a,b,c){this.db=olympe.dc.ia();this.j=a;this.La=b;this.Ji=c}ga(){return{p:this.La.X(),o:this.Ji}}toString(){return'sortByQueryPart-'+this.Ji+this.La.X()}$g(){const a=this.db.Jb(this.La,olympe.dm.Property.typeRel),b=olympe.dc.fa;if(this.db.Qf(a,olympe.dm.String))return Jh((c,d)=>c.localeCompare(d));if(a===b(olympe.dm.Number)||a===b(olympe.dm.Boolean))return Jh((c,d)=>c-d);if(a===b(olympe.dm.DateTime))return Jh((c,d)=>c.getTime()-d.getTime());if(a===b(olympe.dm.Color))return Jh((c,
|
|
668
|
-
d)=>c.compare(d));olympe.ja.ab('dc.query').warn(`No comparator found for type with tag ${a}`);return Jh(()=>-1)}Qa(){return this.La}};olympe.dc.Te=class{X(){}};olympe.dc.Te.prototype.getTag=olympe.dc.Te.prototype.X;olympe.dc.lB=olympe.dc.Te;function Kh(a){let b;if(null==(b=a.j)?0:b.jf())if(a=a.
|
|
669
|
-
olympe.dc.query.gv=class{constructor(a,b,c,d){this.G=a;this.source=b;this.D=c;this.
|
|
668
|
+
d)=>c.compare(d));olympe.ja.ab('dc.query').warn(`No comparator found for type with tag ${a}`);return Jh(()=>-1)}Qa(){return this.La}};olympe.dc.Te=class{X(){}};olympe.dc.Te.prototype.getTag=olympe.dc.Te.prototype.X;olympe.dc.lB=olympe.dc.Te;function Kh(a){let b;if(null==(b=a.j)?0:b.jf())if(a=a.N,!a.N){let c;null==(c=a.R)||c.call(a)}}function Lh(a,b,c,d,e){Kh(a);let f,g;b?null==(f=a.j)||f.Oa(c,d,e):null==(g=a.j)||g.hc(c,d,e)}function Mh(a){let b;const c=!(null==(b=a.j)?0:b.jf());a.F=c?a.j:null;a.H.forEach(d=>d());a.H=[];c&&(a.j=new olympe.dc.db.ec,a.G.j()&&a.G.debug(`Commit notification with ${a.F.H()} operations for query ${a.D}`))}
|
|
669
|
+
olympe.dc.query.gv=class{constructor(a,b,c,d){this.G=a;this.source=b;this.D=c;this.N=d;this.j=this.F=null;this.db=olympe.dc.ia();this.H=[]}watch(a,b){if(this.db.source(a)===this.source){var c=`${this.D}:${a}:notif`;sf(this.db,a,(d,e)=>{if(d){Kh(this);let f;null==(f=this.j)||f.$(e)}else if(b&&Og(this.db,e,c),!this.db.Ha(e)){Kh(this);let f;null==(f=this.j)||f.D(e,olympe.dc.Lb.NONE)}},c);b&&Ng(this.db,a,(d,e,f)=>{Kh(this);let g;f||null!=(g=this.j)&&g.Wc(a,new Map([[d,e]]))},c)}}stop(a){this.H.push(()=>
|
|
670
|
+
qf(this.db,a,`${this.D}:${a}:notif`))}};olympe.dc.query.kk={ASC:'ASC',DESC:'DESC'};function Nh(a){const b=Oh(a.query),c=new Map;for(let e=b.length;0<=e;e--){const f=0<e?b[e-1].T():a.F,g=0<e?b[e-1].j:'root',h=0<e&&b[e-1].R(),k=a.j.get(f),l=new Set(k.Rc()),n=new Map,p=a.H.has(f);let q=p?';':'';if(c.has(f)){const [r,t,u]=c.get(f);c.delete(f);q+=u;r.forEach((x,y)=>{for(const z of k.j(y)){let A;n.set(z,Array.from(x).map(K=>p?`${y};${K}`:K).reduce((K,X)=>K.add(X),null!=(A=n.get(z))?A:new Set))}l.delete(y)});t&&l.forEach(x=>{const y=p?`${x};${u}`:u;for(const z of k.j(x)){let A;n.set(z,
|
|
670
671
|
(null!=(A=n.get(z))?A:new Set).add(y))}})}else l.forEach(r=>{const t=p?`${r};`:'';for(const u of k.j(r))n.has(u)?n.get(u).add(t):n.set(u,(new Set).add(t))});if(0<e&&c.has(g)){const [r,t,u]=c.get(g),x=new Map;n.forEach((y,z)=>{let A;null==(A=r.get(z))||A.forEach(K=>{let X;const xa=null!=(X=x.get(z))?X:new Set;y.forEach(ab=>xa.add(ab+K));x.set(z,xa)});n.delete(z);r.delete(z)});t&&n.forEach((y,z)=>{x.set(z,new Set(Array.from(y).map(A=>A+u)))});b[e-1].R()&&r.forEach((y,z)=>{x.set(z,new Set(Array.from(y).map(A=>
|
|
671
|
-
q+A)))});c.set(g,[x,t&&h,q+u])}else c.set(g,[n,h,q])}let d;a=null==(d=c.get('root'))?void 0:d[0].get('root');return Array.from(null!=a?a:[]).map(e=>e.slice(0,-1).split(';'))}function
|
|
672
|
-
function
|
|
673
|
-
function
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
a,b,!1,c)}static Cj(a,b,c=!0){Yh(a);return new olympe.dc.query.Z.Gi(olympe.dc.ia(),a,b,!0,c)}static and(...a){if(!a.every(b=>b instanceof olympe.dc.query.Aa))throw new olympe.dc.query.yd(`Some specified predicates, while trying to build an AND query predicate are invalid: ${a}`);return new olympe.dc.query.Z.Jd(...a)}static or(...a){if(!a.every(b=>b instanceof olympe.dc.query.Aa))throw new olympe.dc.query.yd(`Some specified predicates, while trying to build an OR query predicate are invalid: ${a}`);
|
|
672
|
+
q+A)))});c.set(g,[x,t&&h,q+u])}else c.set(g,[n,h,q])}let d;a=null==(d=c.get('root'))?void 0:d[0].get('root');return Array.from(null!=a?a:[]).map(e=>e.slice(0,-1).split(';'))}function Ph(a){if(null===a.D){const b={Hb:a.query.$g(),Hd:a.Hd,max:a.query.j.max,offset:a.query.j.offset};a.D=olympe.dc.Ia.from(a.Y,Nh(a),b)}return a.D}function Qh(a,b){a.R=b}function Rh(a){if(!a.N){null!==a.D&&(a.Y=a.D);a.D=null;a.N=!0;let b;null==(b=a.R)||b.call(a)}}
|
|
673
|
+
function Sh(a,b){let c;return null!=(c=a.j.get(b).Rc())?c:[]}function Th(a,b,c){let d,e;return null!=(e=null==(d=a.j.get(c))?void 0:d.has(b))?e:!1}function Uh(a,b,c=a.F,d='root'){const e=a.j.get(c);if(!e)return a.G.error('Try to insert result entry to a higher level than possible'),null;const f=!e.has(b);e.D(b,d)&&Rh(a);let g;f&&(null==(g=a.Me)||g.watch(b,a.H.has(c)));return f}function Vh(a,b,c,d,e,f){null!==a.Me&&(d===olympe.dc.va.ORIGIN?Lh(a.Me,b,c,f,e):Lh(a.Me,b,c,e,f))}
|
|
674
|
+
function Wh(a){a.G.j()&&a.G.debug(`Start sending notifications for query ${a.query.T()}`);const b=new olympe.dc.query.gv(a.G,a.query.sb(),a.query.T(),a);a.j.forEach((c,d)=>{for(const e of c.Rc())b.watch(e,a.H.has(d))});null!=b.j||(b.j=new olympe.dc.db.ec);a.Me=b}function Xh(a){null!==a.Me&&(a.G.j()&&a.G.debug(`Stop sending notifications for query ${a.query.T()}`),a.j.forEach(b=>{for(const c of b.Rc())a.Me.stop(c)}),a.Me=null)}function Yh(a){a.N=!1;let b;null==(b=a.Me)||Mh(b)}
|
|
675
|
+
olympe.dc.query.Aq=class{constructor(a,b){this.G=a;this.query=b;this.F=olympe.V.tb(b.D);this.oa=new Map;this.j=(new Map).set(this.F,new olympe.dc.query.oa.Am);this.H=new Set(b.F);this.Hd=-1;this.N=!1;this.R=null;this.Y=olympe.dc.Ia.empty();this.Me=this.D=null;a=Oh(b);a.forEach(c=>{const d=c.T();this.oa.set(d,c.N());this.j.set(d,c.ha())});b=b.$g();if(null!==b){b=b.j;let c=-1;for(const d of[this.F].concat(a.map(e=>e.T())))if(c+=this.H.has(d)?1:0,b===d){this.Hd=c;break}}}remove(a,b=this.F,c='root'){b=
|
|
676
|
+
this.j.get(b);if(null==b?0:b.remove(a,c))if(Rh(this),!b.has(a)){let d;null==(d=this.Me)||d.stop(a);return!0}return!1}Nc(a){const b=a.D,c=olympe.V.tb(b);a=Oh(a);const d=[];for(const [f,g]of this.j){if(g.H(b))return!0;g.has(b)&&d.push(f)}const e=(new Map).set(c,d);return 0<d.length&&a.every(f=>{let g;const h=(null!=(g=e.get(f.j))?g:[]).flatMap(k=>f.$(k,this.oa.get(k))).filter(k=>{let l,n;return null!=(n=null==(l=this.oa.get(k))?void 0:l.Nc(f))?n:!1});e.set(f.T(),h);return 0<h.length})}};function Zh(a){if(!olympe.dc.ia().Ob(a,olympe.dm.Property))throw new olympe.dc.query.yd(`The specified property while trying to build a query predicate is invalid: ${a}`);}
|
|
677
|
+
function $h(a){var b=olympe.dc.query.Aa.j.tr;const c=olympe.dc.query.Aa.j.Po,d=olympe.dc.query.Aa.j.Nj,e=olympe.dc.query.Aa.j.Ap,f=olympe.dc.query.Aa.j.aq,g=olympe.dc.query.Aa.j.Kq,h=olympe.dc.query.Aa.j.Jn,k=olympe.dc.query.Aa.j.pq;switch(a.pr){case b:return new olympe.dc.query.Z.Fm(a.t);case c:b=a.v;switch(a.t){case 2:b=new Date(b);break;case 3:b=olympe.dc.CloudObject.get(b);break;case 4:b=olympe.C.Color.create(b.r,b.g,b.b,b.a)}return new olympe.dc.query.Z.ve(a.p,b,olympe.dc.ia());case d:return new olympe.dc.query.Z.tf(a.p,
|
|
678
|
+
a.s,olympe.dc.ia(),a.c);case e:return new olympe.dc.query.Z.Gi(olympe.dc.ia(),a.p,a.b,a.l,a.s);case f:return new olympe.dc.query.Z.fe($h(a.v));case g:return new olympe.dc.query.Z.Ef(a.p,new RegExp(a.r),olympe.dc.ia(),a.c);case k:return new olympe.dc.query.Z.Be(...a.p.map(l=>$h(l)));case h:return new olympe.dc.query.Z.Jd(...a.p.map(l=>$h(l)));default:return null}}
|
|
679
|
+
olympe.dc.query.Aa=class{observe(){}nb(){}compile(){return[[this]]}ud(){return new olympe.dc.query.Z.fe(this)}Db(){}Nc(){}clear(){}ga(){}Vc(){}toString(){}Ea(a){return this===a}static Ey(...a){return new olympe.dc.query.Z.Fm(a)}static Ea(a,b){Zh(a);return new olympe.dc.query.Z.ve(a,b,olympe.dc.ia())}static contains(a,b,c=!0){Zh(a);return new olympe.dc.query.Z.tf(a,b,olympe.dc.ia(),c)}static vz(a,b,c=!0){Zh(a);return new olympe.dc.query.Z.Ef(a,b,olympe.dc.ia(),c)}static Vk(a,b,c=!0){Zh(a);return new olympe.dc.query.Z.Gi(olympe.dc.ia(),
|
|
680
|
+
a,b,!1,c)}static Cj(a,b,c=!0){Zh(a);return new olympe.dc.query.Z.Gi(olympe.dc.ia(),a,b,!0,c)}static and(...a){if(!a.every(b=>b instanceof olympe.dc.query.Aa))throw new olympe.dc.query.yd(`Some specified predicates, while trying to build an AND query predicate are invalid: ${a}`);return new olympe.dc.query.Z.Jd(...a)}static or(...a){if(!a.every(b=>b instanceof olympe.dc.query.Aa))throw new olympe.dc.query.yd(`Some specified predicates, while trying to build an OR query predicate are invalid: ${a}`);
|
|
681
681
|
return new olympe.dc.query.Z.Be(...a)}static ud(a){if(!(a instanceof olympe.dc.query.Aa))throw new olympe.dc.query.yd(`The specified predicate, while trying to build a NOT query predicate is invalid: ${a}`);return new olympe.dc.query.Z.fe(a)}};olympe.dc.query.Aa.not=olympe.dc.query.Aa.ud;olympe.dc.query.Aa.or=olympe.dc.query.Aa.or;olympe.dc.query.Aa.and=olympe.dc.query.Aa.and;olympe.dc.query.Aa.smallerThan=olympe.dc.query.Aa.Cj;olympe.dc.query.Aa.greaterThan=olympe.dc.query.Aa.Vk;
|
|
682
|
-
olympe.dc.query.Aa.regex=olympe.dc.query.Aa.vz;olympe.dc.query.Aa.contains=olympe.dc.query.Aa.contains;olympe.dc.query.Aa.equals=olympe.dc.query.Aa.Ea;olympe.dc.query.Aa['in']=olympe.dc.query.Aa.Ey;olympe.dc.query.Aa.j={tr:0,Po:1,Nj:2,Ap:3,aq:4,Kq:5,pq:6,Jn:7};function
|
|
683
|
-
function
|
|
684
|
-
b.T();for(c=a.cursor+1;c<a.oa.length&&a.oa[c].T()!==d;)c++;b=c<a.oa.length?a.oa:a.oa.concat(b);return new olympe.dc.ma(a.D,a.source,b,c,a.F,a.j)}function
|
|
685
|
-
function
|
|
686
|
-
function
|
|
682
|
+
olympe.dc.query.Aa.regex=olympe.dc.query.Aa.vz;olympe.dc.query.Aa.contains=olympe.dc.query.Aa.contains;olympe.dc.query.Aa.equals=olympe.dc.query.Aa.Ea;olympe.dc.query.Aa['in']=olympe.dc.query.Aa.Ey;olympe.dc.query.Aa.j={tr:0,Po:1,Nj:2,Ap:3,aq:4,Kq:5,pq:6,Jn:7};function Oh(a){return Array.from(a.oa)}
|
|
683
|
+
function ai(a,b){var c=b.relation,d=olympe.dm.Relation.originModelRel,e=olympe.dm.Relation.destinationModelRel;d=a.db.Jb(c,c.Ka()===olympe.dc.va.ORIGIN?e:d);if(0>a.cursor)e=a.j.Ne;else if(e=a.oa[a.cursor],null!==e.ua)e=e.ua;else{var f=olympe.dc.va.ORIGIN;e=olympe.dc.ia().Jb(e.relation,e.relation.Ka()===f?olympe.dm.Relation.originModelRel:olympe.dm.Relation.destinationModelRel)}if(a.db.Ha(olympe.dc.CloudObject)&&(null===d||!a.db.Qf(d,e)&&!a.db.Qf(e,d)))throw new olympe.dc.query.yd(`The specified relation "${c}" is invalid at the current level "${a.db.name(e)} (${e})" of the Query you are building. Please make sure you did not forget a .back() or another relation.`);d=
|
|
684
|
+
b.T();for(c=a.cursor+1;c<a.oa.length&&a.oa[c].T()!==d;)c++;b=c<a.oa.length?a.oa:a.oa.concat(b);return new olympe.dc.ma(a.D,a.source,b,c,a.F,a.j)}function bi(a,b=a.cursor){return 0<=b?a.oa[b].T():olympe.V.tb(a.D)}
|
|
685
|
+
function ci(a,b,c,d={}){var e=olympe.dc.Lb.fg;const f=(null==d?0:d.jd)?d.jd:olympe.dc.ma.nc.rf,g=(null==d?0:d.Dn)?'__code-as-data__':void 0;b=olympe.dc.fa(b);const h=olympe.dc.ae().Ke(b);b=(new olympe.dc.ma(b,h)).ie();b.oa=[f===olympe.dc.ma.nc.Jg?new olympe.dc.query.oa.$o(bi(b),e,c):new olympe.dc.query.oa.Kd(bi(b),e,c)];let k;b.H=null!=(k=null==d?void 0:d.zs)?k:!1;return b.observe(a,{jd:f,Kk:g})}
|
|
686
|
+
function di(a){const b=0===a.F.size?a.ie():a;if(null!==b.j.Hd&&!b.F.has(bi(a,b.j.Hd)))throw new olympe.dc.query.yd('AndReturn was not called for the current level before sortBy operator');return b}function ei(a,b){let c,d;return b.H||(null!=(d=null==(c=a.N)?void 0:c.has(b.T()))?d:!1)}
|
|
687
687
|
olympe.dc.ma=class{constructor(a,b,c=[],d=-1,e=new Set,f={max:-1,offset:0,Hd:null,Ne:null}){this.db=olympe.dc.ia();if('string'!==typeof a||''===a)throw new olympe.dc.query.yd('The root of the query cannot be empty.');this.D=a;this.source=b;this.oa=c;this.cursor=d;this.F=e;this.j=f;this.N=this.id=null;this.H=!1}static from(a,b){a=olympe.dc.fa(a);if(!olympe.dc.CloudObject.exists(a))throw new olympe.dc.query.yd(`Try to create a query from an instance that does not exist (${a}). Please try to use \`Query.fromTag()\` instead.`);
|
|
688
688
|
b=null!=b?b:olympe.dc.ae().Ke(a);b=new olympe.dc.ma(a,b);b.j.Ne=olympe.dc.ia().model(a);return b}static Ke(a,b,c){if(!olympe.dc.CloudObject.exists(b)&&!c)throw new olympe.dc.query.yd(`Try to create a query from an instance (${a}) with an explicit datatype that does not exist (${b})`);a=olympe.dc.fa(a);c=null!=c?c:olympe.dc.ae().fromModel(b);c=new olympe.dc.ma(a,c);c.j.Ne=olympe.dc.fa(b);return c}static Yk(a,b=!0,c){const d=olympe.dc.fa(a);var e=olympe.dc.ia();if(!e.ji(d))throw new olympe.dc.query.yd(`Try to create a query to get instances of ${a}, which is not a data type or does not exist.`);
|
|
689
|
-
a=null!=c?c:olympe.dc.ae().fromModel(d);a=new olympe.dc.ma(d,a);a.j.Ne=e.model(d);b&&(a
|
|
690
|
-
d.oa=[b?new olympe.dc.query.oa.$o(
|
|
691
|
-
return
|
|
689
|
+
a=null!=c?c:olympe.dc.ae().fromModel(d);a=new olympe.dc.ma(d,a);a.j.Ne=e.model(d);b&&(a=ai(a,new olympe.dc.query.oa.we(bi(a),olympe.dc.CloudObject.extendedByRel,!0,!1)));b=a;e=new olympe.dc.query.oa.wh(bi(a),olympe.dc.CloudObject.instancesRel,!1);e.ua=d;return ai(b,e)}static Pb(a,b,c,d,e){var f;const g=null!=(f=null==e?void 0:e.jd)?f:olympe.dc.ma.nc.rf;f=(null==e?0:e.Dn)?'__code-as-data__':void 0;b=olympe.dc.fa(b);d=null!=d?d:olympe.dc.ae().Ke(b);d=(new olympe.dc.ma(b,d)).ie();b=g===olympe.dc.ma.nc.Jg;
|
|
690
|
+
d.oa=[b?new olympe.dc.query.oa.$o(bi(d),c):new olympe.dc.query.oa.Kd(bi(d),c)];let h;d.H=null!=(h=null==e?void 0:e.zs)?h:!1;let k;return d.observe(a,{jd:g,Kk:f,gj:null!=(k=null==e?void 0:e.gj)?k:b})}fb(a,b=!1){if(!(a instanceof olympe.dc.Ra.Relation))throw new olympe.dc.query.yd(`The relation given to follow() is invalid: ${a}`);return ai(this,new olympe.dc.query.oa.wh(bi(this),a,b))}mg(a,b=!1,c=!1){if(!(a instanceof olympe.dc.Ra.Relation))throw new olympe.dc.query.yd(`The relation given to followRecursively() is invalid: ${a}`);
|
|
691
|
+
return ai(this,new olympe.dc.query.oa.we(bi(this),a,b,c))}ie(){const a=(new Set(this.F)).add(bi(this));return new olympe.dc.ma(this.D,this.source,this.oa,this.cursor,a,this.j)}filter(a){if(!(a instanceof olympe.dc.query.Aa))throw new olympe.dc.query.yd(`The specified predicate while trying to filter a query is invalid: ${a}`);const b=Array.from(this.oa);b[this.cursor]=b[this.cursor].filter(a);return new olympe.dc.ma(this.D,this.source,b,this.cursor,this.F,this.j)}hj(){return this}vj(a,b=0){return new olympe.dc.ma(this.D,
|
|
692
692
|
this.source,this.oa,this.cursor,this.F,{Hd:this.j.Hd,max:a,offset:b,Ne:this.j.Ne})}fl(a,b=olympe.dc.query.kk.ASC){if(0>this.cursor)throw new olympe.dc.query.yd('You are trying to sort an empty query. Please first follow at least one relation to sort a query.');if(!olympe.dc.ia().Ob(a,olympe.dm.Property))throw new olympe.dc.query.yd(`The specified property while trying to sort a query is invalid: ${a}`);const c=this.oa[this.cursor],d={Hd:this.cursor,max:this.j.max,offset:this.j.offset,Ne:this.j.Ne},
|
|
693
|
-
e=Array.from(this.oa);e[this.cursor]=c.sort(a,b);return new olympe.dc.ma(this.D,this.source,e,this.cursor,this.F,d)}$g(){const a=this.j.Hd;let b;return null!==a?null==(b=this.oa[a])?void 0:b.$g():null}back(a=1){if(0>this.cursor||1>a)return this;let b=this.cursor;for(let c=0;c<a;c++){const d=this.oa[b].j;for(b--;-1<b&&
|
|
693
|
+
e=Array.from(this.oa);e[this.cursor]=c.sort(a,b);return new olympe.dc.ma(this.D,this.source,e,this.cursor,this.F,d)}$g(){const a=this.j.Hd;let b;return null!==a?null==(b=this.oa[a])?void 0:b.$g():null}back(a=1){if(0>this.cursor||1>a)return this;let b=this.cursor;for(let c=0;c<a;c++){const d=this.oa[b].j;for(b--;-1<b&&bi(this,b)!==d;)b--}return new olympe.dc.ma(this.D,this.source,Array.from(this.oa),b,this.F,this.j)}parse(){const a=new Map,b=bi(this,-1),c={limit:this.j.max,offset:this.j.offset,returned:this.F.has(b),
|
|
694
694
|
filter:[],optional:!1,inheritance:!1,next:[]};a.set(b,c);this.db.ji(this.D)?c.dataType=olympe.dc.fa(this.D):(c.root=olympe.dc.fa(this.D),c.dataType=this.j.Ne);this.oa.forEach((d,e)=>{const f=d.T(),g=d.Vc();Object.assign(g,{returned:this.F.has(f),next:[]});a.set(f,g);g.sort&&this.j.Hd!==e&&delete g.sort;if(1>=e&&d instanceof olympe.dc.query.oa.wh&&d.relation.Ea(olympe.dc.CloudObject.instancesRel))Object.assign(c,g);else if(0===e&&d instanceof olympe.dc.query.oa.we&&d.relation.Ea(olympe.dc.CloudObject.extendedByRel))Object.assign(c,
|
|
695
|
-
g),c.inheritance=!0;else{let h;null==(h=a.get(d.j))||h.next.push(g)}});return c}nb(a){const b=(null==a?0:a.jd)?a.jd:olympe.dc.ma.nc.lk;let c;return olympe.dc.query.Uk().executeQuery(
|
|
696
|
-
a;let d;return
|
|
695
|
+
g),c.inheritance=!0;else{let h;null==(h=a.get(d.j))||h.next.push(g)}});return c}nb(a){const b=(null==a?0:a.jd)?a.jd:olympe.dc.ma.nc.lk;let c;return olympe.dc.query.Uk().executeQuery(di(this),b,{Xh:null!=(c=null==a?void 0:a.Kk)?c:null==a?void 0:a.cacheId,Ac:null==a?void 0:a.Ac}).then(d=>{let e;return null!=(e=null==d?void 0:Ph(d))?e:olympe.dc.Ia.empty()})}Fc(){return Ph(fi(olympe.dc.query.Uk(),di(this)))}observe(a,b){const c=(null==b?0:b.jd)?b.jd:olympe.dc.ma.nc.rf;a='function'===typeof a.Cb?a.Cb():
|
|
696
|
+
a;let d;return gi(olympe.dc.query.Uk(),di(this),a,olympe.dc.Ja.SELF,c,{Xh:null!=(d=null==b?void 0:b.Kk)?d:null==b?void 0:b.cacheId,Ac:null==b?void 0:b.Ac,gj:null==b?void 0:b.gj}).pipe(rxjs.operators.map(e=>Ph(e)),rxjs.operators.distinctUntilChanged())}T(){null===this.id&&(this.id=olympe.V.tb(this.D+Oh(this).map(a=>a.H()).join()+Array.from(new Set(this.F)).sort().toString()+this.j.Hd+this.j.max+this.j.offset));return this.id}sb(){return this.source}ga(){let a;return{b:this.D,p:this.oa.map(b=>b.ga()),
|
|
697
697
|
r:Array.from(this.F),s:this.source,e:{m:this.j.max,o:this.j.offset,s:this.j.Hd,rm:null!=(a=this.j.Ne)?a:this.db.model(this.D)}}}toString(){return`Query: ${JSON.stringify(this)}`}toJSON(){return{origin:this.db.Ha(this.D)?olympe.dc.CloudObject.get(this.D):this.D,relations:this.oa.map(a=>a.toJSON())}}};olympe.dc.ma.prototype.observe=olympe.dc.ma.prototype.observe;olympe.dc.ma.prototype.executeFromCache=olympe.dc.ma.prototype.Fc;olympe.dc.ma.prototype.execute=olympe.dc.ma.prototype.nb;
|
|
698
698
|
olympe.dc.ma.prototype.parse=olympe.dc.ma.prototype.parse;olympe.dc.ma.prototype.back=olympe.dc.ma.prototype.back;olympe.dc.ma.prototype.sortBy=olympe.dc.ma.prototype.fl;olympe.dc.ma.prototype.limit=olympe.dc.ma.prototype.vj;olympe.dc.ma.prototype.cast=olympe.dc.ma.prototype.hj;olympe.dc.ma.prototype.filter=olympe.dc.ma.prototype.filter;olympe.dc.ma.prototype.andReturn=olympe.dc.ma.prototype.ie;olympe.dc.ma.prototype.followRecursively=olympe.dc.ma.prototype.mg;olympe.dc.ma.prototype.follow=olympe.dc.ma.prototype.fb;
|
|
699
|
-
olympe.dc.ma.followRule=olympe.dc.ma.Pb;olympe.dc.ma.instancesOf=olympe.dc.ma.Yk;olympe.dc.ma.fromTag=olympe.dc.ma.Ke;olympe.dc.ma.from=olympe.dc.ma.from;olympe.dc.ma.nc={rf:1,lk:2,Jg:3};olympe.dc.ma.j={ul:'cacheBucketName',Gp:'isCacheable'};function
|
|
700
|
-
olympe.dc.query.zd=class extends olympe.dc.Ag{constructor(a){super(a,null);this.F=new olympe.dc.transaction.Ce}static mj(a){const b=new olympe.dc.query.zd(`DataResult_${a.T()}`);b.D=a.sb();return b}static j(a){const b=new olympe.dc.query.zd(a.i);let c;b.D=null!=(c=a.s)?c:null;let d;b.Lk=null!=(d=a.t)?d:null;let e;b.Fa=null!=(e=a.p)?e:[];return b}qc(a){
|
|
701
|
-
b,c){this.F.Oa(a,b,c,null,null);return this}ga(){return super.ga()}};olympe.dc.query.zd.prototype.createRelation=olympe.dc.query.zd.prototype.Oa;olympe.dc.query.zd.prototype.create=olympe.dc.query.zd.prototype.create;olympe.dc.query.zd.fromQuery=olympe.dc.query.zd.mj;function
|
|
702
|
-
function
|
|
703
|
-
{const n=()=>{p&&c.Gs(p);l.complete();if(q){var r=q;const u=a.j.get(g);a.G.debug(`${d} unsubscribed from ${g}`);if(null==u)r=0;else{var t=u;t.H.delete(r)&&t.G.debug(`Remove subscriber ${d} for query ${t.query.T()}, now have ${t.H.size} subscribers`);d!==olympe.dc.Ja.SELF&&(t.$--,0===t.$&&
|
|
704
|
-
function
|
|
705
|
-
function
|
|
706
|
-
function
|
|
707
|
-
olympe.dc.query.Bv=class{constructor(a,b,c,d,e){this.G=a;this.D=b;this.N=c;this.Tb=d;this.H=e;this.j=new Map;this.F=new Set;wg(b,()=>
|
|
708
|
-
null}return
|
|
709
|
-
Promise.resolve();var u=t;t instanceof ReadableStream&&(u=(u=d())?t.pipeThrough(u):t);return
|
|
710
|
-
l(!0)},0)).subscribe(rxjs.Subscriber.create(r=>{Array.isArray(h)?h.push(r):
|
|
699
|
+
olympe.dc.ma.followRule=olympe.dc.ma.Pb;olympe.dc.ma.instancesOf=olympe.dc.ma.Yk;olympe.dc.ma.fromTag=olympe.dc.ma.Ke;olympe.dc.ma.from=olympe.dc.ma.from;olympe.dc.ma.nc={rf:1,lk:2,Jg:3};olympe.dc.ma.j={ul:'cacheBucketName',Gp:'isCacheable'};function hi(a){null===a.Fa&&null===a.j&&(a.Fa=Bf(a.F))}
|
|
700
|
+
olympe.dc.query.zd=class extends olympe.dc.Ag{constructor(a){super(a,null);this.F=new olympe.dc.transaction.Ce}static mj(a){const b=new olympe.dc.query.zd(`DataResult_${a.T()}`);b.D=a.sb();return b}static j(a){const b=new olympe.dc.query.zd(a.i);let c;b.D=null!=(c=a.s)?c:null;let d;b.Lk=null!=(d=a.t)?d:null;let e;b.Fa=null!=(e=a.p)?e:[];return b}qc(a){hi(this);return super.qc(a)}jc(){hi(this);return super.jc()}Rk(){hi(this);return super.Rk()}create(a,b,c){this.F.Oc(a,this.D,c,b);return this}Oa(a,
|
|
701
|
+
b,c){this.F.Oa(a,b,c,null,null);return this}ga(){return super.ga()}};olympe.dc.query.zd.prototype.createRelation=olympe.dc.query.zd.prototype.Oa;olympe.dc.query.zd.prototype.create=olympe.dc.query.zd.prototype.create;olympe.dc.query.zd.fromQuery=olympe.dc.query.zd.mj;function fi(a,b){const c=new olympe.dc.query.Aq(a.G,b);if(a.D.view.Ha(b.D)){Uh(c,b.D);for(const d of Oh(b))d.nb(c)}return c}
|
|
702
|
+
function gi(a,b,c,d,e,f){const g=b.T();let h=a.j.get(g);if(!h){var k=b.sb();a.G.debug(`Create new subscription for query ${g} for subscriber ${d}, to be executed by the data source ${k}`);k=!1===f.Ac||a.H&&k===olympe.dc.Ja.SERVER?[]:Array.from(a.j.values());h=new olympe.dc.query.Iq(a.G,a.D,b,e,a.R.bind(a,e,f));a.j.set(g,h);ii(h,l=>a.F.add(l));h.start(k)&&(null==f?0:f.Xh)&&ji(a,b,e,f).catch(l=>{a.G.error(`Was not able to get the result of the subscribed query ${g} to add it to the cache: ${l}`)})}return new rxjs.Observable(l=>
|
|
703
|
+
{const n=()=>{p&&c.Gs(p);l.complete();if(q){var r=q;const u=a.j.get(g);a.G.debug(`${d} unsubscribed from ${g}`);if(null==u)r=0;else{var t=u;t.H.delete(r)&&t.G.debug(`Remove subscriber ${d} for query ${t.query.T()}, now have ${t.H.size} subscribers`);d!==olympe.dc.Ja.SELF&&(t.$--,0===t.$&&Xh(t.j));r=0===t.H.size}r&&(a.G.debug(`No more subscriber to ${g}, remove the subscription`),a.F.delete(g),a.j.delete(g),u.destroy())}},p=c.Td(n),q=ki(h,d,l);return n})}
|
|
704
|
+
function li(a){a.F.forEach(b=>{let c;null==(c=a.j.get(b))||mi(c)});a.F.clear()}function ni(a,b,c,d){return w(function*(){const e=null!=d?d:c===olympe.dc.ma.nc.Jg;if(b instanceof ReadableStream)yield vg(a.D,b,{Sm:e});else{var f;if(f=b instanceof olympe.dc.Ag)f=b.T(),f=!a.N.H.has(f);f&&a.D.Tc(b,{Sm:e})}})}function oi(a){a.G.debug('Send GetContext request to the orchestrator');const b=new olympe.dc.Request(olympe.dc.Request.j.Cg,olympe.dc.Ja.SERVER);return a.Tb.request(b).then(c=>{a.D.Tc(c)})}
|
|
705
|
+
function pi(a,b){const c=b.sb();if(c===olympe.dc.Ja.SELF||a.H&&c===olympe.dc.Ja.SERVER)return Promise.resolve(!0);a=Array.from(a.j.values()).filter(d=>d.Nc(b)).map(d=>new Promise(e=>d.hd(f=>e(!f))));return Promise.all(a).then(d=>d.some(e=>e))}function ji(a,b,c,d){return w(function*(){var e=b.sb();e=wf(wf(new olympe.dc.Request(olympe.dc.Request.j.Lg,e,b),olympe.dc.ma.j.Gp,c===olympe.dc.ma.nc.Jg),olympe.dc.ma.j.ul,null==d?void 0:d.Xh);return a.Tb.request(e)})}
|
|
706
|
+
function qi(a,b,c){const d=[];for(const e of a.j.values())ri(e,b,c)&&d.push(ji(a,e.query,olympe.dc.ma.nc.lk,{}).then(f=>ni(a,f,olympe.dc.ma.nc.lk)));return Promise.all(d).then(()=>{})}
|
|
707
|
+
olympe.dc.query.Bv=class{constructor(a,b,c,d,e){this.G=a;this.D=b;this.N=c;this.Tb=d;this.H=e;this.j=new Map;this.F=new Set;wg(b,()=>li(this));zf(d,olympe.dc.Request.j.zo,f=>{ni(this,f.content,olympe.dc.ma.nc.rf).catch(g=>this.G.error(`Error while applying data notification on DB: ${g}`))})}executeQuery(a,b,c){const d=this;return w(function*(){const e='boolean'===typeof c.Ac?c.Ac:yield pi(d,a);if(!e||(null==c?0:c.Xh))try{const f=yield ji(d,a,b,c);e||(yield ni(d,f,b))}catch(f){return d.G.error(`Error while sending a query to data source ${a.sb()}: ${f}`),
|
|
708
|
+
null}return fi(d,a)})}R(a,b,c,d,e,f){const g=c.sb();if(g===olympe.dc.Ja.SELF||b.Ac||this.H&&g===olympe.dc.Ja.SERVER)return e(),null;if(a!==olympe.dc.ma.nc.rf)return ji(this,c,a,b).then(r=>{var t=r;r instanceof ReadableStream&&(t=(t=d())?r.pipeThrough(t):r);return ni(this,t,a,b.gj)}).then(e).catch(f),null;let h,k=!1;const l=r=>{h=[];r&&this.G.debug(`Resend subscription ${c.T()} after detection of dead subscription in the remote service`);ji(this,c,a,b).then(t=>{if(k)return this.G.warn(`Received data result after query subscription ${c.T()} has been destroyed. Could happen with queries observed multiple times successively quickly.`),
|
|
709
|
+
Promise.resolve();var u=t;t instanceof ReadableStream&&(u=(u=d())?t.pipeThrough(u):t);return ni(this,u,a,b.gj).then(()=>{h.forEach(x=>ni(this,x,a))}).finally(()=>{h=null})}).then(e).catch(f)},n=c.T();l(!1);const p=wf(new olympe.dc.Request(olympe.dc.Request.j.pk,g,c),olympe.dc.ma.j.ul,null==b?void 0:b.Xh),q=this.Tb.subscribe(p,l.bind(this,!0)).pipe(nb(olympe.L.errors.pp,()=>{},0)).pipe(nb(olympe.L.errors.eo,(r,t)=>{this.G.debug(`Data Provider: Subscribe to topic ${r.T()} now that we are back online, after waiting for ${t}ms`);
|
|
710
|
+
l(!0)},0)).subscribe(rxjs.Subscriber.create(r=>{Array.isArray(h)?h.push(r):ni(this,r,a)},r=>{this.G.error(`An error occurred with the subscription ${n}: ${r}`);f(String(r))}));return()=>{k=!0;this.G.debug(`Unsubscribe to query ${n} from data source ${g}`);q.unsubscribe()}}};function si(a){const b=olympe.dc.ia();let c=!1;const d=a.k.map(e=>{const f=e.split('.').map(g=>b.Ha(g)?olympe.dc.CloudObject.get(g):(olympe.ja.ab('dc.query').error(`CloudObject with tag ${g} not present but required for deserialization`),c=!0,null));return[e,1===f.length?f[0]:f]});return c?null:olympe.dc.Ia.create(d,a.a,a.r)}
|
|
711
711
|
olympe.dc.Ia=class{constructor(){this.j=[];this.D=new Map;this.F=[];this.H=[];this.hash=''}static empty(){return new olympe.dc.Ia}[Symbol.iterator](){let a=0;return{next:()=>{var b={done:!0};a<this.j.length&&(b=this.j[a],b={value:[b,this.D.get(b)],done:!1},a++);return b}}}entries(){return this.j.map(a=>[a,this.D.get(a)])}values(){return this.D.values()}keys(){return this.j.values()}Oe(){return this.j.map(a=>this.D.get(a))}size(){return this.j.length}has(a){return this.D.has(a)||this.Oe().includes(a)}indexOf(a){return null===
|
|
712
712
|
a||void 0===a?-1:'string'===typeof a?this.j.indexOf(a):this.Oe().indexOf(a)}get(a){return(a=this.D.get(a))?a:null}Gc(){return this.le(0)}le(a){return a<this.j.length?this.D.get(this.j[a]):null}push(...a){const b=this.Oe();b.push(...a);return b}pop(){if(0===this.j.length)return[];const a=this.Oe();a.pop();return a}shift(){if(0<this.j.length){const a=this.Oe();a.shift();return a}return[]}filter(a){return this.Oe().filter(a)}find(a){return(a=this.Oe().find(a))?a:null}forEach(a){this.j.forEach((b,c)=>
|
|
713
713
|
a(this.D.get(b),c))}map(a){return this.Oe().map(a)}sort(a){const b=this.entries().sort((c,d)=>a(c[1],d[1]));return olympe.dc.Ia.create(b,Array.from(this.F),Array.from(this.H))}reduce(a,b){return this.Oe().reduce(a,b)}concat(...a){const b=[this.entries(),...a.map(d=>d.entries())].flat();let c=Array.from(this.F);for(const d of a)c=c.concat(d.F.map(e=>e+c.length));a=this.H.concat(...a.map(d=>d.H));return olympe.dc.Ia.create(b,c,a)}toString(){return`QueryResult: ${JSON.stringify(this)}`}toJSON(){return this.Oe()}nj(){return this.F.map(a=>
|
|
@@ -715,109 +715,109 @@ this.D.get(this.j[a]))}sj(){return this.H.map(a=>{a=a.split('.');return 1===a.le
|
|
|
715
715
|
if(c===a.hash)return a;const g=p=>''===p?null:olympe.dc.CloudObject.get(p);e=b.map(p=>[p.join('.'),1===p.length?g(p[0]):p.map(g)]);const h=new Set(e.map(p=>p[0])),k=new Set(a.keys()),l=[],n=[];e.forEach(([p],q)=>{!k.has(p)&&l.push(q)});k.forEach(p=>{!h.has(p)&&n.push(p)});return olympe.dc.Ia.create(e,l,n,c)}static create(a,b,c,d){const e=new olympe.dc.Ia;e.j=a.map(f=>f[0]);e.D=new Map(a);e.hash=d||olympe.V.tb(e.j.join(''));e.F=b||e.j.map((f,g)=>g);e.H=c||[];return e}ga(a){a&&this.j.flatMap(b=>b.split('.')).forEach(a);
|
|
716
716
|
return{k:this.j,a:this.F,r:this.H}}};olympe.dc.Ia.prototype.getRemoved=olympe.dc.Ia.prototype.sj;olympe.dc.Ia.prototype.getAdded=olympe.dc.Ia.prototype.nj;olympe.dc.Ia.prototype.concat=olympe.dc.Ia.prototype.concat;olympe.dc.Ia.prototype.reduce=olympe.dc.Ia.prototype.reduce;olympe.dc.Ia.prototype.sort=olympe.dc.Ia.prototype.sort;olympe.dc.Ia.prototype.map=olympe.dc.Ia.prototype.map;olympe.dc.Ia.prototype.forEach=olympe.dc.Ia.prototype.forEach;olympe.dc.Ia.prototype.find=olympe.dc.Ia.prototype.find;
|
|
717
717
|
olympe.dc.Ia.prototype.filter=olympe.dc.Ia.prototype.filter;olympe.dc.Ia.prototype.shift=olympe.dc.Ia.prototype.shift;olympe.dc.Ia.prototype.pop=olympe.dc.Ia.prototype.pop;olympe.dc.Ia.prototype.push=olympe.dc.Ia.prototype.push;olympe.dc.Ia.prototype.getAt=olympe.dc.Ia.prototype.le;olympe.dc.Ia.prototype.getFirst=olympe.dc.Ia.prototype.Gc;olympe.dc.Ia.prototype.get=olympe.dc.Ia.prototype.get;olympe.dc.Ia.prototype.indexOf=olympe.dc.Ia.prototype.indexOf;olympe.dc.Ia.prototype.has=olympe.dc.Ia.prototype.has;
|
|
718
|
-
olympe.dc.Ia.prototype.size=olympe.dc.Ia.prototype.size;olympe.dc.Ia.prototype.toArray=olympe.dc.Ia.prototype.Oe;olympe.dc.Ia.prototype.keys=olympe.dc.Ia.prototype.keys;olympe.dc.Ia.prototype.values=olympe.dc.Ia.prototype.values;olympe.dc.Ia.prototype.entries=olympe.dc.Ia.prototype.entries;olympe.dc.Ia.empty=olympe.dc.Ia.empty;function
|
|
719
|
-
olympe.dc.nd.prototype.execute=olympe.dc.nd.prototype.nb;olympe.dc.nd.prototype.cast=olympe.dc.nd.prototype.hj;olympe.dc.nd.prototype.follow=olympe.dc.nd.prototype.fb;const
|
|
720
|
-
function
|
|
721
|
-
function
|
|
722
|
-
function
|
|
723
|
-
function
|
|
724
|
-
olympe.dc.query.Iq=class{constructor(a,b,c,d,e){this.G=a;this.ua=b;this.db=b.view;this.query=c;this.jd=d;this.j=new olympe.dc.query.Aq(this.G,c);this.$=0;this.da=1;this.Y=[];this.H=new Map;this.D=[()=>
|
|
725
|
-
(null===this.D||this.query.D===a.D)&&this.j.Nc(a))}hd(a){null!==this.D?this.D.push(a):a();return this}destroy(a){a?this.G.error(`Destroy subscription ${this.query.T()} after error: ${a}`):this.G.debug(`Destroy subscription ${this.query.T()}`);const b=this.Y;this.Y=null;this.H.forEach(e=>a?e.error(a):e.complete());let c;null==(c=this.F)||c.forEach(e=>
|
|
726
|
-
olympe.dc.ma.nc.Jg;if(this.jd===a)return olympe.V.stream.tap(c=>{c=c.Rk().filter(d=>d.o===olympe.dc.Lc.j).map(d=>d.t);this.ua.je(c,'Batch mode')});let b;if(0<(null==(b=this.R)?void 0:b.length)){const c=this.R.filter(e=>e.jd===a).map(e=>new Promise(f=>e.hd(f))),d=this.R.filter(e=>e.jd!==a).map(e=>new Promise(f=>e.hd(f)));this.R=void 0;return new TransformStream({start:()=>Promise.all(c),flush:()=>Promise.all(d)})}return null}};function
|
|
727
|
-
class
|
|
728
|
-
!this.N&&this.db.Ha(a))){var c;this.j||(this.j=null==(c=this.properties)?void 0:c.some(([d,e])=>b.has(d)&&
|
|
729
|
-
new olympe.dc.Ra.Relation(a),c)){const d=this.F.get(
|
|
718
|
+
olympe.dc.Ia.prototype.size=olympe.dc.Ia.prototype.size;olympe.dc.Ia.prototype.toArray=olympe.dc.Ia.prototype.Oe;olympe.dc.Ia.prototype.keys=olympe.dc.Ia.prototype.keys;olympe.dc.Ia.prototype.values=olympe.dc.Ia.prototype.values;olympe.dc.Ia.prototype.entries=olympe.dc.Ia.prototype.entries;olympe.dc.Ia.empty=olympe.dc.Ia.empty;function ti(a){return 1<a.size()?(olympe.ja.ab('dc').warn(`a follow() on a QuerySingle has ${a.size()} results (0 or 1 expected) -> returns null`),null):a.Gc()||null}olympe.dc.nd=class{constructor(a){this.query=a}static from(a){return new olympe.dc.nd(olympe.dc.ma.from(a))}fb(a){return new olympe.dc.nd(this.query.fb(a))}hj(){return this}nb(a){return this.query.nb(a).then(b=>ti(b))}Fc(){return ti(this.query.Fc())}};olympe.dc.nd.prototype.executeFromCache=olympe.dc.nd.prototype.Fc;
|
|
719
|
+
olympe.dc.nd.prototype.execute=olympe.dc.nd.prototype.nb;olympe.dc.nd.prototype.cast=olympe.dc.nd.prototype.hj;olympe.dc.nd.prototype.follow=olympe.dc.nd.prototype.fb;const ui=olympe.dc.va.ORIGIN,vi=olympe.dc.va.DESTINATION;function ii(a,b){Qh(a.j,()=>{a.gb()||null!==a.D||b(a.query.T())})}function ki(a,b,c){const d=a.da;a.da++;a.H.set(d,c);b===olympe.dc.Ja.SELF?a.hd(e=>e?c.error(e):c.next(a.j)):(a.$++,1===a.$&&a.hd(()=>Wh(a.j)));a.G.debug(`Add subscriber ${b} for query ${a.query.T()}, now have ${a.H.size} subscribers`);return d}
|
|
720
|
+
function ri(a,b,c){if(a.query.sb()!==b)return!1;c.qc(a.ha);(b=a.ha.flush())&&a.G.debug(`Subscription ${a.query.T()} is considered as obsolete after the transaction ${c.T()} applied on DB`);return b}function mi(a){Yh(a.j);a.H.forEach(b=>{b.next(a.j)})}
|
|
721
|
+
function wi(a,b,c){const d=[];let e=!1;const f=new olympe.async.mk(olympe.C.ah());for(const g of b)if(g.Nc(a.query)&&(e||(e=!0),f.add(h=>g.hd(k=>{!k&&d.push(g);h()}))),null!==g.D&&ei(a.query,g.query)){let h;null==(h=a.R)||h.push(g)}bd(f,g=>c(g?d:[]));f.start();return e}
|
|
722
|
+
function xi(a){const b=a.query.T(),c=new Map,d=q=>{const r=c.get(q);return r?1===r.size?Array.from(r)[0]:(t,u,x,y)=>r.forEach(z=>z(t,u,x,y)):()=>{}},e=Oh(a.query),f=a.j;for(let q=e.length-1;0<=q;q--){var g=e[q];const r=g.T(),t=g.j;g=g.observe(f,d(r));let u;c.set(t,(null!=(u=c.get(t))?u:new Set).add(g))}const h=a.db,k=a.query.D,l=olympe.V.tb(k),n=sf(h,k,(q,r)=>{q?Uh(f,r):f.remove(r);d(l)(q,r,null,b)});let p;null==(p=a.Y)||p.push(()=>{qf(h,k,n)});yi(a)}
|
|
723
|
+
function zi(a){const b=a.Ga(a.query,a.$a.bind(a),()=>{null===a.D||a.gb()||xi(a)},d=>{a.gb()||(a.G.error(`Error while getting data from data source (${a.query.sb()}) to ensure coverage of the query ${a.query.T()}: ${d}`),yi(a))});let c;b&&(null==(c=a.Y)||c.push(b))}function Ai(a,b){a.N.delete(b);0===a.N.size&&(a.N=null,Promise.resolve().then(()=>{!a.gb()&&zi(a)}))}function yi(a){const b=a.D;a.D=null;null==b||b.forEach(c=>c())}
|
|
724
|
+
olympe.dc.query.Iq=class{constructor(a,b,c,d,e){this.G=a;this.ua=b;this.db=b.view;this.query=c;this.jd=d;this.j=new olympe.dc.query.Aq(this.G,c);this.$=0;this.da=1;this.Y=[];this.H=new Map;this.D=[()=>Yh(this.j)];this.Ga=e;this.ha=new Bi(a,this.db,c,this.j);this.F=this.N=null;this.R=[]}start(a){return wi(this,a,b=>{0<b.length?(this.N=new Set(b),this.N.forEach(c=>{null===c.F&&(c.F=new Set);c.F.add(this)}),xi(this)):zi(this)})}Nc(a){return!this.gb()&&this.query.sb()===a.sb()&&(this.query.T()===a.T()||
|
|
725
|
+
(null===this.D||this.query.D===a.D)&&this.j.Nc(a))}hd(a){null!==this.D?this.D.push(a):a();return this}destroy(a){a?this.G.error(`Destroy subscription ${this.query.T()} after error: ${a}`):this.G.debug(`Destroy subscription ${this.query.T()}`);const b=this.Y;this.Y=null;this.H.forEach(e=>a?e.error(a):e.complete());let c;null==(c=this.F)||c.forEach(e=>Ai(e,this));let d;null==(d=this.N)||d.forEach(e=>{e.F.delete(this);0===e.F.size&&(e.F=null)});b.forEach(e=>e())}gb(){return null===this.Y}$a(){const a=
|
|
726
|
+
olympe.dc.ma.nc.Jg;if(this.jd===a)return olympe.V.stream.tap(c=>{c=c.Rk().filter(d=>d.o===olympe.dc.Lc.j).map(d=>d.t);this.ua.je(c,'Batch mode')});let b;if(0<(null==(b=this.R)?void 0:b.length)){const c=this.R.filter(e=>e.jd===a).map(e=>new Promise(f=>e.hd(f))),d=this.R.filter(e=>e.jd!==a).map(e=>new Promise(f=>e.hd(f)));this.R=void 0;return new TransformStream({start:()=>Promise.all(c),flush:()=>Promise.all(d)})}return null}};function Ci(a,b){return a.F.has(vi+b)||a.F.has(ui+b)}
|
|
727
|
+
class Bi{constructor(a,b,c,d){this.G=a;this.db=b;this.H=d;this.R=[];this.N=-1<c.j.max||0<c.j.offset;this.F=new Map;this.j=!1;const e=new Map;for(const f of Oh(c)){a=f.T();this.R.push(a);if(f instanceof olympe.dc.query.oa.Kh){a=f.relation;a=`${a.Ka()}${a.X()}`;let g;b=null!=(g=this.F.get(a))?g:[];b.push(f);this.F.set(a,b)}Di(f).forEach(g=>{let h;const k=null!=(h=e.get(g))?h:[];k.push(f.T());e.set(g,k)})}this.properties=Array.from(e.entries())}flush(){const a=this.j;this.j=!1;return a}Oc(){}Wc(a,b){if(!(this.j||
|
|
728
|
+
!this.N&&this.db.Ha(a))){var c;this.j||(this.j=null==(c=this.properties)?void 0:c.some(([d,e])=>b.has(d)&&Th(this.H,a,e)))}}D(a){this.j||this.db.Ha(a)&&!this.N||this.j||(this.j=this.R.some(b=>Th(this.H,a,b)))}Oa(a,b,c){if(!this.j&&Ci(this,a)){var d=this.db.Ha(b),e=this.db.Ha(c);if(d&&!e||!d&&e){const f=this.F.get(vi+a);a=this.F.get(ui+a);this.j||(this.j=d&&(null==f?void 0:f.some(g=>Th(this.H,b,g.j)))||e&&(null==a?void 0:a.some(g=>Th(this.H,c,g.j))))}}}hc(a,b,c){if(!this.j&&this.N&&Ci(this,a)&&this.db.As(b,
|
|
729
|
+
new olympe.dc.Ra.Relation(a),c)){const d=this.F.get(vi+a);a=this.F.get(ui+a);const e=this.H;this.j||(this.j=(null==d?void 0:d.some(f=>Th(e,b,f.j)&&Th(e,c,f.T())))||(null==a?void 0:a.some(f=>Th(e,c,f.j)&&Th(e,b,f.T()))))}}}olympe.dc.query.Iq.xa=[olympe.dc.Writable];function Ei(a){return new olympe.dc.query.Relation(a.tag,a.direction,!0)}
|
|
730
730
|
olympe.dc.query.Relation=class extends olympe.dc.Ra.Relation{constructor(a,b,c){super(a,b);this.recursive=c}toJSON(){let a='{ "tag": '+JSON.stringify(this.X())+', ';a+='"direction": '+JSON.stringify(this.Ka())+', ';a+='"recursive": '+JSON.stringify(this.recursive);return a+'}'}static Qb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.dc.query.Relation(b.tag,b.direction,b.recursive)}static from(a,b){return new olympe.dc.query.Relation(a.X(),a.Ka(),null!=b?b:a instanceof olympe.dc.ba.Fe)}$b(){const a=
|
|
731
|
-
olympe.dc.va.DESTINATION,b=olympe.dc.va.ORIGIN;return new olympe.dc.query.Relation(this.tag,this.direction===a?b:a,this.recursive)}T(){return`${this.direction}${this.tag}${this.recursive?'-r':''}`}};olympe.dc.query.P={Ca:'dc.query.Logger',nk:'dc.query.QueryProcessor'};olympe.W.config(function(a){E(a,olympe.dc.query.P.Ca,[olympe.ja.P.Da],b=>b.cd('query'));D(a,olympe.dc.query.P.nk,olympe.dc.query.Bv,olympe.dc.query.P.Ca,olympe.dc.db.P.Da,olympe.dc.transaction.P.Da,olympe.dc.P.Ng,new olympe.W.pa(olympe.dc.U.Mh))});olympe.W.run([olympe.dc.query.P.nk],a=>{olympe.dc.query.Uk=()=>a});olympe.dc.query.yd=class extends Error{};olympe.dc.query.Z={};olympe.dc.query.Z.Jd=class extends olympe.dc.query.Aa{constructor(...a){super();this.Z=a}compile(){
|
|
732
|
-
Array(this.Z.length).fill(!1);let e=null;const f=(g,h)=>{d[g]=h;g=d.every(k=>k);e!==g&&(e=g,c(g))};this.Z.forEach((g,h)=>{g.observe(a,olympe.V.tb('AND-'+b+a+h),f.bind(null,h))})}ga(){return{pr:olympe.dc.query.Aa.j.Jn,p:this.Z.map(a=>a.ga())}}Vc(){throw Error('toObject for AND predicate should not be called');}toString(){return'And-'+this.Z.reduce((a,b)=>a+'-'+b.toString(),'')}clear(a,b){this.Z.forEach((c,d)=>{c.clear(a,olympe.V.tb('AND-'+b+a+d))})}};olympe.dc.query.Z.tf=class extends olympe.dc.query.Aa{constructor(a,b,c,d=!1){super();this.La=olympe.dc.fa(a);this.substring=b;this.db=c;this.j=d}Db(){return[this.La]}Nc(a,b){return a instanceof olympe.dc.query.Z.tf&&a.La===this.La?b?a.j?a.substring.toLowerCase().includes(this.substring.toLowerCase()):a.substring.includes(this.substring):this.j?this.substring.toLowerCase().includes(a.substring.toLowerCase()):this.substring.includes(a.substring):!1}Qa(){return this.La}nb(a){return this.apply(this.db.Qa(a,
|
|
731
|
+
olympe.dc.va.DESTINATION,b=olympe.dc.va.ORIGIN;return new olympe.dc.query.Relation(this.tag,this.direction===a?b:a,this.recursive)}T(){return`${this.direction}${this.tag}${this.recursive?'-r':''}`}};olympe.dc.query.P={Ca:'dc.query.Logger',nk:'dc.query.QueryProcessor'};olympe.W.config(function(a){E(a,olympe.dc.query.P.Ca,[olympe.ja.P.Da],b=>b.cd('query'));D(a,olympe.dc.query.P.nk,olympe.dc.query.Bv,olympe.dc.query.P.Ca,olympe.dc.db.P.Da,olympe.dc.transaction.P.Da,olympe.dc.P.Ng,new olympe.W.pa(olympe.dc.U.Mh))});olympe.W.run([olympe.dc.query.P.nk],a=>{olympe.dc.query.Uk=()=>a});olympe.dc.query.yd=class extends Error{};olympe.dc.query.Z={};olympe.dc.query.Z.Jd=class extends olympe.dc.query.Aa{constructor(...a){super();this.Z=a}compile(){const a=b=>0<b.length?b[0].reduce((c,d)=>[...c,...a(b.slice(1)).map(e=>[...d,...e])],[]):[[]];return a(this.Z.map(b=>b.compile()))}ud(){return new olympe.dc.query.Z.Be(...this.Z.map(a=>a.ud()))}Db(){return this.Z.flatMap(a=>a.Db())}Nc(){throw Error('Should not try to check predicate coverage on And (should be removed by compiling predicates');}nb(a){return this.Z.reduce((b,c)=>b&&c.nb(a),!0)}observe(a,
|
|
732
|
+
b,c){const d=Array(this.Z.length).fill(!1);let e=null;const f=(g,h)=>{d[g]=h;g=d.every(k=>k);e!==g&&(e=g,c(g))};this.Z.forEach((g,h)=>{g.observe(a,olympe.V.tb('AND-'+b+a+h),f.bind(null,h))})}ga(){return{pr:olympe.dc.query.Aa.j.Jn,p:this.Z.map(a=>a.ga())}}Vc(){throw Error('toObject for AND predicate should not be called');}toString(){return'And-'+this.Z.reduce((a,b)=>a+'-'+b.toString(),'')}clear(a,b){this.Z.forEach((c,d)=>{c.clear(a,olympe.V.tb('AND-'+b+a+d))})}};olympe.dc.query.Z.tf=class extends olympe.dc.query.Aa{constructor(a,b,c,d=!1){super();this.La=olympe.dc.fa(a);this.substring=b;this.db=c;this.j=d}Db(){return[this.La]}Nc(a,b){return a instanceof olympe.dc.query.Z.tf&&a.La===this.La?b?a.j?a.substring.toLowerCase().includes(this.substring.toLowerCase()):a.substring.includes(this.substring):this.j?this.substring.toLowerCase().includes(a.substring.toLowerCase()):this.substring.includes(a.substring):!1}Qa(){return this.La}nb(a){return this.apply(this.db.Qa(a,
|
|
733
733
|
this.La))}observe(a,b,c){Lg(this.db,a,this.La,d=>{c(this.apply(d))},olympe.V.tb(b+a+this.toString()))}apply(a){a=olympe.dc.mb.Bc(a);return'string'===typeof a?this.j?a.includes(this.substring):a.toLowerCase().includes(this.substring.toLowerCase()):!1}toString(){return'Contains'+this.La+'-'+this.substring+'-'+this.j}clear(a,b){Mg(this.db,a,this.La,olympe.V.tb(b+a+this.toString()))}Vc(){return{name:'CONTAINS',property:this.Qa(),value:this.substring,caseSensitive:this.j}}ga(){return{pr:olympe.dc.query.Aa.j.Nj,
|
|
734
734
|
p:this.La,s:this.substring,c:this.j}}};olympe.dc.query.Z.ve=class extends olympe.dc.query.Aa{constructor(a,b,c){super();this.La=olympe.dc.fa(a);this.j=olympe.dc.mb.Bc(null!=b?b:null);this.db=c}Db(){return[this.La]}Nc(a){if(a instanceof olympe.dc.query.Z.ve&&this.La===a.La)if('object'===typeof this.j&&null!==this.j){if(this.j instanceof olympe.dc.CloudObject)return this.j.Ea(a.j);if(this.j instanceof Date)return a.j instanceof Date&&this.j.getTime()===a.j.getTime();if(this.j instanceof olympe.C.Color)return this.j.Ea(a.j)}else return this.j===
|
|
735
735
|
a.j;return!1}nb(a){return this.apply(this.db.Qa(a,this.La))}observe(a,b,c){Lg(this.db,a,this.La,d=>{c(this.apply(d))},olympe.V.tb(b+a+this.toString()));null===this.j&&null===this.db.Qa(a,this.La)&&c(!0)}clear(a,b){Mg(this.db,a,this.La,olympe.V.tb(b+a+this.toString()))}apply(a){a=olympe.dc.mb.Bc(a);return'object'===typeof a&&null!==a?a instanceof olympe.dc.CloudObject?a.Ea(this.j):a instanceof Date?this.j instanceof Date&&this.j.getTime()===a.getTime():a instanceof olympe.C.Color?a.Ea(this.j):!1:a===
|
|
736
|
-
this.j}toString(){let a,b;const c=null!=(b=null==(a=this.j)?void 0:a.toString())?b:'null';return'Equals-'+this.La+'-'+c}Vc(){return{name:'EQUALS',property:this.La,value:this.j}}ga(){let a=1,b=this.j;switch(!0){case this.j instanceof Date:a=2;b=this.j.toJSON();break;case this.j instanceof olympe.dc.CloudObject:a=3;b=this.j.X();break;case this.j instanceof olympe.C.Color:a=4,b=this.j.toJSON()}return{pr:olympe.dc.query.Aa.j.Po,p:this.La,t:a,v:b}}};function
|
|
736
|
+
this.j}toString(){let a,b;const c=null!=(b=null==(a=this.j)?void 0:a.toString())?b:'null';return'Equals-'+this.La+'-'+c}Vc(){return{name:'EQUALS',property:this.La,value:this.j}}ga(){let a=1,b=this.j;switch(!0){case this.j instanceof Date:a=2;b=this.j.toJSON();break;case this.j instanceof olympe.dc.CloudObject:a=3;b=this.j.X();break;case this.j instanceof olympe.C.Color:a=4,b=this.j.toJSON()}return{pr:olympe.dc.query.Aa.j.Po,p:this.La,t:a,v:b}}};function Fi(a,b,c){return olympe.V.tb(c+b+a.j+a.La)}
|
|
737
737
|
olympe.dc.query.Z.Gi=class extends olympe.dc.query.Aa{constructor(a,b,c,d=!0,e=!0){super();this.db=a;this.La=olympe.dc.fa(b);this.j=(this.F=('object'===typeof c||'string'===typeof c)&&olympe.dc.CloudObject.exists(c))?olympe.dc.fa(c):c;this.D=d;this.H=e}ud(){return new olympe.dc.query.Z.Gi(this.db,this.La,this.j,!this.D,!this.H)}Db(){return[this.La]}Nc(a,b){if(b)throw Error('Check coverage of inequality should not happen with opposite = true');return a instanceof olympe.dc.query.Z.Gi&&this.La===a.La?
|
|
738
|
-
typeof this.j!==typeof a.j||this.D!==a.D?!1:this.F?this.j===a.j:this.D&&this.j>=a.j||!this.D&&this.j<=a.j:!1}Qa(){return this.La}nb(a){return this.compare(this.db.Qa(a,this.La),this.F?this.db.Qa(a,this.j):this.j)}observe(a,b,c){this.F&&Lg(this.db,a,this.j,d=>{const e=this.db.Qa(a,this.La);null!==e&&c(this.compare(e,d))},
|
|
739
|
-
this.D?a<b:a>b:this.D?a<=b:a>=b}clear(a,b){Mg(this.db,a,this.La,
|
|
738
|
+
typeof this.j!==typeof a.j||this.D!==a.D?!1:this.F?this.j===a.j:this.D&&this.j>=a.j||!this.D&&this.j<=a.j:!1}Qa(){return this.La}nb(a){return this.compare(this.db.Qa(a,this.La),this.F?this.db.Qa(a,this.j):this.j)}observe(a,b,c){this.F&&Lg(this.db,a,this.j,d=>{const e=this.db.Qa(a,this.La);null!==e&&c(this.compare(e,d))},Fi(this,a,b));Lg(this.db,a,this.La,d=>{const e=this.F?this.db.Qa(a,this.j):this.j;c(null!==e?this.compare(d,e):!0)},Fi(this,a,b))}compare(a,b){return null===a?!1:null===b?!0:this.H?
|
|
739
|
+
this.D?a<b:a>b:this.D?a<=b:a>=b}clear(a,b){Mg(this.db,a,this.La,Fi(this,a,b));this.F&&Mg(this.db,a,this.j,Fi(this,a,b))}Vc(){return{name:'INEQUALITY_OPERATOR',property:this.Qa(),operator:this.D?'<':'>',strict:this.H,value:this.j}}ga(){return{pr:olympe.dc.query.Aa.j.Ap,p:this.La,b:this.j,l:this.D,s:this.H}}toString(){return(this.D?'LowerThan-':'GreaterThan-')+this.La+'-'+this.H+'-'+this.j}};olympe.dc.query.Z.fe=class extends olympe.dc.query.Aa{constructor(a){super();this.j=a}compile(){const a=this.j.ud();return this.Ea(a)?super.compile():a.compile()}ud(){return this.j}Db(){return this.j.Db()}Nc(a,b){return a instanceof olympe.dc.query.Z.fe?this.j.Nc(a.j,b):this.j.Nc(a,!b)}nb(a){return!this.j.nb(a)}observe(a,b,c){let d=null;this.j.observe(a,olympe.V.tb('NOT'+b+a),e=>{!e!==d&&(d=!e,c(d))})}Vc(){return{name:'NOT',predicate:this.j.Vc()}}ga(){return{pr:olympe.dc.query.Aa.j.aq,v:this.j.ga()}}toString(){return`NOT-${this.j.toString()}`}clear(a,
|
|
740
740
|
b){this.j.clear(a,olympe.V.tb('NOT'+b+a))}Ea(a){return a instanceof olympe.dc.query.Z.fe?this.j.Ea(a.j):!1}};olympe.dc.query.Z.Be=class extends olympe.dc.query.Aa{constructor(...a){super();this.Z=a}compile(){return this.Z.map(a=>a.compile()).flat()}ud(){return new olympe.dc.query.Z.Jd(...this.Z.map(a=>a.ud()))}Db(){return this.Z.flatMap(a=>a.Db())}Nc(){throw Error('Should not try to check predicate coverage on And (should be removed by compiling predicates');}nb(a){return this.Z.reduce((b,c)=>b||c.nb(a),!1)}observe(a,b,c){const d=Array(this.Z.length).fill(!1);let e=null;const f=(g,h)=>{d[g]=h;g=d.some(k=>
|
|
741
|
-
k);e!==g&&(e=g,c(g))};this.Z.forEach((g,h)=>{g.observe(a,olympe.V.tb('OR-'+b+a+h),f.bind(null,h))})}Vc(){throw Error('toObject for OR predicate should not be called');}ga(){return{pr:olympe.dc.query.Aa.j.pq,p:this.Z.map(a=>a.ga())}}toString(){return'
|
|
742
|
-
return'string'===typeof a?(a=this.j.test(this.D?a:a.toLowerCase()),this.j.lastIndex=0,a):!1}toString(){return'Regex'+this.La+'-'+this.j.toString()+'-'+this.D}Vc(){return{name:'REGEX',property:this.La,pattern:this.j,caseSensitive:this.D}}ga(){return{pr:olympe.dc.query.Aa.j.Kq,p:this.La,r:this.j.source,c:this.D}}clear(a,b){Mg(this.db,a,this.La,olympe.V.tb(b+a+this.toString()))}};olympe.dc.query.Z.Fm=class extends olympe.dc.query.Aa{constructor(a){super();this.j=new Set(a.map(olympe.dc.fa))}Db(){return[]}Nc(a){return a instanceof olympe.dc.query.Z.Fm&&Array.from(a.j).every(b=>this.j.has(b))}nb(a){return this.j.has(a)}observe(a,b,c){c(this.j.has(a))}clear(){}toString(){return'Tags-'+Array.from(this.j)}Vc(){return{name:'IS',tags:Array.from(this.j)}}ga(){return{pr:olympe.dc.query.Aa.j.tr,t:Array.from(this.j)}}};olympe.dc.query.oa={};function
|
|
743
|
-
function
|
|
744
|
-
olympe.dc.query.oa.tm=class{constructor(a,b){this.db=olympe.dc.ia();this.j=a;this.optional=b;this.da=this.Hb=this.D=this.id=null}static j(a){var b=a.i;if('string'===typeof a.f)return new olympe.dc.query.oa.Kd(b,a.f);var c=a.o;const d=new olympe.dc.Ra.Relation(a.t,a.d);b='boolean'===typeof a.s?new olympe.dc.query.oa.we(b,d,a.s,c):new olympe.dc.query.oa.wh(b,d,c);void 0!==a.p&&(b.D
|
|
745
|
-
b,c,d;return`${this.j}-${this.optional}${null!=(c=null==(a=this.D)?void 0:a.toString())?c:''}${null!=(d=null==(b=this.Hb)?void 0:b.toString())?d:''}`}Vc(){}toJSON(){}ga(){const a={i:this.j,o:this.optional};null!==this.D&&(a.p=this.D.ga());null!==this.Hb&&(a.c=this.Hb.ga());return a}Y(){}ha(){return new olympe.dc.query.oa.Am}$(){}T(){this.id||(this.id=this.Y());return this.id}R(){return this.optional}Nc(a){const b=
|
|
746
|
-
|
|
741
|
+
k);e!==g&&(e=g,c(g))};this.Z.forEach((g,h)=>{g.observe(a,olympe.V.tb('OR-'+b+a+h),f.bind(null,h))})}Vc(){throw Error('toObject for OR predicate should not be called');}ga(){return{pr:olympe.dc.query.Aa.j.pq,p:this.Z.map(a=>a.ga())}}toString(){return'Or-'+this.Z.reduce((a,b)=>a.toString()+'-'+b.toString(),'')}clear(a,b){this.Z.forEach((c,d)=>{c.clear(a,olympe.V.tb('OR-'+b+a+d))})}};olympe.dc.query.Z.Ef=class extends olympe.dc.query.Aa{constructor(a,b,c,d=!0){super();this.La=olympe.dc.fa(a);this.j='string'===typeof b?new RegExp(d?b:b.toLowerCase()):d?b:new RegExp(b.source.toLowerCase());this.db=c;this.D=d}Db(){return[this.La]}Nc(a){return a instanceof olympe.dc.query.Z.Ef&&this.La===a.La&&this.j.toString()===a.j.toString()}nb(a){return this.apply(this.db.Qa(a,this.La))}observe(a,b,c){Lg(this.db,a,this.La,d=>{c(this.apply(d))},olympe.V.tb(b+a+this.toString()))}apply(a){a=olympe.dc.mb.Bc(a);
|
|
742
|
+
return'string'===typeof a?(a=this.j.test(this.D?a:a.toLowerCase()),this.j.lastIndex=0,a):!1}toString(){return'Regex'+this.La+'-'+this.j.toString()+'-'+this.D}Vc(){return{name:'REGEX',property:this.La,pattern:this.j,caseSensitive:this.D}}ga(){return{pr:olympe.dc.query.Aa.j.Kq,p:this.La,r:this.j.source,c:this.D}}clear(a,b){Mg(this.db,a,this.La,olympe.V.tb(b+a+this.toString()))}};olympe.dc.query.Z.Fm=class extends olympe.dc.query.Aa{constructor(a){super();this.j=new Set(a.map(olympe.dc.fa))}Db(){return[]}Nc(a){return a instanceof olympe.dc.query.Z.Fm&&Array.from(a.j).every(b=>this.j.has(b))}nb(a){return this.j.has(a)}observe(a,b,c){c(this.j.has(a))}clear(){}toString(){return'Tags-'+Array.from(this.j)}Vc(){return{name:'IS',tags:Array.from(this.j)}}ga(){return{pr:olympe.dc.query.Aa.j.tr,t:Array.from(this.j)}}};olympe.dc.query.oa={};function Di(a){let b,c;const d=new Set(null!=(c=null==(b=a.D)?void 0:b.Db())?c:[]);let e;a.Hb&&d.add(null==(e=a.Hb)?void 0:e.Qa().X());return d}function Gi(a){if(!a.da){let b,c;a.da=null!=(c=null==(b=a.D)?void 0:b.compile())?c:[]}return a.da}function Hi(a,b){for(const c of b)if(a.some(d=>d.Nc(c,!1)))return!0;return!1}
|
|
743
|
+
function Ii(a,b){if(null===a.D)return b;let c=!1;const d=a.toString();return(e,f,g,h)=>{const k=olympe.V.tb(h+f+d);e?a.D.observe(f,k,l=>{c||b(l,f,g,k)}):(c=!0,a.D.clear(f,k),c=!1,b(!1,f,g,k))}}function Ji(a,b,c){if(null===a.Hb)return c;const d=a.toString();return(e,f,g,h)=>{const k=a.Hb.Qa();h=olympe.V.tb(h+d);e?Lg(a.db,f,k,()=>{Rh(b)},h):Mg(a.db,f,k,h);c(e,f,g,h)}}
|
|
744
|
+
olympe.dc.query.oa.tm=class{constructor(a,b){this.db=olympe.dc.ia();this.j=a;this.optional=b;this.da=this.Hb=this.D=this.id=null}static j(a){var b=a.i;if('string'===typeof a.f)return new olympe.dc.query.oa.Kd(b,a.f);var c=a.o;const d=new olympe.dc.Ra.Relation(a.t,a.d);b='boolean'===typeof a.s?new olympe.dc.query.oa.we(b,d,a.s,c):new olympe.dc.query.oa.wh(b,d,c);void 0!==a.p&&(b.D=$h(a.p));void 0!==a.c&&(c=b.T(),a=a.c,a=new olympe.dc.query.sf(c,new olympe.dc.Ra.Property(a.p),a.o),b.Hb=a);return b}N(){}H(){let a,
|
|
745
|
+
b,c,d;return`${this.j}-${this.optional}${null!=(c=null==(a=this.D)?void 0:a.toString())?c:''}${null!=(d=null==(b=this.Hb)?void 0:b.toString())?d:''}`}Vc(){}toJSON(){}ga(){const a={i:this.j,o:this.optional};null!==this.D&&(a.p=this.D.ga());null!==this.Hb&&(a.c=this.Hb.ga());return a}Y(){}ha(){return new olympe.dc.query.oa.Am}$(){}T(){this.id||(this.id=this.Y());return this.id}R(){return this.optional}Nc(a){const b=Gi(this);if(0===b.length)return!0;a=Gi(a);if(0===a.length)return!1;for(const c of a)if(!b.some(d=>
|
|
746
|
+
Hi(d,c)))return!1;return!0}filter(a){const b=this.N(),c=b.D;null===c?b.D=a:b.D=c instanceof olympe.dc.query.Z.Jd?new olympe.dc.query.Z.Jd(...Array.from(c.Z),a):new olympe.dc.query.Z.Jd(b.D,a);return b}sort(a,b){const c=this.N();c.Hb=new olympe.dc.query.sf(this.T(),a,b);return c}$g(){return this.Hb}nb(a){if(null!==this.D){var b=this.T();for(const c of Sh(a,b))this.D.nb(c)||a.remove(c,b,null)}}observe(a,b){const c=this.T();return Ii(this,Ji(this,a,(d,e,f,g)=>{(d?Uh(a,e,c,f):a.remove(e,c,f))&&b(d,e,
|
|
747
747
|
f,g)}))}Ea(){}};olympe.dc.query.oa.Kh=class extends olympe.dc.query.oa.tm{constructor(a,b,c){super(a,c);this.relation=b;this.ua=null}};olympe.dc.query.oa.um=class{has(){}H(){}j(){}Rc(){}D(){}remove(){}};olympe.dc.query.oa.Kd=class extends olympe.dc.query.oa.tm{constructor(a,b,c){super(a,!1);this.Pb=b;this.F=null!=c?c:null}N(){return new olympe.dc.query.oa.Kd(this.j,this.Pb,this.F)}Y(){return olympe.V.tb(this.j+'followRules')}ha(){return new olympe.dc.query.oa.Hp(this.db,this.F)}$(a,b){return b instanceof olympe.dc.query.oa.Kd?[a]:[olympe.V.tb(a+'followRules')]}Nc(a){if(a instanceof olympe.dc.query.oa.Kh){const b=olympe.dc.va.ORIGIN,c=olympe.dc.va.DESTINATION,d=olympe.dc.fc.Yc,e=olympe.dc.fc.zi,f=
|
|
748
|
-
olympe.dm.Relation.j.Qq,g=olympe.dm.Relation.j.yr;a=a.relation;const h=a.Ka(),k=a.X();return h!==c||k!==d&&k!==e?!!(Ug(this.db,a,this.Pb)&(a.Ka()===b?f:g)):!0}return a instanceof olympe.dc.query.oa.Kd?this.Pb===a.Pb:!1}nb(a){const b=this.T();for(const c of
|
|
749
|
-
Wg(this.db,g,this.Pb,k);b(f,g,e,k)};return(e,f,g,h)=>{(e?
|
|
750
|
-
rule:`${this.db.name(this.Pb)} (${this.Pb})`}}R(){return!1}filter(){olympe.ja.ab('dc.query').warn('Should never try to filter on queries with follow rules, ignore...');return this}sort(){olympe.ja.ab('dc.query').warn('Should never try to sort queries with follow rules, ignore...');return this}};olympe.dc.query.oa.Kd.D='followRules';olympe.dc.query.oa.wh=class extends olympe.dc.query.oa.Kh{constructor(a,b,c){super(a,olympe.dc.query.Relation.from(b,!1),c)}N(){const a=new olympe.dc.query.oa.wh(this.j,this.relation,this.optional);a.D=this.D;a.Hb=this.Hb;return a}Y(){return olympe.V.tb(this.j+this.relation.T())}$(a,b){if(b instanceof olympe.dc.query.oa.Kd)return[a];const c=[a+this.relation.T(),a+
|
|
751
|
-
c.push(a);return c}nb(a){const b=this.T();for(const c of
|
|
752
|
-
{recursive:!1,relation:this.relation,filter:
|
|
753
|
-
b.relation.Ea(this.relation)&&c.push(a);return c}nb(a){const b=this.T();for(const c of
|
|
754
|
-
g,olympe.V.tb(h+g));e(f,g,g,h)}}ga(){return Object.assign(super.ga(),{s:this.F,t:this.relation.X(),d:this.relation.Ka()})}H(){return`followRecursivelyPart-${this.relation.T()}-${this.F}-${super.H()}`}Vc(){const a={recursive:this.F?'INCLUDE_SELF':'EXCLUDE_SELF',relation:this.relation,filter:
|
|
755
|
-
relation:`${this.db.name(this.relation)} (${this.relation.X()})`,direction:this.relation.Ka()}}Ea(a){return a instanceof olympe.dc.query.oa.we&&this.relation.Ea(a.relation)&&this.F===a.F}};olympe.dc.query.oa.$o=class extends olympe.dc.query.oa.Kd{observe(a,b){const c=this.T();return(d,e,f,g)=>{d?
|
|
748
|
+
olympe.dm.Relation.j.Qq,g=olympe.dm.Relation.j.yr;a=a.relation;const h=a.Ka(),k=a.X();return h!==c||k!==d&&k!==e?!!(Ug(this.db,a,this.Pb)&(a.Ka()===b?f:g)):!0}return a instanceof olympe.dc.query.oa.Kd?this.Pb===a.Pb:!1}nb(a){const b=this.T();for(const c of Sh(a,this.j))for(const d of Qf(this.db,c,this.Pb))Uh(a,d,b,c)}observe(a,b){const c=this.T(),d=(e,f,g,h)=>{const k=`${h}:${g}`;f?Vg(this.db,g,this.Pb,(l,n,p,q,r)=>{p&&(p=q?Uh(a,r,c,g):a.remove(r,c,g),null!==n&&Vh(a,q,l,n,g,r),p&&d(e,q,r,h))},k):
|
|
749
|
+
Wg(this.db,g,this.Pb,k);b(f,g,e,k)};return(e,f,g,h)=>{(e?Uh(a,f,c,f):a.remove(f,c,f))&&d(f,e,f,olympe.V.tb(h+f+this.toString()))}}ga(){return Object.assign(super.ga(),{f:this.Pb})}H(){return`followRulePart-${this.Pb}-${super.H()}`}Vc(){throw Error('Try to parse a part of an implicit query. Data connectors do not support those queries.');}toString(){return`FollowRule Part: ${this.db.name(this.Pb)} (${this.Pb})`}Ea(a){return a instanceof olympe.dc.query.oa.Kd&&this.Pb===a.Pb}toJSON(){return{type:'follow rule',
|
|
750
|
+
rule:`${this.db.name(this.Pb)} (${this.Pb})`}}R(){return!1}filter(){olympe.ja.ab('dc.query').warn('Should never try to filter on queries with follow rules, ignore...');return this}sort(){olympe.ja.ab('dc.query').warn('Should never try to sort queries with follow rules, ignore...');return this}};olympe.dc.query.oa.Kd.D='followRules';olympe.dc.query.oa.wh=class extends olympe.dc.query.oa.Kh{constructor(a,b,c){super(a,olympe.dc.query.Relation.from(b,!1),c)}N(){const a=new olympe.dc.query.oa.wh(this.j,this.relation,this.optional);a.D=this.D;a.Hb=this.Hb;return a}Y(){return olympe.V.tb(this.j+this.relation.T())}$(a,b){if(b instanceof olympe.dc.query.oa.Kd)return[a];const c=[a+this.relation.T(),a+Ei(this.relation).T()+!1,a+Ei(this.relation).T()+!0,a+'followRules'].map(d=>olympe.V.tb(d));b instanceof olympe.dc.query.oa.we&&b.relation.Ea(this.relation)&&
|
|
751
|
+
c.push(a);return c}nb(a){const b=this.T();for(const c of Sh(a,this.j))this.db.bb(c,this.relation).forEach(d=>{Uh(a,d,b,c)});super.nb(a)}observe(a,b){const c=super.observe(a,b),d=this.relation.X(),e=this.relation.Ka(),f=this.toString();return(g,h,k,l)=>{const n=olympe.V.tb(l+h+f);g?T(this.db,h,this.relation,(p,q)=>{Vh(a,p,d,e,h,q);c(p,q,h,n)},n):this.db.D(h,this.relation,n)}}ga(){return Object.assign(super.ga(),{t:this.relation.X(),d:this.relation.Ka()})}H(){return`followPart-${this.relation.T()}-${super.H()}`}Vc(){const a=
|
|
752
|
+
{recursive:!1,relation:this.relation,filter:Gi(this).map(b=>b.map(c=>c.Vc())),optional:this.R()};this.Hb&&(a.sort={property:this.Hb.Qa(),order:this.Hb.Ji});return a}toString(){return`Follow Part: ${this.relation}`}toJSON(){return{type:'follow',relation:`${this.db.name(this.relation)} (${this.relation.X()})`,direction:this.relation.Ka()}}Ea(a){return a instanceof olympe.dc.query.oa.wh&&this.relation.Ea(a.relation)}};olympe.dc.query.oa.we=class extends olympe.dc.query.oa.Kh{constructor(a,b,c,d){super(a,olympe.dc.query.Relation.from(b,!0),d);this.F=c}ha(){return new olympe.dc.query.oa.Uq}N(){const a=new olympe.dc.query.oa.we(this.j,this.relation,this.F,this.optional);a.D=this.D;a.Hb=this.Hb;return a}Y(){return olympe.V.tb(this.j+this.relation.T()+this.F)}$(a,b){if(b instanceof olympe.dc.query.oa.Kd)return[a];const c=[a+this.relation.T()+this.F,a+'followRules'].map(d=>olympe.V.tb(d));b instanceof olympe.dc.query.oa.we&&
|
|
753
|
+
b.relation.Ea(this.relation)&&c.push(a);return c}nb(a){const b=this.T();for(const c of Sh(a,this.j))this.F&&Uh(a,c,b,c),this.db.eh(c,this.relation).forEach(d=>{Uh(a,d,b,c)});super.nb(a)}observe(a,b){const c=this.relation.X(),d=this.relation.Ka(),e=(f,g,h,k)=>{const l=olympe.V.tb(k+g);f?T(this.db,g,this.relation,(n,p)=>{Vh(a,n,c,d,g,p);super.observe(a,(q,r,t,u)=>{b(q,r,t,u);e(q,r,t,k)})(n,p,h,l)},l):this.db.D(g,this.relation,l)};return(f,g,h,k)=>{h=k+this.toString();this.F&&super.observe(a,b)(f,g,
|
|
754
|
+
g,olympe.V.tb(h+g));e(f,g,g,h)}}ga(){return Object.assign(super.ga(),{s:this.F,t:this.relation.X(),d:this.relation.Ka()})}H(){return`followRecursivelyPart-${this.relation.T()}-${this.F}-${super.H()}`}Vc(){const a={recursive:this.F?'INCLUDE_SELF':'EXCLUDE_SELF',relation:this.relation,filter:Gi(this).map(b=>b.map(c=>c.Vc())),optional:this.R()};this.Hb&&(a.sort={property:this.Hb.Qa(),order:this.Hb.Ji});return a}toString(){return`FollowRecursively Part: ${this.relation}`}toJSON(){return{type:'follow recursively',
|
|
755
|
+
relation:`${this.db.name(this.relation)} (${this.relation.X()})`,direction:this.relation.Ka()}}Ea(a){return a instanceof olympe.dc.query.oa.we&&this.relation.Ea(a.relation)&&this.F===a.F}};olympe.dc.query.oa.$o=class extends olympe.dc.query.oa.Kd{observe(a,b){const c=this.T();return(d,e,f,g)=>{d?Uh(a,e,c,e):a.remove(e,c,e);b(d,e,e,g)}}};olympe.dc.query.oa.Hp=class{constructor(a,b){this.db=a;this.origin=null;this.content=new Map;this.F=null!=b?b:null}Rc(){return this.content.keys()}j(a){return this.content.has(a)&&null!==this.origin?[this.origin].values():[].values()}has(a){return this.content.has(a)}H(a){let b;return(null==(b=this.F)?void 0:b.call(this,a))||!1}D(a,b){null===this.origin&&(this.origin=b);const c=this.content.get(a);if(!c)return this.content.set(a,(new Map).set(b,1)),!0;let d;a=null!=(d=c.get(b))?d:0;c.set(b,a+1);return!1}remove(a,
|
|
756
756
|
b){a===this.origin&&(this.origin=null);if(null===this.origin||!this.db.Ha(a)||!b)return this.content.delete(a);var c=this.content.get(a);if(!c)return!1;const d=c.get(b);if(1<d)return c.set(b,d-1),!0;b=c.delete(b);if(0===c.size)return this.content.delete(a);if(b){c=new Set(c.keys());for(const e of c){if(this.origin===e)return!0;let f,g;for(const h of null!=(g=null==(f=this.content.get(e))?void 0:f.keys())?g:[])c.add(h)}return this.content.delete(a)}return!1}};olympe.dc.query.oa.Hp.xa=[olympe.dc.query.oa.um];olympe.dc.query.oa.Uq=class{constructor(){this.content=new Map}Rc(){return this.content.keys()}j(a){let b,c;return null!=(c=null==(b=this.content.get(a))?void 0:b.keys())?c:[]}has(a){return this.content.has(a)}H(){return!1}D(a,b){let c=this.content.get(a);c||(c=new Map,this.content.set(a,c));let d;a=null!=(d=c.get(b))?d:0;c.set(b,a+1);return 0===a}remove(a,b){if(null===b)return this.content.delete(a);const c=this.content.get(a),d=null==c?void 0:c.get(b);if(1<d)return c.set(b,d-1),!1;let e;b=null!=
|
|
757
757
|
(e=null==c?void 0:c.delete(b))?e:!1;0===(null==c?void 0:c.size)&&this.content.delete(a);return b}};olympe.dc.query.oa.Uq.xa=[olympe.dc.query.oa.um];olympe.dc.query.oa.Am=class{constructor(){this.content=new Map}Rc(){return this.content.keys()}j(a){let b,c;return null!=(c=null==(b=this.content.get(a))?void 0:b.values())?c:[]}has(a){return this.content.has(a)}H(){return!1}D(a,b){let c=this.content.get(a);c||(c=new Set,this.content.set(a,c));a=c.size;c.add(b);return a<c.size}remove(a,b){if(null===b)return this.content.delete(a);const c=this.content.get(a);let d;b=null!=(d=null==c?void 0:c.delete(b))?d:!1;0===(null==c?void 0:c.size)&&this.content.delete(a);
|
|
758
|
-
return b}};olympe.dc.query.oa.Am.xa=[olympe.dc.query.oa.um];olympe.dc.sources={};olympe.dc.sources.Yq=class extends Error{};olympe.dc.sources.Tj=class{T(){}init(){}destroy(){}request(){return w(function*(){})}subscribe(){}};const
|
|
759
|
-
function
|
|
760
|
-
k[
|
|
761
|
-
(X.content=p);break;default:throw Error(`Data Http request type not supported ${n}`);}let xa;const ab=null!=(xa=k['X-Source-Origin'])?xa:olympe.dc.Ja.Bf;var q=vf(new olympe.dc.Request(n,f,X,l),ab);const Pa=yield g(q);let Zc;void 0===Pa?Zc='':Pa instanceof Blob||Pa instanceof Uint8Array||Pa instanceof ArrayBuffer||'function'===typeof(null==Pa?void 0:Pa.pipe)?Zc=Pa:Zc=JSON.stringify(a.D.ga(Pa));return new olympe.net.ld(Zc,h===
|
|
762
|
-
|
|
763
|
-
function
|
|
764
|
-
function
|
|
765
|
-
function
|
|
766
|
-
function
|
|
758
|
+
return b}};olympe.dc.query.oa.Am.xa=[olympe.dc.query.oa.um];olympe.dc.sources={};olympe.dc.sources.Yq=class extends Error{};olympe.dc.sources.Tj=class{T(){}init(){}destroy(){}request(){return w(function*(){})}subscribe(){}};const Ki=olympe.net.wa.Nd.GET,Li=olympe.net.wa.Nd.Gh,Mi=olympe.net.wa.Nd.Dc,Ni=olympe.net.wa.Nd.zq,Oi=olympe.net.wa.Headers.wi,Pi=olympe.net.wa.Headers.Vn,Qi=olympe.net.wa.Vb.Eh,Ri=olympe.net.wa.Vb.no,Si=olympe.net.wa.Vb.Yo,Ti=olympe.net.wa.Vb.Vi,Ui=olympe.net.wa.Vb.gm;
|
|
759
|
+
function Vi(a){const b=`/${olympe.W.getParameter(olympe.dc.sources.U.Pl)}/:${'sourceId'}/:${'requestType'}`.replace(/\/+/g,'/').replace(/\/$/,'');a.R.F('_DataSourcesHTTPService',b,[Ki,Li,Mi,Ni],(c,d,e)=>w(function*(){const f=d.get('sourceId');var g=a.F.get(d.get('sourceId'));if(!g){var h;g=null!=(h=olympe.dc.ia().name(f))?h:'name unknown';return Promise.resolve(new olympe.net.ld(`No handler found for datasource ${f} called '${g}'`,Ui,'Invalid source id'))}h=c.method;const k=c.qj();try{var l=yield Wi(a,
|
|
760
|
+
k[Pi])}catch(r){return new olympe.net.ld(`Invalid token ${r}`,Si,'Access denied')}try{var n=Number(d.get('requestType')),p=c.body;const r=olympe.dc.Request.j.oc,t=olympe.dc.Request.j.Lg,u=olympe.dc.Request.j.Ze,x=olympe.dc.Request.j.Vg,y=olympe.dc.Request.j.oh,z=olympe.dc.Request.j.Yf,A=olympe.dc.Request.j.$f,K=olympe.dc.Request.j.hg;let X;switch(n){case r:break;case t:case u:case y:case x:X=a.D.N(p);break;case K:case z:case A:X={tag:e.get('tag'),model:e.get('model'),mimeType:k[Oi]};p instanceof Uint8Array&&
|
|
761
|
+
(X.content=p);break;default:throw Error(`Data Http request type not supported ${n}`);}let xa;const ab=null!=(xa=k['X-Source-Origin'])?xa:olympe.dc.Ja.Bf;var q=vf(new olympe.dc.Request(n,f,X,l),ab);const Pa=yield g(q);let Zc;void 0===Pa?Zc='':Pa instanceof Blob||Pa instanceof Uint8Array||Pa instanceof ArrayBuffer||'function'===typeof(null==Pa?void 0:Pa.pipe)?Zc=Pa:Zc=JSON.stringify(a.D.ga(Pa));return new olympe.net.ld(Zc,h===Ni?Ri:Qi)}catch(r){return r instanceof olympe.dc.sources.Yq?new olympe.net.ld(`Authorization error: ${r}`,
|
|
762
|
+
Si,'Forbidden'):new olympe.net.ld(`Internal server error: ${r}`,Ti,'Internal server error')}})).catch(c=>a.G.error(`Error while starting the HTTP Service: ${c}`));a.G.debug(`Started HTTP service with path: ${b}`)}function Xi(a){a.R.Y('_DataSourcesHTTPService').catch(b=>{a.G.error(`An error occurred while stopping the data sources http service: ${b}`)})}function Yi(a,b,c){0===a.F.size&&Vi(a);a.F.set(b,c);return()=>{a.F.delete(b);0===a.F.size&&Xi(a)}}
|
|
763
|
+
function Zi(a,b,c){c=b instanceof olympe.dm.DataSource?b.Lf(c):$i(b,c);null===c&&a.G.error(`Impossible to build URL for data source ${b}`);return c}
|
|
764
|
+
function aj(a,b,c){if(b===olympe.dc.Ja.SERVER){var d;return null!=(d=Ld(a.H,a.da.get(c)))?d:null}var e=a.N.get(b);if(!e){d=a.$.sb(b);e=olympe.dc.sources.U.xh;const f=olympe.dc.sources.U.wf,g=olympe.dc.sources.U.Di,h=olympe.dc.sources.U.Pl;let k;e=`${Zi(a,null!=d?d:b,g)?'https':'http'}://${Zi(a,null!=d?d:b,e)}:${null!=(k=Zi(a,null!=d?d:b,f))?k:Zi(a,null!=d?d:b,g)?443:80}`+`/${Zi(a,null!=d?d:b,h)}/${b}`.replace(/\/+/g,'/').replace(/\/$/,'');a.N.set(b,e)}return`${e}/${c}`}
|
|
765
|
+
function bj(a,b){return b instanceof olympe.net.Fi?Nd(a.H,b,rd(a.Y).Cd()):Promise.reject('No http request to send')}function cj(a,b){var c=aj(a,b.ic(),b.getType());if(!c)return Promise.reject(`No destination URL to send the query to destination: ${b.ic()}`);const d=b.content,e=JSON.stringify(a.D.ga(d));c=N(c,Li,e,olympe.net.wa.ResponseType.JSON);Ac(c,{['X-Source-Origin']:b.origin,[Oi]:'application/json'});return bj(a,c).then(f=>(f=f.getData())?a.D.N(f):olympe.dc.query.zd.mj(d))}
|
|
766
|
+
function dj(a,b){var c=aj(a,b.ic(),b.getType());if(!c)return Promise.reject(`No destination URL to send the transaction to destination: ${b.ic()}`);const d=JSON.stringify(a.D.ga(b.content));c=N(c,Li,d);Ac(c,{['X-Source-Origin']:b.origin,[Oi]:'application/json'});return bj(a,c).then(e=>Number.parseInt(e.getData(),10))}function Wi(a,b){return'string'!==typeof b?Promise.reject('Please provide an authorization token.'):new Promise((c,d)=>{a.Y.hh(b,(e,f)=>{e?d(e):c(f)})})}
|
|
767
767
|
olympe.dc.sources.Wt=class{constructor(a,b,c,d,e,f){this.G=a;this.R=b;this.H=c;this.Y=d;this.$=e;this.D=f;this.F=new Map;new olympe.C.Xb('Http service of remote data provider');this.N=new Map;this.j=new Map;this.da=new Map([[olympe.dc.Request.j.Cg,olympe.L.Yb.Cg],[olympe.dc.Request.j.$f,olympe.L.Yb.Wj],[olympe.dc.Request.j.hg,olympe.L.Yb.Wj],[olympe.dc.Request.j.Yf,olympe.L.Yb.Wj],[olympe.dc.Request.j.Xn,olympe.L.Yb.Wn],[olympe.dc.Request.j.Oq,olympe.L.Yb.Nq],[olympe.dc.Request.j.mp,olympe.L.Yb.lp],
|
|
768
|
-
[olympe.dc.Request.j.Lg,olympe.L.Yb.ho],[olympe.dc.Request.j.Vg,olympe.L.Yb.TRANSACTION]])}Hc(a){var b
|
|
769
|
-
const g=N(e===olympe.dc.Ja.SERVER?`${f}/${b}`:`${f}?tag=${b}&model=${c}`,
|
|
770
|
-
{['X-Source-Origin']:a.origin});return
|
|
771
|
-
Ac(e,{['X-Source-Origin']:a.origin});
|
|
772
|
-
function
|
|
773
|
-
function
|
|
774
|
-
olympe.dc.sources.Tp=class{constructor(a,b){this.G=a;this.j=b;this.Tb=null;this.N=olympe.dc.query.Uk();this.H=olympe.dc.gs();this.F=new olympe.C.Xb('Context of source '+this.T());let c;this.R=null!=(c=b.Lf(olympe.dc.sources.U.qm))?c:-1;this.D=null}T(){return this.j.T()}init(a){this.Tb=a;if(this.T()===olympe.dc.Ja.SELF)return this;(new Promise((b,c)=>{let d=!0;
|
|
775
|
-
for(const [f,g]of e)this.G.debug(`=> DataType: ${g.name()} (${f})`)}d&&(d=!1,b())},c))})).then(()=>this.j.init(this.F)).catch(b=>{this.G.error(`Error while initialization of DataSource ${this.j.name()} (${this.T()}): ${b}`)});return this}healthCheck(){return this.j.healthCheck().then(()=>`Data source ${this.j.name()} (${this.j.T()}) OK`)}destroy(){this.F.destroy();return this.j.destroy()}request(a){const b=a.content;var c=a.getType();switch(c){case
|
|
776
|
-
return this.j.healthCheck().then(()=>({s:e})).catch(g=>({s:d,r:String(g)}));case
|
|
777
|
-
b.jc());case
|
|
778
|
-
b,this.F,a,olympe.dc.ma.nc.rf,{}).pipe(rxjs.operators.map(c=>{let d,e;return null!=(e=null==(d=c.Me)?void 0:d.F)?e:null}),rxjs.operators.filter(c=>null!==c),rxjs.operators.map(c=>rf(c,Date.now())))}return rxjs.throwError(()=>Error('Subscription request not supported'))}applyTransaction(a,b){const c=this;return w(function*(){var d=
|
|
779
|
-
function
|
|
780
|
-
class
|
|
768
|
+
[olympe.dc.Request.j.Lg,olympe.L.Yb.ho],[olympe.dc.Request.j.Vg,olympe.L.Yb.TRANSACTION]])}Hc(a){var b=aj(this,a.ic(),a.getType());if(!b)return Promise.reject(`No destination URL to send the status request to destination: ${a.ic()}`);b=Cc(N(b,Ki),olympe.net.wa.ResponseType.JSON);Ac(b,{['X-Source-Origin']:a.origin});return bj(this,b).then(c=>c.getData())}uploadFileContent(a){const {tag:b,model:c,content:d}=a.content,e=a.ic(),f=aj(this,e,a.getType());if(!f)return Promise.reject(`No destination URL to upload the file. ${b}`);
|
|
769
|
+
const g=N(e===olympe.dc.Ja.SERVER?`${f}/${b}`:`${f}?tag=${b}&model=${c}`,Ni,d);Ac(g,{[Oi]:'application/octet-stream'});e!==olympe.dc.Ja.SERVER&&Ac(g,{['X-Source-Origin']:a.origin});return bj(this,g).then(()=>(new URL(g.j())).pathname)}deleteFileContent(a){const {tag:b,model:c}=a.content,d=a.ic();var e=aj(this,d,a.getType());if(!e)return Promise.reject(`No destination URL to delete the file. ${b}`);e=N(d===olympe.dc.Ja.SERVER?`${e}/${b}`:`${e}?tag=${b}&model=${c}`,Mi,b);d!==olympe.dc.Ja.SERVER&&Ac(e,
|
|
770
|
+
{['X-Source-Origin']:a.origin});return bj(this,e).then(()=>{})}downloadFileContent(a){const {tag:b,model:c}=a.content,d=a.ic();var e=aj(this,d,a.getType());if(!e)return Promise.reject(Error(`No destination URL to download the file. ${b}`));var f;const g=null!=(f=this.j.get(b))?f:[];f=new Promise((h,k)=>{g.push({done:h,bi:k})});if(this.j.has(b))return f;this.j.set(b,g);e=N(d===olympe.dc.Ja.SERVER?`${e}/${b}`:`${e}?tag=${b}&model=${c}`,Ki,void 0,olympe.net.wa.ResponseType.Oh);d!==olympe.dc.Ja.SERVER&&
|
|
771
|
+
Ac(e,{['X-Source-Origin']:a.origin});bj(this,e).then(h=>{let k;null==(k=this.j.get(b))||k.forEach(l=>l.done(h.getData()))}).catch(h=>{let k;null==(k=this.j.get(b))||k.forEach(l=>l.bi(`${h}`))}).finally(()=>{this.j.delete(b)});return f}};olympe.dc.sources.Fp=class{constructor(a,b){this.G=a;this.Tb=b}};olympe.dc.sources.Fp.Vb={Xi:0,mC:1,nC:3,JB:4};const ej=olympe.dc.Request.j.oc,fj=olympe.dc.Request.j.Lg,gj=olympe.dc.Request.j.pk,hj=olympe.dc.Request.j.hg,ij=olympe.dc.Request.j.$f,jj=olympe.dc.Request.j.Yf,kj=olympe.dc.Request.j.si,lj=olympe.dc.Request.j.oh,mj=olympe.dc.Request.j.Ze,nj=olympe.dc.Request.j.Vg;
|
|
772
|
+
function oj(a,b){const c=b.T();null===a.D&&(a.D=new olympe.V.Nh(6E4),hb(a.D,(f,g)=>{a.applyTransaction(g,!1).catch(h=>{a.G.error(`Error occurred when applying burst transaction ${f} to the data source: ${h}`)})}),ib(a.D,()=>{a.D=null}));let d;const e=null!=(d=a.D.get(c))?d:new olympe.dc.db.ec(c);b.qc(e);fb(a.D.j,c)||a.D.set(c,e)}
|
|
773
|
+
function pj(a,b){const c=b.T();let d,e;const f=null!=(e=null==(d=a.D)?void 0:d.get(c))?e:new olympe.dc.db.ec(c);let g;null==(g=a.D)||g.delete(c);b.qc(f);return a.applyTransaction(f,!1).catch(h=>{a.G.error(`Error occurred when applying burst transaction ${c} to the data source: ${h}`)})}function qj(a,b){const c=rxjs.defer(()=>a.j.executeQuery(b));return 0<a.R?rxjs.interval(a.R).pipe(rxjs.operators.switchMap(()=>c)):c}
|
|
774
|
+
olympe.dc.sources.Tp=class{constructor(a,b){this.G=a;this.j=b;this.Tb=null;this.N=olympe.dc.query.Uk();this.H=olympe.dc.gs();this.F=new olympe.C.Xb('Context of source '+this.T());let c;this.R=null!=(c=b.Lf(olympe.dc.sources.U.qm))?c:-1;this.D=null}T(){return this.j.T()}init(a){this.Tb=a;if(this.T()===olympe.dc.Ja.SELF)return this;(new Promise((b,c)=>{let d=!0;rj(this.j,this.F).subscribe(rxjs.Subscriber.create(e=>{if(this.G.j()){this.G.debug(`Data source ${this.j.name()} has loaded ${e.size()} data types in its cache:`);
|
|
775
|
+
for(const [f,g]of e)this.G.debug(`=> DataType: ${g.name()} (${f})`)}d&&(d=!1,b())},c))})).then(()=>this.j.init(this.F)).catch(b=>{this.G.error(`Error while initialization of DataSource ${this.j.name()} (${this.T()}): ${b}`)});return this}healthCheck(){return this.j.healthCheck().then(()=>`Data source ${this.j.name()} (${this.j.T()}) OK`)}destroy(){this.F.destroy();return this.j.destroy()}request(a){const b=a.content;var c=a.getType();switch(c){case ej:const d=olympe.dm.DataSource.oc.Ab,e=olympe.dm.DataSource.oc.Jh;
|
|
776
|
+
return this.j.healthCheck().then(()=>({s:e})).catch(g=>({s:d,r:String(g)}));case fj:return this.j.executeQuery(b);case kj:return c=b.jc(),oj(this,c),this.H.Tc(rf(c)),Promise.resolve();case mj:case nj:const f=b.jc();return this.applyTransaction(f,c===nj).finally(()=>{if(a.origin===olympe.dc.Ja.SELF){var g=f.T();g=vf(new olympe.dc.Request(olympe.dc.Request.j.Xj,olympe.dc.Ja.SELF,{id:g,finalize:olympe.dc.transaction.Ff.j.Ni,error:null}),this.T());let h;null==(h=this.Tb)||h.vd(g)}});case lj:return pj(this,
|
|
777
|
+
b.jc());case hj:return b.content instanceof Uint8Array?this.j.uploadFileContent(b.tag,b.model,b.content).then(()=>`datasource://${b.tag}`):Promise.reject('File content is undefined');case ij:return this.j.downloadFileContent(b.tag,b.model);case jj:return this.j.deleteFileContent(b.tag,b.model);default:return Promise.reject(`Request of type ${a.getType()} is not supported by the data source`)}}subscribe(a){if(a.getType()===gj){const b=a.content;a=a.origin;return a===olympe.dc.Ja.SELF?qj(this,b):gi(this.N,
|
|
778
|
+
b,this.F,a,olympe.dc.ma.nc.rf,{}).pipe(rxjs.operators.map(c=>{let d,e;return null!=(e=null==(d=c.Me)?void 0:d.F)?e:null}),rxjs.operators.filter(c=>null!==c),rxjs.operators.map(c=>rf(c,Date.now())))}return rxjs.throwError(()=>Error('Subscription request not supported'))}applyTransaction(a,b){const c=this;return w(function*(){var d=sj(a);yield c.j.applyTransaction(d,{batch:b});d=Date.now();yield qi(c.N,c.T(),a);c.H.Tc(rf(a,d));return d})}};olympe.dc.sources.Tp.xa=[olympe.dc.sources.Tj];function sj(a){const b=olympe.dc.sources.gg.j.ut,c=olympe.dc.sources.gg.j.qw,d=olympe.dc.sources.gg.j.At,e=olympe.dc.sources.gg.j.vt,f=olympe.dc.sources.gg.j.Bt,g=[],h=[],k=[],l=[],n=[];a.Bb.forEach((p,q)=>{const r=p.Wb();p.D()?g.push(tj(b,q,r,p.R()?p.Db():null)):p.td()?k.push(tj(d,q,r,null,p.H())):p.R()&&h.push(tj(c,q,r,p.Db()));for(const [t,u,x]of p.Ed())p=a.Qc(u),x?l.push(new uj(e,t,q,u,r,p.Wb())):n.push(new uj(f,t,q,u,r,p.Wb()))});return n.concat(k,g,h,l)}
|
|
779
|
+
function tj(a,b,c,d,e){if('string'!==typeof c)throw Error(`Patch: model of instance ${b} is missing. It is invalid transaction.`);return new vj(a,b,c,d,e)}olympe.dc.sources.gg=class{constructor(a){this.type=a}};class vj extends olympe.dc.sources.gg{constructor(a,b,c,d,e){super(a);this.object=b;this.model=c;this.properties=null!=d?d:null;this.deleteRules=null!=e?e:olympe.dc.Lb.NONE}}
|
|
780
|
+
class uj extends olympe.dc.sources.gg{constructor(a,b,c,d,e,f){super(a);this.relation=b;this.from=c;this.to=d;this.fromModel=e;this.toModel=f}}olympe.dc.sources.gg.j={ut:'CREATE',qw:'UPDATE',At:'DELETE',vt:'CREATE_RELATION',Bt:'DELETE_RELATION'};function wj(a,b){b=vf(new olympe.dc.Request(olympe.dc.Request.j.Xj,olympe.dc.Ja.SELF,{id:b,finalize:olympe.dc.transaction.Ff.j.Ni,error:null}),a.T());let c;null==(c=a.Tb)||c.vd(b)}
|
|
781
781
|
olympe.dc.sources.yl=class{constructor(a,b){this.G=a;this.D=b;this.Tb=null}T(){}R(){}Y(){}init(a){this.Tb=a;return this}destroy(){return Promise.resolve()}request(a){const b=this;return w(function*(){if(!b.D.D)return b.R(a);var c=olympe.dc.Request.j.oc,d=olympe.dc.Request.j.Lg;const e=olympe.dc.Request.j.Ze,f=olympe.dc.Request.j.Vg;var g=olympe.dc.Request.j.si;const h=olympe.dc.Request.j.oh,k=olympe.dc.Request.j.hg;var l=olympe.dc.Request.j.$f;const n=olympe.dc.Request.j.Yf,p=olympe.dc.sources.Zd(),
|
|
782
|
-
q=a.getType(),r=a.ic();if(id(b.D)){q===d&&(c=a.content,(g=xf(a).get(olympe.dc.ma.j.ul))&&(yield
|
|
783
|
-
x.jc();yield
|
|
784
|
-
case d:return p.executeQuery(a.content);case e:case f:case h:d=a.content;const t=d.jc().T();return p.applyTransaction(d,r).finally(()=>
|
|
785
|
-
b);const c=olympe.dc.sources.Zd(),d=a.content,e=a.ic();return rxjs.of(null).pipe(rxjs.operators.switchMap(()=>{if(id(this.D)){const f=new rxjs.Observable(h=>{olympe.C.Is([this.D.Sf()],()=>{h.error(new olympe.L.errors.pp('Go Offline',d.T()))})}),g=this.Y(a,b);return rxjs.merge(f,g)}return new rxjs.Observable(f=>{olympe.C.Is([this.D.Sf()],()=>{f.error(new olympe.L.errors.eo('Back Online',d.T()))})})})).pipe(rxjs.operators.switchMap(f=>rxjs.from(
|
|
786
|
-
throw g;}))))}};olympe.dc.sources.yl.xa=[olympe.dc.sources.Tj];const
|
|
787
|
-
function
|
|
788
|
-
function
|
|
789
|
-
g=yield d.tn(f);a.$.set(g,f);g=a.N.get(f);g||(g=new
|
|
790
|
-
olympe.dc.sources.Xq=class extends olympe.dc.sources.yl{constructor(a,b,c,d,e,f){super(a,d);this.H=b;this.j=c;this.db=e;this.F=new olympe.C.Xb('Remote Provider Context');this.da=new Map;this.N=new Map;this.$=new Map;this.ha=f}T(){return olympe.dc.Ja.Bf}R(a){var b=olympe.L.ub;const c=a.ic(),d=a.getType();this.G.j()&&this.G.debug(`Request (type: ${d}) will be sent to remote data provider ${c}: ${a.content}`);switch(d){case
|
|
791
|
-
c)?b.get(c,a):Promise.resolve({s:f});a=
|
|
792
|
-
a):b.get(c,a)).finally(()=>
|
|
793
|
-
b){const c=a.ic(),d=a.getType();if(!
|
|
782
|
+
q=a.getType(),r=a.ic();if(id(b.D)){q===d&&(c=a.content,(g=xf(a).get(olympe.dc.ma.j.ul))&&(yield xj(p,c.T(),g)),b.G.debug(`Data Provider: Query ${c.T()} will be executed with its default Remote or Server provider`));if(q===l&&(l=a.content,'string'===typeof(null==l?void 0:l.url)&&l.url.startsWith('offline://')))return p.downloadFileContent(l.tag);l=yield b.R(a);if(q===d){const t=a.content;d=l;const u=new olympe.dc.db.ec(`fullResult_${t.T()}`);l=d.pipeThrough(new TransformStream({transform:(x,y)=>w(function*(){const z=
|
|
783
|
+
x.jc();yield yj(p,z);z.qc(u);b.G.j()&&b.G.debug(`Data Provider: Data result for query ${t.T()}`,z.Bb.size,'instances',Array.from(z.Ed()).length,'relations');y.enqueue(x)}),flush:()=>w(function*(){yield zj(p,t.T(),r,u,!0)})}))}else if(q===e||q===f||q===h)b.G.debug('Data Provider: Persisting graph patch in offline cache after successful transaction'),yield Aj(p,null,r,a.content.jc(),!1);return l}b.G.debug(`Data Provider: Request (type: ${q}) will be sent to the cache data provider: ${a.content}`);switch(q){case c:return{s:olympe.dm.DataSource.oc.Ae};
|
|
784
|
+
case d:return p.executeQuery(a.content);case e:case f:case h:d=a.content;const t=d.jc().T();return p.applyTransaction(d,r).finally(()=>wj(b,t));case g:return Promise.resolve();case k:return d=a.content,p.uploadFileContent(d.tag,d.content,d.mimeType);case l:return p.downloadFileContent(a.content.tag);case n:return p.deleteFileContent(a.content.tag);default:return Promise.reject(`Messages of type ${a.getType()} is not supported by the source ${b.T()}`)}})}subscribe(a,b){if(!this.D.D)return this.Y(a,
|
|
785
|
+
b);const c=olympe.dc.sources.Zd(),d=a.content,e=a.ic();return rxjs.of(null).pipe(rxjs.operators.switchMap(()=>{if(id(this.D)){const f=new rxjs.Observable(h=>{olympe.C.Is([this.D.Sf()],()=>{h.error(new olympe.L.errors.pp('Go Offline',d.T()))})}),g=this.Y(a,b);return rxjs.merge(f,g)}return new rxjs.Observable(f=>{olympe.C.Is([this.D.Sf()],()=>{f.error(new olympe.L.errors.eo('Back Online',d.T()))})})})).pipe(rxjs.operators.switchMap(f=>rxjs.from(Aj(c,d.T(),e,f.jc()).then(()=>f).catch(g=>{this.G.error(`Data Provider: Cache database failed to handle the data result with message: ${g}`);
|
|
786
|
+
throw g;}))))}};olympe.dc.sources.yl.xa=[olympe.dc.sources.Tj];const Bj=olympe.dc.Request.j.oc,Cj=olympe.dc.Request.j.Lg,Dj=olympe.dc.Request.j.pk,Ej=olympe.dc.Request.j.Ze,Fj=olympe.dc.Request.j.Vg,Gj=olympe.dc.Request.j.si,Hj=olympe.dc.Request.j.oh,Ij=olympe.dc.Request.j.hg,Jj=olympe.dc.Request.j.$f,Kj=olympe.dc.Request.j.Yf;function Lj(a,b){let c;return(null==(c=a.ha.sb(b))?void 0:c.Lf(olympe.dc.sources.U.Qe))!==olympe.dm.DataSource.Qe.sp}function Mj(a,b){let c;return(null==(c=a.ha.sb(b))?void 0:c.Lf(olympe.dc.sources.U.Qe))!==olympe.dm.DataSource.Qe.$n}
|
|
787
|
+
function Nj(a,b){b=b.Cc();if(b!==olympe.dm.User.j&&a.Lf(olympe.dc.sources.U.xm))throw a=`User ${b} has no right to access the restricted data source ${a.name()} (${a.T()}). Please use an admin account instead.`,new olympe.dc.sources.Yq(a);}
|
|
788
|
+
function Oj(a,b,c,d,e){return w(function*(){var f=olympe.L.cb.j.SEND,g=olympe.L.cb.j.GET;const h=olympe.L.cb.j.PUBLISH,k=olympe.L.cb.j.SUBSCRIBE,l=d.Js();var n=d.body();if(e!==n.Cc())throw Error('Access denied: try to impersonate a user');Nj(c,n);let p;if(null==(p=a.Tb)||!p.sources.has(n.ic()))throw Error(`Try to process a message with destination data source ${n.ic()} coming from remote but not started here`);if(l===k){if(n.getType()===Dj)f=n.content.T();else throw Error('Not supported type of subscription');
|
|
789
|
+
g=yield d.tn(f);a.$.set(g,f);g=a.N.get(f);g||(g=new Pj(a.G,f,b,vf(n,olympe.dc.Ja.Bf)),a.N.set(f,g));g.subscribe()}else l===g?(n=yield b.request(n),void 0!==n?yield d.vd(n):a.G.warn(`Request from ${d.source()} requires an output value, but got undefined instead.`)):l===f?(yield b.request(n),yield d.Pr()):l===h&&(yield b.request(n))})}
|
|
790
|
+
olympe.dc.sources.Xq=class extends olympe.dc.sources.yl{constructor(a,b,c,d,e,f){super(a,d);this.H=b;this.j=c;this.db=e;this.F=new olympe.C.Xb('Remote Provider Context');this.da=new Map;this.N=new Map;this.$=new Map;this.ha=f}T(){return olympe.dc.Ja.Bf}R(a){var b=olympe.L.ub;const c=a.ic(),d=a.getType();this.G.j()&&this.G.debug(`Request (type: ${d}) will be sent to remote data provider ${c}: ${a.content}`);switch(d){case Bj:const e=olympe.dm.DataSource.oc.Ab,f=olympe.dm.DataSource.oc.Jh;b=Lj(this,
|
|
791
|
+
c)?b.get(c,a):Promise.resolve({s:f});a=Mj(this,c)?this.j.Hc(a):Promise.resolve({s:f});return Promise.all([b,a]).then(([k,l])=>{if((null==k?void 0:k.s)===e||(null==l?void 0:l.s)===e){let n,p;return{s:e,r:`${null!=(n=null==k?void 0:k.r)?n:''} ${null!=(p=null==l?void 0:l.r)?p:''}`}}return{s:f}});case Cj:return Mj(this,c)?cj(this.j,a):b.get(c,a);case Ej:const g=a.content.jc().T();return(Lj(this,c)?b.get(c,a):dj(this.j,a)).finally(()=>wj(this,g));case Fj:const h=a.content.jc().T();return(Mj(this,c)?dj(this.j,
|
|
792
|
+
a):b.get(c,a)).finally(()=>wj(this,h));case Gj:return Lj(this,c)?b.publish(c,a).catch(k=>{this.G.error(`An error occurred while sending "burst transaction" to the data source ${c}: ${k}`)}):Promise.resolve();case Hj:return Lj(this,c)?b.get(c,a):dj(this.j,a);case Ij:return Mj(this,c)?this.j.uploadFileContent(a):b.get(c,a);case Jj:return Mj(this,c)?this.j.downloadFileContent(a):b.get(c,a);case Kj:return Mj(this,c)?this.j.deleteFileContent(a):b.send(c,a);default:return Promise.reject(`Messages of type ${a.getType()} is not supported by the source ${this.T()}`)}}Y(a,
|
|
793
|
+
b){const c=a.ic(),d=a.getType();if(!Lj(this,c))return rxjs.throwError(()=>Error(`Subscription request not supported for data source ${this.db.name(c)} (${c}) which uses HTTP only.`));this.G.j()&&this.G.debug(`Subscription (type: ${d}) will be sent to remote data provider ${c}: ${a.content}`);return d===Dj?olympe.L.ub.observe(c,this.F,a,{onRetry:b}):rxjs.throwError(()=>Error(`Do not handle subscription request of type ${d}`))}init(a){super.init(a);if(a.F)return this;olympe.dc.ma.from(this.H,this.H).fb(olympe.dm.DataSource.zj).filter(olympe.dc.query.Aa.Ea(olympe.dm.DataSource.Vh,
|
|
794
794
|
!0)).filter(olympe.dc.query.Aa.Ea(olympe.dm.DataSource.$r,!0)).observe(this.F).subscribe(b=>{b.nj().forEach(this.Ga.bind(this,a));b.sj().forEach(c=>{let d;null==(d=this.da.get(c))||d.destroy();this.da.delete(c)})});this.db.Qa(this.H,olympe.dm.DataSource.$r)&&(new olympe.L.ub(this.H,this.F)).listen().subscribe(b=>{b=b.body();b instanceof olympe.dc.Request?a.vd(b):this.G.error('Self source received something else than a data request, ignore it.')});return this}destroy(){return w(function*(){})}Ga(a,
|
|
795
|
-
b){const c=b.X(),d=new olympe.C.Xb(`Published data provider context ${c}`,this.F);this.da.set(c,d);let e,f;
|
|
795
|
+
b){const c=b.X(),d=new olympe.C.Xb(`Published data provider context ${c}`,this.F);this.da.set(c,d);let e,f;Qj(b,d).subscribe(g=>{let h;null==(h=e)||h();let k;null==(k=f)||k.stop();g!==olympe.dm.DataSource.Qe.$n&&(e=Yi(this.j,c,l=>{Nj(b,l);return a.request(l)}),d.onDestroy(()=>{let l;return null==(l=e)?void 0:l()}));g!==olympe.dm.DataSource.Qe.sp&&(g=new olympe.C.Xb(`Bus Service of data source ${c}`,d),f=(new olympe.L.ub(c,g)).Qs(this.ua.bind(this)),f.listen().subscribe(l=>{l.mi().then(n=>Oj(this,
|
|
796
796
|
a,b,l,n)).catch(n=>{this.G.warn(`Error occurred while processing request from ${l.source()}: ${n}`);return l.bi(n instanceof Error?n:Error(n))})}))})}ua(a){const b=this.$.get(a);this.$.delete(a);if(a=b)null==(a=this.N.get(b))?a=0:(0<a.j&&--a.j,0===a.j?(a.G.debug(`Data subscription ${a.D} has more subscriber: unsubscribe`),a.F.unsubscribe(),a=!0):(a.G.debug(`Data subscription ${a.D} has ${a.j} subscribers`),a=!1));a&&this.N.delete(b)}};
|
|
797
|
-
class
|
|
798
|
-
olympe.dc.sources.cc=class extends olympe.L.cc{constructor(a){super();this.$=a;this.db=a.view;this.F=new Map}ga(a){a=super.ga(a);if(0<this.F.size){const b=Array.from(this.F.values());this.F.clear();return Object.assign(this.format(W.Jr,a),{i:b})}return a}N(a){return(null==a?void 0:a.t)===W.Jr&&Array.isArray(null==a?void 0:a.i)?(
|
|
797
|
+
class Pj{constructor(a,b,c,d){this.G=a;this.D=b;this.j=0;this.F=c.subscribe(d).subscribe({next:e=>{olympe.L.ub.publish(b,e).catch(f=>a.error(`Error occurred while publishing a data notification: ${f}`))},error:e=>a.error(`Error occurred while trying to subscribe to topic ${b} for a datasource: ${e}`)})}subscribe(){this.j++;this.G.debug(`Data subscription ${this.D} has ${this.j} subscribers`);return this}}olympe.dc.sources.Xq.xa=[olympe.dc.sources.Tj];const W={Jr:10,mo:11,Uo:12,Fq:13,QUERY_RESULT:14,np:15,Do:16,Ze:17,Gq:18,Co:19,Ui:20};function Rj(a,b){const c=new olympe.dc.transaction.Ce,d=new olympe.dc.transaction.Ce;b.forEach(e=>{const f=new Map(Array.from(Object.entries(e.p).map(([h,k])=>[h,a.j(k)]))),g=e.v?d:c;g.Oc(e.t,e.s,f,e.m);e.r.forEach(h=>g.Oa(h.r,h.o,h.d))});a.$.Tc(Af(Bf(d),olympe.dc.Ja.SELF),{persist:!1});a.$.Tc(Af(Bf(c),olympe.dc.Ja.SELF))}
|
|
798
|
+
olympe.dc.sources.cc=class extends olympe.L.cc{constructor(a){super();this.$=a;this.db=a.view;this.F=new Map}ga(a){a=super.ga(a);if(0<this.F.size){const b=Array.from(this.F.values());this.F.clear();return Object.assign(this.format(W.Jr,a),{i:b})}return a}N(a){return(null==a?void 0:a.t)===W.Jr&&Array.isArray(null==a?void 0:a.i)?(Rj(this,a.i),this.j(a.v)):this.j(a)}D(a){switch(!0){case a instanceof olympe.dm.File:var b=this.format,c=W.Uo;{const d=a.X(),e={t:d};if(!this.F.has(d)&&(this.H(d),!this.db.Le(d))){const f=
|
|
799
799
|
a.get(olympe.dm.File.urlProp);if(f.startsWith('blob:')||f.startsWith('stream:'))a=olympe.dc.ls().Ga(a),this.F.get(d).p[olympe.dm.File.urlProp.X()]='stream://'+d,e.s=this.D(a)}a=e}return b.call(this,c,a);case a instanceof olympe.dc.CloudObject:return this.format(W.mo,this.H(a.X()));case a instanceof olympe.dc.ma:return this.format(W.Fq,a.ga());case a instanceof olympe.dc.Ia:return this.format(W.QUERY_RESULT,a.ga(this.H.bind(this)));case a instanceof olympe.dc.db.ec:return b=new olympe.dc.transaction.Ce,
|
|
800
800
|
a.qc(b),this.format(W.np,{i:a.T(),p:Bf(b)});case a instanceof olympe.dc.Request:return this.format(W.Do,{r:a.getType(),o:a.origin,d:a.ic(),u:a.Cc(),c:this.D(a.content)});case a instanceof olympe.dc.transaction.aj:return this.format(W.Ze,{r:a.kh(),p:this.D(a.jc())});case a instanceof olympe.dc.query.zd:return this.format(W.Gq,a.ga());case a instanceof olympe.dc.Ag:return this.format(W.Co,a.ga());case a instanceof olympe.dc.uc:return this.format(W.Ui,this.H(a.X()));default:return super.D(a)}}j(a){if(null===
|
|
801
|
-
a||'object'!==typeof a)return super.j(a);const {t:b,v:c}=a;switch(b){case W.Uo:var d=c.t;c.s&&(a=this.j(c.s),olympe.dc.ls().zb(d,a));return olympe.dc.CloudObject.get(d);case W.mo:return olympe.dc.CloudObject.get(c);case W.Fq:return d=c.p.map(olympe.dc.query.oa.tm.j),a=c.e,new olympe.dc.ma(c.b,c.s,d,d.length-1,new Set(c.r),{max:a.m,offset:a.o,Hd:a.s,Ne:a.rm});case W.QUERY_RESULT:return
|
|
801
|
+
a||'object'!==typeof a)return super.j(a);const {t:b,v:c}=a;switch(b){case W.Uo:var d=c.t;c.s&&(a=this.j(c.s),olympe.dc.ls().zb(d,a));return olympe.dc.CloudObject.get(d);case W.mo:return olympe.dc.CloudObject.get(c);case W.Fq:return d=c.p.map(olympe.dc.query.oa.tm.j),a=c.e,new olympe.dc.ma(c.b,c.s,d,d.length-1,new Set(c.r),{max:a.m,offset:a.o,Hd:a.s,Ne:a.rm});case W.QUERY_RESULT:return si(c);case W.np:return(new olympe.dc.transaction.Si).j(c.p,c.i);case W.Do:return a=null!=(d=this.j(c.c))?d:void 0,
|
|
802
802
|
vf(new olympe.dc.Request(c.r,c.d,a,c.u),c.o);case W.Ze:return d=this.j(c.p),new olympe.dc.transaction.aj(d,c.r);case W.Gq:return olympe.dc.query.zd.j(c);case W.Co:return olympe.dc.Ag.j(c);case W.Ui:return new olympe.dc.uc(c);default:return super.j(a)}}H(a){if(this.F.has(a))return a;if(!this.db.Ha(a))throw new olympe.dc.rq(a);const b={};this.db.Db(a).forEach((d,e)=>{b[e]=this.D(d)});var c=[];for(const [d,e,f]of Yg(this.db,a))this.F.has(f)&&c.push(e===olympe.dc.va.DESTINATION?{r:d,o:a,d:f}:{r:d,o:f,
|
|
803
|
-
d:a});c={t:a,m:this.db.model(a),s:this.db.source(a),p:b,r:c};this.db.Le(a)||(c.v=!0);this.F.set(a,c);return a}};const
|
|
804
|
-
olympe.dc.Request.j.oh,
|
|
805
|
-
function
|
|
806
|
-
function
|
|
807
|
-
function
|
|
808
|
-
function
|
|
809
|
-
function
|
|
810
|
-
function
|
|
811
|
-
function
|
|
812
|
-
e))})}return b}function
|
|
813
|
-
function
|
|
814
|
-
function
|
|
815
|
-
function
|
|
816
|
-
olympe.dc.sources.lr=class extends olympe.dc.sources.yl{constructor(a,b,c,d,e,f,g){super(a,c);this.F=b;this.j=d;this.$=new olympe.dc.transaction.Si(this.T());this.H=new Map;this.N=new Set;this.version=e||'unknown';this.Ga=g?new olympe.V.stream.yw:null;this.ua=new olympe.V.promise.rr(f);olympe.C.uj(this.D.Sf(),()=>{this.H.forEach((h,k)=>{h.error(new olympe.L.errors.Oi('Connection to server has been recovered',k))})})}T(){return olympe.dc.Ja.SERVER}R(a){var b=a.getType();const c=a.content,d=xf(a);switch(b){case
|
|
817
|
-
olympe.dm.DataSource.oc.Ab,b=olympe.dm.DataSource.oc.Jh,Promise.resolve(Td(this.F)?{s:b}:{s:a,r:'Disconnected'});case
|
|
818
|
-
case
|
|
819
|
-
{this.G.warn(`Fail to unsubscribe to graphdef ${d}: ${e}`)}).finally(()=>{this.N.has(d)&&this.H.delete(d);this.N.delete(d)})}))}return rxjs.throwError(()=>Error(`Subscription of type ${a.getType()} is not supported`))}init(a){super.init(a);Rd(this.F,olympe.L.ze.zg,this.ha.bind(this));return this}destroy(){return w(function*(){})}ha(a,b){const c=olympe.dc.Request.j.Zn,d=olympe.dc.Request.j.fm,e=a.c;if(e===olympe.dc.Request.j.zo)
|
|
820
|
-
b=rf(b,a.ct),
|
|
803
|
+
d:a});c={t:a,m:this.db.model(a),s:this.db.source(a),p:b,r:c};this.db.Le(a)||(c.v=!0);this.F.set(a,c);return a}};const Sj=olympe.dc.Request.j.Cg,Tj=olympe.dc.Request.j.Ze,Uj=olympe.dc.Request.j.Vg,Vj=olympe.dc.Request.j.si,Wj=olympe.dc.Request.j.Xn,Xj=olympe.dc.Request.j.Oq,Yj=olympe.dc.Request.j.Lg,Zj=olympe.dc.Request.j.pk,ak=olympe.dc.Request.j.mp,bk=olympe.dc.Request.j.Rt,ck=olympe.dc.Request.j.St,dk=olympe.dc.Request.j.Tt,ek=olympe.dc.Request.j.Yf,fk=olympe.dc.Request.j.$f,gk=olympe.dc.Request.j.hg,hk=olympe.dc.Request.j.Xj,ik=olympe.dc.Request.j.ow,jk=olympe.dc.Request.j.Ev,kk=olympe.dc.Request.j.hp,lk=
|
|
804
|
+
olympe.dc.Request.j.oh,mk=olympe.dc.Request.j.pt,nk=olympe.dc.Request.j.oc;function ok(a){return pk(a,olympe.dc.Request.j.Cg).then(b=>{b=b.getData().p;const c=Af(b,a.T());a.G.j()&&a.G.debug('< Get Context result',b);a.G.N()&&a.G.log('< Get Context result has',b.length,'operations');return c})}function qk(a,b){const c=new olympe.dc.transaction.Ce({he:!1,Wh:!1}),d=b.jc(),e=b.j;d.qc(c);return rk(a,Tj,{i:d.T(),r:b.kh(),p:Bf(c),bd:e?!0:void 0}).then(f=>f.ct)}
|
|
805
|
+
function sk(a,b){const c=b.jc(),d=new olympe.dc.transaction.Ce({el:!0,he:!1,Wh:!1});c.qc(d);b=b.j?'bd=true':'';return pk(a,Uj,Bf(d),b,olympe.net.wa.ResponseType.ur).then(e=>{try{const f=e.getData();let g;return null!=(g=JSON.parse(f).ct)?g:Date.now()}catch(f){return Date.now()}}).finally(()=>{tk(a,hk,{id:c.T(),finalize:olympe.dc.transaction.Ff.j.Ni})})}
|
|
806
|
+
function uk(a,b){const c=new olympe.dc.transaction.Ce({he:!1,Wh:!1}),d=b.jc();d.qc(c);return rk(a,Vj,{i:d.T(),r:b.kh(),p:Bf(c)},!1).catch(e=>a.G.error(`Error while publishing burst transaction: ${e}`))}function vk(a,b){const c=new olympe.dc.transaction.Ce({he:!1,Wh:!1});b=b.jc();b.qc(c);return rk(a,lk,{i:b.T(),p:Bf(c)}).then(d=>d.ct)}
|
|
807
|
+
function wk(a,b){const c=encodeURI(bb(olympe.V.ef(),JSON.stringify(xk(a,b))));a.G.j()&&a.G.debug(`Static GraphDef query ${b} sent to orchestrator`);return pk(a,Yj,void 0,`query=${c}&v=${a.version}`,olympe.net.wa.ResponseType.ge).then(d=>yk(a,d))}function zk(a,b){const c=b.T();a.G.j()&&a.G.debug(`Query (${c}) sent to orchestrator: ${b}`);const d=xk(a,b);return qb(a.ua,()=>pk(a,ak,d,void 0,olympe.net.wa.ResponseType.ge)).then(e=>yk(a,e))}
|
|
808
|
+
function Ak(a,b){if(!Td(a.F))return a.G.error(`Server is disconnected, backup of instance ${b} is canceled.`),Promise.reject('Server is disconnected');b=xk(a,olympe.dc.ma.from(b));b.f=olympe.dc.Lb.Ho;b=N(aj(a.j,olympe.dc.Ja.SERVER,Wj),olympe.net.wa.Nd.Gh,JSON.stringify(b),olympe.net.wa.ResponseType.Oh);Ac(b,{[olympe.net.wa.Headers.wi]:olympe.net.wa.Al.JSON});return bj(a.j,b).then(c=>c.getData())}
|
|
809
|
+
function Bk(a,b,c,d){if(!Td(a.F))return a.G.error('Server is disconnected, restore of instance is canceled.'),Promise.reject('Server is disconnected');const e=aj(a.j,olympe.dc.Ja.SERVER,Xj);b=N(e+`?debug=${c}&optional=${d}`,olympe.net.wa.Nd.Gh,b);Ac(b,{[olympe.net.wa.Headers.wi]:olympe.net.wa.Al.zw});return bj(a.j,b).then(f=>f.getData())}
|
|
810
|
+
function rk(a,b,c,d=!0){const e=olympe.L.ze.zg,f={c:b};Object.assign(f,c);if(d)return new Promise((g,h)=>{Wd(a.F,e,f,(k,l)=>{k?h(k):g(l)})});Wd(a.F,e,f);return Promise.resolve()}
|
|
811
|
+
function xk(a,b){var c=Oh(b);b={i:b.T(),b:[b.D],m:!0,v:!0};if(c[0]instanceof olympe.dc.query.oa.Kd)Object.assign(b,{f:c[0].Pb,q:[]});else{const d=(h,k)=>{h.every(l=>!l.Ea(k))&&h.push(k);return h},e=new Map;for(let h=c.length-1;0<=h;h--){const k=c[h],l=k.j;let n;const p=d(null!=(n=e.get(l))?n:[],k);if(k instanceof olympe.dc.query.oa.we&&k.F){let q;null==(q=e.get(k.T()))||q.forEach(r=>d(p,r))}e.set(l,p)}let f,g;c=null!=(g=e.get(null==(f=c[0])?void 0:f.j))?g:[];Object.assign(b,{f:olympe.dc.Lb.NONE,q:c.map(a.da.bind(a,
|
|
812
|
+
e))})}return b}function tk(a,b,c){b=vf(new olympe.dc.Request(b,olympe.dc.Ja.SELF,c),a.T());let d;null==(d=a.Tb)||d.vd(b)}
|
|
813
|
+
function pk(a,b,c,d,e){const f=aj(a.j,a.T(),b);if('string'!==typeof f)return Promise.reject(`ServerProvider: no url for type ${b}`);b=N(`${f}${'string'===typeof d&&0<d.length?`?${d}`:''}`,void 0!==c?olympe.net.wa.Nd.Gh:olympe.net.wa.Nd.GET,c&&JSON.stringify(c));Ac(b,{[olympe.net.wa.Headers.wi]:'application/json'});Cc(b,null!=e?e:olympe.net.wa.ResponseType.JSON);return bj(a.j,b)}
|
|
814
|
+
function yk(a,b){return w(function*(){const c=b.headers.graphId,d=b.getData();let e,f;return(null!=(f=null==(e=a.Ga)?void 0:rb(e,d))?f:olympe.V.stream.jk.transform(b.getData())).pipeThrough(new TransformStream({transform:(g,h)=>{a.G.debug(`Received ${g.length} operations for patch ${c}`);h.enqueue(Af(g,a.T(),null,c))}}))})}
|
|
815
|
+
function Ck(a,b,c){return w(function*(){const d=b.pi;let e;if(c instanceof olympe.V.stream.Df){e=new olympe.dc.db.ec(d);try{for(const f=fa(c);;){const g=yield f.next();if(g.done)break;a.$.j(g.value.p,d).qc(e)}}catch(f){a.G.error(`Error while reading the stream: ${f}`),e=new olympe.dc.db.ec(d)}}else e=a.$.j(b.p,d);return rf(e,b.ct)})}
|
|
816
|
+
olympe.dc.sources.lr=class extends olympe.dc.sources.yl{constructor(a,b,c,d,e,f,g){super(a,c);this.F=b;this.j=d;this.$=new olympe.dc.transaction.Si(this.T());this.H=new Map;this.N=new Set;this.version=e||'unknown';this.Ga=g?new olympe.V.stream.yw:null;this.ua=new olympe.V.promise.rr(f);olympe.C.uj(this.D.Sf(),()=>{this.H.forEach((h,k)=>{h.error(new olympe.L.errors.Oi('Connection to server has been recovered',k))})})}T(){return olympe.dc.Ja.SERVER}R(a){var b=a.getType();const c=a.content,d=xf(a);switch(b){case nk:return a=
|
|
817
|
+
olympe.dm.DataSource.oc.Ab,b=olympe.dm.DataSource.oc.Jh,Promise.resolve(Td(this.F)?{s:b}:{s:a,r:'Disconnected'});case Sj:return ok(this);case Tj:return qk(this,c);case Uj:return sk(this,c);case Vj:return uk(this,c);case lk:return vk(this,c);case Yj:return d.get(olympe.dc.ma.j.Gp)?wk(this,c):zk(this,c);case Wj:return Ak(this,c);case Xj:return Bk(this,c.VE,c.debug,c.optional);case ik:case jk:case kk:case mk:return rk(this,b,{});case fk:return this.j.downloadFileContent(a);case ek:return this.j.deleteFileContent(a);
|
|
818
|
+
case gk:return this.j.uploadFileContent(a);default:return Promise.reject(`ServerProvider: Message of type ${b} not supported yet`)}}Y(a,b){if(a.getType()===Zj){const c=a.content,d=c.T();return(new rxjs.Observable(e=>{const f=xk(this,c);this.N.delete(d);this.H.set(d,e);rk(this,bk,f).catch(g=>e.error(g))})).pipe(nb(olympe.L.errors.Oi,(e,f)=>{this.G.debug(`Subscribe to topic ${e.T()} now that we are back online, after waiting for ${f}ms`);b()}),rxjs.operators.finalize(()=>{this.N.add(d);rk(this,ck,{i:d}).catch(e=>
|
|
819
|
+
{this.G.warn(`Fail to unsubscribe to graphdef ${d}: ${e}`)}).finally(()=>{this.N.has(d)&&this.H.delete(d);this.N.delete(d)})}))}return rxjs.throwError(()=>Error(`Subscription of type ${a.getType()} is not supported`))}init(a){super.init(a);Rd(this.F,olympe.L.ze.zg,this.ha.bind(this));return this}destroy(){return w(function*(){})}ha(a,b){const c=olympe.dc.Request.j.Zn,d=olympe.dc.Request.j.fm,e=a.c;if(e===olympe.dc.Request.j.zo)Ck(this,a,b).then(f=>{tk(this,e,f)});else if(e===c)b=this.$.j(a.p,a.i),
|
|
820
|
+
b=rf(b,a.ct),tk(this,e,{rollback:b,error:a.error});else if(e===dk){const f=a.i;Ck(this,a,b).then(g=>{let h;null==(h=this.H.get(f))||h.next(g)})}else e===d&&tk(this,hk,{id:a.i,finalize:olympe.dc.transaction.Ff.j.fm,error:0<a.s?a.error:null})}da(a,b){if(b instanceof olympe.dc.query.oa.Kh){const c=b.relation;let d;b=null!=(d=a.get(b.T()))?d:[];return{t:c.X(),d:c.Ka()===olympe.dc.va.ORIGIN?1:2,v:!0,r:c.recursive,q:b.map(this.da.bind(this,a))}}return{}}};olympe.dc.sources.lr.xa=[olympe.dc.sources.Tj];function Dk(a,b,c){const d=new olympe.C.Xb(`Source solver ${b.X()}`);b.fb(olympe.dm.wd.F.$b()).fb(olympe.dm.wd.D).ie().back().fb(olympe.dm.wd.j).ie().observe(d,{jd:c,Ac:!0}).subscribe(e=>{e.nj().forEach(([f,g])=>{a.D.set(f.X(),g.T())});e.sj().forEach(([f])=>{a.D.delete(f)})});b.fb(olympe.dm.ib.D).observe(d,{jd:c,Ac:!0}).subscribe(e=>{let f,g;a.F=null!=(g=null==(f=e.Gc())?void 0:f.T())?g:null});d.onDestroy(()=>{a.D.clear();a.F=null})}
|
|
821
821
|
olympe.dc.sources.Bk=class{constructor(a,b,c){this.db=a;this.j=b;this.N=c;this.D=new Map;this.F=null;this.H=!1}fromModel(a){a=olympe.dc.fa(a);return this.D.has(a)?this.D.get(a):this.F&&this.R(a)?this.F:this.N}Ke(a){let b;return null!=(b=this.db.source(a))?b:this.N}sb(a){return a===this.j?olympe.dc.CloudObject.get(this.j):a===olympe.dc.Ja.SERVER?olympe.dc.CloudObject.get(olympe.dm.DataSource.SERVER):this.db.Ha(a)&&this.db.Ob(a,olympe.dm.DataSource)?olympe.dc.CloudObject.get(a):null}R(){return!1}init(){if(!this.H){this.H=
|
|
822
822
|
!0;var a=new olympe.dc.Wa;Y(a.create(olympe.dm.DataSource,this.j).ki(this.j),olympe.dm.DataSource.Vh,!0);a.Oa(olympe.dm.DataSource.zj,this.j,this.j);a.nb(()=>{olympe.dc.ma.from(this.j).observe(olympe.C.ah()).subscribe(()=>{})})}}};olympe.dc.sources.P={Ca:'dc.sources.Logger',Rl:'dc.sources.HTTPService',hu:'dc.sources.IOService',Mq:'dc.sources.RemoteProvider',er:'dc.sources.ServerProvider',KB:'dc.sources.OfflineProvider',We:'dc.sources.SourceSolver',Ge:'dc.sources.Serializer',Ao:'dc.sources.cache.Cache',Bo:'dc.sources.cache.DATABASE',vl:'dc.sources.cache.Logger'};
|
|
823
823
|
olympe.dc.sources.U={xh:'data.httpHost',wf:'data.httpPort',Di:'data.httpSSL',Pl:'data.httpBasePath',qm:'data.pollingFrequency',Qe:'data.communicationMode',xm:'data.restrictedUse',VERSION:'version.version',jr:'data.streamWorker',qq:'data.queryConcurrencyLimit'};olympe.dc.sources.zh={rv:'olympe.internal.data.',xh:'olympe.internal.data.httpHost',wf:'olympe.internal.data.httpPort',Di:'olympe.internal.data.httpSSL'};
|
|
@@ -825,176 +825,176 @@ olympe.W.config(function(a){const b=['localhost','127.0.0.1'],c=a.getParameter(o
|
|
|
825
825
|
[olympe.dc.sources.zh.xh,olympe.dc.sources.U.wf],(e,f)=>{if(f)return f;f=b.includes(e);const g=e.endsWith(d);e=e.endsWith(c);return f?3141:g?85:e?80:443});Ya(a,olympe.dc.sources.zh.Di,[olympe.dc.sources.zh.wf,olympe.dc.sources.U.Di],(e,f)=>null!==f?f:443===e);F(a,olympe.dc.sources.U.qm,null);F(a,olympe.dc.sources.U.Qe,null);F(a,olympe.dc.sources.U.xm,null);E(a,olympe.dc.sources.P.Ca,[olympe.ja.P.Da],e=>e.cd('data'));D(a,olympe.dc.sources.P.Ge,olympe.dc.sources.cc,olympe.dc.db.P.Da);Wa(a,olympe.L.P.Ge,
|
|
826
826
|
olympe.dc.sources.P.Ge);D(a,olympe.dc.sources.P.Rl,olympe.dc.sources.Wt,olympe.dc.sources.P.Ca,olympe.net.P.cj,olympe.L.P.Ql,olympe.auth.P.Da,olympe.dc.sources.P.We,olympe.L.P.Ge,new olympe.W.pa(olympe.L.U.ql));D(a,olympe.dc.sources.P.hu,olympe.dc.sources.Fp,olympe.dc.sources.P.Ca,olympe.dc.P.Ng,olympe.net.P.Da,olympe.auth.P.Da);D(a,olympe.dc.sources.P.Mq,olympe.dc.sources.Xq,olympe.dc.sources.P.Ca,new olympe.W.pa(olympe.dc.U.Qg),olympe.dc.sources.P.Rl,olympe.L.P.qf,olympe.dc.P.sh,olympe.dc.sources.P.We);
|
|
827
827
|
D(a,olympe.dc.sources.P.er,olympe.dc.sources.lr,olympe.dc.sources.P.Ca,olympe.L.P.vk,olympe.L.P.qf,olympe.dc.sources.P.Rl,new olympe.W.pa(olympe.dc.sources.U.VERSION),new olympe.W.pa(olympe.dc.sources.U.qq),new olympe.W.pa(olympe.dc.sources.U.jr));D(a,olympe.dc.sources.P.We,olympe.dc.sources.Bk,olympe.dc.P.sh,new olympe.W.pa(olympe.dc.U.Qg),new olympe.W.pa(olympe.dc.U.Gl));E(a,olympe.dc.sources.P.vl,[olympe.ja.P.Da],e=>e.cd('datacache'));D(a,olympe.dc.sources.P.Ao,olympe.dc.sources.cache.Cache,olympe.dc.sources.P.vl,
|
|
828
|
-
olympe.dc.P.Ng,olympe.dc.sources.P.Bo,olympe.dc.db.P.Da,olympe.net.P.Da,olympe.L.P.qf,olympe.Eb.P.bm,olympe.V.P.vg,new olympe.W.pa(olympe.net.U.nq),new olympe.W.pa(olympe.dc.sources.U.VERSION));D(a,olympe.dc.sources.P.Bo,olympe.dc.sources.cache.hk,olympe.Eb.P.Sg,olympe.dc.sources.P.vl,olympe.Eb.P.bk)},'olympe.dc.sources');olympe.W.run([olympe.dc.sources.P.We,olympe.dc.sources.P.Ao],(a,b)=>{olympe.dc.ae=()=>a;olympe.dc.sources.Zd=()=>b});olympe.dc.sources.cache={};olympe.dc.sources.cache.errors={};olympe.dc.sources.cache.errors.Dm=class extends Error{constructor(a){super(a)}};olympe.dc.sources.cache.errors.yt=class extends olympe.dc.sources.cache.errors.Dm{};olympe.dc.sources.cache.errors.lw=class extends olympe.dc.sources.cache.errors.Dm{};olympe.dc.sources.cache.errors.vw=class extends olympe.dc.sources.cache.errors.Dm{};function
|
|
828
|
+
olympe.dc.P.Ng,olympe.dc.sources.P.Bo,olympe.dc.db.P.Da,olympe.net.P.Da,olympe.L.P.qf,olympe.Eb.P.bm,olympe.V.P.vg,new olympe.W.pa(olympe.net.U.nq),new olympe.W.pa(olympe.dc.sources.U.VERSION));D(a,olympe.dc.sources.P.Bo,olympe.dc.sources.cache.hk,olympe.Eb.P.Sg,olympe.dc.sources.P.vl,olympe.Eb.P.bk)},'olympe.dc.sources');olympe.W.run([olympe.dc.sources.P.We,olympe.dc.sources.P.Ao],(a,b)=>{olympe.dc.ae=()=>a;olympe.dc.sources.Zd=()=>b});olympe.dc.sources.cache={};olympe.dc.sources.cache.errors={};olympe.dc.sources.cache.errors.Dm=class extends Error{constructor(a){super(a)}};olympe.dc.sources.cache.errors.yt=class extends olympe.dc.sources.cache.errors.Dm{};olympe.dc.sources.cache.errors.lw=class extends olympe.dc.sources.cache.errors.Dm{};olympe.dc.sources.cache.errors.vw=class extends olympe.dc.sources.cache.errors.Dm{};function Ek(a){switch(!0){case null===a:case void 0===a:return null;case 'string'===typeof a:case 'boolean'===typeof a:case 'number'===typeof a:return a}switch(a.t){case 1:return new Date(a.d);case 2:return olympe.C.Color.Qb(a);case 17:return new olympe.dc.uc(a.v);case 13:return(new olympe.dc.transaction.Si).j(a.v,a.i);default:throw Error(`Impossible to deserialize the following value: ${a}`);}}
|
|
829
829
|
olympe.dc.sources.cache.wp=class{ga(a){switch(!0){case null===a:case void 0===a:return null;case 'string'===typeof a:case 'boolean'===typeof a:case 'number'===typeof a:return a;case a instanceof olympe.C.eb:return{t:1,d:a.valueOf().toISOString()};case a instanceof Date:return{t:1,d:a.toISOString()};case a instanceof olympe.C.Color:return Object.assign({t:2},a.toJSON());case a instanceof olympe.dc.uc:return{t:17,v:a.X()};case a instanceof olympe.dc.db.ec:const b=new olympe.dc.transaction.Ce;a.qc(b);
|
|
830
|
-
return{t:13,i:a.T(),v:Bf(b)};default:throw Error(`Impossible to serialize the following value: ${a}`);}}};function
|
|
831
|
-
function
|
|
832
|
-
a.$c.next(f)}finally{b&&
|
|
833
|
-
function
|
|
834
|
-
function
|
|
835
|
-
'application/octet-stream';f={tag:h,model:g.Wb(),mimeType:l};const n=new olympe.dc.Request(olympe.dc.Request.j.$f,c,f);f=qb(a.Id,()=>a.Tb.request(n).then(p=>
|
|
836
|
-
function
|
|
837
|
-
function
|
|
838
|
-
function
|
|
839
|
-
function
|
|
830
|
+
return{t:13,i:a.T(),v:Bf(b)};default:throw Error(`Impossible to serialize the following value: ${a}`);}}};function xj(a,b,c){return w(function*(){Fk(a,'queries',b);yield a.init();const d=a.D.has(c)?a.D.get(c):new Set;d.has(b)||(d.add(b),a.D.set(c,d),a.N.next(Gk(a)));return Hk(a.j,b,c)})}function yj(a,b){return w(function*(){yield a.init();a.G.debug(`Cache: subtract pending transaction operations from ${b.T()}`);b.R(a.F)})}
|
|
831
|
+
function zj(a,b,c,d,e=!1){(()=>w(function*(){a.G.debug(`Cache: handle query ${b} graph patch: ${d.T()}`);try{const f=null===b?[]:Array.from(a.D.entries()).filter(([,h])=>h.has(b)).map(([h])=>h),g=1===f.length&&'__code-as-data__'===f[0];if(null===b||!g||a.$)a.G.debug('Cache: persist graph patch',d.T()),e&&b&&(Array.from(d.Rc()).filter(h=>!h.td()).map(h=>h.tag()),yield Ik(a.j)),yield Jk(a.j,d,0<f.length?b:null),Kk(a,d,c).catch(h=>{a.G.error(`Cache: Failed to download files of a graph patch: ${h}`)})}catch(f){a.G.error(`Cache: Failed to handle graph patch ${d.T()} with message: ${f}`),
|
|
832
|
+
a.$c.next(f)}finally{b&&Lk(a,'queries',b)}}))().then(()=>{})}function Aj(a,b,c,d,e=!1){return w(function*(){yield yj(a,d);zj(a,b,c,d,e)})}function Mk(){var a=olympe.dc.sources.Zd();a.$=!0;a.zb=!0}function Fk(a,b,c){const d=a.status.getValue();b in d||(d[b]={total:0,processed:0,values:new Set});d[b].total+=1;d[b].values.add(c);d.processing=!0;a.status.next(d)}
|
|
833
|
+
function Lk(a,b,c){const d=a.status.getValue();let e,f;null!=(f=null==(e=d[b])?void 0:e.values)&&f.delete(c)&&(d[b].processed+=1,0===d[b].values.size&&(delete d[b],('queries'===b?'files':'queries')in d||(d.processing=!1)),a.status.next(d))}function Nk(a){return w(function*(){a.F=new olympe.dc.db.ec;const b=yield Ok(a.j);for(const c of b)c.qc(a.F);a.da.next(0<b.length)})}
|
|
834
|
+
function Kk(a,b,c){return w(function*(){const d=Pk(b),e=[];for(const g of d){const h=g.tag();if(!(yield Qk(a.j,h)))if(Fk(a,'files',h),!1===g.Qa(olympe.dm.File.j.X())&&g.Qa(olympe.dm.File.urlProp.X())){var f=g.Qa(olympe.dm.File.urlProp.X());f=N(f);Cc(f,olympe.net.wa.ResponseType.pl);e.push(Dc(a.Bd,f).then(k=>{k=k.Hc();if(200>k||300<=k)throw Error(`Failed to download file ${g}. Response code ${k}`);}).finally(()=>Lk(a,'files',h)))}else{let k;const l=null!=(k=g.Qa(olympe.dm.File.mimeTypeProp.X()))?k:
|
|
835
|
+
'application/octet-stream';f={tag:h,model:g.Wb(),mimeType:l};const n=new olympe.dc.Request(olympe.dc.Request.j.$f,c,f);f=qb(a.Id,()=>a.Tb.request(n).then(p=>Rk(a.j,h,p,l))).finally(()=>Lk(a,'files',h));e.push(f)}}yield Promise.allSettled(e).then(g=>{g.forEach((h,k)=>{if('rejected'===h.status){let l;a.G.warn(`Cache: File content for ${null==(l=d[k])?void 0:l.tag()} was not found`)}})})})}
|
|
836
|
+
function Pk(a){const b=[olympe.dc.fa(olympe.dm.File)];if(olympe.dc.CloudObject.exists(olympe.dm.File))b.push(...olympe.dc.ma.from(olympe.dm.File).mg(olympe.dc.CloudObject.extendedByRel).Fc().keys());else for(const c of b){let d,e;b.push(...(null!=(e=null==(d=a.Qc(c))?void 0:d.bb(olympe.dc.CloudObject.extendedByRel,f=>f))?e:[]))}return b.reduce((c,d)=>{let e,f;d=Array.from(null!=(f=null==(e=a.Qc(d))?void 0:e.bb(olympe.dc.CloudObject.instancesRel,g=>g))?f:[]).map(g=>a.Qc(g));return c.concat(d)},[])}
|
|
837
|
+
function Sk(a,b){return Array.from(a.D.values()).some(c=>c.has(b))}function Gk(a){return Array.from(a.D.keys()).filter(b=>'__code-as-data__'!==b)}function Tk(a,b){return w(function*(){yield a.init();if(b){var c,d=Array.from(null!=(c=a.D.get(b))?c:[]);a.D.delete(b);var e=Array.from(a.D.values()).reduce((f,g)=>{g.forEach(h=>f.add(h));return f},new Set);yield Uk(a.j,b);a.N.next(Gk(a));d.filter(f=>!e.has(f));yield Ik(a.j)}else yield Promise.all(Gk(a).map(f=>Tk(a,f)))})}
|
|
838
|
+
function Vk(a){if(!(2>a.length))for(let b=a.length-1;0<b;b--)for(let c=b-1;0<=c;c--)a[c].R(a[b])}
|
|
839
|
+
function Wk(a,b,c){return w(function*(){var d=olympe.dc.Request.j.Ze;const e=olympe.dc.Request.j.Yf,f=olympe.dc.Request.j.hg;a.G.debug('Sync Cache: Applying transaction patch to destination',c,b.T());const g=Pk(b);a.G.debug(`Sync Cache: Found ${g.length} files to send`);yield Promise.all(g.map(h=>w(function*(){const k=h.tag();var l=h.Wb();if(h.td())l=new olympe.dc.Request(e,c,{tag:k,model:l});else{const n=yield Xk(a.j,k);l=new olympe.dc.Request(f,c,{tag:k,model:l,content:n.content,mimeType:n.j})}if(!id(a.jb))throw Error('Lost connection, stop syncing');
|
|
840
840
|
l=yield a.Tb.request(l);b.Wc(k,new Map([[olympe.dm.File.urlProp.X(),l]]))})));d=new olympe.dc.Request(d,c,new olympe.dc.transaction.aj(b,!1));if(!id(a.jb))throw Error('Lost connection, stop syncing');yield a.Tb.request(d)})}
|
|
841
|
-
function
|
|
841
|
+
function Yk(a,b,c){return c instanceof olympe.L.errors.Dk||c instanceof olympe.L.errors.uo?(a.G.error('Sync Cache: Timeout or Connection error',c),new olympe.dc.sources.cache.errors.yt('The connection has been lost. It can happen when the application loose connectivity or when the remote server is not responding correctly',c.message)):c instanceof olympe.L.errors.Wq?(a.G.error(`Sync Cache: transaction has been rejected by ${b} data source`,c),new olympe.dc.sources.cache.errors.lw('The transaction has been rejected by the datasource',
|
|
842
842
|
c.message)):new olympe.dc.sources.cache.errors.vw('Synchronisation error',c.message)}
|
|
843
|
-
function
|
|
844
|
-
h,f),yield
|
|
845
|
-
function
|
|
846
|
-
function
|
|
847
|
-
function
|
|
843
|
+
function Zk(){var a=olympe.dc.sources.Zd();if(a.R)return rxjs.throwError(()=>Error('Another synchronisation is in progress'));a.R=!0;a.G.info('Sync Cache: Start synchronising transactions');const b=new rxjs.BehaviorSubject([null,null]);(()=>w(function*(){yield a.init();const c=yield $k(a.j);let d=0;const e=Array.from(c.values()).reduce((f,g)=>f+g.length,0);0<e&&b.next([e,d]);for(const [f,g]of c){Vk(g);for(const h of g){a.G.debug(`Sync Cache: Processing patch ${d+1}/${e} (${h.T()})`);try{yield Wk(a,
|
|
844
|
+
h,f),yield al(a.j,h)}catch(k){throw Yk(a,f,k);}d+=1;b.next([e,d])}}a.H=null}))().then(()=>{a.R=!1;b.complete()}).catch(c=>{b.error(c.message)}).finally(()=>{Nk(a).finally(()=>{a.R=!1})});return b.asObservable()}
|
|
845
|
+
function bl(){const a=olympe.dc.sources.Zd();return w(function*(){var b=new Set;const c={files:[],patches:[],version:a.version};var d=Pk(a.F);for(const e of d)b.has(e.tag())||(d=yield Xk(a.j,e.tag()),c.files.push({t:e.tag(),m:d.j,c:a.ua.j(d.content)}),b.add(e.tag()));b=yield cl(a.j);c.patches.push(...b);return JSON.stringify(c)})}
|
|
846
|
+
function dl(a){const b=olympe.dc.sources.Zd();return w(function*(){let c;try{c=JSON.parse(a)}catch(e){throw Error('Invalid pending changes, must be a JSON string');}var d=c.files;if(!Array.isArray(c.patches)||!Array.isArray(d))throw Error('Invalid pending changes, must contain a `patches` array and a `files` array');for(const e of c.files)d=b.ua.D(e.c),yield Rk(b.j,e.t,d,e.m);yield el(b.j,c.patches);yield Nk(b);b.Ga.Tc(rf(b.F))})}
|
|
847
|
+
function fl(){const a=olympe.dc.sources.Zd();return w(function*(){yield gl(a.j);yield Nk(a)})}
|
|
848
848
|
olympe.dc.sources.cache.Cache=class{constructor(a,b,c,d,e,f,g,h,k,l){this.G=a;this.Tb=b;this.j=c;this.Ga=d;this.Bd=e;this.jb=f;this.$a=g;this.ua=h;this.version=l;this.$=this.version!==this.$a.get('__code-as-data-version__');this.Mb=this.zb=!1;this.D=new Map;this.N=new rxjs.BehaviorSubject([]);this.H=null;this.da=new rxjs.BehaviorSubject(!1);this.F=new olympe.dc.db.ec;this.vc=this.zc=!1;this.ha=[];this.Y=0;this.Rd=new rxjs.BehaviorSubject(!1);this.status=new rxjs.BehaviorSubject({processing:!1});this.R=
|
|
849
|
-
!1;this.$c=new rxjs.Subject;this.Id=new olympe.V.promise.rr(k)}Hc(){return this.status.asObservable()}init(){const a=this;return w(function*(){if(!a.zc)if(a.vc)yield new Promise(b=>{a.ha.push(b)});else{a.vc=!0;(yield
|
|
850
|
-
b.j.executeQuery(a).then(olympe.V.stream.ds)})}applyTransaction(a,b){const c=this;return w(function*(){c.G.debug('Cache: apply transaction',a,b);yield c.init();const d=a.jc(),e=Array.from(d.Bb.keys());let f,g;const h=Array.from(null!=(g=null==(f=c.H)?void 0:f.j.Bb.keys())?g:[]);let k;b!==(null==(k=c.H)?void 0:k.D)||e.some(l=>!h.includes(l))?(yield
|
|
851
|
-
b,c){const d=this;return w(function*(){yield d.init();yield
|
|
852
|
-
function
|
|
853
|
-
function
|
|
854
|
-
function
|
|
855
|
-
function
|
|
856
|
-
function
|
|
857
|
-
a.G.debug(`Offline DB: Data result for query ${b.T()}`,d.jc().Bb.size,'instances',Array.from(d.jc().Ed()).length,'relations');return d})}function
|
|
858
|
-
function
|
|
859
|
-
olympe.dc.sources.cache.hk=class{constructor(a,b,c){this.H=`Olympe_Cache_${a}`;this.G=b;this.N=new olympe.dc.sources.cache.wp;this.db=c.D(this.H);this.D=new Set;this.j=[];this.files=null;this.db.R('files').then(d=>{this.files=new Set(d);this.j.forEach(e=>e(null))}).catch(d=>{this.j.forEach(e=>e(d))});this.F=olympe.V.Promise.jj(()=>{const d=this;return w(function*(){if(!(0===d.D.size||0<(yield
|
|
849
|
+
!1;this.$c=new rxjs.Subject;this.Id=new olympe.V.promise.rr(k)}Hc(){return this.status.asObservable()}init(){const a=this;return w(function*(){if(!a.zc)if(a.vc)yield new Promise(b=>{a.ha.push(b)});else{a.vc=!0;(yield hl(a.j)).forEach(b=>{a.D.set(b.name,new Set(b.j))});a.N.next(Gk(a));yield Nk(a);a.Ga.Tc(rf(a.F));for(const b of a.ha)b();a.zc=!0;a.ha=[]}})}executeQuery(a){const b=this;return w(function*(){yield b.init();return Sk(b,a.T())&&Oh(a).some(c=>c instanceof olympe.dc.query.oa.Kd)?il(b.j,a).then(olympe.V.stream.ds):
|
|
850
|
+
b.j.executeQuery(a).then(olympe.V.stream.ds)})}applyTransaction(a,b){const c=this;return w(function*(){c.G.debug('Cache: apply transaction',a,b);yield c.init();const d=a.jc(),e=Array.from(d.Bb.keys());let f,g;const h=Array.from(null!=(g=null==(f=c.H)?void 0:f.j.Bb.keys())?g:[]);let k;b!==(null==(k=c.H)?void 0:k.D)||e.some(l=>!h.includes(l))?(yield jl(c.j,d,b),c.H=new olympe.dc.sources.cache.wt(d,b),c.da.next(!0)):(d.qc(c.H.j),yield jl(c.j,c.H.j,b));d.qc(c.F);yield Jk(c.j,d,'local-transaction')})}uploadFileContent(a,
|
|
851
|
+
b,c){const d=this;return w(function*(){yield d.init();yield Rk(d.j,a,b,c);return`offline://${a}`})}downloadFileContent(a){const b=this;return w(function*(){yield b.init();return Xk(b.j,a).then(c=>c.content)})}deleteFileContent(a){const b=this;return w(function*(){yield b.init();yield kl(b.j,[a])})}};olympe.dc.sources.cache.wt=class{constructor(a,b){this.j=a;this.D=b}};olympe.dc.sources.cache.Cache.D='__code-as-data-version__';olympe.dc.sources.cache.Cache.j='__code-as-data__';function hl(a){return w(function*(){return(yield a.db.F('buckets')).map(b=>olympe.dc.sources.cache.sq.Qb(b))})}function Ok(a){return w(function*(){return(yield a.db.F('pending-transactions')).map(b=>{b=olympe.dc.sources.cache.Fh.Qb(b);return Ek(b.j)})})}function Hk(a,b,c){return w(function*(){a.G.debug(`Offline DB: Adding query ${b} in bucket ${c}`);return a.db.D()})}function Ik(a){return w(function*(){return a.db.D()})}
|
|
852
|
+
function Jk(a,b,c){a.G.debug(`Offline DB: Apply patch ${b.T()} on local offline db`);Array.from(b.Bb.keys());return a.db.D().then(()=>{null===c&&(b.Bb.forEach((d,e)=>a.D.add(e)),a.F().then(()=>{}))})}function Qk(a,b){return new Promise((c,d)=>{null!==a.files?c(a.files.has(b)):a.j.push(e=>{let f;return e?d(e):c(!(null==(f=a.files)||!f.has(b)))})})}
|
|
853
|
+
function Rk(a,b,c,d){c=new olympe.dc.sources.cache.om(b,c,d);a.files.add(b);return a.db.set('files',c.toJSON()).then(()=>{}).catch(e=>{a.files.delete(b);throw e;})}function Uk(a,b){return w(function*(){return a.db.remove('buckets',b).then(()=>{})})}function $k(a){return w(function*(){return(yield a.db.F('pending-transactions')).reduce((b,c)=>{c=olympe.dc.sources.cache.Fh.Qb(c);const d=c.D;let e;const f=null!=(e=b.get(d))?e:[];f.push(Ek(c.j));b.set(d,f);return b},new Map)})}
|
|
854
|
+
function al(a,b){return w(function*(){return a.db.remove('pending-transactions',b.T()).then(()=>{})})}function Xk(a,b){return w(function*(){const c=yield a.db.get('files',b);if(!c)throw Error(`File ${b} not found in offline cache database`);return olympe.dc.sources.cache.om.Qb(c)})}function cl(a){return w(function*(){return a.db.F('pending-transactions')})}
|
|
855
|
+
function el(a,b){return w(function*(){const c=new Map;for(const d of b){const e=olympe.dc.sources.cache.Fh.Qb(d);e&&c.set(e.j.i,d)}yield a.db.da()})}function gl(a){return w(function*(){return a.db.clear('pending-transactions').then(()=>{})})}
|
|
856
|
+
function il(a,b){return w(function*(){const c=b.sb();a.G.debug(`Offline DB: Executing query ${b.T()} by ID with source ${c}`);const d=olympe.dc.query.zd.mj(b);var e=(yield a.db.H(b.T())).map(f=>olympe.dc.sources.cache.Ig.Qb(f));for(const f of e){if(f.source!==c)continue;e=olympe.dc.sources.cache.hk.ac(f);const g=ll(f.Gd);d.create(f.tag,e,g);for(const h of f.ob)if(e=h.match(/^([a-z0-9]*)(<|>)([a-z0-9]*)$/)){const [,k,l,n]=e;e='<'===l;k===olympe.dc.fc.Yc&&!0===e||d.Oa(k,e?n:f.tag,e?f.tag:n)}}a.G.j()&&
|
|
857
|
+
a.G.debug(`Offline DB: Data result for query ${b.T()}`,d.jc().Bb.size,'instances',Array.from(d.jc().Ed()).length,'relations');return d})}function jl(a,b,c){b=a.N.ga(b);a.G.debug(`save transaction in destination '${c}'`,JSON.stringify(b));return a.db.set('pending-transactions',(new olympe.dc.sources.cache.Fh(c,b,Date.now())).toJSON())}function ml(a){return w(function*(){return a.db.N('pending-transactions')})}function kl(a,b){return w(function*(){b.forEach(c=>a.files.delete(c));yield a.db.$()})}
|
|
858
|
+
function ll(a){return Object.entries(a).reduce((b,[c,d])=>b.set(c,Ek(d)),new Map)}
|
|
859
|
+
olympe.dc.sources.cache.hk=class{constructor(a,b,c){this.H=`Olympe_Cache_${a}`;this.G=b;this.N=new olympe.dc.sources.cache.wp;this.db=c.D(this.H);this.D=new Set;this.j=[];this.files=null;this.db.R('files').then(d=>{this.files=new Set(d);this.j.forEach(e=>e(null))}).catch(d=>{this.j.forEach(e=>e(d))});this.F=olympe.V.Promise.jj(()=>{const d=this;return w(function*(){if(!(0===d.D.size||0<(yield ml(d))))if(0<d.db.Y())d.F().then(()=>{}),d.G.debug('Offline DB GC: Postponing round while the stack is busy');
|
|
860
860
|
else{d.G.debug(`Offline DB GC: Round with ${d.D.size} candidates`);var e=Date.now();yield d.db.D().then(()=>{});d.G.debug(`Offline DB GC: has taken ${Date.now()-e}ms to run`)}})},5E3)}static ac(a){const b=new RegExp(`^(${olympe.dc.fc.Yc})>([a-z0-9]*)$`);for(const c of a.ob)if(a=c.match(b))return a[2];return null}executeQuery(a){const b=this;return w(function*(){const c=Date.now();b.G.debug(`Offline DB: Executing query ${a.T()} with source ${a.sb()}`);const d=olympe.dc.query.zd.mj(a),e=a.sb();var f=
|
|
861
|
-
yield b.db.get('instances',a.D),g=olympe.dc.sources.cache.Ig.Qb(f);if(!g)return d;f=new Map;const h=new Set([g.tag]);d.create(g.tag,olympe.dc.sources.cache.hk.ac(g),
|
|
862
|
-
Promise.resolve([]);r.X();return b.db.H().then(z=>z.map(A=>olympe.dc.sources.cache.Ig.Qb(A))).then(z=>{x.set(y,z)})})).then(()=>x);for(const [y,z]of l){p instanceof olympe.dc.query.oa.we&&p.F&&k.add(y);for(const A of z)if(l=A.tag,A.source===e){if(p instanceof olympe.dc.query.oa.we&&!k.has(l)){var n=t[t.length-1];n||(n=new Set,t.push(n));n.add(l)}k.add(l);h.has(l)||(h.add(l),n=olympe.dc.sources.cache.hk.ac(A),d.create(l,n,
|
|
861
|
+
yield b.db.get('instances',a.D),g=olympe.dc.sources.cache.Ig.Qb(f);if(!g)return d;f=new Map;const h=new Set([g.tag]);d.create(g.tag,olympe.dc.sources.cache.hk.ac(g),ll(g.Gd));for(const p of Oh(a))if(p instanceof olympe.dc.query.oa.Kh){var k=p.relation;g=k.Ka()===olympe.dc.va.ORIGIN;const q=k.X(),r=k.$b();k=new Set;f.set(p.T(),k);const t=[f.has(p.j)?new Set(f.get(p.j)):new Set([a.D])];for(const u of t){const x=new Map;var l=yield Promise.all(Array.from(u).map(y=>{if(!h.has(y))return b.G.warn(`Offline DB: Instance ${y} not found while processing query part, this should not happen`),
|
|
862
|
+
Promise.resolve([]);r.X();return b.db.H().then(z=>z.map(A=>olympe.dc.sources.cache.Ig.Qb(A))).then(z=>{x.set(y,z)})})).then(()=>x);for(const [y,z]of l){p instanceof olympe.dc.query.oa.we&&p.F&&k.add(y);for(const A of z)if(l=A.tag,A.source===e){if(p instanceof olympe.dc.query.oa.we&&!k.has(l)){var n=t[t.length-1];n||(n=new Set,t.push(n));n.add(l)}k.add(l);h.has(l)||(h.add(l),n=olympe.dc.sources.cache.hk.ac(A),d.create(l,n,ll(A.Gd)));q===olympe.dc.fc.Yc&&!0===g||d.Oa(q,g?l:y,g?y:l)}}}}else p instanceof
|
|
863
863
|
olympe.dc.query.oa.Kd&&b.G.warn(`Offline DB: Trying to execute a query ${a.T()} on the Cache DB that contains a FollowRule part. This is not supported and designed not to happen.`);b.G.j()&&(b.G.debug(`Offline DB: Data result for query ${a.T()}`,d.jc().Bb.size,'instances',Array.from(d.jc().Ed()).length,'relations'),b.G.debug(`Offline DB: Data result for query ${a.T()} took ${Date.now()-c}ms to be executed`));return d})}};
|
|
864
864
|
olympe.dc.sources.cache.sq=class{constructor(a,b){this.name=a;this.j=b}static Qb(a){return a?new olympe.dc.sources.cache.sq(a.name,a.queryIds):null}toJSON(){return{name:this.name,queryIds:this.j}}};
|
|
865
865
|
olympe.dc.sources.cache.Ig=class{constructor(a,b,c,d,e){this.tag=a;this.source=b;this.Gd=null!=c?c:{};this.ob=null!=d?d:[];this.j=null!=e?e:[]}static Qb(a){return a?new olympe.dc.sources.cache.Ig(a.tag,a.source,a.props,a.relations,a.queryIds):null}toJSON(){return{tag:this.tag,source:this.source,props:this.Gd,relations:this.ob,queryIds:this.j}}};
|
|
866
866
|
olympe.dc.sources.cache.Fh=class{constructor(a,b,c){this.D=a;this.j=b;this.timestamp=c}static Qb(a){return a?new olympe.dc.sources.cache.Fh(a.destination,a.patch,a.timestamp):null}toJSON(){return{destination:this.D,patch:this.j,timestamp:this.timestamp}}};
|
|
867
867
|
olympe.dc.sources.cache.mv=class extends olympe.dc.sources.cache.Fh{constructor(a,b,c,d){super(a,b,c);this.error=d}static Qb(a){return a?new olympe.dc.sources.cache.mv(a.destination,a.patch,a.timestamp,a.error):null}toJSON(){return{destination:this.D,patch:this.j,timestamp:this.timestamp,error:this.error}}};
|
|
868
|
-
olympe.dc.sources.cache.om=class{constructor(a,b,c){this.tag=a;this.content=b;this.j=c}static Qb(a){return a?new olympe.dc.sources.cache.om(a.tag,a.content,a.mimetype):null}toJSON(){return{tag:this.tag,content:this.content,mimetype:this.j}}};function
|
|
868
|
+
olympe.dc.sources.cache.om=class{constructor(a,b,c){this.tag=a;this.content=b;this.j=c}static Qb(a){return a?new olympe.dc.sources.cache.om(a.tag,a.content,a.mimetype):null}toJSON(){return{tag:this.tag,content:this.content,mimetype:this.j}}};function nl(a,b){let c=a.N.get(b);c||(c=new Set(a.j.get(b).ob),a.N.set(b,c));return c}
|
|
869
869
|
olympe.dc.sources.cache.$t=class{constructor(a,b){this.G=a;this.F=b;this.j=new Map;this.R=new Set;this.Y=new Set;this.H=new olympe.dc.sources.cache.wp;this.N=new Map}Rc(){this.R.forEach(a=>this.j.delete(a));Array.from(this.j.entries()).forEach(([a,b])=>{b||this.j.delete(a)});return this.j}Oc(a,b,c){const d=this.j.get(a);d||this.Y.add(a);var e;c=Array.from(null!=c?c:[]).reduce((h,k)=>{h[k[0]]=this.H.ga(k[1]);return h},null!=(e=null==d?void 0:d.Gd)?e:{});let f;e=null!=(f=null==d?void 0:d.j)?f:[];null===
|
|
870
870
|
this.F||e.includes(this.F)||e.push(this.F);let g;b=new olympe.dc.sources.cache.Ig(a,b,c,null!=(g=null==d?void 0:d.ob)?g:[],e);this.j.set(a,b)}Wc(a,b){const c=this.j.get(a);if(c){var d;c.Gd=Array.from(b).reduce((e,[f,g])=>{null===g?delete e[f]:e[f]=this.H.ga(g);return e},null!=(d=c.Gd)?d:{})}else this.G.warn(`Trying to update an instance (${a}) which do not exists in the cache database: ignoring.`)}D(a){this.R.add(a)}Oa(a,b,c){var d;const e=null!=(d=this.j.get(b))?d:new olympe.dc.sources.cache.Ig(b,
|
|
871
|
-
'unknown',{},[],[]);var f;d=null!=(f=this.j.get(c))?f:new olympe.dc.sources.cache.Ig(c,'unknown',{},[],[]);b=`${a}${olympe.dc.va.ORIGIN}${b}`;f=(g,h)=>{this.j.set(g.tag,g);const k=
|
|
872
|
-
f.ob.indexOf(g);f.ob.splice(k,1);h.delete(g)}};d&&b(d,c);e&&b(e,a)}};olympe.dc.sources.cache.$t.xa=[olympe.dc.Writable];olympe.dc.transaction={};olympe.dc.ti=class a{constructor(b,c){this.id=null!=b?b:olympe.V.Ic();this.D=new olympe.C.Xb('BurstTransaction#'+this.id,c);this.zb=
|
|
871
|
+
'unknown',{},[],[]);var f;d=null!=(f=this.j.get(c))?f:new olympe.dc.sources.cache.Ig(c,'unknown',{},[],[]);b=`${a}${olympe.dc.va.ORIGIN}${b}`;f=(g,h)=>{this.j.set(g.tag,g);const k=nl(this,g.tag);k.has(h)||(g.ob.push(h),k.add(h));null===this.F||g.j.includes(this.F)||g.j.push(this.F)};f(e,`${a}${olympe.dc.va.DESTINATION}${c}`);f(d,b)}hc(a,b,c){const d=this.j.get(b),e=this.j.get(c);c=`${a}${olympe.dc.va.DESTINATION}${c}`;a=`${a}${olympe.dc.va.ORIGIN}${b}`;b=(f,g)=>{const h=nl(this,f.tag);if(h.has(g)){const k=
|
|
872
|
+
f.ob.indexOf(g);f.ob.splice(k,1);h.delete(g)}};d&&b(d,c);e&&b(e,a)}};olympe.dc.sources.cache.$t.xa=[olympe.dc.Writable];olympe.dc.transaction={};olympe.dc.ti=class a{constructor(b,c){this.id=null!=b?b:olympe.V.Ic();this.D=new olympe.C.Xb('BurstTransaction#'+this.id,c);this.zb=ol(this);this.R=!1;this.D.onDestroy(()=>this.N());this.Y=new Set;this.F=new Map;this.H=new Set;this.j=null;let d;this.$a=null!=(d=olympe.W.getParameter(olympe.dc.transaction.U.Yn))?d:30;this.ha=[]}static j(b,c){return`${b},${c}`}Mb(b){for(const c of this.ha)c(b);this.stop()}Ga(){null!==this.j&&(clearTimeout(this.j),this.j=null);const b=this.da(this.H);0<b.size&&pl(this,
|
|
873
873
|
b,!1);this.H.clear()}da(b){const c=new Map;b.forEach(d=>{const e=d.split(',');let f=c.get(e[0]);void 0===f&&(f=new Map,c.set(e[0],f));f.set(e[1],this.F.get(d))});return c}$(b,c,d){this.ua(b,c,d);this.zb(b,c,d);null===this.j&&(this.j=setTimeout(this.Ga.bind(this),this.$a))}ua(b,c,d){b=a.j(b,c);this.F.set(b,d);this.H.add(b)}jb(b,c){return this.F.get(a.j(b,c))}push(b,c){const d=olympe.dc.fa(b);b=c.subscribe(e=>{for(const [f,g]of e)e=olympe.dc.fa(f),this.jb(d,e)!==g&&this.$(d,e,g.valueOf())});this.Y.add(b)}complete(){return new Promise((b,
|
|
874
874
|
c)=>{this.N((d,e)=>{for(const f of this.Y)f.unsubscribe();d?b():c(e)})})}update(b,c,d){const e=olympe.dc.fa(b),f=olympe.dc.fa(c);void 0===e||void 0===f?olympe.ja.ab('dc').error('Burst transaction: instance tag or property tag is undefined'):(this.D.run(()=>{olympe.C.vn([d],g=>{this.R=!0;if(g instanceof olympe.dc.uc)olympe.ja.ab('dc').error('Cannot send complex property values in burst transactions');else{var h;this.$(e,f,null!=(h=null==g?void 0:g.valueOf())?h:null)}})}),this.D.Td(()=>{this.N()}))}stop(){this.D.destroy();
|
|
875
|
-
this.ha.length=0}getContext(){return this.D}T(){return this.id}kh(){return!1}N(b){if(this.R){this.R=!1;null!==this.j&&(clearTimeout(this.j),this.j=null);this.H.clear();const c=this.da(new Set(this.F.keys()));
|
|
875
|
+
this.ha.length=0}getContext(){return this.D}T(){return this.id}kh(){return!1}N(b){if(this.R){this.R=!1;null!==this.j&&(clearTimeout(this.j),this.j=null);this.H.clear();const c=this.da(new Set(this.F.keys()));pl(this,c,!0,b)}else null==b||b(!0)}toString(){return'Burst transaction #'+this.id}};olympe.dc.ti.prototype.complete=olympe.dc.ti.prototype.complete;olympe.dc.ti.prototype.push=olympe.dc.ti.prototype.push;olympe.dc.Lc=class{j(){}toString(){}};olympe.dc.Lc.j=1;olympe.dc.Lc.D=2;olympe.dc.Lc.H=3;olympe.dc.Lc.F=4;olympe.dc.Lc.N=5;olympe.dc.transaction.Si=class a{constructor(b){this.F=null!=b?b:olympe.dc.Ja.SERVER}static j(b){const c=new Map;for(const [d,e]of Object.entries(b)){b=d;let f=typeof e;20<b.length&&b.startsWith('fd')&&(b=olympe.dc.de.Se+b.substring(2));'object'===f&&(f=e&&e.c?String(e.c):'untyped');switch(f){case '1':case '2':case '3':throw Error('Complex format for primitive types not supported.');case 'string':case 'boolean':case 'number':c.set(b,e);break;case '4':c.set(b,new Date(Date.UTC(e.y,e.M-1,e.d,e.h,e.m,
|
|
876
876
|
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&&e.M-1||0,e.d||1,e.h,e.m,e.s,e.S)));break;case '7':c.set(b,new olympe.C.Color(e.r,e.g,e.b,e.a));break;case '8':c.set(b,new olympe.dc.uc(e.t));break;case 'untyped':null===e&&c.set(b,null)}}return c}j(b,c){return this.D(b,new olympe.dc.db.ec(c))}D(b,c){for(const d of b)switch(d.o){case olympe.dc.Lc.j:b=a.j(d.p||{});let e;c.Oc(d.t,null!=(e=d.s)?e:this.F,b,d.m);break;case olympe.dc.Lc.D:c.Wc(d.t,
|
|
877
|
-
a.j(d.p),d.m);break;case olympe.dc.Lc.H:c.D(d.t,d.f,d.m);break;case olympe.dc.Lc.F:c.Oa(d.m,d.l,d.r,d.lm,d.rm);break;case olympe.dc.Lc.N:c.hc(d.m,d.l,d.r,d.lm,d.rm);break;default:throw Error('Undefined patch operation: '+d.o);}return c}};function
|
|
878
|
-
function
|
|
879
|
-
olympe.dc.transaction.wv=class{constructor(a,b,c){this.id=null!=c?c:olympe.V.Ic();this.H=b;this.db=a;this.D=new Map;this.j=new olympe.dc.db.ec(this.id);this.sources=new Map;this.F=new Map}jf(){return 0===this.j.Bb.size}Oc(a,b,c,d){let e;const f=null!=(e=null!=c?c:this.sources.get(a))?e:this.H.fromModel(b);c=Z(this,a);this.sources.set(a,f);
|
|
880
|
-
|
|
881
|
-
Z(this,c)&&d!==olympe.dc.Ja.SELF&&e!==olympe.dc.Ja.SELF;f&&d!==e&&a!==olympe.dc.fc.Yc&&(olympe.ja.ab('dc').warn(`Try to delete a relation between 2 objects that have different locations: ${b}-[${a}]->${c}`),f=!1);
|
|
882
|
-
class
|
|
877
|
+
a.j(d.p),d.m);break;case olympe.dc.Lc.H:c.D(d.t,d.f,d.m);break;case olympe.dc.Lc.F:c.Oa(d.m,d.l,d.r,d.lm,d.rm);break;case olympe.dc.Lc.N:c.hc(d.m,d.l,d.r,d.lm,d.rm);break;default:throw Error('Undefined patch operation: '+d.o);}return c}};function ql(a,b){let c;return null!=(c=a.sources.get(b))?c:a.H.Ke(b)}function rl(a,b){let c,d,e;return null!=(e=null!=(d=null==(c=a.j.Qc(b))?void 0:c.Wb())?d:a.db.model(b))?e:null}function Z(a,b){let c;return null!=(c=a.F.get(b))?c:a.db.Le(b)||!a.db.Ha(b)}function sl(a,b){0===a.F.size?a.F=b:b.forEach((c,d)=>a.F.set(d,c))}function tl(a){return Array.from(a.j.Rc()).filter(b=>!b.td()).map(b=>b.tag())}function ul(a){return Array.from(a.j.Rc()).filter(b=>b.td()).map(b=>b.tag())}
|
|
878
|
+
function vl(a,b,c,d){d(a.j);c&&b!==olympe.dc.Ja.SELF&&(c=a.D.get(b),c||(c=new olympe.dc.db.ec(a.id),a.D.set(b,c)),d(c))}function wl(a,b,c){const d=ql(a,b),e=Z(a,b),f=rl(a,b);vl(a,d,e,g=>{g.D(b,c,f)})}
|
|
879
|
+
olympe.dc.transaction.wv=class{constructor(a,b,c){this.id=null!=c?c:olympe.V.Ic();this.H=b;this.db=a;this.D=new Map;this.j=new olympe.dc.db.ec(this.id);this.sources=new Map;this.F=new Map}jf(){return 0===this.j.Bb.size}Oc(a,b,c,d){let e;const f=null!=(e=null!=c?c:this.sources.get(a))?e:this.H.fromModel(b);c=Z(this,a);this.sources.set(a,f);vl(this,f,c,g=>{g.Oc(a,f,d,b)})}Wc(a,b){const c=ql(this,a),d=Z(this,a),e=rl(this,a);vl(this,c,d,f=>{f.Wc(a,null!=b?b:new Map,e)})}Oa(a,b,c){const d=ql(this,b),e=
|
|
880
|
+
ql(this,c);var f=Z(this,b)&&Z(this,c)&&d!==olympe.dc.Ja.SELF&&e!==olympe.dc.Ja.SELF;f&&d!==e&&a!==olympe.dc.fc.Yc&&(f=g=>{let h;return null!=(h=olympe.dc.ia().name(g))?h:g},olympe.ja.ab('dc').warn(`Try to create a relation between 2 objects that have different locations: \n ${f(b)} (${b})-[${f(a)} (${a})]->${f(c)} (${c}), originSrc: ${f(d)} (${d}), destinationSrc: ${f(e)} (${e})`),f=!1);vl(this,d,f,g=>{g.Oa(a,b,c,rl(this,b),rl(this,c))})}hc(a,b,c){const d=ql(this,b),e=ql(this,c);let f=Z(this,b)&&
|
|
881
|
+
Z(this,c)&&d!==olympe.dc.Ja.SELF&&e!==olympe.dc.Ja.SELF;f&&d!==e&&a!==olympe.dc.fc.Yc&&(olympe.ja.ab('dc').warn(`Try to delete a relation between 2 objects that have different locations: ${b}-[${a}]->${c}`),f=!1);vl(this,d,f,g=>{g.hc(a,b,c,rl(this,b),rl(this,c))})}};function xl(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.Jp.ir)if(e===olympe.dc.Ja.SELF)d[g]=olympe.dc.ia().T();else{if(e===olympe.dc.Ja.SERVER)continue}else g.startsWith(olympe.dc.de.Se)&&(g='fd'+g.substring(1));e=a.R(e);c&&e instanceof Object&&8===e.c?a.N.set(g,e):d[g]=e}return d}function yl(a){if(0===a.N.size)return null;const b=Object.create(null);a.N.forEach((c,d)=>{b[d]=c});a.N.clear();return b}
|
|
882
|
+
class zl{constructor(){this.N=new Map}R(a){return a instanceof olympe.C.Sa||a instanceof olympe.C.ea||a instanceof olympe.C.aa?a.valueOf():a instanceof Date||a instanceof olympe.C.eb?(a=a instanceof olympe.C.eb?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.C.Color?{c:7,r:a.fh().valueOf(),g:a.bh().valueOf(),b:a.Zg().valueOf(),a:a.Yg().valueOf()}:a&&'function'===
|
|
883
883
|
typeof a.X?{c:8,t:a.X()}:a}}function Bf(a){const b=a.H.concat(a.F).concat(a.N).concat(a.j).concat(a.R);a.N=[];a.F=[];a.j=[];a.R=[];a.H=[];return b}
|
|
884
|
-
olympe.dc.transaction.Ce=class{constructor({el:a=!1,Wh:b=!0,he:c=!0}={}){this.N=[];this.F=[];this.j=[];this.R=[];this.H=[];this.el=null!=a?a:!1;this.he=null!=c?c:!0;this.Wh=null!=b?b:!0;this.Y=olympe.C?new
|
|
885
|
-
t:a,p:b})}Wc(a,b,c=null){b=
|
|
886
|
-
e&&(a.rm=e);this.R.push(a)}hc(a,b,c,d=null,e=null){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');a={o:olympe.dc.Lc.N,m:a,l:b,r:c};this.he&&d&&(a.lm=d);this.he&&e&&(a.rm=e);this.H.push(a)}};olympe.dc.transaction.Ce.xa=[olympe.dc.Writable];function
|
|
887
|
-
function
|
|
888
|
-
function
|
|
889
|
-
olympe.dc.Wa=class{constructor(a){this.id=null!=a?a:olympe.V.Ic();this.Fa=[];this.F=new Map;this.Y=!0;this.D=new Map;this.$=[];this.H=this.N=!1;this.R=[...olympe.dc.tj().$]}T(){return this.id}model(a){let b;return null!=(b=this.F.get(olympe.dc.fa(a)))?b:olympe.dc.ia().model(a)}j(a){
|
|
890
|
-
olympe.dc.fa(a));let d;this.persist(c,null!=(d=this.D.get(c))?d:this.Y);return b}persist(a,b=!0){const c=olympe.dc.fa(a);var d=olympe.dc.ia();this.D.set(c,b);if(b){let f;b=null!=(f=this.F.get(c))?f:d.model(c);if(null===b)throw Error(`Try to persist an instance that does not exist: ${c}`);var e;d=null!=(e=d.source(a))?e:olympe.dc.ae().fromModel(b);
|
|
891
|
-
if(!e&&!this.F.has(c))throw Error(`Try to remove persistence of an instance that does not exist and is not part of the transaction: ${c}`);}return this}delete(a,b=olympe.dc.Lb.Dc){
|
|
884
|
+
olympe.dc.transaction.Ce=class{constructor({el:a=!1,Wh:b=!0,he:c=!0}={}){this.N=[];this.F=[];this.j=[];this.R=[];this.H=[];this.el=null!=a?a:!1;this.he=null!=c?c:!0;this.Wh=null!=b?b:!0;this.Y=olympe.C?new zl:new class extends zl{R(d){return d&&'function'===typeof d.X?{c:8,t:d.X()}:d}}}flush(){return JSON.stringify(Bf(this))}Oc(a,b,c,d=null){c=xl(this.Y,null!=c?c:null,this.el);c={o:olympe.dc.Lc.j,t:a,p:c};this.Wh&&(c.s=b);this.he&&d&&(c.m=d);this.N.push(c);this.el&&(b=yl(this.Y))&&this.j.push({o:olympe.dc.Lc.D,
|
|
885
|
+
t:a,p:b})}Wc(a,b,c=null){b=xl(this.Y,b||null,!1);a={o:olympe.dc.Lc.D,t:a,p:b};this.he&&c&&(a.m=c);this.j.push(a)}D(a,b,c=null){a={o:olympe.dc.Lc.H,t:a,f:b};this.he&&c&&(a.m=c);this.F.push(a)}Oa(a,b,c,d=null,e=null){if(!a)throw Error('Cannot create relation of undefined type');if(!b)throw Error(`Cannot create relation ${a} from undefined origin to ${c}`);if(!c)throw Error(`Cannot create relation ${a} from ${b} to undefined destination`);a={o:olympe.dc.Lc.F,m:a,l:b,r:c};this.he&&d&&(a.lm=d);this.he&&
|
|
886
|
+
e&&(a.rm=e);this.R.push(a)}hc(a,b,c,d=null,e=null){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');a={o:olympe.dc.Lc.N,m:a,l:b,r:c};this.he&&d&&(a.lm=d);this.he&&e&&(a.rm=e);this.H.push(a)}};olympe.dc.transaction.Ce.xa=[olympe.dc.Writable];function Al(a){var b=new olympe.dc.Wa;b.Y=a;return b}function Bl(a,b){b instanceof olympe.dc.Wa&&b.D.forEach((c,d)=>a.D.set(d,c));a.Fa.push(b);return b}
|
|
887
|
+
function Cl(a,b,c,d){c=a.create(null!=c?c:olympe.dc.CloudObject,void 0);if('string'===typeof b)b=b||'',Y(c,olympe.dc.CloudObject.nameProp.X(),b);else for(const [f,g]of Object.entries(b))Y(c,f,g);b=c.X();d=null!=d?d:olympe.dc.CloudObject;const e=olympe.dc.CloudObject.extendRel.X();Bl(a,new olympe.dc.transaction.Fa.Jo(e,b));Bl(a,new olympe.dc.transaction.Fa.Bl(e,b,d));return c}
|
|
888
|
+
function Dl(a,b){if(a.H)throw Error('Operation not permitted: this transaction has already been executed');a.H=!0;const c=[d=>{a.H=d},...a.$,null!=b?b:()=>{}];return(d,e)=>{c.forEach(f=>f(d,e))}}
|
|
889
|
+
olympe.dc.Wa=class{constructor(a){this.id=null!=a?a:olympe.V.Ic();this.Fa=[];this.F=new Map;this.Y=!0;this.D=new Map;this.$=[];this.H=this.N=!1;this.R=[...olympe.dc.tj().$]}T(){return this.id}model(a){let b;return null!=(b=this.F.get(olympe.dc.fa(a)))?b:olympe.dc.ia().model(a)}j(a){sl(a,this.D);for(const b of this.Fa)b.j(a);try{this.R.forEach(b=>b(a))}catch(b){throw Error(`Transaction compilation error: ${b.message}`);}}create(a,b){b=Bl(this,new olympe.dc.transaction.Fa.xo(a,b));const c=b.X();this.F.set(c,
|
|
890
|
+
olympe.dc.fa(a));let d;this.persist(c,null!=(d=this.D.get(c))?d:this.Y);return b}persist(a,b=!0){const c=olympe.dc.fa(a);var d=olympe.dc.ia();this.D.set(c,b);if(b){let f;b=null!=(f=this.F.get(c))?f:d.model(c);if(null===b)throw Error(`Try to persist an instance that does not exist: ${c}`);var e;d=null!=(e=d.source(a))?e:olympe.dc.ae().fromModel(b);Bl(this,new olympe.dc.transaction.Fa.xv(c,d))}else{if((e=d.Ha(c))&&d.Le(c))throw Error(`Try to remove persistence of an instance already persisted: ${c}`);
|
|
891
|
+
if(!e&&!this.F.has(c))throw Error(`Try to remove persistence of an instance that does not exist and is not part of the transaction: ${c}`);}return this}delete(a,b=olympe.dc.Lb.Dc){Bl(this,new olympe.dc.transaction.Fa.Ko(a,b))}update(a,b,c){return Bl(this,new olympe.dc.transaction.Fa.xw(a,b,c))}Oa(a,b,c){Bl(this,new olympe.dc.transaction.Fa.Bl(a,b,c))}hc(a,b,c){Bl(this,new olympe.dc.transaction.Fa.It(a,b,c))}Zm(a,b){Bl(this,new olympe.dc.transaction.Fa.Jo(a,b))}defineProperty(a,b,c,d,e,f){d=this.create(olympe.dm.Property,
|
|
892
892
|
f);Y(d,olympe.dc.CloudObject.nameProp,c||'');void 0!==e&&this.update(a,olympe.dc.de.Se+d.X(),e);this.Oa(olympe.dc.CloudObject.propertyRel,a,d);this.Oa(olympe.dm.Property.typeRel,d,b);this.Oa(olympe.dc.CloudObject.containsRel,a,d);return d}Xr(a,b,c='',{eE:d=olympe.dm.Relation.H.hv,qE:e=olympe.dm.Relation.j.Fv,lE:f=olympe.dm.Relation.j.ft,OE:g=olympe.dm.Relation.j.yp,bE:h=olympe.dm.ll.NONE,NE:k=olympe.dm.Relation.N|h}={},l=olympe.V.Ic()){c=Y(Y(Y(Y(Y(Y(Y(Y(Y(Y(this.create(olympe.dm.Relation,l),olympe.dc.CloudObject.nameProp,
|
|
893
|
-
c||''),olympe.dm.Relation.D,d),olympe.dm.Relation.F,k),olympe.dm.Relation.da,e),olympe.dm.Relation.ua,e),olympe.dm.Relation.$,e),olympe.dm.Relation.Y,f),olympe.dm.Relation.ha,g),olympe.dm.Relation.Ga,olympe.dm.Relation.j.yp),olympe.dm.Relation.R,h);this.Oa(olympe.dc.CloudObject.yj,a,c);this.Oa(olympe.dm.Relation.destinationModelRel,c,b);this.Oa(olympe.dc.CloudObject.containsRel,a,c);return c}kh(){return!1}Rm(a){this.$.push(olympe.C.Xa().rc(a))}nb(a,b){
|
|
894
|
-
|
|
895
|
-
function
|
|
896
|
-
function
|
|
897
|
-
function
|
|
898
|
-
function
|
|
899
|
-
f.j,g),n=olympe.C.Xa().rc((q,r)=>c(null!==q,r)),p=[l,n];
|
|
900
|
-
function
|
|
893
|
+
c||''),olympe.dm.Relation.D,d),olympe.dm.Relation.F,k),olympe.dm.Relation.da,e),olympe.dm.Relation.ua,e),olympe.dm.Relation.$,e),olympe.dm.Relation.Y,f),olympe.dm.Relation.ha,g),olympe.dm.Relation.Ga,olympe.dm.Relation.j.yp),olympe.dm.Relation.R,h);this.Oa(olympe.dc.CloudObject.yj,a,c);this.Oa(olympe.dm.Relation.destinationModelRel,c,b);this.Oa(olympe.dc.CloudObject.containsRel,a,c);return c}kh(){return!1}Rm(a){this.$.push(olympe.C.Xa().rc(a))}nb(a,b){El(olympe.dc.tj(),this,Dl(this,a),b)}$m(a){a=
|
|
894
|
+
Dl(this,a);Fl(olympe.dc.tj(),this,a,!0)}toString(){return`Transaction #${this.id}`}};olympe.dc.Wa.xa=[olympe.dc.Lc];function ol(a){var b=olympe.dc.tj();const c=a.T();b.H.set(c,a);return(d,e,f)=>{const g=new olympe.dc.db.ec(c);g.Wc(d,(new Map).set(e,f),b.db.model(d));b.j.Tc(rf(g,Infinity))}}
|
|
895
|
+
function pl(a,b,c,d){var e=olympe.dc.tj();const f=olympe.dc.Request.j.si,g=olympe.dc.Request.j.oh,h=a.T();a=a.kh();const k=new Map;for(const l of b.keys()){const n=e.db.source(l);if(n===olympe.dc.Ja.SELF||!e.db.Le(l))continue;let p=k.get(n);p||(p=new olympe.dc.db.ec(h),k.set(n,p));p.Wc(l,b.get(l),e.db.model(l))}for(const [l,n]of k)b=new olympe.dc.Request(c?g:f,l,new olympe.dc.transaction.aj(n,a)),b=e.Tb.request(b).catch(p=>null==d?void 0:d(!1,`${p}`)),c&&b.then(p=>{e.j.Tc(rf(n,p));null==d||d(!0)})}
|
|
896
|
+
function El(a,b,c,d){if(d){const e=b.T();a.D.set(e,c);Fl(a,b,(f,g)=>{f||(a.D.delete(e),c(f,g))},!1)}else Fl(a,b,c,!1)}function Gl(a){const b=olympe.dc.Request.j.Xj;zf(a.Tb,olympe.dc.Request.j.Zn,c=>{var d=c.content;c=d.rollback;d=d.error;const e=c.T(),f=a.H.get(e);void 0!==f&&(a.H.delete(e),f.Mb(d));a.j.Tc(c);a.G.warn(`Burst update (id=${e}) has been refused and is rolled back. Error: ${d}`)});zf(a.Tb,b,c=>{c=c.content;Hl(a,c.id,c.finalize,c.error)})}
|
|
897
|
+
function Il(a,b,c){if(!c)throw Error('Transaction compiler id is required');a.ua.has(c)||a.$.push(b);return a}
|
|
898
|
+
function Fl(a,b,c,d=!1){const e=b.T(),f=new olympe.dc.transaction.wv(a.db,a.ha,e);try{b.j(f)}catch(q){if(q instanceof olympe.dc.kq){q.j.then(()=>Fl(a,b,c,d));return}c(!1,q.message);return}if(f.jf()){c(!0);var g;null==(g=a.D.get(e))||g(!0);a.D.delete(e)}else{a.F.set(e,[]);var h=tl(f);a.j.je(h,olympe.dc.db.Instance.j.TRANSACTION);g=h.filter(q=>Z(f,q));var k=ul(f).filter(q=>a.db.Le(q)&&a.db.Ob(q,olympe.dm.File)&&a.db.source(q)!==olympe.dc.Ja.SERVER).map(q=>[q,a.db.model(q),a.db.source(q)]),l=ug(a.j,
|
|
899
|
+
f.j,g),n=olympe.C.Xa().rc((q,r)=>c(null!==q,r)),p=[l,n];Jl(a,f,g).then(q=>{p.splice(1,0,q);Kl(a,e,h,f.D.size+1);return Ll(a,f.D,d,b.kh(),b.N)}).then(q=>Promise.allSettled(k.map(([r,t,u])=>a.N.ua(r,t,u))).then(r=>{r.forEach(t=>{'rejected'===t.status&&a.G.warn('Some binary files have not been deleted after the transaction:',t.reason)});return q})).then(q=>{p.forEach(r=>r(q));Hl(a,e,olympe.dc.transaction.Ff.j.Ni)}).catch(q=>{a.G.error(q);p.forEach(r=>r(null,`${q}`));Ml(a,e)})}}
|
|
900
|
+
function Jl(a,b,c){const d=b.j,e=olympe.dm.File.urlProp.X();c=c.filter(n=>{let p;return a.db.Ob(n,olympe.dm.File)&&void 0!==(null==(p=d.Qc(n))?void 0:p.Qa(e))}).map(olympe.dc.CloudObject.get);if(0===c.length)return Promise.resolve(()=>{});const f=olympe.dm.File.j.X(),g=olympe.dm.File.modificationDateProp.X(),h=Array.from(b.D.values()),k=[],l=olympe.V.ef();return Promise.all(c.map(n=>{const p=n.get(e);if(p.startsWith('blob:'))return l.F(p).then(q=>new Promise((r,t)=>{if(null===q)URL.revokeObjectURL(p),
|
|
901
901
|
r();else{var u=n.X(),x,y=null!=(x=n.get(olympe.dm.File.mimeTypeProp))?x:'application/data';a.N.ha(u,q,y,z=>{const A=h.reduce((K,X)=>K||X.Qc(u),null);null!==A&&(z=(new Map).set(e,z).set(f,!0).set(g,new Date),A.Qm(z),k.push([u,z]));URL.revokeObjectURL(p);r()},t)}}));2048<p.length&&a.G.error('Trying to create a file with an URL longer than 2048. It likely is a data url and should be an object url. File tag:',n.X());return Promise.resolve([])})).then(()=>{const n=k.reduce((p,[q,r])=>{p.Wc(q,r);return p},
|
|
902
|
-
new olympe.dc.db.ec);return ug(a.j,n)})}function
|
|
903
|
-
function
|
|
904
|
-
function
|
|
905
|
-
olympe.dc.transaction.Ff=class{constructor(a,b,c,d,e,f,g){this.G=a;this.j=b;this.db=b.view;this.Tb=c;this.ha=d;this.N=e;this.da=f;this.R=g.get('notificationTimeout');this.$=[];let h;this.ua=new Set(null!=(h=g.get('disabledCompilers'))?h:[]);this.H=new olympe.V.Nh(g.get('burstHoldTime'));this.F=new Map;this.Y=[];this.D=new Map;this.Ga=new olympe.V.promise.Bm;
|
|
902
|
+
new olympe.dc.db.ec);return ug(a.j,n)})}function Kl(a,b,c,d){const e=olympe.C.ah(),f=new olympe.async.mk(e);0<a.R&&f.In(a.R);const g=olympe.dc.transaction.Ff.j.dv;let h=!0;const k=a.F.get(b);for(let l=0;l<d;l++)f.add((n,p)=>{k.push(e.rc((q,r)=>{h&&(h=q!==g);r?p(r):n()}))});bd(f,(l,n)=>{l||a.G.warn(`An error occurred while processing the notification of transaction (${b}): ${n}.`);h&&a.j.detach(c,olympe.dc.db.Instance.j.TRANSACTION);Ml(a,b)});f.start()}
|
|
903
|
+
function Ll(a,b,c,d,e){if(c&&olympe.C.Pa(a.da.D)!==olympe.auth.Ta.j.mf)return Promise.reject('Cannot persist with batch transactions API if not authenticated (aka: `Transaction.executeAsLarge()`).');const f=c?olympe.dc.Request.j.Vg:olympe.dc.Request.j.Ze;return Promise.all(Array.from(b).map(([g,h])=>{g=new olympe.dc.Request(f,g,new olympe.dc.transaction.aj(h,d,e));return a.Tb.request(g)})).then(g=>g[0])}
|
|
904
|
+
function Hl(a,b,c,d){let e,f;null==(f=null==(e=a.F.get(b))?void 0:e.pop())||f(c,null!=d?d:null)}function Ml(a,b){var c;null==(c=a.F.get(b))||c.forEach(d=>{d(olympe.dc.transaction.Ff.j.Ni,null)});a.F.delete(b);if(0===a.F.size){for(const d of a.Y)d();a.Y=[]}a.D.has(b)&&(c=a.D.get(b),a.D.delete(b),c(!0))}
|
|
905
|
+
olympe.dc.transaction.Ff=class{constructor(a,b,c,d,e,f,g){this.G=a;this.j=b;this.db=b.view;this.Tb=c;this.ha=d;this.N=e;this.da=f;this.R=g.get('notificationTimeout');this.$=[];let h;this.ua=new Set(null!=(h=g.get('disabledCompilers'))?h:[]);this.H=new olympe.V.Nh(g.get('burstHoldTime'));this.F=new Map;this.Y=[];this.D=new Map;this.Ga=new olympe.V.promise.Bm;Gl(this)}ne(a){qb(this.Ga,()=>this.Tb.request(new olympe.dc.Request(olympe.dc.Request.j.hp,olympe.dc.Ja.SERVER)).then(b=>{a(b.ids,b.undo_stack_size,
|
|
906
906
|
b.redo_stack_size)}).catch(b=>this.G.error('Failed to process get stack request',b))).then(()=>{})}};olympe.dc.transaction.Ff.j={fm:0,Ni:1,dv:2};olympe.dc.transaction.aj=class{constructor(a,b=!1,c=!1){this.D=a;this.F=b;this.j=c}kh(){return this.F}jc(){return this.D}};olympe.dc.transaction.P={Ca:'dc.transaction.Logger',Da:'dc.transaction.Manager'};olympe.dc.transaction.U={bq:'dc.transaction.timeout',Yn:'dc.transaction.burstInterval',Il:'dc.transaction.disabledCompilers'};
|
|
907
907
|
olympe.W.config(function(a){F(a,olympe.dc.transaction.U.bq,9E4);F(a,olympe.dc.transaction.U.Yn,30);F(a,olympe.dc.transaction.U.Il,[]);E(a,olympe.dc.transaction.P.Ca,[olympe.ja.P.Da],b=>b.cd('dc'));E(a,'olympe.dc.transaction.Config',[new olympe.W.pa(olympe.dc.transaction.U.bq),new olympe.W.pa(olympe.dc.transaction.U.Il),new olympe.W.pa(olympe.dc.db.U.xl)],(b,c,d)=>new Map([['notificationTimeout',b],['disabledCompilers',c],['burstHoldTime',d]]));D(a,olympe.dc.transaction.P.Da,olympe.dc.transaction.Ff,
|
|
908
|
-
olympe.dc.transaction.P.Ca,olympe.dc.db.P.Da,olympe.dc.P.Ng,olympe.dc.sources.P.We,olympe.dc.P.Vj,olympe.auth.P.Da,'olympe.dc.transaction.Config')},'olympe.dc.transaction');olympe.dc.transaction.Fa={};function
|
|
908
|
+
olympe.dc.transaction.P.Ca,olympe.dc.db.P.Da,olympe.dc.P.Ng,olympe.dc.sources.P.We,olympe.dc.P.Vj,olympe.auth.P.Da,'olympe.dc.transaction.Config')},'olympe.dc.transaction');olympe.dc.transaction.Fa={};function Nl(a,b){const c=new Map;for(const [d,e]of b)c.set(d,a.Pa(e));return c}olympe.dc.transaction.Fa.ug=class{constructor(){this.ia=olympe.dc.ia()}j(){throw Error('Abstract method build() not override !');}toString(){throw Error('Abstract method toString() not override !');}Pa(a){a=olympe.C.Pa(a);return void 0===a||null===a?null:olympe.C.ys(a)?a.valueOf():a}};olympe.dc.transaction.Fa.ug.xa=[olympe.dc.Lc];olympe.dc.transaction.Fa.Rn=class extends olympe.dc.transaction.Fa.ug{constructor(a,b){super();this.relation=a instanceof olympe.dc.Ra.Relation?a:new olympe.dc.Ra.Relation(olympe.dc.fa(a));this.origin=this.ia.Ha(b)?olympe.dc.CloudObject.get(b):b}getType(){return this.relation.X()}Ka(){return this.relation.Ka()}j(){throw Error('Abstract method build() not override !');}toString(){throw Error('Abstract method toString() not override !');}};function Y(a,b,c){a.Gd.set(olympe.dc.fa(b),c);return a}olympe.dc.transaction.Fa.xo=class extends olympe.dc.transaction.Fa.ug{constructor(a,b){super();let c;this.tag=null!=(c=b&&olympe.dc.fa(b))?c:olympe.V.df();this.model=olympe.dc.fa(a);this.source=null;this.Gd=new Map}X(){return this.tag}ac(){return this.model}ki(a){this.source=a;return this}j(a){const b=this.ac(),c=this.X();if(!b)throw Error('OperationError: Cannot create instance, model tag is undefined');a.Oc(c,b,this.source,Nl(this,this.Gd))}toString(){return`CreateInstance(${this.ac()}, ${this.X()})`}};
|
|
909
909
|
olympe.dc.transaction.Fa.xo.xa=[olympe.dc.Te];olympe.dc.transaction.Fa.Bl=class extends olympe.dc.transaction.Fa.Rn{constructor(a,b,c){super(a,b);this.D=this.ia.Ha(c)?olympe.dc.CloudObject.get(c):c}j(a){const b=this.getType();if(''===b)throw Error('OperationError: Cannot create relation, type is undefined, null or empty string');if(b===olympe.dc.fc.Yc)throw Error('OperationError: Cannot create the instance -> model relation');if(!this.origin)throw Error('OperationError: Cannot create relation, origin tag is undefined, null or empty string');
|
|
910
910
|
if(!this.D)throw Error('OperationError: Cannot create relation, destination tag is undefined, null or empty string');this.relation.Ka()===olympe.dc.va.DESTINATION?a.Oa(b,olympe.dc.fa(this.origin),olympe.dc.fa(this.D)):a.Oa(b,olympe.dc.fa(this.D),olympe.dc.fa(this.origin))}toString(){return`CreateRelation('${this.relation.Ka()}${this.relation.X()}, ${olympe.dc.fa(this.origin)}, ${olympe.dc.fa(this.D)})`}};olympe.dc.transaction.Fa.vA=class extends olympe.dc.transaction.Fa.ug{constructor(a,b=olympe.dc.Lb.Dc){super();this.model=a instanceof olympe.dc.CloudObject?a:olympe.dc.CloudObject.get(a);this.Pb=b}j(a){for(const b of this.ia.Rc(this.model))b!==olympe.dc.fa(this.model)&&(new olympe.dc.transaction.Fa.Ko(b,this.Pb)).j(a)}toString(){return`DeleteAllInstances(${this.model.X()}, ${this.Pb})`}};olympe.dc.transaction.Fa.Jo=class extends olympe.dc.transaction.Fa.Rn{j(a){const b=this.getType();if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.fc.Yc)throw Error('OperationError: Cannot delete the instance -> model relation');const c=olympe.dc.fa(this.origin);if(!this.origin)throw Error('OperationError: Cannot delete relation, left tag is undefined');const d=this.Ka(),e=this.ia.bb(c,this.relation);for(const f of e)d===olympe.dc.va.DESTINATION?
|
|
911
|
-
a.hc(b,c,f):a.hc(b,f,c)}toString(){return`DeleteAllRelations(${this.Ka()}${this.getType()})`}};olympe.dc.transaction.Fa.Ko=class extends olympe.dc.transaction.Fa.ug{constructor(a,b=olympe.dc.Lb.Dc){super();this.tag=this.ia.Ha(a)?olympe.dc.CloudObject.get(a):a;this.Pb=b}X(){return olympe.dc.fa(this.tag)}j(a){const b=this.X();if(void 0===b)throw Error('OperationError: Cannot delete instance, tag is undefined');this.ia.Ha(b)&&
|
|
912
|
-
this.relation.Ka()===olympe.dc.va.DESTINATION?a.hc(b,c,d):a.hc(b,d,c)}toString(){return'DeleteRelation('+this.relation.Ka()+this.relation.X()+', '+olympe.dc.fa(this.origin)+', '+olympe.dc.fa(this.D)+')'}};olympe.dc.transaction.Fa.xw=class extends olympe.dc.transaction.Fa.ug{constructor(a,b,c){super();this.tag=this.ia.Ha(a)?olympe.dc.CloudObject.get(a):a;this.Gd=new Map;void 0!==b&&this.Gd.set(olympe.dc.fa(b),c)}X(){return olympe.dc.fa(this.tag)}j(a){const b=this.X();if(void 0===b)throw Error('OperationError: Cannot update instance, tag is undefined');var c;if(!(null!=(c=a.j.Qc(b))&&c.D()||this.ia.Ha(b)))throw Error('OperationError: Instance #'+b+' not found so it cannot be updated');c=
|
|
913
|
-
for(const [e,f]of c){var d=this.ia.Qa(b,e,!0);d instanceof olympe.dc.uc&&
|
|
911
|
+
a.hc(b,c,f):a.hc(b,f,c)}toString(){return`DeleteAllRelations(${this.Ka()}${this.getType()})`}};olympe.dc.transaction.Fa.Ko=class extends olympe.dc.transaction.Fa.ug{constructor(a,b=olympe.dc.Lb.Dc){super();this.tag=this.ia.Ha(a)?olympe.dc.CloudObject.get(a):a;this.Pb=b}X(){return olympe.dc.fa(this.tag)}j(a){const b=this.X();if(void 0===b)throw Error('OperationError: Cannot delete instance, tag is undefined');this.ia.Ha(b)&&wl(a,b,this.Pb)}toString(){return'DeleteInstance('+this.X()+', '+this.Pb+')'}};olympe.dc.transaction.Fa.It=class extends olympe.dc.transaction.Fa.Bl{j(a){const b=this.relation.X();if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.fc.Yc)throw Error('OperationError: Cannot delete the instance -> model relation');const c=olympe.dc.fa(this.origin);if(void 0===c)throw Error('OperationError: Cannot delete relation, left tag is undefined');const d=olympe.dc.fa(this.D);if(void 0===d)throw Error('OperationError: Cannot delete relation, right tag is undefined');
|
|
912
|
+
this.relation.Ka()===olympe.dc.va.DESTINATION?a.hc(b,c,d):a.hc(b,d,c)}toString(){return'DeleteRelation('+this.relation.Ka()+this.relation.X()+', '+olympe.dc.fa(this.origin)+', '+olympe.dc.fa(this.D)+')'}};olympe.dc.transaction.Fa.xw=class extends olympe.dc.transaction.Fa.ug{constructor(a,b,c){super();this.tag=this.ia.Ha(a)?olympe.dc.CloudObject.get(a):a;this.Gd=new Map;void 0!==b&&this.Gd.set(olympe.dc.fa(b),c)}X(){return olympe.dc.fa(this.tag)}j(a){const b=this.X();if(void 0===b)throw Error('OperationError: Cannot update instance, tag is undefined');var c;if(!(null!=(c=a.j.Qc(b))&&c.D()||this.ia.Ha(b)))throw Error('OperationError: Instance #'+b+' not found so it cannot be updated');c=Nl(this,this.Gd);
|
|
913
|
+
for(const [e,f]of c){var d=this.ia.Qa(b,e,!0);d instanceof olympe.dc.uc&&wl(a,d.X(),olympe.dc.Lb.Dc);f instanceof olympe.dc.uc&&!Z(a,f.X())&&(d=new olympe.dc.Wa,d.persist(f.X()),d.j(a))}a.Wc(b,c)}toString(){return'UpdateInstance('+this.X()+', '+Nl(this,this.Gd)+')'}};olympe.dc.transaction.Fa.xv=class a extends olympe.dc.transaction.Fa.ug{constructor(b,c){super();this.tag=b;this.source=c}j(b){const c=olympe.dc.ia();if(Z(b,this.tag)&&c.Ha(this.tag)&&!c.Le(this.tag)){const e=c.Db(this.tag,!0);var d;let f;null==(f=null==(d=b.j.Qc(this.tag))?void 0:d.Db())||f.forEach((g,h)=>{e.set(h,g)});for(const g of e.values())g instanceof olympe.dc.uc&&c.Ha(g.X())&&(new a(g.X(),this.source)).j(b);d=c.model(this.tag);b.Oc(this.tag,d,this.source,e);for(const [g,h,k]of Yg(c,this.tag))Z(b,
|
|
914
914
|
k)&&(h===olympe.dc.va.ORIGIN?b.Oa(g,k,this.tag):b.Oa(g,this.tag,k))}}toString(){return`PersistOperation: tag - ${this.tag}, src - ${this.source}`}};olympe.dc.fa=function(a){let b=null;if('string'===typeof a)return a;if('function'===typeof(null==a?void 0:a.X)&&(null==a||!a.Xg))b=a.X();else if('function'===typeof a){let d;b=null!=(d=olympe.dc.na.ac(a))?d:''}else if(olympe.C.kf(a)){let d;b=olympe.dc.fa(null==(d=olympe.C.Pa(a))?void 0:d.valueOf())}let c;return null!=(c=b)?c:''};B('olympe.dc.instanceToTag',olympe.dc.fa);olympe.dc.ia=function(){return olympe.dc.gs().view};olympe.dc.register=function(a,b){olympe.dc.na.j(a,b)};
|
|
915
915
|
olympe.dc.defineProperty=function(a){return new olympe.dc.Ra.Property(a)};olympe.dc.Xr=function(a,b=olympe.dc.va.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.va.DESTINATION){const e=olympe.dc.va.DESTINATION;return b===olympe.dc.va.ORIGIN||b===e?new olympe.dc.Ra.Relation(a,b):new olympe.dc.Ra.Relation(a,d,b,c)};olympe.dc.gx=function(a){return a.$b()};olympe.dc.mb={};olympe.dc.mb.Xm=a=>'string'===typeof a||'number'===typeof a||'boolean'===typeof a||a instanceof String?olympe.C.xb(a):a instanceof olympe.C.Sa?a:null;olympe.dc.mb.Um=a=>'boolean'===typeof a||a instanceof Boolean?olympe.C.Sb(a):a instanceof olympe.C.ea?a:null;olympe.dc.mb.Wm=a=>'number'===typeof a||a instanceof Number?olympe.C.ra(a):'string'===typeof a||a instanceof String?olympe.C.ra(Number.parseFloat(a.valueOf())):a instanceof olympe.C.aa?a:null;
|
|
916
916
|
olympe.dc.mb.Vm=a=>'number'===typeof a||a instanceof Number?ic(a.valueOf()):'string'===typeof a||a instanceof String?new olympe.C.eb(new Date(a.valueOf().valueOf())):a instanceof Date?new olympe.C.eb(a):a instanceof olympe.C.eb?a:null;olympe.dc.mb.Sr=function(a){return a instanceof olympe.C.Color?a:'string'===typeof a||a instanceof String?mc(a.valueOf()):null};olympe.dc.mb.Tr=a=>a instanceof olympe.dc.CloudObject?a:a instanceof olympe.dc.uc?olympe.dc.CloudObject.get(a.tag):null;
|
|
917
917
|
olympe.dc.mb.ij=a=>a instanceof olympe.dc.uc?olympe.dc.CloudObject.get(a.tag):a;olympe.dc.mb.Bc=a=>{a=a instanceof olympe.dc.uc?olympe.dc.CloudObject.get(a.tag):a;let b;return null!=(b=a instanceof olympe.dc.CloudObject?a.Bc():a)?b:null};
|
|
918
|
-
olympe.dc.mb.Bx=a=>{switch(a){case olympe.C.ea:return olympe.dc.mb.Um;case olympe.C.Sa:return olympe.dc.mb.Xm;case olympe.C.aa:return olympe.dc.mb.Wm;case olympe.C.eb:return olympe.dc.mb.Vm;case olympe.C.Color:return olympe.dc.mb.Sr;case olympe.dc.CloudObject:return olympe.dc.mb.Tr;default:return olympe.dc.mb.ij}};olympe.dc.kc={};olympe.dc.sf=class{la(){}F(){}compare(){}H(){}ga(){}toString(){}};function
|
|
919
|
-
olympe.dc.za=class{constructor(a,b,c){void 0===a||null===a?olympe.ja.ab('dc').warn('attempt to create a listdef with a null or undefind basetag. This listdef is thus without effect.'):(this.D=olympe.C.ta([a],olympe.dc.fa,String),this.ba=void 0!==b&&(Array.isArray(b)?b:[b])||[],this.valueType=c||
|
|
918
|
+
olympe.dc.mb.Bx=a=>{switch(a){case olympe.C.ea:return olympe.dc.mb.Um;case olympe.C.Sa:return olympe.dc.mb.Xm;case olympe.C.aa:return olympe.dc.mb.Wm;case olympe.C.eb:return olympe.dc.mb.Vm;case olympe.C.Color:return olympe.dc.mb.Sr;case olympe.dc.CloudObject:return olympe.dc.mb.Tr;default:return olympe.dc.mb.ij}};olympe.dc.kc={};olympe.dc.sf=class{la(){}F(){}compare(){}H(){}ga(){}toString(){}};function Ol(a){let b=null;for(a=[...a.ba];null===b&&0<a.length;)b=a.pop().Nb();return b}function Pl(a,b){a.R()||(a=`Calling "${b}" on subscription with id ${a.T()} while it is not ready (thus no data is available).`+'This call should be made within an onReady callback. You can also consider to use Queries API instead of ListDefs (which are deprecated)',olympe.ja.ab('dc').warn(a))}
|
|
919
|
+
olympe.dc.za=class{constructor(a,b,c){void 0===a||null===a?olympe.ja.ab('dc').warn('attempt to create a listdef with a null or undefind basetag. This listdef is thus without effect.'):(this.D=olympe.C.ta([a],olympe.dc.fa,String),this.ba=void 0!==b&&(Array.isArray(b)?b:[b])||[],this.valueType=c||Ol(this),this.j=null,this.Ac=void 0)}me(){return olympe.dc.me()}nb(){if(null===this.j){const a=olympe.dc.kc.Zx();this.j=Ql(a,this,this.Ac);null!==this.valueType&&this.j.Md(this.valueType);olympe.C.Xa().Td(()=>
|
|
920
920
|
{var b=this.j.T();a.G.debug('QueryMGR: [ID:',b,'] - Unregistered');const c=a.j.get(b);if(null==c)var d=0;else 0<c.counter&&c.counter--,d=0===c.counter;d&&(c.j.release(),a.j.delete(b));this.j=null})}return this}mc(){null===this.j&&this.nb();return this.j}Md(a){this.valueType=a;null!==this.j&&this.j.Md(this.valueType)}Nb(){return null!==this.j?this.j.Nb():null===this.valueType?olympe.dc.CloudObject:this.valueType}Yd(){return this.D}Xl(){return this.ba}hd(a,b){return this.mc().hd(a,b)}bl(a){this.mc().bl(a)}tu(){return this.mc().Id()}su(){return this.mc().R()}get(a){return this.mc().get(a)}hi(){return this.mc().hi()}fi(a){const b=
|
|
921
|
-
this.mc();
|
|
922
|
-
this.mc();
|
|
923
|
-
if(c instanceof olympe.dc.Ra.Property)throw Error(`ListDef.transform(): Properties cannot be used as transformer, unlike relations ${c}`);if(!c||'function'!==typeof c.j)break;a.push(c)}b=new olympe.dc.za(this.D,a);b.Ac=this.Ac;b.Md(
|
|
921
|
+
this.mc();Pl(b,'getCurrent');return b.fi(a)}has(a){return this.mc().has(a)}ih(a){const b=this.mc();Pl(b,'hasCurrent');return b.ih(a)}le(a){return this.mc().le(a)}cz(a){return this.le(a).asObservable()}gf(a){const b=this.mc();Pl(b,'getCurrentAt');return b.gf(a)}hf(a){return this.mc().hf(a)}Mf(a){const b=this.mc();Pl(b,'getCurrentKeyAt');return b.Mf(a)}Dd(a){return this.mc().Dd(a)}hz(a){return this.Dd(a).asObservable()}Nf(a){const b=this.mc();Pl(b,'getCurrentRank');return b.Nf(a)}Gc(){return this.mc().Gc()}dz(){return this.Gc().asObservable()}Of(){return this.mc().Of()}xf(){return this.mc().xf()}iz(){return this.xf().asObservable()}og(){const a=
|
|
922
|
+
this.mc();Pl(a,'getCurrentSize');return a.og()}forEach(a,b){this.mc().forEach(a,b)}ke(a){const b=this.mc();Pl(b,'forEachCurrentValue');return b.ke(a)}lj(a,b,c,d){a=new olympe.dc.ba.Bh(a,b);(new olympe.dc.za(this.D,[...this.ba,a],this.valueType)).forEach(c,d)}transform(...a){var b=a;if(Array.isArray(a[0])){if(1<a.length)throw Error('ListDef.transform() should be called either with one array argument, or with ... arguments, but not both');b=a[0]}a=[...this.ba];for(const c of b){if(void 0===c)throw Error('ListDef.transform(): Trying to set an undefined transformer');
|
|
923
|
+
if(c instanceof olympe.dc.Ra.Property)throw Error(`ListDef.transform(): Properties cannot be used as transformer, unlike relations ${c}`);if(!c||'function'!==typeof c.j)break;a.push(c)}b=new olympe.dc.za(this.D,a);b.Ac=this.Ac;b.Md(Ol(b)||this.valueType||Object);return b}gl(a){return this.transform(new olympe.dc.ba.Hf(a))}filter(a){return this.transform(new olympe.dc.ba.uf(a))}Jk(){const a=new olympe.dc.ck(this.D,null===this.valueType?void 0:this.valueType);'boolean'===typeof this.Ac&&(a.Ac=this.Ac);
|
|
924
924
|
let b=this.ba;b instanceof Array||(b=b?[b]:[]);a.transform(b);return a}toString(){let a=this.ba;a=a?', '+(a.join?a.join(', '):a.toString()):'';return'ListDef(#'+olympe.C.Pa(this.D)+a+')'}ru(){return this.mc().Eg()}Uc(){return olympe.C.ta([this.xf()],a=>{let b='[';for(let c=0;c<a;c++){const d=this.gf(c).toString();b=0<c&&c<a?b+(', '+d):b+d}return olympe.C.xb(b+']')},olympe.C.Sa)}};olympe.dc.za.prototype.filter=olympe.dc.za.prototype.filter;olympe.dc.za.prototype.union=olympe.dc.za.prototype.gl;
|
|
925
925
|
olympe.dc.za.prototype.transform=olympe.dc.za.prototype.transform;olympe.dc.za.prototype.forEachCurrentValue=olympe.dc.za.prototype.ke;olympe.dc.za.prototype.forEach=olympe.dc.za.prototype.forEach;olympe.dc.za.prototype.getCurrentSize=olympe.dc.za.prototype.og;olympe.dc.za.prototype.observeSize=olympe.dc.za.prototype.iz;olympe.dc.za.prototype.observeFirst=olympe.dc.za.prototype.dz;olympe.dc.za.prototype.getCurrentRank=olympe.dc.za.prototype.Nf;olympe.dc.za.prototype.observeRank=olympe.dc.za.prototype.hz;
|
|
926
926
|
olympe.dc.za.prototype.getCurrentAt=olympe.dc.za.prototype.gf;olympe.dc.za.prototype.observeAt=olympe.dc.za.prototype.cz;olympe.dc.za.prototype.offReady=olympe.dc.za.prototype.bl;olympe.dc.za.prototype.onReady=olympe.dc.za.prototype.hd;olympe.dc.za.prototype.getBaseTag=olympe.dc.za.prototype.Yd;olympe.dc.za.xa=[olympe.C.qd];m=olympe.dc.za.prototype;m.me.K=olympe.C.J.j;m.nb.K=olympe.C.J.H();m.mc.K=new olympe.C.J(()=>olympe.dc.kc.Subscription,[]);m.Md.K=new olympe.C.J(()=>{},[]);
|
|
927
927
|
m.Yd.K=new olympe.C.J(()=>String,[]);m.Xl.K=new olympe.C.J(()=>Array,[]);m.hd.K=new olympe.C.J(()=>String,[]);m.bl.K=new olympe.C.J(()=>{},[]);m.tu.K=olympe.C.J.N;m.su.K=olympe.C.J.j;m.get.K=new olympe.C.J(()=>olympe.dc.CloudObject,[],'valueType');m.hi.K=new olympe.C.J(()=>Array,[]);m.fi.K=olympe.C.J.j;m.has.K=olympe.C.J.N;m.ih.K=olympe.C.J.j;m.le.K=new olympe.C.J(()=>olympe.dc.CloudObject,[],'valueType');m.gf.K=olympe.C.J.j;m.hf.K=new olympe.C.J(()=>String,[]);m.Mf.K=olympe.C.J.j;m.Dd.K=olympe.C.J.F;
|
|
928
|
-
m.Nf.K=olympe.C.J.j;m.Gc.K=new olympe.C.J(()=>olympe.dc.CloudObject,[],'valueType');m.Of.K=new olympe.C.J(()=>String,[]);m.xf.K=olympe.C.J.F;m.og.K=olympe.C.J.j;m.forEach.K=new olympe.C.J(()=>{},[]);m.ke.K=olympe.C.J.j;m.lj.K=new olympe.C.J(()=>{},[]);m.transform.K=new olympe.C.J(()=>olympe.dc.za,[]);m.gl.K=new olympe.C.J(()=>olympe.dc.za,[]);m.filter.K=new olympe.C.J(()=>olympe.dc.za,[]);m.Jk.K=new olympe.C.J(()=>olympe.dc.ck,[]);m.toString.K=olympe.C.J.j;m.ru.K=olympe.C.J.j;m.Uc.K=olympe.C.J.D;const
|
|
929
|
-
olympe.dc.ck=class{constructor(a,b){this.j=
|
|
930
|
-
d);if(!d||'function'!==typeof d.j)throw new
|
|
931
|
-
b,c){a=new olympe.dc.ba.Fe(a,a.Ka(),b,c);this.ba.push(a);this.valueType=a.Nb()||olympe.dc.CloudObject;return this}tx(a){const b=[];let c;for(let d=0;d<a.length;d++){const e=a[d];b.push(e.X());void 0===c&&(c=e.Ka())}a=new olympe.dc.ba.dk(b,c);this.ba.push(a);this.valueType=a.Nb()||olympe.dc.CloudObject;return this}uu(){this.fb(olympe.dc.CloudObject.instancesRel);return this}cf(a){var b=this.Fa.pop();b===
|
|
932
|
-
olympe.dc.Z.Jd?(b=b.Z,b.push(a),a=new olympe.dc.Z.Jd(...b)):a=new olympe.dc.Z.Jd(b,a);b=this.Fa.pop();break;case
|
|
933
|
-
c))}Ob(a){if(!(a instanceof Array))throw new
|
|
934
|
-
Array))throw new
|
|
935
|
-
return this.cf(b)}ud(){this.Fa.push(
|
|
936
|
-
new olympe.dc.wc.DateTime(new olympe.dc.Za.xi(a,c))}c=d;null!==c&&this.ba.push(new olympe.dc.ba.Tg(c,b));return this}sort(a,b,c){const d=new class extends olympe.dc.wc.tg{F(e,f){return a(olympe.dc.CloudObject.get(f))}compare(e,f){return b(e,f).valueOf()}};this.ba.push(new olympe.dc.ba.Tg(d,c));return this}kx(){this.ba.push(new olympe.dc.ba.yi);return this}vj(a,b){this.ba.push(new olympe.dc.ba.Bh(a,b));return this}};class
|
|
937
|
-
function
|
|
938
|
-
m.ox.K=olympe.C.J.H();m.contains.K=olympe.C.J.H();m.Ob.K=olympe.C.J.H();m.Xk.K=olympe.C.J.H();m.px.K=olympe.C.J.H();m.Dy.K=olympe.C.J.H();m.Vk.K=olympe.C.J.H();m.Cj.K=olympe.C.J.H();m.Vy.K=olympe.C.J.H();m.filter.K=olympe.C.J.H();m.ud.K=olympe.C.J.H();m.and.K=olympe.C.J.H();m.or.K=olympe.C.J.H();m.fl.K=olympe.C.J.H();m.sort.K=olympe.C.J.H();m.kx.K=olympe.C.J.H();m.vj.K=olympe.C.J.H();function
|
|
939
|
-
function
|
|
940
|
-
function
|
|
941
|
-
function
|
|
942
|
-
function
|
|
943
|
-
e=!0)
|
|
944
|
-
olympe.dc.kc.Tu=class{constructor(a,b,c,d,e,f){this.G=a;this.db=b;this.D=f||e;this.H=d;this.j=new Map;this.F=new olympe.C.Xb('Legacy ListDef processor')}process(a,b){const c=a.T();var d=this.j.get(c);d||(d=new olympe.dc.kc.dw(a),this.j.set(c,d));d.counter++;
|
|
945
|
-
|
|
928
|
+
m.Nf.K=olympe.C.J.j;m.Gc.K=new olympe.C.J(()=>olympe.dc.CloudObject,[],'valueType');m.Of.K=new olympe.C.J(()=>String,[]);m.xf.K=olympe.C.J.F;m.og.K=olympe.C.J.j;m.forEach.K=new olympe.C.J(()=>{},[]);m.ke.K=olympe.C.J.j;m.lj.K=new olympe.C.J(()=>{},[]);m.transform.K=new olympe.C.J(()=>olympe.dc.za,[]);m.gl.K=new olympe.C.J(()=>olympe.dc.za,[]);m.filter.K=new olympe.C.J(()=>olympe.dc.za,[]);m.Jk.K=new olympe.C.J(()=>olympe.dc.ck,[]);m.toString.K=olympe.C.J.j;m.ru.K=olympe.C.J.j;m.Uc.K=olympe.C.J.D;const Rl={Oz:'append',Ml:'filter_not',Wo:'filter_and',Xo:'filter_or'};function Sl(a,b){a=Tl(a);a=olympe.dc.CloudObject.get(a);return(new olympe.dc.Za.Sn(a,b)).D}
|
|
929
|
+
olympe.dc.ck=class{constructor(a,b){this.j=Tl(a);this.G=olympe.ja.ab('dc.query');this.valueType=void 0===b?olympe.dc.CloudObject:b;this.ba=[];this.Fa=[];this.Ac=void 0}Ki(){const a=new olympe.dc.za(this.j,this.ba,this.valueType);'boolean'===typeof this.Ac&&(a.Ac=this.Ac);return a}transform(a){for(let b=0,c=a.length,d;b<c;b++){d=a[b];if(void 0===d)throw new Ul('transform','Trying to set an undefined transformer');if(d instanceof olympe.dc.Ra.Property)throw new Ul('transform','Properties cannot be used as transformer, unlike relations '+
|
|
930
|
+
d);if(!d||'function'!==typeof d.j)throw new Ul('transform','one of the argument is not a Transformer '+d);const e=d.Nb();null!==e&&(this.valueType=e);this.ba.push(d)}return this}gl(a){this.ba.push(new olympe.dc.ba.Hf(a));return this}Mz(a){this.ba.push(new olympe.dc.ba.Hf(Tl(a)));return this}vu(a){this.valueType=a;return this}fb(a){this.ba.push(a);this.valueType=a.Nb()||olympe.dc.CloudObject;return this}vx(a){for(const b of a)this.ba.push(b),this.valueType=b.Nb()||olympe.dc.CloudObject;return this}ux(a,
|
|
931
|
+
b,c){a=new olympe.dc.ba.Fe(a,a.Ka(),b,c);this.ba.push(a);this.valueType=a.Nb()||olympe.dc.CloudObject;return this}tx(a){const b=[];let c;for(let d=0;d<a.length;d++){const e=a[d];b.push(e.X());void 0===c&&(c=e.Ka())}a=new olympe.dc.ba.dk(b,c);this.ba.push(a);this.valueType=a.Nb()||olympe.dc.CloudObject;return this}uu(){this.fb(olympe.dc.CloudObject.instancesRel);return this}cf(a){var b=this.Fa.pop();b===Rl.Ml&&(a=new olympe.dc.Z.fe(a),b=this.Fa.pop());switch(b){case Rl.Wo:b=this.ba.pop().D;b instanceof
|
|
932
|
+
olympe.dc.Z.Jd?(b=b.Z,b.push(a),a=new olympe.dc.Z.Jd(...b)):a=new olympe.dc.Z.Jd(b,a);b=this.Fa.pop();break;case Rl.Xo:b=this.ba.pop().D,b instanceof olympe.dc.Z.Be?(b=b.Z,b.push(a),a=new olympe.dc.Z.Be(...b)):a=new olympe.dc.Z.Be(b,a),b=this.Fa.pop()}b===Rl.Ml&&(a=new olympe.dc.Z.fe(a),this.Fa.pop());this.ba.push(new olympe.dc.ba.uf(a));return this}ox(a,b,c){return this.cf(new olympe.dc.Z.ve(Sl(a,c),new olympe.dc.Za.Re(b)))}contains(a,b,c=!1,d){return this.cf(new olympe.dc.Z.tf(Sl(a,d),new olympe.dc.Za.Re(b),
|
|
933
|
+
c))}Ob(a){if(!(a instanceof Array))throw new Ul('instanceOf','Provided argument "models" must be an array.');const b=[];for(let c=0;c<a.length;c++)b.push(Tl(a[c]));return this.cf(new olympe.dc.Z.Hi(b))}Xk(a){return this.cf(new olympe.dc.Z.ve(new olympe.dc.Za.$i,new olympe.dc.Za.Re(Tl(a))))}px(a){if(!Array.isArray(a))throw Error('ExcludeInstances should be called with an array');if(0<a.length){this.ud().Xk(a[0]);for(let b=1,c=a.length;b<c;b++)this.and().ud().Xk(a[b])}return this}Dy(a,b){if(!(a instanceof
|
|
934
|
+
Array))throw new Ul('hasRelated','Provided argument "relations" must be an array.');const c=[],d=[];a.forEach(e=>{c.push(e);d.push(e.Ka())});return this.cf(new olympe.dc.Z.Ei(c,d,b))}Vk(a,b,c){a=Sl(a,c);return this.cf(new olympe.dc.Z.Zj(a,new olympe.dc.Za.Re(b)))}Cj(a,b,c){a=Sl(a,c);return this.cf(new olympe.dc.Z.Ak(a,new olympe.dc.Za.Re(b)))}Vy(a,b,c,d){a=Sl(a,d);return this.cf(new olympe.dc.Z.Ef(a,b,c))}filter(a){const b=new class extends olympe.dc.Z.tg{j(c,d){return a(olympe.dc.CloudObject.get(d))}};
|
|
935
|
+
return this.cf(b)}ud(){this.Fa.push(Rl.Ml);return this}and(){this.ba[this.ba.length-1]instanceof olympe.dc.ba.uf&&this.Fa.push(Rl.Wo);return this}or(){this.ba[this.ba.length-1]instanceof olympe.dc.ba.uf&&this.Fa.push(Rl.Xo);return this}fl(a,b,c){a=Tl(a);let d=null;switch(olympe.dc.ia().Jb(a,olympe.dm.Property.typeRel)){case olympe.dm.String.O.X():d=new olympe.dc.wc.String(new olympe.dc.Za.Yi(a,c));break;case olympe.dm.Number.O.X():d=new olympe.dc.wc.Number(new olympe.dc.Za.Pi(a,c));break;case olympe.dm.DateTime.O.X():d=
|
|
936
|
+
new olympe.dc.wc.DateTime(new olympe.dc.Za.xi(a,c))}c=d;null!==c&&this.ba.push(new olympe.dc.ba.Tg(c,b));return this}sort(a,b,c){const d=new class extends olympe.dc.wc.tg{F(e,f){return a(olympe.dc.CloudObject.get(f))}compare(e,f){return b(e,f).valueOf()}};this.ba.push(new olympe.dc.ba.Tg(d,c));return this}kx(){this.ba.push(new olympe.dc.ba.yi);return this}vj(a,b){this.ba.push(new olympe.dc.ba.Bh(a,b));return this}};class Ul extends Error{constructor(a,b){super(`ListDefBuilder.${a}(): ${b}`)}}
|
|
937
|
+
function Tl(a){return'string'===typeof a||a instanceof olympe.C.Sa?a:'function'===typeof a?olympe.dc.na.ac(a):olympe.C.hb(a)?a.Sh===olympe.C.Sa?a:olympe.C.ta([a],b=>olympe.C.xb(olympe.dc.fa(b)),olympe.C.Sa):a.X()}m=olympe.dc.ck.prototype;m.Ki.K=new olympe.C.J(()=>olympe.dc.za,[]);m.transform.K=olympe.C.J.H();m.gl.K=olympe.C.J.H();m.Mz.K=olympe.C.J.H();m.vu.K=olympe.C.J.H();m.fb.K=olympe.C.J.H();m.vx.K=olympe.C.J.H();m.ux.K=olympe.C.J.H();m.tx.K=olympe.C.J.H();m.uu.K=olympe.C.J.H();m.cf.K=olympe.C.J.H();
|
|
938
|
+
m.ox.K=olympe.C.J.H();m.contains.K=olympe.C.J.H();m.Ob.K=olympe.C.J.H();m.Xk.K=olympe.C.J.H();m.px.K=olympe.C.J.H();m.Dy.K=olympe.C.J.H();m.Vk.K=olympe.C.J.H();m.Cj.K=olympe.C.J.H();m.Vy.K=olympe.C.J.H();m.filter.K=olympe.C.J.H();m.ud.K=olympe.C.J.H();m.and.K=olympe.C.J.H();m.or.K=olympe.C.J.H();m.fl.K=olympe.C.J.H();m.sort.K=olympe.C.J.H();m.kx.K=olympe.C.J.H();m.vj.K=olympe.C.J.H();function Ql(a,b,c){const d=b.Yd();var e=new olympe.dc.query.vv;let f;f=d;olympe.C.hb(f)&&(f=e.add(d));b=(b=b.Xl())?Array.isArray(b)?b:[b]:null;e=olympe.dc.kc.Subscription.F(f,b,e);let g,h,k=null!=(h=null==(g=a.j.get(e))?void 0:g.j)?h:null;null===k&&(a.G.debug('QueryMGR: new',a.D?'local':'remote','subscription "',e,'": #',`${f},`,b),k=new olympe.dc.kc.Subscription(e,d,b,a.F));k.getContext().run(()=>a.process(k,c));return k}
|
|
939
|
+
function Vl(a,b){if(b.R())a.G.debug('ListProcessor: [ID:',b.T(),'] - Subscription already booted, ignoring');else{a.G.debug('ListProcessor: [ID:',b.T(),'] - Booting subscription');var c=new olympe.dc.lc.sr(a.db,a.G),d=b.T();olympe.C.Sc([b.Yd()],e=>{const f=olympe.dc.fa(e);a.G.debug('ListProcessor: [ID:',b.T(),'] - Booting with baseTag',f);b.ai()||b.Wk();sf(a.db,f,Wl(a,b,c),d);olympe.C.Xa().Td(()=>qf(a.db,f,d));a.db.Ha(f.valueOf())||Xl(c);b.R()||(Xl(c),b.$c([]))})}}
|
|
940
|
+
function Yl(a,b,c,d,e){const f=[b.Yd()],g=l=>l instanceof olympe.dc.ba.Hf;let h;const k=(null!=(h=b.gh())?h:[]).filter(g);for(const l of k){f.push(l.Yd());let n;k.push(...(null!=(n=l.gh())?n:[]).filter(g))}olympe.C.Sc(f,()=>{const l=b.$e(c);Zl(a,l,b.T(),d,e)})}
|
|
941
|
+
function Zl(a,b,c,d,e){a.G.debug('CoverageProcessor: [ID:',c,'] - checking coverage of remote query over',b.length,'paths.');const f=olympe.C.Xa(),g=new olympe.async.mk(f);b.forEach(h=>{g.add((k,l)=>{let n=!1;gi(a.H,h,f,olympe.dc.Ja.SELF,olympe.dc.ma.nc.rf,{Ac:e}).subscribe(rxjs.Subscriber.create(()=>{n||(n=!0,f.run(k))},p=>f.run(()=>l(`The query ${c} is not covered by an existing graphdef, `+`and the specific graphdef id ${h.T()} has encountered an error: ${p}`))))})});bd(g,(h,k)=>d(k));g.start()}
|
|
942
|
+
function Wl(a,b,c){const d=new olympe.dc.lc.Jj;let e=!1;const f=olympe.C.Xa(),g=b.gh(),h=[];h[g?g.length:0]=(k,l,n,p)=>{f.gd()||f.gb()||(k?b.ih(n)?a.G.warn('Adding the same index twice (should never happen) for sub #',b.T(),', index #',n,', tag #',l):(a.G.debug('ListProcessor: [ID:',b.T(),'] - Adding Instance',l,'to the subscription'),b.Rd(n,l)):(a.G.debug('ListProcessor: [ID:',b.T(),'] - Removing Instance',l,'from the subscription'),b.ci(n)),e||($l(c,()=>{p.ig();Xl(c)}),f.run(()=>p.me().rg(b.$c.bind(b))),
|
|
943
|
+
e=!0),am(c,n))};if(null!==g)for(let k=g.length-1;0<=k;k--)h[k]=g[k].j(f,c,h[k+1]);return(k,l)=>{const n=b.T();c.register(n,null);const p=d.j(k,l,n,null);if(null!==p)h[0](k,l,n,bm(p,k,l,n))}}
|
|
944
|
+
olympe.dc.kc.Tu=class{constructor(a,b,c,d,e,f){this.G=a;this.db=b;this.D=f||e;this.H=d;this.j=new Map;this.F=new olympe.C.Xb('Legacy ListDef processor')}process(a,b){const c=a.T();var d=this.j.get(c);d||(d=new olympe.dc.kc.dw(a),this.j.set(c,d));d.counter++;cm(d)?this.G.debug('ListProcessor: [ID:',c,'] - id already processed'):(this.G.debug('ListProcessor: [ID:',c,'] - NOT processed yet.'),d=a.$h(),b||this.D&&d===olympe.dc.Ja.SERVER||d===olympe.dc.Ja.SELF?(this.G.debug('QueryMGR: [ID:',c,'] - Local subscription, no need for coverage check, booting subscription '),
|
|
945
|
+
Vl(this,a)):Yl(this,a,d,e=>{e?this.G.error(e):Vl(this,a)},b))}};function dm(a){return olympe.C.hb(a)?'Node#'+a.Ba.T():String(a)}function em(a,b){return olympe.C.hb(b)?'{"c":"Parameter","v":"'+a.add(b)+'"}':JSON.stringify(b)}
|
|
946
946
|
olympe.dc.query.vv=class{constructor(){this.j=0;this.values=null}add(a){let b;b=olympe.C.hb(a)?'n'+a.Ba.T():'p'+ ++this.j;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.Aa=class{la(){}j(){}D(){}ga(){}toString(){}};olympe.dc.kc.Subscription=class a extends olympe.C.Hj{constructor(b,c,d,e){super(olympe.dc.CloudObject,new olympe.C.Xb('context subscription '+b,e));this.id=b;this.Bd=c;this.ba=d||null;this.F=this.N.run(()=>olympe.C.be(olympe.dc.kc.Subscription.j.INIT));this.vc=!1;this.$=this.zc=null}static F(b,c,d){let e;try{e=b;if(c)for(let f=0,g=c.length;f<g;f++)e+='|'+c[f].ga(d);else e+='|null';e=olympe.V.tb(e)}catch(f){e=olympe.V.Ic()}return e}T(){return this.id}Yd(){return this.Bd}gh(){return this.ba}$h(){const b=
|
|
947
947
|
olympe.dc.ae(),c=olympe.C.Pa(this.Yd());let d;return olympe.dc.CloudObject.instancesRel.Ea(null==(d=this.ba)?void 0:d[0])?b.fromModel(c):b.Ke(c)}ai(){const b=olympe.C.Pa(this.F);return b&&b.valueOf()>=olympe.dc.kc.Subscription.j.kr}Wk(){if(this.F.Ba.gb())throw Error(`Cannot set destroyed subscription '${this.id}' as subscribed`);const b=this.zc;this.zc=null;for(let c in b)if(Object.prototype.hasOwnProperty.call(b,c))b[c](this);fc(this.F,olympe.C.be(olympe.dc.kc.Subscription.j.kr))}Id(){return olympe.C.ta([this.F],
|
|
948
948
|
()=>{},olympe.C.ea)}R(){const b=this.F.Ba.Fb;return b&&b.valueOf()>=olympe.dc.kc.Subscription.j.Jh}hd(b,c){this.R()?b(this):(null===this.$&&(this.$=new Map),void 0===c&&(c=olympe.V.Ic()),this.$.set(c,olympe.C.Xa().rc(b)));return c||''}bl(b){null!==this.$&&b&&this.$.delete(b)}Mb(){const b=olympe.dc.kc.Subscription.j.Jh;if(!this.F.Ba.gb()&&olympe.C.Pa(this.F)!==b&&(this.Jf(),fc(this.F,b),null!==this.$)){for(const c of this.$.values())c(this);this.$=null}}onDestroy(b){this.N.onDestroy(b)}release(){this.N.destroy()}$c(b){if(!this.F.Ba.gb()){for(let c=
|
|
949
949
|
0,d=b.length;c<d;c++)this.Nm(b[c],c);if(this.R())this.Jf();else{this.vc=b=!0;for(let c in this.D)if(Object.prototype.hasOwnProperty.call(this.D,c)&&!Object.prototype.hasOwnProperty.call(this.values,c)){b=!1;break}b&&this.Mb()}}}Rd(b,c){if(!this.F.Ba.gb()&&(this.Ik(b,olympe.dc.CloudObject.get(c)),b=this.R(),this.vc&&!b)){b=!0;for(let d in this.D)if(Object.prototype.hasOwnProperty.call(this.D,d)&&!Object.prototype.hasOwnProperty.call(this.values,d)){b=!1;break}b&&this.Mb()}}ci(b){this.F.Ba.gb()||(this.Mm(b),
|
|
950
950
|
this.ej(b,!this.R()))}Eg(){return this.R()?super.Eg():'Subscription is not ready!'}$e(b){const c=olympe.C.Pa(this.Yd());return olympe.dc.kc.Subscription.D(c,b,this.gh())}static D(b,c,d){var e=olympe.dc.ma.from(b,c).ie();if(null===d)return[e];b=[];b.push(e);for(let f=0,g=d.length;f<g;f++)if(e=d[f],e instanceof olympe.dc.ba.Ve){const h=olympe.dc.query.Relation.from(e);b=b.map(k=>k.fb(h,!0))}else if(e instanceof olympe.dc.ba.Fe){const h=olympe.dc.query.Relation.from(e);b=b.map(k=>k.mg(h,!0,!0))}else if(e instanceof
|
|
951
|
-
olympe.dc.ba.Hf)e=a.D(olympe.C.Pa(e.Yd()),c,e.gh()),b.push(...e);else if(e instanceof olympe.dc.ba.uf||e instanceof olympe.dc.ba.Tg){const h=e.F();b=b.map(k=>{for(const l of h){for(const n of l)k=n.recursive?k.mg(n,!0,!0):k.fb(n,!0);k=k.back(l.length)}return k})}return b}};olympe.dc.kc.Subscription.j={INIT:0,kr:1,Jh:2};olympe.dc.kc.Subscription.prototype.Eg.K=olympe.C.J.j;function
|
|
951
|
+
olympe.dc.ba.Hf)e=a.D(olympe.C.Pa(e.Yd()),c,e.gh()),b.push(...e);else if(e instanceof olympe.dc.ba.uf||e instanceof olympe.dc.ba.Tg){const h=e.F();b=b.map(k=>{for(const l of h){for(const n of l)k=n.recursive?k.mg(n,!0,!0):k.fb(n,!0);k=k.back(l.length)}return k})}return b}};olympe.dc.kc.Subscription.j={INIT:0,kr:1,Jh:2};olympe.dc.kc.Subscription.prototype.Eg.K=olympe.C.J.j;function cm(a){const b=a.D;a.D=!0;return b}olympe.dc.kc.dw=class{constructor(a){this.counter=0;this.D=!1;this.j=a}};olympe.dc.Gf=class{la(){}Nb(){}j(){}ga(){}toString(){}};olympe.dc.Dq=class{F(){}};olympe.dc.Fk=class{la(){}getValue(){}j(){}ga(){}toString(){}};olympe.dc.wc={};let fm=0;olympe.dc.wc.tg=class{constructor(){this.id=fm++}la(){return'CustomLocalComparator#'+fm}H(){return[]}F(){throw Error('GetComparedValue function was not implemented.');}compare(){throw Error('Compare function was not implemented.');}ga(){return`{"c":"${this.la()}"}`}toString(){return this.la()+'()'}};olympe.dc.wc.tg.xa=[olympe.dc.sf];olympe.dc.wc.DateTime=class{constructor(a){this.j=a}la(){return Q(olympe.dc.wc.DateTime)}H(){return this.j.j()}F(a,b){return this.j.getValue(a,b)}compare(a,b){if(!a)return b?-1:0;if(!b)return 1;a=a.getTime();b=b.getTime();return a!==b?a>b?1:-1:0}ga(a){return'{"c":"'+this.la()+'",a:['+this.j.ga(a)+']}'}toString(){return'Number('+this.j.toString()+')'}};P('olympe.dc.comparators.DateTime',olympe.dc.wc.DateTime);olympe.dc.wc.DateTime.xa=[olympe.dc.sf];olympe.dc.wc.Number=class{constructor(a){this.j=a}la(){return Q(olympe.dc.wc.Number)}H(){return this.j.j()}F(a,b){return this.j.getValue(a,b)}compare(a,b){return a!==b?a>b?1:-1:0}ga(a){return`{"c":"${this.la()}",a:[${this.j.ga(a)}]}`}toString(){return`Number(${this.j.toString()})`}};P('olympe.dc.comparators.Number',olympe.dc.wc.Number);olympe.dc.wc.Number.xa=[olympe.dc.sf];olympe.dc.wc.String=class{constructor(a){this.j=a}la(){return Q(olympe.dc.wc.String)}H(){return this.j.j()}F(a,b){return olympe.C.ta([this.j.getValue(a,b)],c=>c.toLowerCase(),olympe.C.Sa)}compare(a,b){return void 0===a?void 0===b?0:1:a!==b?a>b?1:-1:0}ga(a){return`{"c":"${this.la()}",a:[${this.j.ga(a)}]}`}toString(){return`String(${this.j.toString()})`}};P('olympe.dc.comparators.String',olympe.dc.wc.String);olympe.dc.wc.String.xa=[olympe.dc.sf];olympe.dc.Z={};let gm=0;olympe.dc.Z.tg=class{constructor(){this.id=gm++}la(){return'CustomLocalPredicate#'+this.id}D(){return[]}j(){throw Error('Test function was not implemented.');}ga(){return`{"c":"${this.la()}"}`}toString(){return this.la()+'()'}};olympe.dc.Z.tg.xa=[olympe.dc.Aa];olympe.dc.Z.ml=class{constructor(a,b){this.F=a;this.H=b}la(){}D(){return[this.F.j(),this.H.j()]}j(a,b){return a.run(()=>olympe.C.ta([this.F.getValue(a,b),this.H.getValue(a,b)],(c,d)=>{c=c.valueOf();d=d.valueOf();return olympe.C.Sb(this.N('string'===typeof c?c:Number(c),'string'===typeof d?d:Number(d)))},olympe.C.ea))}N(){}ga(a){return'{"c":"'+this.la()+'","a":['+this.F.ga(a)+','+this.H.ga(a)+']}'}toString(){return this.la().replace(/^.+\./,'')+'('+this.F.toString()+','+this.H.toString()+')'}};
|
|
952
952
|
olympe.dc.Z.ml.xa=[olympe.dc.Aa];olympe.dc.Z.Jd=class{constructor(a){this.Z=[];for(let b=arguments.length,c=0;c<b;c++)Array.isArray(arguments[c])?this.Z=this.Z.concat(arguments[c]):this.Z.push(arguments[c])}la(){return Q(olympe.dc.Z.Jd)}D(){return this.Z.reduce((a,b)=>a.concat(b.D()),[])}j(a,b){return a.run(()=>olympe.C.ta(this.Z.map(c=>c.j(a,b)),(...c)=>olympe.C.Sb(c.every(d=>d.valueOf())),olympe.C.ea))}ga(a){const b=this.Z.map(c=>c.ga(a));return'{"c":"'+this.la()+'","a":['+b.join(',')+']}'}toString(){return'And('+this.Z.map(a=>
|
|
953
953
|
a.toString()).join(',')+')'}};P('olympe.dc.predicates.And',olympe.dc.Z.Jd);olympe.dc.Z.Jd.xa=[olympe.dc.Aa];olympe.dc.Z.tl=class{constructor(a,b){this.F=a;this.value=b}j(a,b){return a.run(()=>olympe.C.ta([this.F,this.value.getValue(a,b)],(c,d)=>{c=c.valueOf();return olympe.C.Sb((Number(c)&Number(d.valueOf()))===Number(c))},olympe.C.ea))}la(){return Q(olympe.dc.Z.tl)}D(){return[this.value.j()]}ga(a){const b=olympe.C.hb(this.F)?this.F.Ba.Fb.valueOf():this.F.valueOf();return'{"c":"'+this.la()+'","a":['+b+','+this.value.ga(a)+']}'}toString(){const a=olympe.C.hb(this.F)?this.F.Ba.Fb.valueOf():this.F.valueOf();
|
|
954
|
-
return this.la().replace(/^.+\./,'')+'('+a.toString()+','+this.value.toString()+')'}};P('olympe.dc.predicates.BitMask',olympe.dc.Z.tl);olympe.dc.Z.tl.xa=[olympe.dc.Aa];olympe.dc.Z.tf=class{constructor(a,b,c){this.source=a;this.value=b;this.F=c?c:!1}la(){return Q(olympe.dc.Z.tf)}D(){return[this.source.j(),this.value.j()]}sb(){return this.source}getValue(){return this.value}j(a,b){return a.run(()=>olympe.C.ta([this.source.getValue(a,b),this.value.getValue(a,b),this.F],(c,d,e)=>{c=String(c);d=String(d);e.valueOf()||(c=c.toLowerCase(),d=d.toLowerCase());return olympe.C.Sb(c.includes(d))},olympe.C.ea))}ga(a){const b=this.source.ga(a),c=this.value.ga(a);a=
|
|
955
|
-
return'{"c":"'+this.la()+'","a":['+b+','+c+','+a+']}'}toString(){const a=
|
|
956
|
-
')'}};P('olympe.dc.predicates.Equals',olympe.dc.Z.ve);olympe.dc.Z.ve.xa=[olympe.dc.Aa];olympe.dc.Z.Kt=class extends olympe.dc.Z.ve{constructor(a,b){super(a,new olympe.dc.Za.Re(b))}};olympe.dc.Z.Kt.xa=[olympe.dc.Aa];olympe.dc.Z.Zj=class extends olympe.dc.Z.ml{constructor(a,b){super(a,b)}la(){return Q(olympe.dc.Z.Zj)}N(a,b){return a>b}};P('olympe.dc.predicates.Greater',olympe.dc.Z.Zj);olympe.dc.Z.Ei=class{constructor(a,b,c){this.ob=[];this.F=c instanceof Array?c:void 0!==c?[olympe.dc.fa(c)]:[];a=Array.isArray(a)?a:[a];for(let d=0,e=a.length;d<e;d++)c=a[d],c instanceof olympe.dc.ba.Fe?this.ob.push(new
|
|
957
|
-
c.getContext().gb()||c.getContext().gd()||(f+=h?1:-1,c.update(0<f))};const g=this.ob;for(let h=g.length-1;0<=h;h--)a=
|
|
958
|
-
function
|
|
959
|
-
const g=this.ob;for(let k=g.length-1;0<=k;k--)f=
|
|
960
|
-
function
|
|
961
|
-
{e.set(r,(e.get(r)||0)+y);l(y)},q,r),(0>a.j||n<=a.j)&&r!==p&&T(b,r,a,k.bind(a,x,n+1,r),t))}else l(-e.get(r)),f.get(r).delete(d+p),0===f.get(r).size&&(e.delete(r),f.delete(r),b.D(r,a,t))};return(l,n,p)=>k(l,0,'origin',n,p)}class
|
|
962
|
-
this.F.has(k)?(c.update(olympe.C.ea.D),f()):(h=new
|
|
954
|
+
return this.la().replace(/^.+\./,'')+'('+a.toString()+','+this.value.toString()+')'}};P('olympe.dc.predicates.BitMask',olympe.dc.Z.tl);olympe.dc.Z.tl.xa=[olympe.dc.Aa];olympe.dc.Z.tf=class{constructor(a,b,c){this.source=a;this.value=b;this.F=c?c:!1}la(){return Q(olympe.dc.Z.tf)}D(){return[this.source.j(),this.value.j()]}sb(){return this.source}getValue(){return this.value}j(a,b){return a.run(()=>olympe.C.ta([this.source.getValue(a,b),this.value.getValue(a,b),this.F],(c,d,e)=>{c=String(c);d=String(d);e.valueOf()||(c=c.toLowerCase(),d=d.toLowerCase());return olympe.C.Sb(c.includes(d))},olympe.C.ea))}ga(a){const b=this.source.ga(a),c=this.value.ga(a);a=em(a,this.F);
|
|
955
|
+
return'{"c":"'+this.la()+'","a":['+b+','+c+','+a+']}'}toString(){const a=dm(this.F);return'Contains('+this.source.toString()+','+this.value.toString()+','+a+')'}};P('olympe.dc.predicates.Contains',olympe.dc.Z.tf);olympe.dc.Z.tf.xa=[olympe.dc.Aa];olympe.dc.Z.ve=class{constructor(a,b){this.F=a;this.H=b}la(){return Q(olympe.dc.Z.ve)}D(){return[this.F.j(),this.H.j()]}j(a,b){return a.run(()=>olympe.C.ta([this.F.getValue(a,b),this.H.getValue(a,b)],(c,d)=>'object'===typeof c&&void 0!==c.Fd?c.Fd(d):'object'===typeof d&&void 0!==d.Fd?d.Fd(c):olympe.C.Sb(c.valueOf()===d.valueOf()),olympe.C.ea,'Test equal predicate'))}ga(a){return'{"c":"'+this.la()+'","a":['+this.F.ga(a)+','+this.H.ga(a)+']}'}toString(){return'Equals('+this.F.toString()+','+this.H.toString()+
|
|
956
|
+
')'}};P('olympe.dc.predicates.Equals',olympe.dc.Z.ve);olympe.dc.Z.ve.xa=[olympe.dc.Aa];olympe.dc.Z.Kt=class extends olympe.dc.Z.ve{constructor(a,b){super(a,new olympe.dc.Za.Re(b))}};olympe.dc.Z.Kt.xa=[olympe.dc.Aa];olympe.dc.Z.Zj=class extends olympe.dc.Z.ml{constructor(a,b){super(a,b)}la(){return Q(olympe.dc.Z.Zj)}N(a,b){return a>b}};P('olympe.dc.predicates.Greater',olympe.dc.Z.Zj);olympe.dc.Z.Ei=class{constructor(a,b,c){this.ob=[];this.F=c instanceof Array?c:void 0!==c?[olympe.dc.fa(c)]:[];a=Array.isArray(a)?a:[a];for(let d=0,e=a.length;d<e;d++)c=a[d],c instanceof olympe.dc.ba.Fe?this.ob.push(new hm(c.X(),c.Ka(),c.F,c.D)):this.ob.push(new hm(olympe.dc.fa(c),b[d],1,1))}la(){return Q(olympe.dc.Z.Ei)}D(){return[this.ob.reduce((a,b)=>a.concat(b),[])]}j(a,b){const c=a.run(()=>gc(olympe.C.bc(Boolean),!1)),d=olympe.V.Ic(),e=olympe.dc.ia();let f=0;a=(h,k)=>{0!==this.F.length&&!this.F.includes(k)||
|
|
957
|
+
c.getContext().gb()||c.getContext().gd()||(f+=h?1:-1,c.update(0<f))};const g=this.ob;for(let h=g.length-1;0<=h;h--)a=im(g[h],e,a,d+h);sf(e,b,a,d);c.getContext().onDestroy(()=>{qf(e,b,d)});return c.rb()}ga(){return'{"c":"'+this.la()+'","a":['+JSON.stringify(this.ob.map(a=>a.ga()))+(0!==this.F.length?',"'+this.F.toString():'')+'"]}'}toString(){return'HasRelated('+(0!==this.F.length?'#'+this.F.toString()+', ':'')+this.ob.map(a=>a.ga())+')'}};P('olympe.dc.predicates.HasRelated',olympe.dc.Z.Ei);
|
|
958
|
+
function im(a,b,c,d){const e=Object.create(null);d+=olympe.V.di();const f=(g,h,k)=>{k>=a.D&&c(g,h);if(!(0<=a.j&&k>=a.j)){var l=d+k;g?e[h]||(e[h]=!0,T(b,h,a,(n,p)=>{f(n,p,k+1)},l)):(delete e[h],b.D(h,a,l))}};return(g,h)=>f(g,h,0)}class hm extends olympe.dc.query.Relation{constructor(a,b,c,d){super(a,b,1!==c||1!==d);this.D=c;this.j=d}ga(){return`${this.X()}, ${this.Ka()}, ${this.D}, ${this.j}`}}olympe.dc.Z.Ei.xa=[olympe.dc.Aa];olympe.dc.Z.Sl=class{constructor(a,b,c){this.ob=[];this.F=void 0!==c?c.map(olympe.dc.fa):null;a=Array.isArray(a)?a:[a];for(let d=0,e=a.length;d<e;d++)c=a[d],c instanceof olympe.dc.ba.Fe?this.ob.push(new jm(c.X(),c.Ka(),c.F,c.D)):this.ob.push(new jm(olympe.dc.fa(c),b[d],1,1))}la(){return Q(olympe.dc.Z.Sl)}D(){return[this.ob.reduce((a,b)=>a.concat(b),[])]}j(a,b){const c=a.run(()=>gc(olympe.C.bc(Boolean),!1)),d=olympe.dc.ia(),e=olympe.V.di();let f=(k,l,n)=>{l&&(null===this.F||this.F.includes(n))&&k(1)};
|
|
959
|
+
const g=this.ob;for(let k=g.length-1;0<=k;k--)f=km(g[k],d,f,e+k);let h=0;sf(d,b,f.bind(null,k=>{c.getContext().gd()||c.getContext().gb()||(h+=k,c.update(0<h))}),e);a.onDestroy(()=>qf(d,b,e));return c.rb()}ga(){return'{"c":"'+this.la()+'","a":['+JSON.stringify(this.ob.map(a=>a.ga()))+(null!==this.F?',"'+this.F.toString():'')+'"]}'}toString(){return'HasRelatedTree('+(null!==this.F?'#['+this.F.toString()+'], ':'')+this.ob.map(a=>a.ga())+')'}};P('olympe.dc.predicates.HasRelatedTree',olympe.dc.Z.Sl);
|
|
960
|
+
function km(a,b,c,d){const e=a.F,f=a.N,g=new Set,h=(l,n,p)=>{f.has(n)?f.get(n).set(d+p,l):f.set(n,(new Map).set(d+p,l))},k=(l,n,p,q,r)=>{const t=olympe.V.di();if(q){const u=p+r,x=y=>{const z=f.get(r);if(g.has(u))throw Error(`Try to use the predicate HasRelatedTree with recursion in a graph cluster containing a loop around instances ${p} and ${r}`);void 0!==z&&null!==z&&(g.add(u),e.set(r,(e.get(r)||0)+y),Array.from(z.values()).forEach(A=>A(y)));g.delete(u)};h(l,r,p);e.has(r)?l(e.get(r)):(n>=a.D&&c(y=>
|
|
961
|
+
{e.set(r,(e.get(r)||0)+y);l(y)},q,r),(0>a.j||n<=a.j)&&r!==p&&T(b,r,a,k.bind(a,x,n+1,r),t))}else l(-e.get(r)),f.get(r).delete(d+p),0===f.get(r).size&&(e.delete(r),f.delete(r),b.D(r,a,t))};return(l,n,p)=>k(l,0,'origin',n,p)}class jm extends olympe.dc.query.Relation{constructor(a,b,c,d){super(a,b,1!==c||1!==d);this.D=c;this.j=d;this.N=new Map;this.F=new Map}ga(){return`${this.X()}, ${this.Ka()}, ${this.D}, ${this.j}`}}olympe.dc.Z.Sl.xa=[olympe.dc.Aa];olympe.dc.Z.Hi=class{constructor(a){this.F=new Set;a instanceof Array?a.forEach(b=>{this.F.add(olympe.dc.fa(b))}):this.F.add(olympe.dc.fa(a))}la(){return Q(olympe.dc.Z.Hi)}D(){return[]}j(a,b){const c=a.run(()=>gc(olympe.C.bc(olympe.C.ea),olympe.C.ea.j)),d=olympe.dc.ia();let e=[];const f=()=>{e.forEach(h=>{d.D(h.tag,h.relation,h.id)});e=[]},g=(h,k)=>{if(h)if(k===olympe.dc.fa(olympe.dc.CloudObject))c.update(olympe.C.Sb(this.F.has(k))),f();else{for(const l of e)if(l.tag===k)throw Error(`You should never extend a model to itself (${k})`);
|
|
962
|
+
this.F.has(k)?(c.update(olympe.C.ea.D),f()):(h=new lm(k,olympe.dc.CloudObject.extendRel),e.push(h),T(d,h.tag,h.relation,g,h.id))}};a=new lm(b,olympe.dc.CloudObject.modelRel);e.push(a);T(d,a.tag,a.relation,g,a.id);c.getContext().onDestroy(f);return c.rb()}ga(){return'{"c":"'+this.la()+'","a":['+JSON.stringify(Array.from(this.F))+']}'}toString(){return'InstanceOf('+Array.from(this.F).join(', ')+')'}};class lm{constructor(a,b){this.tag=a;this.relation=b;this.id=olympe.V.di()}}
|
|
963
963
|
P('olympe.dc.predicates.InstanceOf',olympe.dc.Z.Hi);olympe.dc.Z.Hi.xa=[olympe.dc.Aa];olympe.dc.Z.fe=class{constructor(a){this.F=a}la(){return Q(olympe.dc.Z.fe)}D(){return this.F.D()}j(a,b){return a.run(()=>olympe.C.ta([this.F.j(a,b)],c=>olympe.C.Sb(!c.valueOf()),olympe.C.ea))}ga(a){return`{"c":"${this.la()}","a":[${this.F.ga(a)}]}`}toString(){return'Not('+this.F.toString()+')'}};P('olympe.dc.predicates.Not',olympe.dc.Z.fe);olympe.dc.Z.fe.xa=[olympe.dc.Aa];olympe.dc.Z.Be=class{constructor(a){this.Z=[];for(let b=arguments.length,c=0;c<b;c++)Array.isArray(arguments[c])?this.Z=this.Z.concat(arguments[c]):this.Z.push(arguments[c])}la(){return Q(olympe.dc.Z.Be)}D(){return this.Z.reduce((a,b)=>a.concat(b.D()),[])}j(a,b){return a.run(()=>olympe.C.ta(this.Z.map(c=>c.j(a,b)),(...c)=>olympe.C.Sb(c.some(d=>d.valueOf())),olympe.C.ea))}ga(a){const b=this.Z.map(c=>c.ga(a));return'{"c":"'+this.la()+'","a":['+b.join(',')+']}'}toString(){return'Or('+this.Z.map(a=>a.toString()).join(',')+
|
|
964
|
-
')'}};P('olympe.dc.predicates.Or',olympe.dc.Z.Be);olympe.dc.Z.Be.xa=[olympe.dc.Aa];olympe.dc.Z.Ef=class{constructor(a,b,c){this.source=a;this.H=b;this.F=void 0===c?!0:c}la(){return Q(olympe.dc.Z.Ef)}D(){return[this.source.j()]}sb(){return this.source}j(a,b){return a.run(()=>olympe.C.ta([this.source.getValue(a,b),this.H,this.F],(c,d,e)=>{c=String(c);d=String(d);e.valueOf()||(c=c.toLowerCase(),d=d.toLowerCase());return olympe.C.Sb((new RegExp(d)).test(c))},olympe.C.ea))}ga(a){const b=this.source.ga(a),c=
|
|
965
|
-
']}'}toString(){const a=
|
|
966
|
-
(0<=this.D?
|
|
967
|
-
function
|
|
968
|
-
olympe.dc.lc.cm=class{constructor(){this.H={};this.ha=[];this.D=null;this.da=!1;this.R=[];this.$=null}N(){return null!==this.D}Y(a){if(null!==this.D)throw Error('Manager already activated (depth='+this.D+')');this.D=a;this.F()}F(){if(null===this.D)throw Error('Manager not activated, need to set a depth before updating ranks');if(!this.da){var a=this.ha,b=a.length,c=this.H,d;for(d=this.R.length=0;d<b;d++){var e=c[a[d]];if(0>this.D)this.R.push(e.R);else{if(!e.$){var f=e,g=this.D;f.$=!0;f.F=
|
|
969
|
-
e.F&&
|
|
970
|
-
class
|
|
971
|
-
function
|
|
972
|
-
function
|
|
973
|
-
olympe.dc.lc.qr=class{constructor(a){this.ha=a;this.H=null;this.D=[];this.R=[];this.$=null;this.da=new Map}j(a,b,c,d){b='$'+c;const e=this.D;let f;if(a)f=new
|
|
974
|
-
this.H+')');this.H=a;
|
|
975
|
-
c;a++)b[a]=b[a+1],b[a].position=a;b.length=c}}};olympe.dc.lc.qr.xa=[olympe.dc.lc.Ta];function
|
|
976
|
-
function
|
|
977
|
-
olympe.dc.lc.sr=class{constructor(a,b){this.db=a;this.G=b||null;this.H=Object.create(null);this.N=Object.create(null);this.D=!1;this.R=0;this.j=new
|
|
978
|
-
class
|
|
979
|
-
function
|
|
964
|
+
')'}};P('olympe.dc.predicates.Or',olympe.dc.Z.Be);olympe.dc.Z.Be.xa=[olympe.dc.Aa];olympe.dc.Z.Ef=class{constructor(a,b,c){this.source=a;this.H=b;this.F=void 0===c?!0:c}la(){return Q(olympe.dc.Z.Ef)}D(){return[this.source.j()]}sb(){return this.source}j(a,b){return a.run(()=>olympe.C.ta([this.source.getValue(a,b),this.H,this.F],(c,d,e)=>{c=String(c);d=String(d);e.valueOf()||(c=c.toLowerCase(),d=d.toLowerCase());return olympe.C.Sb((new RegExp(d)).test(c))},olympe.C.ea))}ga(a){const b=this.source.ga(a),c=em(a,this.H);a=em(a,this.F);return'{"c":"'+this.la()+'","a":['+b+','+c+','+a+
|
|
965
|
+
']}'}toString(){const a=dm(this.F);return'Regex('+this.source.toString()+','+this.H+','+a+')'}};P('olympe.dc.predicates.Regex',olympe.dc.Z.Ef);olympe.dc.Z.Ef.xa=[olympe.dc.Aa];olympe.dc.Z.Ak=class extends olympe.dc.Z.ml{constructor(a,b){super(a,b)}la(){return Q(olympe.dc.Z.Ak)}N(a,b){return a<b}};P('olympe.dc.predicates.Smaller',olympe.dc.Z.Ak);olympe.dc.lc={};olympe.dc.lc.Jj=class{constructor(){this.$=this.H=this.R=this.D=null}N(){return null!==this.D}Y(a){if(null!==this.D)throw Error('Manager already activated (depth='+this.D+')');this.D=a;this.F()}j(a,b,c){b=this.H;if(a&&null!==b)throw Error('The AutoManger handles only a single item.');a?(b=new olympe.dc.lc.Uj(this),this.R=c,this.H=b):this.H=this.R=null;return b}F(){if(null===this.D)throw Error('Manager not activated, need to set a depth before updating ranks');if(null!==this.$){const a=[];null!==this.H&&
|
|
966
|
+
(0<=this.D?mm(nm(this.H,this.D),a):a.push(this.R));this.$(a)}}rg(a){this.$=a}};olympe.dc.lc.Jj.xa=[olympe.dc.lc.Ta];function bm(a,b,c,d){b?a.N[d]=c:delete a.N[d];null===a.D&&(a.D=new olympe.dc.lc.Uj(a.j,a));return a.D}function nm(a,b){for(let c=0;c<b;c++)if(null!==a.D)a=a.D;else break;return a}function mm(a,b){a=a.N;if(null!==a)for(let c in a)Object.prototype.hasOwnProperty.call(a,c)&&b.push(c)}olympe.dc.lc.Uj=class{constructor(a,b){this.j=a;this.depth=b?b.depth+1:0;this.N=Object.create(null);this.D=null}me(){return this.j}ig(){this.j.N()?this.j.F():this.j.Y(this.depth-1)}};class om extends olympe.dc.lc.Uj{constructor(a,b,c){super(a);this.R=b;this.tag=c;this.$=this.Y=this.H=!1;this.F=null}}
|
|
967
|
+
function pm(a,b,c,d,e){const f=Object.create(null),g=a.ha,h=a.H;let k,l,n;a.da=!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.H||(c.H=!0,e(!0,c.tag,c.R,c)));for(k in f)Object.prototype.hasOwnProperty.call(f,k)&&(c=h[k],c.H&&(c.H=!1,e(!1,c.tag,c.R,c)),c.Y&&(c.F=null,delete h[k]),delete f[k]);a.da=!1;null!==a.D&&a.F()}
|
|
968
|
+
olympe.dc.lc.cm=class{constructor(){this.H={};this.ha=[];this.D=null;this.da=!1;this.R=[];this.$=null}N(){return null!==this.D}Y(a){if(null!==this.D)throw Error('Manager already activated (depth='+this.D+')');this.D=a;this.F()}F(){if(null===this.D)throw Error('Manager not activated, need to set a depth before updating ranks');if(!this.da){var a=this.ha,b=a.length,c=this.H,d;for(d=this.R.length=0;d<b;d++){var e=c[a[d]];if(0>this.D)this.R.push(e.R);else{if(!e.$){var f=e,g=this.D;f.$=!0;f.F=nm(f,g)}null!==
|
|
969
|
+
e.F&&mm(e.F,this.R)}}this.$&&this.$(this.R)}}rg(a){this.$=a}j(a,b,c){let d=this.H[c];a?void 0===d?(d=new om(this,c,b),this.H[c]=d):(d.tag=b,d.Y=!1):void 0!==d&&(d.Y=!0);return d}};olympe.dc.lc.cm.xa=[olympe.dc.lc.Ta];olympe.dc.lc.Ta=class{constructor(){}j(){}N(){}Y(){}F(){}rg(){}};function qm(a,b){olympe.C.kf(a.value)?(a.node=olympe.C.un(a.value,b),Nb(a.node)||b()):b()}function rm(a,b){if(olympe.C.kf(a.value)){const c=olympe.C.Xa(),d=a.H;olympe.C.Sc([a.value],e=>{d!==e.valueOf()&&(c.run(()=>qm(a,b)),olympe.C.Xa().destroy())})}}
|
|
970
|
+
class sm extends olympe.dc.lc.Uj{constructor(a,b,c){super(a);this.Y=b;this.value=c;this.H=this.Pa();this.position=this.node=null;this.R=!1;this.F=null}Pa(){const a=olympe.C.Pa(this.value);return a?a.valueOf():a}destroy(){this.node&&(this.node.destroy(),this.node=null);this.F=this.value=null}gb(){return null===this.value}}
|
|
971
|
+
function tm(a,b){if(!b.gb()){var c=a.D;var d=a.ha,e=b.Pa(),f=0;let g=c.length,h=0,k;for(null!==b.position&&--g;g>f;){h=Math.floor((f+g)/2);k=d(c[h].H,e);if(0===k||2>g-f){0>k&&null!==b.position&&b.position<=h&&(k=d(c[g].H,e));h=0>k?g:h;break}0>k?f=h:g=h}c=h;b.H=b.Pa();if(c!==b.position){d=a.D;e=d.length;f=b.position;null===f&&(f=e);if(c<f)for(e=f;e>c;e--)d[e]=d[e-1],d[e].position=e;else for(e=f;e<c;e++)d[e]=d[e+1],d[e].position=e;d[c]=b;d[c].position=c;b.R&&a.F()}}}
|
|
972
|
+
function um(a){const b=a.ha;a.D.sort((c,d)=>b(c.Pa(),d.Pa()))}
|
|
973
|
+
olympe.dc.lc.qr=class{constructor(a){this.ha=a;this.H=null;this.D=[];this.R=[];this.$=null;this.da=new Map}j(a,b,c,d){b='$'+c;const e=this.D;let f;if(a)f=new sm(this,c,d),this.da.set(b,f),this.N()?qm(f,()=>tm(this,f)):(f.position=e.length,e.push(f));else{f=this.da.get(b);if(void 0===f)throw Error('Trying to remove an non-registered item: "'+c+'"');this.da.delete(b);null!==f.position&&(this.N()?this.remove(f):delete e[f.position]);f.destroy()}return f}N(){return null!==this.H}Y(a){if(null!==this.H)throw Error('Manager already activated (depth='+
|
|
974
|
+
this.H+')');this.H=a;um(this);for(let b=0,c=this.D.length;b<c;b++){const d=this.D[b];d.position=b;rm(d,()=>tm(this,d))}this.F()}F(){if(null===this.H)throw Error('Manager not activated, need to set a depth before updating ranks');const a=this.D.length;this.R.length=0;for(let d=0;d<a;d++){let e=this.D[d];if(!e.R){var b=e,c=this.H;b.R=!0;b.F=nm(b,c)}0>this.H?this.R.push(e.Y):e.F&&mm(e.F,this.R)}this.$&&this.$(this.R)}rg(a){this.$=a}remove(a){const b=this.D,c=b.length-1;if(null!==a.position){for(a=a.position;a<
|
|
975
|
+
c;a++)b[a]=b[a+1],b[a].position=a;b.length=c}}};olympe.dc.lc.qr.xa=[olympe.dc.lc.Ta];function Xl(a){if(!a.D){for(let b in a.F)vm(a.F[b]);a.D=!0}a.H=null;a.N=null}function $l(a,b,c){a.F[c||'root'].R=b}function am(a,b,c){a.F[c||'root'].ig(b)}function wm(a,b,c,d){const e=a.N,f=b+d+c;let g=e[f];void 0===g&&(g=$g(a.db,b,c,d),e[f]=g);return g}function xm(a,b){a.D||a.j.ig(b)}function ym(a,b,c,d,e){if(!a.D){let f=wm(a,c,d,e||olympe.dc.va.DESTINATION);e||(f+=wm(a,c,d,olympe.dc.va.ORIGIN));0===f&&xm(a,b)}}
|
|
976
|
+
function zm(a,b){const c=a.F[b];void 0!==c?(a.G&&a.G.debug('Set current block to',b,null!==c.F?'parent = '+c.F.T():''),a.j=c):a.G&&a.G.error('Try to set a block that does not exists:',b)}function Am(a){const b=String(++a.R),c=a.j;a.F[b]=new Bm(b,c);Cm(c,b);c.H||(c.H=()=>zm(a,c.T()));return b}function Dm(a,b){const c=a.j;a.j.H=()=>{zm(a,c.T());b()}}function Em(a,b){vm(b?a.F[b]:a.j)}
|
|
977
|
+
olympe.dc.lc.sr=class{constructor(a,b){this.db=a;this.G=b||null;this.H=Object.create(null);this.N=Object.create(null);this.D=!1;this.R=0;this.j=new Bm('root');this.F=Object.create(null);this.F.root=this.j}register(a,b,c,d,e){this.D||(null!==b&&c&&d&&e?(c=wm(this,c,d,e),d=this.H[b]||0,this.H[b]=++d,this.j.j===b&&c<=d&&(this.j.j=a)):this.j.j=a)}};function Cm(a,b){null===a.D&&(a.D=Object.create(null));a.D[b]=!1}function vm(a){a.N=!0;null!==a.F&&a.F.notify(a.id)}
|
|
978
|
+
class Bm{constructor(a,b){this.id=a;this.F=b||null;this.j=this.R=this.H=this.D=null;this.N=!1}T(){return this.id}ig(a){const b=this.R;if(this.N||this.j===a||null===a)b&&b(),!b&&vm(this)}notify(a){const b=this.H,c=this.D;if(this.N)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.Za={};function Fm(a,b,c,d){const e=olympe.dc.ia(),f=new olympe.dc.lc.Jj,g=new olympe.dc.lc.sr(e);let h=!1;const k=Object.create(null),l=q=>{if(0<q.length)for(const r in k)q[0]===r&&d(k[r])};let n=(q,r,t,u)=>{a.gd()||a.gb()||(h||($l(g,()=>{u.ig();Xl(g)}),u.me().rg(l),h=!0),q?k[t]=r:delete k[t],am(g,t))};if(null!==c)for(let q=c.length-1;0<=q;q--)n=c[q].j(a,g,n);const p=olympe.V.Ic();sf(e,b,(q,r)=>{g.register(p,null);const t=f.j(q,b,p,null);n(q,r,p,bm(t,q,b,p))},p);a.onDestroy(()=>{qf(e,b,p)});e.Ha(b)||Xl(g)}
|
|
979
|
+
function Gm(a,b,c){const d=c.getContext(),e=olympe.dc.ia(),f=a.F(),g=Lg(e,b,a.H,d.rc(h=>{null!==h&&(h=f(h));null===h?c.clear():c.update(h)}));d.onDestroy(()=>Mg(e,b,a.H,g))}
|
|
980
980
|
olympe.dc.Za.oi=class{constructor(a,b,c){this.H=a&&a.X?a.X():a;this.ba=b&&b.filter(d=>d instanceof olympe.dc.ba.Ve||d instanceof olympe.dc.ba.Fe)||null;this.D=c||null;this.defaultValue=null}la(){}Nb(){}F(){}j(){return(this.ba||[]).reduce((a,b)=>a.concat(olympe.dc.query.Relation.from(b)),[])}nh(a){this.defaultValue=a;return this}gh(){return this.ba}Yd(){return this.D}getValue(a,b){const c=a.run(()=>olympe.C.bc(this.Nb()||Object,'AbstractProperty valueType'));null!==this.defaultValue&&gc(c,this.defaultValue);
|
|
981
|
-
b=this.D||b;null!==this.ba?
|
|
982
|
-
b);break;case olympe.dm.Boolean.O.X():d=new olympe.dc.Za.Kj(c,b);break;case olympe.dm.DateTime.O.X():d=new olympe.dc.Za.xi(c,b)}this.D=d}la(){return this.D.la()}j(){return this.D.j()}getValue(a,b){return this.D.getValue(a,b)}ga(a){return this.D.ga(a)}toString(){return this.D.toString()}};olympe.dc.Za.Sn.xa=[olympe.dc.Fk];olympe.dc.Za.Kj=class extends olympe.dc.Za.oi{constructor(a,b,c){super(a,b,c)}la(){return Q(olympe.dc.Za.Kj)}F(){return olympe.dc.mb.Um}Nb(){return olympe.C.ea}};P('olympe.dc.valuedefs.BooleanProperty',olympe.dc.Za.Kj);olympe.dc.Za.Re=class{constructor(a){this.value=a}la(){return Q(olympe.dc.Za.Re)}j(){return[]}getValue(){return this.value}ga(a){a=
|
|
983
|
-
d(g,h,k,!1),delete e[h]}}ga(a){return'{"c":"'+this.la()+'","a":['+this.D.ga(a)+']}'}toString(){return'Filter('+this.D.toString()+')'}};P('olympe.dc.transformers.Filter',olympe.dc.ba.uf);olympe.dc.ba.uf.xa=[olympe.dc.Gf,olympe.dc.Dq];olympe.dc.ba.Nl=class{constructor(a,b,c,d){this.D=new olympe.dc.Ra.Relation(olympe.dc.fa(a),c||olympe.dc.va.DESTINATION);this.F=new olympe.dc.Ra.Relation(olympe.dc.fa(b),d||olympe.dc.va.DESTINATION)}Nb(){return Mf(this.D)}la(){return Q(olympe.dc.ba.Nl)}j(a,b,c){const d=olympe.dc.ia(),e={},f=this.D.X(),g=this.D.Ka(),h=this.F.X(),k=this.F.Ka();let l=null,n=null;const p=(r,t,u,x,y,z)=>{if(y){if(y=()=>{const A=olympe.V.tb(u+g+(f+'_'+r)+z,20),K=
|
|
984
|
-
u,x,f,g);c(!0,z,A,K)},y.ws=r,e[x]=y,null===l||r<l)n&&n(),y()}else if(l===r){n();e[x]=!0;y=Infinity;let A=null;for(let K=Object.keys(e),X=K.length,xa=0;xa<X;xa++){let ab=e[K[xa]];ab.ws<y&&(y=ab.ws,A=ab)}A&&A()}},q=(r,t,u,x,y)=>{x?e[y]||(e[y]=!0,
|
|
985
|
-
'","'+this.F.toString()+'"]}'}toString(){return'FirstRelated('+this.D.toString()+', '+this.F.toString()+')'}};P('olympe.dc.transformers.FirstRelated',olympe.dc.ba.Nl);olympe.dc.ba.Nl.xa=[olympe.dc.Gf];olympe.dc.ba.Bh=class{constructor(a,b){this.start=a;this.D=b}Nb(){return null}la(){return Q(olympe.dc.ba.Bh)}j(a,b,c){const d=new olympe.dc.lc.cm;let e,f,g,h=!1;const k=()=>{if(void 0!==f&&void 0!==g&&void 0!==e){var n=f+g;b.D||(b.j.j=e[0>n-1?0:Math.min(e.length,n)-1]);
|
|
986
|
-
this.la()+'","a":['+
|
|
987
|
-
olympe.dc.ba.dk=class{constructor(a,b){this.direction=b||olympe.dc.va.DESTINATION;this.ob=a.map(c=>new olympe.dc.Ra.Relation(c,this.direction))}Nb(){return olympe.dc.CloudObject}la(){return Q(olympe.dc.ba.dk)}Ka(){return this.direction}j(a,b,c){const d=olympe.dc.ia(),e=(f,g,h,k)=>T(d,f,k,(l,n)=>{var p=k.X();p=olympe.V.tb(g+k.Ka()+p+n,20);const q=
|
|
988
|
-
{d.D(g,l,h)})}}ga(){return'{"c":"'+this.la()+'","a":['+JSON.stringify(
|
|
989
|
-
q,r,h,k||g);null===k&&b.register(y,q,r,h,f)}}},n=(p,q,r,t,u,x)=>{u&&!b.D&&l(p,t,x);p>=this.F?c(u,x,t,
|
|
990
|
-
P('olympe.dc.transformers.RecursiveRelated',olympe.dc.ba.Fe);olympe.dc.ba.Fe.xa=[olympe.dc.Gf];olympe.dc.ba.Ve=class extends olympe.dc.Ra.Relation{constructor(a,b){super(a,b||olympe.dc.va.DESTINATION)}Nb(){return Mf(this)}la(){return Q(olympe.dc.ba.Ve)}$b(){return new olympe.dc.ba.Ve(this.tag,this.direction===olympe.dc.va.DESTINATION?olympe.dc.va.ORIGIN:olympe.dc.va.DESTINATION)}j(a,b,c){const d=olympe.dc.ia(),e=this.X(),f=this.Ka();return(g,h,k,l)=>{
|
|
981
|
+
b=this.D||b;null!==this.ba?Fm(a,b,this.ba,d=>{Gm(this,d,c)}):Gm(this,b,c);return c.rb()}ga(a){const b=em(a,this.H),c=em(a,this.D);let d='null';this.ba&&(d=this.ba.map(function(e){return e.ga(a)}).join(','));return`{"c":"${this.la()}","a":["${b}",${d},${c}]}`}toString(){const a=dm(this.H),b=this.D?','+dm(this.D):'';let c='';this.ba&&(c=','+this.ba.join(','));return this.la().replace(/^.+\./,'')+'('+a+c+b+')'}};olympe.dc.Za.oi.xa=[olympe.dc.Fk];olympe.dc.Za.Sn=class{constructor(a,b){if(olympe.C.kf(a))throw Error('Dataflows of Property not supported by AnyProperty');const c=a.X();var d=olympe.dc.ia();const e=d.Jb(a,olympe.dm.Property.typeRel);if(!e)throw Error('Type of property '+a+'unavailable locally, cannot proceed with AnyProperty');a=d.eh(e,olympe.dc.CloudObject.extendRel,olympe.dm.De);d=null;switch(1<a.length?a[a.length-2]:e){case olympe.dm.String.O.X():d=new olympe.dc.Za.Yi(c,b);break;case olympe.dm.Number.O.X():d=new olympe.dc.Za.Pi(c,
|
|
982
|
+
b);break;case olympe.dm.Boolean.O.X():d=new olympe.dc.Za.Kj(c,b);break;case olympe.dm.DateTime.O.X():d=new olympe.dc.Za.xi(c,b)}this.D=d}la(){return this.D.la()}j(){return this.D.j()}getValue(a,b){return this.D.getValue(a,b)}ga(a){return this.D.ga(a)}toString(){return this.D.toString()}};olympe.dc.Za.Sn.xa=[olympe.dc.Fk];olympe.dc.Za.Kj=class extends olympe.dc.Za.oi{constructor(a,b,c){super(a,b,c)}la(){return Q(olympe.dc.Za.Kj)}F(){return olympe.dc.mb.Um}Nb(){return olympe.C.ea}};P('olympe.dc.valuedefs.BooleanProperty',olympe.dc.Za.Kj);olympe.dc.Za.Re=class{constructor(a){this.value=a}la(){return Q(olympe.dc.Za.Re)}j(){return[]}getValue(){return this.value}ga(a){a=em(a,this.value);return`{"c":"${this.la()}","a":[${a}]}`}toString(){return`Constant(${dm(this.value)})`}};P('olympe.dc.valuedefs.Constant',olympe.dc.Za.Re);olympe.dc.Za.Re.xa=[olympe.dc.Fk];olympe.dc.Za.xi=class extends olympe.dc.Za.oi{constructor(a,b,c){super(a,b,c)}la(){return Q(olympe.dc.Za.xi)}F(){return olympe.dc.mb.Vm}Nb(){return olympe.C.eb}};P('olympe.dc.valuedefs.DateTimeProperty',olympe.dc.Za.xi);olympe.dc.Za.Pi=class extends olympe.dc.Za.oi{constructor(a,b,c){super(a,b,c)}la(){return Q(olympe.dc.Za.Pi)}F(){return olympe.dc.mb.Wm}Nb(){return olympe.C.aa}};P('olympe.dc.valuedefs.NumberProperty',olympe.dc.Za.Pi);olympe.dc.Za.Yi=class extends olympe.dc.Za.oi{constructor(a,b,c){super(a,b,c)}la(){return Q(olympe.dc.Za.Yi)}F(){return olympe.dc.mb.Xm}Nb(){return olympe.C.Sa}};P('olympe.dc.valuedefs.StringProperty',olympe.dc.Za.Yi);olympe.dc.Za.$i=class{la(){return Q(olympe.dc.Za.$i)}j(){return[]}getValue(a,b){return b}ga(){return'{"c":"'+this.la()+'","a":[]}'}toString(){return'Tag()'}};P('olympe.dc.valuedefs.Tag',olympe.dc.Za.$i);olympe.dc.Za.$i.xa=[olympe.dc.Fk];olympe.dc.ba={};olympe.dc.ba.yi=class{Nb(){return null}la(){return Q(olympe.dc.ba.yi)}j(a,b,c){const d={};return function(e,f,g,h){e?void 0===d[f]?(d[f]=1,b.j.j!==g||b.D||(b.j.j=f),c(!0,f,f,bm(h,!0,f,f))):(d[f]++,xm(b,g)):void 0!==d[f]&&0>=--d[f]&&(delete d[f],c(!1,f,f,bm(h,!1,f,f)))}}ga(){return'{"c":"'+this.la()+'"}'}toString(){return'Distinct()'}};P('olympe.dc.transformers.Distinct',olympe.dc.ba.yi);olympe.dc.ba.yi.xa=[olympe.dc.Gf];olympe.dc.ba.uf=class{constructor(a){this.D=a}Nb(){return null}la(){return Q(olympe.dc.ba.uf)}F(){return this.D.D()}j(a,b,c){function d(f,g,h,k){k=k.valueOf();!1===k&&xm(b,g);k!==!!e[g]&&(e[g]=k,c(k,f,g,bm(h,k,f,g)))}const e={};return(f,g,h,k)=>{const l='@'+h;if(f){let n=this.D.j(a,g);olympe.C.hb(n)&&(n=n.Ba);olympe.C.Rf(n)?(b.D||void 0!==olympe.C.Pa(n)||xm(b,h),e[l]=n,a.run(()=>{olympe.C.Sc([n],p=>{d(g,h,k,p)},'filterResultHandler')})):d(g,h,k,n)}else void 0!==e[l]&&(e[l].destroy(),delete e[l]),
|
|
983
|
+
d(g,h,k,!1),delete e[h]}}ga(a){return'{"c":"'+this.la()+'","a":['+this.D.ga(a)+']}'}toString(){return'Filter('+this.D.toString()+')'}};P('olympe.dc.transformers.Filter',olympe.dc.ba.uf);olympe.dc.ba.uf.xa=[olympe.dc.Gf,olympe.dc.Dq];olympe.dc.ba.Nl=class{constructor(a,b,c,d){this.D=new olympe.dc.Ra.Relation(olympe.dc.fa(a),c||olympe.dc.va.DESTINATION);this.F=new olympe.dc.Ra.Relation(olympe.dc.fa(b),d||olympe.dc.va.DESTINATION)}Nb(){return Mf(this.D)}la(){return Q(olympe.dc.ba.Nl)}j(a,b,c){const d=olympe.dc.ia(),e={},f=this.D.X(),g=this.D.Ka(),h=this.F.X(),k=this.F.Ka();let l=null,n=null;const p=(r,t,u,x,y,z)=>{if(y){if(y=()=>{const A=olympe.V.tb(u+g+(f+'_'+r)+z,20),K=bm(t,!0,z,A);l=r;n=()=>{c(!1,z,A,bm(t,!1,z,A))};b.register(A,
|
|
984
|
+
u,x,f,g);c(!0,z,A,K)},y.ws=r,e[x]=y,null===l||r<l)n&&n(),y()}else if(l===r){n();e[x]=!0;y=Infinity;let A=null;for(let K=Object.keys(e),X=K.length,xa=0;xa<X;xa++){let ab=e[K[xa]];ab.ws<y&&(y=ab.ws,A=ab)}A&&A()}},q=(r,t,u,x,y)=>{x?e[y]||(e[y]=!0,ym(b,u,y,f,g),ym(b,u,y,h,k),T(d,y,this.D,p.bind(this,r,t,u,y),u+'_val'),T(d,y,this.F,q.bind(this,r+1,t,u),u+'_follow')):(d.D(y,this.F,u+'_follow'),d.D(y,this.D,u+'_val'),delete e[y])};return(r,t,u,x)=>q(0,x,u,r,t)}ga(){return'{"c":"'+this.la()+'","a":["'+this.D.toString()+
|
|
985
|
+
'","'+this.F.toString()+'"]}'}toString(){return'FirstRelated('+this.D.toString()+', '+this.F.toString()+')'}};P('olympe.dc.transformers.FirstRelated',olympe.dc.ba.Nl);olympe.dc.ba.Nl.xa=[olympe.dc.Gf];olympe.dc.ba.Bh=class{constructor(a,b){this.start=a;this.D=b}Nb(){return null}la(){return Q(olympe.dc.ba.Bh)}j(a,b,c){const d=new olympe.dc.lc.cm;let e,f,g,h=!1;const k=()=>{if(void 0!==f&&void 0!==g&&void 0!==e){var n=f+g;b.D||(b.j.j=e[0>n-1?0:Math.min(e.length,n)-1]);pm(d,e,f,n,c)}};a.run(()=>olympe.C.Sc([this.start,this.D],(n,p)=>{f=n.valueOf();g=p.valueOf();k()}));Dm(b,k);const l=Am(b);zm(b,l);return(n,p,q,r)=>{h||(r.me().rg(t=>{e=t;Em(b,l)}),$l(b,()=>r.ig(),l),h=!0);d.j(n,p,q,null);am(b,q,l)}}ga(a){return'{"c":"'+
|
|
986
|
+
this.la()+'","a":['+em(a,this.start)+','+em(a,this.D)+']}'}toString(){return`Limit(${olympe.C.Pa(this.start)},${olympe.C.Pa(this.D)})`}};P('olympe.dc.transformers.Limit',olympe.dc.ba.Bh);olympe.dc.ba.Bh.xa=[olympe.dc.Gf];function Hm(a){return a.ob.map(b=>b.X())}
|
|
987
|
+
olympe.dc.ba.dk=class{constructor(a,b){this.direction=b||olympe.dc.va.DESTINATION;this.ob=a.map(c=>new olympe.dc.Ra.Relation(c,this.direction))}Nb(){return olympe.dc.CloudObject}la(){return Q(olympe.dc.ba.dk)}Ka(){return this.direction}j(a,b,c){const d=olympe.dc.ia(),e=(f,g,h,k)=>T(d,f,k,(l,n)=>{var p=k.X();p=olympe.V.tb(g+k.Ka()+p+n,20);const q=bm(h,l,n,p);l&&b.register(p,g,f,k.X(),k.Ka());c(l,n,p,q)},g);return(f,g,h,k)=>{f?this.ob.forEach(l=>{ym(b,h,g,l.X(),l.Ka());e(g,h,k,l)}):this.ob.forEach(l=>
|
|
988
|
+
{d.D(g,l,h)})}}ga(){return'{"c":"'+this.la()+'","a":['+JSON.stringify(Hm(this))+',"'+this.direction+'"]}'}toString(){return'MultiRelated('+this.Ka()+'['+Hm(this).join(',')+'])'}};P('olympe.dc.transformers.MultiRelated',olympe.dc.ba.dk);olympe.dc.ba.dk.xa=[olympe.dc.Gf];olympe.dc.ba.Fe=class extends olympe.dc.Ra.Relation{constructor(a,b=olympe.dc.va.DESTINATION,c=1,d=-1){super(a,b);this.F=c;this.D=d}Nb(){return Mf(this)}la(){return Q(olympe.dc.ba.Fe)}j(a,b,c){const d=olympe.dc.ia(),e=Object.create(null),f=olympe.dc.va.ORIGIN,g=olympe.dc.va.DESTINATION,h=this.X(),k=this.Ka(),l=(p,q,r)=>{if(!(0<=this.D&&p>=this.D)){var t=d.bb(r,this);p+=1;for(let u=0,x=t.length;u<x;u++){if(void 0!==e[t[u]]||r===t[u])continue;const y=olympe.V.tb(q+k+(h+'_'+p)+t[u],20);b.register(y,
|
|
989
|
+
q,r,h,k||g);null===k&&b.register(y,q,r,h,f)}}},n=(p,q,r,t,u,x)=>{u&&!b.D&&l(p,t,x);p>=this.F?c(u,x,t,bm(r,u,x,t)):ym(b,t,x,h,k);0<=this.D&&p>=this.D||(u?e[x]||(e[x]=!0,T(d,x,this,(y,z)=>{const A=p+1,K=olympe.V.tb(t+k+(h+'_'+A)+z,20);n(A,x,r,K,y,z)},t)):(d.D(x,this,t),delete e[x]))};return(p,q,r,t)=>n(0,null,t,r,p,q)}ga(){return'{"c":"'+this.la()+'","a":["'+this.X()+'","'+this.Ka()+'",'+this.F+','+this.D+']}'}toString(){return'RecursiveRelated('+this.Ka()+this.X()+'['+this.F+'..'+this.D+'])'}};
|
|
990
|
+
P('olympe.dc.transformers.RecursiveRelated',olympe.dc.ba.Fe);olympe.dc.ba.Fe.xa=[olympe.dc.Gf];olympe.dc.ba.Ve=class extends olympe.dc.Ra.Relation{constructor(a,b){super(a,b||olympe.dc.va.DESTINATION)}Nb(){return Mf(this)}la(){return Q(olympe.dc.ba.Ve)}$b(){return new olympe.dc.ba.Ve(this.tag,this.direction===olympe.dc.va.DESTINATION?olympe.dc.va.ORIGIN:olympe.dc.va.DESTINATION)}j(a,b,c){const d=olympe.dc.ia(),e=this.X(),f=this.Ka();return(g,h,k,l)=>{ym(b,k,h,e,f);g?T(d,h,this,(n,p)=>{const q=olympe.V.tb(k+f+e+p,20),r=bm(l,n,p,q);n&&b.register(q,k,h,e,f);c(n,p,q,r)},k):d.D(h,this,k)}}ga(){return'{"c":"'+
|
|
991
991
|
this.la()+'","a":["'+this.X()+'","'+this.Ka()+'"]}'}toString(){return'Related('+this.Ka()+this.X()+')'}};P('olympe.dc.transformers.Related',olympe.dc.ba.Ve);olympe.dc.ba.Ve.xa=[olympe.dc.Gf];olympe.dc.ba.Tg=class{constructor(a,b){this.Hb=a;this.D=void 0===b?!0:!!b}Nb(){return null}la(){return Q(olympe.dc.ba.Tg)}$g(){return this.Hb}F(){return[this.Hb.H()]}j(a,b,c){const d=new olympe.dc.lc.qr(a.rc(this.D?this.Hb.compare.bind(this.Hb):(e,f)=>this.Hb.compare(f,e)));return(e,f,g)=>{var h=e?this.Hb.F(a,f):void 0;h=d.j(e,f,g,h);c(e,f,g,h)}}ga(a){return'{"c":"'+this.la()+'","a":['+this.Hb.ga(a)+','+JSON.stringify(this.D)+']}'}toString(){return'Sort('+this.Hb.toString()+','+JSON.stringify(this.D)+
|
|
992
|
-
')'}};P('olympe.dc.transformers.Sort',olympe.dc.ba.Tg);olympe.dc.ba.Tg.xa=[olympe.dc.Gf,olympe.dc.Dq];function
|
|
993
|
-
olympe.dc.ba.Hf=class{constructor(a,b){this.ba=this.D=null;a instanceof olympe.dc.za?(this.D=a.Yd(),this.ba=a.Xl()):(this.D=a,b&&(this.ba=b))}Nb(){return null}la(){return Q(olympe.dc.ba.Hf)||''}gh(){return this.ba}Yd(){return this.D}j(a,b,c){const d=new olympe.dc.lc.cm,e=new olympe.dc.lc.Jj;let f=[],g=[],h=!1,k=!1;const l=
|
|
994
|
-
u.gb()||(k||(t.me().rg(x=>{g=x;
|
|
995
|
-
P('olympe.dc.transformers.Union',olympe.dc.ba.Hf);olympe.dc.ba.Hf.xa=[olympe.dc.Gf];olympe.dc.ba.Vq={fB:1,bu:-1,au:0};olympe.dc.ba.HC={Pz:!0,oA:!1};olympe.dc.kc.P={Qp:'dc.legacy.listdefProcessor'};olympe.dc.kc.U={Pp:'dc.legacy.listdefsCovered'};olympe.W.config(a=>{F(a,olympe.dc.kc.U.Pp,!1);D(a,olympe.dc.kc.P.Qp,olympe.dc.kc.Tu,olympe.dc.query.P.Ca,olympe.dc.P.sh,olympe.dc.transaction.P.Da,olympe.dc.query.P.nk,new olympe.W.pa(olympe.dc.U.Mh),new olympe.W.pa(olympe.dc.kc.U.Pp))});olympe.W.run([olympe.dc.kc.P.Qp],a=>{olympe.dc.kc.Zx=()=>a});function
|
|
992
|
+
')'}};P('olympe.dc.transformers.Sort',olympe.dc.ba.Tg);olympe.dc.ba.Tg.xa=[olympe.dc.Gf,olympe.dc.Dq];function Im(a,b,c,d,e,f){function g(n,p){if(l)for(var q=l.length-1;0<=q;q--)f=l[q].j(b,e,f);e.register(h,null);q=d.j(n,p,c,null);f(n,p,h,bm(q,n,p,h))}const h=olympe.V.Ic(),k=olympe.dc.ia(),l=a.ba;b.run(()=>olympe.C.Sc([a.D],n=>{Jm(k,n,g,h);void 0===k.model(n)&&Xl(e)}))}function Jm(a,b,c,d){const e=b&&b.valueOf();e&&(sf(a,e,c,d),olympe.C.Xa().Td(()=>qf(a,e,d)))}
|
|
993
|
+
olympe.dc.ba.Hf=class{constructor(a,b){this.ba=this.D=null;a instanceof olympe.dc.za?(this.D=a.Yd(),this.ba=a.Xl()):(this.D=a,b&&(this.ba=b))}Nb(){return null}la(){return Q(olympe.dc.ba.Hf)||''}gh(){return this.ba}Yd(){return this.D}j(a,b,c){const d=new olympe.dc.lc.cm,e=new olympe.dc.lc.Jj;let f=[],g=[],h=!1,k=!1;const l=Am(b),n=Am(b);Dm(b,()=>{const p=f.concat(g);0<p.length?b.D||(b.j.j=p[p.length-1]):Em(b);pm(d,p,0,p.length,c)});zm(b,n);Im(this,a,this.D,e,b,(p,q,r,t)=>{const u=olympe.C.Xa();u.gd()||
|
|
994
|
+
u.gb()||(k||(t.me().rg(x=>{g=x;Em(b,n)}),$l(b,()=>t.ig(),n),k=!0),d.j(p,q,r),am(b,r,n))});zm(b,l);return(p,q,r,t)=>{h||(t.me().rg(u=>{f=u;Em(b,l)}),$l(b,()=>t.ig(),l),h=!0);d.j(p,q,r,l);am(b,r,l)}}ga(a){const b=this.ba?'['+this.ba.map(c=>c.ga(a)).join(',')+']':'null';return'{"c":"'+this.la()+'","a":['+em(a,this.D)+','+b+']}'}toString(){const a=olympe.C.hb(this.D)?'N:'+this.D.Ba.T():this.D.valueOf(),b=this.ba?','+this.ba.map(c=>c.toString()).join(','):'';return'Union('+a+b+')'}};
|
|
995
|
+
P('olympe.dc.transformers.Union',olympe.dc.ba.Hf);olympe.dc.ba.Hf.xa=[olympe.dc.Gf];olympe.dc.ba.Vq={fB:1,bu:-1,au:0};olympe.dc.ba.HC={Pz:!0,oA:!1};olympe.dc.kc.P={Qp:'dc.legacy.listdefProcessor'};olympe.dc.kc.U={Pp:'dc.legacy.listdefsCovered'};olympe.W.config(a=>{F(a,olympe.dc.kc.U.Pp,!1);D(a,olympe.dc.kc.P.Qp,olympe.dc.kc.Tu,olympe.dc.query.P.Ca,olympe.dc.P.sh,olympe.dc.transaction.P.Da,olympe.dc.query.P.nk,new olympe.W.pa(olympe.dc.U.Mh),new olympe.W.pa(olympe.dc.kc.U.Pp))});olympe.W.run([olympe.dc.kc.P.Qp],a=>{olympe.dc.kc.Zx=()=>a});function Km(a){const b=olympe.dc.ia(),c=new Map;b.ks(a).forEach(d=>{b.bb(d,olympe.dc.CloudObject.propertyRel).forEach(e=>{const f=b.name(e);c.has(f)||c.set(f,e)})});return c}
|
|
996
996
|
olympe.dc.CloudObject=class{constructor(a,b){this.tag=b;this.db=olympe.dc.ia();Object.defineProperty(this,'db',{enumerable:!1});this.model=null}static Oc(a,b,c,...d){b=olympe.dc.fa(b);var e=uf(b);if(e=e&&e.j)return e(a,c,...d);a=a.create(b);void 0!==c&&null!==c&&Y(a,olympe.dc.CloudObject.nameProp,c);return a.X()}static get(a){if(a instanceof olympe.dc.CloudObject)var b=a;else{b=olympe.dc.ns();a=olympe.dc.fa(a);var c=b.db.model(a);c=tf(b,c);if(null===c)throw new olympe.dc.rq(a);c=c.instantiate(a,b.D);
|
|
997
|
-
b.j.je([a],olympe.dc.db.Instance.j.Bp);b.Ra.register(c,a);b=c}return b}static exists(a){return olympe.dc.ia().Ha(olympe.dc.fa(a))}static ex(a,b,c){const d=olympe.dc.ia();let e=null;const f=k=>{null===e&&(e=
|
|
997
|
+
b.j.je([a],olympe.dc.db.Instance.j.Bp);b.Ra.register(c,a);b=c}return b}static exists(a){return olympe.dc.ia().Ha(olympe.dc.fa(a))}static ex(a,b,c){const d=olympe.dc.ia();let e=null;const f=k=>{null===e&&(e=Km(b||this));return e.has(k)?e.get(k):null},g=Al(!1),h=g.create(null!=b?b:this);void 0!==c&&h.ki(c);a.forEach((k,l)=>{d.Ha(olympe.dc.fa(l))?Y(h,l,k):(l=f(l))&&Y(h,l,k)});g.nb((k,l)=>{k||olympe.ja.ab('dc').error(`Error occurred for transaction executed by CloudObject.createWith: ${l}`)});return this.get(h)}static Nw(){return this.get(this)}static Yk(a){return olympe.dc.ma.Yk(a)}static Db(){return olympe.dc.ia().bb(this,
|
|
998
998
|
olympe.dc.CloudObject.propertyRel).map(a=>new olympe.dc.Ra.Property(a))}static Ed(){const a=olympe.dc.ia();return a.bb(this,olympe.dc.CloudObject.yj).map(b=>new olympe.dc.Ra.Relation(b)).concat(a.bb(this,olympe.dc.CloudObject.Zr).map(b=>new olympe.dc.Ra.Relation(b,olympe.dc.va.ORIGIN)))}static Qc(a){return olympe.dc.CloudObject.get(a)}static ps(a){var b=tf(olympe.dc.ns(),olympe.dc.fa(a));b=b&&b.D;return new olympe.dc.za(olympe.dc.fa(a),olympe.dc.CloudObject.instancesRel,b)}X(){return this.tag}name(){return this.db.name(this)}la(){return this.wb(olympe.dc.CloudObject.nameProp)}Wb(){this.model||
|
|
999
999
|
(this.model=olympe.dc.CloudObject.get(this.db.model(this)));return this.model}query(){return olympe.dc.ma.from(this)}Le(){return this.db.Le(this)}sb(){return this.db.source(this)}Wx(){return this.db.ji(this)?olympe.dc.ae().fromModel(this):null}js(){return olympe.C.ta([this.la()],a=>olympe.C.xb(a),olympe.C.Sa,'getDisplayName',olympe.C.xb('('+this.toString()+')'))}ac(){return this.model?this.model.X():this.db.model(this)}observe(a,b,c=!0){const d='function'===typeof a.Cb?a.Cb():a;return new rxjs.Observable(e=>
|
|
1000
1000
|
{const f=olympe.dc.mb.Bc(this.db.Qa(this.tag,b));c||null!==f||e.next(f);const g=Lg(this.db,this.tag,b,h=>{e.next(olympe.dc.mb.Bc(h))});d.Td(()=>{e.complete();Mg(this.db,this.tag,b,g)});return()=>Mg(this.db,this.tag,b,g)})}fz(a){const b='function'===typeof a.Cb?a.Cb():a;return new rxjs.Observable(c=>{const d=Ng(this.db,this.tag,(e,f)=>{null===f||void 0===f?c.next([new olympe.dc.Ra.Property(e),null]):c.next([new olympe.dc.Ra.Property(e),f])});b.Td(()=>{c.complete();Og(this.db,this.tag,d)});return()=>
|
|
@@ -1021,11 +1021,11 @@ B('olympe.dm.User.loginProp',olympe.dm.User.loginProp);olympe.dm.User.D=olympe.d
|
|
|
1021
1021
|
olympe.dm.User.SAMLnameIdProp=olympe.dm.User.O.ka('ff023000000000000036');B('olympe.dm.User.SAMLnameIdProp',olympe.dm.User.SAMLnameIdProp);olympe.dm.User.F=R(olympe.dm.User.O,olympe.dm.Qd.j);olympe.dm.User.Y=olympe.dm.User.O.sa('ff022000000000000002');olympe.dm.User.j=Jf('014831d95fd7d12b8568','ADMIN_USER');olympe.dm.User.H=Jf('0163d9653067b6237f62','GUEST_USER');m=olympe.dm.User.prototype;m.Tx.K=olympe.C.J.D;m.la.K=olympe.C.J.D;m.jn.K=olympe.C.J.D;m.xu.K=olympe.C.J.D;m.wu.K=olympe.C.J.D;m.qy.K=olympe.C.J.D;
|
|
1022
1022
|
m.Ay.K=olympe.C.J.D;m.oy.K=new olympe.C.J(()=>olympe.dc.za,[]);olympe.dm.ag=class extends olympe.dc.CloudObject{Y(){return this.en()}Ga(){return this.wb(olympe.dm.ag.ua)}};olympe.dm.ag.O=olympe.dc.na.j('01621fb84e3300000000',olympe.dm.ag);olympe.dm.ag.ua=olympe.dm.ag.O.ka('01609de3f292e3c2c6ff');olympe.dm.ag.prototype.Y.K=new olympe.C.J(()=>olympe.C.qd,[]);olympe.dm.ag.prototype.Ga.K=olympe.C.J.D;olympe.dm.BrickMetadata=class extends olympe.dm.ag{By(){return this.wb(olympe.dm.BrickMetadata.zc)}Hc(){return this.wb(olympe.dm.BrickMetadata.da)}getType(){return this.wb(olympe.dm.BrickMetadata.Mb)}My(){return this.dh(olympe.dm.BrickMetadata.zb)}qe(){return null}Dx(){return this.bb(olympe.sc.ui.Yw.Comment.gE.$b(),olympe.sc.ui.Yw.Comment)}Sk(){return this.ng(olympe.dm.BrickMetadata.Ga).Fc().Sk()}};olympe.dm.BrickMetadata.O=Of(olympe.dc.na.j('01621fb84e3500000000',olympe.dm.BrickMetadata));
|
|
1023
1023
|
olympe.dm.BrickMetadata.zc=olympe.dm.BrickMetadata.O.ka('01621fb84e320000f001');olympe.dm.BrickMetadata.da=olympe.dm.BrickMetadata.O.ka('01703376c4a81c0e9d94');olympe.dm.BrickMetadata.Mb=olympe.dm.BrickMetadata.O.ka('01703376c4a81c0e9d00');olympe.dm.BrickMetadata.zb=olympe.dm.BrickMetadata.O.ka('01703376c4a81c0eaea5');olympe.dm.BrickMetadata.Ga=olympe.dm.BrickMetadata.O.sa('0161ae97622bb21f335b');olympe.dm.BrickMetadata.Rd={YB:'private',$B:'public'};
|
|
1024
|
-
olympe.dm.BrickMetadata.Vb={AA:'experimental',oC:'stable',nA:'deprecated'};olympe.dm.BrickMetadata.Id={aA:'business',KC:'technical'};m=olympe.dm.BrickMetadata.prototype;m.By.K=olympe.C.J.D;m.Hc.K=olympe.C.J.D;m.getType.K=olympe.C.J.D;m.My.K=olympe.C.J.N;m.qe.K=new olympe.C.J(()=>String,[]);m.Dx.K=new olympe.C.J(()=>olympe.dc.za,[]);m.Sk.K=olympe.C.J.R;function
|
|
1025
|
-
function
|
|
1026
|
-
function
|
|
1024
|
+
olympe.dm.BrickMetadata.Vb={AA:'experimental',oC:'stable',nA:'deprecated'};olympe.dm.BrickMetadata.Id={aA:'business',KC:'technical'};m=olympe.dm.BrickMetadata.prototype;m.By.K=olympe.C.J.D;m.Hc.K=olympe.C.J.D;m.getType.K=olympe.C.J.D;m.My.K=olympe.C.J.N;m.qe.K=new olympe.C.J(()=>String,[]);m.Dx.K=new olympe.C.J(()=>olympe.dc.za,[]);m.Sk.K=olympe.C.J.R;function $i(a,b){b=b.startsWith('data.')?b.substring(5):b;let c,d;return null!=(d=null!=(c=olympe.W.getParameter(`${'data.'}${a}.${b}`))?c:olympe.W.getParameter(`${'data.'}${b}`))?d:olympe.W.getParameter(`${olympe.dc.sources.zh.rv}${b}`)}
|
|
1025
|
+
function rj(a,b){const c=a.query().fb(olympe.dm.wd.j.$b()).fb(olympe.dm.wd.D);a=a.query().fb(olympe.dm.ib.D.$b()).mg(olympe.dm.ib.F,!0).fb(olympe.sc.yc.j.$b());const d=e=>e.ie().mg(olympe.dc.CloudObject.extendRel,!0).fb(olympe.dc.CloudObject.yj,!0).fb(olympe.dm.Relation.destinationModelRel).back(2).fb(olympe.dc.CloudObject.propertyRel,!0).fb(olympe.dm.Property.typeRel).observe(b);return rxjs.combineLatest([d(c),d(a)]).pipe(rxjs.operators.map(([e,...f])=>e.concat(...f)))}
|
|
1026
|
+
function Qj(a,b){return a.observe(b,olympe.dm.DataSource.Ur).pipe(rxjs.operators.map(()=>a.Lf(olympe.dc.sources.U.Qe)),rxjs.operators.distinctUntilChanged())}
|
|
1027
1027
|
olympe.dm.DataSource=class extends olympe.dc.CloudObject{constructor(a,b,c){super(a,b);this.Tb=c;this.Wr=new Map([[olympe.dc.sources.U.qm,olympe.dm.DataSource.rz],[olympe.dc.sources.U.Qe,olympe.dm.DataSource.Ur],[olympe.dc.sources.U.xm,olympe.dm.DataSource.wz]])}T(){return this.tag===olympe.dm.DataSource.SERVER?olympe.dc.Ja.SERVER:this.tag}Lf(a){const b=a.startsWith('data.')?a.split('.')[1]:a,c=`${'data.'}${b}`;let d,e;return null!=(e=null!=(d=olympe.W.getParameter(`${'data.'}${this.name().toLowerCase().replace(/\W/g,
|
|
1028
|
-
'_')}.${b}`))?d
|
|
1028
|
+
'_')}.${b}`))?d:$i(this.X(),a))?e:this.Wr.has(c)?this.get(this.Wr.get(c)):null}Hc(){const a=this;return w(function*(){const b=olympe.dm.DataSource.oc.Ft,c=olympe.dm.DataSource.oc.Ab,d=new olympe.dc.Request(olympe.dc.Request.j.oc,a.T());return a.Tb.request(d).then(e=>{let f;const g=null!=(f=null==e?void 0:e.s)?f:c;(e=null==e?void 0:e.r)&&olympe.ja.ab('dc').warn(`Source ${a.name()} (${a.T()}) has encountered issues: ${e}`);return g}).catch(e=>{const f=olympe.L.errors.jq;return e instanceof olympe.L.errors.Dk||
|
|
1029
1029
|
e instanceof f?b:c})})}init(){const a=this;return w(function*(){if(a.constructor===olympe.dm.DataSource)throw Error(`Data source ${a.name()} (${a.tag}) has no implementation (is the file missing ?)`);})}destroy(){return w(function*(){})}healthCheck(){return w(function*(){})}executeQuery(a){return w(function*(){return olympe.dc.query.zd.mj(a)})}applyTransaction(){return w(function*(){})}uploadFileContent(){return w(function*(){throw Error('Should not try to upload files with SELF source');})}downloadFileContent(){return w(function*(){throw Error('Should not try to download files with SELF source');
|
|
1030
1030
|
})}deleteFileContent(){return w(function*(){})}};olympe.dm.DataSource.prototype.deleteFileContent=olympe.dm.DataSource.prototype.deleteFileContent;olympe.dm.DataSource.prototype.downloadFileContent=olympe.dm.DataSource.prototype.downloadFileContent;olympe.dm.DataSource.prototype.uploadFileContent=olympe.dm.DataSource.prototype.uploadFileContent;olympe.dm.DataSource.prototype.applyTransaction=olympe.dm.DataSource.prototype.applyTransaction;olympe.dm.DataSource.prototype.executeQuery=olympe.dm.DataSource.prototype.executeQuery;
|
|
1031
1031
|
olympe.dm.DataSource.prototype.healthCheck=olympe.dm.DataSource.prototype.healthCheck;olympe.dm.DataSource.prototype.destroy=olympe.dm.DataSource.prototype.destroy;olympe.dm.DataSource.prototype.init=olympe.dm.DataSource.prototype.init;olympe.dm.DataSource.prototype.getConfig=olympe.dm.DataSource.prototype.Lf;olympe.dm.DataSource.prototype.getId=olympe.dm.DataSource.prototype.T;olympe.dm.DataSource.O=olympe.dc.na.j('ff021000000000000060',olympe.dm.DataSource,olympe.dc.P.Ng);
|
|
@@ -1049,92 +1049,92 @@ olympe.dm.ib.Bd=Jf('100000000000000000dd','PRIMORDIAL');olympe.dm.ib.prototype.j
|
|
|
1049
1049
|
B('olympe.dm.Property.definingModelRel',olympe.dm.Property.definingModelRel);olympe.dm.Property.typeRel=R(olympe.dm.Property.O,olympe.dc.CloudObject.typeRel);B('olympe.dm.Property.typeRel',olympe.dm.Property.typeRel);olympe.dm.Property.prototype.j.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);olympe.dm.Property.prototype.getType.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);olympe.dm.Property.prototype.D.K=olympe.C.J.j;olympe.dm.Relation=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}Yx(){return olympe.C.Sa.EMPTY}Ax(){return this.sd(olympe.dm.Relation.D)}ky(){return this.sd(olympe.dm.Relation.F)}hs(){return this.bb(olympe.dm.Relation.destinationModelRel,olympe.dc.CloudObject).Gc()}ss(){return this.bb(olympe.dm.Relation.originModelRel,olympe.dc.CloudObject).Gc()}Uc(){return this.ss().la().concat(['-',this.la(),'->',this.hs().la()])}};olympe.dm.Relation.O=olympe.dc.na.j('ff021000000000000006',olympe.dm.Relation);
|
|
1050
1050
|
olympe.dm.Relation.F=olympe.dm.Relation.O.ka('ff023000000000000030');olympe.dm.Relation.D=olympe.dm.Relation.O.ka('ff023000000000000034');olympe.dm.Relation.da=olympe.dm.Relation.O.ka(olympe.dc.Lb.Ho);olympe.dm.Relation.Y=olympe.dm.Relation.O.ka(olympe.dc.Lb.Dc);olympe.dm.Relation.ha=olympe.dm.Relation.O.ka(olympe.dc.Lb.fg);olympe.dm.Relation.ua=olympe.dm.Relation.O.ka(olympe.dc.Lb.Wv);olympe.dm.Relation.$=olympe.dm.Relation.O.ka(olympe.dc.Lb.Gt);olympe.dm.Relation.Ga=olympe.dm.Relation.O.ka(olympe.dc.Lb.rw);
|
|
1051
1051
|
olympe.dm.Relation.R=olympe.dm.Relation.O.ka('ff023000000000000031');olympe.dm.Relation.originModelRel=R(olympe.dm.Relation.O,olympe.dc.CloudObject.yj);B('olympe.dm.Relation.originModelRel',olympe.dm.Relation.originModelRel);olympe.dm.Relation.destinationModelRel=R(olympe.dm.Relation.O,olympe.dc.CloudObject.Zr);B('olympe.dm.Relation.destinationModelRel',olympe.dm.Relation.destinationModelRel);olympe.dm.Relation.j={yp:0,ft:5,Fv:1,iC:4,yr:2,Qq:8,zA:10,fC:6,gC:9,Se:6,hC:9};
|
|
1052
|
-
olympe.dm.Relation.H={LB:3,hv:4,xB:5,wB:6};olympe.dm.Relation.N=olympe.dm.ll.kv+olympe.dm.ll.Ct;m=olympe.dm.Relation.prototype;m.Yx.K=olympe.C.J.D;m.Ax.K=olympe.C.J.F;m.ky.K=olympe.C.J.F;m.hs.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.ss.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);function
|
|
1052
|
+
olympe.dm.Relation.H={LB:3,hv:4,xB:5,wB:6};olympe.dm.Relation.N=olympe.dm.ll.kv+olympe.dm.ll.Ct;m=olympe.dm.Relation.prototype;m.Yx.K=olympe.C.J.D;m.Ax.K=olympe.C.J.F;m.ky.K=olympe.C.J.F;m.hs.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.ss.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);function Lm(a){a=olympe.dc.fa(a);if(olympe.dc.ia().Qf(a,olympe.dm.String))return olympe.dm.String.valueProp;switch(a){case olympe.dm.Number.O.X():return olympe.dm.Number.valueProp;case olympe.dm.Boolean.O.X():return olympe.dm.Boolean.valueProp;case olympe.dm.DateTime.O.X():return olympe.dm.DateTime.valueProp;case olympe.dm.Color.O.X():return olympe.dm.Color.valueProp;default:throw Error('Unknown primitive model: '+a);}}olympe.dm.De=class extends olympe.dc.CloudObject{getValue(){}};
|
|
1053
1053
|
olympe.dm.De.O=olympe.dc.na.j('ff021000000000000019',olympe.dm.De);olympe.dm.String=class extends olympe.dm.De{getValue(){return this.wb(olympe.dm.String.valueProp)}Bc(){return this.get(olympe.dm.String.valueProp)}toString(){let a;return null!=(a=this.get(olympe.dm.String.valueProp))?a:''}};olympe.dm.String.O=olympe.dc.na.j('ff021000000000000011',olympe.dm.String);olympe.dm.String.valueProp=olympe.dm.String.O.ka('ff023000000000000026');B('olympe.dm.String.valueProp',olympe.dm.String.valueProp);olympe.dm.String.prototype.getValue.K=olympe.C.J.D;
|
|
1054
1054
|
olympe.dm.String.prototype.toString.K=olympe.C.J.j;olympe.dm.Boolean=class extends olympe.dm.De{getValue(){return this.dh(olympe.dm.Boolean.valueProp)}Bc(){return this.get(olympe.dm.Boolean.valueProp)}};olympe.dm.Boolean.O=olympe.dc.na.j('ff021000000000000012',olympe.dm.Boolean);olympe.dm.Boolean.valueProp=olympe.dm.Boolean.O.ka('ff023000000000000027');B('olympe.dm.Boolean.valueProp',olympe.dm.Boolean.valueProp);olympe.dm.Boolean.prototype.getValue.K=olympe.C.J.N;olympe.dm.Color=class extends olympe.dm.De{getValue(){return this.us()}Bc(){return this.get(olympe.dm.Color.valueProp)}};olympe.dm.Color.O=olympe.dc.na.j('ff021000000000000017',olympe.dm.Color);olympe.dm.Color.valueProp=olympe.dm.Color.O.ka('ff023000000000000032');B('olympe.dm.Color.valueProp',olympe.dm.Color.valueProp);olympe.dm.Color.prototype.getValue.K=new olympe.C.J(()=>olympe.C.Color,[]);olympe.dm.DateTime=class extends olympe.dm.De{getValue(){return this.rj(olympe.dm.DateTime.valueProp)}Bc(){return this.get(olympe.dm.DateTime.valueProp)}};olympe.dm.DateTime.O=olympe.dc.na.j('ff021000000000000014',olympe.dm.DateTime);olympe.dm.DateTime.valueProp=olympe.dm.DateTime.O.ka('ff023000000000000029');B('olympe.dm.DateTime.valueProp',olympe.dm.DateTime.valueProp);olympe.dm.DateTime.prototype.getValue.K=new olympe.C.J(()=>olympe.C.eb,[]);olympe.dm.Enum=class extends olympe.dm.String{la(){return olympe.C.ta([super.la(),super.getValue()],(a,b)=>''!==a.valueOf()?a:b,olympe.C.Sa)}Dd(){return this.sd(olympe.dm.Enum.rankProp)}};olympe.dm.Enum.O=olympe.dc.na.j('016cdd861b32d56c81f7',olympe.dm.Enum);olympe.dm.Enum.rankProp=olympe.dm.Enum.O.ka('017a7690c915975ea995');olympe.dm.Enum.prototype.Dd.K=olympe.C.J.F;olympe.dm.cg=class extends olympe.dm.BrickMetadata{zy(){return this.fb(olympe.dc.CloudObject.instancesRel).fl(olympe.dm.Enum.rankProp,olympe.dc.query.kk.ASC).Fc()}static create(a,b){b=a.create(olympe.dm.cg,(new Map).set(olympe.dc.CloudObject.nameProp,b));a.Oa(olympe.dc.CloudObject.extendRel,b,olympe.dm.Enum);return b}};olympe.dm.cg.create=olympe.dm.cg.create;olympe.dm.cg.prototype.getValues=olympe.dm.cg.prototype.zy;olympe.dm.cg.O=olympe.dc.na.j('017a768f966fc08ebb98',olympe.dm.cg);olympe.dm.Number=class extends olympe.dm.De{getValue(){return this.sd(olympe.dm.Number.valueProp)}Bc(){return this.get(olympe.dm.Number.valueProp)}};olympe.dm.Number.O=olympe.dc.na.j('ff021000000000000013',olympe.dm.Number);olympe.dm.Number.valueProp=olympe.dm.Number.O.ka('ff023000000000000028');B('olympe.dm.Number.valueProp',olympe.dm.Number.valueProp);olympe.dm.Number.prototype.getValue.K=olympe.C.J.F;olympe.sc={};olympe.sc.P={Ca:'sc.Logger',tk:'sc.RootContext',Ge:'sc.Serializer'};olympe.sc.U={Pe:'sc.app',Xf:'sc.debug',Mn:'sc.autostartProfiler',Eo:'sc.debugger',Dt:'sc.disableTheme',PRODUCTION:'sc.production',jv:'sc.onstartTimeout',Lq:'sc.remoteActionTimeout'};
|
|
1055
1055
|
olympe.W.config(a=>{F(a,olympe.sc.U.Pe,'');F(a,olympe.sc.U.Xf,!1);F(a,olympe.sc.U.Dt,!0);F(a,olympe.sc.U.PRODUCTION,!1);F(a,olympe.sc.U.jv,2E4);F(a,olympe.sc.U.Lq,3E4);F(a,olympe.sc.U.Mn,!1);E(a,olympe.sc.P.Ca,[olympe.ja.P.Da],b=>b.cd('sc'));D(a,olympe.sc.P.Ge,olympe.sc.cc,olympe.dc.db.P.Da);Wa(a,olympe.dc.sources.P.Ge,olympe.sc.P.Ge);E(a,olympe.sc.P.tk,[new olympe.W.pa(olympe.sc.U.PRODUCTION)],b=>{const c=new olympe.sc.yg('root','root',null);olympe.sc.wn=c;c.set(olympe.sc.ya.j.PRODUCTION,b);return new olympe.sc.ya(c)})},
|
|
1056
1056
|
'olympe.sc');olympe.W.run([olympe.sc.P.tk,new olympe.W.pa(olympe.L.U.wl)],(a,b)=>{olympe.$d().ctx=a;olympe.$d().oVersion=()=>b});olympe.sc.qn=()=>null!==olympe.dc.ia().Jb(void 0,olympe.sc.Runnable.j.$b());olympe.sc.hE=(a,b,c,d)=>{c=Y(Y(a.create(olympe.sc.ed),olympe.sc.ed.j,c||null),olympe.sc.ed.F,d||null);a.Oa(olympe.sc.ed.D,c,b);a.Oa(olympe.dc.CloudObject.containsRel,b,c);return c.X()};olympe.sc.ij=(a,b)=>{a=olympe.dc.mb.Bx(b)(a);return a instanceof olympe.sc.Pd?a.j():a};
|
|
1057
1057
|
olympe.sc.zE=function(a){const b=olympe.dc.CloudObject.containsRel.$b();var c=olympe.dc.fa(a);if(void 0===c)return[];a=olympe.dc.ia();const d=[];let e=[];const f=new Set;for(;!a.Ob(c,olympe.dm.Kb);){f.add(c);const g=a.Jb(c,b);if(null===g)return olympe.ja.ab('sc').warn(`Object ${c} has no container`),[];a.Ob(c,olympe.sc.logic.pb)||g===a.Jb(c,olympe.sc.Runnable.j.$b())||d.push(c);c=g;if(f.has(c))throw Error(`Instance ${c} (${a.name(c)}) is part of a cyclic contain pattern`);}e.push(c);e=e.concat(a.eh(e[0],
|
|
1058
1058
|
olympe.dm.Kb.ha));e=e.concat(a.eh(e[e.length-1],olympe.dm.Mc.R.$b()));e=e.concat(a.eh(e[e.length-1],olympe.dm.Mc.N.$b()));return[...d,...e].reverse()};olympe.sc.AE=a=>{a=a&&a.valueOf()||'';return a.startsWith('image/')?olympe.sc.Dg:a.startsWith('video/')?olympe.sc.Qh:a.startsWith('font/')||a.startsWith('application/font-woff')?olympe.sc.Kc:olympe.dm.File};
|
|
1059
|
-
olympe.sc.yE=a=>a instanceof olympe.sc.Dg?'image/*':a instanceof olympe.sc.Qh?'video/*':a instanceof olympe.sc.Kc?'font/*,application/font-woff':null;olympe.sc.Ya={};function
|
|
1059
|
+
olympe.sc.yE=a=>a instanceof olympe.sc.Dg?'image/*':a instanceof olympe.sc.Qh?'video/*':a instanceof olympe.sc.Kc?'font/*,application/font-woff':null;olympe.sc.Ya={};function Mm(a,b){var c=olympe.sc.ya,d=a.j;a=a.Cb();b=olympe.dc.fa(b);let e,f=null==(e=d.j)?void 0:e.get(b);if(!f){f=d.Yh(a,void 0,b);for(d=f.getParent();d&&d.ha&&!d.id.startsWith('_');)d=d.getParent();let g;null==(g=d)||Nm(g,b,f)}return new c(f)}function Om(a,b){let c,d;return(a=null!=(d=null==(c=a.j.j)?void 0:c.get(olympe.dc.fa(b)))?d:null)?new olympe.sc.ya(a):null}function Pm(a){let b;return null!=(b=a.Pa(olympe.sc.ya.j.PRODUCTION))?b:!1}
|
|
1060
1060
|
olympe.sc.ya=class{constructor(a=olympe.sc.wn){this.j=a;this.G=olympe.ja.ab('sc');this.D=null}T(){return this.j.T()}getParent(){if(null===this.D){const a=this.j.getParent();this.D=null===a?null:new olympe.sc.ya(a)}return this.D}Cx(a){const b=olympe.dc.ia();let c=this.getParent();if(!c)return this;const d=e=>{e=e.ff();if('string'!==typeof e)return!1;const f=b.model(e);return f&&b.Qa(f,olympe.sc.Ua.$)||a.modelTag&&!b.Ob(e,a.modelTag)?!1:!0};for(;c&&!d(c);){const e=c.getParent();if(!e)break;c=e}return c}ff(){return this.j.ff()}Cb(){return this.j.Cb()}set(a,
|
|
1061
1061
|
b){this.j.set(a,b);return this}Gn(a){return this.set(a,Date.now())}remove(a){this.set(a,null)}rb(a,b,c=!1){const d=olympe.dc.fa(a),e=olympe.C.bc(null!=b?b:Object,`Get context value flow source of ${d}`);e.getContext().onDestroy(this.on(a,f=>{null===f?e.clear():e.update(f)},c?this.j.T():void 0));return e.rb()}get(a,b=!1){a=this.Pa(a,b);return void 0!==a?a:null}has(a,b=!1){return this.j.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,
|
|
1062
|
-
d.next.bind(d),c?void 0:this.j.T(),!1);this.onDestroy(()=>{f();d.complete()});return f})}repeat(a,b){const c=
|
|
1063
|
-
`on the context ${this.T()}:\nStack: ${this.ne()}\n${f}`;f instanceof rxjs.EmptyError&&(g=`The context ${this.T()} has been destroyed while a Promise `+`created from a call to \`waitFor(${olympe.dc.fa(a)})\` `+`has never received any value:\nStack: ${this.ne()}`);e(Error(g))}))})}throw(a){var b=a instanceof Error?a.message:String(a);if(a instanceof Error){var c;const d=(null==(c=a.ne)?void 0:c.call(a))||this.ne();let e,f;c=null!=(f=null==(e=a.es)?void 0:e.call(a))?f:0;b=
|
|
1064
|
-
|
|
1065
|
-
this.Cb().Tf(a)}clear(){this.j.clear()}gb(){return this.Cb().gb()||this.Cb().gd()}Qa(a){a=
|
|
1062
|
+
d.next.bind(d),c?void 0:this.j.T(),!1);this.onDestroy(()=>{f();d.complete()});return f})}repeat(a,b){const c=Qm(this.j,a);a=b.subscribe(d=>{null!==d?this.set(c,d):this.remove(c)});this.mh(a.unsubscribe.bind(a));return this}yz(a){a=a instanceof olympe.sc.Runnable?a:this.get(a);if(!a)return null;const b=this.Yh(`Runner ${a.name()}`);a.run(b);return b}Us(a,b=!0,c=!1){return new Promise((d,e)=>{this.observe(a,b,c).pipe(rxjs.operators.first()).subscribe(rxjs.Subscriber.create(d,f=>{let g=`An error occurred while calling \`waitFor(${olympe.dc.fa(a)})\``+
|
|
1063
|
+
`on the context ${this.T()}:\nStack: ${this.ne()}\n${f}`;f instanceof rxjs.EmptyError&&(g=`The context ${this.T()} has been destroyed while a Promise `+`created from a call to \`waitFor(${olympe.dc.fa(a)})\` `+`has never received any value:\nStack: ${this.ne()}`);e(Error(g))}))})}throw(a){var b=a instanceof Error?a.message:String(a);if(a instanceof Error){var c;const d=(null==(c=a.ne)?void 0:c.call(a))||this.ne();let e,f;c=null!=(f=null==(e=a.es)?void 0:e.call(a))?f:0;b=Rm(b,c,d);b.stack=a.stack}else b=
|
|
1064
|
+
Rm(b,0,this.ne());Sm(this.j,b);return this}zz(a){this.set(olympe.sc.ya.j.xg,a);return this}Pa(a,b=!0){return this.j.Pa(a,b)}on(a,b,c,d=!0){return this.j.on(a,b,c,d)}Yh(a){return new olympe.sc.ya(this.j.Yh(this.Cb(),a))}cl(a,b){return this.j.cl(a,c=>{b(new olympe.sc.ya(c))})}iy(a){a=Tm(this.j,a);return a===this.j?this:a&&new olympe.sc.ya(a)}destroy(){this.j.destroy()}mh(a,b){return this.j.mh(a,b)}al(a){this.j.al(a)}onDestroy(a){return this.gb()?(a(),'noId'):this.Cb().onDestroy(a)}Tf(a){this.gb()||
|
|
1065
|
+
this.Cb().Tf(a)}clear(){this.j.clear()}gb(){return this.Cb().gb()||this.Cb().gd()}Qa(a){a=Um(this.j,a);return null!==a?new olympe.sc.ui.gA(a,this):null}Rx(a){a=Um(this.j,a);return null!==a?new olympe.sc.ui.fA(a,this):null}ez(...a){return rxjs.combineLatest(a.map(b=>{b=Um(this.j,b);return null!==b?this.observe(b):rxjs.of(null)}))}Ea(a){return(null==a?void 0:a.constructor)!==this.constructor?!1:this.j===a.j}ne(){const a=olympe.dc.ia();let b;try{const c=[this];let d=this.getParent();for(;null!==d&&d.j!==
|
|
1066
1066
|
olympe.sc.wn;)c.push(d),d=d.getParent();b='> '+c.map(e=>{const f=e.ff();return null!==f?(e=a.model(f),`${a.name(f)||e&&a.name(e)||f} (${e})`):e.T()}).join('\n> ')}catch(c){b=`No stack available for context ${this.T()}: ${c}`,this.G.warn(b)}return b}};olympe.sc.ya.prototype.observeMany=olympe.sc.ya.prototype.ez;olympe.sc.ya.prototype.getEvent=olympe.sc.ya.prototype.Rx;olympe.sc.ya.prototype.getProperty=olympe.sc.ya.prototype.Qa;olympe.sc.ya.prototype.isDestroyed=olympe.sc.ya.prototype.gb;
|
|
1067
1067
|
olympe.sc.ya.prototype.clear=olympe.sc.ya.prototype.clear;olympe.sc.ya.prototype.offDestroy=olympe.sc.ya.prototype.Tf;olympe.sc.ya.prototype.onDestroy=olympe.sc.ya.prototype.onDestroy;olympe.sc.ya.prototype.offClear=olympe.sc.ya.prototype.al;olympe.sc.ya.prototype.onClear=olympe.sc.ya.prototype.mh;olympe.sc.ya.prototype.destroy=olympe.sc.ya.prototype.destroy;olympe.sc.ya.prototype.getOtherContext=olympe.sc.ya.prototype.iy;olympe.sc.ya.prototype.onContext=olympe.sc.ya.prototype.cl;
|
|
1068
1068
|
olympe.sc.ya.prototype.createChild=olympe.sc.ya.prototype.Yh;olympe.sc.ya.prototype.setParentElement=olympe.sc.ya.prototype.zz;olympe.sc.ya.prototype['throw']=olympe.sc.ya.prototype.throw;olympe.sc.ya.prototype.waitFor=olympe.sc.ya.prototype.Us;olympe.sc.ya.prototype.runner=olympe.sc.ya.prototype.yz;olympe.sc.ya.prototype.repeat=olympe.sc.ya.prototype.repeat;olympe.sc.ya.prototype.observe=olympe.sc.ya.prototype.observe;olympe.sc.ya.prototype.has=olympe.sc.ya.prototype.has;
|
|
1069
|
-
olympe.sc.ya.prototype.get=olympe.sc.ya.prototype.get;olympe.sc.ya.prototype.remove=olympe.sc.ya.prototype.remove;olympe.sc.ya.prototype.trigger=olympe.sc.ya.prototype.Gn;olympe.sc.ya.prototype.set=olympe.sc.ya.prototype.set;olympe.sc.ya.prototype.getClosest=olympe.sc.ya.prototype.Cx;olympe.sc.ya.prototype.getParent=olympe.sc.ya.prototype.getParent;olympe.sc.ya.j={PRODUCTION:'__production',EDITION:'__editionMode',TRANSACTION:'__transaction',xg:'__htmlContainer',uA:'__dockableElement',Kn:'__appHasStarted'};olympe.sc.ww=class extends olympe.sc.ya{constructor(a){super(a);this.F=new olympe.C.Xb('SC Update Context',super.Cb());const b=a.mh(()=>{b&&a.al(b);this.F.destroy()})}Cb(){return this.F}mh(a,b){return this.Cb().onDestroy(a,null!=b?b:olympe.V.Ic())}};let
|
|
1070
|
-
function
|
|
1071
|
-
function
|
|
1072
|
-
function
|
|
1073
|
-
function
|
|
1074
|
-
function
|
|
1075
|
-
function
|
|
1076
|
-
olympe.sc.yg=class{constructor(a,b='no name',c=olympe.sc.wn){this.id=a;this.ad=b;this.R=new Set;this.H=c;this.D=new olympe.C.Xb('SC Context');this.data=new Map;this.da=this.Y=this.j=this.F=null;this.ha=!1;this.N=new Set;this.ua=!1;this.$=null;this.G=olympe.ja.ab('sc');this.Ya=null;
|
|
1077
|
-
(d=this.$)?void 0:d.get('IO#'+g))?k:g;c='$'+a;var e;d=null!=(e=this.data.get(c))?e:null;b=null!=b?b:null;if(e=!this.N.has(c)){a:{if('function'===typeof(null==b?void 0:b.Ea))try{var f=b.Ea(d);break a}catch(l){f=!1;break a}f=b===d}e=!f}e&&(null===b?this.data.delete(c):this.data.set(c,b),null!==this.Ya&&0<this.Ya.size&&
|
|
1078
|
-
'*';a=
|
|
1079
|
-
b,this));null!==this.Ya&&0<this.Ya.size&&this.Ya.forEach(({dl:f,depth:g})=>{(-1===f.F||g<f.F)&&
|
|
1080
|
-
else return
|
|
1081
|
-
t])})};b.tn(h).then(()=>{const l=[];k(g,l,0)
|
|
1069
|
+
olympe.sc.ya.prototype.get=olympe.sc.ya.prototype.get;olympe.sc.ya.prototype.remove=olympe.sc.ya.prototype.remove;olympe.sc.ya.prototype.trigger=olympe.sc.ya.prototype.Gn;olympe.sc.ya.prototype.set=olympe.sc.ya.prototype.set;olympe.sc.ya.prototype.getClosest=olympe.sc.ya.prototype.Cx;olympe.sc.ya.prototype.getParent=olympe.sc.ya.prototype.getParent;olympe.sc.ya.j={PRODUCTION:'__production',EDITION:'__editionMode',TRANSACTION:'__transaction',xg:'__htmlContainer',uA:'__dockableElement',Kn:'__appHasStarted'};olympe.sc.ww=class extends olympe.sc.ya{constructor(a){super(a);this.F=new olympe.C.Xb('SC Update Context',super.Cb());const b=a.mh(()=>{b&&a.al(b);this.F.destroy()})}Cb(){return this.F}mh(a,b){return this.Cb().onDestroy(a,null!=b?b:olympe.V.Ic())}};let Vm=0;function Qm(a,b){b=olympe.dc.fa(b);let c,d,e,f;return null!=(f=null!=(e=null==(c=a.$)?void 0:c.get('I#'+b))?e:null==(d=a.$)?void 0:d.get('IO#'+b))?f:b}function Sm(a,b){if(null===a.H)a.G.error(`An error occurred in a brick: ${b.toString()}`);else if(a.da){var c=Wm(olympe.dc.CloudObject.get(a.da));null!==c&&Xm(a,c).some(d=>{let e,f;return 0<(null==(e=a.F)?void 0:null==(f=e.get(d))?void 0:f.size)})&&!a.N.has('$'+c)?a.set(c,b):Sm(a.H,b)}else Sm(a.H,b)}
|
|
1070
|
+
function Tm(a,b){if(b===a.id||a.R.has(b)||!b)return a;for(a=a.H;a;){if(b===a.T()||a.R.has(b))return a;const c=Ym(a.j,b);if(c)return c;a=a.getParent()}return null}function Zm(a,b,c=0){null===a.Ya&&(a.Ya=new Map);a.Ya.has(b.T())||(a.Ya.set(b.T(),{dl:b,depth:c}),$m(a,d=>{(-1===b.F||c<b.F)&&Zm(d,b,c+1)}),a.onDestroy(()=>{an(a,b.T())}));return b.T()}
|
|
1071
|
+
function an(a,b){if(null===a.Ya||!a.Ya.has(b))return!1;const {dl:c,depth:d}=a.Ya.get(b);$m(a,f=>{an(f,b)});0===d&&c.D();const e=a.Ya.delete(b);0===a.Ya.size&&(a.Ya=null);return e}function Um(a,b){let c;return(null==(c=a.$)?void 0:c.get('IO#'+b))||null}
|
|
1072
|
+
function bn(a){a.D.Td(()=>{$m(a,c=>c.destroy())});a.D.onDestroy(()=>{void 0!==a.Pa(olympe.sc.ya.j.TRANSACTION,!1)&&a.G.warn(`The context ${a.T()} is being destroyed but still has unreleased transactions. You probably forgot to end a transaction.`);a.clear();let c;if(null!=(c=a.H)){let d;null==(d=c.j)||d.delete(a.T());let e;0===(null==(e=c.j)?void 0:e.size)&&(c.j=null)}a.R.clear()});let b;null==(b=a.H)||cn(b,a)}
|
|
1073
|
+
function Ym(a,b){if(null===a)return null;if(a.has(b))return a.get(b);for(const c of a.values())if(c.ha&&!c.id.startsWith('_')&&(a=Ym(c.j,b)))return a;return null}function dn(a,b,...c){if(null!==a.Ya)for(const {dl:d,depth:e}of a.Ya.values())d.process(a,b,e,...c)}function en(a,b){a.da=olympe.dc.fa(b);a.ha=b.rd().qn();b.F().forEach(c=>{a.id===c||a.R.has(c)||(a.R.add(c),Nm(a,c,a))});a.$=b.j();dn(a,olympe.sc.Ya.pc.j.INIT)}function fn(a){a.ua=!0;let b;null==(b=a.j)||b.forEach(c=>{fn(c)})}
|
|
1074
|
+
function gn(a){a.ua=!1;let b;null==(b=a.j)||b.forEach(c=>{gn(c)})}function Xm(a,b){return['*',a.id,...a.R].map(c=>`${'@'}${c}.${b}`)}function hn(a,b,c,d){c.forEach(f=>{let g,h;null==(g=a.F)||null==(h=g.get(f))||h.forEach(k=>{k(d)})});let e;null==(e=a.j)||e.forEach(f=>{!f.ua&&f.data.has(b)||hn(f,b,c,d)})}function jn(a,b,c){a.F||(a.F=new Map);let d=a.F.get(b);void 0===d&&(d=new Map,a.F.set(b,d));Vm++;const e=Vm;d.set(e,c);return()=>{const f=a.F.get(b);f&&(f.delete(e),0===f.size&&a.F.delete(b))}}
|
|
1075
|
+
function Nm(a,b,c){a.N.add(b);let d,e;null==(d=a.F)||null==(e=d.get('&'+b))||e.forEach(f=>{f(c)});$m(a,f=>{f.N.has(b)||Nm(f,b,c)});a.N.delete(b)}function $m(a,b){let c;null==(c=a.j)||c.forEach(b)}function kn(a,b){a.data.forEach((c,d)=>b(c,d.slice(1)))}function ln(a){var b=olympe.sc.Ya.pc.D.Bf;const c=[];if(null!==a.Ya)for(const {dl:d}of a.Ya.values())d.getType()===b&&(c.push(d.T()),d.D(),an(a,d.T()))}function cn(a,b){null===a.j&&(a.j=new Map);a.j.set(b.id,b)}
|
|
1076
|
+
olympe.sc.yg=class{constructor(a,b='no name',c=olympe.sc.wn){this.id=a;this.ad=b;this.R=new Set;this.H=c;this.D=new olympe.C.Xb('SC Context');this.data=new Map;this.da=this.Y=this.j=this.F=null;this.ha=!1;this.N=new Set;this.ua=!1;this.$=null;this.G=olympe.ja.ab('sc');this.Ya=null;bn(this)}T(){return this.id}getParent(){return this.H}ff(){return this.da}set(a,b){if(!this.D.gd()&&!this.D.gb()){const g=olympe.dc.fa(a);var c,d;let h,k;a=null!=(k=null!=(h=null==(c=this.$)?void 0:c.get('O#'+g))?h:null==
|
|
1077
|
+
(d=this.$)?void 0:d.get('IO#'+g))?k:g;c='$'+a;var e;d=null!=(e=this.data.get(c))?e:null;b=null!=b?b:null;if(e=!this.N.has(c)){a:{if('function'===typeof(null==b?void 0:b.Ea))try{var f=b.Ea(d);break a}catch(l){f=!1;break a}f=b===d}e=!f}e&&(null===b?this.data.delete(c):this.data.set(c,b),null!==this.Ya&&0<this.Ya.size&&dn(this,olympe.sc.Ya.pc.j.Rg,a,b),f=Xm(this,a),this.N.add(c),hn(this,c,f,b),this.N.delete(c))}}on(a,b,c,d=!0){if(this.D.gb()||this.D.gd())return()=>{};const e=Qm(this,a),f=c?olympe.dc.fa(c):
|
|
1078
|
+
'*';a=jn(this,'@'+f+'.'+e,b);c=c?(c=Tm(this,f))?c.Pa(e,!1):void 0:this.Pa(e);void 0!==c&&b(c);if(d)olympe.C.Xa().onDestroy(a);return a}has(a,b=!1){a='$'+Qm(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}Yh(a,b,c){const d=null!=c?c:'_'+olympe.V.Ic();if(a.gb()||a.gd())throw Error(`Try to create new child context in a destroyed context ${a.T()}, probably because \`runner()\` is called on a destroyed context`);const e=a.run(()=>new olympe.sc.yg(d,
|
|
1079
|
+
b,this));null!==this.Ya&&0<this.Ya.size&&this.Ya.forEach(({dl:f,depth:g})=>{(-1===f.F||g<f.F)&&Zm(e,f,g+1)});return e}cl(a,b){const c=Tm(this,a);if(c)return b(c),()=>{};const d=jn(this,'&'+a,e=>{let f;null==(f=d)||f();b(e)});return d}Pa(a,b=!0){a='$'+Qm(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.D.gd()||this.D.gb()||(dn(this,olympe.sc.Ya.pc.j.Rj),this.D.destroy(),dn(this,olympe.sc.Ya.pc.j.Vd))}mh(a,b){if(this.D.gb())a();
|
|
1080
|
+
else return Vm++,b=null!=b?b:String(Vm),null===this.Y&&(this.Y=new Map),this.Y.set(b,a),b;return b||'noId'}al(a){null!==this.Y&&this.Y.delete(a)}onDestroy(a){return this.gb()?(a(),'noId'):this.D.onDestroy(a)}clear(){if(!this.D.gb()){dn(this,olympe.sc.Ya.pc.j.Lj);let a;null==(a=this.Y)||a.forEach(b=>b());dn(this,olympe.sc.Ya.pc.j.Mj)}}gb(){return this.D.gb()}Cb(){return this.D}};olympe.sc.yg.prototype.getParent=olympe.sc.yg.prototype.getParent;olympe.sc.yg.j={Ul:'I#',mm:'O#',nB:'IO#'};function mn(a,b,c){return(c=c.ff())?`${a}.${c}.${b}`:`${a}.${b}`}olympe.sc.Ya.pc=class{constructor(a=-1){this.id=olympe.V.df();this.active=!0;this.F=a}D(){this.active=!1}T(){return this.id}getType(){}process(){}};olympe.sc.Ya.pc.j={INIT:'INIT',Rg:'SET',Lj:'CLEAR',Mj:'CLEARED',Rj:'DESTROY',Vd:'DESTROYED'};olympe.sc.Ya.pc.D={Bf:'REMOTE',Nu:'LOCAL',eg:'PROFILER'};olympe.sc.Xd=class a{constructor(){this.D=this.H=this.N=null;this.R=new Map;this.F=new Map;this.j=new olympe.V.Gm(1E4);gb(this.j,b=>{ln(b)})}$(b,c,d){const e=b.body(),f=e.c,g=this.R.get(f);switch(e.t){case olympe.sc.Xd.j.ov:c=this.F.get(e.f);b.vd(c).catch(l=>{d.error('Unable to reply with paths: ',l)});break;case olympe.sc.Xd.j.pv:const h=f+c,k=(l,n,p=0)=>{kn(l,(q,r)=>{let t;q instanceof olympe.dc.CloudObject?t=a.F(q):t=q;let u;q=null!=(u=l.ff())?u:'';0<q.length&&(q+='.');n.push([`${p}.${q}${r}`,
|
|
1081
|
+
t])})};b.tn(h).then(()=>{const l=[];k(g,l,0);$m(g,p=>{k(p,l,1)});olympe.L.ub.publish(h,{t:olympe.sc.Xd.j.eu,v:l,ts:0}).catch(p=>{d.error('Error publishing on service : ',p)});const n=new olympe.sc.Ya.Jv(h);Zm(g,n);this.j.has(g)?fb(this.j,g):this.j.add(g)}).catch(l=>{d.error('Error notifying on a contextId : ',l)});break;case olympe.sc.Xd.j.qv:void 0!==g&&this.j.has(g)&&fb(this.j,g);break;case olympe.sc.Xd.j.bg:void 0!==g&&(this.j.delete(g),ln(g))}}da(b,c,d){this.N=new olympe.L.ub('discovery_debug_id',
|
|
1082
1082
|
c);this.N.listen().subscribe(e=>{var f=e.body();if(f.t===olympe.sc.Xd.j.Et){e=f.i;f=f.f;if(!this.F.has(f)){const g=this.Y(f,c,b);if(0!==g.length)this.F.set(f,g);else return}null===this.D&&(this.D=olympe.V.df(),f=new olympe.C.Xb(this.D,c.Cb()),this.H=new olympe.L.ub(this.D,f),this.H.listen().subscribe(g=>{this.$(g,b,d)}));olympe.L.ub.publish(e,{t:olympe.sc.Xd.j.Vs,n:olympe.W.getParameter(olympe.sc.U.Eo)||'no name',a:b,s:this.D}).catch(g=>{d.error('Error publishing on draw service : '+g)})}})}Y(b,c,
|
|
1083
|
-
d){const e=[],f=olympe.dc.ia(),g=(h,k)=>{
|
|
1083
|
+
d){const e=[],f=olympe.dc.ia(),g=(h,k)=>{$m(h,l=>{if(null!==l.ff()){const n=olympe.dc.CloudObject.get(l.ff()).ng(olympe.sc.Runnable.H).Fc();if(null!==n){const p=k+'/'+f.name(n);n.X()===b&&(e.push([p,l.T()]),this.R.set(l.T(),l));g(l,p)}}})};g(c.j,f.name(d));return e}static D(b,c,d){let e=d;d instanceof olympe.dc.CloudObject&&(e=a.F(d));olympe.L.ub.publish(b,{t:olympe.sc.Xd.j.Ek,k:c,v:e,ts:Date.now()}).catch(f=>{olympe.ja.ab('Debugger').error('Error publishing on service : ',f)})}static F(b){if(null===
|
|
1084
1084
|
b||void 0===b)return'<null>';const c=olympe.dc.ia();if(b instanceof olympe.dc.CloudObject){var d=b.ac();if(!c.Ob(d,olympe.sc.yc))return b.toString();let f=`${b.Wb().name()} (${b.X()})`;var e=olympe.dc.CloudObject.get(d);d=olympe.dc.ma.from(e).mg(olympe.dc.CloudObject.extendRel,!0).ie().fb(olympe.dc.CloudObject.propertyRel).ie().Fc();e=olympe.dc.ma.from(e).mg(olympe.dc.CloudObject.extendRel,!0).ie().fb(olympe.dc.CloudObject.yj).ie().Fc();d=d.filter(([g])=>g instanceof olympe.sc.yc);0!==d.length&&(f+=
|
|
1085
|
-
'<br> ',f+='Properties:<br>',d.forEach(([,g])=>{f+=' ';f+=' - '+c.name(g)+' : '+c.Qa(b.X(),g)+'<br>'}));d=e.filter(([g])=>g instanceof olympe.sc.yc);0!==d.length&&(f+=' ',f+='Relations:<br>',d.forEach(([,g])=>{f+=' ';f+=' - '+c.name(g)+'<br>'}));return f}return b.toString()}};olympe.sc.Xd.H='discovery_debug_id';olympe.sc.Xd.j={Et:0,Vs:1,ov:2,pv:3,eu:4,Ek:5,qv:6,bg:7};olympe.sc.Ya.vB=class extends olympe.sc.Ya.pc{constructor(a=-1){super(a);this.j=new Map}getType(){return olympe.sc.Ya.pc.D.Nu}process(a,b,c,...d){if(this.active&&b===olympe.sc.Ya.pc.j.Rg){a=
|
|
1085
|
+
'<br> ',f+='Properties:<br>',d.forEach(([,g])=>{f+=' ';f+=' - '+c.name(g)+' : '+c.Qa(b.X(),g)+'<br>'}));d=e.filter(([g])=>g instanceof olympe.sc.yc);0!==d.length&&(f+=' ',f+='Relations:<br>',d.forEach(([,g])=>{f+=' ';f+=' - '+c.name(g)+'<br>'}));return f}return b.toString()}};olympe.sc.Xd.H='discovery_debug_id';olympe.sc.Xd.j={Et:0,Vs:1,ov:2,pv:3,eu:4,Ek:5,qv:6,bg:7};olympe.sc.Ya.vB=class extends olympe.sc.Ya.pc{constructor(a=-1){super(a);this.j=new Map}getType(){return olympe.sc.Ya.pc.D.Nu}process(a,b,c,...d){if(this.active&&b===olympe.sc.Ya.pc.j.Rg){a=mn(c,Qm(a,d[0]),a);d=d[1];let e;null==(e=this.j.get(a))||e(d)}}on(a,b){this.j.set(a,b)}};function nn(a,b,c,d=new Map){for(var e=[];b;){const n=b.ff();if(!n)break;e.push(n);b=b.getParent()}mb(a.j,c,d.set('context',e));var f;let g;for(const n of[...e,null==(f=d)?void 0:f.get('propId'),null==(g=d)?void 0:g.get('type')])if(c=n,'string'===typeof c&&!a.H.has(c)){e=a;f=c;e.ia||(e.ia=olympe.dc.ia());d=e.ia.name(f);e=(f=e.ia.model(f))?e.ia.name(f):'';var [h,k,l]=[d,f,e];d=a.j;e=(new Map).set(c,h).set(k,l);c=(new Map).set(c,k);for(const [p,q]of e.entries())d.N.set(p,q);for(const [p,q]of c.entries())d.H.set(p,
|
|
1086
1086
|
q)}}
|
|
1087
|
-
olympe.sc.Ya.zv=class extends olympe.sc.Ya.pc{constructor(a){super();this.j=a;this.ia=olympe.dc.ia();this.H=new Set}getType(){return olympe.sc.Ya.pc.D.eg}process(a,b,c,...d){var e=
|
|
1088
|
-
|
|
1089
|
-
const
|
|
1090
|
-
e,f)});this.j.set(e,()=>{Og(this.db,f,h)})}olympe.sc.Xd.D(this.H,e,f)}}};olympe.sc.Metadata=class extends olympe.dc.CloudObject{zu(){return this.sd(this.ln())}Au(){return this.sd(this.mn())}Sk(){return new olympe.C.Zb(this.sd(this.ln()),this.sd(this.mn()))}ln(){}mn(){}};olympe.sc.Metadata.O=olympe.dc.na.j('0161ae936c62f9fcd131',olympe.sc.Metadata);m=olympe.sc.Metadata.prototype;m.zu.K=olympe.C.J.F;m.Au.K=olympe.C.J.F;m.Sk.K=olympe.C.J.R;m.ln.K=olympe.C.J.j;m.mn.K=olympe.C.J.j;olympe.sc.ed=class extends olympe.dc.CloudObject{D(){return this.wb(olympe.sc.ed.F)}j(){return this.wb(olympe.sc.ed.j)}};olympe.sc.ed.O=olympe.dc.na.j('01703376c4a81c0e9d90',olympe.sc.ed);olympe.sc.ed.F=olympe.sc.ed.O.ka('01703376c4a81c0e9d91');olympe.sc.ed.j=olympe.sc.ed.O.ka('01703376c4a81c0e9d92');olympe.sc.ed.D=olympe.sc.ed.O.sa('01703376c4a81c0e9d93');R(olympe.dc.CloudObject.O,olympe.sc.ed.D);olympe.sc.ed.prototype.D.K=olympe.C.J.D;olympe.sc.ed.prototype.j.K=olympe.C.J.D;olympe.sc.se={};olympe.sc.se.Ie={Ot:'folders',Nv:'screenflow',mw:'ui-design',hr:'software-intelligence',rh:'data-management',ZB:'projects'};olympe.sc.Cf=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}Dd(){return this.sd(olympe.sc.Cf.D)}};olympe.sc.Cf.O=olympe.dc.na.j('019131fb930466a1ad79',olympe.sc.Cf);olympe.sc.Cf.D=olympe.sc.Cf.O.ka('016d1bb681929c2cc3f1');olympe.sc.Cf.j=olympe.sc.Cf.O.sa('019131fb930466a1ad7a');R(olympe.dc.CloudObject.O,olympe.sc.Cf.j);olympe.sc.Cf.prototype.Dd.K=olympe.C.J.F;olympe.sc.od=class extends olympe.dm.BrickMetadata{qe(){return olympe.sc.se.Ie.hr}j(){return this.bb(olympe.sc.od.j,olympe.sc.logic.Ih)}D(){return this.bb(olympe.sc.od.D,olympe.sc.logic.Kg)}};olympe.sc.od.O=olympe.dc.na.j('011100000000000adef0',olympe.sc.od);olympe.sc.od.j=olympe.sc.od.O.sa('016ac4f59a2917fdef01');olympe.sc.od.D=olympe.sc.od.O.sa('016ac4f59a2917fdef02');olympe.sc.od.O.j=(a,b)=>
|
|
1091
|
-
olympe.sc.od.prototype.j.K=new olympe.C.J(()=>olympe.dc.za,[]);olympe.sc.od.prototype.D.K=new olympe.C.J(()=>olympe.dc.za,[]);function
|
|
1087
|
+
olympe.sc.Ya.zv=class extends olympe.sc.Ya.pc{constructor(a){super();this.j=a;this.ia=olympe.dc.ia();this.H=new Set}getType(){return olympe.sc.Ya.pc.D.eg}process(a,b,c,...d){var e=on.Ul,f=on.mm,g=on.uv;const h=on.INIT,k=on.Lj,l=on.Mj,n=on.Rj,p=on.Vd;c=on.lv;if(b===olympe.sc.Ya.pc.j.Rg){const [q,r]=d;b=(d=a.ff())?olympe.dc.ia().Ob(d,olympe.sc.logic.Function):!1;d=d?olympe.dc.ia().Ob(d,olympe.sc.ui.kC):!1;b?(g=this.ia.Jb(q,olympe.dm.Property.typeRel),b=this.ia.Ob(q,olympe.sc.logic.vb),d=this.ia.Ob(q,olympe.sc.logic.Gb),
|
|
1088
|
+
nn(this,a,b?e:d?f:c,new Map([['propId',q],['value',r],['type',g]]))):d&&(e=this.ia.Ob(q,olympe.dm.Property),f=this.ia.Jb(q,olympe.dm.Property.typeRel),nn(this,a,e?g:c,new Map([['propId',q],['value',r],['type',f]])))}else b===olympe.sc.Ya.pc.j.INIT?nn(this,a,h):b===olympe.sc.Ya.pc.j.Lj?nn(this,a,k):b===olympe.sc.Ya.pc.j.Mj?nn(this,a,l):b===olympe.sc.Ya.pc.j.Rj?nn(this,a,n):b===olympe.sc.Ya.pc.j.Vd&&nn(this,a,p)}};
|
|
1089
|
+
const on={Ul:'input',mm:'output',uv:'prop',INIT:'init',Lj:'clear',Mj:'cleared',Rj:'destroy',Vd:'destroyed',lv:'other'};olympe.sc.Ya.Jv=class extends olympe.sc.Ya.pc{constructor(a){super(1);this.H=a;this.j=new Map;this.db=olympe.dc.ia()}getType(){return olympe.sc.Ya.pc.D.Bf}D(){super.D();for(const a of this.j.values())a();this.j.clear()}process(a,b,c,...d){if(this.active&&b===olympe.sc.Ya.pc.j.Rg&&void 0!==d[0]&&null!==d[0]){const e=mn(c,Qm(a,d[0]),a),f=d[1];let g;null==(g=this.j.get(e))||g();this.j.delete(e);if(f instanceof olympe.dc.CloudObject&&f.Wb()instanceof olympe.sc.yc){const h=Ng(this.db,f,()=>{olympe.sc.Xd.D(this.H,
|
|
1090
|
+
e,f)});this.j.set(e,()=>{Og(this.db,f,h)})}olympe.sc.Xd.D(this.H,e,f)}}};olympe.sc.Metadata=class extends olympe.dc.CloudObject{zu(){return this.sd(this.ln())}Au(){return this.sd(this.mn())}Sk(){return new olympe.C.Zb(this.sd(this.ln()),this.sd(this.mn()))}ln(){}mn(){}};olympe.sc.Metadata.O=olympe.dc.na.j('0161ae936c62f9fcd131',olympe.sc.Metadata);m=olympe.sc.Metadata.prototype;m.zu.K=olympe.C.J.F;m.Au.K=olympe.C.J.F;m.Sk.K=olympe.C.J.R;m.ln.K=olympe.C.J.j;m.mn.K=olympe.C.J.j;olympe.sc.ed=class extends olympe.dc.CloudObject{D(){return this.wb(olympe.sc.ed.F)}j(){return this.wb(olympe.sc.ed.j)}};olympe.sc.ed.O=olympe.dc.na.j('01703376c4a81c0e9d90',olympe.sc.ed);olympe.sc.ed.F=olympe.sc.ed.O.ka('01703376c4a81c0e9d91');olympe.sc.ed.j=olympe.sc.ed.O.ka('01703376c4a81c0e9d92');olympe.sc.ed.D=olympe.sc.ed.O.sa('01703376c4a81c0e9d93');R(olympe.dc.CloudObject.O,olympe.sc.ed.D);olympe.sc.ed.prototype.D.K=olympe.C.J.D;olympe.sc.ed.prototype.j.K=olympe.C.J.D;olympe.sc.se={};olympe.sc.se.Ie={Ot:'folders',Nv:'screenflow',mw:'ui-design',hr:'software-intelligence',rh:'data-management',ZB:'projects'};olympe.sc.Cf=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}Dd(){return this.sd(olympe.sc.Cf.D)}};olympe.sc.Cf.O=olympe.dc.na.j('019131fb930466a1ad79',olympe.sc.Cf);olympe.sc.Cf.D=olympe.sc.Cf.O.ka('016d1bb681929c2cc3f1');olympe.sc.Cf.j=olympe.sc.Cf.O.sa('019131fb930466a1ad7a');R(olympe.dc.CloudObject.O,olympe.sc.Cf.j);olympe.sc.Cf.prototype.Dd.K=olympe.C.J.F;olympe.sc.od=class extends olympe.dm.BrickMetadata{qe(){return olympe.sc.se.Ie.hr}j(){return this.bb(olympe.sc.od.j,olympe.sc.logic.Ih)}D(){return this.bb(olympe.sc.od.D,olympe.sc.logic.Kg)}};olympe.sc.od.O=olympe.dc.na.j('011100000000000adef0',olympe.sc.od);olympe.sc.od.j=olympe.sc.od.O.sa('016ac4f59a2917fdef01');olympe.sc.od.D=olympe.sc.od.O.sa('016ac4f59a2917fdef02');olympe.sc.od.O.j=(a,b)=>Cl(a,b||'New function signature',olympe.sc.od,olympe.sc.logic.xd).X();
|
|
1091
|
+
olympe.sc.od.prototype.j.K=new olympe.C.J(()=>olympe.dc.za,[]);olympe.sc.od.prototype.D.K=new olympe.C.J(()=>olympe.dc.za,[]);function pn(a,b){[].forEach(c=>c.call(a,b,(d,e)=>{null===e?b.remove(d):b.set(d,e)}))}function qn(a,b){b=b.filter(c=>'string'===typeof c&&a.db.Ob(c,olympe.sc.logic.Ub));b.sort((c,d)=>{let e;c=null!=(e=a.db.Qa(c,olympe.sc.logic.Ub.j,!0))?e:0;let f;d=null!=(f=a.db.Qa(d,olympe.sc.logic.Ub.j,!0))?f:0;return c-d});return b}function rn(a){return qn(a,a.db.bb(a.tag,olympe.sc.Ua.F))}function sn(a){return qn(a,a.db.bb(a.tag,olympe.sc.Ua.D))}
|
|
1092
1092
|
olympe.sc.Ua=class extends olympe.dm.BrickMetadata{Cu(a,b,c,d,e=!0){e||olympe.ja.ab('sc').error('parameter own= false ignored, investigate');return olympe.C.nh(M(this.Pf(a,olympe.dc.mb.ij,c)),d)}H(){return[]}F(){return rxjs.of([])}py(){return this.bb(olympe.sc.Ua.N,olympe.sc.Runnable)}Fx(){return this.bb(olympe.sc.Ua.R,olympe.sc.Runnable)}ii(){return this.db.Qa(this,olympe.sc.Ua.$)}qn(){return null!==this.db.Jb(this.tag,olympe.sc.Runnable.j.$b())}Bu(){return this.bb(olympe.sc.Ua.F,olympe.sc.logic.vb)}Np(){return this.bb(olympe.sc.Ua.D,
|
|
1093
1093
|
olympe.sc.logic.Gb)}N(){return[olympe.sc.Ua.$a]}};olympe.sc.Ua.O=olympe.dc.na.j('0112000000000000def0',olympe.sc.Ua);olympe.sc.Ua.$=olympe.sc.Ua.O.ka('01692aa71f3108454479');olympe.sc.Ua.jb=olympe.sc.Ua.O.ka('0166446c1f128ebc903a');olympe.sc.Ua.$a=olympe.sc.Ua.O.ka('0166446c1f128ebc904e');olympe.sc.Ua.N=olympe.sc.Ua.O.sa('01692a4af82e8984742c');olympe.sc.Ua.R=olympe.sc.Ua.O.sa('01692a4af82e8984742d');olympe.sc.Ua.Y=olympe.sc.Ua.O.sa('01692a4af82e8984742e');olympe.sc.Ua.F=olympe.sc.Ua.O.sa('01621fb84e320000f00a');
|
|
1094
|
-
olympe.sc.Ua.D=olympe.sc.Ua.O.sa('01621fb84e320000f00b');olympe.sc.Ua.Bd=olympe.sc.Ua.O.sa('0171838bcfed0000e00e');olympe.sc.Ua.$c=olympe.sc.Ua.O.sa('0171838bcfed0000a00a');m=olympe.sc.Ua.prototype;m.Cu.K=olympe.C.J.j;m.py.K=new olympe.C.J(()=>olympe.dc.za,[]);m.Fx.K=new olympe.C.J(()=>olympe.dc.za,[]);m.ii.K=olympe.C.J.j;m.qn.K=olympe.C.J.j;m.Bu.K=new olympe.C.J(()=>olympe.dc.za,[]);m.Np.K=new olympe.C.J(()=>olympe.dc.za,[]);function
|
|
1095
|
-
function
|
|
1096
|
-
function
|
|
1097
|
-
function
|
|
1098
|
-
function
|
|
1099
|
-
olympe.sc.Runnable=class extends olympe.dm.BrickMetadata{constructor(a,b,c){super(a,b);this.G=c}run(a){a.Cb().run(()=>{
|
|
1100
|
-
d,olympe.sc.Ua.Y,a)}D(a){a.Gn(olympe.sc.Ua.jb)}clear(){}destroy(a){this.onDestroy(a)}setupExecution(a){return this.rd().F(a)}onInit(){}onUpdate(){const a=this.ac(),b=this.db.name(a),c=this.db.name(this.db.model(a));this.G.error(`No code was found for ${b} (${c}: ${a})\n\n`+'This is probably because the code has not yet been deployed to the environment, or because the package.json does not import the required dependencies.')}onDestroy(){}getInputs(){return
|
|
1101
|
-
b,c,d){a=b.rb(a,c,!0);void 0!==d&&olympe.C.nh(a,d);return a}$a(a,b,c,d,e){olympe.C.vn([d],f=>{b.set(a,olympe.C.ys(f)?f.valueOf():f)});return this.H(a,b,c,e)}N(){return[this.$,this.R]}$(a,b){
|
|
1094
|
+
olympe.sc.Ua.D=olympe.sc.Ua.O.sa('01621fb84e320000f00b');olympe.sc.Ua.Bd=olympe.sc.Ua.O.sa('0171838bcfed0000e00e');olympe.sc.Ua.$c=olympe.sc.Ua.O.sa('0171838bcfed0000a00a');m=olympe.sc.Ua.prototype;m.Cu.K=olympe.C.J.j;m.py.K=new olympe.C.J(()=>olympe.dc.za,[]);m.Fx.K=new olympe.C.J(()=>olympe.dc.za,[]);m.ii.K=olympe.C.J.j;m.qn.K=olympe.C.J.j;m.Bu.K=new olympe.C.J(()=>olympe.dc.za,[]);m.Np.K=new olympe.C.J(()=>olympe.dc.za,[]);function Wm(a){let b;return null!=(b=a.rd().N().map(olympe.dc.fa)[0])?b:null}function tn(a){const b=new olympe.dc.Wa;a=b.create(a);b.persist(a,!1);b.nb((d,e)=>{d||olympe.ja.ab('sc').error(`Error occurred for transaction executed by createLocalRunnable: ${e}`)});const c=olympe.dc.CloudObject.get(a);olympe.C.Xa().onDestroy(()=>{const d=new olympe.dc.Wa;d.delete(c);d.nb()});return c}
|
|
1095
|
+
function un(a,b){en(b.j,a);pn(a.rd(),b);const c=a.N(),d=vn(b,c),e=[];c.forEach((f,g)=>{f===a.$?e[0]=g:f===a.R&&(e[1]=g)});void 0!==e[0]&&void 0!==e[1]&&(wn(a,b,d[e[0]],d[e[1]]),c[e[0]]=null,c[e[1]]=null);c.forEach((f,g)=>{f&&f.call(a,b,d[g])})}
|
|
1096
|
+
function xn(a,b){let c,d,e;a.G.j()&&(e=a.db.name(a.ac()),c=`Brick ${e} successfully run`,d=`Brick ${e} successfully cleared`);const f=yn(a,b),g=a.setupExecution(b).pipe(rxjs.operators.map(h=>{if(!b.gb()&&(b.clear(),null!==h)){const k=Array.isArray(h)?h:[h],l=new olympe.sc.ww(b.j);l.Cb().run(()=>w(function*(){try{yield a.update(l,k,f)}catch(n){l.throw(n)}}));return!0}return!1})).subscribe(rxjs.Subscriber.create(h=>h?a.G.debug(c):a.G.debug(d),h=>b.throw(h),()=>a.G.debug(`Brick ${e} completed`)));b.onDestroy(g.unsubscribe.bind(g))}
|
|
1097
|
+
function zn(a,b,c,d){let e=[];const f=T(a.db,b,c,(g,h)=>{if(g){const k=Mm(d,h),l=olympe.dc.CloudObject.get(h);l instanceof olympe.sc.logic.dd&&null!==e?e.push(()=>l.run(k)):l.run(k)}else{let k;null==(k=Om(d,h))||k.destroy()}});e.forEach(g=>g());e=null;d.Cb().onDestroy(a.db.D.bind(a.db,b,c,f))}function yn(a,b){return a.rd().H(b)}
|
|
1098
|
+
function vn(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)}})}function wn(a,b,c,d){b=b.Cb();const e=Ng(a.db,a.tag,b.rc((f,g,h)=>{const k=h?d:c;null!==k&&(k(f,olympe.dc.mb.Bc(g)),h&&c!==k&&(null==c||c(f,null)))}));b.onDestroy(()=>{Og(a.db,a.tag,e)})}
|
|
1099
|
+
olympe.sc.Runnable=class extends olympe.dm.BrickMetadata{constructor(a,b,c){super(a,b);this.G=c}run(a){a.Cb().run(()=>{un(this,a);this.init(a);a.mh(this.clear.bind(this,a));a.onDestroy(this.destroy.bind(this,a));xn(this,a);this.D(a)})}rd(){return this.Wb()}init(a){this.onInit(a)}update(a,b,c){const d=this.rd();if(d.ii())this.onUpdate(a,b,c);else this.G.debug(`Softcoded runnable ${this.db.name(this)} with tag ${this.tag} running in context ${a.T()}`),zn(this,d,olympe.sc.Ua.N,a),this.da()&&zn(this,
|
|
1100
|
+
d,olympe.sc.Ua.Y,a)}D(a){a.Gn(olympe.sc.Ua.jb)}clear(){}destroy(a){this.onDestroy(a)}setupExecution(a){return this.rd().F(a)}onInit(){}onUpdate(){const a=this.ac(),b=this.db.name(a),c=this.db.name(this.db.model(a));this.G.error(`No code was found for ${b} (${c}: ${a})\n\n`+'This is probably because the code has not yet been deployed to the environment, or because the package.json does not import the required dependencies.')}onDestroy(){}getInputs(){return rn(this.rd())}getOutputs(){return sn(this.rd())}F(){return[]}j(){return null}da(){return!1}H(a,
|
|
1101
|
+
b,c,d){a=b.rb(a,c,!0);void 0!==d&&olympe.C.nh(a,d);return a}$a(a,b,c,d,e){olympe.C.vn([d],f=>{b.set(a,olympe.C.ys(f)?f.valueOf():f)});return this.H(a,b,c,e)}N(){return[this.$,this.R]}$(a,b){wn(this,a,b,null)}R(a,b){wn(this,a,null,b)}jb(a,b){const c=this.db,d=olympe.sc.logic.pb.F.$b(),e=olympe.sc.logic.pb.D,f=olympe.sc.logic.pb.j;this.cs(d,g=>{var h=g.X();if(h=c.Jb(h,e)||c.Jb(h,f))return An(g,a,b.bind(null,h))})}};olympe.sc.Runnable.O=Of(olympe.dc.na.j('01130000000000ca1100',olympe.sc.Runnable));
|
|
1102
1102
|
olympe.sc.Runnable.H=olympe.sc.Runnable.O.sa('01692a4af82e8984742b');olympe.sc.Runnable.j=olympe.sc.Runnable.O.sa('01756a18d4921c103111');olympe.sc.Runnable.N=R(olympe.sc.Runnable.O,olympe.sc.Ua.N);olympe.sc.Runnable.R=R(olympe.sc.Runnable.O,olympe.sc.Ua.R);olympe.sc.Runnable.Y=R(olympe.sc.Runnable.O,olympe.sc.Ua.Y);R(olympe.sc.Ua.O,olympe.sc.Runnable.H);R(olympe.sc.Ua.O,olympe.sc.Runnable.j);olympe.sc.Runnable.prototype.rd.K=new olympe.C.J(()=>olympe.sc.Ua,[]);
|
|
1103
|
-
olympe.sc.Runnable.prototype.H.K=new olympe.C.J(()=>Object,[]);olympe.sc.Runnable.prototype.$a.K=olympe.C.J.j;function
|
|
1104
|
-
olympe.sc.Pd.j=olympe.sc.Pd.O.sa('0169b5a8a33144fb0b49');R(olympe.dc.CloudObject.O,olympe.sc.Pd.j);olympe.sc.Pd.prototype.D.K=new olympe.C.J(()=>String,[]);olympe.sc.Pd.prototype.j.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);olympe.sc.Io=class extends olympe.dm.Kb{qe(){return olympe.sc.se.Ie.rh}};olympe.sc.Io.O=olympe.dc.na.j('0163a68ce44f3d1fa84c',olympe.sc.Io);olympe.sc.yc=class extends olympe.dm.BrickMetadata{};olympe.sc.yc.O=olympe.dc.na.j('016324fde11a836f76c2',olympe.sc.yc);olympe.sc.yc.j=olympe.sc.yc.O.sa('016324fde11a836087c2');olympe.sc.yc.O.j=function(a,b){return
|
|
1105
|
-
function
|
|
1106
|
-
g()}))})}olympe.ja.ab('sc').debug("Found business container but won't load it's content according to configuration.")}else olympe.ja.ab('sc').info(`No business container for application ${a}. You probably miss permissions.`);return Promise.resolve()}).catch(d=>{
|
|
1103
|
+
olympe.sc.Runnable.prototype.H.K=new olympe.C.J(()=>Object,[]);olympe.sc.Runnable.prototype.$a.K=olympe.C.J.j;function Bn(a){if(a){if('string'===typeof a)return a;if(a instanceof olympe.sc.Pd)return(a=a.D())?a.valueOf():null;if('function'===typeof a.X)return a.X()}return null}olympe.sc.Pd=class extends olympe.dc.CloudObject{D(){return this.db.bb(this,olympe.sc.Pd.j)[0]}j(){const a=Bn(this);return olympe.dc.CloudObject.get(a)}Bc(){return this.j().Bc()}toString(){const a=Bn(this);let b;a&&(b=this.db.name(a));return b||super.toString()}};olympe.sc.Pd.O=olympe.dc.na.j('0163c9ae01f2d6e9ca49',olympe.sc.Pd);
|
|
1104
|
+
olympe.sc.Pd.j=olympe.sc.Pd.O.sa('0169b5a8a33144fb0b49');R(olympe.dc.CloudObject.O,olympe.sc.Pd.j);olympe.sc.Pd.prototype.D.K=new olympe.C.J(()=>String,[]);olympe.sc.Pd.prototype.j.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);olympe.sc.Io=class extends olympe.dm.Kb{qe(){return olympe.sc.se.Ie.rh}};olympe.sc.Io.O=olympe.dc.na.j('0163a68ce44f3d1fa84c',olympe.sc.Io);olympe.sc.yc=class extends olympe.dm.BrickMetadata{};olympe.sc.yc.O=olympe.dc.na.j('016324fde11a836f76c2',olympe.sc.yc);olympe.sc.yc.j=olympe.sc.yc.O.sa('016324fde11a836087c2');olympe.sc.yc.O.j=function(a,b){return Cl(a,null!=b?b:'New type',olympe.sc.yc).X()};let Cn=null,Dn=null,En=[];
|
|
1105
|
+
function Fn(a,b){Cn=a;const c=olympe.C.Xa();return olympe.dc.nd.from(a).fb(olympe.sc.qa.Xc.j).fb(olympe.sc.nf.j.$b()).nb({Xh:'__code-as-data__'}).then(d=>{let e;null==(e=En)||e.forEach(f=>f());En=null;Dn=d;if(null!==d){if(b){const f=olympe.dc.ia();return new Promise(g=>{ci(c,d,h=>{h=f.ji(h)?h:f.model(h);return null!==h&&f.Ob(h,olympe.sc.yc)},{Dn:!0}).subscribe(rxjs.Subscriber.create(()=>{g()},()=>{olympe.ja.ab('sc').error('Impossible to load the business container for the application',a,'maybe are you offline?');
|
|
1106
|
+
g()}))})}olympe.ja.ab('sc').debug("Found business container but won't load it's content according to configuration.")}else olympe.ja.ab('sc').info(`No business container for application ${a}. You probably miss permissions.`);return Promise.resolve()}).catch(d=>{En=null;throw d;})}function pf(){return null===En?Promise.resolve():new Promise(a=>{En.push(()=>a())})}olympe.sc.nf=class extends olympe.dc.CloudObject{};olympe.sc.nf.O=olympe.dc.na.j('017b3aa8fae1e3d044dc',olympe.sc.nf);olympe.sc.nf.j=olympe.sc.nf.O.sa('017b3aa8fd1659291b92');
|
|
1107
1107
|
olympe.sc.nf.D=olympe.sc.nf.O.sa('017b3aa8fe7ec3fd52f2');olympe.sc.Map=class extends olympe.dc.CloudObject{};olympe.sc.Map.O=olympe.dc.na.j('018119241abce0e5696e',olympe.sc.Map);olympe.sc.Hg=class extends olympe.sc.Map{};olympe.sc.Hg.O=olympe.dc.na.j('01631aacd8276ea98490',olympe.sc.Hg);olympe.sc.File=class extends olympe.dm.File{static $w(a,b,c,d,e,f){e=a.create(olympe.sc.File,new Map,e,f);olympe.sc.File.Ns(a,e,b,c,d);return e}static ax(a,b,c,d,e,f){e=a.create(olympe.sc.File,new Map,e,f);olympe.sc.File.Cn(a,e,b,c,d);return e}static Ns(a,b,c,d,e){e=null!=e?e:'application/data';d=URL.createObjectURL(new Blob([d],{type:e}));olympe.sc.File.Cn(a,b,c,d,e)}static Cn(a,b,c,d,e){const f=olympe.dc.ia(),g=f.Ha(b);var h;const k=null!=(h=a.model(b))?h:olympe.sc.File;if(null===k||!f.Qf(k,olympe.dm.File))throw Error(`Try to set the content of an object which is not a file: ${b}`);
|
|
1108
1108
|
h=new Date;c=(new Map).set(olympe.dm.File.fileNameProp,null!=c?c:'file').set(olympe.dm.File.urlProp,d).set(olympe.dm.File.modificationDateProp,h).set(olympe.dm.File.mimeTypeProp,null!=e?e:'application/data');g&&null!==f.Qa(b,olympe.dm.File.urlProp)||c.set(olympe.dm.File.creationDateProp,h).set(olympe.dm.File.j,!1);a.Fs(b,c)}};olympe.sc.File.setURLContent=olympe.sc.File.Cn;olympe.sc.File.setContent=olympe.sc.File.Ns;olympe.sc.File.createFromURL=olympe.sc.File.ax;olympe.sc.File.createFromContent=olympe.sc.File.$w;
|
|
1109
1109
|
olympe.sc.File.O=If(olympe.dm.File,'ff021000000000000031',olympe.sc.File);olympe.sc.Dg=class extends olympe.sc.File{H(){const a=olympe.C.bc(olympe.C.Sa);this.Pk(b=>{a.update(olympe.C.xb(b))});return a.rb()}};olympe.sc.Dg.O=If(olympe.sc.File,'01644b6297305d62fca2',olympe.sc.Dg);olympe.sc.Dg.O.j=olympe.sc.File.D.bind(null,olympe.sc.Dg);olympe.sc.Dg.prototype.H.K=olympe.C.J.D;olympe.sc.Kc=class extends olympe.sc.File{H(){return this.wb(olympe.sc.Kc.fontFamilyProp)}N(){return this.wb(olympe.sc.Kc.F)}R(){return this.sd(olympe.sc.Kc.H)}};olympe.sc.Kc.O=If(olympe.sc.File,'01647e113043c637b541',olympe.sc.Kc);olympe.sc.Kc.fontFamilyProp=olympe.sc.Kc.O.ka('01647e35ecd24ef0b88d');olympe.sc.Kc.F=olympe.sc.Kc.O.ka('01647e677f5d1cfbdf42');olympe.sc.Kc.H=olympe.sc.Kc.O.ka('01647e6780999bf8bd25');
|
|
1110
1110
|
olympe.sc.Kc.O.j=(a,b,c,d)=>{c=olympe.sc.File.D(olympe.sc.Kc,a,b,c,d);a.update(c,olympe.sc.Kc.fontFamilyProp,b.split('.')[0]);return c};olympe.sc.Kc.prototype.H.K=olympe.C.J.D;olympe.sc.Kc.prototype.N.K=olympe.C.J.D;olympe.sc.Kc.prototype.R.K=olympe.C.J.F;olympe.sc.Qh=class extends olympe.sc.File{};olympe.sc.Qh.O=If(olympe.sc.File,'0164643c432146a71d5c',olympe.sc.Qh);olympe.sc.Qh.O.j=olympe.sc.File.D.bind(null,olympe.sc.Qh);olympe.sc.Fr=class extends olympe.dc.CloudObject{};olympe.sc.Fr.O=olympe.dc.na.j('016421bb3797e22d1c4e',olympe.sc.Fr);olympe.sc.logic={};olympe.sc.logic.op=(a,b)=>a===b?0:a>b?1:-1;
|
|
1111
1111
|
olympe.sc.logic.uB=(a,b,c,d,e,f,g)=>{const h=b.X();b=olympe.C.Pa(b.getType().X());let k,l;if(b===olympe.dc.fa(olympe.dm.String))k=c.valueOf().toLowerCase(),l=p=>p.wb(h).toLowerCase();else if(b===olympe.dc.fa(olympe.dm.Number))k=c.valueOf(),l=p=>p.sd(h);else if(b===olympe.dc.fa(olympe.dm.DateTime))k=c.getTime(),l=p=>olympe.C.ta([p.rj(h)],q=>q.getTime(),Number,'FilterList Date&DateTime TransformFlows');else{c=olympe.dc.ia().name(b);g.warn(`Properties of type ${c} are not supported. List will not be filtered.`);e(a);
|
|
1112
1112
|
return}let n;if('<'===f)n=(p,q)=>olympe.sc.logic.op(q,p);else if('>'===f)n=(p,q)=>olympe.sc.logic.op(p,q);else{g.error(`Unknown inequality ${f}. Please use '<' or '>'`);return}e(a.Jk().filter(p=>olympe.C.ta([l(p)],q=>{q=n(q.valueOf(),k);return olympe.C.Sb(d.valueOf()?1===q:0<=q)},olympe.C.ea,'FilterList ListDefBuilder Filter TransformFlows')).Ki())};
|
|
1113
|
-
olympe.sc.logic.fE=(a,b)=>{if(a instanceof olympe.C.aa)return a;if(a instanceof olympe.C.Sa)return a.Rs();if(a instanceof olympe.C.ea)return a.rs();if('string'===typeof a||'number'===typeof a)return olympe.C.ra(Number(a));b.error(`Could not parse provided value ${a} into a number`);return olympe.C.aa.Zp};olympe.sc.logic.Ra={};function
|
|
1114
|
-
olympe.sc.logic.na=class{constructor(){}static j(a,b,...c){if(
|
|
1115
|
-
olympe.sc.logic.Error.prototype.getCode=olympe.sc.logic.Error.prototype.es;olympe.sc.logic.Error.prototype.getMessage=olympe.sc.logic.Error.prototype.ay;olympe.sc.logic.Error.create=olympe.sc.logic.Error.create;olympe.sc.logic.Bi=class extends olympe.sc.logic.Pj{};olympe.sc.logic.Bi.O=olympe.dc.na.j('016eeb5ede9f3094d8f0',olympe.sc.logic.Bi);olympe.sc.logic.md=class extends olympe.dc.CloudObject{j(){return this.Pc(olympe.sc.logic.md.j,olympe.dc.CloudObject)}};olympe.sc.logic.md.O=olympe.dc.na.j('016ac4f59ee8ea2081ba',olympe.sc.logic.md);olympe.sc.logic.md.D=olympe.sc.logic.md.O.ka('017bc044aeacce7ffc8f');olympe.sc.logic.md.j=olympe.sc.logic.md.O.sa('016ac4f5a0091c4790e2');R(olympe.dc.CloudObject.O,olympe.sc.logic.md.j);olympe.sc.logic.md.prototype.j.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.Ih=class extends olympe.sc.logic.md{};olympe.sc.logic.Ih.O=olympe.dc.na.j('016ac4f59c592b862457',olympe.sc.logic.Ih);olympe.sc.logic.Ih.F=olympe.sc.od.j.$b();olympe.sc.logic.Ih.O.j=(a,b,c,d,e)=>{b=
|
|
1116
|
-
c=>this.db.model(c)===olympe.dc.fa(a));return b?olympe.dc.CloudObject.get(b):null}H(a){if(!this.ii())return super.H(a);const b=olympe.dc.fa(olympe.sc.logic.Pj),c=olympe.dc.fa(olympe.sc.logic.Bi);return
|
|
1117
|
-
c.includes(null)?null:c)):rxjs.of([])}};olympe.sc.logic.xd.O=
|
|
1118
|
-
olympe.sc.logic.Wf=class extends olympe.sc.logic.xd{R(){return this.j('016ac63229782039429f')}$(){return this.D('016ac6322acf67eebfe7')}da(){return this.Np().Jk().fb(olympe.sc.logic.Ub.typeRel).Xk(olympe.sc.logic.Bi).Ki().xf().rn(olympe.C.aa.ZERO)}F(a){if(this.ii()||
|
|
1119
|
-
olympe.sc.logic.Wf.O=
|
|
1113
|
+
olympe.sc.logic.fE=(a,b)=>{if(a instanceof olympe.C.aa)return a;if(a instanceof olympe.C.Sa)return a.Rs();if(a instanceof olympe.C.ea)return a.rs();if('string'===typeof a||'number'===typeof a)return olympe.C.ra(Number(a));b.error(`Could not parse provided value ${a} into a number`);return olympe.C.aa.Zp};olympe.sc.logic.Ra={};function Gn(a){Nf(a.O,(b,c)=>{b=b.create(a.O.D);Y(b,olympe.dc.CloudObject.nameProp,c);return b.X()})}olympe.sc.logic.Ra.cp=class{constructor(a,b,c){this.O=olympe.dc.na.j(a,b,...c);Gn(this)}X(){return this.O.X()}};olympe.sc.logic.Ra.cp.xa=[olympe.dc.Te];const Hn=Object.create(null),In=new Map;function Jn(a){if(void 0===Hn[a])throw Error(`Tag: ${a} - does not correspond to a registered function`);return Kf(a)}function Kn(a,b,c=olympe.sc.logic.Function){if(In.has(a))throw c=Jn(a),Error(`Tag: ${a} - overwriting existing function definition "${c.name}" with "${b.name}"`);const d=olympe.dc.na.j(a,b,...[]);In.set(a,{O:d,wE:b,cE:c});return d}
|
|
1114
|
+
olympe.sc.logic.na=class{constructor(){}static j(a,b,...c){if(Hn[a])throw c=Jn(a),Error(`Tag: ${a} - overwriting already defined function "${c.name}" with "${b.name}"`);b=new olympe.sc.logic.Ra.cp(a,b,[olympe.sc.P.Ca].concat(c));return Hn[a]=b}};olympe.sc.logic.jA=class{};olympe.sc.logic.Pj=class extends olympe.dc.CloudObject{};olympe.sc.logic.Pj.O=olympe.dc.na.j('01621fb84e320000cf00',olympe.sc.logic.Pj);function Rm(a,b,c){return new olympe.sc.logic.Error(a,b,c)}olympe.sc.logic.Error=class extends Error{constructor(a,b,c){super(a);this.code=b;this.j=null!=c?c:null}static create(a,b){return new olympe.sc.logic.Error(a,b)}ay(){return this.message}es(){return this.code}ne(){let a;return null!=(a=this.j)?a:''}toString(){return`${this.message}\nError found in:\n${this.ne()}\n\n${this.stack}`}};olympe.sc.logic.Error.prototype.getStack=olympe.sc.logic.Error.prototype.ne;
|
|
1115
|
+
olympe.sc.logic.Error.prototype.getCode=olympe.sc.logic.Error.prototype.es;olympe.sc.logic.Error.prototype.getMessage=olympe.sc.logic.Error.prototype.ay;olympe.sc.logic.Error.create=olympe.sc.logic.Error.create;olympe.sc.logic.Bi=class extends olympe.sc.logic.Pj{};olympe.sc.logic.Bi.O=olympe.dc.na.j('016eeb5ede9f3094d8f0',olympe.sc.logic.Bi);olympe.sc.logic.md=class extends olympe.dc.CloudObject{j(){return this.Pc(olympe.sc.logic.md.j,olympe.dc.CloudObject)}};olympe.sc.logic.md.O=olympe.dc.na.j('016ac4f59ee8ea2081ba',olympe.sc.logic.md);olympe.sc.logic.md.D=olympe.sc.logic.md.O.ka('017bc044aeacce7ffc8f');olympe.sc.logic.md.j=olympe.sc.logic.md.O.sa('016ac4f5a0091c4790e2');R(olympe.dc.CloudObject.O,olympe.sc.logic.md.j);olympe.sc.logic.md.prototype.j.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.Ih=class extends olympe.sc.logic.md{};olympe.sc.logic.Ih.O=olympe.dc.na.j('016ac4f59c592b862457',olympe.sc.logic.Ih);olympe.sc.logic.Ih.F=olympe.sc.od.j.$b();olympe.sc.logic.Ih.O.j=(a,b,c,d,e)=>{b=Cl(a,b||'New Predefined Input',olympe.sc.logic.Ih,olympe.sc.logic.vb);Y(b,olympe.sc.logic.md.D,e);a.Oa(olympe.sc.logic.md.j,b,c);a.Oa(olympe.sc.od.j,d,b);return b.X()};olympe.sc.logic.Kg=class extends olympe.sc.logic.md{};olympe.sc.logic.Kg.O=olympe.dc.na.j('016ac4f59dd99f5df3e1',olympe.sc.logic.Kg);olympe.sc.logic.Kg.F=R(olympe.sc.logic.Kg.O,olympe.sc.od.D);olympe.sc.logic.Kg.O.j=(a,b,c,d,e)=>{b=Cl(a,b||'New Predefined Output',olympe.sc.logic.Kg,olympe.sc.logic.Gb);Y(b,olympe.sc.logic.md.D,e);a.Oa(olympe.sc.logic.md.j,b,c);a.Oa(olympe.sc.od.D,d,b);return b.X()};olympe.sc.logic.xd=class extends olympe.sc.Ua{qe(){return olympe.sc.se.Ie.hr}Y(){return this.en().Jk().Ob([olympe.sc.logic.Function]).and().ud().Ob([olympe.sc.logic.kd,olympe.sc.logic.dd]).Ki()}N(){const a=olympe.dc.fa(olympe.sc.logic.Bi);return this.db.bb(this,olympe.sc.logic.xd.D).filter(b=>this.db.Jb(b,olympe.sc.logic.Ub.typeRel)===a)}j(a){const b=this.db.bn(this,[olympe.sc.Ua.F],c=>this.db.model(c)===olympe.dc.fa(a));return b?olympe.dc.CloudObject.get(b):null}D(a){const b=this.db.bn(this,[olympe.sc.Ua.D],
|
|
1116
|
+
c=>this.db.model(c)===olympe.dc.fa(a));return b?olympe.dc.CloudObject.get(b):null}H(a){if(!this.ii())return super.H(a);const b=olympe.dc.fa(olympe.sc.logic.Pj),c=olympe.dc.fa(olympe.sc.logic.Bi);return sn(this).map(d=>{switch(this.db.Jb(d,olympe.sc.logic.Ub.typeRel)){case b:return a.Gn.bind(a,d);case c:return a.throw.bind(a);default:return a.set.bind(a,d)}})}F(a){if(!this.ii())return super.F(a);const b=rn(this);return 0<b.length?rxjs.combineLatest(b.map(c=>a.observe(c))).pipe(rxjs.operators.map(c=>
|
|
1117
|
+
c.includes(null)?null:c)):rxjs.of([])}};olympe.sc.logic.xd.O=Kn('01621fb84e320000f000',olympe.sc.logic.xd,olympe.sc.logic.Function);olympe.sc.logic.xd.prototype.j.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.xd.prototype.D.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);let Ln=null;function Mn(){if(null===Ln){let a;Ln=null!=(a=olympe.W.getParameter('sc.action.experimental'))?a:!1}return Ln}
|
|
1118
|
+
olympe.sc.logic.Wf=class extends olympe.sc.logic.xd{R(){return this.j('016ac63229782039429f')}$(){return this.D('016ac6322acf67eebfe7')}da(){return this.Np().Jk().fb(olympe.sc.logic.Ub.typeRel).Xk(olympe.sc.logic.Bi).Ki().xf().rn(olympe.C.aa.ZERO)}F(a){if(this.ii()||Mn()){const b=this.R().X();return a.observe(b).pipe(rxjs.operators.map(c=>null===c?null:rn(this).filter(d=>d!==b).map(d=>a.get(d))))}return super.F(a)}};olympe.sc.logic.Wf.j='016ac63229782039429f';olympe.sc.logic.Wf.H='016ac6322acf67eebfe7';
|
|
1119
|
+
olympe.sc.logic.Wf.O=Kn('01621fb84e320000a000',olympe.sc.logic.Wf,olympe.sc.logic.Action);olympe.sc.logic.Wf.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.Wf.prototype.$.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);olympe.sc.logic.Wf.prototype.da.K=olympe.C.J.N;olympe.sc.logic.ro=class extends olympe.sc.logic.xd{};olympe.sc.logic.ro.O=Kn('01621fb84e320000f011',olympe.sc.logic.ro);olympe.sc.logic.qo=class extends olympe.sc.logic.Wf{};olympe.sc.logic.qo.O=Kn('01621fb84e320000f012',olympe.sc.logic.qo);olympe.sc.logic.Function=class extends olympe.sc.Runnable{N(){return[this.jb]}j(){if(!this.rd().ii())return super.j();const a=olympe.sc.yg.j.Ul,b=olympe.sc.yg.j.mm,c=this.db,d=new Map,e=this.ac();c.bb(e,olympe.sc.Ua.F).forEach(f=>{d.set(a+c.name(f),f)});c.bb(e,olympe.sc.Ua.D).forEach(f=>{d.set(b+c.name(f),f)});return d}};olympe.sc.logic.Function.O=olympe.dc.na.j('0168c6f020f2a96f0000',olympe.sc.logic.Function,olympe.sc.P.Ca);olympe.sc.logic.Ub=class extends olympe.dc.CloudObject{getType(){return this.Pc(olympe.sc.logic.Ub.typeRel,olympe.dc.CloudObject)}j(){return this.sd(olympe.sc.logic.Ub.j)}};olympe.sc.logic.Ub.O=olympe.dc.na.j('0168a431d25001540000',olympe.sc.logic.Ub);olympe.sc.logic.Ub.j=olympe.sc.logic.Ub.O.ka('01740c5d4ae4b520dd01');olympe.sc.logic.Ub.typeRel=olympe.sc.logic.Ub.O.sa('0168a431d3b9b7438424');R(olympe.dc.CloudObject.O,olympe.sc.logic.Ub.typeRel);
|
|
1120
1120
|
olympe.sc.logic.Ub.prototype.getType.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.Ub.prototype.j.K=olympe.C.J.F;olympe.sc.logic.vb=class extends olympe.sc.logic.Ub{};olympe.sc.logic.vb.O=olympe.dc.na.j('0168a431d25001540001',olympe.sc.logic.vb);olympe.sc.logic.vb.R=olympe.sc.logic.Ub.O.ka('01740c5d4ae4b520dd02');olympe.sc.logic.vb.N=R(olympe.sc.logic.vb.O,olympe.sc.Ua.F);olympe.sc.logic.vb.D=olympe.sc.logic.vb.O.sa('0168a431d91f2578000b',olympe.dc.va.ORIGIN);olympe.sc.logic.vb.F=olympe.sc.logic.vb.O.sa('01621fb84e32000000a1',olympe.dc.va.ORIGIN);
|
|
1121
1121
|
olympe.sc.logic.vb.H=olympe.sc.logic.vb.O.sa('01621fb84e32000000d1',olympe.dc.va.ORIGIN);olympe.sc.logic.vb.O.j=function(a,b,c,d,e,f=olympe.sc.logic.vb){f=a.create(f);Y(f,olympe.dc.CloudObject.nameProp,b||'New input');a.Oa(olympe.sc.logic.Ub.typeRel,f,c);void 0!==e&&Y(f,olympe.sc.logic.Ub.j,e);d&&a.Oa(olympe.sc.Ua.F,d,f);return f.X()};olympe.sc.logic.Gb=class extends olympe.sc.logic.Ub{};olympe.sc.logic.Gb.O=olympe.dc.na.j('0168a431d25001540002',olympe.sc.logic.Gb);olympe.sc.logic.Gb.N=R(olympe.sc.logic.Gb.O,olympe.sc.Ua.D);olympe.sc.logic.Gb.D=olympe.sc.logic.Gb.O.sa('0168a431d91f25780003',olympe.dc.va.ORIGIN);olympe.sc.logic.Gb.H=olympe.sc.logic.Gb.O.sa('01621fb84e32000000a2',olympe.dc.va.ORIGIN);olympe.sc.logic.Gb.F=olympe.sc.logic.Gb.O.sa('01621fb84e32000000d2',olympe.dc.va.ORIGIN);
|
|
1122
|
-
olympe.sc.logic.Gb.O.j=function(a,b,c,d,e,f=olympe.sc.logic.Gb){f=a.create(f);Y(f,olympe.dc.CloudObject.nameProp,b||'New output');a.Oa(olympe.sc.logic.Ub.typeRel,f,c);void 0!==e&&Y(f,olympe.sc.logic.Ub.j,e);d&&a.Oa(olympe.sc.Ua.D,d,f);return f.X()};olympe.sc.logic.kd=class extends olympe.sc.logic.Function{run(a){
|
|
1122
|
+
olympe.sc.logic.Gb.O.j=function(a,b,c,d,e,f=olympe.sc.logic.Gb){f=a.create(f);Y(f,olympe.dc.CloudObject.nameProp,b||'New output');a.Oa(olympe.sc.logic.Ub.typeRel,f,c);void 0!==e&&Y(f,olympe.sc.logic.Ub.j,e);d&&a.Oa(olympe.sc.Ua.D,d,f);return f.X()};olympe.sc.logic.kd=class extends olympe.sc.logic.Function{run(a){un(this,a);const b=a.getParent(),c=this.db.Jb(this,olympe.sc.logic.kd.F),d=this.db.Jb(this,olympe.sc.logic.kd.D);a.on(c,e=>b.set(d,e),this.tag)}ha(){return this.ng(olympe.sc.logic.kd.F).Fc()}ua(){return this.ng(olympe.sc.logic.kd.D).Fc()}};olympe.sc.logic.kd.O=olympe.dc.na.j('01621fb84e32000000a0',olympe.sc.logic.kd,olympe.sc.P.Ca);olympe.sc.logic.kd.F=R(olympe.sc.logic.kd.O,olympe.sc.logic.vb.F);
|
|
1123
1123
|
olympe.sc.logic.kd.D=R(olympe.sc.logic.kd.O,olympe.sc.logic.Gb.H);olympe.sc.logic.kd.O.j=function(a,b,c){b=a.create(olympe.sc.logic.kd);a.Oa(olympe.sc.logic.kd.D,b,c);return b.X()};olympe.sc.logic.kd.prototype.ha.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.kd.prototype.ua.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);olympe.sc.logic.dd=class extends olympe.sc.logic.Function{run(a){const b=a.getParent(),c=this.db.Jb(this,olympe.sc.logic.dd.D),d=this.db.Jb(this,olympe.sc.logic.dd.F);b.on(c,e=>a.set(d,e),b.T())}ua(){return this.ng(olympe.sc.logic.dd.D).Fc()}ha(){return this.ng(olympe.sc.logic.dd.F).Fc()}};olympe.sc.logic.dd.O=olympe.dc.na.j('01621fb84e32000000d0',olympe.sc.logic.dd,olympe.sc.P.Ca);olympe.sc.logic.dd.D=R(olympe.sc.logic.dd.O,olympe.sc.logic.vb.H);olympe.sc.logic.dd.F=R(olympe.sc.logic.dd.O,olympe.sc.logic.Gb.F);
|
|
1124
|
-
olympe.sc.logic.dd.O.j=function(a,b,c){b=a.create(olympe.sc.logic.dd);a.Oa(olympe.sc.logic.dd.D,b,c);return b.X()};olympe.sc.logic.dd.prototype.ua.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.dd.prototype.ha.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);function
|
|
1125
|
-
h)}}function
|
|
1124
|
+
olympe.sc.logic.dd.O.j=function(a,b,c){b=a.create(olympe.sc.logic.dd);a.Oa(olympe.sc.logic.dd.D,b,c);return b.X()};olympe.sc.logic.dd.prototype.ua.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.dd.prototype.ha.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);function An(a,b,c){var d;const e=null!=(d=a.db.Jb(a,olympe.sc.logic.pb.R))?d:a.db.Jb(a,olympe.sc.logic.pb.H),f=a.db.Jb(a,olympe.sc.logic.pb.N);if(null!==e&&null!==f){d=a.db.Qf(Nn(a),olympe.dm.De)?new olympe.C.Xb('Pipe Context'):null;const k=a.j.bind(a,c,d);let l;const n=b.cl(f,p=>{let q;null==(q=l)||q();l=p.on(e,k,f)});return()=>{k(null);n();let p;null==(p=l)||p()}}const g=k=>c(olympe.dc.mb.Bc(k)),h=Lg(a.db,a,olympe.sc.logic.pb.valueProp,g);return()=>{g(null);Mg(a.db,a,olympe.sc.logic.pb.valueProp,
|
|
1125
|
+
h)}}function Nn(a){let b=null,c=a.db.Jb(a,olympe.sc.logic.pb.D);c?b=a.db.Jb(c,olympe.dm.Property.typeRel):(c=a.db.Jb(a,olympe.sc.logic.pb.j))&&(b=a.db.Jb(c,olympe.sc.logic.Ub.typeRel));return b||olympe.dc.fa(olympe.dc.CloudObject)}
|
|
1126
1126
|
olympe.sc.logic.pb=class extends olympe.dc.CloudObject{constructor(a,b,c){super(a,b);this.G=c}j(a,b,c){const d=olympe.sc.ij(c);null==b||b.lg();b&&d instanceof olympe.dm.De?null==b||b.run(()=>{olympe.C.Sc([d.getValue()],e=>{a(e.valueOf())})}):a(d)}getValue(a){return this.Pf(olympe.sc.logic.pb.valueProp,a||olympe.dc.mb.ij,Object)}getType(){const a=this.transform(olympe.sc.logic.pb.j,olympe.sc.logic.Ub.typeRel);a.Md(olympe.dc.CloudObject);return a.Gc()}wy(){return this.Pc(olympe.sc.logic.pb.N,olympe.dc.CloudObject)}uy(){return this.Pc(olympe.sc.logic.pb.R,
|
|
1127
1127
|
olympe.sc.logic.Gb)}vy(){return this.Pc(olympe.sc.logic.pb.H,olympe.dm.Property)}Ox(){return this.Pc(olympe.sc.logic.pb.F,olympe.dc.CloudObject)}Mx(){return this.Pc(olympe.sc.logic.pb.j,olympe.sc.logic.vb)}Nx(){return this.Pc(olympe.sc.logic.pb.D,olympe.dm.Property)}};olympe.sc.logic.pb.O=olympe.dc.na.j('0168a431d91f25780000',olympe.sc.logic.pb,olympe.sc.P.Ca);olympe.sc.logic.pb.valueProp=olympe.sc.logic.pb.O.ka('0168a431d91f25780001');olympe.sc.logic.pb.N=olympe.sc.logic.pb.O.sa('0168a431d91f25780002');
|
|
1128
1128
|
olympe.sc.logic.pb.R=R(olympe.sc.logic.pb.O,olympe.sc.logic.Gb.D);olympe.sc.logic.pb.H=olympe.sc.logic.pb.O.sa('0168a431d91f25780004');olympe.sc.logic.pb.F=olympe.sc.logic.pb.O.sa('0168a431d91f2578000a');olympe.sc.logic.pb.j=R(olympe.sc.logic.pb.O,olympe.sc.logic.vb.D);olympe.sc.logic.pb.D=olympe.sc.logic.pb.O.sa('0168a431d91f2578000c');R(olympe.dc.CloudObject.O,olympe.sc.logic.pb.N);R(olympe.dm.Property.O,olympe.sc.logic.pb.H);R(olympe.dc.CloudObject.O,olympe.sc.logic.pb.F);
|
|
1129
|
-
R(olympe.dm.Property.O,olympe.sc.logic.pb.D);m=olympe.sc.logic.pb.prototype;m.getType.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.wy.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.uy.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);m.vy.K=new olympe.C.J(()=>olympe.dm.Property,[]);m.Ox.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.Mx.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);m.Nx.K=new olympe.C.J(()=>olympe.dm.Property,[]);function
|
|
1129
|
+
R(olympe.dm.Property.O,olympe.sc.logic.pb.D);m=olympe.sc.logic.pb.prototype;m.getType.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.wy.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.uy.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);m.vy.K=new olympe.C.J(()=>olympe.dm.Property,[]);m.Ox.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.Mx.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);m.Nx.K=new olympe.C.J(()=>olympe.dm.Property,[]);function On(a,b){const c=a.rd(),d=c.Yl().X(),e=c.Zl().X(),f=c.$l().X();b.on(d,g=>{if(g){g=new Map(a.getInputs().map(k=>[k,b.get(k)]));const h={timeout:a.timeout};olympe.L.ub.get(a.ac(),g,h).then(k=>{for(const [l,n]of k)l!==e&&l!==f&&b.set(l,n);b.set(e,k.get(e));k=k.get(f);k instanceof olympe.sc.logic.Error&&(k=Rm(k.message,k.code,k.ne()+'\n===== Remote Call =====\n'+b.ne()),b.throw(k))}).catch(k=>{k=`RemoteAction "${a.Wb().name()}" (${a.tag}) encountered an error:\n${k}`;a.G.error(k);b.throw(olympe.sc.logic.Error.create(k,
|
|
1130
1130
|
400))})}},b.T())}
|
|
1131
|
-
function
|
|
1132
|
-
olympe.sc.logic.Lh=class extends olympe.sc.logic.Function{constructor(a,b,c,d){super(a,b,c);this.timeout=d}run(a){let b;null!=(b=a.Pa(olympe.sc.ya.j.EDITION))&&b||(this.db.Qa(this,olympe.sc.logic.Lh.D)?(
|
|
1133
|
-
k.destroy()},this.timeout);
|
|
1134
|
-
1))})},h=>{const k=this.ac();this.G.error(`Error while listening on remote action ${this.db.name(k)} (${k}): ${h.message}`)}))}};olympe.sc.logic.Lh.O=olympe.dc.na.j('017a7b0c5dcbd8964c5d',olympe.sc.logic.Lh,olympe.sc.P.Ca,new olympe.W.pa(olympe.sc.U.Lq));olympe.sc.logic.Lh.D=olympe.sc.logic.Lh.O.ka('017a7b0c62a02a89444f');olympe.sc.logic.controllers={};olympe.sc.logic.controllers.Vl=class{constructor(a){this.db=olympe.dc.ia();this.typeRel=a}};olympe.sc.logic.controllers.Vl.j={mA:-1,mB:1};olympe.sc.logic.controllers.dC=class extends olympe.sc.logic.controllers.Vl{constructor(){super(olympe.sc.logic.md.j)}};olympe.sc.logic.controllers.lC=class extends olympe.sc.logic.controllers.Vl{constructor(){super(olympe.sc.logic.Ub.typeRel)}};olympe.sc.logic.Nk={};olympe.sc.logic.Nk.cw=class extends olympe.sc.logic.Function{update(a,[b],[c]){const d=olympe.dc.fa(b);d?olympe.dc.ma.Pb(a,d,olympe.dc.Lb.fg).subscribe(()=>{c(olympe.dc.CloudObject.get(d))}):this.G.warn('Cannot subscribe to an instance with no tag: '+d)}};olympe.sc.logic.na.j('0174bf4b7e006e4b788a',olympe.sc.logic.Nk.cw);olympe.sc.logic.actions={};olympe.sc.logic.Nk.Uu=class extends olympe.sc.logic.Function{run(a){
|
|
1135
|
-
olympe.sc.logic.na.j('0171889b060b6cd54300',olympe.sc.logic.Nk.Uu);olympe.sc.logic.Rb={};olympe.sc.logic.Rb.Ll=class extends olympe.sc.logic.xd{R(){return this.j('016ac638085357047a2d')}};olympe.sc.logic.Rb.Ll.O=
|
|
1136
|
-
olympe.sc.logic.Rb.Og.O=
|
|
1137
|
-
olympe.sc.workflow.ObjectState.dateTimeProp=olympe.sc.workflow.ObjectState.O.ka('017ffdd8f0b1e31fe13b');olympe.sc.workflow.ObjectState.serializedObjectProp=olympe.sc.workflow.ObjectState.O.ka('017ffdd8f0b1e31fe13d');olympe.sc.workflow.ObjectState.objectRel=olympe.sc.workflow.ObjectState.O.sa('017ffdd8f0b1e31fe13c');olympe.sc.workflow.ObjectState.currentObjectRel=olympe.sc.workflow.ObjectState.O.sa('017ffdd8f0b1e31fe13f');olympe.sc.workflow.Af=class extends olympe.sc.logic.xd{Eu(){return this.j('017ffe02381f9fac5060')}Hu(){return this.j('017ffe02381f9fac5061')}Iu(){return this.j('017ffe02381f9fac5062')}Kx(){return this.j('017ffe02381f9fac5065')}Fu(){return this.D('017ffe02381f9fac5063')}Gu(){return this.D('017ffe02381f9fac5064')}};olympe.sc.workflow.Af.O=
|
|
1131
|
+
function Pn(a,b,c,d,e,f){const g=n=>w(function*(){if(null!==n){e.cancel();let p;null==(p=k)||p();let q;null==(q=l)||q();try{const r=new Map(a.getOutputs().map(t=>[t,b.get(t)]));yield f.vd(r)}catch(r){const t=Error(`Error while trying to send the response of remote action ${a.Wb().name()} (${a.ac()}): ${r}`);f.bi(t).catch(u=>{a.G.error(`Cannot reply with an error to a remote action call ${a.Wb().name()} (${a.ac()}): ${u}`)})}finally{b.destroy()}}}),h=b.T(),k=b.on(c,g,h),l=b.on(d,g,h)}
|
|
1132
|
+
olympe.sc.logic.Lh=class extends olympe.sc.logic.Function{constructor(a,b,c,d){super(a,b,c);this.timeout=d}run(a){let b;null!=(b=a.Pa(olympe.sc.ya.j.EDITION))&&b||(this.db.Qa(this,olympe.sc.logic.Lh.D)?(en(a.j,this),this.ha(a)):(un(this,a),On(this,a)))}ha(a){const b=this.ac(),c=this.rd(),d=c.Op().X(),e=c.Yl().X(),f=c.Zl().X(),g=c.$l().X();(new olympe.L.ub(b,a)).listen().subscribe(rxjs.Subscriber.create(h=>{const k=a.Yh('remote call'),l=h.body(),n=wc(()=>{h.bi(Error(`Timeout reached on remote action ${this.db.name(this)} (${this.tag})`));
|
|
1133
|
+
k.destroy()},this.timeout);Pn(this,k,f,g,n,h);super.run(k);for(const [p,q]of l)p!==e&&k.set(p,q);h.mi().then(p=>{var q=k.get(d);null!==q&&olympe.dc.fa(q)!==p&&(q=this.ac(),this.G.warn(`Remote action ${this.db.name(q)} ${q}: try to run it with an input user that is not the real authenticated user.`));k.set(d,p);k.set(e,l.get(e))}).catch(p=>{const q=this.ac();this.G.warn(`Remote action ${this.db.name(q)} ${q} Triggered by unrecognized user: ${p}.`);k.set(g,olympe.sc.logic.Error.create('Unrecognized User',
|
|
1134
|
+
1))})},h=>{const k=this.ac();this.G.error(`Error while listening on remote action ${this.db.name(k)} (${k}): ${h.message}`)}))}};olympe.sc.logic.Lh.O=olympe.dc.na.j('017a7b0c5dcbd8964c5d',olympe.sc.logic.Lh,olympe.sc.P.Ca,new olympe.W.pa(olympe.sc.U.Lq));olympe.sc.logic.Lh.D=olympe.sc.logic.Lh.O.ka('017a7b0c62a02a89444f');olympe.sc.logic.controllers={};olympe.sc.logic.controllers.Vl=class{constructor(a){this.db=olympe.dc.ia();this.typeRel=a}};olympe.sc.logic.controllers.Vl.j={mA:-1,mB:1};olympe.sc.logic.controllers.dC=class extends olympe.sc.logic.controllers.Vl{constructor(){super(olympe.sc.logic.md.j)}};olympe.sc.logic.controllers.lC=class extends olympe.sc.logic.controllers.Vl{constructor(){super(olympe.sc.logic.Ub.typeRel)}};olympe.sc.logic.Nk={};olympe.sc.logic.Nk.cw=class extends olympe.sc.logic.Function{update(a,[b],[c]){const d=olympe.dc.fa(b);d?olympe.dc.ma.Pb(a,d,olympe.dc.Lb.fg).subscribe(()=>{c(olympe.dc.CloudObject.get(d))}):this.G.warn('Cannot subscribe to an instance with no tag: '+d)}};olympe.sc.logic.na.j('0174bf4b7e006e4b788a',olympe.sc.logic.Nk.cw);olympe.sc.logic.actions={};olympe.sc.logic.Nk.Uu=class extends olympe.sc.logic.Function{run(a){un(this,a);const [b,c,d]=yn(this,a);let e,f=null,g=null;const h=a.getParent(),k=()=>{null===g||0===e?(this.G.warn('No list to iter upon'),this.G.info(a.T())):f<e?(b(g.gf(f)),f++,c(Date.now())):(gn(h.j),d(Date.now()))};this.getInputs().forEach((l,n)=>a.on(l,p=>{if(p)switch(n){case 0:g=p;break;case 1:e=g.og();f=0;fn(h.j);k();break;case 2:k();break;default:this.G.error('Unhandled input')}},this.tag))}};
|
|
1135
|
+
olympe.sc.logic.na.j('0171889b060b6cd54300',olympe.sc.logic.Nk.Uu);olympe.sc.logic.Rb={};olympe.sc.logic.Rb.Ll=class extends olympe.sc.logic.xd{R(){return this.j('016ac638085357047a2d')}};olympe.sc.logic.Rb.Ll.O=Kn('0169b6876a03f14ae61b',olympe.sc.logic.Rb.Ll);olympe.sc.logic.Rb.Ll.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);let Qn=null;olympe.sc.logic.Rb.Wl=class extends olympe.sc.logic.xd{R(){return this.j('016ac63808535703691c')}F(a){if(null===Qn){let b;Qn=null!=(b=olympe.W.getParameter('sc.event.experimental'))?b:!1}return Qn?a.observe(rn(this)[0]):super.F(a)}};olympe.sc.logic.Rb.Wl.O=Kn('0169b6876a03f139d50a',olympe.sc.logic.Rb.Wl);olympe.sc.logic.Rb.Wl.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.Rb.nm=class extends olympe.sc.logic.xd{R(){return this.j('016ac63809a9a8e6db96')}$(){return this.D('016ac6380ab003363b3e')}};Kn('01646ad602f933b8caaf',olympe.sc.logic.Rb.nm);olympe.sc.logic.Rb.nm.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.Rb.nm.prototype.$.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);olympe.sc.logic.Rb.gk=class extends olympe.sc.logic.xd{R(){return this.j('016ac6380bd98f1d91a0')}da(){return this.D('016ac63c589ae38ca3ae')}$(){return this.D('016ac63c5a377fceabaa')}};Kn('0168ec42fc01747a98b6',olympe.sc.logic.Rb.gk);olympe.sc.logic.Rb.gk.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.Rb.gk.prototype.da.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);olympe.sc.logic.Rb.gk.prototype.$.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);olympe.sc.logic.Rb.Og=class extends olympe.sc.logic.xd{Yl(){return this.j('017a7b07b09e3b22c8b4')}Op(){return this.j('017a7b07ba05807a74b0')}Zl(){return this.D('017a7b0818c12388d731')}$l(){return this.D('017a7b085146d5e69aec')}Du(){return olympe.C.ea.D}};olympe.sc.logic.Rb.Og.H='017a7b07b09e3b22c8b4';olympe.sc.logic.Rb.Og.vc='017a7b07ba05807a74b0';olympe.sc.logic.Rb.Og.ha='017a7b0818c12388d731';olympe.sc.logic.Rb.Og.j='017a7b085146d5e69aec';
|
|
1136
|
+
olympe.sc.logic.Rb.Og.O=Kn('017a7b07a948e30508fa',olympe.sc.logic.Rb.Og,olympe.sc.logic.Lh);m=olympe.sc.logic.Rb.Og.prototype;m.Yl.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);m.Op.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);m.Zl.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);m.$l.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);m.Du.K=olympe.C.J.N;olympe.sc.logic.Rb.mr=class extends olympe.sc.logic.xd{R(){return this.j('016ac63c5b3ed0562740')}};Kn('016a9766c230916ea5ec',olympe.sc.logic.Rb.mr);olympe.sc.logic.Rb.mr.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);olympe.sc.query={};olympe.sc.query.Un=class extends olympe.sc.Hg{};olympe.sc.query.Un.O=olympe.dc.na.j('01631aacd8276ea98491',olympe.sc.query.Un);olympe.sc.query.uq=class extends olympe.dm.Enum{};olympe.sc.query.uq.O=olympe.dc.na.j('01631aacd8276ea98495',olympe.sc.query.uq);olympe.sc.query.Eq=class extends olympe.dm.Enum{};olympe.sc.query.Eq.O=olympe.dc.na.j('01631aacd8276ea98494',olympe.sc.query.Eq);olympe.sc.query.Hq=class extends olympe.sc.Hg{};olympe.sc.query.Hq.O=olympe.dc.na.j('01631aacd8276ea98492',olympe.sc.query.Hq);olympe.sc.query.nc=class extends olympe.dc.CloudObject{};olympe.sc.query.nc.O=olympe.dc.na.j('01631aacd8276ea98493',olympe.sc.query.nc);olympe.sc.wo=class extends olympe.dc.CloudObject{};olympe.sc.wo.O=olympe.dc.na.j('018312ceeb3e93618a85',olympe.sc.wo);olympe.sc.workflow={};olympe.sc.workflow.ObjectState=class extends olympe.dc.CloudObject{};olympe.sc.workflow.ObjectState.O=olympe.dc.na.j('017ffdd8f0b1e31fe138',olympe.sc.workflow.ObjectState);olympe.sc.workflow.ObjectState.workflowProp=olympe.sc.workflow.ObjectState.O.ka('017ffdd8f0b1e31fe13e');olympe.sc.workflow.ObjectState.stateProp=olympe.sc.workflow.ObjectState.O.ka('017ffdd8f0b1e31fe139');olympe.sc.workflow.ObjectState.assigneeProp=olympe.sc.workflow.ObjectState.O.ka('017ffdd8f0b1e31fe13a');
|
|
1137
|
+
olympe.sc.workflow.ObjectState.dateTimeProp=olympe.sc.workflow.ObjectState.O.ka('017ffdd8f0b1e31fe13b');olympe.sc.workflow.ObjectState.serializedObjectProp=olympe.sc.workflow.ObjectState.O.ka('017ffdd8f0b1e31fe13d');olympe.sc.workflow.ObjectState.objectRel=olympe.sc.workflow.ObjectState.O.sa('017ffdd8f0b1e31fe13c');olympe.sc.workflow.ObjectState.currentObjectRel=olympe.sc.workflow.ObjectState.O.sa('017ffdd8f0b1e31fe13f');olympe.sc.workflow.Af=class extends olympe.sc.logic.xd{Eu(){return this.j('017ffe02381f9fac5060')}Hu(){return this.j('017ffe02381f9fac5061')}Iu(){return this.j('017ffe02381f9fac5062')}Kx(){return this.j('017ffe02381f9fac5065')}Fu(){return this.D('017ffe02381f9fac5063')}Gu(){return this.D('017ffe02381f9fac5064')}};olympe.sc.workflow.Af.O=Kn('017ffde21f5fe0f704ce',olympe.sc.workflow.Af);olympe.sc.workflow.Af.j='017ffe02381f9fac5060';olympe.sc.workflow.Af.$e='017ffe02381f9fac5061';
|
|
1138
1138
|
olympe.sc.workflow.Af.af='017ffe02381f9fac5062';olympe.sc.workflow.Af.ha='017ffe02381f9fac5065';olympe.sc.workflow.Af.H='017ffe02381f9fac5063';olympe.sc.workflow.Af.vc='017ffe02381f9fac5064';m=olympe.sc.workflow.Af.prototype;m.Eu.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);m.Hu.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);m.Iu.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);m.Kx.K=new olympe.C.J(()=>Map,[]);m.Fu.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);m.Gu.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);olympe.sc.workflow.Ye=class extends olympe.dm.BrickMetadata{Uc(){return this.Pc(olympe.sc.workflow.Workflow.statesRel.$b(),olympe.sc.workflow.Workflow).la().concat(['.',this.la()])}};olympe.sc.workflow.Ye.O=olympe.dc.na.j('017ffdc2dda51d46b430',olympe.sc.workflow.Ye);olympe.sc.workflow.Transition=class extends olympe.dc.CloudObject{D(){return this.vs()}j(){return this.Pc(olympe.sc.workflow.Transition.fromStateRel,olympe.sc.workflow.Ye)}F(){return this.Pc(olympe.sc.workflow.Transition.toStateRel,olympe.sc.workflow.Ye)}Uc(){const a=this.Pc(olympe.sc.workflow.Transition.fromStateRel,olympe.sc.workflow.Ye);return a.Pc(olympe.sc.workflow.Workflow.statesRel.$b(),olympe.sc.workflow.Workflow).la().concat(['.',a.la(),'->',this.la()])}};
|
|
1139
1139
|
olympe.sc.workflow.Transition.O=olympe.dc.na.j('017ffdc633219f16beea',olympe.sc.workflow.Transition);olympe.sc.workflow.Transition.processRefProp=olympe.sc.workflow.Transition.O.ka('017ffdc633219f16beec');olympe.sc.workflow.Transition.fromStateRel=olympe.sc.workflow.Transition.O.sa('017ffdc2dda51d46b431');olympe.sc.workflow.Transition.toStateRel=olympe.sc.workflow.Transition.O.sa('017ffdc633219f16beeb');olympe.sc.workflow.Transition.prototype.D.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);
|
|
1140
1140
|
olympe.sc.workflow.Transition.prototype.j.K=new olympe.C.J(()=>olympe.sc.workflow.Ye,[]);olympe.sc.workflow.Transition.prototype.F.K=new olympe.C.J(()=>olympe.sc.workflow.Ye,[]);olympe.sc.workflow.Workflow=class extends olympe.dm.BrickMetadata{qe(){return olympe.sc.se.Ie.rh}F(){return this.dh(olympe.sc.workflow.Workflow.serializationEnabledProp)}j(){return this.Pc(olympe.sc.workflow.Workflow.dataTypeRel,olympe.sc.yc)}D(){return this.Pc(olympe.sc.workflow.Workflow.initialStateRel,olympe.sc.workflow.Ye)}};olympe.sc.workflow.Workflow.O=olympe.dc.na.j('017ffdc010e5bcc9c971',olympe.sc.workflow.Workflow);olympe.sc.workflow.Workflow.serializationEnabledProp=olympe.sc.workflow.Workflow.O.ka('017ffdc010e5bcc9c972');
|
|
@@ -1143,32 +1143,32 @@ olympe.sc.workflow.Workflow.prototype.D.K=new olympe.C.J(()=>olympe.sc.workflow.
|
|
|
1143
1143
|
olympe.sc.qa.lb.O=olympe.dc.na.j('011203300000000adef5',olympe.sc.qa.lb);olympe.sc.qa.lb.Vh=olympe.sc.qa.lb.O.ka('011203300000000adef6');olympe.sc.qa.lb.ha=olympe.sc.qa.lb.O.ka('011203300000000adef7');olympe.sc.qa.lb.j=olympe.sc.qa.lb.O.ka('011203300000000adef8');olympe.sc.qa.lb.H=olympe.sc.qa.lb.O.ka('011203300000000adef9');olympe.sc.qa.lb.da=olympe.sc.qa.lb.O.ka('011203300000000adefa');olympe.sc.qa.lb.Y=olympe.sc.qa.lb.O.ka('011203300000000adefb');olympe.sc.qa.lb.D=olympe.sc.qa.lb.O.ka('011203300000000adefc');
|
|
1144
1144
|
olympe.sc.qa.lb.$=olympe.sc.qa.lb.O.ka('011203300000000adefd');olympe.sc.qa.lb.N=olympe.sc.qa.lb.O.ka('011203300000000adefe');olympe.sc.qa.lb.R=olympe.sc.qa.lb.O.ka('011203300000000adeff');olympe.sc.qa.lb.F=olympe.sc.qa.lb.O.ka('011203300000000adee0');olympe.sc.qa.lb.oc={INIT:0,$z:1,xk:2,wk:3,zm:4,FC:5,Ab:9};m=olympe.sc.qa.lb.prototype;m.Ku.K=olympe.C.J.N;m.Zy.K=olympe.C.J.N;m.Hc.K=olympe.C.J.F;m.Qx.K=olympe.C.J.D;m.ny.K=olympe.C.J.D;m.my.K=olympe.C.J.D;m.Lf.K=olympe.C.J.D;m.$x.K=olympe.C.J.D;
|
|
1145
1145
|
m.zx.K=olympe.C.J.D;m.ly.K=olympe.C.J.D;m.Ju.K=olympe.C.J.D;olympe.sc.qa.Tl=class extends olympe.sc.qa.ri{D(a){a.set(olympe.sc.ya.j.Kn,!0);super.D(a)}da(){return!0}};olympe.sc.qa.Tl.O=olympe.dc.na.j('0113032000000aca1102',olympe.sc.qa.Tl,olympe.sc.P.Ca);olympe.sc.qa.Xe=class extends olympe.sc.qa.Xc{j(){return(new olympe.dc.ck(this.X(),olympe.sc.qa.lb)).fb(olympe.sc.qa.Xe.H).Ki().Gc()}};olympe.sc.qa.Xe.O=olympe.dc.na.j('011203300000000adef3',olympe.sc.qa.Xe);olympe.sc.qa.Xe.H=olympe.sc.qa.Xe.O.sa('011203300000000adef4');R(olympe.sc.qa.lb.O,olympe.sc.qa.Xe.H);
|
|
1146
|
-
olympe.sc.qa.Xe.O.j=(a,b,c)=>{b=
|
|
1146
|
+
olympe.sc.qa.Xe.O.j=(a,b,c)=>{b=Cl(a,b||'New Service Application model',olympe.sc.qa.Xe,olympe.sc.qa.Tl);a.Oa(olympe.sc.qa.Xc.j,b,c);c=a.create(olympe.sc.qa.lb).X();a.Oa(olympe.sc.qa.Xe.H,b,c);return b.X()};olympe.sc.qa.Xe.prototype.j.K=new olympe.C.J(()=>olympe.sc.qa.lb,[]);olympe.sc.Ug=class extends olympe.dc.CloudObject{static get(){return olympe.dc.CloudObject.get('011203300000000adf0f')}};olympe.sc.Ug.O=olympe.dc.na.j('011203300000000adf00',olympe.sc.Ug);olympe.sc.Ug.D=olympe.sc.Ug.O.ka('011203300000000adf01');olympe.sc.Ug.j=olympe.sc.Ug.O.ka('011203300000000adf02');olympe.sc.Ug.F='011203300000000adf0f';olympe.sc.sg={};olympe.sc.sg.Py=a=>{var b=a.j;const c=olympe.dc.ia();var d=null;var e=null===En;for(const f of b.Rc())if((b=f.Wb())&&f.D()&&f.sb()===olympe.dc.Ja.SERVER&&Z(a,f.tag())&&c.Ob(b,olympe.sc.yc)){if(!e)throw new olympe.dc.kq;let g,h;null==d&&(d=null,null!==Dn?d=Dn:'string'===typeof Cn&&(d=olympe.dc.nd.from(Cn).fb(olympe.sc.qa.Xc.j).fb(olympe.sc.nf.j.$b()).Fc()),d=null==(g=d)?void 0:g.X());d=null!=(h=d)?h:null;if(null===d)throw Error(`No business container for new instance of ${olympe.dc.fa(b)}`);a.Oa(olympe.sc.nf.D.X(),
|
|
1147
1147
|
d,f.tag())}};
|
|
1148
1148
|
olympe.sc.sg.az=a=>{const b=a.j,c=olympe.dc.ia();for(const d of b.Rc()){const e=d.Wb();e&&!d.td()&&c.Ob(e,olympe.sc.yc)&&d.Db().forEach((f,g)=>{if(f instanceof olympe.dc.uc){const l=b.Qc(f.X());if(null===l)throw Error(`Try to assign an instance as complex property which is not created within the same transaction: ${f.X()}`);var h;f=null!=(h=null==l?void 0:l.Wb())?h:null;h=l.tag();let n;if(f===olympe.dc.fa(olympe.sc.Pd)){h=l.Jb(olympe.sc.Pd.j);if(!h)throw Error('No object reference found for new ObjectRef');var k;
|
|
1149
|
-
let p;f=null!=(p=null==(k=b.Qc(h))?void 0:k.Wb())?p:c.model(h)}if(c.Qf(f,olympe.dm.De)){k=
|
|
1149
|
+
let p;f=null!=(p=null==(k=b.Qc(h))?void 0:k.Wb())?p:c.model(h)}if(c.Qf(f,olympe.dm.De)){k=Lm(f);let p;n=null!=(p=l.Qa(k.X()))?p:c.Qa(h,k)}if(void 0===n)throw Error(`Try to set a complex property to an instance of a DataType: ${c.name(e)} (${e})`);a.Wc(d.tag(),new Map([[g,n]]));wl(a,l.tag(),olympe.dc.Lb.Dc)}})}};
|
|
1150
1150
|
olympe.sc.sg.Vw=a=>{const b=a.j,c=olympe.dc.ia(),d=new Set;for(var e of b.Bb.values()){a=e.tag();let f;const g=null!=(f=e.Wb())?f:c.model(a);if(null!==g&&e.Id()&&(d.has(g)||c.Ob(g,olympe.sc.yc))){d.add(g);const h=Array.from(e.ha()).flatMap(([k,,l,n])=>n&&k!==olympe.dc.fc.Yc?[l]:[]).find(k=>{let l,n;const p=null!=(n=null==(l=b.Qc(k))?void 0:l.Wb())?n:c.model(k);return!p||!(d.has(p)||c.Ob(p,olympe.sc.yc))});if(void 0!==h){let k,l,n;e=null!=(n=null!=(l=null==(k=b.Qc(h))?void 0:k.Wb())?l:c.model(h))?
|
|
1151
1151
|
n:'unknown';throw Error(`Try to link an instance (${a}) of DataType ${c.name(g)} (${g}) to an instance which is not (${h}) a DataType: ${c.name(e)} (${e})`);}}}};olympe.sc.sg.pz=a=>{var b=a.j;const c=olympe.dc.ia();for(const d of b.Rc()){b=d.tag();const e=d.Wb();if(e&&!c.Ob(e,olympe.sc.yc)&&Z(a,b))throw Error(`You are trying to persist an instance of : ${c.name(e)} (${e}), but only instances of DataType can be persisted`);}};
|
|
1152
|
-
olympe.W.run([olympe.dc.transaction.P.Da],a=>{
|
|
1152
|
+
olympe.W.run([olympe.dc.transaction.P.Da],a=>{Il(Il(Il(a,olympe.sc.sg.Vw,'businessDataRelations'),olympe.sc.sg.Py,'linkBusinessContainer'),olympe.sc.sg.az,'noBusinessComplexProperty')});olympe.sc.Oj=class extends olympe.dm.BrickMetadata{qe(){return olympe.sc.se.Ie.rh}};olympe.sc.Oj.O=olympe.dc.na.j('01645fe6873aeea59e64',olympe.sc.Oj);olympe.sc.Oj.j=olympe.sc.Oj.O.sa('017ed8ac775f48d4d589');olympe.sc.so=class extends olympe.dm.Kb{qe(){return olympe.sc.se.Ie.rh}};olympe.sc.so.O=olympe.dc.na.j('0163a68ce44f3d1fa95d',olympe.sc.so);olympe.sc.ph=class extends olympe.dm.BrickMetadata{};olympe.sc.ph.O=olympe.dc.na.j('016324fde11a836f77d3',olympe.sc.ph);olympe.sc.ph.j=olympe.sc.yc.O.sa('016324fde11a836088d3');olympe.sc.ph.O.j=(a,b)=>Cl(a,null!=b?b:'New config type',olympe.sc.ph).X();olympe.sc.iA=class{};olympe.sc.Sj=class extends olympe.dm.BrickMetadata{qe(){return olympe.sc.se.Ie.rh}};olympe.sc.Sj.O=olympe.dc.na.j('017dc8d6c8fd8c8bd2ff',olympe.sc.Sj);olympe.sc.Sj.O.j=(a,b)=>Cl(a,null!=b?b:'New data connector',olympe.sc.Sj,olympe.dm.DataSource).X();olympe.sc.ue=class extends olympe.sc.Runnable{ua(){return this.bb(olympe.sc.ue.F,olympe.sc.Runnable)}ha(){return this.bb(olympe.sc.ue.D,olympe.dm.Property)}};olympe.sc.ue.O=Of(olympe.dc.na.j('016c2d996d9ca27fa9d8',olympe.sc.ue));olympe.sc.ue.F=olympe.sc.ue.O.sa('016c3cb7742ec9309e0b');olympe.sc.ue.D=olympe.sc.ue.O.sa('016c42d3454636f90533');olympe.sc.ue.prototype.ua.K=new olympe.C.J(()=>olympe.dc.za,[]);olympe.sc.ue.prototype.ha.K=new olympe.C.J(()=>olympe.dc.za,[]);olympe.sc.So=class extends olympe.dm.Kb{qe(){return olympe.sc.se.Ie.rh}};olympe.sc.So.O=olympe.dc.na.j('017a7a9ff057958e5678',olympe.sc.So);olympe.sc.Ai=class extends olympe.dm.Enum{static create(a,b,c,d,e){const f=olympe.dc.ia();e=void 0!==e?e:f.Ha(b)&&f.Rc(b).length||0;c=(new Map).set(olympe.dm.String.valueProp,c).set(olympe.dc.CloudObject.nameProp,d||c).set(olympe.dm.Enum.rankProp,e);return a.create(b,c)}};olympe.sc.Ai.create=olympe.sc.Ai.create;olympe.sc.Ai.O=olympe.dc.na.j('016cdd861b32d56c8208',olympe.sc.Ai);olympe.sc.Xp=class extends olympe.dm.Kb{qe(){return olympe.sc.se.Ie.mw}};olympe.sc.Xp.O=olympe.dc.na.j('01644b6d4543b344b857',olympe.sc.Xp);olympe.sc.Yp=class extends olympe.dc.CloudObject{};olympe.sc.Yp.O=olympe.dc.na.j('0162f672366be5ca7a86',olympe.sc.Yp);const Rn={Ro:30};olympe.sc.cc=class extends olympe.dc.sources.cc{D(a){return a instanceof olympe.sc.logic.Error?this.format(Rn.Ro,{c:a.code,m:a.message,s:a.ne()}):super.D(a)}j(a){return(null==a?void 0:a.t)===Rn.Ro?(a=a.v,Rm(a.m,a.c,a.s)):super.j(a)}H(a){super.H(a);if(this.db.model(a)===olympe.sc.Pd.O.X()){const b=olympe.sc.Pd.j;this.F.get(a).r.push({r:b.X(),o:a,d:this.db.Jb(a,b)})}return a}};olympe.sc.nr=class extends olympe.sc.ue{};olympe.sc.nr.O=olympe.dc.na.j('016d3f37610ae4fc3962',olympe.sc.nr);olympe.sc.Text=class extends olympe.dm.String{};olympe.sc.Text.O=olympe.dc.na.j('016cfca73e63f9ab5ba4',olympe.sc.Text);olympe.sc.Wa=class{constructor(a=!0){a=Al(a);a.N=!0;var b=olympe.sc.sg.pz;let c;(null==(c=olympe.W.getParameter(olympe.dc.transaction.U.Il))?0:c.includes('persistenceBusinessDataOnly'))||a.R.push(b);this.j=a;this.D=[];this.source=null}static from(a){const b=olympe.sc.ya.j.TRANSACTION;return a.has(b,!0)?a.get(b,!0):new olympe.sc.Wa}static process(a,b){return a.has(olympe.sc.ya.j.TRANSACTION,!0)?Promise.resolve(!1):b.nb().then(()=>!0)}T(){return this.j.T()}create(a,b=new Map,c=this.source,d){c='string'===
|
|
1153
1153
|
typeof c?c:olympe.dc.ae().fromModel(a);a=this.j.create(a,d).ki(c);for(const [e,f]of b)Y(a,e,f);b=a.X();this.D.push(b);return b}update(a,b,c){this.j.update(a,b,c);return this}Fs(a,b){a=this.j.update(a);for(const [c,d]of b)b=d,a.Gd.set(olympe.dc.fa(c),b);return this}delete(a){this.j.delete(a);return this}Oa(a,b,c){this.j.Oa(a,b,c);return this}hc(a,b,c){this.j.hc(a,b,c);return this}Zm(a,b){this.j.Zm(a,b);return this}persist(a,b=!0){this.j.persist(a,b);return this}oz(a,b=!0){olympe.ja.ab('dc').warn('Transaction#persistInstance() has been deprecated. Please use Transaction#persist() instead.');
|
|
1154
|
-
return this.persist(a,b)}ki(a){this.source=a;return this}model(a){return this.j.model(a)}merge(a){
|
|
1154
|
+
return this.persist(a,b)}ki(a){this.source=a;return this}model(a){return this.j.model(a)}merge(a){Bl(this.j,a.j);return this}Rm(a){this.j.Rm(a);return this}nb(){return new Promise((a,b)=>{this.j.nb((c,d)=>{c?a(new olympe.sc.bj(this.D)):b(d)})})}$m(){return new Promise((a,b)=>{this.j.$m((c,d)=>{c?a(new olympe.sc.bj(this.D)):b(d)})})}};olympe.sc.Wa.prototype.executeAsLarge=olympe.sc.Wa.prototype.$m;olympe.sc.Wa.prototype.execute=olympe.sc.Wa.prototype.nb;olympe.sc.Wa.prototype.afterExecution=olympe.sc.Wa.prototype.Rm;
|
|
1155
1155
|
olympe.sc.Wa.prototype.merge=olympe.sc.Wa.prototype.merge;olympe.sc.Wa.prototype.model=olympe.sc.Wa.prototype.model;olympe.sc.Wa.prototype.setSource=olympe.sc.Wa.prototype.ki;olympe.sc.Wa.prototype.persistInstance=olympe.sc.Wa.prototype.oz;olympe.sc.Wa.prototype.persist=olympe.sc.Wa.prototype.persist;olympe.sc.Wa.prototype.deleteAllRelations=olympe.sc.Wa.prototype.Zm;olympe.sc.Wa.prototype.deleteRelation=olympe.sc.Wa.prototype.hc;olympe.sc.Wa.prototype.createRelation=olympe.sc.Wa.prototype.Oa;
|
|
1156
|
-
olympe.sc.Wa.prototype['delete']=olympe.sc.Wa.prototype.delete;olympe.sc.Wa.prototype.multiUpdate=olympe.sc.Wa.prototype.Fs;olympe.sc.Wa.prototype.update=olympe.sc.Wa.prototype.update;olympe.sc.Wa.prototype.create=olympe.sc.Wa.prototype.create;olympe.sc.Wa.prototype.getId=olympe.sc.Wa.prototype.T;olympe.sc.Wa.process=olympe.sc.Wa.process;olympe.sc.Wa.from=olympe.sc.Wa.from;olympe.sc.bj=class{constructor(a){this.j=a}Hx(){return this.j.map(olympe.dc.CloudObject.get)}};olympe.sc.bj.prototype.getCreatedObjects=olympe.sc.bj.prototype.Hx;olympe.xc={};olympe.xc.bt=class{run(){}};function
|
|
1156
|
+
olympe.sc.Wa.prototype['delete']=olympe.sc.Wa.prototype.delete;olympe.sc.Wa.prototype.multiUpdate=olympe.sc.Wa.prototype.Fs;olympe.sc.Wa.prototype.update=olympe.sc.Wa.prototype.update;olympe.sc.Wa.prototype.create=olympe.sc.Wa.prototype.create;olympe.sc.Wa.prototype.getId=olympe.sc.Wa.prototype.T;olympe.sc.Wa.process=olympe.sc.Wa.process;olympe.sc.Wa.from=olympe.sc.Wa.from;olympe.sc.bj=class{constructor(a){this.j=a}Hx(){return this.j.map(olympe.dc.CloudObject.get)}};olympe.sc.bj.prototype.getCreatedObjects=olympe.sc.bj.prototype.Hx;olympe.xc={};olympe.xc.bt=class{run(){}};function Sn(a,b='default'){return a.j===b}
|
|
1157
1157
|
olympe.xc.Ta=class{constructor(a,b){this.j=a;this.G=b;this.D=null;this.F='';this.G.info('HC Manager will execute application registered as:',this.j)}Aj(a,b,c=''){b||(b='default');b===this.j?(null===this.D?this.G.log('Application',c,'designated to be launched'):this.G.log('OVERRIDE: Application',c,'designated to be launched'),this.D=a,this.F=c):this.G.debug('ignoring application:'+c+' as it is registered under name '+b+' and not '+this.j)}run(){null!==this.D?(this.G.info('Running application:',this.F),
|
|
1158
|
-
this.D.run()):this.G.error('No app registered under name: '+this.j)}};olympe.xc.Aj=function(a,b,c='default'){const d=a.ab();c?d.debug('Pre-registering application '+b+' under name '+c+' (use '+olympe.xc.U.Pe+'='+c+' to start it)'):d.debug('Pre-registering application '+b+' as default one');a.rd(olympe.xc.P.Da).config(c,[b],(e,f)=>f.Aj(e,c,b),e=>
|
|
1159
|
-
olympe.W.run([olympe.xc.P.Da],a=>a.run(),'olympe.hc');olympe.sc.Ib={};function
|
|
1160
|
-
function
|
|
1161
|
-
h.Ob(l,olympe.sc.ph)},{jd:
|
|
1162
|
-
{jd:h,Kk:'__code-as-data__'}).subscribe(()=>f())})});return Promise.all([d,e]).then(()=>{if(a.da)return
|
|
1163
|
-
function
|
|
1164
|
-
a.G.info(`Application ${olympe.dc.ia().name(a.j)} (${a.j}) started`);k=olympe.dc.sources.Zd();k.Mb=!0;k.Y+=0;k.Rd.next(0<k.Y);0===k.Y&&k.$&&k.Mb&&(k.G.debug(`Cache: set code-as-data version in local storage: ${k.version}`),k.$a.set('__code-as-data-version__',k.version),k.zb||(k.$=!1))})}else a.G.error('application retrieved: not an Application with a run() method');else
|
|
1165
|
-
3E4);let e;null==(e=a.Mb)||e.start()}}function
|
|
1166
|
-
olympe.sc.Ib.ym=class{constructor(a,b,c,d,e,f,g,h,k,l){this.G=a;this.ha=b;this.N=c;this.Ga=d;this.F=e;this.Y=this.R='';this.D=f;this.$a=g;this.H=h;this.Mb=l;this.j=k.get('appTag');this.ua=k.get('getContextMode');let n;this.zb=null!=(n=k.get('debuggerName'))?n:null;this.jb=k.get('autostartProfiler');this.da=k.get('requireBusinessContainer');this.$=olympe.C.bc(olympe.C.ea).update(olympe.C.ea.j)}run(){this.G.debug('runtime starting for app #'+this.j);let a=!1;
|
|
1167
|
-
c=olympe.L.tc.j.Ae,d=olympe.L.tc.j.Wd;olympe.C.Sc([this.N.getState()],e=>{switch(e){case b:case c:this.G.debug('Server session opened or working offline, start the application');a||(a=!0,
|
|
1158
|
+
this.D.run()):this.G.error('No app registered under name: '+this.j)}};olympe.xc.Aj=function(a,b,c='default'){const d=a.ab();c?d.debug('Pre-registering application '+b+' under name '+c+' (use '+olympe.xc.U.Pe+'='+c+' to start it)'):d.debug('Pre-registering application '+b+' as default one');a.rd(olympe.xc.P.Da).config(c,[b],(e,f)=>f.Aj(e,c,b),e=>Sn(e,c),'olympe.hc.registerApp')};olympe.xc.P={Da:'hc.Manager',Ca:'hc.Logger'};olympe.xc.U={Pe:'hc.app',kp:'hc.globalToken'};olympe.W.config(function(a){F(a,olympe.xc.U.Pe,'default');F(a,olympe.xc.U.kp,!1);E(a,olympe.xc.P.Ca,[olympe.ja.P.Da],b=>b.cd('hc'));E(a,olympe.Eb.P.Sg,[new olympe.W.pa(olympe.xc.U.Pe)],b=>b);E(a,olympe.auth.P.kl,[olympe.Eb.P.Sg,new olympe.W.pa(olympe.xc.U.kp)],(b,c)=>new olympe.auth.Tn(c?'':b));D(a,olympe.xc.P.Da,olympe.xc.Ta,new olympe.W.pa(olympe.xc.U.Pe),olympe.xc.P.Ca)},'olympe.hc');
|
|
1159
|
+
olympe.W.run([olympe.xc.P.Da],a=>a.run(),'olympe.hc');olympe.sc.Ib={};function Tn(a){a.Y=a.F.F(()=>w(function*(){return Un(a)}),'Stop application')}function Vn(a){a.R=a.F.j(()=>olympe.C.Pa(a.$)===olympe.C.ea.D?Promise.resolve('The application is started'):Promise.reject('The application is not started'),'Application health check',olympe.host.Ee.j.READINESS)}
|
|
1160
|
+
function Wn(a){if(a.ua)return a.G.debug('Sending getContext request'),oi(a.Ga).then(()=>{a.G.debug('synchronisation request successful');var f=a.j;En=null;Cn=f}).catch(f=>{a.G.error('failed to synchronise (authenticated) with server: '+f.message)});const b=Pm(a.D);!b&&Mk();a.G.debug((b?'PULLING':'SUBSCRIBING')+' application '+a.j);const c=a.D.Cb(),d=new Promise((f,g)=>{const h=olympe.dc.ia(),k=new olympe.C.Xb('Primordial Subscription Context',c);ci(k,a.j,l=>{l=h.ji(l)?l:h.model(l);return null!==l&&
|
|
1161
|
+
h.Ob(l,olympe.sc.ph)},{jd:Xn(b),Dn:!0,zs:!0}).subscribe(rxjs.Subscriber.create(c.rc(()=>{h.Ob(a.j,olympe.sc.qa.Xc)?(a.$a.Y(a.j,b),f()):id(a.N)?g(Error(`The specified application tag (${a.j}) is not an application or does not exist`)):(k.destroy(),a.N.connect().catch(l=>{g(Error(`Failed to load the app while offline, you might want to try again when online: ${l}`))}))}),l=>g(l)))}),e=new Promise(f=>{olympe.C.Sc([a.ha.pe()],g=>{const h=Xn(b,!1);olympe.dc.ma.Ke(g,olympe.dm.User,olympe.dc.Ja.SERVER).observe(c,
|
|
1162
|
+
{jd:h,Kk:'__code-as-data__'}).subscribe(()=>f())})});return Promise.all([d,e]).then(()=>{if(a.da)return Yn(a);Yn(a).then(()=>{})})}
|
|
1163
|
+
function Zn(a){a.G.info('Starting application '+a.j);const b=olympe.dc.ia();if(0<a.j.length){const c=sf(b,a.j,a.D.Cb().rc((f,g)=>{if(f)if(f=tn(g),f instanceof olympe.sc.qa.ri){a.G.debug('application retrieved: running');g=Mm(a.D,f);const h=new olympe.sc.Ya.zv(a.H);jb(a.H,()=>Zm(a.D.j,h));kb(a.H,()=>{var k=h.T();return an(a.D.j,k)});a.jb&&a.H.start();f.run(g);'string'===typeof a.zb&&(new olympe.sc.Xd).da(f.X(),g,a.G);g.Us(olympe.sc.ya.j.Kn).then(()=>{var k;null==(k=d)||k.cancel();a.$.update(olympe.C.ea.D);
|
|
1164
|
+
a.G.info(`Application ${olympe.dc.ia().name(a.j)} (${a.j}) started`);k=olympe.dc.sources.Zd();k.Mb=!0;k.Y+=0;k.Rd.next(0<k.Y);0===k.Y&&k.$&&k.Mb&&(k.G.debug(`Cache: set code-as-data version in local storage: ${k.version}`),k.$a.set('__code-as-data-version__',k.version),k.zb||(k.$=!1))})}else a.G.error('application retrieved: not an Application with a run() method');else Un(a)}));olympe.C.Xa().onDestroy(()=>{qf(b,a.j,c)});const d=wc(()=>{a.G.warn(`requested application ${a.j} may not be available (it may not exist or the logged user may not have the correct permissions)`)},
|
|
1165
|
+
3E4);let e;null==(e=a.Mb)||e.start()}}function Xn(a,b=!0){return a?olympe.dc.ma.nc.Jg:b?olympe.dc.ma.nc.rf:olympe.dc.ma.nc.lk}function Yn(a){return w(function*(){$n(a.j)&&(yield Fn(a.j,a.da).catch(b=>{throw Error(`Failed to load the business container for the application ${a.j}: ${b}`);}))})}function Un(a){a.G.info('Stop the application');a.D.Cb().lg();a.F.D(a.R);a.F.R(a.Y)}
|
|
1166
|
+
olympe.sc.Ib.ym=class{constructor(a,b,c,d,e,f,g,h,k,l){this.G=a;this.ha=b;this.N=c;this.Ga=d;this.F=e;this.Y=this.R='';this.D=f;this.$a=g;this.H=h;this.Mb=l;this.j=k.get('appTag');this.ua=k.get('getContextMode');let n;this.zb=null!=(n=k.get('debuggerName'))?n:null;this.jb=k.get('autostartProfiler');this.da=k.get('requireBusinessContainer');this.$=olympe.C.bc(olympe.C.ea).update(olympe.C.ea.j)}run(){this.G.debug('runtime starting for app #'+this.j);let a=!1;Tn(this);Vn(this);const b=olympe.L.tc.j.Ri,
|
|
1167
|
+
c=olympe.L.tc.j.Ae,d=olympe.L.tc.j.Wd;olympe.C.Sc([this.N.getState()],e=>{switch(e){case b:case c:this.G.debug('Server session opened or working offline, start the application');a||(a=!0,Wn(this).then(olympe.C.Xa().rc(()=>Zn(this))));break;case d:this.G.debug('Impossible to open a connection to the orchestrator and offline mode is disabled.')}})}};olympe.sc.Ib.ym.j='app_instance';olympe.sc.Ib.ym.xa=[olympe.xc.bt];olympe.sc.Ib.Lv=class{constructor(a,b,c,d){this.G=a;this.D=b;this.F=d.get('httpManifestPath');this.j=d.get('manifestCommon');if(!this.j)this.j={};else if('string'===typeof this.j)try{this.j=JSON.parse(this.j)}catch(e){this.G.warn('Invalid manifest common config'),this.j={}}}start(){const a=b=>{this.G.debug('Request URL',b.j());const c=(new URL(b.j())).searchParams.get('origin');if(c)return c;b=b.qj();this.G.debug('Request headers',b);return b.origin?b.origin:b.uz?(new URL(b.uz)).origin:b[olympe.net.wa.Headers.ap]&&
|
|
1168
1168
|
b[olympe.net.wa.Headers.bp]?b[olympe.net.wa.Headers.bp]+'://'+b[olympe.net.wa.Headers.ap]:null};this.D.F('manifest',`${this.F}/:${'appTag'}`,[olympe.net.wa.Nd.GET],(b,c)=>{const d=this;return w(function*(){var e=c.get('appTag');d.G.debug('Processing request to serve manifest for app',e);if(20!==e.length)return new olympe.net.ld('Invalid appTag',olympe.net.wa.Vb.nl);try{var f=yield olympe.dc.ma.Ke(e,olympe.sc.qa.Xc).nb()}catch(h){return new olympe.net.ld(`Something went wrong: ${'string'===typeof h?
|
|
1169
1169
|
h:h.message}`,olympe.net.wa.Vb.nl)}if(0===f.size())return new olympe.net.ld('App not found',olympe.net.wa.Vb.gm);var g=a(b);f=f.Gc();g={name:f.name(),short_name:f.name(),id:e,start_url:g?`${g}?hc.app=sc.runtime&sc.app=${e}`:void 0,display:'standalone',backgroundColor:'#fff',icons:g?[{src:`${g}/images/logo.svg`,sizes:'150x150',type:'image/png'},{src:`${g}/images/logo.png`,sizes:'1024x1024',type:'image/png',purpose:'maskable any'}]:void 0};f=olympe.W.getParameter(`app.manifest.${e}`);if(!f)f={};else if('string'===
|
|
1170
|
-
typeof f)try{f=JSON.parse(f)}catch(h){d.G.warn(`Invalid manifest app config for app: ${e}`),f={}}e=Object.assign({},g,d.j,f);return new olympe.net.ld(JSON.stringify(e),olympe.net.wa.Vb.Eh,void 0,{'content-type':'application/json'})})}).catch(()=>this.G.error('Error while starting the RuntimeHTTPService'));this.G.debug('Started RuntimeHTTPService')}};function
|
|
1171
|
-
olympe.sc.Ib.Bk=class extends olympe.dc.sources.Bk{R(a){return this.db.Ob(a,olympe.sc.yc)}Y(a,b){if(!this.H){super.init();var c=olympe.dc.nd.from(a).fb(olympe.sc.qa.Xc.j).Fc();if(!(c instanceof olympe.dm.ib))throw Error(`Impossible to initialize the source solver for the application ${a}: no project is linked to it`);b=b?olympe.dc.ma.nc.Jg:olympe.dc.ma.nc.rf;
|
|
1170
|
+
typeof f)try{f=JSON.parse(f)}catch(h){d.G.warn(`Invalid manifest app config for app: ${e}`),f={}}e=Object.assign({},g,d.j,f);return new olympe.net.ld(JSON.stringify(e),olympe.net.wa.Vb.Eh,void 0,{'content-type':'application/json'})})}).catch(()=>this.G.error('Error while starting the RuntimeHTTPService'));this.G.debug('Started RuntimeHTTPService')}};function $n(a){var b=olympe.dm.DataSource.SERVER;const c=olympe.dc.ma.from(a).fb(olympe.sc.qa.Xc.j).fb(olympe.dm.wd.F.$b()).fb(olympe.dm.wd.j).Fc();a=olympe.dc.ma.from(a).fb(olympe.sc.qa.Xc.j).fb(olympe.dm.ib.D).Fc();return c.concat(a).has(b)}
|
|
1171
|
+
olympe.sc.Ib.Bk=class extends olympe.dc.sources.Bk{R(a){return this.db.Ob(a,olympe.sc.yc)}Y(a,b){if(!this.H){super.init();var c=olympe.dc.nd.from(a).fb(olympe.sc.qa.Xc.j).Fc();if(!(c instanceof olympe.dm.ib))throw Error(`Impossible to initialize the source solver for the application ${a}: no project is linked to it`);b=b?olympe.dc.ma.nc.Jg:olympe.dc.ma.nc.rf;Dk(this,c,b);c=new olympe.C.Xb('deployed data sources');olympe.dc.ma.from(a).fb(olympe.sc.qa.Xc.ha).observe(c,{jd:b}).subscribe(d=>{const e=
|
|
1172
1172
|
new olympe.dc.Wa;d.nj().forEach(f=>{e.Oa(olympe.dm.DataSource.zj,this.j,f)});d.sj().forEach(f=>{e.hc(olympe.dm.DataSource.zj,this.j,f)});e.nb()})}}};olympe.sc.Ib.P={fg:'sc.runtime.Main',We:'sc.runtime.SourceSolver',Rq:'sc.runtime.appConfig',Tq:'sc.runtime.runtimeHTTPServiceConfig',Sq:'sc.runtime.RuntimeHTTPService',mq:'sc.runtime.OfflineAppConfig'};olympe.sc.Ib.U={vp:'app.httpManifestPath',Vp:'app.manifest.common',Rp:'sc.loadBusinessContainer'};
|
|
1173
1173
|
olympe.W.config(function(a){F(a,olympe.sc.Ib.U.vp,'/runtime/manifest');F(a,olympe.sc.Ib.U.Vp,null);F(a,olympe.sc.Ib.U.Rp,!1);E(a,olympe.Eb.P.Sg,[new olympe.W.pa(olympe.xc.U.Pe),new olympe.W.pa(olympe.sc.U.Pe)],(b,c)=>`${b}${c?'-'+c:''}`);E(a,olympe.sc.Ib.P.mq,[new olympe.W.pa(olympe.sc.U.Pe),new olympe.W.pa(olympe.net.U.Qi),new olympe.W.pa(olympe.net.U.im)],(b,c,d)=>{let e;const f=null!=(e=a.getParameter(`offline.${b}.enabled`))?e:c;let g;b=null!=(g=a.getParameter(`offline.${b}.autoBackOnline`))?
|
|
1174
1174
|
g:d;return new Map([['offlineEnabled',f],['offlineAutoBackOnline',!f||b]])});Wa(a,olympe.net.P.jm,olympe.sc.Ib.P.mq);D(a,olympe.sc.Ib.P.We,olympe.sc.Ib.Bk,olympe.dc.P.sh,new olympe.W.pa(olympe.dc.U.Qg),new olympe.W.pa(olympe.dc.U.Gl));Wa(a,olympe.dc.sources.P.We,olympe.sc.Ib.P.We);E(a,olympe.sc.Ib.P.Rq,[new olympe.W.pa(olympe.sc.U.Pe),new olympe.W.pa(olympe.dc.U.Mh),new olympe.W.pa(olympe.sc.U.Eo),new olympe.W.pa(olympe.sc.U.Mn),new olympe.W.pa(olympe.sc.Ib.U.Rp)],(b,c,d,e,f)=>new Map([['appTag',
|
|
@@ -1182,8 +1182,8 @@ olympe.public.Ma.getToken=olympe.public.Ma.oe;olympe.public.Ma.observeUser=olymp
|
|
|
1182
1182
|
olympe.public.sf=class{static create(a){return new class extends olympe.dc.wc.tg{F(b,c){return olympe.dc.CloudObject.get(c)}compare(b,c){b=a(b,c);if('number'===typeof b)return b;const d=olympe.C.bc(olympe.C.aa),e=b.subscribe(f=>d.update(olympe.C.ra(f)));olympe.C.Xa().Td(()=>e.unsubscribe());return d.rb()}}}};olympe.public.Process=class{static kz(a,b){if('string'===typeof b)throw Error('When registering a health check, the options parameter should be an object: string is not supported anymore.');const c=olympe.host.Tk(),d=c.j(a,void 0,null==b?void 0:b.type);return()=>c.D(d)}static lz(a,b){const c=olympe.host.Tk(),d=c.Ga(a,b);return()=>c.R(d)}static connect(){return olympe.L.cn().connect()}static disconnect(){return olympe.L.cn().disconnect()}static Sf(a){a='function'===typeof a.Cb?a.Cb():a;return olympe.L.cn().Sf().asObservable(a).pipe(rxjs.operators.map(b=>
|
|
1183
1183
|
b.valueOf()))}};olympe.public.Process.isOnline=olympe.public.Process.Sf;olympe.public.Process.disconnect=olympe.public.Process.disconnect;olympe.public.Process.connect=olympe.public.Process.connect;olympe.public.Process.onShutdown=olympe.public.Process.lz;olympe.public.Process.onHealthCheck=olympe.public.Process.kz;'object'===typeof exports&&(exports={CloudObject:olympe.dc.CloudObject,Relation:olympe.dc.Ra.Relation,Direction:olympe.dc.va,generateTag:olympe.V.df,tagToString:olympe.dc.fa,register:olympe.dc.register,defineProperty:olympe.dc.defineProperty,defineRelation:olympe.dc.Xr,defineInverseRelation:olympe.dc.gx,BrickContext:olympe.sc.ya,Brick:olympe.sc.logic.Function,ActionBrick:olympe.sc.logic.Function,GlobalProperties:olympe.sc.ya.j,registerBrick:olympe.sc.logic.na.j,FunctionBrick:olympe.sc.logic.Function,
|
|
1184
1184
|
Context:olympe.sc.ya,Entry:olympe.dc.Ra.Entry,PropertyModel:olympe.dm.Property,RelationModel:olympe.dm.Relation,StringModel:olympe.dm.String,NumberModel:olympe.dm.Number,BooleanModel:olympe.dm.Boolean,DatetimeModel:olympe.dm.DateTime,ColorModel:olympe.dm.Color,File:olympe.sc.File,User:olympe.dm.User,Enum:olympe.dm.cg,EnumValue:olympe.sc.Ai,DataSource:olympe.dm.DataSource,DataResult:olympe.dc.query.zd,Workflow:olympe.sc.workflow.Workflow,WorkflowState:olympe.sc.workflow.Ye,WorkflowTransition:olympe.sc.workflow.Transition,
|
|
1185
|
-
WorkflowObjectState:olympe.sc.workflow.ObjectState,Transaction:olympe.sc.Wa,BurstTransaction:olympe.dc.ti,TransactionResult:olympe.sc.bj,PredefinedDataSource:olympe.dc.Ja,QueryResult:olympe.dc.Ia,Query:olympe.dc.ma,QuerySingle:olympe.dc.nd,Predicate:olympe.dc.query.Aa,Order:olympe.dc.query.kk,Config:class{static getParameter(a){return olympe.W.getParameter(a)}},Process:olympe.public.Process,ProbeType:olympe.host.Ee.j,Cache:{getCacheEntries:()=>olympe.dc.sources.Zd().N,clearCache:a=>
|
|
1186
|
-
a),getProcessingStatus:()=>olympe.dc.sources.Zd().Hc(),getProcessingErrors:()=>olympe.dc.sources.Zd().$c.asObservable(),hasPendingChanges:()=>olympe.dc.sources.Zd().da.asObservable(),synchroniseChanges:()=>
|
|
1185
|
+
WorkflowObjectState:olympe.sc.workflow.ObjectState,Transaction:olympe.sc.Wa,BurstTransaction:olympe.dc.ti,TransactionResult:olympe.sc.bj,PredefinedDataSource:olympe.dc.Ja,QueryResult:olympe.dc.Ia,Query:olympe.dc.ma,QuerySingle:olympe.dc.nd,Predicate:olympe.dc.query.Aa,Order:olympe.dc.query.kk,Config:class{static getParameter(a){return olympe.W.getParameter(a)}},Process:olympe.public.Process,ProbeType:olympe.host.Ee.j,Cache:{getCacheEntries:()=>olympe.dc.sources.Zd().N,clearCache:a=>Tk(olympe.dc.sources.Zd(),
|
|
1186
|
+
a),getProcessingStatus:()=>olympe.dc.sources.Zd().Hc(),getProcessingErrors:()=>olympe.dc.sources.Zd().$c.asObservable(),hasPendingChanges:()=>olympe.dc.sources.Zd().da.asObservable(),synchroniseChanges:()=>Zk(),getPendingChanges:()=>bl(),clearPendingChanges:()=>fl(),loadPendingChanges:a=>dl(a)},Color:olympe.C.Color,ErrorFlow:olympe.sc.logic.Error,ServiceRequestType:olympe.L.cb.j,ServiceRequest:olympe.L.Zc,Service:olympe.L.ub,Auth:olympe.public.Ma,AuthState:{INIT:olympe.auth.Ta.j.INIT,AUTHENTICATING:olympe.auth.Ta.j.Gj,
|
|
1187
1187
|
GUEST:olympe.auth.Ta.j.Ci,AUTHENTICATED:olympe.auth.Ta.j.mf,ERROR:olympe.auth.Ta.j.Ab},AuthProtocol:olympe.auth.Ec.j,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.kb{static get(){return olympe.dc.ia()}},ListDef:olympe.dc.za,
|
|
1188
1188
|
instanceToTag:olympe.dc.fa,registerSync:olympe.dc.na.j,getUniqueTag:olympe.V.df,onDestroy:a=>olympe.C.Xa().onDestroy(a),offDestroy:a=>olympe.C.Xa().Tf(a),FollowRules:olympe.dc.Lb,transformers:{Related:olympe.dc.ba.Ve,RecursiveRelated:olympe.dc.ba.Fe,Distinct:olympe.dc.ba.yi,Filter:olympe.dc.ba.uf,Limit:olympe.dc.ba.Bh,Sort:olympe.dc.ba.Tg,Union:olympe.dc.ba.Hf},ListDefPredicate:olympe.public.Aa,predicates:{And:olympe.dc.Z.Jd,Or:olympe.dc.Z.Be,Not:olympe.dc.Z.fe,Equals:olympe.dc.Z.ve,Contains:olympe.dc.Z.tf,
|
|
1189
1189
|
Greater:olympe.dc.Z.Zj,Smaller:olympe.dc.Z.Ak,HasRelated:olympe.dc.Z.Ei,InstanceOf:olympe.dc.Z.Hi,Regex:olympe.dc.Z.Ef},Comparator:olympe.public.sf,comparators:{Number:olympe.dc.wc.Number,String:olympe.dc.wc.String,DateTime:olympe.dc.wc.DateTime},valuedefs:{BooleanProperty:olympe.dc.Za.Kj,StringProperty:olympe.dc.Za.Yi,NumberProperty:olympe.dc.Za.Pi,DateTimeProperty:olympe.dc.Za.xi,Constant:olympe.dc.Za.Re,Tag:olympe.dc.Za.$i}});
|