@social-mail/social-mail-client 1.2.466 → 1.2.468

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1975,209 +1975,8 @@ const UMD = new UMDClass();
1975
1975
  //# sourceMappingURL=umd.js.map
1976
1976
 
1977
1977
  AmdLoader.instance.register(
1978
- ["@social-mail/social-mail-client","@web-atoms/data-styles","@web-atoms/core","reflect-metadata","@web-atoms/web-controls","@web-atoms/date-time"],
1979
- ["@social-mail/social-mail-client/dist/public/preview/pdf/PreviewPDF","@web-atoms/data-styles/data-styles","@web-atoms/core/dist/core/XNode","@web-atoms/core/dist/core/Bind","@web-atoms/core/dist/core/ExpressionParser","@web-atoms/core/dist/core/types","reflect-metadata","@web-atoms/core/dist/core/AtomMap","@web-atoms/core/dist/style/styled","@web-atoms/core/dist/App","@web-atoms/core/dist/core/AtomBinder","@web-atoms/core/dist/core/AtomDispatcher","@web-atoms/core/dist/di/RegisterSingleton","@web-atoms/core/dist/di/Register","@web-atoms/core/dist/di/ServiceCollection","@web-atoms/core/dist/di/TypeKey","@web-atoms/core/dist/di/ServiceProvider","@web-atoms/core/dist/core/TransientDisposable","@web-atoms/core/dist/di/Inject","@web-atoms/core/dist/services/BusyIndicatorService","@web-atoms/web-controls/dist/basic/Form","@web-atoms/core/dist/core/StringHelper","@web-atoms/web-controls/dist/basic/FormField","@web-atoms/core/dist/core/FormattedString","@web-atoms/core/dist/services/NavigationService","@web-atoms/core/dist/core/AtomComponent","@web-atoms/core/dist/core/AtomDisposableList","@web-atoms/core/dist/core/AtomWatcher","@web-atoms/core/dist/core/Hacks","@web-atoms/core/dist/web/core/AtomUI","@web-atoms/core/dist/core/InheritedProperty","@web-atoms/core/dist/core/PropertyMap","@web-atoms/core/dist/core/AtomUri","@web-atoms/core/dist/services/ReferenceService","@web-atoms/core/dist/di/DISingleton","@web-atoms/core/dist/web/services/PopupService","@web-atoms/core/dist/web/controls/AtomControl","@web-atoms/core/dist/core/BindableProperty","@web-atoms/core/dist/core/Command","@web-atoms/core/dist/core/EventScope","@web-atoms/date-time/dist/DateTime","@web-atoms/date-time/dist/TimeSpan","@web-atoms/core/dist/core/Route","@web-atoms/core/dist/core/WebImage","@web-atoms/core/dist/web/styles/AtomStyle","@web-atoms/core/dist/web/styles/AtomStyleSheet","@web-atoms/core/dist/web/services/PopupWindow","@web-atoms/core/dist/core/sleep","@web-atoms/web-controls/dist/basic/styles/form-field-style","@web-atoms/web-controls/dist/basic/PasswordBox","@web-atoms/web-controls/dist/basic/styles/password-box-style","@social-mail/social-mail-client/dist/common/controls/buttons/IconButton","@social-mail/social-mail-client/dist/common/fileUrl","@social-mail/social-mail-client/dist/common/apiPath","@social-mail/social-mail-client/dist/common/Modules","@web-atoms/core/dist/Pack","@web-atoms/core/dist/web/WebApp","@web-atoms/core/dist/core/AtomOnce","@web-atoms/core/dist/web/services/WebBusyIndicatorService","@web-atoms/core/dist/web/styles/StyleBuilder","@web-atoms/core/dist/web/services/WindowService","@web-atoms/core/dist/Atom","@web-atoms/core/dist/core/AtomLoader","@web-atoms/core/dist/services/JsonService","@web-atoms/core/dist/core/FormattedError","@web-atoms/core/dist/view-model/AtomWindowViewModel","@web-atoms/core/dist/view-model/AtomViewModel","@web-atoms/core/dist/view-model/baseTypes","@web-atoms/core/dist/web/controls/AtomAlertWindow","@web-atoms/core/dist/web/styles/AtomAlertWindowStyle","@web-atoms/core/dist/core/Colors","@web-atoms/core/dist/web/styles/AtomWindowStyle","@web-atoms/core/src/web/images/close-button-hover.svg","@web-atoms/core/dist/web/controls/AtomWindow","@web-atoms/core/dist/web/controls/AtomTemplate","@web-atoms/core/dist/web/controls/AtomNotification","@web-atoms/core/dist/web/styles/AtomNotificationStyle","@web-atoms/core/dist/web/styles/AtomPopupStyle","@web-atoms/core/dist/web/services/NotificationPopup","@web-atoms/core/dist/web/styles/AtomTheme"]);
1980
-
1981
-
1982
- System.register([], function(_export, _context) {
1983
- return {
1984
- setters: [],
1985
- execute: function() {
1986
-
1987
- // this is because in web atoms loader
1988
- // root url may not be set when the module is registered
1989
- setTimeout(() => {
1990
-
1991
- const cssModule = _context.meta.resolve("./data-styles.css");
1992
- const cssURL = System.resolve(cssModule);
1993
-
1994
- const link = document.createElement("link");
1995
- link.id = "data-styles";
1996
- link.setAttribute("href", cssURL);
1997
- link.setAttribute("rel", "stylesheet");
1998
- link.setAttribute("as", "style");
1999
- link.setAttribute("crossorigin", "anonymous");
2000
- const head = document.head;
2001
- const firstElementChild = head.firstElementChild;
2002
- if (firstElementChild) {
2003
- head.insertBefore(link, firstElementChild);
2004
- } else {
2005
- head.appendChild(link);
2006
- }
2007
- }, 1);
2008
- }
2009
- };
2010
- });
2011
-
2012
-
2013
- AmdLoader.instance.setup("@web-atoms/data-styles/data-styles");
2014
-
2015
- System.register([], function (_export, _context) {
2016
- "use strict";
2017
-
2018
- var viewModelParseWatchCache, viewModelParseWatchCache2;
2019
- function trimRegEx(t, r) {
2020
- const m = r.exec(t);
2021
- if (m && m.length) {
2022
- return [true, t.substring(m[0].length).trim(), m[0]];
2023
- }
2024
- return [false, t, ""];
2025
- }
2026
- function extractTill(text, search, returnOriginal = false) {
2027
- const index = text.indexOf(search);
2028
- if (index <= 0) {
2029
- return returnOriginal ? text : "";
2030
- }
2031
- return text.substring(0, index);
2032
- }
2033
- function parsePath(f, parseThis) {
2034
- let str = f.toString().trim();
2035
- str = str.split("\n").filter(s => !/^\/\//.test(s.trim())).join("\n");
2036
- const key = (parseThis === undefined ? "un:" : parseThis ? "_this:" : "_noThis:") + str;
2037
- const px1 = viewModelParseWatchCache[key];
2038
- if (px1) {
2039
- return px1;
2040
- }
2041
- if (str.endsWith("}")) {
2042
- str = str.substr(0, str.length - 1);
2043
- }
2044
- const functionRegEx = /^\w+\s*\(/;
2045
- const lambdaRegEx = /^\(?(\w+)?(\s?\,\s?\w+)*\)?\s?\=\>/;
2046
- let arg = "";
2047
- const original = str;
2048
- let [success, remaining] = trimRegEx(str, functionRegEx);
2049
- if (success) {
2050
- str = remaining;
2051
- remaining = extractTill(remaining, ")");
2052
- str = str.substring(remaining.length);
2053
- arg = extractTill(remaining, ",", true);
2054
- } else {
2055
- [success, str, remaining] = trimRegEx(str, lambdaRegEx);
2056
- if (success) {
2057
- remaining = remaining.trim();
2058
- remaining = remaining.substring(0, remaining.length - 2);
2059
- remaining = extractTill(remaining, ")", true);
2060
- arg = extractTill(remaining, ",", true);
2061
- if (arg.startsWith("(")) {
2062
- arg = arg.substring(1);
2063
- }
2064
- } else {
2065
- if (parseThis !== undefined && parseThis === false) {
2066
- return [];
2067
- } else {
2068
- parseThis = true;
2069
- }
2070
- }
2071
- }
2072
- str = str.trim();
2073
- const isThis = parseThis === undefined ? (arg ? false : true) || parseThis : parseThis;
2074
- const p = (isThis ? "(\\_this|this)" : arg || "").trim();
2075
- if (p.length === 0) {
2076
- const empty = [];
2077
- viewModelParseWatchCache[key] = empty;
2078
- return empty;
2079
- }
2080
- const regExp = `(?:(\\b${p})(?:(\\.[a-zA-Z_][a-zA-Z_0-9]*)+)\\s?(?:(\\(|\\=\\=\\=|\\=\\=|\\=)?))`;
2081
- const re = new RegExp(regExp, "gi");
2082
- let path = [];
2083
- const ms = str.replace(re, m => {
2084
- let px = m;
2085
- if (px.startsWith("this.")) {
2086
- if (parseThis !== true) {
2087
- px = px.substr(5);
2088
- }
2089
- } else if (px.startsWith("_this.")) {
2090
- if (parseThis !== true) {
2091
- px = px.substr(6);
2092
- } else {
2093
- px = px.substr(1);
2094
- }
2095
- } else {
2096
- px = px.substr(p.length + 1);
2097
- }
2098
- px = px.split(".").filter(s => !s.endsWith("(")).join(".");
2099
- if (!path.find(y => y === px)) {
2100
- path.push(px);
2101
- }
2102
- const filtered = [];
2103
- for (const iterator of path) {
2104
- if (iterator.endsWith("==") || !(iterator.endsWith("(") || iterator.endsWith("="))) {
2105
- filtered.push((iterator.endsWith("===") ? iterator.substr(0, iterator.length - 3) : iterator.endsWith("==") ? iterator.substr(0, iterator.length - 2) : iterator).trim());
2106
- }
2107
- }
2108
- path = filtered.filter(px11 => {
2109
- const search = px11 + ".";
2110
- for (const iterator of filtered) {
2111
- if (px11 !== iterator && iterator.indexOf(search) !== -1) {
2112
- return false;
2113
- }
2114
- }
2115
- return true;
2116
- });
2117
- return m;
2118
- });
2119
- path = path.sort((a, b) => b.localeCompare(a));
2120
- const duplicates = path;
2121
- path = [];
2122
- for (const iterator of duplicates) {
2123
- if (path.find(px2 => px2 === iterator)) {
2124
- continue;
2125
- }
2126
- path.push(iterator);
2127
- }
2128
- const rp = [];
2129
- for (const rpItem of path) {
2130
- if (rp.find(x => x.startsWith(rpItem))) {
2131
- continue;
2132
- }
2133
- rp.push(rpItem);
2134
- }
2135
- const pl = path.filter(p1 => p1).map(p1 => p1.split("."));
2136
- viewModelParseWatchCache[key] = pl;
2137
- return pl;
2138
- }
2139
- function parsePathLists(f) {
2140
- const str = f.toString().trim();
2141
- const key = str;
2142
- const px1 = viewModelParseWatchCache2[key];
2143
- if (px1) {
2144
- return px1;
2145
- }
2146
- const pl = {
2147
- pathList: parsePath(str, false),
2148
- thisPath: parsePath(str, true),
2149
- combined: []
2150
- };
2151
- if (pl.thisPath.length && pl.pathList.length) {
2152
- pl.combined = pl.thisPath.map(x => {
2153
- x[0] = "t";
2154
- x.splice(0, 0, "this");
2155
- return x;
2156
- }).concat(pl.pathList.map(x => {
2157
- x.splice(0, 0, "this", "x");
2158
- return x;
2159
- }));
2160
- pl.thisPath = [];
2161
- pl.pathList = [];
2162
- }
2163
- viewModelParseWatchCache2[key] = pl;
2164
- return pl;
2165
- }
2166
- _export({
2167
- parsePath: parsePath,
2168
- parsePathLists: parsePathLists
2169
- });
2170
- return {
2171
- setters: [],
2172
- execute: function () {
2173
- viewModelParseWatchCache = {};
2174
- viewModelParseWatchCache2 = {};
2175
- }
2176
- };
2177
- });
2178
- //# sourceMappingURL=ExpressionParser.js.map
2179
-
2180
- AmdLoader.instance.setup("@web-atoms/core/dist/core/ExpressionParser");
1978
+ ["@social-mail/social-mail-client","@web-atoms/core","reflect-metadata","@web-atoms/data-styles","@web-atoms/web-controls","@web-atoms/date-time"],
1979
+ ["@social-mail/social-mail-client/dist/public/preview/pdf/PreviewPDF","@social-mail/social-mail-client/dist/style/GlobalStyle","@web-atoms/core/dist/core/types","reflect-metadata","@web-atoms/core/dist/core/AtomMap","@web-atoms/core/dist/core/AtomList","@web-atoms/core/dist/core/AtomBinder","@social-mail/social-mail-client/dist/style/OverrideAppStyle","@web-atoms/core/dist/style/styled","@web-atoms/data-styles/data-styles","@web-atoms/core/dist/core/XNode","@web-atoms/core/dist/core/Bind","@web-atoms/core/dist/core/ExpressionParser","@web-atoms/core/dist/App","@web-atoms/core/dist/core/AtomDispatcher","@web-atoms/core/dist/di/RegisterSingleton","@web-atoms/core/dist/di/Register","@web-atoms/core/dist/di/ServiceCollection","@web-atoms/core/dist/di/TypeKey","@web-atoms/core/dist/di/ServiceProvider","@web-atoms/core/dist/core/TransientDisposable","@web-atoms/core/dist/di/Inject","@web-atoms/core/dist/services/BusyIndicatorService","@web-atoms/web-controls/dist/basic/Form","@web-atoms/core/dist/core/StringHelper","@web-atoms/web-controls/dist/basic/FormField","@web-atoms/core/dist/core/FormattedString","@web-atoms/core/dist/services/NavigationService","@web-atoms/core/dist/core/AtomComponent","@web-atoms/core/dist/core/AtomDisposableList","@web-atoms/core/dist/core/AtomWatcher","@web-atoms/core/dist/core/Hacks","@web-atoms/core/dist/web/core/AtomUI","@web-atoms/core/dist/core/InheritedProperty","@web-atoms/core/dist/core/PropertyMap","@web-atoms/core/dist/core/AtomUri","@web-atoms/core/dist/services/ReferenceService","@web-atoms/core/dist/di/DISingleton","@web-atoms/core/dist/web/services/PopupService","@web-atoms/core/dist/web/controls/AtomControl","@web-atoms/core/dist/core/BindableProperty","@web-atoms/core/dist/core/Command","@web-atoms/core/dist/core/EventScope","@web-atoms/date-time/dist/DateTime","@web-atoms/date-time/dist/TimeSpan","@web-atoms/core/dist/core/Route","@web-atoms/core/dist/core/WebImage","@web-atoms/core/dist/web/styles/AtomStyle","@web-atoms/core/dist/web/styles/AtomStyleSheet","@web-atoms/core/dist/web/services/PopupWindow","@web-atoms/core/dist/core/sleep","@web-atoms/web-controls/dist/basic/styles/form-field-style","@web-atoms/web-controls/dist/basic/PasswordBox","@web-atoms/web-controls/dist/basic/styles/password-box-style","@social-mail/social-mail-client/dist/common/controls/buttons/IconButton","@social-mail/social-mail-client/dist/common/fileUrl","@social-mail/social-mail-client/dist/common/apiPath","@social-mail/social-mail-client/dist/common/Modules","@web-atoms/core/dist/Pack","@web-atoms/core/dist/web/WebApp","@web-atoms/core/dist/core/AtomOnce","@web-atoms/core/dist/web/services/WebBusyIndicatorService","@web-atoms/core/dist/web/styles/StyleBuilder","@web-atoms/core/dist/web/services/WindowService","@web-atoms/core/dist/Atom","@web-atoms/core/dist/core/AtomLoader","@web-atoms/core/dist/services/JsonService","@web-atoms/core/dist/core/FormattedError","@web-atoms/core/dist/view-model/AtomWindowViewModel","@web-atoms/core/dist/view-model/AtomViewModel","@web-atoms/core/dist/view-model/baseTypes","@web-atoms/core/dist/web/controls/AtomAlertWindow","@web-atoms/core/dist/web/styles/AtomAlertWindowStyle","@web-atoms/core/dist/core/Colors","@web-atoms/core/dist/web/styles/AtomWindowStyle","@web-atoms/core/src/web/images/close-button-hover.svg","@web-atoms/core/dist/web/controls/AtomWindow","@web-atoms/core/dist/web/controls/AtomTemplate","@web-atoms/core/dist/web/controls/AtomNotification","@web-atoms/core/dist/web/styles/AtomNotificationStyle","@web-atoms/core/dist/web/styles/AtomPopupStyle","@web-atoms/core/dist/web/services/NotificationPopup","@web-atoms/core/dist/web/styles/AtomTheme"]);
2181
1980
 
2182
1981
  /*! *****************************************************************************
2183
1982
  Copyright (C) Microsoft. All rights reserved.
@@ -3469,517 +3268,478 @@ System.register(["reflect-metadata", "./AtomMap"], function (_export, _context)
3469
3268
 
3470
3269
  AmdLoader.instance.setup("@web-atoms/core/dist/core/types");
3471
3270
 
3472
- System.register(["tslib", "./ExpressionParser", "./types"], function (_export, _context) {
3271
+ System.register(["./types"], function (_export, _context) {
3473
3272
  "use strict";
3474
3273
 
3475
- var __awaiter, parsePath, parsePathLists, CancelToken, ignoreValue, Bind, isEvent, bindSymbol;
3476
- function twoWaysConvert(name, b, control, e, creator) {
3477
- control.bind(e, name, b.thisPathList || b.pathList, b.eventList || true, null, b.thisPathList ? creator : undefined);
3478
- }
3479
- _export("default", void 0);
3274
+ var ArrayHelper, AtomBinder, symbolHandlers, symbolBindable;
3275
+ _export("AtomBinder", void 0);
3480
3276
  return {
3481
- setters: [function (_tslib) {
3482
- __awaiter = _tslib.__awaiter;
3483
- }, function (_ExpressionParser) {
3484
- parsePath = _ExpressionParser.parsePath;
3485
- parsePathLists = _ExpressionParser.parsePathLists;
3486
- }, function (_types) {
3487
- CancelToken = _types.CancelToken;
3488
- ignoreValue = _types.ignoreValue;
3277
+ setters: [function (_types) {
3278
+ ArrayHelper = _types.ArrayHelper;
3489
3279
  }],
3490
3280
  execute: function () {
3491
- isEvent = /^event/i;
3492
- _export("bindSymbol", bindSymbol = Symbol("Bind"));
3493
- _export("default", Bind = class Bind {
3494
- static forControl() {
3495
- return Bind;
3496
- }
3497
- static forData() {
3498
- return Bind;
3499
- }
3500
- static forViewModel() {
3501
- return Bind;
3502
- }
3503
- static forLocalViewModel() {
3504
- return Bind;
3281
+ _export("symbolHandlers", symbolHandlers = Symbol.for("handlers"));
3282
+ _export("symbolBindable", symbolBindable = Symbol.for("bindable"));
3283
+ _export("AtomBinder", AtomBinder = class AtomBinder {
3284
+ static refreshValue(target, key) {
3285
+ const handlers = AtomBinder.get_WatchHandler(target, key);
3286
+ if (handlers === undefined || handlers == null) {
3287
+ return;
3288
+ }
3289
+ for (const item of handlers) {
3290
+ item(target, key);
3291
+ }
3292
+ if (target.onPropertyChanged) {
3293
+ target.onPropertyChanged(key);
3294
+ }
3505
3295
  }
3506
- static presenter(name) {
3507
- return {
3508
- [bindSymbol](cn, control, e, creator) {
3509
- if (typeof name === "function") {
3510
- name(control);
3511
- return;
3512
- }
3513
- const n = name || cn;
3514
- let c = control.element;
3515
- while (c) {
3516
- if (c.atomControl && c.atomControl[n] !== undefined) {
3517
- break;
3518
- }
3519
- c = c._logicalParent || c.parentElement;
3296
+ static add_WatchHandler(target, key, handler) {
3297
+ if (target == null) {
3298
+ return;
3299
+ }
3300
+ const handlers = AtomBinder.get_WatchHandler(target, key);
3301
+ handlers.push(handler);
3302
+ if (Array.isArray(target)) {
3303
+ return;
3304
+ }
3305
+ const pv = AtomBinder.getPropertyDescriptor(target, key);
3306
+ if (pv && pv.get) {
3307
+ return;
3308
+ }
3309
+ const tw = target;
3310
+ let bindables = tw[symbolBindable];
3311
+ if (bindables === undefined) {
3312
+ bindables = {};
3313
+ Object.defineProperty(tw, symbolBindable, {
3314
+ value: bindables,
3315
+ enumerable: false,
3316
+ writable: true,
3317
+ configurable: true
3318
+ });
3319
+ }
3320
+ if (!bindables[key]) {
3321
+ bindables[key] = 1;
3322
+ const o = target[key];
3323
+ const nk = Symbol.for(key);
3324
+ target[nk] = o;
3325
+ const set = function (v) {
3326
+ const ov = this[nk];
3327
+ if (ov === undefined ? ov === v : ov == v) {
3328
+ return;
3520
3329
  }
3521
- (c && c.atomControl || control)[n] = e;
3330
+ this[nk] = v;
3331
+ AtomBinder.refreshValue(this, key);
3332
+ };
3333
+ const get = function () {
3334
+ return this[nk];
3335
+ };
3336
+ if (pv) {
3337
+ delete target[key];
3338
+ Object.defineProperty(target, key, {
3339
+ get,
3340
+ set,
3341
+ configurable: true,
3342
+ enumerable: true
3343
+ });
3344
+ } else {
3345
+ Object.defineProperty(target, key, {
3346
+ get,
3347
+ set,
3348
+ enumerable: true,
3349
+ configurable: true
3350
+ });
3522
3351
  }
3523
- };
3352
+ }
3524
3353
  }
3525
- static event(sourcePath) {
3526
- return {
3527
- [bindSymbol](name, control, e) {
3528
- control.runAfterInit(() => {
3529
- if (isEvent.test(name)) {
3530
- name = name.substring(5);
3531
- if (name.startsWith("-")) {
3532
- name = name.substring(1).replace(/-([a-z])/g, g => g[1].toUpperCase());
3533
- } else {
3534
- name = name[0].toLowerCase() + name.substring(1);
3535
- }
3536
- }
3537
- control.bindEvent(e, name, e1 => {
3538
- return sourcePath(control, e1);
3539
- });
3540
- });
3354
+ static getPropertyDescriptor(target, key) {
3355
+ const pv = Object.getOwnPropertyDescriptor(target, key);
3356
+ if (!pv) {
3357
+ const pt = Object.getPrototypeOf(target);
3358
+ if (pt) {
3359
+ return AtomBinder.getPropertyDescriptor(pt, key);
3541
3360
  }
3542
- };
3361
+ }
3362
+ return pv;
3543
3363
  }
3544
- static oneTime(sourcePath, now) {
3364
+ static get_WatchHandler(target, key) {
3365
+ if (target == null) {
3366
+ return null;
3367
+ }
3368
+ let handlers = target[symbolHandlers];
3369
+ if (handlers === undefined) {
3370
+ handlers = {};
3371
+ Object.defineProperty(target, symbolHandlers, {
3372
+ value: handlers,
3373
+ enumerable: false,
3374
+ writable: true,
3375
+ configurable: true
3376
+ });
3377
+ }
3378
+ let handlersForKey = handlers[key];
3379
+ if (handlersForKey === undefined || handlersForKey == null) {
3380
+ handlersForKey = [];
3381
+ handlers[key] = handlersForKey;
3382
+ }
3383
+ return handlersForKey;
3384
+ }
3385
+ static remove_WatchHandler(target, key, handler) {
3386
+ if (target == null) {
3387
+ return;
3388
+ }
3389
+ const handlers = target[symbolHandlers];
3390
+ if (typeof handlers === "undefined") {
3391
+ return;
3392
+ }
3393
+ const handlersForKey = target[symbolHandlers][key];
3394
+ if (handlersForKey === undefined || handlersForKey == null) {
3395
+ return;
3396
+ }
3397
+ ArrayHelper.remove(handlersForKey, f => f === handler);
3398
+ if (!handlersForKey.length) {
3399
+ handlers[key] = null;
3400
+ delete handlers[key];
3401
+ }
3402
+ }
3403
+ static invokeItemsEvent(target, mode, index, item, oldItem) {
3404
+ const key = "_items";
3405
+ const handlers = AtomBinder.get_WatchHandler(target, key);
3406
+ if (!handlers) {
3407
+ return;
3408
+ }
3409
+ for (const obj of handlers) {
3410
+ obj(target, mode, index, item, oldItem);
3411
+ }
3412
+ AtomBinder.refreshValue(target, "length");
3413
+ }
3414
+ static refreshItems(ary) {
3415
+ AtomBinder.invokeItemsEvent(ary, "refresh", -1, null);
3416
+ }
3417
+ static add_CollectionChanged(target, handler) {
3418
+ if (target == null) {
3419
+ throw new Error("Target Array to watch cannot be null");
3420
+ }
3421
+ if (handler == null) {
3422
+ throw new Error("Target handle to watch an Array cannot be null");
3423
+ }
3424
+ const handlers = AtomBinder.get_WatchHandler(target, "_items");
3425
+ handlers.push(handler);
3545
3426
  return {
3546
- [bindSymbol](name, control, e) {
3547
- control.runAfterInit(() => {
3548
- control.setLocalValue(e, name, sourcePath(control, e));
3549
- });
3550
- if (typeof now !== "undefined") {
3551
- control.setLocalValue(e, name, now);
3552
- }
3427
+ dispose: () => {
3428
+ AtomBinder.remove_CollectionChanged(target, handler);
3553
3429
  }
3554
3430
  };
3555
3431
  }
3556
- static oneTimeAsync(sourcePath, now) {
3432
+ static remove_CollectionChanged(t, handler) {
3433
+ if (t == null) {
3434
+ return;
3435
+ }
3436
+ const target = t;
3437
+ const handlers = target[symbolHandlers];
3438
+ if (typeof handlers === "undefined") {
3439
+ return;
3440
+ }
3441
+ const key = "_items";
3442
+ const handlersForKey = handlers[key];
3443
+ if (handlersForKey === undefined || handlersForKey == null) {
3444
+ return;
3445
+ }
3446
+ ArrayHelper.remove(handlersForKey, f => f === handler);
3447
+ if (!handlersForKey.length) {
3448
+ handlers[key] = null;
3449
+ delete handlers[key];
3450
+ }
3451
+ }
3452
+ static watch(item, property, f) {
3453
+ AtomBinder.add_WatchHandler(item, property, f);
3557
3454
  return {
3558
- [bindSymbol](name, control, e) {
3559
- control.runAfterInit(() => {
3560
- control.app.runAsync(() => __awaiter(this, void 0, void 0, function* () {
3561
- const value = yield sourcePath(control, e, new CancelToken());
3562
- control.setLocalValue(e, name, value);
3563
- }));
3564
- });
3565
- if (typeof now !== "undefined") {
3566
- control.setLocalValue(e, name, now);
3567
- }
3455
+ dispose: () => {
3456
+ AtomBinder.remove_WatchHandler(item, property, f);
3568
3457
  }
3569
3458
  };
3570
3459
  }
3571
- static source(source, path, now) {
3572
- const lists = parsePath(path, false).map(x => ["this", ...x]);
3573
- return {
3574
- [bindSymbol](name, control, e, creator) {
3575
- const self = {
3576
- control,
3577
- source
3578
- };
3579
- control.bind(e, name, lists, false, () => {
3580
- return path.call(self, self);
3581
- }, self);
3582
- if (typeof now !== "undefined") {
3583
- control.setLocalValue(e, name, now);
3584
- }
3460
+ static clear(a) {
3461
+ a.length = 0;
3462
+ this.invokeItemsEvent(a, "refresh", -1, null);
3463
+ AtomBinder.refreshValue(a, "length");
3464
+ }
3465
+ static addItem(a, item) {
3466
+ const index = a.length;
3467
+ a.push(item);
3468
+ this.invokeItemsEvent(a, "add", index, item);
3469
+ AtomBinder.refreshValue(a, "length");
3470
+ }
3471
+ static removeItem(a, item) {
3472
+ const i = a.findIndex(x => x === item);
3473
+ if (i === -1) {
3474
+ return false;
3475
+ }
3476
+ a.splice(i, 1);
3477
+ AtomBinder.invokeItemsEvent(a, "remove", i, item);
3478
+ AtomBinder.refreshValue(a, "length");
3479
+ return true;
3480
+ }
3481
+ });
3482
+ }
3483
+ };
3484
+ });
3485
+ //# sourceMappingURL=AtomBinder.js.map
3486
+
3487
+ AmdLoader.instance.setup("@web-atoms/core/dist/core/AtomBinder");
3488
+
3489
+ System.register(["./AtomBinder"], function (_export, _context) {
3490
+ "use strict";
3491
+
3492
+ var AtomBinder, AtomList, ap;
3493
+ _export("AtomList", void 0);
3494
+ return {
3495
+ setters: [function (_AtomBinder) {
3496
+ AtomBinder = _AtomBinder.AtomBinder;
3497
+ }],
3498
+ execute: function () {
3499
+ _export("AtomList", AtomList = class AtomList extends Array {
3500
+ constructor() {
3501
+ super();
3502
+ this.startValue = 0;
3503
+ this.totalValue = 0;
3504
+ this.sizeValue = 10;
3505
+ this["__proto__"] = AtomList.prototype;
3506
+ this.next = () => {
3507
+ this.start = this.start + this.size;
3508
+ };
3509
+ this.prev = () => {
3510
+ if (this.start >= this.size) {
3511
+ this.start = this.start - this.size;
3585
3512
  }
3586
3513
  };
3587
3514
  }
3588
- static oneWayAsync(sourcePath, {
3589
- watchDelayInMS = 250,
3590
- default: defaultValue
3591
- } = {}) {
3592
- let pathList;
3593
- let combined;
3594
- let thisPathList;
3595
- if (Array.isArray(sourcePath)) {
3596
- pathList = sourcePath;
3597
- } else {
3598
- const lists = parsePathLists(sourcePath);
3599
- if (lists.combined.length) {
3600
- combined = lists.combined;
3601
- }
3602
- if (lists.pathList.length) {
3603
- pathList = lists.pathList;
3604
- }
3605
- if (lists.thisPath.length) {
3606
- thisPathList = lists.thisPath;
3607
- }
3608
- }
3609
- if (!(combined || pathList || thisPathList)) {
3610
- throw new Error(`Failed to setup binding for ${sourcePath}, parsing failed`);
3515
+ get start() {
3516
+ return this.startValue;
3517
+ }
3518
+ set start(v) {
3519
+ if (v === this.startValue) {
3520
+ return;
3611
3521
  }
3612
- return {
3613
- [bindSymbol](name, control, e, creator) {
3614
- let bindingSource;
3615
- let finalPathList = pathList;
3616
- if (combined) {
3617
- bindingSource = {
3618
- t: creator,
3619
- x: control
3620
- };
3621
- finalPathList = combined;
3622
- } else if (thisPathList) {
3623
- finalPathList = thisPathList;
3624
- bindingSource = creator;
3625
- }
3626
- const asyncState = {
3627
- token: 0,
3628
- cancelToken: undefined
3629
- };
3630
- control.bind(e, name, finalPathList, false, () => {
3631
- var _a;
3632
- const app = control.app;
3633
- (_a = asyncState.cancelToken) === null || _a === void 0 ? void 0 : _a.cancel();
3634
- asyncState.cancelToken = undefined;
3635
- asyncState.token = app.setTimeoutAsync(() => __awaiter(this, void 0, void 0, function* () {
3636
- var _b, _c;
3637
- if ((_b = asyncState.cancelToken) === null || _b === void 0 ? void 0 : _b.cancelled) {
3638
- return;
3639
- }
3640
- asyncState.token = undefined;
3641
- (_c = asyncState.cancelToken) === null || _c === void 0 ? void 0 : _c.cancel();
3642
- const ct = asyncState.cancelToken = new CancelToken();
3643
- const value = yield sourcePath.call(creator, control, e, ct);
3644
- if (!ct.cancelled) {
3645
- control.setLocalValue(e, name, value);
3646
- }
3647
- }), watchDelayInMS, asyncState.token);
3648
- return ignoreValue;
3649
- }, bindingSource);
3650
- if (typeof defaultValue !== "undefined") {
3651
- control.setLocalValue(e, name, defaultValue);
3652
- }
3653
- }
3654
- };
3522
+ this.startValue = v;
3523
+ AtomBinder.refreshValue(this, "start");
3655
3524
  }
3656
- static oneWay(sourcePath, now) {
3657
- let pathList;
3658
- let combined;
3659
- let thisPathList;
3660
- if (Array.isArray(sourcePath)) {
3661
- pathList = sourcePath;
3662
- } else {
3663
- const lists = parsePathLists(sourcePath);
3664
- if (lists.combined.length) {
3665
- combined = lists.combined;
3666
- }
3667
- if (lists.pathList.length) {
3668
- pathList = lists.pathList;
3669
- }
3670
- if (lists.thisPath.length) {
3671
- thisPathList = lists.thisPath;
3672
- }
3525
+ get total() {
3526
+ return this.totalValue;
3527
+ }
3528
+ set total(v) {
3529
+ if (v === this.totalValue) {
3530
+ return;
3673
3531
  }
3674
- if (!(combined || pathList || thisPathList)) {
3675
- throw new Error(`Failed to setup binding for ${sourcePath}, parsing failed`);
3532
+ this.totalValue = v;
3533
+ AtomBinder.refreshValue(this, "total");
3534
+ }
3535
+ get size() {
3536
+ return this.sizeValue;
3537
+ }
3538
+ set size(v) {
3539
+ if (v === this.sizeValue) {
3540
+ return;
3676
3541
  }
3677
- return {
3678
- [bindSymbol](name, control, e, creator) {
3679
- if (pathList) {
3680
- control.bind(e, name, pathList, false, () => {
3681
- return sourcePath.call(creator, control, e);
3682
- });
3683
- if (typeof now !== "undefined") {
3684
- control.setLocalValue(e, name, now);
3685
- }
3686
- return;
3687
- }
3688
- if (combined) {
3689
- const a = {
3690
- t: creator,
3691
- x: control
3692
- };
3693
- control.bind(e, name, combined, false, () => {
3694
- return sourcePath.call(creator, control, e);
3695
- }, a);
3696
- if (typeof now !== "undefined") {
3697
- control.setLocalValue(e, name, now);
3698
- }
3699
- return;
3700
- }
3701
- control.bind(e, name, thisPathList, false, () => {
3702
- return sourcePath.call(creator, control, e);
3703
- }, creator);
3704
- if (typeof now !== "undefined") {
3705
- control.setLocalValue(e, name, now);
3542
+ this.sizeValue = v;
3543
+ AtomBinder.refreshValue(this, "size");
3544
+ }
3545
+ add(item) {
3546
+ const i = this.length;
3547
+ const n = this.push(item);
3548
+ AtomBinder.invokeItemsEvent(this, "add", i, item);
3549
+ AtomBinder.refreshValue(this, "length");
3550
+ return n;
3551
+ }
3552
+ addAll(items) {
3553
+ for (const item of items) {
3554
+ const i = this.length;
3555
+ this.push(item);
3556
+ AtomBinder.invokeItemsEvent(this, "add", i, item);
3557
+ AtomBinder.refreshValue(this, "length");
3558
+ }
3559
+ const t = items["total"];
3560
+ if (t) {
3561
+ this.total = t;
3562
+ }
3563
+ }
3564
+ replace(items, start, size) {
3565
+ this.length = items.length;
3566
+ for (let i = 0; i < items.length; i++) {
3567
+ this[i] = items[i];
3568
+ }
3569
+ this.refresh();
3570
+ const t = items["total"];
3571
+ if (t) {
3572
+ this.total = t;
3573
+ }
3574
+ if (start !== undefined) {
3575
+ this.start = start;
3576
+ }
3577
+ if (size !== undefined) {
3578
+ this.size = size;
3579
+ }
3580
+ }
3581
+ insert(i, item) {
3582
+ const n = this.splice(i, 0, item);
3583
+ AtomBinder.invokeItemsEvent(this, "add", i, item);
3584
+ AtomBinder.refreshValue(this, "length");
3585
+ }
3586
+ set(i, item) {
3587
+ const old = this[i];
3588
+ this[i] = item;
3589
+ AtomBinder.invokeItemsEvent(this, "replace", i, item, old);
3590
+ AtomBinder.refreshValue(this, "length");
3591
+ }
3592
+ removeAt(i) {
3593
+ const item = this[i];
3594
+ this.splice(i, 1);
3595
+ AtomBinder.invokeItemsEvent(this, "remove", i, item);
3596
+ AtomBinder.refreshValue(this, "length");
3597
+ return item;
3598
+ }
3599
+ remove(item) {
3600
+ if (item instanceof Function) {
3601
+ let removed = false;
3602
+ for (let index = 0; index < this.length;) {
3603
+ const it = this[index];
3604
+ if (item(it)) {
3605
+ this.splice(index, 1);
3606
+ AtomBinder.invokeItemsEvent(this, "remove", index, it);
3607
+ AtomBinder.refreshValue(this, "length");
3608
+ removed = true;
3609
+ continue;
3706
3610
  }
3611
+ index++;
3707
3612
  }
3708
- };
3709
- }
3710
- static twoWays(sourcePath, events, converter) {
3711
- let pathList;
3712
- let thisPathList;
3713
- if (Array.isArray(sourcePath)) {
3714
- pathList = sourcePath;
3715
- } else {
3716
- const lists = parsePathLists(sourcePath);
3717
- if (lists.combined.length) {
3718
- throw new Error("Cannot have combined binding for two ways");
3719
- }
3720
- if (lists.pathList.length) {
3721
- pathList = lists.pathList;
3722
- }
3723
- if (lists.thisPath.length) {
3724
- thisPathList = lists.thisPath;
3725
- }
3613
+ return removed;
3726
3614
  }
3727
- if (!(thisPathList || pathList)) {
3728
- throw new Error(`Failed to setup twoWay binding on ${sourcePath}`);
3615
+ const n = this.indexOf(item);
3616
+ if (n !== -1) {
3617
+ this.removeAt(n);
3618
+ return true;
3729
3619
  }
3730
- return {
3731
- [bindSymbol](name, control, e, creator) {
3732
- control.bind(e, name, thisPathList || pathList, events || true, converter, thisPathList ? creator : undefined);
3733
- }
3734
- };
3735
- }
3736
- static sourceTwoWays(source, path, events = ["input", "cut", "paste", "change"]) {
3737
- const lists = parsePath(path, false).map(x => ["this", ...x]);
3738
- return {
3739
- [bindSymbol](name, control, e, creator) {
3740
- const self = {
3741
- control,
3742
- source
3743
- };
3744
- control.bind(e, name, lists, events, lists, self);
3745
- }
3746
- };
3620
+ return false;
3747
3621
  }
3748
- static twoWaysImmediate(sourcePath, converter) {
3749
- return this.twoWays(sourcePath, ["change", "input", "paste", "cut"], converter);
3622
+ clear() {
3623
+ this.length = 0;
3624
+ this.refresh();
3750
3625
  }
3751
- constructor(setupFunction, sourcePath, name, eventList) {
3752
- this.setupFunction = setupFunction;
3753
- this.name = name;
3754
- this.eventList = eventList;
3755
- this.sourcePath = sourcePath;
3756
- this[bindSymbol] = true;
3757
- if (!this.sourcePath) {
3758
- return;
3626
+ refresh() {
3627
+ AtomBinder.invokeItemsEvent(this, "refresh", -1, null);
3628
+ AtomBinder.refreshValue(this, "length");
3629
+ }
3630
+ watch(f, wrap) {
3631
+ if (wrap) {
3632
+ const fx = f;
3633
+ f = function () {
3634
+ const p = [];
3635
+ for (let i = 0; i < arguments.length; i++) {
3636
+ const iterator = arguments[i];
3637
+ p.push(iterator);
3638
+ }
3639
+ return fx.call(this, p);
3640
+ };
3759
3641
  }
3760
- if (Array.isArray(this.sourcePath)) {
3761
- this.pathList = this.sourcePath;
3762
- } else {
3763
- const lists = parsePathLists(this.sourcePath);
3764
- if (lists.combined.length) {
3765
- this.combined = lists.combined;
3766
- }
3767
- if (lists.pathList.length) {
3768
- this.pathList = lists.pathList;
3769
- }
3770
- if (lists.thisPath.length) {
3771
- this.thisPathList = lists.thisPath;
3642
+ return AtomBinder.add_CollectionChanged(this, f);
3643
+ }
3644
+ count(f) {
3645
+ let total = 0;
3646
+ for (const iterator of this) {
3647
+ if (f(iterator)) {
3648
+ total++;
3772
3649
  }
3773
3650
  }
3651
+ return total;
3652
+ }
3653
+ avg(f) {
3654
+ if (!this.length) {
3655
+ return 0;
3656
+ }
3657
+ let sum = 0;
3658
+ for (const iterator of this) {
3659
+ sum += f(iterator);
3660
+ }
3661
+ return sum / this.length;
3662
+ }
3663
+ includes(item) {
3664
+ return this.indexOf(item) !== -1;
3774
3665
  }
3775
3666
  });
3667
+ ap = Array.prototype;
3668
+ for (const key of Object.getOwnPropertyNames(AtomList.prototype)) {
3669
+ const {
3670
+ value
3671
+ } = Object.getOwnPropertyDescriptor(AtomList.prototype, key);
3672
+ switch (key) {
3673
+ case "add":
3674
+ case "addAll":
3675
+ case "clear":
3676
+ case "refresh":
3677
+ case "set":
3678
+ case "remove":
3679
+ case "removeAt":
3680
+ case "watch":
3681
+ case "replace":
3682
+ case "insert":
3683
+ case "count":
3684
+ case "avg":
3685
+ case "includes":
3686
+ if (key in ap) {
3687
+ continue;
3688
+ }
3689
+ Object.defineProperty(ap, key, {
3690
+ enumerable: false,
3691
+ value,
3692
+ configurable: true,
3693
+ writable: true
3694
+ });
3695
+ continue;
3696
+ }
3697
+ }
3776
3698
  }
3777
3699
  };
3778
3700
  });
3779
- //# sourceMappingURL=Bind.js.map
3701
+ //# sourceMappingURL=AtomList.js.map
3780
3702
 
3781
- AmdLoader.instance.setup("@web-atoms/core/dist/core/Bind");
3703
+ AmdLoader.instance.setup("@web-atoms/core/dist/core/AtomList");
3782
3704
 
3783
- System.register(["./Bind"], function (_export, _context) {
3705
+ System.register([], function (_export, _context) {
3784
3706
  "use strict";
3785
3707
 
3786
- var bindSymbol, RootObject, XNode, xnodeSymbol, isControl, elementFactorySymbol, isFactorySymbol, attachedSymbol, isTemplateSymbol, constructorNeedsArgumentsSymbol, attachedProperties, attachedId, attach;
3787
- _export({
3788
- RootObject: void 0,
3789
- default: void 0
3790
- });
3708
+ var StyleFragment, id, nextId, globalLow, global, globalHigh, localLow, local, localHigh, styles, styled, svgAsCssDataUrl;
3709
+ function* divide(text) {
3710
+ const regex = /^(([^\{\n]+\{[\t\x20]*)|([^\n\}]*\}[^\S\n\r]*))$/gm;
3711
+ let m;
3712
+ let sentOnce = false;
3713
+ let lastIndex = 0;
3714
+ let lastMatch;
3715
+ while ((m = regex.exec(text)) !== null) {
3716
+ if (m.index === regex.lastIndex) {
3717
+ regex.lastIndex++;
3718
+ }
3719
+ const match = m[0];
3720
+ if (!sentOnce) {
3721
+ sentOnce = true;
3722
+ yield text.substring(lastIndex, m.index);
3723
+ lastIndex = m.index + match.length;
3724
+ lastMatch = match;
3725
+ continue;
3726
+ }
3727
+ if (lastMatch.includes("}")) {
3728
+ yield [lastMatch.trim()];
3729
+ lastIndex = m.index + match.length;
3730
+ lastMatch = match;
3731
+ continue;
3732
+ }
3733
+ yield [lastMatch, text.substring(lastIndex, m.index), match];
3734
+ lastIndex = m.index + match.length;
3735
+ lastMatch = match;
3736
+ }
3737
+ if (lastMatch === null || lastMatch === void 0 ? void 0 : lastMatch.includes("}")) {
3738
+ yield [lastMatch.trim()];
3739
+ }
3740
+ }
3791
3741
  return {
3792
- setters: [function (_Bind) {
3793
- bindSymbol = _Bind.bindSymbol;
3794
- }],
3795
- execute: function () {
3796
- _export("RootObject", RootObject = class RootObject {
3797
- get vsProps() {
3798
- return undefined;
3799
- }
3800
- addEventListener(name, handler) {
3801
- return bridge.addEventHandler(this, name, handler);
3802
- }
3803
- appendChild(e) {
3804
- bridge.appendChild(this, e);
3805
- }
3806
- dispatchEvent(evt) {
3807
- bridge.dispatchEvent(evt);
3808
- }
3809
- });
3810
- _export("xnodeSymbol", xnodeSymbol = Symbol("XNode"));
3811
- _export("isControl", isControl = Symbol("isControl"));
3812
- _export("elementFactorySymbol", elementFactorySymbol = Symbol("elementFactory"));
3813
- _export("isFactorySymbol", isFactorySymbol = Symbol("isFactory"));
3814
- _export("attachedSymbol", attachedSymbol = Symbol("attached"));
3815
- _export("isTemplateSymbol", isTemplateSymbol = Symbol("isTemplate"));
3816
- _export("constructorNeedsArgumentsSymbol", constructorNeedsArgumentsSymbol = Symbol("constructorNeedsArguments"));
3817
- _export("attachedProperties", attachedProperties = {});
3818
- attachedId = 1;
3819
- attach = (name, attacher) => {
3820
- const key = `:${attachedId++}`;
3821
- const fx = v => {
3822
- return {
3823
- [key]: v
3824
- };
3825
- };
3826
- attachedProperties[key] = attacher;
3827
- fx[attachedSymbol] = attacher;
3828
- fx[isFactorySymbol] = key;
3829
- return fx;
3830
- };
3831
- _export("default", XNode = class XNode {
3832
- static attach(n, tag) {
3833
- return {
3834
- factory: (attributes, ...nodes) => new XNode(n, attributes ? Object.assign(Object.assign({}, attributes), {
3835
- for: tag
3836
- }) : {
3837
- for: tag
3838
- }, nodes)
3839
- };
3840
- }
3841
- static prepare(n, isProperty, isTemplate) {
3842
- function px(v) {
3843
- return {
3844
- [n]: v
3845
- };
3846
- }
3847
- px.factory = (a, ...nodes) => {
3848
- return new XNode(n, a, nodes, isProperty, isTemplate);
3849
- };
3850
- px.toString = () => n;
3851
- return px;
3852
- }
3853
- static getClass(fullTypeName, assemblyName) {
3854
- const n = fullTypeName + ";" + assemblyName;
3855
- const cx = XNode.classes[n] || (XNode.classes[n] = bridge.getClass(fullTypeName, assemblyName, RootObject, (name, isProperty, isTemplate) => (a, ...nodes) => new XNode(name, a, nodes, isProperty, isTemplate)));
3856
- return cx;
3857
- }
3858
- static namespace(ns, assemblyName) {
3859
- return (type, isTemplate) => {
3860
- return c => {
3861
- for (const key in c) {
3862
- if (c.hasOwnProperty(key)) {
3863
- const element = c[key];
3864
- if (element) {
3865
- const n = ns + "." + type + ":" + key + ";" + assemblyName;
3866
- const af = a => {
3867
- const r = {
3868
- [n]: a
3869
- };
3870
- Object.defineProperty(r, "toString", {
3871
- value: () => n,
3872
- enumerable: false,
3873
- configurable: false
3874
- });
3875
- return r;
3876
- };
3877
- af.factory = (a, ...nodes) => new XNode(n, a, nodes, true, element.isTemplate);
3878
- af.toString = () => n;
3879
- c[key] = af;
3880
- }
3881
- }
3882
- }
3883
- const tn = ns + "." + type + ";" + assemblyName;
3884
- c.factory = (a, ...nodes) => {
3885
- return new XNode(tn, a, nodes, false, isTemplate);
3886
- };
3887
- c.toString = () => tn;
3888
- };
3889
- };
3890
- }
3891
- static create(name, attributes, ...children) {
3892
- if (typeof name === "string") {
3893
- return new XNode(name, attributes, children);
3894
- }
3895
- if (name[isFactorySymbol]) {
3896
- return new XNode(name, attributes, children);
3897
- }
3898
- if (name.factory) {
3899
- return name.factory(attributes, ...children);
3900
- }
3901
- switch (typeof name) {
3902
- case "object":
3903
- name = name.toString();
3904
- break;
3905
- case "function":
3906
- return name(attributes || {}, ...children);
3907
- }
3908
- return new XNode(name, attributes, children);
3909
- }
3910
- constructor(name, attributes, children, isProperty, isTemplate) {
3911
- this.name = name;
3912
- this.attributes = attributes;
3913
- this.children = children;
3914
- this.isProperty = isProperty;
3915
- this.isTemplate = isTemplate;
3916
- this[xnodeSymbol] = true;
3917
- }
3918
- toString() {
3919
- if (typeof this.name === "string") {
3920
- return `name is of type string and value is ${this.name}`;
3921
- }
3922
- return `name is of type ${typeof this.name}`;
3923
- }
3924
- });
3925
- XNode.isFactory = isFactorySymbol;
3926
- XNode.elementFactory = elementFactorySymbol;
3927
- XNode.bindSymbol = bindSymbol;
3928
- XNode.isTemplate = isTemplateSymbol;
3929
- XNode.prepareAttached = attach;
3930
- XNode.constructorNeedsArguments = constructorNeedsArgumentsSymbol;
3931
- XNode.classes = {};
3932
- XNode.factory = (name, isProperty, isTemplate) => (a, ...nodes) => {
3933
- return new XNode(name, a, nodes, isProperty, isTemplate);
3934
- };
3935
- if (typeof bridge !== "undefined") {
3936
- bridge.XNode = XNode;
3937
- }
3938
- }
3939
- };
3940
- });
3941
- //# sourceMappingURL=XNode.js.map
3942
-
3943
- AmdLoader.instance.setup("@web-atoms/core/dist/core/XNode");
3944
-
3945
- System.register([], function (_export, _context) {
3946
- "use strict";
3947
-
3948
- var StyleFragment, id, nextId, globalLow, global, globalHigh, localLow, local, localHigh, styles, styled, svgAsCssDataUrl;
3949
- function* divide(text) {
3950
- const regex = /^(([^\{\n]+\{[\t\x20]*)|([^\n\}]*\}[^\S\n\r]*))$/gm;
3951
- let m;
3952
- let sentOnce = false;
3953
- let lastIndex = 0;
3954
- let lastMatch;
3955
- while ((m = regex.exec(text)) !== null) {
3956
- if (m.index === regex.lastIndex) {
3957
- regex.lastIndex++;
3958
- }
3959
- const match = m[0];
3960
- if (!sentOnce) {
3961
- sentOnce = true;
3962
- yield text.substring(lastIndex, m.index);
3963
- lastIndex = m.index + match.length;
3964
- lastMatch = match;
3965
- continue;
3966
- }
3967
- if (lastMatch.includes("}")) {
3968
- yield [lastMatch.trim()];
3969
- lastIndex = m.index + match.length;
3970
- lastMatch = match;
3971
- continue;
3972
- }
3973
- yield [lastMatch, text.substring(lastIndex, m.index), match];
3974
- lastIndex = m.index + match.length;
3975
- lastMatch = match;
3976
- }
3977
- if (lastMatch === null || lastMatch === void 0 ? void 0 : lastMatch.includes("}")) {
3978
- yield [lastMatch.trim()];
3979
- }
3980
- }
3981
- return {
3982
- setters: [],
3742
+ setters: [],
3983
3743
  execute: function () {
3984
3744
  ;
3985
3745
  id = 1;
@@ -4152,223 +3912,823 @@ System.register([], function (_export, _context) {
4152
3912
 
4153
3913
  AmdLoader.instance.setup("@web-atoms/core/dist/style/styled");
4154
3914
 
4155
- System.register(["./types"], function (_export, _context) {
3915
+ System.register(["@web-atoms/core/dist/style/styled"], function (_export, _context) {
4156
3916
  "use strict";
4157
3917
 
4158
- var ArrayHelper, AtomBinder, symbolHandlers, symbolBindable;
4159
- _export("AtomBinder", void 0);
3918
+ var styled;
4160
3919
  return {
4161
- setters: [function (_types) {
4162
- ArrayHelper = _types.ArrayHelper;
3920
+ setters: [function (_webAtomsCoreDistStyleStyled) {
3921
+ styled = _webAtomsCoreDistStyleStyled.default;
4163
3922
  }],
4164
3923
  execute: function () {
4165
- _export("symbolHandlers", symbolHandlers = Symbol.for("handlers"));
4166
- _export("symbolBindable", symbolBindable = Symbol.for("bindable"));
4167
- _export("AtomBinder", AtomBinder = class AtomBinder {
4168
- static refreshValue(target, key) {
4169
- const handlers = AtomBinder.get_WatchHandler(target, key);
4170
- if (handlers === undefined || handlers == null) {
4171
- return;
4172
- }
4173
- for (const item of handlers) {
4174
- item(target, key);
4175
- }
4176
- if (target.onPropertyChanged) {
4177
- target.onPropertyChanged(key);
4178
- }
4179
- }
4180
- static add_WatchHandler(target, key, handler) {
4181
- if (target == null) {
4182
- return;
4183
- }
4184
- const handlers = AtomBinder.get_WatchHandler(target, key);
4185
- handlers.push(handler);
4186
- if (Array.isArray(target)) {
4187
- return;
4188
- }
4189
- const pv = AtomBinder.getPropertyDescriptor(target, key);
4190
- if (pv && pv.get) {
4191
- return;
4192
- }
4193
- const tw = target;
4194
- let bindables = tw[symbolBindable];
4195
- if (bindables === undefined) {
4196
- bindables = {};
4197
- Object.defineProperty(tw, symbolBindable, {
4198
- value: bindables,
4199
- enumerable: false,
4200
- writable: true,
4201
- configurable: true
4202
- });
4203
- }
4204
- if (!bindables[key]) {
4205
- bindables[key] = 1;
4206
- const o = target[key];
4207
- const nk = Symbol.for(key);
4208
- target[nk] = o;
4209
- const set = function (v) {
4210
- const ov = this[nk];
4211
- if (ov === undefined ? ov === v : ov == v) {
4212
- return;
4213
- }
4214
- this[nk] = v;
4215
- AtomBinder.refreshValue(this, key);
4216
- };
4217
- const get = function () {
4218
- return this[nk];
4219
- };
4220
- if (pv) {
4221
- delete target[key];
4222
- Object.defineProperty(target, key, {
4223
- get,
4224
- set,
4225
- configurable: true,
4226
- enumerable: true
4227
- });
4228
- } else {
4229
- Object.defineProperty(target, key, {
4230
- get,
4231
- set,
4232
- enumerable: true,
4233
- configurable: true
4234
- });
4235
- }
4236
- }
3924
+ styled.css`
3925
+
3926
+ div[data-desktop-app=desktop-app] {
3927
+ width: 100%;
3928
+ }
3929
+
3930
+ /* div[data-base-page=base-page] {
3931
+ & > [data-page-element=title] {
3932
+ overflow-y: visible;
4237
3933
  }
4238
- static getPropertyDescriptor(target, key) {
4239
- const pv = Object.getOwnPropertyDescriptor(target, key);
4240
- if (!pv) {
4241
- const pt = Object.getPrototypeOf(target);
4242
- if (pt) {
4243
- return AtomBinder.getPropertyDescriptor(pt, key);
3934
+ } */
3935
+
3936
+ `.withId("default-app-style").withOrder("medium").installGlobal();
3937
+ }
3938
+ };
3939
+ });
3940
+ //# sourceMappingURL=OverrideAppStyle.js.map
3941
+
3942
+ AmdLoader.instance.setup("@social-mail/social-mail-client/dist/style/OverrideAppStyle");
3943
+
3944
+
3945
+ System.register([], function(_export, _context) {
3946
+ return {
3947
+ setters: [],
3948
+ execute: function() {
3949
+
3950
+ // this is because in web atoms loader
3951
+ // root url may not be set when the module is registered
3952
+ setTimeout(() => {
3953
+
3954
+ const cssModule = _context.meta.resolve("./data-styles.css");
3955
+ const cssURL = System.resolve(cssModule);
3956
+
3957
+ const link = document.createElement("link");
3958
+ link.id = "data-styles";
3959
+ link.setAttribute("href", cssURL);
3960
+ link.setAttribute("rel", "stylesheet");
3961
+ link.setAttribute("as", "style");
3962
+ link.setAttribute("crossorigin", "anonymous");
3963
+ const head = document.head;
3964
+ const firstElementChild = head.firstElementChild;
3965
+ if (firstElementChild) {
3966
+ head.insertBefore(link, firstElementChild);
3967
+ } else {
3968
+ head.appendChild(link);
3969
+ }
3970
+ }, 1);
3971
+ }
3972
+ };
3973
+ });
3974
+
3975
+
3976
+ AmdLoader.instance.setup("@web-atoms/data-styles/data-styles");
3977
+
3978
+ System.register(["@web-atoms/core/dist/core/types", "@web-atoms/core/dist/core/AtomList", "./OverrideAppStyle", "@web-atoms/core/dist/style/styled", "@web-atoms/data-styles/data-styles"], function (_export, _context) {
3979
+ "use strict";
3980
+
3981
+ var UMD, styled, ___UMD;
3982
+ function addLinkTag(href, integrity, rel = "stylesheet") {
3983
+ if (!document.head.querySelector(`[href="${href}"]`)) {
3984
+ const fa = document.createElement("link");
3985
+ fa.href = href;
3986
+ fa.crossOrigin = "anonymous";
3987
+ fa.as = "style";
3988
+ fa.rel = "preload";
3989
+ if (integrity) {
3990
+ fa.integrity = integrity;
3991
+ }
3992
+ fa.onload = () => {
3993
+ fa.onload = null;
3994
+ fa.rel = rel;
3995
+ };
3996
+ document.head.insertBefore(fa, document.head.firstElementChild);
3997
+ }
3998
+ }
3999
+ return {
4000
+ setters: [function (_webAtomsCoreDistCoreTypes) {
4001
+ UMD = _webAtomsCoreDistCoreTypes.UMD;
4002
+ }, function (_webAtomsCoreDistCoreAtomList) {}, function (_OverrideAppStyle) {}, function (_webAtomsCoreDistStyleStyled) {
4003
+ styled = _webAtomsCoreDistStyleStyled.default;
4004
+ }, function (_webAtomsDataStylesDataStyles) {}],
4005
+ execute: function () {
4006
+ _export("___UMD", ___UMD = UMD);
4007
+ addLinkTag("https://fonts.googleapis.com/css2?family=Source+Sans+Pro:ital,wght@0,400;0,600;0,700;1,400;1,600;1,700&display=swap");
4008
+ addLinkTag("https://npm-git.azureedge.net/npm/package/@c8private/fa-icons@6.5.2/css/all.min.css");
4009
+ addLinkTag("https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0");
4010
+ addLinkTag("https://cdn.jsdelivr.net/npm/file-icon-vectors@1.0.0/dist/file-icon-vivid.min.css");
4011
+ styled.css`
4012
+
4013
+ :root {
4014
+ --primary-color: #294D4A;
4015
+ --accent-color: #ff6733;
4016
+ --accent2-color: #ff673375;
4017
+ --lighter-accent-color: #e6e6fa60;
4018
+ --light-accent-color: #f2e5fa;
4019
+ --accent-text-color: white;
4020
+ --background-color: #f1f1f160;
4021
+ --window-background: #50505025;
4022
+ --media-bg-color: #9F33FF0F;
4023
+ --font-size-small: 0.8125em;
4024
+
4025
+ --hover-color: #b8b88b20;
4026
+ --command-bg-color: #50505025;
4027
+ --hover-text-color: CanvasText;
4028
+ --selection-color: #b8b88b60;
4029
+ --selection-text-color: CanvasText;
4030
+ --spacing: 5px;
4031
+ --spacing-medium: 7px;
4032
+ --spacing-large: 10px;
4033
+ }
4034
+
4035
+ html, body {
4036
+ margin:0;
4037
+ }
4038
+
4039
+ * {
4040
+ scrollbar-width: thin;
4041
+ scrollbar-color: var(--accent-color) white;
4042
+ }
4043
+
4044
+
4045
+ ::-webkit-scrollbar {
4046
+ width: 5px;
4047
+ }
4048
+ ::-webkit-scrollbar-track {
4049
+ background: white;
4050
+ border-radius: 20px;
4051
+ }
4052
+ ::-webkit-scrollbar-thumb {
4053
+ background: var(--accent-color);
4054
+ border-radius: 20px;
4055
+ }
4056
+
4057
+ body {
4058
+ font-family: trebuchet ms, "Source Sans Pro";
4059
+ font-size: 16px;
4060
+ justify-content: stretch;
4061
+
4062
+ & * {
4063
+ font-family: trebuchet ms, "Source Sans Pro";
4064
+ box-sizing: border-box;
4065
+ }
4066
+
4067
+ &::placeholder {
4068
+ font-size: smaller;
4069
+ }
4070
+
4071
+ & ul {
4072
+ padding-inline-start: 15px;
4073
+ }
4074
+
4075
+ & input[type=search] {
4076
+ border: none;
4077
+ outline: none;
4078
+ border-radius: 9999px;
4079
+ padding-right: 10px;
4080
+ padding-left: 25px;
4081
+ background: canvas url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' class='bi bi-search' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z'%3E%3C/path%3E%3C/svg%3E") no-repeat 5px center;
4082
+ }
4083
+ }
4084
+
4085
+ `.withId("global-styles").withOrder("medium").installGlobal();
4086
+ }
4087
+ };
4088
+ });
4089
+ //# sourceMappingURL=GlobalStyle.js.map
4090
+
4091
+ AmdLoader.instance.setup("@social-mail/social-mail-client/dist/style/GlobalStyle");
4092
+
4093
+ System.register([], function (_export, _context) {
4094
+ "use strict";
4095
+
4096
+ var viewModelParseWatchCache, viewModelParseWatchCache2;
4097
+ function trimRegEx(t, r) {
4098
+ const m = r.exec(t);
4099
+ if (m && m.length) {
4100
+ return [true, t.substring(m[0].length).trim(), m[0]];
4101
+ }
4102
+ return [false, t, ""];
4103
+ }
4104
+ function extractTill(text, search, returnOriginal = false) {
4105
+ const index = text.indexOf(search);
4106
+ if (index <= 0) {
4107
+ return returnOriginal ? text : "";
4108
+ }
4109
+ return text.substring(0, index);
4110
+ }
4111
+ function parsePath(f, parseThis) {
4112
+ let str = f.toString().trim();
4113
+ str = str.split("\n").filter(s => !/^\/\//.test(s.trim())).join("\n");
4114
+ const key = (parseThis === undefined ? "un:" : parseThis ? "_this:" : "_noThis:") + str;
4115
+ const px1 = viewModelParseWatchCache[key];
4116
+ if (px1) {
4117
+ return px1;
4118
+ }
4119
+ if (str.endsWith("}")) {
4120
+ str = str.substr(0, str.length - 1);
4121
+ }
4122
+ const functionRegEx = /^\w+\s*\(/;
4123
+ const lambdaRegEx = /^\(?(\w+)?(\s?\,\s?\w+)*\)?\s?\=\>/;
4124
+ let arg = "";
4125
+ const original = str;
4126
+ let [success, remaining] = trimRegEx(str, functionRegEx);
4127
+ if (success) {
4128
+ str = remaining;
4129
+ remaining = extractTill(remaining, ")");
4130
+ str = str.substring(remaining.length);
4131
+ arg = extractTill(remaining, ",", true);
4132
+ } else {
4133
+ [success, str, remaining] = trimRegEx(str, lambdaRegEx);
4134
+ if (success) {
4135
+ remaining = remaining.trim();
4136
+ remaining = remaining.substring(0, remaining.length - 2);
4137
+ remaining = extractTill(remaining, ")", true);
4138
+ arg = extractTill(remaining, ",", true);
4139
+ if (arg.startsWith("(")) {
4140
+ arg = arg.substring(1);
4141
+ }
4142
+ } else {
4143
+ if (parseThis !== undefined && parseThis === false) {
4144
+ return [];
4145
+ } else {
4146
+ parseThis = true;
4147
+ }
4148
+ }
4149
+ }
4150
+ str = str.trim();
4151
+ const isThis = parseThis === undefined ? (arg ? false : true) || parseThis : parseThis;
4152
+ const p = (isThis ? "(\\_this|this)" : arg || "").trim();
4153
+ if (p.length === 0) {
4154
+ const empty = [];
4155
+ viewModelParseWatchCache[key] = empty;
4156
+ return empty;
4157
+ }
4158
+ const regExp = `(?:(\\b${p})(?:(\\.[a-zA-Z_][a-zA-Z_0-9]*)+)\\s?(?:(\\(|\\=\\=\\=|\\=\\=|\\=)?))`;
4159
+ const re = new RegExp(regExp, "gi");
4160
+ let path = [];
4161
+ const ms = str.replace(re, m => {
4162
+ let px = m;
4163
+ if (px.startsWith("this.")) {
4164
+ if (parseThis !== true) {
4165
+ px = px.substr(5);
4166
+ }
4167
+ } else if (px.startsWith("_this.")) {
4168
+ if (parseThis !== true) {
4169
+ px = px.substr(6);
4170
+ } else {
4171
+ px = px.substr(1);
4172
+ }
4173
+ } else {
4174
+ px = px.substr(p.length + 1);
4175
+ }
4176
+ px = px.split(".").filter(s => !s.endsWith("(")).join(".");
4177
+ if (!path.find(y => y === px)) {
4178
+ path.push(px);
4179
+ }
4180
+ const filtered = [];
4181
+ for (const iterator of path) {
4182
+ if (iterator.endsWith("==") || !(iterator.endsWith("(") || iterator.endsWith("="))) {
4183
+ filtered.push((iterator.endsWith("===") ? iterator.substr(0, iterator.length - 3) : iterator.endsWith("==") ? iterator.substr(0, iterator.length - 2) : iterator).trim());
4184
+ }
4185
+ }
4186
+ path = filtered.filter(px11 => {
4187
+ const search = px11 + ".";
4188
+ for (const iterator of filtered) {
4189
+ if (px11 !== iterator && iterator.indexOf(search) !== -1) {
4190
+ return false;
4191
+ }
4192
+ }
4193
+ return true;
4194
+ });
4195
+ return m;
4196
+ });
4197
+ path = path.sort((a, b) => b.localeCompare(a));
4198
+ const duplicates = path;
4199
+ path = [];
4200
+ for (const iterator of duplicates) {
4201
+ if (path.find(px2 => px2 === iterator)) {
4202
+ continue;
4203
+ }
4204
+ path.push(iterator);
4205
+ }
4206
+ const rp = [];
4207
+ for (const rpItem of path) {
4208
+ if (rp.find(x => x.startsWith(rpItem))) {
4209
+ continue;
4210
+ }
4211
+ rp.push(rpItem);
4212
+ }
4213
+ const pl = path.filter(p1 => p1).map(p1 => p1.split("."));
4214
+ viewModelParseWatchCache[key] = pl;
4215
+ return pl;
4216
+ }
4217
+ function parsePathLists(f) {
4218
+ const str = f.toString().trim();
4219
+ const key = str;
4220
+ const px1 = viewModelParseWatchCache2[key];
4221
+ if (px1) {
4222
+ return px1;
4223
+ }
4224
+ const pl = {
4225
+ pathList: parsePath(str, false),
4226
+ thisPath: parsePath(str, true),
4227
+ combined: []
4228
+ };
4229
+ if (pl.thisPath.length && pl.pathList.length) {
4230
+ pl.combined = pl.thisPath.map(x => {
4231
+ x[0] = "t";
4232
+ x.splice(0, 0, "this");
4233
+ return x;
4234
+ }).concat(pl.pathList.map(x => {
4235
+ x.splice(0, 0, "this", "x");
4236
+ return x;
4237
+ }));
4238
+ pl.thisPath = [];
4239
+ pl.pathList = [];
4240
+ }
4241
+ viewModelParseWatchCache2[key] = pl;
4242
+ return pl;
4243
+ }
4244
+ _export({
4245
+ parsePath: parsePath,
4246
+ parsePathLists: parsePathLists
4247
+ });
4248
+ return {
4249
+ setters: [],
4250
+ execute: function () {
4251
+ viewModelParseWatchCache = {};
4252
+ viewModelParseWatchCache2 = {};
4253
+ }
4254
+ };
4255
+ });
4256
+ //# sourceMappingURL=ExpressionParser.js.map
4257
+
4258
+ AmdLoader.instance.setup("@web-atoms/core/dist/core/ExpressionParser");
4259
+
4260
+ System.register(["tslib", "./ExpressionParser", "./types"], function (_export, _context) {
4261
+ "use strict";
4262
+
4263
+ var __awaiter, parsePath, parsePathLists, CancelToken, ignoreValue, Bind, isEvent, bindSymbol;
4264
+ function twoWaysConvert(name, b, control, e, creator) {
4265
+ control.bind(e, name, b.thisPathList || b.pathList, b.eventList || true, null, b.thisPathList ? creator : undefined);
4266
+ }
4267
+ _export("default", void 0);
4268
+ return {
4269
+ setters: [function (_tslib) {
4270
+ __awaiter = _tslib.__awaiter;
4271
+ }, function (_ExpressionParser) {
4272
+ parsePath = _ExpressionParser.parsePath;
4273
+ parsePathLists = _ExpressionParser.parsePathLists;
4274
+ }, function (_types) {
4275
+ CancelToken = _types.CancelToken;
4276
+ ignoreValue = _types.ignoreValue;
4277
+ }],
4278
+ execute: function () {
4279
+ isEvent = /^event/i;
4280
+ _export("bindSymbol", bindSymbol = Symbol("Bind"));
4281
+ _export("default", Bind = class Bind {
4282
+ static forControl() {
4283
+ return Bind;
4284
+ }
4285
+ static forData() {
4286
+ return Bind;
4287
+ }
4288
+ static forViewModel() {
4289
+ return Bind;
4290
+ }
4291
+ static forLocalViewModel() {
4292
+ return Bind;
4293
+ }
4294
+ static presenter(name) {
4295
+ return {
4296
+ [bindSymbol](cn, control, e, creator) {
4297
+ if (typeof name === "function") {
4298
+ name(control);
4299
+ return;
4300
+ }
4301
+ const n = name || cn;
4302
+ let c = control.element;
4303
+ while (c) {
4304
+ if (c.atomControl && c.atomControl[n] !== undefined) {
4305
+ break;
4306
+ }
4307
+ c = c._logicalParent || c.parentElement;
4308
+ }
4309
+ (c && c.atomControl || control)[n] = e;
4244
4310
  }
4245
- }
4246
- return pv;
4311
+ };
4247
4312
  }
4248
- static get_WatchHandler(target, key) {
4249
- if (target == null) {
4250
- return null;
4251
- }
4252
- let handlers = target[symbolHandlers];
4253
- if (handlers === undefined) {
4254
- handlers = {};
4255
- Object.defineProperty(target, symbolHandlers, {
4256
- value: handlers,
4257
- enumerable: false,
4258
- writable: true,
4259
- configurable: true
4260
- });
4261
- }
4262
- let handlersForKey = handlers[key];
4263
- if (handlersForKey === undefined || handlersForKey == null) {
4264
- handlersForKey = [];
4265
- handlers[key] = handlersForKey;
4266
- }
4267
- return handlersForKey;
4313
+ static event(sourcePath) {
4314
+ return {
4315
+ [bindSymbol](name, control, e) {
4316
+ control.runAfterInit(() => {
4317
+ if (isEvent.test(name)) {
4318
+ name = name.substring(5);
4319
+ if (name.startsWith("-")) {
4320
+ name = name.substring(1).replace(/-([a-z])/g, g => g[1].toUpperCase());
4321
+ } else {
4322
+ name = name[0].toLowerCase() + name.substring(1);
4323
+ }
4324
+ }
4325
+ control.bindEvent(e, name, e1 => {
4326
+ return sourcePath(control, e1);
4327
+ });
4328
+ });
4329
+ }
4330
+ };
4268
4331
  }
4269
- static remove_WatchHandler(target, key, handler) {
4270
- if (target == null) {
4271
- return;
4332
+ static oneTime(sourcePath, now) {
4333
+ return {
4334
+ [bindSymbol](name, control, e) {
4335
+ control.runAfterInit(() => {
4336
+ control.setLocalValue(e, name, sourcePath(control, e));
4337
+ });
4338
+ if (typeof now !== "undefined") {
4339
+ control.setLocalValue(e, name, now);
4340
+ }
4341
+ }
4342
+ };
4343
+ }
4344
+ static oneTimeAsync(sourcePath, now) {
4345
+ return {
4346
+ [bindSymbol](name, control, e) {
4347
+ control.runAfterInit(() => {
4348
+ control.app.runAsync(() => __awaiter(this, void 0, void 0, function* () {
4349
+ const value = yield sourcePath(control, e, new CancelToken());
4350
+ control.setLocalValue(e, name, value);
4351
+ }));
4352
+ });
4353
+ if (typeof now !== "undefined") {
4354
+ control.setLocalValue(e, name, now);
4355
+ }
4356
+ }
4357
+ };
4358
+ }
4359
+ static source(source, path, now) {
4360
+ const lists = parsePath(path, false).map(x => ["this", ...x]);
4361
+ return {
4362
+ [bindSymbol](name, control, e, creator) {
4363
+ const self = {
4364
+ control,
4365
+ source
4366
+ };
4367
+ control.bind(e, name, lists, false, () => {
4368
+ return path.call(self, self);
4369
+ }, self);
4370
+ if (typeof now !== "undefined") {
4371
+ control.setLocalValue(e, name, now);
4372
+ }
4373
+ }
4374
+ };
4375
+ }
4376
+ static oneWayAsync(sourcePath, {
4377
+ watchDelayInMS = 250,
4378
+ default: defaultValue
4379
+ } = {}) {
4380
+ let pathList;
4381
+ let combined;
4382
+ let thisPathList;
4383
+ if (Array.isArray(sourcePath)) {
4384
+ pathList = sourcePath;
4385
+ } else {
4386
+ const lists = parsePathLists(sourcePath);
4387
+ if (lists.combined.length) {
4388
+ combined = lists.combined;
4389
+ }
4390
+ if (lists.pathList.length) {
4391
+ pathList = lists.pathList;
4392
+ }
4393
+ if (lists.thisPath.length) {
4394
+ thisPathList = lists.thisPath;
4395
+ }
4272
4396
  }
4273
- const handlers = target[symbolHandlers];
4274
- if (typeof handlers === "undefined") {
4275
- return;
4397
+ if (!(combined || pathList || thisPathList)) {
4398
+ throw new Error(`Failed to setup binding for ${sourcePath}, parsing failed`);
4276
4399
  }
4277
- const handlersForKey = target[symbolHandlers][key];
4278
- if (handlersForKey === undefined || handlersForKey == null) {
4279
- return;
4400
+ return {
4401
+ [bindSymbol](name, control, e, creator) {
4402
+ let bindingSource;
4403
+ let finalPathList = pathList;
4404
+ if (combined) {
4405
+ bindingSource = {
4406
+ t: creator,
4407
+ x: control
4408
+ };
4409
+ finalPathList = combined;
4410
+ } else if (thisPathList) {
4411
+ finalPathList = thisPathList;
4412
+ bindingSource = creator;
4413
+ }
4414
+ const asyncState = {
4415
+ token: 0,
4416
+ cancelToken: undefined
4417
+ };
4418
+ control.bind(e, name, finalPathList, false, () => {
4419
+ var _a;
4420
+ const app = control.app;
4421
+ (_a = asyncState.cancelToken) === null || _a === void 0 ? void 0 : _a.cancel();
4422
+ asyncState.cancelToken = undefined;
4423
+ asyncState.token = app.setTimeoutAsync(() => __awaiter(this, void 0, void 0, function* () {
4424
+ var _b, _c;
4425
+ if ((_b = asyncState.cancelToken) === null || _b === void 0 ? void 0 : _b.cancelled) {
4426
+ return;
4427
+ }
4428
+ asyncState.token = undefined;
4429
+ (_c = asyncState.cancelToken) === null || _c === void 0 ? void 0 : _c.cancel();
4430
+ const ct = asyncState.cancelToken = new CancelToken();
4431
+ const value = yield sourcePath.call(creator, control, e, ct);
4432
+ if (!ct.cancelled) {
4433
+ control.setLocalValue(e, name, value);
4434
+ }
4435
+ }), watchDelayInMS, asyncState.token);
4436
+ return ignoreValue;
4437
+ }, bindingSource);
4438
+ if (typeof defaultValue !== "undefined") {
4439
+ control.setLocalValue(e, name, defaultValue);
4440
+ }
4441
+ }
4442
+ };
4443
+ }
4444
+ static oneWay(sourcePath, now) {
4445
+ let pathList;
4446
+ let combined;
4447
+ let thisPathList;
4448
+ if (Array.isArray(sourcePath)) {
4449
+ pathList = sourcePath;
4450
+ } else {
4451
+ const lists = parsePathLists(sourcePath);
4452
+ if (lists.combined.length) {
4453
+ combined = lists.combined;
4454
+ }
4455
+ if (lists.pathList.length) {
4456
+ pathList = lists.pathList;
4457
+ }
4458
+ if (lists.thisPath.length) {
4459
+ thisPathList = lists.thisPath;
4460
+ }
4280
4461
  }
4281
- ArrayHelper.remove(handlersForKey, f => f === handler);
4282
- if (!handlersForKey.length) {
4283
- handlers[key] = null;
4284
- delete handlers[key];
4462
+ if (!(combined || pathList || thisPathList)) {
4463
+ throw new Error(`Failed to setup binding for ${sourcePath}, parsing failed`);
4285
4464
  }
4465
+ return {
4466
+ [bindSymbol](name, control, e, creator) {
4467
+ if (pathList) {
4468
+ control.bind(e, name, pathList, false, () => {
4469
+ return sourcePath.call(creator, control, e);
4470
+ });
4471
+ if (typeof now !== "undefined") {
4472
+ control.setLocalValue(e, name, now);
4473
+ }
4474
+ return;
4475
+ }
4476
+ if (combined) {
4477
+ const a = {
4478
+ t: creator,
4479
+ x: control
4480
+ };
4481
+ control.bind(e, name, combined, false, () => {
4482
+ return sourcePath.call(creator, control, e);
4483
+ }, a);
4484
+ if (typeof now !== "undefined") {
4485
+ control.setLocalValue(e, name, now);
4486
+ }
4487
+ return;
4488
+ }
4489
+ control.bind(e, name, thisPathList, false, () => {
4490
+ return sourcePath.call(creator, control, e);
4491
+ }, creator);
4492
+ if (typeof now !== "undefined") {
4493
+ control.setLocalValue(e, name, now);
4494
+ }
4495
+ }
4496
+ };
4286
4497
  }
4287
- static invokeItemsEvent(target, mode, index, item, oldItem) {
4288
- const key = "_items";
4289
- const handlers = AtomBinder.get_WatchHandler(target, key);
4290
- if (!handlers) {
4291
- return;
4498
+ static twoWays(sourcePath, events, converter) {
4499
+ let pathList;
4500
+ let thisPathList;
4501
+ if (Array.isArray(sourcePath)) {
4502
+ pathList = sourcePath;
4503
+ } else {
4504
+ const lists = parsePathLists(sourcePath);
4505
+ if (lists.combined.length) {
4506
+ throw new Error("Cannot have combined binding for two ways");
4507
+ }
4508
+ if (lists.pathList.length) {
4509
+ pathList = lists.pathList;
4510
+ }
4511
+ if (lists.thisPath.length) {
4512
+ thisPathList = lists.thisPath;
4513
+ }
4292
4514
  }
4293
- for (const obj of handlers) {
4294
- obj(target, mode, index, item, oldItem);
4515
+ if (!(thisPathList || pathList)) {
4516
+ throw new Error(`Failed to setup twoWay binding on ${sourcePath}`);
4295
4517
  }
4296
- AtomBinder.refreshValue(target, "length");
4297
- }
4298
- static refreshItems(ary) {
4299
- AtomBinder.invokeItemsEvent(ary, "refresh", -1, null);
4518
+ return {
4519
+ [bindSymbol](name, control, e, creator) {
4520
+ control.bind(e, name, thisPathList || pathList, events || true, converter, thisPathList ? creator : undefined);
4521
+ }
4522
+ };
4300
4523
  }
4301
- static add_CollectionChanged(target, handler) {
4302
- if (target == null) {
4303
- throw new Error("Target Array to watch cannot be null");
4304
- }
4305
- if (handler == null) {
4306
- throw new Error("Target handle to watch an Array cannot be null");
4307
- }
4308
- const handlers = AtomBinder.get_WatchHandler(target, "_items");
4309
- handlers.push(handler);
4524
+ static sourceTwoWays(source, path, events = ["input", "cut", "paste", "change"]) {
4525
+ const lists = parsePath(path, false).map(x => ["this", ...x]);
4310
4526
  return {
4311
- dispose: () => {
4312
- AtomBinder.remove_CollectionChanged(target, handler);
4527
+ [bindSymbol](name, control, e, creator) {
4528
+ const self = {
4529
+ control,
4530
+ source
4531
+ };
4532
+ control.bind(e, name, lists, events, lists, self);
4313
4533
  }
4314
4534
  };
4315
4535
  }
4316
- static remove_CollectionChanged(t, handler) {
4317
- if (t == null) {
4318
- return;
4319
- }
4320
- const target = t;
4321
- const handlers = target[symbolHandlers];
4322
- if (typeof handlers === "undefined") {
4323
- return;
4324
- }
4325
- const key = "_items";
4326
- const handlersForKey = handlers[key];
4327
- if (handlersForKey === undefined || handlersForKey == null) {
4536
+ static twoWaysImmediate(sourcePath, converter) {
4537
+ return this.twoWays(sourcePath, ["change", "input", "paste", "cut"], converter);
4538
+ }
4539
+ constructor(setupFunction, sourcePath, name, eventList) {
4540
+ this.setupFunction = setupFunction;
4541
+ this.name = name;
4542
+ this.eventList = eventList;
4543
+ this.sourcePath = sourcePath;
4544
+ this[bindSymbol] = true;
4545
+ if (!this.sourcePath) {
4328
4546
  return;
4329
4547
  }
4330
- ArrayHelper.remove(handlersForKey, f => f === handler);
4331
- if (!handlersForKey.length) {
4332
- handlers[key] = null;
4333
- delete handlers[key];
4548
+ if (Array.isArray(this.sourcePath)) {
4549
+ this.pathList = this.sourcePath;
4550
+ } else {
4551
+ const lists = parsePathLists(this.sourcePath);
4552
+ if (lists.combined.length) {
4553
+ this.combined = lists.combined;
4554
+ }
4555
+ if (lists.pathList.length) {
4556
+ this.pathList = lists.pathList;
4557
+ }
4558
+ if (lists.thisPath.length) {
4559
+ this.thisPathList = lists.thisPath;
4560
+ }
4334
4561
  }
4335
4562
  }
4336
- static watch(item, property, f) {
4337
- AtomBinder.add_WatchHandler(item, property, f);
4563
+ });
4564
+ }
4565
+ };
4566
+ });
4567
+ //# sourceMappingURL=Bind.js.map
4568
+
4569
+ AmdLoader.instance.setup("@web-atoms/core/dist/core/Bind");
4570
+
4571
+ System.register(["./Bind"], function (_export, _context) {
4572
+ "use strict";
4573
+
4574
+ var bindSymbol, RootObject, XNode, xnodeSymbol, isControl, elementFactorySymbol, isFactorySymbol, attachedSymbol, isTemplateSymbol, constructorNeedsArgumentsSymbol, attachedProperties, attachedId, attach;
4575
+ _export({
4576
+ RootObject: void 0,
4577
+ default: void 0
4578
+ });
4579
+ return {
4580
+ setters: [function (_Bind) {
4581
+ bindSymbol = _Bind.bindSymbol;
4582
+ }],
4583
+ execute: function () {
4584
+ _export("RootObject", RootObject = class RootObject {
4585
+ get vsProps() {
4586
+ return undefined;
4587
+ }
4588
+ addEventListener(name, handler) {
4589
+ return bridge.addEventHandler(this, name, handler);
4590
+ }
4591
+ appendChild(e) {
4592
+ bridge.appendChild(this, e);
4593
+ }
4594
+ dispatchEvent(evt) {
4595
+ bridge.dispatchEvent(evt);
4596
+ }
4597
+ });
4598
+ _export("xnodeSymbol", xnodeSymbol = Symbol("XNode"));
4599
+ _export("isControl", isControl = Symbol("isControl"));
4600
+ _export("elementFactorySymbol", elementFactorySymbol = Symbol("elementFactory"));
4601
+ _export("isFactorySymbol", isFactorySymbol = Symbol("isFactory"));
4602
+ _export("attachedSymbol", attachedSymbol = Symbol("attached"));
4603
+ _export("isTemplateSymbol", isTemplateSymbol = Symbol("isTemplate"));
4604
+ _export("constructorNeedsArgumentsSymbol", constructorNeedsArgumentsSymbol = Symbol("constructorNeedsArguments"));
4605
+ _export("attachedProperties", attachedProperties = {});
4606
+ attachedId = 1;
4607
+ attach = (name, attacher) => {
4608
+ const key = `:${attachedId++}`;
4609
+ const fx = v => {
4338
4610
  return {
4339
- dispose: () => {
4340
- AtomBinder.remove_WatchHandler(item, property, f);
4341
- }
4611
+ [key]: v
4612
+ };
4613
+ };
4614
+ attachedProperties[key] = attacher;
4615
+ fx[attachedSymbol] = attacher;
4616
+ fx[isFactorySymbol] = key;
4617
+ return fx;
4618
+ };
4619
+ _export("default", XNode = class XNode {
4620
+ static attach(n, tag) {
4621
+ return {
4622
+ factory: (attributes, ...nodes) => new XNode(n, attributes ? Object.assign(Object.assign({}, attributes), {
4623
+ for: tag
4624
+ }) : {
4625
+ for: tag
4626
+ }, nodes)
4342
4627
  };
4343
4628
  }
4344
- static clear(a) {
4345
- a.length = 0;
4346
- this.invokeItemsEvent(a, "refresh", -1, null);
4347
- AtomBinder.refreshValue(a, "length");
4629
+ static prepare(n, isProperty, isTemplate) {
4630
+ function px(v) {
4631
+ return {
4632
+ [n]: v
4633
+ };
4634
+ }
4635
+ px.factory = (a, ...nodes) => {
4636
+ return new XNode(n, a, nodes, isProperty, isTemplate);
4637
+ };
4638
+ px.toString = () => n;
4639
+ return px;
4348
4640
  }
4349
- static addItem(a, item) {
4350
- const index = a.length;
4351
- a.push(item);
4352
- this.invokeItemsEvent(a, "add", index, item);
4353
- AtomBinder.refreshValue(a, "length");
4641
+ static getClass(fullTypeName, assemblyName) {
4642
+ const n = fullTypeName + ";" + assemblyName;
4643
+ const cx = XNode.classes[n] || (XNode.classes[n] = bridge.getClass(fullTypeName, assemblyName, RootObject, (name, isProperty, isTemplate) => (a, ...nodes) => new XNode(name, a, nodes, isProperty, isTemplate)));
4644
+ return cx;
4354
4645
  }
4355
- static removeItem(a, item) {
4356
- const i = a.findIndex(x => x === item);
4357
- if (i === -1) {
4358
- return false;
4646
+ static namespace(ns, assemblyName) {
4647
+ return (type, isTemplate) => {
4648
+ return c => {
4649
+ for (const key in c) {
4650
+ if (c.hasOwnProperty(key)) {
4651
+ const element = c[key];
4652
+ if (element) {
4653
+ const n = ns + "." + type + ":" + key + ";" + assemblyName;
4654
+ const af = a => {
4655
+ const r = {
4656
+ [n]: a
4657
+ };
4658
+ Object.defineProperty(r, "toString", {
4659
+ value: () => n,
4660
+ enumerable: false,
4661
+ configurable: false
4662
+ });
4663
+ return r;
4664
+ };
4665
+ af.factory = (a, ...nodes) => new XNode(n, a, nodes, true, element.isTemplate);
4666
+ af.toString = () => n;
4667
+ c[key] = af;
4668
+ }
4669
+ }
4670
+ }
4671
+ const tn = ns + "." + type + ";" + assemblyName;
4672
+ c.factory = (a, ...nodes) => {
4673
+ return new XNode(tn, a, nodes, false, isTemplate);
4674
+ };
4675
+ c.toString = () => tn;
4676
+ };
4677
+ };
4678
+ }
4679
+ static create(name, attributes, ...children) {
4680
+ if (typeof name === "string") {
4681
+ return new XNode(name, attributes, children);
4359
4682
  }
4360
- a.splice(i, 1);
4361
- AtomBinder.invokeItemsEvent(a, "remove", i, item);
4362
- AtomBinder.refreshValue(a, "length");
4363
- return true;
4683
+ if (name[isFactorySymbol]) {
4684
+ return new XNode(name, attributes, children);
4685
+ }
4686
+ if (name.factory) {
4687
+ return name.factory(attributes, ...children);
4688
+ }
4689
+ switch (typeof name) {
4690
+ case "object":
4691
+ name = name.toString();
4692
+ break;
4693
+ case "function":
4694
+ return name(attributes || {}, ...children);
4695
+ }
4696
+ return new XNode(name, attributes, children);
4697
+ }
4698
+ constructor(name, attributes, children, isProperty, isTemplate) {
4699
+ this.name = name;
4700
+ this.attributes = attributes;
4701
+ this.children = children;
4702
+ this.isProperty = isProperty;
4703
+ this.isTemplate = isTemplate;
4704
+ this[xnodeSymbol] = true;
4705
+ }
4706
+ toString() {
4707
+ if (typeof this.name === "string") {
4708
+ return `name is of type string and value is ${this.name}`;
4709
+ }
4710
+ return `name is of type ${typeof this.name}`;
4364
4711
  }
4365
4712
  });
4713
+ XNode.isFactory = isFactorySymbol;
4714
+ XNode.elementFactory = elementFactorySymbol;
4715
+ XNode.bindSymbol = bindSymbol;
4716
+ XNode.isTemplate = isTemplateSymbol;
4717
+ XNode.prepareAttached = attach;
4718
+ XNode.constructorNeedsArguments = constructorNeedsArgumentsSymbol;
4719
+ XNode.classes = {};
4720
+ XNode.factory = (name, isProperty, isTemplate) => (a, ...nodes) => {
4721
+ return new XNode(name, a, nodes, isProperty, isTemplate);
4722
+ };
4723
+ if (typeof bridge !== "undefined") {
4724
+ bridge.XNode = XNode;
4725
+ }
4366
4726
  }
4367
4727
  };
4368
4728
  });
4369
- //# sourceMappingURL=AtomBinder.js.map
4729
+ //# sourceMappingURL=XNode.js.map
4370
4730
 
4371
- AmdLoader.instance.setup("@web-atoms/core/dist/core/AtomBinder");
4731
+ AmdLoader.instance.setup("@web-atoms/core/dist/core/XNode");
4372
4732
 
4373
4733
  System.register([], function (_export, _context) {
4374
4734
  "use strict";
@@ -10812,7 +11172,7 @@ System.register([], function (_export, _context) {
10812
11172
 
10813
11173
  AmdLoader.instance.setup("@web-atoms/core/dist/Pack");
10814
11174
 
10815
- System.register(["tslib", "@web-atoms/data-styles/data-styles", "@web-atoms/core/dist/core/XNode", "@web-atoms/core/dist/style/styled", "@web-atoms/core/dist/core/Bind", "@web-atoms/core/dist/App", "@web-atoms/web-controls/dist/basic/Form", "@web-atoms/web-controls/dist/basic/FormField", "@web-atoms/web-controls/dist/basic/PasswordBox", "@web-atoms/core/dist/web/controls/AtomControl", "../../../common/controls/buttons/IconButton", "../../../common/fileUrl", "../../../common/Modules", "@web-atoms/core/dist/Pack"], function (_export, _context) {
11175
+ System.register(["tslib", "../../../style/GlobalStyle", "@web-atoms/core/dist/core/XNode", "@web-atoms/core/dist/style/styled", "@web-atoms/core/dist/core/Bind", "@web-atoms/core/dist/App", "@web-atoms/web-controls/dist/basic/Form", "@web-atoms/web-controls/dist/basic/FormField", "@web-atoms/web-controls/dist/basic/PasswordBox", "@web-atoms/core/dist/web/controls/AtomControl", "../../../common/controls/buttons/IconButton", "../../../common/fileUrl", "../../../common/Modules", "@web-atoms/core/dist/Pack"], function (_export, _context) {
10816
11176
  "use strict";
10817
11177
 
10818
11178
  var __awaiter, __decorate, __metadata, XNode, styled, Bind, App, Form, FormField, PasswordBox, AtomControl, IconButton, fileUrl, Modules, Pack, css, installStyleSheet, fileInfo, PreviewDocument;
@@ -10821,7 +11181,7 @@ System.register(["tslib", "@web-atoms/data-styles/data-styles", "@web-atoms/core
10821
11181
  __awaiter = _tslib.__awaiter;
10822
11182
  __decorate = _tslib.__decorate;
10823
11183
  __metadata = _tslib.__metadata;
10824
- }, function (_webAtomsDataStylesDataStyles) {}, function (_webAtomsCoreDistCoreXNode) {
11184
+ }, function (_styleGlobalStyle) {}, function (_webAtomsCoreDistCoreXNode) {
10825
11185
  XNode = _webAtomsCoreDistCoreXNode.default;
10826
11186
  }, function (_webAtomsCoreDistStyleStyled) {
10827
11187
  styled = _webAtomsCoreDistStyleStyled.default;
@@ -10849,7 +11209,7 @@ System.register(["tslib", "@web-atoms/data-styles/data-styles", "@web-atoms/core
10849
11209
  execute: function () {
10850
11210
  css = styled.css`
10851
11211
 
10852
- & > pdf-frame {
11212
+ & > .pdf-frame {
10853
11213
 
10854
11214
  display: grid;
10855
11215
  width: 100%;
@@ -10989,7 +11349,7 @@ System.register(["tslib", "@web-atoms/data-styles/data-styles", "@web-atoms/core
10989
11349
 
10990
11350
  `.installLocal();
10991
11351
  installStyleSheet = () => {
10992
- App.installStyleSheet("https://cdn.jsdelivr.net/npm/pdfjs-dist@4.4.168/web/pdf_viewer.css");
11352
+ App.installStyleSheet("https://cdn.jsdelivr.net/npm/pdfjs-dist@4.6.82/web/pdf_viewer.css");
10993
11353
  installStyleSheet = null;
10994
11354
  };
10995
11355
  fileInfo = window.fileInfo;