UNPKG

jointjs

Version:

JavaScript diagramming library

1,285 lines (1,267 loc) 3.83 MB
// make sure to keep this as 'var' // we don't want block scoping var dartNodePreambleSelf = typeof global !== "undefined" ? global : window; var self = Object.create(dartNodePreambleSelf); self.scheduleImmediate = self.setImmediate ? function (cb) { dartNodePreambleSelf.setImmediate(cb); } : function(cb) { setTimeout(cb, 0); }; // CommonJS globals. self.exports = exports; // Node.js specific exports, check to see if they exist & or polyfilled if (typeof process !== "undefined") { self.process = process; } if (typeof __dirname !== "undefined") { self.__dirname = __dirname; } if (typeof __filename !== "undefined") { self.__filename = __filename; } // if we're running in a browser, Dart supports most of this out of box // make sure we only run these in Node.js environment var dartNodeIsActuallyNode = !dartNodePreambleSelf.window try { // Check if we're in a Web Worker instead. if ("undefined" !== typeof WorkerGlobalScope && dartNodePreambleSelf instanceof WorkerGlobalScope) { dartNodeIsActuallyNode = false; } // Check if we're in Electron, with Node.js integration, and override if true. if (dartNodeIsActuallyNode && dartNodePreambleSelf.process && dartNodePreambleSelf.versions && process.versions.hasOwnProperty('electron') && process.versions.hasOwnProperty('node')) { dartNodeIsActuallyNode = true; } } catch(e) {} if (dartNodeIsActuallyNode) { // This line is to: // 1) Prevent Webpack from bundling. // 2) In Webpack on Node.js, make sure we're using the native Node.js require, which is available via __non_webpack_require__ // https://github.com/mbullington/node_preamble.dart/issues/18#issuecomment-527305561 var url = ("undefined" !== typeof __webpack_require__ ? __non_webpack_require__ : require)("url"); self.location = { get href() { if (url.pathToFileURL) { return url.pathToFileURL(process.cwd()).href + "/"; } else { // This isn't really a correct transformation, but it's the best we have // for versions of Node <10.12.0 which introduced `url.pathToFileURL()`. // For example, it will fail for paths that contain characters that need // to be escaped in URLs. return "file://" + (function() { var cwd = process.cwd(); if (process.platform != "win32") return cwd; return "/" + cwd.replace(/\\/g, "/"); })() + "/" } } }; (function() { function computeCurrentScript() { try { throw new Error(); } catch(e) { var stack = e.stack; var re = new RegExp("^ *at [^(]*\\((.*):[0-9]*:[0-9]*\\)$", "mg"); var lastMatch = null; do { var match = re.exec(stack); if (match != null) lastMatch = match; } while (match != null); return lastMatch[1]; } } var cachedCurrentScript = null; self.document = { get currentScript() { if (cachedCurrentScript == null) { cachedCurrentScript = {src: computeCurrentScript()}; } return cachedCurrentScript; } }; })(); self.dartDeferredLibraryLoader = function(uri, successCallback, errorCallback) { try { load(uri); successCallback(); } catch (error) { errorCallback(error); } }; } self.fs = require("fs"); self.chokidar = require("chokidar"); self.readline = require("readline"); // Generated by dart2js (fast startup emitter, strong, trust primitives, omit checks, lax runtime type), the Dart to JavaScript compiler version: 2.8.4. // The code supports the following hooks: // dartPrint(message): // if this function is defined it is called instead of the Dart [print] // method. // // dartMainRunner(main, args): // if this function is defined, the Dart [main] method will not be invoked // directly. Instead, a closure that will invoke [main], and its arguments // [args] is passed to [dartMainRunner]. // // dartDeferredLibraryLoader(uri, successCallback, errorCallback): // if this function is defined, it will be called when a deferred library // is loaded. It should load and eval the javascript of `uri`, and call // successCallback. If it fails to do so, it should call errorCallback with // an error. // // dartCallInstrumentation(id, qualifiedName): // if this function is defined, it will be called at each entry of a // method or constructor. Used only when compiling programs with // --experiment-call-instrumentation. (function dartProgram() { function copyProperties(from, to) { var keys = Object.keys(from); for (var i = 0; i < keys.length; i++) { var key = keys[i]; to[key] = from[key]; } } var supportsDirectProtoAccess = function() { var cls = function() { }; cls.prototype = {p: {}}; var object = new cls(); if (!(object.__proto__ && object.__proto__.p === cls.prototype.p)) return false; try { if (typeof navigator != "undefined" && typeof navigator.userAgent == "string" && navigator.userAgent.indexOf("Chrome/") >= 0) return true; if (typeof version == "function" && version.length == 0) { var v = version(); if (/^\d+\.\d+\.\d+\.\d+$/.test(v)) return true; } } catch (_) { } return false; }(); function setFunctionNamesIfNecessary(holders) { function t() { } ; if (typeof t.name == "string") return; for (var i = 0; i < holders.length; i++) { var holder = holders[i]; var keys = Object.keys(holder); for (var j = 0; j < keys.length; j++) { var key = keys[j]; var f = holder[key]; if (typeof f == 'function') f.name = key; } } } function inherit(cls, sup) { cls.prototype.constructor = cls; cls.prototype["$is" + cls.name] = cls; if (sup != null) { if (supportsDirectProtoAccess) { cls.prototype.__proto__ = sup.prototype; return; } var clsPrototype = Object.create(sup.prototype); copyProperties(cls.prototype, clsPrototype); cls.prototype = clsPrototype; } } function inheritMany(sup, classes) { for (var i = 0; i < classes.length; i++) inherit(classes[i], sup); } function mixin(cls, mixin) { copyProperties(mixin.prototype, cls.prototype); cls.prototype.constructor = cls; } function lazy(holder, name, getterName, initializer) { var uninitializedSentinel = holder; holder[name] = uninitializedSentinel; holder[getterName] = function() { holder[getterName] = function() { H.throwCyclicInit(name); }; var result; var sentinelInProgress = initializer; try { if (holder[name] === uninitializedSentinel) { result = holder[name] = sentinelInProgress; result = holder[name] = initializer(); } else result = holder[name]; } finally { if (result === sentinelInProgress) holder[name] = null; holder[getterName] = function() { return this[name]; }; } return result; }; } function makeConstList(list) { list.immutable$list = Array; list.fixed$length = Array; return list; } function convertToFastObject(properties) { function t() { } t.prototype = properties; new t(); return properties; } function convertAllToFastObject(arrayOfObjects) { for (var i = 0; i < arrayOfObjects.length; ++i) convertToFastObject(arrayOfObjects[i]); } var functionCounter = 0; function tearOffGetter(funcs, applyTrampolineIndex, reflectionInfo, name, isIntercepted) { return isIntercepted ? new Function("funcs", "applyTrampolineIndex", "reflectionInfo", "name", "H", "c", "return function tearOff_" + name + functionCounter++ + "(receiver) {" + "if (c === null) c = " + "H.closureFromTearOff" + "(" + "this, funcs, applyTrampolineIndex, reflectionInfo, false, true, name);" + "return new c(this, funcs[0], receiver, name);" + "}")(funcs, applyTrampolineIndex, reflectionInfo, name, H, null) : new Function("funcs", "applyTrampolineIndex", "reflectionInfo", "name", "H", "c", "return function tearOff_" + name + functionCounter++ + "() {" + "if (c === null) c = " + "H.closureFromTearOff" + "(" + "this, funcs, applyTrampolineIndex, reflectionInfo, false, false, name);" + "return new c(this, funcs[0], null, name);" + "}")(funcs, applyTrampolineIndex, reflectionInfo, name, H, null); } function tearOff(funcs, applyTrampolineIndex, reflectionInfo, isStatic, name, isIntercepted) { var cache = null; return isStatic ? function() { if (cache === null) cache = H.closureFromTearOff(this, funcs, applyTrampolineIndex, reflectionInfo, true, false, name).prototype; return cache; } : tearOffGetter(funcs, applyTrampolineIndex, reflectionInfo, name, isIntercepted); } var typesOffset = 0; function installTearOff(container, getterName, isStatic, isIntercepted, requiredParameterCount, optionalParameterDefaultValues, callNames, funsOrNames, funType, applyIndex) { var funs = []; for (var i = 0; i < funsOrNames.length; i++) { var fun = funsOrNames[i]; if (typeof fun == 'string') fun = container[fun]; fun.$callName = callNames[i]; funs.push(fun); } var fun = funs[0]; fun.$requiredArgCount = requiredParameterCount; fun.$defaultValues = optionalParameterDefaultValues; var reflectionInfo = funType; if (typeof reflectionInfo == "number") reflectionInfo += typesOffset; var name = funsOrNames[0]; fun.$stubName = name; var getterFunction = tearOff(funs, applyIndex || 0, reflectionInfo, isStatic, name, isIntercepted); container[getterName] = getterFunction; if (isStatic) fun.$tearOff = getterFunction; } function installStaticTearOff(container, getterName, requiredParameterCount, optionalParameterDefaultValues, callNames, funsOrNames, funType, applyIndex) { return installTearOff(container, getterName, true, false, requiredParameterCount, optionalParameterDefaultValues, callNames, funsOrNames, funType, applyIndex); } function installInstanceTearOff(container, getterName, isIntercepted, requiredParameterCount, optionalParameterDefaultValues, callNames, funsOrNames, funType, applyIndex) { return installTearOff(container, getterName, false, isIntercepted, requiredParameterCount, optionalParameterDefaultValues, callNames, funsOrNames, funType, applyIndex); } function setOrUpdateInterceptorsByTag(newTags) { var tags = init.interceptorsByTag; if (!tags) { init.interceptorsByTag = newTags; return; } copyProperties(newTags, tags); } function setOrUpdateLeafTags(newTags) { var tags = init.leafTags; if (!tags) { init.leafTags = newTags; return; } copyProperties(newTags, tags); } function updateTypes(newTypes) { var types = init.types; var length = types.length; types.push.apply(types, newTypes); return length; } function updateHolder(holder, newHolder) { copyProperties(newHolder, holder); return holder; } var hunkHelpers = function() { var mkInstance = function(isIntercepted, requiredParameterCount, optionalParameterDefaultValues, callNames, applyIndex) { return function(container, getterName, name, funType) { return installInstanceTearOff(container, getterName, isIntercepted, requiredParameterCount, optionalParameterDefaultValues, callNames, [name], funType, applyIndex); }; }, mkStatic = function(requiredParameterCount, optionalParameterDefaultValues, callNames, applyIndex) { return function(container, getterName, name, funType) { return installStaticTearOff(container, getterName, requiredParameterCount, optionalParameterDefaultValues, callNames, [name], funType, applyIndex); }; }; return {inherit: inherit, inheritMany: inheritMany, mixin: mixin, installStaticTearOff: installStaticTearOff, installInstanceTearOff: installInstanceTearOff, _instance_0u: mkInstance(0, 0, null, ["call$0"], 0), _instance_1u: mkInstance(0, 1, null, ["call$1"], 0), _instance_2u: mkInstance(0, 2, null, ["call$2"], 0), _instance_0i: mkInstance(1, 0, null, ["call$0"], 0), _instance_1i: mkInstance(1, 1, null, ["call$1"], 0), _instance_2i: mkInstance(1, 2, null, ["call$2"], 0), _static_0: mkStatic(0, null, ["call$0"], 0), _static_1: mkStatic(1, null, ["call$1"], 0), _static_2: mkStatic(2, null, ["call$2"], 0), makeConstList: makeConstList, lazy: lazy, updateHolder: updateHolder, convertToFastObject: convertToFastObject, setFunctionNamesIfNecessary: setFunctionNamesIfNecessary, updateTypes: updateTypes, setOrUpdateInterceptorsByTag: setOrUpdateInterceptorsByTag, setOrUpdateLeafTags: setOrUpdateLeafTags}; }(); function initializeDeferredHunk(hunk) { typesOffset = init.types.length; hunk(hunkHelpers, init, holders, $); } function getGlobalFromName(name) { for (var i = 0; i < holders.length; i++) { if (holders[i] == C) continue; if (holders[i][name]) return holders[i][name]; } } var C = {}, H = {JS_CONST: function JS_CONST() { }, CastIterable_CastIterable: function(source, $S, $T) { if ($S._eval$1("EfficientLengthIterable<0>")._is(source)) return new H._EfficientLengthCastIterable(source, $S._eval$1("@<0>")._bind$1($T)._eval$1("_EfficientLengthCastIterable<1,2>")); return new H.CastIterable(source, $S._eval$1("@<0>")._bind$1($T)._eval$1("CastIterable<1,2>")); }, hexDigitValue: function(char) { var letter, digit = char ^ 48; if (digit <= 9) return digit; letter = char | 32; if (97 <= letter && letter <= 102) return letter - 87; return -1; }, SubListIterable$: function(_iterable, _start, _endOrLength, $E) { P.RangeError_checkNotNegative(_start, "start"); if (_endOrLength != null) { P.RangeError_checkNotNegative(_endOrLength, "end"); if (_start > _endOrLength) H.throwExpression(P.RangeError$range(_start, 0, _endOrLength, "start", null)); } return new H.SubListIterable(_iterable, _start, _endOrLength, $E._eval$1("SubListIterable<0>")); }, MappedIterable_MappedIterable: function(iterable, $function, $S, $T) { if (type$.EfficientLengthIterable_dynamic._is(iterable)) return new H.EfficientLengthMappedIterable(iterable, $function, $S._eval$1("@<0>")._bind$1($T)._eval$1("EfficientLengthMappedIterable<1,2>")); return new H.MappedIterable(iterable, $function, $S._eval$1("@<0>")._bind$1($T)._eval$1("MappedIterable<1,2>")); }, TakeIterable_TakeIterable: function(iterable, takeCount, $E) { var _s9_ = "takeCount"; P.ArgumentError_checkNotNull(takeCount, _s9_); P.RangeError_checkNotNegative(takeCount, _s9_); if (type$.EfficientLengthIterable_dynamic._is(iterable)) return new H.EfficientLengthTakeIterable(iterable, takeCount, $E._eval$1("EfficientLengthTakeIterable<0>")); return new H.TakeIterable(iterable, takeCount, $E._eval$1("TakeIterable<0>")); }, SkipIterable_SkipIterable: function(iterable, count, $E) { var _s5_ = "count"; if (type$.EfficientLengthIterable_dynamic._is(iterable)) { P.ArgumentError_checkNotNull(count, _s5_); P.RangeError_checkNotNegative(count, _s5_); return new H.EfficientLengthSkipIterable(iterable, count, $E._eval$1("EfficientLengthSkipIterable<0>")); } P.ArgumentError_checkNotNull(count, _s5_); P.RangeError_checkNotNegative(count, _s5_); return new H.SkipIterable(iterable, count, $E._eval$1("SkipIterable<0>")); }, FollowedByIterable_FollowedByIterable$firstEfficient: function(first, second, $E) { if ($E._eval$1("EfficientLengthIterable<0>")._is(second)) return new H.EfficientLengthFollowedByIterable(first, second, $E._eval$1("EfficientLengthFollowedByIterable<0>")); return new H.FollowedByIterable(first, second, $E._eval$1("FollowedByIterable<0>")); }, IterableElementError_noElement: function() { return new P.StateError("No element"); }, IterableElementError_tooMany: function() { return new P.StateError("Too many elements"); }, IterableElementError_tooFew: function() { return new P.StateError("Too few elements"); }, Sort_sort: function(a, compare) { H.Sort__doSort(a, 0, J.get$length$asx(a) - 1, compare); }, Sort__doSort: function(a, left, right, compare) { if (right - left <= 32) H.Sort__insertionSort(a, left, right, compare); else H.Sort__dualPivotQuicksort(a, left, right, compare); }, Sort__insertionSort: function(a, left, right, compare) { var i, t1, el, j, j0; for (i = left + 1, t1 = J.getInterceptor$asx(a); i <= right; ++i) { el = t1.$index(a, i); j = i; while (true) { if (!(j > left && compare.call$2(t1.$index(a, j - 1), el) > 0)) break; j0 = j - 1; t1.$indexSet(a, j, t1.$index(a, j0)); j = j0; } t1.$indexSet(a, j, el); } }, Sort__dualPivotQuicksort: function(a, left, right, compare) { var t0, less, great, k, ak, comp, great0, less0, pivots_are_equal, t2, sixth = C.JSInt_methods._tdivFast$1(right - left + 1, 6), index1 = left + sixth, index5 = right - sixth, index3 = C.JSInt_methods._tdivFast$1(left + right, 2), index2 = index3 - sixth, index4 = index3 + sixth, t1 = J.getInterceptor$asx(a), el1 = t1.$index(a, index1), el2 = t1.$index(a, index2), el3 = t1.$index(a, index3), el4 = t1.$index(a, index4), el5 = t1.$index(a, index5); if (compare.call$2(el1, el2) > 0) { t0 = el2; el2 = el1; el1 = t0; } if (compare.call$2(el4, el5) > 0) { t0 = el5; el5 = el4; el4 = t0; } if (compare.call$2(el1, el3) > 0) { t0 = el3; el3 = el1; el1 = t0; } if (compare.call$2(el2, el3) > 0) { t0 = el3; el3 = el2; el2 = t0; } if (compare.call$2(el1, el4) > 0) { t0 = el4; el4 = el1; el1 = t0; } if (compare.call$2(el3, el4) > 0) { t0 = el4; el4 = el3; el3 = t0; } if (compare.call$2(el2, el5) > 0) { t0 = el5; el5 = el2; el2 = t0; } if (compare.call$2(el2, el3) > 0) { t0 = el3; el3 = el2; el2 = t0; } if (compare.call$2(el4, el5) > 0) { t0 = el5; el5 = el4; el4 = t0; } t1.$indexSet(a, index1, el1); t1.$indexSet(a, index3, el3); t1.$indexSet(a, index5, el5); t1.$indexSet(a, index2, t1.$index(a, left)); t1.$indexSet(a, index4, t1.$index(a, right)); less = left + 1; great = right - 1; if (J.$eq$(compare.call$2(el2, el4), 0)) { for (k = less; k <= great; ++k) { ak = t1.$index(a, k); comp = compare.call$2(ak, el2); if (comp === 0) continue; if (comp < 0) { if (k !== less) { t1.$indexSet(a, k, t1.$index(a, less)); t1.$indexSet(a, less, ak); } ++less; } else for (; true;) { comp = compare.call$2(t1.$index(a, great), el2); if (comp > 0) { --great; continue; } else { great0 = great - 1; if (comp < 0) { t1.$indexSet(a, k, t1.$index(a, less)); less0 = less + 1; t1.$indexSet(a, less, t1.$index(a, great)); t1.$indexSet(a, great, ak); great = great0; less = less0; break; } else { t1.$indexSet(a, k, t1.$index(a, great)); t1.$indexSet(a, great, ak); great = great0; break; } } } } pivots_are_equal = true; } else { for (k = less; k <= great; ++k) { ak = t1.$index(a, k); if (compare.call$2(ak, el2) < 0) { if (k !== less) { t1.$indexSet(a, k, t1.$index(a, less)); t1.$indexSet(a, less, ak); } ++less; } else if (compare.call$2(ak, el4) > 0) for (; true;) if (compare.call$2(t1.$index(a, great), el4) > 0) { --great; if (great < k) break; continue; } else { great0 = great - 1; if (compare.call$2(t1.$index(a, great), el2) < 0) { t1.$indexSet(a, k, t1.$index(a, less)); less0 = less + 1; t1.$indexSet(a, less, t1.$index(a, great)); t1.$indexSet(a, great, ak); less = less0; } else { t1.$indexSet(a, k, t1.$index(a, great)); t1.$indexSet(a, great, ak); } great = great0; break; } } pivots_are_equal = false; } t2 = less - 1; t1.$indexSet(a, left, t1.$index(a, t2)); t1.$indexSet(a, t2, el2); t2 = great + 1; t1.$indexSet(a, right, t1.$index(a, t2)); t1.$indexSet(a, t2, el4); H.Sort__doSort(a, left, less - 2, compare); H.Sort__doSort(a, great + 2, right, compare); if (pivots_are_equal) return; if (less < index1 && great > index5) { for (; J.$eq$(compare.call$2(t1.$index(a, less), el2), 0);) ++less; for (; J.$eq$(compare.call$2(t1.$index(a, great), el4), 0);) --great; for (k = less; k <= great; ++k) { ak = t1.$index(a, k); if (compare.call$2(ak, el2) === 0) { if (k !== less) { t1.$indexSet(a, k, t1.$index(a, less)); t1.$indexSet(a, less, ak); } ++less; } else if (compare.call$2(ak, el4) === 0) for (; true;) if (compare.call$2(t1.$index(a, great), el4) === 0) { --great; if (great < k) break; continue; } else { great0 = great - 1; if (compare.call$2(t1.$index(a, great), el2) < 0) { t1.$indexSet(a, k, t1.$index(a, less)); less0 = less + 1; t1.$indexSet(a, less, t1.$index(a, great)); t1.$indexSet(a, great, ak); less = less0; } else { t1.$indexSet(a, k, t1.$index(a, great)); t1.$indexSet(a, great, ak); } great = great0; break; } } H.Sort__doSort(a, less, great, compare); } else H.Sort__doSort(a, less, great, compare); }, _CastIterableBase: function _CastIterableBase() { }, CastIterator: function CastIterator(t0, t1) { this._source = t0; this.$ti = t1; }, CastIterable: function CastIterable(t0, t1) { this._source = t0; this.$ti = t1; }, _EfficientLengthCastIterable: function _EfficientLengthCastIterable(t0, t1) { this._source = t0; this.$ti = t1; }, _CastListBase: function _CastListBase() { }, _CastListBase_sort_closure: function _CastListBase_sort_closure(t0, t1) { this.$this = t0; this.compare = t1; }, CastList: function CastList(t0, t1) { this._source = t0; this.$ti = t1; }, CastSet: function CastSet(t0, t1, t2) { this._source = t0; this._emptySet = t1; this.$ti = t2; }, CastQueue: function CastQueue(t0, t1) { this._source = t0; this.$ti = t1; }, CodeUnits: function CodeUnits(t0) { this._string = t0; }, EfficientLengthIterable: function EfficientLengthIterable() { }, ListIterable: function ListIterable() { }, SubListIterable: function SubListIterable(t0, t1, t2, t3) { var _ = this; _.__internal$_iterable = t0; _._start = t1; _._endOrLength = t2; _.$ti = t3; }, ListIterator: function ListIterator(t0, t1) { var _ = this; _.__internal$_iterable = t0; _.__internal$_length = t1; _.__internal$_index = 0; _.__internal$_current = null; }, MappedIterable: function MappedIterable(t0, t1, t2) { this.__internal$_iterable = t0; this._f = t1; this.$ti = t2; }, EfficientLengthMappedIterable: function EfficientLengthMappedIterable(t0, t1, t2) { this.__internal$_iterable = t0; this._f = t1; this.$ti = t2; }, MappedIterator: function MappedIterator(t0, t1) { this.__internal$_current = null; this._iterator = t0; this._f = t1; }, MappedListIterable: function MappedListIterable(t0, t1, t2) { this._source = t0; this._f = t1; this.$ti = t2; }, WhereIterable: function WhereIterable(t0, t1, t2) { this.__internal$_iterable = t0; this._f = t1; this.$ti = t2; }, WhereIterator: function WhereIterator(t0, t1) { this._iterator = t0; this._f = t1; }, ExpandIterable: function ExpandIterable(t0, t1, t2) { this.__internal$_iterable = t0; this._f = t1; this.$ti = t2; }, ExpandIterator: function ExpandIterator(t0, t1, t2) { var _ = this; _._iterator = t0; _._f = t1; _._currentExpansion = t2; _.__internal$_current = null; }, TakeIterable: function TakeIterable(t0, t1, t2) { this.__internal$_iterable = t0; this._takeCount = t1; this.$ti = t2; }, EfficientLengthTakeIterable: function EfficientLengthTakeIterable(t0, t1, t2) { this.__internal$_iterable = t0; this._takeCount = t1; this.$ti = t2; }, TakeIterator: function TakeIterator(t0, t1) { this._iterator = t0; this._remaining = t1; }, SkipIterable: function SkipIterable(t0, t1, t2) { this.__internal$_iterable = t0; this._skipCount = t1; this.$ti = t2; }, EfficientLengthSkipIterable: function EfficientLengthSkipIterable(t0, t1, t2) { this.__internal$_iterable = t0; this._skipCount = t1; this.$ti = t2; }, SkipIterator: function SkipIterator(t0, t1) { this._iterator = t0; this._skipCount = t1; }, SkipWhileIterable: function SkipWhileIterable(t0, t1, t2) { this.__internal$_iterable = t0; this._f = t1; this.$ti = t2; }, SkipWhileIterator: function SkipWhileIterator(t0, t1) { this._iterator = t0; this._f = t1; this._hasSkipped = false; }, EmptyIterable: function EmptyIterable(t0) { this.$ti = t0; }, EmptyIterator: function EmptyIterator() { }, FollowedByIterable: function FollowedByIterable(t0, t1, t2) { this.__internal$_first = t0; this._second = t1; this.$ti = t2; }, EfficientLengthFollowedByIterable: function EfficientLengthFollowedByIterable(t0, t1, t2) { this.__internal$_first = t0; this._second = t1; this.$ti = t2; }, FollowedByIterator: function FollowedByIterator(t0, t1) { this._currentIterator = t0; this._nextIterable = t1; }, WhereTypeIterable: function WhereTypeIterable(t0, t1) { this._source = t0; this.$ti = t1; }, WhereTypeIterator: function WhereTypeIterator(t0, t1) { this._source = t0; this.$ti = t1; }, FixedLengthListMixin: function FixedLengthListMixin() { }, UnmodifiableListMixin: function UnmodifiableListMixin() { }, UnmodifiableListBase: function UnmodifiableListBase() { }, ReversedListIterable: function ReversedListIterable(t0, t1) { this._source = t0; this.$ti = t1; }, Symbol: function Symbol(t0) { this.__internal$_name = t0; }, __CastListBase__CastIterableBase_ListMixin: function __CastListBase__CastIterableBase_ListMixin() { }, ConstantMap_ConstantMap$from: function(other, $K, $V) { var allStrings, object, containsProto, protoValue, $length, k, v, keys = P.List_List$from(other.get$keys(), true, $K), t1 = keys.length, _i = 0; while (true) { if (!(_i < t1)) { allStrings = true; break; } if (typeof keys[_i] != "string") { allStrings = false; break; } ++_i; } if (allStrings) { object = {}; for (containsProto = false, protoValue = null, $length = 0, _i = 0; _i < keys.length; keys.length === t1 || (0, H.throwConcurrentModificationError)(keys), ++_i) { k = keys[_i]; v = other.$index(0, k); if (!J.$eq$(k, "__proto__")) { if (!object.hasOwnProperty(k)) ++$length; object[k] = v; } else { protoValue = v; containsProto = true; } } if (containsProto) return new H.ConstantProtoMap(protoValue, $length + 1, object, keys, $K._eval$1("@<0>")._bind$1($V)._eval$1("ConstantProtoMap<1,2>")); return new H.ConstantStringMap($length, object, keys, $K._eval$1("@<0>")._bind$1($V)._eval$1("ConstantStringMap<1,2>")); } return new H.ConstantMapView(P.LinkedHashMap_LinkedHashMap$from(other, $K, $V), $K._eval$1("@<0>")._bind$1($V)._eval$1("ConstantMapView<1,2>")); }, ConstantMap__throwUnmodifiable: function() { throw H.wrapException(P.UnsupportedError$("Cannot modify unmodifiable Map")); }, instantiate1: function(f, T1) { var t1 = new H.Instantiation1(f, T1._eval$1("Instantiation1<0>")); t1.Instantiation$1(f); return t1; }, unminifyOrTag: function(rawClassName) { var preserved = H.unmangleGlobalNameIfPreservedAnyways(rawClassName); if (typeof preserved == "string") return preserved; return rawClassName; }, isJsIndexable: function(object, record) { var result; if (record != null) { result = record.x; if (result != null) return result; } return type$.JavaScriptIndexingBehavior_dynamic._is(object); }, S: function(value) { var res; if (typeof value == "string") return value; if (typeof value == "number") { if (value !== 0) return "" + value; } else if (true === value) return "true"; else if (false === value) return "false"; else if (value == null) return "null"; res = J.toString$0$(value); if (typeof res != "string") throw H.wrapException(H.argumentErrorValue(value)); return res; }, Primitives_objectHashCode: function(object) { var hash = object.$identityHash; if (hash == null) { hash = Math.random() * 0x3fffffff | 0; object.$identityHash = hash; } return hash; }, Primitives_parseInt: function(source, radix) { var match, decimalMatch, maxCharCode, digitsPart, t1, i, _null = null; if (typeof source != "string") H.throwExpression(H.argumentErrorValue(source)); match = /^\s*[+-]?((0x[a-f0-9]+)|(\d+)|([a-z0-9]+))\s*$/i.exec(source); if (match == null) return _null; decimalMatch = match[3]; if (radix == null) { if (decimalMatch != null) return parseInt(source, 10); if (match[2] != null) return parseInt(source, 16); return _null; } if (radix < 2 || radix > 36) throw H.wrapException(P.RangeError$range(radix, 2, 36, "radix", _null)); if (radix === 10 && decimalMatch != null) return parseInt(source, 10); if (radix < 10 || decimalMatch == null) { maxCharCode = radix <= 10 ? 47 + radix : 86 + radix; digitsPart = match[1]; for (t1 = digitsPart.length, i = 0; i < t1; ++i) if ((C.JSString_methods._codeUnitAt$1(digitsPart, i) | 32) > maxCharCode) return _null; } return parseInt(source, radix); }, Primitives_parseDouble: function(source) { var result, trimmed; if (!/^\s*[+-]?(?:Infinity|NaN|(?:\.\d+|\d+(?:\.\d*)?)(?:[eE][+-]?\d+)?)\s*$/.test(source)) return null; result = parseFloat(source); if (isNaN(result)) { trimmed = C.JSString_methods.trim$0(source); if (trimmed === "NaN" || trimmed === "+NaN" || trimmed === "-NaN") return result; return null; } return result; }, Primitives_objectTypeName: function(object) { var t1 = H.Primitives__objectTypeNameNewRti(object); return t1; }, Primitives__objectTypeNameNewRti: function(object) { var dispatchName, $constructor, constructorName; if (object instanceof P.Object) return H._rtiToString(H.instanceType(object), null); if (J.getInterceptor$(object) === C.Interceptor_methods || type$.UnknownJavaScriptObject._is(object)) { dispatchName = C.C_JS_CONST(object); if (H.Primitives__saneNativeClassName(dispatchName)) return dispatchName; $constructor = object.constructor; if (typeof $constructor == "function") { constructorName = $constructor.name; if (typeof constructorName == "string" && H.Primitives__saneNativeClassName(constructorName)) return constructorName; } } return H._rtiToString(H.instanceType(object), null); }, Primitives__saneNativeClassName: function($name) { var t1 = $name !== "Object" && $name !== ""; return t1; }, Primitives_currentUri: function() { if (!!self.location) return self.location.href; return null; }, Primitives__fromCharCodeApply: function(array) { var result, i, i0, chunkEnd, end = J.get$length$asx(array); if (end <= 500) return String.fromCharCode.apply(null, array); for (result = "", i = 0; i < end; i = i0) { i0 = i + 500; chunkEnd = i0 < end ? i0 : end; result += String.fromCharCode.apply(null, array.slice(i, chunkEnd)); } return result; }, Primitives_stringFromCodePoints: function(codePoints) { var t1, i, a = H.setRuntimeTypeInfo([], type$.JSArray_int); for (t1 = J.get$iterator$ax(codePoints); t1.moveNext$0();) { i = t1.get$current(t1); if (!H._isInt(i)) throw H.wrapException(H.argumentErrorValue(i)); if (i <= 65535) a.push(i); else if (i <= 1114111) { a.push(55296 + (C.JSInt_methods._shrOtherPositive$1(i - 65536, 10) & 1023)); a.push(56320 + (i & 1023)); } else throw H.wrapException(H.argumentErrorValue(i)); } return H.Primitives__fromCharCodeApply(a); }, Primitives_stringFromCharCodes: function(charCodes) { var t1, i; for (t1 = J.get$iterator$ax(charCodes); t1.moveNext$0();) { i = t1.get$current(t1); if (!H._isInt(i)) throw H.wrapException(H.argumentErrorValue(i)); if (i < 0) throw H.wrapException(H.argumentErrorValue(i)); if (i > 65535) return H.Primitives_stringFromCodePoints(charCodes); } return H.Primitives__fromCharCodeApply(charCodes); }, Primitives_stringFromNativeUint8List: function(charCodes, start, end) { var i, result, i0, chunkEnd; if (end <= 500 && start === 0 && end === charCodes.length) return String.fromCharCode.apply(null, charCodes); for (i = start, result = ""; i < end; i = i0) { i0 = i + 500; chunkEnd = i0 < end ? i0 : end; result += String.fromCharCode.apply(null, charCodes.subarray(i, chunkEnd)); } return result; }, Primitives_stringFromCharCode: function(charCode) { var bits; if (0 <= charCode) { if (charCode <= 65535) return String.fromCharCode(charCode); if (charCode <= 1114111) { bits = charCode - 65536; return String.fromCharCode((55296 | C.JSInt_methods._shrOtherPositive$1(bits, 10)) >>> 0, 56320 | bits & 1023); } } throw H.wrapException(P.RangeError$range(charCode, 0, 1114111, null, null)); }, Primitives_lazyAsJsDate: function(receiver) { if (receiver.date === void 0) receiver.date = new Date(receiver._core$_value); return receiver.date; }, Primitives_getYear: function(receiver) { var t1 = H.Primitives_lazyAsJsDate(receiver).getFullYear() + 0; return t1; }, Primitives_getMonth: function(receiver) { var t1 = H.Primitives_lazyAsJsDate(receiver).getMonth() + 1; return t1; }, Primitives_getDay: function(receiver) { var t1 = H.Primitives_lazyAsJsDate(receiver).getDate() + 0; return t1; }, Primitives_getHours: function(receiver) { var t1 = H.Primitives_lazyAsJsDate(receiver).getHours() + 0; return t1; }, Primitives_getMinutes: function(receiver) { var t1 = H.Primitives_lazyAsJsDate(receiver).getMinutes() + 0; return t1; }, Primitives_getSeconds: function(receiver) { var t1 = H.Primitives_lazyAsJsDate(receiver).getSeconds() + 0; return t1; }, Primitives_getMilliseconds: function(receiver) { var t1 = H.Primitives_lazyAsJsDate(receiver).getMilliseconds() + 0; return t1; }, Primitives_functionNoSuchMethod: function($function, positionalArguments, namedArguments) { var $arguments, namedArgumentList, t1 = {}; t1.argumentCount = 0; $arguments = []; namedArgumentList = []; t1.argumentCount = positionalArguments.length; C.JSArray_methods.addAll$1($arguments, positionalArguments); t1.names = ""; if (namedArguments != null && !namedArguments.get$isEmpty(namedArguments)) namedArguments.forEach$1(0, new H.Primitives_functionNoSuchMethod_closure(t1, namedArgumentList, $arguments)); "" + t1.argumentCount; return J.noSuchMethod$1$($function, new H.JSInvocationMirror(C.Symbol_call, 0, $arguments, namedArgumentList, 0)); }, Primitives_applyFunction: function($function, positionalArguments, namedArguments) { var t1, $arguments, argumentCount, jsStub; if (positionalArguments instanceof Array) t1 = namedArguments == null || namedArguments.get$isEmpty(namedArguments); else t1 = false; if (t1) { $arguments = positionalArguments; argumentCount = $arguments.length; if (argumentCount === 0) { if (!!$function.call$0) return $function.call$0(); } else if (argumentCount === 1) { if (!!$function.call$1) return $function.call$1($arguments[0]); } else if (argumentCount === 2) { if (!!$function.call$2) return $function.call$2($arguments[0], $arguments[1]); } else if (argumentCount === 3) { if (!!$function.call$3) return $function.call$3($arguments[0], $arguments[1], $arguments[2]); } else if (argumentCount === 4) { if (!!$function.call$4) return $function.call$4($arguments[0], $arguments[1], $arguments[2], $arguments[3]); } else if (argumentCount === 5) if (!!$function.call$5) return $function.call$5($arguments[0], $arguments[1], $arguments[2], $arguments[3], $arguments[4]); jsStub = $function["call" + "$" + argumentCount]; if (jsStub != null) return jsStub.apply($function, $arguments); } return H.Primitives__genericApplyFunction2($function, positionalArguments, namedArguments); }, Primitives__genericApplyFunction2: function($function, positionalArguments, namedArguments) { var $arguments, argumentCount, requiredParameterCount, defaultValuesClosure, t1, defaultValues, interceptor, jsFunction, keys, _i, used, t2; if (positionalArguments != null) $arguments = positionalArguments instanceof Array ? positionalArguments : P.List_List$from(positionalArguments, true, type$.dynamic); else $arguments = []; argumentCount = $arguments.length; requiredParameterCount = $function.$requiredArgCount; if (argumentCount < requiredParameterCount) return H.Primitives_functionNoSuchMethod($function, $arguments, namedArguments); defaultValuesClosure = $function.$defaultValues; t1 = defaultValuesClosure == null; defaultValues = !t1 ? defaultValuesClosure() : null; interceptor = J.getInterceptor$($function); jsFunction = interceptor["call*"]; if (typeof jsFunction == "string") jsFunction = interceptor[jsFunction]; if (t1) { if (namedArguments != null && namedArguments.get$isNotEmpty(namedArguments)) return H.Primitives_functionNoSuchMethod($function, $arguments, namedArguments); if (argumentCount === requiredParameterCount) return jsFunction.apply($function, $arguments); return H.Primitives_functionNoSuchMethod($function, $arguments, namedArguments); } if (defaultValues instanceof Array) { if (namedArguments != null && namedArguments.get$isNotEmpty(namedArguments)) return H.Primitives_functionNoSuchMethod($function, $arguments, namedArguments); if (argumentCount > requiredParameterCount + defaultValues.length) return H.Primitives_functionNoSuchMethod($function, $arguments, null); C.JSArray_methods.addAll$1($arguments, defaultValues.slice(argumentCount - requiredParameterCount)); return jsFunction.apply($function, $arguments); } else { if (argumentCount > requiredParameterCount) return H.Primitives_functionNoSuchMethod($function, $arguments, namedArguments); keys = Object.keys(defaultValues); if (namedArguments == null) for (t1 = keys.length, _i = 0; _i < keys.length; keys.length === t1 || (0, H.throwConcurrentModificationError)(keys), ++_i) C.JSArray_methods.add$1($arguments, defaultValues[keys[_i]]); else { for (t1 = keys.length, used = 0, _i = 0; _i < keys.length; keys.length === t1 || (0, H.throwConcurrentModificationError)(keys), ++_i) { t2 = keys[_i]; if (namedArguments.containsKey$1(t2)) { ++used; C.JSArray_methods.add$1($arguments, namedArguments.$index(0, t2)); } else C.JSArray_methods.add$1($arguments, defaultValues[t2]); } if (used !== namedArguments.get$length(namedArguments)) return H.Primitives_functionNoSuchMethod($function, $arguments, namedArguments); } return jsFunction.apply($function, $arguments); } }, diagnoseIndexError: function(indexable, index) { var $length, _s5_ = "index"; if (!H._isInt(index)) return new P.ArgumentError(true, index, _s5_, null); $length = J.get$length$asx(indexable); if (index < 0 || index >= $length) return P.IndexError$(index, indexable, _s5_, null, $length); return P.RangeError$value(index, _s5_, null); }, diagnoseRangeError: function(start, end, $length) { var _s13_ = "Invalid value"; if (start < 0 || start > $length) return new P.RangeError(0, $length, true, start, "start", _s13_); if (end != null) if (end < start || end > $length) return new P.RangeError(start, $length, true, end, "end", _s13_); return new P.ArgumentError(true, end, "end", null); }, argumentErrorValue: function(object) { return new P.ArgumentError(true, object, null, null); }, checkNum: function(value) { if (typeof value != "number") throw H.wrapException(H.argumentErrorValue(value)); return value; }, wrapException: function(ex) { var wrapper; if (ex == null) ex = new P.NullThrownError(); wrapper = new Error(); wrapper.dartException = ex; if ("defineProperty" in Object) { Object.defineProperty(wrapper, "message", {get: H.toStringWrapper}); wrapper.name = ""; } else wrapper.toString = H.toStringWrapper; return wrapper; }, toStringWrapper: function() { return J.toString$0$(this.dartException); }, throwExpression: function(ex) { throw H.wrapException(ex); }, throwConcurrentModificationError: function(collection) { throw H.wrapException(P.ConcurrentModificationError$(collection)); }, TypeErrorDecoder_extractPattern: function(message) { var match, $arguments, argumentsExpr, expr, method, receiver; message = H.quoteStringForRegExp(message.replace(String({}), '$receiver$')); match = message.match(/\\\$[a-zA-Z]+\\\$/g); if (match == null) match = H.setRuntimeTypeInfo([], type$.JSArray_String); $arguments = match.indexOf("\\$arguments\\$"); argumentsExpr = match.indexOf("\\$argumentsExpr\\$"); expr = match.indexOf("\\$expr\\$"); method = match.indexOf("\\$method\\$"); receiver = match.indexOf("\\$receiver\\$"); return new H.TypeErrorDecoder(message.replace(new RegExp('\\\\\\$arguments\\\\\\$', 'g'), '((?:x|[^x])*)').replace(new RegExp('\\\\\\$argumentsExpr\\\\\\$', 'g'), '((?:x|[^x])*)').replace(new RegExp('\\\\\\$expr\\\\\\$', 'g'), '((?:x|[^x])*)').replace(new RegExp('\\\\\\$method\\\\\\$', 'g'), '((?:x|[^x])*)').replace(new RegExp('\\\\\\$receiver\\\\\\$', 'g'), '((?:x|[^x])*)'), $arguments, argumentsExpr, expr, method, receiver); }, TypeErrorDecoder_provokeCallErrorOn: function(expression) { return function($expr$) { var $argumentsExpr$ = '$arguments$'; try { $expr$.$method$($argumentsExpr$); } catch (e) { return e.message; } }(expression); }, TypeErrorDecoder_provokePropertyErrorOn: function(expression) { return function($expr$) { try { $expr$.$method$; } catch (e) { return e.message; } }(expression); }, NullError$: function(_message, match) { return new H.NullError(_message, match == null ? null : match.method); }, JsNoSuchMethodError$: function(_message, match) { var t1 = match == null, t2 = t1 ? null : match.method; return new H.JsNoSuchMethodError(_message, t2, t1 ? null : match.receiver); }, unwrapException: function(ex) { var message, number, ieErrorCode, nsme, notClosure, nullCall, nullLiteralCall, undefCall, undefLiteralCall, nullProperty, undefProperty, undefLiteralProperty, match, t2, _null = null, t1 = new H.unwrapException_saveStackTrace(ex); if (ex == null) return _null; if (ex instanceof H.ExceptionAndStackTrace) return t1.call$1(ex.dartException); if (typeof ex !== "object") return ex; if ("dartException" in ex) return t1.call$1(ex.dartException); else if (!("message" in ex)) return ex; message = ex.message; if ("number" in ex && typeof ex.number == "number") { number = ex.number; ieErrorCode = number & 65535; if ((C.JSInt_methods._shrOtherPositive$1(number, 16) & 8191) === 10) switch (ieErrorCode) { case 438: return t1.call$1(H.JsNoSuchMethodError$(H.S(message) + " (Error " + ieErrorCode + ")", _null)); case 445: case 5007: return t1.call$1(H.NullError$(H.S(message) + " (Error " + ieErrorCode + ")", _null)); } } if (ex instanceof TypeError) { nsme = $.$get$TypeErrorDecoder_noSuchMethodPattern(); notClosure = $.$get$TypeErrorDecoder_notClosurePattern(); nullCall = $.$get$TypeErrorDecoder_nullCallPattern(); nullLiteralCall = $.$get$TypeErrorDecoder_nullLiteralCallPattern(); undefCall = $.$get$TypeErrorDecoder_undefinedCallPattern(); undefLiteralCall = $.$get$TypeErrorDecoder_undefinedLiteralCallPattern(); nullProperty = $.$get$TypeErrorDecoder_nullPropertyPattern(); $.$get$TypeErrorDecoder_nullLiteralPropertyPattern(); undefProperty = $.$get$TypeErrorDecoder_undefinedPropertyPattern(); undefLiteralProperty = $.$get$TypeErrorDecoder_undefinedLiteralPropertyPattern(); match = nsme.matchTypeError$1(message); if (match != null) return t1.call$1(H.JsNoSuchMethodError$(message, match)); else { match = notClosure.matchTypeError$1(message); if (match != null) { match.method = "call"; return t1.call$1(H.JsNoSuchMethodError$(message, match)); } else { match = nullCall.matchTypeError$1(message); if (match == null) { match = nullLiteralCall.matchTypeError$1(message); if (match == null) { match = undefCall.matchTypeError$1(message); if (match == null) { match = undefLiteralCall.matchTypeError$1(message); if (match == null) { match = nullProperty.matchTypeError$1(message); if (match == null) { match = nullLiteralCall.matchTypeError$1(message); if (match == null) { match = undefProperty.matc