@govtechsg/sgds-web-component 2.0.0-rc.0 → 2.0.0-rc.2
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/components/Accordion/accordion.cjs.js +1 -1
- package/components/Accordion/accordion.js +1 -1
- package/components/Accordion/index.umd.js +1 -1
- package/components/ActionCard/index.umd.js +1938 -1836
- package/components/ActionCard/index.umd.js.map +1 -1
- package/components/ActionCard/sgds-action-card.cjs.js +2 -2
- package/components/ActionCard/sgds-action-card.cjs.js.map +1 -1
- package/components/ActionCard/sgds-action-card.d.ts +1 -1
- package/components/ActionCard/sgds-action-card.js +1 -1
- package/components/ActionCard/sgds-action-card.js.map +1 -1
- package/components/Alert/index.umd.js +200 -98
- package/components/Alert/index.umd.js.map +1 -1
- package/components/Alert/sgds-alert.cjs.js +2 -2
- package/components/Alert/sgds-alert.cjs.js.map +1 -1
- package/components/Alert/sgds-alert.d.ts +1 -1
- package/components/Alert/sgds-alert.js +1 -1
- package/components/Alert/sgds-alert.js.map +1 -1
- package/components/ComboBox/index.umd.js +229 -127
- package/components/ComboBox/index.umd.js.map +1 -1
- package/components/ComboBox/sgds-combo-box.cjs.js +2 -2
- package/components/ComboBox/sgds-combo-box.cjs.js.map +1 -1
- package/components/ComboBox/sgds-combo-box.d.ts +1 -1
- package/components/ComboBox/sgds-combo-box.js +1 -1
- package/components/ComboBox/sgds-combo-box.js.map +1 -1
- package/components/Datepicker/index.umd.js +7836 -7734
- package/components/Datepicker/index.umd.js.map +1 -1
- package/components/Datepicker/sgds-datepicker.cjs.js +2 -2
- package/components/Datepicker/sgds-datepicker.cjs.js.map +1 -1
- package/components/Datepicker/sgds-datepicker.d.ts +1 -1
- package/components/Datepicker/sgds-datepicker.js +1 -1
- package/components/Datepicker/sgds-datepicker.js.map +1 -1
- package/components/Drawer/index.umd.js +200 -98
- package/components/Drawer/index.umd.js.map +1 -1
- package/components/Drawer/sgds-drawer.cjs.js +2 -2
- package/components/Drawer/sgds-drawer.cjs.js.map +1 -1
- package/components/Drawer/sgds-drawer.d.ts +1 -1
- package/components/Drawer/sgds-drawer.js +1 -1
- package/components/Drawer/sgds-drawer.js.map +1 -1
- package/components/Dropdown/index.umd.js +229 -127
- package/components/Dropdown/index.umd.js.map +1 -1
- package/components/Dropdown/sgds-dropdown.cjs.js +2 -2
- package/components/Dropdown/sgds-dropdown.cjs.js.map +1 -1
- package/components/Dropdown/sgds-dropdown.d.ts +1 -1
- package/components/Dropdown/sgds-dropdown.js +1 -1
- package/components/Dropdown/sgds-dropdown.js.map +1 -1
- package/components/FileUpload/index.umd.js +229 -127
- package/components/FileUpload/index.umd.js.map +1 -1
- package/components/FileUpload/sgds-file-upload.cjs.js +2 -2
- package/components/FileUpload/sgds-file-upload.cjs.js.map +1 -1
- package/components/FileUpload/sgds-file-upload.d.ts +1 -1
- package/components/FileUpload/sgds-file-upload.js +1 -1
- package/components/FileUpload/sgds-file-upload.js.map +1 -1
- package/components/Modal/index.umd.js +200 -98
- package/components/Modal/index.umd.js.map +1 -1
- package/components/Modal/sgds-modal.cjs.js +2 -2
- package/components/Modal/sgds-modal.cjs.js.map +1 -1
- package/components/Modal/sgds-modal.d.ts +1 -1
- package/components/Modal/sgds-modal.js +1 -1
- package/components/Modal/sgds-modal.js.map +1 -1
- package/components/Progress/index.umd.js +2 -20
- package/components/Progress/index.umd.js.map +1 -1
- package/components/Progress/progress-bar.cjs.js +1 -3
- package/components/Progress/progress-bar.cjs.js.map +1 -1
- package/components/Progress/progress-bar.js +1 -3
- package/components/Progress/progress-bar.js.map +1 -1
- package/components/Progress/sgds-progress-bar.cjs.js +1 -17
- package/components/Progress/sgds-progress-bar.cjs.js.map +1 -1
- package/components/Progress/sgds-progress-bar.d.ts +0 -8
- package/components/Progress/sgds-progress-bar.js +1 -17
- package/components/Progress/sgds-progress-bar.js.map +1 -1
- package/components/QuantityToggle/index.umd.js +200 -98
- package/components/QuantityToggle/index.umd.js.map +1 -1
- package/components/QuantityToggle/sgds-quantity-toggle.cjs.js +2 -2
- package/components/QuantityToggle/sgds-quantity-toggle.cjs.js.map +1 -1
- package/components/QuantityToggle/sgds-quantity-toggle.d.ts +1 -1
- package/components/QuantityToggle/sgds-quantity-toggle.js +1 -1
- package/components/QuantityToggle/sgds-quantity-toggle.js.map +1 -1
- package/components/Textarea/index.umd.js +1 -1
- package/components/Textarea/textarea.cjs.js +1 -1
- package/components/Textarea/textarea.js +1 -1
- package/components/Toast/index.umd.js +1938 -1836
- package/components/Toast/index.umd.js.map +1 -1
- package/components/Toast/sgds-toast.cjs.js +2 -2
- package/components/Toast/sgds-toast.cjs.js.map +1 -1
- package/components/Toast/sgds-toast.d.ts +1 -1
- package/components/Toast/sgds-toast.js +1 -1
- package/components/Toast/sgds-toast.js.map +1 -1
- package/components/index.umd.js +204 -120
- package/components/index.umd.js.map +1 -1
- package/index.umd.js +204 -120
- package/index.umd.js.map +1 -1
- package/package.json +2 -2
- package/themes/day.css +1 -9
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var tslib = require('tslib');
|
|
6
|
-
var
|
|
6
|
+
var scopedElements = require('@open-wc/scoped-elements');
|
|
7
7
|
var decorators_js = require('lit/decorators.js');
|
|
8
8
|
var staticHtml_js = require('lit/static-html.js');
|
|
9
9
|
var sgdsElement = require('../../base/sgds-element.cjs.js');
|
|
@@ -29,7 +29,7 @@ var toast = require('./toast.cjs.js');
|
|
|
29
29
|
|
|
30
30
|
* @cssproperty --toast-icon-margin-right - The margin right between toast's icon and title in its header.
|
|
31
31
|
*/
|
|
32
|
-
class SgdsToast extends
|
|
32
|
+
class SgdsToast extends scopedElements.ScopedElementsMixin(sgdsElement["default"]) {
|
|
33
33
|
constructor() {
|
|
34
34
|
super(...arguments);
|
|
35
35
|
/** Controls the appearance of toast */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sgds-toast.cjs.js","sources":["../../../src/components/Toast/sgds-toast.ts"],"sourcesContent":["import { ScopedElementsMixin } from \"@open-wc/scoped-elements
|
|
1
|
+
{"version":3,"file":"sgds-toast.cjs.js","sources":["../../../src/components/Toast/sgds-toast.ts"],"sourcesContent":["import { ScopedElementsMixin } from \"@open-wc/scoped-elements\";\nimport { property, query } from \"lit/decorators.js\";\nimport { html } from \"lit/static-html.js\";\nimport SgdsElement from \"../../base/sgds-element\";\nimport SgdsCloseButton from \"../../internals/CloseButton/sgds-close-button\";\nimport { animateTo } from \"../../utils/animate\";\nimport { getAnimation, setDefaultAnimation } from \"../../utils/animation-registry\";\nimport { waitForEvent } from \"../../utils/event\";\nimport { watch } from \"../../utils/watch\";\nimport toastStyle from \"./toast.css\";\n/**\n * @summary Toast allows you to convey quick messaging notifications to the user.\n *\n * @slot default - The content to pass into toast's body\n * @slot icon - The slot to pass in icon to toast's header\n * @slot duration - When required, pass in the duration since toast appeared to this slot\n *\n *\n * @event sgds-show - Emitted on show.\n * @event sgds-after-show - Emitted on show after animation has completed.\n * @event sgds-hide - Emitted on hide.\n * @event sgds-after-hide - Emitted on hide after animation has completed.\n \n * @cssproperty --toast-icon-margin-right - The margin right between toast's icon and title in its header.\n */\nexport class SgdsToast extends ScopedElementsMixin(SgdsElement) {\n static styles = [...SgdsElement.styles, toastStyle];\n /**@internal */\n static get scopedElements() {\n return {\n \"sgds-close-button\": SgdsCloseButton\n };\n }\n\n /**@internal */\n @query(\"div.toast\") toast: HTMLElement;\n /** Controls the appearance of toast */\n @property({ type: Boolean, reflect: true }) show = false;\n /** The header title of toast. It is required to assign a title to toast */\n @property({ type: String, reflect: true }) title = \"Title\";\n /** Controls whether the toast has fade animation during its appearance/disappearance */\n @property({ type: Boolean, reflect: true }) noAnimation = false;\n /** Controls if the toast will hide itself after the delay time. Works with delay property */\n @property({ type: Boolean, reflect: true }) autohide = false;\n /** The amount of time taken for toast to disappear after its first render. It takes effect only when autohide is set to true */\n @property({ type: Number, reflect: true }) delay = 5000;\n /**Adds CSS styling to `<Toast />` based on the defined status */\n @property({ type: String, reflect: true }) variant: \"success\" | \"warning\" | \"danger\" | \"info\" = \"info\";\n\n /** Shows the toast */\n public async showToast() {\n if (this.show) {\n return;\n }\n\n this.show = true;\n return waitForEvent(this, \"sgds-after-show\");\n }\n\n /** Hide the toast */\n public async hideToast() {\n if (!this.show) {\n return;\n }\n this.show = false;\n return waitForEvent(this, \"sgds-after-hide\");\n }\n\n /** @internal */\n handleCloseClick() {\n this.show = false;\n this.emit(\"sgds-close\");\n }\n /**@internal */\n @watch(\"show\", { waitUntilFirstUpdate: true })\n async handleShowChange() {\n if (this.show) {\n this.emit(\"sgds-show\");\n this.toast.hidden = !this.show;\n\n const toastAnimation = getAnimation(this, \"toast.show\");\n !this.noAnimation && (await animateTo(this.toast, toastAnimation.keyframes, toastAnimation.options));\n\n this.emit(\"sgds-after-show\");\n } else {\n this.emit(\"sgds-hide\");\n const toastAnimation = getAnimation(this, \"toast.hide\");\n\n !this.noAnimation && (await animateTo(this.toast, toastAnimation.keyframes, toastAnimation.options));\n this.emit(\"sgds-after-hide\");\n this.toast.hidden = !this.show;\n }\n }\n protected firstUpdated(): void {\n this.toast.hidden = !this.show;\n }\n\n render() {\n if (this.autohide && this.show) {\n setTimeout(() => {\n this.show = false;\n }, this.delay);\n }\n return html`\n <div\n class=\"toast sgds\"\n role=\"alert\"\n aria-hidden=${this.show ? \"false\" : \"true\"}\n aria-live=\"assertive\"\n aria-atomic=\"true\"\n >\n <div class=\"toast-header\">\n <slot name=\"icon\"></slot>\n <strong>${this.title}</strong>\n <small><slot name=\"duration\"></slot></small>\n <sgds-close-button ariaLabel=\"close toast\" @click=${this.handleCloseClick}></sgds-close-button>\n </div>\n <div class=\"toast-body\"><slot></slot></div>\n </div>\n `;\n }\n}\n\nexport default SgdsToast;\n\nsetDefaultAnimation(\"toast.show\", {\n keyframes: [{ opacity: 0 }, { opacity: 1 }],\n options: { duration: 400, easing: \"ease\" }\n});\nsetDefaultAnimation(\"toast.hide\", {\n keyframes: [{ opacity: 1 }, { opacity: 0 }],\n options: { duration: 400, easing: \"ease\" }\n});\n"],"names":["ScopedElementsMixin","SgdsElement","SgdsCloseButton","waitForEvent","getAnimation","animateTo","html","toastStyle","__decorate","query","property","watch","setDefaultAnimation"],"mappings":";;;;;;;;;;;;;;;;AAUA;;;;;;;;;;;;;;AAcG;MACU,SAAU,SAAQA,kCAAmB,CAACC,sBAAW,CAAC,CAAA;AAA/D,IAAA,WAAA,GAAA;;;QAY8C,IAAI,CAAA,IAAA,GAAG,KAAK,CAAC;;QAEd,IAAK,CAAA,KAAA,GAAG,OAAO,CAAC;;QAEf,IAAW,CAAA,WAAA,GAAG,KAAK,CAAC;;QAEpB,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;;QAElB,IAAK,CAAA,KAAA,GAAG,IAAI,CAAC;;QAEb,IAAO,CAAA,OAAA,GAA8C,MAAM,CAAC;KA0ExG;;AA7FC,IAAA,WAAW,cAAc,GAAA;QACvB,OAAO;AACL,YAAA,mBAAmB,EAAEC,+BAAe;SACrC,CAAC;KACH;;AAkBM,IAAA,MAAM,SAAS,GAAA;AACpB,QAAA,IAAI,IAAI,CAAC,IAAI,EAAE;YACb,OAAO;SACR;AAED,QAAA,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;AACjB,QAAA,OAAOC,kBAAY,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;KAC9C;;AAGM,IAAA,MAAM,SAAS,GAAA;AACpB,QAAA,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;YACd,OAAO;SACR;AACD,QAAA,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;AAClB,QAAA,OAAOA,kBAAY,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;KAC9C;;IAGD,gBAAgB,GAAA;AACd,QAAA,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;AAClB,QAAA,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;KACzB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CAAA,EAAA,SAAA,CAAA,SAAA,EAAA,OAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAEbF,gBAAA,CAAA;IAA1CE,sBAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAA6D,CAAA,EAAA,SAAA,CAAA,SAAA,EAAA,SAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AA4BjGF,gBAAA,CAAA;IADLG,WAAK,CAAC,MAAM,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;AAkB7C,CAAA,EAAA,SAAA,CAAA,SAAA,EAAA,kBAAA,EAAA,IAAA,CAAA,CAAA;AAiCHC,qCAAmB,CAAC,YAAY,EAAE;AAChC,IAAA,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;IAC3C,OAAO,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE;AAC3C,CAAA,CAAC,CAAC;AACHA,qCAAmB,CAAC,YAAY,EAAE;AAChC,IAAA,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;IAC3C,OAAO,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE;AAC3C,CAAA,CAAC;;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import SgdsElement from "../../base/sgds-element";
|
|
2
2
|
import SgdsCloseButton from "../../internals/CloseButton/sgds-close-button";
|
|
3
|
-
declare const SgdsToast_base: typeof SgdsElement & import("@open-wc/scoped-elements/
|
|
3
|
+
declare const SgdsToast_base: typeof SgdsElement & import("@open-wc/dedupe-mixin").Constructor<import("@open-wc/scoped-elements/types/src/types").ScopedElementsHost>;
|
|
4
4
|
/**
|
|
5
5
|
* @summary Toast allows you to convey quick messaging notifications to the user.
|
|
6
6
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __decorate } from 'tslib';
|
|
2
|
-
import { ScopedElementsMixin } from '@open-wc/scoped-elements
|
|
2
|
+
import { ScopedElementsMixin } from '@open-wc/scoped-elements';
|
|
3
3
|
import { query, property } from 'lit/decorators.js';
|
|
4
4
|
import { html } from 'lit/static-html.js';
|
|
5
5
|
import SgdsElement from '../../base/sgds-element.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sgds-toast.js","sources":["../../../src/components/Toast/sgds-toast.ts"],"sourcesContent":["import { ScopedElementsMixin } from \"@open-wc/scoped-elements
|
|
1
|
+
{"version":3,"file":"sgds-toast.js","sources":["../../../src/components/Toast/sgds-toast.ts"],"sourcesContent":["import { ScopedElementsMixin } from \"@open-wc/scoped-elements\";\nimport { property, query } from \"lit/decorators.js\";\nimport { html } from \"lit/static-html.js\";\nimport SgdsElement from \"../../base/sgds-element\";\nimport SgdsCloseButton from \"../../internals/CloseButton/sgds-close-button\";\nimport { animateTo } from \"../../utils/animate\";\nimport { getAnimation, setDefaultAnimation } from \"../../utils/animation-registry\";\nimport { waitForEvent } from \"../../utils/event\";\nimport { watch } from \"../../utils/watch\";\nimport toastStyle from \"./toast.css\";\n/**\n * @summary Toast allows you to convey quick messaging notifications to the user.\n *\n * @slot default - The content to pass into toast's body\n * @slot icon - The slot to pass in icon to toast's header\n * @slot duration - When required, pass in the duration since toast appeared to this slot\n *\n *\n * @event sgds-show - Emitted on show.\n * @event sgds-after-show - Emitted on show after animation has completed.\n * @event sgds-hide - Emitted on hide.\n * @event sgds-after-hide - Emitted on hide after animation has completed.\n \n * @cssproperty --toast-icon-margin-right - The margin right between toast's icon and title in its header.\n */\nexport class SgdsToast extends ScopedElementsMixin(SgdsElement) {\n static styles = [...SgdsElement.styles, toastStyle];\n /**@internal */\n static get scopedElements() {\n return {\n \"sgds-close-button\": SgdsCloseButton\n };\n }\n\n /**@internal */\n @query(\"div.toast\") toast: HTMLElement;\n /** Controls the appearance of toast */\n @property({ type: Boolean, reflect: true }) show = false;\n /** The header title of toast. It is required to assign a title to toast */\n @property({ type: String, reflect: true }) title = \"Title\";\n /** Controls whether the toast has fade animation during its appearance/disappearance */\n @property({ type: Boolean, reflect: true }) noAnimation = false;\n /** Controls if the toast will hide itself after the delay time. Works with delay property */\n @property({ type: Boolean, reflect: true }) autohide = false;\n /** The amount of time taken for toast to disappear after its first render. It takes effect only when autohide is set to true */\n @property({ type: Number, reflect: true }) delay = 5000;\n /**Adds CSS styling to `<Toast />` based on the defined status */\n @property({ type: String, reflect: true }) variant: \"success\" | \"warning\" | \"danger\" | \"info\" = \"info\";\n\n /** Shows the toast */\n public async showToast() {\n if (this.show) {\n return;\n }\n\n this.show = true;\n return waitForEvent(this, \"sgds-after-show\");\n }\n\n /** Hide the toast */\n public async hideToast() {\n if (!this.show) {\n return;\n }\n this.show = false;\n return waitForEvent(this, \"sgds-after-hide\");\n }\n\n /** @internal */\n handleCloseClick() {\n this.show = false;\n this.emit(\"sgds-close\");\n }\n /**@internal */\n @watch(\"show\", { waitUntilFirstUpdate: true })\n async handleShowChange() {\n if (this.show) {\n this.emit(\"sgds-show\");\n this.toast.hidden = !this.show;\n\n const toastAnimation = getAnimation(this, \"toast.show\");\n !this.noAnimation && (await animateTo(this.toast, toastAnimation.keyframes, toastAnimation.options));\n\n this.emit(\"sgds-after-show\");\n } else {\n this.emit(\"sgds-hide\");\n const toastAnimation = getAnimation(this, \"toast.hide\");\n\n !this.noAnimation && (await animateTo(this.toast, toastAnimation.keyframes, toastAnimation.options));\n this.emit(\"sgds-after-hide\");\n this.toast.hidden = !this.show;\n }\n }\n protected firstUpdated(): void {\n this.toast.hidden = !this.show;\n }\n\n render() {\n if (this.autohide && this.show) {\n setTimeout(() => {\n this.show = false;\n }, this.delay);\n }\n return html`\n <div\n class=\"toast sgds\"\n role=\"alert\"\n aria-hidden=${this.show ? \"false\" : \"true\"}\n aria-live=\"assertive\"\n aria-atomic=\"true\"\n >\n <div class=\"toast-header\">\n <slot name=\"icon\"></slot>\n <strong>${this.title}</strong>\n <small><slot name=\"duration\"></slot></small>\n <sgds-close-button ariaLabel=\"close toast\" @click=${this.handleCloseClick}></sgds-close-button>\n </div>\n <div class=\"toast-body\"><slot></slot></div>\n </div>\n `;\n }\n}\n\nexport default SgdsToast;\n\nsetDefaultAnimation(\"toast.show\", {\n keyframes: [{ opacity: 0 }, { opacity: 1 }],\n options: { duration: 400, easing: \"ease\" }\n});\nsetDefaultAnimation(\"toast.hide\", {\n keyframes: [{ opacity: 1 }, { opacity: 0 }],\n options: { duration: 400, easing: \"ease\" }\n});\n"],"names":["toastStyle"],"mappings":";;;;;;;;;;;;AAUA;;;;;;;;;;;;;;AAcG;MACU,SAAU,SAAQ,mBAAmB,CAAC,WAAW,CAAC,CAAA;AAA/D,IAAA,WAAA,GAAA;;;QAY8C,IAAI,CAAA,IAAA,GAAG,KAAK,CAAC;;QAEd,IAAK,CAAA,KAAA,GAAG,OAAO,CAAC;;QAEf,IAAW,CAAA,WAAA,GAAG,KAAK,CAAC;;QAEpB,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;;QAElB,IAAK,CAAA,KAAA,GAAG,IAAI,CAAC;;QAEb,IAAO,CAAA,OAAA,GAA8C,MAAM,CAAC;KA0ExG;;AA7FC,IAAA,WAAW,cAAc,GAAA;QACvB,OAAO;AACL,YAAA,mBAAmB,EAAE,eAAe;SACrC,CAAC;KACH;;AAkBM,IAAA,MAAM,SAAS,GAAA;AACpB,QAAA,IAAI,IAAI,CAAC,IAAI,EAAE;YACb,OAAO;SACR;AAED,QAAA,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;AACjB,QAAA,OAAO,YAAY,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;KAC9C;;AAGM,IAAA,MAAM,SAAS,GAAA;AACpB,QAAA,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;YACd,OAAO;SACR;AACD,QAAA,IAAI,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