igniteui-angular-core
Version:
Ignite UI Angular Core logic used in multiple UI components.
1,371 lines • 77.5 kB
JavaScript
/*
THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE AGREEMENT ("AGREEMENT") LOCATED HERE:
https://www.infragistics.com/legal/license/igultimate-la
https://www.infragistics.com/legal/license/igultimate-eula
GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE: you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company.
*/
import { __extends, __values } from "tslib";
import { Base, IEnumerable_$type, fromEnum, typeCast, Date_$type, Boolean_$type, Array_$type, runOn, Number_$type, Delegate_$type, String_$type, markType } from "./type";
import { TypeDescriptionContext } from "./TypeDescriptionContext";
import { TypeDescriptionCleanups } from "./TypeDescriptionCleanups";
import { Dictionary$2 } from "./Dictionary$2";
import { Description } from "./Description";
import { DescriptionTreeNode } from "./DescriptionTreeNode";
import { Queue$1 } from "./Queue$1";
import { DescriptionTreeAction } from "./DescriptionTreeAction";
import { List$1 } from "./List$1";
import { DescriptionRef } from "./DescriptionRef";
import { TypeDescriptionPropretyTransforms } from "./TypeDescriptionPropretyTransforms";
import { DescriptionSerializerBuilder } from "./DescriptionSerializerBuilder";
import { DescriptionSerializer } from "./DescriptionSerializer";
import { DataSourceLocalDataProvider } from "./DataSourceLocalDataProvider";
import { JsonDictionaryParser } from "./JsonDictionaryParser";
import { DescriptionTreeBuilder } from "./DescriptionTreeBuilder";
import { JsonDictionaryObject } from "./JsonDictionaryObject";
import { JsonDictionaryValue } from "./JsonDictionaryValue";
import { JsonDictionaryArray } from "./JsonDictionaryArray";
import { TypeDescriptionMetadata } from "./TypeDescriptionMetadata";
import { DescriptionTreeReconciler } from "./DescriptionTreeReconciler";
import { HashSet$1 } from "./HashSet$1";
import { Tuple$2 } from "./Tuple$2";
import { DescriptionRefTargetInfo } from "./DescriptionRefTargetInfo";
import { NotImplementedException } from "./NotImplementedException";
import { ComponentRendererAdapter } from "./ComponentRendererAdapter";
import { stringIsNullOrEmpty, stringStartsWith, stringEndsWith } from "./string";
/**
* @hidden
*/
var ComponentRenderer = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(ComponentRenderer, _super);
function ComponentRenderer() {
var _this = _super.call(this) || this;
_this._adapter = null;
_this._context = null;
_this._isProceedOnErrorEnabled = false;
_this.i = null;
_this.j = null;
_this.aw = new Dictionary$2(Base.$, Description.$, 0);
_this.ax = new Dictionary$2(Base.$, Boolean_$type, 0);
_this.ay = new Dictionary$2(Base.$, Boolean_$type, 0);
_this.av = new Dictionary$2(Base.$, Boolean_$type, 0);
_this.at = new Dictionary$2(Base.$, DescriptionTreeNode.$, 0);
_this.a1 = new Dictionary$2(Base.$, ContainerState.$, 0);
_this.az = new Dictionary$2(Base.$, Queue$1.$.specialize(Queue$1.$.specialize(DescriptionTreeAction.$)), 0);
_this.au = new Dictionary$2(Base.$, List$1.$.specialize(Delegate_$type), 0);
_this.as = new Dictionary$2(Base.$, Boolean_$type, 0);
_this.a0 = new Dictionary$2(String_$type, DescriptionRef.$, 0);
_this.a2 = new Dictionary$2(String_$type, Base.$, 0);
_this.a4 = new Dictionary$2(String_$type, Base.$, 0);
_this.a8 = new List$1(Delegate_$type, 0);
_this.a3 = new Dictionary$2(String_$type, List$1.$.specialize(Delegate_$type), 0);
_this.a6 = new List$1(Delegate_$type, 0);
_this.a7 = new List$1(Delegate_$type, 0);
_this._shouldNamespaceSystemRefValues = false;
var a = _this.h();
_this.adapter = a;
var adapter_ = _this.adapter;
var b = (adapter_._platform);
if (b == "Igc") {
ComponentRenderer.platform = 4;
}
else if (b == "Igr") {
ComponentRenderer.platform = 2;
}
_this.context = new TypeDescriptionContext(_this.adapter, ComponentRenderer.platform);
_this.i = new TypeDescriptionPropretyTransforms();
_this.j = new TypeDescriptionCleanups();
return _this;
}
Object.defineProperty(ComponentRenderer, "defaultInstance", {
get: function () {
return ComponentRenderer._defaultInstance;
},
set: function (a) {
ComponentRenderer._defaultInstance = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(ComponentRenderer.prototype, "adapter", {
get: function () {
return this._adapter;
},
set: function (a) {
this._adapter = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(ComponentRenderer.prototype, "context", {
get: function () {
return this._context;
},
set: function (a) {
this._context = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(ComponentRenderer.prototype, "isProceedOnErrorEnabled", {
get: function () {
return this._isProceedOnErrorEnabled;
},
set: function (a) {
this._isProceedOnErrorEnabled = a;
},
enumerable: false,
configurable: true
});
ComponentRenderer.prototype.h = function () {
return (new ComponentRendererAdapter());
};
ComponentRenderer.prototype.toJson = function (a) {
var e_1, _a, e_2, _b;
var b = new DescriptionSerializerBuilder();
var c = new DescriptionSerializer();
b.f("{");
b.i();
b.f("\"descriptions\": {");
b.i();
var d = true;
try {
for (var _c = __values(fromEnum(this.at.keys)), _d = _c.next(); !_d.done; _d = _c.next()) {
var e = _d.value;
if (d) {
d = false;
}
else {
b.f(",");
}
var f = e;
var g = this.at.item(e);
var h = "root";
h = a(f);
if (stringIsNullOrEmpty(h)) {
h = "root";
}
b.e("\"" + h + "\"");
b.e(": ");
c.t(this.context, g, b);
}
}
catch (e_1_1) {
e_1 = { error: e_1_1 };
}
finally {
try {
if (_d && !_d.done && (_a = _c.return))
_a.call(_c);
}
finally {
if (e_1)
throw e_1.error;
}
}
b.f("");
b.h();
b.e("}");
if (this.a4.count > 0) {
b.e(",");
}
b.f("");
if (this.a4.count > 0) {
d = true;
b.f("refs: {");
b.i();
try {
for (var _e = __values(fromEnum(this.a4.keys)), _f = _e.next(); !_f.done; _f = _e.next()) {
var i = _f.value;
if (!this.o(i, this.a4.item(i))) {
continue;
}
if (d) {
d = false;
}
else {
b.f(",");
}
this.dh(b, i, this.a4.item(i));
}
}
catch (e_2_1) {
e_2 = { error: e_2_1 };
}
finally {
try {
if (_f && !_f.done && (_b = _e.return))
_b.call(_e);
}
finally {
if (e_2)
throw e_2.error;
}
}
b.f("");
b.h();
b.f("}");
}
b.h();
b.f("}");
return b.toString();
};
ComponentRenderer.prototype.dh = function (a, b, c) {
a.e("\"" + b + "\": ");
this.di(a, c);
};
ComponentRenderer.prototype.di = function (a, b) {
if (this.x(b)) {
if (typeof b === 'string') {
a.e(b == null ? "null" : "\"" + b.toString() + "\"");
}
else if (typeof b === 'number') {
a.e(b == null ? "null" : b.toString());
}
else if (typeof b === 'number') {
a.e(b == null ? "null" : b.toString());
}
else if (typeof b === 'number') {
a.e(b == null ? "null" : b.toString());
}
else if (typeof b === 'number') {
a.e(b == null ? "null" : b.toString());
}
else if (typeof b === 'number') {
a.e(b == null ? "null" : b.toString());
}
else if (typeof b === 'number') {
a.e(b == null ? "null" : b.toString());
}
else if (typeof b === 'number') {
a.e(b == null ? "null" : b.toString());
}
else if (typeCast(Date_$type, b) !== null) {
var v_ = b;
a.e("\"" + (v_.toJSON()) + "\"");
}
else if (typeCast(Boolean_$type, b) !== null) {
a.e(b == null ? "null" : b.toString().toLowerCase());
}
else {
a.e("null");
}
}
else {
if (b == null) {
a.e("null");
return;
}
if (this.u(b)) {
a.f("[");
a.i();
var c = new DataSourceLocalDataProvider();
c.dataSource = b;
for (var d = 0; d < c.actualCount; d++) {
if (d > 0) {
a.f(",");
}
this.dg(a, c, d);
}
a.f("");
a.h();
a.e("]");
}
else {
var e = [b];
var f = new DataSourceLocalDataProvider();
f.dataSource = e;
this.dg(a, f, 0);
}
}
};
ComponentRenderer.prototype.x = function (a) {
if (typeof a === 'string') {
return true;
}
if (typeof a === 'number' || typeof a === 'number' || typeof a === 'number' || typeof a === 'number' || typeof a === 'number' || typeof a === 'number' || typeof a === 'number') {
return true;
}
if (typeCast(Date_$type, a) !== null) {
return true;
}
if (typeCast(Boolean_$type, a) !== null) {
return true;
}
return false;
};
ComponentRenderer.prototype.u = function (a) {
if (typeCast(Array_$type, a) !== null) {
return true;
}
if (typeCast(IEnumerable_$type, a) !== null) {
return true;
}
return false;
};
ComponentRenderer.prototype.dg = function (a, b, c) {
a.f("{");
a.i();
var d = b.actualSchema;
for (var e = 0; e < d.propertyNames.length; e++) {
if (e > 0) {
a.f(",");
}
var f = d.propertyNames[e];
if (stringStartsWith(f, "[")) {
f = f.substr(1, f.length - 2);
}
a.e("\"" + f + "\"");
a.e(": ");
var g = b.getItemValue(b.getItemAtIndex(c), d.propertyNames[e]);
switch (d.propertyTypes[e]) {
case 0:
a.e(g == null ? "null" : "\"" + g.toString() + "\"");
break;
case 2:
a.e(g == null ? "null" : "\"" + g.toString() + "\"");
break;
case 10:
case 6:
case 5:
case 1:
case 3:
case 4:
case 7:
a.e(g == null ? "null" : g.toString());
break;
case 8:
var v_ = g;
a.e("\"" + (v_.toJSON()) + "\"");
break;
case 11:
this.di(a, g);
break;
}
}
a.h();
a.f("}");
};
ComponentRenderer.prototype.o = function (a, b) {
if (b == null) {
return true;
}
var v_ = b;
if ((typeof v_ === 'function')) {
return false;
}
return true;
};
ComponentRenderer.prototype.createObjectFromJson = function (a, b) {
var c = new JsonDictionaryParser();
var d = c.parse(a);
var e = new DescriptionSerializer();
var f = false;
var g = e.d(this.context, d, f, null, false);
if (g.result == null) {
return null;
}
var h = DescriptionTreeBuilder.createTree(this.context, g.result);
var i = this.a1.item(b);
if (h.c("Type")) {
var j = h.a("Type").b;
return this.bu(j, h, b, i, true, -1, null);
}
else {
return this.bt(typeCast(JsonDictionaryObject.$, d));
}
};
ComponentRenderer.prototype.loadJson = function (a, b) {
this.cs(a, b, null, false, false, false);
};
ComponentRenderer.prototype.loadJsonOverlay = function (a, b, c) {
this.cs(a, b, c, true, false, true);
};
ComponentRenderer.prototype.loadJsonDelta = function (a, b, c) {
this.cs(a, b, null, true, c, false);
};
ComponentRenderer.prototype.ap = function () {
return false;
};
ComponentRenderer.prototype.cu = function (a) {
};
ComponentRenderer.prototype.cs = function (a, b, c, d, e, f) {
var g = new JsonDictionaryParser();
var h = g.parse(a);
var i = new DescriptionSerializer();
i.h = this.isProceedOnErrorEnabled;
i.g = this.ap();
var j = null;
if (typeCast(JsonDictionaryObject.$, h) !== null) {
var k = h;
if (k.g("skipAlterDataCasing")) {
var l = k.item("skipAlterDataCasing");
if (l.value) {
this.cu(true);
}
}
else {
this.cu(false);
}
if (k.g("descriptions")) {
var m = k.item("descriptions");
if (typeCast(JsonDictionaryObject.$, m) !== null) {
var n = m;
var o = n.e();
for (var p = 0; p < o.length; p++) {
var q = o[p];
var r = n.item(q);
var s = b(q);
if (s == null) {
continue;
}
j = s;
var t = false;
var u = this.ba();
if (u != null) {
t = true;
}
var v = null;
if (this.isProceedOnErrorEnabled) {
try {
v = i.d(this.context, r, t, u, false);
}
catch (w) {
return;
}
}
else {
v = i.d(this.context, r, t, u, false);
}
if (v.result == null) {
continue;
}
if (f) {
if (!this.a5.containsKey(s)) {
var x = null;
if (this.isProceedOnErrorEnabled) {
try {
x = i.d(this.context, r, t, u, true);
}
catch (y) {
return;
}
}
else {
x = i.d(this.context, r, t, u, true);
}
this.dd(x.result, s, d, true, false);
var z = c(q);
var aa = this.a5.item(s);
this.co(this.at.item(s), z, aa, s);
}
}
this.dd(v.result, s, d, e, false);
}
}
}
if (k.g("refs") && j != null) {
var ab = k.item("refs");
var ac = this.af(ab);
if (!ac && typeCast(JsonDictionaryObject.$, ab) !== null) {
var ad = ab;
var ae = ad.e();
for (var af = 0; af < ae.length; af++) {
var ag = ae[af];
var ah = ad.item(ag);
if (typeCast(JsonDictionaryValue.$, ah) !== null) {
var ai = ah;
this.provideRefValue(j, ag, ai.value);
}
else if (typeCast(JsonDictionaryArray.$, ah) !== null) {
var aj = ah;
var ak = this.a(aj);
this.provideRefValue(j, ag, ak);
}
else {
var al = this.bt(ah);
this.provideRefValue(j, ag, al);
}
}
}
}
if (k.g("modules") && j != null) {
var am = k.item("modules");
this.ac(am);
}
if (k.g("strings") && j != null) {
var an = k.item("strings");
this.aj(an);
}
if (k.g("onInit") && j != null) {
var ao = k.item("onInit");
this.ad(ao);
}
if (k.g("onViewInit") && j != null) {
var ap = k.item("onViewInit");
this.ae(ap);
}
}
};
ComponentRenderer.prototype.provideRefValueFromJson = function (a, b, c) {
var d = b;
var e = new JsonDictionaryParser();
var f = e.parse(c);
if (typeCast(JsonDictionaryValue.$, f) !== null) {
var g = f;
this.provideRefValue(a, d, g.value);
}
else if (typeCast(JsonDictionaryArray.$, f) !== null) {
var h = f;
var i = this.a(h);
this.provideRefValue(a, d, i);
}
else {
var j = this.bt(f);
this.provideRefValue(a, d, j);
}
};
ComponentRenderer.prototype.ba = function () {
return null;
};
ComponentRenderer.prototype.af = function (a) {
return false;
};
ComponentRenderer.prototype.ac = function (a) {
return false;
};
ComponentRenderer.prototype.aj = function (a) {
return false;
};
ComponentRenderer.prototype.ad = function (a) {
return false;
};
ComponentRenderer.prototype.ae = function (a) {
return false;
};
ComponentRenderer.prototype.b7 = function (a, b, c) {
var d = a;
if (c != null) {
d = c.j(b);
}
else {
if (TypeDescriptionMetadata.shouldCamelize(b)) {
d = TypeDescriptionMetadata.camelize(d);
}
}
if (stringEndsWith(d, "Ref")) {
d = d.substr(0, d.length - ("Ref").length);
}
return d;
};
ComponentRenderer.prototype.co = function (a, b, c, d) {
var e_3, _a;
if (!c.b(b)) {
c.k(d, this.at.item(d).g, b, this.at.item(d), runOn(this, this.cz), -1);
}
try {
for (var _b = __values(fromEnum(a.f())), _c = _b.next(); !_c.done; _c = _b.next()) {
var e = _c.value;
this.cp(this.b7(e.c, ComponentRenderer.platform, e.a), e.b, b, c, d, a.g);
}
}
catch (e_3_1) {
e_3 = { error: e_3_1 };
}
finally {
try {
if (_c && !_c.done && (_a = _b.return))
_a.call(_b);
}
finally {
if (e_3)
throw e_3.error;
}
}
};
ComponentRenderer.prototype.cp = function (a, b, c, d, e, f) {
var e_4, _a;
var _this = this;
if (typeCast(DescriptionTreeNode.$, b) !== null) {
var g = b;
var h = this.adapter.getPropertyValue(c, a);
if (!d.b(h) && !d.a(g.g)) {
d.k(e, g.g, h, g, runOn(this, this.cz), f);
}
try {
for (var _b = __values(fromEnum(g.f())), _c = _b.next(); !_c.done; _c = _b.next()) {
var i = _c.value;
this.cp(a + "." + this.b7(i.c, ComponentRenderer.platform, i.a), i.b, c, d, e, g.g);
}
}
catch (e_4_1) {
e_4 = { error: e_4_1 };
}
finally {
try {
if (_c && !_c.done && (_a = _b.return))
_a.call(_b);
}
finally {
if (e_4)
throw e_4.error;
}
}
}
if (typeCast(Array_$type, b) !== null) {
var j_1 = new Dictionary$2(Number_$type, DescriptionTreeNode.$, 0);
var k_1 = 0;
var l = b.length;
var o = b;
for (var n = 0; n < o.length; n++) {
var m = o[n];
if (typeCast(DescriptionTreeNode.$, m) !== null) {
var p = m;
j_1.item(k_1, p);
}
k_1++;
}
var q = this.adapter.getPropertyValue(c, a);
k_1 = 0;
this.adapter.forPropertyValueItem(c, a, function (r) {
var e_5, _a;
if (j_1.containsKey(k_1)) {
var s = j_1.item(k_1);
if (!d.b(r) && !d.a(s.g)) {
d.k(e, s.g, r, s, runOn(_this, _this.cz), f);
}
try {
for (var _b = __values(fromEnum(s.f())), _c = _b.next(); !_c.done; _c = _b.next()) {
var t = _c.value;
_this.cp(a + "." + t.c, t.b, c, d, e, s.g);
}
}
catch (e_5_1) {
e_5 = { error: e_5_1 };
}
finally {
try {
if (_c && !_c.done && (_a = _b.return))
_a.call(_b);
}
finally {
if (e_5)
throw e_5.error;
}
}
}
k_1++;
});
if (l > 0 && k_1 == 0) {
var r_1 = this.cb(a);
this.adapter.forPropertyValueItem(c, r_1, function (s) {
var e_6, _a;
if (j_1.containsKey(k_1)) {
var t = j_1.item(k_1);
if (!d.b(s) && !d.a(t.g)) {
d.k(e, t.g, s, t, runOn(_this, _this.cz), f);
}
try {
for (var _b = __values(fromEnum(t.f())), _c = _b.next(); !_c.done; _c = _b.next()) {
var u = _c.value;
_this.cp(r_1 + "." + u.c, u.b, c, d, e, t.g);
}
}
catch (e_6_1) {
e_6 = { error: e_6_1 };
}
finally {
try {
if (_c && !_c.done && (_a = _b.return))
_a.call(_b);
}
finally {
if (e_6)
throw e_6.error;
}
}
}
k_1++;
});
}
}
};
ComponentRenderer.prototype.cb = function (a) {
var b = a.lastIndexOf('.');
var c = null;
var d = a;
if (b > 0) {
c = a.substr(0, b);
d = a.substr(b + 1);
}
d = "actual" + this.b9(d);
if (c != null) {
return c + "." + d;
}
return d;
};
ComponentRenderer.prototype.b9 = function (a) {
return a.substr(0, 1).toUpperCase() + a.substr(1);
};
ComponentRenderer.prototype.a = function (a) {
var b = new Array(a.items.length);
for (var c = 0; c < a.items.length; c++) {
var d = this.bt(a.items[c]);
b[c] = d;
}
return b;
};
ComponentRenderer.prototype.bt = function (a) {
if (a == null) {
return null;
}
var b = {};
var dict_ = b;
var c = a.e();
for (var d = 0; d < c.length; d++) {
var key_ = c[d];
if (typeCast(JsonDictionaryObject.$, a.item(key_)) !== null) {
var val_ = this.bt(a.item(key_));
dict_[key_] = val_;
}
else if (typeCast(JsonDictionaryArray.$, a.item(key_)) !== null) {
var val_ = this.a(a.item(key_));
dict_[key_] = val_;
}
else {
var val_ = a.item(key_).value;
dict_[key_] = val_;
}
}
return dict_;
};
Object.defineProperty(ComponentRenderer.prototype, "a5", {
get: function () {
return this.a1;
},
enumerable: false,
configurable: true
});
ComponentRenderer.prototype.cleanup = function (a, b) {
this.dd(null, a, false, false, b);
};
ComponentRenderer.prototype.render = function (a, b) {
this.dd(a, b, false, false, false);
};
ComponentRenderer.prototype.dd = function (a, b, c, d, e) {
var _this = this;
if (!this.a1.containsKey(b)) {
this.a1.item(b, new ContainerState());
this.a1.item(b).i = b;
}
this.aw.item(b, a);
this.ax.item(b, c);
this.ay.item(b, d);
this.av.item(b, e);
this.cv(b, function () { return _this.db(b); });
};
ComponentRenderer.prototype.cv = function (a, b) {
this.adapter.onUIThread(a, b);
};
ComponentRenderer.prototype.db = function (a) {
var e_7, _a, e_8, _b, e_9, _c, e_10, _d;
var _this = this;
if (this.aw.containsKey(a)) {
var b = this.ax.containsKey(a) ? this.ax.item(a) : false;
var c = this.ay.containsKey(a) ? this.ay.item(a) : false;
var d = this.aw.item(a);
this.aw.removeItem(a);
var e = DescriptionTreeBuilder.createTree(this.context, d);
var f = null;
if (this.at.containsKey(a)) {
f = this.at.item(a);
}
var g = DescriptionTreeReconciler.c(f, e, b);
if (!c && b) {
e = f.b();
DescriptionTreeReconciler.a(f, g);
var h = f;
f = e;
e = h;
g = DescriptionTreeReconciler.c(f, e, false);
}
if (c) {
var i = DescriptionTreeReconciler.a(f, g);
if (!this.a1.containsKey(a)) {
this.a1.addItem(a, ((function () {
var $ret = new ContainerState();
$ret.i = a;
return $ret;
})()));
}
var j_2 = this.a1.item(a);
if (i.a.count > 0) {
try {
for (var _e = __values(fromEnum(i.a)), _f = _e.next(); !_f.done; _f = _e.next()) {
var k = _f.value;
if (j_2.a(k)) {
var l = j_2.j(k);
this.cm(a, l, j_2);
}
}
}
catch (e_7_1) {
e_7 = { error: e_7_1 };
}
finally {
try {
if (_f && !_f.done && (_a = _e.return))
_a.call(_e);
}
finally {
if (e_7)
throw e_7.error;
}
}
}
if (i.c.count > 0) {
try {
for (var _g = __values(fromEnum(i.c)), _h = _g.next(); !_h.done; _h = _g.next()) {
var m = _h.value;
var n = this.bz(a, j_2, m);
var o = this.adapter.getPropertyValue(n, m.j);
if (o != null) {
if (!j_2.b(o)) {
var p = m.g;
if (typeCast(DescriptionTreeNode.$, p) !== null) {
var q = p.g;
j_2.k(a, q, o, p, runOn(this, this.cz), m.c.g);
}
}
}
}
}
catch (e_8_1) {
e_8 = { error: e_8_1 };
}
finally {
try {
if (_h && !_h.done && (_b = _g.return))
_b.call(_g);
}
finally {
if (e_8)
throw e_8.error;
}
}
}
if (i.d.count > 0) {
try {
for (var _j = __values(fromEnum(i.d)), _k = _j.next(); !_k.done; _k = _j.next()) {
var r = _k.value;
var s = r.g;
if (s != null) {
if (!j_2.b(s)) {
var t = r.g;
if (typeCast(DescriptionTreeNode.$, t) !== null) {
var u = t.g;
this.at.item(a, t);
}
}
}
}
}
catch (e_9_1) {
e_9 = { error: e_9_1 };
}
finally {
try {
if (_k && !_k.done && (_c = _j.return))
_c.call(_j);
}
finally {
if (e_9)
throw e_9.error;
}
}
}
if (i.b.count > 0) {
var _loop_1 = function (v) {
var w = v.c.a(v.j).b;
if (w == null) {
return "continue";
}
var x = new Dictionary$2(String_$type, DescriptionTreeNode.$, 0);
for (var y = 0; y < w.length; y++) {
var z = w[y];
if (typeCast(DescriptionTreeNode.$, z) !== null) {
var aa = z;
if (aa.c("Name")) {
x.item(aa.a("Name").b, aa);
}
}
}
if (x.count == 0) {
return "continue";
}
var ab = this_1.bz(a, j_2, v);
var ac = this_1.adapter.getPropertyValue(ab, v.j);
if (ac != null) {
var ad_1 = 0;
this_1.adapter.forPropertyValueItem(ab, v.j, function (ae) {
if (x.containsKey(_this.adapter.getPropertyValue(ae, "Name").toString())) {
if (!j_2.b(ae)) {
var af = x.item(_this.adapter.getPropertyValue(ae, "Name").toString());
if (typeCast(DescriptionTreeNode.$, af) !== null) {
var ag = af.g;
j_2.k(a, ag, ae, af, runOn(_this, _this.cz), v.c.g);
}
}
}
ad_1++;
});
}
};
var this_1 = this;
try {
for (var _l = __values(fromEnum(i.b)), _m = _l.next(); !_m.done; _m = _l.next()) {
var v = _m.value;
_loop_1(v);
}
}
catch (e_10_1) {
e_10 = { error: e_10_1 };
}
finally {
try {
if (_m && !_m.done && (_d = _l.return))
_d.call(_l);
}
finally {
if (e_10)
throw e_10.error;
}
}
}
}
else {
this.at.item(a, e);
}
if (!c) {
this.dc(a, g);
}
if (this.av.item(a)) {
this.c9(a);
if (this.a1.containsKey(a)) {
this.a1.removeItem(a);
}
}
}
};
ComponentRenderer.prototype.provideRefValue = function (a, b, c) {
var _this = this;
this.cv(a, function () {
if (!_this.a1.containsKey(a)) {
_this.a1.addItem(a, ((function () {
var $ret = new ContainerState();
$ret.i = a;
return $ret;
})()));
}
var d = _this.a1.item(a);
_this.cz(a, b, c, true);
});
};
ComponentRenderer.prototype.removeRefValue = function (a, b) {
var _this = this;
this.cv(a, function () {
if (!_this.a1.containsKey(a)) {
_this.a1.addItem(a, ((function () {
var $ret = new ContainerState();
$ret.i = a;
return $ret;
})()));
}
var c = _this.a1.item(a);
_this.removeRefValueCore(a, b, true);
});
};
ComponentRenderer.prototype.c9 = function (a) {
var e_11, _a;
var b = this.a1.item(a);
var c = new List$1(String_$type, 0);
try {
for (var _b = __values(fromEnum(this.a0.keys)), _c = _b.next(); !_c.done; _c = _b.next()) {
var d = _c.value;
if (this.a0.item(d).c == 0) {
c.add(d);
}
}
}
catch (e_11_1) {
e_11 = { error: e_11_1 };
}
finally {
try {
if (_c && !_c.done && (_a = _b.return))
_a.call(_b);
}
finally {
if (e_11)
throw e_11.error;
}
}
for (var e = 0; e < c.count; e++) {
var f = this.shouldNamespaceSystemRefValues;
this.shouldNamespaceSystemRefValues = false;
this.removeRefValueCore(a, c._inner[e], this.a4.containsKey(c._inner[e]));
this.shouldNamespaceSystemRefValues = f;
}
};
ComponentRenderer.prototype.clearRefValues = function (a) {
var _this = this;
this.cv(a, function () {
if (!_this.a1.containsKey(a)) {
_this.a1.addItem(a, ((function () {
var $ret = new ContainerState();
$ret.i = a;
return $ret;
})()));
}
var b = _this.a1.item(a);
_this.clearUserRefValues();
});
};
ComponentRenderer.prototype.v = function (a) {
if (this.as.containsKey(a) && this.as.item(a)) {
return false;
}
if (this.az.containsKey(a) && this.az.item(a).count > 0) {
return false;
}
return true;
};
ComponentRenderer.prototype.queueForIdle = function (a, b) {
var _this = this;
this.cv(a, function () {
if (_this.v(a)) {
b();
}
else {
if (!_this.au.containsKey(a)) {
_this.au.item(a, new List$1(Delegate_$type, 0));
}
_this.au.item(a).add(b);
}
});
};
ComponentRenderer.prototype.tryFlushIdleActions = function (a) {
if (this.v(a)) {
if (this.au.containsKey(a)) {
var b = new List$1(Delegate_$type, 1, this.au.item(a));
this.au.item(a).clear();
for (var c = 0; c < b.count; c++) {
b._inner[c]();
}
}
}
};
ComponentRenderer.prototype.dc = function (a, b) {
var c = this.a1.item(a);
this.cw(a, c, b);
};
ComponentRenderer.prototype.df = function (a, b) {
if (this.isProceedOnErrorEnabled) {
try {
this.cn(a, b, true);
}
catch (c) {
this.as.item(a, false);
}
}
else {
this.cn(a, b, true);
}
};
ComponentRenderer.prototype.dl = function (a, b) {
if (this.isProceedOnErrorEnabled) {
try {
this.cn(a, b, false);
}
catch (c) {
this.as.item(a, false);
}
}
else {
this.cn(a, b, false);
}
};
ComponentRenderer.prototype.cn = function (a, b, c) {
if (!c) {
if (this.as.containsKey(a) && this.as.item(a)) {
return;
}
}
this.as.item(a, true);
var d = true;
while (d && this.az.item(a).count > 0) {
while (this.az.item(a).count > 0 && this.az.item(a).c().count < 1) {
this.az.item(a).b();
}
if (this.az.item(a).count < 1) {
break;
}
var e = this.az.item(a).c();
while (e.count > 0) {
var f = e.b();
d = this.z(a, b, f);
if (!d) {
break;
}
}
}
if (d) {
this.as.item(a, false);
}
if (this.v(a)) {
this.tryFlushIdleActions(a);
}
};
ComponentRenderer.prototype.cw = function (a, b, c) {
var d = new Queue$1(DescriptionTreeAction.$);
for (var e = 0; e < c.count; e++) {
d.g(c._inner[e]);
}
if (!this.az.containsKey(a)) {
this.az.addItem(a, new Queue$1(Queue$1.$.specialize(DescriptionTreeAction.$)));
}
this.az.item(a).g(d);
this.dl(a, b);
};
ComponentRenderer.prototype.cx = function (a, b, c) {
for (var d = 0; d < c.count; d++) {
this.z(a, b, c._inner[d]);
}
};
ComponentRenderer.prototype.z = function (a, b, c) {
switch (c.a) {
case 5: return this.aa(a, b, c);
case 2: return this.ab(a, b, c);
case 4: return this.ag(a, b, c);
case 3: return this.ah(a, b, c);
case 1: return this.ai(a, b, c);
case 0: return this.ak(a, b, c);
}
return true;
};
ComponentRenderer.prototype.ak = function (a, b, c) {
var d = this.bz(a, b, c);
this.ar(a, b, c, d);
return true;
};
ComponentRenderer.prototype.ar = function (a, b, c, d) {
var e = this.bw(c, a, b);
e = this.i.transform(ComponentRenderer.platform, e, c);
var f = false;
if (this.a8 != null && this.a8.count > 0) {
for (var g = 0; g < this.a8.count; g++) {
var h = this.a8._inner[g];
var i = this.b8(a, c);
if (h(i, d, e)) {
f = true;
}
}
}
if (c.j == "Type" || c.j == "type") {
f = true;
}
if (f) {
return true;
}
if (c.d != null && c.d.knownType == 9) {
this.ao(a, b, c.i(ComponentRenderer.platform), c.d, e, d);
}
else {
this.dj(a, b, c.i(ComponentRenderer.platform), c.d, e, c.h, d);
}
return true;
};
ComponentRenderer.prototype.b8 = function (a, b) {
var c = b.c;
var d = "";
if (c != this.at.item(a)) {
var e = this.b6(a, c);
d = e;
}
if (d.length > 0) {
d += ".";
}
d += b.j;
return d;
};
ComponentRenderer.prototype.b6 = function (a, b) {
if (b == null) {
return "";
}
var c = this.cc("", this.at.item(a), b);
if (c.c) {
return c.d;
}
return "";
};
ComponentRenderer.prototype.cc = function (a, b, c) {
if (b == c) {
return new Tuple$2(Boolean_$type, String_$type, true, a);
}
if (a.length > 0) {
a += ".";
}
var d = b.f();
for (var e = 0; e < d.count; e++) {
var f = d._inner[e];
if (typeCast(DescriptionTreeNode.$, f.b) !== null) {
if (f.b.g == c.g) {
a += f.c;
return new Tuple$2(Boolean_$type, String_$type, true, a);
}
else {
var g = a + f.c;
var h = this.cc(g, f.b, c);
if (h.c) {
return h;
}
}
}
if (f.a != null && f.a.knownType == 9) {
var i = f.b;
for (var j = 0; j < i.length; j++) {
if (typeCast(DescriptionTreeNode.$, i[j]) !== null) {
var k = i[j];
if (k.g == c.g) {
a += f.c + "[" + j + "]";
return new Tuple$2(Boolean_$type, String_$type, true, a);
}
else {
var l = a + f.c + "[" + j + "]";
var m = this.cc(l, k, c);
if (m.c) {
return m;
}
}
}
}
}
}
return new Tuple$2(Boolean_$type, String_$type, false, a);
};
ComponentRenderer.prototype.ao = function (a, b, c, d, e, f) {
var e_12, _a;
if (this.a3.containsKey(c)) {
try {
for (var _b = __values(fromEnum(this.a3.item(c))), _c = _b.next(); !_c.done; _c = _b.next()) {
var g = _c.value;
g(c, f, e);
}
}
catch (e_12_1) {
e_12 = { error: e_12_1 };
}
finally {
try {
if (_c && !_c.done && (_a = _b.return))
_a.call(_b);
}
finally {
if (e_12)
throw e_12.error;
}
}
}
this.adapter.setOrUpdateCollectionOnTarget(a, c, d, this.context, f, e);
return true;
};
ComponentRenderer.prototype.bw = function (a, b, c) {
if (a.d == null) {
return a.g;
}
switch (a.d.knownType) {
case 10: return this.bc(a, b, c);
case 7: return this.bd(a);
case 4: return this.be(a);
case 6: return this.bf(a);
case 9: return this.bc(a, b, c);
case 5: return this.bg(a);
case 16: return this.bh(a);
case 20: return this.b0(a, c);
case 22: return this.b3(a, c);
case 15: return null;
case 3: return this.bi(a);
case 19: return this.b1(a, c);
case 8: return this.bk(a, b, c);
case 13: return null;
case 18: return this.b2(a, c);
case 1: return this.bl(a);
case 11: return this.bm(a);
case 14: return this.bn(a);
case 12: return this.bo(a);
case 2: return this.bp(a);
case 21: return this.bq(a);
case 17: return this.br(a, b, c);
case 0: return null;
}
return null;
};
ComponentRenderer.prototype.br = function (a, b, c) {
var d = this.bs(a.g, a, b, c);
return d;
};
ComponentRenderer.prototype.bs = function (a, b, c, d) {
if (typeof a === 'string') {
if (stringStartsWith(a, "@d:")) {
var v_ = a.substr(3);
a = new Date(v_);
}
}
if (typeCast(Array_$type, a) !== null) {
var e = a;
var f = new Array(e.length);
for (var g = 0; g < e.length; g++) {
var h = this.bs(e[g], b, c, d);
f[g] = h;
}
a = f;
}
if (typeCast(DescriptionTreeNode.$, a) !== null) {
var i = a;
if (i.i == "EmbeddedRef") {
return this.bu(i.i, a, c, d, false, b.c.g, b.d);
}
}
return a;
};
ComponentRenderer.prototype.bq = function (a) {
return a.g;
};
ComponentRenderer.prototype.bp = function (a) {
return a.g != null ? a.g.toString() : null;
};
ComponentRenderer.prototype.bo = function (a) {
var b = a.g;
var width_ = b.width;
var height_ = b.height;
var c = { width: width_, height: height_ };
return c;
};
ComponentRenderer.prototype.bn = function (a) {
var b = a.g;
var top_ = b.top;
var left_ = b.left;
var width_ = b.width;
var height_ = b.height;
var c = { left: left_, top: top_, width: width_, height: height_ };
return c;
};
ComponentRenderer.prototype.bm = function (a) {
var b = a.g;
var x_ = b.x;
var y_ = b.y;
var c = { x: x_, y: y_ };
return c;
};
ComponentRenderer.prototype.bl = function (a) {
if (a.g == null) {
if (a.d != null && (a.d.spe