UNPKG

@devexpress/utils

Version:
1,147 lines (1,090 loc) 322 kB
/*! * DevExpress Utils (dx.utils) * Version: 1.4.3 * Build date: Wed Apr 03 2024 * * Copyright (c) 2012 - 2024 Developer Express Inc. ALL RIGHTS RESERVED * Read about DevExpress licensing here: https://www.devexpress.com/Support/EULAs */ var DevExpress = typeof DevExpress === "object" ? DevExpress : {}; DevExpress["WebUtils"] = /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 41); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Browser = void 0; var Browser = (function () { function Browser() { } Browser.IdentUserAgent = function (userAgent, ignoreDocumentMode) { if (ignoreDocumentMode === void 0) { ignoreDocumentMode = false; } var browserTypesOrderedList = ['Mozilla', 'IE', 'Firefox', 'Netscape', 'Safari', 'Chrome', 'Opera', 'Opera10', 'Edge']; var defaultBrowserType = 'IE'; var defaultPlatform = 'Win'; var defaultVersions = { Safari: 2, Chrome: 0.1, Mozilla: 1.9, Netscape: 8, Firefox: 2, Opera: 9, IE: 6, Edge: 12 }; if (!userAgent || userAgent.length === 0) { Browser.fillUserAgentInfo(browserTypesOrderedList, defaultBrowserType, defaultVersions[defaultBrowserType], defaultPlatform); return; } userAgent = userAgent.toLowerCase(); Browser.indentPlatformMajorVersion(userAgent); try { var platformIdentStrings = { 'Windows': 'Win', 'Macintosh': 'Mac', 'Mac OS': 'Mac', 'Mac_PowerPC': 'Mac', 'cpu os': 'MacMobile', 'cpu iphone os': 'MacMobile', 'Android': 'Android', '!Windows Phone': 'WinPhone', '!WPDesktop': 'WinPhone', '!ZuneWP': 'WinPhone' }; var optSlashOrSpace = '(?:/|\\s*)?'; var versionString = '(\\d+)(?:\\.((?:\\d+?[1-9])|\\d)0*?)?'; var optVersion = '(?:' + versionString + ')?'; var patterns = { Safari: 'applewebkit(?:.*?(?:version/' + versionString + '[\\.\\w\\d]*?(?:\\s+mobile/\\S*)?\\s+safari))?', Chrome: '(?:chrome|crios)(?!frame)' + optSlashOrSpace + optVersion, Mozilla: 'mozilla(?:.*rv:' + optVersion + '.*Gecko)?', Netscape: '(?:netscape|navigator)\\d*/?\\s*' + optVersion, Firefox: 'firefox' + optSlashOrSpace + optVersion, Opera: '(?:opera|\\sopr)' + optSlashOrSpace + optVersion, Opera10: 'opera.*\\s*version' + optSlashOrSpace + optVersion, IE: 'msie\\s*' + optVersion, Edge: 'edge' + optSlashOrSpace + optVersion }; var browserType = null; var version = -1; for (var i = 0; i < browserTypesOrderedList.length; i++) { var browserTypeCandidate = browserTypesOrderedList[i]; var regExp = new RegExp(patterns[browserTypeCandidate], 'i'); var matches = regExp.exec(userAgent); if (matches && matches.index >= 0) { if (browserType === 'IE' && version >= 11 && browserTypeCandidate === 'Safari') continue; browserType = browserTypeCandidate; if (browserType === 'Opera10') browserType = 'Opera'; var tridentPattern = 'trident' + optSlashOrSpace + optVersion; version = Browser.GetBrowserVersion(userAgent, matches, tridentPattern, Browser.getIECompatibleVersionString()); if (browserType === 'Mozilla' && version >= 11) browserType = 'IE'; } } if (!browserType) browserType = defaultBrowserType; var browserVersionDetected = version !== -1; if (!browserVersionDetected) version = defaultVersions[browserType]; var platform = null; var minOccurenceIndex = Number.MAX_VALUE; for (var identStr in platformIdentStrings) { if (!Object.prototype.hasOwnProperty.call(platformIdentStrings, identStr)) continue; var importantIdent = identStr.substr(0, 1) === '!'; var occurenceIndex = userAgent.indexOf((importantIdent ? identStr.substr(1) : identStr).toLowerCase()); if (occurenceIndex >= 0 && (occurenceIndex < minOccurenceIndex || importantIdent)) { minOccurenceIndex = importantIdent ? 0 : occurenceIndex; platform = platformIdentStrings[identStr]; } } var samsungPattern = 'SM-[A-Z]'; var m = userAgent.toUpperCase().match(samsungPattern); var isSamsungAndroidDevice = m && m.length > 0; if (platform === 'WinPhone' && version < 9) version = Math.floor(Browser.getVersionFromTrident(userAgent, 'trident' + optSlashOrSpace + optVersion)); if (!ignoreDocumentMode && browserType === 'IE' && version > 7 && document.documentMode < version) version = document.documentMode; if (platform === 'WinPhone') version = Math.max(9, version); if (!platform) platform = defaultPlatform; if (platform === platformIdentStrings['cpu os'] && !browserVersionDetected) version = 4; Browser.fillUserAgentInfo(browserTypesOrderedList, browserType, version, platform, isSamsungAndroidDevice); } catch (e) { Browser.fillUserAgentInfo(browserTypesOrderedList, defaultBrowserType, defaultVersions[defaultBrowserType], defaultPlatform); } }; Browser.GetBrowserVersion = function (userAgent, matches, tridentPattern, ieCompatibleVersionString) { var version = Browser.getVersionFromMatches(matches); if (ieCompatibleVersionString) { var versionFromTrident = Browser.getVersionFromTrident(userAgent, tridentPattern); if (ieCompatibleVersionString === 'edge' || parseInt(ieCompatibleVersionString) === versionFromTrident) return versionFromTrident; } return version; }; Browser.getIECompatibleVersionString = function () { if (document.compatible) { for (var i = 0; i < document.compatible.length; i++) { if (document.compatible[i].userAgent === 'IE' && document.compatible[i].version) return document.compatible[i].version.toLowerCase(); } } return ''; }; Browser.isTouchEnabled = function () { return Browser.hasTouchStart() || Browser.hasMaxTouchPoints() || Browser.hasMsMaxTouchPoints(); }; Browser.hasTouchStart = function () { return ('ontouchstart' in window); }; Browser.hasMaxTouchPoints = function () { return navigator['maxTouchPoints'] > 0; }; Browser.hasMsMaxTouchPoints = function () { return navigator['msMaxTouchPoints'] > 0; }; Browser.hasNavigator = function () { return typeof navigator !== 'undefined'; }; Browser.fillUserAgentInfo = function (browserTypesOrderedList, browserType, version, platform, isSamsungAndroidDevice) { if (isSamsungAndroidDevice === void 0) { isSamsungAndroidDevice = false; } for (var i = 0; i < browserTypesOrderedList.length; i++) { var type = browserTypesOrderedList[i]; Browser[type] = type === browserType; } Browser.Version = Math.floor(10.0 * version) / 10.0; Browser.MajorVersion = Math.floor(Browser.Version); Browser.WindowsPlatform = platform === 'Win' || platform === 'WinPhone'; Browser.MacOSMobilePlatform = platform === 'MacMobile' || (platform === 'Mac' && Browser.isTouchEnabled()); Browser.MacOSPlatform = platform === 'Mac' && !Browser.MacOSMobilePlatform; Browser.AndroidMobilePlatform = platform === 'Android'; Browser.WindowsPhonePlatform = platform === 'WinPhone'; Browser.WebKitFamily = Browser.Safari || Browser.Chrome || Browser.Opera && Browser.MajorVersion >= 15; Browser.NetscapeFamily = Browser.Netscape || Browser.Mozilla || Browser.Firefox; Browser.WebKitTouchUI = Browser.MacOSMobilePlatform || Browser.AndroidMobilePlatform; var isIETouchUI = Browser.IE && Browser.MajorVersion > 9 && Browser.WindowsPlatform && Browser.UserAgent.toLowerCase().indexOf('touch') >= 0; Browser.MSTouchUI = isIETouchUI || (Browser.Edge && !!window.navigator.maxTouchPoints); Browser.TouchUI = Browser.WebKitTouchUI || Browser.MSTouchUI; Browser.MobileUI = Browser.WebKitTouchUI || Browser.WindowsPhonePlatform; Browser.AndroidDefaultBrowser = Browser.AndroidMobilePlatform && !Browser.Chrome; Browser.AndroidChromeBrowser = Browser.AndroidMobilePlatform && Browser.Chrome; if (isSamsungAndroidDevice) Browser.SamsungAndroidDevice = isSamsungAndroidDevice; if (Browser.MSTouchUI) { var isARMArchitecture = Browser.UserAgent.toLowerCase().indexOf('arm;') > -1; Browser.VirtualKeyboardSupported = isARMArchitecture || Browser.WindowsPhonePlatform; } else Browser.VirtualKeyboardSupported = Browser.WebKitTouchUI; Browser.fillDocumentElementBrowserTypeClassNames(browserTypesOrderedList); }; Browser.indentPlatformMajorVersion = function (userAgent) { var regex = /(?:(?:windows nt|macintosh|mac os|cpu os|cpu iphone os|android|windows phone|linux) )(\d+)(?:[-0-9_.])*/; var matches = regex.exec(userAgent); if (matches) Browser.PlaformMajorVersion = matches[1]; }; Browser.getVersionFromMatches = function (matches) { var result = -1; var versionStr = ''; if (matches) { if (matches[1]) { versionStr += matches[1]; if (matches[2]) versionStr += '.' + matches[2]; } if (versionStr !== '') { result = parseFloat(versionStr); if (isNaN(result)) result = -1; } } return result; }; Browser.getVersionFromTrident = function (userAgent, tridentPattern) { var tridentDiffFromVersion = 4; var matches = new RegExp(tridentPattern, 'i').exec(userAgent); return Browser.getVersionFromMatches(matches) + tridentDiffFromVersion; }; Browser.fillDocumentElementBrowserTypeClassNames = function (browserTypesOrderedList) { var documentElementClassName = ''; var browserTypeslist = browserTypesOrderedList.concat(['WindowsPlatform', 'MacOSPlatform', 'MacOSMobilePlatform', 'AndroidMobilePlatform', 'WindowsPhonePlatform', 'WebKitFamily', 'WebKitTouchUI', 'MSTouchUI', 'TouchUI', 'AndroidDefaultBrowser']); for (var i = 0; i < browserTypeslist.length; i++) { var type = browserTypeslist[i]; if (Browser[type]) documentElementClassName += 'dx' + type + ' '; } documentElementClassName += 'dxBrowserVersion-' + Browser.MajorVersion; if (typeof document !== 'undefined' && document && document.documentElement) { if (document.documentElement.className !== '') documentElementClassName = ' ' + documentElementClassName; document.documentElement.className += documentElementClassName; Browser.Info = documentElementClassName; } }; Browser.getUserAgent = function () { return Browser.hasNavigator() && navigator.userAgent ? navigator.userAgent.toLowerCase() : ''; }; Browser.UserAgent = Browser.getUserAgent(); Browser._foo = Browser.IdentUserAgent(Browser.UserAgent); return Browser; }()); exports.Browser = Browser; /***/ }), /* 1 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__extends", function() { return __extends; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__assign", function() { return __assign; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__rest", function() { return __rest; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__decorate", function() { return __decorate; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__param", function() { return __param; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__metadata", function() { return __metadata; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__awaiter", function() { return __awaiter; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__generator", function() { return __generator; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__createBinding", function() { return __createBinding; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__exportStar", function() { return __exportStar; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__values", function() { return __values; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__read", function() { return __read; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spread", function() { return __spread; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spreadArrays", function() { return __spreadArrays; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spreadArray", function() { return __spreadArray; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__await", function() { return __await; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncGenerator", function() { return __asyncGenerator; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncDelegator", function() { return __asyncDelegator; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncValues", function() { return __asyncValues; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__makeTemplateObject", function() { return __makeTemplateObject; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__importStar", function() { return __importStar; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__importDefault", function() { return __importDefault; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__classPrivateFieldGet", function() { return __classPrivateFieldGet; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__classPrivateFieldSet", function() { return __classPrivateFieldSet; }); /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ /* global Reflect, Promise */ var extendStatics = function(d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; function __extends(d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); } var __assign = function() { __assign = Object.assign || function __assign(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; } return __assign.apply(this, arguments); } function __rest(s, e) { var t = {}; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; } return t; } function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; } function __param(paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } } function __metadata(metadataKey, metadataValue) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); } function __awaiter(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); } function __generator(thisArg, body) { var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; function verb(n) { return function (v) { return step([n, v]); }; } function step(op) { if (f) throw new TypeError("Generator is already executing."); while (_) try { if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; if (y = 0, t) op = [op[0] & 2, t.value]; switch (op[0]) { case 0: case 1: t = op; break; case 4: _.label++; return { value: op[1], done: false }; case 5: _.label++; y = op[1]; op = [0]; continue; case 7: op = _.ops.pop(); _.trys.pop(); continue; default: if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } if (t[2]) _.ops.pop(); _.trys.pop(); continue; } op = body.call(thisArg, _); } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; } } var __createBinding = Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; }); function __exportStar(m, o) { for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); } function __values(o) { var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; if (m) return m.call(o); if (o && typeof o.length === "number") return { next: function () { if (o && i >= o.length) o = void 0; return { value: o && o[i++], done: !o }; } }; throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); } function __read(o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; } /** @deprecated */ function __spread() { for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); return ar; } /** @deprecated */ function __spreadArrays() { for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j]; return r; } function __spreadArray(to, from, pack) { if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { if (ar || !(i in from)) { if (!ar) ar = Array.prototype.slice.call(from, 0, i); ar[i] = from[i]; } } return to.concat(ar || Array.prototype.slice.call(from)); } function __await(v) { return this instanceof __await ? (this.v = v, this) : new __await(v); } function __asyncGenerator(thisArg, _arguments, generator) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var g = generator.apply(thisArg, _arguments || []), i, q = []; return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } function fulfill(value) { resume("next", value); } function reject(value) { resume("throw", value); } function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } } function __asyncDelegator(o) { var i, p; return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } } function __asyncValues(o) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var m = o[Symbol.asyncIterator], i; return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } } function __makeTemplateObject(cooked, raw) { if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } return cooked; }; var __setModuleDefault = Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }; function __importStar(mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; } function __importDefault(mod) { return (mod && mod.__esModule) ? mod : { default: mod }; } function __classPrivateFieldGet(receiver, state, kind, f) { if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); } function __classPrivateFieldSet(receiver, state, value, kind, f) { if (kind === "m") throw new TypeError("Private method is not writable"); if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; } /***/ }), /* 2 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.numberToStringHex = exports.numberToStringBin = exports.isOdd = exports.isEven = exports.isNonNullString = exports.isString = exports.isNumber = exports.boolToString = exports.boolToInt = exports.isDefined = void 0; var string_1 = __webpack_require__(3); function isDefined(value) { return value !== undefined && value !== null; } exports.isDefined = isDefined; function boolToInt(value) { return value ? 1 : 0; } exports.boolToInt = boolToInt; function boolToString(value) { return value ? '1' : '0'; } exports.boolToString = boolToString; function isNumber(obj) { return typeof obj === 'number'; } exports.isNumber = isNumber; function isString(obj) { return typeof obj === 'string'; } exports.isString = isString; function isNonNullString(str) { return !!str; } exports.isNonNullString = isNonNullString; function isEven(num) { return (num % 2) !== 0; } exports.isEven = isEven; function isOdd(num) { return (num % 2) === 0; } exports.isOdd = isOdd; function numberToStringBin(num, minLength) { if (minLength === void 0) { minLength = 0; } return string_1.StringUtils.padLeft(num.toString(2), minLength, '0'); } exports.numberToStringBin = numberToStringBin; function numberToStringHex(num, minLength) { if (minLength === void 0) { minLength = 0; } return string_1.StringUtils.padLeft(num.toString(16), minLength, '0'); } exports.numberToStringHex = numberToStringHex; /***/ }), /* 3 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.StringUtils = void 0; var StringUtils = (function () { function StringUtils() { } StringUtils.isAlpha = function (ch) { return (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z'); }; StringUtils.isDigit = function (ch) { return ch >= '0' && ch <= '9'; }; StringUtils.stringHashCode = function (str) { var hash = 0; if (str.length === 0) return hash; var strLen = str.length; for (var i = 0; i < strLen; i++) { hash = ((hash << 5) - hash) + str.charCodeAt(i); hash |= 0; } return hash; }; StringUtils.endsAt = function (str, template) { var strInd = str.length - 1; var tmplInd = template.length - 1; var strStartInd = strInd - tmplInd; if (strStartInd < 0) return false; for (; strInd >= strStartInd; strInd--, tmplInd--) { if (str[strInd] !== template[tmplInd]) return false; } return true; }; StringUtils.startsAt = function (str, template) { return str.substr(0, template.length) === template; }; StringUtils.stringInLowerCase = function (str) { return str.toLowerCase() === str; }; StringUtils.stringInUpperCase = function (str) { return str.toUpperCase() === str; }; StringUtils.atLeastOneSymbolInUpperCase = function (str) { for (var i = 0, char = void 0; char = str[i]; i++) { if (StringUtils.stringInUpperCase(char) && !StringUtils.stringInLowerCase(char)) return true; } return false; }; StringUtils.getSymbolFromEnd = function (text, posFromEnd) { return text[text.length - posFromEnd]; }; StringUtils.trim = function (str, trimChars) { if (trimChars === undefined) return StringUtils.trimInternal(str, true, true); else { var joinedChars = trimChars.join(''); return str.replace(new RegExp("(^[" + joinedChars + "]*)|([" + joinedChars + "]*$)", 'g'), ''); } }; StringUtils.trimStart = function (str, trimChars) { if (trimChars === undefined) return StringUtils.trimInternal(str, true, false); else { var joinedChars = trimChars.join(''); return str.replace(new RegExp("^[" + joinedChars + "]*", 'g'), ''); } }; StringUtils.trimEnd = function (str, trimChars) { if (trimChars === undefined) return StringUtils.trimInternal(str, false, true); else { var joinedChars = trimChars.join(''); return str.replace(new RegExp("[" + joinedChars + "]*$", 'g'), ''); } }; StringUtils.getDecimalSeparator = function () { return (1.1).toLocaleString().substr(1, 1); }; StringUtils.repeat = function (str, count) { return new Array(count <= 0 ? 0 : count + 1).join(str); }; StringUtils.isNullOrEmpty = function (str) { return !str || !str.length; }; StringUtils.padLeft = function (str, totalWidth, paddingChar) { return StringUtils.repeat(paddingChar, Math.max(0, totalWidth - str.length)) + str; }; StringUtils.trimInternal = function (source, trimStart, trimEnd) { var len = source.length; if (!len) return source; if (len < 0xBABA1) { var result = source; if (trimStart) result = result.replace(/^\s+/, ''); if (trimEnd) result = result.replace(/\s+$/, ''); return result; } else { var start = 0; if (trimEnd) { while (len > 0 && /\s/.test(source[len - 1])) len--; } if (trimStart && len > 0) { while (start < len && /\s/.test(source[start])) start++; } return source.substring(start, len); } }; return StringUtils; }()); exports.StringUtils = StringUtils; /***/ }), /* 4 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Point = void 0; var Point = (function () { function Point(x, y) { this.x = x; this.y = y; } Point.zero = function () { return new Point(0, 0); }; Point.fromNumber = function (num) { return new Point(num, num); }; Point.prototype.isZero = function () { return this.x === 0 && this.y === 0; }; Point.prototype.toString = function () { return JSON.stringify(this); }; Point.prototype.copyFrom = function (obj) { this.x = obj.x; this.y = obj.y; }; Point.prototype.clone = function () { return new Point(this.x, this.y); }; Point.prototype.equals = function (obj) { return this.x === obj.x && this.y === obj.y; }; Point.prototype.offset = function (offsetX, offsetY) { this.x += offsetX; this.y += offsetY; return this; }; Point.prototype.offsetByPoint = function (offset) { this.x += offset.x; this.y += offset.y; return this; }; Point.prototype.multiply = function (multiplierX, multiplierY) { this.x *= multiplierX; this.y *= multiplierY; return this; }; Point.prototype.negative = function () { this.x *= -1; this.y *= -1; return this; }; Point.prototype.applyConverter = function (converter) { this.x = converter(this.x); this.y = converter(this.y); return this; }; Point.plus = function (a, b) { return new Point(a.x + b.x, a.y + b.y); }; Point.minus = function (a, b) { return new Point(a.x - b.x, a.y - b.y); }; Point.xComparer = function (a, b) { return a.x - b.x; }; Point.yComparer = function (a, b) { return a.y - b.y; }; Point.equals = function (a, b) { return a.x === b.x && a.y === b.y; }; return Point; }()); exports.Point = Point; /***/ }), /* 5 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ExtendedMinMax = exports.ExtendedMax = exports.ExtendedMin = exports.MinMaxNumber = exports.MinMax = void 0; var tslib_1 = __webpack_require__(1); var MinMax = (function () { function MinMax(minElement, maxElement) { this.minElement = minElement; this.maxElement = maxElement; } return MinMax; }()); exports.MinMax = MinMax; var MinMaxNumber = (function (_super) { tslib_1.__extends(MinMaxNumber, _super); function MinMaxNumber() { return _super !== null && _super.apply(this, arguments) || this; } Object.defineProperty(MinMaxNumber.prototype, "length", { get: function () { return this.maxElement - this.minElement; }, enumerable: false, configurable: true }); return MinMaxNumber; }(MinMax)); exports.MinMaxNumber = MinMaxNumber; var ExtendedMin = (function () { function ExtendedMin(minElement, minValue) { this.minElement = minElement; this.minValue = minValue; } return ExtendedMin; }()); exports.ExtendedMin = ExtendedMin; var ExtendedMax = (function () { function ExtendedMax(maxElement, maxValue) { this.maxElement = maxElement; this.maxValue = maxValue; } return ExtendedMax; }()); exports.ExtendedMax = ExtendedMax; var ExtendedMinMax = (function (_super) { tslib_1.__extends(ExtendedMinMax, _super); function ExtendedMinMax(minElement, minValue, maxElement, maxValue) { var _this = _super.call(this, minElement, maxElement) || this; _this.minValue = minValue; _this.maxValue = maxValue; return _this; } return ExtendedMinMax; }(MinMax)); exports.ExtendedMinMax = ExtendedMinMax; /***/ }), /* 6 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MathUtils = void 0; var list_1 = __webpack_require__(7); var MathUtils = (function () { function MathUtils() { } MathUtils.round = function (value, digits) { if (digits === void 0) { digits = 0; } var factor = MathUtils.powFactor[digits]; return Math.round(value * factor) / factor; }; MathUtils.numberCloseTo = function (num, to, accuracy) { if (accuracy === void 0) { accuracy = 0.00001; } return Math.abs(num - to) < accuracy; }; MathUtils.restrictValue = function (val, minVal, maxVal) { if (maxVal < minVal) maxVal = minVal; if (val > maxVal) return maxVal; else if (val < minVal) return minVal; return val; }; MathUtils.getRandomInt = function (min, max) { return Math.floor(Math.random() * (max - min + 1)) + min; }; MathUtils.generateGuid = function () { return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { var r = Math.random() * 16 | 0; var v = c === 'x' ? r : (r & 0x3 | 0x8); return v.toString(16); }); }; MathUtils.powFactor = list_1.ListUtils.initByCallback(20, function (ind) { return Math.pow(10, ind); }); MathUtils.somePrimes = [1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291, 1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, 1597, 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889, 1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, 1999, 2003]; return MathUtils; }()); exports.MathUtils = MathUtils; /***/ }), /* 7 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ListUtils = void 0; var min_max_1 = __webpack_require__(5); var comparers_1 = __webpack_require__(26); var ListUtils = (function () { function ListUtils() { } ListUtils.remove = function (list, element) { var index = list.indexOf(element, 0); if (index >= 0) list.splice(index, 1); }; ListUtils.removeBy = function (list, callback) { var len = list.length; for (var index = 0; index < len; index++) { if (callback(list[index], index)) return list.splice(index, 1)[0]; } return null; }; ListUtils.shallowCopy = function (list) { return list.slice(); }; ListUtils.deepCopy = function (list) { return ListUtils.map(list, function (val) { return val.clone(); }); }; ListUtils.initByValue = function (numElements, initValue) { var result = []; for (; numElements > 0; numElements--) result.push(initValue); return result; }; ListUtils.initByCallback = function (numElements, initCallback) { var result = []; for (var index = 0; index < numElements; index++) result.push(initCallback(index)); return result; }; ListUtils.forEachOnInterval = function (interval, callback) { var end = interval.end; for (var index = interval.start; index < end; index++) callback(index); }; ListUtils.reverseForEachOnInterval = function (interval, callback) { var start = interval.start; for (var index = interval.end - 1; index >= start; index--) callback(index); }; ListUtils.reducedMap = function (list, callback, startIndex, endIndex) { if (startIndex === void 0) { startIndex = 0; } if (endIndex === void 0) { endIndex = list.length; } var result = []; for (var index = startIndex; index < endIndex; index++) { var newItem = callback(list[index], index); if (newItem !== null) result.push(newItem); } return result; }; ListUtils.filter = function (list, callback, startIndex, endIndex) { if (startIndex === void 0) { startIndex = 0; } if (endIndex === void 0) { endIndex = list.length; } var result = []; for (var index = startIndex; index < endIndex; index++) { var item = list[index]; if (callback(item, index)) result.push(item); } return result; }; ListUtils.map = function (list, callback, startIndex, endIndex) { if (startIndex === void 0) { startIndex = 0; } if (endIndex === void 0) { endIndex = list.length; } var result = []; for (var index = startIndex; index < endIndex; index++) result.push(callback(list[index], index)); return result; }; ListUtils.indexBy = function (list, callback, startIndex, endIndex) { if (startIndex === void 0) { startIndex = 0; } if (endIndex === void 0) { endIndex = list.length; } for (var ind = startIndex; ind < endIndex; ind++) { if (callback(list[ind], ind)) return ind; } return -1; }; ListUtils.reverseIndexBy = function (list, callback, startIndex, endIndex) { if (startIndex === void 0) { startIndex = list.length - 1; } if (endIndex === void 0) { endIndex = 0; } for (var ind = startIndex; ind >= endIndex; ind--) { if (callback(list[ind], ind)) return ind; } return -1; }; ListUtils.elementBy = function (list, callback, startIndex, endIndex) { if (startIndex === void 0) { startIndex = 0; } if (endIndex === void 0) { endIndex = list.length; } var ind = ListUtils.indexBy(list, callback, startIndex, endIndex); return ind < 0 ? null : list[ind]; }; ListUtils.reverseElementBy = function (list, callback, startIndex, endIndex) { if (startIndex === void 0) { startIndex = list.length - 1; } if (endIndex === void 0) { endIndex = 0; } var ind = ListUtils.reverseIndexBy(list, callback, startIndex, endIndex); return ind < 0 ? null : list[ind]; }; ListUtils.last = function (list) { return list[list.length - 1]; }; ListUtils.setLast = function (list, newVal) { return list[list.length - 1] = newVal; }; ListUtils.incLast = function (list) { return ++list[list.length - 1]; }; ListUtils.decLast = function (list) { return --list[list.length - 1]; }; ListUtils.equals = function (a, b) { return a.length === b.length && ListUtils.allOf2(a, b, function (a, b) { return a.equals(b); }); }; ListUtils.equalsByReference = function (a, b) { var aLen = a.length; var bLen = a.length; if (aLen !== bLen) return false; for (var i = 0; i < aLen; i++) { if (a[i] !== b[i]) return false; } return true; }; ListUtils.unique = function (list, cmp, equal, finalizeObj) { if (equal === void 0) { equal = cmp; } if (finalizeObj === void 0) { finalizeObj = function () { }; } var len = list.length; if (len === 0) return []; list = list.sort(cmp); var prevValue = list[0]; var result = ListUtils.reducedMap(list, function (v) { if (equal(prevValue, v) !== 0) { prevValue = v; return v; } finalizeObj(v); return null; }, 1, len); result.unshift(list[0]); return result; }; ListUtils.uniqueNumber = function (list) { list = list.sort(comparers_1.Comparers.number); var prevValue = Number.NaN; for (var i = list.length - 1; i >= 0; i--) { if (prevValue === list[i]) list.splice(i, 1); else prevValue = list[i]; } return list; }; ListUtils.forEach = function (list, callback, startIndex, endIndex) { if (startIndex === void 0) { startIndex = 0; } if (endIndex === void 0) { endIndex = list.length; } for (var index = startIndex; index < endIndex; index++) callback(list[index], index); }; ListUtils.forE