123b3eb3cSopenharmony_ci/* 223b3eb3cSopenharmony_ci * Copyright (c) 2023-2024 Huawei Device Co., Ltd. 323b3eb3cSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 423b3eb3cSopenharmony_ci * you may not use this file except in compliance with the License. 523b3eb3cSopenharmony_ci * You may obtain a copy of the License at 623b3eb3cSopenharmony_ci * 723b3eb3cSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 823b3eb3cSopenharmony_ci * 923b3eb3cSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 1023b3eb3cSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 1123b3eb3cSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1223b3eb3cSopenharmony_ci * See the License for the specific language governing permissions and 1323b3eb3cSopenharmony_ci * limitations under the License. 1423b3eb3cSopenharmony_ci */ 1523b3eb3cSopenharmony_ci 1623b3eb3cSopenharmony_ciif (!("finalizeConstruction" in ViewPU.prototype)) { 1723b3eb3cSopenharmony_ci Reflect.set(ViewPU.prototype, "finalizeConstruction", () => { }); 1823b3eb3cSopenharmony_ci} 1923b3eb3cSopenharmony_ci 2023b3eb3cSopenharmony_ciconst display = requireNapi('display'); 2123b3eb3cSopenharmony_ciconst mediaquery = requireNapi('mediaquery'); 2223b3eb3cSopenharmony_ciconst LengthMetrics = requireNapi('arkui.node').LengthMetrics; 2323b3eb3cSopenharmony_ci 2423b3eb3cSopenharmony_ciexport const defaultTheme = { 2523b3eb3cSopenharmony_ci icon: { 2623b3eb3cSopenharmony_ci size: { width: 32, height: 32 }, 2723b3eb3cSopenharmony_ci margin: { 2823b3eb3cSopenharmony_ci top: LengthMetrics.vp(12), 2923b3eb3cSopenharmony_ci bottom: LengthMetrics.vp(12), 3023b3eb3cSopenharmony_ci start: LengthMetrics.vp(12), 3123b3eb3cSopenharmony_ci end: LengthMetrics.vp(12) 3223b3eb3cSopenharmony_ci }, 3323b3eb3cSopenharmony_ci fillColor: '', 3423b3eb3cSopenharmony_ci borderRadius: { 3523b3eb3cSopenharmony_ci "id": -1, 3623b3eb3cSopenharmony_ci "type": 10002, 3723b3eb3cSopenharmony_ci params: ['sys.float.ohos_id_corner_radius_default_s'], 3823b3eb3cSopenharmony_ci "bundleName": "__harDefaultBundleName__", 3923b3eb3cSopenharmony_ci "moduleName": "__harDefaultModuleName__" 4023b3eb3cSopenharmony_ci } 4123b3eb3cSopenharmony_ci }, 4223b3eb3cSopenharmony_ci title: { 4323b3eb3cSopenharmony_ci margin: { bottom: LengthMetrics.vp(2) }, 4423b3eb3cSopenharmony_ci minFontSize: 12, 4523b3eb3cSopenharmony_ci fontWeight: FontWeight.Medium, 4623b3eb3cSopenharmony_ci fontSize: { 4723b3eb3cSopenharmony_ci "id": -1, 4823b3eb3cSopenharmony_ci "type": 10002, 4923b3eb3cSopenharmony_ci params: ['sys.float.ohos_id_text_size_sub_title2'], 5023b3eb3cSopenharmony_ci "bundleName": "__harDefaultBundleName__", 5123b3eb3cSopenharmony_ci "moduleName": "__harDefaultModuleName__" 5223b3eb3cSopenharmony_ci }, 5323b3eb3cSopenharmony_ci fontColor: { 5423b3eb3cSopenharmony_ci "id": -1, 5523b3eb3cSopenharmony_ci "type": 10001, 5623b3eb3cSopenharmony_ci params: ['sys.color.font_primary'], 5723b3eb3cSopenharmony_ci "bundleName": "__harDefaultBundleName__", 5823b3eb3cSopenharmony_ci "moduleName": "__harDefaultModuleName__" 5923b3eb3cSopenharmony_ci } 6023b3eb3cSopenharmony_ci }, 6123b3eb3cSopenharmony_ci button: { 6223b3eb3cSopenharmony_ci margin: { 6323b3eb3cSopenharmony_ci top: LengthMetrics.vp(16), 6423b3eb3cSopenharmony_ci bottom: LengthMetrics.vp(16), 6523b3eb3cSopenharmony_ci start: LengthMetrics.vp(16), 6623b3eb3cSopenharmony_ci end: LengthMetrics.vp(16) 6723b3eb3cSopenharmony_ci }, 6823b3eb3cSopenharmony_ci padding: { 6923b3eb3cSopenharmony_ci top: LengthMetrics.vp(4), 7023b3eb3cSopenharmony_ci bottom: LengthMetrics.vp(4), 7123b3eb3cSopenharmony_ci start: LengthMetrics.vp(4), 7223b3eb3cSopenharmony_ci end: LengthMetrics.vp(4) 7323b3eb3cSopenharmony_ci }, 7423b3eb3cSopenharmony_ci fontSize: { 7523b3eb3cSopenharmony_ci "id": -1, 7623b3eb3cSopenharmony_ci "type": 10002, 7723b3eb3cSopenharmony_ci params: ['sys.float.ohos_id_text_size_button2'], 7823b3eb3cSopenharmony_ci "bundleName": "__harDefaultBundleName__", 7923b3eb3cSopenharmony_ci "moduleName": "__harDefaultModuleName__" 8023b3eb3cSopenharmony_ci }, 8123b3eb3cSopenharmony_ci fontColor: { 8223b3eb3cSopenharmony_ci "id": -1, 8323b3eb3cSopenharmony_ci "type": 10001, 8423b3eb3cSopenharmony_ci params: ['sys.color.font_emphasize'], 8523b3eb3cSopenharmony_ci "bundleName": "__harDefaultBundleName__", 8623b3eb3cSopenharmony_ci "moduleName": "__harDefaultModuleName__" 8723b3eb3cSopenharmony_ci }, 8823b3eb3cSopenharmony_ci textMargin: { 8923b3eb3cSopenharmony_ci top: LengthMetrics.vp(8), 9023b3eb3cSopenharmony_ci bottom: LengthMetrics.vp(8), 9123b3eb3cSopenharmony_ci start: LengthMetrics.vp(8), 9223b3eb3cSopenharmony_ci end: LengthMetrics.vp(8) 9323b3eb3cSopenharmony_ci }, 9423b3eb3cSopenharmony_ci minFontSize: 9, 9523b3eb3cSopenharmony_ci fontWeight: FontWeight.Medium, 9623b3eb3cSopenharmony_ci hoverColor: { 9723b3eb3cSopenharmony_ci "id": -1, 9823b3eb3cSopenharmony_ci "type": 10001, 9923b3eb3cSopenharmony_ci params: ['sys.color.ohos_id_color_hover'], 10023b3eb3cSopenharmony_ci "bundleName": "__harDefaultBundleName__", 10123b3eb3cSopenharmony_ci "moduleName": "__harDefaultModuleName__" 10223b3eb3cSopenharmony_ci }, 10323b3eb3cSopenharmony_ci backgroundColor: { 10423b3eb3cSopenharmony_ci "id": -1, 10523b3eb3cSopenharmony_ci "type": 10001, 10623b3eb3cSopenharmony_ci params: ['sys.color.ohos_id_color_background_transparent'], 10723b3eb3cSopenharmony_ci "bundleName": "__harDefaultBundleName__", 10823b3eb3cSopenharmony_ci "moduleName": "__harDefaultModuleName__" 10923b3eb3cSopenharmony_ci } 11023b3eb3cSopenharmony_ci }, 11123b3eb3cSopenharmony_ci message: { 11223b3eb3cSopenharmony_ci fontSize: { 11323b3eb3cSopenharmony_ci "id": -1, 11423b3eb3cSopenharmony_ci "type": 10002, 11523b3eb3cSopenharmony_ci params: ['sys.float.ohos_id_text_size_body2'], 11623b3eb3cSopenharmony_ci "bundleName": "__harDefaultBundleName__", 11723b3eb3cSopenharmony_ci "moduleName": "__harDefaultModuleName__" 11823b3eb3cSopenharmony_ci }, 11923b3eb3cSopenharmony_ci fontColor: { 12023b3eb3cSopenharmony_ci "id": -1, 12123b3eb3cSopenharmony_ci "type": 10001, 12223b3eb3cSopenharmony_ci params: ['sys.color.font_secondary'], 12323b3eb3cSopenharmony_ci "bundleName": "__harDefaultBundleName__", 12423b3eb3cSopenharmony_ci "moduleName": "__harDefaultModuleName__" 12523b3eb3cSopenharmony_ci }, 12623b3eb3cSopenharmony_ci fontWeight: FontWeight.Regular, 12723b3eb3cSopenharmony_ci plainFontColor: { 12823b3eb3cSopenharmony_ci "id": -1, 12923b3eb3cSopenharmony_ci "type": 10001, 13023b3eb3cSopenharmony_ci params: ['sys.color.font_primary'], 13123b3eb3cSopenharmony_ci "bundleName": "__harDefaultBundleName__", 13223b3eb3cSopenharmony_ci "moduleName": "__harDefaultModuleName__" 13323b3eb3cSopenharmony_ci } 13423b3eb3cSopenharmony_ci }, 13523b3eb3cSopenharmony_ci windows: { 13623b3eb3cSopenharmony_ci padding: { 13723b3eb3cSopenharmony_ci top: LengthMetrics.vp(12), 13823b3eb3cSopenharmony_ci bottom: LengthMetrics.vp(12), 13923b3eb3cSopenharmony_ci start: LengthMetrics.vp(12), 14023b3eb3cSopenharmony_ci end: LengthMetrics.vp(12) 14123b3eb3cSopenharmony_ci }, 14223b3eb3cSopenharmony_ci }, 14323b3eb3cSopenharmony_ci closeButton: { 14423b3eb3cSopenharmony_ci size: { width: 22, height: 22 }, 14523b3eb3cSopenharmony_ci imageSize: { width: 18, height: 18 }, 14623b3eb3cSopenharmony_ci padding: { 14723b3eb3cSopenharmony_ci top: LengthMetrics.vp(2), 14823b3eb3cSopenharmony_ci bottom: LengthMetrics.vp(2), 14923b3eb3cSopenharmony_ci start: LengthMetrics.vp(2), 15023b3eb3cSopenharmony_ci end: LengthMetrics.vp(2) 15123b3eb3cSopenharmony_ci }, 15223b3eb3cSopenharmony_ci margin: { 15323b3eb3cSopenharmony_ci top: LengthMetrics.vp(12), 15423b3eb3cSopenharmony_ci bottom: LengthMetrics.vp(12), 15523b3eb3cSopenharmony_ci start: LengthMetrics.vp(12), 15623b3eb3cSopenharmony_ci end: LengthMetrics.vp(12) 15723b3eb3cSopenharmony_ci }, 15823b3eb3cSopenharmony_ci image: { 15923b3eb3cSopenharmony_ci "id": -1, 16023b3eb3cSopenharmony_ci "type": 20000, 16123b3eb3cSopenharmony_ci params: ['sys.media.ohos_ic_public_cancel'], 16223b3eb3cSopenharmony_ci "bundleName": "__harDefaultBundleName__", 16323b3eb3cSopenharmony_ci "moduleName": "__harDefaultModuleName__" 16423b3eb3cSopenharmony_ci }, 16523b3eb3cSopenharmony_ci fillColor: { 16623b3eb3cSopenharmony_ci "id": -1, 16723b3eb3cSopenharmony_ci "type": 10001, 16823b3eb3cSopenharmony_ci params: ['sys.color.icon_secondary'], 16923b3eb3cSopenharmony_ci "bundleName": "__harDefaultBundleName__", 17023b3eb3cSopenharmony_ci "moduleName": "__harDefaultModuleName__" 17123b3eb3cSopenharmony_ci }, 17223b3eb3cSopenharmony_ci hoverColor: { 17323b3eb3cSopenharmony_ci "id": -1, 17423b3eb3cSopenharmony_ci "type": 10001, 17523b3eb3cSopenharmony_ci params: ['sys.color.ohos_id_color_hover'], 17623b3eb3cSopenharmony_ci "bundleName": "__harDefaultBundleName__", 17723b3eb3cSopenharmony_ci "moduleName": "__harDefaultModuleName__" 17823b3eb3cSopenharmony_ci }, 17923b3eb3cSopenharmony_ci backgroundColor: { 18023b3eb3cSopenharmony_ci "id": -1, 18123b3eb3cSopenharmony_ci "type": 10001, 18223b3eb3cSopenharmony_ci params: ['sys.color.ohos_id_color_background_transparent'], 18323b3eb3cSopenharmony_ci "bundleName": "__harDefaultBundleName__", 18423b3eb3cSopenharmony_ci "moduleName": "__harDefaultModuleName__" 18523b3eb3cSopenharmony_ci } 18623b3eb3cSopenharmony_ci }, 18723b3eb3cSopenharmony_ci}; 18823b3eb3cSopenharmony_ciconst noop = () => { 18923b3eb3cSopenharmony_ci}; 19023b3eb3cSopenharmony_ci 19123b3eb3cSopenharmony_ciexport function Popup(r29, s29 = null) { 19223b3eb3cSopenharmony_ci const t29 = r29; 19323b3eb3cSopenharmony_ci { 19423b3eb3cSopenharmony_ci (s29 ? s29 : this).observeComponentCreation2((v29, w29, x29 = t29) => { 19523b3eb3cSopenharmony_ci if (w29) { 19623b3eb3cSopenharmony_ci let y29 = new PopupComponent(typeof PUV2ViewBase !== "undefined" && s29 instanceof PUV2ViewBase ? s29 : this, { 19723b3eb3cSopenharmony_ci icon: x29.icon, 19823b3eb3cSopenharmony_ci title: x29.title, 19923b3eb3cSopenharmony_ci message: x29.message, 20023b3eb3cSopenharmony_ci popupDirection: x29.direction, 20123b3eb3cSopenharmony_ci showClose: x29.showClose, 20223b3eb3cSopenharmony_ci onClose: x29.onClose, 20323b3eb3cSopenharmony_ci buttons: x29.buttons 20423b3eb3cSopenharmony_ci }, undefined, v29, () => { 20523b3eb3cSopenharmony_ci }, { page: "library/src/main/ets/components/popup/popup.ets", line: 198, col: 3 }); 20623b3eb3cSopenharmony_ci ViewPU.create(y29); 20723b3eb3cSopenharmony_ci let z29 = () => { 20823b3eb3cSopenharmony_ci return { 20923b3eb3cSopenharmony_ci icon: x29.icon, 21023b3eb3cSopenharmony_ci title: x29.title, 21123b3eb3cSopenharmony_ci message: x29.message, 21223b3eb3cSopenharmony_ci popupDirection: x29.direction, 21323b3eb3cSopenharmony_ci showClose: x29.showClose, 21423b3eb3cSopenharmony_ci onClose: x29.onClose, 21523b3eb3cSopenharmony_ci buttons: x29.buttons 21623b3eb3cSopenharmony_ci }; 21723b3eb3cSopenharmony_ci }; 21823b3eb3cSopenharmony_ci y29.paramsGenerator_ = z29; 21923b3eb3cSopenharmony_ci } 22023b3eb3cSopenharmony_ci else { 22123b3eb3cSopenharmony_ci (s29 ? s29 : this).updateStateVarsOfChildByElmtId(v29, { 22223b3eb3cSopenharmony_ci icon: x29.icon, 22323b3eb3cSopenharmony_ci title: x29.title, 22423b3eb3cSopenharmony_ci message: x29.message, 22523b3eb3cSopenharmony_ci popupDirection: x29.direction, 22623b3eb3cSopenharmony_ci showClose: x29.showClose, 22723b3eb3cSopenharmony_ci buttons: x29.buttons 22823b3eb3cSopenharmony_ci }); 22923b3eb3cSopenharmony_ci } 23023b3eb3cSopenharmony_ci }, { name: "PopupComponent" }); 23123b3eb3cSopenharmony_ci } 23223b3eb3cSopenharmony_ci} 23323b3eb3cSopenharmony_ci 23423b3eb3cSopenharmony_ciexport class PopupComponent extends ViewPU { 23523b3eb3cSopenharmony_ci constructor(l29, m29, n29, o29 = -1, p29 = undefined, q29) { 23623b3eb3cSopenharmony_ci super(l29, n29, o29, q29); 23723b3eb3cSopenharmony_ci if (typeof p29 === "function") { 23823b3eb3cSopenharmony_ci this.paramsGenerator_ = p29; 23923b3eb3cSopenharmony_ci } 24023b3eb3cSopenharmony_ci this.onClose = noop; 24123b3eb3cSopenharmony_ci this.theme = defaultTheme; 24223b3eb3cSopenharmony_ci this.__icon = new SynchedPropertyObjectOneWayPU(m29.icon, this, "icon"); 24323b3eb3cSopenharmony_ci this.__title = new SynchedPropertyObjectOneWayPU(m29.title, this, "title"); 24423b3eb3cSopenharmony_ci this.__message = new SynchedPropertyObjectOneWayPU(m29.message, this, "message"); 24523b3eb3cSopenharmony_ci this.__popupDirection = new SynchedPropertySimpleOneWayPU(m29.popupDirection, this, "popupDirection"); 24623b3eb3cSopenharmony_ci this.__showClose = new SynchedPropertyObjectOneWayPU(m29.showClose, this, "showClose"); 24723b3eb3cSopenharmony_ci this.__buttons = new SynchedPropertyObjectOneWayPU(m29.buttons, this, "buttons"); 24823b3eb3cSopenharmony_ci this.textHeight = 0; 24923b3eb3cSopenharmony_ci this.__titleHeight = new ObservedPropertySimplePU(0, this, "titleHeight"); 25023b3eb3cSopenharmony_ci this.__applyHeight = new ObservedPropertySimplePU(0, this, "applyHeight"); 25123b3eb3cSopenharmony_ci this.__buttonHeight = new ObservedPropertySimplePU(0, this, "buttonHeight"); 25223b3eb3cSopenharmony_ci this.__messageMaxWeight = new ObservedPropertyObjectPU(0, this, "messageMaxWeight"); 25323b3eb3cSopenharmony_ci this.__beforeScreenStatus = new ObservedPropertySimplePU(undefined, this, "beforeScreenStatus"); 25423b3eb3cSopenharmony_ci this.__currentScreenStatus = new ObservedPropertySimplePU(true, this, "currentScreenStatus"); 25523b3eb3cSopenharmony_ci this.__applySizeOptions = new ObservedPropertyObjectPU(undefined, this, "applySizeOptions"); 25623b3eb3cSopenharmony_ci this.__closeButtonBackgroundColor = new ObservedPropertyObjectPU({ 25723b3eb3cSopenharmony_ci "id": -1, 25823b3eb3cSopenharmony_ci "type": 10001, 25923b3eb3cSopenharmony_ci params: ['sys.color.ohos_id_color_background_transparent'], 26023b3eb3cSopenharmony_ci "bundleName": "__harDefaultBundleName__", 26123b3eb3cSopenharmony_ci "moduleName": "__harDefaultModuleName__" 26223b3eb3cSopenharmony_ci }, this, "closeButtonBackgroundColor"); 26323b3eb3cSopenharmony_ci this.__firstButtonBackgroundColor = new ObservedPropertyObjectPU({ 26423b3eb3cSopenharmony_ci "id": -1, 26523b3eb3cSopenharmony_ci "type": 10001, 26623b3eb3cSopenharmony_ci params: ['sys.color.ohos_id_color_background_transparent'], 26723b3eb3cSopenharmony_ci "bundleName": "__harDefaultBundleName__", 26823b3eb3cSopenharmony_ci "moduleName": "__harDefaultModuleName__" 26923b3eb3cSopenharmony_ci }, this, "firstButtonBackgroundColor"); 27023b3eb3cSopenharmony_ci this.__secondButtonBackgroundColor = new ObservedPropertyObjectPU({ 27123b3eb3cSopenharmony_ci "id": -1, 27223b3eb3cSopenharmony_ci "type": 10001, 27323b3eb3cSopenharmony_ci params: ['sys.color.ohos_id_color_background_transparent'], 27423b3eb3cSopenharmony_ci "bundleName": "__harDefaultBundleName__", 27523b3eb3cSopenharmony_ci "moduleName": "__harDefaultModuleName__" 27623b3eb3cSopenharmony_ci }, this, "secondButtonBackgroundColor"); 27723b3eb3cSopenharmony_ci this.__closeButtonFillColorWithTheme = new ObservedPropertyObjectPU({ 27823b3eb3cSopenharmony_ci "id": -1, 27923b3eb3cSopenharmony_ci "type": 10001, 28023b3eb3cSopenharmony_ci params: ['sys.color.icon_secondary'], 28123b3eb3cSopenharmony_ci "bundleName": "__harDefaultBundleName__", 28223b3eb3cSopenharmony_ci "moduleName": "__harDefaultModuleName__" 28323b3eb3cSopenharmony_ci }, this, "closeButtonFillColorWithTheme"); 28423b3eb3cSopenharmony_ci this.listener = mediaquery.matchMediaSync('(orientation: landscape)'); 28523b3eb3cSopenharmony_ci this.setInitiallyProvidedValue(m29); 28623b3eb3cSopenharmony_ci this.finalizeConstruction(); 28723b3eb3cSopenharmony_ci } 28823b3eb3cSopenharmony_ci 28923b3eb3cSopenharmony_ci setInitiallyProvidedValue(k29) { 29023b3eb3cSopenharmony_ci if (k29.onClose !== undefined) { 29123b3eb3cSopenharmony_ci this.onClose = k29.onClose; 29223b3eb3cSopenharmony_ci } 29323b3eb3cSopenharmony_ci if (k29.theme !== undefined) { 29423b3eb3cSopenharmony_ci this.theme = k29.theme; 29523b3eb3cSopenharmony_ci } 29623b3eb3cSopenharmony_ci if (k29.icon === undefined) { 29723b3eb3cSopenharmony_ci this.__icon.set({ image: '' }); 29823b3eb3cSopenharmony_ci } 29923b3eb3cSopenharmony_ci if (k29.title === undefined) { 30023b3eb3cSopenharmony_ci this.__title.set({ text: '' }); 30123b3eb3cSopenharmony_ci } 30223b3eb3cSopenharmony_ci if (k29.message === undefined) { 30323b3eb3cSopenharmony_ci this.__message.set({ text: '' }); 30423b3eb3cSopenharmony_ci } 30523b3eb3cSopenharmony_ci if (k29.popupDirection === undefined) { 30623b3eb3cSopenharmony_ci this.__popupDirection.set(Direction.Auto); 30723b3eb3cSopenharmony_ci } 30823b3eb3cSopenharmony_ci if (k29.showClose === undefined) { 30923b3eb3cSopenharmony_ci this.__showClose.set(true); 31023b3eb3cSopenharmony_ci } 31123b3eb3cSopenharmony_ci if (k29.buttons === undefined) { 31223b3eb3cSopenharmony_ci this.__buttons.set([{ text: '' }, { text: '' }]); 31323b3eb3cSopenharmony_ci } 31423b3eb3cSopenharmony_ci if (k29.textHeight !== undefined) { 31523b3eb3cSopenharmony_ci this.textHeight = k29.textHeight; 31623b3eb3cSopenharmony_ci } 31723b3eb3cSopenharmony_ci if (k29.titleHeight !== undefined) { 31823b3eb3cSopenharmony_ci this.titleHeight = k29.titleHeight; 31923b3eb3cSopenharmony_ci } 32023b3eb3cSopenharmony_ci if (k29.applyHeight !== undefined) { 32123b3eb3cSopenharmony_ci this.applyHeight = k29.applyHeight; 32223b3eb3cSopenharmony_ci } 32323b3eb3cSopenharmony_ci if (k29.buttonHeight !== undefined) { 32423b3eb3cSopenharmony_ci this.buttonHeight = k29.buttonHeight; 32523b3eb3cSopenharmony_ci } 32623b3eb3cSopenharmony_ci if (k29.messageMaxWeight !== undefined) { 32723b3eb3cSopenharmony_ci this.messageMaxWeight = k29.messageMaxWeight; 32823b3eb3cSopenharmony_ci } 32923b3eb3cSopenharmony_ci if (k29.beforeScreenStatus !== undefined) { 33023b3eb3cSopenharmony_ci this.beforeScreenStatus = k29.beforeScreenStatus; 33123b3eb3cSopenharmony_ci } 33223b3eb3cSopenharmony_ci if (k29.currentScreenStatus !== undefined) { 33323b3eb3cSopenharmony_ci this.currentScreenStatus = k29.currentScreenStatus; 33423b3eb3cSopenharmony_ci } 33523b3eb3cSopenharmony_ci if (k29.applySizeOptions !== undefined) { 33623b3eb3cSopenharmony_ci this.applySizeOptions = k29.applySizeOptions; 33723b3eb3cSopenharmony_ci } 33823b3eb3cSopenharmony_ci if (k29.closeButtonBackgroundColor !== undefined) { 33923b3eb3cSopenharmony_ci this.closeButtonBackgroundColor = k29.closeButtonBackgroundColor; 34023b3eb3cSopenharmony_ci } 34123b3eb3cSopenharmony_ci if (k29.firstButtonBackgroundColor !== undefined) { 34223b3eb3cSopenharmony_ci this.firstButtonBackgroundColor = k29.firstButtonBackgroundColor; 34323b3eb3cSopenharmony_ci } 34423b3eb3cSopenharmony_ci if (k29.secondButtonBackgroundColor !== undefined) { 34523b3eb3cSopenharmony_ci this.secondButtonBackgroundColor = k29.secondButtonBackgroundColor; 34623b3eb3cSopenharmony_ci } 34723b3eb3cSopenharmony_ci if (k29.closeButtonFillColorWithTheme !== undefined) { 34823b3eb3cSopenharmony_ci this.closeButtonFillColorWithTheme = k29.closeButtonFillColorWithTheme; 34923b3eb3cSopenharmony_ci } 35023b3eb3cSopenharmony_ci if (k29.listener !== undefined) { 35123b3eb3cSopenharmony_ci this.listener = k29.listener; 35223b3eb3cSopenharmony_ci } 35323b3eb3cSopenharmony_ci } 35423b3eb3cSopenharmony_ci 35523b3eb3cSopenharmony_ci updateStateVars(j29) { 35623b3eb3cSopenharmony_ci this.__icon.reset(j29.icon); 35723b3eb3cSopenharmony_ci this.__title.reset(j29.title); 35823b3eb3cSopenharmony_ci this.__message.reset(j29.message); 35923b3eb3cSopenharmony_ci this.__popupDirection.reset(j29.popupDirection); 36023b3eb3cSopenharmony_ci this.__showClose.reset(j29.showClose); 36123b3eb3cSopenharmony_ci this.__buttons.reset(j29.buttons); 36223b3eb3cSopenharmony_ci } 36323b3eb3cSopenharmony_ci 36423b3eb3cSopenharmony_ci purgeVariableDependenciesOnElmtId(i29) { 36523b3eb3cSopenharmony_ci this.__icon.purgeDependencyOnElmtId(i29); 36623b3eb3cSopenharmony_ci this.__title.purgeDependencyOnElmtId(i29); 36723b3eb3cSopenharmony_ci this.__message.purgeDependencyOnElmtId(i29); 36823b3eb3cSopenharmony_ci this.__popupDirection.purgeDependencyOnElmtId(i29); 36923b3eb3cSopenharmony_ci this.__showClose.purgeDependencyOnElmtId(i29); 37023b3eb3cSopenharmony_ci this.__buttons.purgeDependencyOnElmtId(i29); 37123b3eb3cSopenharmony_ci this.__titleHeight.purgeDependencyOnElmtId(i29); 37223b3eb3cSopenharmony_ci this.__applyHeight.purgeDependencyOnElmtId(i29); 37323b3eb3cSopenharmony_ci this.__buttonHeight.purgeDependencyOnElmtId(i29); 37423b3eb3cSopenharmony_ci this.__messageMaxWeight.purgeDependencyOnElmtId(i29); 37523b3eb3cSopenharmony_ci this.__beforeScreenStatus.purgeDependencyOnElmtId(i29); 37623b3eb3cSopenharmony_ci this.__currentScreenStatus.purgeDependencyOnElmtId(i29); 37723b3eb3cSopenharmony_ci this.__applySizeOptions.purgeDependencyOnElmtId(i29); 37823b3eb3cSopenharmony_ci this.__closeButtonBackgroundColor.purgeDependencyOnElmtId(i29); 37923b3eb3cSopenharmony_ci this.__firstButtonBackgroundColor.purgeDependencyOnElmtId(i29); 38023b3eb3cSopenharmony_ci this.__secondButtonBackgroundColor.purgeDependencyOnElmtId(i29); 38123b3eb3cSopenharmony_ci this.__closeButtonFillColorWithTheme.purgeDependencyOnElmtId(i29); 38223b3eb3cSopenharmony_ci } 38323b3eb3cSopenharmony_ci 38423b3eb3cSopenharmony_ci aboutToBeDeleted() { 38523b3eb3cSopenharmony_ci this.__icon.aboutToBeDeleted(); 38623b3eb3cSopenharmony_ci this.__title.aboutToBeDeleted(); 38723b3eb3cSopenharmony_ci this.__message.aboutToBeDeleted(); 38823b3eb3cSopenharmony_ci this.__popupDirection.aboutToBeDeleted(); 38923b3eb3cSopenharmony_ci this.__showClose.aboutToBeDeleted(); 39023b3eb3cSopenharmony_ci this.__buttons.aboutToBeDeleted(); 39123b3eb3cSopenharmony_ci this.__titleHeight.aboutToBeDeleted(); 39223b3eb3cSopenharmony_ci this.__applyHeight.aboutToBeDeleted(); 39323b3eb3cSopenharmony_ci this.__buttonHeight.aboutToBeDeleted(); 39423b3eb3cSopenharmony_ci this.__messageMaxWeight.aboutToBeDeleted(); 39523b3eb3cSopenharmony_ci this.__beforeScreenStatus.aboutToBeDeleted(); 39623b3eb3cSopenharmony_ci this.__currentScreenStatus.aboutToBeDeleted(); 39723b3eb3cSopenharmony_ci this.__applySizeOptions.aboutToBeDeleted(); 39823b3eb3cSopenharmony_ci this.__closeButtonBackgroundColor.aboutToBeDeleted(); 39923b3eb3cSopenharmony_ci this.__firstButtonBackgroundColor.aboutToBeDeleted(); 40023b3eb3cSopenharmony_ci this.__secondButtonBackgroundColor.aboutToBeDeleted(); 40123b3eb3cSopenharmony_ci this.__closeButtonFillColorWithTheme.aboutToBeDeleted(); 40223b3eb3cSopenharmony_ci SubscriberManager.Get().delete(this.id__()); 40323b3eb3cSopenharmony_ci this.aboutToBeDeletedInternal(); 40423b3eb3cSopenharmony_ci } 40523b3eb3cSopenharmony_ci 40623b3eb3cSopenharmony_ci get icon() { 40723b3eb3cSopenharmony_ci return this.__icon.get(); 40823b3eb3cSopenharmony_ci } 40923b3eb3cSopenharmony_ci 41023b3eb3cSopenharmony_ci set icon(h29) { 41123b3eb3cSopenharmony_ci this.__icon.set(h29); 41223b3eb3cSopenharmony_ci } 41323b3eb3cSopenharmony_ci 41423b3eb3cSopenharmony_ci get title() { 41523b3eb3cSopenharmony_ci return this.__title.get(); 41623b3eb3cSopenharmony_ci } 41723b3eb3cSopenharmony_ci 41823b3eb3cSopenharmony_ci set title(g29) { 41923b3eb3cSopenharmony_ci this.__title.set(g29); 42023b3eb3cSopenharmony_ci } 42123b3eb3cSopenharmony_ci 42223b3eb3cSopenharmony_ci get message() { 42323b3eb3cSopenharmony_ci return this.__message.get(); 42423b3eb3cSopenharmony_ci } 42523b3eb3cSopenharmony_ci 42623b3eb3cSopenharmony_ci set message(f29) { 42723b3eb3cSopenharmony_ci this.__message.set(f29); 42823b3eb3cSopenharmony_ci } 42923b3eb3cSopenharmony_ci 43023b3eb3cSopenharmony_ci get popupDirection() { 43123b3eb3cSopenharmony_ci return this.__popupDirection.get(); 43223b3eb3cSopenharmony_ci } 43323b3eb3cSopenharmony_ci 43423b3eb3cSopenharmony_ci set popupDirection(e29) { 43523b3eb3cSopenharmony_ci this.__popupDirection.set(e29); 43623b3eb3cSopenharmony_ci } 43723b3eb3cSopenharmony_ci 43823b3eb3cSopenharmony_ci get showClose() { 43923b3eb3cSopenharmony_ci return this.__showClose.get(); 44023b3eb3cSopenharmony_ci } 44123b3eb3cSopenharmony_ci 44223b3eb3cSopenharmony_ci set showClose(d29) { 44323b3eb3cSopenharmony_ci this.__showClose.set(d29); 44423b3eb3cSopenharmony_ci } 44523b3eb3cSopenharmony_ci 44623b3eb3cSopenharmony_ci get buttons() { 44723b3eb3cSopenharmony_ci return this.__buttons.get(); 44823b3eb3cSopenharmony_ci } 44923b3eb3cSopenharmony_ci 45023b3eb3cSopenharmony_ci set buttons(c29) { 45123b3eb3cSopenharmony_ci this.__buttons.set(c29); 45223b3eb3cSopenharmony_ci } 45323b3eb3cSopenharmony_ci 45423b3eb3cSopenharmony_ci get titleHeight() { 45523b3eb3cSopenharmony_ci return this.__titleHeight.get(); 45623b3eb3cSopenharmony_ci } 45723b3eb3cSopenharmony_ci 45823b3eb3cSopenharmony_ci set titleHeight(b29) { 45923b3eb3cSopenharmony_ci this.__titleHeight.set(b29); 46023b3eb3cSopenharmony_ci } 46123b3eb3cSopenharmony_ci 46223b3eb3cSopenharmony_ci get applyHeight() { 46323b3eb3cSopenharmony_ci return this.__applyHeight.get(); 46423b3eb3cSopenharmony_ci } 46523b3eb3cSopenharmony_ci 46623b3eb3cSopenharmony_ci set applyHeight(a29) { 46723b3eb3cSopenharmony_ci this.__applyHeight.set(a29); 46823b3eb3cSopenharmony_ci } 46923b3eb3cSopenharmony_ci 47023b3eb3cSopenharmony_ci get buttonHeight() { 47123b3eb3cSopenharmony_ci return this.__buttonHeight.get(); 47223b3eb3cSopenharmony_ci } 47323b3eb3cSopenharmony_ci 47423b3eb3cSopenharmony_ci set buttonHeight(z28) { 47523b3eb3cSopenharmony_ci this.__buttonHeight.set(z28); 47623b3eb3cSopenharmony_ci } 47723b3eb3cSopenharmony_ci 47823b3eb3cSopenharmony_ci get messageMaxWeight() { 47923b3eb3cSopenharmony_ci return this.__messageMaxWeight.get(); 48023b3eb3cSopenharmony_ci } 48123b3eb3cSopenharmony_ci 48223b3eb3cSopenharmony_ci set messageMaxWeight(y28) { 48323b3eb3cSopenharmony_ci this.__messageMaxWeight.set(y28); 48423b3eb3cSopenharmony_ci } 48523b3eb3cSopenharmony_ci 48623b3eb3cSopenharmony_ci get beforeScreenStatus() { 48723b3eb3cSopenharmony_ci return this.__beforeScreenStatus.get(); 48823b3eb3cSopenharmony_ci } 48923b3eb3cSopenharmony_ci 49023b3eb3cSopenharmony_ci set beforeScreenStatus(x28) { 49123b3eb3cSopenharmony_ci this.__beforeScreenStatus.set(x28); 49223b3eb3cSopenharmony_ci } 49323b3eb3cSopenharmony_ci 49423b3eb3cSopenharmony_ci get currentScreenStatus() { 49523b3eb3cSopenharmony_ci return this.__currentScreenStatus.get(); 49623b3eb3cSopenharmony_ci } 49723b3eb3cSopenharmony_ci 49823b3eb3cSopenharmony_ci set currentScreenStatus(w28) { 49923b3eb3cSopenharmony_ci this.__currentScreenStatus.set(w28); 50023b3eb3cSopenharmony_ci } 50123b3eb3cSopenharmony_ci 50223b3eb3cSopenharmony_ci get applySizeOptions() { 50323b3eb3cSopenharmony_ci return this.__applySizeOptions.get(); 50423b3eb3cSopenharmony_ci } 50523b3eb3cSopenharmony_ci 50623b3eb3cSopenharmony_ci set applySizeOptions(v28) { 50723b3eb3cSopenharmony_ci this.__applySizeOptions.set(v28); 50823b3eb3cSopenharmony_ci } 50923b3eb3cSopenharmony_ci 51023b3eb3cSopenharmony_ci get closeButtonBackgroundColor() { 51123b3eb3cSopenharmony_ci return this.__closeButtonBackgroundColor.get(); 51223b3eb3cSopenharmony_ci } 51323b3eb3cSopenharmony_ci 51423b3eb3cSopenharmony_ci set closeButtonBackgroundColor(u28) { 51523b3eb3cSopenharmony_ci this.__closeButtonBackgroundColor.set(u28); 51623b3eb3cSopenharmony_ci } 51723b3eb3cSopenharmony_ci 51823b3eb3cSopenharmony_ci get firstButtonBackgroundColor() { 51923b3eb3cSopenharmony_ci return this.__firstButtonBackgroundColor.get(); 52023b3eb3cSopenharmony_ci } 52123b3eb3cSopenharmony_ci 52223b3eb3cSopenharmony_ci set firstButtonBackgroundColor(t28) { 52323b3eb3cSopenharmony_ci this.__firstButtonBackgroundColor.set(t28); 52423b3eb3cSopenharmony_ci } 52523b3eb3cSopenharmony_ci 52623b3eb3cSopenharmony_ci get secondButtonBackgroundColor() { 52723b3eb3cSopenharmony_ci return this.__secondButtonBackgroundColor.get(); 52823b3eb3cSopenharmony_ci } 52923b3eb3cSopenharmony_ci 53023b3eb3cSopenharmony_ci set secondButtonBackgroundColor(s28) { 53123b3eb3cSopenharmony_ci this.__secondButtonBackgroundColor.set(s28); 53223b3eb3cSopenharmony_ci } 53323b3eb3cSopenharmony_ci 53423b3eb3cSopenharmony_ci get closeButtonFillColorWithTheme() { 53523b3eb3cSopenharmony_ci return this.__closeButtonFillColorWithTheme.get(); 53623b3eb3cSopenharmony_ci } 53723b3eb3cSopenharmony_ci 53823b3eb3cSopenharmony_ci set closeButtonFillColorWithTheme(r28) { 53923b3eb3cSopenharmony_ci this.__closeButtonFillColorWithTheme.set(r28); 54023b3eb3cSopenharmony_ci } 54123b3eb3cSopenharmony_ci 54223b3eb3cSopenharmony_ci getIconWidth() { 54323b3eb3cSopenharmony_ci return this.icon?.width ?? this.theme.icon.size.width; 54423b3eb3cSopenharmony_ci } 54523b3eb3cSopenharmony_ci 54623b3eb3cSopenharmony_ci getIconHeight() { 54723b3eb3cSopenharmony_ci return this.icon?.height ?? this.theme.icon.size.height; 54823b3eb3cSopenharmony_ci } 54923b3eb3cSopenharmony_ci 55023b3eb3cSopenharmony_ci getIconFillColor() { 55123b3eb3cSopenharmony_ci return this.icon?.fillColor ?? this.theme.icon.fillColor; 55223b3eb3cSopenharmony_ci } 55323b3eb3cSopenharmony_ci 55423b3eb3cSopenharmony_ci getIconBorderRadius() { 55523b3eb3cSopenharmony_ci return this.icon?.borderRadius ?? this.theme.icon.borderRadius; 55623b3eb3cSopenharmony_ci } 55723b3eb3cSopenharmony_ci 55823b3eb3cSopenharmony_ci getIconMargin() { 55923b3eb3cSopenharmony_ci return { 56023b3eb3cSopenharmony_ci start: new LengthMetrics(this.theme.button.margin.start.value / 2, this.theme.button.margin.start.unit), 56123b3eb3cSopenharmony_ci end: new LengthMetrics(this.theme.icon.margin.start.value - (this.theme.button.margin.end.value / 2), this.theme.button.margin.start.unit) 56223b3eb3cSopenharmony_ci }; 56323b3eb3cSopenharmony_ci } 56423b3eb3cSopenharmony_ci 56523b3eb3cSopenharmony_ci getIconImage() { 56623b3eb3cSopenharmony_ci return this.icon?.image; 56723b3eb3cSopenharmony_ci } 56823b3eb3cSopenharmony_ci 56923b3eb3cSopenharmony_ci getTitleText() { 57023b3eb3cSopenharmony_ci return this.title?.text; 57123b3eb3cSopenharmony_ci } 57223b3eb3cSopenharmony_ci 57323b3eb3cSopenharmony_ci getTitlePadding() { 57423b3eb3cSopenharmony_ci return { 57523b3eb3cSopenharmony_ci start: new LengthMetrics(this.theme.button.margin.start.value / 2, this.theme.button.margin.start.unit), 57623b3eb3cSopenharmony_ci end: this.theme.closeButton.margin.end 57723b3eb3cSopenharmony_ci }; 57823b3eb3cSopenharmony_ci } 57923b3eb3cSopenharmony_ci 58023b3eb3cSopenharmony_ci getTitleMargin() { 58123b3eb3cSopenharmony_ci return this.theme.title.margin; 58223b3eb3cSopenharmony_ci } 58323b3eb3cSopenharmony_ci 58423b3eb3cSopenharmony_ci getTitleMinFontSize() { 58523b3eb3cSopenharmony_ci return this.theme.title.minFontSize; 58623b3eb3cSopenharmony_ci } 58723b3eb3cSopenharmony_ci 58823b3eb3cSopenharmony_ci getTitleFontWeight() { 58923b3eb3cSopenharmony_ci return this.title?.fontWeight ?? this.theme.title.fontWeight; 59023b3eb3cSopenharmony_ci } 59123b3eb3cSopenharmony_ci 59223b3eb3cSopenharmony_ci getTitleFontSize() { 59323b3eb3cSopenharmony_ci return this.title?.fontSize ?? this.theme.title.fontSize; 59423b3eb3cSopenharmony_ci } 59523b3eb3cSopenharmony_ci 59623b3eb3cSopenharmony_ci getTitleFontColor() { 59723b3eb3cSopenharmony_ci return this.title?.fontColor ?? this.theme.title.fontColor; 59823b3eb3cSopenharmony_ci } 59923b3eb3cSopenharmony_ci 60023b3eb3cSopenharmony_ci getCloseButtonWidth() { 60123b3eb3cSopenharmony_ci return this.theme.closeButton.size.width; 60223b3eb3cSopenharmony_ci } 60323b3eb3cSopenharmony_ci 60423b3eb3cSopenharmony_ci getCloseButtonHeight() { 60523b3eb3cSopenharmony_ci return this.theme.closeButton.size.height; 60623b3eb3cSopenharmony_ci } 60723b3eb3cSopenharmony_ci 60823b3eb3cSopenharmony_ci getCloseButtonImage() { 60923b3eb3cSopenharmony_ci return this.theme.closeButton.image; 61023b3eb3cSopenharmony_ci } 61123b3eb3cSopenharmony_ci 61223b3eb3cSopenharmony_ci getCloseButtonFillColor() { 61323b3eb3cSopenharmony_ci return this.closeButtonFillColorWithTheme; 61423b3eb3cSopenharmony_ci } 61523b3eb3cSopenharmony_ci 61623b3eb3cSopenharmony_ci getCloseButtonHoverColor() { 61723b3eb3cSopenharmony_ci return this.theme.closeButton.hoverColor; 61823b3eb3cSopenharmony_ci } 61923b3eb3cSopenharmony_ci 62023b3eb3cSopenharmony_ci getCloseButtonBackgroundColor() { 62123b3eb3cSopenharmony_ci return this.theme.closeButton.backgroundColor; 62223b3eb3cSopenharmony_ci } 62323b3eb3cSopenharmony_ci 62423b3eb3cSopenharmony_ci getCloseButtonPadding() { 62523b3eb3cSopenharmony_ci return this.theme.closeButton.padding; 62623b3eb3cSopenharmony_ci } 62723b3eb3cSopenharmony_ci 62823b3eb3cSopenharmony_ci getCloseButtonImageWidth() { 62923b3eb3cSopenharmony_ci return this.theme.closeButton.imageSize.width; 63023b3eb3cSopenharmony_ci } 63123b3eb3cSopenharmony_ci 63223b3eb3cSopenharmony_ci getCloseButtonImageHeight() { 63323b3eb3cSopenharmony_ci return this.theme.closeButton.imageSize.height; 63423b3eb3cSopenharmony_ci } 63523b3eb3cSopenharmony_ci 63623b3eb3cSopenharmony_ci getMessageText() { 63723b3eb3cSopenharmony_ci return this.message.text; 63823b3eb3cSopenharmony_ci } 63923b3eb3cSopenharmony_ci 64023b3eb3cSopenharmony_ci getMessageFontSize() { 64123b3eb3cSopenharmony_ci return this.message.fontSize ?? this.theme.message.fontSize; 64223b3eb3cSopenharmony_ci } 64323b3eb3cSopenharmony_ci 64423b3eb3cSopenharmony_ci getMessageFontColor() { 64523b3eb3cSopenharmony_ci let q28; 64623b3eb3cSopenharmony_ci if (this.message.fontColor) { 64723b3eb3cSopenharmony_ci q28 = this.message.fontColor; 64823b3eb3cSopenharmony_ci } 64923b3eb3cSopenharmony_ci else { 65023b3eb3cSopenharmony_ci if (this.title.text !== '' && this.title.text !== void (0)) { 65123b3eb3cSopenharmony_ci q28 = this.theme.message.fontColor; 65223b3eb3cSopenharmony_ci } 65323b3eb3cSopenharmony_ci else { 65423b3eb3cSopenharmony_ci q28 = this.theme.message.plainFontColor; 65523b3eb3cSopenharmony_ci } 65623b3eb3cSopenharmony_ci } 65723b3eb3cSopenharmony_ci return q28; 65823b3eb3cSopenharmony_ci } 65923b3eb3cSopenharmony_ci 66023b3eb3cSopenharmony_ci getMessagePadding() { 66123b3eb3cSopenharmony_ci let p28; 66223b3eb3cSopenharmony_ci if (this.title.text !== '' && this.title.text !== void (0)) { 66323b3eb3cSopenharmony_ci p28 = { start: LengthMetrics.vp(this.theme.button.margin.start.value / 2) }; 66423b3eb3cSopenharmony_ci } 66523b3eb3cSopenharmony_ci else { 66623b3eb3cSopenharmony_ci p28 = { 66723b3eb3cSopenharmony_ci start: LengthMetrics.vp(this.theme.button.margin.start.value / 2), 66823b3eb3cSopenharmony_ci end: LengthMetrics.vp(this.theme.closeButton.margin.end.value) 66923b3eb3cSopenharmony_ci }; 67023b3eb3cSopenharmony_ci } 67123b3eb3cSopenharmony_ci return p28; 67223b3eb3cSopenharmony_ci } 67323b3eb3cSopenharmony_ci 67423b3eb3cSopenharmony_ci getMessageMaxWeight() { 67523b3eb3cSopenharmony_ci let n28 = undefined; 67623b3eb3cSopenharmony_ci let o28 = display.getDefaultDisplaySync(); 67723b3eb3cSopenharmony_ci if (this.showClose || this.showClose === void (0)) { 67823b3eb3cSopenharmony_ci if (px2vp(o28.width) > 400) { 67923b3eb3cSopenharmony_ci n28 = 400; 68023b3eb3cSopenharmony_ci } 68123b3eb3cSopenharmony_ci else { 68223b3eb3cSopenharmony_ci n28 = px2vp(o28.width); 68323b3eb3cSopenharmony_ci } 68423b3eb3cSopenharmony_ci n28 -= (this.theme.windows.padding.start.value - (this.theme.button.margin.end.value / 2)); 68523b3eb3cSopenharmony_ci n28 -= this.theme.windows.padding.end.value; 68623b3eb3cSopenharmony_ci n28 -= this.theme.button.margin.start.value / 2; 68723b3eb3cSopenharmony_ci n28 -= this.getCloseButtonWidth(); 68823b3eb3cSopenharmony_ci } 68923b3eb3cSopenharmony_ci return n28; 69023b3eb3cSopenharmony_ci } 69123b3eb3cSopenharmony_ci 69223b3eb3cSopenharmony_ci getMessageFontWeight() { 69323b3eb3cSopenharmony_ci return this.theme.message.fontWeight; 69423b3eb3cSopenharmony_ci } 69523b3eb3cSopenharmony_ci 69623b3eb3cSopenharmony_ci getButtonMargin() { 69723b3eb3cSopenharmony_ci return { 69823b3eb3cSopenharmony_ci top: LengthMetrics.vp(this.theme.button.textMargin.top.value / 2 - 4), 69923b3eb3cSopenharmony_ci bottom: LengthMetrics.vp(this.theme.button.textMargin.bottom.value / 2 - 4), 70023b3eb3cSopenharmony_ci start: LengthMetrics.vp(this.theme.button.margin.start.value / 2 - 4), 70123b3eb3cSopenharmony_ci end: LengthMetrics.vp(this.theme.button.margin.end.value / 2 - 4) 70223b3eb3cSopenharmony_ci }; 70323b3eb3cSopenharmony_ci } 70423b3eb3cSopenharmony_ci 70523b3eb3cSopenharmony_ci getButtonTextMargin() { 70623b3eb3cSopenharmony_ci return { top: LengthMetrics.vp(this.theme.button.textMargin.bottom.value ) }; 70723b3eb3cSopenharmony_ci } 70823b3eb3cSopenharmony_ci 70923b3eb3cSopenharmony_ci getButtonTextPadding() { 71023b3eb3cSopenharmony_ci return this.theme.button.padding; 71123b3eb3cSopenharmony_ci } 71223b3eb3cSopenharmony_ci 71323b3eb3cSopenharmony_ci getButtonHoverColor() { 71423b3eb3cSopenharmony_ci return this.theme.button.hoverColor; 71523b3eb3cSopenharmony_ci } 71623b3eb3cSopenharmony_ci 71723b3eb3cSopenharmony_ci getButtonBackgroundColor() { 71823b3eb3cSopenharmony_ci return this.theme.button.backgroundColor; 71923b3eb3cSopenharmony_ci } 72023b3eb3cSopenharmony_ci 72123b3eb3cSopenharmony_ci getFirstButtonText() { 72223b3eb3cSopenharmony_ci return this.buttons?.[0]?.text; 72323b3eb3cSopenharmony_ci } 72423b3eb3cSopenharmony_ci 72523b3eb3cSopenharmony_ci getSecondButtonText() { 72623b3eb3cSopenharmony_ci return this.buttons?.[1]?.text; 72723b3eb3cSopenharmony_ci } 72823b3eb3cSopenharmony_ci 72923b3eb3cSopenharmony_ci getFirstButtonFontSize() { 73023b3eb3cSopenharmony_ci return this.buttons?.[0]?.fontSize ?? this.theme.button.fontSize; 73123b3eb3cSopenharmony_ci } 73223b3eb3cSopenharmony_ci 73323b3eb3cSopenharmony_ci getSecondButtonFontSize() { 73423b3eb3cSopenharmony_ci return this.buttons?.[1]?.fontSize ?? this.theme.button.fontSize; 73523b3eb3cSopenharmony_ci } 73623b3eb3cSopenharmony_ci 73723b3eb3cSopenharmony_ci getFirstButtonFontColor() { 73823b3eb3cSopenharmony_ci return this.buttons?.[0]?.fontColor ?? this.theme.button.fontColor; 73923b3eb3cSopenharmony_ci } 74023b3eb3cSopenharmony_ci 74123b3eb3cSopenharmony_ci getSecondButtonFontColor() { 74223b3eb3cSopenharmony_ci return this.buttons?.[1]?.fontColor ?? this.theme.button.fontColor; 74323b3eb3cSopenharmony_ci } 74423b3eb3cSopenharmony_ci 74523b3eb3cSopenharmony_ci getButtonMinFontSize() { 74623b3eb3cSopenharmony_ci return this.theme.button.minFontSize; 74723b3eb3cSopenharmony_ci } 74823b3eb3cSopenharmony_ci 74923b3eb3cSopenharmony_ci getButtonFontWeight() { 75023b3eb3cSopenharmony_ci return this.theme.button.fontWeight; 75123b3eb3cSopenharmony_ci } 75223b3eb3cSopenharmony_ci 75323b3eb3cSopenharmony_ci getWindowsPadding() { 75423b3eb3cSopenharmony_ci return { 75523b3eb3cSopenharmony_ci top: this.theme.windows.padding.top, 75623b3eb3cSopenharmony_ci bottom: LengthMetrics.vp(this.theme.windows.padding.bottom.value - 75723b3eb3cSopenharmony_ci (this.theme.button.textMargin.bottom.value / 2)), 75823b3eb3cSopenharmony_ci start: LengthMetrics.vp(this.theme.windows.padding.start.value - 75923b3eb3cSopenharmony_ci (this.theme.button.margin.end.value / 2)), 76023b3eb3cSopenharmony_ci end: this.theme.windows.padding.end 76123b3eb3cSopenharmony_ci }; 76223b3eb3cSopenharmony_ci } 76323b3eb3cSopenharmony_ci 76423b3eb3cSopenharmony_ci onWillApplyTheme(m28) { 76523b3eb3cSopenharmony_ci this.theme.title.fontColor = m28.colors.fontPrimary; 76623b3eb3cSopenharmony_ci this.theme.button.fontColor = m28.colors.fontEmphasize; 76723b3eb3cSopenharmony_ci this.theme.message.fontColor = m28.colors.fontSecondary; 76823b3eb3cSopenharmony_ci this.theme.message.plainFontColor = m28.colors.fontPrimary; 76923b3eb3cSopenharmony_ci this.closeButtonFillColorWithTheme = m28.colors.iconSecondary; 77023b3eb3cSopenharmony_ci } 77123b3eb3cSopenharmony_ci 77223b3eb3cSopenharmony_ci aboutToAppear() { 77323b3eb3cSopenharmony_ci this.listener.on("change", (l28) => { 77423b3eb3cSopenharmony_ci this.currentScreenStatus = l28.matches; 77523b3eb3cSopenharmony_ci }); 77623b3eb3cSopenharmony_ci } 77723b3eb3cSopenharmony_ci 77823b3eb3cSopenharmony_ci aboutToDisappear() { 77923b3eb3cSopenharmony_ci this.listener.off("change"); 78023b3eb3cSopenharmony_ci } 78123b3eb3cSopenharmony_ci 78223b3eb3cSopenharmony_ci getScrollMaxHeight() { 78323b3eb3cSopenharmony_ci let j28 = undefined; 78423b3eb3cSopenharmony_ci if (this.currentScreenStatus !== this.beforeScreenStatus) { 78523b3eb3cSopenharmony_ci this.applySizeOptions = this.getApplyMaxSize(); 78623b3eb3cSopenharmony_ci this.beforeScreenStatus = this.currentScreenStatus; 78723b3eb3cSopenharmony_ci return j28; 78823b3eb3cSopenharmony_ci } 78923b3eb3cSopenharmony_ci j28 = this.applyHeight; 79023b3eb3cSopenharmony_ci j28 -= this.titleHeight; 79123b3eb3cSopenharmony_ci j28 -= this.buttonHeight; 79223b3eb3cSopenharmony_ci j28 -= this.theme.windows.padding.top.value; 79323b3eb3cSopenharmony_ci j28 -= (this.theme.button.textMargin.bottom.value / 2); 79423b3eb3cSopenharmony_ci j28 -= this.theme.title.margin.bottom.value; 79523b3eb3cSopenharmony_ci j28 -= (this.theme.windows.padding.bottom.value - 79623b3eb3cSopenharmony_ci (this.theme.button.textMargin.bottom.value / 2)); 79723b3eb3cSopenharmony_ci if (Math.floor(this.textHeight) > Math.floor(j28 + 1)) { 79823b3eb3cSopenharmony_ci return j28; 79923b3eb3cSopenharmony_ci } 80023b3eb3cSopenharmony_ci else { 80123b3eb3cSopenharmony_ci j28 = undefined; 80223b3eb3cSopenharmony_ci return j28; 80323b3eb3cSopenharmony_ci } 80423b3eb3cSopenharmony_ci } 80523b3eb3cSopenharmony_ci 80623b3eb3cSopenharmony_ci getLayoutWeight() { 80723b3eb3cSopenharmony_ci let i28; 80823b3eb3cSopenharmony_ci if ((this.icon.image !== '' && this.icon.image !== void (0)) || 80923b3eb3cSopenharmony_ci (this.title.text !== '' && this.title.text !== void (0)) || 81023b3eb3cSopenharmony_ci (this.buttons?.[0]?.text !== '' && this.buttons?.[0]?.text !== void (0)) || 81123b3eb3cSopenharmony_ci (this.buttons?.[1]?.text !== '' && this.buttons?.[1]?.text !== void (0))) { 81223b3eb3cSopenharmony_ci i28 = 1; 81323b3eb3cSopenharmony_ci } 81423b3eb3cSopenharmony_ci else { 81523b3eb3cSopenharmony_ci i28 = 0; 81623b3eb3cSopenharmony_ci } 81723b3eb3cSopenharmony_ci return i28; 81823b3eb3cSopenharmony_ci } 81923b3eb3cSopenharmony_ci 82023b3eb3cSopenharmony_ci getApplyMaxSize() { 82123b3eb3cSopenharmony_ci let e28 = undefined; 82223b3eb3cSopenharmony_ci let f28 = undefined; 82323b3eb3cSopenharmony_ci let g28 = undefined; 82423b3eb3cSopenharmony_ci let h28 = display.getDefaultDisplaySync(); 82523b3eb3cSopenharmony_ci if (px2vp(h28.width) > 400) { 82623b3eb3cSopenharmony_ci e28 = 400; 82723b3eb3cSopenharmony_ci } 82823b3eb3cSopenharmony_ci else { 82923b3eb3cSopenharmony_ci e28 = px2vp(h28.width); 83023b3eb3cSopenharmony_ci } 83123b3eb3cSopenharmony_ci if (px2vp(h28.height) > 480) { 83223b3eb3cSopenharmony_ci f28 = 480; 83323b3eb3cSopenharmony_ci } 83423b3eb3cSopenharmony_ci else { 83523b3eb3cSopenharmony_ci f28 = px2vp(h28.height) - 40 - 40; 83623b3eb3cSopenharmony_ci } 83723b3eb3cSopenharmony_ci g28 = { maxWidth: e28, maxHeight: f28 }; 83823b3eb3cSopenharmony_ci this.messageMaxWeight = this.getMessageMaxWeight(); 83923b3eb3cSopenharmony_ci return g28; 84023b3eb3cSopenharmony_ci } 84123b3eb3cSopenharmony_ci 84223b3eb3cSopenharmony_ci initialRender() { 84323b3eb3cSopenharmony_ci this.observeComponentCreation2((z27, a28) => { 84423b3eb3cSopenharmony_ci Row.create(); 84523b3eb3cSopenharmony_ci Row.direction(this.popupDirection); 84623b3eb3cSopenharmony_ci Row.alignItems(VerticalAlign.Top); 84723b3eb3cSopenharmony_ci Row.padding(this.getWindowsPadding()); 84823b3eb3cSopenharmony_ci Row.constraintSize(ObservedObject.GetRawObject(this.applySizeOptions)); 84923b3eb3cSopenharmony_ci Row.onAreaChange((c28, d28) => { 85023b3eb3cSopenharmony_ci this.applyHeight = d28.height; 85123b3eb3cSopenharmony_ci }); 85223b3eb3cSopenharmony_ci }, Row); 85323b3eb3cSopenharmony_ci this.observeComponentCreation2((s27, t27) => { 85423b3eb3cSopenharmony_ci If.create(); 85523b3eb3cSopenharmony_ci if (this.icon.image !== '' && this.icon.image !== void (0)) { 85623b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(0, () => { 85723b3eb3cSopenharmony_ci this.observeComponentCreation2((x27, y27) => { 85823b3eb3cSopenharmony_ci Image.create(this.getIconImage()); 85923b3eb3cSopenharmony_ci Image.direction(this.popupDirection); 86023b3eb3cSopenharmony_ci Image.width(this.getIconWidth()); 86123b3eb3cSopenharmony_ci Image.height(this.getIconHeight()); 86223b3eb3cSopenharmony_ci Image.margin(this.getIconMargin()); 86323b3eb3cSopenharmony_ci Image.fillColor(this.getIconFillColor()); 86423b3eb3cSopenharmony_ci Image.borderRadius(this.getIconBorderRadius()); 86523b3eb3cSopenharmony_ci }, Image); 86623b3eb3cSopenharmony_ci }); 86723b3eb3cSopenharmony_ci } 86823b3eb3cSopenharmony_ci else { 86923b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(1, () => { 87023b3eb3cSopenharmony_ci }); 87123b3eb3cSopenharmony_ci } 87223b3eb3cSopenharmony_ci }, If); 87323b3eb3cSopenharmony_ci If.pop(); 87423b3eb3cSopenharmony_ci this.observeComponentCreation2((m22, n22) => { 87523b3eb3cSopenharmony_ci If.create(); 87623b3eb3cSopenharmony_ci if (this.title.text !== '' && this.title.text !== void (0)) { 87723b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(0, () => { 87823b3eb3cSopenharmony_ci this.observeComponentCreation2((q27, r27) => { 87923b3eb3cSopenharmony_ci Column.create(); 88023b3eb3cSopenharmony_ci Column.direction(this.popupDirection); 88123b3eb3cSopenharmony_ci Column.layoutWeight(this.getLayoutWeight()); 88223b3eb3cSopenharmony_ci }, Column); 88323b3eb3cSopenharmony_ci this.observeComponentCreation2((l27, m27) => { 88423b3eb3cSopenharmony_ci Flex.create({ alignItems: ItemAlign.Start }); 88523b3eb3cSopenharmony_ci Flex.direction(this.popupDirection); 88623b3eb3cSopenharmony_ci Flex.width("100%"); 88723b3eb3cSopenharmony_ci Flex.margin(this.getTitleMargin()); 88823b3eb3cSopenharmony_ci Flex.onAreaChange((o27, p27) => { 88923b3eb3cSopenharmony_ci this.titleHeight = p27.height; 89023b3eb3cSopenharmony_ci }); 89123b3eb3cSopenharmony_ci }, Flex); 89223b3eb3cSopenharmony_ci this.observeComponentCreation2((j27, k27) => { 89323b3eb3cSopenharmony_ci Text.create(this.getTitleText()); 89423b3eb3cSopenharmony_ci Text.direction(this.popupDirection); 89523b3eb3cSopenharmony_ci Text.flexGrow(1); 89623b3eb3cSopenharmony_ci Text.maxLines(2); 89723b3eb3cSopenharmony_ci Text.align(Alignment.Start); 89823b3eb3cSopenharmony_ci Text.padding(this.getTitlePadding()); 89923b3eb3cSopenharmony_ci Text.minFontSize(this.getTitleMinFontSize()); 90023b3eb3cSopenharmony_ci Text.textOverflow({ overflow: TextOverflow.Ellipsis }); 90123b3eb3cSopenharmony_ci Text.fontWeight(this.getTitleFontWeight()); 90223b3eb3cSopenharmony_ci Text.fontSize(this.getTitleFontSize()); 90323b3eb3cSopenharmony_ci Text.fontColor(this.getTitleFontColor()); 90423b3eb3cSopenharmony_ci Text.constraintSize({ minHeight: this.getCloseButtonHeight() }); 90523b3eb3cSopenharmony_ci }, Text); 90623b3eb3cSopenharmony_ci Text.pop(); 90723b3eb3cSopenharmony_ci this.observeComponentCreation2((w26, x26) => { 90823b3eb3cSopenharmony_ci If.create(); 90923b3eb3cSopenharmony_ci if (this.showClose || this.showClose === void (0)) { 91023b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(0, () => { 91123b3eb3cSopenharmony_ci this.observeComponentCreation2((e27, f27) => { 91223b3eb3cSopenharmony_ci Button.createWithChild(); 91323b3eb3cSopenharmony_ci Button.direction(this.popupDirection); 91423b3eb3cSopenharmony_ci Button.width(this.getCloseButtonWidth()); 91523b3eb3cSopenharmony_ci Button.height(this.getCloseButtonHeight()); 91623b3eb3cSopenharmony_ci Button.padding(this.getCloseButtonPadding()); 91723b3eb3cSopenharmony_ci Button.backgroundColor(ObservedObject.GetRawObject(this.closeButtonBackgroundColor)); 91823b3eb3cSopenharmony_ci Button.flexShrink(0); 91923b3eb3cSopenharmony_ci Button.onHover((i27) => { 92023b3eb3cSopenharmony_ci if (i27) { 92123b3eb3cSopenharmony_ci this.closeButtonBackgroundColor = this.getCloseButtonHoverColor(); 92223b3eb3cSopenharmony_ci } 92323b3eb3cSopenharmony_ci else { 92423b3eb3cSopenharmony_ci this.closeButtonBackgroundColor = this.getCloseButtonBackgroundColor(); 92523b3eb3cSopenharmony_ci } 92623b3eb3cSopenharmony_ci }); 92723b3eb3cSopenharmony_ci Button.onClick(() => { 92823b3eb3cSopenharmony_ci if (this.onClose) { 92923b3eb3cSopenharmony_ci this.onClose(); 93023b3eb3cSopenharmony_ci } 93123b3eb3cSopenharmony_ci }); 93223b3eb3cSopenharmony_ci }, Button); 93323b3eb3cSopenharmony_ci this.observeComponentCreation2((c27, d27) => { 93423b3eb3cSopenharmony_ci Image.create(this.getCloseButtonImage()); 93523b3eb3cSopenharmony_ci Image.direction(this.popupDirection); 93623b3eb3cSopenharmony_ci Image.focusable(true); 93723b3eb3cSopenharmony_ci Image.width(this.getCloseButtonImageWidth()); 93823b3eb3cSopenharmony_ci Image.height(this.getCloseButtonImageHeight()); 93923b3eb3cSopenharmony_ci Image.fillColor(this.getCloseButtonFillColor()); 94023b3eb3cSopenharmony_ci }, Image); 94123b3eb3cSopenharmony_ci Button.pop(); 94223b3eb3cSopenharmony_ci }); 94323b3eb3cSopenharmony_ci } 94423b3eb3cSopenharmony_ci else { 94523b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(1, () => { 94623b3eb3cSopenharmony_ci }); 94723b3eb3cSopenharmony_ci } 94823b3eb3cSopenharmony_ci }, If); 94923b3eb3cSopenharmony_ci If.pop(); 95023b3eb3cSopenharmony_ci Flex.pop(); 95123b3eb3cSopenharmony_ci this.observeComponentCreation2((u26, v26) => { 95223b3eb3cSopenharmony_ci Scroll.create(); 95323b3eb3cSopenharmony_ci Scroll.direction(this.popupDirection); 95423b3eb3cSopenharmony_ci Scroll.width("100%"); 95523b3eb3cSopenharmony_ci Scroll.align(Alignment.TopStart); 95623b3eb3cSopenharmony_ci Scroll.padding(this.getMessagePadding()); 95723b3eb3cSopenharmony_ci Scroll.scrollBar(BarState.Auto); 95823b3eb3cSopenharmony_ci Scroll.scrollable(ScrollDirection.Vertical); 95923b3eb3cSopenharmony_ci Scroll.constraintSize({ maxHeight: this.getScrollMaxHeight() }); 96023b3eb3cSopenharmony_ci }, Scroll); 96123b3eb3cSopenharmony_ci this.observeComponentCreation2((p26, q26) => { 96223b3eb3cSopenharmony_ci Text.create(this.getMessageText()); 96323b3eb3cSopenharmony_ci Text.direction(this.popupDirection); 96423b3eb3cSopenharmony_ci Text.fontSize(this.getMessageFontSize()); 96523b3eb3cSopenharmony_ci Text.fontColor(this.getMessageFontColor()); 96623b3eb3cSopenharmony_ci Text.fontWeight(this.getMessageFontWeight()); 96723b3eb3cSopenharmony_ci Text.constraintSize({ minHeight: this.getCloseButtonHeight() }); 96823b3eb3cSopenharmony_ci Text.onAreaChange((s26, t26) => { 96923b3eb3cSopenharmony_ci this.textHeight = t26.height; 97023b3eb3cSopenharmony_ci }); 97123b3eb3cSopenharmony_ci }, Text); 97223b3eb3cSopenharmony_ci Text.pop(); 97323b3eb3cSopenharmony_ci Scroll.pop(); 97423b3eb3cSopenharmony_ci this.observeComponentCreation2((k26, l26) => { 97523b3eb3cSopenharmony_ci Flex.create({ wrap: FlexWrap.Wrap }); 97623b3eb3cSopenharmony_ci Flex.direction(this.popupDirection); 97723b3eb3cSopenharmony_ci Flex.margin(this.getButtonTextMargin()); 97823b3eb3cSopenharmony_ci Flex.flexGrow(1); 97923b3eb3cSopenharmony_ci Flex.onAreaChange((n26, o26) => { 98023b3eb3cSopenharmony_ci this.buttonHeight = o26.height; 98123b3eb3cSopenharmony_ci }); 98223b3eb3cSopenharmony_ci }, Flex); 98323b3eb3cSopenharmony_ci this.observeComponentCreation2((x25, y25) => { 98423b3eb3cSopenharmony_ci If.create(); 98523b3eb3cSopenharmony_ci if (this.buttons?.[0]?.text !== '' && this.buttons?.[0]?.text !== void (0)) { 98623b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(0, () => { 98723b3eb3cSopenharmony_ci this.observeComponentCreation2((f26, g26) => { 98823b3eb3cSopenharmony_ci Button.createWithChild(); 98923b3eb3cSopenharmony_ci Button.direction(this.popupDirection); 99023b3eb3cSopenharmony_ci Button.margin(this.getButtonMargin()); 99123b3eb3cSopenharmony_ci Button.padding(this.getButtonTextPadding()); 99223b3eb3cSopenharmony_ci Button.backgroundColor(ObservedObject.GetRawObject(this.firstButtonBackgroundColor)); 99323b3eb3cSopenharmony_ci Button.onHover((j26) => { 99423b3eb3cSopenharmony_ci if (j26) { 99523b3eb3cSopenharmony_ci this.firstButtonBackgroundColor = this.getButtonHoverColor(); 99623b3eb3cSopenharmony_ci } 99723b3eb3cSopenharmony_ci else { 99823b3eb3cSopenharmony_ci this.firstButtonBackgroundColor = this.getButtonBackgroundColor(); 99923b3eb3cSopenharmony_ci } 100023b3eb3cSopenharmony_ci }); 100123b3eb3cSopenharmony_ci Button.onClick(() => { 100223b3eb3cSopenharmony_ci if (this.buttons?.[0]?.action) { 100323b3eb3cSopenharmony_ci this.buttons?.[0]?.action(); 100423b3eb3cSopenharmony_ci } 100523b3eb3cSopenharmony_ci }); 100623b3eb3cSopenharmony_ci }, Button); 100723b3eb3cSopenharmony_ci this.observeComponentCreation2((d26, e26) => { 100823b3eb3cSopenharmony_ci Text.create(this.getFirstButtonText()); 100923b3eb3cSopenharmony_ci Text.direction(this.popupDirection); 101023b3eb3cSopenharmony_ci Text.maxLines(2); 101123b3eb3cSopenharmony_ci Text.focusable(true); 101223b3eb3cSopenharmony_ci Text.fontSize(this.getFirstButtonFontSize()); 101323b3eb3cSopenharmony_ci Text.fontColor(this.getFirstButtonFontColor()); 101423b3eb3cSopenharmony_ci Text.fontWeight(this.getButtonFontWeight()); 101523b3eb3cSopenharmony_ci Text.minFontSize(this.getButtonMinFontSize()); 101623b3eb3cSopenharmony_ci Text.textOverflow({ overflow: TextOverflow.Ellipsis }); 101723b3eb3cSopenharmony_ci }, Text); 101823b3eb3cSopenharmony_ci Text.pop(); 101923b3eb3cSopenharmony_ci Button.pop(); 102023b3eb3cSopenharmony_ci }); 102123b3eb3cSopenharmony_ci } 102223b3eb3cSopenharmony_ci else { 102323b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(1, () => { 102423b3eb3cSopenharmony_ci }); 102523b3eb3cSopenharmony_ci } 102623b3eb3cSopenharmony_ci }, If); 102723b3eb3cSopenharmony_ci If.pop(); 102823b3eb3cSopenharmony_ci this.observeComponentCreation2((k25, l25) => { 102923b3eb3cSopenharmony_ci If.create(); 103023b3eb3cSopenharmony_ci if (this.buttons?.[1]?.text !== '' && this.buttons?.[1]?.text !== void (0)) { 103123b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(0, () => { 103223b3eb3cSopenharmony_ci this.observeComponentCreation2((s25, t25) => { 103323b3eb3cSopenharmony_ci Button.createWithChild(); 103423b3eb3cSopenharmony_ci Button.direction(this.popupDirection); 103523b3eb3cSopenharmony_ci Button.margin(this.getButtonMargin()); 103623b3eb3cSopenharmony_ci Button.padding(this.getButtonTextPadding()); 103723b3eb3cSopenharmony_ci Button.backgroundColor(ObservedObject.GetRawObject(this.secondButtonBackgroundColor)); 103823b3eb3cSopenharmony_ci Button.onHover((w25) => { 103923b3eb3cSopenharmony_ci if (w25) { 104023b3eb3cSopenharmony_ci this.secondButtonBackgroundColor = this.getButtonHoverColor(); 104123b3eb3cSopenharmony_ci } 104223b3eb3cSopenharmony_ci else { 104323b3eb3cSopenharmony_ci this.secondButtonBackgroundColor = this.getButtonBackgroundColor(); 104423b3eb3cSopenharmony_ci } 104523b3eb3cSopenharmony_ci }); 104623b3eb3cSopenharmony_ci Button.onClick(() => { 104723b3eb3cSopenharmony_ci if (this.buttons?.[1]?.action) { 104823b3eb3cSopenharmony_ci this.buttons?.[1]?.action(); 104923b3eb3cSopenharmony_ci } 105023b3eb3cSopenharmony_ci }); 105123b3eb3cSopenharmony_ci }, Button); 105223b3eb3cSopenharmony_ci this.observeComponentCreation2((q25, r25) => { 105323b3eb3cSopenharmony_ci Text.create(this.getSecondButtonText()); 105423b3eb3cSopenharmony_ci Text.direction(this.popupDirection); 105523b3eb3cSopenharmony_ci Text.maxLines(2); 105623b3eb3cSopenharmony_ci Text.focusable(true); 105723b3eb3cSopenharmony_ci Text.fontSize(this.getSecondButtonFontSize()); 105823b3eb3cSopenharmony_ci Text.fontColor(this.getSecondButtonFontColor()); 105923b3eb3cSopenharmony_ci Text.fontWeight(this.getButtonFontWeight()); 106023b3eb3cSopenharmony_ci Text.minFontSize(this.getButtonMinFontSize()); 106123b3eb3cSopenharmony_ci Text.textOverflow({ overflow: TextOverflow.Ellipsis }); 106223b3eb3cSopenharmony_ci }, Text); 106323b3eb3cSopenharmony_ci Text.pop(); 106423b3eb3cSopenharmony_ci Button.pop(); 106523b3eb3cSopenharmony_ci }); 106623b3eb3cSopenharmony_ci } 106723b3eb3cSopenharmony_ci else { 106823b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(1, () => { 106923b3eb3cSopenharmony_ci }); 107023b3eb3cSopenharmony_ci } 107123b3eb3cSopenharmony_ci }, If); 107223b3eb3cSopenharmony_ci If.pop(); 107323b3eb3cSopenharmony_ci Flex.pop(); 107423b3eb3cSopenharmony_ci Column.pop(); 107523b3eb3cSopenharmony_ci }); 107623b3eb3cSopenharmony_ci } 107723b3eb3cSopenharmony_ci else { 107823b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(1, () => { 107923b3eb3cSopenharmony_ci this.observeComponentCreation2((y24, z24) => { 108023b3eb3cSopenharmony_ci Column.create(); 108123b3eb3cSopenharmony_ci Column.direction(this.popupDirection); 108223b3eb3cSopenharmony_ci Column.layoutWeight(this.getLayoutWeight()); 108323b3eb3cSopenharmony_ci }, Column); 108423b3eb3cSopenharmony_ci this.observeComponentCreation2((w24, x24) => { 108523b3eb3cSopenharmony_ci Row.create(); 108623b3eb3cSopenharmony_ci Row.direction(this.popupDirection); 108723b3eb3cSopenharmony_ci Row.alignItems(VerticalAlign.Top); 108823b3eb3cSopenharmony_ci }, Row); 108923b3eb3cSopenharmony_ci this.observeComponentCreation2((u24, v24) => { 109023b3eb3cSopenharmony_ci Scroll.create(); 109123b3eb3cSopenharmony_ci Scroll.direction(this.popupDirection); 109223b3eb3cSopenharmony_ci Scroll.layoutWeight(this.getLayoutWeight()); 109323b3eb3cSopenharmony_ci Scroll.align(Alignment.TopStart); 109423b3eb3cSopenharmony_ci Scroll.padding(this.getMessagePadding()); 109523b3eb3cSopenharmony_ci Scroll.scrollBar(BarState.Auto); 109623b3eb3cSopenharmony_ci Scroll.scrollable(ScrollDirection.Vertical); 109723b3eb3cSopenharmony_ci Scroll.constraintSize({ maxHeight: this.getScrollMaxHeight() }); 109823b3eb3cSopenharmony_ci }, Scroll); 109923b3eb3cSopenharmony_ci this.observeComponentCreation2((p24, q24) => { 110023b3eb3cSopenharmony_ci Text.create(this.getMessageText()); 110123b3eb3cSopenharmony_ci Text.direction(this.popupDirection); 110223b3eb3cSopenharmony_ci Text.fontSize(this.getMessageFontSize()); 110323b3eb3cSopenharmony_ci Text.fontColor(this.getMessageFontColor()); 110423b3eb3cSopenharmony_ci Text.fontWeight(this.getMessageFontWeight()); 110523b3eb3cSopenharmony_ci Text.constraintSize({ 110623b3eb3cSopenharmony_ci maxWidth: this.messageMaxWeight, 110723b3eb3cSopenharmony_ci minHeight: this.getCloseButtonHeight() 110823b3eb3cSopenharmony_ci }); 110923b3eb3cSopenharmony_ci Text.onAreaChange((s24, t24) => { 111023b3eb3cSopenharmony_ci this.textHeight = t24.height; 111123b3eb3cSopenharmony_ci }); 111223b3eb3cSopenharmony_ci }, Text); 111323b3eb3cSopenharmony_ci Text.pop(); 111423b3eb3cSopenharmony_ci Scroll.pop(); 111523b3eb3cSopenharmony_ci this.observeComponentCreation2((c24, d24) => { 111623b3eb3cSopenharmony_ci If.create(); 111723b3eb3cSopenharmony_ci if (this.showClose || this.showClose === void (0)) { 111823b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(0, () => { 111923b3eb3cSopenharmony_ci this.observeComponentCreation2((k24, l24) => { 112023b3eb3cSopenharmony_ci Button.createWithChild(); 112123b3eb3cSopenharmony_ci Button.direction(this.popupDirection); 112223b3eb3cSopenharmony_ci Button.width(this.getCloseButtonWidth()); 112323b3eb3cSopenharmony_ci Button.height(this.getCloseButtonHeight()); 112423b3eb3cSopenharmony_ci Button.padding(this.getCloseButtonPadding()); 112523b3eb3cSopenharmony_ci Button.backgroundColor(ObservedObject.GetRawObject(this.closeButtonBackgroundColor)); 112623b3eb3cSopenharmony_ci Button.flexShrink(0); 112723b3eb3cSopenharmony_ci Button.onHover((o24) => { 112823b3eb3cSopenharmony_ci if (o24) { 112923b3eb3cSopenharmony_ci this.closeButtonBackgroundColor = this.getCloseButtonHoverColor(); 113023b3eb3cSopenharmony_ci } 113123b3eb3cSopenharmony_ci else { 113223b3eb3cSopenharmony_ci this.closeButtonBackgroundColor = this.getCloseButtonBackgroundColor(); 113323b3eb3cSopenharmony_ci } 113423b3eb3cSopenharmony_ci }); 113523b3eb3cSopenharmony_ci Button.onClick(() => { 113623b3eb3cSopenharmony_ci if (this.onClose) { 113723b3eb3cSopenharmony_ci this.onClose(); 113823b3eb3cSopenharmony_ci } 113923b3eb3cSopenharmony_ci }); 114023b3eb3cSopenharmony_ci }, Button); 114123b3eb3cSopenharmony_ci this.observeComponentCreation2((i24, j24) => { 114223b3eb3cSopenharmony_ci Image.create(this.getCloseButtonImage()); 114323b3eb3cSopenharmony_ci Image.direction(this.popupDirection); 114423b3eb3cSopenharmony_ci Image.focusable(true); 114523b3eb3cSopenharmony_ci Image.width(this.getCloseButtonImageWidth()); 114623b3eb3cSopenharmony_ci Image.height(this.getCloseButtonImageHeight()); 114723b3eb3cSopenharmony_ci Image.fillColor(this.getCloseButtonFillColor()); 114823b3eb3cSopenharmony_ci }, Image); 114923b3eb3cSopenharmony_ci Button.pop(); 115023b3eb3cSopenharmony_ci }); 115123b3eb3cSopenharmony_ci } 115223b3eb3cSopenharmony_ci else { 115323b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(1, () => { 115423b3eb3cSopenharmony_ci }); 115523b3eb3cSopenharmony_ci } 115623b3eb3cSopenharmony_ci }, If); 115723b3eb3cSopenharmony_ci If.pop(); 115823b3eb3cSopenharmony_ci Row.pop(); 115923b3eb3cSopenharmony_ci this.observeComponentCreation2((x23, y23) => { 116023b3eb3cSopenharmony_ci Flex.create({ wrap: FlexWrap.Wrap }); 116123b3eb3cSopenharmony_ci Flex.direction(this.popupDirection); 116223b3eb3cSopenharmony_ci Flex.margin(this.getButtonTextMargin()); 116323b3eb3cSopenharmony_ci Flex.flexGrow(1); 116423b3eb3cSopenharmony_ci Flex.onAreaChange((a24, b24) => { 116523b3eb3cSopenharmony_ci this.buttonHeight = b24.height; 116623b3eb3cSopenharmony_ci }); 116723b3eb3cSopenharmony_ci }, Flex); 116823b3eb3cSopenharmony_ci this.observeComponentCreation2((k23, l23) => { 116923b3eb3cSopenharmony_ci If.create(); 117023b3eb3cSopenharmony_ci if (this.buttons?.[0]?.text !== '' && this.buttons?.[0]?.text !== void (0)) { 117123b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(0, () => { 117223b3eb3cSopenharmony_ci this.observeComponentCreation2((s23, t23) => { 117323b3eb3cSopenharmony_ci Button.createWithChild(); 117423b3eb3cSopenharmony_ci Button.direction(this.popupDirection); 117523b3eb3cSopenharmony_ci Button.margin(this.getButtonMargin()); 117623b3eb3cSopenharmony_ci Button.padding(this.getButtonTextPadding()); 117723b3eb3cSopenharmony_ci Button.backgroundColor(ObservedObject.GetRawObject(this.firstButtonBackgroundColor)); 117823b3eb3cSopenharmony_ci Button.onHover((w23) => { 117923b3eb3cSopenharmony_ci if (w23) { 118023b3eb3cSopenharmony_ci this.firstButtonBackgroundColor = this.getButtonHoverColor(); 118123b3eb3cSopenharmony_ci } 118223b3eb3cSopenharmony_ci else { 118323b3eb3cSopenharmony_ci this.firstButtonBackgroundColor = this.getButtonBackgroundColor(); 118423b3eb3cSopenharmony_ci } 118523b3eb3cSopenharmony_ci }); 118623b3eb3cSopenharmony_ci Button.onClick(() => { 118723b3eb3cSopenharmony_ci if (this.buttons?.[0]?.action) { 118823b3eb3cSopenharmony_ci this.buttons?.[0]?.action(); 118923b3eb3cSopenharmony_ci } 119023b3eb3cSopenharmony_ci }); 119123b3eb3cSopenharmony_ci }, Button); 119223b3eb3cSopenharmony_ci this.observeComponentCreation2((q23, r23) => { 119323b3eb3cSopenharmony_ci Text.create(this.getFirstButtonText()); 119423b3eb3cSopenharmony_ci Text.direction(this.popupDirection); 119523b3eb3cSopenharmony_ci Text.maxLines(2); 119623b3eb3cSopenharmony_ci Text.focusable(true); 119723b3eb3cSopenharmony_ci Text.fontSize(this.getFirstButtonFontSize()); 119823b3eb3cSopenharmony_ci Text.fontColor(this.getFirstButtonFontColor()); 119923b3eb3cSopenharmony_ci Text.fontWeight(this.getButtonFontWeight()); 120023b3eb3cSopenharmony_ci Text.minFontSize(this.getButtonMinFontSize()); 120123b3eb3cSopenharmony_ci Text.textOverflow({ overflow: TextOverflow.Ellipsis }); 120223b3eb3cSopenharmony_ci }, Text); 120323b3eb3cSopenharmony_ci Text.pop(); 120423b3eb3cSopenharmony_ci Button.pop(); 120523b3eb3cSopenharmony_ci }); 120623b3eb3cSopenharmony_ci } 120723b3eb3cSopenharmony_ci else { 120823b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(1, () => { 120923b3eb3cSopenharmony_ci }); 121023b3eb3cSopenharmony_ci } 121123b3eb3cSopenharmony_ci }, If); 121223b3eb3cSopenharmony_ci If.pop(); 121323b3eb3cSopenharmony_ci this.observeComponentCreation2((x22, y22) => { 121423b3eb3cSopenharmony_ci If.create(); 121523b3eb3cSopenharmony_ci if (this.buttons?.[1]?.text !== '' && this.buttons?.[1]?.text !== void (0)) { 121623b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(0, () => { 121723b3eb3cSopenharmony_ci this.observeComponentCreation2((f23, g23) => { 121823b3eb3cSopenharmony_ci Button.createWithChild(); 121923b3eb3cSopenharmony_ci Button.direction(this.popupDirection); 122023b3eb3cSopenharmony_ci Button.margin(this.getButtonMargin()); 122123b3eb3cSopenharmony_ci Button.padding(this.getButtonTextPadding()); 122223b3eb3cSopenharmony_ci Button.backgroundColor(ObservedObject.GetRawObject(this.secondButtonBackgroundColor)); 122323b3eb3cSopenharmony_ci Button.onHover((j23) => { 122423b3eb3cSopenharmony_ci if (j23) { 122523b3eb3cSopenharmony_ci this.secondButtonBackgroundColor = this.getButtonHoverColor(); 122623b3eb3cSopenharmony_ci } 122723b3eb3cSopenharmony_ci else { 122823b3eb3cSopenharmony_ci this.secondButtonBackgroundColor = this.getButtonBackgroundColor(); 122923b3eb3cSopenharmony_ci } 123023b3eb3cSopenharmony_ci }); 123123b3eb3cSopenharmony_ci Button.onClick(() => { 123223b3eb3cSopenharmony_ci if (this.buttons?.[1]?.action) { 123323b3eb3cSopenharmony_ci this.buttons?.[1]?.action(); 123423b3eb3cSopenharmony_ci } 123523b3eb3cSopenharmony_ci }); 123623b3eb3cSopenharmony_ci }, Button); 123723b3eb3cSopenharmony_ci this.observeComponentCreation2((d23, e23) => { 123823b3eb3cSopenharmony_ci Text.create(this.getSecondButtonText()); 123923b3eb3cSopenharmony_ci Text.direction(this.popupDirection); 124023b3eb3cSopenharmony_ci Text.maxLines(2); 124123b3eb3cSopenharmony_ci Text.focusable(true); 124223b3eb3cSopenharmony_ci Text.fontSize(this.getSecondButtonFontSize()); 124323b3eb3cSopenharmony_ci Text.fontColor(this.getSecondButtonFontColor()); 124423b3eb3cSopenharmony_ci Text.fontWeight(this.getButtonFontWeight()); 124523b3eb3cSopenharmony_ci Text.minFontSize(this.getButtonMinFontSize()); 124623b3eb3cSopenharmony_ci Text.textOverflow({ overflow: TextOverflow.Ellipsis }); 124723b3eb3cSopenharmony_ci }, Text); 124823b3eb3cSopenharmony_ci Text.pop(); 124923b3eb3cSopenharmony_ci Button.pop(); 125023b3eb3cSopenharmony_ci }); 125123b3eb3cSopenharmony_ci } 125223b3eb3cSopenharmony_ci else { 125323b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(1, () => { 125423b3eb3cSopenharmony_ci }); 125523b3eb3cSopenharmony_ci } 125623b3eb3cSopenharmony_ci }, If); 125723b3eb3cSopenharmony_ci If.pop(); 125823b3eb3cSopenharmony_ci Flex.pop(); 125923b3eb3cSopenharmony_ci Column.pop(); 126023b3eb3cSopenharmony_ci }); 126123b3eb3cSopenharmony_ci } 126223b3eb3cSopenharmony_ci }, If); 126323b3eb3cSopenharmony_ci If.pop(); 126423b3eb3cSopenharmony_ci Row.pop(); 126523b3eb3cSopenharmony_ci } 126623b3eb3cSopenharmony_ci 126723b3eb3cSopenharmony_ci rerender() { 126823b3eb3cSopenharmony_ci this.updateDirtyElements(); 126923b3eb3cSopenharmony_ci } 127023b3eb3cSopenharmony_ci} 127123b3eb3cSopenharmony_ci 127223b3eb3cSopenharmony_ciexport default { Popup };