@peculiar/certificates-viewer 2.0.1 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/cjs/_commonjsHelpers-cb1f949a.js +23 -0
- package/dist/cjs/{download-cd98aa01.js → certification_request-96951e7b.js} +2880 -3313
- package/dist/cjs/{dom-760f300f.js → dom-f57e260e.js} +4 -1
- package/dist/cjs/download-5e7d5455.js +438 -0
- package/dist/cjs/{index-2973f90a.js → index-064e95c7.js} +287 -634
- package/dist/cjs/index.cjs.js +12 -0
- package/dist/cjs/{l10n-e971a5ac.js → l10n-2e7def18.js} +72 -90
- package/dist/cjs/loader.cjs.js +12 -3
- package/dist/cjs/peculiar-attribute-certificate-viewer_9.cjs.entry.js +1426 -1391
- package/dist/cjs/peculiar-certificate-summary_3.cjs.entry.js +66 -62
- package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js +222 -217
- package/dist/cjs/peculiar.cjs.js +70 -3
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/attribute-certificate-viewer/attribute-certificate-viewer.js +220 -205
- package/dist/collection/components/attribute-certificate-viewer/holder.js +27 -24
- package/dist/collection/components/attribute-certificate-viewer/issuer.js +11 -8
- package/dist/collection/components/button/button.css +2 -7
- package/dist/collection/components/button/button.js +125 -122
- package/dist/collection/components/button-split/button-split.js +103 -100
- package/dist/collection/components/certificate-decoder/certificate-decoder.css +1 -3
- package/dist/collection/components/certificate-decoder/certificate-decoder.js +158 -155
- package/dist/collection/components/certificate-summary/certificate-summary.js +75 -72
- package/dist/collection/components/certificate-viewer/attributes/activity_description_attribute.js +11 -8
- package/dist/collection/components/certificate-viewer/attributes/as_string_attribute.js +6 -3
- package/dist/collection/components/certificate-viewer/attributes/basic_attribute.js +11 -8
- package/dist/collection/components/certificate-viewer/attributes/challenge_password_attribute.js +6 -3
- package/dist/collection/components/certificate-viewer/attributes/index.js +45 -42
- package/dist/collection/components/certificate-viewer/attributes/insurance_value_attribute.js +7 -4
- package/dist/collection/components/certificate-viewer/attributes/name_attribute.js +6 -3
- package/dist/collection/components/certificate-viewer/attributes/name_part.js +8 -5
- package/dist/collection/components/certificate-viewer/attributes/type_relationship_attribute.js +5 -2
- package/dist/collection/components/certificate-viewer/attributes/unstructured_name_attribute.js +6 -3
- package/dist/collection/components/certificate-viewer/attributes/valuation_ranking_attribute.js +18 -15
- package/dist/collection/components/certificate-viewer/attributes/web_gdpr_attribute.js +13 -10
- package/dist/collection/components/certificate-viewer/basic_information.js +13 -10
- package/dist/collection/components/certificate-viewer/certificate-viewer.js +255 -240
- package/dist/collection/components/certificate-viewer/extensions/archive_rev_info_extension.js +6 -3
- package/dist/collection/components/certificate-viewer/extensions/as_string_extension.js +6 -3
- package/dist/collection/components/certificate-viewer/extensions/attribute_value.js +4 -1
- package/dist/collection/components/certificate-viewer/extensions/authority_key_identifier_extension.js +18 -15
- package/dist/collection/components/certificate-viewer/extensions/basic_constraints_extension.js +7 -4
- package/dist/collection/components/certificate-viewer/extensions/basic_extension.js +12 -9
- package/dist/collection/components/certificate-viewer/extensions/biometric_syntax_extension.js +12 -9
- package/dist/collection/components/certificate-viewer/extensions/ca_version_extension.js +8 -5
- package/dist/collection/components/certificate-viewer/extensions/certificate_policies_extension.js +28 -25
- package/dist/collection/components/certificate-viewer/extensions/certificate_template_extension.js +8 -5
- package/dist/collection/components/certificate-viewer/extensions/certificate_transparency_extension.js +13 -10
- package/dist/collection/components/certificate-viewer/extensions/crl_distribution_points_extension.js +11 -8
- package/dist/collection/components/certificate-viewer/extensions/crl_reason_extension.js +6 -3
- package/dist/collection/components/certificate-viewer/extensions/enroll_cert_type_extension.js +6 -3
- package/dist/collection/components/certificate-viewer/extensions/entrust_version_info_extension.js +7 -4
- package/dist/collection/components/certificate-viewer/extensions/extended_key_usage_extension.js +5 -2
- package/dist/collection/components/certificate-viewer/extensions/general_name_part.js +55 -52
- package/dist/collection/components/certificate-viewer/extensions/index.js +112 -109
- package/dist/collection/components/certificate-viewer/extensions/info_access_syntax_extension.js +9 -6
- package/dist/collection/components/certificate-viewer/extensions/key_usage_extension.js +6 -3
- package/dist/collection/components/certificate-viewer/extensions/lei_extension.js +6 -3
- package/dist/collection/components/certificate-viewer/extensions/lei_role_extennsion.js +6 -3
- package/dist/collection/components/certificate-viewer/extensions/logotype_extension.js +49 -46
- package/dist/collection/components/certificate-viewer/extensions/name_constraints_extension.js +8 -5
- package/dist/collection/components/certificate-viewer/extensions/netscape_cert_type_extension.js +6 -3
- package/dist/collection/components/certificate-viewer/extensions/netscape_comment_extension.js +6 -3
- package/dist/collection/components/certificate-viewer/extensions/policy_constraints_extension.js +7 -4
- package/dist/collection/components/certificate-viewer/extensions/policy_mappings_extension.js +9 -6
- package/dist/collection/components/certificate-viewer/extensions/private_key_usage_period_extension.js +7 -4
- package/dist/collection/components/certificate-viewer/extensions/qc_statements_extension.js +9 -6
- package/dist/collection/components/certificate-viewer/extensions/subject_alternative_name_extension.js +5 -2
- package/dist/collection/components/certificate-viewer/extensions/subject_directory_attributes_extension.js +9 -6
- package/dist/collection/components/certificate-viewer/extensions/subject_key_identifier_extension.js +18 -15
- package/dist/collection/components/certificate-viewer/extensions/timestamp_extension.js +8 -5
- package/dist/collection/components/certificate-viewer/extensions/tn_auth_list_extension.js +10 -7
- package/dist/collection/components/certificate-viewer/get_string_by_oid.js +8 -5
- package/dist/collection/components/certificate-viewer/issuer_name.js +9 -6
- package/dist/collection/components/certificate-viewer/miscellaneous.js +29 -26
- package/dist/collection/components/certificate-viewer/public_key.js +31 -28
- package/dist/collection/components/certificate-viewer/row.js +35 -32
- package/dist/collection/components/certificate-viewer/signature.js +12 -9
- package/dist/collection/components/certificate-viewer/subject_name.js +8 -5
- package/dist/collection/components/certificate-viewer/thumbprints.js +15 -12
- package/dist/collection/components/certificates-viewer/certificates-viewer.css +1 -19
- package/dist/collection/components/certificates-viewer/certificates-viewer.js +384 -381
- package/dist/collection/components/circular-progress/circular-progress.css +2 -24
- package/dist/collection/components/circular-progress/circular-progress.js +73 -70
- package/dist/collection/components/csr-viewer/csr-viewer.js +197 -188
- package/dist/collection/components/highlight-words/highlight-words.js +56 -53
- package/dist/collection/components/link/link.css +1 -3
- package/dist/collection/components/link/link.js +60 -57
- package/dist/collection/components/text-hider/text-hider.js +75 -72
- package/dist/collection/components/typography/typography.css +1 -3
- package/dist/collection/components/typography/typography.js +126 -123
- package/dist/collection/constants/logs.js +79 -76
- package/dist/collection/constants/oids.js +2301 -2298
- package/dist/collection/crypto/asn_data.js +33 -32
- package/dist/collection/crypto/attribute.js +52 -49
- package/dist/collection/crypto/csr.js +64 -61
- package/dist/collection/crypto/extension.js +126 -123
- package/dist/collection/crypto/index.js +3 -0
- package/dist/collection/crypto/name.js +33 -32
- package/dist/collection/crypto/provider.js +28 -25
- package/dist/collection/crypto/utils.js +24 -21
- package/dist/collection/crypto/x509_attribute_certificate.js +61 -58
- package/dist/collection/crypto/x509_certificate.js +107 -104
- package/dist/collection/index.js +5 -1
- package/dist/collection/utils/date_formatter.js +19 -16
- package/dist/collection/utils/download.js +18 -15
- package/dist/collection/utils/download_from_buffer.js +30 -25
- package/dist/collection/utils/history.js +5 -2
- package/dist/collection/utils/index.js +3 -0
- package/dist/collection/utils/is_link.js +4 -1
- package/dist/collection/utils/l10n.js +28 -25
- package/dist/collection/utils/parse_hash.js +16 -13
- package/dist/collection/utils/query_stringify.js +12 -9
- package/dist/collection/utils/read_file.js +43 -40
- package/dist/collection/utils/third_party_links.js +3 -0
- package/dist/collection/utils/validator.js +15 -12
- package/dist/esm/_commonjsHelpers-bfbd2ad8.js +20 -0
- package/dist/esm/{download-1ff0a3be.js → certification_request-48e8b956.js} +2898 -3328
- package/dist/esm/{dom-91ed8d21.js → dom-f1b08a97.js} +4 -1
- package/dist/esm/download-cf68ac2c.js +434 -0
- package/dist/esm/{index-5ef692cc.js → index-bbd484d9.js} +278 -624
- package/dist/esm/index.js +5 -0
- package/dist/esm/{l10n-c8cf6930.js → l10n-ead9928b.js} +71 -86
- package/dist/esm/{loader.mjs → loader.js} +11 -2
- package/dist/esm/peculiar-attribute-certificate-viewer_9.entry.js +1425 -1390
- package/dist/esm/peculiar-certificate-summary_3.entry.js +66 -62
- package/dist/esm/peculiar-certificates-viewer.entry.js +222 -217
- package/dist/esm/peculiar.js +73 -0
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm/polyfills/index.js +2 -2
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -1
- package/dist/peculiar/index.esm.js +4 -0
- package/dist/peculiar/p-452d69af.entry.js +113 -0
- package/dist/peculiar/p-886e9c53.js +87 -0
- package/dist/peculiar/p-9ae6b1f8.entry.js +4 -0
- package/dist/peculiar/{p-3d1015c2.js → p-9f4ee110.js} +5 -2
- package/dist/peculiar/p-c774ec0b.js +18 -0
- package/dist/peculiar/p-d09b762f.js +33 -0
- package/dist/peculiar/p-d0b55fbb.js +4 -0
- package/dist/peculiar/p-e5f99586.entry.js +4 -0
- package/dist/peculiar/p-f7683ba5.js +5 -0
- package/dist/peculiar/peculiar.esm.js +4 -1
- package/dist/types/components/attribute-certificate-viewer/attribute-certificate-viewer.d.ts +56 -56
- package/dist/types/components/attribute-certificate-viewer/holder.d.ts +1 -1
- package/dist/types/components/attribute-certificate-viewer/issuer.d.ts +1 -1
- package/dist/types/components/button/button.d.ts +17 -17
- package/dist/types/components/button-split/button-split.d.ts +10 -10
- package/dist/types/components/certificate-decoder/certificate-decoder.d.ts +16 -16
- package/dist/types/components/certificate-summary/certificate-summary.d.ts +4 -4
- package/dist/types/components/certificate-viewer/attributes/activity_description_attribute.d.ts +1 -1
- package/dist/types/components/certificate-viewer/attributes/as_string_attribute.d.ts +1 -1
- package/dist/types/components/certificate-viewer/attributes/basic_attribute.d.ts +1 -1
- package/dist/types/components/certificate-viewer/attributes/challenge_password_attribute.d.ts +1 -1
- package/dist/types/components/certificate-viewer/attributes/index.d.ts +1 -1
- package/dist/types/components/certificate-viewer/attributes/insurance_value_attribute.d.ts +1 -1
- package/dist/types/components/certificate-viewer/attributes/name_attribute.d.ts +1 -1
- package/dist/types/components/certificate-viewer/attributes/name_part.d.ts +1 -1
- package/dist/types/components/certificate-viewer/attributes/type_relationship_attribute.d.ts +1 -1
- package/dist/types/components/certificate-viewer/attributes/unstructured_name_attribute.d.ts +1 -1
- package/dist/types/components/certificate-viewer/attributes/valuation_ranking_attribute.d.ts +1 -1
- package/dist/types/components/certificate-viewer/attributes/web_gdpr_attribute.d.ts +1 -1
- package/dist/types/components/certificate-viewer/basic_information.d.ts +6 -6
- package/dist/types/components/certificate-viewer/certificate-viewer.d.ts +66 -66
- package/dist/types/components/certificate-viewer/extensions/archive_rev_info_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/as_string_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/authority_key_identifier_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/basic_constraints_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/basic_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/biometric_syntax_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/ca_version_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/certificate_policies_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/certificate_template_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/certificate_transparency_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/crl_distribution_points_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/crl_reason_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/enroll_cert_type_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/entrust_version_info_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/extended_key_usage_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/general_name_part.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/index.d.ts +2 -2
- package/dist/types/components/certificate-viewer/extensions/info_access_syntax_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/key_usage_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/lei_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/lei_role_extennsion.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/logotype_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/name_constraints_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/netscape_cert_type_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/netscape_comment_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/policy_constraints_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/policy_mappings_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/private_key_usage_period_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/qc_statements_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/subject_alternative_name_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/subject_directory_attributes_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/subject_key_identifier_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/timestamp_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/tn_auth_list_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/issuer_name.d.ts +2 -2
- package/dist/types/components/certificate-viewer/miscellaneous.d.ts +1 -1
- package/dist/types/components/certificate-viewer/public_key.d.ts +1 -1
- package/dist/types/components/certificate-viewer/row.d.ts +7 -7
- package/dist/types/components/certificate-viewer/signature.d.ts +1 -1
- package/dist/types/components/certificate-viewer/subject_name.d.ts +1 -1
- package/dist/types/components/certificate-viewer/thumbprints.d.ts +1 -1
- package/dist/types/components/certificate-viewer/types.d.ts +26 -0
- package/dist/types/components/certificates-viewer/certificates-viewer.d.ts +64 -64
- package/dist/types/components/circular-progress/circular-progress.d.ts +10 -10
- package/dist/types/components/csr-viewer/csr-viewer.d.ts +45 -45
- package/dist/types/components/highlight-words/highlight-words.d.ts +8 -8
- package/dist/types/components/link/link.d.ts +6 -6
- package/dist/types/components/text-hider/text-hider.d.ts +4 -4
- package/dist/types/components/typography/typography.d.ts +18 -18
- package/dist/types/components.d.ts +11 -3
- package/dist/types/constants/logs.d.ts +76 -76
- package/dist/types/constants/oids.d.ts +2293 -2293
- package/dist/types/crypto/asn_data.d.ts +6 -6
- package/dist/types/crypto/attribute.d.ts +3 -3
- package/dist/types/crypto/csr.d.ts +19 -19
- package/dist/types/crypto/extension.d.ts +3 -3
- package/dist/types/crypto/name.d.ts +7 -7
- package/dist/types/crypto/provider.d.ts +15 -15
- package/dist/types/crypto/x509_attribute_certificate.d.ts +22 -22
- package/dist/types/crypto/x509_certificate.d.ts +28 -28
- package/dist/types/index.d.ts +2 -1
- package/dist/types/interface.d.ts +3 -0
- package/dist/types/stencil-public-runtime.d.ts +230 -217
- package/dist/types/utils/download.d.ts +8 -8
- package/dist/types/utils/download_from_buffer.d.ts +3 -3
- package/dist/types/utils/l10n.d.ts +43 -43
- package/dist/types/utils/read_file.d.ts +7 -7
- package/loader/cdn.js +3 -1
- package/loader/index.cjs.js +3 -1
- package/loader/index.d.ts +0 -1
- package/loader/index.es2017.js +5 -0
- package/loader/{index.mjs → index.js} +4 -2
- package/loader/package.json +4 -5
- package/package.json +14 -15
- package/dist/cjs/css-shim-1b988199.js +0 -6
- package/dist/cjs/patch-15ea31af.js +0 -112
- package/dist/cjs/shadow-css-376763e9.js +0 -385
- package/dist/esm/css-shim-5ce2b5c4.js +0 -4
- package/dist/esm/index.mjs +0 -1
- package/dist/esm/patch-f8a17185.js +0 -109
- package/dist/esm/peculiar.mjs +0 -6
- package/dist/esm/shadow-css-95922619.js +0 -383
- package/dist/esm-es5/css-shim-5ce2b5c4.js +0 -122
- package/dist/esm-es5/dom-91ed8d21.js +0 -468
- package/dist/esm-es5/download-1ff0a3be.js +0 -12692
- package/dist/esm-es5/index-5ef692cc.js +0 -1839
- package/dist/esm-es5/index.mjs +0 -0
- package/dist/esm-es5/l10n-c8cf6930.js +0 -758
- package/dist/esm-es5/loader.mjs +0 -10
- package/dist/esm-es5/patch-f8a17185.js +0 -106
- package/dist/esm-es5/peculiar-attribute-certificate-viewer_9.entry.js +0 -2168
- package/dist/esm-es5/peculiar-certificate-summary_3.entry.js +0 -83
- package/dist/esm-es5/peculiar-certificates-viewer.entry.js +0 -290
- package/dist/esm-es5/peculiar.mjs +0 -5
- package/dist/esm-es5/shadow-css-95922619.js +0 -408
- package/dist/index.mjs +0 -1
- package/dist/peculiar/p-0ad0b6e8.js +0 -1
- package/dist/peculiar/p-198d9121.js +0 -1
- package/dist/peculiar/p-294c4ef9.entry.js +0 -1
- package/dist/peculiar/p-3d339152.system.entry.js +0 -1
- package/dist/peculiar/p-4b7cd42f.js +0 -12
- package/dist/peculiar/p-50ea2036.system.js +0 -1
- package/dist/peculiar/p-557d912f.system.js +0 -1
- package/dist/peculiar/p-75076c56.system.js +0 -21
- package/dist/peculiar/p-84e8326d.entry.js +0 -110
- package/dist/peculiar/p-94f96303.system.js +0 -100
- package/dist/peculiar/p-983b5210.system.entry.js +0 -1
- package/dist/peculiar/p-9f815f76.system.js +0 -1
- package/dist/peculiar/p-aa0a9b36.system.js +0 -1
- package/dist/peculiar/p-bd1f9066.system.js +0 -36
- package/dist/peculiar/p-bd949790.js +0 -1
- package/dist/peculiar/p-cf1841f8.js +0 -30
- package/dist/peculiar/p-dbdd61e7.entry.js +0 -1
- package/dist/peculiar/p-dc6b70b2.js +0 -100
- package/dist/peculiar/p-fb53799e.system.js +0 -1
- package/dist/peculiar/p-fc92385a.system.entry.js +0 -457
- package/dist/peculiar/p-fdad110e.system.js +0 -13
- package/dist/peculiar/peculiar.js +0 -132
- package/dist/peculiar.js +0 -30
- package/loader/index.es2017.mjs +0 -3
- package/loader/node-main.js +0 -3
|
@@ -1,1839 +0,0 @@
|
|
|
1
|
-
var __extends = (this && this.__extends) || (function () {
|
|
2
|
-
var extendStatics = function (d, b) {
|
|
3
|
-
extendStatics = Object.setPrototypeOf ||
|
|
4
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
6
|
-
return extendStatics(d, b);
|
|
7
|
-
};
|
|
8
|
-
return function (d, b) {
|
|
9
|
-
extendStatics(d, b);
|
|
10
|
-
function __() { this.constructor = d; }
|
|
11
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
12
|
-
};
|
|
13
|
-
})();
|
|
14
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
15
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
16
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
17
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
18
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
19
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
20
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
24
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
25
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
26
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
27
|
-
function step(op) {
|
|
28
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
29
|
-
while (_) try {
|
|
30
|
-
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;
|
|
31
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
32
|
-
switch (op[0]) {
|
|
33
|
-
case 0: case 1: t = op; break;
|
|
34
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
35
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
36
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
37
|
-
default:
|
|
38
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
39
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
40
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
41
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
42
|
-
if (t[2]) _.ops.pop();
|
|
43
|
-
_.trys.pop(); continue;
|
|
44
|
-
}
|
|
45
|
-
op = body.call(thisArg, _);
|
|
46
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
47
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
var __spreadArrays = (this && this.__spreadArrays) || function () {
|
|
51
|
-
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
|
52
|
-
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
53
|
-
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
54
|
-
r[k] = a[j];
|
|
55
|
-
return r;
|
|
56
|
-
};
|
|
57
|
-
var NAMESPACE = 'peculiar';
|
|
58
|
-
var scopeId;
|
|
59
|
-
var contentRef;
|
|
60
|
-
var hostTagName;
|
|
61
|
-
var useNativeShadowDom = false;
|
|
62
|
-
var checkSlotFallbackVisibility = false;
|
|
63
|
-
var checkSlotRelocate = false;
|
|
64
|
-
var isSvgMode = false;
|
|
65
|
-
var queueCongestion = 0;
|
|
66
|
-
var queuePending = false;
|
|
67
|
-
var win = typeof window !== 'undefined' ? window : {};
|
|
68
|
-
var CSS = win.CSS;
|
|
69
|
-
var doc = win.document || { head: {} };
|
|
70
|
-
var plt = {
|
|
71
|
-
$flags$: 0,
|
|
72
|
-
$resourcesUrl$: '',
|
|
73
|
-
jmp: function (h) { return h(); },
|
|
74
|
-
raf: function (h) { return requestAnimationFrame(h); },
|
|
75
|
-
ael: function (el, eventName, listener, opts) { return el.addEventListener(eventName, listener, opts); },
|
|
76
|
-
rel: function (el, eventName, listener, opts) { return el.removeEventListener(eventName, listener, opts); },
|
|
77
|
-
ce: function (eventName, opts) { return new CustomEvent(eventName, opts); },
|
|
78
|
-
};
|
|
79
|
-
var supportsShadow = /*@__PURE__*/ (function () { return (doc.head.attachShadow + '').indexOf('[native') > -1; })();
|
|
80
|
-
var promiseResolve = function (v) { return Promise.resolve(v); };
|
|
81
|
-
var supportsConstructibleStylesheets = /*@__PURE__*/ (function () {
|
|
82
|
-
try {
|
|
83
|
-
new CSSStyleSheet();
|
|
84
|
-
return true;
|
|
85
|
-
}
|
|
86
|
-
catch (e) { }
|
|
87
|
-
return false;
|
|
88
|
-
})();
|
|
89
|
-
var addHostEventListeners = function (elm, hostRef, listeners, attachParentListeners) {
|
|
90
|
-
if (listeners) {
|
|
91
|
-
listeners.map(function (_a) {
|
|
92
|
-
var flags = _a[0], name = _a[1], method = _a[2];
|
|
93
|
-
var target = elm;
|
|
94
|
-
var handler = hostListenerProxy(hostRef, method);
|
|
95
|
-
var opts = hostListenerOpts(flags);
|
|
96
|
-
plt.ael(target, name, handler, opts);
|
|
97
|
-
(hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(function () { return plt.rel(target, name, handler, opts); });
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
};
|
|
101
|
-
var hostListenerProxy = function (hostRef, methodName) { return function (ev) {
|
|
102
|
-
{
|
|
103
|
-
if (hostRef.$flags$ & 256 /* isListenReady */) {
|
|
104
|
-
// instance is ready, let's call it's member method for this event
|
|
105
|
-
hostRef.$lazyInstance$[methodName](ev);
|
|
106
|
-
}
|
|
107
|
-
else {
|
|
108
|
-
(hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}; };
|
|
112
|
-
// prettier-ignore
|
|
113
|
-
var hostListenerOpts = function (flags) { return (flags & 2 /* Capture */) !== 0; };
|
|
114
|
-
var HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
|
|
115
|
-
var XLINK_NS = 'http://www.w3.org/1999/xlink';
|
|
116
|
-
var createTime = function (fnName, tagName) {
|
|
117
|
-
if (tagName === void 0) { tagName = ''; }
|
|
118
|
-
{
|
|
119
|
-
return function () {
|
|
120
|
-
return;
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
|
-
var uniqueTime = function (key, measureText) {
|
|
125
|
-
{
|
|
126
|
-
return function () {
|
|
127
|
-
return;
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
};
|
|
131
|
-
var rootAppliedStyles = new WeakMap();
|
|
132
|
-
var registerStyle = function (scopeId, cssText, allowCS) {
|
|
133
|
-
var style = styles.get(scopeId);
|
|
134
|
-
if (supportsConstructibleStylesheets && allowCS) {
|
|
135
|
-
style = (style || new CSSStyleSheet());
|
|
136
|
-
style.replace(cssText);
|
|
137
|
-
}
|
|
138
|
-
else {
|
|
139
|
-
style = cssText;
|
|
140
|
-
}
|
|
141
|
-
styles.set(scopeId, style);
|
|
142
|
-
};
|
|
143
|
-
var addStyle = function (styleContainerNode, cmpMeta, mode, hostElm) {
|
|
144
|
-
var scopeId = getScopeId(cmpMeta);
|
|
145
|
-
var style = styles.get(scopeId);
|
|
146
|
-
// if an element is NOT connected then getRootNode() will return the wrong root node
|
|
147
|
-
// so the fallback is to always use the document for the root node in those cases
|
|
148
|
-
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
|
|
149
|
-
if (style) {
|
|
150
|
-
if (typeof style === 'string') {
|
|
151
|
-
styleContainerNode = styleContainerNode.head || styleContainerNode;
|
|
152
|
-
var appliedStyles = rootAppliedStyles.get(styleContainerNode);
|
|
153
|
-
var styleElm = void 0;
|
|
154
|
-
if (!appliedStyles) {
|
|
155
|
-
rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
|
|
156
|
-
}
|
|
157
|
-
if (!appliedStyles.has(scopeId)) {
|
|
158
|
-
{
|
|
159
|
-
if (plt.$cssShim$) {
|
|
160
|
-
styleElm = plt.$cssShim$.createHostStyle(hostElm, scopeId, style, !!(cmpMeta.$flags$ & 10 /* needsScopedEncapsulation */));
|
|
161
|
-
var newScopeId = styleElm['s-sc'];
|
|
162
|
-
if (newScopeId) {
|
|
163
|
-
scopeId = newScopeId;
|
|
164
|
-
// we don't want to add this styleID to the appliedStyles Set
|
|
165
|
-
// since the cssVarShim might need to apply several different
|
|
166
|
-
// stylesheets for the same component
|
|
167
|
-
appliedStyles = null;
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
else {
|
|
171
|
-
styleElm = doc.createElement('style');
|
|
172
|
-
styleElm.innerHTML = style;
|
|
173
|
-
}
|
|
174
|
-
styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
|
|
175
|
-
}
|
|
176
|
-
if (appliedStyles) {
|
|
177
|
-
appliedStyles.add(scopeId);
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
|
|
182
|
-
styleContainerNode.adoptedStyleSheets = __spreadArrays(styleContainerNode.adoptedStyleSheets, [style]);
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
return scopeId;
|
|
186
|
-
};
|
|
187
|
-
var attachStyles = function (hostRef) {
|
|
188
|
-
var cmpMeta = hostRef.$cmpMeta$;
|
|
189
|
-
var elm = hostRef.$hostElement$;
|
|
190
|
-
var flags = cmpMeta.$flags$;
|
|
191
|
-
var endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
|
|
192
|
-
var scopeId = addStyle(supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta, hostRef.$modeName$, elm);
|
|
193
|
-
if (flags & 10 /* needsScopedEncapsulation */) {
|
|
194
|
-
// only required when we're NOT using native shadow dom (slot)
|
|
195
|
-
// or this browser doesn't support native shadow dom
|
|
196
|
-
// and this host element was NOT created with SSR
|
|
197
|
-
// let's pick out the inner content for slot projection
|
|
198
|
-
// create a node to represent where the original
|
|
199
|
-
// content was first placed, which is useful later on
|
|
200
|
-
// DOM WRITE!!
|
|
201
|
-
elm['s-sc'] = scopeId;
|
|
202
|
-
elm.classList.add(scopeId + '-h');
|
|
203
|
-
}
|
|
204
|
-
endAttachStyles();
|
|
205
|
-
};
|
|
206
|
-
var getScopeId = function (cmp, mode) { return 'sc-' + (cmp.$tagName$); };
|
|
207
|
-
/**
|
|
208
|
-
* Default style mode id
|
|
209
|
-
*/
|
|
210
|
-
/**
|
|
211
|
-
* Reusable empty obj/array
|
|
212
|
-
* Don't add values to these!!
|
|
213
|
-
*/
|
|
214
|
-
var EMPTY_OBJ = {};
|
|
215
|
-
/**
|
|
216
|
-
* Namespaces
|
|
217
|
-
*/
|
|
218
|
-
var SVG_NS = 'http://www.w3.org/2000/svg';
|
|
219
|
-
var HTML_NS = 'http://www.w3.org/1999/xhtml';
|
|
220
|
-
var isDef = function (v) { return v != null; };
|
|
221
|
-
var noop = function () {
|
|
222
|
-
/* noop*/
|
|
223
|
-
};
|
|
224
|
-
var isComplexType = function (o) {
|
|
225
|
-
// https://jsperf.com/typeof-fn-object/5
|
|
226
|
-
o = typeof o;
|
|
227
|
-
return o === 'object' || o === 'function';
|
|
228
|
-
};
|
|
229
|
-
var IS_DENO_ENV = typeof Deno !== 'undefined';
|
|
230
|
-
var IS_NODE_ENV = !IS_DENO_ENV &&
|
|
231
|
-
typeof global !== 'undefined' &&
|
|
232
|
-
typeof require === 'function' &&
|
|
233
|
-
!!global.process &&
|
|
234
|
-
typeof __filename === 'string' &&
|
|
235
|
-
(!global.origin || typeof global.origin !== 'string');
|
|
236
|
-
var IS_DENO_WINDOWS_ENV = IS_DENO_ENV && Deno.build.os === 'windows';
|
|
237
|
-
var getCurrentDirectory = IS_NODE_ENV ? process.cwd : IS_DENO_ENV ? Deno.cwd : function () { return '/'; };
|
|
238
|
-
var exit = IS_NODE_ENV ? process.exit : IS_DENO_ENV ? Deno.exit : noop;
|
|
239
|
-
/**
|
|
240
|
-
* Production h() function based on Preact by
|
|
241
|
-
* Jason Miller (@developit)
|
|
242
|
-
* Licensed under the MIT License
|
|
243
|
-
* https://github.com/developit/preact/blob/master/LICENSE
|
|
244
|
-
*
|
|
245
|
-
* Modified for Stencil's compiler and vdom
|
|
246
|
-
*/
|
|
247
|
-
// const stack: any[] = [];
|
|
248
|
-
// export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode;
|
|
249
|
-
// export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
|
|
250
|
-
var h = function (nodeName, vnodeData) {
|
|
251
|
-
var children = [];
|
|
252
|
-
for (var _i = 2; _i < arguments.length; _i++) {
|
|
253
|
-
children[_i - 2] = arguments[_i];
|
|
254
|
-
}
|
|
255
|
-
var child = null;
|
|
256
|
-
var key = null;
|
|
257
|
-
var slotName = null;
|
|
258
|
-
var simple = false;
|
|
259
|
-
var lastSimple = false;
|
|
260
|
-
var vNodeChildren = [];
|
|
261
|
-
var walk = function (c) {
|
|
262
|
-
for (var i = 0; i < c.length; i++) {
|
|
263
|
-
child = c[i];
|
|
264
|
-
if (Array.isArray(child)) {
|
|
265
|
-
walk(child);
|
|
266
|
-
}
|
|
267
|
-
else if (child != null && typeof child !== 'boolean') {
|
|
268
|
-
if ((simple = typeof nodeName !== 'function' && !isComplexType(child))) {
|
|
269
|
-
child = String(child);
|
|
270
|
-
}
|
|
271
|
-
if (simple && lastSimple) {
|
|
272
|
-
// If the previous child was simple (string), we merge both
|
|
273
|
-
vNodeChildren[vNodeChildren.length - 1].$text$ += child;
|
|
274
|
-
}
|
|
275
|
-
else {
|
|
276
|
-
// Append a new vNode, if it's text, we create a text vNode
|
|
277
|
-
vNodeChildren.push(simple ? newVNode(null, child) : child);
|
|
278
|
-
}
|
|
279
|
-
lastSimple = simple;
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
};
|
|
283
|
-
walk(children);
|
|
284
|
-
if (vnodeData) {
|
|
285
|
-
// normalize class / classname attributes
|
|
286
|
-
if (vnodeData.key) {
|
|
287
|
-
key = vnodeData.key;
|
|
288
|
-
}
|
|
289
|
-
if (vnodeData.name) {
|
|
290
|
-
slotName = vnodeData.name;
|
|
291
|
-
}
|
|
292
|
-
{
|
|
293
|
-
var classData_1 = vnodeData.className || vnodeData.class;
|
|
294
|
-
if (classData_1) {
|
|
295
|
-
vnodeData.class =
|
|
296
|
-
typeof classData_1 !== 'object'
|
|
297
|
-
? classData_1
|
|
298
|
-
: Object.keys(classData_1)
|
|
299
|
-
.filter(function (k) { return classData_1[k]; })
|
|
300
|
-
.join(' ');
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
if (typeof nodeName === 'function') {
|
|
305
|
-
// nodeName is a functional component
|
|
306
|
-
return nodeName(vnodeData === null ? {} : vnodeData, vNodeChildren, vdomFnUtils);
|
|
307
|
-
}
|
|
308
|
-
var vnode = newVNode(nodeName, null);
|
|
309
|
-
vnode.$attrs$ = vnodeData;
|
|
310
|
-
if (vNodeChildren.length > 0) {
|
|
311
|
-
vnode.$children$ = vNodeChildren;
|
|
312
|
-
}
|
|
313
|
-
{
|
|
314
|
-
vnode.$key$ = key;
|
|
315
|
-
}
|
|
316
|
-
{
|
|
317
|
-
vnode.$name$ = slotName;
|
|
318
|
-
}
|
|
319
|
-
return vnode;
|
|
320
|
-
};
|
|
321
|
-
var newVNode = function (tag, text) {
|
|
322
|
-
var vnode = {
|
|
323
|
-
$flags$: 0,
|
|
324
|
-
$tag$: tag,
|
|
325
|
-
$text$: text,
|
|
326
|
-
$elm$: null,
|
|
327
|
-
$children$: null,
|
|
328
|
-
};
|
|
329
|
-
{
|
|
330
|
-
vnode.$attrs$ = null;
|
|
331
|
-
}
|
|
332
|
-
{
|
|
333
|
-
vnode.$key$ = null;
|
|
334
|
-
}
|
|
335
|
-
{
|
|
336
|
-
vnode.$name$ = null;
|
|
337
|
-
}
|
|
338
|
-
return vnode;
|
|
339
|
-
};
|
|
340
|
-
var Host = {};
|
|
341
|
-
var isHost = function (node) { return node && node.$tag$ === Host; };
|
|
342
|
-
var vdomFnUtils = {
|
|
343
|
-
forEach: function (children, cb) { return children.map(convertToPublic).forEach(cb); },
|
|
344
|
-
map: function (children, cb) { return children
|
|
345
|
-
.map(convertToPublic)
|
|
346
|
-
.map(cb)
|
|
347
|
-
.map(convertToPrivate); },
|
|
348
|
-
};
|
|
349
|
-
var convertToPublic = function (node) { return ({
|
|
350
|
-
vattrs: node.$attrs$,
|
|
351
|
-
vchildren: node.$children$,
|
|
352
|
-
vkey: node.$key$,
|
|
353
|
-
vname: node.$name$,
|
|
354
|
-
vtag: node.$tag$,
|
|
355
|
-
vtext: node.$text$,
|
|
356
|
-
}); };
|
|
357
|
-
var convertToPrivate = function (node) {
|
|
358
|
-
if (typeof node.vtag === 'function') {
|
|
359
|
-
var vnodeData = Object.assign({}, node.vattrs);
|
|
360
|
-
if (node.vkey) {
|
|
361
|
-
vnodeData.key = node.vkey;
|
|
362
|
-
}
|
|
363
|
-
if (node.vname) {
|
|
364
|
-
vnodeData.name = node.vname;
|
|
365
|
-
}
|
|
366
|
-
return h.apply(void 0, __spreadArrays([node.vtag, vnodeData], node.vchildren || []));
|
|
367
|
-
}
|
|
368
|
-
var vnode = newVNode(node.vtag, node.vtext);
|
|
369
|
-
vnode.$attrs$ = node.vattrs;
|
|
370
|
-
vnode.$children$ = node.vchildren;
|
|
371
|
-
vnode.$key$ = node.vkey;
|
|
372
|
-
vnode.$name$ = node.vname;
|
|
373
|
-
return vnode;
|
|
374
|
-
};
|
|
375
|
-
/**
|
|
376
|
-
* Production setAccessor() function based on Preact by
|
|
377
|
-
* Jason Miller (@developit)
|
|
378
|
-
* Licensed under the MIT License
|
|
379
|
-
* https://github.com/developit/preact/blob/master/LICENSE
|
|
380
|
-
*
|
|
381
|
-
* Modified for Stencil's compiler and vdom
|
|
382
|
-
*/
|
|
383
|
-
var setAccessor = function (elm, memberName, oldValue, newValue, isSvg, flags) {
|
|
384
|
-
if (oldValue !== newValue) {
|
|
385
|
-
var isProp = isMemberInElement(elm, memberName);
|
|
386
|
-
var ln = memberName.toLowerCase();
|
|
387
|
-
if (memberName === 'class') {
|
|
388
|
-
var classList = elm.classList;
|
|
389
|
-
var oldClasses_1 = parseClassList(oldValue);
|
|
390
|
-
var newClasses_1 = parseClassList(newValue);
|
|
391
|
-
classList.remove.apply(classList, oldClasses_1.filter(function (c) { return c && !newClasses_1.includes(c); }));
|
|
392
|
-
classList.add.apply(classList, newClasses_1.filter(function (c) { return c && !oldClasses_1.includes(c); }));
|
|
393
|
-
}
|
|
394
|
-
else if (memberName === 'style') {
|
|
395
|
-
// update style attribute, css properties and values
|
|
396
|
-
{
|
|
397
|
-
for (var prop in oldValue) {
|
|
398
|
-
if (!newValue || newValue[prop] == null) {
|
|
399
|
-
if (prop.includes('-')) {
|
|
400
|
-
elm.style.removeProperty(prop);
|
|
401
|
-
}
|
|
402
|
-
else {
|
|
403
|
-
elm.style[prop] = '';
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
for (var prop in newValue) {
|
|
409
|
-
if (!oldValue || newValue[prop] !== oldValue[prop]) {
|
|
410
|
-
if (prop.includes('-')) {
|
|
411
|
-
elm.style.setProperty(prop, newValue[prop]);
|
|
412
|
-
}
|
|
413
|
-
else {
|
|
414
|
-
elm.style[prop] = newValue[prop];
|
|
415
|
-
}
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
else if (memberName === 'key')
|
|
420
|
-
;
|
|
421
|
-
else if (memberName === 'ref') {
|
|
422
|
-
// minifier will clean this up
|
|
423
|
-
if (newValue) {
|
|
424
|
-
newValue(elm);
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
else if ((!isProp) && memberName[0] === 'o' && memberName[1] === 'n') {
|
|
428
|
-
// Event Handlers
|
|
429
|
-
// so if the member name starts with "on" and the 3rd characters is
|
|
430
|
-
// a capital letter, and it's not already a member on the element,
|
|
431
|
-
// then we're assuming it's an event listener
|
|
432
|
-
if (memberName[2] === '-') {
|
|
433
|
-
// on- prefixed events
|
|
434
|
-
// allows to be explicit about the dom event to listen without any magic
|
|
435
|
-
// under the hood:
|
|
436
|
-
// <my-cmp on-click> // listens for "click"
|
|
437
|
-
// <my-cmp on-Click> // listens for "Click"
|
|
438
|
-
// <my-cmp on-ionChange> // listens for "ionChange"
|
|
439
|
-
// <my-cmp on-EVENTS> // listens for "EVENTS"
|
|
440
|
-
memberName = memberName.slice(3);
|
|
441
|
-
}
|
|
442
|
-
else if (isMemberInElement(win, ln)) {
|
|
443
|
-
// standard event
|
|
444
|
-
// the JSX attribute could have been "onMouseOver" and the
|
|
445
|
-
// member name "onmouseover" is on the window's prototype
|
|
446
|
-
// so let's add the listener "mouseover", which is all lowercased
|
|
447
|
-
memberName = ln.slice(2);
|
|
448
|
-
}
|
|
449
|
-
else {
|
|
450
|
-
// custom event
|
|
451
|
-
// the JSX attribute could have been "onMyCustomEvent"
|
|
452
|
-
// so let's trim off the "on" prefix and lowercase the first character
|
|
453
|
-
// and add the listener "myCustomEvent"
|
|
454
|
-
// except for the first character, we keep the event name case
|
|
455
|
-
memberName = ln[2] + memberName.slice(3);
|
|
456
|
-
}
|
|
457
|
-
if (oldValue) {
|
|
458
|
-
plt.rel(elm, memberName, oldValue, false);
|
|
459
|
-
}
|
|
460
|
-
if (newValue) {
|
|
461
|
-
plt.ael(elm, memberName, newValue, false);
|
|
462
|
-
}
|
|
463
|
-
}
|
|
464
|
-
else {
|
|
465
|
-
// Set property if it exists and it's not a SVG
|
|
466
|
-
var isComplex = isComplexType(newValue);
|
|
467
|
-
if ((isProp || (isComplex && newValue !== null)) && !isSvg) {
|
|
468
|
-
try {
|
|
469
|
-
if (!elm.tagName.includes('-')) {
|
|
470
|
-
var n = newValue == null ? '' : newValue;
|
|
471
|
-
// Workaround for Safari, moving the <input> caret when re-assigning the same valued
|
|
472
|
-
if (memberName === 'list') {
|
|
473
|
-
isProp = false;
|
|
474
|
-
// tslint:disable-next-line: triple-equals
|
|
475
|
-
}
|
|
476
|
-
else if (oldValue == null || elm[memberName] != n) {
|
|
477
|
-
elm[memberName] = n;
|
|
478
|
-
}
|
|
479
|
-
}
|
|
480
|
-
else {
|
|
481
|
-
elm[memberName] = newValue;
|
|
482
|
-
}
|
|
483
|
-
}
|
|
484
|
-
catch (e) { }
|
|
485
|
-
}
|
|
486
|
-
/**
|
|
487
|
-
* Need to manually update attribute if:
|
|
488
|
-
* - memberName is not an attribute
|
|
489
|
-
* - if we are rendering the host element in order to reflect attribute
|
|
490
|
-
* - if it's a SVG, since properties might not work in <svg>
|
|
491
|
-
* - if the newValue is null/undefined or 'false'.
|
|
492
|
-
*/
|
|
493
|
-
var xlink = false;
|
|
494
|
-
{
|
|
495
|
-
if (ln !== (ln = ln.replace(/^xlink\:?/, ''))) {
|
|
496
|
-
memberName = ln;
|
|
497
|
-
xlink = true;
|
|
498
|
-
}
|
|
499
|
-
}
|
|
500
|
-
if (newValue == null || newValue === false) {
|
|
501
|
-
if (newValue !== false || elm.getAttribute(memberName) === '') {
|
|
502
|
-
if (xlink) {
|
|
503
|
-
elm.removeAttributeNS(XLINK_NS, memberName);
|
|
504
|
-
}
|
|
505
|
-
else {
|
|
506
|
-
elm.removeAttribute(memberName);
|
|
507
|
-
}
|
|
508
|
-
}
|
|
509
|
-
}
|
|
510
|
-
else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
|
|
511
|
-
newValue = newValue === true ? '' : newValue;
|
|
512
|
-
if (xlink) {
|
|
513
|
-
elm.setAttributeNS(XLINK_NS, memberName, newValue);
|
|
514
|
-
}
|
|
515
|
-
else {
|
|
516
|
-
elm.setAttribute(memberName, newValue);
|
|
517
|
-
}
|
|
518
|
-
}
|
|
519
|
-
}
|
|
520
|
-
}
|
|
521
|
-
};
|
|
522
|
-
var parseClassListRegex = /\s/;
|
|
523
|
-
var parseClassList = function (value) { return (!value ? [] : value.split(parseClassListRegex)); };
|
|
524
|
-
var updateElement = function (oldVnode, newVnode, isSvgMode, memberName) {
|
|
525
|
-
// if the element passed in is a shadow root, which is a document fragment
|
|
526
|
-
// then we want to be adding attrs/props to the shadow root's "host" element
|
|
527
|
-
// if it's not a shadow root, then we add attrs/props to the same element
|
|
528
|
-
var elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
|
|
529
|
-
var oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
|
|
530
|
-
var newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
|
|
531
|
-
{
|
|
532
|
-
// remove attributes no longer present on the vnode by setting them to undefined
|
|
533
|
-
for (memberName in oldVnodeAttrs) {
|
|
534
|
-
if (!(memberName in newVnodeAttrs)) {
|
|
535
|
-
setAccessor(elm, memberName, oldVnodeAttrs[memberName], undefined, isSvgMode, newVnode.$flags$);
|
|
536
|
-
}
|
|
537
|
-
}
|
|
538
|
-
}
|
|
539
|
-
// add new & update changed attributes
|
|
540
|
-
for (memberName in newVnodeAttrs) {
|
|
541
|
-
setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
|
|
542
|
-
}
|
|
543
|
-
};
|
|
544
|
-
var createElm = function (oldParentVNode, newParentVNode, childIndex, parentElm) {
|
|
545
|
-
// tslint:disable-next-line: prefer-const
|
|
546
|
-
var newVNode = newParentVNode.$children$[childIndex];
|
|
547
|
-
var i = 0;
|
|
548
|
-
var elm;
|
|
549
|
-
var childNode;
|
|
550
|
-
var oldVNode;
|
|
551
|
-
if (!useNativeShadowDom) {
|
|
552
|
-
// remember for later we need to check to relocate nodes
|
|
553
|
-
checkSlotRelocate = true;
|
|
554
|
-
if (newVNode.$tag$ === 'slot') {
|
|
555
|
-
if (scopeId) {
|
|
556
|
-
// scoped css needs to add its scoped id to the parent element
|
|
557
|
-
parentElm.classList.add(scopeId + '-s');
|
|
558
|
-
}
|
|
559
|
-
newVNode.$flags$ |= newVNode.$children$
|
|
560
|
-
? // slot element has fallback content
|
|
561
|
-
2 /* isSlotFallback */
|
|
562
|
-
: // slot element does not have fallback content
|
|
563
|
-
1 /* isSlotReference */;
|
|
564
|
-
}
|
|
565
|
-
}
|
|
566
|
-
if (newVNode.$text$ !== null) {
|
|
567
|
-
// create text node
|
|
568
|
-
elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
|
|
569
|
-
}
|
|
570
|
-
else if (newVNode.$flags$ & 1 /* isSlotReference */) {
|
|
571
|
-
// create a slot reference node
|
|
572
|
-
elm = newVNode.$elm$ = doc.createTextNode('');
|
|
573
|
-
}
|
|
574
|
-
else {
|
|
575
|
-
if (!isSvgMode) {
|
|
576
|
-
isSvgMode = newVNode.$tag$ === 'svg';
|
|
577
|
-
}
|
|
578
|
-
// create element
|
|
579
|
-
elm = newVNode.$elm$ = (doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, newVNode.$flags$ & 2 /* isSlotFallback */ ? 'slot-fb' : newVNode.$tag$));
|
|
580
|
-
if (isSvgMode && newVNode.$tag$ === 'foreignObject') {
|
|
581
|
-
isSvgMode = false;
|
|
582
|
-
}
|
|
583
|
-
// add css classes, attrs, props, listeners, etc.
|
|
584
|
-
{
|
|
585
|
-
updateElement(null, newVNode, isSvgMode);
|
|
586
|
-
}
|
|
587
|
-
if (isDef(scopeId) && elm['s-si'] !== scopeId) {
|
|
588
|
-
// if there is a scopeId and this is the initial render
|
|
589
|
-
// then let's add the scopeId as a css class
|
|
590
|
-
elm.classList.add((elm['s-si'] = scopeId));
|
|
591
|
-
}
|
|
592
|
-
if (newVNode.$children$) {
|
|
593
|
-
for (i = 0; i < newVNode.$children$.length; ++i) {
|
|
594
|
-
// create the node
|
|
595
|
-
childNode = createElm(oldParentVNode, newVNode, i, elm);
|
|
596
|
-
// return node could have been null
|
|
597
|
-
if (childNode) {
|
|
598
|
-
// append our new node
|
|
599
|
-
elm.appendChild(childNode);
|
|
600
|
-
}
|
|
601
|
-
}
|
|
602
|
-
}
|
|
603
|
-
{
|
|
604
|
-
if (newVNode.$tag$ === 'svg') {
|
|
605
|
-
// Only reset the SVG context when we're exiting <svg> element
|
|
606
|
-
isSvgMode = false;
|
|
607
|
-
}
|
|
608
|
-
else if (elm.tagName === 'foreignObject') {
|
|
609
|
-
// Reenter SVG context when we're exiting <foreignObject> element
|
|
610
|
-
isSvgMode = true;
|
|
611
|
-
}
|
|
612
|
-
}
|
|
613
|
-
}
|
|
614
|
-
{
|
|
615
|
-
elm['s-hn'] = hostTagName;
|
|
616
|
-
if (newVNode.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {
|
|
617
|
-
// remember the content reference comment
|
|
618
|
-
elm['s-sr'] = true;
|
|
619
|
-
// remember the content reference comment
|
|
620
|
-
elm['s-cr'] = contentRef;
|
|
621
|
-
// remember the slot name, or empty string for default slot
|
|
622
|
-
elm['s-sn'] = newVNode.$name$ || '';
|
|
623
|
-
// check if we've got an old vnode for this slot
|
|
624
|
-
oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
|
|
625
|
-
if (oldVNode && oldVNode.$tag$ === newVNode.$tag$ && oldParentVNode.$elm$) {
|
|
626
|
-
// we've got an old slot vnode and the wrapper is being replaced
|
|
627
|
-
// so let's move the old slot content back to it's original location
|
|
628
|
-
putBackInOriginalLocation(oldParentVNode.$elm$, false);
|
|
629
|
-
}
|
|
630
|
-
}
|
|
631
|
-
}
|
|
632
|
-
return elm;
|
|
633
|
-
};
|
|
634
|
-
var putBackInOriginalLocation = function (parentElm, recursive) {
|
|
635
|
-
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
636
|
-
var oldSlotChildNodes = parentElm.childNodes;
|
|
637
|
-
for (var i = oldSlotChildNodes.length - 1; i >= 0; i--) {
|
|
638
|
-
var childNode = oldSlotChildNodes[i];
|
|
639
|
-
if (childNode['s-hn'] !== hostTagName && childNode['s-ol']) {
|
|
640
|
-
// // this child node in the old element is from another component
|
|
641
|
-
// // remove this node from the old slot's parent
|
|
642
|
-
// childNode.remove();
|
|
643
|
-
// and relocate it back to it's original location
|
|
644
|
-
parentReferenceNode(childNode).insertBefore(childNode, referenceNode(childNode));
|
|
645
|
-
// remove the old original location comment entirely
|
|
646
|
-
// later on the patch function will know what to do
|
|
647
|
-
// and move this to the correct spot in need be
|
|
648
|
-
childNode['s-ol'].remove();
|
|
649
|
-
childNode['s-ol'] = undefined;
|
|
650
|
-
checkSlotRelocate = true;
|
|
651
|
-
}
|
|
652
|
-
if (recursive) {
|
|
653
|
-
putBackInOriginalLocation(childNode, recursive);
|
|
654
|
-
}
|
|
655
|
-
}
|
|
656
|
-
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
657
|
-
};
|
|
658
|
-
var addVnodes = function (parentElm, before, parentVNode, vnodes, startIdx, endIdx) {
|
|
659
|
-
var containerElm = ((parentElm['s-cr'] && parentElm['s-cr'].parentNode) || parentElm);
|
|
660
|
-
var childNode;
|
|
661
|
-
if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
|
|
662
|
-
containerElm = containerElm.shadowRoot;
|
|
663
|
-
}
|
|
664
|
-
for (; startIdx <= endIdx; ++startIdx) {
|
|
665
|
-
if (vnodes[startIdx]) {
|
|
666
|
-
childNode = createElm(null, parentVNode, startIdx, parentElm);
|
|
667
|
-
if (childNode) {
|
|
668
|
-
vnodes[startIdx].$elm$ = childNode;
|
|
669
|
-
containerElm.insertBefore(childNode, referenceNode(before));
|
|
670
|
-
}
|
|
671
|
-
}
|
|
672
|
-
}
|
|
673
|
-
};
|
|
674
|
-
var removeVnodes = function (vnodes, startIdx, endIdx, vnode, elm) {
|
|
675
|
-
for (; startIdx <= endIdx; ++startIdx) {
|
|
676
|
-
if ((vnode = vnodes[startIdx])) {
|
|
677
|
-
elm = vnode.$elm$;
|
|
678
|
-
callNodeRefs(vnode);
|
|
679
|
-
{
|
|
680
|
-
// we're removing this element
|
|
681
|
-
// so it's possible we need to show slot fallback content now
|
|
682
|
-
checkSlotFallbackVisibility = true;
|
|
683
|
-
if (elm['s-ol']) {
|
|
684
|
-
// remove the original location comment
|
|
685
|
-
elm['s-ol'].remove();
|
|
686
|
-
}
|
|
687
|
-
else {
|
|
688
|
-
// it's possible that child nodes of the node
|
|
689
|
-
// that's being removed are slot nodes
|
|
690
|
-
putBackInOriginalLocation(elm, true);
|
|
691
|
-
}
|
|
692
|
-
}
|
|
693
|
-
// remove the vnode's element from the dom
|
|
694
|
-
elm.remove();
|
|
695
|
-
}
|
|
696
|
-
}
|
|
697
|
-
};
|
|
698
|
-
var updateChildren = function (parentElm, oldCh, newVNode, newCh) {
|
|
699
|
-
var oldStartIdx = 0;
|
|
700
|
-
var newStartIdx = 0;
|
|
701
|
-
var idxInOld = 0;
|
|
702
|
-
var i = 0;
|
|
703
|
-
var oldEndIdx = oldCh.length - 1;
|
|
704
|
-
var oldStartVnode = oldCh[0];
|
|
705
|
-
var oldEndVnode = oldCh[oldEndIdx];
|
|
706
|
-
var newEndIdx = newCh.length - 1;
|
|
707
|
-
var newStartVnode = newCh[0];
|
|
708
|
-
var newEndVnode = newCh[newEndIdx];
|
|
709
|
-
var node;
|
|
710
|
-
var elmToMove;
|
|
711
|
-
while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
|
|
712
|
-
if (oldStartVnode == null) {
|
|
713
|
-
// Vnode might have been moved left
|
|
714
|
-
oldStartVnode = oldCh[++oldStartIdx];
|
|
715
|
-
}
|
|
716
|
-
else if (oldEndVnode == null) {
|
|
717
|
-
oldEndVnode = oldCh[--oldEndIdx];
|
|
718
|
-
}
|
|
719
|
-
else if (newStartVnode == null) {
|
|
720
|
-
newStartVnode = newCh[++newStartIdx];
|
|
721
|
-
}
|
|
722
|
-
else if (newEndVnode == null) {
|
|
723
|
-
newEndVnode = newCh[--newEndIdx];
|
|
724
|
-
}
|
|
725
|
-
else if (isSameVnode(oldStartVnode, newStartVnode)) {
|
|
726
|
-
patch(oldStartVnode, newStartVnode);
|
|
727
|
-
oldStartVnode = oldCh[++oldStartIdx];
|
|
728
|
-
newStartVnode = newCh[++newStartIdx];
|
|
729
|
-
}
|
|
730
|
-
else if (isSameVnode(oldEndVnode, newEndVnode)) {
|
|
731
|
-
patch(oldEndVnode, newEndVnode);
|
|
732
|
-
oldEndVnode = oldCh[--oldEndIdx];
|
|
733
|
-
newEndVnode = newCh[--newEndIdx];
|
|
734
|
-
}
|
|
735
|
-
else if (isSameVnode(oldStartVnode, newEndVnode)) {
|
|
736
|
-
// Vnode moved right
|
|
737
|
-
if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
|
|
738
|
-
putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
|
|
739
|
-
}
|
|
740
|
-
patch(oldStartVnode, newEndVnode);
|
|
741
|
-
parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
|
|
742
|
-
oldStartVnode = oldCh[++oldStartIdx];
|
|
743
|
-
newEndVnode = newCh[--newEndIdx];
|
|
744
|
-
}
|
|
745
|
-
else if (isSameVnode(oldEndVnode, newStartVnode)) {
|
|
746
|
-
// Vnode moved left
|
|
747
|
-
if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
|
|
748
|
-
putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
|
|
749
|
-
}
|
|
750
|
-
patch(oldEndVnode, newStartVnode);
|
|
751
|
-
parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
|
|
752
|
-
oldEndVnode = oldCh[--oldEndIdx];
|
|
753
|
-
newStartVnode = newCh[++newStartIdx];
|
|
754
|
-
}
|
|
755
|
-
else {
|
|
756
|
-
// createKeyToOldIdx
|
|
757
|
-
idxInOld = -1;
|
|
758
|
-
{
|
|
759
|
-
for (i = oldStartIdx; i <= oldEndIdx; ++i) {
|
|
760
|
-
if (oldCh[i] && oldCh[i].$key$ !== null && oldCh[i].$key$ === newStartVnode.$key$) {
|
|
761
|
-
idxInOld = i;
|
|
762
|
-
break;
|
|
763
|
-
}
|
|
764
|
-
}
|
|
765
|
-
}
|
|
766
|
-
if (idxInOld >= 0) {
|
|
767
|
-
elmToMove = oldCh[idxInOld];
|
|
768
|
-
if (elmToMove.$tag$ !== newStartVnode.$tag$) {
|
|
769
|
-
node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld, parentElm);
|
|
770
|
-
}
|
|
771
|
-
else {
|
|
772
|
-
patch(elmToMove, newStartVnode);
|
|
773
|
-
oldCh[idxInOld] = undefined;
|
|
774
|
-
node = elmToMove.$elm$;
|
|
775
|
-
}
|
|
776
|
-
newStartVnode = newCh[++newStartIdx];
|
|
777
|
-
}
|
|
778
|
-
else {
|
|
779
|
-
// new element
|
|
780
|
-
node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx, parentElm);
|
|
781
|
-
newStartVnode = newCh[++newStartIdx];
|
|
782
|
-
}
|
|
783
|
-
if (node) {
|
|
784
|
-
{
|
|
785
|
-
parentReferenceNode(oldStartVnode.$elm$).insertBefore(node, referenceNode(oldStartVnode.$elm$));
|
|
786
|
-
}
|
|
787
|
-
}
|
|
788
|
-
}
|
|
789
|
-
}
|
|
790
|
-
if (oldStartIdx > oldEndIdx) {
|
|
791
|
-
addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
|
|
792
|
-
}
|
|
793
|
-
else if (newStartIdx > newEndIdx) {
|
|
794
|
-
removeVnodes(oldCh, oldStartIdx, oldEndIdx);
|
|
795
|
-
}
|
|
796
|
-
};
|
|
797
|
-
var isSameVnode = function (vnode1, vnode2) {
|
|
798
|
-
// compare if two vnode to see if they're "technically" the same
|
|
799
|
-
// need to have the same element tag, and same key to be the same
|
|
800
|
-
if (vnode1.$tag$ === vnode2.$tag$) {
|
|
801
|
-
if (vnode1.$tag$ === 'slot') {
|
|
802
|
-
return vnode1.$name$ === vnode2.$name$;
|
|
803
|
-
}
|
|
804
|
-
{
|
|
805
|
-
return vnode1.$key$ === vnode2.$key$;
|
|
806
|
-
}
|
|
807
|
-
}
|
|
808
|
-
return false;
|
|
809
|
-
};
|
|
810
|
-
var referenceNode = function (node) {
|
|
811
|
-
// this node was relocated to a new location in the dom
|
|
812
|
-
// because of some other component's slot
|
|
813
|
-
// but we still have an html comment in place of where
|
|
814
|
-
// it's original location was according to it's original vdom
|
|
815
|
-
return (node && node['s-ol']) || node;
|
|
816
|
-
};
|
|
817
|
-
var parentReferenceNode = function (node) { return (node['s-ol'] ? node['s-ol'] : node).parentNode; };
|
|
818
|
-
var patch = function (oldVNode, newVNode) {
|
|
819
|
-
var elm = (newVNode.$elm$ = oldVNode.$elm$);
|
|
820
|
-
var oldChildren = oldVNode.$children$;
|
|
821
|
-
var newChildren = newVNode.$children$;
|
|
822
|
-
var tag = newVNode.$tag$;
|
|
823
|
-
var text = newVNode.$text$;
|
|
824
|
-
var defaultHolder;
|
|
825
|
-
if (text === null) {
|
|
826
|
-
{
|
|
827
|
-
// test if we're rendering an svg element, or still rendering nodes inside of one
|
|
828
|
-
// only add this to the when the compiler sees we're using an svg somewhere
|
|
829
|
-
isSvgMode = tag === 'svg' ? true : tag === 'foreignObject' ? false : isSvgMode;
|
|
830
|
-
}
|
|
831
|
-
// element node
|
|
832
|
-
{
|
|
833
|
-
if (tag === 'slot')
|
|
834
|
-
;
|
|
835
|
-
else {
|
|
836
|
-
// either this is the first render of an element OR it's an update
|
|
837
|
-
// AND we already know it's possible it could have changed
|
|
838
|
-
// this updates the element's css classes, attrs, props, listeners, etc.
|
|
839
|
-
updateElement(oldVNode, newVNode, isSvgMode);
|
|
840
|
-
}
|
|
841
|
-
}
|
|
842
|
-
if (oldChildren !== null && newChildren !== null) {
|
|
843
|
-
// looks like there's child vnodes for both the old and new vnodes
|
|
844
|
-
updateChildren(elm, oldChildren, newVNode, newChildren);
|
|
845
|
-
}
|
|
846
|
-
else if (newChildren !== null) {
|
|
847
|
-
// no old child vnodes, but there are new child vnodes to add
|
|
848
|
-
if (oldVNode.$text$ !== null) {
|
|
849
|
-
// the old vnode was text, so be sure to clear it out
|
|
850
|
-
elm.textContent = '';
|
|
851
|
-
}
|
|
852
|
-
// add the new vnode children
|
|
853
|
-
addVnodes(elm, null, newVNode, newChildren, 0, newChildren.length - 1);
|
|
854
|
-
}
|
|
855
|
-
else if (oldChildren !== null) {
|
|
856
|
-
// no new child vnodes, but there are old child vnodes to remove
|
|
857
|
-
removeVnodes(oldChildren, 0, oldChildren.length - 1);
|
|
858
|
-
}
|
|
859
|
-
if (isSvgMode && tag === 'svg') {
|
|
860
|
-
isSvgMode = false;
|
|
861
|
-
}
|
|
862
|
-
}
|
|
863
|
-
else if ((defaultHolder = elm['s-cr'])) {
|
|
864
|
-
// this element has slotted content
|
|
865
|
-
defaultHolder.parentNode.textContent = text;
|
|
866
|
-
}
|
|
867
|
-
else if (oldVNode.$text$ !== text) {
|
|
868
|
-
// update the text content for the text only vnode
|
|
869
|
-
// and also only if the text is different than before
|
|
870
|
-
elm.data = text;
|
|
871
|
-
}
|
|
872
|
-
};
|
|
873
|
-
var updateFallbackSlotVisibility = function (elm) {
|
|
874
|
-
// tslint:disable-next-line: prefer-const
|
|
875
|
-
var childNodes = elm.childNodes;
|
|
876
|
-
var childNode;
|
|
877
|
-
var i;
|
|
878
|
-
var ilen;
|
|
879
|
-
var j;
|
|
880
|
-
var slotNameAttr;
|
|
881
|
-
var nodeType;
|
|
882
|
-
for (i = 0, ilen = childNodes.length; i < ilen; i++) {
|
|
883
|
-
childNode = childNodes[i];
|
|
884
|
-
if (childNode.nodeType === 1 /* ElementNode */) {
|
|
885
|
-
if (childNode['s-sr']) {
|
|
886
|
-
// this is a slot fallback node
|
|
887
|
-
// get the slot name for this slot reference node
|
|
888
|
-
slotNameAttr = childNode['s-sn'];
|
|
889
|
-
// by default always show a fallback slot node
|
|
890
|
-
// then hide it if there are other slots in the light dom
|
|
891
|
-
childNode.hidden = false;
|
|
892
|
-
for (j = 0; j < ilen; j++) {
|
|
893
|
-
if (childNodes[j]['s-hn'] !== childNode['s-hn']) {
|
|
894
|
-
// this sibling node is from a different component
|
|
895
|
-
nodeType = childNodes[j].nodeType;
|
|
896
|
-
if (slotNameAttr !== '') {
|
|
897
|
-
// this is a named fallback slot node
|
|
898
|
-
if (nodeType === 1 /* ElementNode */ && slotNameAttr === childNodes[j].getAttribute('slot')) {
|
|
899
|
-
childNode.hidden = true;
|
|
900
|
-
break;
|
|
901
|
-
}
|
|
902
|
-
}
|
|
903
|
-
else {
|
|
904
|
-
// this is a default fallback slot node
|
|
905
|
-
// any element or text node (with content)
|
|
906
|
-
// should hide the default fallback slot node
|
|
907
|
-
if (nodeType === 1 /* ElementNode */ || (nodeType === 3 /* TextNode */ && childNodes[j].textContent.trim() !== '')) {
|
|
908
|
-
childNode.hidden = true;
|
|
909
|
-
break;
|
|
910
|
-
}
|
|
911
|
-
}
|
|
912
|
-
}
|
|
913
|
-
}
|
|
914
|
-
}
|
|
915
|
-
// keep drilling down
|
|
916
|
-
updateFallbackSlotVisibility(childNode);
|
|
917
|
-
}
|
|
918
|
-
}
|
|
919
|
-
};
|
|
920
|
-
var relocateNodes = [];
|
|
921
|
-
var relocateSlotContent = function (elm) {
|
|
922
|
-
// tslint:disable-next-line: prefer-const
|
|
923
|
-
var childNode;
|
|
924
|
-
var node;
|
|
925
|
-
var hostContentNodes;
|
|
926
|
-
var slotNameAttr;
|
|
927
|
-
var relocateNodeData;
|
|
928
|
-
var j;
|
|
929
|
-
var i = 0;
|
|
930
|
-
var childNodes = elm.childNodes;
|
|
931
|
-
var ilen = childNodes.length;
|
|
932
|
-
for (; i < ilen; i++) {
|
|
933
|
-
childNode = childNodes[i];
|
|
934
|
-
if (childNode['s-sr'] && (node = childNode['s-cr'])) {
|
|
935
|
-
// first got the content reference comment node
|
|
936
|
-
// then we got it's parent, which is where all the host content is in now
|
|
937
|
-
hostContentNodes = node.parentNode.childNodes;
|
|
938
|
-
slotNameAttr = childNode['s-sn'];
|
|
939
|
-
for (j = hostContentNodes.length - 1; j >= 0; j--) {
|
|
940
|
-
node = hostContentNodes[j];
|
|
941
|
-
if (!node['s-cn'] && !node['s-nr'] && node['s-hn'] !== childNode['s-hn']) {
|
|
942
|
-
// let's do some relocating to its new home
|
|
943
|
-
// but never relocate a content reference node
|
|
944
|
-
// that is suppose to always represent the original content location
|
|
945
|
-
if (isNodeLocatedInSlot(node, slotNameAttr)) {
|
|
946
|
-
// it's possible we've already decided to relocate this node
|
|
947
|
-
relocateNodeData = relocateNodes.find(function (r) { return r.$nodeToRelocate$ === node; });
|
|
948
|
-
// made some changes to slots
|
|
949
|
-
// let's make sure we also double check
|
|
950
|
-
// fallbacks are correctly hidden or shown
|
|
951
|
-
checkSlotFallbackVisibility = true;
|
|
952
|
-
node['s-sn'] = node['s-sn'] || slotNameAttr;
|
|
953
|
-
if (relocateNodeData) {
|
|
954
|
-
// previously we never found a slot home for this node
|
|
955
|
-
// but turns out we did, so let's remember it now
|
|
956
|
-
relocateNodeData.$slotRefNode$ = childNode;
|
|
957
|
-
}
|
|
958
|
-
else {
|
|
959
|
-
// add to our list of nodes to relocate
|
|
960
|
-
relocateNodes.push({
|
|
961
|
-
$slotRefNode$: childNode,
|
|
962
|
-
$nodeToRelocate$: node,
|
|
963
|
-
});
|
|
964
|
-
}
|
|
965
|
-
if (node['s-sr']) {
|
|
966
|
-
relocateNodes.map(function (relocateNode) {
|
|
967
|
-
if (isNodeLocatedInSlot(relocateNode.$nodeToRelocate$, node['s-sn'])) {
|
|
968
|
-
relocateNodeData = relocateNodes.find(function (r) { return r.$nodeToRelocate$ === node; });
|
|
969
|
-
if (relocateNodeData && !relocateNode.$slotRefNode$) {
|
|
970
|
-
relocateNode.$slotRefNode$ = relocateNodeData.$slotRefNode$;
|
|
971
|
-
}
|
|
972
|
-
}
|
|
973
|
-
});
|
|
974
|
-
}
|
|
975
|
-
}
|
|
976
|
-
else if (!relocateNodes.some(function (r) { return r.$nodeToRelocate$ === node; })) {
|
|
977
|
-
// so far this element does not have a slot home, not setting slotRefNode on purpose
|
|
978
|
-
// if we never find a home for this element then we'll need to hide it
|
|
979
|
-
relocateNodes.push({
|
|
980
|
-
$nodeToRelocate$: node,
|
|
981
|
-
});
|
|
982
|
-
}
|
|
983
|
-
}
|
|
984
|
-
}
|
|
985
|
-
}
|
|
986
|
-
if (childNode.nodeType === 1 /* ElementNode */) {
|
|
987
|
-
relocateSlotContent(childNode);
|
|
988
|
-
}
|
|
989
|
-
}
|
|
990
|
-
};
|
|
991
|
-
var isNodeLocatedInSlot = function (nodeToRelocate, slotNameAttr) {
|
|
992
|
-
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
993
|
-
if (nodeToRelocate.getAttribute('slot') === null && slotNameAttr === '') {
|
|
994
|
-
return true;
|
|
995
|
-
}
|
|
996
|
-
if (nodeToRelocate.getAttribute('slot') === slotNameAttr) {
|
|
997
|
-
return true;
|
|
998
|
-
}
|
|
999
|
-
return false;
|
|
1000
|
-
}
|
|
1001
|
-
if (nodeToRelocate['s-sn'] === slotNameAttr) {
|
|
1002
|
-
return true;
|
|
1003
|
-
}
|
|
1004
|
-
return slotNameAttr === '';
|
|
1005
|
-
};
|
|
1006
|
-
var callNodeRefs = function (vNode) {
|
|
1007
|
-
{
|
|
1008
|
-
vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
|
|
1009
|
-
vNode.$children$ && vNode.$children$.map(callNodeRefs);
|
|
1010
|
-
}
|
|
1011
|
-
};
|
|
1012
|
-
var renderVdom = function (hostRef, renderFnResults) {
|
|
1013
|
-
var hostElm = hostRef.$hostElement$;
|
|
1014
|
-
var cmpMeta = hostRef.$cmpMeta$;
|
|
1015
|
-
var oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
1016
|
-
var rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
|
|
1017
|
-
hostTagName = hostElm.tagName;
|
|
1018
|
-
if (cmpMeta.$attrsToReflect$) {
|
|
1019
|
-
rootVnode.$attrs$ = rootVnode.$attrs$ || {};
|
|
1020
|
-
cmpMeta.$attrsToReflect$.map(function (_a) {
|
|
1021
|
-
var propName = _a[0], attribute = _a[1];
|
|
1022
|
-
return (rootVnode.$attrs$[attribute] = hostElm[propName]);
|
|
1023
|
-
});
|
|
1024
|
-
}
|
|
1025
|
-
rootVnode.$tag$ = null;
|
|
1026
|
-
rootVnode.$flags$ |= 4 /* isHost */;
|
|
1027
|
-
hostRef.$vnode$ = rootVnode;
|
|
1028
|
-
rootVnode.$elm$ = oldVNode.$elm$ = (hostElm.shadowRoot || hostElm);
|
|
1029
|
-
{
|
|
1030
|
-
scopeId = hostElm['s-sc'];
|
|
1031
|
-
}
|
|
1032
|
-
{
|
|
1033
|
-
contentRef = hostElm['s-cr'];
|
|
1034
|
-
useNativeShadowDom = supportsShadow && (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
|
|
1035
|
-
// always reset
|
|
1036
|
-
checkSlotFallbackVisibility = false;
|
|
1037
|
-
}
|
|
1038
|
-
// synchronous patch
|
|
1039
|
-
patch(oldVNode, rootVnode);
|
|
1040
|
-
{
|
|
1041
|
-
// while we're moving nodes around existing nodes, temporarily disable
|
|
1042
|
-
// the disconnectCallback from working
|
|
1043
|
-
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
1044
|
-
if (checkSlotRelocate) {
|
|
1045
|
-
relocateSlotContent(rootVnode.$elm$);
|
|
1046
|
-
var relocateData = void 0;
|
|
1047
|
-
var nodeToRelocate = void 0;
|
|
1048
|
-
var orgLocationNode = void 0;
|
|
1049
|
-
var parentNodeRef = void 0;
|
|
1050
|
-
var insertBeforeNode = void 0;
|
|
1051
|
-
var refNode = void 0;
|
|
1052
|
-
var i = 0;
|
|
1053
|
-
for (; i < relocateNodes.length; i++) {
|
|
1054
|
-
relocateData = relocateNodes[i];
|
|
1055
|
-
nodeToRelocate = relocateData.$nodeToRelocate$;
|
|
1056
|
-
if (!nodeToRelocate['s-ol']) {
|
|
1057
|
-
// add a reference node marking this node's original location
|
|
1058
|
-
// keep a reference to this node for later lookups
|
|
1059
|
-
orgLocationNode = doc.createTextNode('');
|
|
1060
|
-
orgLocationNode['s-nr'] = nodeToRelocate;
|
|
1061
|
-
nodeToRelocate.parentNode.insertBefore((nodeToRelocate['s-ol'] = orgLocationNode), nodeToRelocate);
|
|
1062
|
-
}
|
|
1063
|
-
}
|
|
1064
|
-
for (i = 0; i < relocateNodes.length; i++) {
|
|
1065
|
-
relocateData = relocateNodes[i];
|
|
1066
|
-
nodeToRelocate = relocateData.$nodeToRelocate$;
|
|
1067
|
-
if (relocateData.$slotRefNode$) {
|
|
1068
|
-
// by default we're just going to insert it directly
|
|
1069
|
-
// after the slot reference node
|
|
1070
|
-
parentNodeRef = relocateData.$slotRefNode$.parentNode;
|
|
1071
|
-
insertBeforeNode = relocateData.$slotRefNode$.nextSibling;
|
|
1072
|
-
orgLocationNode = nodeToRelocate['s-ol'];
|
|
1073
|
-
while ((orgLocationNode = orgLocationNode.previousSibling)) {
|
|
1074
|
-
refNode = orgLocationNode['s-nr'];
|
|
1075
|
-
if (refNode && refNode['s-sn'] === nodeToRelocate['s-sn'] && parentNodeRef === refNode.parentNode) {
|
|
1076
|
-
refNode = refNode.nextSibling;
|
|
1077
|
-
if (!refNode || !refNode['s-nr']) {
|
|
1078
|
-
insertBeforeNode = refNode;
|
|
1079
|
-
break;
|
|
1080
|
-
}
|
|
1081
|
-
}
|
|
1082
|
-
}
|
|
1083
|
-
if ((!insertBeforeNode && parentNodeRef !== nodeToRelocate.parentNode) || nodeToRelocate.nextSibling !== insertBeforeNode) {
|
|
1084
|
-
// we've checked that it's worth while to relocate
|
|
1085
|
-
// since that the node to relocate
|
|
1086
|
-
// has a different next sibling or parent relocated
|
|
1087
|
-
if (nodeToRelocate !== insertBeforeNode) {
|
|
1088
|
-
if (!nodeToRelocate['s-hn'] && nodeToRelocate['s-ol']) {
|
|
1089
|
-
// probably a component in the index.html that doesn't have it's hostname set
|
|
1090
|
-
nodeToRelocate['s-hn'] = nodeToRelocate['s-ol'].parentNode.nodeName;
|
|
1091
|
-
}
|
|
1092
|
-
// add it back to the dom but in its new home
|
|
1093
|
-
parentNodeRef.insertBefore(nodeToRelocate, insertBeforeNode);
|
|
1094
|
-
}
|
|
1095
|
-
}
|
|
1096
|
-
}
|
|
1097
|
-
else {
|
|
1098
|
-
// this node doesn't have a slot home to go to, so let's hide it
|
|
1099
|
-
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
1100
|
-
nodeToRelocate.hidden = true;
|
|
1101
|
-
}
|
|
1102
|
-
}
|
|
1103
|
-
}
|
|
1104
|
-
}
|
|
1105
|
-
if (checkSlotFallbackVisibility) {
|
|
1106
|
-
updateFallbackSlotVisibility(rootVnode.$elm$);
|
|
1107
|
-
}
|
|
1108
|
-
// done moving nodes around
|
|
1109
|
-
// allow the disconnect callback to work again
|
|
1110
|
-
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
1111
|
-
// always reset
|
|
1112
|
-
relocateNodes.length = 0;
|
|
1113
|
-
}
|
|
1114
|
-
};
|
|
1115
|
-
var getElement = function (ref) { return (getHostRef(ref).$hostElement$); };
|
|
1116
|
-
var createEvent = function (ref, name, flags) {
|
|
1117
|
-
var elm = getElement(ref);
|
|
1118
|
-
return {
|
|
1119
|
-
emit: function (detail) {
|
|
1120
|
-
return emitEvent(elm, name, {
|
|
1121
|
-
bubbles: !!(flags & 4 /* Bubbles */),
|
|
1122
|
-
composed: !!(flags & 2 /* Composed */),
|
|
1123
|
-
cancelable: !!(flags & 1 /* Cancellable */),
|
|
1124
|
-
detail: detail,
|
|
1125
|
-
});
|
|
1126
|
-
},
|
|
1127
|
-
};
|
|
1128
|
-
};
|
|
1129
|
-
var emitEvent = function (elm, name, opts) {
|
|
1130
|
-
var ev = plt.ce(name, opts);
|
|
1131
|
-
elm.dispatchEvent(ev);
|
|
1132
|
-
return ev;
|
|
1133
|
-
};
|
|
1134
|
-
var attachToAncestor = function (hostRef, ancestorComponent) {
|
|
1135
|
-
if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
|
|
1136
|
-
ancestorComponent['s-p'].push(new Promise(function (r) { return (hostRef.$onRenderResolve$ = r); }));
|
|
1137
|
-
}
|
|
1138
|
-
};
|
|
1139
|
-
var scheduleUpdate = function (hostRef, isInitialLoad) {
|
|
1140
|
-
{
|
|
1141
|
-
hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
|
|
1142
|
-
}
|
|
1143
|
-
if (hostRef.$flags$ & 4 /* isWaitingForChildren */) {
|
|
1144
|
-
hostRef.$flags$ |= 512 /* needsRerender */;
|
|
1145
|
-
return;
|
|
1146
|
-
}
|
|
1147
|
-
attachToAncestor(hostRef, hostRef.$ancestorComponent$);
|
|
1148
|
-
// there is no ancestorc omponent or the ancestor component
|
|
1149
|
-
// has already fired off its lifecycle update then
|
|
1150
|
-
// fire off the initial update
|
|
1151
|
-
var dispatch = function () { return dispatchHooks(hostRef, isInitialLoad); };
|
|
1152
|
-
return writeTask(dispatch);
|
|
1153
|
-
};
|
|
1154
|
-
var dispatchHooks = function (hostRef, isInitialLoad) {
|
|
1155
|
-
var endSchedule = createTime('scheduleUpdate', hostRef.$cmpMeta$.$tagName$);
|
|
1156
|
-
var instance = hostRef.$lazyInstance$;
|
|
1157
|
-
var promise;
|
|
1158
|
-
if (isInitialLoad) {
|
|
1159
|
-
{
|
|
1160
|
-
hostRef.$flags$ |= 256 /* isListenReady */;
|
|
1161
|
-
if (hostRef.$queuedListeners$) {
|
|
1162
|
-
hostRef.$queuedListeners$.map(function (_a) {
|
|
1163
|
-
var methodName = _a[0], event = _a[1];
|
|
1164
|
-
return safeCall(instance, methodName, event);
|
|
1165
|
-
});
|
|
1166
|
-
hostRef.$queuedListeners$ = null;
|
|
1167
|
-
}
|
|
1168
|
-
}
|
|
1169
|
-
{
|
|
1170
|
-
promise = safeCall(instance, 'componentWillLoad');
|
|
1171
|
-
}
|
|
1172
|
-
}
|
|
1173
|
-
endSchedule();
|
|
1174
|
-
return then(promise, function () { return updateComponent(hostRef, instance, isInitialLoad); });
|
|
1175
|
-
};
|
|
1176
|
-
var updateComponent = function (hostRef, instance, isInitialLoad) {
|
|
1177
|
-
// updateComponent
|
|
1178
|
-
var elm = hostRef.$hostElement$;
|
|
1179
|
-
var endUpdate = createTime('update', hostRef.$cmpMeta$.$tagName$);
|
|
1180
|
-
var rc = elm['s-rc'];
|
|
1181
|
-
if (isInitialLoad) {
|
|
1182
|
-
// DOM WRITE!
|
|
1183
|
-
attachStyles(hostRef);
|
|
1184
|
-
}
|
|
1185
|
-
var endRender = createTime('render', hostRef.$cmpMeta$.$tagName$);
|
|
1186
|
-
{
|
|
1187
|
-
{
|
|
1188
|
-
// looks like we've got child nodes to render into this host element
|
|
1189
|
-
// or we need to update the css class/attrs on the host element
|
|
1190
|
-
// DOM WRITE!
|
|
1191
|
-
renderVdom(hostRef, callRender(hostRef, instance));
|
|
1192
|
-
}
|
|
1193
|
-
}
|
|
1194
|
-
if (plt.$cssShim$) {
|
|
1195
|
-
plt.$cssShim$.updateHost(elm);
|
|
1196
|
-
}
|
|
1197
|
-
if (rc) {
|
|
1198
|
-
// ok, so turns out there are some child host elements
|
|
1199
|
-
// waiting on this parent element to load
|
|
1200
|
-
// let's fire off all update callbacks waiting
|
|
1201
|
-
rc.map(function (cb) { return cb(); });
|
|
1202
|
-
elm['s-rc'] = undefined;
|
|
1203
|
-
}
|
|
1204
|
-
endRender();
|
|
1205
|
-
endUpdate();
|
|
1206
|
-
{
|
|
1207
|
-
var childrenPromises = elm['s-p'];
|
|
1208
|
-
var postUpdate = function () { return postUpdateComponent(hostRef); };
|
|
1209
|
-
if (childrenPromises.length === 0) {
|
|
1210
|
-
postUpdate();
|
|
1211
|
-
}
|
|
1212
|
-
else {
|
|
1213
|
-
Promise.all(childrenPromises).then(postUpdate);
|
|
1214
|
-
hostRef.$flags$ |= 4 /* isWaitingForChildren */;
|
|
1215
|
-
childrenPromises.length = 0;
|
|
1216
|
-
}
|
|
1217
|
-
}
|
|
1218
|
-
};
|
|
1219
|
-
var callRender = function (hostRef, instance) {
|
|
1220
|
-
try {
|
|
1221
|
-
instance = instance.render();
|
|
1222
|
-
{
|
|
1223
|
-
hostRef.$flags$ &= ~16 /* isQueuedForUpdate */;
|
|
1224
|
-
}
|
|
1225
|
-
{
|
|
1226
|
-
hostRef.$flags$ |= 2 /* hasRendered */;
|
|
1227
|
-
}
|
|
1228
|
-
}
|
|
1229
|
-
catch (e) {
|
|
1230
|
-
consoleError(e);
|
|
1231
|
-
}
|
|
1232
|
-
return instance;
|
|
1233
|
-
};
|
|
1234
|
-
var postUpdateComponent = function (hostRef) {
|
|
1235
|
-
var tagName = hostRef.$cmpMeta$.$tagName$;
|
|
1236
|
-
var elm = hostRef.$hostElement$;
|
|
1237
|
-
var endPostUpdate = createTime('postUpdate', tagName);
|
|
1238
|
-
var instance = hostRef.$lazyInstance$;
|
|
1239
|
-
var ancestorComponent = hostRef.$ancestorComponent$;
|
|
1240
|
-
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
|
1241
|
-
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
|
1242
|
-
{
|
|
1243
|
-
// DOM WRITE!
|
|
1244
|
-
addHydratedFlag(elm);
|
|
1245
|
-
}
|
|
1246
|
-
{
|
|
1247
|
-
safeCall(instance, 'componentDidLoad');
|
|
1248
|
-
}
|
|
1249
|
-
endPostUpdate();
|
|
1250
|
-
{
|
|
1251
|
-
hostRef.$onReadyResolve$(elm);
|
|
1252
|
-
if (!ancestorComponent) {
|
|
1253
|
-
appDidLoad();
|
|
1254
|
-
}
|
|
1255
|
-
}
|
|
1256
|
-
}
|
|
1257
|
-
else {
|
|
1258
|
-
{
|
|
1259
|
-
safeCall(instance, 'componentDidUpdate');
|
|
1260
|
-
}
|
|
1261
|
-
endPostUpdate();
|
|
1262
|
-
}
|
|
1263
|
-
// load events fire from bottom to top
|
|
1264
|
-
// the deepest elements load first then bubbles up
|
|
1265
|
-
{
|
|
1266
|
-
if (hostRef.$onRenderResolve$) {
|
|
1267
|
-
hostRef.$onRenderResolve$();
|
|
1268
|
-
hostRef.$onRenderResolve$ = undefined;
|
|
1269
|
-
}
|
|
1270
|
-
if (hostRef.$flags$ & 512 /* needsRerender */) {
|
|
1271
|
-
nextTick(function () { return scheduleUpdate(hostRef, false); });
|
|
1272
|
-
}
|
|
1273
|
-
hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */);
|
|
1274
|
-
}
|
|
1275
|
-
// ( •_•)
|
|
1276
|
-
// ( •_•)>⌐■-■
|
|
1277
|
-
// (⌐■_■)
|
|
1278
|
-
};
|
|
1279
|
-
var forceUpdate = function (ref) {
|
|
1280
|
-
{
|
|
1281
|
-
var hostRef = getHostRef(ref);
|
|
1282
|
-
var isConnected = hostRef.$hostElement$.isConnected;
|
|
1283
|
-
if (isConnected && (hostRef.$flags$ & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
1284
|
-
scheduleUpdate(hostRef, false);
|
|
1285
|
-
}
|
|
1286
|
-
// Returns "true" when the forced update was successfully scheduled
|
|
1287
|
-
return isConnected;
|
|
1288
|
-
}
|
|
1289
|
-
};
|
|
1290
|
-
var appDidLoad = function (who) {
|
|
1291
|
-
// on appload
|
|
1292
|
-
// we have finish the first big initial render
|
|
1293
|
-
{
|
|
1294
|
-
addHydratedFlag(doc.documentElement);
|
|
1295
|
-
}
|
|
1296
|
-
{
|
|
1297
|
-
plt.$flags$ |= 2 /* appLoaded */;
|
|
1298
|
-
}
|
|
1299
|
-
nextTick(function () { return emitEvent(win, 'appload', { detail: { namespace: NAMESPACE } }); });
|
|
1300
|
-
};
|
|
1301
|
-
var safeCall = function (instance, method, arg) {
|
|
1302
|
-
if (instance && instance[method]) {
|
|
1303
|
-
try {
|
|
1304
|
-
return instance[method](arg);
|
|
1305
|
-
}
|
|
1306
|
-
catch (e) {
|
|
1307
|
-
consoleError(e);
|
|
1308
|
-
}
|
|
1309
|
-
}
|
|
1310
|
-
return undefined;
|
|
1311
|
-
};
|
|
1312
|
-
var then = function (promise, thenFn) {
|
|
1313
|
-
return promise && promise.then ? promise.then(thenFn) : thenFn();
|
|
1314
|
-
};
|
|
1315
|
-
var addHydratedFlag = function (elm) { return (elm.classList.add('hydrated')); };
|
|
1316
|
-
var parsePropertyValue = function (propValue, propType) {
|
|
1317
|
-
// ensure this value is of the correct prop type
|
|
1318
|
-
if (propValue != null && !isComplexType(propValue)) {
|
|
1319
|
-
if (propType & 4 /* Boolean */) {
|
|
1320
|
-
// per the HTML spec, any string value means it is a boolean true value
|
|
1321
|
-
// but we'll cheat here and say that the string "false" is the boolean false
|
|
1322
|
-
return propValue === 'false' ? false : propValue === '' || !!propValue;
|
|
1323
|
-
}
|
|
1324
|
-
if (propType & 2 /* Number */) {
|
|
1325
|
-
// force it to be a number
|
|
1326
|
-
return parseFloat(propValue);
|
|
1327
|
-
}
|
|
1328
|
-
if (propType & 1 /* String */) {
|
|
1329
|
-
// could have been passed as a number or boolean
|
|
1330
|
-
// but we still want it as a string
|
|
1331
|
-
return String(propValue);
|
|
1332
|
-
}
|
|
1333
|
-
// redundant return here for better minification
|
|
1334
|
-
return propValue;
|
|
1335
|
-
}
|
|
1336
|
-
// not sure exactly what type we want
|
|
1337
|
-
// so no need to change to a different type
|
|
1338
|
-
return propValue;
|
|
1339
|
-
};
|
|
1340
|
-
var getValue = function (ref, propName) { return getHostRef(ref).$instanceValues$.get(propName); };
|
|
1341
|
-
var setValue = function (ref, propName, newVal, cmpMeta) {
|
|
1342
|
-
// check our new property value against our internal value
|
|
1343
|
-
var hostRef = getHostRef(ref);
|
|
1344
|
-
var oldVal = hostRef.$instanceValues$.get(propName);
|
|
1345
|
-
var flags = hostRef.$flags$;
|
|
1346
|
-
var instance = hostRef.$lazyInstance$;
|
|
1347
|
-
newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
|
|
1348
|
-
if ((!(flags & 8 /* isConstructingInstance */) || oldVal === undefined) && newVal !== oldVal) {
|
|
1349
|
-
// gadzooks! the property's value has changed!!
|
|
1350
|
-
// set our new value!
|
|
1351
|
-
hostRef.$instanceValues$.set(propName, newVal);
|
|
1352
|
-
if (instance) {
|
|
1353
|
-
// get an array of method names of watch functions to call
|
|
1354
|
-
if (cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
|
|
1355
|
-
var watchMethods = cmpMeta.$watchers$[propName];
|
|
1356
|
-
if (watchMethods) {
|
|
1357
|
-
// this instance is watching for when this property changed
|
|
1358
|
-
watchMethods.map(function (watchMethodName) {
|
|
1359
|
-
try {
|
|
1360
|
-
// fire off each of the watch methods that are watching this property
|
|
1361
|
-
instance[watchMethodName](newVal, oldVal, propName);
|
|
1362
|
-
}
|
|
1363
|
-
catch (e) {
|
|
1364
|
-
consoleError(e);
|
|
1365
|
-
}
|
|
1366
|
-
});
|
|
1367
|
-
}
|
|
1368
|
-
}
|
|
1369
|
-
if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
1370
|
-
// looks like this value actually changed, so we've got work to do!
|
|
1371
|
-
// but only if we've already rendered, otherwise just chill out
|
|
1372
|
-
// queue that we need to do an update, but don't worry about queuing
|
|
1373
|
-
// up millions cuz this function ensures it only runs once
|
|
1374
|
-
scheduleUpdate(hostRef, false);
|
|
1375
|
-
}
|
|
1376
|
-
}
|
|
1377
|
-
}
|
|
1378
|
-
};
|
|
1379
|
-
var proxyComponent = function (Cstr, cmpMeta, flags) {
|
|
1380
|
-
if (cmpMeta.$members$) {
|
|
1381
|
-
if (Cstr.watchers) {
|
|
1382
|
-
cmpMeta.$watchers$ = Cstr.watchers;
|
|
1383
|
-
}
|
|
1384
|
-
// It's better to have a const than two Object.entries()
|
|
1385
|
-
var members = Object.entries(cmpMeta.$members$);
|
|
1386
|
-
var prototype_1 = Cstr.prototype;
|
|
1387
|
-
members.map(function (_a) {
|
|
1388
|
-
var memberName = _a[0], memberFlags = _a[1][0];
|
|
1389
|
-
if ((memberFlags & 31 /* Prop */ || ((flags & 2 /* proxyState */) && memberFlags & 32 /* State */))) {
|
|
1390
|
-
// proxyComponent - prop
|
|
1391
|
-
Object.defineProperty(prototype_1, memberName, {
|
|
1392
|
-
get: function () {
|
|
1393
|
-
// proxyComponent, get value
|
|
1394
|
-
return getValue(this, memberName);
|
|
1395
|
-
},
|
|
1396
|
-
set: function (newValue) {
|
|
1397
|
-
// proxyComponent, set value
|
|
1398
|
-
setValue(this, memberName, newValue, cmpMeta);
|
|
1399
|
-
},
|
|
1400
|
-
configurable: true,
|
|
1401
|
-
enumerable: true,
|
|
1402
|
-
});
|
|
1403
|
-
}
|
|
1404
|
-
});
|
|
1405
|
-
if ((flags & 1 /* isElementConstructor */)) {
|
|
1406
|
-
var attrNameToPropName_1 = new Map();
|
|
1407
|
-
prototype_1.attributeChangedCallback = function (attrName, _oldValue, newValue) {
|
|
1408
|
-
var _this = this;
|
|
1409
|
-
plt.jmp(function () {
|
|
1410
|
-
var propName = attrNameToPropName_1.get(attrName);
|
|
1411
|
-
_this[propName] = newValue === null && typeof _this[propName] === 'boolean' ? false : newValue;
|
|
1412
|
-
});
|
|
1413
|
-
};
|
|
1414
|
-
// create an array of attributes to observe
|
|
1415
|
-
// and also create a map of html attribute name to js property name
|
|
1416
|
-
Cstr.observedAttributes = members
|
|
1417
|
-
.filter(function (_a) {
|
|
1418
|
-
var _ = _a[0], m = _a[1];
|
|
1419
|
-
return m[0] & 15;
|
|
1420
|
-
} /* HasAttribute */) // filter to only keep props that should match attributes
|
|
1421
|
-
.map(function (_a) {
|
|
1422
|
-
var propName = _a[0], m = _a[1];
|
|
1423
|
-
var attrName = m[1] || propName;
|
|
1424
|
-
attrNameToPropName_1.set(attrName, propName);
|
|
1425
|
-
if (m[0] & 512 /* ReflectAttr */) {
|
|
1426
|
-
cmpMeta.$attrsToReflect$.push([propName, attrName]);
|
|
1427
|
-
}
|
|
1428
|
-
return attrName;
|
|
1429
|
-
});
|
|
1430
|
-
}
|
|
1431
|
-
}
|
|
1432
|
-
return Cstr;
|
|
1433
|
-
};
|
|
1434
|
-
var initializeComponent = function (elm, hostRef, cmpMeta, hmrVersionId, Cstr) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1435
|
-
var endLoad, endNewInstance, style_1, scopeId_1, endRegisterStyles, ancestorComponent, schedule;
|
|
1436
|
-
return __generator(this, function (_a) {
|
|
1437
|
-
switch (_a.label) {
|
|
1438
|
-
case 0:
|
|
1439
|
-
if (!((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0)) return [3 /*break*/, 5];
|
|
1440
|
-
// we haven't initialized this element yet
|
|
1441
|
-
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
|
1442
|
-
// lazy loaded components
|
|
1443
|
-
// request the component's implementation to be
|
|
1444
|
-
// wired up with the host element
|
|
1445
|
-
Cstr = loadModule(cmpMeta);
|
|
1446
|
-
if (!Cstr.then) return [3 /*break*/, 2];
|
|
1447
|
-
endLoad = uniqueTime();
|
|
1448
|
-
return [4 /*yield*/, Cstr];
|
|
1449
|
-
case 1:
|
|
1450
|
-
Cstr = _a.sent();
|
|
1451
|
-
endLoad();
|
|
1452
|
-
_a.label = 2;
|
|
1453
|
-
case 2:
|
|
1454
|
-
if (!Cstr.isProxied) {
|
|
1455
|
-
// we'eve never proxied this Constructor before
|
|
1456
|
-
// let's add the getters/setters to its prototype before
|
|
1457
|
-
// the first time we create an instance of the implementation
|
|
1458
|
-
{
|
|
1459
|
-
cmpMeta.$watchers$ = Cstr.watchers;
|
|
1460
|
-
}
|
|
1461
|
-
proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
|
|
1462
|
-
Cstr.isProxied = true;
|
|
1463
|
-
}
|
|
1464
|
-
endNewInstance = createTime('createInstance', cmpMeta.$tagName$);
|
|
1465
|
-
// ok, time to construct the instance
|
|
1466
|
-
// but let's keep track of when we start and stop
|
|
1467
|
-
// so that the getters/setters don't incorrectly step on data
|
|
1468
|
-
{
|
|
1469
|
-
hostRef.$flags$ |= 8 /* isConstructingInstance */;
|
|
1470
|
-
}
|
|
1471
|
-
// construct the lazy-loaded component implementation
|
|
1472
|
-
// passing the hostRef is very important during
|
|
1473
|
-
// construction in order to directly wire together the
|
|
1474
|
-
// host element and the lazy-loaded instance
|
|
1475
|
-
try {
|
|
1476
|
-
new Cstr(hostRef);
|
|
1477
|
-
}
|
|
1478
|
-
catch (e) {
|
|
1479
|
-
consoleError(e);
|
|
1480
|
-
}
|
|
1481
|
-
{
|
|
1482
|
-
hostRef.$flags$ &= ~8 /* isConstructingInstance */;
|
|
1483
|
-
}
|
|
1484
|
-
{
|
|
1485
|
-
hostRef.$flags$ |= 128 /* isWatchReady */;
|
|
1486
|
-
}
|
|
1487
|
-
endNewInstance();
|
|
1488
|
-
if (!Cstr.style) return [3 /*break*/, 5];
|
|
1489
|
-
style_1 = Cstr.style;
|
|
1490
|
-
scopeId_1 = getScopeId(cmpMeta);
|
|
1491
|
-
if (!!styles.has(scopeId_1)) return [3 /*break*/, 5];
|
|
1492
|
-
endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
|
|
1493
|
-
if (!(cmpMeta.$flags$ & 8) /* needsShadowDomShim */) return [3 /*break*/, 4]; /* needsShadowDomShim */
|
|
1494
|
-
return [4 /*yield*/, import('./shadow-css-95922619.js').then(function (m) { return m.scopeCss(style_1, scopeId_1, false); })];
|
|
1495
|
-
case 3:
|
|
1496
|
-
style_1 = _a.sent();
|
|
1497
|
-
_a.label = 4;
|
|
1498
|
-
case 4:
|
|
1499
|
-
registerStyle(scopeId_1, style_1, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
|
|
1500
|
-
endRegisterStyles();
|
|
1501
|
-
_a.label = 5;
|
|
1502
|
-
case 5:
|
|
1503
|
-
ancestorComponent = hostRef.$ancestorComponent$;
|
|
1504
|
-
schedule = function () { return scheduleUpdate(hostRef, true); };
|
|
1505
|
-
if (ancestorComponent && ancestorComponent['s-rc']) {
|
|
1506
|
-
// this is the intial load and this component it has an ancestor component
|
|
1507
|
-
// but the ancestor component has NOT fired its will update lifecycle yet
|
|
1508
|
-
// so let's just cool our jets and wait for the ancestor to continue first
|
|
1509
|
-
// this will get fired off when the ancestor component
|
|
1510
|
-
// finally gets around to rendering its lazy self
|
|
1511
|
-
// fire off the initial update
|
|
1512
|
-
ancestorComponent['s-rc'].push(schedule);
|
|
1513
|
-
}
|
|
1514
|
-
else {
|
|
1515
|
-
schedule();
|
|
1516
|
-
}
|
|
1517
|
-
return [2 /*return*/];
|
|
1518
|
-
}
|
|
1519
|
-
});
|
|
1520
|
-
}); };
|
|
1521
|
-
var connectedCallback = function (elm) {
|
|
1522
|
-
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
1523
|
-
var hostRef_1 = getHostRef(elm);
|
|
1524
|
-
var cmpMeta_1 = hostRef_1.$cmpMeta$;
|
|
1525
|
-
var endConnected = createTime('connectedCallback', cmpMeta_1.$tagName$);
|
|
1526
|
-
if (!(hostRef_1.$flags$ & 1 /* hasConnected */)) {
|
|
1527
|
-
// first time this component has connected
|
|
1528
|
-
hostRef_1.$flags$ |= 1 /* hasConnected */;
|
|
1529
|
-
{
|
|
1530
|
-
// initUpdate
|
|
1531
|
-
// if the slot polyfill is required we'll need to put some nodes
|
|
1532
|
-
// in here to act as original content anchors as we move nodes around
|
|
1533
|
-
// host element has been connected to the DOM
|
|
1534
|
-
if ((cmpMeta_1.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */))) {
|
|
1535
|
-
setContentReference(elm);
|
|
1536
|
-
}
|
|
1537
|
-
}
|
|
1538
|
-
{
|
|
1539
|
-
// find the first ancestor component (if there is one) and register
|
|
1540
|
-
// this component as one of the actively loading child components for its ancestor
|
|
1541
|
-
var ancestorComponent = elm;
|
|
1542
|
-
while ((ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host)) {
|
|
1543
|
-
// climb up the ancestors looking for the first
|
|
1544
|
-
// component that hasn't finished its lifecycle update yet
|
|
1545
|
-
if (ancestorComponent['s-p']) {
|
|
1546
|
-
// we found this components first ancestor component
|
|
1547
|
-
// keep a reference to this component's ancestor component
|
|
1548
|
-
attachToAncestor(hostRef_1, (hostRef_1.$ancestorComponent$ = ancestorComponent));
|
|
1549
|
-
break;
|
|
1550
|
-
}
|
|
1551
|
-
}
|
|
1552
|
-
}
|
|
1553
|
-
// Lazy properties
|
|
1554
|
-
// https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
|
|
1555
|
-
if (cmpMeta_1.$members$) {
|
|
1556
|
-
Object.entries(cmpMeta_1.$members$).map(function (_a) {
|
|
1557
|
-
var memberName = _a[0], memberFlags = _a[1][0];
|
|
1558
|
-
if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
|
|
1559
|
-
var value = elm[memberName];
|
|
1560
|
-
delete elm[memberName];
|
|
1561
|
-
elm[memberName] = value;
|
|
1562
|
-
}
|
|
1563
|
-
});
|
|
1564
|
-
}
|
|
1565
|
-
{
|
|
1566
|
-
// connectedCallback, taskQueue, initialLoad
|
|
1567
|
-
// angular sets attribute AFTER connectCallback
|
|
1568
|
-
// https://github.com/angular/angular/issues/18909
|
|
1569
|
-
// https://github.com/angular/angular/issues/19940
|
|
1570
|
-
nextTick(function () { return initializeComponent(elm, hostRef_1, cmpMeta_1); });
|
|
1571
|
-
}
|
|
1572
|
-
}
|
|
1573
|
-
else {
|
|
1574
|
-
// not the first time this has connected
|
|
1575
|
-
// reattach any event listeners to the host
|
|
1576
|
-
// since they would have been removed when disconnected
|
|
1577
|
-
addHostEventListeners(elm, hostRef_1, cmpMeta_1.$listeners$);
|
|
1578
|
-
}
|
|
1579
|
-
endConnected();
|
|
1580
|
-
}
|
|
1581
|
-
};
|
|
1582
|
-
var setContentReference = function (elm) {
|
|
1583
|
-
// only required when we're NOT using native shadow dom (slot)
|
|
1584
|
-
// or this browser doesn't support native shadow dom
|
|
1585
|
-
// and this host element was NOT created with SSR
|
|
1586
|
-
// let's pick out the inner content for slot projection
|
|
1587
|
-
// create a node to represent where the original
|
|
1588
|
-
// content was first placed, which is useful later on
|
|
1589
|
-
var contentRefElm = (elm['s-cr'] = doc.createComment(''));
|
|
1590
|
-
contentRefElm['s-cn'] = true;
|
|
1591
|
-
elm.insertBefore(contentRefElm, elm.firstChild);
|
|
1592
|
-
};
|
|
1593
|
-
var disconnectedCallback = function (elm) {
|
|
1594
|
-
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
1595
|
-
var hostRef = getHostRef(elm);
|
|
1596
|
-
{
|
|
1597
|
-
if (hostRef.$rmListeners$) {
|
|
1598
|
-
hostRef.$rmListeners$.map(function (rmListener) { return rmListener(); });
|
|
1599
|
-
hostRef.$rmListeners$ = undefined;
|
|
1600
|
-
}
|
|
1601
|
-
}
|
|
1602
|
-
// clear CSS var-shim tracking
|
|
1603
|
-
if (plt.$cssShim$) {
|
|
1604
|
-
plt.$cssShim$.removeHost(elm);
|
|
1605
|
-
}
|
|
1606
|
-
}
|
|
1607
|
-
};
|
|
1608
|
-
var bootstrapLazy = function (lazyBundles, options) {
|
|
1609
|
-
if (options === void 0) { options = {}; }
|
|
1610
|
-
var endBootstrap = createTime();
|
|
1611
|
-
var cmpTags = [];
|
|
1612
|
-
var exclude = options.exclude || [];
|
|
1613
|
-
var customElements = win.customElements;
|
|
1614
|
-
var head = doc.head;
|
|
1615
|
-
var metaCharset = /*@__PURE__*/ head.querySelector('meta[charset]');
|
|
1616
|
-
var visibilityStyle = /*@__PURE__*/ doc.createElement('style');
|
|
1617
|
-
var deferredConnectedCallbacks = [];
|
|
1618
|
-
var appLoadFallback;
|
|
1619
|
-
var isBootstrapping = true;
|
|
1620
|
-
Object.assign(plt, options);
|
|
1621
|
-
plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;
|
|
1622
|
-
{
|
|
1623
|
-
if (options.syncQueue) {
|
|
1624
|
-
plt.$flags$ |= 4 /* queueSync */;
|
|
1625
|
-
}
|
|
1626
|
-
}
|
|
1627
|
-
lazyBundles.map(function (lazyBundle) { return lazyBundle[1].map(function (compactMeta) {
|
|
1628
|
-
var cmpMeta = {
|
|
1629
|
-
$flags$: compactMeta[0],
|
|
1630
|
-
$tagName$: compactMeta[1],
|
|
1631
|
-
$members$: compactMeta[2],
|
|
1632
|
-
$listeners$: compactMeta[3],
|
|
1633
|
-
};
|
|
1634
|
-
{
|
|
1635
|
-
cmpMeta.$members$ = compactMeta[2];
|
|
1636
|
-
}
|
|
1637
|
-
{
|
|
1638
|
-
cmpMeta.$listeners$ = compactMeta[3];
|
|
1639
|
-
}
|
|
1640
|
-
{
|
|
1641
|
-
cmpMeta.$attrsToReflect$ = [];
|
|
1642
|
-
}
|
|
1643
|
-
{
|
|
1644
|
-
cmpMeta.$watchers$ = {};
|
|
1645
|
-
}
|
|
1646
|
-
if (!supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
1647
|
-
cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
|
|
1648
|
-
}
|
|
1649
|
-
var tagName = cmpMeta.$tagName$;
|
|
1650
|
-
var HostElement = /** @class */ (function (_super) {
|
|
1651
|
-
__extends(HostElement, _super);
|
|
1652
|
-
// StencilLazyHost
|
|
1653
|
-
function HostElement(self) {
|
|
1654
|
-
var _this =
|
|
1655
|
-
// @ts-ignore
|
|
1656
|
-
_super.call(this, self) || this;
|
|
1657
|
-
self = _this;
|
|
1658
|
-
registerHost(self, cmpMeta);
|
|
1659
|
-
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
1660
|
-
// this component is using shadow dom
|
|
1661
|
-
// and this browser supports shadow dom
|
|
1662
|
-
// add the read-only property "shadowRoot" to the host element
|
|
1663
|
-
// adding the shadow root build conditionals to minimize runtime
|
|
1664
|
-
if (supportsShadow) {
|
|
1665
|
-
{
|
|
1666
|
-
self.attachShadow({ mode: 'open' });
|
|
1667
|
-
}
|
|
1668
|
-
}
|
|
1669
|
-
else if (!('shadowRoot' in self)) {
|
|
1670
|
-
self.shadowRoot = self;
|
|
1671
|
-
}
|
|
1672
|
-
}
|
|
1673
|
-
return _this;
|
|
1674
|
-
}
|
|
1675
|
-
HostElement.prototype.connectedCallback = function () {
|
|
1676
|
-
var _this = this;
|
|
1677
|
-
if (appLoadFallback) {
|
|
1678
|
-
clearTimeout(appLoadFallback);
|
|
1679
|
-
appLoadFallback = null;
|
|
1680
|
-
}
|
|
1681
|
-
if (isBootstrapping) {
|
|
1682
|
-
// connectedCallback will be processed once all components have been registered
|
|
1683
|
-
deferredConnectedCallbacks.push(this);
|
|
1684
|
-
}
|
|
1685
|
-
else {
|
|
1686
|
-
plt.jmp(function () { return connectedCallback(_this); });
|
|
1687
|
-
}
|
|
1688
|
-
};
|
|
1689
|
-
HostElement.prototype.disconnectedCallback = function () {
|
|
1690
|
-
var _this = this;
|
|
1691
|
-
plt.jmp(function () { return disconnectedCallback(_this); });
|
|
1692
|
-
};
|
|
1693
|
-
HostElement.prototype.forceUpdate = function () {
|
|
1694
|
-
forceUpdate(this);
|
|
1695
|
-
};
|
|
1696
|
-
HostElement.prototype.componentOnReady = function () {
|
|
1697
|
-
return getHostRef(this).$onReadyPromise$;
|
|
1698
|
-
};
|
|
1699
|
-
return HostElement;
|
|
1700
|
-
}(HTMLElement));
|
|
1701
|
-
cmpMeta.$lazyBundleId$ = lazyBundle[0];
|
|
1702
|
-
if (!exclude.includes(tagName) && !customElements.get(tagName)) {
|
|
1703
|
-
cmpTags.push(tagName);
|
|
1704
|
-
customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */));
|
|
1705
|
-
}
|
|
1706
|
-
}); });
|
|
1707
|
-
{
|
|
1708
|
-
visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS;
|
|
1709
|
-
visibilityStyle.setAttribute('data-styles', '');
|
|
1710
|
-
head.insertBefore(visibilityStyle, metaCharset ? metaCharset.nextSibling : head.firstChild);
|
|
1711
|
-
}
|
|
1712
|
-
// Process deferred connectedCallbacks now all components have been registered
|
|
1713
|
-
isBootstrapping = false;
|
|
1714
|
-
if (deferredConnectedCallbacks.length) {
|
|
1715
|
-
deferredConnectedCallbacks.map(function (host) { return host.connectedCallback(); });
|
|
1716
|
-
}
|
|
1717
|
-
else {
|
|
1718
|
-
{
|
|
1719
|
-
plt.jmp(function () { return (appLoadFallback = setTimeout(appDidLoad, 30)); });
|
|
1720
|
-
}
|
|
1721
|
-
}
|
|
1722
|
-
// Fallback appLoad event
|
|
1723
|
-
endBootstrap();
|
|
1724
|
-
};
|
|
1725
|
-
var hostRefs = new WeakMap();
|
|
1726
|
-
var getHostRef = function (ref) { return hostRefs.get(ref); };
|
|
1727
|
-
var registerInstance = function (lazyInstance, hostRef) { return hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef); };
|
|
1728
|
-
var registerHost = function (elm, cmpMeta) {
|
|
1729
|
-
var hostRef = {
|
|
1730
|
-
$flags$: 0,
|
|
1731
|
-
$hostElement$: elm,
|
|
1732
|
-
$cmpMeta$: cmpMeta,
|
|
1733
|
-
$instanceValues$: new Map(),
|
|
1734
|
-
};
|
|
1735
|
-
{
|
|
1736
|
-
hostRef.$onReadyPromise$ = new Promise(function (r) { return (hostRef.$onReadyResolve$ = r); });
|
|
1737
|
-
elm['s-p'] = [];
|
|
1738
|
-
elm['s-rc'] = [];
|
|
1739
|
-
}
|
|
1740
|
-
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
|
|
1741
|
-
return hostRefs.set(elm, hostRef);
|
|
1742
|
-
};
|
|
1743
|
-
var isMemberInElement = function (elm, memberName) { return memberName in elm; };
|
|
1744
|
-
var consoleError = function (e) { return console.error(e); };
|
|
1745
|
-
var cmpModules = /*@__PURE__*/ new Map();
|
|
1746
|
-
var loadModule = function (cmpMeta, hostRef, hmrVersionId) {
|
|
1747
|
-
// loadModuleImport
|
|
1748
|
-
var exportName = cmpMeta.$tagName$.replace(/-/g, '_');
|
|
1749
|
-
var bundleId = cmpMeta.$lazyBundleId$;
|
|
1750
|
-
var module = cmpModules.get(bundleId);
|
|
1751
|
-
if (module) {
|
|
1752
|
-
return module[exportName];
|
|
1753
|
-
}
|
|
1754
|
-
return import(
|
|
1755
|
-
/* webpackInclude: /\.entry\.js$/ */
|
|
1756
|
-
/* webpackExclude: /\.system\.entry\.js$/ */
|
|
1757
|
-
/* webpackMode: "lazy" */
|
|
1758
|
-
"./" + bundleId + ".entry.js" + '').then(function (importedModule) {
|
|
1759
|
-
{
|
|
1760
|
-
cmpModules.set(bundleId, importedModule);
|
|
1761
|
-
}
|
|
1762
|
-
return importedModule[exportName];
|
|
1763
|
-
}, consoleError);
|
|
1764
|
-
};
|
|
1765
|
-
var styles = new Map();
|
|
1766
|
-
var queueDomReads = [];
|
|
1767
|
-
var queueDomWrites = [];
|
|
1768
|
-
var queueDomWritesLow = [];
|
|
1769
|
-
var queueTask = function (queue, write) { return function (cb) {
|
|
1770
|
-
queue.push(cb);
|
|
1771
|
-
if (!queuePending) {
|
|
1772
|
-
queuePending = true;
|
|
1773
|
-
if (write && plt.$flags$ & 4 /* queueSync */) {
|
|
1774
|
-
nextTick(flush);
|
|
1775
|
-
}
|
|
1776
|
-
else {
|
|
1777
|
-
plt.raf(flush);
|
|
1778
|
-
}
|
|
1779
|
-
}
|
|
1780
|
-
}; };
|
|
1781
|
-
var consume = function (queue) {
|
|
1782
|
-
for (var i = 0; i < queue.length; i++) {
|
|
1783
|
-
try {
|
|
1784
|
-
queue[i](performance.now());
|
|
1785
|
-
}
|
|
1786
|
-
catch (e) {
|
|
1787
|
-
consoleError(e);
|
|
1788
|
-
}
|
|
1789
|
-
}
|
|
1790
|
-
queue.length = 0;
|
|
1791
|
-
};
|
|
1792
|
-
var consumeTimeout = function (queue, timeout) {
|
|
1793
|
-
var i = 0;
|
|
1794
|
-
var ts = 0;
|
|
1795
|
-
while (i < queue.length && (ts = performance.now()) < timeout) {
|
|
1796
|
-
try {
|
|
1797
|
-
queue[i++](ts);
|
|
1798
|
-
}
|
|
1799
|
-
catch (e) {
|
|
1800
|
-
consoleError(e);
|
|
1801
|
-
}
|
|
1802
|
-
}
|
|
1803
|
-
if (i === queue.length) {
|
|
1804
|
-
queue.length = 0;
|
|
1805
|
-
}
|
|
1806
|
-
else if (i !== 0) {
|
|
1807
|
-
queue.splice(0, i);
|
|
1808
|
-
}
|
|
1809
|
-
};
|
|
1810
|
-
var flush = function () {
|
|
1811
|
-
{
|
|
1812
|
-
queueCongestion++;
|
|
1813
|
-
}
|
|
1814
|
-
// always force a bunch of medium callbacks to run, but still have
|
|
1815
|
-
// a throttle on how many can run in a certain time
|
|
1816
|
-
// DOM READS!!!
|
|
1817
|
-
consume(queueDomReads);
|
|
1818
|
-
// DOM WRITES!!!
|
|
1819
|
-
{
|
|
1820
|
-
var timeout = (plt.$flags$ & 6 /* queueMask */) === 2 /* appLoaded */ ? performance.now() + 14 * Math.ceil(queueCongestion * (1.0 / 10.0)) : Infinity;
|
|
1821
|
-
consumeTimeout(queueDomWrites, timeout);
|
|
1822
|
-
consumeTimeout(queueDomWritesLow, timeout);
|
|
1823
|
-
if (queueDomWrites.length > 0) {
|
|
1824
|
-
queueDomWritesLow.push.apply(queueDomWritesLow, queueDomWrites);
|
|
1825
|
-
queueDomWrites.length = 0;
|
|
1826
|
-
}
|
|
1827
|
-
if ((queuePending = queueDomReads.length + queueDomWrites.length + queueDomWritesLow.length > 0)) {
|
|
1828
|
-
// still more to do yet, but we've run out of time
|
|
1829
|
-
// let's let this thing cool off and try again in the next tick
|
|
1830
|
-
plt.raf(flush);
|
|
1831
|
-
}
|
|
1832
|
-
else {
|
|
1833
|
-
queueCongestion = 0;
|
|
1834
|
-
}
|
|
1835
|
-
}
|
|
1836
|
-
};
|
|
1837
|
-
var nextTick = /*@__PURE__*/ function (cb) { return promiseResolve().then(cb); };
|
|
1838
|
-
var writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
|
|
1839
|
-
export { CSS as C, Host as H, NAMESPACE as N, promiseResolve as a, bootstrapLazy as b, createEvent as c, doc as d, getElement as g, h, plt as p, registerInstance as r, win as w };
|