diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/.gitignore b/unionpi_tiger/sample/app/DistributedVideoPlayer/.gitignore deleted file mode 100644 index fbabf771..00000000 --- a/unionpi_tiger/sample/app/DistributedVideoPlayer/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -/node_modules -/oh_modules -/local.properties -/.idea -**/build -/.hvigor -.cxx -/.clangd -/.clang-format -/.clang-tidy -**/.test \ No newline at end of file diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/AppScope/app.json5 b/unionpi_tiger/sample/app/DistributedVideoPlayer/AppScope/app.json5 deleted file mode 100644 index 48e99921..00000000 --- a/unionpi_tiger/sample/app/DistributedVideoPlayer/AppScope/app.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -{ - "app": { - "bundleName": "com.unionman.distributedvideoplayer", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name" - } -} diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/AppScope/resources/base/element/string.json b/unionpi_tiger/sample/app/DistributedVideoPlayer/AppScope/resources/base/element/string.json deleted file mode 100644 index 09b6a700..00000000 --- a/unionpi_tiger/sample/app/DistributedVideoPlayer/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "DistributedVideoPlayer" - } - ] -} diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/AppScope/resources/base/media/app_icon.png b/unionpi_tiger/sample/app/DistributedVideoPlayer/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index c394496f..00000000 Binary files a/unionpi_tiger/sample/app/DistributedVideoPlayer/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/README.md b/unionpi_tiger/sample/app/DistributedVideoPlayer/README.md deleted file mode 100644 index 28936589..00000000 --- a/unionpi_tiger/sample/app/DistributedVideoPlayer/README.md +++ /dev/null @@ -1,122 +0,0 @@ -# 分布式视频播放器 - -### 介绍 - -本示例使用medialibrary获取本地视频文件资源,并通过AVPlayer完成了视频的播放、暂停、跳转、倍速等功能;并使用DeviceManager完成了分布式设备列表的显示和分布式能力完成了视频播放状态的跨设备协同。 - -本示例用到了文件存储管理能力接口[@ohos.fileio](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-fileio.md) - -媒体查询接口[@ohos.mediaquery](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-mediaquery.md) - -分布式键值数据库接口[@ohos.data.distributedKVStore](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-distributed-data.md) - -音视频相关媒体业务能力接口[@ohos.multimedia.media](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-media.md) - -分布式设备管理能力接口(设备管理),实现设备之间的kvStore对象的数据传输交互[@ohos.distributedHardware.deviceManager](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-device-manager.md) - -应用持久化轻量级数据接口[@ohos.data.preferences](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-data-preferences.md) - -屏幕截图接口[@ohos.screenshot](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-screenshot.md) - -### 效果预览 - -| 首页 | 视频列表 | -| ------------------------------------- | ---------------------------------- | -| ![](screenshots/Index.jpeg) | ![](screenshots/VideoList.jpeg) | -| **设备弹窗** | **设置** | -| ![](screenshots/DeviceDialog.jpeg) | ![](screenshots/Settings.jpeg) | - -使用说明 - -1. 首次进入应用会弹出权限弹窗,需要进行授权; -1. 播放视频源可使用hdc命令将视频推到storage/media/100/local/files/Videos路径下并重启; -1. **单击**播放键/暂停键或**双击**界面控制**播放/暂停**; -2. 点击进度条或左右滑动**操控进度**; -3. 点击右上角流转按钮,即可弹出设备选择框; -3. 在设备选择框中点击对端设备名称,拉起对端应用; -3. 对端应用启动后,可在任意一端中操作应用,两端应用可实现数据实时同步; -3. 在设备选择框中选中本机即可关闭对端应用; -3. 点击右上角设置按钮,可对流转模式及分布式认证设备进行设置管理; - -### 工程目录 - -``` -entry/src/main/ets/ -|---pages -| |---Index.ets // 首页 -| |---Settings.ets // 设置页 -|---model -| |---DistributedDataModel.ts // 封装分布式数据类 -| |---Logger.ets // 日志工具 -| |---KvStoreModel.ets // kvstore对象操作类 -| |---RemoteDeviceModel.ets // 远程设备操作类 -|---common -| |---BasicDataSource.ets // 懒加载数据 -| |---DeviceDialog.ets // 分布式设备列表弹窗 -| |---ScreenshotDialog.ets // 屏幕截图弹窗 -| |---TitleBar.ets // 菜单栏模块(包含远端设备拉起) -|---utils -| |---AVPlayerUtils.ts // 封装AVPlayer工具类 -| |---DateTimeUtil.ets // 日期时间工具类 -| |---MediaUtils.ts // 媒体库工具类 -| |---utils.ets // 自定义工具类 -``` - -### 具体实现 - -在分布式视频播放器应用中,分布式设备管理包含了分布式设备搜索、分布式设备列表弹窗、远端设备拉起三部分。 -首先在分布式组网内搜索设备,然后把设备展示到分布式设备列表弹窗中,最后根据用户的选择拉起远端设备。 - -#### 分布式设备搜索 - -通过SUBSCRIBE_ID搜索分布式组网内的远端设备,详见startDeviceDiscovery(){}模块[源码参考](https://gitee.com/openharmony/vendor_unionman/blob/master/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/ets/model/RemoteDeviceModel.ets)。 - -#### 分布式设备列表弹窗 - -使用@CustomDialog装饰器来装饰分布式设备列表弹窗,[源码参考](https://gitee.com/openharmony/vendor_unionman/blob/master/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/ets/common/DeviceDialog.ets)。 - -#### 远端设备拉起 - -通过startAbility(deviceId)方法拉起远端设备的包,[源码参考](https://gitee.com/openharmony/vendor_unionman/blob/master/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/ets/common/TitleBar.ets)。 - -#### 分布式数据管理 - -(1) 管理分布式数据库 -创建一个KVManager对象实例,用于管理分布式数据库对象。通过distributedKVStore.createKVManager(config),并通过指定Options和storeId,创建并获取KVStore数据库,并通过Promise方式返回,此方法为异步方法,例如this.kvManager.getKVStore(STORE_ID, options).then((store) => {}) - -(2) 订阅分布式数据变化 -通过订阅分布式数据库所有(本地及远端)数据变化实现数据协同[源码参考](https://gitee.com/openharmony/vendor_unionman/blob/master/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/ets/model/KvStoreModel.ets)。 - -### 相关权限 - -[ohos.permission.DISTRIBUTED_DATASYNC](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md#ohospermissiondistributed_datasync) - -[ohos.permission.CAPTURE_SCREEN](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md#ohospermissioncapture_screen) - -[ohos.permission.READ_MEDIA](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md#ohospermissionread_media) - -[ohos.permission.WRITE_MEDIA](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md#ohospermissionwrite_media) - -### 依赖 - -不涉及。 - -### 约束与限制 - -1. 本示例仅支持标准系统上运行; -2. 本示例仅支持API9版本SDK,SDK版本号(API Version 9 Release),镜像版本号(3.2 Release); -3. 本示例需要使用DevEco Studio 版本号(3.1 Release)才可编译运行; -4. 本示例涉及使用系统接口:@ohos.distributedHardware.deviceManager,需要手动替换Full SDK才能编译通过,具体操作可参考[替换指南](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/faqs/full-sdk-switch-guide.md); -5. 本示例涉及系统接口,需要配置系统应用签名,可以参考[特殊权限配置方法](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/app-provision-structure.md#修改harmonyappprovision配置文件),把配置文件中的“app-feature”字段信息改为“hos_system_app”。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -``` -git init -git config core.sparsecheckout true -echo unionpi_tiger/sample/app/DistributedVideoPlayer/ > .git/info/sparse-checkout -git remote add origin https://gitee.com/openharmony/vendor_unionman.git -git pull origin master -``` \ No newline at end of file diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/build-profile.json5 b/unionpi_tiger/sample/app/DistributedVideoPlayer/build-profile.json5 deleted file mode 100644 index 598b9b6d..00000000 --- a/unionpi_tiger/sample/app/DistributedVideoPlayer/build-profile.json5 +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -{ - "app": { - "signingConfigs": [], - "compileSdkVersion": 9, - "compatibleSdkVersion": 9, - "products": [ - { - "name": "default", - "signingConfig": "default", - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/.gitignore b/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/.gitignore deleted file mode 100644 index e2713a27..00000000 --- a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/build-profile.json5 b/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/build-profile.json5 deleted file mode 100644 index 33e22c80..00000000 --- a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/build-profile.json5 +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -{ - "apiType": 'stageMode', - "buildOption": { - }, - "targets": [ - { - "name": "default", - "runtimeOS": "OpenHarmony" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/hvigorfile.ts b/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/hvigorfile.ts deleted file mode 100644 index 80e4ec5b..00000000 --- a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/hvigorfile.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. -export { hapTasks } from '@ohos/hvigor-ohos-plugin'; diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/oh-package.json5 b/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/oh-package.json5 deleted file mode 100644 index 225946cb..00000000 --- a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/oh-package.json5 +++ /dev/null @@ -1,10 +0,0 @@ -{ - "license": "", - "devDependencies": {}, - "author": "", - "name": "entry", - "description": "Please describe the basic information.", - "main": "", - "version": "1.0.0", - "dependencies": {} -} diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/ets/common/BasicDataSource.ets b/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/ets/common/BasicDataSource.ets deleted file mode 100644 index 55a088f1..00000000 --- a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/ets/common/BasicDataSource.ets +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -import mediaLibrary from '@ohos.multimedia.mediaLibrary'; - -class BasicDataSource implements IDataSource { - private listeners: DataChangeListener[] = [] - - public totalCount(): number { - return 0 - } - - public getData(index: number): any { - return undefined - } - - registerDataChangeListener(listener: DataChangeListener): void { - if (this.listeners.indexOf(listener) < 0) { - this.listeners.push(listener) - } - } - - unregisterDataChangeListener(listener: DataChangeListener): void { - const pos = this.listeners.indexOf(listener); - if (pos >= 0) { - this.listeners.splice(pos, 1) - } - } - - notifyDataReload(): void { - this.listeners.forEach(listener => { - listener.onDataReloaded() - }) - } - - notifyDataAdd(index: number): void { - this.listeners.forEach(listener => { - listener.onDataAdd(index) - }) - } - - notifyDataChange(index: number): void { - this.listeners.forEach(listener => { - listener.onDataChange(index) - }) - } - - notifyDataDelete(index: number): void { - this.listeners.forEach(listener => { - listener.onDataDelete(index) - }) - } - - notifyDataMove(from: number, to: number): void { - this.listeners.forEach(listener => { - listener.onDataMove(from, to) - }) - } -} - -export default class MediaDataSource extends BasicDataSource { - private dataArray: mediaLibrary.FileAsset[] = [] - - constructor(data: mediaLibrary.FileAsset[]) { - super() - this.dataArray = data - } - - public totalCount(): number { - return this.dataArray.length - } - - public getData(index: number): mediaLibrary.FileAsset { - return this.dataArray[index] - } - - public addData(index: number, data: mediaLibrary.FileAsset): void { - this.dataArray.splice(index, 0, data) - this.notifyDataAdd(index) - } - - public pushData(data: mediaLibrary.FileAsset): void { - this.dataArray.push(data) - this.notifyDataAdd(this.dataArray.length - 1) - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/ets/common/DeviceDialog.ets b/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/ets/common/DeviceDialog.ets deleted file mode 100644 index afc8f929..00000000 --- a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/ets/common/DeviceDialog.ets +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -import Logger from '../model/Logger'; -import deviceManager from '@ohos.distributedHardware.deviceManager'; - -const TAG: string = 'DeviceDialog'; - -@CustomDialog -export struct DeviceDialog { - controller?: CustomDialogController - @StorageLink('deviceLists') deviceLists: Array = AppStorage.Get('deviceLists') - private selectedIndex: number = 0 - private selectedIndexChange: (selectedIndex: number) => void = () => { - } - cancel: () => void - - build() { - Column() { - Text($r('app.string.choiceDevice')) - .fontSize('32px') - .width('434px') - .fontColor(Color.Black) - .textAlign(TextAlign.Start) - .fontWeight(600) - List() { - ForEach(this.deviceLists, (item: deviceManager.DeviceInfo, index: number | undefined) => { - ListItem() { - Flex({ - direction: FlexDirection.Row, - justifyContent: FlexAlign.SpaceBetween, - alignItems: ItemAlign.Center - }) { - Text(item.deviceName) - .fontSize(18) - .width('86%') - .fontColor(Color.Black) - .textAlign(TextAlign.Start) - Radio({ value: '', group: 'radioGroup' }) - .width('7%') - .checked(index === this.selectedIndex ? true : false) - .onChange(() => { - Logger.info(TAG, `select device: ${item.deviceId}`) - if (index === this.selectedIndex) { - Logger.info(TAG, 'index === this.selectedIndex') - return - } - this.selectedIndex = index !== undefined ? index : 0 - if (this.controller !== undefined) { - this.controller.close() - } - this.selectedIndexChange(this.selectedIndex) - }) - } - .height(55) - } - .width('100%') - .height(80) - }, item => item.deviceName) - } - .height('36%') - .width('100%') - - Button() { - Text($r('app.string.cancel')) - .width('90%') - .fontSize(21) - .fontColor('#ff0d64fb') - .textAlign(TextAlign.Center) - } - .margin({ bottom: 16 }) - .type(ButtonType.Capsule) - .backgroundColor(Color.White) - .onClick(() => { - if (this.controller !== undefined) { - this.controller.close() - this.cancel() - } - }) - } - .margin({ bottom: 36 }) - .width('500px') - .padding(10) - .backgroundColor(Color.White) - .border({ color: Color.White, radius: 20 }) - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/ets/common/ScreenshotDialog.ets b/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/ets/common/ScreenshotDialog.ets deleted file mode 100644 index c6343666..00000000 --- a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/ets/common/ScreenshotDialog.ets +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -const SCALE: number = 0.5; // 缩放比例 - -@CustomDialog -export struct ScreenshotDialog { - screenshotController: CustomDialogController - @Link screenshotUrl: PixelMap - - build() { - Column() { - Image(this.screenshotUrl) - } - .borderRadius(10) - .padding(20) - .backgroundColor(Color.White) - .scale({ x: SCALE, y: SCALE }) - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/ets/common/TitleBar.ets b/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/ets/common/TitleBar.ets deleted file mode 100644 index 4e1a1aca..00000000 --- a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/ets/common/TitleBar.ets +++ /dev/null @@ -1,234 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -import router from '@ohos.router'; -import screenshot from '@ohos.screenshot'; -import abilityAccessCtrl from '@ohos.abilityAccessCtrl'; -import promptAction from '@ohos.promptAction'; -import deviceManager from '@ohos.distributedHardware.deviceManager'; -import Logger from '../model/Logger'; -import MediaUtils from '../utils/MediaUtils'; -import { DeviceDialog } from '../common/DeviceDialog'; -import { RemoteDeviceModel } from '../model/RemoteDeviceModel'; -import { ScreenshotDialog } from '../common/ScreenshotDialog'; - -const TAG = 'TitleBar'; -const DATA_CHANGE = 'dataChange'; -const EXIT = 'exit'; -const ONE_THOUSAND: number = 1000; - -@Component -export struct TitleBar { - @Prop title: string - @Prop isLand: boolean - @State selectedIndex: number = 0 - @StorageLink('deviceLists') deviceLists: Array = [] - @State screenshotUrl: PixelMap = undefined - private startAbilityCallBack: (key) => void - private remoteDeviceModel: RemoteDeviceModel = null - private dialogController: CustomDialogController = null - private mediaUtil: MediaUtils = new MediaUtils() - screenshotDialogController: CustomDialogController = new CustomDialogController({ - builder: ScreenshotDialog({ screenshotUrl: $screenshotUrl }), - autoCancel: true, - customStyle: true, - offset: { dx: -100, dy: 100 } - }) - - aboutToAppear() { - AppStorage.SetOrCreate('deviceLists', this.deviceLists) - } - - clearSelectState() { - this.deviceLists = [] - if (this.dialogController) { - this.dialogController.close() - this.dialogController = null - } - } - - selectDevice() { - Logger.info(TAG, `start ability device:${JSON.stringify(this.deviceLists[this.selectedIndex])}`) - if (this.remoteDeviceModel === null || this.remoteDeviceModel.discoverLists.length <= 0 || this.remoteDeviceModel.deviceLists.includes(this.deviceLists[this.selectedIndex])) { - this.startAbility(this.deviceLists[this.selectedIndex].deviceId) - this.clearSelectState() - return - } - Logger.info(TAG, 'start ability, needAuth') - this.remoteDeviceModel.authenticateDevice(this.deviceLists[this.selectedIndex], (device: deviceManager.DeviceInfo) => { - Logger.info(TAG, 'auth and online finished' + JSON.stringify(device)) - this.startAbility(device.deviceId) - }) - Logger.info(TAG, 'start ability2 ......') - this.clearSelectState() - } - - selectedIndexChange = (index: number) => { - Logger.info(TAG, 'selectedIndexChange') - this.selectedIndex = index - if (this.selectedIndex === 0) { - Logger.info(TAG, 'stop ability') - this.startAbilityCallBack(EXIT) - globalThis.isDistributed = false - if (this.dialogController !== null) { - this.dialogController.close() - } - this.deviceLists = [] - return - } - this.selectDevice() - } - - /** - * 启动远程设备 - * @param deviceId - */ - async startAbility(deviceId) { - Logger.info(TAG, `startAbility deviceId: ${deviceId}`) - await globalThis.context.startAbility({ - bundleName: 'com.unionman.distributedvideoplayer', - abilityName: 'EntryAbility', - deviceId: deviceId, - parameters: { - isStage: 'Stage', - deviceID: "remote" - } - }).then((data) => { - Logger.info(TAG, `start ability finished: ${JSON.stringify(data)}`) - promptAction.showToast({ message: "流转成功" }) - globalThis.isDistributed = true - // 等待对端KvStore启动再同步数据 - setTimeout(() => { - this.startAbilityCallBack(DATA_CHANGE) - }, 2000) - }).catch((err) => { - Logger.error(TAG, `start ability err: ${JSON.stringify(err)}`); - }); - } - - showDialog() { - // 注册监听回调,发现设备或查找到已认证设备会弹窗显示 - this.remoteDeviceModel.registerDeviceListCallback(() => { - Logger.info(TAG, 'registerDeviceListCallback, callback entered') - this.deviceLists = [] - this.deviceLists.push({ - deviceId: '0', - deviceName: '本机(结束协同)', - deviceType: deviceManager.DeviceType.UNKNOWN_TYPE, - networkId: '', - range: ONE_THOUSAND - }) - let deviceTempList = this.remoteDeviceModel.deviceLists.concat(this.remoteDeviceModel.discoverLists) - Logger.info(TAG, `this.remoteDeviceModel.deviceTempList.length${deviceTempList.length}`) - for (let i = 0; i < deviceTempList.length; i++) { - Logger.info(TAG, `device ${i}/${deviceTempList.length} deviceId= ${deviceTempList[i].deviceId}, deviceName= ${deviceTempList[i].deviceName}, deviceType= ${deviceTempList[i].deviceType}`) - this.deviceLists.push(deviceTempList[i]) - AppStorage.Set('deviceLists', this.deviceLists) - Logger.info(TAG, 'deviceLists push end') - } - Logger.info(TAG, 'CustomDialogController start') - if (this.dialogController !== null) { - this.dialogController.close() - this.dialogController = null - } - this.dialogController = new CustomDialogController({ - builder: DeviceDialog({ - cancel: () => { - this.clearSelectState() - }, - selectedIndex: this.selectedIndex, - selectedIndexChange: this.selectedIndexChange - }), - cancel: () => { - this.clearSelectState() - }, - autoCancel: true, - customStyle: true, - alignment: this.isLand ? DialogAlignment.Center : DialogAlignment.Bottom - }) - this.dialogController.open() - Logger.info(TAG, 'CustomDialogController end') - }) - } - - build() { - Row() { - Image($r("app.media.ic_back")) - .id("back") - .height('60%') - .margin({ right: 4 }) - .width(this.isLand ? '6%' : '8%') - .objectFit(ImageFit.Contain) - .onClick(() => { - globalThis.context.terminateSelf() - }) - - Text(this.title) - .fontColor(Color.White) - .fontSize(22) - .maxLines(1) - - Blank() - - Image($r("app.media.ic_controlcenter_screenshot_filled")) - .id("screenshot") - .height('60%') - .margin({ right: 8 }) - .width(this.isLand ? '6%' : '8%') - .objectFit(ImageFit.Contain) - .onClick(() => { - var screenshotOptions = {}; - screenshot.save(screenshotOptions).then((pixelMap: PixelMap) => { - this.screenshotUrl = pixelMap - this.mediaUtil.savePicture(pixelMap) - this.screenshotDialogController.open() - }).catch((err) => { - Logger.error('Failed to save screenshot: ' + JSON.stringify(err)); - }); - }) - - Image($r("app.media.ic_hop")) - .id("hop") - .height('60%') - .width(this.isLand ? '6%' : '8%') - .margin({ right: 8 }) - .objectFit(ImageFit.Contain) - .onClick(() => { - this.showDialog() - }) - - Image($r("app.media.ic_settings")) - .id("settings") - .height('60%') - .width(this.isLand ? '6%' : '8%') - .objectFit(ImageFit.Contain) - .onClick(() => { - router.pushUrl({ - url: 'pages/Settings' - }) - }) - } - .width('100%') - .height(this.isLand ? '10%' : '8%') - .constraintSize({ minHeight: 50 }) - .alignItems(VerticalAlign.Center) - .padding({ left: 10, right: 10 }) - .linearGradient({ - direction: GradientDirection.Bottom, - colors: [['#CC000000', 0.0], ['#33000000', 0.66], ['#00000000', 0.99]] - }) - } -} diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/ets/entryability/EntryAbility.ts b/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/ets/entryability/EntryAbility.ts deleted file mode 100644 index 117d3250..00000000 --- a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/ets/entryability/EntryAbility.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import UIAbility from '@ohos.app.ability.UIAbility'; -import window from '@ohos.window'; -import abilityAccessCtrl from '@ohos.abilityAccessCtrl'; - -export default class EntryAbility extends UIAbility { - onCreate(want, launchParam) { - if (want.parameters !== undefined) { - AppStorage.SetOrCreate('isStage', want.parameters.isStage) - AppStorage.SetOrCreate('deviceID', want.parameters.deviceID) - } - globalThis.context = this.context; - } - - onWindowStageCreate(windowStage: window.WindowStage) { - let AtManager = abilityAccessCtrl.createAtManager(); - AtManager.requestPermissionsFromUser(this.context, ["ohos.permission.DISTRIBUTED_DATASYNC", "ohos.permission.READ_MEDIA", "ohos.permission.WRITE_MEDIA"]) - windowStage.getMainWindowSync().setWindowSystemBarEnable([]) - - windowStage.loadContent('pages/Index', null); - } -} diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/ets/model/DistributedDataModel.ets b/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/ets/model/DistributedDataModel.ets deleted file mode 100644 index 9fd38d32..00000000 --- a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/ets/model/DistributedDataModel.ets +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -export default class DistributedDataModel { - public title: string - public currentTime: number - public SpeedIndex: number - public isPlay: boolean - public firstHop: boolean - - constructor(title, currentTime, SpeedIndex, isPlay, firstHop) { - this.title = title - this.currentTime = currentTime - this.SpeedIndex = SpeedIndex - this.isPlay = isPlay - this.firstHop = firstHop - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/ets/model/KvStoreModel.ets b/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/ets/model/KvStoreModel.ets deleted file mode 100644 index fbc12c1d..00000000 --- a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/ets/model/KvStoreModel.ets +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -import Logger from './Logger'; -import distributedKVStore from '@ohos.data.distributedKVStore'; - -const TAG = 'KvStoreModel'; -const STORE_ID = 'distributedvideoplayer'; - -export class KvStoreModel { - private kvManager: distributedKVStore.KVManager = undefined; - private kvStore: distributedKVStore.SingleKVStore = undefined; - - constructor() { - } - - async createKvStore(callback) { - if ((typeof (this.kvStore) !== 'undefined')) { - callback() - return - } - let kvManagerConfig = { - bundleName: 'com.unionman.distributedvideoplayer', - context: globalThis.context - } - Logger.info(TAG, 'createKVManager begin') - this.kvManager = distributedKVStore.createKVManager(kvManagerConfig) - Logger.info(TAG, `createKVManager success, kvManager`) - - let options = { - createIfMissing: true, // 当数据库文件不存在时创建数据库 - encrypt: false, // 设置数据库文件不加密 - backup: false, // 设置数据库文件不备份 - autoSync: true, // 设置数据库文件自动同步 - kvStoreType: distributedKVStore.KVStoreType.SINGLE_VERSION, // 设置要创建的数据库类型为表示单版本数据库 - securityLevel: distributedKVStore.SecurityLevel.S1, // 设置数据库安全级别为低级别 - } - Logger.info(TAG, 'kvManager.getKVStore begin') - // 通过指定Options和storeId,创建并获取KVStore数据库 - this.kvStore = await this.kvManager.getKVStore(STORE_ID, options) - Logger.info(TAG, `getKVStore success, kvStore=${JSON.stringify(this.kvStore)}`) - callback() - Logger.info(TAG, 'kvManager.getKVStore end') - Logger.info(TAG, 'createKVManager end') - } - - put(key, value) { - Logger.info(TAG, `kvStore.put ${key}=${value}`) - try { - this.kvStore.put(key, value).then((data) => { - Logger.info(TAG, `kvStore.put ${key} finished, data= ${data}`) - }).catch((err) => { - Logger.error(TAG, `kvStore.put ${key} failed ${err}`) - }) - } catch (e) { - Logger.error(TAG, `An unexpected error occurred.code is ${e.code},message is ${e.message}`); - } - } - - setOnMessageReceivedListener(msg, callback) { - Logger.info(TAG, `setOnMessageReceivedListener ${msg}`) - this.createKvStore(() => { - Logger.info(TAG, 'kvStore.on(dataChange) begin') - this.kvStore.on('dataChange', distributedKVStore.SubscribeType.SUBSCRIBE_TYPE_REMOTE, (data) => { - Logger.info(TAG, `dataChange, ${JSON.stringify(data)}`) - Logger.info(TAG, `dataChange, insert ${data.insertEntries.length},udpate ${data.updateEntries.length}`) - let entries = data.insertEntries.length > 0 ? data.insertEntries : data.updateEntries - for (let i = 0; i < entries.length; i++) { - if (entries[i].key === msg) { - let value = entries[i].value.value - Logger.info(TAG, `Entries receive${msg} = ${value}`) - callback(value) - return; - } - } - }); - Logger.info(TAG, 'kvStore.on(dataChange) end') - }) - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/ets/model/Logger.ets b/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/ets/model/Logger.ets deleted file mode 100644 index cba6989a..00000000 --- a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/ets/model/Logger.ets +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -import hilog from '@ohos.hilog' - -class Logger { - private domain: number = 0xFF00 - private prefix: string = '' - private format: string = "%{public}s, %{public}s" - - constructor(prefix: string) { - this.prefix = prefix - this.domain = 0xFF00 - } - - debug(...args: any[]) { - hilog.debug(this.domain, this.prefix, this.format, args) - } - - info(...args: any[]) { - hilog.info(this.domain, this.prefix, this.format, args) - } - - warn(...args: any[]) { - hilog.warn(this.domain, this.prefix, this.format, args) - } - - error(...args: any[]) { - hilog.error(this.domain, this.prefix, this.format, args) - } -} - -export default new Logger('[DistributedVideoPlayer]') \ No newline at end of file diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/ets/model/RemoteDeviceModel.ets b/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/ets/model/RemoteDeviceModel.ets deleted file mode 100644 index 5150a726..00000000 --- a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/ets/model/RemoteDeviceModel.ets +++ /dev/null @@ -1,242 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -import Logger from './Logger'; -import promptAction from '@ohos.promptAction'; -import deviceManager from '@ohos.distributedHardware.deviceManager'; - -const TAG = 'RemoteDeviceModel'; -const RANDOM: number = 65536; -let SUBSCRIBE_ID = 100; - -export class RemoteDeviceModel { - public deviceLists: Array = [] - public discoverLists: Array = [] - private callback: () => void = null - private authCallback: (device: deviceManager.DeviceInfo) => void = null - private deviceManager: deviceManager.DeviceManager = undefined - - constructor() { - } - - registerDeviceListCallback(callback) { - if (typeof (this.deviceManager) !== 'undefined') { - this.registerDeviceListCallbackImplement(callback) - return - } - Logger.info(TAG, 'deviceManager.createDeviceManager begin') - try { - deviceManager.createDeviceManager("com.unionman.distributedvideoplayer", (error, value) => { - if (error) { - Logger.error(TAG, `createDeviceManager failed.${error}`) - return - } - this.deviceManager = value - this.registerDeviceListCallbackImplement(callback) - Logger.info(TAG, `createDeviceManager callback returned, error= ${error} value= ${JSON.stringify(value)}`) - }) - } catch (error) { - Logger.error(TAG, `createDeviceManager throw error, code=${error.code} message=${error.message}`) - } - Logger.info(TAG, 'deviceManager.createDeviceManager end') - } - - deviceStateChangeActionOffline(device) { - if (this.deviceLists.length <= 0) { - this.callback() - return - } - for (let j = 0; j < this.deviceLists.length; j++) { - if (this.deviceLists[j].deviceId === device.deviceId) { - this.deviceLists[j] = device - break - } - } - Logger.info(TAG, `offline, device list= ${JSON.stringify(this.deviceLists)}`) - this.callback() - } - - changeStateOnline(device) { - this.deviceLists[this.deviceLists.length] = device - Logger.debug(TAG, `online, device list= ${JSON.stringify(this.deviceLists)}`) - this.callback() - } - - registerDeviceListCallbackImplement(callback) { - Logger.info(TAG, 'registerDeviceListCallback') - this.callback = callback - if (this.deviceManager === undefined) { - Logger.error(TAG, 'deviceManager has not initialized') - this.callback() - return - } - Logger.info(TAG, 'getTrustedDeviceListSync begin') - try { - let list = this.deviceManager.getTrustedDeviceListSync() - Logger.info(TAG, `getTrustedDeviceListSync end, deviceList= ${JSON.stringify(list)}`) - if (typeof (list) != 'undefined' && typeof (list.length) != 'undefined') { - this.deviceLists = list - } - } catch (error) { - Logger.error(TAG, `getTrustedDeviceListSync throw error, code=${error.code} message=${error.message}`) - } - - this.callback() - Logger.info(TAG, `callback finished devices = ${JSON.stringify(this.deviceLists)}`) - try { - this.deviceManager.on('deviceStateChange', (data) => { - if (data === null) { - return - } - Logger.info(TAG, `deviceStateChange data= ${JSON.stringify(data)}`) - switch (data.action) { - case deviceManager.DeviceStateChangeAction.ONLINE: - this.changeStateOnline(data.device) - break; - case deviceManager.DeviceStateChangeAction.READY: - this.discoverLists = [] - this.deviceLists.push(data.device) - this.callback() - try { - let list = this.deviceManager.getTrustedDeviceListSync() - if (typeof (list) !== 'undefined' && typeof (list.length) !== 'undefined') { - this.deviceLists = list - } - } catch (error) { - Logger.error(TAG, `getTrustedDeviceListSync throw error, code=${error.code} message=${error.message}`) - } - this.callback() - break; - case deviceManager.DeviceStateChangeAction.OFFLINE: - case deviceManager.DeviceStateChangeAction.CHANGE: - this.deviceStateChangeActionOffline(data.device) - try { - let list = this.deviceManager.getTrustedDeviceListSync() - if (typeof (list) !== 'undefined' && typeof (list.length) !== 'undefined') { - this.deviceLists = list - } - } catch (error) { - Logger.error(TAG, `getTrustedDeviceListSync throw error, code=${error.code} message=${error.message}`) - } - this.callback() - break - default: - break - } - }) - this.deviceManager.on('deviceFound', (data) => { - if (data === null) { - return - } - Logger.info(TAG, `deviceFound data=${JSON.stringify(data)}`) - this.deviceFound(data) - }) - this.deviceManager.on('discoverFail', (data) => { - Logger.info(TAG, `discoverFail data= ${JSON.stringify(data)}`) - }) - this.deviceManager.on('serviceDie', () => { - Logger.error(TAG, 'serviceDie') - }) - } catch (error) { - Logger.error(TAG, `on throw error, code=${error.code} message=${error.message}`) - } - this.startDeviceDiscovery() - } - - deviceFound(data) { - for (var i = 0;i < this.discoverLists.length; i++) { - if (this.discoverLists[i].deviceId === data.device.deviceId) { - Logger.info(TAG, 'device founded ignored') - return - } - } - this.discoverLists[this.discoverLists.length] = data.device - Logger.info(TAG, `deviceFound self.discoverList= ${JSON.stringify(this.discoverLists)}`) - this.callback() - } - - /** - * 通过SUBSCRIBE_ID搜索分布式组网内的设备 - */ - startDeviceDiscovery() { - // 生成发现标识,随机数确保每次调用发现接口的标识不一致,且SUBSCRIBE_ID在0到65536之间 - SUBSCRIBE_ID = Math.floor(RANDOM * Math.random()) - let info = { - subscribeId: SUBSCRIBE_ID, // 发现标识,用于标识不同的发现周期 - mode: 0xAA, // 主动模式 - medium: 2, // WiFi发现类型 - freq: 2, // 高频率 - isSameAccount: false, // 是否同账号 - isWakeRemote: true, // 是否唤醒设备 - capability: 0 // DDMP能力 - } - Logger.info(TAG, `startDeviceDiscovery ${SUBSCRIBE_ID}`) - // 当有设备发现时,通过deviceFound回调通知给应用程序 - try { - this.deviceManager.startDeviceDiscovery(info) - } catch (error) { - Logger.error(TAG, `startDeviceDiscovery throw error, code=${error.code} message=${error.message}`) - } - } - - authenticateDevice(device, callBack) { - Logger.info(TAG, `authenticateDevice ${JSON.stringify(device)}`) - for (let i = 0; i < this.discoverLists.length; i++) { - if (this.discoverLists[i].deviceId !== device.deviceId) { - continue - } - let extraInfo = { - 'targetPkgName': 'com.unionman.distributedvideoplayer', - 'appName': 'Distributed VideoPlayer', - 'appDescription': 'Distributed VideoPlayer', - 'business': '0' - } - let authParam = { - 'authType': 1, //认证类型: 1 - 无账号PIN码认证 - 'appIcon': '', - 'appThumbnail': '', - 'extraInfo': extraInfo - } - try { - this.deviceManager.authenticateDevice(device, authParam, (err, data) => { - if (err) { - Logger.error(TAG, `authenticateDevice error: ${JSON.stringify(err)}`) - this.authCallback = null - return - } - Logger.info(TAG, `authenticateDevice succeed: ${JSON.stringify(data)}`) - this.authCallback = callBack - if (this.authCallback !== null) { - this.authCallback(device) - this.authCallback = null - } - }) - } catch (error) { - Logger.error(TAG, `authenticateDevice throw error, code=${error.code} message=${error.message}`) - } - } - } - - unAuthenticateDevice(device) { - try { - this.deviceManager.unAuthenticateDevice(device); - promptAction.showToast({ message: '解除中,请稍后...', duration: 3000 }) - } catch (err) { - Logger.error(TAG, "unAuthenticateDevice errCode:" + err.code + ",errMessage:" + err.message); - } - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/ets/pages/Index.ets b/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index ed5cd25f..00000000 --- a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,533 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -import mediaLibrary from '@ohos.multimedia.mediaLibrary'; -import mediaQuery from '@ohos.mediaquery'; -import preferences from '@ohos.data.preferences'; -import MediaDataSource from '../common/BasicDataSource'; -import { TitleBar } from '../common/TitleBar'; -import { toTime } from '../utils/utils'; -import { RemoteDeviceModel } from '../model/RemoteDeviceModel'; -import { KvStoreModel } from '../model/KvStoreModel'; -import Logger from '../model/Logger'; -import MediaUtils from '../utils/MediaUtils'; -import AVPlayerUtils from '../utils/AVPlayerUtils'; -import DistributedDataModel from '../model/DistributedDataModel'; - -const TAG: string = "Index"; -const EXIT: string = 'exit'; -const DATA_CHANGE: string = 'dataChange'; -const PlaybackSpeed: string[] = ['0.75X', '1.0X', '1.25X', '1.75X', '2.0X']; -const PREFERENCES_NAME = 'setting'; -let preferenceSetting: preferences.Preferences = null; - -@Component -struct localVideoItem { - private media: mediaLibrary.FileAsset - @State pixelMap: PixelMap = undefined - @Link videoIndex: number - @State index: number = 0 - event: (event?: ClickEvent) => void - - async aboutToAppear() { - let size = { width: 128, height: 80 } - this.pixelMap = await this.media.getThumbnail(size) - } - - build() { - Row({ space: 10 }) { - Image(this.pixelMap) - .height(80) - .aspectRatio(1.6) - .objectFit(ImageFit.Cover) - .borderRadius(10) - Text(this.media.displayName.replace('.mp4', '')) - .width(172) - .fontSize(14) - .fontColor(this.videoIndex === this.index ? '#E5007DFF' : '#FFFFFF') - } - .width(330) - .height(100) - .padding(10) - .borderRadius(20) - .backgroundColor('#464646') - .alignItems(VerticalAlign.Center) - .onClick(this.event) - } -} - -@Entry -@Component -struct Index { - @State tabsIndex: number = 0 - @State @Watch('resetVideo') videoIndex: number = 0 - @State @Watch('initVideo') title: string = '' - @State @Watch('setSpeed') SpeedIndex: number = 1 - @State @Watch('dataChange') isPlay: boolean = false - // 是否显示控制栏 - @State @Watch('showControlBarEvent') controls: number = Visibility.Visible; - // 是否显示侧边栏 - @State showSideBar: boolean = false - @State showPlaybackProgress: boolean = false - @State currentTime: number = 0 - @State duration: number = 0 - @State kvStoreModel: KvStoreModel = new KvStoreModel() - @State ratio: number = 1.0 - // 是否横屏 - @State isLand: boolean = false - // 是否正在加载 - @State isLoading: boolean = true; - // 流转模式 - @StorageLink('continuationMode') continuationMode: string = 'continuation' - // 控制栏定时器id - private controlBarTimeoutID: number - private tabsController: TabsController = new TabsController() - private remoteDeviceModel: RemoteDeviceModel = new RemoteDeviceModel() - private mediaDataSource: MediaDataSource = new MediaDataSource([]) - private mediaUtil: MediaUtils = new MediaUtils() - private mediaList: Array = [] - private mXComponentController: XComponentController = new XComponentController() - private surfaceId: string = '' - private avPlayer: AVPlayerUtils = new AVPlayerUtils() - private fileAsset: mediaLibrary.FileAsset = undefined - private fd: number = undefined - private listener = mediaQuery.matchMediaSync('screen and (min-aspect-ratio: 1.5) or (orientation: landscape)') - onLand = (mediaQueryResult) => { - Logger.info(TAG, `onLand: mediaQueryResult.matches= ${mediaQueryResult.matches}`) - if (mediaQueryResult.matches) { - this.isLand = true - } else { - this.isLand = false - } - } - startX: number - startY: number - moveX: number - moveY: number - - @Builder TabBuilder(index: number, text: string) { - Column() { - Text(text) - .fontColor(Color.White) - .fontSize(24) - .fontFamily('HarmonyHeiTi') - - Divider() - .width('75%') - .strokeWidth(5) - .color('#007Dff') - .opacity(this.tabsIndex === index ? 1 : 0) - } - } - - async aboutToAppear() { - this.getVideos() - // 订阅DATA_CHANGE类型的数据变更通知 - this.kvStoreModel.setOnMessageReceivedListener(DATA_CHANGE, value => { - Logger.info(TAG, `DATA_CHANGE ${value}`) - if (globalThis.isDistributed) { - if (value.search(EXIT) !== -1) { - Logger.info(TAG, `EXIT ${EXIT}`) - globalThis.context.terminateSelf((error) => { - Logger.error(TAG, `terminateSelf finished, error= ${error}`) - }); - } else { - let video = JSON.parse(value) - globalThis.dataChange = true - globalThis.firstHop = video.firstHop - this.title = video.title - this.currentTime = video.currentTime - if (!video.firstHop) { - this.setCurrentTime() - } - this.SpeedIndex = video.SpeedIndex - this.isPlay = video.isPlay - Logger.info(TAG, `title:${this.title},currentTime:${this.currentTime},SpeedIndex:${this.SpeedIndex},isPlay:${this.isPlay},firstHop:${globalThis.firstHop}`) - globalThis.dataChange = false - } - } - }) - if (AppStorage.Get('isStage') === 'Stage') { - globalThis.isDistributed = true - } - globalThis.deviceID = AppStorage.Get('deviceID') - this.listener.on('change', this.onLand) - preferenceSetting = await preferences.getPreferences(globalThis.context, PREFERENCES_NAME) - this.continuationMode = await preferenceSetting.get('continuationMode', 'continuation') - } - - startAbilityCallBack = (key) => { - Logger.info(TAG, `startAbilityCallBack ${key}`) - if (DATA_CHANGE === key) { - globalThis.deviceID = "local" - globalThis.firstHop = true - let video = new DistributedDataModel(this.title, this.currentTime, this.SpeedIndex, this.isPlay, true) - this.isPlay = false - this.kvStoreModel.put(DATA_CHANGE, JSON.stringify(video)) - if (this.continuationMode == 'continuation') { - globalThis.context.terminateSelf() - } - } - if (EXIT === key) { - this.kvStoreModel.put(DATA_CHANGE, EXIT) - } - } - - async getVideos() { - this.mediaDataSource['dataArray'] = [] - let fileList = await this.mediaUtil.getFileAssetsFromType(mediaLibrary.MediaType.VIDEO) - Logger.info(TAG, 'getVideos fileList:' + JSON.stringify(fileList)) - this.mediaList = this.mediaDataSource['dataArray'] = fileList - Logger.info(TAG, 'getVideos mediaList:' + JSON.stringify(this.mediaList)) - Logger.info(TAG, 'getVideos mediaDataSource:' + JSON.stringify(this.mediaDataSource['dataArray'])) - this.mediaDataSource.notifyDataReload() - if (!globalThis.isDistributed) { - this.title = this.mediaList[this.videoIndex].displayName.replace('.mp4', '') - } - } - - dataChange() { - Logger.info(TAG, `dataChange, title = ${this.title}, currentTime = ${this.currentTime}, SpeedIndex = ${this.SpeedIndex}, isPlay = ${this.isPlay}`) - if (this.isPlay) { - this.playVideo() - } else { - this.avPlayer.pause() - this.controls = Visibility.Visible - clearTimeout(this.controlBarTimeoutID) - } - this.controls = Visibility.Visible - this.distributedDataSync() - } - - distributedDataSync() { - if (globalThis.isDistributed && !globalThis.firstHop && !globalThis.dataChange) { - let video = new DistributedDataModel(this.title, this.currentTime, this.SpeedIndex, this.isPlay, false) - this.kvStoreModel.put(DATA_CHANGE, JSON.stringify(video)) - } - } - - showControlBarEvent() { - if (this.controls == Visibility.Visible) { - this.controlBarTimeoutID = setTimeout(() => { - this.controls = Visibility.Hidden - }, 5000) - } - } - - async initVideo() { - Logger.info(TAG, 'initVideo') - try { - this.mediaList.forEach((file, index) => { - if (file.displayName.replace('.mp4', '') === this.title) { - this.fileAsset = file - this.videoIndex = index - } - }) - let fdPath = await this.prepareVideo() - await this.avPlayer.initVideoPlayer(fdPath, this.surfaceId) - if (globalThis.firstHop && globalThis.isDistributed) { - this.setCurrentTime() - } - if (globalThis.firstHop && globalThis.deviceID === "remote") { - this.dataChange() - globalThis.firstHop = false - let video = new DistributedDataModel(this.title, this.currentTime, this.SpeedIndex, this.isPlay, false) - this.kvStoreModel.put(DATA_CHANGE, JSON.stringify(video)) - } - } catch (error) { - Logger.info(TAG, `initVideo error ${JSON.stringify(error)}`) - } - } - - async prepareVideo() { - Logger.info(TAG, 'prepareVideo') - this.fd = await this.fileAsset.open('Rw') - this.ratio = this.fileAsset.width / this.fileAsset.height - this.mXComponentController.setXComponentSurfaceSize({ - surfaceWidth: this.fileAsset.width, - surfaceHeight: this.fileAsset.height - }) - this.surfaceId = this.mXComponentController.getXComponentSurfaceId() - this.isLoading = false - this.duration = this.fileAsset.duration / 1000 - return 'fd://' + this.fd - } - - async resetVideo() { - Logger.info(TAG, 'resetVideo') - if (globalThis.firstHop) { - return - } - this.SpeedIndex = 1 - this.currentTime = 0 - this.isLoading = true - await this.fileAsset.close(this.fd) - this.fileAsset = this.mediaList[this.videoIndex] - this.title = this.fileAsset.displayName.replace('.mp4', '') - this.isPlay = false - this.distributedDataSync() - let fdPath = await this.prepareVideo() - await this.avPlayer.reset(fdPath) - } - - async playVideo() { - Logger.info(TAG, 'playVideo') - if (globalThis.firstHop) { - return - } - this.avPlayer.setTimeUpdateCallBackCallBack((time: number) => { - this.currentTime = time / 1000 - }) - this.avPlayer.play() - this.isPlay = true - this.showControlBarEvent() - } - - aboutToDisappear() { - this.clearVideoPlayer() - } - - clearVideoPlayer() { - Logger.info(TAG, 'clearVideoPlayer') - if (this.avPlayer) { - this.avPlayer.stop() - this.avPlayer.release() - } - if (this.fileAsset) { - this.fileAsset.close(this.fd) - } - } - - setCurrentTime() { - Logger.info(TAG, 'setCurrentTime') - this.avPlayer.seek(this.currentTime) - this.isLoading = false - this.distributedDataSync() - } - - setSpeed() { - Logger.info(TAG, 'setSpeed') - this.avPlayer.setSpeed(this.SpeedIndex) - this.distributedDataSync() - } - - build() { - SideBarContainer(SideBarContainerType.Overlay) { - Tabs({ controller: this.tabsController }) { - TabContent() { - Scroll() { - Column({ space: 10 }) { - LazyForEach(this.mediaDataSource, (item, index) => { - localVideoItem({ media: item, videoIndex: $videoIndex, index: index, event: () => { - this.videoIndex = index - this.title = item.displayName.replace('.mp4', '') - } }) - }) - } - .constraintSize({ minHeight: '100%' }) - } - .edgeEffect(EdgeEffect.Spring) - .padding(10) - }.tabBar(this.TabBuilder(0, '本地视频')) - } - .backgroundColor('#7F000000') - .vertical(false) - .scrollable(false) - - Stack() { - XComponent({ - id: 'xComponent', - type: 'surface', - controller: this.mXComponentController - }) - .width('100%') - .aspectRatio(this.ratio) - - // 控制栏 - Column() { - TitleBar({ - title: this.title, - isLand: this.isLand, - startAbilityCallBack: this.startAbilityCallBack.bind(this), - remoteDeviceModel: this.remoteDeviceModel, - }) - - Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.SpaceEvenly, alignItems: ItemAlign.Center }) { - Image(this.isPlay ? $r("app.media.ic_pause") : $r("app.media.ic_play")) - .id("playBtn") - .width(36) - .height(36) - .flexShrink(0) - .margin({ right: 10 }) - .onClick(() => { - this.isPlay = !this.isPlay - }) - Text(toTime(this.currentTime)) - .flexShrink(0) - .fontColor(Color.White) - .maxLines(1) - .textOverflow({ overflow: TextOverflow.None }) - Slider({ - value: this.currentTime, - min: 0, - max: this.duration, - step: 1, - }) - .id("slider") - .blockColor(Color.White) - .trackColor(Color.Gray) - .selectedColor(Color.White) - .onChange((value: number, mode: SliderChangeMode) => { - this.currentTime = value - this.setCurrentTime() - }) - Text(toTime(this.duration)) - .flexShrink(0) - .fontColor(Color.White) - .maxLines(1) - .textOverflow({ overflow: TextOverflow.None }) - Select([{ value: PlaybackSpeed[0] }, - { value: PlaybackSpeed[1] }, - { value: PlaybackSpeed[2] }, - { value: PlaybackSpeed[3] }, - { value: PlaybackSpeed[4] }]) - .id("playbackSpeed") - .flexShrink(0) - .backgroundColor('#00000000') - .margin({ left: 10, right: 10 }) - .selected(this.SpeedIndex) - .value(PlaybackSpeed[this.SpeedIndex]) - .font({ size: 24 }) - .fontColor("#E5007DFF") - .selectedOptionFont({ size: 16 }) - .selectedOptionFontColor("#E5007DFF") - .optionFont({ size: 16 }) - .optionFontColor("#7F007DFF") - .onSelect((index: number, value: string) => { - Logger.info(TAG, `index ${index}`) - this.SpeedIndex = index - }) - - Image($r("app.media.ic_public_view_list")) - .id("viewList") - .width(36) - .aspectRatio(1) - .flexShrink(0) - .margin({ right: 10 }) - .onClick(() => { - this.showSideBar = !this.showSideBar - }) - } - .width('100%') - .padding({ left: 10, right: 10 }) - .linearGradient({ - direction: GradientDirection.Top, - colors: [['#CC000000', 0.0], ['#33000000', 0.66], ['#00000000', 0.99]] - }) - } - .width('100%') - .height('100%') - .justifyContent(FlexAlign.SpaceBetween) - .alignItems(HorizontalAlign.Start) - .visibility(this.controls) - - if (this.showPlaybackProgress) { - Text(toTime(this.currentTime) + '/' + toTime(this.duration)) - .fontColor(Color.White) - .padding(12) - .backgroundColor('#CC000000') - .borderRadius(8) - } - - if (this.isLoading) { - Column() { - LoadingProgress() - .height(96) - .width(96) - .color(Color.Grey) - - Text("正在加载...") - .fontColor(Color.White) - .fontFamily('HarmonyHeiTi') - .fontSize(14) - } - } - } - .id("container") - .width('100%') - .height('100%') - .backgroundColor(Color.Black) - .onClick(() => { - if (!this.showSideBar) { - this.controls = (this.controls === Visibility.Hidden) ? Visibility.Visible : Visibility.Hidden - } else { - this.showSideBar = false - } - }) - .priorityGesture( - GestureGroup(GestureMode.Exclusive, - TapGesture({ count: 2 }) - .onAction(() => { - this.isPlay = !this.isPlay - }), - PanGesture({ direction: PanDirection.Left | PanDirection.Right }) - .onActionStart((event: GestureEvent) => { - Logger.info(TAG, 'PlaybackEvent Pan start') - this.startX = event.offsetX - }) - .onActionUpdate((event: GestureEvent) => { - Logger.info(TAG, 'PlaybackEvent Pan update') - // 右滑 - if (event.offsetX - this.startX > 0) { - this.startX = event.offsetX - this.showPlaybackProgress = true - if (this.currentTime === this.duration) { - return - } else { - this.currentTime += 1 - } - } // 左滑 - else if (event.offsetX - this.startX < 0) { - this.startX = event.offsetX - this.showPlaybackProgress = true - if (this.currentTime === 0) { - return - } else { - this.currentTime -= 1 - } - } - }) - .onActionEnd(() => { - Logger.info(TAG, 'PlaybackEvent Pan end') - this.showPlaybackProgress = false - this.isLoading = true - this.setCurrentTime() - }) - ) - ) - } - .showSideBar(this.showSideBar) - .showControlButton(false) - .sideBarPosition(SideBarPosition.End) - .sideBarWidth(350) - .minSideBarWidth(200) - .maxSideBarWidth(400) - .onChange((value: boolean) => { - Logger.info('status:' + value) - }) - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/ets/pages/Settings.ets b/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/ets/pages/Settings.ets deleted file mode 100644 index 938dd663..00000000 --- a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/ets/pages/Settings.ets +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -import router from '@ohos.router'; -import preferences from '@ohos.data.preferences'; -import deviceManager from '@ohos.distributedHardware.deviceManager'; -import { RemoteDeviceModel } from '../model/RemoteDeviceModel'; -import Logger from '../model/Logger'; - -const TAG: string = 'Setting'; -const PREFERENCES_NAME = 'setting'; -let preferenceSetting: preferences.Preferences = null; - -@Entry -@Component -struct Setting { - @State deviceLists: Array = [] - @StorageLink('continuationMode') @Watch('continuationModeChange') continuationMode: string = 'continuation' - private remoteDeviceModel: RemoteDeviceModel = new RemoteDeviceModel() - - async aboutToAppear() { - preferenceSetting = await preferences.getPreferences(globalThis.context, PREFERENCES_NAME) - this.remoteDeviceModel.registerDeviceListCallback(() => { - Logger.info(TAG, 'registerDeviceListCallback, callback entered') - this.deviceLists = this.remoteDeviceModel.deviceLists - Logger.info(TAG, `deviceLists.length${this.deviceLists.length}`) - }) - } - - async continuationModeChange() { - await preferenceSetting.put('continuationMode', this.continuationMode) - await preferenceSetting.flush() - } - - build() { - Column() { - Row() { - Image($r("app.media.ic_back")) - .id("settings_back") - .width('8%') - .height('50%') - .margin({ right: 4 }) - .objectFit(ImageFit.Contain) - .onClick(() => { - router.back() - }) - - Text('设置') - .fontColor(Color.White) - .fontFamily('HarmonyHeiTi') - .fontSize(20) - .maxLines(1) - } - .width('100%') - .height('8%') - .constraintSize({ minHeight: 50 }) - .padding({ left: 10, right: 10 }) - - Row({ space: 10 }) { - Text('流转模式') - .fontColor(Color.White) - .fontFamily('HarmonyHeiTi') - .fontSize(20) - - Blank() - - Radio({ value: 'continuation', group: 'continuationMode' }) - .id("continuation") - .checked(this.continuationMode == 'continuation' ? true : false) - .height(25) - .width(25) - .onChange((isChecked: boolean) => { - if (isChecked) { - this.continuationMode = 'continuation' - } - }) - - Text('跨端迁移') - .fontColor(Color.White) - .fontFamily('HarmonyHeiTi') - .fontSize(20) - - Radio({ value: 'synchronization', group: 'continuationMode' }) - .id("synchronization") - .checked(this.continuationMode == 'synchronization' ? true : false) - .height(25) - .width(25) - .onChange((isChecked: boolean) => { - if (isChecked) { - this.continuationMode = 'synchronization' - } - }) - - Text('多端协同') - .fontColor(Color.White) - .fontFamily('HarmonyHeiTi') - .fontSize(20) - } - .width('100%') - .height(100) - .padding(10) - .borderRadius(20) - .backgroundColor('#464646') - .alignItems(VerticalAlign.Center) - - Row() { - Text('认证设备管理') - .fontSize(16) - .fontColor(Color.White) - } - .width('100%') - .padding(10) - - Scroll() { - Column() { - ForEach(this.deviceLists, (item: deviceManager.DeviceInfo) => { - Row() { - Text(item.deviceName) - .height('100%') - .fontSize(20) - .fontColor(Color.White) - .fontFamily('HarmonyHeiTi') - - Blank() - - Button('解除认证') - .onClick(() => { - this.remoteDeviceModel.unAuthenticateDevice(item) - }) - } - .width('100%') - .height(80) - .padding(10) - .borderRadius(20) - .backgroundColor('#464646') - .alignItems(VerticalAlign.Center) - }) - } - .constraintSize({ minHeight: '100%' }) - } - } - .width('100%') - .height('100%') - .padding(10) - .backgroundColor('#7F000000') - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/ets/utils/AVPlayerUtils.ets b/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/ets/utils/AVPlayerUtils.ets deleted file mode 100644 index 3f908cfd..00000000 --- a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/ets/utils/AVPlayerUtils.ets +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -import media from '@ohos.multimedia.media'; -import Logger from '../model/Logger'; - -const TAG: string = 'AVPlayerUtils'; - -export default class AVPlayerUtils { - private avPlayer: media.AVPlayer = undefined - private avPlayerState: string = '' - private playPath: string = '' - private timeUpdateCallBack: (time: number) => void = undefined - - async initVideoPlayer(playSrc: string, surfaceID: string) { - await this.release() - this.playPath = playSrc - // 创建avPlayer实例对象 - this.avPlayer = await media.createAVPlayer() - Logger.info(TAG, 'createVideoPlayer') - // 创建状态机变化回调函数 - this.setAVPlayerCallback(); - this.avPlayer.url = this.playPath - Logger.info(TAG, 'this.avPlayer.url' + this.avPlayer.url) - this.avPlayer.on('timeUpdate', (time: number) => { - Logger.info(TAG, 'timeUpdate success,and new time is :' + time) - if (this.timeUpdateCallBack) { - this.timeUpdateCallBack(time) - } - }); - this.avPlayer.surfaceId = surfaceID - Logger.info(TAG, 'setDisplaySurface') - await this.avPlayer.prepare(); - Logger.info(TAG, 'init VideoPlayer finish') - } - - // 注册avplayer回调函数 - setAVPlayerCallback() { - // seek操作结果回调函数 - this.avPlayer.on('seekDone', (seekDoneTime: number) => { - Logger.info(TAG, `AVPlayer seek succeeded, seek time is ${seekDoneTime}`); - }) - // error回调监听函数,当avPlayer在操作过程中出现错误时调用 reset接口触发重置流程 - this.avPlayer.on('error', err => { - Logger.error(TAG, `Invoke avPlayer failed, code is ${err.code}, message is ${err.message}`); - this.avPlayer.reset(); // 调用reset重置资源,触发idle状态 - }) - // 状态机变化回调函数 - this.avPlayer.on('stateChange', async (state: string, reason: media.StateChangeReason) => { - switch (state) { - case 'idle': // 成功调用reset接口后触发该状态机上报 - Logger.info(TAG, 'AVPlayer state idle called.'); - this.avPlayerState = 'idle'; - this.avPlayer.release(); // 调用release接口销毁实例对象 - break; - case 'initialized': // avplayer 设置播放源后触发该状态上报 - Logger.info(TAG, 'AVPlayer state initialized called.'); - this.avPlayerState = 'initialized'; - break; - case 'prepared': // prepare调用成功后上报该状态机 - Logger.info(TAG, 'AVPlayer state prepared called.'); - this.avPlayerState = 'prepared'; - break; - case 'playing': // play成功调用后触发该状态机上报 - Logger.info(TAG, 'AVPlayer state playing called.'); - this.avPlayerState = 'playing'; - break; - case 'paused': // pause成功调用后触发该状态机上报 - Logger.info(TAG, 'AVPlayer state paused called.'); - this.avPlayerState = 'paused'; - break; - case 'completed': // 播放结束后触发该状态机上报 - Logger.info(TAG, 'AVPlayer state completed called.'); - this.avPlayerState = 'completed'; - break; - case 'stopped': // stop接口成功调用后触发该状态机上报 - Logger.info(TAG, 'AVPlayer state stopped called.'); - this.avPlayerState = 'stopped'; - break; - case 'released': - Logger.info(TAG, 'AVPlayer state released called.'); - this.avPlayerState = 'released'; - break; - default: - Logger.info(TAG, 'AVPlayer state unknown called.'); - break; - } - }) - } - - async play() { - Logger.info(TAG, 'play') - if (typeof (this.avPlayer) != 'undefined') { - await this.avPlayer.play() - } - } - - async seek(time: number) { - Logger.info(TAG, 'seek') - if (typeof (this.avPlayer) != 'undefined' && - (this.avPlayerState === 'prepared' || this.avPlayerState === 'playing' || this.avPlayerState === 'paused' || this.avPlayerState === 'completed')) { - this.avPlayer.seek(time * 1000) - } - } - - async setSpeed(speed: media.PlaybackSpeed) { - Logger.info(TAG, 'setSpeed') - if (typeof (this.avPlayer) != 'undefined') { - this.avPlayer.setSpeed(speed) - } - } - - async pause() { - Logger.info(TAG, 'pause') - if (typeof (this.avPlayer) != 'undefined') { - await this.avPlayer.pause() - } - } - - async stop() { - Logger.info(TAG, 'stop') - if (typeof (this.avPlayer) != 'undefined') { - await this.avPlayer.stop() - } - } - - async reset(playSrc: string) { - Logger.info(TAG, 'reset') - if (typeof (this.avPlayer) != 'undefined') { - this.playPath = playSrc - await this.avPlayer.reset() - this.avPlayer.url = this.playPath - await this.avPlayer.prepare() - } - } - - async release() { - Logger.info(TAG, 'release') - if (typeof (this.avPlayer) != 'undefined') { - await this.avPlayer.release() - Logger.info(TAG, 'release success') - } - } - - setTimeUpdateCallBackCallBack(callback) { - this.timeUpdateCallBack = callback - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/ets/utils/DateTimeUtil.ets b/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/ets/utils/DateTimeUtil.ets deleted file mode 100644 index 0836cd6c..00000000 --- a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/ets/utils/DateTimeUtil.ets +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -/** - * @file 日期工具 - */ -export default class DateTimeUtil { - - /** - * 时分秒 - */ - getTime() { - const DATETIME = new Date() - return this.concatTime(DATETIME.getHours(), DATETIME.getMinutes(), DATETIME.getSeconds()) - } - - /** - * 年月日 - */ - getDate() { - const DATETIME = new Date() - return this.concatDate(DATETIME.getFullYear(), DATETIME.getMonth() + 1, DATETIME.getDate()) - } - - /** - * 日期不足两位补充0 - * @param value-数据值 - */ - fill(value: number) { - return (value > 9 ? '' : '0') + value - } - - /** - * 年月日格式修饰 - * @param year - * @param month - * @param date - */ - concatDate(year: number, month: number, date: number) { - return `${year}${this.fill(month)}${this.fill(date)}` - } - - /** - * 时分秒格式修饰 - * @param hours - * @param minutes - * @param seconds - */ - concatTime(hours: number, minutes: number, seconds: number) { - return `${this.fill(hours)}${this.fill(minutes)}${this.fill(seconds)}` - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/ets/utils/MediaUtils.ets b/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/ets/utils/MediaUtils.ets deleted file mode 100644 index b9b150be..00000000 --- a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/ets/utils/MediaUtils.ets +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -import image from '@ohos.multimedia.image'; -import fileio from '@ohos.fileio'; -import promptAction from '@ohos.promptAction'; -import mediaLibrary from '@ohos.multimedia.mediaLibrary'; -import Logger from '../model/Logger'; -import DateTimeUtil from './DateTimeUtil'; - -const TAG: string = 'MediaUtils'; - -export default class MediaUtils { - private mediaList: Array = [] - private mediaLib: mediaLibrary.MediaLibrary = undefined - - constructor() { - this.mediaLib = mediaLibrary.getMediaLibrary(globalThis.context) - } - - async createAndGetFile() { - let mediaTest = mediaLibrary.getMediaLibrary(globalThis.context) - let info = { - prefix: 'IMG_', suffix: '.jpg', directory: mediaLibrary.DirectoryType.DIR_IMAGE - } - let dateTimeUtil = new DateTimeUtil() - let name = `${dateTimeUtil.getDate()}_${dateTimeUtil.getTime()}` - let displayName = `${info.prefix}${name}${info.suffix}` - let publicPath = await mediaTest.getPublicDirectory(info.directory) - Logger.info(TAG, `publicPath = ${publicPath}`) - return await mediaTest.createAsset(mediaLibrary.MediaType.IMAGE, displayName, publicPath) - } - - async savePicture(data) { - Logger.info(TAG, `savePicture`) - let packOpts: image.PackingOption = { - format: "image/jpeg", quality: 100 - } - let imagePackerApi = image.createImagePacker() - let arrayBuffer = await imagePackerApi.packing(data, packOpts) - let fileAsset = await this.createAndGetFile() - let fd = await fileAsset.open('Rw') - imagePackerApi.release() - try { - await fileio.write(fd, arrayBuffer) - } catch (err) { - Logger.error(`write failed, code is ${err.code}, message is ${err.message}`) - } - await fileAsset.close(fd) - Logger.info(TAG, `write done`) - promptAction.showToast({ - message: '图片保存成功', duration: 1000 - }) - } - - async getFileAssetsFromType(mediaType: number) { - Logger.info(TAG, `getFileAssetsFromType,mediaType = ${mediaType}`) - let fileKeyObj = mediaLibrary.FileKey - let fetchOp = { - selections: `${fileKeyObj.MEDIA_TYPE}=?`, - selectionArgs: [`${mediaType}`], - } - let fetchFileResult = await this.mediaLib.getFileAssets(fetchOp) - Logger.info(TAG, `getFileAssetsFromType,fetchFileResult.count = ${fetchFileResult.getCount()}`) - if (fetchFileResult.getCount() > 0) { - this.mediaList = await fetchFileResult.getAllObject() - Logger.info(TAG, `getFileAssetsFromType,fetchFileResult.count = ${JSON.stringify(this.mediaList)}`) - } - return this.mediaList - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/ets/utils/utils.ets b/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/ets/utils/utils.ets deleted file mode 100644 index 5eb254a6..00000000 --- a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/ets/utils/utils.ets +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -export function toTime(Number: number): string { - let hour: number - let minute: number - let second: number - hour = Number / 3600 | 0 - minute = Number / 60 % 60 | 0 - second = Number % 60 | 0 - if (hour > 0) { - return (hour < 10 ? '0' + hour : hour.toString()) + ":" + (minute < 10 ? '0' + minute : minute.toString()) + ":" + (second < 10 ? '0' + second : second.toString()) - } else { - return (minute < 10 ? '0' + minute : minute.toString()) + ":" + (second < 10 ? '0' + second : second.toString()) - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/module.json5 b/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/module.json5 deleted file mode 100644 index 089b6211..00000000 --- a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/module.json5 +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -{ - "module": { - "name": "entry", - "type": "entry", - "description": "$string:module_desc", - "mainElement": "EntryAbility", - "deviceTypes": [ - "default" - ], - "deliveryWithInstall": true, - "installationFree": false, - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "EntryAbility", - "srcEntry": "./ets/entryability/EntryAbility.ts", - "description": "$string:EntryAbility_desc", - "icon": "$media:icon", - "label": "$string:EntryAbility_label", - "startWindowIcon": "$media:icon", - "startWindowBackground": "$color:start_window_background", - "exported": true, - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ] - } - ], - "requestPermissions": [ - { - "name": "ohos.permission.DISTRIBUTED_DATASYNC", - "reason": "$string:distributed_permission", - "usedScene": { - "abilities": [ - "EntryAbility" - ], - "when": "inuse" - } - }, - { - "name": "ohos.permission.CAPTURE_SCREEN" - }, - { - "name": "ohos.permission.READ_MEDIA", - "reason": "$string:media_reason", - "usedScene": { - "abilities": [ - "EntryAbility" - ], - "when": "inuse" - } - }, - { - "name": "ohos.permission.WRITE_MEDIA", - "reason": "$string:media_reason", - "usedScene": { - "abilities": [ - "EntryAbility" - ], - "when": "inuse" - } - } - ] - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/resources/base/element/color.json b/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962..00000000 --- a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/resources/base/element/string.json b/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 948c841e..00000000 --- a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "DistributedVideoPlayer" - }, - { - "name": "choiceDevice", - "value": "choiceDevice" - }, - { - "name": "cancel", - "value": "cancel" - }, - { - "name": "distributed_permission", - "value": "Allow data exchange between different devices" - }, - { - "name": "media_reason", - "value": "Allows applications to read media files from external storage" - } - ] -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/resources/base/media/checked.png b/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/resources/base/media/checked.png deleted file mode 100644 index a77ded51..00000000 Binary files a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/resources/base/media/checked.png and /dev/null differ diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/resources/base/media/ic_back.png b/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/resources/base/media/ic_back.png deleted file mode 100644 index 650fa22d..00000000 Binary files a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/resources/base/media/ic_back.png and /dev/null differ diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/resources/base/media/ic_controlcenter_screenshot_filled.png b/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/resources/base/media/ic_controlcenter_screenshot_filled.png deleted file mode 100644 index 854cdfec..00000000 Binary files a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/resources/base/media/ic_controlcenter_screenshot_filled.png and /dev/null differ diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/resources/base/media/ic_gallery_full_screen.png b/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/resources/base/media/ic_gallery_full_screen.png deleted file mode 100644 index aa34e066..00000000 Binary files a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/resources/base/media/ic_gallery_full_screen.png and /dev/null differ diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/resources/base/media/ic_hop.png b/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/resources/base/media/ic_hop.png deleted file mode 100644 index c5517e48..00000000 Binary files a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/resources/base/media/ic_hop.png and /dev/null differ diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/resources/base/media/ic_pause.png b/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/resources/base/media/ic_pause.png deleted file mode 100644 index b2b1e3fc..00000000 Binary files a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/resources/base/media/ic_pause.png and /dev/null differ diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/resources/base/media/ic_play.png b/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/resources/base/media/ic_play.png deleted file mode 100644 index 40280c25..00000000 Binary files a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/resources/base/media/ic_play.png and /dev/null differ diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/resources/base/media/ic_public_view_list.png b/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/resources/base/media/ic_public_view_list.png deleted file mode 100644 index 39646fda..00000000 Binary files a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/resources/base/media/ic_public_view_list.png and /dev/null differ diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/resources/base/media/ic_settings.png b/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/resources/base/media/ic_settings.png deleted file mode 100644 index 9813d442..00000000 Binary files a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/resources/base/media/ic_settings.png and /dev/null differ diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/resources/base/media/icon.png b/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index c394496f..00000000 Binary files a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/resources/base/media/uncheck.png b/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/resources/base/media/uncheck.png deleted file mode 100644 index cba71b7e..00000000 Binary files a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/resources/base/media/uncheck.png and /dev/null differ diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/resources/base/profile/main_pages.json b/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index cd55405b..00000000 --- a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "src": [ - "pages/Index", - "pages/Settings" - ] -} diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/resources/en_US/element/string.json b/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/resources/en_US/element/string.json deleted file mode 100644 index 948c841e..00000000 --- a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/resources/en_US/element/string.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "DistributedVideoPlayer" - }, - { - "name": "choiceDevice", - "value": "choiceDevice" - }, - { - "name": "cancel", - "value": "cancel" - }, - { - "name": "distributed_permission", - "value": "Allow data exchange between different devices" - }, - { - "name": "media_reason", - "value": "Allows applications to read media files from external storage" - } - ] -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/resources/zh_CN/element/string.json b/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/resources/zh_CN/element/string.json deleted file mode 100644 index 937e3eb2..00000000 --- a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/resources/zh_CN/element/string.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "模块描述" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "分布式视频播放器" - }, - { - "name": "choiceDevice", - "value": "选择设备" - }, - { - "name": "cancel", - "value": "取消" - }, - { - "name": "distributed_permission", - "value": "用于分布式视频播放器进行不同设备间的数据交换" - }, - { - "name": "media_reason", - "value": "用于分布式视频播放器访问用户媒体文件中的地理位置信息" - } - ] -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/ohosTest/ets/test/Ability.test.ets b/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index 52757407..00000000 --- a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,398 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' -import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; -import { Driver, ON } from '@ohos.UiTest'; -import resourceManager from '@ohos.resourceManager'; -import Logger from '../../../main/ets/model/Logger'; - -const BUNDLE = 'DistributedVideoPlayer_'; - -const DELAY_TIME = 1000; -const DELAY_TIME_FiVE = 500; -let driver: Driver = Driver.create(); - -// 获取AbilityDelegator -let abilityDelegatorRegistry = AbilityDelegatorRegistry.getAbilityDelegator(); -// 启动后获取app上下文 -let context: Context; -// 启动后获取resourceManager -let manager: resourceManager.ResourceManager; - -// 通过 resource 验证有没有这个组件 有的话点击一下 -async function checkButtonAndClickWithTextByResource(text: Resource) { - let atom: string = await manager.getStringValue(text); - await driver.assertComponentExist(ON.text(atom)); - let button = await driver.findComponent(ON.text(atom)); - await button.click(); - await driver.delayMs(DELAY_TIME_FiVE); - Logger.info(BUNDLE + atom); -} - -// 通过 ID 滑动 slider -async function drawSliderWithId(text: string) { - let atom = text; - await driver.assertComponentExist(ON.id(atom)); - let slider = await driver.findComponent(ON.id(atom)); - let rect = await slider.getBoundsCenter(); - await driver.drag(rect.x - 100, rect.y, rect.x + 100, rect.y, 800) - await driver.delayMs(DELAY_TIME_FiVE); - Logger.info(BUNDLE + atom); -} - -// 通过text验证有没有这个组件 有的话点击一下 -async function checkButtonAndClickWithText(text: string) { - let atom = text; - await driver.assertComponentExist(ON.text(atom)); - let button = await driver.findComponent(ON.text(atom)); - await button.click(); - await driver.delayMs(DELAY_TIME); - Logger.info(BUNDLE + atom); -} - -// 通过id验证有没有这个组件 有的话点击一下 -async function checkButtonAndClickWithID(text: string) { - let atom = text; - await driver.assertComponentExist(ON.id(atom)); - let button = await driver.findComponent(ON.id(atom)); - await button.click(); - await driver.delayMs(DELAY_TIME_FiVE); - Logger.info(BUNDLE + atom); -} - -// 通过id验证有没有这个组件 有的话点击一下 -async function checkButtonAndDoubleClickWithID(text: string) { - let atom = text; - await driver.assertComponentExist(ON.id(atom)); - let button = await driver.findComponent(ON.id(atom)); - await button.doubleClick(); - await driver.delayMs(DELAY_TIME_FiVE); - Logger.info(BUNDLE + atom); -} - -// 展开Select并选择 -async function clickSelectIDAndSelectText(toggleId: string, selectText: string) { - { //展开 - let atom = toggleId; - await checkButtonAndClickWithID(atom); - } - { //选择 - let atom = selectText; - await checkButtonAndClickWithText(atom); - } -} - -export default function abilityTest() { - describe('ActsAbilityTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }) - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }) - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }) - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }) - it("assertContain", 0, () => { - - Logger.info("Sample_DistributedVideoPlayer test start") - /** - * 打开应用 - */ - it(BUNDLE + 'StartAbility_001', 0, async (done: Function) => { - let testName = 'StartAbility'; - Logger.info(BUNDLE + testName + ' begin'); - let abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - try { - await abilityDelegator.startAbility({ - bundleName: 'com.unionman.distributedvideoplayer', - abilityName: 'EntryAbility' - }) - - context = abilityDelegatorRegistry.getAppContext(); - manager = context.resourceManager; - - done(); - } catch (exception) { - Logger.info(BUNDLE, `StartAbility_001 end ${JSON.stringify(exception)}`); - expect(0).assertEqual(exception.code); - done(); - } - Logger.info(BUNDLE + testName + ' end'); - }) - - /** - * 获取权限 - */ - it(BUNDLE + 'RequestPermissionFunction_001', 0, async () => { - let testName = 'RequestPermissionFunction'; - Logger.info(BUNDLE + testName + ' begin'); - await driver.delayMs(DELAY_TIME); - - // 获取多设备协同权限 - await checkButtonAndClickWithTextByResource($r('app.string.permit')); - // 获取文件读写权限 - await checkButtonAndClickWithTextByResource($r('app.string.permit')); - Logger.info(BUNDLE + testName + ' end'); - }) - - /** - * 关闭应用 - */ - it(BUNDLE + 'StopAbility_001', 0, async (done: Function) => { - let testName = 'StopAbility'; - Logger.info(BUNDLE + testName + ' begin'); - try { - await checkButtonAndClickWithID("back"); - await driver.delayMs(DELAY_TIME); - - done(); - } catch (exception) { - Logger.info(BUNDLE, `StopAbility_001 end ${JSON.stringify(exception)}`); - expect(0).assertEqual(exception.code); - done(); - } - Logger.info(BUNDLE + testName + ' end'); - }) - - /** - * 打开应用 - */ - it(BUNDLE + 'StartAbility_002', 0, async (done: Function) => { - let testName = 'StartAbility'; - Logger.info(BUNDLE + testName + ' begin'); - let abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - try { - await abilityDelegator.startAbility({ - bundleName: 'com.unionman.distributedvideoplayer', - abilityName: 'EntryAbility' - }) - - done(); - } catch (exception) { - Logger.info(BUNDLE, `StartAbility_002 end ${JSON.stringify(exception)}`); - expect(0).assertEqual(exception.code); - done(); - } - Logger.info(BUNDLE + testName + ' end'); - }) - - /** - * 单击播放按钮 - */ - it(BUNDLE + 'PlayVideo_001', 0, async () => { - let testName = 'PlayVideo'; - Logger.info(BUNDLE + testName + ' begin'); - await driver.delayMs(DELAY_TIME); - - // 播放 - await checkButtonAndClickWithID('playBtn'); - await driver.delayMs(DELAY_TIME); - - // 暂停 - await checkButtonAndClickWithID('playBtn'); - await driver.delayMs(DELAY_TIME); - - Logger.info(BUNDLE + testName + ' end'); - }); - - /** - * 双击页面 - */ - it(BUNDLE + 'PlayVideo_002', 0, async () => { - let testName = 'PlayVideo'; - Logger.info(BUNDLE + testName + ' begin'); - - // 播放 - await checkButtonAndDoubleClickWithID('container'); - await driver.delayMs(DELAY_TIME); - - // 暂停 - await checkButtonAndDoubleClickWithID('container'); - await driver.delayMs(DELAY_TIME); - - // 播放 - await checkButtonAndDoubleClickWithID('container'); - await driver.delayMs(DELAY_TIME); - - Logger.info(BUNDLE + testName + ' end'); - }); - - /** - * 滑动Slider进度条 - */ - it(BUNDLE + 'Slider_001', 0, async () => { - let testName = 'Slider'; - Logger.info(BUNDLE + testName + ' begin'); - - await drawSliderWithId("slider"); - await driver.delayMs(DELAY_TIME); - - Logger.info(BUNDLE + testName + ' end'); - }); - - /** - * 左右滑动屏幕 - */ - it(BUNDLE + 'Swipe_001', 0, async () => { - let testName = 'Swipe'; - Logger.info(BUNDLE + testName + ' begin'); - - // 左滑 - await driver.swipe(500, 200, 200, 200, 600); - await driver.delayMs(DELAY_TIME); - - // 右滑 - await driver.swipe(200, 200, 500, 200, 600); - await driver.delayMs(DELAY_TIME); - - Logger.info(BUNDLE + testName + ' end'); - }); - - /** - * 调整倍速 - */ - it(BUNDLE + 'PlaybackSpeed_001', 0, async () => { - let testName = 'PlaybackSpeed'; - Logger.info(BUNDLE + testName + ' begin'); - - // 单击屏幕显示控制栏 - await checkButtonAndClickWithID('container'); - await driver.delayMs(DELAY_TIME); - - // 选择2.0X倍速 - await clickSelectIDAndSelectText('playbackSpeed', '2.0X'); - await driver.delayMs(DELAY_TIME); - - // 单击屏幕显示控制栏 - await checkButtonAndClickWithID('container'); - - // 选择0.75X倍速 - await clickSelectIDAndSelectText('playbackSpeed', '0.75X'); - await driver.delayMs(DELAY_TIME); - - Logger.info(BUNDLE + testName + ' end'); - }); - - /** - * 展开视频列表 - */ - it(BUNDLE + 'ShwoVideoList_001', 0, async () => { - let testName = 'ShwoVideoList'; - Logger.info(BUNDLE + testName + ' begin'); - await driver.delayMs(DELAY_TIME); - - // 单击屏幕显示控制栏 - await checkButtonAndClickWithID('container'); - await driver.delayMs(DELAY_TIME); - - // 点击展开视频列表 - await checkButtonAndClickWithID("viewList"); - await driver.delayMs(DELAY_TIME); - - // 单击隐藏视频列表 固定坐标只支持UnionPi-Tiger,其他设备需要调整 - await driver.click(200, 200); - await driver.delayMs(DELAY_TIME); - - Logger.info(BUNDLE + testName + ' end'); - }); - - /** - * 截图 - */ - it(BUNDLE + 'Screenshot_001', 0, async () => { - let testName = 'Screenshot'; - Logger.info(BUNDLE + testName + ' begin'); - await driver.delayMs(DELAY_TIME); - - // 单击屏幕显示控制栏 - await checkButtonAndClickWithID('container'); - await driver.delayMs(DELAY_TIME); - - // 单击截图图标 - await checkButtonAndClickWithID('screenshot'); - await driver.delayMs(DELAY_TIME); - - // 单击隐藏截图窗口 固定坐标只支持UnionPi-Tiger,其他设备需要调整 - await driver.click(800, 200); - await driver.delayMs(DELAY_TIME); - - Logger.info(BUNDLE + testName + ' end'); - }); - - /** - * 测试选择设备弹窗是否能正常弹出 - */ - it(BUNDLE + 'ShwoDeviceDialog_001', 0, async () => { - let testName = 'ShwoDeviceDialog'; - Logger.info(BUNDLE + testName + ' begin'); - await driver.delayMs(DELAY_TIME); - - // 单击屏幕显示控制栏 - await checkButtonAndClickWithID('container'); - await driver.delayMs(DELAY_TIME); - - // 单击流转图标 - await checkButtonAndClickWithID('hop'); - await driver.delayMs(DELAY_TIME); - - // 点击取消 - await checkButtonAndClickWithTextByResource($r('app.string.cancel')); - await driver.delayMs(DELAY_TIME); - - Logger.info(BUNDLE + testName + ' end'); - }); - - /** - * 设置流转模式 - */ - it(BUNDLE + 'SetContinuationMode_001', 0, async () => { - let testName = 'SetContinuationMode'; - Logger.info(BUNDLE + testName + ' begin'); - await driver.delayMs(DELAY_TIME); - - // 单击屏幕显示控制栏 - await checkButtonAndClickWithID('container'); - await driver.delayMs(DELAY_TIME); - - // 单击设置图标 - await checkButtonAndClickWithID('settings'); - await driver.delayMs(DELAY_TIME); - - // 选择多端协同模式 - await checkButtonAndClickWithID('synchronization'); - await driver.delayMs(DELAY_TIME); - - // 返回 - await checkButtonAndClickWithID('settings_back'); - await driver.delayMs(DELAY_TIME); - - Logger.info(BUNDLE + testName + ' end'); - }); - }) - }) -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/ohosTest/ets/test/List.test.ets b/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 5b03e231..00000000 --- a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -import abilityTest from './Ability.test' - -export default function testsuite() { - abilityTest() -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/ohosTest/ets/testability/TestAbility.ets b/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/ohosTest/ets/testability/TestAbility.ets deleted file mode 100644 index 07751d2a..00000000 --- a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/ohosTest/ets/testability/TestAbility.ets +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -import UIAbility from '@ohos.app.ability.UIAbility'; -import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; -import hilog from '@ohos.hilog'; -import { Hypium } from '@ohos/hypium'; -import testsuite from '../test/List.test'; -import window from '@ohos.window'; - -export default class TestAbility extends UIAbility { - onCreate(want, launchParam) { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onCreate'); - hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? ''); - hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:' + JSON.stringify(launchParam) ?? ''); - var abilityDelegator: any - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments: any - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - hilog.info(0x0000, 'testTag', '%{public}s', 'start run testcase!!!'); - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - } - - onDestroy() { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage) { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageCreate'); - windowStage.loadContent('testability/pages/Index', (err, data) => { - if (err.code) { - hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); - return; - } - hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', - JSON.stringify(data) ?? ''); - }); - } - - onWindowStageDestroy() { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageDestroy'); - } - - onForeground() { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onForeground'); - } - - onBackground() { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onBackground'); - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/ohosTest/ets/testability/pages/Index.ets b/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/ohosTest/ets/testability/pages/Index.ets deleted file mode 100644 index c0a72d47..00000000 --- a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/ohosTest/ets/testability/pages/Index.ets +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -import hilog from '@ohos.hilog'; - -@Entry -@Component -struct Index { - aboutToAppear() { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility index aboutToAppear'); - } - - @State message: string = 'Hello World' - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - Button() { - Text('next page') - .fontSize(20) - .fontWeight(FontWeight.Bold) - } - .type(ButtonType.Capsule) - .margin({ - top: 20 - }) - .backgroundColor('#0D9FFB') - .width('35%') - .height('5%') - .onClick(() => { - }) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ts b/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ts deleted file mode 100644 index 25af7aac..00000000 --- a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ts +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import hilog from '@ohos.hilog'; -import TestRunner from '@ohos.application.testRunner'; -import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; - -var abilityDelegator = undefined -var abilityDelegatorArguments = undefined - -async function onAbilityCreateCallback() { - hilog.info(0x0000, 'testTag', '%{public}s', 'onAbilityCreateCallback'); -} - -async function addAbilityMonitorCallback(err: any) { - hilog.info(0x0000, 'testTag', 'addAbilityMonitorCallback : %{public}s', JSON.stringify(err) ?? ''); -} - -export default class OpenHarmonyTestRunner implements TestRunner { - constructor() { - } - - onPrepare() { - hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner OnPrepare '); - } - - async onRun() { - hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun run'); - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility' - let lMonitor = { - abilityName: testAbilityName, - onAbilityCreate: onAbilityCreateCallback, - }; - abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) - var cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName - var debug = abilityDelegatorArguments.parameters['-D'] - if (debug == 'true') { - cmd += ' -D' - } - hilog.info(0x0000, 'testTag', 'cmd : %{public}s', cmd); - abilityDelegator.executeShellCommand(cmd, - (err: any, d: any) => { - hilog.info(0x0000, 'testTag', 'executeShellCommand : err : %{public}s', JSON.stringify(err) ?? ''); - hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.stdResult ?? ''); - hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.exitCode ?? ''); - }) - hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun end'); - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/ohosTest/module.json5 b/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/ohosTest/module.json5 deleted file mode 100644 index 8b6d86d4..00000000 --- a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -{ - "module": { - "name": "entry_test", - "type": "feature", - "description": "$string:module_test_desc", - "mainElement": "TestAbility", - "deviceTypes": [ - "default" - ], - "deliveryWithInstall": true, - "installationFree": false, - "pages": "$profile:test_pages", - "abilities": [ - { - "name": "TestAbility", - "srcEntry": "./ets/testability/TestAbility.ets", - "description": "$string:TestAbility_desc", - "icon": "$media:icon", - "label": "$string:TestAbility_label", - "exported": true, - "startWindowIcon": "$media:icon", - "startWindowBackground": "$color:start_window_background", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - } - ] - } - ] - } -} diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/ohosTest/resources/base/element/color.json b/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/ohosTest/resources/base/element/color.json deleted file mode 100644 index 3c712962..00000000 --- a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/ohosTest/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/ohosTest/resources/base/element/string.json b/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/ohosTest/resources/base/element/string.json deleted file mode 100644 index 1c6c33bc..00000000 --- a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/ohosTest/resources/base/element/string.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "string": [ - { - "name": "module_test_desc", - "value": "test ability description" - }, - { - "name": "TestAbility_desc", - "value": "the test ability" - }, - { - "name": "TestAbility_label", - "value": "test label" - }, - { - "name": "permit", - "value": "permit" - }, - { - "name": "cancel", - "value": "cancel" - } - ] -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/ohosTest/resources/base/media/icon.png b/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/ohosTest/resources/base/media/icon.png deleted file mode 100644 index ce307a88..00000000 Binary files a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/ohosTest/resources/base/media/icon.png and /dev/null differ diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/ohosTest/resources/base/profile/test_pages.json b/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/ohosTest/resources/base/profile/test_pages.json deleted file mode 100644 index b7e7343c..00000000 --- a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/ohosTest/resources/base/profile/test_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "testability/pages/Index" - ] -} diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/ohosTest/resources/en/element/string.json b/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/ohosTest/resources/en/element/string.json deleted file mode 100644 index 1c6c33bc..00000000 --- a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/ohosTest/resources/en/element/string.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "string": [ - { - "name": "module_test_desc", - "value": "test ability description" - }, - { - "name": "TestAbility_desc", - "value": "the test ability" - }, - { - "name": "TestAbility_label", - "value": "test label" - }, - { - "name": "permit", - "value": "permit" - }, - { - "name": "cancel", - "value": "cancel" - } - ] -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/ohosTest/resources/zh/element/string.json b/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/ohosTest/resources/zh/element/string.json deleted file mode 100644 index 1757b7ee..00000000 --- a/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/ohosTest/resources/zh/element/string.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "string": [ - { - "name": "module_test_desc", - "value": "test ability description" - }, - { - "name": "TestAbility_desc", - "value": "the test ability" - }, - { - "name": "TestAbility_label", - "value": "test label" - }, - { - "name": "permit", - "value": "允许" - }, - { - "name": "cancel", - "value": "取消" - } - ] -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/hvigor/hvigor-config.json5 b/unionpi_tiger/sample/app/DistributedVideoPlayer/hvigor/hvigor-config.json5 deleted file mode 100644 index e5bf1bf2..00000000 --- a/unionpi_tiger/sample/app/DistributedVideoPlayer/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,6 +0,0 @@ -{ - "hvigorVersion": "2.1.1", - "dependencies": { - "@ohos/hvigor-ohos-plugin": "2.1.1" - } -} diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/hvigor/hvigor-wrapper.js b/unionpi_tiger/sample/app/DistributedVideoPlayer/hvigor/hvigor-wrapper.js deleted file mode 100644 index 994f2298..00000000 --- a/unionpi_tiger/sample/app/DistributedVideoPlayer/hvigor/hvigor-wrapper.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict";var e=require("fs"),t=require("path"),n=require("os"),r=require("crypto"),u=require("child_process"),o=require("constants"),i=require("stream"),s=require("util"),c=require("assert"),a=require("tty"),l=require("zlib"),f=require("net");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var D=d(e),p=d(t),E=d(n),m=d(r),h=d(u),y=d(o),C=d(i),F=d(s),g=d(c),A=d(a),v=d(l),S=d(f),w="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},O={},b={},_={},B=w&&w.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_,"__esModule",{value:!0}),_.isMac=_.isLinux=_.isWindows=void 0;const P=B(E.default),k="Windows_NT",x="Linux",N="Darwin";_.isWindows=function(){return P.default.type()===k},_.isLinux=function(){return P.default.type()===x},_.isMac=function(){return P.default.type()===N};var I={},T=w&&w.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),R=w&&w.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),M=w&&w.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&T(t,e,n);return R(t,e),t};Object.defineProperty(I,"__esModule",{value:!0}),I.hash=void 0;const L=M(m.default);I.hash=function(e,t="md5"){return L.createHash(t).update(e,"utf-8").digest("hex")},function(e){var t=w&&w.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=w&&w.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=w&&w.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var u in e)"default"!==u&&Object.prototype.hasOwnProperty.call(e,u)&&t(r,e,u);return n(r,e),r};Object.defineProperty(e,"__esModule",{value:!0}),e.HVIGOR_BOOT_JS_FILE_PATH=e.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH=e.HVIGOR_PROJECT_DEPENDENCIES_HOME=e.HVIGOR_PROJECT_WRAPPER_HOME=e.HVIGOR_PROJECT_NAME=e.HVIGOR_PROJECT_ROOT_DIR=e.HVIGOR_PROJECT_CACHES_HOME=e.HVIGOR_PNPM_STORE_PATH=e.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH=e.HVIGOR_WRAPPER_TOOLS_HOME=e.HVIGOR_USER_HOME=e.DEFAULT_PACKAGE_JSON=e.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME=e.PNPM=e.HVIGOR=e.NPM_TOOL=e.PNPM_TOOL=e.HVIGOR_ENGINE_PACKAGE_NAME=void 0;const u=r(p.default),o=r(E.default),i=_,s=I;e.HVIGOR_ENGINE_PACKAGE_NAME="@ohos/hvigor",e.PNPM_TOOL=(0,i.isWindows)()?"pnpm.cmd":"pnpm",e.NPM_TOOL=(0,i.isWindows)()?"npm.cmd":"npm",e.HVIGOR="hvigor",e.PNPM="pnpm",e.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME="hvigor-config.json5",e.DEFAULT_PACKAGE_JSON="package.json",e.HVIGOR_USER_HOME=u.resolve(o.homedir(),".hvigor"),e.HVIGOR_WRAPPER_TOOLS_HOME=u.resolve(e.HVIGOR_USER_HOME,"wrapper","tools"),e.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH=u.resolve(e.HVIGOR_WRAPPER_TOOLS_HOME,"node_modules",".bin",e.PNPM_TOOL),e.HVIGOR_PNPM_STORE_PATH=u.resolve(e.HVIGOR_USER_HOME,"caches"),e.HVIGOR_PROJECT_CACHES_HOME=u.resolve(e.HVIGOR_USER_HOME,"project_caches"),e.HVIGOR_PROJECT_ROOT_DIR=process.cwd(),e.HVIGOR_PROJECT_NAME=u.basename((0,s.hash)(e.HVIGOR_PROJECT_ROOT_DIR)),e.HVIGOR_PROJECT_WRAPPER_HOME=u.resolve(e.HVIGOR_PROJECT_ROOT_DIR,e.HVIGOR),e.HVIGOR_PROJECT_DEPENDENCIES_HOME=u.resolve(e.HVIGOR_PROJECT_CACHES_HOME,e.HVIGOR_PROJECT_NAME,"workspace"),e.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH=u.resolve(e.HVIGOR_PROJECT_DEPENDENCIES_HOME,e.DEFAULT_PACKAGE_JSON),e.HVIGOR_BOOT_JS_FILE_PATH=u.resolve(e.HVIGOR_PROJECT_DEPENDENCIES_HOME,"node_modules","@ohos","hvigor","bin","hvigor.js")}(b);var j={},$={};Object.defineProperty($,"__esModule",{value:!0}),$.logInfoPrintConsole=$.logErrorAndExit=void 0,$.logErrorAndExit=function(e){e instanceof Error?console.error(e.message):console.error(e),process.exit(-1)},$.logInfoPrintConsole=function(e){console.log(e)};var H=w&&w.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),J=w&&w.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),G=w&&w.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&H(t,e,n);return J(t,e),t},V=w&&w.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(j,"__esModule",{value:!0}),j.isFileExists=j.offlinePluginConversion=j.executeCommand=j.getNpmPath=j.hasNpmPackInPaths=void 0;const U=h.default,W=G(p.default),z=b,K=$,q=V(D.default);j.hasNpmPackInPaths=function(e,t){try{return require.resolve(e,{paths:[...t]}),!0}catch(e){return!1}},j.getNpmPath=function(){const e=process.execPath;return W.join(W.dirname(e),z.NPM_TOOL)},j.executeCommand=function(e,t,n){0!==(0,U.spawnSync)(e,t,n).status&&(0,K.logErrorAndExit)(`Error: ${e} ${t} execute failed.See above for details.`)},j.offlinePluginConversion=function(e,t){return t.startsWith("file:")||t.endsWith(".tgz")?W.resolve(e,z.HVIGOR,t.replace("file:","")):t},j.isFileExists=function(e){return q.default.existsSync(e)&&q.default.statSync(e).isFile()},function(e){var t=w&&w.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=w&&w.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=w&&w.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var u in e)"default"!==u&&Object.prototype.hasOwnProperty.call(e,u)&&t(r,e,u);return n(r,e),r},u=w&&w.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.executeInstallPnpm=e.isPnpmAvailable=e.environmentHandler=e.checkNpmConifg=e.PNPM_VERSION=void 0;const o=r(D.default),i=b,s=j,c=r(p.default),a=$,l=h.default,f=u(E.default);e.PNPM_VERSION="7.30.0",e.checkNpmConifg=function(){const e=c.resolve(i.HVIGOR_PROJECT_ROOT_DIR,".npmrc"),t=c.resolve(f.default.homedir(),".npmrc");if((0,s.isFileExists)(e)||(0,s.isFileExists)(t))return;const n=(0,s.getNpmPath)(),r=(0,l.spawnSync)(n,["config","get","prefix"],{cwd:i.HVIGOR_PROJECT_ROOT_DIR});if(0!==r.status||!r.stdout)return void(0,a.logErrorAndExit)("Error: The hvigor depends on the npmrc file. Configure the npmrc file first.");const u=c.resolve(`${r.stdout}`.replace(/[\r\n]/gi,""),".npmrc");(0,s.isFileExists)(u)||(0,a.logErrorAndExit)("Error: The hvigor depends on the npmrc file. Configure the npmrc file first.")},e.environmentHandler=function(){process.env["npm_config_update-notifier"]="false"},e.isPnpmAvailable=function(){return!!o.existsSync(i.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH)&&(0,s.hasNpmPackInPaths)("pnpm",[i.HVIGOR_WRAPPER_TOOLS_HOME])},e.executeInstallPnpm=function(){(0,a.logInfoPrintConsole)(`Installing pnpm@${e.PNPM_VERSION}...`);const t=(0,s.getNpmPath)();!function(){const t=c.resolve(i.HVIGOR_WRAPPER_TOOLS_HOME,i.DEFAULT_PACKAGE_JSON);try{o.existsSync(i.HVIGOR_WRAPPER_TOOLS_HOME)||o.mkdirSync(i.HVIGOR_WRAPPER_TOOLS_HOME,{recursive:!0});const n={dependencies:{}};n.dependencies[i.PNPM]=e.PNPM_VERSION,o.writeFileSync(t,JSON.stringify(n))}catch(e){(0,a.logErrorAndExit)(`Error: EPERM: operation not permitted,create ${t} failed.`)}}(),(0,s.executeCommand)(t,["install","pnpm"],{cwd:i.HVIGOR_WRAPPER_TOOLS_HOME,stdio:["inherit","inherit","inherit"],env:process.env}),(0,a.logInfoPrintConsole)("Pnpm install success.")}}(O);var Y={},X={},Z={},Q={};Object.defineProperty(Q,"__esModule",{value:!0}),Q.Unicode=void 0;class ee{}Q.Unicode=ee,ee.Space_Separator=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,ee.ID_Start=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,ee.ID_Continue=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,Object.defineProperty(Z,"__esModule",{value:!0}),Z.JudgeUtil=void 0;const te=Q;Z.JudgeUtil=class{static isIgnoreChar(e){return"string"==typeof e&&("\t"===e||"\v"===e||"\f"===e||" "===e||" "===e||"\ufeff"===e||"\n"===e||"\r"===e||"\u2028"===e||"\u2029"===e)}static isSpaceSeparator(e){return"string"==typeof e&&te.Unicode.Space_Separator.test(e)}static isIdStartChar(e){return"string"==typeof e&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||"$"===e||"_"===e||te.Unicode.ID_Start.test(e))}static isIdContinueChar(e){return"string"==typeof e&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e>="0"&&e<="9"||"$"===e||"_"===e||"‌"===e||"‍"===e||te.Unicode.ID_Continue.test(e))}static isDigitWithoutZero(e){return/[1-9]/.test(e)}static isDigit(e){return"string"==typeof e&&/[0-9]/.test(e)}static isHexDigit(e){return"string"==typeof e&&/[0-9A-Fa-f]/.test(e)}};var ne={},re={fromCallback:function(e){return Object.defineProperty((function(...t){if("function"!=typeof t[t.length-1])return new Promise(((n,r)=>{e.call(this,...t,((e,t)=>null!=e?r(e):n(t)))}));e.apply(this,t)}),"name",{value:e.name})},fromPromise:function(e){return Object.defineProperty((function(...t){const n=t[t.length-1];if("function"!=typeof n)return e.apply(this,t);e.apply(this,t.slice(0,-1)).then((e=>n(null,e)),n)}),"name",{value:e.name})}},ue=y.default,oe=process.cwd,ie=null,se=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return ie||(ie=oe.call(process)),ie};try{process.cwd()}catch(e){}if("function"==typeof process.chdir){var ce=process.chdir;process.chdir=function(e){ie=null,ce.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,ce)}var ae=function(e){ue.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(e){e.lchmod=function(t,n,r){e.open(t,ue.O_WRONLY|ue.O_SYMLINK,n,(function(t,u){t?r&&r(t):e.fchmod(u,n,(function(t){e.close(u,(function(e){r&&r(t||e)}))}))}))},e.lchmodSync=function(t,n){var r,u=e.openSync(t,ue.O_WRONLY|ue.O_SYMLINK,n),o=!0;try{r=e.fchmodSync(u,n),o=!1}finally{if(o)try{e.closeSync(u)}catch(e){}else e.closeSync(u)}return r}}(e);e.lutimes||function(e){ue.hasOwnProperty("O_SYMLINK")&&e.futimes?(e.lutimes=function(t,n,r,u){e.open(t,ue.O_SYMLINK,(function(t,o){t?u&&u(t):e.futimes(o,n,r,(function(t){e.close(o,(function(e){u&&u(t||e)}))}))}))},e.lutimesSync=function(t,n,r){var u,o=e.openSync(t,ue.O_SYMLINK),i=!0;try{u=e.futimesSync(o,n,r),i=!1}finally{if(i)try{e.closeSync(o)}catch(e){}else e.closeSync(o)}return u}):e.futimes&&(e.lutimes=function(e,t,n,r){r&&process.nextTick(r)},e.lutimesSync=function(){})}(e);e.chown=r(e.chown),e.fchown=r(e.fchown),e.lchown=r(e.lchown),e.chmod=t(e.chmod),e.fchmod=t(e.fchmod),e.lchmod=t(e.lchmod),e.chownSync=u(e.chownSync),e.fchownSync=u(e.fchownSync),e.lchownSync=u(e.lchownSync),e.chmodSync=n(e.chmodSync),e.fchmodSync=n(e.fchmodSync),e.lchmodSync=n(e.lchmodSync),e.stat=o(e.stat),e.fstat=o(e.fstat),e.lstat=o(e.lstat),e.statSync=i(e.statSync),e.fstatSync=i(e.fstatSync),e.lstatSync=i(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(e,t,n){n&&process.nextTick(n)},e.lchmodSync=function(){});e.chown&&!e.lchown&&(e.lchown=function(e,t,n,r){r&&process.nextTick(r)},e.lchownSync=function(){});"win32"===se&&(e.rename="function"!=typeof e.rename?e.rename:function(t){function n(n,r,u){var o=Date.now(),i=0;t(n,r,(function s(c){if(c&&("EACCES"===c.code||"EPERM"===c.code||"EBUSY"===c.code)&&Date.now()-o<6e4)return setTimeout((function(){e.stat(r,(function(e,o){e&&"ENOENT"===e.code?t(n,r,s):u(c)}))}),i),void(i<100&&(i+=10));u&&u(c)}))}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.rename));function t(t){return t?function(n,r,u){return t.call(e,n,r,(function(e){s(e)&&(e=null),u&&u.apply(this,arguments)}))}:t}function n(t){return t?function(n,r){try{return t.call(e,n,r)}catch(e){if(!s(e))throw e}}:t}function r(t){return t?function(n,r,u,o){return t.call(e,n,r,u,(function(e){s(e)&&(e=null),o&&o.apply(this,arguments)}))}:t}function u(t){return t?function(n,r,u){try{return t.call(e,n,r,u)}catch(e){if(!s(e))throw e}}:t}function o(t){return t?function(n,r,u){function o(e,t){t&&(t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296)),u&&u.apply(this,arguments)}return"function"==typeof r&&(u=r,r=null),r?t.call(e,n,r,o):t.call(e,n,o)}:t}function i(t){return t?function(n,r){var u=r?t.call(e,n,r):t.call(e,n);return u&&(u.uid<0&&(u.uid+=4294967296),u.gid<0&&(u.gid+=4294967296)),u}:t}function s(e){return!e||("ENOSYS"===e.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==e.code&&"EPERM"!==e.code))}e.read="function"!=typeof e.read?e.read:function(t){function n(n,r,u,o,i,s){var c;if(s&&"function"==typeof s){var a=0;c=function(l,f,d){if(l&&"EAGAIN"===l.code&&a<10)return a++,t.call(e,n,r,u,o,i,c);s.apply(this,arguments)}}return t.call(e,n,r,u,o,i,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.read),e.readSync="function"!=typeof e.readSync?e.readSync:(c=e.readSync,function(t,n,r,u,o){for(var i=0;;)try{return c.call(e,t,n,r,u,o)}catch(e){if("EAGAIN"===e.code&&i<10){i++;continue}throw e}});var c};var le=C.default.Stream,fe=function(e){return{ReadStream:function t(n,r){if(!(this instanceof t))return new t(n,r);le.call(this);var u=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,r=r||{};for(var o=Object.keys(r),i=0,s=o.length;ithis.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick((function(){u._read()}));e.open(this.path,this.flags,this.mode,(function(e,t){if(e)return u.emit("error",e),void(u.readable=!1);u.fd=t,u.emit("open",t),u._read()}))},WriteStream:function t(n,r){if(!(this instanceof t))return new t(n,r);le.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var u=Object.keys(r),o=0,i=u.length;o= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}};var de=function(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Object)var t={__proto__:De(e)};else t=Object.create(null);return Object.getOwnPropertyNames(e).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t},De=Object.getPrototypeOf||function(e){return e.__proto__};var pe,Ee,me=D.default,he=ae,ye=fe,Ce=de,Fe=F.default;function ge(e,t){Object.defineProperty(e,pe,{get:function(){return t}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(pe=Symbol.for("graceful-fs.queue"),Ee=Symbol.for("graceful-fs.previous")):(pe="___graceful-fs.queue",Ee="___graceful-fs.previous");var Ae=function(){};if(Fe.debuglog?Ae=Fe.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Ae=function(){var e=Fe.format.apply(Fe,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: "),console.error(e)}),!me[pe]){var ve=w[pe]||[];ge(me,ve),me.close=function(e){function t(t,n){return e.call(me,t,(function(e){e||_e(),"function"==typeof n&&n.apply(this,arguments)}))}return Object.defineProperty(t,Ee,{value:e}),t}(me.close),me.closeSync=function(e){function t(t){e.apply(me,arguments),_e()}return Object.defineProperty(t,Ee,{value:e}),t}(me.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){Ae(me[pe]),g.default.equal(me[pe].length,0)}))}w[pe]||ge(w,me[pe]);var Se,we=Oe(Ce(me));function Oe(e){he(e),e.gracefulify=Oe,e.createReadStream=function(t,n){return new e.ReadStream(t,n)},e.createWriteStream=function(t,n){return new e.WriteStream(t,n)};var t=e.readFile;e.readFile=function(e,n,r){"function"==typeof n&&(r=n,n=null);return function e(n,r,u,o){return t(n,r,(function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof u&&u.apply(this,arguments):be([e,[n,r,u],t,o||Date.now(),Date.now()])}))}(e,n,r)};var n=e.writeFile;e.writeFile=function(e,t,r,u){"function"==typeof r&&(u=r,r=null);return function e(t,r,u,o,i){return n(t,r,u,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof o&&o.apply(this,arguments):be([e,[t,r,u,o],n,i||Date.now(),Date.now()])}))}(e,t,r,u)};var r=e.appendFile;r&&(e.appendFile=function(e,t,n,u){"function"==typeof n&&(u=n,n=null);return function e(t,n,u,o,i){return r(t,n,u,(function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?"function"==typeof o&&o.apply(this,arguments):be([e,[t,n,u,o],r,i||Date.now(),Date.now()])}))}(e,t,n,u)});var u=e.copyFile;u&&(e.copyFile=function(e,t,n,r){"function"==typeof n&&(r=n,n=0);return function e(t,n,r,o,i){return u(t,n,r,(function(u){!u||"EMFILE"!==u.code&&"ENFILE"!==u.code?"function"==typeof o&&o.apply(this,arguments):be([e,[t,n,r,o],u,i||Date.now(),Date.now()])}))}(e,t,n,r)});var o=e.readdir;e.readdir=function(e,t,n){"function"==typeof t&&(n=t,t=null);var r=i.test(process.version)?function(e,t,n,r){return o(e,u(e,t,n,r))}:function(e,t,n,r){return o(e,t,u(e,t,n,r))};return r(e,t,n);function u(e,t,n,u){return function(o,i){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?(i&&i.sort&&i.sort(),"function"==typeof n&&n.call(this,o,i)):be([r,[e,t,n],o,u||Date.now(),Date.now()])}}};var i=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var s=ye(e);d=s.ReadStream,D=s.WriteStream}var c=e.ReadStream;c&&(d.prototype=Object.create(c.prototype),d.prototype.open=function(){var e=this;E(e.path,e.flags,e.mode,(function(t,n){t?(e.autoClose&&e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n),e.read())}))});var a=e.WriteStream;a&&(D.prototype=Object.create(a.prototype),D.prototype.open=function(){var e=this;E(e.path,e.flags,e.mode,(function(t,n){t?(e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n))}))}),Object.defineProperty(e,"ReadStream",{get:function(){return d},set:function(e){d=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return D},set:function(e){D=e},enumerable:!0,configurable:!0});var l=d;Object.defineProperty(e,"FileReadStream",{get:function(){return l},set:function(e){l=e},enumerable:!0,configurable:!0});var f=D;function d(e,t){return this instanceof d?(c.apply(this,arguments),this):d.apply(Object.create(d.prototype),arguments)}function D(e,t){return this instanceof D?(a.apply(this,arguments),this):D.apply(Object.create(D.prototype),arguments)}Object.defineProperty(e,"FileWriteStream",{get:function(){return f},set:function(e){f=e},enumerable:!0,configurable:!0});var p=e.open;function E(e,t,n,r){return"function"==typeof n&&(r=n,n=null),function e(t,n,r,u,o){return p(t,n,r,(function(i,s){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?"function"==typeof u&&u.apply(this,arguments):be([e,[t,n,r,u],i,o||Date.now(),Date.now()])}))}(e,t,n,r)}return e.open=E,e}function be(e){Ae("ENQUEUE",e[0].name,e[1]),me[pe].push(e),Be()}function _e(){for(var e=Date.now(),t=0;t2&&(me[pe][t][3]=e,me[pe][t][4]=e);Be()}function Be(){if(clearTimeout(Se),Se=void 0,0!==me[pe].length){var e=me[pe].shift(),t=e[0],n=e[1],r=e[2],u=e[3],o=e[4];if(void 0===u)Ae("RETRY",t.name,n),t.apply(null,n);else if(Date.now()-u>=6e4){Ae("TIMEOUT",t.name,n);var i=n.pop();"function"==typeof i&&i.call(null,r)}else{var s=Date.now()-o,c=Math.max(o-u,1);s>=Math.min(1.2*c,100)?(Ae("RETRY",t.name,n),t.apply(null,n.concat([u]))):me[pe].push(e)}void 0===Se&&(Se=setTimeout(Be,0))}}process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!me.__patched&&(we=Oe(me),me.__patched=!0),function(e){const t=re.fromCallback,n=we,r=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((e=>"function"==typeof n[e]));Object.assign(e,n),r.forEach((r=>{e[r]=t(n[r])})),e.realpath.native=t(n.realpath.native),e.exists=function(e,t){return"function"==typeof t?n.exists(e,t):new Promise((t=>n.exists(e,t)))},e.read=function(e,t,r,u,o,i){return"function"==typeof i?n.read(e,t,r,u,o,i):new Promise(((i,s)=>{n.read(e,t,r,u,o,((e,t,n)=>{if(e)return s(e);i({bytesRead:t,buffer:n})}))}))},e.write=function(e,t,...r){return"function"==typeof r[r.length-1]?n.write(e,t,...r):new Promise(((u,o)=>{n.write(e,t,...r,((e,t,n)=>{if(e)return o(e);u({bytesWritten:t,buffer:n})}))}))},"function"==typeof n.writev&&(e.writev=function(e,t,...r){return"function"==typeof r[r.length-1]?n.writev(e,t,...r):new Promise(((u,o)=>{n.writev(e,t,...r,((e,t,n)=>{if(e)return o(e);u({bytesWritten:t,buffers:n})}))}))})}(ne);var Pe={},ke={};const xe=p.default;ke.checkPath=function(e){if("win32"===process.platform){if(/[<>:"|?*]/.test(e.replace(xe.parse(e).root,""))){const t=new Error(`Path contains invalid characters: ${e}`);throw t.code="EINVAL",t}}};const Ne=ne,{checkPath:Ie}=ke,Te=e=>"number"==typeof e?e:{mode:511,...e}.mode;Pe.makeDir=async(e,t)=>(Ie(e),Ne.mkdir(e,{mode:Te(t),recursive:!0})),Pe.makeDirSync=(e,t)=>(Ie(e),Ne.mkdirSync(e,{mode:Te(t),recursive:!0}));const Re=re.fromPromise,{makeDir:Me,makeDirSync:Le}=Pe,je=Re(Me);var $e={mkdirs:je,mkdirsSync:Le,mkdirp:je,mkdirpSync:Le,ensureDir:je,ensureDirSync:Le};const He=re.fromPromise,Je=ne;var Ge={pathExists:He((function(e){return Je.access(e).then((()=>!0)).catch((()=>!1))})),pathExistsSync:Je.existsSync};const Ve=we;var Ue=function(e,t,n,r){Ve.open(e,"r+",((e,u)=>{if(e)return r(e);Ve.futimes(u,t,n,(e=>{Ve.close(u,(t=>{r&&r(e||t)}))}))}))},We=function(e,t,n){const r=Ve.openSync(e,"r+");return Ve.futimesSync(r,t,n),Ve.closeSync(r)};const ze=ne,Ke=p.default,qe=F.default;function Ye(e,t,n){const r=n.dereference?e=>ze.stat(e,{bigint:!0}):e=>ze.lstat(e,{bigint:!0});return Promise.all([r(e),r(t).catch((e=>{if("ENOENT"===e.code)return null;throw e}))]).then((([e,t])=>({srcStat:e,destStat:t})))}function Xe(e,t){return t.ino&&t.dev&&t.ino===e.ino&&t.dev===e.dev}function Ze(e,t){const n=Ke.resolve(e).split(Ke.sep).filter((e=>e)),r=Ke.resolve(t).split(Ke.sep).filter((e=>e));return n.reduce(((e,t,n)=>e&&r[n]===t),!0)}function Qe(e,t,n){return`Cannot ${n} '${e}' to a subdirectory of itself, '${t}'.`}var et={checkPaths:function(e,t,n,r,u){qe.callbackify(Ye)(e,t,r,((r,o)=>{if(r)return u(r);const{srcStat:i,destStat:s}=o;if(s){if(Xe(i,s)){const r=Ke.basename(e),o=Ke.basename(t);return"move"===n&&r!==o&&r.toLowerCase()===o.toLowerCase()?u(null,{srcStat:i,destStat:s,isChangingCase:!0}):u(new Error("Source and destination must not be the same."))}if(i.isDirectory()&&!s.isDirectory())return u(new Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`));if(!i.isDirectory()&&s.isDirectory())return u(new Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`))}return i.isDirectory()&&Ze(e,t)?u(new Error(Qe(e,t,n))):u(null,{srcStat:i,destStat:s})}))},checkPathsSync:function(e,t,n,r){const{srcStat:u,destStat:o}=function(e,t,n){let r;const u=n.dereference?e=>ze.statSync(e,{bigint:!0}):e=>ze.lstatSync(e,{bigint:!0}),o=u(e);try{r=u(t)}catch(e){if("ENOENT"===e.code)return{srcStat:o,destStat:null};throw e}return{srcStat:o,destStat:r}}(e,t,r);if(o){if(Xe(u,o)){const r=Ke.basename(e),i=Ke.basename(t);if("move"===n&&r!==i&&r.toLowerCase()===i.toLowerCase())return{srcStat:u,destStat:o,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(u.isDirectory()&&!o.isDirectory())throw new Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`);if(!u.isDirectory()&&o.isDirectory())throw new Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`)}if(u.isDirectory()&&Ze(e,t))throw new Error(Qe(e,t,n));return{srcStat:u,destStat:o}},checkParentPaths:function e(t,n,r,u,o){const i=Ke.resolve(Ke.dirname(t)),s=Ke.resolve(Ke.dirname(r));if(s===i||s===Ke.parse(s).root)return o();ze.stat(s,{bigint:!0},((i,c)=>i?"ENOENT"===i.code?o():o(i):Xe(n,c)?o(new Error(Qe(t,r,u))):e(t,n,s,u,o)))},checkParentPathsSync:function e(t,n,r,u){const o=Ke.resolve(Ke.dirname(t)),i=Ke.resolve(Ke.dirname(r));if(i===o||i===Ke.parse(i).root)return;let s;try{s=ze.statSync(i,{bigint:!0})}catch(e){if("ENOENT"===e.code)return;throw e}if(Xe(n,s))throw new Error(Qe(t,r,u));return e(t,n,i,u)},isSrcSubdir:Ze,areIdentical:Xe};const tt=we,nt=p.default,rt=$e.mkdirs,ut=Ge.pathExists,ot=Ue,it=et;function st(e,t,n,r,u){const o=nt.dirname(n);ut(o,((i,s)=>i?u(i):s?at(e,t,n,r,u):void rt(o,(o=>o?u(o):at(e,t,n,r,u)))))}function ct(e,t,n,r,u,o){Promise.resolve(u.filter(n,r)).then((i=>i?e(t,n,r,u,o):o()),(e=>o(e)))}function at(e,t,n,r,u){(r.dereference?tt.stat:tt.lstat)(t,((o,i)=>o?u(o):i.isDirectory()?function(e,t,n,r,u,o){return t?Dt(n,r,u,o):function(e,t,n,r,u){tt.mkdir(n,(o=>{if(o)return u(o);Dt(t,n,r,(t=>t?u(t):dt(n,e,u)))}))}(e.mode,n,r,u,o)}(i,e,t,n,r,u):i.isFile()||i.isCharacterDevice()||i.isBlockDevice()?function(e,t,n,r,u,o){return t?function(e,t,n,r,u){if(!r.overwrite)return r.errorOnExist?u(new Error(`'${n}' already exists`)):u();tt.unlink(n,(o=>o?u(o):lt(e,t,n,r,u)))}(e,n,r,u,o):lt(e,n,r,u,o)}(i,e,t,n,r,u):i.isSymbolicLink()?function(e,t,n,r,u){tt.readlink(t,((t,o)=>t?u(t):(r.dereference&&(o=nt.resolve(process.cwd(),o)),e?void tt.readlink(n,((t,i)=>t?"EINVAL"===t.code||"UNKNOWN"===t.code?tt.symlink(o,n,u):u(t):(r.dereference&&(i=nt.resolve(process.cwd(),i)),it.isSrcSubdir(o,i)?u(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${i}'.`)):e.isDirectory()&&it.isSrcSubdir(i,o)?u(new Error(`Cannot overwrite '${i}' with '${o}'.`)):function(e,t,n){tt.unlink(t,(r=>r?n(r):tt.symlink(e,t,n)))}(o,n,u)))):tt.symlink(o,n,u))))}(e,t,n,r,u):i.isSocket()?u(new Error(`Cannot copy a socket file: ${t}`)):i.isFIFO()?u(new Error(`Cannot copy a FIFO pipe: ${t}`)):u(new Error(`Unknown file: ${t}`))))}function lt(e,t,n,r,u){tt.copyFile(t,n,(o=>o?u(o):r.preserveTimestamps?function(e,t,n,r){if(function(e){return 0==(128&e)}(e))return function(e,t,n){return dt(e,128|t,n)}(n,e,(u=>u?r(u):ft(e,t,n,r)));return ft(e,t,n,r)}(e.mode,t,n,u):dt(n,e.mode,u)))}function ft(e,t,n,r){!function(e,t,n){tt.stat(e,((e,r)=>e?n(e):ot(t,r.atime,r.mtime,n)))}(t,n,(t=>t?r(t):dt(n,e,r)))}function dt(e,t,n){return tt.chmod(e,t,n)}function Dt(e,t,n,r){tt.readdir(e,((u,o)=>u?r(u):pt(o,e,t,n,r)))}function pt(e,t,n,r,u){const o=e.pop();return o?function(e,t,n,r,u,o){const i=nt.join(n,t),s=nt.join(r,t);it.checkPaths(i,s,"copy",u,((t,c)=>{if(t)return o(t);const{destStat:a}=c;!function(e,t,n,r,u){r.filter?ct(at,e,t,n,r,u):at(e,t,n,r,u)}(a,i,s,u,(t=>t?o(t):pt(e,n,r,u,o)))}))}(e,o,t,n,r,u):u()}var Et=function(e,t,n,r){"function"!=typeof n||r?"function"==typeof n&&(n={filter:n}):(r=n,n={}),r=r||function(){},(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269"),it.checkPaths(e,t,"copy",n,((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;it.checkParentPaths(e,i,t,"copy",(u=>u?r(u):n.filter?ct(st,s,e,t,n,r):st(s,e,t,n,r)))}))};const mt=we,ht=p.default,yt=$e.mkdirsSync,Ct=We,Ft=et;function gt(e,t,n,r){const u=(r.dereference?mt.statSync:mt.lstatSync)(t);if(u.isDirectory())return function(e,t,n,r,u){return t?St(n,r,u):function(e,t,n,r){return mt.mkdirSync(n),St(t,n,r),vt(n,e)}(e.mode,n,r,u)}(u,e,t,n,r);if(u.isFile()||u.isCharacterDevice()||u.isBlockDevice())return function(e,t,n,r,u){return t?function(e,t,n,r){if(r.overwrite)return mt.unlinkSync(n),At(e,t,n,r);if(r.errorOnExist)throw new Error(`'${n}' already exists`)}(e,n,r,u):At(e,n,r,u)}(u,e,t,n,r);if(u.isSymbolicLink())return function(e,t,n,r){let u=mt.readlinkSync(t);r.dereference&&(u=ht.resolve(process.cwd(),u));if(e){let e;try{e=mt.readlinkSync(n)}catch(e){if("EINVAL"===e.code||"UNKNOWN"===e.code)return mt.symlinkSync(u,n);throw e}if(r.dereference&&(e=ht.resolve(process.cwd(),e)),Ft.isSrcSubdir(u,e))throw new Error(`Cannot copy '${u}' to a subdirectory of itself, '${e}'.`);if(mt.statSync(n).isDirectory()&&Ft.isSrcSubdir(e,u))throw new Error(`Cannot overwrite '${e}' with '${u}'.`);return function(e,t){return mt.unlinkSync(t),mt.symlinkSync(e,t)}(u,n)}return mt.symlinkSync(u,n)}(e,t,n,r);if(u.isSocket())throw new Error(`Cannot copy a socket file: ${t}`);if(u.isFIFO())throw new Error(`Cannot copy a FIFO pipe: ${t}`);throw new Error(`Unknown file: ${t}`)}function At(e,t,n,r){return mt.copyFileSync(t,n),r.preserveTimestamps&&function(e,t,n){(function(e){return 0==(128&e)})(e)&&function(e,t){vt(e,128|t)}(n,e);(function(e,t){const n=mt.statSync(e);Ct(t,n.atime,n.mtime)})(t,n)}(e.mode,t,n),vt(n,e.mode)}function vt(e,t){return mt.chmodSync(e,t)}function St(e,t,n){mt.readdirSync(e).forEach((r=>function(e,t,n,r){const u=ht.join(t,e),o=ht.join(n,e),{destStat:i}=Ft.checkPathsSync(u,o,"copy",r);return function(e,t,n,r){if(!r.filter||r.filter(t,n))return gt(e,t,n,r)}(i,u,o,r)}(r,e,t,n)))}var wt=function(e,t,n){"function"==typeof n&&(n={filter:n}),(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269");const{srcStat:r,destStat:u}=Ft.checkPathsSync(e,t,"copy",n);return Ft.checkParentPathsSync(e,r,t,"copy"),function(e,t,n,r){if(r.filter&&!r.filter(t,n))return;const u=ht.dirname(n);mt.existsSync(u)||yt(u);return gt(e,t,n,r)}(u,e,t,n)};var Ot={copy:(0,re.fromCallback)(Et),copySync:wt};const bt=we,_t=p.default,Bt=g.default,Pt="win32"===process.platform;function kt(e){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((t=>{e[t]=e[t]||bt[t],e[t+="Sync"]=e[t]||bt[t]})),e.maxBusyTries=e.maxBusyTries||3}function xt(e,t,n){let r=0;"function"==typeof t&&(n=t,t={}),Bt(e,"rimraf: missing path"),Bt.strictEqual(typeof e,"string","rimraf: path should be a string"),Bt.strictEqual(typeof n,"function","rimraf: callback function required"),Bt(t,"rimraf: invalid options argument provided"),Bt.strictEqual(typeof t,"object","rimraf: options should be object"),kt(t),Nt(e,t,(function u(o){if(o){if(("EBUSY"===o.code||"ENOTEMPTY"===o.code||"EPERM"===o.code)&&rNt(e,t,u)),100*r)}"ENOENT"===o.code&&(o=null)}n(o)}))}function Nt(e,t,n){Bt(e),Bt(t),Bt("function"==typeof n),t.lstat(e,((r,u)=>r&&"ENOENT"===r.code?n(null):r&&"EPERM"===r.code&&Pt?It(e,t,r,n):u&&u.isDirectory()?Rt(e,t,r,n):void t.unlink(e,(r=>{if(r){if("ENOENT"===r.code)return n(null);if("EPERM"===r.code)return Pt?It(e,t,r,n):Rt(e,t,r,n);if("EISDIR"===r.code)return Rt(e,t,r,n)}return n(r)}))))}function It(e,t,n,r){Bt(e),Bt(t),Bt("function"==typeof r),t.chmod(e,438,(u=>{u?r("ENOENT"===u.code?null:n):t.stat(e,((u,o)=>{u?r("ENOENT"===u.code?null:n):o.isDirectory()?Rt(e,t,n,r):t.unlink(e,r)}))}))}function Tt(e,t,n){let r;Bt(e),Bt(t);try{t.chmodSync(e,438)}catch(e){if("ENOENT"===e.code)return;throw n}try{r=t.statSync(e)}catch(e){if("ENOENT"===e.code)return;throw n}r.isDirectory()?Lt(e,t,n):t.unlinkSync(e)}function Rt(e,t,n,r){Bt(e),Bt(t),Bt("function"==typeof r),t.rmdir(e,(u=>{!u||"ENOTEMPTY"!==u.code&&"EEXIST"!==u.code&&"EPERM"!==u.code?u&&"ENOTDIR"===u.code?r(n):r(u):function(e,t,n){Bt(e),Bt(t),Bt("function"==typeof n),t.readdir(e,((r,u)=>{if(r)return n(r);let o,i=u.length;if(0===i)return t.rmdir(e,n);u.forEach((r=>{xt(_t.join(e,r),t,(r=>{if(!o)return r?n(o=r):void(0==--i&&t.rmdir(e,n))}))}))}))}(e,t,r)}))}function Mt(e,t){let n;kt(t=t||{}),Bt(e,"rimraf: missing path"),Bt.strictEqual(typeof e,"string","rimraf: path should be a string"),Bt(t,"rimraf: missing options"),Bt.strictEqual(typeof t,"object","rimraf: options should be object");try{n=t.lstatSync(e)}catch(n){if("ENOENT"===n.code)return;"EPERM"===n.code&&Pt&&Tt(e,t,n)}try{n&&n.isDirectory()?Lt(e,t,null):t.unlinkSync(e)}catch(n){if("ENOENT"===n.code)return;if("EPERM"===n.code)return Pt?Tt(e,t,n):Lt(e,t,n);if("EISDIR"!==n.code)throw n;Lt(e,t,n)}}function Lt(e,t,n){Bt(e),Bt(t);try{t.rmdirSync(e)}catch(r){if("ENOTDIR"===r.code)throw n;if("ENOTEMPTY"===r.code||"EEXIST"===r.code||"EPERM"===r.code)!function(e,t){if(Bt(e),Bt(t),t.readdirSync(e).forEach((n=>Mt(_t.join(e,n),t))),!Pt){return t.rmdirSync(e,t)}{const n=Date.now();do{try{return t.rmdirSync(e,t)}catch{}}while(Date.now()-n<500)}}(e,t);else if("ENOENT"!==r.code)throw r}}var jt=xt;xt.sync=Mt;const $t=we,Ht=re.fromCallback,Jt=jt;var Gt={remove:Ht((function(e,t){if($t.rm)return $t.rm(e,{recursive:!0,force:!0},t);Jt(e,t)})),removeSync:function(e){if($t.rmSync)return $t.rmSync(e,{recursive:!0,force:!0});Jt.sync(e)}};const Vt=re.fromPromise,Ut=ne,Wt=p.default,zt=$e,Kt=Gt,qt=Vt((async function(e){let t;try{t=await Ut.readdir(e)}catch{return zt.mkdirs(e)}return Promise.all(t.map((t=>Kt.remove(Wt.join(e,t)))))}));function Yt(e){let t;try{t=Ut.readdirSync(e)}catch{return zt.mkdirsSync(e)}t.forEach((t=>{t=Wt.join(e,t),Kt.removeSync(t)}))}var Xt={emptyDirSync:Yt,emptydirSync:Yt,emptyDir:qt,emptydir:qt};const Zt=re.fromCallback,Qt=p.default,en=we,tn=$e;var nn={createFile:Zt((function(e,t){function n(){en.writeFile(e,"",(e=>{if(e)return t(e);t()}))}en.stat(e,((r,u)=>{if(!r&&u.isFile())return t();const o=Qt.dirname(e);en.stat(o,((e,r)=>{if(e)return"ENOENT"===e.code?tn.mkdirs(o,(e=>{if(e)return t(e);n()})):t(e);r.isDirectory()?n():en.readdir(o,(e=>{if(e)return t(e)}))}))}))})),createFileSync:function(e){let t;try{t=en.statSync(e)}catch{}if(t&&t.isFile())return;const n=Qt.dirname(e);try{en.statSync(n).isDirectory()||en.readdirSync(n)}catch(e){if(!e||"ENOENT"!==e.code)throw e;tn.mkdirsSync(n)}en.writeFileSync(e,"")}};const rn=re.fromCallback,un=p.default,on=we,sn=$e,cn=Ge.pathExists,{areIdentical:an}=et;var ln={createLink:rn((function(e,t,n){function r(e,t){on.link(e,t,(e=>{if(e)return n(e);n(null)}))}on.lstat(t,((u,o)=>{on.lstat(e,((u,i)=>{if(u)return u.message=u.message.replace("lstat","ensureLink"),n(u);if(o&&an(i,o))return n(null);const s=un.dirname(t);cn(s,((u,o)=>u?n(u):o?r(e,t):void sn.mkdirs(s,(u=>{if(u)return n(u);r(e,t)}))))}))}))})),createLinkSync:function(e,t){let n;try{n=on.lstatSync(t)}catch{}try{const t=on.lstatSync(e);if(n&&an(t,n))return}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}const r=un.dirname(t);return on.existsSync(r)||sn.mkdirsSync(r),on.linkSync(e,t)}};const fn=p.default,dn=we,Dn=Ge.pathExists;var pn={symlinkPaths:function(e,t,n){if(fn.isAbsolute(e))return dn.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:e})));{const r=fn.dirname(t),u=fn.join(r,e);return Dn(u,((t,o)=>t?n(t):o?n(null,{toCwd:u,toDst:e}):dn.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:fn.relative(r,e)})))))}},symlinkPathsSync:function(e,t){let n;if(fn.isAbsolute(e)){if(n=dn.existsSync(e),!n)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}{const r=fn.dirname(t),u=fn.join(r,e);if(n=dn.existsSync(u),n)return{toCwd:u,toDst:e};if(n=dn.existsSync(e),!n)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:fn.relative(r,e)}}}};const En=we;var mn={symlinkType:function(e,t,n){if(n="function"==typeof t?t:n,t="function"!=typeof t&&t)return n(null,t);En.lstat(e,((e,r)=>{if(e)return n(null,"file");t=r&&r.isDirectory()?"dir":"file",n(null,t)}))},symlinkTypeSync:function(e,t){let n;if(t)return t;try{n=En.lstatSync(e)}catch{return"file"}return n&&n.isDirectory()?"dir":"file"}};const hn=re.fromCallback,yn=p.default,Cn=ne,Fn=$e.mkdirs,gn=$e.mkdirsSync,An=pn.symlinkPaths,vn=pn.symlinkPathsSync,Sn=mn.symlinkType,wn=mn.symlinkTypeSync,On=Ge.pathExists,{areIdentical:bn}=et;function _n(e,t,n,r){An(e,t,((u,o)=>{if(u)return r(u);e=o.toDst,Sn(o.toCwd,n,((n,u)=>{if(n)return r(n);const o=yn.dirname(t);On(o,((n,i)=>n?r(n):i?Cn.symlink(e,t,u,r):void Fn(o,(n=>{if(n)return r(n);Cn.symlink(e,t,u,r)}))))}))}))}var Bn={createSymlink:hn((function(e,t,n,r){r="function"==typeof n?n:r,n="function"!=typeof n&&n,Cn.lstat(t,((u,o)=>{!u&&o.isSymbolicLink()?Promise.all([Cn.stat(e),Cn.stat(t)]).then((([u,o])=>{if(bn(u,o))return r(null);_n(e,t,n,r)})):_n(e,t,n,r)}))})),createSymlinkSync:function(e,t,n){let r;try{r=Cn.lstatSync(t)}catch{}if(r&&r.isSymbolicLink()){const n=Cn.statSync(e),r=Cn.statSync(t);if(bn(n,r))return}const u=vn(e,t);e=u.toDst,n=wn(u.toCwd,n);const o=yn.dirname(t);return Cn.existsSync(o)||gn(o),Cn.symlinkSync(e,t,n)}};const{createFile:Pn,createFileSync:kn}=nn,{createLink:xn,createLinkSync:Nn}=ln,{createSymlink:In,createSymlinkSync:Tn}=Bn;var Rn={createFile:Pn,createFileSync:kn,ensureFile:Pn,ensureFileSync:kn,createLink:xn,createLinkSync:Nn,ensureLink:xn,ensureLinkSync:Nn,createSymlink:In,createSymlinkSync:Tn,ensureSymlink:In,ensureSymlinkSync:Tn};var Mn={stringify:function(e,{EOL:t="\n",finalEOL:n=!0,replacer:r=null,spaces:u}={}){const o=n?t:"";return JSON.stringify(e,r,u).replace(/\n/g,t)+o},stripBom:function(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e.replace(/^\uFEFF/,"")}};let Ln;try{Ln=we}catch(e){Ln=D.default}const jn=re,{stringify:$n,stripBom:Hn}=Mn;const Jn=jn.fromPromise((async function(e,t={}){"string"==typeof t&&(t={encoding:t});const n=t.fs||Ln,r=!("throws"in t)||t.throws;let u,o=await jn.fromCallback(n.readFile)(e,t);o=Hn(o);try{u=JSON.parse(o,t?t.reviver:null)}catch(t){if(r)throw t.message=`${e}: ${t.message}`,t;return null}return u}));const Gn=jn.fromPromise((async function(e,t,n={}){const r=n.fs||Ln,u=$n(t,n);await jn.fromCallback(r.writeFile)(e,u,n)}));const Vn={readFile:Jn,readFileSync:function(e,t={}){"string"==typeof t&&(t={encoding:t});const n=t.fs||Ln,r=!("throws"in t)||t.throws;try{let r=n.readFileSync(e,t);return r=Hn(r),JSON.parse(r,t.reviver)}catch(t){if(r)throw t.message=`${e}: ${t.message}`,t;return null}},writeFile:Gn,writeFileSync:function(e,t,n={}){const r=n.fs||Ln,u=$n(t,n);return r.writeFileSync(e,u,n)}};var Un={readJson:Vn.readFile,readJsonSync:Vn.readFileSync,writeJson:Vn.writeFile,writeJsonSync:Vn.writeFileSync};const Wn=re.fromCallback,zn=we,Kn=p.default,qn=$e,Yn=Ge.pathExists;var Xn={outputFile:Wn((function(e,t,n,r){"function"==typeof n&&(r=n,n="utf8");const u=Kn.dirname(e);Yn(u,((o,i)=>o?r(o):i?zn.writeFile(e,t,n,r):void qn.mkdirs(u,(u=>{if(u)return r(u);zn.writeFile(e,t,n,r)}))))})),outputFileSync:function(e,...t){const n=Kn.dirname(e);if(zn.existsSync(n))return zn.writeFileSync(e,...t);qn.mkdirsSync(n),zn.writeFileSync(e,...t)}};const{stringify:Zn}=Mn,{outputFile:Qn}=Xn;var er=async function(e,t,n={}){const r=Zn(t,n);await Qn(e,r,n)};const{stringify:tr}=Mn,{outputFileSync:nr}=Xn;var rr=function(e,t,n){const r=tr(t,n);nr(e,r,n)};const ur=re.fromPromise,or=Un;or.outputJson=ur(er),or.outputJsonSync=rr,or.outputJSON=or.outputJson,or.outputJSONSync=or.outputJsonSync,or.writeJSON=or.writeJson,or.writeJSONSync=or.writeJsonSync,or.readJSON=or.readJson,or.readJSONSync=or.readJsonSync;var ir=or;const sr=we,cr=p.default,ar=Ot.copy,lr=Gt.remove,fr=$e.mkdirp,dr=Ge.pathExists,Dr=et;function pr(e,t,n,r,u){return r?Er(e,t,n,u):n?lr(t,(r=>r?u(r):Er(e,t,n,u))):void dr(t,((r,o)=>r?u(r):o?u(new Error("dest already exists.")):Er(e,t,n,u)))}function Er(e,t,n,r){sr.rename(e,t,(u=>u?"EXDEV"!==u.code?r(u):function(e,t,n,r){const u={overwrite:n,errorOnExist:!0};ar(e,t,u,(t=>t?r(t):lr(e,r)))}(e,t,n,r):r()))}var mr=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=n.overwrite||n.clobber||!1;Dr.checkPaths(e,t,"move",n,((n,o)=>{if(n)return r(n);const{srcStat:i,isChangingCase:s=!1}=o;Dr.checkParentPaths(e,i,t,"move",(n=>n?r(n):function(e){const t=cr.dirname(e);return cr.parse(t).root===t}(t)?pr(e,t,u,s,r):void fr(cr.dirname(t),(n=>n?r(n):pr(e,t,u,s,r)))))}))};const hr=we,yr=p.default,Cr=Ot.copySync,Fr=Gt.removeSync,gr=$e.mkdirpSync,Ar=et;function vr(e,t,n){try{hr.renameSync(e,t)}catch(r){if("EXDEV"!==r.code)throw r;return function(e,t,n){const r={overwrite:n,errorOnExist:!0};return Cr(e,t,r),Fr(e)}(e,t,n)}}var Sr=function(e,t,n){const r=(n=n||{}).overwrite||n.clobber||!1,{srcStat:u,isChangingCase:o=!1}=Ar.checkPathsSync(e,t,"move",n);return Ar.checkParentPathsSync(e,u,t,"move"),function(e){const t=yr.dirname(e);return yr.parse(t).root===t}(t)||gr(yr.dirname(t)),function(e,t,n,r){if(r)return vr(e,t,n);if(n)return Fr(t),vr(e,t,n);if(hr.existsSync(t))throw new Error("dest already exists.");return vr(e,t,n)}(e,t,r,o)};var wr,Or,br,_r,Br,Pr={move:(0,re.fromCallback)(mr),moveSync:Sr},kr={...ne,...Ot,...Xt,...Rn,...ir,...$e,...Pr,...Xn,...Ge,...Gt},xr={},Nr={exports:{}},Ir={exports:{}};function Tr(){if(Or)return wr;Or=1;var e=1e3,t=60*e,n=60*t,r=24*n,u=7*r,o=365.25*r;function i(e,t,n,r){var u=t>=1.5*n;return Math.round(e/n)+" "+r+(u?"s":"")}return wr=function(s,c){c=c||{};var a=typeof s;if("string"===a&&s.length>0)return function(i){if((i=String(i)).length>100)return;var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(!s)return;var c=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*u;case"days":case"day":case"d":return c*r;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*t;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(s);if("number"===a&&isFinite(s))return c.long?function(u){var o=Math.abs(u);if(o>=r)return i(u,o,r,"day");if(o>=n)return i(u,o,n,"hour");if(o>=t)return i(u,o,t,"minute");if(o>=e)return i(u,o,e,"second");return u+" ms"}(s):function(u){var o=Math.abs(u);if(o>=r)return Math.round(u/r)+"d";if(o>=n)return Math.round(u/n)+"h";if(o>=t)return Math.round(u/t)+"m";if(o>=e)return Math.round(u/e)+"s";return u+"ms"}(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))}}function Rr(){if(_r)return br;return _r=1,br=function(e){function t(e){let r,u,o,i=null;function s(...e){if(!s.enabled)return;const n=s,u=Number(new Date),o=u-(r||u);n.diff=o,n.prev=r,n.curr=u,r=u,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,u)=>{if("%%"===r)return"%";i++;const o=t.formatters[u];if("function"==typeof o){const t=e[i];r=o.call(n,t),e.splice(i,1),i--}return r})),t.formatArgs.call(n,e);(n.log||t.log).apply(n,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=n,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==i?i:(u!==t.namespaces&&(u=t.namespaces,o=t.enabled(e)),o),set:e=>{i=e}}),"function"==typeof t.init&&t.init(s),s}function n(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function r(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(r),...t.skips.map(r).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),u=r.length;for(n=0;n{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t{const n=e.startsWith("-")?"":1===e.length?"-":"--",r=t.indexOf(n+e),u=t.indexOf("--");return-1!==r&&(-1===u||r{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=function(){if($r)return jr;$r=1;const e=E.default,t=A.default,n=Vr(),{env:r}=process;let u;function o(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function i(t,o){if(0===u)return 0;if(n("color=16m")||n("color=full")||n("color=truecolor"))return 3;if(n("color=256"))return 2;if(t&&!o&&void 0===u)return 0;const i=u||0;if("dumb"===r.TERM)return i;if("win32"===process.platform){const t=e.release().split(".");return Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in r)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((e=>e in r))||"codeship"===r.CI_NAME?1:i;if("TEAMCITY_VERSION"in r)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(r.TEAMCITY_VERSION)?1:0;if("truecolor"===r.COLORTERM)return 3;if("TERM_PROGRAM"in r){const e=parseInt((r.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(r.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(r.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(r.TERM)||"COLORTERM"in r?1:i}return n("no-color")||n("no-colors")||n("color=false")||n("color=never")?u=0:(n("color")||n("colors")||n("color=true")||n("color=always"))&&(u=1),"FORCE_COLOR"in r&&(u="true"===r.FORCE_COLOR?1:"false"===r.FORCE_COLOR?0:0===r.FORCE_COLOR.length?1:Math.min(parseInt(r.FORCE_COLOR,10),3)),jr={supportsColor:function(e){return o(i(e,e&&e.isTTY))},stdout:o(i(!0,t.isatty(1))),stderr:o(i(!0,t.isatty(2)))}}();e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,t)=>{const n=t.substring(6).toLowerCase().replace(/_([a-z])/g,((e,t)=>t.toUpperCase()));let r=process.env[t];return r=!!/^(yes|on|true|enabled)$/i.test(r)||!/^(no|off|false|disabled)$/i.test(r)&&("null"===r?null:Number(r)),e[n]=r,e}),{}),e.exports=Rr()(t);const{formatters:u}=e.exports;u.o=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")},u.O=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts)}}(Gr,Gr.exports)),Gr.exports}Jr=Nr,"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?Jr.exports=(Br||(Br=1,function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,u=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(u=r))})),t.splice(u,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=Rr()(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(Ir,Ir.exports)),Ir.exports):Jr.exports=Ur();var Wr=function(e){return(e=e||{}).circles?function(e){var t=[],n=[];return e.proto?function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=zr(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o}:function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u)if(!1!==Object.hasOwnProperty.call(u,i)){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=zr(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o};function r(e,r){for(var u=Object.keys(e),o=new Array(u.length),i=0;i!e,Qr=e=>e&&"object"==typeof e&&!Array.isArray(e),eu=(e,t,n)=>{(Array.isArray(t)?t:[t]).forEach((t=>{if(t)throw new Error(`Problem with log4js configuration: (${Kr.inspect(e,{depth:5})}) - ${n}`)}))};var tu={configure:e=>{qr("New configuration to be validated: ",e),eu(e,Zr(Qr(e)),"must be an object."),qr(`Calling pre-processing listeners (${Yr.length})`),Yr.forEach((t=>t(e))),qr("Configuration pre-processing finished."),qr(`Calling configuration listeners (${Xr.length})`),Xr.forEach((t=>t(e))),qr("Configuration finished.")},addListener:e=>{Xr.push(e),qr(`Added listener, now ${Xr.length} listeners`)},addPreProcessingListener:e=>{Yr.push(e),qr(`Added pre-processing listener, now ${Yr.length} listeners`)},throwExceptionIf:eu,anObject:Qr,anInteger:e=>e&&"number"==typeof e&&Number.isInteger(e),validIdentifier:e=>/^[A-Za-z][A-Za-z0-9_]*$/g.test(e),not:Zr},nu={exports:{}};!function(e){function t(e,t){for(var n=e.toString();n.length-1?s:c,l=n(u.getHours()),f=n(u.getMinutes()),d=n(u.getSeconds()),D=t(u.getMilliseconds(),3),p=function(e){var t=Math.abs(e),n=String(Math.floor(t/60)),r=String(t%60);return n=("0"+n).slice(-2),r=("0"+r).slice(-2),0===e?"Z":(e<0?"+":"-")+n+":"+r}(u.getTimezoneOffset());return r.replace(/dd/g,o).replace(/MM/g,i).replace(/y{1,4}/g,a).replace(/hh/g,l).replace(/mm/g,f).replace(/ss/g,d).replace(/SSS/g,D).replace(/O/g,p)}function u(e,t,n,r){e["set"+(r?"":"UTC")+t](n)}e.exports=r,e.exports.asString=r,e.exports.parse=function(t,n,r){if(!t)throw new Error("pattern must be supplied");return function(t,n,r){var o=t.indexOf("O")<0,i=!1,s=[{pattern:/y{1,4}/,regexp:"\\d{1,4}",fn:function(e,t){u(e,"FullYear",t,o)}},{pattern:/MM/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Month",t-1,o),e.getMonth()!==t-1&&(i=!0)}},{pattern:/dd/,regexp:"\\d{1,2}",fn:function(e,t){i&&u(e,"Month",e.getMonth()-1,o),u(e,"Date",t,o)}},{pattern:/hh/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Hours",t,o)}},{pattern:/mm/,regexp:"\\d\\d",fn:function(e,t){u(e,"Minutes",t,o)}},{pattern:/ss/,regexp:"\\d\\d",fn:function(e,t){u(e,"Seconds",t,o)}},{pattern:/SSS/,regexp:"\\d\\d\\d",fn:function(e,t){u(e,"Milliseconds",t,o)}},{pattern:/O/,regexp:"[+-]\\d{1,2}:?\\d{2}?|Z",fn:function(e,t){t="Z"===t?0:t.replace(":","");var n=Math.abs(t),r=(t>0?-1:1)*(n%100+60*Math.floor(n/100));e.setUTCMinutes(e.getUTCMinutes()+r)}}],c=s.reduce((function(e,t){return t.pattern.test(e.regexp)?(t.index=e.regexp.match(t.pattern).index,e.regexp=e.regexp.replace(t.pattern,"("+t.regexp+")")):t.index=-1,e}),{regexp:t,index:[]}),a=s.filter((function(e){return e.index>-1}));a.sort((function(e,t){return e.index-t.index}));var l=new RegExp(c.regexp).exec(n);if(l){var f=r||e.exports.now();return a.forEach((function(e,t){e.fn(f,l[t+1])})),f}throw new Error("String '"+n+"' could not be parsed as '"+t+"'")}(t,n,r)},e.exports.now=function(){return new Date},e.exports.ISO8601_FORMAT="yyyy-MM-ddThh:mm:ss.SSS",e.exports.ISO8601_WITH_TZ_OFFSET_FORMAT="yyyy-MM-ddThh:mm:ss.SSSO",e.exports.DATETIME_FORMAT="dd MM yyyy hh:mm:ss.SSS",e.exports.ABSOLUTETIME_FORMAT="hh:mm:ss.SSS"}(nu);const ru=nu.exports,uu=E.default,ou=F.default,iu=p.default,su={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[90,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[91,39],yellow:[33,39]};function cu(e){return e?`[${su[e][0]}m`:""}function au(e){return e?`[${su[e][1]}m`:""}function lu(e,t){return n=ou.format("[%s] [%s] %s - ",ru.asString(e.startTime),e.level.toString(),e.categoryName),cu(r=t)+n+au(r);var n,r}function fu(e){return lu(e)+ou.format(...e.data)}function du(e){return lu(e,e.level.colour)+ou.format(...e.data)}function Du(e){return ou.format(...e.data)}function pu(e){return e.data[0]}function Eu(e,t){const n=/%(-?[0-9]+)?(\.?-?[0-9]+)?([[\]cdhmnprzxXyflos%])(\{([^}]+)\})?|([^%]+)/;function r(e){return e&&e.pid?e.pid.toString():process.pid.toString()}e=e||"%r %p %c - %m%n";const u={c:function(e,t){let n=e.categoryName;if(t){const e=parseInt(t,10),r=n.split(".");ee&&(n=r.slice(-e).join(iu.sep))}return n},l:function(e){return e.lineNumber?`${e.lineNumber}`:""},o:function(e){return e.columnNumber?`${e.columnNumber}`:""},s:function(e){return e.callStack||""}};function o(e,t,n){return u[e](t,n)}function i(e,t,n){let r=e;return r=function(e,t){let n;return e?(n=parseInt(e.substr(1),10),n>0?t.slice(0,n):t.slice(n)):t}(t,r),r=function(e,t){let n;if(e)if("-"===e.charAt(0))for(n=parseInt(e.substr(1),10);t.lengthDu,basic:()=>fu,colored:()=>du,coloured:()=>du,pattern:e=>Eu(e&&e.pattern,e&&e.tokens),dummy:()=>pu};var hu={basicLayout:fu,messagePassThroughLayout:Du,patternLayout:Eu,colouredLayout:du,coloredLayout:du,dummyLayout:pu,addLayout(e,t){mu[e]=t},layout:(e,t)=>mu[e]&&mu[e](t)};const yu=tu,Cu=["white","grey","black","blue","cyan","green","magenta","red","yellow"];class Fu{constructor(e,t,n){this.level=e,this.levelStr=t,this.colour=n}toString(){return this.levelStr}static getLevel(e,t){return e?e instanceof Fu?e:(e instanceof Object&&e.levelStr&&(e=e.levelStr),Fu[e.toString().toUpperCase()]||t):t}static addLevels(e){if(e){Object.keys(e).forEach((t=>{const n=t.toUpperCase();Fu[n]=new Fu(e[t].value,n,e[t].colour);const r=Fu.levels.findIndex((e=>e.levelStr===n));r>-1?Fu.levels[r]=Fu[n]:Fu.levels.push(Fu[n])})),Fu.levels.sort(((e,t)=>e.level-t.level))}}isLessThanOrEqualTo(e){return"string"==typeof e&&(e=Fu.getLevel(e)),this.level<=e.level}isGreaterThanOrEqualTo(e){return"string"==typeof e&&(e=Fu.getLevel(e)),this.level>=e.level}isEqualTo(e){return"string"==typeof e&&(e=Fu.getLevel(e)),this.level===e.level}}Fu.levels=[],Fu.addLevels({ALL:{value:Number.MIN_VALUE,colour:"grey"},TRACE:{value:5e3,colour:"blue"},DEBUG:{value:1e4,colour:"cyan"},INFO:{value:2e4,colour:"green"},WARN:{value:3e4,colour:"yellow"},ERROR:{value:4e4,colour:"red"},FATAL:{value:5e4,colour:"magenta"},MARK:{value:9007199254740992,colour:"grey"},OFF:{value:Number.MAX_VALUE,colour:"grey"}}),yu.addListener((e=>{const t=e.levels;if(t){yu.throwExceptionIf(e,yu.not(yu.anObject(t)),"levels must be an object");Object.keys(t).forEach((n=>{yu.throwExceptionIf(e,yu.not(yu.validIdentifier(n)),`level name "${n}" is not a valid identifier (must start with a letter, only contain A-Z,a-z,0-9,_)`),yu.throwExceptionIf(e,yu.not(yu.anObject(t[n])),`level "${n}" must be an object`),yu.throwExceptionIf(e,yu.not(t[n].value),`level "${n}" must have a 'value' property`),yu.throwExceptionIf(e,yu.not(yu.anInteger(t[n].value)),`level "${n}".value must have an integer value`),yu.throwExceptionIf(e,yu.not(t[n].colour),`level "${n}" must have a 'colour' property`),yu.throwExceptionIf(e,yu.not(Cu.indexOf(t[n].colour)>-1),`level "${n}".colour must be one of ${Cu.join(", ")}`)}))}})),yu.addListener((e=>{Fu.addLevels(e.levels)}));var gu=Fu,Au={exports:{}},vu={};/*! (c) 2020 Andrea Giammarchi */ -const{parse:Su,stringify:wu}=JSON,{keys:Ou}=Object,bu=String,_u="string",Bu={},Pu="object",ku=(e,t)=>t,xu=e=>e instanceof bu?bu(e):e,Nu=(e,t)=>typeof t===_u?new bu(t):t,Iu=(e,t,n,r)=>{const u=[];for(let o=Ou(n),{length:i}=o,s=0;s{const r=bu(t.push(n)-1);return e.set(n,r),r},Ru=(e,t)=>{const n=Su(e,Nu).map(xu),r=n[0],u=t||ku,o=typeof r===Pu&&r?Iu(n,new Set,r,u):r;return u.call({"":o},"",o)};vu.parse=Ru;const Mu=(e,t,n)=>{const r=t&&typeof t===Pu?(e,n)=>""===e||-1Su(Mu(e));vu.fromJSON=e=>Ru(wu(e));const Lu=vu,ju=gu;class $u{constructor(e,t,n,r,u){this.startTime=new Date,this.categoryName=e,this.data=n,this.level=t,this.context=Object.assign({},r),this.pid=process.pid,u&&(this.functionName=u.functionName,this.fileName=u.fileName,this.lineNumber=u.lineNumber,this.columnNumber=u.columnNumber,this.callStack=u.callStack)}serialise(){const e=this.data.map((e=>(e&&e.message&&e.stack&&(e=Object.assign({message:e.message,stack:e.stack},e)),e)));return this.data=e,Lu.stringify(this)}static deserialise(e){let t;try{const n=Lu.parse(e);n.data=n.data.map((e=>{if(e&&e.message&&e.stack){const t=new Error(e);Object.keys(e).forEach((n=>{t[n]=e[n]})),e=t}return e})),t=new $u(n.categoryName,ju.getLevel(n.level.levelStr),n.data,n.context),t.startTime=new Date(n.startTime),t.pid=n.pid,t.cluster=n.cluster}catch(n){t=new $u("log4js",ju.ERROR,["Unable to parse log:",e,"because: ",n])}return t}}var Hu=$u;const Ju=Nr.exports("log4js:clustering"),Gu=Hu,Vu=tu;let Uu=!1,Wu=null;try{Wu=require("cluster")}catch(e){Ju("cluster module not present"),Uu=!0}const zu=[];let Ku=!1,qu="NODE_APP_INSTANCE";const Yu=()=>Ku&&"0"===process.env[qu],Xu=()=>Uu||Wu.isMaster||Yu(),Zu=e=>{zu.forEach((t=>t(e)))},Qu=(e,t)=>{if(Ju("cluster message received from worker ",e,": ",t),e.topic&&e.data&&(t=e,e=void 0),t&&t.topic&&"log4js:message"===t.topic){Ju("received message: ",t.data);const e=Gu.deserialise(t.data);Zu(e)}};Uu||Vu.addListener((e=>{zu.length=0,({pm2:Ku,disableClustering:Uu,pm2InstanceVar:qu="NODE_APP_INSTANCE"}=e),Ju(`clustering disabled ? ${Uu}`),Ju(`cluster.isMaster ? ${Wu&&Wu.isMaster}`),Ju(`pm2 enabled ? ${Ku}`),Ju(`pm2InstanceVar = ${qu}`),Ju(`process.env[${qu}] = ${process.env[qu]}`),Ku&&process.removeListener("message",Qu),Wu&&Wu.removeListener&&Wu.removeListener("message",Qu),Uu||e.disableClustering?Ju("Not listening for cluster messages, because clustering disabled."):Yu()?(Ju("listening for PM2 broadcast messages"),process.on("message",Qu)):Wu.isMaster?(Ju("listening for cluster messages"),Wu.on("message",Qu)):Ju("not listening for messages, because we are not a master process")}));var eo={onlyOnMaster:(e,t)=>Xu()?e():t,isMaster:Xu,send:e=>{Xu()?Zu(e):(Ku||(e.cluster={workerId:Wu.worker.id,worker:process.pid}),process.send({topic:"log4js:message",data:e.serialise()}))},onMessage:e=>{zu.push(e)}},to={};function no(e){if("number"==typeof e&&Number.isInteger(e))return e;const t={K:1024,M:1048576,G:1073741824},n=Object.keys(t),r=e.substr(e.length-1).toLocaleUpperCase(),u=e.substring(0,e.length-1).trim();if(n.indexOf(r)<0||!Number.isInteger(Number(u)))throw Error(`maxLogSize: "${e}" is invalid`);return u*t[r]}function ro(e){return function(e,t){const n=Object.assign({},t);return Object.keys(e).forEach((r=>{n[r]&&(n[r]=e[r](t[r]))})),n}({maxLogSize:no},e)}const uo={file:ro,fileSync:ro};to.modifyConfig=e=>uo[e.type]?uo[e.type](e):e;var oo={};const io=console.log.bind(console);oo.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{io(e(n,t))}}(n,e.timezoneOffset)};var so={};so.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stdout.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var co={};co.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stderr.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var ao={};ao.configure=function(e,t,n,r){const u=n(e.appender);return function(e,t,n,r){const u=r.getLevel(e),o=r.getLevel(t,r.FATAL);return e=>{const t=e.level;t.isGreaterThanOrEqualTo(u)&&t.isLessThanOrEqualTo(o)&&n(e)}}(e.level,e.maxLevel,u,r)};var lo={};const fo=Nr.exports("log4js:categoryFilter");lo.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return"string"==typeof e&&(e=[e]),n=>{fo(`Checking ${n.categoryName} against ${e}`),-1===e.indexOf(n.categoryName)&&(fo("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var Do={};const po=Nr.exports("log4js:noLogFilter");Do.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return n=>{po(`Checking data: ${n.data} against filters: ${e}`),"string"==typeof e&&(e=[e]),e=e.filter((e=>null!=e&&""!==e));const r=new RegExp(e.join("|"),"i");(0===e.length||n.data.findIndex((e=>r.test(e)))<0)&&(po("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var Eo={},mo={exports:{}},ho={},yo={fromCallback:function(e){return Object.defineProperty((function(){if("function"!=typeof arguments[arguments.length-1])return new Promise(((t,n)=>{arguments[arguments.length]=(e,r)=>{if(e)return n(e);t(r)},arguments.length++,e.apply(this,arguments)}));e.apply(this,arguments)}),"name",{value:e.name})},fromPromise:function(e){return Object.defineProperty((function(){const t=arguments[arguments.length-1];if("function"!=typeof t)return e.apply(this,arguments);e.apply(this,arguments).then((e=>t(null,e)),t)}),"name",{value:e.name})}};!function(e){const t=yo.fromCallback,n=we,r=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchown","lchmod","link","lstat","mkdir","mkdtemp","open","readFile","readdir","readlink","realpath","rename","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((e=>"function"==typeof n[e]));Object.keys(n).forEach((t=>{"promises"!==t&&(e[t]=n[t])})),r.forEach((r=>{e[r]=t(n[r])})),e.exists=function(e,t){return"function"==typeof t?n.exists(e,t):new Promise((t=>n.exists(e,t)))},e.read=function(e,t,r,u,o,i){return"function"==typeof i?n.read(e,t,r,u,o,i):new Promise(((i,s)=>{n.read(e,t,r,u,o,((e,t,n)=>{if(e)return s(e);i({bytesRead:t,buffer:n})}))}))},e.write=function(e,t,...r){return"function"==typeof r[r.length-1]?n.write(e,t,...r):new Promise(((u,o)=>{n.write(e,t,...r,((e,t,n)=>{if(e)return o(e);u({bytesWritten:t,buffer:n})}))}))},"function"==typeof n.realpath.native&&(e.realpath.native=t(n.realpath.native))}(ho);const Co=p.default;function Fo(e){return(e=Co.normalize(Co.resolve(e)).split(Co.sep)).length>0?e[0]:null}const go=/[<>:"|?*]/;var Ao=function(e){const t=Fo(e);return e=e.replace(t,""),go.test(e)};const vo=we,So=p.default,wo=Ao,Oo=parseInt("0777",8);var bo=function e(t,n,r,u){if("function"==typeof n?(r=n,n={}):n&&"object"==typeof n||(n={mode:n}),"win32"===process.platform&&wo(t)){const e=new Error(t+" contains invalid WIN32 path characters.");return e.code="EINVAL",r(e)}let o=n.mode;const i=n.fs||vo;void 0===o&&(o=Oo&~process.umask()),u||(u=null),r=r||function(){},t=So.resolve(t),i.mkdir(t,o,(o=>{if(!o)return r(null,u=u||t);if("ENOENT"===o.code){if(So.dirname(t)===t)return r(o);e(So.dirname(t),n,((u,o)=>{u?r(u,o):e(t,n,r,o)}))}else i.stat(t,((e,t)=>{e||!t.isDirectory()?r(o,u):r(null,u)}))}))};const _o=we,Bo=p.default,Po=Ao,ko=parseInt("0777",8);var xo=function e(t,n,r){n&&"object"==typeof n||(n={mode:n});let u=n.mode;const o=n.fs||_o;if("win32"===process.platform&&Po(t)){const e=new Error(t+" contains invalid WIN32 path characters.");throw e.code="EINVAL",e}void 0===u&&(u=ko&~process.umask()),r||(r=null),t=Bo.resolve(t);try{o.mkdirSync(t,u),r=r||t}catch(u){if("ENOENT"===u.code){if(Bo.dirname(t)===t)throw u;r=e(Bo.dirname(t),n,r),e(t,n,r)}else{let e;try{e=o.statSync(t)}catch(e){throw u}if(!e.isDirectory())throw u}}return r};const No=(0,yo.fromCallback)(bo);var Io={mkdirs:No,mkdirsSync:xo,mkdirp:No,mkdirpSync:xo,ensureDir:No,ensureDirSync:xo};const To=we;E.default,p.default;var Ro=function(e,t,n,r){To.open(e,"r+",((e,u)=>{if(e)return r(e);To.futimes(u,t,n,(e=>{To.close(u,(t=>{r&&r(e||t)}))}))}))},Mo=function(e,t,n){const r=To.openSync(e,"r+");return To.futimesSync(r,t,n),To.closeSync(r)};const Lo=we,jo=p.default,$o=10,Ho=5,Jo=0,Go=process.versions.node.split("."),Vo=Number.parseInt(Go[0],10),Uo=Number.parseInt(Go[1],10),Wo=Number.parseInt(Go[2],10);function zo(){if(Vo>$o)return!0;if(Vo===$o){if(Uo>Ho)return!0;if(Uo===Ho&&Wo>=Jo)return!0}return!1}function Ko(e,t){const n=jo.resolve(e).split(jo.sep).filter((e=>e)),r=jo.resolve(t).split(jo.sep).filter((e=>e));return n.reduce(((e,t,n)=>e&&r[n]===t),!0)}function qo(e,t,n){return`Cannot ${n} '${e}' to a subdirectory of itself, '${t}'.`}var Yo,Xo,Zo={checkPaths:function(e,t,n,r){!function(e,t,n){zo()?Lo.stat(e,{bigint:!0},((e,r)=>{if(e)return n(e);Lo.stat(t,{bigint:!0},((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))})):Lo.stat(e,((e,r)=>{if(e)return n(e);Lo.stat(t,((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))}))}(e,t,((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;return s&&s.ino&&s.dev&&s.ino===i.ino&&s.dev===i.dev?r(new Error("Source and destination must not be the same.")):i.isDirectory()&&Ko(e,t)?r(new Error(qo(e,t,n))):r(null,{srcStat:i,destStat:s})}))},checkPathsSync:function(e,t,n){const{srcStat:r,destStat:u}=function(e,t){let n,r;n=zo()?Lo.statSync(e,{bigint:!0}):Lo.statSync(e);try{r=zo()?Lo.statSync(t,{bigint:!0}):Lo.statSync(t)}catch(e){if("ENOENT"===e.code)return{srcStat:n,destStat:null};throw e}return{srcStat:n,destStat:r}}(e,t);if(u&&u.ino&&u.dev&&u.ino===r.ino&&u.dev===r.dev)throw new Error("Source and destination must not be the same.");if(r.isDirectory()&&Ko(e,t))throw new Error(qo(e,t,n));return{srcStat:r,destStat:u}},checkParentPaths:function e(t,n,r,u,o){const i=jo.resolve(jo.dirname(t)),s=jo.resolve(jo.dirname(r));if(s===i||s===jo.parse(s).root)return o();zo()?Lo.stat(s,{bigint:!0},((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(qo(t,r,u))):e(t,n,s,u,o))):Lo.stat(s,((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(qo(t,r,u))):e(t,n,s,u,o)))},checkParentPathsSync:function e(t,n,r,u){const o=jo.resolve(jo.dirname(t)),i=jo.resolve(jo.dirname(r));if(i===o||i===jo.parse(i).root)return;let s;try{s=zo()?Lo.statSync(i,{bigint:!0}):Lo.statSync(i)}catch(e){if("ENOENT"===e.code)return;throw e}if(s.ino&&s.dev&&s.ino===n.ino&&s.dev===n.dev)throw new Error(qo(t,r,u));return e(t,n,i,u)},isSrcSubdir:Ko};const Qo=we,ei=p.default,ti=Io.mkdirsSync,ni=Mo,ri=Zo;function ui(e,t,n,r){if(!r.filter||r.filter(t,n))return function(e,t,n,r){const u=r.dereference?Qo.statSync:Qo.lstatSync,o=u(t);if(o.isDirectory())return function(e,t,n,r,u){if(!t)return function(e,t,n,r){return Qo.mkdirSync(n),ii(t,n,r),Qo.chmodSync(n,e.mode)}(e,n,r,u);if(t&&!t.isDirectory())throw new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`);return ii(n,r,u)}(o,e,t,n,r);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return function(e,t,n,r,u){return t?function(e,t,n,r){if(r.overwrite)return Qo.unlinkSync(n),oi(e,t,n,r);if(r.errorOnExist)throw new Error(`'${n}' already exists`)}(e,n,r,u):oi(e,n,r,u)}(o,e,t,n,r);if(o.isSymbolicLink())return function(e,t,n,r){let u=Qo.readlinkSync(t);r.dereference&&(u=ei.resolve(process.cwd(),u));if(e){let e;try{e=Qo.readlinkSync(n)}catch(e){if("EINVAL"===e.code||"UNKNOWN"===e.code)return Qo.symlinkSync(u,n);throw e}if(r.dereference&&(e=ei.resolve(process.cwd(),e)),ri.isSrcSubdir(u,e))throw new Error(`Cannot copy '${u}' to a subdirectory of itself, '${e}'.`);if(Qo.statSync(n).isDirectory()&&ri.isSrcSubdir(e,u))throw new Error(`Cannot overwrite '${e}' with '${u}'.`);return function(e,t){return Qo.unlinkSync(t),Qo.symlinkSync(e,t)}(u,n)}return Qo.symlinkSync(u,n)}(e,t,n,r)}(e,t,n,r)}function oi(e,t,n,r){return"function"==typeof Qo.copyFileSync?(Qo.copyFileSync(t,n),Qo.chmodSync(n,e.mode),r.preserveTimestamps?ni(n,e.atime,e.mtime):void 0):function(e,t,n,r){const u=65536,o=(Xo?Yo:(Xo=1,Yo=function(e){if("function"==typeof Buffer.allocUnsafe)try{return Buffer.allocUnsafe(e)}catch(t){return new Buffer(e)}return new Buffer(e)}))(u),i=Qo.openSync(t,"r"),s=Qo.openSync(n,"w",e.mode);let c=0;for(;cfunction(e,t,n,r){const u=ei.join(t,e),o=ei.join(n,e),{destStat:i}=ri.checkPathsSync(u,o,"copy");return ui(i,u,o,r)}(r,e,t,n)))}var si=function(e,t,n){"function"==typeof n&&(n={filter:n}),(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269");const{srcStat:r,destStat:u}=ri.checkPathsSync(e,t,"copy");return ri.checkParentPathsSync(e,r,t,"copy"),function(e,t,n,r){if(r.filter&&!r.filter(t,n))return;const u=ei.dirname(n);Qo.existsSync(u)||ti(u);return ui(e,t,n,r)}(u,e,t,n)},ci={copySync:si};const ai=yo.fromPromise,li=ho;var fi={pathExists:ai((function(e){return li.access(e).then((()=>!0)).catch((()=>!1))})),pathExistsSync:li.existsSync};const di=we,Di=p.default,pi=Io.mkdirs,Ei=fi.pathExists,mi=Ro,hi=Zo;function yi(e,t,n,r,u){const o=Di.dirname(n);Ei(o,((i,s)=>i?u(i):s?Fi(e,t,n,r,u):void pi(o,(o=>o?u(o):Fi(e,t,n,r,u)))))}function Ci(e,t,n,r,u,o){Promise.resolve(u.filter(n,r)).then((i=>i?e(t,n,r,u,o):o()),(e=>o(e)))}function Fi(e,t,n,r,u){return r.filter?Ci(gi,e,t,n,r,u):gi(e,t,n,r,u)}function gi(e,t,n,r,u){(r.dereference?di.stat:di.lstat)(t,((o,i)=>o?u(o):i.isDirectory()?function(e,t,n,r,u,o){if(!t)return function(e,t,n,r,u){di.mkdir(n,(o=>{if(o)return u(o);Si(t,n,r,(t=>t?u(t):di.chmod(n,e.mode,u)))}))}(e,n,r,u,o);if(t&&!t.isDirectory())return o(new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`));return Si(n,r,u,o)}(i,e,t,n,r,u):i.isFile()||i.isCharacterDevice()||i.isBlockDevice()?function(e,t,n,r,u,o){return t?function(e,t,n,r,u){if(!r.overwrite)return r.errorOnExist?u(new Error(`'${n}' already exists`)):u();di.unlink(n,(o=>o?u(o):Ai(e,t,n,r,u)))}(e,n,r,u,o):Ai(e,n,r,u,o)}(i,e,t,n,r,u):i.isSymbolicLink()?function(e,t,n,r,u){di.readlink(t,((t,o)=>t?u(t):(r.dereference&&(o=Di.resolve(process.cwd(),o)),e?void di.readlink(n,((t,i)=>t?"EINVAL"===t.code||"UNKNOWN"===t.code?di.symlink(o,n,u):u(t):(r.dereference&&(i=Di.resolve(process.cwd(),i)),hi.isSrcSubdir(o,i)?u(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${i}'.`)):e.isDirectory()&&hi.isSrcSubdir(i,o)?u(new Error(`Cannot overwrite '${i}' with '${o}'.`)):function(e,t,n){di.unlink(t,(r=>r?n(r):di.symlink(e,t,n)))}(o,n,u)))):di.symlink(o,n,u))))}(e,t,n,r,u):void 0))}function Ai(e,t,n,r,u){return"function"==typeof di.copyFile?di.copyFile(t,n,(t=>t?u(t):vi(e,n,r,u))):function(e,t,n,r,u){const o=di.createReadStream(t);o.on("error",(e=>u(e))).once("open",(()=>{const t=di.createWriteStream(n,{mode:e.mode});t.on("error",(e=>u(e))).on("open",(()=>o.pipe(t))).once("close",(()=>vi(e,n,r,u)))}))}(e,t,n,r,u)}function vi(e,t,n,r){di.chmod(t,e.mode,(u=>u?r(u):n.preserveTimestamps?mi(t,e.atime,e.mtime,r):r()))}function Si(e,t,n,r){di.readdir(e,((u,o)=>u?r(u):wi(o,e,t,n,r)))}function wi(e,t,n,r,u){const o=e.pop();return o?function(e,t,n,r,u,o){const i=Di.join(n,t),s=Di.join(r,t);hi.checkPaths(i,s,"copy",((t,c)=>{if(t)return o(t);const{destStat:a}=c;Fi(a,i,s,u,(t=>t?o(t):wi(e,n,r,u,o)))}))}(e,o,t,n,r,u):u()}var Oi=function(e,t,n,r){"function"!=typeof n||r?"function"==typeof n&&(n={filter:n}):(r=n,n={}),r=r||function(){},(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269"),hi.checkPaths(e,t,"copy",((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;hi.checkParentPaths(e,i,t,"copy",(u=>u?r(u):n.filter?Ci(yi,s,e,t,n,r):yi(s,e,t,n,r)))}))};var bi={copy:(0,yo.fromCallback)(Oi)};const _i=we,Bi=p.default,Pi=g.default,ki="win32"===process.platform;function xi(e){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((t=>{e[t]=e[t]||_i[t],e[t+="Sync"]=e[t]||_i[t]})),e.maxBusyTries=e.maxBusyTries||3}function Ni(e,t,n){let r=0;"function"==typeof t&&(n=t,t={}),Pi(e,"rimraf: missing path"),Pi.strictEqual(typeof e,"string","rimraf: path should be a string"),Pi.strictEqual(typeof n,"function","rimraf: callback function required"),Pi(t,"rimraf: invalid options argument provided"),Pi.strictEqual(typeof t,"object","rimraf: options should be object"),xi(t),Ii(e,t,(function u(o){if(o){if(("EBUSY"===o.code||"ENOTEMPTY"===o.code||"EPERM"===o.code)&&rIi(e,t,u)),100*r)}"ENOENT"===o.code&&(o=null)}n(o)}))}function Ii(e,t,n){Pi(e),Pi(t),Pi("function"==typeof n),t.lstat(e,((r,u)=>r&&"ENOENT"===r.code?n(null):r&&"EPERM"===r.code&&ki?Ti(e,t,r,n):u&&u.isDirectory()?Mi(e,t,r,n):void t.unlink(e,(r=>{if(r){if("ENOENT"===r.code)return n(null);if("EPERM"===r.code)return ki?Ti(e,t,r,n):Mi(e,t,r,n);if("EISDIR"===r.code)return Mi(e,t,r,n)}return n(r)}))))}function Ti(e,t,n,r){Pi(e),Pi(t),Pi("function"==typeof r),n&&Pi(n instanceof Error),t.chmod(e,438,(u=>{u?r("ENOENT"===u.code?null:n):t.stat(e,((u,o)=>{u?r("ENOENT"===u.code?null:n):o.isDirectory()?Mi(e,t,n,r):t.unlink(e,r)}))}))}function Ri(e,t,n){let r;Pi(e),Pi(t),n&&Pi(n instanceof Error);try{t.chmodSync(e,438)}catch(e){if("ENOENT"===e.code)return;throw n}try{r=t.statSync(e)}catch(e){if("ENOENT"===e.code)return;throw n}r.isDirectory()?ji(e,t,n):t.unlinkSync(e)}function Mi(e,t,n,r){Pi(e),Pi(t),n&&Pi(n instanceof Error),Pi("function"==typeof r),t.rmdir(e,(u=>{!u||"ENOTEMPTY"!==u.code&&"EEXIST"!==u.code&&"EPERM"!==u.code?u&&"ENOTDIR"===u.code?r(n):r(u):function(e,t,n){Pi(e),Pi(t),Pi("function"==typeof n),t.readdir(e,((r,u)=>{if(r)return n(r);let o,i=u.length;if(0===i)return t.rmdir(e,n);u.forEach((r=>{Ni(Bi.join(e,r),t,(r=>{if(!o)return r?n(o=r):void(0==--i&&t.rmdir(e,n))}))}))}))}(e,t,r)}))}function Li(e,t){let n;xi(t=t||{}),Pi(e,"rimraf: missing path"),Pi.strictEqual(typeof e,"string","rimraf: path should be a string"),Pi(t,"rimraf: missing options"),Pi.strictEqual(typeof t,"object","rimraf: options should be object");try{n=t.lstatSync(e)}catch(n){if("ENOENT"===n.code)return;"EPERM"===n.code&&ki&&Ri(e,t,n)}try{n&&n.isDirectory()?ji(e,t,null):t.unlinkSync(e)}catch(n){if("ENOENT"===n.code)return;if("EPERM"===n.code)return ki?Ri(e,t,n):ji(e,t,n);if("EISDIR"!==n.code)throw n;ji(e,t,n)}}function ji(e,t,n){Pi(e),Pi(t),n&&Pi(n instanceof Error);try{t.rmdirSync(e)}catch(r){if("ENOTDIR"===r.code)throw n;if("ENOTEMPTY"===r.code||"EEXIST"===r.code||"EPERM"===r.code)!function(e,t){if(Pi(e),Pi(t),t.readdirSync(e).forEach((n=>Li(Bi.join(e,n),t))),!ki){return t.rmdirSync(e,t)}{const n=Date.now();do{try{return t.rmdirSync(e,t)}catch(e){}}while(Date.now()-n<500)}}(e,t);else if("ENOENT"!==r.code)throw r}}var $i=Ni;Ni.sync=Li;const Hi=$i;var Ji={remove:(0,yo.fromCallback)(Hi),removeSync:Hi.sync};const Gi=yo.fromCallback,Vi=we,Ui=p.default,Wi=Io,zi=Ji,Ki=Gi((function(e,t){t=t||function(){},Vi.readdir(e,((n,r)=>{if(n)return Wi.mkdirs(e,t);r=r.map((t=>Ui.join(e,t))),function e(){const n=r.pop();if(!n)return t();zi.remove(n,(n=>{if(n)return t(n);e()}))}()}))}));function qi(e){let t;try{t=Vi.readdirSync(e)}catch(t){return Wi.mkdirsSync(e)}t.forEach((t=>{t=Ui.join(e,t),zi.removeSync(t)}))}var Yi={emptyDirSync:qi,emptydirSync:qi,emptyDir:Ki,emptydir:Ki};const Xi=yo.fromCallback,Zi=p.default,Qi=we,es=Io,ts=fi.pathExists;var ns={createFile:Xi((function(e,t){function n(){Qi.writeFile(e,"",(e=>{if(e)return t(e);t()}))}Qi.stat(e,((r,u)=>{if(!r&&u.isFile())return t();const o=Zi.dirname(e);ts(o,((e,r)=>e?t(e):r?n():void es.mkdirs(o,(e=>{if(e)return t(e);n()}))))}))})),createFileSync:function(e){let t;try{t=Qi.statSync(e)}catch(e){}if(t&&t.isFile())return;const n=Zi.dirname(e);Qi.existsSync(n)||es.mkdirsSync(n),Qi.writeFileSync(e,"")}};const rs=yo.fromCallback,us=p.default,os=we,is=Io,ss=fi.pathExists;var cs={createLink:rs((function(e,t,n){function r(e,t){os.link(e,t,(e=>{if(e)return n(e);n(null)}))}ss(t,((u,o)=>u?n(u):o?n(null):void os.lstat(e,(u=>{if(u)return u.message=u.message.replace("lstat","ensureLink"),n(u);const o=us.dirname(t);ss(o,((u,i)=>u?n(u):i?r(e,t):void is.mkdirs(o,(u=>{if(u)return n(u);r(e,t)}))))}))))})),createLinkSync:function(e,t){if(os.existsSync(t))return;try{os.lstatSync(e)}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}const n=us.dirname(t);return os.existsSync(n)||is.mkdirsSync(n),os.linkSync(e,t)}};const as=p.default,ls=we,fs=fi.pathExists;var ds={symlinkPaths:function(e,t,n){if(as.isAbsolute(e))return ls.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:e})));{const r=as.dirname(t),u=as.join(r,e);return fs(u,((t,o)=>t?n(t):o?n(null,{toCwd:u,toDst:e}):ls.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:as.relative(r,e)})))))}},symlinkPathsSync:function(e,t){let n;if(as.isAbsolute(e)){if(n=ls.existsSync(e),!n)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}{const r=as.dirname(t),u=as.join(r,e);if(n=ls.existsSync(u),n)return{toCwd:u,toDst:e};if(n=ls.existsSync(e),!n)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:as.relative(r,e)}}}};const Ds=we;var ps={symlinkType:function(e,t,n){if(n="function"==typeof t?t:n,t="function"!=typeof t&&t)return n(null,t);Ds.lstat(e,((e,r)=>{if(e)return n(null,"file");t=r&&r.isDirectory()?"dir":"file",n(null,t)}))},symlinkTypeSync:function(e,t){let n;if(t)return t;try{n=Ds.lstatSync(e)}catch(e){return"file"}return n&&n.isDirectory()?"dir":"file"}};const Es=yo.fromCallback,ms=p.default,hs=we,ys=Io.mkdirs,Cs=Io.mkdirsSync,Fs=ds.symlinkPaths,gs=ds.symlinkPathsSync,As=ps.symlinkType,vs=ps.symlinkTypeSync,Ss=fi.pathExists;var ws={createSymlink:Es((function(e,t,n,r){r="function"==typeof n?n:r,n="function"!=typeof n&&n,Ss(t,((u,o)=>u?r(u):o?r(null):void Fs(e,t,((u,o)=>{if(u)return r(u);e=o.toDst,As(o.toCwd,n,((n,u)=>{if(n)return r(n);const o=ms.dirname(t);Ss(o,((n,i)=>n?r(n):i?hs.symlink(e,t,u,r):void ys(o,(n=>{if(n)return r(n);hs.symlink(e,t,u,r)}))))}))}))))})),createSymlinkSync:function(e,t,n){if(hs.existsSync(t))return;const r=gs(e,t);e=r.toDst,n=vs(r.toCwd,n);const u=ms.dirname(t);return hs.existsSync(u)||Cs(u),hs.symlinkSync(e,t,n)}};var Os,bs={createFile:ns.createFile,createFileSync:ns.createFileSync,ensureFile:ns.createFile,ensureFileSync:ns.createFileSync,createLink:cs.createLink,createLinkSync:cs.createLinkSync,ensureLink:cs.createLink,ensureLinkSync:cs.createLinkSync,createSymlink:ws.createSymlink,createSymlinkSync:ws.createSymlinkSync,ensureSymlink:ws.createSymlink,ensureSymlinkSync:ws.createSymlinkSync};try{Os=we}catch(e){Os=D.default}function _s(e,t){var n,r="\n";return"object"==typeof t&&null!==t&&(t.spaces&&(n=t.spaces),t.EOL&&(r=t.EOL)),JSON.stringify(e,t?t.replacer:null,n).replace(/\n/g,r)+r}function Bs(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e=e.replace(/^\uFEFF/,"")}var Ps={readFile:function(e,t,n){null==n&&(n=t,t={}),"string"==typeof t&&(t={encoding:t});var r=(t=t||{}).fs||Os,u=!0;"throws"in t&&(u=t.throws),r.readFile(e,t,(function(r,o){if(r)return n(r);var i;o=Bs(o);try{i=JSON.parse(o,t?t.reviver:null)}catch(t){return u?(t.message=e+": "+t.message,n(t)):n(null,null)}n(null,i)}))},readFileSync:function(e,t){"string"==typeof(t=t||{})&&(t={encoding:t});var n=t.fs||Os,r=!0;"throws"in t&&(r=t.throws);try{var u=n.readFileSync(e,t);return u=Bs(u),JSON.parse(u,t.reviver)}catch(t){if(r)throw t.message=e+": "+t.message,t;return null}},writeFile:function(e,t,n,r){null==r&&(r=n,n={});var u=(n=n||{}).fs||Os,o="";try{o=_s(t,n)}catch(e){return void(r&&r(e,null))}u.writeFile(e,o,n,r)},writeFileSync:function(e,t,n){var r=(n=n||{}).fs||Os,u=_s(t,n);return r.writeFileSync(e,u,n)}},ks=Ps;const xs=yo.fromCallback,Ns=ks;var Is={readJson:xs(Ns.readFile),readJsonSync:Ns.readFileSync,writeJson:xs(Ns.writeFile),writeJsonSync:Ns.writeFileSync};const Ts=p.default,Rs=Io,Ms=fi.pathExists,Ls=Is;var js=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=Ts.dirname(e);Ms(u,((o,i)=>o?r(o):i?Ls.writeJson(e,t,n,r):void Rs.mkdirs(u,(u=>{if(u)return r(u);Ls.writeJson(e,t,n,r)}))))};const $s=we,Hs=p.default,Js=Io,Gs=Is;var Vs=function(e,t,n){const r=Hs.dirname(e);$s.existsSync(r)||Js.mkdirsSync(r),Gs.writeJsonSync(e,t,n)};const Us=yo.fromCallback,Ws=Is;Ws.outputJson=Us(js),Ws.outputJsonSync=Vs,Ws.outputJSON=Ws.outputJson,Ws.outputJSONSync=Ws.outputJsonSync,Ws.writeJSON=Ws.writeJson,Ws.writeJSONSync=Ws.writeJsonSync,Ws.readJSON=Ws.readJson,Ws.readJSONSync=Ws.readJsonSync;var zs=Ws;const Ks=we,qs=p.default,Ys=ci.copySync,Xs=Ji.removeSync,Zs=Io.mkdirpSync,Qs=Zo;function ec(e,t,n){try{Ks.renameSync(e,t)}catch(r){if("EXDEV"!==r.code)throw r;return function(e,t,n){const r={overwrite:n,errorOnExist:!0};return Ys(e,t,r),Xs(e)}(e,t,n)}}var tc=function(e,t,n){const r=(n=n||{}).overwrite||n.clobber||!1,{srcStat:u}=Qs.checkPathsSync(e,t,"move");return Qs.checkParentPathsSync(e,u,t,"move"),Zs(qs.dirname(t)),function(e,t,n){if(n)return Xs(t),ec(e,t,n);if(Ks.existsSync(t))throw new Error("dest already exists.");return ec(e,t,n)}(e,t,r)},nc={moveSync:tc};const rc=we,uc=p.default,oc=bi.copy,ic=Ji.remove,sc=Io.mkdirp,cc=fi.pathExists,ac=Zo;function lc(e,t,n,r){rc.rename(e,t,(u=>u?"EXDEV"!==u.code?r(u):function(e,t,n,r){const u={overwrite:n,errorOnExist:!0};oc(e,t,u,(t=>t?r(t):ic(e,r)))}(e,t,n,r):r()))}var fc=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=n.overwrite||n.clobber||!1;ac.checkPaths(e,t,"move",((n,o)=>{if(n)return r(n);const{srcStat:i}=o;ac.checkParentPaths(e,i,t,"move",(n=>{if(n)return r(n);sc(uc.dirname(t),(n=>n?r(n):function(e,t,n,r){if(n)return ic(t,(u=>u?r(u):lc(e,t,n,r)));cc(t,((u,o)=>u?r(u):o?r(new Error("dest already exists.")):lc(e,t,n,r)))}(e,t,u,r)))}))}))};var dc={move:(0,yo.fromCallback)(fc)};const Dc=yo.fromCallback,pc=we,Ec=p.default,mc=Io,hc=fi.pathExists;var yc={outputFile:Dc((function(e,t,n,r){"function"==typeof n&&(r=n,n="utf8");const u=Ec.dirname(e);hc(u,((o,i)=>o?r(o):i?pc.writeFile(e,t,n,r):void mc.mkdirs(u,(u=>{if(u)return r(u);pc.writeFile(e,t,n,r)}))))})),outputFileSync:function(e,...t){const n=Ec.dirname(e);if(pc.existsSync(n))return pc.writeFileSync(e,...t);mc.mkdirsSync(n),pc.writeFileSync(e,...t)}};!function(e){e.exports=Object.assign({},ho,ci,bi,Yi,bs,zs,Io,nc,dc,yc,fi,Ji);const t=D.default;Object.getOwnPropertyDescriptor(t,"promises")&&Object.defineProperty(e.exports,"promises",{get:()=>t.promises})}(mo);const Cc=Nr.exports("streamroller:fileNameFormatter"),Fc=p.default;const gc=Nr.exports("streamroller:fileNameParser"),Ac=nu.exports;const vc=Nr.exports("streamroller:moveAndMaybeCompressFile"),Sc=mo.exports,wc=v.default;var Oc=async(e,t,n)=>{if(n=function(e){const t={mode:parseInt("0600",8),compress:!1},n=Object.assign({},t,e);return vc(`_parseOption: moveAndMaybeCompressFile called with option=${JSON.stringify(n)}`),n}(n),e!==t){if(await Sc.pathExists(e))if(vc(`moveAndMaybeCompressFile: moving file from ${e} to ${t} ${n.compress?"with":"without"} compress`),n.compress)await new Promise(((r,u)=>{let o=!1;const i=Sc.createWriteStream(t,{mode:n.mode,flags:"wx"}).on("open",(()=>{o=!0;const t=Sc.createReadStream(e).on("open",(()=>{t.pipe(wc.createGzip()).pipe(i)})).on("error",(t=>{vc(`moveAndMaybeCompressFile: error reading ${e}`,t),i.destroy(t)}))})).on("finish",(()=>{vc(`moveAndMaybeCompressFile: finished compressing ${t}, deleting ${e}`),Sc.unlink(e).then(r).catch((t=>{vc(`moveAndMaybeCompressFile: error deleting ${e}, truncating instead`,t),Sc.truncate(e).then(r).catch((t=>{vc(`moveAndMaybeCompressFile: error truncating ${e}`,t),u(t)}))}))})).on("error",(e=>{o?(vc(`moveAndMaybeCompressFile: error writing ${t}, deleting`,e),Sc.unlink(t).then((()=>{u(e)})).catch((e=>{vc(`moveAndMaybeCompressFile: error deleting ${t}`,e),u(e)}))):(vc(`moveAndMaybeCompressFile: error creating ${t}`,e),u(e))}))})).catch((()=>{}));else{vc(`moveAndMaybeCompressFile: renaming ${e} to ${t}`);try{await Sc.move(e,t,{overwrite:!0})}catch(n){if(vc(`moveAndMaybeCompressFile: error renaming ${e} to ${t}`,n),"ENOENT"!==n.code){vc("moveAndMaybeCompressFile: trying copy+truncate instead");try{await Sc.copy(e,t,{overwrite:!0}),await Sc.truncate(e)}catch(e){vc("moveAndMaybeCompressFile: error copy+truncate",e)}}}}}else vc("moveAndMaybeCompressFile: source and target are the same, not doing anything")};const bc=Nr.exports("streamroller:RollingFileWriteStream"),_c=mo.exports,Bc=p.default,Pc=E.default,kc=()=>new Date,xc=nu.exports,{Writable:Nc}=C.default,Ic=({file:e,keepFileExt:t,needsIndex:n,alwaysIncludeDate:r,compress:u,fileNameSep:o})=>{let i=o||".";const s=Fc.join(e.dir,e.name),c=t=>t+e.ext,a=(e,t,r)=>!n&&r||!t?e:e+i+t,l=(e,t,n)=>(t>0||r)&&n?e+i+n:e,f=(e,t)=>t&&u?e+".gz":e,d=t?[l,a,c,f]:[c,l,a,f];return({date:e,index:t})=>(Cc(`_formatFileName: date=${e}, index=${t}`),d.reduce(((n,r)=>r(n,t,e)),s))},Tc=({file:e,keepFileExt:t,pattern:n,fileNameSep:r})=>{let u=r||".";const o="__NOT_MATCHING__";let i=[(e,t)=>e.endsWith(".gz")?(gc("it is gzipped"),t.isCompressed=!0,e.slice(0,-1*".gz".length)):e,t?t=>t.startsWith(e.name)&&t.endsWith(e.ext)?(gc("it starts and ends with the right things"),t.slice(e.name.length+1,-1*e.ext.length)):o:t=>t.startsWith(e.base)?(gc("it starts with the right things"),t.slice(e.base.length+1)):o,n?(e,t)=>{const r=e.split(u);let o=r[r.length-1];gc("items: ",r,", indexStr: ",o);let i=e;void 0!==o&&o.match(/^\d+$/)?(i=e.slice(0,-1*(o.length+1)),gc(`dateStr is ${i}`),n&&!i&&(i=o,o="0")):o="0";try{const r=Ac.parse(n,i,new Date(0,0));return Ac.asString(n,r)!==i?e:(t.index=parseInt(o,10),t.date=i,t.timestamp=r.getTime(),"")}catch(t){return gc(`Problem parsing ${i} as ${n}, error was: `,t),e}}:(e,t)=>e.match(/^\d+$/)?(gc("it has an index"),t.index=parseInt(e,10),""):e];return e=>{let t={filename:e,index:0,isCompressed:!1};return i.reduce(((e,n)=>n(e,t)),e)?null:t}},Rc=Oc;var Mc=class extends Nc{constructor(e,t){if(bc(`constructor: creating RollingFileWriteStream. path=${e}`),"string"!=typeof e||0===e.length)throw new Error(`Invalid filename: ${e}`);if(e.endsWith(Bc.sep))throw new Error(`Filename is a directory: ${e}`);0===e.indexOf(`~${Bc.sep}`)&&(e=e.replace("~",Pc.homedir())),super(t),this.options=this._parseOption(t),this.fileObject=Bc.parse(e),""===this.fileObject.dir&&(this.fileObject=Bc.parse(Bc.join(process.cwd(),e))),this.fileFormatter=Ic({file:this.fileObject,alwaysIncludeDate:this.options.alwaysIncludePattern,needsIndex:this.options.maxSize 0`)}else delete n.maxSize;if(n.numBackups||0===n.numBackups){if(n.numBackups<0)throw new Error(`options.numBackups (${n.numBackups}) should be >= 0`);if(n.numBackups>=Number.MAX_SAFE_INTEGER)throw new Error(`options.numBackups (${n.numBackups}) should be < Number.MAX_SAFE_INTEGER`);n.numToKeep=n.numBackups+1}else if(n.numToKeep<=0)throw new Error(`options.numToKeep (${n.numToKeep}) should be > 0`);return bc(`_parseOption: creating stream with option=${JSON.stringify(n)}`),n}_final(e){this.currentFileStream.end("",this.options.encoding,e)}_write(e,t,n){this._shouldRoll().then((()=>{bc(`_write: writing chunk. file=${this.currentFileStream.path} state=${JSON.stringify(this.state)} chunk=${e}`),this.currentFileStream.write(e,t,(t=>{this.state.currentSize+=e.length,n(t)}))}))}async _shouldRoll(){(this._dateChanged()||this._tooBig())&&(bc(`_shouldRoll: rolling because dateChanged? ${this._dateChanged()} or tooBig? ${this._tooBig()}`),await this._roll())}_dateChanged(){return this.state.currentDate&&this.state.currentDate!==xc(this.options.pattern,kc())}_tooBig(){return this.state.currentSize>=this.options.maxSize}_roll(){return bc("_roll: closing the current stream"),new Promise(((e,t)=>{this.currentFileStream.end("",this.options.encoding,(()=>{this._moveOldFiles().then(e).catch(t)}))}))}async _moveOldFiles(){const e=await this._getExistingFiles();for(let t=(this.state.currentDate?e.filter((e=>e.date===this.state.currentDate)):e).length;t>=0;t--){bc(`_moveOldFiles: i = ${t}`);const e=this.fileFormatter({date:this.state.currentDate,index:t}),n=this.fileFormatter({date:this.state.currentDate,index:t+1}),r={compress:this.options.compress&&0===t,mode:this.options.mode};await Rc(e,n,r)}this.state.currentSize=0,this.state.currentDate=this.state.currentDate?xc(this.options.pattern,kc()):null,bc(`_moveOldFiles: finished rolling files. state=${JSON.stringify(this.state)}`),this._renewWriteStream(),await new Promise(((e,t)=>{this.currentFileStream.write("","utf8",(()=>{this._clean().then(e).catch(t)}))}))}async _getExistingFiles(){const e=await _c.readdir(this.fileObject.dir).catch((()=>[]));bc(`_getExistingFiles: files=${e}`);const t=e.map((e=>this.fileNameParser(e))).filter((e=>e)),n=e=>(e.timestamp?e.timestamp:kc().getTime())-e.index;return t.sort(((e,t)=>n(e)-n(t))),t}_renewWriteStream(){const e=this.fileFormatter({date:this.state.currentDate,index:0}),t=e=>{try{return _c.mkdirSync(e,{recursive:!0})}catch(n){if("ENOENT"===n.code)return t(Bc.dirname(e)),t(e);if("EEXIST"!==n.code&&"EROFS"!==n.code)throw n;try{if(_c.statSync(e).isDirectory())return e;throw n}catch(e){throw n}}};t(this.fileObject.dir);const n={flags:this.options.flags,encoding:this.options.encoding,mode:this.options.mode};var r,u;_c.appendFileSync(e,"",(r={...n},u="flags",r["flag"]=r[u],delete r[u],r)),this.currentFileStream=_c.createWriteStream(e,n),this.currentFileStream.on("error",(e=>{this.emit("error",e)}))}async _clean(){const e=await this._getExistingFiles();if(bc(`_clean: numToKeep = ${this.options.numToKeep}, existingFiles = ${e.length}`),bc("_clean: existing files are: ",e),this._tooManyFiles(e.length)){const n=e.slice(0,e.length-this.options.numToKeep).map((e=>Bc.format({dir:this.fileObject.dir,base:e.filename})));await(t=n,bc(`deleteFiles: files to delete: ${t}`),Promise.all(t.map((e=>_c.unlink(e).catch((t=>{bc(`deleteFiles: error when unlinking ${e}, ignoring. Error was ${t}`)}))))))}var t}_tooManyFiles(e){return this.options.numToKeep>0&&e>this.options.numToKeep}};const Lc=Mc;var jc=class extends Lc{constructor(e,t,n,r){r||(r={}),t&&(r.maxSize=t),r.numBackups||0===r.numBackups||(n||0===n||(n=1),r.numBackups=n),super(e,r),this.backups=r.numBackups,this.size=this.options.maxSize}get theStream(){return this.currentFileStream}};const $c=Mc;var Hc={RollingFileWriteStream:Mc,RollingFileStream:jc,DateRollingFileStream:class extends $c{constructor(e,t,n){t&&"object"==typeof t&&(n=t,t=null),n||(n={}),t||(t="yyyy-MM-dd"),n.pattern=t,n.numBackups||0===n.numBackups?n.daysToKeep=n.numBackups:(n.daysToKeep||0===n.daysToKeep?process.emitWarning("options.daysToKeep is deprecated due to the confusion it causes when used together with file size rolling. Please use options.numBackups instead.","DeprecationWarning","streamroller-DEP0001"):n.daysToKeep=1,n.numBackups=n.daysToKeep),super(e,n),this.mode=this.options.mode}get theStream(){return this.currentFileStream}}};const Jc=Nr.exports("log4js:file"),Gc=p.default,Vc=Hc,Uc=E.default.EOL;let Wc=!1;const zc=new Set;function Kc(){zc.forEach((e=>{e.sighupHandler()}))}function qc(e,t,n,r){const u=new Vc.RollingFileStream(e,t,n,r);return u.on("error",(t=>{console.error("log4js.fileAppender - Writing to file %s, error happened ",e,t)})),u.on("drain",(()=>{process.emit("log4js:pause",!1)})),u}Eo.configure=function(e,t){let n=t.basicLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),e.mode=e.mode||384,function(e,t,n,r,u,o){e=Gc.normalize(e),Jc("Creating file appender (",e,", ",n,", ",r=r||0===r?r:5,", ",u,", ",o,")");let i=qc(e,n,r,u);const s=function(e){if(i.writable){if(!0===u.removeColor){const t=/\x1b[[0-9;]*m/g;e.data=e.data.map((e=>"string"==typeof e?e.replace(t,""):e))}i.write(t(e,o)+Uc,"utf8")||process.emit("log4js:pause",!0)}};return s.reopen=function(){i.end((()=>{i=qc(e,n,r,u)}))},s.sighupHandler=function(){Jc("SIGHUP handler called."),s.reopen()},s.shutdown=function(e){zc.delete(s),0===zc.size&&Wc&&(process.removeListener("SIGHUP",Kc),Wc=!1),i.end("","utf-8",e)},zc.add(s),Wc||(process.on("SIGHUP",Kc),Wc=!0),s}(e.filename,n,e.maxLogSize,e.backups,e,e.timezoneOffset)};var Yc={};const Xc=Hc,Zc=E.default.EOL;function Qc(e,t,n,r,u){r.maxSize=r.maxLogSize;const o=function(e,t,n){const r=new Xc.DateRollingFileStream(e,t,n);return r.on("error",(t=>{console.error("log4js.dateFileAppender - Writing to file %s, error happened ",e,t)})),r.on("drain",(()=>{process.emit("log4js:pause",!1)})),r}(e,t,r),i=function(e){o.writable&&(o.write(n(e,u)+Zc,"utf8")||process.emit("log4js:pause",!0))};return i.shutdown=function(e){o.end("","utf-8",e)},i}Yc.configure=function(e,t){let n=t.basicLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),e.alwaysIncludePattern||(e.alwaysIncludePattern=!1),e.mode=e.mode||384,Qc(e.filename,e.pattern,n,e,e.timezoneOffset)};var ea={};const ta=Nr.exports("log4js:fileSync"),na=p.default,ra=D.default,ua=E.default.EOL||"\n";function oa(e,t){if(ra.existsSync(e))return;const n=ra.openSync(e,t.flags,t.mode);ra.closeSync(n)}class ia{constructor(e,t,n,r){ta("In RollingFileStream"),function(){if(!e||!t||t<=0)throw new Error("You must specify a filename and file size")}(),this.filename=e,this.size=t,this.backups=n,this.options=r,this.currentSize=0,this.currentSize=function(e){let t=0;try{t=ra.statSync(e).size}catch(t){oa(e,r)}return t}(this.filename)}shouldRoll(){return ta("should roll with current size %d, and max size %d",this.currentSize,this.size),this.currentSize>=this.size}roll(e){const t=this,n=new RegExp(`^${na.basename(e)}`);function r(e){return n.test(e)}function u(t){return parseInt(t.substring(`${na.basename(e)}.`.length),10)||0}function o(e,t){return u(e)>u(t)?1:u(e) ${e}.${r+1}`),ra.renameSync(na.join(na.dirname(e),n),`${e}.${r+1}`)}}ta("Rolling, rolling, rolling"),ta("Renaming the old files"),ra.readdirSync(na.dirname(e)).filter(r).sort(o).reverse().forEach(i)}write(e,t){const n=this;ta("in write"),this.shouldRoll()&&(this.currentSize=0,this.roll(this.filename)),ta("writing the chunk to the file"),n.currentSize+=e.length,ra.appendFileSync(n.filename,e)}}ea.configure=function(e,t){let n=t.basicLayout;e.layout&&(n=t.layout(e.layout.type,e.layout));const r={flags:e.flags||"a",encoding:e.encoding||"utf8",mode:e.mode||384};return function(e,t,n,r,u,o){ta("fileSync appender created");const i=function(e,t,n){let r;var u;return t?r=new ia(e,t,n,o):(oa(u=e,o),r={write(e){ra.appendFileSync(u,e)}}),r}(e=na.normalize(e),n,r=r||0===r?r:5);return e=>{i.write(t(e,u)+ua)}}(e.filename,n,e.maxLogSize,e.backups,e.timezoneOffset,r)};var sa={};const ca=Nr.exports("log4js:tcp"),aa=S.default;sa.configure=function(e,t){ca(`configure with config = ${e}`);let n=function(e){return e.serialise()};return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){let n=!1;const r=[];let u,o=3,i="__LOG4JS__";function s(e){ca("Writing log event to socket"),n=u.write(`${t(e)}${i}`,"utf8")}function c(){let e;for(ca("emptying buffer");e=r.shift();)s(e)}function a(e){n?s(e):(ca("buffering log event because it cannot write at the moment"),r.push(e))}return function t(){ca(`appender creating socket to ${e.host||"localhost"}:${e.port||5e3}`),i=`${e.endMsg||"__LOG4JS__"}`,u=aa.createConnection(e.port||5e3,e.host||"localhost"),u.on("connect",(()=>{ca("socket connected"),c(),n=!0})),u.on("drain",(()=>{ca("drain event received, emptying buffer"),n=!0,c()})),u.on("timeout",u.end.bind(u)),u.on("error",(e=>{ca("connection error",e),n=!1,c()})),u.on("close",t)}(),a.shutdown=function(e){ca("shutdown called"),r.length&&o?(ca("buffer has items, waiting 100ms to empty"),o-=1,setTimeout((()=>{a.shutdown(e)}),100)):(u.removeAllListeners("close"),u.end(e))},a}(e,n)};const la=p.default,fa=Nr.exports("log4js:appenders"),da=tu,Da=eo,pa=gu,Ea=hu,ma=to,ha=new Map;ha.set("console",oo),ha.set("stdout",so),ha.set("stderr",co),ha.set("logLevelFilter",ao),ha.set("categoryFilter",lo),ha.set("noLogFilter",Do),ha.set("file",Eo),ha.set("dateFile",Yc),ha.set("fileSync",ea),ha.set("tcp",sa);const ya=new Map,Ca=(e,t)=>{fa("Loading module from ",e);try{return require(e)}catch(n){return void da.throwExceptionIf(t,"MODULE_NOT_FOUND"!==n.code,`appender "${e}" could not be loaded (error was: ${n})`)}},Fa=new Set,ga=(e,t)=>{if(ya.has(e))return ya.get(e);if(!t.appenders[e])return!1;if(Fa.has(e))throw new Error(`Dependency loop detected for appender ${e}.`);Fa.add(e),fa(`Creating appender ${e}`);const n=Aa(e,t);return Fa.delete(e),ya.set(e,n),n},Aa=(e,t)=>{const n=t.appenders[e],r=n.type.configure?n.type:((e,t)=>ha.get(e)||Ca(`./${e}`,t)||Ca(e,t)||require.main&&Ca(la.join(la.dirname(require.main.filename),e),t)||Ca(la.join(process.cwd(),e),t))(n.type,t);return da.throwExceptionIf(t,da.not(r),`appender "${e}" is not valid (type "${n.type}" could not be found)`),r.appender&&fa(`DEPRECATION: Appender ${n.type} exports an appender function.`),r.shutdown&&fa(`DEPRECATION: Appender ${n.type} exports a shutdown function.`),fa(`${e}: clustering.isMaster ? ${Da.isMaster()}`),fa(`${e}: appenderModule is ${F.default.inspect(r)}`),Da.onlyOnMaster((()=>(fa(`calling appenderModule.configure for ${e} / ${n.type}`),r.configure(ma.modifyConfig(n),Ea,(e=>ga(e,t)),pa))),(()=>{}))},va=e=>{ya.clear(),Fa.clear();const t=[];Object.values(e.categories).forEach((e=>{t.push(...e.appenders)})),Object.keys(e.appenders).forEach((n=>{(t.includes(n)||"tcp-server"===e.appenders[n].type)&&ga(n,e)}))},Sa=()=>{va({appenders:{out:{type:"stdout"}},categories:{default:{appenders:["out"],level:"trace"}}})};Sa(),da.addListener((e=>{da.throwExceptionIf(e,da.not(da.anObject(e.appenders)),'must have a property "appenders" of type object.');const t=Object.keys(e.appenders);da.throwExceptionIf(e,da.not(t.length),"must define at least one appender."),t.forEach((t=>{da.throwExceptionIf(e,da.not(e.appenders[t].type),`appender "${t}" is not valid (must be an object with property "type")`)}))})),da.addListener(va),Au.exports=ya,Au.exports.init=Sa;var wa={exports:{}};!function(e){const t=Nr.exports("log4js:categories"),n=tu,r=gu,u=Au.exports,o=new Map;function i(e,t,n){if(!1===t.inherit)return;const r=n.lastIndexOf(".");if(r<0)return;const u=n.substring(0,r);let o=e.categories[u];o||(o={inherit:!0,appenders:[]}),i(e,o,u),!e.categories[u]&&o.appenders&&o.appenders.length&&o.level&&(e.categories[u]=o),t.appenders=t.appenders||[],t.level=t.level||o.level,o.appenders.forEach((e=>{t.appenders.includes(e)||t.appenders.push(e)})),t.parent=o}function s(e){if(!e.categories)return;Object.keys(e.categories).forEach((t=>{const n=e.categories[t];i(e,n,t)}))}n.addPreProcessingListener((e=>s(e))),n.addListener((e=>{n.throwExceptionIf(e,n.not(n.anObject(e.categories)),'must have a property "categories" of type object.');const t=Object.keys(e.categories);n.throwExceptionIf(e,n.not(t.length),"must define at least one category."),t.forEach((t=>{const o=e.categories[t];n.throwExceptionIf(e,[n.not(o.appenders),n.not(o.level)],`category "${t}" is not valid (must be an object with properties "appenders" and "level")`),n.throwExceptionIf(e,n.not(Array.isArray(o.appenders)),`category "${t}" is not valid (appenders must be an array of appender names)`),n.throwExceptionIf(e,n.not(o.appenders.length),`category "${t}" is not valid (appenders must contain at least one appender name)`),Object.prototype.hasOwnProperty.call(o,"enableCallStack")&&n.throwExceptionIf(e,"boolean"!=typeof o.enableCallStack,`category "${t}" is not valid (enableCallStack must be boolean type)`),o.appenders.forEach((r=>{n.throwExceptionIf(e,n.not(u.get(r)),`category "${t}" is not valid (appender "${r}" is not defined)`)})),n.throwExceptionIf(e,n.not(r.getLevel(o.level)),`category "${t}" is not valid (level "${o.level}" not recognised; valid levels are ${r.levels.join(", ")})`)})),n.throwExceptionIf(e,n.not(e.categories.default),'must define a "default" category.')}));const c=e=>{o.clear();Object.keys(e.categories).forEach((n=>{const i=e.categories[n],s=[];i.appenders.forEach((e=>{s.push(u.get(e)),t(`Creating category ${n}`),o.set(n,{appenders:s,level:r.getLevel(i.level),enableCallStack:i.enableCallStack||!1})}))}))},a=()=>{c({categories:{default:{appenders:["out"],level:"OFF"}}})};a(),n.addListener(c);const l=e=>(t(`configForCategory: searching for config for ${e}`),o.has(e)?(t(`configForCategory: ${e} exists in config, returning it`),o.get(e)):e.indexOf(".")>0?(t(`configForCategory: ${e} has hierarchy, searching for parents`),l(e.substring(0,e.lastIndexOf(".")))):(t("configForCategory: returning config for default category"),l("default")));e.exports=o,e.exports=Object.assign(e.exports,{appendersForCategory:e=>l(e).appenders,getLevelForCategory:e=>l(e).level,setLevelForCategory:(e,n)=>{let r=o.get(e);if(t(`setLevelForCategory: found ${r} for ${e}`),!r){const n=l(e);t(`setLevelForCategory: no config found for category, found ${n} for parents of ${e}`),r={appenders:n.appenders}}r.level=n,o.set(e,r)},getEnableCallStackForCategory:e=>!0===l(e).enableCallStack,setEnableCallStackForCategory:(e,t)=>{l(e).enableCallStack=t},init:a})}(wa);const Oa=Nr.exports("log4js:logger"),ba=Hu,_a=gu,Ba=eo,Pa=wa.exports,ka=tu,xa=/at (?:(.+)\s+\()?(?:(.+?):(\d+)(?::(\d+))?|([^)]+))\)?/;function Na(e,t=4){const n=e.stack.split("\n").slice(t),r=xa.exec(n[0]);return r&&6===r.length?{functionName:r[1],fileName:r[2],lineNumber:parseInt(r[3],10),columnNumber:parseInt(r[4],10),callStack:n.join("\n")}:null}class Ia{constructor(e){if(!e)throw new Error("No category provided.");this.category=e,this.context={},this.parseCallStack=Na,Oa(`Logger created (${this.category}, ${this.level})`)}get level(){return _a.getLevel(Pa.getLevelForCategory(this.category),_a.TRACE)}set level(e){Pa.setLevelForCategory(this.category,_a.getLevel(e,this.level))}get useCallStack(){return Pa.getEnableCallStackForCategory(this.category)}set useCallStack(e){Pa.setEnableCallStackForCategory(this.category,!0===e)}log(e,...t){let n=_a.getLevel(e);n||(this._log(_a.WARN,"log4js:logger.log: invalid value for log-level as first parameter given: ",e),n=_a.INFO),this.isLevelEnabled(n)&&this._log(n,t)}isLevelEnabled(e){return this.level.isLessThanOrEqualTo(e)}_log(e,t){Oa(`sending log data (${e}) to appenders`);const n=new ba(this.category,e,t,this.context,this.useCallStack&&this.parseCallStack(new Error));Ba.send(n)}addContext(e,t){this.context[e]=t}removeContext(e){delete this.context[e]}clearContext(){this.context={}}setParseCallStackFunction(e){this.parseCallStack=e}}function Ta(e){const t=_a.getLevel(e),n=t.toString().toLowerCase().replace(/_([a-z])/g,(e=>e[1].toUpperCase())),r=n[0].toUpperCase()+n.slice(1);Ia.prototype[`is${r}Enabled`]=function(){return this.isLevelEnabled(t)},Ia.prototype[n]=function(...e){this.log(t,...e)}}_a.levels.forEach(Ta),ka.addListener((()=>{_a.levels.forEach(Ta)}));var Ra=Ia;const Ma=gu;function La(e){return e.originalUrl||e.url}function ja(e,t){for(let n=0;ne.source?e.source:e));t=new RegExp(n.join("|"))}return t}(t.nolog);return(e,i,s)=>{if(e._logging)return s();if(o&&o.test(e.originalUrl))return s();if(n.isLevelEnabled(r)||"auto"===t.level){const o=new Date,{writeHead:s}=i;e._logging=!0,i.writeHead=(e,t)=>{i.writeHead=s,i.writeHead(e,t),i.__statusCode=e,i.__headers=t||{}},i.on("finish",(()=>{i.responseTime=new Date-o,i.statusCode&&"auto"===t.level&&(r=Ma.INFO,i.statusCode>=300&&(r=Ma.WARN),i.statusCode>=400&&(r=Ma.ERROR)),r=function(e,t,n){let r=t;if(n){const t=n.find((t=>{let n=!1;return n=t.from&&t.to?e>=t.from&&e<=t.to:-1!==t.codes.indexOf(e),n}));t&&(r=Ma.getLevel(t.level,r))}return r}(i.statusCode,r,t.statusRules);const s=function(e,t,n){const r=[];return r.push({token:":url",replacement:La(e)}),r.push({token:":protocol",replacement:e.protocol}),r.push({token:":hostname",replacement:e.hostname}),r.push({token:":method",replacement:e.method}),r.push({token:":status",replacement:t.__statusCode||t.statusCode}),r.push({token:":response-time",replacement:t.responseTime}),r.push({token:":date",replacement:(new Date).toUTCString()}),r.push({token:":referrer",replacement:e.headers.referer||e.headers.referrer||""}),r.push({token:":http-version",replacement:`${e.httpVersionMajor}.${e.httpVersionMinor}`}),r.push({token:":remote-addr",replacement:e.headers["x-forwarded-for"]||e.ip||e._remoteAddress||e.socket&&(e.socket.remoteAddress||e.socket.socket&&e.socket.socket.remoteAddress)}),r.push({token:":user-agent",replacement:e.headers["user-agent"]}),r.push({token:":content-length",replacement:t.getHeader("content-length")||t.__headers&&t.__headers["Content-Length"]||"-"}),r.push({token:/:req\[([^\]]+)]/g,replacement:(t,n)=>e.headers[n.toLowerCase()]}),r.push({token:/:res\[([^\]]+)]/g,replacement:(e,n)=>t.getHeader(n.toLowerCase())||t.__headers&&t.__headers[n]}),(e=>{const t=e.concat();for(let e=0;eja(e,s)));t&&n.log(r,t)}else n.log(r,ja(u,s));t.context&&n.removeContext("res")}))}return s()}},nl=Va;let rl=!1;function ul(e){if(!rl)return;Ua("Received log event ",e);Za.appendersForCategory(e.categoryName).forEach((t=>{t(e)}))}function ol(e){rl&&il();let t=e;return"string"==typeof t&&(t=function(e){Ua(`Loading configuration from ${e}`);try{return JSON.parse(Wa.readFileSync(e,"utf8"))}catch(t){throw new Error(`Problem reading config from file "${e}". Error was ${t.message}`,t)}}(e)),Ua(`Configuration is ${t}`),Ka.configure(za(t)),el.onMessage(ul),rl=!0,sl}function il(e){Ua("Shutdown called. Disabling all log writing."),rl=!1;const t=Array.from(Xa.values());Xa.init(),Za.init();const n=t.reduceRight(((e,t)=>t.shutdown?e+1:e),0);if(0===n)return Ua("No appenders with shutdown functions found."),void 0!==e&&e();let r,u=0;function o(t){r=r||t,u+=1,Ua(`Appender shutdowns complete: ${u} / ${n}`),u>=n&&(Ua("All shutdown functions completed."),e&&e(r))}return Ua(`Found ${n} appenders with shutdown functions.`),t.filter((e=>e.shutdown)).forEach((e=>e.shutdown(o))),null}const sl={getLogger:function(e){return rl||ol(process.env.LOG4JS_CONFIG||{appenders:{out:{type:"stdout"}},categories:{default:{appenders:["out"],level:"OFF"}}}),new Qa(e||"default")},configure:ol,shutdown:il,connectLogger:tl,levels:Ya,addLayout:qa.addLayout,recording:function(){return nl}};var cl=sl,al={};Object.defineProperty(al,"__esModule",{value:!0}),al.levelMap=al.getLevel=al.setCategoriesLevel=al.getConfiguration=al.setConfiguration=void 0;const ll=cl;let fl={appenders:{debug:{type:"stdout",layout:{type:"pattern",pattern:"[%d] > hvigor %p %c %[%m%]"}},info:{type:"stdout",layout:{type:"pattern",pattern:"[%d] > hvigor %[%m%]"}},"no-pattern-info":{type:"stdout",layout:{type:"pattern",pattern:"%m"}},wrong:{type:"stderr",layout:{type:"pattern",pattern:"[%d] > hvigor %[%p: %m%]"}},"just-debug":{type:"logLevelFilter",appender:"debug",level:"debug",maxLevel:"debug"},"just-info":{type:"logLevelFilter",appender:"info",level:"info",maxLevel:"info"},"just-wrong":{type:"logLevelFilter",appender:"wrong",level:"warn",maxLevel:"error"}},categories:{default:{appenders:["just-debug","just-info","just-wrong"],level:"debug"},"no-pattern-info":{appenders:["no-pattern-info"],level:"info"}}};al.setConfiguration=e=>{fl=e};al.getConfiguration=()=>fl;let dl=ll.levels.DEBUG;al.setCategoriesLevel=(e,t)=>{dl=e;const n=fl.categories;for(const r in n)(null==t?void 0:t.includes(r))||Object.prototype.hasOwnProperty.call(n,r)&&(n[r].level=e.levelStr)};al.getLevel=()=>dl,al.levelMap=new Map([["ALL",ll.levels.ALL],["MARK",ll.levels.MARK],["TRACE",ll.levels.TRACE],["DEBUG",ll.levels.DEBUG],["INFO",ll.levels.INFO],["WARN",ll.levels.WARN],["ERROR",ll.levels.ERROR],["FATAL",ll.levels.FATAL],["OFF",ll.levels.OFF]]);var Dl=w&&w.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),pl=w&&w.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),El=w&&w.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&Dl(t,e,n);return pl(t,e),t};Object.defineProperty(xr,"__esModule",{value:!0}),xr.evaluateLogLevel=xr.HvigorLogger=void 0;const ml=El(cl),hl=cl,yl=El(F.default),Cl=al;class Fl{constructor(e){ml.configure((0,Cl.getConfiguration)()),this._logger=ml.getLogger(e),this._logger.level=(0,Cl.getLevel)()}static getLogger(e){return new Fl(e)}log(e,...t){this._logger.log(e,...t)}debug(e,...t){this._logger.debug(e,...t)}info(e,...t){this._logger.info(e,...t)}warn(e,...t){void 0!==e&&""!==e&&this._logger.warn(e,...t)}error(e,...t){this._logger.error(e,...t)}_printTaskExecuteInfo(e,t){this.info(`Finished :${e}... after ${t}`)}_printFailedTaskInfo(e){this.error(`Failed :${e}... `)}_printDisabledTaskInfo(e){this.info(`Disabled :${e}... `)}_printUpToDateTaskInfo(e){this.info(`UP-TO-DATE :${e}... `)}errorMessageExit(e,...t){throw new Error(yl.format(e,...t))}errorExit(e,t,...n){t&&this._logger.error(t,n),this._logger.error(e.stack)}setLevel(e,t){(0,Cl.setCategoriesLevel)(e,t),ml.shutdown(),ml.configure((0,Cl.getConfiguration)())}getLevel(){return this._logger.level}configure(e){const t=(0,Cl.getConfiguration)(),n={appenders:{...t.appenders,...e.appenders},categories:{...t.categories,...e.categories}};(0,Cl.setConfiguration)(n),ml.shutdown(),ml.configure(n)}}xr.HvigorLogger=Fl,xr.evaluateLogLevel=function(e,t){t.debug?e.setLevel(hl.levels.DEBUG):t.warn?e.setLevel(hl.levels.WARN):t.error?e.setLevel(hl.levels.ERROR):e.setLevel(hl.levels.INFO)};var gl=w&&w.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(X,"__esModule",{value:!0}),X.parseJsonText=X.parseJsonFile=void 0;const Al=Z,vl=gl(kr),Sl=gl(p.default),wl=gl(E.default),Ol=xr.HvigorLogger.getLogger("parse-json-util");var bl;!function(e){e[e.Char=0]="Char",e[e.EOF=1]="EOF",e[e.Identifier=2]="Identifier"}(bl||(bl={}));let _l,Bl,Pl,kl,xl,Nl,Il="start",Tl=[],Rl=0,Ml=1,Ll=0,jl=!1,$l="default",Hl="'",Jl=1;function Gl(e,t=!1){Bl=String(e),Il="start",Tl=[],Rl=0,Ml=1,Ll=0,kl=void 0,jl=t;do{_l=Vl(),Xl[Il]()}while("eof"!==_l.type);return kl}function Vl(){for($l="default",xl="",Hl="'",Jl=1;;){Nl=Ul();const e=zl[$l]();if(e)return e}}function Ul(){if(Bl[Rl])return String.fromCodePoint(Bl.codePointAt(Rl))}function Wl(){const e=Ul();return"\n"===e?(Ml++,Ll=0):e?Ll+=e.length:Ll++,e&&(Rl+=e.length),e}X.parseJsonFile=function(e,t=!1,n="utf-8"){const r=vl.default.readFileSync(Sl.default.resolve(e),{encoding:n});try{return Gl(r,t)}catch(t){if(t instanceof SyntaxError){const n=t.message.split("at");2===n.length&&Ol.errorMessageExit(`${n[0].trim()}${wl.default.EOL}\t at ${e}:${n[1].trim()}`)}Ol.errorMessageExit(`${e} is not in valid JSON/JSON5 format.`)}},X.parseJsonText=Gl;const zl={default(){switch(Nl){case"/":return Wl(),void($l="comment");case void 0:return Wl(),Kl("eof")}if(!Al.JudgeUtil.isIgnoreChar(Nl)&&!Al.JudgeUtil.isSpaceSeparator(Nl))return zl[Il]();Wl()},start(){$l="value"},beforePropertyName(){switch(Nl){case"$":case"_":return xl=Wl(),void($l="identifierName");case"\\":return Wl(),void($l="identifierNameStartEscape");case"}":return Kl("punctuator",Wl());case'"':case"'":return Hl=Nl,Wl(),void($l="string")}if(Al.JudgeUtil.isIdStartChar(Nl))return xl+=Wl(),void($l="identifierName");throw tf(bl.Char,Wl())},afterPropertyName(){if(":"===Nl)return Kl("punctuator",Wl());throw tf(bl.Char,Wl())},beforePropertyValue(){$l="value"},afterPropertyValue(){switch(Nl){case",":case"}":return Kl("punctuator",Wl())}throw tf(bl.Char,Wl())},beforeArrayValue(){if("]"===Nl)return Kl("punctuator",Wl());$l="value"},afterArrayValue(){switch(Nl){case",":case"]":return Kl("punctuator",Wl())}throw tf(bl.Char,Wl())},end(){throw tf(bl.Char,Wl())},comment(){switch(Nl){case"*":return Wl(),void($l="multiLineComment");case"/":return Wl(),void($l="singleLineComment")}throw tf(bl.Char,Wl())},multiLineComment(){switch(Nl){case"*":return Wl(),void($l="multiLineCommentAsterisk");case void 0:throw tf(bl.Char,Wl())}Wl()},multiLineCommentAsterisk(){switch(Nl){case"*":return void Wl();case"/":return Wl(),void($l="default");case void 0:throw tf(bl.Char,Wl())}Wl(),$l="multiLineComment"},singleLineComment(){switch(Nl){case"\n":case"\r":case"\u2028":case"\u2029":return Wl(),void($l="default");case void 0:return Wl(),Kl("eof")}Wl()},value(){switch(Nl){case"{":case"[":return Kl("punctuator",Wl());case"n":return Wl(),ql("ull"),Kl("null",null);case"t":return Wl(),ql("rue"),Kl("boolean",!0);case"f":return Wl(),ql("alse"),Kl("boolean",!1);case"-":case"+":return"-"===Wl()&&(Jl=-1),void($l="numerical");case".":case"0":case"I":case"N":return void($l="numerical");case'"':case"'":return Hl=Nl,Wl(),xl="",void($l="string")}if(void 0===Nl||!Al.JudgeUtil.isDigitWithoutZero(Nl))throw tf(bl.Char,Wl());$l="numerical"},numerical(){switch(Nl){case".":return xl=Wl(),void($l="decimalPointLeading");case"0":return xl=Wl(),void($l="zero");case"I":return Wl(),ql("nfinity"),Kl("numeric",Jl*(1/0));case"N":return Wl(),ql("aN"),Kl("numeric",NaN)}if(void 0!==Nl&&Al.JudgeUtil.isDigitWithoutZero(Nl))return xl=Wl(),void($l="decimalInteger");throw tf(bl.Char,Wl())},zero(){switch(Nl){case".":case"e":case"E":return void($l="decimal");case"x":case"X":return xl+=Wl(),void($l="hexadecimal")}return Kl("numeric",0)},decimalInteger(){switch(Nl){case".":case"e":case"E":return void($l="decimal")}if(!Al.JudgeUtil.isDigit(Nl))return Kl("numeric",Jl*Number(xl));xl+=Wl()},decimal(){switch(Nl){case".":xl+=Wl(),$l="decimalFraction";break;case"e":case"E":xl+=Wl(),$l="decimalExponent"}},decimalPointLeading(){if(Al.JudgeUtil.isDigit(Nl))return xl+=Wl(),void($l="decimalFraction");throw tf(bl.Char,Wl())},decimalFraction(){switch(Nl){case"e":case"E":return xl+=Wl(),void($l="decimalExponent")}if(!Al.JudgeUtil.isDigit(Nl))return Kl("numeric",Jl*Number(xl));xl+=Wl()},decimalExponent(){switch(Nl){case"+":case"-":return xl+=Wl(),void($l="decimalExponentSign")}if(Al.JudgeUtil.isDigit(Nl))return xl+=Wl(),void($l="decimalExponentInteger");throw tf(bl.Char,Wl())},decimalExponentSign(){if(Al.JudgeUtil.isDigit(Nl))return xl+=Wl(),void($l="decimalExponentInteger");throw tf(bl.Char,Wl())},decimalExponentInteger(){if(!Al.JudgeUtil.isDigit(Nl))return Kl("numeric",Jl*Number(xl));xl+=Wl()},hexadecimal(){if(Al.JudgeUtil.isHexDigit(Nl))return xl+=Wl(),void($l="hexadecimalInteger");throw tf(bl.Char,Wl())},hexadecimalInteger(){if(!Al.JudgeUtil.isHexDigit(Nl))return Kl("numeric",Jl*Number(xl));xl+=Wl()},identifierNameStartEscape(){if("u"!==Nl)throw tf(bl.Char,Wl());Wl();const e=Yl();switch(e){case"$":case"_":break;default:if(!Al.JudgeUtil.isIdStartChar(e))throw tf(bl.Identifier)}xl+=e,$l="identifierName"},identifierName(){switch(Nl){case"$":case"_":case"‌":case"‍":return void(xl+=Wl());case"\\":return Wl(),void($l="identifierNameEscape")}if(!Al.JudgeUtil.isIdContinueChar(Nl))return Kl("identifier",xl);xl+=Wl()},identifierNameEscape(){if("u"!==Nl)throw tf(bl.Char,Wl());Wl();const e=Yl();switch(e){case"$":case"_":case"‌":case"‍":break;default:if(!Al.JudgeUtil.isIdContinueChar(e))throw tf(bl.Identifier)}xl+=e,$l="identifierName"},string(){switch(Nl){case"\\":return Wl(),void(xl+=function(){const e=Ul(),t=function(){switch(Ul()){case"b":return Wl(),"\b";case"f":return Wl(),"\f";case"n":return Wl(),"\n";case"r":return Wl(),"\r";case"t":return Wl(),"\t";case"v":return Wl(),"\v"}return}();if(t)return t;switch(e){case"0":if(Wl(),Al.JudgeUtil.isDigit(Ul()))throw tf(bl.Char,Wl());return"\0";case"x":return Wl(),function(){let e="",t=Ul();if(!Al.JudgeUtil.isHexDigit(t))throw tf(bl.Char,Wl());if(e+=Wl(),t=Ul(),!Al.JudgeUtil.isHexDigit(t))throw tf(bl.Char,Wl());return e+=Wl(),String.fromCodePoint(parseInt(e,16))}();case"u":return Wl(),Yl();case"\n":case"\u2028":case"\u2029":return Wl(),"";case"\r":return Wl(),"\n"===Ul()&&Wl(),""}if(void 0===e||Al.JudgeUtil.isDigitWithoutZero(e))throw tf(bl.Char,Wl());return Wl()}());case'"':case"'":if(Nl===Hl){const e=Kl("string",xl);return Wl(),e}return void(xl+=Wl());case"\n":case"\r":case void 0:throw tf(bl.Char,Wl());case"\u2028":case"\u2029":!function(e){Ol.warn(`JSON5: '${ef(e)}' in strings is not valid ECMAScript; consider escaping.`)}(Nl)}xl+=Wl()}};function Kl(e,t){return{type:e,value:t,line:Ml,column:Ll}}function ql(e){for(const t of e){if(Ul()!==t)throw tf(bl.Char,Wl());Wl()}}function Yl(){let e="",t=4;for(;t-- >0;){const t=Ul();if(!Al.JudgeUtil.isHexDigit(t))throw tf(bl.Char,Wl());e+=Wl()}return String.fromCodePoint(parseInt(e,16))}const Xl={start(){if("eof"===_l.type)throw tf(bl.EOF);Zl()},beforePropertyName(){switch(_l.type){case"identifier":case"string":return Pl=_l.value,void(Il="afterPropertyName");case"punctuator":return void Ql();case"eof":throw tf(bl.EOF)}},afterPropertyName(){if("eof"===_l.type)throw tf(bl.EOF);Il="beforePropertyValue"},beforePropertyValue(){if("eof"===_l.type)throw tf(bl.EOF);Zl()},afterPropertyValue(){if("eof"===_l.type)throw tf(bl.EOF);switch(_l.value){case",":return void(Il="beforePropertyName");case"}":Ql()}},beforeArrayValue(){if("eof"===_l.type)throw tf(bl.EOF);"punctuator"!==_l.type||"]"!==_l.value?Zl():Ql()},afterArrayValue(){if("eof"===_l.type)throw tf(bl.EOF);switch(_l.value){case",":return void(Il="beforeArrayValue");case"]":Ql()}},end(){}};function Zl(){const e=function(){let e;switch(_l.type){case"punctuator":switch(_l.value){case"{":e={};break;case"[":e=[]}break;case"null":case"boolean":case"numeric":case"string":e=_l.value}return e}();if(jl&&"object"==typeof e&&(e._line=Ml,e._column=Ll),void 0===kl)kl=e;else{const t=Tl[Tl.length-1];Array.isArray(t)?jl&&"object"!=typeof e?t.push({value:e,_line:Ml,_column:Ll}):t.push(e):t[Pl]=jl&&"object"!=typeof e?{value:e,_line:Ml,_column:Ll}:e}!function(e){if(e&&"object"==typeof e)Tl.push(e),Il=Array.isArray(e)?"beforeArrayValue":"beforePropertyName";else{const e=Tl[Tl.length-1];Il=e?Array.isArray(e)?"afterArrayValue":"afterPropertyValue":"end"}}(e)}function Ql(){Tl.pop();const e=Tl[Tl.length-1];Il=e?Array.isArray(e)?"afterArrayValue":"afterPropertyValue":"end"}function ef(e){const t={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(t[e])return t[e];if(e<" "){const t=e.charCodeAt(0).toString(16);return`\\x${`00${t}`.substring(t.length)}`}return e}function tf(e,t){let n="";switch(e){case bl.Char:n=void 0===t?`JSON5: invalid end of input at ${Ml}:${Ll}`:`JSON5: invalid character '${ef(t)}' at ${Ml}:${Ll}`;break;case bl.EOF:n=`JSON5: invalid end of input at ${Ml}:${Ll}`;break;case bl.Identifier:Ll-=5,n=`JSON5: invalid identifier character at ${Ml}:${Ll}`}const r=new nf(n);return r.lineNumber=Ml,r.columnNumber=Ll,r}class nf extends SyntaxError{}var rf=w&&w.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),uf=w&&w.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),of=w&&w.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&rf(t,e,n);return uf(t,e),t};Object.defineProperty(Y,"__esModule",{value:!0});var sf=Y.cleanWorkSpace=Ff=Y.executeInstallHvigor=yf=Y.isHvigorInstalled=mf=Y.isAllDependenciesInstalled=void 0;const cf=of(D.default),af=of(p.default),lf=b,ff=j,df=$,Df=X;let pf,Ef;var mf=Y.isAllDependenciesInstalled=function(){function e(e){const t=null==e?void 0:e.dependencies;return void 0===t?0:Object.getOwnPropertyNames(t).length}if(pf=gf(),Ef=Af(),e(pf)+1!==e(Ef))return!1;for(const e in null==pf?void 0:pf.dependencies)if(!(0,ff.hasNpmPackInPaths)(e,[lf.HVIGOR_PROJECT_DEPENDENCIES_HOME])||!hf(e,pf,Ef))return!1;return!0};function hf(e,t,n){return void 0!==n.dependencies&&(0,ff.offlinePluginConversion)(lf.HVIGOR_PROJECT_ROOT_DIR,t.dependencies[e])===n.dependencies[e]}var yf=Y.isHvigorInstalled=function(){return pf=gf(),Ef=Af(),(0,ff.hasNpmPackInPaths)(lf.HVIGOR_ENGINE_PACKAGE_NAME,[lf.HVIGOR_PROJECT_DEPENDENCIES_HOME])&&(0,ff.offlinePluginConversion)(lf.HVIGOR_PROJECT_ROOT_DIR,pf.hvigorVersion)===Ef.dependencies[lf.HVIGOR_ENGINE_PACKAGE_NAME]};const Cf={cwd:lf.HVIGOR_PROJECT_DEPENDENCIES_HOME,stdio:["inherit","inherit","inherit"]};var Ff=Y.executeInstallHvigor=function(){(0,df.logInfoPrintConsole)("Hvigor installing...");const e={dependencies:{}};e.dependencies[lf.HVIGOR_ENGINE_PACKAGE_NAME]=(0,ff.offlinePluginConversion)(lf.HVIGOR_PROJECT_ROOT_DIR,pf.hvigorVersion);try{cf.mkdirSync(lf.HVIGOR_PROJECT_DEPENDENCIES_HOME,{recursive:!0});const t=af.resolve(lf.HVIGOR_PROJECT_DEPENDENCIES_HOME,lf.DEFAULT_PACKAGE_JSON);cf.writeFileSync(t,JSON.stringify(e))}catch(e){(0,df.logErrorAndExit)(e)}!function(){const e=["config","set","store-dir",lf.HVIGOR_PNPM_STORE_PATH];(0,ff.executeCommand)(lf.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,e,Cf)}(),(0,ff.executeCommand)(lf.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,["install"],Cf)};function gf(){const e=af.resolve(lf.HVIGOR_PROJECT_WRAPPER_HOME,lf.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME);return cf.existsSync(e)||(0,df.logErrorAndExit)(`Error: Hvigor config file ${e} does not exist.`),(0,Df.parseJsonFile)(e)}function Af(){return cf.existsSync(lf.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH)?(0,Df.parseJsonFile)(lf.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH):{dependencies:{}}}sf=Y.cleanWorkSpace=function(){if((0,df.logInfoPrintConsole)("Hvigor cleaning..."),!cf.existsSync(lf.HVIGOR_PROJECT_DEPENDENCIES_HOME))return;const e=cf.readdirSync(lf.HVIGOR_PROJECT_DEPENDENCIES_HOME);if(e&&0!==e.length){cf.existsSync(lf.HVIGOR_BOOT_JS_FILE_PATH)&&(0,ff.executeCommand)(process.argv[0],[lf.HVIGOR_BOOT_JS_FILE_PATH,"--stop-daemon"],{});try{e.forEach((e=>{cf.rmSync(af.resolve(lf.HVIGOR_PROJECT_DEPENDENCIES_HOME,e),{recursive:!0})}))}catch(e){(0,df.logErrorAndExit)(`The hvigor build tool cannot be installed. Please manually clear the workspace directory and synchronize the project again.\n\n Workspace Path: ${lf.HVIGOR_PROJECT_DEPENDENCIES_HOME}.`)}}};var vf={},Sf=w&&w.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),wf=w&&w.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Of=w&&w.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&Sf(t,e,n);return wf(t,e),t};Object.defineProperty(vf,"__esModule",{value:!0});var bf=vf.executeBuild=void 0;const _f=b,Bf=Of(D.default),Pf=Of(p.default),kf=$;bf=vf.executeBuild=function(){const e=Pf.resolve(_f.HVIGOR_PROJECT_DEPENDENCIES_HOME,"node_modules","@ohos","hvigor","bin","hvigor.js");try{const t=Bf.realpathSync(e);require(t)}catch(t){(0,kf.logErrorAndExit)(`Error: ENOENT: no such file ${e},delete ${_f.HVIGOR_PROJECT_DEPENDENCIES_HOME} and retry.`)}},function(){if(O.checkNpmConifg(),O.environmentHandler(),O.isPnpmAvailable()||O.executeInstallPnpm(),yf()&&mf())bf();else{sf();try{Ff()}catch(e){return void sf()}bf()}}(); \ No newline at end of file diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/hvigorfile.ts b/unionpi_tiger/sample/app/DistributedVideoPlayer/hvigorfile.ts deleted file mode 100644 index 64781869..00000000 --- a/unionpi_tiger/sample/app/DistributedVideoPlayer/hvigorfile.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. -export { appTasks } from '@ohos/hvigor-ohos-plugin'; \ No newline at end of file diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/hvigorw b/unionpi_tiger/sample/app/DistributedVideoPlayer/hvigorw deleted file mode 100644 index 54aadd22..00000000 --- a/unionpi_tiger/sample/app/DistributedVideoPlayer/hvigorw +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash - -# ---------------------------------------------------------------------------- -# Hvigor startup script, version 1.0.0 -# -# Required ENV vars: -# ------------------ -# NODE_HOME - location of a Node home dir -# or -# Add /usr/local/nodejs/bin to the PATH environment variable -# ---------------------------------------------------------------------------- - -HVIGOR_APP_HOME=$(dirname $(readlink -f $0)) -HVIGOR_WRAPPER_SCRIPT=${HVIGOR_APP_HOME}/hvigor/hvigor-wrapper.js -warn() { - echo "" - echo -e "\033[1;33m`date '+[%Y-%m-%d %H:%M:%S]'`$@\033[0m" -} - -error() { - echo "" - echo -e "\033[1;31m`date '+[%Y-%m-%d %H:%M:%S]'`$@\033[0m" -} - -fail() { - error "$@" - exit 1 -} - -# Determine node to start hvigor wrapper script -if [ -n "${NODE_HOME}" ];then - EXECUTABLE_NODE="${NODE_HOME}/bin/node" - if [ ! -x "$EXECUTABLE_NODE" ];then - fail "ERROR: NODE_HOME is set to an invalid directory,check $NODE_HOME\n\nPlease set NODE_HOME in your environment to the location where your nodejs installed" - fi -else - EXECUTABLE_NODE="node" - which ${EXECUTABLE_NODE} > /dev/null 2>&1 || fail "ERROR: NODE_HOME is not set and not 'node' command found in your path" -fi - -# Check hvigor wrapper script -if [ ! -r "$HVIGOR_WRAPPER_SCRIPT" ];then - fail "ERROR: Couldn't find hvigor/hvigor-wrapper.js in ${HVIGOR_APP_HOME}" -fi - -# start hvigor-wrapper script -exec "${EXECUTABLE_NODE}" \ - "${HVIGOR_WRAPPER_SCRIPT}" "$@" diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/hvigorw.bat b/unionpi_tiger/sample/app/DistributedVideoPlayer/hvigorw.bat deleted file mode 100644 index 6861293e..00000000 --- a/unionpi_tiger/sample/app/DistributedVideoPlayer/hvigorw.bat +++ /dev/null @@ -1,64 +0,0 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Hvigor startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -set WRAPPER_MODULE_PATH=%APP_HOME%\hvigor\hvigor-wrapper.js -set NODE_EXE=node.exe - -goto start - -:start -@rem Find node.exe -if defined NODE_HOME goto findNodeFromNodeHome - -%NODE_EXE% --version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute - -echo. -echo ERROR: NODE_HOME is not set and no 'node' command could be found in your PATH. -echo. -echo Please set the NODE_HOME variable in your environment to match the -echo location of your NodeJs installation. - -goto fail - -:findNodeFromNodeHome -set NODE_HOME=%NODE_HOME:"=% -set NODE_EXE_PATH=%NODE_HOME%/%NODE_EXE% - -if exist "%NODE_EXE_PATH%" goto execute -echo. -echo ERROR: NODE_HOME is not set and no 'node' command could be found in your PATH. -echo. -echo Please set the NODE_HOME variable in your environment to match the -echo location of your NodeJs installation. - -goto fail - -:execute -@rem Execute hvigor -"%NODE_EXE%" %WRAPPER_MODULE_PATH% %* - -if "%ERRORLEVEL%" == "0" goto hvigorwEnd - -:fail -exit /b 1 - -:hvigorwEnd -if "%OS%" == "Windows_NT" endlocal - -:end diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/oh-package.json5 b/unionpi_tiger/sample/app/DistributedVideoPlayer/oh-package.json5 deleted file mode 100644 index 1244eb45..00000000 --- a/unionpi_tiger/sample/app/DistributedVideoPlayer/oh-package.json5 +++ /dev/null @@ -1,12 +0,0 @@ -{ - "license": "", - "devDependencies": { - "@ohos/hypium": "1.0.6" - }, - "author": "", - "name": "distributedvideoplayer", - "description": "Please describe the basic information.", - "main": "", - "version": "1.0.0", - "dependencies": {} -} diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/ohosTest.md b/unionpi_tiger/sample/app/DistributedVideoPlayer/ohosTest.md deleted file mode 100644 index 47587613..00000000 --- a/unionpi_tiger/sample/app/DistributedVideoPlayer/ohosTest.md +++ /dev/null @@ -1,19 +0,0 @@ -# DistributedVideoPlayer 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 | 是否自动 | 测试结果 | -| ---------------- | -------------------------------------------- | ---------------------------------------------- | ---------------------- | -------- | -------- | -| 打开应用 | 设备正常运行 | | 成功拉起应用 | 是 | Pass | -| 获取权限 | 设备正常运行 | 点击权限弹窗允许按钮 | 授权后成功进入首页 | 是 | Pass | -| 关闭应用 | | 点击左上角返回按钮 | 成功退出应用 | 是 | Pass | -| 打开应用 | 设备正常运行 | | 成功拉起应用 | 是 | Pass | -| 单击播放按钮 | 位于首页,控制栏处于显示状态 | 单击播放按钮 | 正常执行 | 是 | Pass | -| 双击页面 | 位于首页 | 双击屏幕 | 正常执行 | 是 | Pass | -| 滑动Slider进度条 | 位于首页,控制栏处于显示状态 | 滑动Slider进度条 | 正常执行 | 是 | Pass | -| 左右滑动屏幕 | | 左右滑动屏幕 | 正常执行 | 是 | Pass | -| 调整倍速 | 位于首页,控制栏处于显示状态,展开倍速选择框 | 点击倍速文本 | 正常执行 | 是 | Pass | -| 切换视频 | 位于首页,控制栏处于显示状态 | 点击视频列表图标 | 展开视频列表侧边栏 | 是 | Pass | -| 截图 | 位于首页,控制栏处于显示状态 | 点击截图按钮 | 成功截图并显示截图窗口 | 是 | Pass | -| 选择设备弹窗 | 位于首页 | 点击流转图标 | 弹出选择设备弹窗 | 是 | Pass | -| 设置流转模式 | 位于首页 | 点击设置图标,进入设置页面后选择“多端协同”模式 | 成功进入设置页面并选择 | 是 | Pass | \ No newline at end of file diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/screenshots/DeviceDialog.jpeg b/unionpi_tiger/sample/app/DistributedVideoPlayer/screenshots/DeviceDialog.jpeg deleted file mode 100644 index 77070a7a..00000000 Binary files a/unionpi_tiger/sample/app/DistributedVideoPlayer/screenshots/DeviceDialog.jpeg and /dev/null differ diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/screenshots/Index.jpeg b/unionpi_tiger/sample/app/DistributedVideoPlayer/screenshots/Index.jpeg deleted file mode 100644 index 76388319..00000000 Binary files a/unionpi_tiger/sample/app/DistributedVideoPlayer/screenshots/Index.jpeg and /dev/null differ diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/screenshots/Settings.jpeg b/unionpi_tiger/sample/app/DistributedVideoPlayer/screenshots/Settings.jpeg deleted file mode 100644 index ac09659e..00000000 Binary files a/unionpi_tiger/sample/app/DistributedVideoPlayer/screenshots/Settings.jpeg and /dev/null differ diff --git a/unionpi_tiger/sample/app/DistributedVideoPlayer/screenshots/VideoList.jpeg b/unionpi_tiger/sample/app/DistributedVideoPlayer/screenshots/VideoList.jpeg deleted file mode 100644 index b55b0b90..00000000 Binary files a/unionpi_tiger/sample/app/DistributedVideoPlayer/screenshots/VideoList.jpeg and /dev/null differ diff --git a/unionpi_tiger/sample/app/factory/AppScope/app.json5 b/unionpi_tiger/sample/app/factory/AppScope/app.json5 deleted file mode 100644 index a838528c..00000000 --- a/unionpi_tiger/sample/app/factory/AppScope/app.json5 +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -{ - "app": { - "bundleName": "com.yarward.factorytest", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name" - } -} diff --git a/unionpi_tiger/sample/app/factory/AppScope/resources/base/element/string.json b/unionpi_tiger/sample/app/factory/AppScope/resources/base/element/string.json deleted file mode 100644 index c911a2d7..00000000 --- a/unionpi_tiger/sample/app/factory/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "factory" - } - ] -} diff --git a/unionpi_tiger/sample/app/factory/AppScope/resources/base/media/app_icon.png b/unionpi_tiger/sample/app/factory/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index ce307a88..00000000 Binary files a/unionpi_tiger/sample/app/factory/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/unionpi_tiger/sample/app/factory/README.md b/unionpi_tiger/sample/app/factory/README.md deleted file mode 100644 index f5e5c631..00000000 --- a/unionpi_tiger/sample/app/factory/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# factory - -factory for OpenHarmony \ No newline at end of file diff --git a/unionpi_tiger/sample/app/factory/build-profile.json5 b/unionpi_tiger/sample/app/factory/build-profile.json5 deleted file mode 100644 index 654f6ed5..00000000 --- a/unionpi_tiger/sample/app/factory/build-profile.json5 +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -{ - "app": { - "signingConfigs": [ - ], - "compileSdkVersion": 10, - "compatibleSdkVersion": 9, - "products": [ - { - "name": "default", - "signingConfig": "default", - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/factory/entry/build-profile.json5 b/unionpi_tiger/sample/app/factory/entry/build-profile.json5 deleted file mode 100644 index cec72069..00000000 --- a/unionpi_tiger/sample/app/factory/entry/build-profile.json5 +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -{ - "apiType": 'stageMode', - "buildOption": { - "sourceOption": { - "workers": [ - "./src/main/ets/pages/workers/fileWorker.ts" - ] - } - }, - "targets": [ - { - "name": "default", - "runtimeOS": "OpenHarmony" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/factory/entry/hvigorfile.ts b/unionpi_tiger/sample/app/factory/entry/hvigorfile.ts deleted file mode 100644 index 80e4ec5b..00000000 --- a/unionpi_tiger/sample/app/factory/entry/hvigorfile.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. -export { hapTasks } from '@ohos/hvigor-ohos-plugin'; diff --git a/unionpi_tiger/sample/app/factory/entry/oh-package.json5 b/unionpi_tiger/sample/app/factory/entry/oh-package.json5 deleted file mode 100644 index 60744fdb..00000000 --- a/unionpi_tiger/sample/app/factory/entry/oh-package.json5 +++ /dev/null @@ -1,10 +0,0 @@ -{ - "license": "", - "devDependencies": {}, - "author": "", - "name": "entry", - "description": "Please describe the basic information.", - "main": "", - "version": "1.0.0", - "dependencies": {} -} diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/ets/common/AvailableWifi.ets b/unionpi_tiger/sample/app/factory/entry/src/main/ets/common/AvailableWifi.ets deleted file mode 100644 index 97108893..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/main/ets/common/AvailableWifi.ets +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import prompt from '@ohos.promptAction' -import Logger from '../model/Logger' -import { PswDialog } from './PswDialog' -import { WifiModel } from '../model/WifiModel' -import { WifiView } from './WifiView' -import WifiDataSource from './BasicDataSource' -import wifi from '@ohos.wifiManager' - -const TAG = 'AvailableWiFi' -let self = null - -@Component -export struct AvailableWifi { - private wifiModel = new WifiModel() - private linkedInfo: wifi.WifiLinkedInfo = null - @StorageLink('wifiList') @Watch('wifiListRefresh') wifiList: Array = [] - @State wifiDataResource: WifiDataSource = new WifiDataSource(this.wifiList) - @State scanInfo: wifi.WifiScanInfo = undefined - private pswDialogController: CustomDialogController = new CustomDialogController({ - builder: PswDialog({ scanInfo: $scanInfo, action: this.onAccept }), - autoCancel: true - }) - - build() { - List() { - ListItem() { - Row() { - Text($r('app.string.available_wlan')) - .fontSize(22) - .layoutWeight(1) - } - .id('validWlan') - .width('100%') - } - - LazyForEach(this.wifiDataResource, (item, index) => { - ListItem() { - WifiView({ wifi: item }) - } - .id(`Wifi${index}`) - .onClick(() => { - Logger.info(TAG, 'wifi click') - this.scanInfo = item - if (this.linkedInfo !== null && item.ssid === this.linkedInfo.ssid) { - prompt.showToast({ message: 'this wifi is connected' }) - return - } - if (item.securityType === 0 || item.securityType === 1) { - this.wifiModel.connectNetwork(item, '') - return - } - this.pswDialogController.open() - }) - }, item => JSON.stringify(item)) - } - .width('100%') - .height('100%') - .padding({ left: 16, right: 16 }) - .layoutWeight(1) - .divider({ strokeWidth: 1, color: Color.Gray, startMargin: 10, endMargin: 10 }) - .margin({ top: 10 }) - } - - onAccept(scanInfo, psw) { - Logger.info(TAG, 'connect wifi') - self.wifiModel.connectNetwork(scanInfo, psw) - } - - aboutToAppear() { - self = this - } - - wifiListRefresh() { - this.wifiDataResource['dataArray'] = this.wifiList - this.wifiDataResource.notifyDataReload() - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/ets/common/BasicDataSource.ets b/unionpi_tiger/sample/app/factory/entry/src/main/ets/common/BasicDataSource.ets deleted file mode 100644 index 8236d01c..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/main/ets/common/BasicDataSource.ets +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import wifi from '@ohos.wifiManager' -import Logger from '../model/Logger' - -export default class WifiDataSource { - private listeners: DataChangeListener[] = [] - private dataArray: wifi.WifiScanInfo[] = [] - - constructor(data: wifi.WifiScanInfo[]) { - this.dataArray = data - } - - public totalCount(): number { - return this.dataArray.length - } - - public getData(index: number): wifi.WifiScanInfo { - return this.dataArray[index] - } - - public addData(index: number, data: wifi.WifiScanInfo): void { - this.dataArray.splice(index, 0, data) - this.notifyDataAdd(index) - } - - public pushData(data: wifi.WifiScanInfo): void { - this.dataArray.push(data) - this.notifyDataAdd(this.dataArray.length - 1) - } - - registerDataChangeListener(listener: DataChangeListener): void { - if (this.listeners.indexOf(listener) < 0) { - Logger.info('add listener') - this.listeners.push(listener) - } - } - - unregisterDataChangeListener(listener: DataChangeListener): void { - const POS = this.listeners.indexOf(listener) - if (POS >= 0) { - Logger.info('remove listener') - this.listeners.splice(POS, 1) - } - } - - notifyDataReload(): void { - this.listeners.forEach(listener => { - listener.onDataReloaded() - }) - } - - notifyDataAdd(index: number): void { - this.listeners.forEach(listener => { - listener.onDataAdd(index) - }) - } - - notifyDataChange(index: number): void { - this.listeners.forEach(listener => { - listener.onDataChange(index) - }) - } - - notifyDataDelete(index: number): void { - this.listeners.forEach(listener => { - listener.onDataDelete(index) - }) - } - - notifyDataMove(from: number, to: number): void { - this.listeners.forEach(listener => { - listener.onDataMove(from, to) - }) - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/ets/common/FirstDialog.ets b/unionpi_tiger/sample/app/factory/entry/src/main/ets/common/FirstDialog.ets deleted file mode 100644 index 2e5da762..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/main/ets/common/FirstDialog.ets +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import data_preferences from '@ohos.data.preferences'; - - -export default class FirstDialog{ - static ChooseDialog = async (StepTips:string,name: string)=>{ - let Test = null; - let context =null; - context = globalThis.getContext(); - let preferences; - - let promise = data_preferences.getPreferences(context,'mystore'); - await promise.then((object) => { - preferences = object; - }); - promise = preferences.get(name, 0); - await promise.then((data) => { - Test = data; - console.info("Succeeded in getting value of 'startup'. Data: " + data); - }); - if(Test != 1) { - AlertDialog.show( - { - title: '操作提示', - message: StepTips, - primaryButton: { - value: '不再提醒',fontColor:Color.Grey, - action: () => { - let promise = preferences.put(name, 1); - promise.then(() => { - console.info("Succeeded in putting value of 'test'."); - }); - promise = preferences.flush(); - promise.then(() => { - console.info("Succeeded in flushing."); - }); - } - }, - secondaryButton: { - value: '我已知晓', - action: () => { - - } - }, - cancel: () => { - - } - } - ) - } - return; - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/ets/common/InfoView.ets b/unionpi_tiger/sample/app/factory/entry/src/main/ets/common/InfoView.ets deleted file mode 100644 index 2bd80371..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/main/ets/common/InfoView.ets +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -@Component -export struct InfoView { - private infoList: Array = [] - - build() { - Column() { - ForEach(this.infoList, (item, index) => { - Column() { - Text(item.key) - .fontColor(Color.Black) - .fontSize(20) - .width('100%') - - Text(item.value) - .fontColor(Color.Black) - .fontSize(20) - .width('100%') - .margin({ top: 5, bottom: 5 }) - if (index < this.infoList.length - 1) { - Divider().color(Color.Grey) - } - } - .padding(5) - }, item => JSON.stringify(item)) - } - .margin(10) - .border({ width: 1, color: Color.Gray, radius: 15 }) - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/ets/common/PinDialog.ets b/unionpi_tiger/sample/app/factory/entry/src/main/ets/common/PinDialog.ets deleted file mode 100644 index 92c0f459..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/main/ets/common/PinDialog.ets +++ /dev/null @@ -1,90 +0,0 @@ - -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import bluetooth from '@ohos.bluetooth' -import logger from '../Model/Logger' - -const TAG: string = 'PinDialog' - -@CustomDialog -export struct PinDialog { - private controller?: CustomDialogController - private data: bluetooth.PinRequiredParam | null = null - @State titleText: string = '' - @State pinCode: string = '' - - @Builder choiceText(message: Resource, handlerClick) { - Text(message) - .width('50%') - .fontSize(30) - .textAlign(TextAlign.Center) - .fontColor('#ff0742ef') - .onClick(handlerClick) - } - - aboutToAppear() { - this.titleText = `"${this.data.deviceId}"要与您配对。请确认此配对码已在"${this.data.deviceId}"上直接显示,且不是手动输入的。` - this.pinCode = JSON.stringify(this.data.pinCode) - } - - build() { - Column({ space: 10 }) { - Text($r('app.string.match_request')) - .fontSize(30) - .alignSelf(ItemAlign.Start) - Text(this.titleText) - .alignSelf(ItemAlign.Start) - .margin({ top: 20 }) - .fontSize(21) - Text(this.pinCode) - .fontSize(40) - .fontWeight(FontWeight.Bold) - .margin({ top: 20 }) - Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { - Checkbox({ name: 'checkbox' }) - .select(false) - .selectedColor('#ff3d6fb8') - .key('checkBox') - Text($r('app.string.grant_permission')) - .fontSize(15) - .margin({ left: 3, top: 6 }) - } - .alignSelf(ItemAlign.Start) - .width('95%') - .margin({ top: 5 }) - - Row() { - this.choiceText($r('app.string.cancel'), () => { - bluetooth.setDevicePairingConfirmation(this.data.deviceId, false) - logger.info(TAG, `setDevicePairingConfirmation = ${bluetooth.setDevicePairingConfirmation(this.data.deviceId, false)}`) - this.controller.close() - }) - - Divider() - .vertical(true) - .height(32) - - this.choiceText($r('app.string.match'), () => { - bluetooth.setDevicePairingConfirmation(this.data.deviceId, true) - logger.info(TAG, `setDevicePairingConfirmation = ${bluetooth.setDevicePairingConfirmation(this.data.deviceId, true)}`) - this.controller.close() - }) - } - .margin({ top: 20 }) - } - .width('100%') - .padding(15) - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/ets/common/PswDialog.ets b/unionpi_tiger/sample/app/factory/entry/src/main/ets/common/PswDialog.ets deleted file mode 100644 index 744117d4..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/main/ets/common/PswDialog.ets +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import wifi from '@ohos.wifiManager' - -@CustomDialog -export struct PswDialog { - @Link scanInfo: wifi.WifiScanInfo - private psw: string = '' - private controller: CustomDialogController - private action: (scanInfo, psw) => void - - build() { - Column() { - Text(this.scanInfo.ssid) - .fontSize(20) - .width('95%') - - TextInput({ placeholder: 'input password' }) - .id('input') - .type(InputType.Password) - .placeholderColor(Color.Gray) - .fontSize(19) - .margin({ top: 15 }) - .width('95%') - .height(36) - .onChange((value: string) => { - this.psw = value - }) - - Row() { - Button() { - Text($r('app.string.sure')) - .fontColor(Color.Blue) - .fontSize(17) - } - .id('sure') - .layoutWeight(7) - .backgroundColor(Color.White) - .margin(5) - .onClick(() => { - this.controller.close() - this.action(this.scanInfo, this.psw) - }) - - // 分割线 - Text() - .width(1) - .height(35) - .backgroundColor(Color.Black) - - Button() { - Text($r('app.string.cancel')) - .fontColor(Color.Red) - .fontSize(17) - } - .layoutWeight(7) - .backgroundColor(Color.White) - .margin(5) - .onClick(() => { - this.controller.close() - }) - } - .width('100%') - .margin({ top: '3%' }) - } - .padding(15) - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/ets/common/TipsDialog.ets b/unionpi_tiger/sample/app/factory/entry/src/main/ets/common/TipsDialog.ets deleted file mode 100644 index b9f4edc9..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/main/ets/common/TipsDialog.ets +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// xxx.ets -@CustomDialog -export struct TipsDialog { - title: string - text: string - controller: CustomDialogController - // 若尝试在CustomDialog中传入多个其他的Controller,以实现在CustomDialog中打开另一个或另一些CustomDialog,那么此处需要将指向自己的controller放在最后 - cancel: () => void - confirm: () => void - - build() { - Column() { - Text(this.title).fontSize(20).margin({ top: 10, bottom: 10 }) - Text(this.text).fontSize(16).margin({ bottom: 10 }) - - } - // dialog默认的borderRadius为24vp,如果需要使用border属性,请和borderRadius属性一起使用。 - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/ets/common/TitleBar.ets b/unionpi_tiger/sample/app/factory/entry/src/main/ets/common/TitleBar.ets deleted file mode 100644 index d0fc0c6b..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/main/ets/common/TitleBar.ets +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import router from '@ohos.router' - -// Page title bar -@Component -export struct TitleBar { - private title: Resource | string - - build() { - Column() { - Row() { - Image($r('app.media.ic_back')) - .width(20) - .height(20) - .margin({ left: 26 }) - .objectFit(ImageFit.Contain) - .onClick(() => { - router.back() - }).id('backBtn') - Text(this.title) - .fontSize(20) - .layoutWeight(1) - .margin({ left: 16 }) - .align(Alignment.Start) - Blank() - } - .height(56) - .width('100%') - } - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/ets/common/WifiView.ets b/unionpi_tiger/sample/app/factory/entry/src/main/ets/common/WifiView.ets deleted file mode 100644 index be3ff9ab..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/main/ets/common/WifiView.ets +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import Logger from '../model/Logger' -import wifi from '@ohos.wifiManager' - -const TAG: string = 'WifiView' - -@Component -export struct WifiView { - private wifi: wifi.WifiScanInfo = null - private securityString: Resource = $r('app.string.encryption') - @State isLock: boolean = true - - aboutToAppear() { - Logger.debug(TAG, `aboutToAppear ${JSON.stringify(this.wifi)}`) - if (this.wifi) { - if (this.wifi.securityType) { - if (this.wifi.securityType === 0 || this.wifi.securityType === 1) { - this.securityString = $r('app.string.open') - this.isLock = false - } - } - } - } - - build() { - Row() { - Column() { - if (this.wifi) { - if (this.wifi.ssid) { - Text(this.wifi.ssid) - .fontSize(20) - .width('50%') - Text(this.wifi.frequency.toString()) - .fontSize(20) - .width('50%') - } - } - Text(this.securityString) - .fontSize(18) - .fontColor(Color.Gray) - .width('100%') - } - .layoutWeight(1) - - Stack({ alignContent: Alignment.BottomEnd }) { - Image($r('app.media.wifi')) - .height(30) - .width(30) - .objectFit(ImageFit.Contain) - if (this.isLock) { - Image($r('app.media.lock')) - .objectFit(ImageFit.Contain) - .width(15) - .height(15) - } - } - .width(40) - .height(40) - .margin({ right: 10 }) - } - .backgroundColor(Color.White) - .width('100%') - .padding(10) - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/ets/controller/BluetoothDeviceController.ts b/unionpi_tiger/sample/app/factory/entry/src/main/ets/controller/BluetoothDeviceController.ts deleted file mode 100644 index 9005e690..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/main/ets/controller/BluetoothDeviceController.ts +++ /dev/null @@ -1,460 +0,0 @@ -/** - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import deviceInfo from '@ohos.deviceInfo'; -import BluetoothModel, { BondState, ProfileConnectionState } from '../Model/BluetoothModel'; -import BluetoothDevice from '../Model/BluetoothDevice'; -import Logger from '../Model/Logger'; -import settings from '@ohos.settings'; - - -const deviceTypeInfo = deviceInfo.deviceType; -const DISCOVERY_DURING_TIME: number = 30000; // 30' -const DISCOVERY_INTERVAL_TIME: number = 3000; // 3' -let debounceTimer = null; - -export default class BluetoothDeviceController { - private TAG = 'BluetoothDeviceController ' - - //state - private isOn: boolean = false; - private enabled: boolean = false; - - // paired devices - private pairedDevices: BluetoothDevice[] = []; - - // available devices - private isDeviceDiscovering: boolean = false; - private availableDevices: BluetoothDevice[] = []; - private pairPinCode: string = ''; - private discoveryStartTimeoutId: number; - private discoveryStopTimeoutId: number; - - - - initData(){ - Logger.info(this.TAG + 'start to initData bluetooth'); - let isOn = BluetoothModel.isStateOn(); - Logger.info(this.TAG + 'initData bluetooth state isOn ' + isOn + ', typeof isOn = ' + typeof (isOn)) - if (isOn) { - this.refreshPairedDevices(); - } - - Logger.info(this.TAG + 'initData save value to app storage. ') - this.isOn = new Boolean(isOn).valueOf() - this.enabled = true - - AppStorage.SetOrCreate('bluetoothIsOn', this.isOn); - AppStorage.SetOrCreate('bluetoothToggleEnabled', this.enabled); - AppStorage.SetOrCreate('bluetoothAvailableDevices', this.availableDevices); - - return this; - } - - subscribe() { - Logger.info(this.TAG + 'subscribe bluetooth state isOn ' + this.isOn) - this.subscribeStateChange(); - this.subscribeBluetoothDeviceFind(); - this.subscribeBondStateChange(); - this.subscribeDeviceConnectStateChange(); - BluetoothModel.subscribePinRequired((pinRequiredParam: { - deviceId: string; - pinCode: string; - }) => { - Logger.info(this.TAG + 'bluetooth subscribePinRequired callback. pinRequiredParam = ' + pinRequiredParam.pinCode); - let pairData = this.getAvailableDevice(pinRequiredParam.deviceId); - this.pairPinCode = pinRequiredParam.pinCode; - AppStorage.SetOrCreate('pairData', pairData); - AppStorage.SetOrCreate('pinRequiredParam', pinRequiredParam); - }) - return this; - } - - unsubscribe(){ - Logger.info(this.TAG + 'start to unsubscribe bluetooth'); - this.stopBluetoothDiscovery(); - - if (this.discoveryStartTimeoutId) { - clearTimeout(this.discoveryStartTimeoutId); - } - - if (this.discoveryStopTimeoutId) { - clearTimeout(this.discoveryStopTimeoutId); - } - - BluetoothModel.unsubscribeBluetoothDeviceFind(); - BluetoothModel.unsubscribeBondStateChange(); - BluetoothModel.unsubscribeDeviceStateChange(); - AppStorage.Delete('BluetoothFailedDialogFlag'); - return this; - } - - /** - * Set toggle value - */ - toggleValue(isOn: boolean) { - clearTimeout(debounceTimer); - debounceTimer = setTimeout(() => { - let curState = BluetoothModel.getState(); - if ((curState === 2) === isOn) { - return; - } - this.enabled = false - AppStorage.SetOrCreate('bluetoothToggleEnabled', this.enabled); - Logger.info(this.TAG + 'afterCurrentValueChanged bluetooth state isOn = ' + this.isOn) - if (isOn) { - BluetoothModel.enableBluetooth(); - } else { - BluetoothModel.disableBluetooth(); - // remove all elements from availableDevices array - this.availableDevices.splice(0, this.availableDevices.length) - } - },500) - } - - - /** - * Pair device. - * - * @param deviceId device id - * @param success success callback - * @param error error callback - */ - pair(deviceId: string, success?: (pinCode: string) => void, error?: () => void): void { - const device: BluetoothDevice = this.getAvailableDevice(deviceId); - if (device && device.connectionState === BondState.BOND_STATE_BONDING) { - Logger.info(this.TAG + `bluetooth no Aavailable device or device is already pairing.`) - return; - } - // start pairing - BluetoothModel.pairDevice(deviceId); - } - - /** - * Confirm pairing. - * - * @param deviceId device id - * @param accept accept or not - * @param success success callback - * @param error error callback - */ - confirmPairing(deviceId: string, accept: boolean): void { - if (accept) { - try { - this.getAvailableDevice(deviceId).connectionState = BondState.BOND_STATE_BONDING; - } catch (err) { - Logger.error(this.TAG + 'confirmPairing =' + JSON.stringify(err)); - } - } - // set paring confirmation - BluetoothModel.setDevicePairingConfirmation(deviceId, accept); - - } - - /** - * Connect device. - * @param deviceId device id - */ - connect(deviceId: string): Array<{ - profileId: number; - connectRet: boolean; - }> { - return BluetoothModel.connectDevice(deviceId); - } - - /** - * disconnect device. - * @param deviceId device id - */ - disconnect(deviceId: string): Array<{ - profileId: number; - disconnectRet: boolean; - }> { - return BluetoothModel.disconnectDevice(deviceId); - } - - /** - * Unpair device. - * @param deviceId device id - */ - unpair(deviceId: string): boolean { - AppStorage.SetOrCreate('BluetoothFailedDialogFlag', false); - const result = BluetoothModel.unpairDevice(deviceId); - Logger.info(this.TAG + 'bluetooth paired device unpair. result = ' + result) - this.refreshPairedDevices() - return result; - } - - /** - * Refresh paired devices. - */ - refreshPairedDevices() { - let deviceIds: string[] = BluetoothModel.getPairedDeviceIds(); - let list: BluetoothDevice[] = [] - deviceIds.forEach(deviceId => { - list.push(this.getDevice(deviceId)); - }); - this.pairedDevices = list; - this.sortPairedDevices(); - AppStorage.SetOrCreate('bluetoothPairedDevices', this.pairedDevices); - Logger.info(this.TAG + 'bluetooth paired devices. list length = ' + JSON.stringify(list.length)) - } - - /** - * Paired device should be shown on top of the list. - */ - private sortPairedDevices() { - Logger.info(this.TAG + 'sortPairedDevices in.') - this.pairedDevices.sort((a: BluetoothDevice, b: BluetoothDevice) => { - if (a.connectionState == ProfileConnectionState.STATE_DISCONNECTED && b.connectionState == ProfileConnectionState.STATE_DISCONNECTED) { - return 0 - } else if (b.connectionState == ProfileConnectionState.STATE_DISCONNECTED) { - return -1 - } else if (a.connectionState == ProfileConnectionState.STATE_DISCONNECTED) { - return 1 - } else { - return 0 - } - }) - Logger.info(this.TAG + 'sortPairedDevices out.') - } - - //---------------------- subscribe ---------------------- - /** - * Subscribe bluetooth state change - */ - private subscribeStateChange() { - BluetoothModel.subscribeStateChange((isOn: boolean) => { - Logger.info(this.TAG + 'bluetooth state changed. isOn = ' + isOn) - this.isOn = new Boolean(isOn).valueOf(); - this.enabled = true; - - Logger.info(this.TAG + 'bluetooth state changed. save value.') - AppStorage.SetOrCreate('bluetoothIsOn', this.isOn); - AppStorage.SetOrCreate('bluetoothToggleEnabled', this.enabled); - - if (isOn) { - Logger.info(this.TAG + 'bluetooth state changed. unsubscribe') - this.startBluetoothDiscovery(); - } else { - Logger.info(this.TAG + 'bluetooth state changed. subscribe') - this.mStopBluetoothDiscovery(); - } - }); - } - - /** - * Subscribe device find - */ - private subscribeBluetoothDeviceFind() { - BluetoothModel.subscribeBluetoothDeviceFind((deviceIds: Array) => { - Logger.info( this.TAG + 'available bluetooth devices changed.'); - - deviceIds?.forEach(deviceId => { - let device = this.availableDevices.find((availableDevice) => { - return availableDevice.deviceId === deviceId - }) - Logger.info(this.TAG + 'available bluetooth find'); - if (!device) { - let pairedDevice = this.pairedDevices.find((pairedDevice) => { - return pairedDevice.deviceId === deviceId - }) - if (pairedDevice) { - Logger.info(this.TAG + `available bluetooth is paried.`); - } else { - Logger.info(this.TAG + 'available bluetooth new device found. availableDevices length = ' + this.availableDevices.length); - let newDevice = this.getDevice(deviceId); - this.availableDevices.push(newDevice); - Logger.info(this.TAG + 'available bluetooth new device pushed. availableDevices length = ' + this.availableDevices.length); - } - } - }) - AppStorage.SetOrCreate('bluetoothAvailableDevices', this.availableDevices); - }); - } - - /** - * Subscribe bond state change - */ - private subscribeBondStateChange() { - BluetoothModel.subscribeBondStateChange((data: { - deviceId: string; - bondState: number; - }) => { - Logger.info(this.TAG + "data.bondState" + JSON.stringify(data.bondState)) - //paired devices - if (data.bondState !== BondState.BOND_STATE_BONDING) { - AppStorage.SetOrCreate("controlPairing", true) - this.refreshPairedDevices(); - } - - //available devices - if (data.bondState == BondState.BOND_STATE_BONDING) { - AppStorage.SetOrCreate("controlPairing", false) - // case bonding - // do nothing and still listening - Logger.info(this.TAG + 'bluetooth continue listening bondStateChange.'); - if (this.getAvailableDevice(data.deviceId) != null) { - this.getAvailableDevice(data.deviceId).connectionState = ProfileConnectionState.STATE_CONNECTING; - } - - } else if (data.bondState == BondState.BOND_STATE_INVALID) { - AppStorage.SetOrCreate("controlPairing", true) - // case failed - if (this.getAvailableDevice(data.deviceId) != null) { - this.getAvailableDevice(data.deviceId).connectionState = ProfileConnectionState.STATE_DISCONNECTED; - } - this.forceRefresh(this.availableDevices); - AppStorage.SetOrCreate('bluetoothAvailableDevices', this.availableDevices); - let showFlag = AppStorage.Get('BluetoothFailedDialogFlag'); - if (showFlag == false) { - AppStorage.SetOrCreate('BluetoothFailedDialogFlag', true); - return; - } - } else if (data.bondState == BondState.BOND_STATE_BONDED) { - // case success - Logger.info(this.TAG + 'bluetooth bonded : remove device.'); - this.removeAvailableDevice(data.deviceId); - BluetoothModel.connectDevice(data.deviceId); - } - - }); - } - - /** - * Subscribe device connect state change - */ - private subscribeDeviceConnectStateChange() { - BluetoothModel.subscribeDeviceStateChange((data: { - profileId: number; - deviceId: string; - profileConnectionState: number; - }) => { - Logger.info(this.TAG + 'device connection state changed. profileId:' + JSON.stringify(data.profileId) - + ' profileConnectionState: ' + JSON.stringify(data.profileConnectionState)); - for (let device of this.pairedDevices) { - if (device.deviceId === data.deviceId) { - device.setProfile(data); - this.sortPairedDevices(); - AppStorage.SetOrCreate('bluetoothPairedDevices', this.pairedDevices); - break; - } - }; - Logger.info(this.TAG + 'device connection state changed. pairedDevices length = ' - + JSON.stringify(this.pairedDevices.length)) - Logger.info(this.TAG + 'device connection state changed. availableDevices length = ' - + JSON.stringify(this.availableDevices.length)) - this.removeAvailableDevice(data.deviceId); - }); - } - - //---------------------- private ---------------------- - /** - * Get device by device id. - * @param deviceId device id - */ - protected getDevice(deviceId: string): BluetoothDevice { - let device = new BluetoothDevice(); - device.deviceId = deviceId; - device.deviceName = BluetoothModel.getDeviceName(deviceId); - device.deviceType = BluetoothModel.getDeviceType(deviceId); - device.setProfiles(BluetoothModel.getDeviceState(deviceId)); - return device; - } - - /** - * Force refresh array. - * Note: the purpose of this function is just trying to fix page (ets) level's bug below, - * and should be useless if fixed by the future sdk. - * Bug Details: - * @State is not supported well for Array type. - * In the case that the array item's field value changed, while not its length, - * the build method on page will not be triggered! - */ - protected forceRefresh(arr: BluetoothDevice[]): void { - arr.push(new BluetoothDevice()) - arr.pop(); - } - - /** - * Start bluetooth discovery. - */ - public startBluetoothDiscovery() { - this.isDeviceDiscovering = true; - BluetoothModel.startBluetoothDiscovery(); - - this.discoveryStopTimeoutId = setTimeout(() => { - this.stopBluetoothDiscovery(); - }, DISCOVERY_DURING_TIME); - } - - /** - * Stop bluetooth discovery. - */ - private stopBluetoothDiscovery() { - this.isDeviceDiscovering = false; - BluetoothModel.stopBluetoothDiscovery(); - - this.discoveryStartTimeoutId = setTimeout(() => { - this.startBluetoothDiscovery(); - }, DISCOVERY_INTERVAL_TIME); - } - - /** - * Stop bluetooth discovery. - */ - private mStopBluetoothDiscovery() { - this.isDeviceDiscovering = false; - BluetoothModel.stopBluetoothDiscovery(); - if (this.discoveryStartTimeoutId) { - clearTimeout(this.discoveryStartTimeoutId); - } - - if (this.discoveryStopTimeoutId) { - clearTimeout(this.discoveryStopTimeoutId); - } - } - - - /** - * Get available device. - * - * @param deviceId device id - */ - private getAvailableDevice(deviceIds: string): BluetoothDevice { - Logger.info(this.TAG + 'getAvailableDevice length = ' + this.availableDevices.length); - let temp = this.availableDevices; - for (let i = 0; i < temp.length; i++) { - if (temp[i].deviceId === deviceIds) { - return temp[i]; - } - } - return null; - } - - /** - * Remove available device. - * - * @param deviceId device id - */ - private removeAvailableDevice(deviceId: string): void { - Logger.info(this.TAG + 'removeAvailableDevice : before : availableDevices length = ' + this.availableDevices.length); - this.availableDevices = this.availableDevices.filter((device) => device.deviceId !== deviceId) - AppStorage.SetOrCreate('bluetoothAvailableDevices', this.availableDevices); - Logger.info(this.TAG + 'removeAvailableDevice : after : availableDevices length = ' + this.availableDevices.length); - } - - -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/ets/entryability/EntryAbility.ts b/unionpi_tiger/sample/app/factory/entry/src/main/ets/entryability/EntryAbility.ts deleted file mode 100644 index 025b5b71..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/main/ets/entryability/EntryAbility.ts +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import UIAbility from '@ohos.app.ability.UIAbility'; -import hilog from '@ohos.hilog'; -import window from '@ohos.window'; -import abilityAccessCtrl from '@ohos.abilityAccessCtrl'; -import worker, { MessageEvents } from '@ohos.worker'; - -const TAG = 'EntryAbility' -enum fileOperateType { - WRITE = 0, - READ = 1 -} -export default class EntryAbility extends UIAbility { - - onCreate(want, launchParam) { - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); - - globalThis.context = this.context; - globalThis.pathDir = this.context.filesDir; - globalThis.nfc = 0; - } - - onDestroy() { - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage) { - // Main window is created, set main page for this ability - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - AppStorage.setOrCreate("writeTimeSpeed",0); - AppStorage.setOrCreate("readTimeSpeed",0); - AppStorage.setOrCreate("btnEnable",true); - let AtManager = abilityAccessCtrl.createAtManager(); - AtManager.requestPermissionsFromUser(this.context, ['ohos.permission.READ_MEDIA', 'ohos.permission.WRITE_MEDIA', - 'ohos.permission.CAPTURE_SCREEN', 'ohos.permission.INTERNET', 'ohos.permission.CAMERA', - 'ohos.permission.MICROPHONE', 'ohos.permission.START_INVISIBLE_ABILITY']).then(() => { - }); - windowStage.loadContent('pages/Index', (err, data) => { - if (err.code) { - hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); - return; - } - hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); - }); - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground() { - // Ability has brought to foreground - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground() { - // Ability has back to background - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); - } -} diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/ets/model/BluetoothDevice.ts b/unionpi_tiger/sample/app/factory/entry/src/main/ets/model/BluetoothDevice.ts deleted file mode 100644 index aa1fcd53..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/main/ets/model/BluetoothDevice.ts +++ /dev/null @@ -1,90 +0,0 @@ -/** - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { ProfileConnectionState } from './BluetoothModel'; -export class Profile { - profileId: number = -1; - profileConnectionState: number = -1 - - constructor() { - } -} - -/** - * Bluetooth device class - */ -export default class BluetoothDevice { - deviceId: string = ''; - deviceName: string = ''; - deviceType: string = ''; - connectionState: number = 0; - profiles: Map = new Map(); - - constructor() { - } - - setProfiles(data: Array<{ - profileId: number; - profileConnectionState: number; - }>): void{ - - data.forEach((item: { - profileId: number; - profileConnectionState: number; - }) => { - this.setProfile({ - profileId: item.profileId, - deviceId: this.deviceId, - profileConnectionState: item.profileConnectionState - }) - }) - } - - setProfile(data: { - profileId: number; - deviceId: string; - profileConnectionState: number; - }): void{ - if (this.deviceId !== data.deviceId) { - return; - } - - this.profiles.set(data.profileId, data) - - let countStateDisconnect = 0; - let countStateConnecting = 0; - let countStateConnected = 0; - let countStateDisconnecting = 0; - - this.profiles.forEach((profile, key) => { - if (profile.profileConnectionState == ProfileConnectionState.STATE_DISCONNECTED) { - countStateDisconnect++; - } else if (profile.profileConnectionState == ProfileConnectionState.STATE_CONNECTING) { - countStateConnecting++; - } else if (profile.profileConnectionState == ProfileConnectionState.STATE_CONNECTED) { - countStateConnected++; - } else if (profile.profileConnectionState == ProfileConnectionState.STATE_DISCONNECTING) { - countStateDisconnecting++; - } - }); - - if (countStateConnected > 0 || countStateDisconnecting > 0) { - this.connectionState = ProfileConnectionState.STATE_CONNECTED; - } else if (countStateConnecting > 0) { - this.connectionState = ProfileConnectionState.STATE_CONNECTING; - } else { - this.connectionState = ProfileConnectionState.STATE_DISCONNECTED; - } - } -} diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/ets/model/BluetoothModel.ts b/unionpi_tiger/sample/app/factory/entry/src/main/ets/model/BluetoothModel.ts deleted file mode 100644 index df912f23..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/main/ets/model/BluetoothModel.ts +++ /dev/null @@ -1,566 +0,0 @@ -/** - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import bluetooth from '@ohos.bluetooth'; -import bluetoothManager from '@ohos.bluetoothManager'; -import Logger from './Logger' - -export enum ProfileCode { - CODE_BT_PROFILE_A2DP_SINK = 0, - CODE_BT_PROFILE_A2DP_SOURCE, - CODE_BT_PROFILE_AVRCP_CT, - CODE_BT_PROFILE_AVRCP_TG, - CODE_BT_PROFILE_HANDS_FREE_AUDIO_GATEWAY, - CODE_BT_PROFILE_HANDS_FREE_UNIT, - CODE_BT_PROFILE_HID_HOST, - CODE_BT_PROFILE_PAN_NETWORK, - CODE_BT_PROFILE_PBAP_CLIENT, - CODE_BT_PROFILE_PBAP_SERVER, -}; - -export enum ProfileConnectionState { - /** the current profile is disconnected */ - STATE_DISCONNECTED = 0, - /** the current profile is being connected */ - STATE_CONNECTING = 1, - /** the current profile is connected */ - STATE_CONNECTED = 2, - /** the current profile is being disconnected */ - STATE_DISCONNECTING = 3 -} - -export enum BondState { - /** Indicate the bond state is invalid */ - BOND_STATE_INVALID = 0, - /** Indicate the bond state is bonding */ - BOND_STATE_BONDING = 1, - /** Indicate the bond state is bonded*/ - BOND_STATE_BONDED = 2 -} - -export enum DeviceType { - BLUETOOTH = '1', - HEADPHONE = '2', - PHONE = '3', - COMPUTER = '4', - WATCH = '5' -} - -export enum BluetoothErrorCode { - SUCCESS = -1, - HOLD_PAIRING_MODE = 1, - APP_PAIR = 2, - PAIR_FAILED = 3, - DEVICE_ILLEGAL = 4, - CONNECT_FAILED = 5 -} - -enum BluetoothState { - /** Indicates the local Bluetooth is off */ - STATE_OFF = 0, - /** Indicates the local Bluetooth is turning on */ - STATE_TURNING_ON = 1, - /** Indicates the local Bluetooth is on, and ready for use */ - STATE_ON = 2, - /** Indicates the local Bluetooth is turning off */ - STATE_TURNING_OFF = 3, - /** Indicates the local Bluetooth is turning LE mode on */ - STATE_BLE_TURNING_ON = 4, - /** Indicates the local Bluetooth is in LE only mode */ - STATE_BLE_ON = 5, - /** Indicates the local Bluetooth is turning off LE only mode */ - STATE_BLE_TURNING_OFF = 6 -} - -/** - * bluetooth service class - */ -export class BluetoothModel { - private TAG = 'BluetoothModel '; - private profiles: any[] = new Array(10); - public canUse: boolean = false; - - /** - * constructor - */ - constructor() { - try{ - Logger.info('bluetooth.getProfile start') - let ProfileId = bluetoothManager.ProfileId; - this.profiles[ProfileId.PROFILE_A2DP_SOURCE] - = bluetoothManager.getProfileInstance(ProfileId.PROFILE_A2DP_SOURCE); - this.profiles[ProfileId.PROFILE_HANDS_FREE_AUDIO_GATEWAY] - = bluetoothManager.getProfileInstance(ProfileId.PROFILE_HANDS_FREE_AUDIO_GATEWAY); - this.profiles[ProfileId.PROFILE_HID_HOST] - = bluetoothManager.getProfileInstance(ProfileId.PROFILE_HID_HOST); - Logger.info('bluetooth.getProfile end') - this.canUse = true; - } - catch(error){ - Logger.info('bluetooth.getProfile error') - this.canUse = false; - Logger.info(`BluetoothModel error: ${JSON.stringify(error)}.`); - } - } - - - /** - * Get Bluetooth status - * @return value of bluetooth.BluetoothState type - */ - getState(): number { - let bluetoothState = bluetooth.getState(); - Logger.info(`${this.TAG} getState: bluetoothState = ${bluetoothState}`); - return bluetoothState; - } - - /** - * Get Bluetooth switch status - */ - isStateOn(): boolean { - let result = false; - let state = bluetooth.getState(); - Logger.info(`${this.TAG} isStateOn: state = ${state}`); - switch (state) { - case BluetoothState.STATE_ON: - result = true - break; - default: - break; - } - Logger.info(`${this.TAG} isStateOn: bluetoothState = ${result}`); - return result; - } - - /** - * Subscribe Bluetooth switch status Change - */ - subscribeStateChange(callback: (data: boolean) => void): void { - Logger.info('bluetooth.subscribeStateChange start'); - bluetooth.on('stateChange', (data) => { - Logger.info(`${this.TAG} subscribeStateChange->stateChange data:${data}`); - if (callback) { - switch (data) { - case BluetoothState.STATE_ON: - bluetooth.setBluetoothScanMode(4, 0); - Logger.info(`${this.TAG} subscribeStateChange->stateChange return: true`); - callback(true) - break; - - case BluetoothState.STATE_OFF: - Logger.info(`${this.TAG} subscribeStateChange->stateChange return: false`); - callback(false) - break; - - default: - break; - } - } - }) - } - - /** - * unsubscribe Bluetooth switch status Change - */ - unsubscribeStateChange(callback?: (data: boolean) => void): void { - Logger.info('bluetooth.unsubscribeStateChange start'); - bluetooth.off('stateChange', (data) => { - Logger.info(`${this.TAG} unsubscribeStateChange->stateChange data:${data}`); - if (callback) { - let result = false; - switch (data) { - case BluetoothState.STATE_ON: - Logger.info(`${this.TAG} unsubscribeStateChange->stateChange return : true`); - callback(true) - break; - case BluetoothState.STATE_OFF: - Logger.info(`${this.TAG} unsubscribeStateChange->stateChange return : false`); - callback(false) - break; - default: - break; - } - } - }) - } - - /** - * Turn on Bluetooth - */ - - enableBluetooth(): boolean { - return bluetooth.enableBluetooth(); - } - - /** - * Turn off Bluetooth - */ - - disableBluetooth(): boolean { - return bluetooth.disableBluetooth(); - } - - /** - * Get local name - */ - getLocalName(): string { - return bluetooth.getLocalName(); - } - - /** - * Set local name - */ - setLocalName(name: string): boolean { - return bluetooth.setLocalName(name); - } - - /** - * Get paired device ids - */ - getPairedDeviceIds(): Array { - return bluetooth.getPairedDevices(); - } - - /** - * Start Bluetooth discovery - */ - - startBluetoothDiscovery(): boolean { - return bluetooth.startBluetoothDiscovery(); - } - - /** - * Stop Bluetooth discovery - */ - - stopBluetoothDiscovery(): boolean { - return bluetooth.stopBluetoothDiscovery(); - } - - /** - * Subscribe Bluetooth status Change - */ - subscribeBluetoothDeviceFind(callback: (data: Array) => void): void { - Logger.info('bluetooth.subscribeBluetoothDeviceFind start'); - bluetooth.on('bluetoothDeviceFind', (data: Array) => { - Logger.info(`${this.TAG} subscribeBluetoothDeviceFind->deviceFind callback`); - if (callback) { - callback(data) - } - }) - } - - /** - * unsubscribe Bluetooth status Change - */ - unsubscribeBluetoothDeviceFind(callback?: (data: Array) => void): void { - Logger.info('bluetooth.unsubscribeBluetoothDeviceFind start'); - bluetooth.off('bluetoothDeviceFind', (data) => { - Logger.info(`${this.TAG} unsubscribeBluetoothDeviceFind->deviceFind callback`); - if (callback) { - callback(data) - } - }) - } - - /** - * Pair device - */ - pairDevice(deviceId: string): boolean { - return bluetooth.pairDevice(deviceId); - } - - /** - * Subscribe PinRequired - */ - subscribePinRequired(callback: (data: { - deviceId: string; - pinCode: string; - }) => void): void { - Logger.info('bluetooth.subscribePinRequired start'); - bluetooth.on('pinRequired', (data: { - deviceId: string; - pinCode: string; - }) => { - Logger.info(`${this.TAG} subscribePinRequired->pinRequired return: ${data.pinCode}`); - if (callback) { - callback(data) - } - }) - } - - /** - * Unsubscribe PinRequired - */ - unsubscribePinRequired(callback?: (data: { - deviceId: string; - pinCode: string; - }) => void): void { - Logger.info('bluetooth.unsubscribePinRequired start'); - bluetooth.off('pinRequired', (data: { - deviceId: string; - pinCode: string; - }) => { - if(data == undefined || !data){ - Logger.error(`${this.TAG} unsubscribePinRequired->pinRequired error`); - return; - } - Logger.info(`${this.TAG} unsubscribePinRequired->pinRequired return: ${data.pinCode}`); - if (callback) { - callback(data) - } - }) - } - - /** - * Set device PairingConfirmation - */ - setDevicePairingConfirmation(deviceId: string, accept: boolean): boolean { - Logger.info('bluetooth.setDevicePairingConfirmation start, accept:' + accept); - let ret = bluetooth.setDevicePairingConfirmation(deviceId, accept); - Logger.info('bluetooth.unsubscribePinRequired end, ret: ' + ret); - return ret; - } - - /** - * Subscribe bondStateChange - */ - subscribeBondStateChange(callback): void { - Logger.info('bluetooth.subscribeBondStateChange start'); - bluetooth.on('bondStateChange', (data) => { - Logger.info(`${this.TAG} subscribeBondStateChange->bondStateChange data.state:${JSON.stringify(data.state)}`); - if (callback) { - let result = { - deviceId: data.deviceId, - bondState: data.state - } - Logger.info(`${this.TAG} subscribeBondStateChange->bondStateChange return:${JSON.stringify(result.bondState)}`); - callback(result); - } - }) - } - - /** - * Unsubscribe bondStateChange - */ - unsubscribeBondStateChange(callback?: (data: { - deviceId: string; - bondState: number; - }) => void): void { - bluetooth.off('bondStateChange', (data) => { - Logger.info(`${this.TAG} unsubscribeBondStateChange->bondStateChange start`); - if (callback) { - let result = { - deviceId: data.deviceId, - bondState: data.state - } - Logger.info(`${this.TAG} unsubscribeBondStateChange->bondStateChange return:${JSON.stringify(result.bondState)}`); - callback(result); - } - }) - } - - /** - * Get device name - */ - getDeviceName(deviceId: string): string { - return bluetooth.getRemoteDeviceName(deviceId); - } - - /** - * Get device type - */ - getDeviceType(deviceId: string): string { - let deviceType = DeviceType.BLUETOOTH; - let deviceClass = bluetooth.getRemoteDeviceClass(deviceId); - switch (deviceClass.majorClass) { - case 0x0100: - deviceType = DeviceType.COMPUTER; - break; - case 0x0400: - if (deviceClass.majorMinorClass === 0x0418 || deviceClass.majorMinorClass === 0x0404) { - deviceType = DeviceType.HEADPHONE; - } - break; - case 0x0700: - if (deviceClass.majorMinorClass === 0x0704) { - deviceType = DeviceType.WATCH; - } - break; - case 0x0200: - deviceType = DeviceType.PHONE; - break; - default: - deviceType = DeviceType.BLUETOOTH; - break; - } - Logger.info('bluetooth.getDeviceType end, return:' + deviceType); - return deviceType; - } - - /** - * Get device state - */ - getDeviceState(deviceId: string): Array<{ - profileId: number; - profileConnectionState: number; - }> { - let result = []; - for (let i = 0;i < this.profiles.length; i++) { - if (this.profiles[i]) { - try { - let state = this.profiles[i].getDeviceState(deviceId); - result.push({ - profileId: i, - profileConnectionState: state - }); - } catch (BusinessError) { - Logger.error("Bluetooth getDeviceState failed , BusinessError is " + JSON.stringify(BusinessError)) - } - } - } - return result; - } - - /** - * Unpair device - */ - unpairDevice(deviceId: string): boolean { - return bluetooth.cancelPairedDevice(deviceId); - } - - /** - * Connect device - */ - connectDevice(deviceId: string): Array<{ - profileId: number; - connectRet: boolean; - }> { - Logger.info('bluetooth.connectDevice start'); - let result = []; - for (let i = 0;i < this.profiles.length; i++) { - if (this.profiles[i]) { - let profile = this.profiles[i]; - let connectRet = true; - try { - profile.connect(deviceId); - } catch (BusinessError) { - Logger.info(`${this.TAG} connect failed. BusinessError is ` + JSON.stringify(BusinessError)); - connectRet = false; - } - result.push({ - profileId: i, - connectRet: connectRet - }); - } - } - Logger.info('bluetooth.connectDevice end, return:' + result); - return result; - } - - /** - * Disconnect device - */ - disconnectDevice(deviceId: string): Array<{ - profileId: number; - disconnectRet: boolean; - }> { - Logger.info('bluetooth.disconnectDevice start'); - let result = []; - for (let i = 0;i < this.profiles.length; i++) { - let profile = this.profiles[i]; - if (this.profiles[i]) { - let profileConnectionState = profile.getDeviceState(deviceId); - let disconnectRet = true; - Logger.info(`${this.TAG} disconnectDevice , connectionState = ${profileConnectionState}`); - if (profileConnectionState === 2) { - try { - profile.disconnect(deviceId); - } catch (BusinessError) { - Logger.info(`${this.TAG} disconnect failed. BusinessError is ` + JSON.stringify(BusinessError)); - disconnectRet = false; - } - } - result.push({ - profileId: i, - disconnectRet: disconnectRet - }); - } - } - Logger.info('bluetooth.connectDevice end, return:' + result); - return result; - } - - /** - * Subscribe device connection state Change - */ - subscribeDeviceStateChange(callback: (data: { - profileId: number; - deviceId: string; - profileConnectionState: number; - }) => void): void { - for (let i = 0;i < this.profiles.length; i++) { - if (this.profiles[i]) { - let profile = this.profiles[i]; - profile.on('connectionStateChange', (data) => { - if (callback) { - let result = { - profileId: i, - deviceId: data.deviceId, - profileConnectionState: data.state - }; - Logger.info(`${this.TAG} subscribeDeviceStateChange->connectionStateChange, - return:${result.profileId} - ${result.profileConnectionState}`); - callback(result); - } - }) - } - } - } - - /** - * unsubscribe device connection state Change - */ - unsubscribeDeviceStateChange(callback?: (data: { - profileId: number; - deviceId: string; - profileConnectionState: number; - }) => void): void { - for (let i = 0;i < this.profiles.length; i++) { - if (this.profiles[i]) { - let profile = this.profiles[i]; - profile.off('connectionStateChange', (data) => { - if(data == undefined || !data){ - Logger.error(`${this.TAG} unsubscribeDeviceStateChange->connectionStateChange error`); - return; - } - if (callback) { - let result = { - profileId: i, - deviceId: data.deviceId, - profileConnectionState: data.state - }; - Logger.info(`${this.TAG} unsubscribeDeviceStateChange->connectionStateChange, - return:${result.profileId} - ${result.profileConnectionState}`); - callback(result); - } - }) - } - } - } -} - -let bluetoothModel = new BluetoothModel(); - -export default bluetoothModel as BluetoothModel; \ No newline at end of file diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/ets/model/DateTimeUtil.ts b/unionpi_tiger/sample/app/factory/entry/src/main/ets/model/DateTimeUtil.ts deleted file mode 100644 index b84cfbdc..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/main/ets/model/DateTimeUtil.ts +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file 日期工具 - */ -export default class DateTimeUtil { - - /** - * 时分秒 - */ - getTime() { - const DATETIME = new Date() - return this.concatTime(DATETIME.getHours(), DATETIME.getMinutes(), DATETIME.getSeconds()) - } - getHour() { - const DATETIME = new Date() - return DATETIME.getHours() - } - getMinute() { - const DATETIME = new Date() - return DATETIME.getMinutes() - } - getSecond() { - const DATETIME = new Date() - return DATETIME.getSeconds() - } - - /** - * 年月日 - */ - getDate() { - const DATETIME = new Date() - return this.concatDate(DATETIME.getFullYear(), DATETIME.getMonth() + 1, DATETIME.getDate()) - } - getFullYear() { - const DATETIME = new Date() - return DATETIME.getFullYear() - } - getMonth() { - const DATETIME = new Date() - return DATETIME.getMonth() + 1 - } - getDay() { - const DATETIME = new Date() - return DATETIME.getDate() - } - - /** - * 日期不足两位补充0 - * @param value-数据值 - */ - fill(value: number) { - return (value > 9 ? '' : '0') + value - } - - /** - * 年月日格式修饰 - * @param year - * @param month - * @param date - */ - concatDate(year: number, month: number, date: number) { - return `${year}${this.fill(month)}${this.fill(date)}` - } - - /** - * 时分秒格式修饰 - * @param hours - * @param minutes - * @param seconds - */ - concatTime(hours: number, minutes: number, seconds: number) { - return `${this.fill(hours)}${this.fill(minutes)}${this.fill(seconds)}` - } - - getDurationString(duration: number) { - let hour = Math.floor(duration / (1000 * 60 * 60)) - let minute = Math.floor((duration - hour * (1000 * 60 * 60)) / (1000 * 60)) - let second = Math.floor((duration - hour * (1000 * 60 * 60) - minute * (60 * 1000)) / 1000) - if (hour > 0) { - return `${this.fill(hour)}:${this.fill(minute)}:${this.fill(second)}` - } - return `${this.fill(minute)}:${this.fill(second)}` - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/ets/model/Logger.ets b/unionpi_tiger/sample/app/factory/entry/src/main/ets/model/Logger.ets deleted file mode 100644 index 4cff9fea..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/main/ets/model/Logger.ets +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -class Logger { - private prefix: string - - constructor(prefix: string) { - this.prefix = prefix - } - - log(...args: string[]) { - console.log(`[${this.prefix}].${args.join(' ')}`) - } - - info(...args: string[]) { - console.log(`[${this.prefix}].${args.join(' ')}`) - } - - debug(...args: string[]) { - console.log(`[${this.prefix}].${args.join(' ')}`) - } - - error(...args: string[]) { - console.log(`[${this.prefix}].${args.join(' ')}`) - } -} - -export default new Logger('[Sample_Wlan]') \ No newline at end of file diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/ets/model/Logger.ts b/unionpi_tiger/sample/app/factory/entry/src/main/ets/model/Logger.ts deleted file mode 100644 index 281f1cdf..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/main/ets/model/Logger.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import hilog from '@ohos.hilog'; - -class Logger { - private domain: number; - private prefix: string; - private format: string = "%{public}s, %{public}s"; - - constructor(prefix: string) { - this.prefix = prefix; - this.domain = 0xFF00; - } - - debug(...args: any[]) { - hilog.debug(this.domain, this.prefix, this.format, args); - } - - info(...args: any[]) { - hilog.info(this.domain, this.prefix, this.format, args); - } - - warn(...args: any[]) { - hilog.warn(this.domain, this.prefix, this.format, args); - } - - error(...args: any[]) { - hilog.error(this.domain, this.prefix, this.format, args); - } -} - -export default new Logger('[Factory]'); \ No newline at end of file diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/ets/model/Utils.ts b/unionpi_tiger/sample/app/factory/entry/src/main/ets/model/Utils.ts deleted file mode 100644 index 91d1e49c..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/main/ets/model/Utils.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export function getTimeString(timeIndex: number, index: number) { - let result = timeIndex + index - 3 - if (result < 0) { - return ' ' - } - if (result % 60 < 10) { - return '0' + Math.floor(result / 60) + ':0' + (result % 60) - } - if (result % 60 >= 10) { - return '0' + Math.floor(result / 60) + ':' + (result % 60) - } -} - -export function updateTime(millisecond: number) { - let minute = parseInt((millisecond / 60000).toString()) - let second = parseInt(((millisecond - (minute * 60000)) / 1000).toString()) - let minuteStr = '' + minute - let secondStr = '' + second - if (minute < 10) { - minuteStr = "0" + minute - } - if (second < 10) { - secondStr = "0" + second - } - return minuteStr + ':' + secondStr; -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/ets/model/WifiModel.ets b/unionpi_tiger/sample/app/factory/entry/src/main/ets/model/WifiModel.ets deleted file mode 100644 index 1cf68e9f..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/main/ets/model/WifiModel.ets +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import prompt from '@ohos.promptAction' -import wifi from '@ohos.wifiManager' -import Logger from './Logger' - -const TAG: string = 'WiFiModel' - -export type WifiType = { - ssid: string, - bssid: string, - securityType: wifi.WifiSecurityType, - rssi: number, - band: number, - frequency: number, - timestamp: number -} - -export class WifiModel { - async getScanInfos(): Promise> { - Logger.info(TAG, 'scanWifi begin') - let wifiList: Array = [] - let result: Array = [] - try { - result = await wifi.getScanResults() - } catch (err) { - Logger.info(TAG, `scan info err: ${JSON.stringify(err)}`) - return wifiList - } - Logger.info(TAG, `scan info call back: ${result.length}`) - for (var i = 0; i < result.length; ++i) { - wifiList.push({ - ssid: result[i].ssid, - bssid: result[i].bssid, - securityType: result[i].securityType, - rssi: result[i].rssi, - band: result[i].band, - frequency: result[i].frequency, - timestamp: result[i].timestamp - }) - } - return wifiList - } - - connectNetwork(scanInfo: wifi.WifiScanInfo, psw) { - prompt.showToast({ message: 'connecting', duration: 5000 }) - Logger.debug(TAG, `connectNetwork bssid=${scanInfo.bssid}`) - // 这里因为api问题,需要声明为any,已提单 - let deviceConfig: any = { - ssid: scanInfo.ssid, - bssid: scanInfo.bssid, - preSharedKey: psw, - isHiddenSsid: false, - securityType: scanInfo.securityType - } - try { - wifi.connectToDevice(deviceConfig) - Logger.debug(TAG, `connectToDevice success`) - } catch (err) { - Logger.debug(TAG, `connectToDevice fail err is ${JSON.stringify(err)}`) - } - try { - wifi.addDeviceConfig(deviceConfig) - } catch (err) { - Logger.debug(TAG, `addDeviceConfig fail err is ${JSON.stringify(err)}`) - } - } - - resolveIP(ip) { - let address: string = ip.toString() - if (address === '0') { - return '00:00:000:000' - } - address.substring(0, 2) - return `${address.substring(0, 2)}:${address.substring(2, 4)}:${address.substring(4, 7)}:${address.substring(7, 10)}` - } - - getIpInfo() { - let ipInfoList = [] - let ipInfo = wifi.getIpInfo() - Logger.info(`${TAG} getIpInfo=${JSON.stringify(ipInfo)}`) - ipInfoList.push({ key: $r('app.string.ip_address'), value: this.resolveIP(ipInfo.ipAddress) }) - ipInfoList.push({ key: $r('app.string.gate_way'), value: this.resolveIP(ipInfo.gateway) }) - ipInfoList.push({ key: $r('app.string.net_mask'), value: this.resolveIP(ipInfo.netmask) }) - ipInfoList.push({ key: $r('app.string.primary_dns'), value: this.resolveIP(ipInfo.primaryDns) }) - ipInfoList.push({ key: $r('app.string.second_dns'), value: this.resolveIP(ipInfo.secondDns) }) - ipInfoList.push({ key: $r('app.string.server_ip'), value: this.resolveIP(ipInfo.serverIp) }) - ipInfoList.push({ key: $r('app.string.lease_duration'), value: ipInfo.leaseDuration.toString() }) - return ipInfoList - } - - getCountryCode() { - let countryCodeList = [] - let countryCode = wifi.getCountryCode() - countryCodeList.push({ key: $r('app.string.country_code'), value: countryCode }) - return countryCodeList - } - - getFeatureSupport() { - let featureSupportedList = [] - featureSupportedList.push({ - key: $r('app.string.infrastructure_feature'), - value: wifi.isFeatureSupported(0x0001).toString() - }) - featureSupportedList.push({ key: $r('app.string.ghz_feature'), value: wifi.isFeatureSupported(0x0002).toString() }) - featureSupportedList.push({ - key: $r('app.string.gas_anqp_feature'), - value: wifi.isFeatureSupported(0x0004).toString() - }) - featureSupportedList.push({ key: $r('app.string.wifi_direct'), value: wifi.isFeatureSupported(0x0008).toString() }) - featureSupportedList.push({ key: $r('app.string.soft_ap'), value: wifi.isFeatureSupported(0x0010).toString() }) - featureSupportedList.push({ key: $r('app.string.wifi_aware'), value: wifi.isFeatureSupported(0x0040).toString() }) - return featureSupportedList - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/ets/model/deviceInfos.ts b/unionpi_tiger/sample/app/factory/entry/src/main/ets/model/deviceInfos.ts deleted file mode 100644 index fbbc3a14..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/main/ets/model/deviceInfos.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import deviceInfo from '@ohos.deviceInfo' -import statvfs from '@ohos.file.statvfs' -import systemparameter from '@ohos.systemParameterEnhance' -// @ts-ignore -import deviceinfonapi from '@ohos.deviceinfonapi' - -export class deviceInfos { - public osFullName; // 系统版本 - public sdkApiVersion; // 系统软件API版本 - public deviceType; // 设备类型 - public cpuFrequency; // cpu频率 - public cpuModule; // cpu型号 - public memCapacity; // 内存容量 - public stoCapacity; // 存储容量 - public usedCapacity; // 已使用存储容量 - public freeCapacity; // 剩余容量 - public manufacture;// 设备厂家名称 - public marketName;// 外部产品系列 - public productSeries;// 产品系列 - - constructor() { - - } - bytesToMB(bytes) { return bytes / (1024 * 1024);} - async init(){ - this.osFullName = deviceInfo.osFullName; - this.sdkApiVersion = await systemparameter.get('const.ohos.apiversion'); - this.deviceType = deviceInfo.deviceType; - this.cpuFrequency = (await deviceinfonapi.get_cpu_frequency()/1000).toFixed(0).toString()+ 'MHZ'; - this.cpuModule = await systemparameter.get('const.product.cpu.abilist'); - // 内存容量 - this.memCapacity = this.bytesToMB(await deviceinfonapi.get_mem_capacity()).toFixed(0) + 'M'; - let filesDir = globalThis.context.filesDir; - // 存储容量 - let stoCapacityBite = await statvfs.getTotalSize(filesDir); - this.stoCapacity = this.bytesToMB(stoCapacityBite).toFixed(0) + 'M'; - // 剩余容量 - let freeCapacityBite = await statvfs.getFreeSize(filesDir); - this.freeCapacity = this.bytesToMB(freeCapacityBite).toFixed(0) + 'M'; - this.usedCapacity = this.bytesToMB(stoCapacityBite - freeCapacityBite).toFixed(0) + 'M'; - this.manufacture = deviceInfo.manufacture; - this.marketName = deviceInfo.marketName; - this.productSeries = deviceInfo.productSeries; - - } -} diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/Camera/CameraService.ts b/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/Camera/CameraService.ts deleted file mode 100644 index c362f6c3..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/Camera/CameraService.ts +++ /dev/null @@ -1,451 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// @ts-nocheck - -import camera from '@ohos.multimedia.camera' -import deviceInfo from '@ohos.deviceInfo' -import fileio from '@ohos.fileio' -import image from '@ohos.multimedia.image' -import media from '@ohos.multimedia.media' -import mediaLibrary from '@ohos.multimedia.mediaLibrary' -import Logger from '../../model/Logger' -import MediaUtils from './MediaUtils' -import ThumbnailGetter from './ThumbnailGetter' - -const CameraSize = { - WIDTH: 1280, - HEIGHT: 720 -} -const TAG = 'CameraService' - -class CameraService { - private static instance: CameraService = new CameraService() - private mediaUtil = MediaUtils.getInstance() - private cameraManager: camera.CameraManager = undefined - cameras: Array = undefined - private cameraInput: camera.CameraInput = undefined - private previewOutput: camera.PreviewOutput = undefined - private photoOutput: camera.PhotoOutput = undefined - private cameraOutputCapability: camera.CameraOutputCapability = undefined - private captureSession: camera.CaptureSession = undefined - private mReceiver: image.ImageReceiver = undefined - private videoPrepareFile: mediaLibrary.FileAsset = undefined - private mFileAssetId = 0 - private avRecorder: media.AVRecorder = undefined - private videoOutput: camera.VideoOutput = undefined - private mThumbnailGetter = new ThumbnailGetter() - private handleTakePicture: (photoUri: string) => void = undefined - private videoConfig: any = { - audioSourceType: 1, - videoSourceType: 1, - profile: { - audioBitrate: 48000, - audioChannels: 1, - audioCodec: 'audio/mp4a-latm', - audioSampleRate: 48000, - fileFormat: 'mp4', - videoBitrate: 280000, - videoCodec: 'video/avc', - videoFrameWidth: 640, - videoFrameHeight: 480, - videoFrameRate: 30, - }, - rotation: 0, - url: '', - orientationHint: 0, - location: { latitude: 30, longitude: 130 }, - } - private videoProfileObj: camera.VideoProfile = { - format: 1, - size: { - "width": 640, - "height": 480 - }, - frameRateRange: { - "min": 5, - "max": 5 - } - } - private photoProfileObj: camera.Profile = { - format: 1, - size: { - "width": 640, - "height": 480 - } - } - private videoOutputStopBol: boolean = true - resolution: any = null - photoResolution: any = null - videoResolution: any = null - - constructor() { - try { - this.mReceiver = image.createImageReceiver(CameraSize.WIDTH, CameraSize.HEIGHT, image.ImageFormat.JPEG, 8) - Logger.info(TAG, 'createImageReceiver') - this.mReceiver.on('imageArrival', () => { - Logger.info(TAG, 'imageArrival') - this.mReceiver.readNextImage((err, image) => { - Logger.info(TAG, 'readNextImage') - if (err || image === undefined) { - Logger.error(TAG, 'failed to get valid image') - return - } - image.getComponent(4, (errMsg, img) => { - Logger.info(TAG, 'getComponent') - if (errMsg || img === undefined) { - Logger.info(TAG, 'failed to get valid buffer') - return - } - let buffer - if (img.byteBuffer) { - buffer = img.byteBuffer - } else { - Logger.error(TAG, 'img.byteBuffer is undefined') - } - this.savePicture(buffer, image) - }) - }) - }) - } catch (err) { - Logger.info(TAG, `image Receiver err ${err.message}`) - } - } - - async savePicture(buffer: ArrayBuffer, img: image.Image) { - try { - Logger.info(TAG, 'savePicture') - let imgFileAsset = await this.mediaUtil.createAndGetUri(mediaLibrary.MediaType.IMAGE) - let imgPhotoUri = imgFileAsset.uri - Logger.info(TAG, `photoUri = ${imgPhotoUri}`) - let imgFd = await this.mediaUtil.getFdPath(imgFileAsset) - Logger.info(TAG, `fd = ${imgFd}`) - await fileio.write(imgFd, buffer) - await imgFileAsset.close(imgFd) - await img.release() - Logger.info(TAG, 'save image done') - if (this.handleTakePicture) { - this.handleTakePicture(imgPhotoUri) - } - } catch (err) { - Logger.info(TAG, `save picture err ${err.message}`) - } - } - - public async createVideoFd(): Promise { - Logger.info(TAG, `getVideoFd E`) - try { - let dataUri = await this.mediaUtil.createAndGetUri(mediaLibrary.MediaType.VIDEO) - this.videoPrepareFile = await this.mediaUtil.queryFile(dataUri); - const fdNumber = await this.videoPrepareFile.open('Rw') - return fdNumber; - } catch (err) { - Logger.error(TAG, `createVideoFd err: ` + err) - } - Logger.info(TAG, `getVideoFd X`) - } - - async initCamera(surfaceId: number, cameraDeviceIndex: number, obj?, photoIndex?, previewObj?) { - try { - if (deviceInfo.deviceType === 'default') { - this.videoConfig.videoSourceType = 1 - } else { - this.videoConfig.videoSourceType = 1 - } - Logger.info(TAG, `cameraDeviceIndex success: ${cameraDeviceIndex}`) - await this.releaseCamera() - await this.getCameraManagerFn() - await this.getSupportedCamerasFn() - await this.getSupportedOutputCapabilityFn(cameraDeviceIndex) - if (previewObj) { - previewObj.format = this.cameraOutputCapability.previewProfiles[0].format - Logger.info(TAG, `previewObj format: ${previewObj.format}`) - } - await this.createPreviewOutputFn(previewObj ? previewObj : this.cameraOutputCapability.previewProfiles[0], surfaceId) - await this.createPhotoOutputFn(obj ? obj : this.cameraOutputCapability.photoProfiles[photoIndex?photoIndex:0]) - await this.createCameraInputFn(this.cameras[cameraDeviceIndex]) - await this.cameraInputOpenFn() - await this.sessionFlowFn() - - } catch (err) { - Logger.info(TAG, 'initCamera err: ' + JSON.stringify(err.message)) - } - } - - setTakePictureCallback(callback) { - this.handleTakePicture = callback - } - // 拍照 - async takePicture(imageRotation?) { - try { - Logger.info(TAG, 'takePicture start') - let photoSettings = { - rotation: imageRotation ? Number(imageRotation) : 0, - quality: 1, - location: { - latitude: 0, - longitude: 0, - altitude: 0 - }, - mirror: false - } - Logger.info(TAG, `photoOutput capture photoSettings: ` + JSON.stringify(photoSettings)) - await this.photoOutput.capture(photoSettings) - Logger.info(TAG, 'takePicture end') - } catch (err) { - Logger.info(TAG, `takePicture fail err: ${err}, message: ${err.message}, code: ${err.code}`) - } - } - - public async createVideoOutput() { - Logger.info(TAG, `createVideoOutput start`) - Logger.info(TAG, `createVideoOutput saveCameraAsset: ${this.mSaveCameraAsset}`) - this.mFileAssetId = await this.createVideoFd() - this.videoConfig.url = `fd://${this.mFileAssetId.toString()}` - await media.createAVRecorder().then((recorder) => { - Logger.info(TAG, `createVideoOutput createAVRecorder record: ${recorder}`) - this.avRecorder = recorder - }) - if (this.avRecorder != null) { - this.avRecorder.on('error', (error) => { - if (error) { - Logger.error(TAG, `createVideoOutput error: ${JSON.stringify(error)}`) - } - }) - Logger.info(TAG, `createVideoOutput size = ${JSON.stringify(this.cameraOutputCapability.videoProfiles[0].size)}`) - this.videoConfig.profile.videoFrameWidth = this.cameraOutputCapability.videoProfiles[0].size.width - this.videoConfig.profile.videoFrameHeight = this.cameraOutputCapability.videoProfiles[0].size.height - Logger.info(TAG, `createVideoOutput videoConfig: ` + JSON.stringify(this.videoConfig)) - await this.avRecorder.prepare(this.videoConfig) - Logger.info(TAG, `createVideoOutput AVRecorder.prepare succeed.`) - } else { - Logger.error(TAG, `createVideoOutput createAVRecorder failed.`) - return - } - - const videoId = await this.avRecorder.getInputSurface() - Logger.info(`${this.TAG} createVideoOutput profileVideo = ${JSON.stringify(this.cameraOutputCapability.videoProfiles[0])}.`) - try { - this.videoOutput = this.cameraManager.createVideoOutput(this.cameraOutputCapability.videoProfiles[0], videoId) - } catch (error) { - Logger.error(TAG, `createVideoOutput failed: ${JSON.stringify(error)}`) - } - Logger.info(TAG, `createVideoOutput end`) - } - // 开始录制 - async StartRecording() { - try { - Logger.info(TAG, `StartRecording begin`) - await this.captureSession.stop() - this.captureSession.beginConfig() - // if (this.videoOutput) { - // await this.captureSession.removeOutput(this.videoOutput) - // Logger.info(TAG, `old videoOutput has been removed.`) - // } - await this.createVideoOutput() - this.captureSession.addOutput(this.videoOutput) - Logger.info(TAG, `StartRecording addOutput finished.`) - await this.captureSession.commitConfig() - Logger.info(TAG, `StartRecording commitConfig finished.`) - await this.captureSession.start() - Logger.info(TAG, `StartRecording Session.start finished.`) - } catch (err) { - Logger.info(TAG, `remove videoOutput ${err}`) - } - await this.videoOutput.start().then(() => { - Logger.info(TAG, `videoOutput.start()`) - }) - await this.avRecorder.start().then(() => { - Logger.info(TAG, `AVRecorder.start()`) - }) - Logger.info(TAG, `StartRecording end`) - } - // 停止录制 - async stopRecording() { - if (!this.videoOutput || !this.avRecorder) { - Logger.error(TAG, `stopRecording error videoOutPut: ${this.videoOutput},AVRecorder: ${this.avRecorder} .`) - return - } - try { - await this.avRecorder.stop() - await this.avRecorder.release() - } catch (err) { - Logger.error(TAG, `stop AVRecorder ${err}`) - } - - try { - await this.videoOutput.stop() - } catch (err) { - Logger.error(TAG, `stop videoOutput ${err}`) - } - - if (this.mFileAssetId != undefined) { - await this.videoPrepareFile.close(this.mFileAssetId) - this.mFileAssetId = undefined - Logger.info(TAG, `fileAsset.close().`) - } - - const thumbnailPixelMap = await this.mThumbnailGetter.getThumbnailInfo(1280, 960) - Logger.info(TAG, `stopRecording invoke X.`) - return thumbnailPixelMap - } - // 查询相机设备在模式下支持的输出能力 - async getSupportedOutputCapabilityFn(cameraDeviceIndex) { - Logger.info(TAG, `cameraOutputCapability cameraId: ${this.cameras[cameraDeviceIndex].cameraId}`) - // @ts-ignore - this.cameraOutputCapability = this.cameraManager.getSupportedOutputCapability(this.cameras[cameraDeviceIndex]) - let previewSize = [] - let photoSize = [] - let videoSize = [] - this.cameraOutputCapability.previewProfiles.forEach((item, index) => { - Logger.info(TAG, `cameraOutputCapability previewProfiles index: ${index}, item:` + JSON.stringify(item)) - previewSize.push({ - value: `${item.size.width}x${item.size.height}` - }) - }) - this.cameraOutputCapability.photoProfiles.forEach((item, index) => { - Logger.info(TAG, `cameraOutputCapability photoProfiles index: ${index}, item:` + JSON.stringify(item)) - photoSize.push({ - value: `${item.size.width}x${item.size.height}` - }) - }) - this.cameraOutputCapability.videoProfiles.forEach((item, index) => { - Logger.info(TAG, `cameraOutputCapability videoProfiles index: ${index}, item:` + JSON.stringify(item)) - videoSize.push({ - value: `${item.size.width}x${item.size.height}` - }) - }) - Logger.info(TAG, `cameraOutputCapability previewProfiles:` + JSON.stringify(this.cameraOutputCapability.previewProfiles)) - Logger.info(TAG, `cameraOutputCapability photoProfiles:` + JSON.stringify(this.cameraOutputCapability.photoProfiles)) - Logger.info(TAG, `cameraOutputCapability videoProfiles:` + JSON.stringify(this.cameraOutputCapability.videoProfiles)) - Logger.info(TAG, `cameraOutputCapability previewProfiles previewSize:` + JSON.stringify(previewSize)) - this.resolution = previewSize - this.photoResolution = photoSize - this.videoResolution = videoSize - return previewSize - } - // 释放会话及其相关参数 - async releaseCamera() { - try { - if (this.cameraInput) { - await this.cameraInput.release() - } - if (this.previewOutput) { - await this.previewOutput.release() - } - if (this.photoOutput) { - await this.photoOutput.release() - } - if (this.videoOutput) { - await this.videoOutput.release() - } - if (this.captureSession) { - await this.captureSession.release() - } - Logger.info(TAG, `releaseCamera success`) - } catch (err) { - Logger.info(TAG, `releaseCamera fail err: ${err}, message: ${err.message}, code: ${err.code}`) - } - } - // 释放会话 - async releaseSession() { - await this.previewOutput.stop() - await this.photoOutput.release() - await this.captureSession.release() - Logger.info(TAG, `releaseSession success`) - } - // 获取相机管理器实例 - async getCameraManagerFn() { - try { - this.cameraManager = await camera.getCameraManager(globalThis.context) - Logger.info(TAG, `getCameraManager success: ` + JSON.stringify(this.cameraManager)) - } catch (err) { - Logger.info(TAG, `getCameraManagerFn fail err: ${err}, message: ${err.message}, code: ${err.code}`) - } - } - // 获取支持指定的相机设备对象 - async getSupportedCamerasFn() { - try { - this.cameras = await this.cameraManager.getSupportedCameras() - Logger.info(TAG, `getSupportedCameras success: ` + JSON.stringify(this.cameras)) - Logger.info(TAG, `getSupportedCameras length success: ${this.cameras.length}`) - } catch (err) { - Logger.info(TAG, `getSupportedCamerasFn fail err: ${err}, message: ${err.message}, code: ${err.code}`) - } - } - // 创建previewOutput输出对象 - async createPreviewOutputFn(previewProfilesObj, surfaceId) { - try { - Logger.info(TAG, `createPreviewOutputFn previewProfilesObj success: ` + JSON.stringify(previewProfilesObj)) - this.previewOutput = await this.cameraManager.createPreviewOutput(previewProfilesObj, surfaceId.toString()) - Logger.info(TAG, `createPreviewOutputFn success: ` + JSON.stringify(this.previewOutput)) - } catch (err) { - Logger.info(TAG, `createPreviewOutputFn fail err: ${err}, message: ${err.message}, code: ${err.code}`) - } - } - // 创建photoOutput输出对象 - async createPhotoOutputFn(photoProfileObj) { - try { - Logger.info(TAG, `createPhotoOutputFn photoProfileObj success: ` + JSON.stringify(photoProfileObj)) - let mSurfaceId = await this.mReceiver.getReceivingSurfaceId() - this.photoOutput = await this.cameraManager.createPhotoOutput(photoProfileObj, mSurfaceId) - Logger.info(TAG, `createPhotoOutputFn success: ` + JSON.stringify(this.photoOutput)) - } catch (err) { - Logger.info(TAG, `createPhotoOutputFn fail err: ${err}, message: ${err.message}, code: ${err.code}`) - } - } - // 创建cameraInput输出对象 - async createCameraInputFn(cameraDeviceIndex) { - try { - this.cameraInput = await this.cameraManager.createCameraInput(cameraDeviceIndex) - Logger.info(TAG, `createCameraInputFn success: ${this.cameraInput}`) - } catch (err) { - Logger.info(TAG, `createCameraInputFn fail err: ${err}, message: ${err.message}, code: ${err.code}`) - } - } - // 打开相机 - async cameraInputOpenFn() { - await this.cameraInput.open() - .then((data) => { - Logger.info(TAG, `cameraInputOpenFn open success: ${data}`) - }) - .catch((err) => { - Logger.info(TAG, `cameraInputOpenFn fail err: ${err}, message: ${err.message}, code: ${err.code}`) - }) - } - // 会话流程 - async sessionFlowFn() { - try { - // 创建captureSession实例 - this.captureSession = await this.cameraManager.createCaptureSession() - // 开始配置会话 - await this.captureSession.beginConfig() - // cameraInput加入会话 - await this.captureSession.addInput(this.cameraInput) - // previewOutput加入会话 - await this.captureSession.addOutput(this.previewOutput) - // photoOutput加入会话 - await this.captureSession.addOutput(this.photoOutput) - // 提交配置会话 - await this.captureSession.commitConfig() - // 开启会话 - await this.captureSession.start() - Logger.info(TAG, `sessionFlowFn success`) - } catch (err) { - Logger.info(TAG, `sessionFlowFn fail err: ${err}, message: ${err.message}, code: ${err.code}`) - } - } -} - -export default new CameraService() \ No newline at end of file diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/Camera/Camera_index.ets b/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/Camera/Camera_index.ets deleted file mode 100644 index fcb95cb2..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/Camera/Camera_index.ets +++ /dev/null @@ -1,177 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Logger from '../../model/Logger' -import CameraService from './CameraService' -import FirstDialog from '../../common/FirstDialog' -import prompt from '@ohos.prompt' -import router from '@ohos.router' - - -const TAG = "Camera" - -@Entry -@Component -struct Camera_index { - @State name: string = 'CameraVideo'; - @State StepTips: string = '测试目的:用于测试相机录像分辨率能力\n预期结果:所有分辨率均可以录像,录像与预览一致'; - private mXComponentController: XComponentController = new XComponentController() - @State surfaceId: number = 0; - @State cameraDeviceIndex: number = 0 - @State assetUri: string = undefined - @State thumbnail: PixelMap = undefined - @State isTakePictureEnabled: boolean = true - @State isTakeVideoEnabled: boolean = true - @State clickFrequency: number = 0 // 点击次数 - @State resolutionSelectVal: string = '' // 下拉框默认value - @State captureBtnScale: number = 1 - - async aboutToAppear() { - await FirstDialog.ChooseDialog(this.StepTips, this.name); - CameraService.setTakePictureCallback(this.handleTakePicture.bind(this)) - Logger.info(TAG, `takePicture end, assetUri: ${this.assetUri}`) - } - - - async cameraInit(obj?) { - CameraService.initCamera(this.surfaceId, this.cameraDeviceIndex).then(() => { - this.resolutionSelectVal = String(CameraService.videoResolution[this.clickFrequency].value) - Logger.info(TAG, `resolutionSelectVal ${this.resolutionSelectVal}`) //1280x960 - }) - } - - handleTakePicture = (assetUri: string) => { - this.assetUri = assetUri - Logger.info(TAG, `takePicture end, assetUri: ${this.assetUri}`) - } - - onPageShow() { - // @ts-ignore - this.surfaceId = this.mXComponentController.getXComponentSurfaceId() - CameraService.initCamera(this.surfaceId, this.cameraDeviceIndex) - } - - onPageHide() { - CameraService.releaseCamera() - Logger.info(TAG, `onPageHide releaseCamera end`) - } - - build() { - Stack({ alignContent: Alignment.BottomEnd }) { - XComponent({ - id: 'componentId', - type: 'surface', - controller: this.mXComponentController - }) - .size({ width: '100%', height: '100%' }) - .onLoad(async () => { - Logger.info(TAG, 'onLoad is called') - // @ts-ignore - this.surfaceId = this.mXComponentController.getXComponentSurfaceId() - Logger.info(TAG, `onLoad surfaceId: ${this.surfaceId}`) - this.cameraInit() - }) - - Row() { - if (this.assetUri !== undefined) { - Image(this.assetUri) - .size({ height: '100%' }) - .border({ width: 1, color: Color.White, style: BorderStyle.Solid }) - .onClick(async () => { - await globalThis.context.startAbility({ - parameters: { uri: 'photodetail' }, - bundleName: 'com.ohos.photos', - abilityName: 'com.ohos.photos.MainAbility' - }) - }) - } - Blank() - if (this.thumbnail !== undefined) { - Image(this.thumbnail) - .height('100%') - .aspectRatio(4 / 3) - .border({ width: 1, color: Color.White, style: BorderStyle.Solid }) - .onClick(async () => { - await globalThis.context.startAbility({ - parameters: { uri: 'photodetail' }, - bundleName: 'com.ohos.photos', - abilityName: 'com.ohos.photos.MainAbility' - }) - }) - } - }.size({ width: '100%', height: '30%' }).justifyContent(FlexAlign.SpaceBetween) - - Column() { - Image(this.isTakeVideoEnabled ? $r('app.media.take_video_normal') : $r('app.media.take_video_stop')) - .width(76).aspectRatio(1).enabled(this.isTakeVideoEnabled) - .onTouch((event: TouchEvent) => { - this.isTakeVideoEnabled = false - if (event.type === TouchType.Up) { - this.isTakeVideoEnabled = false - prompt.showToast({ - message: '录制中,请等待三秒', duration: 1000 - }); - CameraService.StartRecording().then(() => { - setTimeout(() => { - CameraService.stopRecording().then((thumbnailPixelMap) => { - this.thumbnail = thumbnailPixelMap - this.isTakeVideoEnabled = true - }) - }, 3000) - }) - } - }) - }.size({ height: '100%' }).justifyContent(FlexAlign.Center) - - Row() { - Stack({ alignContent: Alignment.Center }) { - Image($r('app.media.ic_circled')).fillColor(Color.White) - Image($r('app.media.ic_circled_filled')) - .width(54) - .aspectRatio(1) - .fillColor(Color.White) - .scale({ x: this.captureBtnScale, y: this.captureBtnScale, z: this.captureBtnScale }) - .enabled(this.isTakePictureEnabled) - .onTouch(async (event: TouchEvent) => { - if (event.type === TouchType.Down) { - animateTo( - { duration: 125, curve: Curve.Sharp, delay: 0 }, - () => { - this.captureBtnScale = 0.85 - }) - } else if (event.type === TouchType.Up) { - animateTo( - { duration: 125, curve: Curve.Sharp, delay: 0, - onFinish: () => { - this.captureBtnScale = 1 - } }, - () => { - this.captureBtnScale = 1 - }) - this.isTakePictureEnabled = false - CameraService.takePicture() - this.isTakePictureEnabled = true - } - }) - }.width(76).aspectRatio(1) - }.size({ width: '100%', height: 76 }).justifyContent(FlexAlign.Center) - }.width('100%').height('100%').backgroundColor(Color.Black) - .gesture( - PanGesture({ direction: PanDirection.Left | PanDirection.Right }) - .onActionEnd(() => { - router.back() - }) - ) - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/Camera/MediaUtils.ts b/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/Camera/MediaUtils.ts deleted file mode 100644 index 983fad50..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/Camera/MediaUtils.ts +++ /dev/null @@ -1,192 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import mediaLibrary from '@ohos.multimedia.mediaLibrary' -import DateTimeUtil from '../../model/DateTimeUtil' -import Logger from '../../model/Logger' - -const TAG = 'MediaUtils' - -export default class MediaUtils { - private mediaTest: mediaLibrary.MediaLibrary = mediaLibrary.getMediaLibrary(globalThis.context) - private static instance: MediaUtils = new MediaUtils() - - public static getInstance() { - if (this.instance === undefined) { - this.instance = new MediaUtils() - } - return this.instance - } - - async createAndGetUri(mediaType: number) { - let info = this.getInfoFromType(mediaType) - let dateTimeUtil = new DateTimeUtil() - let name = `${dateTimeUtil.getDate()}_${dateTimeUtil.getTime()}` - let displayName = `${info.prefix}${name}${info.suffix}` - Logger.info(TAG, `displayName = ${displayName},mediaType = ${mediaType}`) - let publicPath = await this.mediaTest.getPublicDirectory(info.directory) - Logger.info(TAG, `publicPath = ${publicPath}`) - try { - return await this.mediaTest.createAsset(mediaType, displayName, publicPath) - } catch (err) { - Logger.info(TAG, `createAsset err ` + JSON.stringify(err)) - } - } - - async queryFile(dataUri: any) { - let fileKeyObj = mediaLibrary.FileKey - if (dataUri !== undefined) { - let args = dataUri.id.toString() - let fetchOp = { - selections: `${fileKeyObj.ID}=?`, - selectionArgs: [args], - } - const fetchFileResult = await this.mediaTest.getFileAssets(fetchOp) - Logger.info(TAG, `fetchFileResult.getCount() = ${fetchFileResult.getCount()}`) - const fileAsset = await fetchFileResult.getFirstObject() - return fileAsset - } - } - - async getFdPath(fileAsset: any) { - let fd = await fileAsset.open('Rw') - Logger.info(TAG, `fd = ${fd}`) - return fd - } - - async getFileAssetsAlbum(path) { - let fileKeyObj = mediaLibrary.FileKey - // ALBUM_NAME - let fetchOp = { - selections: `${fileKeyObj.RELATIVE_PATH}=?`, - selectionArgs: [`${path}`], - } - const fetchFileResult = await this.mediaTest.getFileAssets(fetchOp) - Logger.info(TAG, `getFileAssetsAlbum,fetchFileResult.count = ${fetchFileResult.getCount()}`) - let fileAssets: Array = [] - if (fetchFileResult.getCount() > 0) { - fileAssets = await fetchFileResult.getAllObject() - } - return fileAssets - } - - async getFileAssetsFromType(mediaType: number) { - Logger.info(TAG, `getFileAssetsFromType,mediaType = ${mediaType}`) - let fileKeyObj = mediaLibrary.FileKey - // ALBUM_NAME - let fetchOp = { - selections: `${fileKeyObj.MEDIA_TYPE}=?`, - selectionArgs: [`${mediaType}`], - } - const fetchFileResult = await this.mediaTest.getFileAssets(fetchOp) - Logger.info(TAG, `getFileAssetsFromType,fetchFileResult.count = ${fetchFileResult.getCount()}`) - let fileAssets = [] - if (fetchFileResult.getCount() > 0) { - fileAssets = await fetchFileResult.getAllObject() - } - return fileAssets - } - - async getAlbums() { - Logger.info(TAG, 'getAlbums begin') - let albums = [] - const [ files, images, videos, audios ] = await Promise.all([ - this.getFileAssetsFromType(mediaLibrary.MediaType.FILE), - this.getFileAssetsFromType(mediaLibrary.MediaType.IMAGE), - this.getFileAssetsFromType(mediaLibrary.MediaType.VIDEO), - this.getFileAssetsFromType(mediaLibrary.MediaType.AUDIO) - ]) - albums.push({ - albumName: 'Documents', count: files.length, mediaType: mediaLibrary.MediaType.FILE - }) - albums.push({ - albumName: 'Pictures', count: images.length, mediaType: mediaLibrary.MediaType.IMAGE - }) - albums.push({ - albumName: 'Videos', count: videos.length, mediaType: mediaLibrary.MediaType.VIDEO - }) - albums.push({ - albumName: 'Audios', count: audios.length, mediaType: mediaLibrary.MediaType.AUDIO - }) - return albums - } - - deleteFile(media: any) { - let uri = media.uri - Logger.info(TAG, `deleteFile,uri = ${uri}`) - // @ts-ignore - return this.mediaTest.deleteAsset(uri) - } - - onDateChange(callback: () => void) { - this.mediaTest.on('albumChange', () => { - Logger.info(TAG, 'albumChange called') - callback() - }) - this.mediaTest.on('imageChange', () => { - Logger.info(TAG, 'imageChange called') - callback() - }) - this.mediaTest.on('audioChange', () => { - Logger.info(TAG, 'audioChange called') - callback() - }) - this.mediaTest.on('videoChange', () => { - Logger.info(TAG, 'videoChange called') - callback() - }) - this.mediaTest.on('fileChange', () => { - Logger.info(TAG, 'fileChange called') - callback() - }) - } - - offDateChange() { - this.mediaTest.off('albumChange') - this.mediaTest.off('imageChange') - this.mediaTest.off('audioChange') - this.mediaTest.off('videoChange') - this.mediaTest.off('fileChange') - } - - getInfoFromType(mediaType: number) { - let result = { - prefix: '', suffix: '', directory: 0 - } - switch (mediaType) { - case mediaLibrary.MediaType.FILE: - result.prefix = 'FILE_' - result.suffix = '.txt' - result.directory = mediaLibrary.DirectoryType.DIR_DOCUMENTS - break - case mediaLibrary.MediaType.IMAGE: - result.prefix = 'IMG_' - result.suffix = '.jpg' - result.directory = mediaLibrary.DirectoryType.DIR_IMAGE - break - case mediaLibrary.MediaType.VIDEO: - result.prefix = 'VID_' - result.suffix = '.mp4' - result.directory = mediaLibrary.DirectoryType.DIR_CAMERA - break - case mediaLibrary.MediaType.AUDIO: - result.prefix = 'AUD_' - result.suffix = '.wav' - result.directory = mediaLibrary.DirectoryType.DIR_AUDIO - break - } - return result - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/Camera/ThumbnailGetter.ts b/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/Camera/ThumbnailGetter.ts deleted file mode 100644 index 3bd6f734..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/Camera/ThumbnailGetter.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import mediaLibrary from '@ohos.multimedia.mediaLibrary' - -import Logger from '../../model/Logger' - -export default class ThumbnailGetter { - private TAG = '[ThumbnailGetter]:' - - public async getThumbnailInfo(width: number, height: number, uri?: string): Promise { - Logger.info(`${this.TAG} getThumbnailInfo E`) - Logger.debug(`${this.TAG} getThumbnailInfo width: ${width}, height: ${height}, uri: ${JSON.stringify(uri)}`) - const fileKeyObj = mediaLibrary.FileKey; - let fetchOp: any - const media = mediaLibrary.getMediaLibrary(globalThis.context); - let publicPath: string = await media.getPublicDirectory(mediaLibrary.DirectoryType.DIR_CAMERA) - Logger.info(`${this.TAG} getThumbnailInfo media: ${media}`) - fetchOp = { - selections: `${fileKeyObj.RELATIVE_PATH}=?`, - selectionArgs: [publicPath], - order: `${fileKeyObj.DATE_ADDED} DESC LIMIT 0, 1` - } - - Logger.info(`${this.TAG} getThumbnailInfo fetchOp: ${JSON.stringify(fetchOp)}`) - const fetchFileResult = await media.getFileAssets(fetchOp); - const count = fetchFileResult.getCount() - Logger.info(`${this.TAG} getThumbnailInfo fetchFileResult.getCount: ${count}`) - if (count == 0) { - return undefined - } - const lastFileAsset = await fetchFileResult.getLastObject() - await fetchFileResult.close() - if (lastFileAsset == null) { - Logger.error(`${this.TAG} getThumbnailInfo lastFileAsset is null`) - return undefined - } - const thumbnailPixelMap = lastFileAsset.getThumbnail({ - width: width, height: height - }) - Logger.info(`${this.TAG} getThumbnailInfo thumbnailPixelMap: ${JSON.stringify(thumbnailPixelMap)} X`) - return thumbnailPixelMap - } -} diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/Index.ets b/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index dbe325b3..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import router from '@ohos.router'; -import { GRAPHIC_TRANSFORMATION, TestButton } from './testData' -import window from '@ohos.window'; -import common from '@ohos.app.ability.common'; -@Entry -@Component -struct Index { - @Builder itemHead(text: Resource | string) { - Text(text) - .fontSize(20) - .height(50) - .backgroundColor('#ffeae9e9') - .width("100%") - .padding(10) - } - onPageShow() { - //获取当前窗口 - var FullScreen = true; - let context = getContext(this) as common.UIAbilityContext - let windowClass = null; - try { - let promise = window.getLastWindow(context); - promise.then((data)=> { - windowClass = data; - console.info('Succeeded in obtaining the top window. Data: ' + JSON.stringify(data)); - //设置全屏状态 - let promise = windowClass.setFullScreen(FullScreen); - promise.then(() => { - console.info('Succeeded in enabling the full-screen mode. '); - }).catch((err) => { - console.error('Failed to enable the full-screen mode. Cause: ' + JSON.stringify(err)); - }); - console.info('Succeeded in obtaining the top window. Data: ' + JSON.stringify(data)); - }).catch((err)=>{ - console.error('Failed to obtain the top window. Cause: ' + JSON.stringify(err)); - }); - } catch (exception) { - console.error('Failed to obtain the top window. Cause: ' + JSON.stringify(exception)); - } - } - build() { - Column() { - Text('yarward测试') - .fontSize(50) - Scroll() { - Column() { - List({ space: 5 }) { - ForEach(GRAPHIC_TRANSFORMATION, (item: TestButton, index: number) => { - ListItemGroup({ header: this.itemHead(item.title) }) { - if (item.childNodes) { - ForEach(item.childNodes, (childItem: TestButton) => { - ListItem() { - Text(childItem.title) - .width("100%") - .height(50) - .fontSize(20) - .padding(10) - .backgroundColor(Color.White) - .onClick(()=>{ - router.pushUrl({url:childItem.url}) - }) - } - }) - } - } - .divider({ strokeWidth: 1, color: Color.Black }) // 每行之间的分界线 - .onClick(()=>{ - console.error('onclick') - if(item.childNodes == undefined){ - console.error('onclick item.childNodes == undefined') - router.pushUrl({url:item.url}) - } - }) - }) - } - Column() - .margin({bottom:90}) - } - .constraintSize({ minHeight: '100%' }) - } - } - .justifyContent(FlexAlign.Center) - } -} diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/Mic/AnimateView.ets b/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/Mic/AnimateView.ets deleted file mode 100644 index 7da7621b..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/Mic/AnimateView.ets +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { getTimeString } from '../../model/Utils' -import Logger from '../../model/Logger' - -const TAG = '[Recorder.AnimateView]' - -@Component -export struct AnimateView { - private timeTextNum = [0, 1, 2, 3, 4, 5] - private intervalId: number = 0 - private updateTimeStr: () => void - @State timeAdd: number = 0 - @State translateImage: string = '-0.2%' - @State translateText: string = '-1%' - @StorageLink('recordState') @Watch('onPlayChange') recordState: boolean = true - @StorageLink('playState') @Watch('onPlayChange') playState: boolean = true - @Link @Watch('onResetChange') resetAnimation: boolean - - onPlayChange() { - Logger.info(TAG, `onPlayChange`) - this.animator() - } - - animator() { - Logger.info(TAG, `animator,recordState=${this.recordState},playState=${this.playState}`) - if (this.recordState || this.playState) { - this.intervalId = setInterval(() => { - this.updateTimeStr() - this.translateImage = '16.3%' - this.translateText = '15.5%' - this.timeAdd += 1 - animateTo({ duration: 1100, curve: Curve.Linear }, () => { - this.translateImage = '-0.2%' - this.translateText = '-1%' - }) - }, 1000) - } else { - clearInterval(this.intervalId) - } - } - - onResetChange() { - this.timeAdd = 0 - } - - aboutToAppear() { - this.animator() - } - - build() { - Column() { - Row() { - ForEach(this.timeTextNum, item => { - Text(getTimeString(this.timeAdd, item)) - .fontSize(12) - .fontColor(Color.Gray) - .textAlign(TextAlign.End) - .maxLines(1) - Blank() - .layoutWeight(1) - }, item => item.toString()) - } - .width('120%') - .translate({ x: this.translateText }) - - Image($r('app.media.slider_time')) - .width('120%') - .height(20) - .objectFit(ImageFit.Fill) - .translate({ x: this.translateImage }) - } - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/Mic/AudioItem.ets b/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/Mic/AudioItem.ets deleted file mode 100644 index 7734ca69..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/Mic/AudioItem.ets +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import DateTimeUtil from '../../model/DateTimeUtil'; -import Logger from '../../model/Logger'; -import { Record } from './Record'; - -const TAG = '[Recorder.AudioItem]'; -const TRANSLATE: number = -145; - -@Component -export struct AudioItem { - @Link record: Record; - @State translateLeft: number = 0; - @State translateRight: number = TRANSLATE; - - getTimeString() { - let date = new Date(this.record.fileAsset.dateAdded * 1000); - let dateTimeUtil = new DateTimeUtil(); - return `${date.getFullYear()}/${dateTimeUtil.fill(date.getMonth() + 1)}/${dateTimeUtil.fill(date.getDate())}`; - } - - build() { - Row() { - Row() { - Column() { - Text(this.record.title) - .fontSize(22) - .fontColor(Color.Black) - Text(this.getTimeString()) - .fontSize(20) - .fontColor(Color.Gray) - .margin({ top: 10 }) - } - .size({ width: '80%', height: '100%' }) - .alignItems(HorizontalAlign.Start) - .justifyContent(FlexAlign.Center) - - Row() { - Text(this.record.duration) - .fontSize(20) - .fontColor(Color.Gray) - } - .width('20%') - .justifyContent(FlexAlign.End) - } - .width('100%') - .padding({ top: 10, bottom: 10, left: 10, right: 10 }) - .margin({ top: 15, right: 15 }) - .backgroundColor('#FFFFFF') - .borderRadius(20) - } - .width('100%') - .height('15%') - .constraintSize({ minHeight: 100 }) - .translate({ x: this.translateLeft, y: 0 }) - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/Mic/AudioModel.ts b/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/Mic/AudioModel.ts deleted file mode 100644 index 1dc404de..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/Mic/AudioModel.ts +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import media from '@ohos.multimedia.media' -import mediaLibrary from '@ohos.multimedia.mediaLibrary' -import Logger from '../../model/Logger' - -const TAG: string = '[Recorder.AudioModel]' - -export class AudioModel { - private audioPlayer = undefined; - private playFile: mediaLibrary.FileAsset = undefined - private dataLoad: boolean = false - - initAudioPlayer(playSrc: mediaLibrary.FileAsset, isPlay) { - this.playFile = playSrc - this.dataLoad = false - this.release() - this.audioPlayer = media.createAudioPlayer() - this.audioPlayer.on('dataLoad', () => { - Logger.info(TAG, `case dataLoad called`) - this.dataLoad = true - }) - this.audioPlayer.on('stop', () => { - Logger.info(TAG, `audioPlayer stop called`) - this.audioPlayer.release() - this.audioPlayer = undefined - }) - this.audioPlayer.on('error', () => { - Logger.info(TAG, `audioPlayer error called`) - }) - this.audioPlayer.reset() - let fdPath = playSrc.open('r') - fdPath.then(fdNumber => { - this.audioPlayer.src = `fd://${fdNumber}` - Logger.info(TAG, `create audioPlayer success`) - }) - } - - release() { - if (typeof (this.audioPlayer) != `undefined`) { - Logger.info(TAG, `audioPlayer release`) - this.audioPlayer.release() - this.audioPlayer = undefined - } - } - - onFinish(callback) { - console.info(`${TAG}set onFinish`) - this.audioPlayer.on('finish', () => { - Logger.info(TAG, `audioPlayer finish called`) - this.audioPlayer.seek(0) - callback() - }); - } - - play(callback) { - if (typeof (this.audioPlayer) != `undefined`) { - this.audioPlayer.on('play', () => { - Logger.info(TAG, `audioPlayer play called`) - callback() - }) - if (this.dataLoad) { - this.audioPlayer.play() - } else { - this.audioPlayer.on('dataLoad', () => { - Logger.info(TAG, `case dataLoad called`) - this.dataLoad = true - this.audioPlayer.play() - }) - } - } - } - - pause(callback) { - if (typeof (this.audioPlayer) != `undefined`) { - this.audioPlayer.on('pause', () => { - Logger.info(TAG, `case pause called`) - callback() - }) - this.audioPlayer.pause() - } - } - - finish() { - if (typeof (this.audioPlayer) != `undefined`) { - this.audioPlayer.stop() - } - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/Mic/MediaManager.ts b/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/Mic/MediaManager.ts deleted file mode 100644 index 98237c4a..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/Mic/MediaManager.ts +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import mediaLibrary from '@ohos.multimedia.mediaLibrary'; -import preferences from '@ohos.data.preferences'; -import DateTimeUtil from '../../model/DateTimeUtil'; -import type common from '@ohos.app.ability.common'; -import Logger from '../../model/Logger'; -import { Record } from './Record'; - -const TAG: string = '[Recorder.MediaManager]'; - -class MediaManager { - private context: common.UIAbilityContext; - private mediaTest: mediaLibrary.MediaLibrary = null; - private storage: preferences.Preferences = null; - - constructor(context: common.UIAbilityContext) { - this.context = context; - this.mediaTest = mediaLibrary.getMediaLibrary(this.context); - this.initStorage(); - } - - async initStorage(): Promise { - let name = 'com.yarward.factorytest'; - try { - this.storage = await preferences.getPreferences(this.context, `${name}`); - } catch (err) { - Logger.error(`getStorage failed, code is ${err.code}, message is ${err.message}`); - } - if (this.storage === null) { - Logger.info(TAG, 'Create storage is fail.'); - } - } - - async createAudioFile(): Promise { - this.mediaTest = mediaLibrary.getMediaLibrary(this.context); - let info = { - suffix: '.m4a', directory: mediaLibrary.DirectoryType.DIR_AUDIO - }; - let dateTimeUtil = new DateTimeUtil(); - let name = `${dateTimeUtil.getDate()}_${dateTimeUtil.getTime()}`; - let displayName = `${name}${info.suffix}`; - Logger.info(TAG, `createAudioFile displayName=${displayName}`); - let publicPath = await this.mediaTest.getPublicDirectory(info.directory); - Logger.info(TAG, `createAudioFile publicPath=${publicPath}`); - let file: mediaLibrary.FileAsset = await this.mediaTest.createAsset(mediaLibrary.MediaType.AUDIO, displayName, publicPath); - return Promise.resolve(file); - } - - async queryAllAudios(): Promise> { - let fileKeyObj = mediaLibrary.FileKey; - let fetchOp = { - selections: `${fileKeyObj.MEDIA_TYPE}=?`, - selectionArgs: [`${mediaLibrary.MediaType.AUDIO}`], - }; - const fetchFileResult = await this.mediaTest.getFileAssets(fetchOp); - let result: Array = []; - Logger.info(TAG, `queryAllAudios fetchFileResult=${fetchFileResult.getCount()}`); - if (fetchFileResult.getCount() > 0) { - let fileAssets = await fetchFileResult.getAllObject(); - for (let i = 0; i < fileAssets.length; i++) { - let record: Record = new Record(this.context); - await record.init(fileAssets[i]); - result.push(record); - } - } - return Promise.resolve(result); - } - - async queryFile(id: number): Promise { - let fileKeyObj = mediaLibrary.FileKey; - if (id !== undefined) { - let args = id.toString(); - let fetchOp = { - selections: `${fileKeyObj.ID}=?`, - selectionArgs: [args], - }; - const fetchFileResult = await this.mediaTest.getFileAssets(fetchOp); - Logger.info(TAG, `fetchFileResult.getCount() = ${fetchFileResult.getCount()}`); - const fileAsset = await fetchFileResult.getAllObject(); - let record: Record = new Record(this.context); - await record.init(fileAsset[0]); - return Promise.resolve(record); - } else { - return undefined; - } - } - - async deleteFile(fileAsset: mediaLibrary.FileAsset): Promise { - Logger.info(TAG, `deleteFile,title = ${fileAsset.title},uri = ${fileAsset.uri}`); - await this.mediaTest.deleteAsset(fileAsset.uri); - } - - onAudioChange(callback: () => void) { - Logger.info(TAG, `onAudioChange`); - this.mediaTest.on('audioChange', () => { - callback(); - }) - } - - async saveFileDuration(name: string, value): Promise { - Logger.info(TAG, `saveFileDuration`+value); - if (this.storage === null) { - Logger.info(TAG, 'Create storage is fail.'); - return; - } - await this.storage.put(name, value); - await this.storage.flush(); - } - - async getFileDuration(name: string): Promise { - let bundleName = 'com.yarward.factorytest'; - let duration; - try { - let storage = await preferences.getPreferences(this.context, `${bundleName}`); - duration = await storage.get(name, '00:00'); - } catch (err) { - Logger.info(TAG, `Failed to get value of duration,code:${err.code},message:${err.message}`); - } - return duration as string; - } -} - -export default MediaManager; \ No newline at end of file diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/Mic/Mic_index.ets b/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/Mic/Mic_index.ets deleted file mode 100644 index 62db8ff1..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/Mic/Mic_index.ets +++ /dev/null @@ -1,223 +0,0 @@ -/* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import common from '@ohos.app.ability.common'; -import Logger from '../../model/Logger'; -import MediaManager from './MediaManager'; -import { AudioModel } from './AudioModel'; -import { Record } from './Record'; -import { RecordModel } from './RecordModel'; -import mediaLibrary from '@ohos.multimedia.mediaLibrary'; -import { updateTime } from '../../model/Utils'; -import { AnimateView } from './AnimateView'; -import { TitleBar } from '../../common/TitleBar'; -import { AudioItem } from './AudioItem'; - -let TAG = '[Mic_index]'; - -@Entry -@Component -struct Mic_index { - private mediaManager = new MediaManager(getContext(this) as common.UIAbilityContext); - private audioModel: AudioModel = new AudioModel(); - @State record: Record = undefined; - private recordModel: RecordModel = new RecordModel(); - private millisecond: number = 0; - @State fileAsset: mediaLibrary.FileAsset = undefined; - private fd: number = undefined; - @StorageLink('recordState') recordState: boolean = false; - @StorageLink('playState') playState: boolean = false; - @State duration: string = '00:00'; - @State resetAnimation: boolean = false; - @State time: string = '00:00'; - - async finish() { - await this.mediaManager.saveFileDuration(this.fileAsset.title, this.duration); - this.recordModel.finish(() => { - this.recordState = false; - }) - let recordList = await this.mediaManager.queryAllAudios(); - this.record = recordList[0] - this.record.init(this.fileAsset) - Logger.info(TAG, `handleChangePlayState this.record= ${JSON.stringify(this.record)}`); - this.audioModel.initAudioPlayer(this.fileAsset, true); - } - - async startRecord() { - this.recordModel.initAudioRecorder(); - if (this.record) { - await this.mediaManager.deleteFile(this.record.fileAsset); - } - this.fileAsset = await this.mediaManager.createAudioFile(); - this.fd = await this.fileAsset.open('Rw'); - this.recordModel.startRecorder(`fd://${this.fd}`, () => { - Logger.info(TAG, 'startRecorder callback success'); - this.millisecond = 0; - this.recordState = true; - }) - } - - updateTimeStr() { - this.millisecond += 1000; - if (this.recordState) { - this.duration = updateTime(this.millisecond); - } else if (this.playState) { - this.time = updateTime(this.millisecond); - } - } - - async aboutToAppear() { - this.record.init(undefined); - } - - async onPageHide() { - await this.mediaManager.deleteFile(this.record.fileAsset); - } - - initAudioPlayer() { - this.audioModel.onFinish(() => { - this.playState = false; - this.reset(); - }); - this.playState = false; - this.reset(); - } - - reset() { - this.time = '00:00'; - this.millisecond = 0; - this.resetAnimation = !this.resetAnimation; - } - - handleChangePlayState = () => { - if (this.record) { - this.initAudioPlayer(); - Logger.info(TAG, `handleChangePlayState this.isPlay= ${this.playState}`); - if (!this.playState) { - this.audioModel.play(() => { - Logger.info(TAG, `handleChangePlayState play success`); - this.playState = !this.playState; - AppStorage.SetOrCreate('playState', this.playState); - }) - } else { - this.audioModel.pause(() => { - Logger.info(TAG, `handleChangePlayState pause success`); - this.playState = !this.playState; - AppStorage.SetOrCreate('playState', this.playState); - }) - } - } - } - - build() { - Row() { - Column() { - TitleBar() - Column() { - if (this.record) { - AudioItem({ record: $record }) - } - } - .layoutWeight(1) - - if (this.recordState) { - Button({ type: ButtonType.Circle, stateEffect: true }) { - Image($r('app.media.ic_pause')) - .objectFit(ImageFit.Contain) - .size({ width: 70, height: 70 }) - } - .width(70) - .height(70) - .borderWidth(1) - .backgroundColor('#FFFFFF') - .margin(10) - .onClick(() => { - this.finish(); - }) - } else { - Button({ type: ButtonType.Circle, stateEffect: true }) { - Image($r('app.media.rectangle')) - .objectFit(ImageFit.Contain) - .size({ width: 30, height: 30 }) - } - .width(70) - .height(70) - .borderWidth(1) - .backgroundColor('#FFFFFF') - .margin(10) - .onClick(() => { - this.startRecord(); - }) - } - } - .layoutWeight(2) - .height('100%') - .backgroundColor('#F5F5F5') - .zIndex(2) - - Column() { - if (this.record) { - Row() { - Text(this.record.title) - .fontColor(Color.Black) - .fontWeight(FontWeight.Bold) - .fontSize(30) - .layoutWeight(1) - } - .size({ width: '100%', height: '8%' }) - .constraintSize({ minHeight: 50 }) - .padding({ left: 20 }) - } - - Column() { - AnimateView({ resetAnimation: $resetAnimation, updateTimeStr: this.updateTimeStr.bind(this) }) - Image($r('app.media.bg_play')) - .width('100%') - .height('30%') - .objectFit(ImageFit.Fill) - Column() { - if (this.recordState) { - Text(this.duration) - .fontColor(Color.Black) - .fontSize(35) - } else { - Text(this.time) - .fontColor(Color.Black) - .fontSize(35) - Text(this.record ? this.record.duration : '00:00') - .fontColor(Color.Gray) - .fontSize(25) - } - } - - Button() { - Image(this.playState ? $r('app.media.pause') : $r('app.media.play')) - .objectFit(ImageFit.Contain) - .size({ width: 70, height: 70 }) - } - .type(ButtonType.Circle) - .size({ width: 70, height: 70 }) - .backgroundColor('#FFFFFF') - .layoutWeight(1) - .margin({ bottom: 15 }) - .onClick(this.handleChangePlayState) - } - } - .layoutWeight(3) - } - .size({ width: '100%', height: '100%' }) - .backgroundColor('#F0F0F0') - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/Mic/Record.ets b/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/Mic/Record.ets deleted file mode 100644 index c2866e33..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/Mic/Record.ets +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import mediaLibrary from '@ohos.multimedia.mediaLibrary' -import type common from '@ohos.app.ability.common' -import DateTimeUtil from '../../model/DateTimeUtil' -import MediaManager from './MediaManager' - -const dateTimeUtil = new DateTimeUtil() - -@Observed -export class Record { - fileAsset: mediaLibrary.FileAsset - title: string - duration: string - context: common.UIAbilityContext - - constructor(context: common.UIAbilityContext) { - this.context = context - } - - async init(fileAsset: mediaLibrary.FileAsset) { - this.fileAsset = fileAsset - if (fileAsset) { - if (fileAsset.duration > 0) { - this.duration = dateTimeUtil.getDurationString(fileAsset.duration) - } else { - let mediaManager = new MediaManager(this.context) - this.duration = await mediaManager.getFileDuration(fileAsset.title) - } - this.title = fileAsset.title - } else { - this.duration = '00:00' - this.title = '' - } - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/Mic/RecordModel.ts b/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/Mic/RecordModel.ts deleted file mode 100644 index d72466bc..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/Mic/RecordModel.ts +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import media from '@ohos.multimedia.media'; -import Logger from '../../model/Logger' - -const TAG: string = '[Recorder.RecordModel]' - -let audioConfig = { - audioEncodeBitRate: 48000, - audioSampleRate: 48000, - numberOfChannels: 1, - uri: '', - audioEncoderMime: media.CodecMimeType.AUDIO_AAC, - fileFormat: media.ContainerFormatType.CFT_MPEG_4A, -} - -export class RecordModel { - private audioRecorder = undefined - - initAudioRecorder() { - this.release(); - this.audioRecorder = media.createAudioRecorder() - Logger.info(TAG, 'create audioRecorder success') - } - - release() { - if (typeof (this.audioRecorder) != `undefined`) { - Logger.info(TAG, 'case audioRecorder release') - this.audioRecorder.release() - this.audioRecorder = undefined - } - } - - startRecorder(pathName, callback) { - Logger.info(TAG, `enter the startRecorder,pathName=${pathName}, audioRecorder=${JSON.stringify(this.audioRecorder)}`) - if (typeof (this.audioRecorder) != 'undefined') { - Logger.info(TAG, 'enter the if') - this.audioRecorder.on('prepare', () => { - Logger.info(TAG, 'setCallback prepare case callback is called') - this.audioRecorder.start() - }) - this.audioRecorder.on('start', () => { - Logger.info(TAG, 'setCallback start case callback is called') - callback() - }) - Logger.info(TAG, 'start prepare') - audioConfig.uri = pathName - this.audioRecorder.prepare(audioConfig) - } else { - Logger.info(TAG, 'case failed, audioRecorder is null') - } - } - - pause(callback) { - Logger.info(TAG, 'audioRecorder pause called') - if (typeof (this.audioRecorder) != `undefined`) { - this.audioRecorder.on('pause', () => { - Logger.info(TAG, 'audioRecorder pause finish') - callback() - }) - this.audioRecorder.pause() - } - } - - resume(callback) { - Logger.info(TAG, 'audioRecorder resume called') - if (typeof (this.audioRecorder) != `undefined`) { - this.audioRecorder.on('resume', () => { - Logger.info(TAG, 'audioRecorder resume finish') - callback() - }) - this.audioRecorder.resume() - } - } - - finish(callback) { - if (typeof (this.audioRecorder) != `undefined`) { - this.audioRecorder.on('stop', () => { - Logger.info(TAG, 'audioRecorder stop called') - this.audioRecorder.release() - callback() - }) - this.audioRecorder.stop() - } - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/testData.ets b/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/testData.ets deleted file mode 100644 index 72605ba1..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/testData.ets +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export interface TestButton { - title: Resource | string, // Third-level category headings - url?: string, // Third-level category detail page URL - childNodes?: TestButton[] -} -export const GRAPHIC_TRANSFORMATION: TestButton[] = - [ - { - title: '设备信息', - url: 'pages/testSample/information' - }, - { - title: '存储', - url: 'pages/testSample/fileRW' - }, - { - title: '扬声器', - url: 'pages/testSample/audio', - }, - { - title: 'MIC', - url: 'pages/Mic/Mic_index' - }, - { - title: '摄像头', - url: 'pages/Camera/Camera_index' - }, - { - title: '蓝牙', - url: 'pages/testSample/bluetooth' - }, - { - title: 'WIFI', - url: 'pages/testSample/wifi' - }, - { - title: '传感器', - url: 'pages/testSample/sensor' - }, - { - title: '灰度测试', - url: 'pages/testSample/gradient' - }, - { - title: '读卡测试', - url: 'pages/testSample/nfc' - }, - { - title: '触摸测试', - url: 'pages/testSample/touch' - }, - { - title: 'LED测试', - url: 'pages/testSample/led' - } - ] diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/testSample/audio.ets b/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/testSample/audio.ets deleted file mode 100644 index 266516b0..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/testSample/audio.ets +++ /dev/null @@ -1,187 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { TitleBar } from '../../common/TitleBar'; -import media from '@ohos.multimedia.media'; -import Logger from '../../model/Logger'; -import config from '@ohos.accessibility.config'; -import { BusinessError } from '@ohos.base'; - -const TAG = 'audioSample' - -enum playType { - LEFT, - RIGHT, - ALL -} - -@Entry -@Component -export struct audioSample { - @State myPlayType: playType = playType.ALL; // - private fileName: string[] = ['EP11.mp4', 'Technology.wav']; - private avPlayer: media.AVPlayer; - - async releaseAllAudio() { - if (this.avPlayer) { - await this.avPlayer.stop(); - await this.avPlayer.release(); - this.avPlayer = undefined; - } - } - - // 注册avplayer回调函数 - setAVPlayerCallback() { - // seek操作结果回调函数 - this.avPlayer.on('seekDone', (seekDoneTime: number) => { - Logger.info(TAG, `AVPlayer seek succeeded, seek time is ${seekDoneTime}`); - }) - // error回调监听函数,当avPlayer在操作过程中出现错误时调用 reset接口触发重置流程 - this.avPlayer.on('error', (err) => { - Logger.error(`Invoke avPlayer failed, code is ${err.code}, message is ${err.message}`); - this.avPlayer.reset(); // 调用reset重置资源,触发idle状态 - }) - // 状态机变化回调函数 - this.avPlayer.on('stateChange', async (state: string, reason: media.StateChangeReason) => { - switch (state) { - case 'idle': // 成功调用reset接口后触发该状态机上报 - Logger.info(TAG, ' AVPlayer state idle called.'); - break; - case 'initialized': // avplayer 设置播放源后触发该状态上报 - Logger.info(TAG, ' AVPlayer state initialized called.'); - this.avPlayer.prepare(); - break; - case 'prepared': // prepare调用成功后上报该状态机 - Logger.info(TAG, ' AVPlayer state prepared called.'); - this.avPlayer.play(); // 调用播放接口开始播放 - break; - case 'playing': // play成功调用后触发该状态机上报 - Logger.info(TAG, ' AVPlayer state playing called.'); - break; - case 'paused': // pause成功调用后触发该状态机上报 - Logger.info(TAG, ' AVPlayer state paused called.'); - this.avPlayer.play(); // 再次播放接口开始播放 - break; - case 'completed': // 播放结束后触发该状态机上报 - Logger.info(TAG, ' AVPlayer state completed called.'); - this.avPlayer.stop(); //调用播放结束接口 - break; - case 'stopped': // stop接口成功调用后触发该状态机上报 - Logger.info(TAG, ' AVPlayer state stopped called.'); - this.avPlayer.reset(); // 调用reset接口初始化avplayer状态 - break; - case 'released': - Logger.info(TAG, ' AVPlayer state released called.'); - break; - default: - Logger.info(TAG, ' AVPlayer state unknown called.'); - break; - } - }) - } - - async aboutToDisappear() { - this.releaseAllAudio(); - await config.audioBalance.set(0); - } - - async startPlay(fileDescriptor) { - // 创建avPlayer实例对象 - this.avPlayer = await media.createAVPlayer(); - // 创建状态机变化回调函数 - this.setAVPlayerCallback(); - // 通过UIAbilityContext的resourceManager成员的getRawFd接口获取媒体资源播放地址 - // 返回类型为{fd,offset,length},fd为HAP包fd地址,offset为媒体资源偏移量,length为播放长度 - let avFileDescriptor: media.AVFileDescriptor = - { fd: fileDescriptor.fd, offset: fileDescriptor.offset, length: fileDescriptor.length }; - // 为fdSrc赋值触发initialized状态机上报 - this.avPlayer.fdSrc = avFileDescriptor; - await this.avPlayer.prepare(); - // this.avPlayer.setVolume(1); - await this.avPlayer.play(); - } - async playAudioAll() { - await this.releaseAllAudio(); - let fileDescriptor = await globalThis.context.resourceManager.getRawFd(this.fileName[1]); - - switch (this.myPlayType) { - case playType.LEFT: - config.audioBalance.set(-1).then(() => { - Logger.info(TAG, `accessibilityConfigSetting config success.`); - this.startPlay(fileDescriptor); - }).catch((err: BusinessError) => { - Logger.error(TAG, `accessibilityConfigSetting config fail. err: ${JSON.stringify(err)}`); - return; - }); - break; - case playType.RIGHT: - // TODO:右声道适配存在问题 - config.audioBalance.set(1).then(() => { - this.startPlay(fileDescriptor); - Logger.info(TAG, `accessibilityConfigSetting config success.`); - }).catch((err: BusinessError) => { - Logger.error(TAG, `accessibilityConfigSetting config fail. err: ${JSON.stringify(err)}`); - return; - }); - break; - case playType.ALL: - fileDescriptor = await globalThis.context.resourceManager.getRawFd(this.fileName[0]); - await this.startPlay(fileDescriptor); - break; - } - } - - build() { - Column() { - TitleBar({ title: '扬声器测试' }) - Scroll() { - Row() { - Text("左声道播放") - .layoutWeight(1) - .height('100%') - .backgroundColor(Color.Blue) - .onClick(() => { - this.myPlayType = playType.LEFT; - this.playAudioAll(); - }) - Column() { - Text("全声道播放") - .height('50%') - .onClick(() => { - this.myPlayType = playType.ALL; - this.playAudioAll(); - }) - Text("暂停播放") - .height('50%') - .onClick(() => { - this.releaseAllAudio(); - }) - }.layoutWeight(1) - - Text("右声道播放") - .layoutWeight(1) - .backgroundColor(Color.Blue) - .height('100%') - .onClick(() => { - this.myPlayType = playType.RIGHT; - this.playAudioAll(); - }) - } - .height(40) - .width('100%') - .constraintSize({ minHeight: '100%' }) - } - } - } -} diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/testSample/bluetooth.ets b/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/testSample/bluetooth.ets deleted file mode 100644 index 63d36bea..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/testSample/bluetooth.ets +++ /dev/null @@ -1,602 +0,0 @@ -/** - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or - { - "name": "bluetoothTab", agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import Router from '@system.router'; -import deviceInfo from '@ohos.deviceInfo'; -import BluetoothDevice from '../../model/BluetoothDevice'; -import Logger from '../../model/Logger'; -import BluetoothDeviceController from '../../controller/BluetoothDeviceController'; -import { DeviceType, ProfileConnectionState, BondState } from '../../model/BluetoothModel'; -import { TitleBar } from '../../common/TitleBar' - - -const PAIRED_ITEM_NUMBER = 3; -const PAGE_URI_DEVICE_NAME = 'pages/deviceName'; -const PAGE_URI_BLUETOOTH_PAIRED_DEVICE_INFO = 'pages/bluetoothPairedDeviceInfo'; -const deviceTypeInfo = deviceInfo.deviceType; -let pinRequiredTIimer = null; - -@Entry -@Component -export struct Bluetooth { - private PAGE_TAG = 'Bluetooth page '; - private deviceController: BluetoothDeviceController = new BluetoothDeviceController(); - @StorageLink('bluetoothIsOn') isOn: boolean = false; - @StorageLink('bluetoothToggleEnabled') isEnabled: boolean = true; - @StorageLink('bluetoothLocalName') localName: string = ''; - - aboutToAppear(): void { - Logger.info(this.PAGE_TAG + 'aboutToAppear in : isOn = ' + this.isOn) - this.deviceController - .initData() - .subscribe(); - Logger.info(this.PAGE_TAG + 'aboutToAppear out : isOn = ' + this.isOn) - } - - onPageShow(): void { - Logger.info(this.PAGE_TAG + 'onPageShow in : localName = ' + this.localName) - Logger.info(this.PAGE_TAG + 'onPageShow out : localName = ' + this.localName) - } - - aboutToDisappear(): void { - this.deviceController.unsubscribe(); - } - - build() { - Column() { - TitleBar({ title: '蓝牙测试' }) - GridContainer({ gutter: 24, margin: 24 }) { - Column() { - - Row() { - Text("蓝牙") - .fontColor($r('sys.color.ohos_fa_text_primary')) - .fontSize(16) - .fontWeight(FontWeight.Medium) - - Blank() - - Toggle({ type: ToggleType.Switch, isOn: this.isOn }) - .width('36vp') - .height('20vp') - .selectedColor('#007DFF') - .margin({ left: 6 }) - .onChange((isOn: boolean) => { - Logger.info(this.PAGE_TAG + 'Toggle onClick: isOn = ' + isOn + ', enabled = ' + this.isEnabled) - if (!this.isEnabled) return; - this.deviceController.toggleValue(isOn); - }); - } - .margin({ top: 8 }) - .width('100%') - .height(56) - .borderRadius(28) - .padding({ left: 12, right: 6 }) - .alignItems(VerticalAlign.Center) - .borderRadius(24) - - Scroll() { - Column() { - - if (this.isOn) { - AvailableDeviceComponent({ - controller: this.deviceController, - }) - } - } - .width('100%') - } - .scrollBarWidth(0) - .width('100%') - .align(Alignment.TopStart) - .layoutWeight(1) - } - .useSizeType({ - sm: { span: 4, offset: 0 }, - md: { span: 6, offset: 1 }, - lg: { span: 8, offset: 2 } - }); - } - .width('100%') - .height('100%'); - } - .backgroundColor($r("sys.color.ohos_id_color_sub_background")) - .width('100%') - .height('100%'); - } -} - - -/** - * Paired device component - */ -@Component -struct PairedDeviceComponent { - private TAG_PAGE = 'PairedDeviceComponent '; - private controller: BluetoothDeviceController; - @StorageLink('bluetoothPairedDevices') pairedDevices: BluetoothDevice[] = []; - @State isTouched: boolean = false; - @State hide: boolean = true; - - aboutToAppear(): void { - - } - - build() { - Column() { - if (this.pairedDevices && this.pairedDevices.length > 0) { - // paired devices title - Row() { - Text("已配对的设备") - .width('100%') - .fontSize(14) - .fontWeight(FontWeight.Medium) - .fontColor($r('sys.color.ohos_id_color_text_secondary')) - } - .width('100%') - .padding({ - left: 12, - top: 19, - bottom: 5 - }) - - List() { - // paired devices list - ForEach(this.pairedDevices, (item: BluetoothDevice, index: number) => { - - if (index < PAIRED_ITEM_NUMBER || !this.hide) { - ListItem() { - Row() { - Text(item.deviceId) - } - .width('100%') - .borderRadius(24) - .onClick(() => { - this.itemClicked(item); - }) - } - } - - if ((this.hide && index === PAIRED_ITEM_NUMBER) || //more - (!this.hide && index >= PAIRED_ITEM_NUMBER && index == this.pairedDevices.length - 1)) { //put_away - ListItem() { - Stack({ alignContent: Alignment.Center }) { - Stack({ alignContent: Alignment.Center }) { - - } - .width('100%') - .height(48) - .borderRadius(20) - .onTouch((event: TouchEvent) => { - if (event.type === TouchType.Down) { - this.isTouched = true; - } - if (event.type === TouchType.Up) { - this.isTouched = false; - } - }) - .onClick(() => { - this.hide = !this.hide; - }) - } - .height(48) - .backgroundColor($r("sys.color.ohos_id_color_foreground_contrary")) - } - } - }, item => JSON.stringify(item)); - } - .padding(4) - .borderRadius(24) - } - } - } - - /** - * Get connection state text - * @param device - */ - getConnectionStateText(device: BluetoothDevice): string { - let stateText: string = ''; - switch (device.connectionState) { - case ProfileConnectionState.STATE_DISCONNECTED: - stateText = ''; - break; - - case ProfileConnectionState.STATE_CONNECTING: - stateText = JSON.parse("正在连接"); - break; - - case ProfileConnectionState.STATE_CONNECTED: - if (device.deviceType === DeviceType.HEADPHONE) { - stateText = JSON.parse("已连接"); - } else { - stateText = ''; - } - break; - - case ProfileConnectionState.STATE_DISCONNECTING: - stateText = JSON.parse("正在断开"); - break; - - } - return stateText; - } - - /** - * Whether headphone connected. - * @param item device - * @return headphone connected or not - */ - private isHeadPhoneConnected(item: BluetoothDevice): boolean { - return item.deviceType === DeviceType.HEADPHONE && item.connectionState === ProfileConnectionState.STATE_CONNECTED - } - - /** - * Goto paired device Info - * @param item device - */ - private gotoPairedDeviceInfo(item: BluetoothDevice) { - if (item.connectionState != 1 - && item.connectionState != 3) { - Logger.info(this.TAG_PAGE + 'item right icon on click.'); - let param = { 'bluetoothDevice': JSON.stringify(item) } - Router.push({ - uri: PAGE_URI_BLUETOOTH_PAIRED_DEVICE_INFO, - params: param - }); - } - } - - /** - * Item clicked - * @param item device - */ - private itemClicked(item: BluetoothDevice) { - switch (item.connectionState) { - case 2: - this.showDisconnectDialog(item.deviceName, () => { - this.controller.disconnect(item.deviceId) - }); - break; - - case 0: - if (!this.controller.connect(item.deviceId)) { - } - break; - } - } - - /** - * Disconnect Dialog - */ - showDisconnectDialog(deviceName, callback) { - AlertDialog.show({ - title: "断开连接?", - message: "此操作将会断开您与以下设备的连接:" + deviceName, - primaryButton: { - value: $r('app.string.cancel'), - action: () => { - Logger.info('Closed callbacks'); - } - }, - secondaryButton: { - value: $r('app.string.confirm'), - action: () => { - Logger.info(`AlertDialog success:`); - callback(); - } - }, - alignment: deviceTypeInfo === 'phone' || deviceTypeInfo === 'default' ? DialogAlignment.Bottom : DialogAlignment.Center, - offset: ({ dx: 0, dy: deviceTypeInfo === 'phone' || deviceTypeInfo === 'default' ? '-24dp' : 0 }) - }) - } -} - - -/** - * Available device component - */ -@Component -struct AvailableDeviceComponent { - private TAG_PAGE = 'AvailableDeviceComponent '; - private controller: BluetoothDeviceController; - @State isDeviceDiscovering: boolean = false; - @StorageLink('bluetoothAvailableDevices') @Watch("availableDevicesChange") availableDevices: BluetoothDevice[] = []; - @State availableDevicesList: AvailableDevicesDataSource = new AvailableDevicesDataSource(this.availableDevices); - @State pairPinCode: string = ''; - private pairingDevice: BluetoothDevice = undefined; - @StorageLink("controlPairing") controlPairing: boolean = true; - @StorageLink("pairData") pairData: BluetoothDevice = null; - @StorageLink("pinRequiredParam") @Watch("pinRequiredParamChange") pinRequiredParam: { - deviceId: string; - pinCode: string - } = { deviceId: '', pinCode: '' }; - pairDialog: CustomDialogController = new CustomDialogController({ - builder: PairDialog({ - deviceName: (this.pairingDevice && this.pairingDevice.hasOwnProperty('deviceName')) ? this.pairingDevice.deviceName : undefined, - pinCode: this.pairPinCode, - action: (accept: boolean) => { - this.confirmPairing(accept); - } - }), - alignment: deviceTypeInfo === 'phone' || deviceTypeInfo === 'default' ? DialogAlignment.Bottom : DialogAlignment.Center, - offset: ({ dx: 0, dy: deviceTypeInfo === 'phone' || deviceTypeInfo === 'default' ? '-24dp' : 0 }), - autoCancel: true, - }); - - availableDevicesChange() { - this.availableDevicesList.setData(this.availableDevices) - } - - aboutToAppear(): void { - if (this.controller) { - - - this.controller.startBluetoothDiscovery(); - } - } - - build() { - Column() { - Row() { - - Blank() - - // bluetooth discovering - if (this.isDeviceDiscovering) { - } - } - .height(48) - .width('100%') - - if (this.availableDevices && this.availableDevices.length >= 1) { - - List() { - // paired devices list - ForEach(this.availableDevices, (item: BluetoothDevice) => { - ListItem() { - Row() { - Column() { - Text(item.deviceId) - .margin({ bottom: 10 }) - Text(item.deviceName) - .margin({ bottom: 10 }) - } - } - .height(70) - .width('100%') - .borderColor('#ffe5e4e4') - .borderWidth({ bottom: 2 }) - .onClick(() => { - Logger.info(this.TAG_PAGE + 'item on click'); - if (this.controlPairing) { - this.pairDevice(item); - } else { - return; - } - }) - } - }, item => JSON.stringify(item)); - } - .height('100%') - .padding({ bottom: 90 }) - } else { - // Scanning... - Text("正在扫描。。。。") - .fontSize($r('sys.float.ohos_id_text_size_body2')) - .textCase(TextCase.UpperCase) - .fontWeight(FontWeight.Medium) - .fontColor($r("sys.color.ohos_id_color_primary")) - .height(48) - } - } - } - - /** - * Get pair state text - * @param device - */ - getPairStateText(device: BluetoothDevice): string { - return device.connectionState == 1 ? JSON.parse(JSON.stringify("正在配对…")) : ''; - } - - pinRequiredParamChange() { - clearTimeout(pinRequiredTIimer); - pinRequiredTIimer = setTimeout(() => { - this.pairPinCode = this.pinRequiredParam.pinCode; - this.pairingDevice = this.pairData; - if (this.pairDialog) { - this.pairDialog.open(); - } - () => { - } - }, 1000) - } - /** - * Pair device - * @param device - */ - pairDevice(device: BluetoothDevice) { - this.controller.pair(device.deviceId) - } - - /** - * Confirm pairing - */ - - confirmPairing(accept: boolean) { - Logger.info(this.TAG_PAGE + 'confirmPairing pairingDevice'); - try { - if (this.pairingDevice && this.pairingDevice.deviceId != null) { - this.controller.confirmPairing(this.pairingDevice.deviceId, accept); - } - } catch (err) { - Logger.info(this.TAG_PAGE + `confirmPairing pairingDevice error ${err}`); - } - } -} - -/** - * AvailableDevicesDataSource For Lazy Loading - */ -class AvailableDevicesDataSource { - private availableDevicesArray: BluetoothDevice[] = null; - - constructor(availableDevicesArray: BluetoothDevice[]) { - this.availableDevicesArray = availableDevicesArray; - } - - public setData(data: BluetoothDevice[]) { - this.availableDevicesArray = data; - } - - public totalCount(): number { - if (this.availableDevicesArray) { - return this.availableDevicesArray.length; - } - return 0; - } - - public getData(index: number): BluetoothDevice { - if (!this.availableDevicesArray) { - Logger.info('array is null.'); - return null; - } - if (index < 0 || index >= this.totalCount()) { - Logger.info('index out of range.'); - return null; - } - return this.availableDevicesArray[index]; - } - - public delData(device: BluetoothDevice): void { - let index = this.availableDevicesArray.indexOf(device); - this.availableDevicesArray.splice(index, 1) - } -} - -/** - * Pair dialog - */ -@CustomDialog -struct PairDialog { - dialogController: CustomDialogController; - action: (accept: boolean) => void; - private deviceName: string = undefined; - private pinCode: string; - - aboutToAppear(): void { - Logger.info(`bluetooth PairDialog aboutToAppear.`) - } - - build() { - Column() { - Text("要与" + this.deviceName + "配对吗?") - .fontSize(15) - .height(56) - .width(200) - Column() { - if (this.pinCode) { - Text("蓝牙配对码") - Text(`${this.pinCode}`) - .fontSize(32) - .fontWeight(500) - .fontColor($r("sys.color.ohos_id_color_primary")) - .width(100) - .textAlign(TextAlign.Center) - .margin({ - top: 6, - bottom: 10 - }) - } else { - - Text(this.deviceName) - .fontSize(16) - .width(100) - .fontWeight(FontWeight.Bold) - } - - // button - Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) { - Text($r('app.string.cancel')) - .fontSize(16) - .fontColor('#007DFF') - .fontWeight(500) - .flexGrow(1) - .onClick(() => { - this.dialogController.close(); - this.action(false); - }) - - Divider() - .height(24) - .strokeWidth(0.5) - .vertical(true) - .color($r("sys.color.ohos_id_color_list_separator")) - - Text("配对") - .fontSize(16) - .fontColor('#007DFF') - .fontWeight(500) - .flexGrow(1) - .onClick(() => { - this.dialogController.close(); - this.action(true); - }) - - } - .width(100) - .height(56) - .margin({ top: 10 }) - .padding({ bottom: 16 }) - } - .width('100%') - .padding({ - left: 24, - right: 24 - }) - } - .width(deviceTypeInfo === 'phone' || deviceTypeInfo === 'default' ? '100%' : 500) - .padding(deviceTypeInfo === 'phone' || deviceTypeInfo === 'default' ? { left: 12, right: 12 } : {}) - } -} - -/** - * Pair mode prompt - * @param dialogTitle Dialog title - * @param dialogMessage Dialog message - * @param buttonValue Dialog buttonValue - */ -function showDialog(dialogTitle: string | Resource, dialogMessage: string | Resource, buttonValue: string | Resource) { - Logger.info('Bluetooth page showDialog in.'); - - AlertDialog.show({ - title: dialogTitle, - message: dialogMessage, - confirm: { - value: buttonValue, - action: () => { - Logger.info('Bluetooth page showDialog : Button-clicking callback'); - } - }, - cancel: () => { - Logger.info('Bluetooth page showDialog : Closed callbacks'); - } - }) - - Logger.info('Bluetooth page showDialog out.'); -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/testSample/fileRW.ets b/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/testSample/fileRW.ets deleted file mode 100644 index 6b11a78a..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/testSample/fileRW.ets +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import fs from '@ohos.file.fs'; -import systemDateTime from '@ohos.systemDateTime'; -import { BusinessError } from '@ohos.base'; -import { TitleBar } from '../../common/TitleBar'; -import Logger from '../../model/Logger'; -import { TipsDialog } from '../../common/TipsDialog'; - import worker, { MessageEvents } from '@ohos.worker'; -import prompt from '@system.prompt'; - -const TAG = 'fileRW' - - -enum fileOperateType { - WRITE = 0, - READ = 1 -} - -@Entry -@Component -export struct fileRW { - @State message: string = ''; - @StorageLink('btnEnabled')@Watch("btnEnabledOnchange") myBtnEnabled: boolean = true; - private myWriteTimeSpeed: number = 0; - private myReadTimeSpeed: number = 0; - btnEnabledOnchange() { - Logger.info(TAG,"btnEnabledOnchange:"+this.myBtnEnabled); - if(this.myBtnEnabled){ - Logger.info(TAG,"myWriteTimeSpeed:"+this.myWriteTimeSpeed+"myReadTimeSpeed:"+this.myReadTimeSpeed); - if(this.myWriteTimeSpeed && this.myReadTimeSpeed){ - this.message = "写入速度:"+this.myWriteTimeSpeed+" M/s\n\n"+"读取速度:"+this.myReadTimeSpeed+" M/s\n"; - } - } - else{ - this.message = "正在读写测试中...."; - } - } - getSpeed(mSTime: number): number { - let ret: number = 0; - let sTime: number = mSTime / 1000; - Logger.info(TAG, `getSpeed sTime: ${sTime}`); - ret = 2048 / sTime; - return Math.round(ret); - } - - createFileWork() { - - let writeAndReadWorkerInstance = new worker.ThreadWorker('@bundle:com.yarward.factorytest/entry/ets/pages/workers/fileWorker'); - // 主线程向worker线程传递信息 - let myFilePath:string = globalThis.pathDir + "/test.txt"; - writeAndReadWorkerInstance.postMessage(myFilePath); - // 在调用terminate后,执行onexit - writeAndReadWorkerInstance.onexit = function() { - Logger.info(TAG,"writeAndReadWorkerInstance main thread terminate"); - } - // 写入数据接收信息回调监听 - writeAndReadWorkerInstance.addEventListener("message", (event: MessageEvents)=>{ - Logger.info(TAG,"writeAndReadWorkerInstance onmessage listener callback"); - if(event.data < 0){ - Logger.info(TAG,"file Operate fail"); - return; - } - Logger.info(TAG,"writeAndReadWorkerInstance onmessage listener event.data:"+event.data); - // 获取写入速度 - let writeTimeSpeed = event.data[0]; - let readTimeSpeed= event.data[1]; - - this.myWriteTimeSpeed = writeTimeSpeed; - this.myReadTimeSpeed = readTimeSpeed; - - try{ - Logger.info(TAG,"writeAndReadWorkerInstance onmessage listener this.writeTimeSpeed:"+writeTimeSpeed+"this.readTimeSpeed:"+writeTimeSpeed); - AppStorage.set("writeTimeSpeed",writeTimeSpeed); - AppStorage.set("readTimeSpeed",readTimeSpeed); - AppStorage.set("btnEnabled",true); - } - catch(err){ - Logger.error(TAG,"AppStorage.setOrCreate fail.err:"+err); - } - - writeAndReadWorkerInstance.terminate(); - - }) - - } - - onPageShow() { - let writeTimeSpeed = AppStorage.get("writeTimeSpeed") as number; - let readTimeSpeed = AppStorage.get("readTimeSpeed") as number; - let myBtnEnabled = < boolean > AppStorage.get("btnEnabled"); - Logger.info(TAG,"aboutToAppear writeTimeSpeed: "+writeTimeSpeed+"readTimeSpeed:"+readTimeSpeed +"myBtnEnabled" +myBtnEnabled); - - if(writeTimeSpeed){ - this.myWriteTimeSpeed = writeTimeSpeed; - } - if(readTimeSpeed){ - this.myReadTimeSpeed = readTimeSpeed; - } - Logger.info(TAG,"aboutToAppear myWriteTimeSecond: "+this.myWriteTimeSpeed+"myReadTimeSecond:"+this.myReadTimeSpeed); - - this.myBtnEnabled = myBtnEnabled; - if(myBtnEnabled === false){ - this.message = "正在读写测试中...."; - } - else { - this.btnEnabledOnchange(); - } - - } - - build() { - Column() { - TitleBar({ title: '存储设备读写测试' }) - Scroll() { - Column() { - Button("读写300M文件开始测试") - .onClick( () => { - Logger.info(TAG,"onClick"); - - if(this.myBtnEnabled === false) { - prompt.showToast({ - message: '正在读写测试,请勿重复点击!', - duration: 2000, - }); - } - else { - try{ - AppStorage.setOrCreate("btnEnabled",false); - }catch(err){ - Logger.error(TAG,"AppStorage.setOrCreate fail.err:"+err); - } - this.myWriteTimeSpeed = 0; - this.myReadTimeSpeed = 0; - this.createFileWork(); - } - - }) - Text(this.message) - .margin({ top: 100 }) - - } - .width('100%') - .constraintSize({ minHeight: '100%' }) - } - } - } -} diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/testSample/gradient.ets b/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/testSample/gradient.ets deleted file mode 100644 index 1d8b2ae6..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/testSample/gradient.ets +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import display from '@ohos.display'; -import { TitleBar } from '../../common/TitleBar' -import Logger from '../../model/Logger'; - -@Entry -@Component -export struct gradient { - @State myAngle: number = 90; - @State windowWidth: number = 0; - @State windowHeight: number = 0; - @State gradientType: number = 0; - @State isTestTime: boolean = true; - private intervalID; - private colorWhite: number = 0xffffff; - private colorBlack: number = 0x000000; - - aboutToDisappear() { - clearInterval(this.intervalID); - } - - async aboutToAppear() { - let displayClass = null; - try { - displayClass = display.getDefaultDisplaySync(); - this.windowWidth = displayClass.width; - this.windowHeight = displayClass.height; - } catch (exception) { - console.error('Failed to obtain the default display object. Code: ' + JSON.stringify(exception)); - } - this.intervalID = setInterval(() => { - switch (this.myAngle) { - case 360: - this.myAngle = 225; - break; - case 225: - this.myAngle = 45; - break; - case 45: - if (this.gradientType != 2) { - this.gradientType++; - } - else { - this.gradientType = 0; - this.myAngle = 90; - } - break; - default: - this.myAngle = this.myAngle + 90;break; - } - - }, 2000); - - } - - build() { - Column() { - TitleBar({ title: '灰度测试' }) - .visibility(this.isTestTime ? Visibility.None : Visibility.Visible) - if (this.gradientType == 0) { - Column() { - } - .linearGradient({ - angle: this.myAngle, - colors: [[this.colorWhite, 0.0], [this.colorBlack, 1.0]] - }) - .width('100%') - .height('100%') - } - else { - Column() { - } - .width('100%') - .height('100%') - .radialGradient({ - center: [this.windowWidth / 2, this.windowHeight / 2], - radius: Math.max(this.windowWidth, this.windowHeight) / 2, - colors: [[this.gradientType == 1 ? this.colorWhite : this.colorBlack, 0.0], [this.gradientType == 1 ? this.colorBlack : this.colorWhite, 1.0]] - }) - } - } - .onClick(() => { - this.isTestTime = true; - }) - .gesture( - PinchGesture({ fingers: 5 }) - .onActionEnd(() => { - this.isTestTime = false; - }) - ) - } -} diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/testSample/information.ets b/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/testSample/information.ets deleted file mode 100644 index 56c7218c..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/testSample/information.ets +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { deviceInfos } from '../../model/deviceInfos'; -import statvfs from '@ohos.file.statvfs'; -import { GRAPHIC_TRANSFORMATION, TestButton } from '../testData' -import { TitleBar } from '../../common/TitleBar' - -export class btn { - btnName: string = '' - isPass: boolean = false -} - - -@Entry -@Component -export struct yarwardInformation { - @State infValue: string[] = []; - private message: string = '设备信息'; - private infName: string[] = ['系统版本:', '系统软件API版本:', '设备类型:', 'cpu频率:', - 'cpu型号:', '内存容量:', '存储容量:', '剩余存储容量:','已使用存储容量:','设备厂家名称:','外部产品系列:','产品系列:']; - private myDeviceInfos: deviceInfos = new deviceInfos(); - - async aboutToAppear() { - await this.myDeviceInfos.init(); - this.infValue.push(this.myDeviceInfos.osFullName); - this.infValue.push(this.myDeviceInfos.sdkApiVersion); - this.infValue.push(this.myDeviceInfos.deviceType); - this.infValue.push(this.myDeviceInfos.cpuFrequency); - this.infValue.push("rk3566 rgo_am64v8a"); - this.infValue.push(this.myDeviceInfos.memCapacity); - this.infValue.push(this.myDeviceInfos.stoCapacity); - this.infValue.push(this.myDeviceInfos.freeCapacity); - this.infValue.push(this.myDeviceInfos.usedCapacity); - this.infValue.push(this.myDeviceInfos.manufacture); - this.infValue.push(this.myDeviceInfos.marketName); - this.infValue.push(this.myDeviceInfos.productSeries); - - } - - build() { - Column() { - TitleBar({ title: '设备信息' }) - Scroll() { - Column() { - ForEach(this.infName, (item, index) => { // ForEach语法,循环创建GridItem - Row() { - Text(item) - .fontSize(20) - .height(50) - .textAlign(TextAlign.Start) - .width('50%') - Text(this.infValue[index]) - .fontSize(20) - .height(50) - .textAlign(TextAlign.Start) - .width('50%') - } - .borderWidth({ bottom: 2 }) - .padding({ left: 30, right: 30 }) - .width('100%') - }) - Column() - .margin({ bottom: 90 }) - } - .width('100%') - .constraintSize({ minHeight: '100%' }) - } - } - } -} diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/testSample/led.ets b/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/testSample/led.ets deleted file mode 100644 index 0d6dcfad..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/testSample/led.ets +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { TitleBar } from '../../common/TitleBar' -import Logger from '../../model/Logger'; - -@Entry -@Component -struct Led { - @State color: Color = Color.Red; - @State index: number = 0; - @State isTestTime: boolean = true; - - private intervalID; - onPageShow(){ - this.intervalID = setInterval(() => { - switch(this.index){ - case 0:this.color = Color.Yellow;break; - case 1:this.color = Color.Blue;break; - case 2:this.color = Color.White;break; - case 3:this.color = Color.Black;break; - default : this.color = Color.Red;this.index = -1;break; - } - this.index++; - - },2000) - } - onPageHide(){ - clearInterval(this.intervalID); - } - build() { - Column() { - TitleBar({ title: 'led测试' }) - .visibility(this.isTestTime ? Visibility.None : Visibility.Visible) - Column() { - } - .backgroundColor(this.color) - .height('100%') - .width('100%') - } - .onClick(() => { - this.isTestTime = true; - }) - .gesture( - PinchGesture({ fingers: 5 }) - .onActionEnd(() => { - this.isTestTime = false; - }) - ) - .height('100%') - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/testSample/nfc.ets b/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/testSample/nfc.ets deleted file mode 100644 index 57cab25d..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/testSample/nfc.ets +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { TitleBar } from '../../common/TitleBar' -// @ts-ignore -import nfctest from '@ohos.nfctest' -import Logger from '../../model/Logger' - -const TAG = 'nfcSample' - -@Entry -@Component -export struct nfcSample { - @State nfc: string[] = [] - @State @Watch('readNfcTimesChange') readNfcTimes: number = 0 - scroller: Scroller = new Scroller() - private message: string = "1、到达此界面时,读卡器已经可以使用;\n2、展示区将展示读卡器发送给本机的数据和分机发送给读卡器的数据;\n3、读卡器读卡成功将发送卡号,本机回复 AA 55 停止读卡;\n4、读卡器读卡失败不会展示任何信息;\n" - - getNfcValue() { - nfctest.get_nfc_value() - .then((ret) => { - Logger.info(TAG, "get_nfc_value " + ret); - this.nfc.push(ret); - this.readNfcTimes++; - }) - .catch((err) => { - Logger.error(TAG, `get_nfc_value failed err is ${JSON.stringify(err)}`) - this.readNfcTimes++; - }) - } - - readNfcTimesChange() { - Logger.error(TAG, "messageChange this.readNfcTimes:" + this.readNfcTimes); - this.getNfcValue(); - this.scroller.scrollEdge(Edge.Bottom); - } - - aboutToAppear() { - Logger.info(TAG, "this.message" + this.nfc); - this.getNfcValue(); - } - onPageHide() { - nfctest.nfc_release(); - } - build() { - Column() { - TitleBar({ title: '读卡测试' }) - Text("读卡次数:" + this.nfc.length) - .margin({ bottom: 25 }) - Scroll(this.scroller) { - Column() { - ForEach((this.nfc), (item, index) => { - Text("第" + (index + 1) + "次数据: " + item) - .width('90%') - .height(50) - .borderWidth({ bottom: 1 }) - .textAlign(TextAlign.Center) - }) - } - .margin({ bottom: 200 }) - } - .width('100%') - .padding({ left: 16, right: 16 }) - } - .margin({ bottom: 80 }) - .width('100%') - .constraintSize({ minHeight: '100%' }) - } -} diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/testSample/sensor.ets b/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/testSample/sensor.ets deleted file mode 100644 index 9e74b5d2..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/testSample/sensor.ets +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import sensor from '@ohos.sensor'; -import { TitleBar } from '../../common/TitleBar'; -import Logger from '../../model/Logger'; - -const TAG = 'sensorSample'; - -@Entry -@Component -export struct sensorSample { - @State myIntensity: string = '0' - @State isDistance: number = 1 - - aboutToAppear() { - // 环境光强度 - try { - sensor.on(sensor.SensorId.AMBIENT_LIGHT, (data) => { - this.myIntensity = data.intensity.toFixed(2); - Logger.info(TAG, 'The ambient light intensity: ' + data.intensity); - }, { interval: 3000000000 }); - } catch (err) { - Logger.error(TAG, 'On fail, errCode: ' + err.code + ' ,msg: ' + err.message); - } - // 接近光程度 - try { - sensor.on(sensor.SensorId.PROXIMITY, (data) => { - this.isDistance = data.distance; - console.info('Distance: ' + data.distance); - }, { interval: 3000000000 }); - } catch (err) { - console.error('On fail, errCode: ' + err.code + ' ,msg: ' + err.message); - } - - } - - build() { - Column() { - TitleBar({ title: '光感测试' }) - Column({space:10}) { - Text("说明: 该测试项对设备感光进行测试,将设备放置于明暗环境下,光感数值有明确变化为测试成功。\n注意: 光线传感器位于摄像头右边") - Column() { - Row() { - Text("设备周围光线强度:") - Text(this.myIntensity).fontSize(50) - Text(" lx") - } - - Row() { - Text("物体与设备显示器") - Text(this.isDistance == 0 ? "接近" : "远离") - .fontSize(50) - } - } - .layoutWeight(1) - .width('100%') - .backgroundColor('#fff3f0f0') - .justifyContent(FlexAlign.Center) - } - .layoutWeight(1) - .width('100%') - .padding(20) - } - .width('100%') - .height('100%') - - } -} diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/testSample/touch.ets b/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/testSample/touch.ets deleted file mode 100644 index fe0244a2..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/testSample/touch.ets +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { TitleBar } from '../../common/TitleBar'; -import Logger from '../../model/Logger'; -import promptAction from '@ohos.promptAction'; -import window from '@ohos.window'; - -const TAG = 'touchSample'; - -@Entry -@Component -export struct touchSample { - @State @Watch('touchTestChange') touchTest: number = 1; // 触摸测试样例 - @State @Watch('touchedCountChange') touchedCount: number = 0; // 触摸测试样例 - @State gridItem: boolean[] = []; - @State buttonsOffsetX: number[] = [0, 100, 200, 300, 400, 500]; - @State buttonsOffsetY: number[] = [0, 100, 200, 300, 400, 500]; - @State myColumnsTemplate: string = "1fr 1fr 1fr 1fr 1fr 1fr"; - @State myRowsTemplate: string = "1fr 1fr 1fr 1fr 1fr 1fr"; - private gridItemArea: Area[] = []; - private gridItemCount: number; - - touchedCountChange() { - Logger.info(TAG,"touchedCount:"+this.touchedCount+"this.gridItemCount"+this.gridItemCount +"this.touchTest:"+this.touchTest); - - if (this.touchedCount >= this.gridItemCount -1 && this.touchTest == 1) { - Logger.info(TAG,"this.touchTest++"); - this.touchTest++; - } - if (this.touchedCount >= this.gridItemCount - 1 && this.touchTest == 2) { - this.touchTest++; - } - } - initGridItem(){ - for (let i = 0;i < this.gridItemCount; i++) { - this.gridItem[i] = false; - } - } - promptActionTouchTestChange() { - // 弹窗 - try { - promptAction.showDialog({ - title: '屏幕触摸项目' + this.touchTest, - message: '1、点击确定开始屏幕触控测试,在单元格上执行点击、拖动等操作会消除单元格,消除完屏幕所有单元格后会自动进行下一项测试2、五指同时触控屏幕可跳过此项测试进行下一项测试', - buttons: [ - { - text: '确定', - color: '#000000', - } - ], - }) - .then(data => { - switch(this.touchTest){ - case 1: - this.gridItemCount = 36;this.initGridItem();break; - case 2: - this.gridItemCount = 144;this.initGridItem();break; - default :; - } - console.info('showDialog success, click button: ' + data.index); - }) - .catch(err => { - console.info('showDialog error: ' + err); - }) - } catch (error) { - console.error(`showDialog args error code is ${error.code}, message is ${error.message}`); - } - ; - } - - touchTestChange() { - Logger.info(TAG,"touchTestChange"); - this.touchedCount = 0; - this.gridItem = []; - if (this.touchTest == 2) { - this.myColumnsTemplate = "1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr"; - this.myRowsTemplate = "1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr"; - Logger.info(TAG, "this.gridItem.length" + this.gridItem.length + "this.gridItemArea.length" + this.gridItemArea.length); - } - this.promptActionTouchTestChange(); - } - - aboutToAppear() { - Logger.info(TAG, "aboutToAppear"); - } - - onPageShow() { - this.promptActionTouchTestChange(); - } - // area.globalPosition: 目标元素左上角相对页面左上角的位置。 - isInArea(area: Area, x: number, y: number): boolean { - if (x >= area.globalPosition.x && x <= Number(area.globalPosition.x) + Number(area.width)) { - if (y >= area.globalPosition.y && y <= Number(area.globalPosition.y) + Number(area.height)) { - return true; - } - } - return false; - } - - build() { - Column() { - TitleBar({ title: '触摸测试' }) - Stack({ alignContent: Alignment.TopStart }) { - Grid() { - ForEach(this.gridItem, (item, index) => { - GridItem() { - } - .onAreaChange((oldValue: Area, newValue: Area) => { - if (this.gridItemArea.length <= this.gridItem.length) { - this.gridItemArea[index] = newValue; - Logger.log(TAG, "gridItemArea:" + this.gridItemArea.length + this.gridItemCount); - } - }) - .id("GridItem" + index) - .onClick(() => { - if (this.gridItem[index] == false) { - this.gridItem[index] = true; - this.touchedCount++; - } - }) - .borderWidth(1) - .backgroundColor(item ? Color.Black : Color.White) - .borderColor(Color.Black) - .width('100%') - .height('100%') - }, item => item) - } - .onTouch((event: TouchEvent) => { - Logger.log(TAG, "TouchEventX:" + event.changedTouches[0].screenX + "TouchEventY:" + event.changedTouches[0].screenY); - this.gridItemArea.forEach((element, index) => { - if (this.isInArea(element, event.changedTouches[0].screenX, event.changedTouches[0].screenY)) { - if (this.gridItem[index] == false) { - this.gridItem[index] = true; - this.touchedCount++; - } - } - }); - }) - .width('100%') - .height('100%') - .columnsTemplate(this.myColumnsTemplate) // Grid宽度均分成4份 - .rowsTemplate(this.myRowsTemplate) // Grid高度均分成5份 - } - .hitTestBehavior(HitTestMode.Transparent) - .gesture( - GestureGroup(GestureMode.Parallel, - LongPressGesture({ fingers: 5, repeat: true }) - // 由于repeat设置为true,长按动作存在时会连续触发,触发间隔为duration(默认值500ms) - .onAction((event: GestureEvent) => { - - Logger.info(TAG, "onActionUpdate"); - let fingerLists = event.fingerList; - Logger.info(TAG, "onActionUpdate" + event.fingerList.length); - fingerLists.forEach((value, index) => { - this.buttonsOffsetX[index] = value.globalX; - this.buttonsOffsetY[index] = value.globalY; - Logger.info(TAG, "GestureEventX:" + value.globalX + "GestureEventY:" + value.globalY); - }) - }), - PinchGesture({ fingers: 5 }) - .onActionEnd(() => { - this.initGridItem(); - this.touchTest++; - }) - ) - ) - .width('100%') - .height('100%') - } - .width('100%') - .height('100%') - - } -} diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/testSample/wifi.ets b/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/testSample/wifi.ets deleted file mode 100644 index 63469f1a..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/testSample/wifi.ets +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import fs from '@ohos.file.fs'; -import { TitleBar } from '../../common/TitleBar' -import { AvailableWifi } from '../../common/AvailableWifi' -import wifi from '@ohos.wifiManager' -import Logger from '../../model/Logger' -import { WifiModel, WifiType } from '../../model/WifiModel' - -const TAG = 'wifi' - -@Entry -@Component -export struct wifiSample { - private wifiModel: WifiModel = new WifiModel() - private linkedInfo: wifi.WifiLinkedInfo = null - @State isLinked: boolean = false - @State isSwitchOn: boolean = false - - // 扫描wifi - async scan() { - // 获取有关Wi-Fi连接的信息,存入linkedInfo - await this.getLinkedInfo() - // 不停地扫描wifi - let result: Array = await this.wifiModel.getScanInfos() - if (this.isSwitchOn) { - AppStorage.SetOrCreate('wifiList', result) - setTimeout(async () => { - await this.scan() - }, 3000) - } - } - - // 获取有关Wi-Fi连接的信息,存入linkedInfo - async getLinkedInfo() { - try { - let wifiLinkedInfo = await wifi.getLinkedInfo() - if (wifiLinkedInfo === null || wifiLinkedInfo.bssid === '') { - this.isLinked = false - this.linkedInfo = null - return - } - this.isLinked = true - this.linkedInfo = wifiLinkedInfo - } catch (err) { - Logger.info(`getLinkedInfo failed err is ${JSON.stringify(err)}`) - } - } - - // 监听wifi的变化 - addListener() { - // 连接状态改变时,修改连接信息 - wifi.on('wifiConnectionChange', async state => { - Logger.info(TAG, `wifiConnectionChange: ${state}`) - await this.getLinkedInfo() - }) - // wifi状态改变时,先清空wifi列表,然后判断是否是开启状态,如果是就扫描 - wifi.on('wifiStateChange', state => { - Logger.info(TAG, `wifiStateLisener state: ${state}`) - AppStorage.SetOrCreate('wifiList', []) - if (state === 1) { // 1: wifi is enable, 0:wifi is disable - this.scan() - } - }) - } - - aboutToAppear() { - // 如果wifi是开的,就记录下状态,然后扫描wifi,并获取连接信息 - if (wifi.isWifiActive()) { - Logger.info(TAG, 'wifi is active') - this.isSwitchOn = true - wifi.scan() - this.scan() - this.getLinkedInfo() - } - // 启动监听 - this.addListener() - } - - build() { - Column() { - TitleBar({ title: 'wifi测试' }) - Scroll() { - Column() { - Toggle({ type: ToggleType.Switch, isOn: this.isSwitchOn }) - .id('switch') - .onChange((isOn: boolean) => { - Logger.info(`LSQ: wifi swtich is: ${isOn}`) - AppStorage.SetOrCreate('wifiList', []) - try { - // 如果是打开状态,记录状态,打开网络,开始扫描 - if (isOn) { - this.isSwitchOn = true - wifi.enableWifi() - return - } else { - // 记录状态,断开网络禁用网络 - this.isSwitchOn = false - this.isLinked = false - wifi.disconnect() - wifi.disableWifi() - } - } catch (error) { - Logger.error(TAG, `failed,code:${JSON.stringify(error.code)},message:${JSON.stringify(error.message)}`) - } - }) - } - } - .width('100%') - .padding({ left: 16, right: 16 }) - - if (this.isLinked && this.isSwitchOn) { - Column() { - Text($r('app.string.connected')) - .fontSize(22) - .width('100%') - Row() { - Text(this.linkedInfo.ssid) - .fontSize(20) - .fontColor(Color.Black) - .layoutWeight(1) - Text($r('app.string.connected')) - .fontSize(18) - .fontColor(Color.Black) - } - .width('100%') - .padding(10) - .margin({ left: 16, right: 16 }) - .border({ radius: 15, color: Color.Gray, width: 1 }) - .backgroundColor(Color.White) - } - .width('100%') - .padding({ left: 16, right: 16 }) - } - - if (this.isSwitchOn) { - AvailableWifi({ linkedInfo: this.linkedInfo }) - } - } - .width('100%') - .constraintSize({ minHeight: '100%' }) - } -} diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/workers/fileWorker.ts b/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/workers/fileWorker.ts deleted file mode 100644 index 8d430008..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/main/ets/pages/workers/fileWorker.ts +++ /dev/null @@ -1,172 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// worker.ts -import worker from '@ohos.worker'; -import systemDateTime from '@ohos.systemDateTime'; -import fs from '@ohos.file.fs'; -import { BusinessError } from '@ohos.base'; -const TAG = 'fileWorker ' - -// 创建worker线程中与主线程通信的对象 -const workerPort = worker.workerPort -enum fileOperateType { - WRITE = 0, - READ = 1 -} - -async function fileRead(filePath) { - console.info(TAG,"fileRead start"); - - fs.open(filePath, fs.OpenMode.READ_ONLY).then(async (file: fs.File)=> { - let readBuf = new ArrayBuffer(67108864); - console.info(TAG, "fileRead filePath:" + filePath); - let readFirstTime = await systemDateTime.getRealActiveTime(false); - console.info(TAG, "fileRead readFirstTime:" + readFirstTime); - let len = 0; - let retLen; - for (let i = 0;i < 32; i++) { - retLen = fs.readSync(file.fd, readBuf, { offset: len }); - len = len + retLen; - } - let readLastTime = await systemDateTime.getRealActiveTime(false); - fs.closeSync(file); - - console.info(TAG, "fileRead readLastTime:" + readLastTime); - - fs.unlink(filePath, (err) => { - if (err) { - console.info(TAG,"remove file failed with error message: " + err.message + ", error code: " + err.code); - } else { - console.info(TAG,"remove file succeed"); - } - }); - let readTimeSecond = readLastTime- readFirstTime; - // worker线程向主线程发送信息 - workerPort.postMessage(readTimeSecond); - - }).catch((err: BusinessError) => { - console.error(TAG,"open file failed with error message: " + err.message + ", error code: " + err.code); - // worker线程向主线程发送信息 - workerPort.postMessage(-1) - }) - console.info(TAG,"fileRead end"); - -} -// worker线程接收主线程信息 -async function fileWrite(filePath: string) { - - console.info(TAG,"fileWrite start filePath:"+filePath); - fs.open(filePath, fs.OpenMode.WRITE_ONLY | fs.OpenMode.CREATE).then(async (file: fs.File) => { - console.log(TAG,"file fd: " + file.fd); - let writeBuf = new ArrayBuffer(67108864); - let len = 0; - let writeFirstTime = await systemDateTime.getRealActiveTime(false); - //41920 - for ( let i = 0;i < 32; i++) { - let retLen = fs.writeSync(file.fd, writeBuf, { offset: len }); - len = len + retLen; - } - let writeLastTime = await systemDateTime.getRealActiveTime(false); - fs.closeSync(file); - let writeTimeSecond = writeLastTime - writeFirstTime; - // worker线程向主线程发送信息 - workerPort.postMessage(writeTimeSecond) - }).catch((err: BusinessError) => { - console.error(TAG,"open file failed with error message: " + err.message + ", error code: " + err.code); - // worker线程向主线程发送信息 - workerPort.postMessage(-1) - }).catch((err: BusinessError) => { - workerPort.postMessage(-1) - console.info(TAG,"remove file failed with error message: " + err.message + ", error code: " + err.code); - }); - console.info(TAG,"fileWrite end"); -} - -async function fileWriteAndRead(filePath: string) { - - console.info(TAG, "fileWriteAndRead start filePath:" + filePath); - fs.open(filePath, fs.OpenMode.READ_WRITE | fs.OpenMode.CREATE).then(async (file: fs.File) => { - console.log(TAG, "file fd: " + file.fd); - let length = 12582912; - let writeBuf = new ArrayBuffer(length); - let readBuf = new ArrayBuffer(length); - - let retLen; - let len = 0; - - let writeFirstTime = await systemDateTime.getRealActiveTime(false); - - for (let i = 0;i < 25; i++) { - - retLen = fs.writeSync(file.fd, writeBuf, { offset: len }); - len = retLen + len; - } - let writeLastTime = await systemDateTime.getRealActiveTime(false); - - let readFirstTime = await systemDateTime.getRealActiveTime(false); - len = 0; - for (let i = 0;i < 25; i++) { - - retLen = fs.readSync(file.fd, readBuf, { offset: len }); - len = retLen + len; - } - let readLastTime = await systemDateTime.getRealActiveTime(false); - fs.closeSync(file); - fs.unlinkSync(filePath); - // 获取读写时间间隔 - let myReadTimeSecond = readLastTime - readFirstTime; - - let myWriteTimeSecond = writeLastTime - writeFirstTime; - console.log(TAG, "file myWriteTimeSecond: " + myWriteTimeSecond+"file myReadTimeSecond: " + myReadTimeSecond); - - - // worker线程向主线程发送信息 - myWriteTimeSecond = myWriteTimeSecond / 1000; - myReadTimeSecond = myReadTimeSecond / 1000; - let myWriteTimeSpeed = Math.floor(300 / myWriteTimeSecond) ; - let myReadTimeSpeed = Math.floor(300 / myReadTimeSecond) ; - - var buffer = new ArrayBuffer(2); - buffer[0] = myWriteTimeSpeed; - buffer[1] = myReadTimeSpeed; - console.log(TAG, "file buffer: " + buffer); - workerPort.postMessage(buffer,[buffer]); - }).catch((err: BusinessError) => { - console.error(TAG, "open file failed with error message: " + err.message + ", error code: " + err.code); - // worker线程向主线程发送信息 - workerPort.postMessage(-1) - }).catch((err: BusinessError) => { - workerPort.postMessage(-1) - console.info(TAG, "remove file failed with error message: " + err.message + ", error code: " + err.code); - }); - console.info(TAG, "fileWriteAndRead end"); - -} - -workerPort.onmessage = async function(e) { - - - - // data:主线程发送的信息 - let workFilePath = e.data; - console.info(TAG, `workFilePath: + ${workFilePath}` ); - fileWriteAndRead(workFilePath); - -} - -// worker线程发生error的回调 -workerPort.onerror= function(e) { - console.log(TAG, "worker.ts onerror"); -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/module.json5 b/unionpi_tiger/sample/app/factory/entry/src/main/module.json5 deleted file mode 100644 index 35f4d219..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/main/module.json5 +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -{ - "module": { - "name": "entry", - "type": "entry", - "description": "$string:module_desc", - "mainElement": "EntryAbility", - "deviceTypes": [ - "default" - ], - "deliveryWithInstall": true, - "installationFree": false, - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "EntryAbility", - "srcEntry": "./ets/entryability/EntryAbility.ts", - "description": "$string:EntryAbility_desc", - "icon": "$media:icon", - "label": "$string:EntryAbility_label", - "startWindowIcon": "$media:icon", - "startWindowBackground": "$color:start_window_background", - "exported": true, - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ] - } - ], - "requestPermissions": [ - // wifi - { - "name": "ohos.permission.FILE_ACCESS_MANAGER" - }, - { - "name": "ohos.permission.GET_WIFI_INFO" - }, - { - "name": "ohos.permission.GET_WIFI_INFO_INTERNAL" - }, - { - "name": "ohos.permission.SET_WIFI_INFO" - }, - { - "name": "ohos.permission.GET_WIFI_PEERS_MAC" - }, - { - "name": "ohos.permission.GET_WIFI_LOCAL_MAC" - }, - { - "name": "ohos.permission.GET_WIFI_CONFIG" - }, - { - "name": "ohos.permission.SET_WIFI_CONFIG" - }, - { - "name": "ohos.permission.MANAGE_WIFI_CONNECTION" - }, - { - "name": "ohos.permission.MANAGE_WIFI_HOTSPOT" - }, - // bluetooth - { - "name": "ohos.permission.LOCATION" - }, - { - "name": "ohos.permission.APPROXIMATELY_LOCATION" - }, - { - "name": "ohos.permission.USE_BLUETOOTH", - }, - { - "name": "ohos.permission.DISCOVER_BLUETOOTH", - }, - { - "name": "ohos.permission.LOCATION", - }, - { - "name": "ohos.permission.APPROXIMATELY_LOCATION", - }, - { - "name": "ohos.permission.MANAGE_BLUETOOTH", - }, - { - "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - }, - { - "name": "ohos.permission.CAPTURE_SCREEN" - }, - { - "name": "ohos.permission.WRITE_MEDIA" - }, - { - "name": "ohos.permission.READ_MEDIA" - }, - { - "name": "ohos.permission.INTERNET" - }, - { - "name": "ohos.permission.MEDIA_LOCATION" - }, - { - "name": "ohos.permission.CAMERA" - }, - { - "name": "ohos.permission.MICROPHONE" - }, - { - "name": "ohos.permission.START_INVISIBLE_ABILITY" - }, - // audio - { - "name": "ohos.permission.WRITE_ACCESSIBILITY_CONFIG" - } - ] - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/resources/base/element/color.json b/unionpi_tiger/sample/app/factory/entry/src/main/resources/base/element/color.json deleted file mode 100644 index d66f9a7d..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/resources/base/element/string.json b/unionpi_tiger/sample/app/factory/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 2639a08a..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,165 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "factoryTest" - }, - { - "name": "entry_MainAbility", - "value": "eTSWLAN" - }, - { - "name": "description_mainability", - "value": "eTSWLAN Ability" - }, - { - "name": "cancel", - "value": "Cancel" - }, - { - "name": "sure", - "value": "Sure" - }, - { - "name": "wlan", - "value": "WLAN" - }, - { - "name": "available_wlan", - "value": "Available WLAN" - }, - { - "name": "connected", - "value": "Connected" - }, - { - "name": "about", - "value": "About" - }, - { - "name": "ip_address", - "value": "IP address:" - }, - { - "name": "gate_way", - "value": "Gateway:" - }, - { - "name": "net_mask", - "value": "Netmask:" - }, - { - "name": "primary_dns", - "value": "Primary Dns IP address:" - }, - { - "name": "second_dns", - "value": "Second DNS IP address:" - }, - { - "name": "server_ip", - "value": "DHCP server IP:" - }, - { - "name": "lease_duration", - "value": "IP address lease duration:" - }, - { - "name": "country_code", - "value": "Country code:" - }, - { - "name": "infrastructure_feature", - "value": "Infrastructure Feature:" - }, - { - "name": "ghz_feature", - "value": "5 GHz Feature:" - }, - { - "name": "gas_anqp_feature", - "value": "GAS/ANQP Feature:" - }, - { - "name": "wifi_direct", - "value": "WiFi-Direct Feature:" - }, - { - "name": "soft_ap", - "value": "Soft AP Feature:" - }, - { - "name": "wifi_aware", - "value": "WiFi Aware Feature:" - }, - { - "name": "encryption", - "value": "encrypted" - }, - { - "name": "open", - "value": "open" - }, - // bluetooth - { - "name": "bluetooth", - "value": "bluetooth" - }, - { - "name": "match", - "value": "pairing" - }, - { - "name": "match_request", - "value": "Bluetooth Pairing Request" - }, - { - "name": "available_device", - "value": "Available Devices" - }, - { - "name": "paired_device", - "value": "Paired Devices" - }, - { - "name": "discovery", - "value": "The device can be detected by nearby devices" - }, - { - "name": "confirm", - "value": "confirm" - }, - { - "name": "grant_permission", - "value": "After paired, access to the address book and call records is granted to the paired device" - }, - { - "name": "disconnect", - "value": "Disconnect?" - }, - { - "name": "grant_use_bluetooth", - "value": "Apply bluetooth permission" - }, - { - "name": "grant_discovery_bluetooth", - "value": "Discover bluetooth permission" - }, - { - "name": "grant_location", - "value": "Obtaining location permission" - }, - { - "name": "grant_manage_bluetooth", - "value": "Managing bluetooth permission" - } - ] -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/resources/base/media/about.png b/unionpi_tiger/sample/app/factory/entry/src/main/resources/base/media/about.png deleted file mode 100644 index 2613fc35..00000000 Binary files a/unionpi_tiger/sample/app/factory/entry/src/main/resources/base/media/about.png and /dev/null differ diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/resources/base/media/bg_play.png b/unionpi_tiger/sample/app/factory/entry/src/main/resources/base/media/bg_play.png deleted file mode 100644 index 8f330e1d..00000000 Binary files a/unionpi_tiger/sample/app/factory/entry/src/main/resources/base/media/bg_play.png and /dev/null differ diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/resources/base/media/bg_record.png b/unionpi_tiger/sample/app/factory/entry/src/main/resources/base/media/bg_record.png deleted file mode 100644 index 41c12ccb..00000000 Binary files a/unionpi_tiger/sample/app/factory/entry/src/main/resources/base/media/bg_record.png and /dev/null differ diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/resources/base/media/ic_back.png b/unionpi_tiger/sample/app/factory/entry/src/main/resources/base/media/ic_back.png deleted file mode 100644 index 099eee41..00000000 Binary files a/unionpi_tiger/sample/app/factory/entry/src/main/resources/base/media/ic_back.png and /dev/null differ diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/resources/base/media/ic_circled.svg b/unionpi_tiger/sample/app/factory/entry/src/main/resources/base/media/ic_circled.svg deleted file mode 100644 index 1d415be3..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/main/resources/base/media/ic_circled.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - ic_circled - - - - \ No newline at end of file diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/resources/base/media/ic_circled_filled.svg b/unionpi_tiger/sample/app/factory/entry/src/main/resources/base/media/ic_circled_filled.svg deleted file mode 100644 index 8f13b88a..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/main/resources/base/media/ic_circled_filled.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - ic_circled_filled - - - - \ No newline at end of file diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/resources/base/media/ic_pause.png b/unionpi_tiger/sample/app/factory/entry/src/main/resources/base/media/ic_pause.png deleted file mode 100644 index 4233656c..00000000 Binary files a/unionpi_tiger/sample/app/factory/entry/src/main/resources/base/media/ic_pause.png and /dev/null differ diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/resources/base/media/ic_play.png b/unionpi_tiger/sample/app/factory/entry/src/main/resources/base/media/ic_play.png deleted file mode 100644 index 3e89b712..00000000 Binary files a/unionpi_tiger/sample/app/factory/entry/src/main/resources/base/media/ic_play.png and /dev/null differ diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/resources/base/media/icon.png b/unionpi_tiger/sample/app/factory/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a88..00000000 Binary files a/unionpi_tiger/sample/app/factory/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/resources/base/media/lock.png b/unionpi_tiger/sample/app/factory/entry/src/main/resources/base/media/lock.png deleted file mode 100644 index b78d86d2..00000000 Binary files a/unionpi_tiger/sample/app/factory/entry/src/main/resources/base/media/lock.png and /dev/null differ diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/resources/base/media/pause.png b/unionpi_tiger/sample/app/factory/entry/src/main/resources/base/media/pause.png deleted file mode 100644 index 88dbcb51..00000000 Binary files a/unionpi_tiger/sample/app/factory/entry/src/main/resources/base/media/pause.png and /dev/null differ diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/resources/base/media/play.png b/unionpi_tiger/sample/app/factory/entry/src/main/resources/base/media/play.png deleted file mode 100644 index 12b58b31..00000000 Binary files a/unionpi_tiger/sample/app/factory/entry/src/main/resources/base/media/play.png and /dev/null differ diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/resources/base/media/rectangle.png b/unionpi_tiger/sample/app/factory/entry/src/main/resources/base/media/rectangle.png deleted file mode 100644 index c46bda81..00000000 Binary files a/unionpi_tiger/sample/app/factory/entry/src/main/resources/base/media/rectangle.png and /dev/null differ diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/resources/base/media/slider_time.png b/unionpi_tiger/sample/app/factory/entry/src/main/resources/base/media/slider_time.png deleted file mode 100644 index 5d04b153..00000000 Binary files a/unionpi_tiger/sample/app/factory/entry/src/main/resources/base/media/slider_time.png and /dev/null differ diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/resources/base/media/take_video_normal.svg b/unionpi_tiger/sample/app/factory/entry/src/main/resources/base/media/take_video_normal.svg deleted file mode 100644 index 550acc1f..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/main/resources/base/media/take_video_normal.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - ic/camera/shutter/take_video_normal - Created with Sketch. - - - - - \ No newline at end of file diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/resources/base/media/take_video_stop.svg b/unionpi_tiger/sample/app/factory/entry/src/main/resources/base/media/take_video_stop.svg deleted file mode 100644 index 0ab5b602..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/main/resources/base/media/take_video_stop.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - ic/camera/shutter/take_video_stop - Created with Sketch. - - - - - \ No newline at end of file diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/resources/base/media/wifi.png b/unionpi_tiger/sample/app/factory/entry/src/main/resources/base/media/wifi.png deleted file mode 100644 index 7017ea92..00000000 Binary files a/unionpi_tiger/sample/app/factory/entry/src/main/resources/base/media/wifi.png and /dev/null differ diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/resources/base/profile/main_pages.json b/unionpi_tiger/sample/app/factory/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 47b1f379..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "src": [ - "pages/Index", - "pages/testSample/information", - "pages/testSample/gradient", - "pages/testSample/fileRW", - "pages/testSample/wifi", - "pages/testSample/bluetooth", - "pages/testSample/audio", - "pages/Mic/Mic_index", - "pages/Camera/Camera_index", - "pages/testSample/sensor", - "pages/testSample/nfc", - "pages/testSample/touch", - "pages/testSample/led" - ] -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/resources/en_US/element/string.json b/unionpi_tiger/sample/app/factory/entry/src/main/resources/en_US/element/string.json deleted file mode 100644 index eecbafcd..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/main/resources/en_US/element/string.json +++ /dev/null @@ -1,166 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "factoryTest" - }, - { - "name": "entry_MainAbility", - "value": "eTSWLAN" - }, - { - "name": "description_mainability", - "value": "eTSWLAN Ability" - }, - { - "name": "cancel", - "value": "Cancel" - }, - { - "name": "wlan", - "value": "WLAN" - }, - { - "name": "sure", - "value": "Sure" - }, - { - "name": "available_wlan", - "value": "Available WLAN" - }, - { - "name": "connected", - "value": "Connected" - }, - { - "name": "about", - "value": "About" - }, - { - "name": "ip_address", - "value": "IP address:" - }, - { - "name": "gate_way", - "value": "Gateway:" - }, - { - "name": "net_mask", - "value": "Netmask:" - }, - { - "name": "primary_dns", - "value": "Primary Dns IP address:" - }, - { - "name": "second_dns", - "value": "Second DNS IP address:" - }, - { - "name": "server_ip", - "value": "DHCP server IP:" - }, - { - "name": "lease_duration", - "value": "IP address lease duration:" - }, - { - "name": "country_code", - "value": "Country code:" - }, - { - "name": "infrastructure_feature", - "value": "Infrastructure Feature:" - }, - { - "name": "ghz_feature", - "value": "5 GHz Feature:" - }, - { - "name": "gas_anqp_feature", - "value": "GAS/ANQP Feature:" - }, - { - "name": "wifi_direct", - "value": "WiFi-Direct Feature:" - }, - { - "name": "soft_ap", - "value": "Soft AP Feature:" - }, - { - "name": "wifi_aware", - "value": "WiFi Aware Feature:" - }, - { - "name": "encryption", - "value": "encrypted" - }, - { - "name": "open", - "value": "open" - }, - // bluetooth - { - "name": "bluetooth", - "value": "bluetooth" - }, - { - "name": "match", - "value": "pairing" - }, - { - "name": "match_request", - "value": "Bluetooth Pairing Request" - }, - { - "name": "available_device", - "value": "Available Devices" - }, - { - "name": "paired_device", - "value": "Paired Devices" - }, - { - "name": "discovery", - "value": "The device can be detected by nearby devices" - }, - { - "name": "confirm", - "value": "confirm" - }, - { - "name": "grant_permission", - "value": "After paired, access to the address book and call records is granted to the paired device" - }, - { - "name": "disconnect", - "value": "Disconnect?" - }, - { - "name": "grant_use_bluetooth", - "value": "Apply bluetooth permission" - }, - { - "name": "grant_discovery_bluetooth", - "value": "Discover bluetooth permission" - }, - { - "name": "grant_location", - "value": "Obtaining location permission" - }, - { - "name": "grant_manage_bluetooth", - "value": "Managing bluetooth permission" - } - - ] -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/resources/rawfile/EP11.mp4 b/unionpi_tiger/sample/app/factory/entry/src/main/resources/rawfile/EP11.mp4 deleted file mode 100644 index e0d410d4..00000000 Binary files a/unionpi_tiger/sample/app/factory/entry/src/main/resources/rawfile/EP11.mp4 and /dev/null differ diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/resources/rawfile/Technology.mp3 b/unionpi_tiger/sample/app/factory/entry/src/main/resources/rawfile/Technology.mp3 deleted file mode 100644 index 74122760..00000000 Binary files a/unionpi_tiger/sample/app/factory/entry/src/main/resources/rawfile/Technology.mp3 and /dev/null differ diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/resources/rawfile/Technology.wav b/unionpi_tiger/sample/app/factory/entry/src/main/resources/rawfile/Technology.wav deleted file mode 100644 index 2490cc49..00000000 Binary files a/unionpi_tiger/sample/app/factory/entry/src/main/resources/rawfile/Technology.wav and /dev/null differ diff --git a/unionpi_tiger/sample/app/factory/entry/src/main/resources/zh_CN/element/string.json b/unionpi_tiger/sample/app/factory/entry/src/main/resources/zh_CN/element/string.json deleted file mode 100644 index cc6479aa..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/main/resources/zh_CN/element/string.json +++ /dev/null @@ -1,157 +0,0 @@ -{ - "string": [ - { - "name": "EntryAbility_label", - "value": "factoryTest" - }, - { - "name": "module_desc", - "value": "模块描述" - }, - { - "name": "cancel", - "value": "取消" - }, - { - "name": "sure", - "value": "确定" - }, - { - "name": "wlan", - "value": "WLAN" - }, - { - "name": "available_wlan", - "value": "可用WLAN" - }, - { - "name": "connected", - "value": "已连接" - }, - { - "name": "about", - "value": "关于" - }, - { - "name": "ip_address", - "value": "IP地址:" - }, - { - "name": "gate_way", - "value": "网关:" - }, - { - "name": "net_mask", - "value": "掩码:" - }, - { - "name": "primary_dns", - "value": "主DNS服务器:" - }, - { - "name": "second_dns", - "value": "备DNS服务器:" - }, - { - "name": "server_ip", - "value": "DHCP服务端ip:" - }, - { - "name": "lease_duration", - "value": "IP地址租用时长:" - }, - { - "name": "country_code", - "value": "国家码:" - }, - { - "name": "infrastructure_feature", - "value": "基础结构模式特性:" - }, - { - "name": "ghz_feature", - "value": "5 GHz 宽带特性:" - }, - { - "name": "gas_anqp_feature", - "value": "GAS/ANQP特性:" - }, - { - "name": "wifi_direct", - "value": "WiFi-Direct特性:" - }, - { - "name": "soft_ap", - "value": "Soft AP特性:" - }, - { - "name": "wifi_aware", - "value": "WiFi Aware组网特性:" - }, - { - "name": "encryption", - "value": "加密" - }, - { - "name": "open", - "value": "开放" - }, - // bluetooth - { - "name": "MainAbility_label", - "value": "蓝牙" - }, - { - "name": "bluetooth", - "value": "蓝牙" - }, - { - "name": "match", - "value": "配对" - }, - { - "name": "match_request", - "value": "蓝牙配对请求" - }, - { - "name": "available_device", - "value": "可用设备" - }, - { - "name": "paired_device", - "value": "已配对的设备" - }, - { - "name": "discovery", - "value": "当前可被附近的设备发现" - }, - { - "name": "confirm", - "value": "确定" - }, - { - "name": "grant_permission", - "value": "配对之后,向所配对设备授予通讯录和通话记录的访问权限" - }, - { - "name": "disconnect", - "value": "断开连接?" - }, - { - "name": "grant_use_bluetooth", - "value": "应用蓝牙权限" - }, - { - "name": "grant_discovery_bluetooth", - "value": "发现蓝牙权限" - }, - { - "name": "grant_location", - "value": "获取位置权限" - }, - { - "name": "grant_manage_bluetooth", - "value": "管理蓝牙权限" - } - ] -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/factory/entry/src/ohosTest/ets/test/Ability.test.ets b/unionpi_tiger/sample/app/factory/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index e1038d7b..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import hilog from '@ohos.hilog'; -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' - -export default function abilityTest() { - describe('ActsAbilityTest', function () { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(function () { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }) - beforeEach(function () { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }) - afterEach(function () { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }) - afterAll(function () { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }) - /** - * @tc.number : assertContain_001 - * @tc.name : assertContain - * @tc.desc : test assertContain - */ - it('assertContain',0, function () { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - hilog.info(0x0000, 'testTag', '%{public}s', 'it begin'); - let a = 'abc' - let b = 'b' - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b) - expect(a).assertEqual(a) - }) - }) -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/factory/entry/src/ohosTest/ets/test/List.test.ets b/unionpi_tiger/sample/app/factory/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 505f2a83..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import abilityTest from './Ability.test' - -export default function testsuite() { - abilityTest() -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/factory/entry/src/ohosTest/ets/testability/TestAbility.ets b/unionpi_tiger/sample/app/factory/entry/src/ohosTest/ets/testability/TestAbility.ets deleted file mode 100644 index 29a61a95..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/ohosTest/ets/testability/TestAbility.ets +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import UIAbility from '@ohos.app.ability.UIAbility'; -import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; -import hilog from '@ohos.hilog'; -import { Hypium } from '@ohos/hypium'; -import testsuite from '../test/List.test'; -import window from '@ohos.window'; - -export default class TestAbility extends UIAbility { - onCreate(want, launchParam) { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onCreate'); - hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? ''); - hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:'+ JSON.stringify(launchParam) ?? ''); - var abilityDelegator: any - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments: any - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - hilog.info(0x0000, 'testTag', '%{public}s', 'start run testcase!!!'); - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - } - - onDestroy() { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage) { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageCreate'); - windowStage.loadContent('testability/pages/Index', (err, data) => { - if (err.code) { - hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); - return; - } - hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', - JSON.stringify(data) ?? ''); - }); - } - - onWindowStageDestroy() { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageDestroy'); - } - - onForeground() { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onForeground'); - } - - onBackground() { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onBackground'); - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/factory/entry/src/ohosTest/ets/testability/pages/Index.ets b/unionpi_tiger/sample/app/factory/entry/src/ohosTest/ets/testability/pages/Index.ets deleted file mode 100644 index 9fbc90dc..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/ohosTest/ets/testability/pages/Index.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import hilog from '@ohos.hilog'; - -@Entry -@Component -struct Index { - aboutToAppear() { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility index aboutToAppear'); - } - @State message: string = 'Hello World' - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - Button() { - Text('next page') - .fontSize(20) - .fontWeight(FontWeight.Bold) - }.type(ButtonType.Capsule) - .margin({ - top: 20 - }) - .backgroundColor('#0D9FFB') - .width('35%') - .height('5%') - .onClick(()=>{ - }) - } - .width('100%') - } - .height('100%') - } - } \ No newline at end of file diff --git a/unionpi_tiger/sample/app/factory/entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ts b/unionpi_tiger/sample/app/factory/entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ts deleted file mode 100644 index a86ebdf6..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ts +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import hilog from '@ohos.hilog'; -import TestRunner from '@ohos.application.testRunner'; -import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; - -var abilityDelegator = undefined -var abilityDelegatorArguments = undefined - -async function onAbilityCreateCallback() { - hilog.info(0x0000, 'testTag', '%{public}s', 'onAbilityCreateCallback'); -} - -async function addAbilityMonitorCallback(err: any) { - hilog.info(0x0000, 'testTag', 'addAbilityMonitorCallback : %{public}s', JSON.stringify(err) ?? ''); -} - -export default class OpenHarmonyTestRunner implements TestRunner { - constructor() { - } - - onPrepare() { - hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner OnPrepare '); - } - - async onRun() { - hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun run'); - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility' - let lMonitor = { - abilityName: testAbilityName, - onAbilityCreate: onAbilityCreateCallback, - }; - abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) - var cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName - var debug = abilityDelegatorArguments.parameters['-D'] - if (debug == 'true') - { - cmd += ' -D' - } - hilog.info(0x0000, 'testTag', 'cmd : %{public}s', cmd); - abilityDelegator.executeShellCommand(cmd, - (err: any, d: any) => { - hilog.info(0x0000, 'testTag', 'executeShellCommand : err : %{public}s', JSON.stringify(err) ?? ''); - hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.stdResult ?? ''); - hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.exitCode ?? ''); - }) - hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun end'); - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/factory/entry/src/ohosTest/module.json5 b/unionpi_tiger/sample/app/factory/entry/src/ohosTest/module.json5 deleted file mode 100644 index 81dcf1e0..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -{ - "module": { - "name": "entry_test", - "type": "feature", - "description": "$string:module_test_desc", - "mainElement": "TestAbility", - "deviceTypes": [ - "default" - ], - "deliveryWithInstall": true, - "installationFree": false, - "pages": "$profile:test_pages", - "abilities": [ - { - "name": "TestAbility", - "srcEntry": "./ets/testability/TestAbility.ets", - "description": "$string:TestAbility_desc", - "icon": "$media:icon", - "label": "$string:TestAbility_label", - "exported": true, - "startWindowIcon": "$media:icon", - "startWindowBackground": "$color:start_window_background", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - } - ] - } - ] - } -} diff --git a/unionpi_tiger/sample/app/factory/entry/src/ohosTest/resources/base/element/color.json b/unionpi_tiger/sample/app/factory/entry/src/ohosTest/resources/base/element/color.json deleted file mode 100644 index 3c712962..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/ohosTest/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/factory/entry/src/ohosTest/resources/base/element/string.json b/unionpi_tiger/sample/app/factory/entry/src/ohosTest/resources/base/element/string.json deleted file mode 100644 index 65d8fa5a..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/ohosTest/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_test_desc", - "value": "test ability description" - }, - { - "name": "TestAbility_desc", - "value": "the test ability" - }, - { - "name": "TestAbility_label", - "value": "test label" - } - ] -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/factory/entry/src/ohosTest/resources/base/media/icon.png b/unionpi_tiger/sample/app/factory/entry/src/ohosTest/resources/base/media/icon.png deleted file mode 100644 index ce307a88..00000000 Binary files a/unionpi_tiger/sample/app/factory/entry/src/ohosTest/resources/base/media/icon.png and /dev/null differ diff --git a/unionpi_tiger/sample/app/factory/entry/src/ohosTest/resources/base/profile/test_pages.json b/unionpi_tiger/sample/app/factory/entry/src/ohosTest/resources/base/profile/test_pages.json deleted file mode 100644 index b7e7343c..00000000 --- a/unionpi_tiger/sample/app/factory/entry/src/ohosTest/resources/base/profile/test_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "testability/pages/Index" - ] -} diff --git a/unionpi_tiger/sample/app/factory/hvigor/hvigor-config.json5 b/unionpi_tiger/sample/app/factory/hvigor/hvigor-config.json5 deleted file mode 100644 index 0663fa2b..00000000 --- a/unionpi_tiger/sample/app/factory/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -{ - "hvigorVersion": "2.4.2", - "dependencies": { - "@ohos/hvigor-ohos-plugin": "2.4.2" - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/factory/hvigor/hvigor-wrapper.js b/unionpi_tiger/sample/app/factory/hvigor/hvigor-wrapper.js deleted file mode 100644 index 994f2298..00000000 --- a/unionpi_tiger/sample/app/factory/hvigor/hvigor-wrapper.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict";var e=require("fs"),t=require("path"),n=require("os"),r=require("crypto"),u=require("child_process"),o=require("constants"),i=require("stream"),s=require("util"),c=require("assert"),a=require("tty"),l=require("zlib"),f=require("net");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var D=d(e),p=d(t),E=d(n),m=d(r),h=d(u),y=d(o),C=d(i),F=d(s),g=d(c),A=d(a),v=d(l),S=d(f),w="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},O={},b={},_={},B=w&&w.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_,"__esModule",{value:!0}),_.isMac=_.isLinux=_.isWindows=void 0;const P=B(E.default),k="Windows_NT",x="Linux",N="Darwin";_.isWindows=function(){return P.default.type()===k},_.isLinux=function(){return P.default.type()===x},_.isMac=function(){return P.default.type()===N};var I={},T=w&&w.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),R=w&&w.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),M=w&&w.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&T(t,e,n);return R(t,e),t};Object.defineProperty(I,"__esModule",{value:!0}),I.hash=void 0;const L=M(m.default);I.hash=function(e,t="md5"){return L.createHash(t).update(e,"utf-8").digest("hex")},function(e){var t=w&&w.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=w&&w.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=w&&w.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var u in e)"default"!==u&&Object.prototype.hasOwnProperty.call(e,u)&&t(r,e,u);return n(r,e),r};Object.defineProperty(e,"__esModule",{value:!0}),e.HVIGOR_BOOT_JS_FILE_PATH=e.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH=e.HVIGOR_PROJECT_DEPENDENCIES_HOME=e.HVIGOR_PROJECT_WRAPPER_HOME=e.HVIGOR_PROJECT_NAME=e.HVIGOR_PROJECT_ROOT_DIR=e.HVIGOR_PROJECT_CACHES_HOME=e.HVIGOR_PNPM_STORE_PATH=e.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH=e.HVIGOR_WRAPPER_TOOLS_HOME=e.HVIGOR_USER_HOME=e.DEFAULT_PACKAGE_JSON=e.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME=e.PNPM=e.HVIGOR=e.NPM_TOOL=e.PNPM_TOOL=e.HVIGOR_ENGINE_PACKAGE_NAME=void 0;const u=r(p.default),o=r(E.default),i=_,s=I;e.HVIGOR_ENGINE_PACKAGE_NAME="@ohos/hvigor",e.PNPM_TOOL=(0,i.isWindows)()?"pnpm.cmd":"pnpm",e.NPM_TOOL=(0,i.isWindows)()?"npm.cmd":"npm",e.HVIGOR="hvigor",e.PNPM="pnpm",e.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME="hvigor-config.json5",e.DEFAULT_PACKAGE_JSON="package.json",e.HVIGOR_USER_HOME=u.resolve(o.homedir(),".hvigor"),e.HVIGOR_WRAPPER_TOOLS_HOME=u.resolve(e.HVIGOR_USER_HOME,"wrapper","tools"),e.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH=u.resolve(e.HVIGOR_WRAPPER_TOOLS_HOME,"node_modules",".bin",e.PNPM_TOOL),e.HVIGOR_PNPM_STORE_PATH=u.resolve(e.HVIGOR_USER_HOME,"caches"),e.HVIGOR_PROJECT_CACHES_HOME=u.resolve(e.HVIGOR_USER_HOME,"project_caches"),e.HVIGOR_PROJECT_ROOT_DIR=process.cwd(),e.HVIGOR_PROJECT_NAME=u.basename((0,s.hash)(e.HVIGOR_PROJECT_ROOT_DIR)),e.HVIGOR_PROJECT_WRAPPER_HOME=u.resolve(e.HVIGOR_PROJECT_ROOT_DIR,e.HVIGOR),e.HVIGOR_PROJECT_DEPENDENCIES_HOME=u.resolve(e.HVIGOR_PROJECT_CACHES_HOME,e.HVIGOR_PROJECT_NAME,"workspace"),e.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH=u.resolve(e.HVIGOR_PROJECT_DEPENDENCIES_HOME,e.DEFAULT_PACKAGE_JSON),e.HVIGOR_BOOT_JS_FILE_PATH=u.resolve(e.HVIGOR_PROJECT_DEPENDENCIES_HOME,"node_modules","@ohos","hvigor","bin","hvigor.js")}(b);var j={},$={};Object.defineProperty($,"__esModule",{value:!0}),$.logInfoPrintConsole=$.logErrorAndExit=void 0,$.logErrorAndExit=function(e){e instanceof Error?console.error(e.message):console.error(e),process.exit(-1)},$.logInfoPrintConsole=function(e){console.log(e)};var H=w&&w.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),J=w&&w.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),G=w&&w.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&H(t,e,n);return J(t,e),t},V=w&&w.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(j,"__esModule",{value:!0}),j.isFileExists=j.offlinePluginConversion=j.executeCommand=j.getNpmPath=j.hasNpmPackInPaths=void 0;const U=h.default,W=G(p.default),z=b,K=$,q=V(D.default);j.hasNpmPackInPaths=function(e,t){try{return require.resolve(e,{paths:[...t]}),!0}catch(e){return!1}},j.getNpmPath=function(){const e=process.execPath;return W.join(W.dirname(e),z.NPM_TOOL)},j.executeCommand=function(e,t,n){0!==(0,U.spawnSync)(e,t,n).status&&(0,K.logErrorAndExit)(`Error: ${e} ${t} execute failed.See above for details.`)},j.offlinePluginConversion=function(e,t){return t.startsWith("file:")||t.endsWith(".tgz")?W.resolve(e,z.HVIGOR,t.replace("file:","")):t},j.isFileExists=function(e){return q.default.existsSync(e)&&q.default.statSync(e).isFile()},function(e){var t=w&&w.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=w&&w.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=w&&w.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var u in e)"default"!==u&&Object.prototype.hasOwnProperty.call(e,u)&&t(r,e,u);return n(r,e),r},u=w&&w.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.executeInstallPnpm=e.isPnpmAvailable=e.environmentHandler=e.checkNpmConifg=e.PNPM_VERSION=void 0;const o=r(D.default),i=b,s=j,c=r(p.default),a=$,l=h.default,f=u(E.default);e.PNPM_VERSION="7.30.0",e.checkNpmConifg=function(){const e=c.resolve(i.HVIGOR_PROJECT_ROOT_DIR,".npmrc"),t=c.resolve(f.default.homedir(),".npmrc");if((0,s.isFileExists)(e)||(0,s.isFileExists)(t))return;const n=(0,s.getNpmPath)(),r=(0,l.spawnSync)(n,["config","get","prefix"],{cwd:i.HVIGOR_PROJECT_ROOT_DIR});if(0!==r.status||!r.stdout)return void(0,a.logErrorAndExit)("Error: The hvigor depends on the npmrc file. Configure the npmrc file first.");const u=c.resolve(`${r.stdout}`.replace(/[\r\n]/gi,""),".npmrc");(0,s.isFileExists)(u)||(0,a.logErrorAndExit)("Error: The hvigor depends on the npmrc file. Configure the npmrc file first.")},e.environmentHandler=function(){process.env["npm_config_update-notifier"]="false"},e.isPnpmAvailable=function(){return!!o.existsSync(i.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH)&&(0,s.hasNpmPackInPaths)("pnpm",[i.HVIGOR_WRAPPER_TOOLS_HOME])},e.executeInstallPnpm=function(){(0,a.logInfoPrintConsole)(`Installing pnpm@${e.PNPM_VERSION}...`);const t=(0,s.getNpmPath)();!function(){const t=c.resolve(i.HVIGOR_WRAPPER_TOOLS_HOME,i.DEFAULT_PACKAGE_JSON);try{o.existsSync(i.HVIGOR_WRAPPER_TOOLS_HOME)||o.mkdirSync(i.HVIGOR_WRAPPER_TOOLS_HOME,{recursive:!0});const n={dependencies:{}};n.dependencies[i.PNPM]=e.PNPM_VERSION,o.writeFileSync(t,JSON.stringify(n))}catch(e){(0,a.logErrorAndExit)(`Error: EPERM: operation not permitted,create ${t} failed.`)}}(),(0,s.executeCommand)(t,["install","pnpm"],{cwd:i.HVIGOR_WRAPPER_TOOLS_HOME,stdio:["inherit","inherit","inherit"],env:process.env}),(0,a.logInfoPrintConsole)("Pnpm install success.")}}(O);var Y={},X={},Z={},Q={};Object.defineProperty(Q,"__esModule",{value:!0}),Q.Unicode=void 0;class ee{}Q.Unicode=ee,ee.Space_Separator=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,ee.ID_Start=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,ee.ID_Continue=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,Object.defineProperty(Z,"__esModule",{value:!0}),Z.JudgeUtil=void 0;const te=Q;Z.JudgeUtil=class{static isIgnoreChar(e){return"string"==typeof e&&("\t"===e||"\v"===e||"\f"===e||" "===e||" "===e||"\ufeff"===e||"\n"===e||"\r"===e||"\u2028"===e||"\u2029"===e)}static isSpaceSeparator(e){return"string"==typeof e&&te.Unicode.Space_Separator.test(e)}static isIdStartChar(e){return"string"==typeof e&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||"$"===e||"_"===e||te.Unicode.ID_Start.test(e))}static isIdContinueChar(e){return"string"==typeof e&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e>="0"&&e<="9"||"$"===e||"_"===e||"‌"===e||"‍"===e||te.Unicode.ID_Continue.test(e))}static isDigitWithoutZero(e){return/[1-9]/.test(e)}static isDigit(e){return"string"==typeof e&&/[0-9]/.test(e)}static isHexDigit(e){return"string"==typeof e&&/[0-9A-Fa-f]/.test(e)}};var ne={},re={fromCallback:function(e){return Object.defineProperty((function(...t){if("function"!=typeof t[t.length-1])return new Promise(((n,r)=>{e.call(this,...t,((e,t)=>null!=e?r(e):n(t)))}));e.apply(this,t)}),"name",{value:e.name})},fromPromise:function(e){return Object.defineProperty((function(...t){const n=t[t.length-1];if("function"!=typeof n)return e.apply(this,t);e.apply(this,t.slice(0,-1)).then((e=>n(null,e)),n)}),"name",{value:e.name})}},ue=y.default,oe=process.cwd,ie=null,se=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return ie||(ie=oe.call(process)),ie};try{process.cwd()}catch(e){}if("function"==typeof process.chdir){var ce=process.chdir;process.chdir=function(e){ie=null,ce.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,ce)}var ae=function(e){ue.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(e){e.lchmod=function(t,n,r){e.open(t,ue.O_WRONLY|ue.O_SYMLINK,n,(function(t,u){t?r&&r(t):e.fchmod(u,n,(function(t){e.close(u,(function(e){r&&r(t||e)}))}))}))},e.lchmodSync=function(t,n){var r,u=e.openSync(t,ue.O_WRONLY|ue.O_SYMLINK,n),o=!0;try{r=e.fchmodSync(u,n),o=!1}finally{if(o)try{e.closeSync(u)}catch(e){}else e.closeSync(u)}return r}}(e);e.lutimes||function(e){ue.hasOwnProperty("O_SYMLINK")&&e.futimes?(e.lutimes=function(t,n,r,u){e.open(t,ue.O_SYMLINK,(function(t,o){t?u&&u(t):e.futimes(o,n,r,(function(t){e.close(o,(function(e){u&&u(t||e)}))}))}))},e.lutimesSync=function(t,n,r){var u,o=e.openSync(t,ue.O_SYMLINK),i=!0;try{u=e.futimesSync(o,n,r),i=!1}finally{if(i)try{e.closeSync(o)}catch(e){}else e.closeSync(o)}return u}):e.futimes&&(e.lutimes=function(e,t,n,r){r&&process.nextTick(r)},e.lutimesSync=function(){})}(e);e.chown=r(e.chown),e.fchown=r(e.fchown),e.lchown=r(e.lchown),e.chmod=t(e.chmod),e.fchmod=t(e.fchmod),e.lchmod=t(e.lchmod),e.chownSync=u(e.chownSync),e.fchownSync=u(e.fchownSync),e.lchownSync=u(e.lchownSync),e.chmodSync=n(e.chmodSync),e.fchmodSync=n(e.fchmodSync),e.lchmodSync=n(e.lchmodSync),e.stat=o(e.stat),e.fstat=o(e.fstat),e.lstat=o(e.lstat),e.statSync=i(e.statSync),e.fstatSync=i(e.fstatSync),e.lstatSync=i(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(e,t,n){n&&process.nextTick(n)},e.lchmodSync=function(){});e.chown&&!e.lchown&&(e.lchown=function(e,t,n,r){r&&process.nextTick(r)},e.lchownSync=function(){});"win32"===se&&(e.rename="function"!=typeof e.rename?e.rename:function(t){function n(n,r,u){var o=Date.now(),i=0;t(n,r,(function s(c){if(c&&("EACCES"===c.code||"EPERM"===c.code||"EBUSY"===c.code)&&Date.now()-o<6e4)return setTimeout((function(){e.stat(r,(function(e,o){e&&"ENOENT"===e.code?t(n,r,s):u(c)}))}),i),void(i<100&&(i+=10));u&&u(c)}))}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.rename));function t(t){return t?function(n,r,u){return t.call(e,n,r,(function(e){s(e)&&(e=null),u&&u.apply(this,arguments)}))}:t}function n(t){return t?function(n,r){try{return t.call(e,n,r)}catch(e){if(!s(e))throw e}}:t}function r(t){return t?function(n,r,u,o){return t.call(e,n,r,u,(function(e){s(e)&&(e=null),o&&o.apply(this,arguments)}))}:t}function u(t){return t?function(n,r,u){try{return t.call(e,n,r,u)}catch(e){if(!s(e))throw e}}:t}function o(t){return t?function(n,r,u){function o(e,t){t&&(t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296)),u&&u.apply(this,arguments)}return"function"==typeof r&&(u=r,r=null),r?t.call(e,n,r,o):t.call(e,n,o)}:t}function i(t){return t?function(n,r){var u=r?t.call(e,n,r):t.call(e,n);return u&&(u.uid<0&&(u.uid+=4294967296),u.gid<0&&(u.gid+=4294967296)),u}:t}function s(e){return!e||("ENOSYS"===e.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==e.code&&"EPERM"!==e.code))}e.read="function"!=typeof e.read?e.read:function(t){function n(n,r,u,o,i,s){var c;if(s&&"function"==typeof s){var a=0;c=function(l,f,d){if(l&&"EAGAIN"===l.code&&a<10)return a++,t.call(e,n,r,u,o,i,c);s.apply(this,arguments)}}return t.call(e,n,r,u,o,i,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.read),e.readSync="function"!=typeof e.readSync?e.readSync:(c=e.readSync,function(t,n,r,u,o){for(var i=0;;)try{return c.call(e,t,n,r,u,o)}catch(e){if("EAGAIN"===e.code&&i<10){i++;continue}throw e}});var c};var le=C.default.Stream,fe=function(e){return{ReadStream:function t(n,r){if(!(this instanceof t))return new t(n,r);le.call(this);var u=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,r=r||{};for(var o=Object.keys(r),i=0,s=o.length;ithis.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick((function(){u._read()}));e.open(this.path,this.flags,this.mode,(function(e,t){if(e)return u.emit("error",e),void(u.readable=!1);u.fd=t,u.emit("open",t),u._read()}))},WriteStream:function t(n,r){if(!(this instanceof t))return new t(n,r);le.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var u=Object.keys(r),o=0,i=u.length;o= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}};var de=function(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Object)var t={__proto__:De(e)};else t=Object.create(null);return Object.getOwnPropertyNames(e).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t},De=Object.getPrototypeOf||function(e){return e.__proto__};var pe,Ee,me=D.default,he=ae,ye=fe,Ce=de,Fe=F.default;function ge(e,t){Object.defineProperty(e,pe,{get:function(){return t}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(pe=Symbol.for("graceful-fs.queue"),Ee=Symbol.for("graceful-fs.previous")):(pe="___graceful-fs.queue",Ee="___graceful-fs.previous");var Ae=function(){};if(Fe.debuglog?Ae=Fe.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Ae=function(){var e=Fe.format.apply(Fe,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: "),console.error(e)}),!me[pe]){var ve=w[pe]||[];ge(me,ve),me.close=function(e){function t(t,n){return e.call(me,t,(function(e){e||_e(),"function"==typeof n&&n.apply(this,arguments)}))}return Object.defineProperty(t,Ee,{value:e}),t}(me.close),me.closeSync=function(e){function t(t){e.apply(me,arguments),_e()}return Object.defineProperty(t,Ee,{value:e}),t}(me.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){Ae(me[pe]),g.default.equal(me[pe].length,0)}))}w[pe]||ge(w,me[pe]);var Se,we=Oe(Ce(me));function Oe(e){he(e),e.gracefulify=Oe,e.createReadStream=function(t,n){return new e.ReadStream(t,n)},e.createWriteStream=function(t,n){return new e.WriteStream(t,n)};var t=e.readFile;e.readFile=function(e,n,r){"function"==typeof n&&(r=n,n=null);return function e(n,r,u,o){return t(n,r,(function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof u&&u.apply(this,arguments):be([e,[n,r,u],t,o||Date.now(),Date.now()])}))}(e,n,r)};var n=e.writeFile;e.writeFile=function(e,t,r,u){"function"==typeof r&&(u=r,r=null);return function e(t,r,u,o,i){return n(t,r,u,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof o&&o.apply(this,arguments):be([e,[t,r,u,o],n,i||Date.now(),Date.now()])}))}(e,t,r,u)};var r=e.appendFile;r&&(e.appendFile=function(e,t,n,u){"function"==typeof n&&(u=n,n=null);return function e(t,n,u,o,i){return r(t,n,u,(function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?"function"==typeof o&&o.apply(this,arguments):be([e,[t,n,u,o],r,i||Date.now(),Date.now()])}))}(e,t,n,u)});var u=e.copyFile;u&&(e.copyFile=function(e,t,n,r){"function"==typeof n&&(r=n,n=0);return function e(t,n,r,o,i){return u(t,n,r,(function(u){!u||"EMFILE"!==u.code&&"ENFILE"!==u.code?"function"==typeof o&&o.apply(this,arguments):be([e,[t,n,r,o],u,i||Date.now(),Date.now()])}))}(e,t,n,r)});var o=e.readdir;e.readdir=function(e,t,n){"function"==typeof t&&(n=t,t=null);var r=i.test(process.version)?function(e,t,n,r){return o(e,u(e,t,n,r))}:function(e,t,n,r){return o(e,t,u(e,t,n,r))};return r(e,t,n);function u(e,t,n,u){return function(o,i){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?(i&&i.sort&&i.sort(),"function"==typeof n&&n.call(this,o,i)):be([r,[e,t,n],o,u||Date.now(),Date.now()])}}};var i=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var s=ye(e);d=s.ReadStream,D=s.WriteStream}var c=e.ReadStream;c&&(d.prototype=Object.create(c.prototype),d.prototype.open=function(){var e=this;E(e.path,e.flags,e.mode,(function(t,n){t?(e.autoClose&&e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n),e.read())}))});var a=e.WriteStream;a&&(D.prototype=Object.create(a.prototype),D.prototype.open=function(){var e=this;E(e.path,e.flags,e.mode,(function(t,n){t?(e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n))}))}),Object.defineProperty(e,"ReadStream",{get:function(){return d},set:function(e){d=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return D},set:function(e){D=e},enumerable:!0,configurable:!0});var l=d;Object.defineProperty(e,"FileReadStream",{get:function(){return l},set:function(e){l=e},enumerable:!0,configurable:!0});var f=D;function d(e,t){return this instanceof d?(c.apply(this,arguments),this):d.apply(Object.create(d.prototype),arguments)}function D(e,t){return this instanceof D?(a.apply(this,arguments),this):D.apply(Object.create(D.prototype),arguments)}Object.defineProperty(e,"FileWriteStream",{get:function(){return f},set:function(e){f=e},enumerable:!0,configurable:!0});var p=e.open;function E(e,t,n,r){return"function"==typeof n&&(r=n,n=null),function e(t,n,r,u,o){return p(t,n,r,(function(i,s){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?"function"==typeof u&&u.apply(this,arguments):be([e,[t,n,r,u],i,o||Date.now(),Date.now()])}))}(e,t,n,r)}return e.open=E,e}function be(e){Ae("ENQUEUE",e[0].name,e[1]),me[pe].push(e),Be()}function _e(){for(var e=Date.now(),t=0;t2&&(me[pe][t][3]=e,me[pe][t][4]=e);Be()}function Be(){if(clearTimeout(Se),Se=void 0,0!==me[pe].length){var e=me[pe].shift(),t=e[0],n=e[1],r=e[2],u=e[3],o=e[4];if(void 0===u)Ae("RETRY",t.name,n),t.apply(null,n);else if(Date.now()-u>=6e4){Ae("TIMEOUT",t.name,n);var i=n.pop();"function"==typeof i&&i.call(null,r)}else{var s=Date.now()-o,c=Math.max(o-u,1);s>=Math.min(1.2*c,100)?(Ae("RETRY",t.name,n),t.apply(null,n.concat([u]))):me[pe].push(e)}void 0===Se&&(Se=setTimeout(Be,0))}}process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!me.__patched&&(we=Oe(me),me.__patched=!0),function(e){const t=re.fromCallback,n=we,r=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((e=>"function"==typeof n[e]));Object.assign(e,n),r.forEach((r=>{e[r]=t(n[r])})),e.realpath.native=t(n.realpath.native),e.exists=function(e,t){return"function"==typeof t?n.exists(e,t):new Promise((t=>n.exists(e,t)))},e.read=function(e,t,r,u,o,i){return"function"==typeof i?n.read(e,t,r,u,o,i):new Promise(((i,s)=>{n.read(e,t,r,u,o,((e,t,n)=>{if(e)return s(e);i({bytesRead:t,buffer:n})}))}))},e.write=function(e,t,...r){return"function"==typeof r[r.length-1]?n.write(e,t,...r):new Promise(((u,o)=>{n.write(e,t,...r,((e,t,n)=>{if(e)return o(e);u({bytesWritten:t,buffer:n})}))}))},"function"==typeof n.writev&&(e.writev=function(e,t,...r){return"function"==typeof r[r.length-1]?n.writev(e,t,...r):new Promise(((u,o)=>{n.writev(e,t,...r,((e,t,n)=>{if(e)return o(e);u({bytesWritten:t,buffers:n})}))}))})}(ne);var Pe={},ke={};const xe=p.default;ke.checkPath=function(e){if("win32"===process.platform){if(/[<>:"|?*]/.test(e.replace(xe.parse(e).root,""))){const t=new Error(`Path contains invalid characters: ${e}`);throw t.code="EINVAL",t}}};const Ne=ne,{checkPath:Ie}=ke,Te=e=>"number"==typeof e?e:{mode:511,...e}.mode;Pe.makeDir=async(e,t)=>(Ie(e),Ne.mkdir(e,{mode:Te(t),recursive:!0})),Pe.makeDirSync=(e,t)=>(Ie(e),Ne.mkdirSync(e,{mode:Te(t),recursive:!0}));const Re=re.fromPromise,{makeDir:Me,makeDirSync:Le}=Pe,je=Re(Me);var $e={mkdirs:je,mkdirsSync:Le,mkdirp:je,mkdirpSync:Le,ensureDir:je,ensureDirSync:Le};const He=re.fromPromise,Je=ne;var Ge={pathExists:He((function(e){return Je.access(e).then((()=>!0)).catch((()=>!1))})),pathExistsSync:Je.existsSync};const Ve=we;var Ue=function(e,t,n,r){Ve.open(e,"r+",((e,u)=>{if(e)return r(e);Ve.futimes(u,t,n,(e=>{Ve.close(u,(t=>{r&&r(e||t)}))}))}))},We=function(e,t,n){const r=Ve.openSync(e,"r+");return Ve.futimesSync(r,t,n),Ve.closeSync(r)};const ze=ne,Ke=p.default,qe=F.default;function Ye(e,t,n){const r=n.dereference?e=>ze.stat(e,{bigint:!0}):e=>ze.lstat(e,{bigint:!0});return Promise.all([r(e),r(t).catch((e=>{if("ENOENT"===e.code)return null;throw e}))]).then((([e,t])=>({srcStat:e,destStat:t})))}function Xe(e,t){return t.ino&&t.dev&&t.ino===e.ino&&t.dev===e.dev}function Ze(e,t){const n=Ke.resolve(e).split(Ke.sep).filter((e=>e)),r=Ke.resolve(t).split(Ke.sep).filter((e=>e));return n.reduce(((e,t,n)=>e&&r[n]===t),!0)}function Qe(e,t,n){return`Cannot ${n} '${e}' to a subdirectory of itself, '${t}'.`}var et={checkPaths:function(e,t,n,r,u){qe.callbackify(Ye)(e,t,r,((r,o)=>{if(r)return u(r);const{srcStat:i,destStat:s}=o;if(s){if(Xe(i,s)){const r=Ke.basename(e),o=Ke.basename(t);return"move"===n&&r!==o&&r.toLowerCase()===o.toLowerCase()?u(null,{srcStat:i,destStat:s,isChangingCase:!0}):u(new Error("Source and destination must not be the same."))}if(i.isDirectory()&&!s.isDirectory())return u(new Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`));if(!i.isDirectory()&&s.isDirectory())return u(new Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`))}return i.isDirectory()&&Ze(e,t)?u(new Error(Qe(e,t,n))):u(null,{srcStat:i,destStat:s})}))},checkPathsSync:function(e,t,n,r){const{srcStat:u,destStat:o}=function(e,t,n){let r;const u=n.dereference?e=>ze.statSync(e,{bigint:!0}):e=>ze.lstatSync(e,{bigint:!0}),o=u(e);try{r=u(t)}catch(e){if("ENOENT"===e.code)return{srcStat:o,destStat:null};throw e}return{srcStat:o,destStat:r}}(e,t,r);if(o){if(Xe(u,o)){const r=Ke.basename(e),i=Ke.basename(t);if("move"===n&&r!==i&&r.toLowerCase()===i.toLowerCase())return{srcStat:u,destStat:o,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(u.isDirectory()&&!o.isDirectory())throw new Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`);if(!u.isDirectory()&&o.isDirectory())throw new Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`)}if(u.isDirectory()&&Ze(e,t))throw new Error(Qe(e,t,n));return{srcStat:u,destStat:o}},checkParentPaths:function e(t,n,r,u,o){const i=Ke.resolve(Ke.dirname(t)),s=Ke.resolve(Ke.dirname(r));if(s===i||s===Ke.parse(s).root)return o();ze.stat(s,{bigint:!0},((i,c)=>i?"ENOENT"===i.code?o():o(i):Xe(n,c)?o(new Error(Qe(t,r,u))):e(t,n,s,u,o)))},checkParentPathsSync:function e(t,n,r,u){const o=Ke.resolve(Ke.dirname(t)),i=Ke.resolve(Ke.dirname(r));if(i===o||i===Ke.parse(i).root)return;let s;try{s=ze.statSync(i,{bigint:!0})}catch(e){if("ENOENT"===e.code)return;throw e}if(Xe(n,s))throw new Error(Qe(t,r,u));return e(t,n,i,u)},isSrcSubdir:Ze,areIdentical:Xe};const tt=we,nt=p.default,rt=$e.mkdirs,ut=Ge.pathExists,ot=Ue,it=et;function st(e,t,n,r,u){const o=nt.dirname(n);ut(o,((i,s)=>i?u(i):s?at(e,t,n,r,u):void rt(o,(o=>o?u(o):at(e,t,n,r,u)))))}function ct(e,t,n,r,u,o){Promise.resolve(u.filter(n,r)).then((i=>i?e(t,n,r,u,o):o()),(e=>o(e)))}function at(e,t,n,r,u){(r.dereference?tt.stat:tt.lstat)(t,((o,i)=>o?u(o):i.isDirectory()?function(e,t,n,r,u,o){return t?Dt(n,r,u,o):function(e,t,n,r,u){tt.mkdir(n,(o=>{if(o)return u(o);Dt(t,n,r,(t=>t?u(t):dt(n,e,u)))}))}(e.mode,n,r,u,o)}(i,e,t,n,r,u):i.isFile()||i.isCharacterDevice()||i.isBlockDevice()?function(e,t,n,r,u,o){return t?function(e,t,n,r,u){if(!r.overwrite)return r.errorOnExist?u(new Error(`'${n}' already exists`)):u();tt.unlink(n,(o=>o?u(o):lt(e,t,n,r,u)))}(e,n,r,u,o):lt(e,n,r,u,o)}(i,e,t,n,r,u):i.isSymbolicLink()?function(e,t,n,r,u){tt.readlink(t,((t,o)=>t?u(t):(r.dereference&&(o=nt.resolve(process.cwd(),o)),e?void tt.readlink(n,((t,i)=>t?"EINVAL"===t.code||"UNKNOWN"===t.code?tt.symlink(o,n,u):u(t):(r.dereference&&(i=nt.resolve(process.cwd(),i)),it.isSrcSubdir(o,i)?u(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${i}'.`)):e.isDirectory()&&it.isSrcSubdir(i,o)?u(new Error(`Cannot overwrite '${i}' with '${o}'.`)):function(e,t,n){tt.unlink(t,(r=>r?n(r):tt.symlink(e,t,n)))}(o,n,u)))):tt.symlink(o,n,u))))}(e,t,n,r,u):i.isSocket()?u(new Error(`Cannot copy a socket file: ${t}`)):i.isFIFO()?u(new Error(`Cannot copy a FIFO pipe: ${t}`)):u(new Error(`Unknown file: ${t}`))))}function lt(e,t,n,r,u){tt.copyFile(t,n,(o=>o?u(o):r.preserveTimestamps?function(e,t,n,r){if(function(e){return 0==(128&e)}(e))return function(e,t,n){return dt(e,128|t,n)}(n,e,(u=>u?r(u):ft(e,t,n,r)));return ft(e,t,n,r)}(e.mode,t,n,u):dt(n,e.mode,u)))}function ft(e,t,n,r){!function(e,t,n){tt.stat(e,((e,r)=>e?n(e):ot(t,r.atime,r.mtime,n)))}(t,n,(t=>t?r(t):dt(n,e,r)))}function dt(e,t,n){return tt.chmod(e,t,n)}function Dt(e,t,n,r){tt.readdir(e,((u,o)=>u?r(u):pt(o,e,t,n,r)))}function pt(e,t,n,r,u){const o=e.pop();return o?function(e,t,n,r,u,o){const i=nt.join(n,t),s=nt.join(r,t);it.checkPaths(i,s,"copy",u,((t,c)=>{if(t)return o(t);const{destStat:a}=c;!function(e,t,n,r,u){r.filter?ct(at,e,t,n,r,u):at(e,t,n,r,u)}(a,i,s,u,(t=>t?o(t):pt(e,n,r,u,o)))}))}(e,o,t,n,r,u):u()}var Et=function(e,t,n,r){"function"!=typeof n||r?"function"==typeof n&&(n={filter:n}):(r=n,n={}),r=r||function(){},(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269"),it.checkPaths(e,t,"copy",n,((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;it.checkParentPaths(e,i,t,"copy",(u=>u?r(u):n.filter?ct(st,s,e,t,n,r):st(s,e,t,n,r)))}))};const mt=we,ht=p.default,yt=$e.mkdirsSync,Ct=We,Ft=et;function gt(e,t,n,r){const u=(r.dereference?mt.statSync:mt.lstatSync)(t);if(u.isDirectory())return function(e,t,n,r,u){return t?St(n,r,u):function(e,t,n,r){return mt.mkdirSync(n),St(t,n,r),vt(n,e)}(e.mode,n,r,u)}(u,e,t,n,r);if(u.isFile()||u.isCharacterDevice()||u.isBlockDevice())return function(e,t,n,r,u){return t?function(e,t,n,r){if(r.overwrite)return mt.unlinkSync(n),At(e,t,n,r);if(r.errorOnExist)throw new Error(`'${n}' already exists`)}(e,n,r,u):At(e,n,r,u)}(u,e,t,n,r);if(u.isSymbolicLink())return function(e,t,n,r){let u=mt.readlinkSync(t);r.dereference&&(u=ht.resolve(process.cwd(),u));if(e){let e;try{e=mt.readlinkSync(n)}catch(e){if("EINVAL"===e.code||"UNKNOWN"===e.code)return mt.symlinkSync(u,n);throw e}if(r.dereference&&(e=ht.resolve(process.cwd(),e)),Ft.isSrcSubdir(u,e))throw new Error(`Cannot copy '${u}' to a subdirectory of itself, '${e}'.`);if(mt.statSync(n).isDirectory()&&Ft.isSrcSubdir(e,u))throw new Error(`Cannot overwrite '${e}' with '${u}'.`);return function(e,t){return mt.unlinkSync(t),mt.symlinkSync(e,t)}(u,n)}return mt.symlinkSync(u,n)}(e,t,n,r);if(u.isSocket())throw new Error(`Cannot copy a socket file: ${t}`);if(u.isFIFO())throw new Error(`Cannot copy a FIFO pipe: ${t}`);throw new Error(`Unknown file: ${t}`)}function At(e,t,n,r){return mt.copyFileSync(t,n),r.preserveTimestamps&&function(e,t,n){(function(e){return 0==(128&e)})(e)&&function(e,t){vt(e,128|t)}(n,e);(function(e,t){const n=mt.statSync(e);Ct(t,n.atime,n.mtime)})(t,n)}(e.mode,t,n),vt(n,e.mode)}function vt(e,t){return mt.chmodSync(e,t)}function St(e,t,n){mt.readdirSync(e).forEach((r=>function(e,t,n,r){const u=ht.join(t,e),o=ht.join(n,e),{destStat:i}=Ft.checkPathsSync(u,o,"copy",r);return function(e,t,n,r){if(!r.filter||r.filter(t,n))return gt(e,t,n,r)}(i,u,o,r)}(r,e,t,n)))}var wt=function(e,t,n){"function"==typeof n&&(n={filter:n}),(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269");const{srcStat:r,destStat:u}=Ft.checkPathsSync(e,t,"copy",n);return Ft.checkParentPathsSync(e,r,t,"copy"),function(e,t,n,r){if(r.filter&&!r.filter(t,n))return;const u=ht.dirname(n);mt.existsSync(u)||yt(u);return gt(e,t,n,r)}(u,e,t,n)};var Ot={copy:(0,re.fromCallback)(Et),copySync:wt};const bt=we,_t=p.default,Bt=g.default,Pt="win32"===process.platform;function kt(e){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((t=>{e[t]=e[t]||bt[t],e[t+="Sync"]=e[t]||bt[t]})),e.maxBusyTries=e.maxBusyTries||3}function xt(e,t,n){let r=0;"function"==typeof t&&(n=t,t={}),Bt(e,"rimraf: missing path"),Bt.strictEqual(typeof e,"string","rimraf: path should be a string"),Bt.strictEqual(typeof n,"function","rimraf: callback function required"),Bt(t,"rimraf: invalid options argument provided"),Bt.strictEqual(typeof t,"object","rimraf: options should be object"),kt(t),Nt(e,t,(function u(o){if(o){if(("EBUSY"===o.code||"ENOTEMPTY"===o.code||"EPERM"===o.code)&&rNt(e,t,u)),100*r)}"ENOENT"===o.code&&(o=null)}n(o)}))}function Nt(e,t,n){Bt(e),Bt(t),Bt("function"==typeof n),t.lstat(e,((r,u)=>r&&"ENOENT"===r.code?n(null):r&&"EPERM"===r.code&&Pt?It(e,t,r,n):u&&u.isDirectory()?Rt(e,t,r,n):void t.unlink(e,(r=>{if(r){if("ENOENT"===r.code)return n(null);if("EPERM"===r.code)return Pt?It(e,t,r,n):Rt(e,t,r,n);if("EISDIR"===r.code)return Rt(e,t,r,n)}return n(r)}))))}function It(e,t,n,r){Bt(e),Bt(t),Bt("function"==typeof r),t.chmod(e,438,(u=>{u?r("ENOENT"===u.code?null:n):t.stat(e,((u,o)=>{u?r("ENOENT"===u.code?null:n):o.isDirectory()?Rt(e,t,n,r):t.unlink(e,r)}))}))}function Tt(e,t,n){let r;Bt(e),Bt(t);try{t.chmodSync(e,438)}catch(e){if("ENOENT"===e.code)return;throw n}try{r=t.statSync(e)}catch(e){if("ENOENT"===e.code)return;throw n}r.isDirectory()?Lt(e,t,n):t.unlinkSync(e)}function Rt(e,t,n,r){Bt(e),Bt(t),Bt("function"==typeof r),t.rmdir(e,(u=>{!u||"ENOTEMPTY"!==u.code&&"EEXIST"!==u.code&&"EPERM"!==u.code?u&&"ENOTDIR"===u.code?r(n):r(u):function(e,t,n){Bt(e),Bt(t),Bt("function"==typeof n),t.readdir(e,((r,u)=>{if(r)return n(r);let o,i=u.length;if(0===i)return t.rmdir(e,n);u.forEach((r=>{xt(_t.join(e,r),t,(r=>{if(!o)return r?n(o=r):void(0==--i&&t.rmdir(e,n))}))}))}))}(e,t,r)}))}function Mt(e,t){let n;kt(t=t||{}),Bt(e,"rimraf: missing path"),Bt.strictEqual(typeof e,"string","rimraf: path should be a string"),Bt(t,"rimraf: missing options"),Bt.strictEqual(typeof t,"object","rimraf: options should be object");try{n=t.lstatSync(e)}catch(n){if("ENOENT"===n.code)return;"EPERM"===n.code&&Pt&&Tt(e,t,n)}try{n&&n.isDirectory()?Lt(e,t,null):t.unlinkSync(e)}catch(n){if("ENOENT"===n.code)return;if("EPERM"===n.code)return Pt?Tt(e,t,n):Lt(e,t,n);if("EISDIR"!==n.code)throw n;Lt(e,t,n)}}function Lt(e,t,n){Bt(e),Bt(t);try{t.rmdirSync(e)}catch(r){if("ENOTDIR"===r.code)throw n;if("ENOTEMPTY"===r.code||"EEXIST"===r.code||"EPERM"===r.code)!function(e,t){if(Bt(e),Bt(t),t.readdirSync(e).forEach((n=>Mt(_t.join(e,n),t))),!Pt){return t.rmdirSync(e,t)}{const n=Date.now();do{try{return t.rmdirSync(e,t)}catch{}}while(Date.now()-n<500)}}(e,t);else if("ENOENT"!==r.code)throw r}}var jt=xt;xt.sync=Mt;const $t=we,Ht=re.fromCallback,Jt=jt;var Gt={remove:Ht((function(e,t){if($t.rm)return $t.rm(e,{recursive:!0,force:!0},t);Jt(e,t)})),removeSync:function(e){if($t.rmSync)return $t.rmSync(e,{recursive:!0,force:!0});Jt.sync(e)}};const Vt=re.fromPromise,Ut=ne,Wt=p.default,zt=$e,Kt=Gt,qt=Vt((async function(e){let t;try{t=await Ut.readdir(e)}catch{return zt.mkdirs(e)}return Promise.all(t.map((t=>Kt.remove(Wt.join(e,t)))))}));function Yt(e){let t;try{t=Ut.readdirSync(e)}catch{return zt.mkdirsSync(e)}t.forEach((t=>{t=Wt.join(e,t),Kt.removeSync(t)}))}var Xt={emptyDirSync:Yt,emptydirSync:Yt,emptyDir:qt,emptydir:qt};const Zt=re.fromCallback,Qt=p.default,en=we,tn=$e;var nn={createFile:Zt((function(e,t){function n(){en.writeFile(e,"",(e=>{if(e)return t(e);t()}))}en.stat(e,((r,u)=>{if(!r&&u.isFile())return t();const o=Qt.dirname(e);en.stat(o,((e,r)=>{if(e)return"ENOENT"===e.code?tn.mkdirs(o,(e=>{if(e)return t(e);n()})):t(e);r.isDirectory()?n():en.readdir(o,(e=>{if(e)return t(e)}))}))}))})),createFileSync:function(e){let t;try{t=en.statSync(e)}catch{}if(t&&t.isFile())return;const n=Qt.dirname(e);try{en.statSync(n).isDirectory()||en.readdirSync(n)}catch(e){if(!e||"ENOENT"!==e.code)throw e;tn.mkdirsSync(n)}en.writeFileSync(e,"")}};const rn=re.fromCallback,un=p.default,on=we,sn=$e,cn=Ge.pathExists,{areIdentical:an}=et;var ln={createLink:rn((function(e,t,n){function r(e,t){on.link(e,t,(e=>{if(e)return n(e);n(null)}))}on.lstat(t,((u,o)=>{on.lstat(e,((u,i)=>{if(u)return u.message=u.message.replace("lstat","ensureLink"),n(u);if(o&&an(i,o))return n(null);const s=un.dirname(t);cn(s,((u,o)=>u?n(u):o?r(e,t):void sn.mkdirs(s,(u=>{if(u)return n(u);r(e,t)}))))}))}))})),createLinkSync:function(e,t){let n;try{n=on.lstatSync(t)}catch{}try{const t=on.lstatSync(e);if(n&&an(t,n))return}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}const r=un.dirname(t);return on.existsSync(r)||sn.mkdirsSync(r),on.linkSync(e,t)}};const fn=p.default,dn=we,Dn=Ge.pathExists;var pn={symlinkPaths:function(e,t,n){if(fn.isAbsolute(e))return dn.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:e})));{const r=fn.dirname(t),u=fn.join(r,e);return Dn(u,((t,o)=>t?n(t):o?n(null,{toCwd:u,toDst:e}):dn.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:fn.relative(r,e)})))))}},symlinkPathsSync:function(e,t){let n;if(fn.isAbsolute(e)){if(n=dn.existsSync(e),!n)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}{const r=fn.dirname(t),u=fn.join(r,e);if(n=dn.existsSync(u),n)return{toCwd:u,toDst:e};if(n=dn.existsSync(e),!n)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:fn.relative(r,e)}}}};const En=we;var mn={symlinkType:function(e,t,n){if(n="function"==typeof t?t:n,t="function"!=typeof t&&t)return n(null,t);En.lstat(e,((e,r)=>{if(e)return n(null,"file");t=r&&r.isDirectory()?"dir":"file",n(null,t)}))},symlinkTypeSync:function(e,t){let n;if(t)return t;try{n=En.lstatSync(e)}catch{return"file"}return n&&n.isDirectory()?"dir":"file"}};const hn=re.fromCallback,yn=p.default,Cn=ne,Fn=$e.mkdirs,gn=$e.mkdirsSync,An=pn.symlinkPaths,vn=pn.symlinkPathsSync,Sn=mn.symlinkType,wn=mn.symlinkTypeSync,On=Ge.pathExists,{areIdentical:bn}=et;function _n(e,t,n,r){An(e,t,((u,o)=>{if(u)return r(u);e=o.toDst,Sn(o.toCwd,n,((n,u)=>{if(n)return r(n);const o=yn.dirname(t);On(o,((n,i)=>n?r(n):i?Cn.symlink(e,t,u,r):void Fn(o,(n=>{if(n)return r(n);Cn.symlink(e,t,u,r)}))))}))}))}var Bn={createSymlink:hn((function(e,t,n,r){r="function"==typeof n?n:r,n="function"!=typeof n&&n,Cn.lstat(t,((u,o)=>{!u&&o.isSymbolicLink()?Promise.all([Cn.stat(e),Cn.stat(t)]).then((([u,o])=>{if(bn(u,o))return r(null);_n(e,t,n,r)})):_n(e,t,n,r)}))})),createSymlinkSync:function(e,t,n){let r;try{r=Cn.lstatSync(t)}catch{}if(r&&r.isSymbolicLink()){const n=Cn.statSync(e),r=Cn.statSync(t);if(bn(n,r))return}const u=vn(e,t);e=u.toDst,n=wn(u.toCwd,n);const o=yn.dirname(t);return Cn.existsSync(o)||gn(o),Cn.symlinkSync(e,t,n)}};const{createFile:Pn,createFileSync:kn}=nn,{createLink:xn,createLinkSync:Nn}=ln,{createSymlink:In,createSymlinkSync:Tn}=Bn;var Rn={createFile:Pn,createFileSync:kn,ensureFile:Pn,ensureFileSync:kn,createLink:xn,createLinkSync:Nn,ensureLink:xn,ensureLinkSync:Nn,createSymlink:In,createSymlinkSync:Tn,ensureSymlink:In,ensureSymlinkSync:Tn};var Mn={stringify:function(e,{EOL:t="\n",finalEOL:n=!0,replacer:r=null,spaces:u}={}){const o=n?t:"";return JSON.stringify(e,r,u).replace(/\n/g,t)+o},stripBom:function(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e.replace(/^\uFEFF/,"")}};let Ln;try{Ln=we}catch(e){Ln=D.default}const jn=re,{stringify:$n,stripBom:Hn}=Mn;const Jn=jn.fromPromise((async function(e,t={}){"string"==typeof t&&(t={encoding:t});const n=t.fs||Ln,r=!("throws"in t)||t.throws;let u,o=await jn.fromCallback(n.readFile)(e,t);o=Hn(o);try{u=JSON.parse(o,t?t.reviver:null)}catch(t){if(r)throw t.message=`${e}: ${t.message}`,t;return null}return u}));const Gn=jn.fromPromise((async function(e,t,n={}){const r=n.fs||Ln,u=$n(t,n);await jn.fromCallback(r.writeFile)(e,u,n)}));const Vn={readFile:Jn,readFileSync:function(e,t={}){"string"==typeof t&&(t={encoding:t});const n=t.fs||Ln,r=!("throws"in t)||t.throws;try{let r=n.readFileSync(e,t);return r=Hn(r),JSON.parse(r,t.reviver)}catch(t){if(r)throw t.message=`${e}: ${t.message}`,t;return null}},writeFile:Gn,writeFileSync:function(e,t,n={}){const r=n.fs||Ln,u=$n(t,n);return r.writeFileSync(e,u,n)}};var Un={readJson:Vn.readFile,readJsonSync:Vn.readFileSync,writeJson:Vn.writeFile,writeJsonSync:Vn.writeFileSync};const Wn=re.fromCallback,zn=we,Kn=p.default,qn=$e,Yn=Ge.pathExists;var Xn={outputFile:Wn((function(e,t,n,r){"function"==typeof n&&(r=n,n="utf8");const u=Kn.dirname(e);Yn(u,((o,i)=>o?r(o):i?zn.writeFile(e,t,n,r):void qn.mkdirs(u,(u=>{if(u)return r(u);zn.writeFile(e,t,n,r)}))))})),outputFileSync:function(e,...t){const n=Kn.dirname(e);if(zn.existsSync(n))return zn.writeFileSync(e,...t);qn.mkdirsSync(n),zn.writeFileSync(e,...t)}};const{stringify:Zn}=Mn,{outputFile:Qn}=Xn;var er=async function(e,t,n={}){const r=Zn(t,n);await Qn(e,r,n)};const{stringify:tr}=Mn,{outputFileSync:nr}=Xn;var rr=function(e,t,n){const r=tr(t,n);nr(e,r,n)};const ur=re.fromPromise,or=Un;or.outputJson=ur(er),or.outputJsonSync=rr,or.outputJSON=or.outputJson,or.outputJSONSync=or.outputJsonSync,or.writeJSON=or.writeJson,or.writeJSONSync=or.writeJsonSync,or.readJSON=or.readJson,or.readJSONSync=or.readJsonSync;var ir=or;const sr=we,cr=p.default,ar=Ot.copy,lr=Gt.remove,fr=$e.mkdirp,dr=Ge.pathExists,Dr=et;function pr(e,t,n,r,u){return r?Er(e,t,n,u):n?lr(t,(r=>r?u(r):Er(e,t,n,u))):void dr(t,((r,o)=>r?u(r):o?u(new Error("dest already exists.")):Er(e,t,n,u)))}function Er(e,t,n,r){sr.rename(e,t,(u=>u?"EXDEV"!==u.code?r(u):function(e,t,n,r){const u={overwrite:n,errorOnExist:!0};ar(e,t,u,(t=>t?r(t):lr(e,r)))}(e,t,n,r):r()))}var mr=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=n.overwrite||n.clobber||!1;Dr.checkPaths(e,t,"move",n,((n,o)=>{if(n)return r(n);const{srcStat:i,isChangingCase:s=!1}=o;Dr.checkParentPaths(e,i,t,"move",(n=>n?r(n):function(e){const t=cr.dirname(e);return cr.parse(t).root===t}(t)?pr(e,t,u,s,r):void fr(cr.dirname(t),(n=>n?r(n):pr(e,t,u,s,r)))))}))};const hr=we,yr=p.default,Cr=Ot.copySync,Fr=Gt.removeSync,gr=$e.mkdirpSync,Ar=et;function vr(e,t,n){try{hr.renameSync(e,t)}catch(r){if("EXDEV"!==r.code)throw r;return function(e,t,n){const r={overwrite:n,errorOnExist:!0};return Cr(e,t,r),Fr(e)}(e,t,n)}}var Sr=function(e,t,n){const r=(n=n||{}).overwrite||n.clobber||!1,{srcStat:u,isChangingCase:o=!1}=Ar.checkPathsSync(e,t,"move",n);return Ar.checkParentPathsSync(e,u,t,"move"),function(e){const t=yr.dirname(e);return yr.parse(t).root===t}(t)||gr(yr.dirname(t)),function(e,t,n,r){if(r)return vr(e,t,n);if(n)return Fr(t),vr(e,t,n);if(hr.existsSync(t))throw new Error("dest already exists.");return vr(e,t,n)}(e,t,r,o)};var wr,Or,br,_r,Br,Pr={move:(0,re.fromCallback)(mr),moveSync:Sr},kr={...ne,...Ot,...Xt,...Rn,...ir,...$e,...Pr,...Xn,...Ge,...Gt},xr={},Nr={exports:{}},Ir={exports:{}};function Tr(){if(Or)return wr;Or=1;var e=1e3,t=60*e,n=60*t,r=24*n,u=7*r,o=365.25*r;function i(e,t,n,r){var u=t>=1.5*n;return Math.round(e/n)+" "+r+(u?"s":"")}return wr=function(s,c){c=c||{};var a=typeof s;if("string"===a&&s.length>0)return function(i){if((i=String(i)).length>100)return;var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(!s)return;var c=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*u;case"days":case"day":case"d":return c*r;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*t;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(s);if("number"===a&&isFinite(s))return c.long?function(u){var o=Math.abs(u);if(o>=r)return i(u,o,r,"day");if(o>=n)return i(u,o,n,"hour");if(o>=t)return i(u,o,t,"minute");if(o>=e)return i(u,o,e,"second");return u+" ms"}(s):function(u){var o=Math.abs(u);if(o>=r)return Math.round(u/r)+"d";if(o>=n)return Math.round(u/n)+"h";if(o>=t)return Math.round(u/t)+"m";if(o>=e)return Math.round(u/e)+"s";return u+"ms"}(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))}}function Rr(){if(_r)return br;return _r=1,br=function(e){function t(e){let r,u,o,i=null;function s(...e){if(!s.enabled)return;const n=s,u=Number(new Date),o=u-(r||u);n.diff=o,n.prev=r,n.curr=u,r=u,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,u)=>{if("%%"===r)return"%";i++;const o=t.formatters[u];if("function"==typeof o){const t=e[i];r=o.call(n,t),e.splice(i,1),i--}return r})),t.formatArgs.call(n,e);(n.log||t.log).apply(n,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=n,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==i?i:(u!==t.namespaces&&(u=t.namespaces,o=t.enabled(e)),o),set:e=>{i=e}}),"function"==typeof t.init&&t.init(s),s}function n(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function r(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(r),...t.skips.map(r).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),u=r.length;for(n=0;n{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t{const n=e.startsWith("-")?"":1===e.length?"-":"--",r=t.indexOf(n+e),u=t.indexOf("--");return-1!==r&&(-1===u||r{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=function(){if($r)return jr;$r=1;const e=E.default,t=A.default,n=Vr(),{env:r}=process;let u;function o(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function i(t,o){if(0===u)return 0;if(n("color=16m")||n("color=full")||n("color=truecolor"))return 3;if(n("color=256"))return 2;if(t&&!o&&void 0===u)return 0;const i=u||0;if("dumb"===r.TERM)return i;if("win32"===process.platform){const t=e.release().split(".");return Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in r)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((e=>e in r))||"codeship"===r.CI_NAME?1:i;if("TEAMCITY_VERSION"in r)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(r.TEAMCITY_VERSION)?1:0;if("truecolor"===r.COLORTERM)return 3;if("TERM_PROGRAM"in r){const e=parseInt((r.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(r.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(r.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(r.TERM)||"COLORTERM"in r?1:i}return n("no-color")||n("no-colors")||n("color=false")||n("color=never")?u=0:(n("color")||n("colors")||n("color=true")||n("color=always"))&&(u=1),"FORCE_COLOR"in r&&(u="true"===r.FORCE_COLOR?1:"false"===r.FORCE_COLOR?0:0===r.FORCE_COLOR.length?1:Math.min(parseInt(r.FORCE_COLOR,10),3)),jr={supportsColor:function(e){return o(i(e,e&&e.isTTY))},stdout:o(i(!0,t.isatty(1))),stderr:o(i(!0,t.isatty(2)))}}();e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,t)=>{const n=t.substring(6).toLowerCase().replace(/_([a-z])/g,((e,t)=>t.toUpperCase()));let r=process.env[t];return r=!!/^(yes|on|true|enabled)$/i.test(r)||!/^(no|off|false|disabled)$/i.test(r)&&("null"===r?null:Number(r)),e[n]=r,e}),{}),e.exports=Rr()(t);const{formatters:u}=e.exports;u.o=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")},u.O=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts)}}(Gr,Gr.exports)),Gr.exports}Jr=Nr,"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?Jr.exports=(Br||(Br=1,function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,u=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(u=r))})),t.splice(u,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=Rr()(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(Ir,Ir.exports)),Ir.exports):Jr.exports=Ur();var Wr=function(e){return(e=e||{}).circles?function(e){var t=[],n=[];return e.proto?function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=zr(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o}:function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u)if(!1!==Object.hasOwnProperty.call(u,i)){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=zr(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o};function r(e,r){for(var u=Object.keys(e),o=new Array(u.length),i=0;i!e,Qr=e=>e&&"object"==typeof e&&!Array.isArray(e),eu=(e,t,n)=>{(Array.isArray(t)?t:[t]).forEach((t=>{if(t)throw new Error(`Problem with log4js configuration: (${Kr.inspect(e,{depth:5})}) - ${n}`)}))};var tu={configure:e=>{qr("New configuration to be validated: ",e),eu(e,Zr(Qr(e)),"must be an object."),qr(`Calling pre-processing listeners (${Yr.length})`),Yr.forEach((t=>t(e))),qr("Configuration pre-processing finished."),qr(`Calling configuration listeners (${Xr.length})`),Xr.forEach((t=>t(e))),qr("Configuration finished.")},addListener:e=>{Xr.push(e),qr(`Added listener, now ${Xr.length} listeners`)},addPreProcessingListener:e=>{Yr.push(e),qr(`Added pre-processing listener, now ${Yr.length} listeners`)},throwExceptionIf:eu,anObject:Qr,anInteger:e=>e&&"number"==typeof e&&Number.isInteger(e),validIdentifier:e=>/^[A-Za-z][A-Za-z0-9_]*$/g.test(e),not:Zr},nu={exports:{}};!function(e){function t(e,t){for(var n=e.toString();n.length-1?s:c,l=n(u.getHours()),f=n(u.getMinutes()),d=n(u.getSeconds()),D=t(u.getMilliseconds(),3),p=function(e){var t=Math.abs(e),n=String(Math.floor(t/60)),r=String(t%60);return n=("0"+n).slice(-2),r=("0"+r).slice(-2),0===e?"Z":(e<0?"+":"-")+n+":"+r}(u.getTimezoneOffset());return r.replace(/dd/g,o).replace(/MM/g,i).replace(/y{1,4}/g,a).replace(/hh/g,l).replace(/mm/g,f).replace(/ss/g,d).replace(/SSS/g,D).replace(/O/g,p)}function u(e,t,n,r){e["set"+(r?"":"UTC")+t](n)}e.exports=r,e.exports.asString=r,e.exports.parse=function(t,n,r){if(!t)throw new Error("pattern must be supplied");return function(t,n,r){var o=t.indexOf("O")<0,i=!1,s=[{pattern:/y{1,4}/,regexp:"\\d{1,4}",fn:function(e,t){u(e,"FullYear",t,o)}},{pattern:/MM/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Month",t-1,o),e.getMonth()!==t-1&&(i=!0)}},{pattern:/dd/,regexp:"\\d{1,2}",fn:function(e,t){i&&u(e,"Month",e.getMonth()-1,o),u(e,"Date",t,o)}},{pattern:/hh/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Hours",t,o)}},{pattern:/mm/,regexp:"\\d\\d",fn:function(e,t){u(e,"Minutes",t,o)}},{pattern:/ss/,regexp:"\\d\\d",fn:function(e,t){u(e,"Seconds",t,o)}},{pattern:/SSS/,regexp:"\\d\\d\\d",fn:function(e,t){u(e,"Milliseconds",t,o)}},{pattern:/O/,regexp:"[+-]\\d{1,2}:?\\d{2}?|Z",fn:function(e,t){t="Z"===t?0:t.replace(":","");var n=Math.abs(t),r=(t>0?-1:1)*(n%100+60*Math.floor(n/100));e.setUTCMinutes(e.getUTCMinutes()+r)}}],c=s.reduce((function(e,t){return t.pattern.test(e.regexp)?(t.index=e.regexp.match(t.pattern).index,e.regexp=e.regexp.replace(t.pattern,"("+t.regexp+")")):t.index=-1,e}),{regexp:t,index:[]}),a=s.filter((function(e){return e.index>-1}));a.sort((function(e,t){return e.index-t.index}));var l=new RegExp(c.regexp).exec(n);if(l){var f=r||e.exports.now();return a.forEach((function(e,t){e.fn(f,l[t+1])})),f}throw new Error("String '"+n+"' could not be parsed as '"+t+"'")}(t,n,r)},e.exports.now=function(){return new Date},e.exports.ISO8601_FORMAT="yyyy-MM-ddThh:mm:ss.SSS",e.exports.ISO8601_WITH_TZ_OFFSET_FORMAT="yyyy-MM-ddThh:mm:ss.SSSO",e.exports.DATETIME_FORMAT="dd MM yyyy hh:mm:ss.SSS",e.exports.ABSOLUTETIME_FORMAT="hh:mm:ss.SSS"}(nu);const ru=nu.exports,uu=E.default,ou=F.default,iu=p.default,su={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[90,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[91,39],yellow:[33,39]};function cu(e){return e?`[${su[e][0]}m`:""}function au(e){return e?`[${su[e][1]}m`:""}function lu(e,t){return n=ou.format("[%s] [%s] %s - ",ru.asString(e.startTime),e.level.toString(),e.categoryName),cu(r=t)+n+au(r);var n,r}function fu(e){return lu(e)+ou.format(...e.data)}function du(e){return lu(e,e.level.colour)+ou.format(...e.data)}function Du(e){return ou.format(...e.data)}function pu(e){return e.data[0]}function Eu(e,t){const n=/%(-?[0-9]+)?(\.?-?[0-9]+)?([[\]cdhmnprzxXyflos%])(\{([^}]+)\})?|([^%]+)/;function r(e){return e&&e.pid?e.pid.toString():process.pid.toString()}e=e||"%r %p %c - %m%n";const u={c:function(e,t){let n=e.categoryName;if(t){const e=parseInt(t,10),r=n.split(".");ee&&(n=r.slice(-e).join(iu.sep))}return n},l:function(e){return e.lineNumber?`${e.lineNumber}`:""},o:function(e){return e.columnNumber?`${e.columnNumber}`:""},s:function(e){return e.callStack||""}};function o(e,t,n){return u[e](t,n)}function i(e,t,n){let r=e;return r=function(e,t){let n;return e?(n=parseInt(e.substr(1),10),n>0?t.slice(0,n):t.slice(n)):t}(t,r),r=function(e,t){let n;if(e)if("-"===e.charAt(0))for(n=parseInt(e.substr(1),10);t.lengthDu,basic:()=>fu,colored:()=>du,coloured:()=>du,pattern:e=>Eu(e&&e.pattern,e&&e.tokens),dummy:()=>pu};var hu={basicLayout:fu,messagePassThroughLayout:Du,patternLayout:Eu,colouredLayout:du,coloredLayout:du,dummyLayout:pu,addLayout(e,t){mu[e]=t},layout:(e,t)=>mu[e]&&mu[e](t)};const yu=tu,Cu=["white","grey","black","blue","cyan","green","magenta","red","yellow"];class Fu{constructor(e,t,n){this.level=e,this.levelStr=t,this.colour=n}toString(){return this.levelStr}static getLevel(e,t){return e?e instanceof Fu?e:(e instanceof Object&&e.levelStr&&(e=e.levelStr),Fu[e.toString().toUpperCase()]||t):t}static addLevels(e){if(e){Object.keys(e).forEach((t=>{const n=t.toUpperCase();Fu[n]=new Fu(e[t].value,n,e[t].colour);const r=Fu.levels.findIndex((e=>e.levelStr===n));r>-1?Fu.levels[r]=Fu[n]:Fu.levels.push(Fu[n])})),Fu.levels.sort(((e,t)=>e.level-t.level))}}isLessThanOrEqualTo(e){return"string"==typeof e&&(e=Fu.getLevel(e)),this.level<=e.level}isGreaterThanOrEqualTo(e){return"string"==typeof e&&(e=Fu.getLevel(e)),this.level>=e.level}isEqualTo(e){return"string"==typeof e&&(e=Fu.getLevel(e)),this.level===e.level}}Fu.levels=[],Fu.addLevels({ALL:{value:Number.MIN_VALUE,colour:"grey"},TRACE:{value:5e3,colour:"blue"},DEBUG:{value:1e4,colour:"cyan"},INFO:{value:2e4,colour:"green"},WARN:{value:3e4,colour:"yellow"},ERROR:{value:4e4,colour:"red"},FATAL:{value:5e4,colour:"magenta"},MARK:{value:9007199254740992,colour:"grey"},OFF:{value:Number.MAX_VALUE,colour:"grey"}}),yu.addListener((e=>{const t=e.levels;if(t){yu.throwExceptionIf(e,yu.not(yu.anObject(t)),"levels must be an object");Object.keys(t).forEach((n=>{yu.throwExceptionIf(e,yu.not(yu.validIdentifier(n)),`level name "${n}" is not a valid identifier (must start with a letter, only contain A-Z,a-z,0-9,_)`),yu.throwExceptionIf(e,yu.not(yu.anObject(t[n])),`level "${n}" must be an object`),yu.throwExceptionIf(e,yu.not(t[n].value),`level "${n}" must have a 'value' property`),yu.throwExceptionIf(e,yu.not(yu.anInteger(t[n].value)),`level "${n}".value must have an integer value`),yu.throwExceptionIf(e,yu.not(t[n].colour),`level "${n}" must have a 'colour' property`),yu.throwExceptionIf(e,yu.not(Cu.indexOf(t[n].colour)>-1),`level "${n}".colour must be one of ${Cu.join(", ")}`)}))}})),yu.addListener((e=>{Fu.addLevels(e.levels)}));var gu=Fu,Au={exports:{}},vu={};/*! (c) 2020 Andrea Giammarchi */ -const{parse:Su,stringify:wu}=JSON,{keys:Ou}=Object,bu=String,_u="string",Bu={},Pu="object",ku=(e,t)=>t,xu=e=>e instanceof bu?bu(e):e,Nu=(e,t)=>typeof t===_u?new bu(t):t,Iu=(e,t,n,r)=>{const u=[];for(let o=Ou(n),{length:i}=o,s=0;s{const r=bu(t.push(n)-1);return e.set(n,r),r},Ru=(e,t)=>{const n=Su(e,Nu).map(xu),r=n[0],u=t||ku,o=typeof r===Pu&&r?Iu(n,new Set,r,u):r;return u.call({"":o},"",o)};vu.parse=Ru;const Mu=(e,t,n)=>{const r=t&&typeof t===Pu?(e,n)=>""===e||-1Su(Mu(e));vu.fromJSON=e=>Ru(wu(e));const Lu=vu,ju=gu;class $u{constructor(e,t,n,r,u){this.startTime=new Date,this.categoryName=e,this.data=n,this.level=t,this.context=Object.assign({},r),this.pid=process.pid,u&&(this.functionName=u.functionName,this.fileName=u.fileName,this.lineNumber=u.lineNumber,this.columnNumber=u.columnNumber,this.callStack=u.callStack)}serialise(){const e=this.data.map((e=>(e&&e.message&&e.stack&&(e=Object.assign({message:e.message,stack:e.stack},e)),e)));return this.data=e,Lu.stringify(this)}static deserialise(e){let t;try{const n=Lu.parse(e);n.data=n.data.map((e=>{if(e&&e.message&&e.stack){const t=new Error(e);Object.keys(e).forEach((n=>{t[n]=e[n]})),e=t}return e})),t=new $u(n.categoryName,ju.getLevel(n.level.levelStr),n.data,n.context),t.startTime=new Date(n.startTime),t.pid=n.pid,t.cluster=n.cluster}catch(n){t=new $u("log4js",ju.ERROR,["Unable to parse log:",e,"because: ",n])}return t}}var Hu=$u;const Ju=Nr.exports("log4js:clustering"),Gu=Hu,Vu=tu;let Uu=!1,Wu=null;try{Wu=require("cluster")}catch(e){Ju("cluster module not present"),Uu=!0}const zu=[];let Ku=!1,qu="NODE_APP_INSTANCE";const Yu=()=>Ku&&"0"===process.env[qu],Xu=()=>Uu||Wu.isMaster||Yu(),Zu=e=>{zu.forEach((t=>t(e)))},Qu=(e,t)=>{if(Ju("cluster message received from worker ",e,": ",t),e.topic&&e.data&&(t=e,e=void 0),t&&t.topic&&"log4js:message"===t.topic){Ju("received message: ",t.data);const e=Gu.deserialise(t.data);Zu(e)}};Uu||Vu.addListener((e=>{zu.length=0,({pm2:Ku,disableClustering:Uu,pm2InstanceVar:qu="NODE_APP_INSTANCE"}=e),Ju(`clustering disabled ? ${Uu}`),Ju(`cluster.isMaster ? ${Wu&&Wu.isMaster}`),Ju(`pm2 enabled ? ${Ku}`),Ju(`pm2InstanceVar = ${qu}`),Ju(`process.env[${qu}] = ${process.env[qu]}`),Ku&&process.removeListener("message",Qu),Wu&&Wu.removeListener&&Wu.removeListener("message",Qu),Uu||e.disableClustering?Ju("Not listening for cluster messages, because clustering disabled."):Yu()?(Ju("listening for PM2 broadcast messages"),process.on("message",Qu)):Wu.isMaster?(Ju("listening for cluster messages"),Wu.on("message",Qu)):Ju("not listening for messages, because we are not a master process")}));var eo={onlyOnMaster:(e,t)=>Xu()?e():t,isMaster:Xu,send:e=>{Xu()?Zu(e):(Ku||(e.cluster={workerId:Wu.worker.id,worker:process.pid}),process.send({topic:"log4js:message",data:e.serialise()}))},onMessage:e=>{zu.push(e)}},to={};function no(e){if("number"==typeof e&&Number.isInteger(e))return e;const t={K:1024,M:1048576,G:1073741824},n=Object.keys(t),r=e.substr(e.length-1).toLocaleUpperCase(),u=e.substring(0,e.length-1).trim();if(n.indexOf(r)<0||!Number.isInteger(Number(u)))throw Error(`maxLogSize: "${e}" is invalid`);return u*t[r]}function ro(e){return function(e,t){const n=Object.assign({},t);return Object.keys(e).forEach((r=>{n[r]&&(n[r]=e[r](t[r]))})),n}({maxLogSize:no},e)}const uo={file:ro,fileSync:ro};to.modifyConfig=e=>uo[e.type]?uo[e.type](e):e;var oo={};const io=console.log.bind(console);oo.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{io(e(n,t))}}(n,e.timezoneOffset)};var so={};so.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stdout.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var co={};co.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stderr.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var ao={};ao.configure=function(e,t,n,r){const u=n(e.appender);return function(e,t,n,r){const u=r.getLevel(e),o=r.getLevel(t,r.FATAL);return e=>{const t=e.level;t.isGreaterThanOrEqualTo(u)&&t.isLessThanOrEqualTo(o)&&n(e)}}(e.level,e.maxLevel,u,r)};var lo={};const fo=Nr.exports("log4js:categoryFilter");lo.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return"string"==typeof e&&(e=[e]),n=>{fo(`Checking ${n.categoryName} against ${e}`),-1===e.indexOf(n.categoryName)&&(fo("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var Do={};const po=Nr.exports("log4js:noLogFilter");Do.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return n=>{po(`Checking data: ${n.data} against filters: ${e}`),"string"==typeof e&&(e=[e]),e=e.filter((e=>null!=e&&""!==e));const r=new RegExp(e.join("|"),"i");(0===e.length||n.data.findIndex((e=>r.test(e)))<0)&&(po("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var Eo={},mo={exports:{}},ho={},yo={fromCallback:function(e){return Object.defineProperty((function(){if("function"!=typeof arguments[arguments.length-1])return new Promise(((t,n)=>{arguments[arguments.length]=(e,r)=>{if(e)return n(e);t(r)},arguments.length++,e.apply(this,arguments)}));e.apply(this,arguments)}),"name",{value:e.name})},fromPromise:function(e){return Object.defineProperty((function(){const t=arguments[arguments.length-1];if("function"!=typeof t)return e.apply(this,arguments);e.apply(this,arguments).then((e=>t(null,e)),t)}),"name",{value:e.name})}};!function(e){const t=yo.fromCallback,n=we,r=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchown","lchmod","link","lstat","mkdir","mkdtemp","open","readFile","readdir","readlink","realpath","rename","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((e=>"function"==typeof n[e]));Object.keys(n).forEach((t=>{"promises"!==t&&(e[t]=n[t])})),r.forEach((r=>{e[r]=t(n[r])})),e.exists=function(e,t){return"function"==typeof t?n.exists(e,t):new Promise((t=>n.exists(e,t)))},e.read=function(e,t,r,u,o,i){return"function"==typeof i?n.read(e,t,r,u,o,i):new Promise(((i,s)=>{n.read(e,t,r,u,o,((e,t,n)=>{if(e)return s(e);i({bytesRead:t,buffer:n})}))}))},e.write=function(e,t,...r){return"function"==typeof r[r.length-1]?n.write(e,t,...r):new Promise(((u,o)=>{n.write(e,t,...r,((e,t,n)=>{if(e)return o(e);u({bytesWritten:t,buffer:n})}))}))},"function"==typeof n.realpath.native&&(e.realpath.native=t(n.realpath.native))}(ho);const Co=p.default;function Fo(e){return(e=Co.normalize(Co.resolve(e)).split(Co.sep)).length>0?e[0]:null}const go=/[<>:"|?*]/;var Ao=function(e){const t=Fo(e);return e=e.replace(t,""),go.test(e)};const vo=we,So=p.default,wo=Ao,Oo=parseInt("0777",8);var bo=function e(t,n,r,u){if("function"==typeof n?(r=n,n={}):n&&"object"==typeof n||(n={mode:n}),"win32"===process.platform&&wo(t)){const e=new Error(t+" contains invalid WIN32 path characters.");return e.code="EINVAL",r(e)}let o=n.mode;const i=n.fs||vo;void 0===o&&(o=Oo&~process.umask()),u||(u=null),r=r||function(){},t=So.resolve(t),i.mkdir(t,o,(o=>{if(!o)return r(null,u=u||t);if("ENOENT"===o.code){if(So.dirname(t)===t)return r(o);e(So.dirname(t),n,((u,o)=>{u?r(u,o):e(t,n,r,o)}))}else i.stat(t,((e,t)=>{e||!t.isDirectory()?r(o,u):r(null,u)}))}))};const _o=we,Bo=p.default,Po=Ao,ko=parseInt("0777",8);var xo=function e(t,n,r){n&&"object"==typeof n||(n={mode:n});let u=n.mode;const o=n.fs||_o;if("win32"===process.platform&&Po(t)){const e=new Error(t+" contains invalid WIN32 path characters.");throw e.code="EINVAL",e}void 0===u&&(u=ko&~process.umask()),r||(r=null),t=Bo.resolve(t);try{o.mkdirSync(t,u),r=r||t}catch(u){if("ENOENT"===u.code){if(Bo.dirname(t)===t)throw u;r=e(Bo.dirname(t),n,r),e(t,n,r)}else{let e;try{e=o.statSync(t)}catch(e){throw u}if(!e.isDirectory())throw u}}return r};const No=(0,yo.fromCallback)(bo);var Io={mkdirs:No,mkdirsSync:xo,mkdirp:No,mkdirpSync:xo,ensureDir:No,ensureDirSync:xo};const To=we;E.default,p.default;var Ro=function(e,t,n,r){To.open(e,"r+",((e,u)=>{if(e)return r(e);To.futimes(u,t,n,(e=>{To.close(u,(t=>{r&&r(e||t)}))}))}))},Mo=function(e,t,n){const r=To.openSync(e,"r+");return To.futimesSync(r,t,n),To.closeSync(r)};const Lo=we,jo=p.default,$o=10,Ho=5,Jo=0,Go=process.versions.node.split("."),Vo=Number.parseInt(Go[0],10),Uo=Number.parseInt(Go[1],10),Wo=Number.parseInt(Go[2],10);function zo(){if(Vo>$o)return!0;if(Vo===$o){if(Uo>Ho)return!0;if(Uo===Ho&&Wo>=Jo)return!0}return!1}function Ko(e,t){const n=jo.resolve(e).split(jo.sep).filter((e=>e)),r=jo.resolve(t).split(jo.sep).filter((e=>e));return n.reduce(((e,t,n)=>e&&r[n]===t),!0)}function qo(e,t,n){return`Cannot ${n} '${e}' to a subdirectory of itself, '${t}'.`}var Yo,Xo,Zo={checkPaths:function(e,t,n,r){!function(e,t,n){zo()?Lo.stat(e,{bigint:!0},((e,r)=>{if(e)return n(e);Lo.stat(t,{bigint:!0},((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))})):Lo.stat(e,((e,r)=>{if(e)return n(e);Lo.stat(t,((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))}))}(e,t,((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;return s&&s.ino&&s.dev&&s.ino===i.ino&&s.dev===i.dev?r(new Error("Source and destination must not be the same.")):i.isDirectory()&&Ko(e,t)?r(new Error(qo(e,t,n))):r(null,{srcStat:i,destStat:s})}))},checkPathsSync:function(e,t,n){const{srcStat:r,destStat:u}=function(e,t){let n,r;n=zo()?Lo.statSync(e,{bigint:!0}):Lo.statSync(e);try{r=zo()?Lo.statSync(t,{bigint:!0}):Lo.statSync(t)}catch(e){if("ENOENT"===e.code)return{srcStat:n,destStat:null};throw e}return{srcStat:n,destStat:r}}(e,t);if(u&&u.ino&&u.dev&&u.ino===r.ino&&u.dev===r.dev)throw new Error("Source and destination must not be the same.");if(r.isDirectory()&&Ko(e,t))throw new Error(qo(e,t,n));return{srcStat:r,destStat:u}},checkParentPaths:function e(t,n,r,u,o){const i=jo.resolve(jo.dirname(t)),s=jo.resolve(jo.dirname(r));if(s===i||s===jo.parse(s).root)return o();zo()?Lo.stat(s,{bigint:!0},((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(qo(t,r,u))):e(t,n,s,u,o))):Lo.stat(s,((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(qo(t,r,u))):e(t,n,s,u,o)))},checkParentPathsSync:function e(t,n,r,u){const o=jo.resolve(jo.dirname(t)),i=jo.resolve(jo.dirname(r));if(i===o||i===jo.parse(i).root)return;let s;try{s=zo()?Lo.statSync(i,{bigint:!0}):Lo.statSync(i)}catch(e){if("ENOENT"===e.code)return;throw e}if(s.ino&&s.dev&&s.ino===n.ino&&s.dev===n.dev)throw new Error(qo(t,r,u));return e(t,n,i,u)},isSrcSubdir:Ko};const Qo=we,ei=p.default,ti=Io.mkdirsSync,ni=Mo,ri=Zo;function ui(e,t,n,r){if(!r.filter||r.filter(t,n))return function(e,t,n,r){const u=r.dereference?Qo.statSync:Qo.lstatSync,o=u(t);if(o.isDirectory())return function(e,t,n,r,u){if(!t)return function(e,t,n,r){return Qo.mkdirSync(n),ii(t,n,r),Qo.chmodSync(n,e.mode)}(e,n,r,u);if(t&&!t.isDirectory())throw new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`);return ii(n,r,u)}(o,e,t,n,r);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return function(e,t,n,r,u){return t?function(e,t,n,r){if(r.overwrite)return Qo.unlinkSync(n),oi(e,t,n,r);if(r.errorOnExist)throw new Error(`'${n}' already exists`)}(e,n,r,u):oi(e,n,r,u)}(o,e,t,n,r);if(o.isSymbolicLink())return function(e,t,n,r){let u=Qo.readlinkSync(t);r.dereference&&(u=ei.resolve(process.cwd(),u));if(e){let e;try{e=Qo.readlinkSync(n)}catch(e){if("EINVAL"===e.code||"UNKNOWN"===e.code)return Qo.symlinkSync(u,n);throw e}if(r.dereference&&(e=ei.resolve(process.cwd(),e)),ri.isSrcSubdir(u,e))throw new Error(`Cannot copy '${u}' to a subdirectory of itself, '${e}'.`);if(Qo.statSync(n).isDirectory()&&ri.isSrcSubdir(e,u))throw new Error(`Cannot overwrite '${e}' with '${u}'.`);return function(e,t){return Qo.unlinkSync(t),Qo.symlinkSync(e,t)}(u,n)}return Qo.symlinkSync(u,n)}(e,t,n,r)}(e,t,n,r)}function oi(e,t,n,r){return"function"==typeof Qo.copyFileSync?(Qo.copyFileSync(t,n),Qo.chmodSync(n,e.mode),r.preserveTimestamps?ni(n,e.atime,e.mtime):void 0):function(e,t,n,r){const u=65536,o=(Xo?Yo:(Xo=1,Yo=function(e){if("function"==typeof Buffer.allocUnsafe)try{return Buffer.allocUnsafe(e)}catch(t){return new Buffer(e)}return new Buffer(e)}))(u),i=Qo.openSync(t,"r"),s=Qo.openSync(n,"w",e.mode);let c=0;for(;cfunction(e,t,n,r){const u=ei.join(t,e),o=ei.join(n,e),{destStat:i}=ri.checkPathsSync(u,o,"copy");return ui(i,u,o,r)}(r,e,t,n)))}var si=function(e,t,n){"function"==typeof n&&(n={filter:n}),(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269");const{srcStat:r,destStat:u}=ri.checkPathsSync(e,t,"copy");return ri.checkParentPathsSync(e,r,t,"copy"),function(e,t,n,r){if(r.filter&&!r.filter(t,n))return;const u=ei.dirname(n);Qo.existsSync(u)||ti(u);return ui(e,t,n,r)}(u,e,t,n)},ci={copySync:si};const ai=yo.fromPromise,li=ho;var fi={pathExists:ai((function(e){return li.access(e).then((()=>!0)).catch((()=>!1))})),pathExistsSync:li.existsSync};const di=we,Di=p.default,pi=Io.mkdirs,Ei=fi.pathExists,mi=Ro,hi=Zo;function yi(e,t,n,r,u){const o=Di.dirname(n);Ei(o,((i,s)=>i?u(i):s?Fi(e,t,n,r,u):void pi(o,(o=>o?u(o):Fi(e,t,n,r,u)))))}function Ci(e,t,n,r,u,o){Promise.resolve(u.filter(n,r)).then((i=>i?e(t,n,r,u,o):o()),(e=>o(e)))}function Fi(e,t,n,r,u){return r.filter?Ci(gi,e,t,n,r,u):gi(e,t,n,r,u)}function gi(e,t,n,r,u){(r.dereference?di.stat:di.lstat)(t,((o,i)=>o?u(o):i.isDirectory()?function(e,t,n,r,u,o){if(!t)return function(e,t,n,r,u){di.mkdir(n,(o=>{if(o)return u(o);Si(t,n,r,(t=>t?u(t):di.chmod(n,e.mode,u)))}))}(e,n,r,u,o);if(t&&!t.isDirectory())return o(new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`));return Si(n,r,u,o)}(i,e,t,n,r,u):i.isFile()||i.isCharacterDevice()||i.isBlockDevice()?function(e,t,n,r,u,o){return t?function(e,t,n,r,u){if(!r.overwrite)return r.errorOnExist?u(new Error(`'${n}' already exists`)):u();di.unlink(n,(o=>o?u(o):Ai(e,t,n,r,u)))}(e,n,r,u,o):Ai(e,n,r,u,o)}(i,e,t,n,r,u):i.isSymbolicLink()?function(e,t,n,r,u){di.readlink(t,((t,o)=>t?u(t):(r.dereference&&(o=Di.resolve(process.cwd(),o)),e?void di.readlink(n,((t,i)=>t?"EINVAL"===t.code||"UNKNOWN"===t.code?di.symlink(o,n,u):u(t):(r.dereference&&(i=Di.resolve(process.cwd(),i)),hi.isSrcSubdir(o,i)?u(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${i}'.`)):e.isDirectory()&&hi.isSrcSubdir(i,o)?u(new Error(`Cannot overwrite '${i}' with '${o}'.`)):function(e,t,n){di.unlink(t,(r=>r?n(r):di.symlink(e,t,n)))}(o,n,u)))):di.symlink(o,n,u))))}(e,t,n,r,u):void 0))}function Ai(e,t,n,r,u){return"function"==typeof di.copyFile?di.copyFile(t,n,(t=>t?u(t):vi(e,n,r,u))):function(e,t,n,r,u){const o=di.createReadStream(t);o.on("error",(e=>u(e))).once("open",(()=>{const t=di.createWriteStream(n,{mode:e.mode});t.on("error",(e=>u(e))).on("open",(()=>o.pipe(t))).once("close",(()=>vi(e,n,r,u)))}))}(e,t,n,r,u)}function vi(e,t,n,r){di.chmod(t,e.mode,(u=>u?r(u):n.preserveTimestamps?mi(t,e.atime,e.mtime,r):r()))}function Si(e,t,n,r){di.readdir(e,((u,o)=>u?r(u):wi(o,e,t,n,r)))}function wi(e,t,n,r,u){const o=e.pop();return o?function(e,t,n,r,u,o){const i=Di.join(n,t),s=Di.join(r,t);hi.checkPaths(i,s,"copy",((t,c)=>{if(t)return o(t);const{destStat:a}=c;Fi(a,i,s,u,(t=>t?o(t):wi(e,n,r,u,o)))}))}(e,o,t,n,r,u):u()}var Oi=function(e,t,n,r){"function"!=typeof n||r?"function"==typeof n&&(n={filter:n}):(r=n,n={}),r=r||function(){},(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269"),hi.checkPaths(e,t,"copy",((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;hi.checkParentPaths(e,i,t,"copy",(u=>u?r(u):n.filter?Ci(yi,s,e,t,n,r):yi(s,e,t,n,r)))}))};var bi={copy:(0,yo.fromCallback)(Oi)};const _i=we,Bi=p.default,Pi=g.default,ki="win32"===process.platform;function xi(e){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((t=>{e[t]=e[t]||_i[t],e[t+="Sync"]=e[t]||_i[t]})),e.maxBusyTries=e.maxBusyTries||3}function Ni(e,t,n){let r=0;"function"==typeof t&&(n=t,t={}),Pi(e,"rimraf: missing path"),Pi.strictEqual(typeof e,"string","rimraf: path should be a string"),Pi.strictEqual(typeof n,"function","rimraf: callback function required"),Pi(t,"rimraf: invalid options argument provided"),Pi.strictEqual(typeof t,"object","rimraf: options should be object"),xi(t),Ii(e,t,(function u(o){if(o){if(("EBUSY"===o.code||"ENOTEMPTY"===o.code||"EPERM"===o.code)&&rIi(e,t,u)),100*r)}"ENOENT"===o.code&&(o=null)}n(o)}))}function Ii(e,t,n){Pi(e),Pi(t),Pi("function"==typeof n),t.lstat(e,((r,u)=>r&&"ENOENT"===r.code?n(null):r&&"EPERM"===r.code&&ki?Ti(e,t,r,n):u&&u.isDirectory()?Mi(e,t,r,n):void t.unlink(e,(r=>{if(r){if("ENOENT"===r.code)return n(null);if("EPERM"===r.code)return ki?Ti(e,t,r,n):Mi(e,t,r,n);if("EISDIR"===r.code)return Mi(e,t,r,n)}return n(r)}))))}function Ti(e,t,n,r){Pi(e),Pi(t),Pi("function"==typeof r),n&&Pi(n instanceof Error),t.chmod(e,438,(u=>{u?r("ENOENT"===u.code?null:n):t.stat(e,((u,o)=>{u?r("ENOENT"===u.code?null:n):o.isDirectory()?Mi(e,t,n,r):t.unlink(e,r)}))}))}function Ri(e,t,n){let r;Pi(e),Pi(t),n&&Pi(n instanceof Error);try{t.chmodSync(e,438)}catch(e){if("ENOENT"===e.code)return;throw n}try{r=t.statSync(e)}catch(e){if("ENOENT"===e.code)return;throw n}r.isDirectory()?ji(e,t,n):t.unlinkSync(e)}function Mi(e,t,n,r){Pi(e),Pi(t),n&&Pi(n instanceof Error),Pi("function"==typeof r),t.rmdir(e,(u=>{!u||"ENOTEMPTY"!==u.code&&"EEXIST"!==u.code&&"EPERM"!==u.code?u&&"ENOTDIR"===u.code?r(n):r(u):function(e,t,n){Pi(e),Pi(t),Pi("function"==typeof n),t.readdir(e,((r,u)=>{if(r)return n(r);let o,i=u.length;if(0===i)return t.rmdir(e,n);u.forEach((r=>{Ni(Bi.join(e,r),t,(r=>{if(!o)return r?n(o=r):void(0==--i&&t.rmdir(e,n))}))}))}))}(e,t,r)}))}function Li(e,t){let n;xi(t=t||{}),Pi(e,"rimraf: missing path"),Pi.strictEqual(typeof e,"string","rimraf: path should be a string"),Pi(t,"rimraf: missing options"),Pi.strictEqual(typeof t,"object","rimraf: options should be object");try{n=t.lstatSync(e)}catch(n){if("ENOENT"===n.code)return;"EPERM"===n.code&&ki&&Ri(e,t,n)}try{n&&n.isDirectory()?ji(e,t,null):t.unlinkSync(e)}catch(n){if("ENOENT"===n.code)return;if("EPERM"===n.code)return ki?Ri(e,t,n):ji(e,t,n);if("EISDIR"!==n.code)throw n;ji(e,t,n)}}function ji(e,t,n){Pi(e),Pi(t),n&&Pi(n instanceof Error);try{t.rmdirSync(e)}catch(r){if("ENOTDIR"===r.code)throw n;if("ENOTEMPTY"===r.code||"EEXIST"===r.code||"EPERM"===r.code)!function(e,t){if(Pi(e),Pi(t),t.readdirSync(e).forEach((n=>Li(Bi.join(e,n),t))),!ki){return t.rmdirSync(e,t)}{const n=Date.now();do{try{return t.rmdirSync(e,t)}catch(e){}}while(Date.now()-n<500)}}(e,t);else if("ENOENT"!==r.code)throw r}}var $i=Ni;Ni.sync=Li;const Hi=$i;var Ji={remove:(0,yo.fromCallback)(Hi),removeSync:Hi.sync};const Gi=yo.fromCallback,Vi=we,Ui=p.default,Wi=Io,zi=Ji,Ki=Gi((function(e,t){t=t||function(){},Vi.readdir(e,((n,r)=>{if(n)return Wi.mkdirs(e,t);r=r.map((t=>Ui.join(e,t))),function e(){const n=r.pop();if(!n)return t();zi.remove(n,(n=>{if(n)return t(n);e()}))}()}))}));function qi(e){let t;try{t=Vi.readdirSync(e)}catch(t){return Wi.mkdirsSync(e)}t.forEach((t=>{t=Ui.join(e,t),zi.removeSync(t)}))}var Yi={emptyDirSync:qi,emptydirSync:qi,emptyDir:Ki,emptydir:Ki};const Xi=yo.fromCallback,Zi=p.default,Qi=we,es=Io,ts=fi.pathExists;var ns={createFile:Xi((function(e,t){function n(){Qi.writeFile(e,"",(e=>{if(e)return t(e);t()}))}Qi.stat(e,((r,u)=>{if(!r&&u.isFile())return t();const o=Zi.dirname(e);ts(o,((e,r)=>e?t(e):r?n():void es.mkdirs(o,(e=>{if(e)return t(e);n()}))))}))})),createFileSync:function(e){let t;try{t=Qi.statSync(e)}catch(e){}if(t&&t.isFile())return;const n=Zi.dirname(e);Qi.existsSync(n)||es.mkdirsSync(n),Qi.writeFileSync(e,"")}};const rs=yo.fromCallback,us=p.default,os=we,is=Io,ss=fi.pathExists;var cs={createLink:rs((function(e,t,n){function r(e,t){os.link(e,t,(e=>{if(e)return n(e);n(null)}))}ss(t,((u,o)=>u?n(u):o?n(null):void os.lstat(e,(u=>{if(u)return u.message=u.message.replace("lstat","ensureLink"),n(u);const o=us.dirname(t);ss(o,((u,i)=>u?n(u):i?r(e,t):void is.mkdirs(o,(u=>{if(u)return n(u);r(e,t)}))))}))))})),createLinkSync:function(e,t){if(os.existsSync(t))return;try{os.lstatSync(e)}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}const n=us.dirname(t);return os.existsSync(n)||is.mkdirsSync(n),os.linkSync(e,t)}};const as=p.default,ls=we,fs=fi.pathExists;var ds={symlinkPaths:function(e,t,n){if(as.isAbsolute(e))return ls.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:e})));{const r=as.dirname(t),u=as.join(r,e);return fs(u,((t,o)=>t?n(t):o?n(null,{toCwd:u,toDst:e}):ls.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:as.relative(r,e)})))))}},symlinkPathsSync:function(e,t){let n;if(as.isAbsolute(e)){if(n=ls.existsSync(e),!n)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}{const r=as.dirname(t),u=as.join(r,e);if(n=ls.existsSync(u),n)return{toCwd:u,toDst:e};if(n=ls.existsSync(e),!n)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:as.relative(r,e)}}}};const Ds=we;var ps={symlinkType:function(e,t,n){if(n="function"==typeof t?t:n,t="function"!=typeof t&&t)return n(null,t);Ds.lstat(e,((e,r)=>{if(e)return n(null,"file");t=r&&r.isDirectory()?"dir":"file",n(null,t)}))},symlinkTypeSync:function(e,t){let n;if(t)return t;try{n=Ds.lstatSync(e)}catch(e){return"file"}return n&&n.isDirectory()?"dir":"file"}};const Es=yo.fromCallback,ms=p.default,hs=we,ys=Io.mkdirs,Cs=Io.mkdirsSync,Fs=ds.symlinkPaths,gs=ds.symlinkPathsSync,As=ps.symlinkType,vs=ps.symlinkTypeSync,Ss=fi.pathExists;var ws={createSymlink:Es((function(e,t,n,r){r="function"==typeof n?n:r,n="function"!=typeof n&&n,Ss(t,((u,o)=>u?r(u):o?r(null):void Fs(e,t,((u,o)=>{if(u)return r(u);e=o.toDst,As(o.toCwd,n,((n,u)=>{if(n)return r(n);const o=ms.dirname(t);Ss(o,((n,i)=>n?r(n):i?hs.symlink(e,t,u,r):void ys(o,(n=>{if(n)return r(n);hs.symlink(e,t,u,r)}))))}))}))))})),createSymlinkSync:function(e,t,n){if(hs.existsSync(t))return;const r=gs(e,t);e=r.toDst,n=vs(r.toCwd,n);const u=ms.dirname(t);return hs.existsSync(u)||Cs(u),hs.symlinkSync(e,t,n)}};var Os,bs={createFile:ns.createFile,createFileSync:ns.createFileSync,ensureFile:ns.createFile,ensureFileSync:ns.createFileSync,createLink:cs.createLink,createLinkSync:cs.createLinkSync,ensureLink:cs.createLink,ensureLinkSync:cs.createLinkSync,createSymlink:ws.createSymlink,createSymlinkSync:ws.createSymlinkSync,ensureSymlink:ws.createSymlink,ensureSymlinkSync:ws.createSymlinkSync};try{Os=we}catch(e){Os=D.default}function _s(e,t){var n,r="\n";return"object"==typeof t&&null!==t&&(t.spaces&&(n=t.spaces),t.EOL&&(r=t.EOL)),JSON.stringify(e,t?t.replacer:null,n).replace(/\n/g,r)+r}function Bs(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e=e.replace(/^\uFEFF/,"")}var Ps={readFile:function(e,t,n){null==n&&(n=t,t={}),"string"==typeof t&&(t={encoding:t});var r=(t=t||{}).fs||Os,u=!0;"throws"in t&&(u=t.throws),r.readFile(e,t,(function(r,o){if(r)return n(r);var i;o=Bs(o);try{i=JSON.parse(o,t?t.reviver:null)}catch(t){return u?(t.message=e+": "+t.message,n(t)):n(null,null)}n(null,i)}))},readFileSync:function(e,t){"string"==typeof(t=t||{})&&(t={encoding:t});var n=t.fs||Os,r=!0;"throws"in t&&(r=t.throws);try{var u=n.readFileSync(e,t);return u=Bs(u),JSON.parse(u,t.reviver)}catch(t){if(r)throw t.message=e+": "+t.message,t;return null}},writeFile:function(e,t,n,r){null==r&&(r=n,n={});var u=(n=n||{}).fs||Os,o="";try{o=_s(t,n)}catch(e){return void(r&&r(e,null))}u.writeFile(e,o,n,r)},writeFileSync:function(e,t,n){var r=(n=n||{}).fs||Os,u=_s(t,n);return r.writeFileSync(e,u,n)}},ks=Ps;const xs=yo.fromCallback,Ns=ks;var Is={readJson:xs(Ns.readFile),readJsonSync:Ns.readFileSync,writeJson:xs(Ns.writeFile),writeJsonSync:Ns.writeFileSync};const Ts=p.default,Rs=Io,Ms=fi.pathExists,Ls=Is;var js=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=Ts.dirname(e);Ms(u,((o,i)=>o?r(o):i?Ls.writeJson(e,t,n,r):void Rs.mkdirs(u,(u=>{if(u)return r(u);Ls.writeJson(e,t,n,r)}))))};const $s=we,Hs=p.default,Js=Io,Gs=Is;var Vs=function(e,t,n){const r=Hs.dirname(e);$s.existsSync(r)||Js.mkdirsSync(r),Gs.writeJsonSync(e,t,n)};const Us=yo.fromCallback,Ws=Is;Ws.outputJson=Us(js),Ws.outputJsonSync=Vs,Ws.outputJSON=Ws.outputJson,Ws.outputJSONSync=Ws.outputJsonSync,Ws.writeJSON=Ws.writeJson,Ws.writeJSONSync=Ws.writeJsonSync,Ws.readJSON=Ws.readJson,Ws.readJSONSync=Ws.readJsonSync;var zs=Ws;const Ks=we,qs=p.default,Ys=ci.copySync,Xs=Ji.removeSync,Zs=Io.mkdirpSync,Qs=Zo;function ec(e,t,n){try{Ks.renameSync(e,t)}catch(r){if("EXDEV"!==r.code)throw r;return function(e,t,n){const r={overwrite:n,errorOnExist:!0};return Ys(e,t,r),Xs(e)}(e,t,n)}}var tc=function(e,t,n){const r=(n=n||{}).overwrite||n.clobber||!1,{srcStat:u}=Qs.checkPathsSync(e,t,"move");return Qs.checkParentPathsSync(e,u,t,"move"),Zs(qs.dirname(t)),function(e,t,n){if(n)return Xs(t),ec(e,t,n);if(Ks.existsSync(t))throw new Error("dest already exists.");return ec(e,t,n)}(e,t,r)},nc={moveSync:tc};const rc=we,uc=p.default,oc=bi.copy,ic=Ji.remove,sc=Io.mkdirp,cc=fi.pathExists,ac=Zo;function lc(e,t,n,r){rc.rename(e,t,(u=>u?"EXDEV"!==u.code?r(u):function(e,t,n,r){const u={overwrite:n,errorOnExist:!0};oc(e,t,u,(t=>t?r(t):ic(e,r)))}(e,t,n,r):r()))}var fc=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=n.overwrite||n.clobber||!1;ac.checkPaths(e,t,"move",((n,o)=>{if(n)return r(n);const{srcStat:i}=o;ac.checkParentPaths(e,i,t,"move",(n=>{if(n)return r(n);sc(uc.dirname(t),(n=>n?r(n):function(e,t,n,r){if(n)return ic(t,(u=>u?r(u):lc(e,t,n,r)));cc(t,((u,o)=>u?r(u):o?r(new Error("dest already exists.")):lc(e,t,n,r)))}(e,t,u,r)))}))}))};var dc={move:(0,yo.fromCallback)(fc)};const Dc=yo.fromCallback,pc=we,Ec=p.default,mc=Io,hc=fi.pathExists;var yc={outputFile:Dc((function(e,t,n,r){"function"==typeof n&&(r=n,n="utf8");const u=Ec.dirname(e);hc(u,((o,i)=>o?r(o):i?pc.writeFile(e,t,n,r):void mc.mkdirs(u,(u=>{if(u)return r(u);pc.writeFile(e,t,n,r)}))))})),outputFileSync:function(e,...t){const n=Ec.dirname(e);if(pc.existsSync(n))return pc.writeFileSync(e,...t);mc.mkdirsSync(n),pc.writeFileSync(e,...t)}};!function(e){e.exports=Object.assign({},ho,ci,bi,Yi,bs,zs,Io,nc,dc,yc,fi,Ji);const t=D.default;Object.getOwnPropertyDescriptor(t,"promises")&&Object.defineProperty(e.exports,"promises",{get:()=>t.promises})}(mo);const Cc=Nr.exports("streamroller:fileNameFormatter"),Fc=p.default;const gc=Nr.exports("streamroller:fileNameParser"),Ac=nu.exports;const vc=Nr.exports("streamroller:moveAndMaybeCompressFile"),Sc=mo.exports,wc=v.default;var Oc=async(e,t,n)=>{if(n=function(e){const t={mode:parseInt("0600",8),compress:!1},n=Object.assign({},t,e);return vc(`_parseOption: moveAndMaybeCompressFile called with option=${JSON.stringify(n)}`),n}(n),e!==t){if(await Sc.pathExists(e))if(vc(`moveAndMaybeCompressFile: moving file from ${e} to ${t} ${n.compress?"with":"without"} compress`),n.compress)await new Promise(((r,u)=>{let o=!1;const i=Sc.createWriteStream(t,{mode:n.mode,flags:"wx"}).on("open",(()=>{o=!0;const t=Sc.createReadStream(e).on("open",(()=>{t.pipe(wc.createGzip()).pipe(i)})).on("error",(t=>{vc(`moveAndMaybeCompressFile: error reading ${e}`,t),i.destroy(t)}))})).on("finish",(()=>{vc(`moveAndMaybeCompressFile: finished compressing ${t}, deleting ${e}`),Sc.unlink(e).then(r).catch((t=>{vc(`moveAndMaybeCompressFile: error deleting ${e}, truncating instead`,t),Sc.truncate(e).then(r).catch((t=>{vc(`moveAndMaybeCompressFile: error truncating ${e}`,t),u(t)}))}))})).on("error",(e=>{o?(vc(`moveAndMaybeCompressFile: error writing ${t}, deleting`,e),Sc.unlink(t).then((()=>{u(e)})).catch((e=>{vc(`moveAndMaybeCompressFile: error deleting ${t}`,e),u(e)}))):(vc(`moveAndMaybeCompressFile: error creating ${t}`,e),u(e))}))})).catch((()=>{}));else{vc(`moveAndMaybeCompressFile: renaming ${e} to ${t}`);try{await Sc.move(e,t,{overwrite:!0})}catch(n){if(vc(`moveAndMaybeCompressFile: error renaming ${e} to ${t}`,n),"ENOENT"!==n.code){vc("moveAndMaybeCompressFile: trying copy+truncate instead");try{await Sc.copy(e,t,{overwrite:!0}),await Sc.truncate(e)}catch(e){vc("moveAndMaybeCompressFile: error copy+truncate",e)}}}}}else vc("moveAndMaybeCompressFile: source and target are the same, not doing anything")};const bc=Nr.exports("streamroller:RollingFileWriteStream"),_c=mo.exports,Bc=p.default,Pc=E.default,kc=()=>new Date,xc=nu.exports,{Writable:Nc}=C.default,Ic=({file:e,keepFileExt:t,needsIndex:n,alwaysIncludeDate:r,compress:u,fileNameSep:o})=>{let i=o||".";const s=Fc.join(e.dir,e.name),c=t=>t+e.ext,a=(e,t,r)=>!n&&r||!t?e:e+i+t,l=(e,t,n)=>(t>0||r)&&n?e+i+n:e,f=(e,t)=>t&&u?e+".gz":e,d=t?[l,a,c,f]:[c,l,a,f];return({date:e,index:t})=>(Cc(`_formatFileName: date=${e}, index=${t}`),d.reduce(((n,r)=>r(n,t,e)),s))},Tc=({file:e,keepFileExt:t,pattern:n,fileNameSep:r})=>{let u=r||".";const o="__NOT_MATCHING__";let i=[(e,t)=>e.endsWith(".gz")?(gc("it is gzipped"),t.isCompressed=!0,e.slice(0,-1*".gz".length)):e,t?t=>t.startsWith(e.name)&&t.endsWith(e.ext)?(gc("it starts and ends with the right things"),t.slice(e.name.length+1,-1*e.ext.length)):o:t=>t.startsWith(e.base)?(gc("it starts with the right things"),t.slice(e.base.length+1)):o,n?(e,t)=>{const r=e.split(u);let o=r[r.length-1];gc("items: ",r,", indexStr: ",o);let i=e;void 0!==o&&o.match(/^\d+$/)?(i=e.slice(0,-1*(o.length+1)),gc(`dateStr is ${i}`),n&&!i&&(i=o,o="0")):o="0";try{const r=Ac.parse(n,i,new Date(0,0));return Ac.asString(n,r)!==i?e:(t.index=parseInt(o,10),t.date=i,t.timestamp=r.getTime(),"")}catch(t){return gc(`Problem parsing ${i} as ${n}, error was: `,t),e}}:(e,t)=>e.match(/^\d+$/)?(gc("it has an index"),t.index=parseInt(e,10),""):e];return e=>{let t={filename:e,index:0,isCompressed:!1};return i.reduce(((e,n)=>n(e,t)),e)?null:t}},Rc=Oc;var Mc=class extends Nc{constructor(e,t){if(bc(`constructor: creating RollingFileWriteStream. path=${e}`),"string"!=typeof e||0===e.length)throw new Error(`Invalid filename: ${e}`);if(e.endsWith(Bc.sep))throw new Error(`Filename is a directory: ${e}`);0===e.indexOf(`~${Bc.sep}`)&&(e=e.replace("~",Pc.homedir())),super(t),this.options=this._parseOption(t),this.fileObject=Bc.parse(e),""===this.fileObject.dir&&(this.fileObject=Bc.parse(Bc.join(process.cwd(),e))),this.fileFormatter=Ic({file:this.fileObject,alwaysIncludeDate:this.options.alwaysIncludePattern,needsIndex:this.options.maxSize 0`)}else delete n.maxSize;if(n.numBackups||0===n.numBackups){if(n.numBackups<0)throw new Error(`options.numBackups (${n.numBackups}) should be >= 0`);if(n.numBackups>=Number.MAX_SAFE_INTEGER)throw new Error(`options.numBackups (${n.numBackups}) should be < Number.MAX_SAFE_INTEGER`);n.numToKeep=n.numBackups+1}else if(n.numToKeep<=0)throw new Error(`options.numToKeep (${n.numToKeep}) should be > 0`);return bc(`_parseOption: creating stream with option=${JSON.stringify(n)}`),n}_final(e){this.currentFileStream.end("",this.options.encoding,e)}_write(e,t,n){this._shouldRoll().then((()=>{bc(`_write: writing chunk. file=${this.currentFileStream.path} state=${JSON.stringify(this.state)} chunk=${e}`),this.currentFileStream.write(e,t,(t=>{this.state.currentSize+=e.length,n(t)}))}))}async _shouldRoll(){(this._dateChanged()||this._tooBig())&&(bc(`_shouldRoll: rolling because dateChanged? ${this._dateChanged()} or tooBig? ${this._tooBig()}`),await this._roll())}_dateChanged(){return this.state.currentDate&&this.state.currentDate!==xc(this.options.pattern,kc())}_tooBig(){return this.state.currentSize>=this.options.maxSize}_roll(){return bc("_roll: closing the current stream"),new Promise(((e,t)=>{this.currentFileStream.end("",this.options.encoding,(()=>{this._moveOldFiles().then(e).catch(t)}))}))}async _moveOldFiles(){const e=await this._getExistingFiles();for(let t=(this.state.currentDate?e.filter((e=>e.date===this.state.currentDate)):e).length;t>=0;t--){bc(`_moveOldFiles: i = ${t}`);const e=this.fileFormatter({date:this.state.currentDate,index:t}),n=this.fileFormatter({date:this.state.currentDate,index:t+1}),r={compress:this.options.compress&&0===t,mode:this.options.mode};await Rc(e,n,r)}this.state.currentSize=0,this.state.currentDate=this.state.currentDate?xc(this.options.pattern,kc()):null,bc(`_moveOldFiles: finished rolling files. state=${JSON.stringify(this.state)}`),this._renewWriteStream(),await new Promise(((e,t)=>{this.currentFileStream.write("","utf8",(()=>{this._clean().then(e).catch(t)}))}))}async _getExistingFiles(){const e=await _c.readdir(this.fileObject.dir).catch((()=>[]));bc(`_getExistingFiles: files=${e}`);const t=e.map((e=>this.fileNameParser(e))).filter((e=>e)),n=e=>(e.timestamp?e.timestamp:kc().getTime())-e.index;return t.sort(((e,t)=>n(e)-n(t))),t}_renewWriteStream(){const e=this.fileFormatter({date:this.state.currentDate,index:0}),t=e=>{try{return _c.mkdirSync(e,{recursive:!0})}catch(n){if("ENOENT"===n.code)return t(Bc.dirname(e)),t(e);if("EEXIST"!==n.code&&"EROFS"!==n.code)throw n;try{if(_c.statSync(e).isDirectory())return e;throw n}catch(e){throw n}}};t(this.fileObject.dir);const n={flags:this.options.flags,encoding:this.options.encoding,mode:this.options.mode};var r,u;_c.appendFileSync(e,"",(r={...n},u="flags",r["flag"]=r[u],delete r[u],r)),this.currentFileStream=_c.createWriteStream(e,n),this.currentFileStream.on("error",(e=>{this.emit("error",e)}))}async _clean(){const e=await this._getExistingFiles();if(bc(`_clean: numToKeep = ${this.options.numToKeep}, existingFiles = ${e.length}`),bc("_clean: existing files are: ",e),this._tooManyFiles(e.length)){const n=e.slice(0,e.length-this.options.numToKeep).map((e=>Bc.format({dir:this.fileObject.dir,base:e.filename})));await(t=n,bc(`deleteFiles: files to delete: ${t}`),Promise.all(t.map((e=>_c.unlink(e).catch((t=>{bc(`deleteFiles: error when unlinking ${e}, ignoring. Error was ${t}`)}))))))}var t}_tooManyFiles(e){return this.options.numToKeep>0&&e>this.options.numToKeep}};const Lc=Mc;var jc=class extends Lc{constructor(e,t,n,r){r||(r={}),t&&(r.maxSize=t),r.numBackups||0===r.numBackups||(n||0===n||(n=1),r.numBackups=n),super(e,r),this.backups=r.numBackups,this.size=this.options.maxSize}get theStream(){return this.currentFileStream}};const $c=Mc;var Hc={RollingFileWriteStream:Mc,RollingFileStream:jc,DateRollingFileStream:class extends $c{constructor(e,t,n){t&&"object"==typeof t&&(n=t,t=null),n||(n={}),t||(t="yyyy-MM-dd"),n.pattern=t,n.numBackups||0===n.numBackups?n.daysToKeep=n.numBackups:(n.daysToKeep||0===n.daysToKeep?process.emitWarning("options.daysToKeep is deprecated due to the confusion it causes when used together with file size rolling. Please use options.numBackups instead.","DeprecationWarning","streamroller-DEP0001"):n.daysToKeep=1,n.numBackups=n.daysToKeep),super(e,n),this.mode=this.options.mode}get theStream(){return this.currentFileStream}}};const Jc=Nr.exports("log4js:file"),Gc=p.default,Vc=Hc,Uc=E.default.EOL;let Wc=!1;const zc=new Set;function Kc(){zc.forEach((e=>{e.sighupHandler()}))}function qc(e,t,n,r){const u=new Vc.RollingFileStream(e,t,n,r);return u.on("error",(t=>{console.error("log4js.fileAppender - Writing to file %s, error happened ",e,t)})),u.on("drain",(()=>{process.emit("log4js:pause",!1)})),u}Eo.configure=function(e,t){let n=t.basicLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),e.mode=e.mode||384,function(e,t,n,r,u,o){e=Gc.normalize(e),Jc("Creating file appender (",e,", ",n,", ",r=r||0===r?r:5,", ",u,", ",o,")");let i=qc(e,n,r,u);const s=function(e){if(i.writable){if(!0===u.removeColor){const t=/\x1b[[0-9;]*m/g;e.data=e.data.map((e=>"string"==typeof e?e.replace(t,""):e))}i.write(t(e,o)+Uc,"utf8")||process.emit("log4js:pause",!0)}};return s.reopen=function(){i.end((()=>{i=qc(e,n,r,u)}))},s.sighupHandler=function(){Jc("SIGHUP handler called."),s.reopen()},s.shutdown=function(e){zc.delete(s),0===zc.size&&Wc&&(process.removeListener("SIGHUP",Kc),Wc=!1),i.end("","utf-8",e)},zc.add(s),Wc||(process.on("SIGHUP",Kc),Wc=!0),s}(e.filename,n,e.maxLogSize,e.backups,e,e.timezoneOffset)};var Yc={};const Xc=Hc,Zc=E.default.EOL;function Qc(e,t,n,r,u){r.maxSize=r.maxLogSize;const o=function(e,t,n){const r=new Xc.DateRollingFileStream(e,t,n);return r.on("error",(t=>{console.error("log4js.dateFileAppender - Writing to file %s, error happened ",e,t)})),r.on("drain",(()=>{process.emit("log4js:pause",!1)})),r}(e,t,r),i=function(e){o.writable&&(o.write(n(e,u)+Zc,"utf8")||process.emit("log4js:pause",!0))};return i.shutdown=function(e){o.end("","utf-8",e)},i}Yc.configure=function(e,t){let n=t.basicLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),e.alwaysIncludePattern||(e.alwaysIncludePattern=!1),e.mode=e.mode||384,Qc(e.filename,e.pattern,n,e,e.timezoneOffset)};var ea={};const ta=Nr.exports("log4js:fileSync"),na=p.default,ra=D.default,ua=E.default.EOL||"\n";function oa(e,t){if(ra.existsSync(e))return;const n=ra.openSync(e,t.flags,t.mode);ra.closeSync(n)}class ia{constructor(e,t,n,r){ta("In RollingFileStream"),function(){if(!e||!t||t<=0)throw new Error("You must specify a filename and file size")}(),this.filename=e,this.size=t,this.backups=n,this.options=r,this.currentSize=0,this.currentSize=function(e){let t=0;try{t=ra.statSync(e).size}catch(t){oa(e,r)}return t}(this.filename)}shouldRoll(){return ta("should roll with current size %d, and max size %d",this.currentSize,this.size),this.currentSize>=this.size}roll(e){const t=this,n=new RegExp(`^${na.basename(e)}`);function r(e){return n.test(e)}function u(t){return parseInt(t.substring(`${na.basename(e)}.`.length),10)||0}function o(e,t){return u(e)>u(t)?1:u(e) ${e}.${r+1}`),ra.renameSync(na.join(na.dirname(e),n),`${e}.${r+1}`)}}ta("Rolling, rolling, rolling"),ta("Renaming the old files"),ra.readdirSync(na.dirname(e)).filter(r).sort(o).reverse().forEach(i)}write(e,t){const n=this;ta("in write"),this.shouldRoll()&&(this.currentSize=0,this.roll(this.filename)),ta("writing the chunk to the file"),n.currentSize+=e.length,ra.appendFileSync(n.filename,e)}}ea.configure=function(e,t){let n=t.basicLayout;e.layout&&(n=t.layout(e.layout.type,e.layout));const r={flags:e.flags||"a",encoding:e.encoding||"utf8",mode:e.mode||384};return function(e,t,n,r,u,o){ta("fileSync appender created");const i=function(e,t,n){let r;var u;return t?r=new ia(e,t,n,o):(oa(u=e,o),r={write(e){ra.appendFileSync(u,e)}}),r}(e=na.normalize(e),n,r=r||0===r?r:5);return e=>{i.write(t(e,u)+ua)}}(e.filename,n,e.maxLogSize,e.backups,e.timezoneOffset,r)};var sa={};const ca=Nr.exports("log4js:tcp"),aa=S.default;sa.configure=function(e,t){ca(`configure with config = ${e}`);let n=function(e){return e.serialise()};return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){let n=!1;const r=[];let u,o=3,i="__LOG4JS__";function s(e){ca("Writing log event to socket"),n=u.write(`${t(e)}${i}`,"utf8")}function c(){let e;for(ca("emptying buffer");e=r.shift();)s(e)}function a(e){n?s(e):(ca("buffering log event because it cannot write at the moment"),r.push(e))}return function t(){ca(`appender creating socket to ${e.host||"localhost"}:${e.port||5e3}`),i=`${e.endMsg||"__LOG4JS__"}`,u=aa.createConnection(e.port||5e3,e.host||"localhost"),u.on("connect",(()=>{ca("socket connected"),c(),n=!0})),u.on("drain",(()=>{ca("drain event received, emptying buffer"),n=!0,c()})),u.on("timeout",u.end.bind(u)),u.on("error",(e=>{ca("connection error",e),n=!1,c()})),u.on("close",t)}(),a.shutdown=function(e){ca("shutdown called"),r.length&&o?(ca("buffer has items, waiting 100ms to empty"),o-=1,setTimeout((()=>{a.shutdown(e)}),100)):(u.removeAllListeners("close"),u.end(e))},a}(e,n)};const la=p.default,fa=Nr.exports("log4js:appenders"),da=tu,Da=eo,pa=gu,Ea=hu,ma=to,ha=new Map;ha.set("console",oo),ha.set("stdout",so),ha.set("stderr",co),ha.set("logLevelFilter",ao),ha.set("categoryFilter",lo),ha.set("noLogFilter",Do),ha.set("file",Eo),ha.set("dateFile",Yc),ha.set("fileSync",ea),ha.set("tcp",sa);const ya=new Map,Ca=(e,t)=>{fa("Loading module from ",e);try{return require(e)}catch(n){return void da.throwExceptionIf(t,"MODULE_NOT_FOUND"!==n.code,`appender "${e}" could not be loaded (error was: ${n})`)}},Fa=new Set,ga=(e,t)=>{if(ya.has(e))return ya.get(e);if(!t.appenders[e])return!1;if(Fa.has(e))throw new Error(`Dependency loop detected for appender ${e}.`);Fa.add(e),fa(`Creating appender ${e}`);const n=Aa(e,t);return Fa.delete(e),ya.set(e,n),n},Aa=(e,t)=>{const n=t.appenders[e],r=n.type.configure?n.type:((e,t)=>ha.get(e)||Ca(`./${e}`,t)||Ca(e,t)||require.main&&Ca(la.join(la.dirname(require.main.filename),e),t)||Ca(la.join(process.cwd(),e),t))(n.type,t);return da.throwExceptionIf(t,da.not(r),`appender "${e}" is not valid (type "${n.type}" could not be found)`),r.appender&&fa(`DEPRECATION: Appender ${n.type} exports an appender function.`),r.shutdown&&fa(`DEPRECATION: Appender ${n.type} exports a shutdown function.`),fa(`${e}: clustering.isMaster ? ${Da.isMaster()}`),fa(`${e}: appenderModule is ${F.default.inspect(r)}`),Da.onlyOnMaster((()=>(fa(`calling appenderModule.configure for ${e} / ${n.type}`),r.configure(ma.modifyConfig(n),Ea,(e=>ga(e,t)),pa))),(()=>{}))},va=e=>{ya.clear(),Fa.clear();const t=[];Object.values(e.categories).forEach((e=>{t.push(...e.appenders)})),Object.keys(e.appenders).forEach((n=>{(t.includes(n)||"tcp-server"===e.appenders[n].type)&&ga(n,e)}))},Sa=()=>{va({appenders:{out:{type:"stdout"}},categories:{default:{appenders:["out"],level:"trace"}}})};Sa(),da.addListener((e=>{da.throwExceptionIf(e,da.not(da.anObject(e.appenders)),'must have a property "appenders" of type object.');const t=Object.keys(e.appenders);da.throwExceptionIf(e,da.not(t.length),"must define at least one appender."),t.forEach((t=>{da.throwExceptionIf(e,da.not(e.appenders[t].type),`appender "${t}" is not valid (must be an object with property "type")`)}))})),da.addListener(va),Au.exports=ya,Au.exports.init=Sa;var wa={exports:{}};!function(e){const t=Nr.exports("log4js:categories"),n=tu,r=gu,u=Au.exports,o=new Map;function i(e,t,n){if(!1===t.inherit)return;const r=n.lastIndexOf(".");if(r<0)return;const u=n.substring(0,r);let o=e.categories[u];o||(o={inherit:!0,appenders:[]}),i(e,o,u),!e.categories[u]&&o.appenders&&o.appenders.length&&o.level&&(e.categories[u]=o),t.appenders=t.appenders||[],t.level=t.level||o.level,o.appenders.forEach((e=>{t.appenders.includes(e)||t.appenders.push(e)})),t.parent=o}function s(e){if(!e.categories)return;Object.keys(e.categories).forEach((t=>{const n=e.categories[t];i(e,n,t)}))}n.addPreProcessingListener((e=>s(e))),n.addListener((e=>{n.throwExceptionIf(e,n.not(n.anObject(e.categories)),'must have a property "categories" of type object.');const t=Object.keys(e.categories);n.throwExceptionIf(e,n.not(t.length),"must define at least one category."),t.forEach((t=>{const o=e.categories[t];n.throwExceptionIf(e,[n.not(o.appenders),n.not(o.level)],`category "${t}" is not valid (must be an object with properties "appenders" and "level")`),n.throwExceptionIf(e,n.not(Array.isArray(o.appenders)),`category "${t}" is not valid (appenders must be an array of appender names)`),n.throwExceptionIf(e,n.not(o.appenders.length),`category "${t}" is not valid (appenders must contain at least one appender name)`),Object.prototype.hasOwnProperty.call(o,"enableCallStack")&&n.throwExceptionIf(e,"boolean"!=typeof o.enableCallStack,`category "${t}" is not valid (enableCallStack must be boolean type)`),o.appenders.forEach((r=>{n.throwExceptionIf(e,n.not(u.get(r)),`category "${t}" is not valid (appender "${r}" is not defined)`)})),n.throwExceptionIf(e,n.not(r.getLevel(o.level)),`category "${t}" is not valid (level "${o.level}" not recognised; valid levels are ${r.levels.join(", ")})`)})),n.throwExceptionIf(e,n.not(e.categories.default),'must define a "default" category.')}));const c=e=>{o.clear();Object.keys(e.categories).forEach((n=>{const i=e.categories[n],s=[];i.appenders.forEach((e=>{s.push(u.get(e)),t(`Creating category ${n}`),o.set(n,{appenders:s,level:r.getLevel(i.level),enableCallStack:i.enableCallStack||!1})}))}))},a=()=>{c({categories:{default:{appenders:["out"],level:"OFF"}}})};a(),n.addListener(c);const l=e=>(t(`configForCategory: searching for config for ${e}`),o.has(e)?(t(`configForCategory: ${e} exists in config, returning it`),o.get(e)):e.indexOf(".")>0?(t(`configForCategory: ${e} has hierarchy, searching for parents`),l(e.substring(0,e.lastIndexOf(".")))):(t("configForCategory: returning config for default category"),l("default")));e.exports=o,e.exports=Object.assign(e.exports,{appendersForCategory:e=>l(e).appenders,getLevelForCategory:e=>l(e).level,setLevelForCategory:(e,n)=>{let r=o.get(e);if(t(`setLevelForCategory: found ${r} for ${e}`),!r){const n=l(e);t(`setLevelForCategory: no config found for category, found ${n} for parents of ${e}`),r={appenders:n.appenders}}r.level=n,o.set(e,r)},getEnableCallStackForCategory:e=>!0===l(e).enableCallStack,setEnableCallStackForCategory:(e,t)=>{l(e).enableCallStack=t},init:a})}(wa);const Oa=Nr.exports("log4js:logger"),ba=Hu,_a=gu,Ba=eo,Pa=wa.exports,ka=tu,xa=/at (?:(.+)\s+\()?(?:(.+?):(\d+)(?::(\d+))?|([^)]+))\)?/;function Na(e,t=4){const n=e.stack.split("\n").slice(t),r=xa.exec(n[0]);return r&&6===r.length?{functionName:r[1],fileName:r[2],lineNumber:parseInt(r[3],10),columnNumber:parseInt(r[4],10),callStack:n.join("\n")}:null}class Ia{constructor(e){if(!e)throw new Error("No category provided.");this.category=e,this.context={},this.parseCallStack=Na,Oa(`Logger created (${this.category}, ${this.level})`)}get level(){return _a.getLevel(Pa.getLevelForCategory(this.category),_a.TRACE)}set level(e){Pa.setLevelForCategory(this.category,_a.getLevel(e,this.level))}get useCallStack(){return Pa.getEnableCallStackForCategory(this.category)}set useCallStack(e){Pa.setEnableCallStackForCategory(this.category,!0===e)}log(e,...t){let n=_a.getLevel(e);n||(this._log(_a.WARN,"log4js:logger.log: invalid value for log-level as first parameter given: ",e),n=_a.INFO),this.isLevelEnabled(n)&&this._log(n,t)}isLevelEnabled(e){return this.level.isLessThanOrEqualTo(e)}_log(e,t){Oa(`sending log data (${e}) to appenders`);const n=new ba(this.category,e,t,this.context,this.useCallStack&&this.parseCallStack(new Error));Ba.send(n)}addContext(e,t){this.context[e]=t}removeContext(e){delete this.context[e]}clearContext(){this.context={}}setParseCallStackFunction(e){this.parseCallStack=e}}function Ta(e){const t=_a.getLevel(e),n=t.toString().toLowerCase().replace(/_([a-z])/g,(e=>e[1].toUpperCase())),r=n[0].toUpperCase()+n.slice(1);Ia.prototype[`is${r}Enabled`]=function(){return this.isLevelEnabled(t)},Ia.prototype[n]=function(...e){this.log(t,...e)}}_a.levels.forEach(Ta),ka.addListener((()=>{_a.levels.forEach(Ta)}));var Ra=Ia;const Ma=gu;function La(e){return e.originalUrl||e.url}function ja(e,t){for(let n=0;ne.source?e.source:e));t=new RegExp(n.join("|"))}return t}(t.nolog);return(e,i,s)=>{if(e._logging)return s();if(o&&o.test(e.originalUrl))return s();if(n.isLevelEnabled(r)||"auto"===t.level){const o=new Date,{writeHead:s}=i;e._logging=!0,i.writeHead=(e,t)=>{i.writeHead=s,i.writeHead(e,t),i.__statusCode=e,i.__headers=t||{}},i.on("finish",(()=>{i.responseTime=new Date-o,i.statusCode&&"auto"===t.level&&(r=Ma.INFO,i.statusCode>=300&&(r=Ma.WARN),i.statusCode>=400&&(r=Ma.ERROR)),r=function(e,t,n){let r=t;if(n){const t=n.find((t=>{let n=!1;return n=t.from&&t.to?e>=t.from&&e<=t.to:-1!==t.codes.indexOf(e),n}));t&&(r=Ma.getLevel(t.level,r))}return r}(i.statusCode,r,t.statusRules);const s=function(e,t,n){const r=[];return r.push({token:":url",replacement:La(e)}),r.push({token:":protocol",replacement:e.protocol}),r.push({token:":hostname",replacement:e.hostname}),r.push({token:":method",replacement:e.method}),r.push({token:":status",replacement:t.__statusCode||t.statusCode}),r.push({token:":response-time",replacement:t.responseTime}),r.push({token:":date",replacement:(new Date).toUTCString()}),r.push({token:":referrer",replacement:e.headers.referer||e.headers.referrer||""}),r.push({token:":http-version",replacement:`${e.httpVersionMajor}.${e.httpVersionMinor}`}),r.push({token:":remote-addr",replacement:e.headers["x-forwarded-for"]||e.ip||e._remoteAddress||e.socket&&(e.socket.remoteAddress||e.socket.socket&&e.socket.socket.remoteAddress)}),r.push({token:":user-agent",replacement:e.headers["user-agent"]}),r.push({token:":content-length",replacement:t.getHeader("content-length")||t.__headers&&t.__headers["Content-Length"]||"-"}),r.push({token:/:req\[([^\]]+)]/g,replacement:(t,n)=>e.headers[n.toLowerCase()]}),r.push({token:/:res\[([^\]]+)]/g,replacement:(e,n)=>t.getHeader(n.toLowerCase())||t.__headers&&t.__headers[n]}),(e=>{const t=e.concat();for(let e=0;eja(e,s)));t&&n.log(r,t)}else n.log(r,ja(u,s));t.context&&n.removeContext("res")}))}return s()}},nl=Va;let rl=!1;function ul(e){if(!rl)return;Ua("Received log event ",e);Za.appendersForCategory(e.categoryName).forEach((t=>{t(e)}))}function ol(e){rl&&il();let t=e;return"string"==typeof t&&(t=function(e){Ua(`Loading configuration from ${e}`);try{return JSON.parse(Wa.readFileSync(e,"utf8"))}catch(t){throw new Error(`Problem reading config from file "${e}". Error was ${t.message}`,t)}}(e)),Ua(`Configuration is ${t}`),Ka.configure(za(t)),el.onMessage(ul),rl=!0,sl}function il(e){Ua("Shutdown called. Disabling all log writing."),rl=!1;const t=Array.from(Xa.values());Xa.init(),Za.init();const n=t.reduceRight(((e,t)=>t.shutdown?e+1:e),0);if(0===n)return Ua("No appenders with shutdown functions found."),void 0!==e&&e();let r,u=0;function o(t){r=r||t,u+=1,Ua(`Appender shutdowns complete: ${u} / ${n}`),u>=n&&(Ua("All shutdown functions completed."),e&&e(r))}return Ua(`Found ${n} appenders with shutdown functions.`),t.filter((e=>e.shutdown)).forEach((e=>e.shutdown(o))),null}const sl={getLogger:function(e){return rl||ol(process.env.LOG4JS_CONFIG||{appenders:{out:{type:"stdout"}},categories:{default:{appenders:["out"],level:"OFF"}}}),new Qa(e||"default")},configure:ol,shutdown:il,connectLogger:tl,levels:Ya,addLayout:qa.addLayout,recording:function(){return nl}};var cl=sl,al={};Object.defineProperty(al,"__esModule",{value:!0}),al.levelMap=al.getLevel=al.setCategoriesLevel=al.getConfiguration=al.setConfiguration=void 0;const ll=cl;let fl={appenders:{debug:{type:"stdout",layout:{type:"pattern",pattern:"[%d] > hvigor %p %c %[%m%]"}},info:{type:"stdout",layout:{type:"pattern",pattern:"[%d] > hvigor %[%m%]"}},"no-pattern-info":{type:"stdout",layout:{type:"pattern",pattern:"%m"}},wrong:{type:"stderr",layout:{type:"pattern",pattern:"[%d] > hvigor %[%p: %m%]"}},"just-debug":{type:"logLevelFilter",appender:"debug",level:"debug",maxLevel:"debug"},"just-info":{type:"logLevelFilter",appender:"info",level:"info",maxLevel:"info"},"just-wrong":{type:"logLevelFilter",appender:"wrong",level:"warn",maxLevel:"error"}},categories:{default:{appenders:["just-debug","just-info","just-wrong"],level:"debug"},"no-pattern-info":{appenders:["no-pattern-info"],level:"info"}}};al.setConfiguration=e=>{fl=e};al.getConfiguration=()=>fl;let dl=ll.levels.DEBUG;al.setCategoriesLevel=(e,t)=>{dl=e;const n=fl.categories;for(const r in n)(null==t?void 0:t.includes(r))||Object.prototype.hasOwnProperty.call(n,r)&&(n[r].level=e.levelStr)};al.getLevel=()=>dl,al.levelMap=new Map([["ALL",ll.levels.ALL],["MARK",ll.levels.MARK],["TRACE",ll.levels.TRACE],["DEBUG",ll.levels.DEBUG],["INFO",ll.levels.INFO],["WARN",ll.levels.WARN],["ERROR",ll.levels.ERROR],["FATAL",ll.levels.FATAL],["OFF",ll.levels.OFF]]);var Dl=w&&w.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),pl=w&&w.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),El=w&&w.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&Dl(t,e,n);return pl(t,e),t};Object.defineProperty(xr,"__esModule",{value:!0}),xr.evaluateLogLevel=xr.HvigorLogger=void 0;const ml=El(cl),hl=cl,yl=El(F.default),Cl=al;class Fl{constructor(e){ml.configure((0,Cl.getConfiguration)()),this._logger=ml.getLogger(e),this._logger.level=(0,Cl.getLevel)()}static getLogger(e){return new Fl(e)}log(e,...t){this._logger.log(e,...t)}debug(e,...t){this._logger.debug(e,...t)}info(e,...t){this._logger.info(e,...t)}warn(e,...t){void 0!==e&&""!==e&&this._logger.warn(e,...t)}error(e,...t){this._logger.error(e,...t)}_printTaskExecuteInfo(e,t){this.info(`Finished :${e}... after ${t}`)}_printFailedTaskInfo(e){this.error(`Failed :${e}... `)}_printDisabledTaskInfo(e){this.info(`Disabled :${e}... `)}_printUpToDateTaskInfo(e){this.info(`UP-TO-DATE :${e}... `)}errorMessageExit(e,...t){throw new Error(yl.format(e,...t))}errorExit(e,t,...n){t&&this._logger.error(t,n),this._logger.error(e.stack)}setLevel(e,t){(0,Cl.setCategoriesLevel)(e,t),ml.shutdown(),ml.configure((0,Cl.getConfiguration)())}getLevel(){return this._logger.level}configure(e){const t=(0,Cl.getConfiguration)(),n={appenders:{...t.appenders,...e.appenders},categories:{...t.categories,...e.categories}};(0,Cl.setConfiguration)(n),ml.shutdown(),ml.configure(n)}}xr.HvigorLogger=Fl,xr.evaluateLogLevel=function(e,t){t.debug?e.setLevel(hl.levels.DEBUG):t.warn?e.setLevel(hl.levels.WARN):t.error?e.setLevel(hl.levels.ERROR):e.setLevel(hl.levels.INFO)};var gl=w&&w.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(X,"__esModule",{value:!0}),X.parseJsonText=X.parseJsonFile=void 0;const Al=Z,vl=gl(kr),Sl=gl(p.default),wl=gl(E.default),Ol=xr.HvigorLogger.getLogger("parse-json-util");var bl;!function(e){e[e.Char=0]="Char",e[e.EOF=1]="EOF",e[e.Identifier=2]="Identifier"}(bl||(bl={}));let _l,Bl,Pl,kl,xl,Nl,Il="start",Tl=[],Rl=0,Ml=1,Ll=0,jl=!1,$l="default",Hl="'",Jl=1;function Gl(e,t=!1){Bl=String(e),Il="start",Tl=[],Rl=0,Ml=1,Ll=0,kl=void 0,jl=t;do{_l=Vl(),Xl[Il]()}while("eof"!==_l.type);return kl}function Vl(){for($l="default",xl="",Hl="'",Jl=1;;){Nl=Ul();const e=zl[$l]();if(e)return e}}function Ul(){if(Bl[Rl])return String.fromCodePoint(Bl.codePointAt(Rl))}function Wl(){const e=Ul();return"\n"===e?(Ml++,Ll=0):e?Ll+=e.length:Ll++,e&&(Rl+=e.length),e}X.parseJsonFile=function(e,t=!1,n="utf-8"){const r=vl.default.readFileSync(Sl.default.resolve(e),{encoding:n});try{return Gl(r,t)}catch(t){if(t instanceof SyntaxError){const n=t.message.split("at");2===n.length&&Ol.errorMessageExit(`${n[0].trim()}${wl.default.EOL}\t at ${e}:${n[1].trim()}`)}Ol.errorMessageExit(`${e} is not in valid JSON/JSON5 format.`)}},X.parseJsonText=Gl;const zl={default(){switch(Nl){case"/":return Wl(),void($l="comment");case void 0:return Wl(),Kl("eof")}if(!Al.JudgeUtil.isIgnoreChar(Nl)&&!Al.JudgeUtil.isSpaceSeparator(Nl))return zl[Il]();Wl()},start(){$l="value"},beforePropertyName(){switch(Nl){case"$":case"_":return xl=Wl(),void($l="identifierName");case"\\":return Wl(),void($l="identifierNameStartEscape");case"}":return Kl("punctuator",Wl());case'"':case"'":return Hl=Nl,Wl(),void($l="string")}if(Al.JudgeUtil.isIdStartChar(Nl))return xl+=Wl(),void($l="identifierName");throw tf(bl.Char,Wl())},afterPropertyName(){if(":"===Nl)return Kl("punctuator",Wl());throw tf(bl.Char,Wl())},beforePropertyValue(){$l="value"},afterPropertyValue(){switch(Nl){case",":case"}":return Kl("punctuator",Wl())}throw tf(bl.Char,Wl())},beforeArrayValue(){if("]"===Nl)return Kl("punctuator",Wl());$l="value"},afterArrayValue(){switch(Nl){case",":case"]":return Kl("punctuator",Wl())}throw tf(bl.Char,Wl())},end(){throw tf(bl.Char,Wl())},comment(){switch(Nl){case"*":return Wl(),void($l="multiLineComment");case"/":return Wl(),void($l="singleLineComment")}throw tf(bl.Char,Wl())},multiLineComment(){switch(Nl){case"*":return Wl(),void($l="multiLineCommentAsterisk");case void 0:throw tf(bl.Char,Wl())}Wl()},multiLineCommentAsterisk(){switch(Nl){case"*":return void Wl();case"/":return Wl(),void($l="default");case void 0:throw tf(bl.Char,Wl())}Wl(),$l="multiLineComment"},singleLineComment(){switch(Nl){case"\n":case"\r":case"\u2028":case"\u2029":return Wl(),void($l="default");case void 0:return Wl(),Kl("eof")}Wl()},value(){switch(Nl){case"{":case"[":return Kl("punctuator",Wl());case"n":return Wl(),ql("ull"),Kl("null",null);case"t":return Wl(),ql("rue"),Kl("boolean",!0);case"f":return Wl(),ql("alse"),Kl("boolean",!1);case"-":case"+":return"-"===Wl()&&(Jl=-1),void($l="numerical");case".":case"0":case"I":case"N":return void($l="numerical");case'"':case"'":return Hl=Nl,Wl(),xl="",void($l="string")}if(void 0===Nl||!Al.JudgeUtil.isDigitWithoutZero(Nl))throw tf(bl.Char,Wl());$l="numerical"},numerical(){switch(Nl){case".":return xl=Wl(),void($l="decimalPointLeading");case"0":return xl=Wl(),void($l="zero");case"I":return Wl(),ql("nfinity"),Kl("numeric",Jl*(1/0));case"N":return Wl(),ql("aN"),Kl("numeric",NaN)}if(void 0!==Nl&&Al.JudgeUtil.isDigitWithoutZero(Nl))return xl=Wl(),void($l="decimalInteger");throw tf(bl.Char,Wl())},zero(){switch(Nl){case".":case"e":case"E":return void($l="decimal");case"x":case"X":return xl+=Wl(),void($l="hexadecimal")}return Kl("numeric",0)},decimalInteger(){switch(Nl){case".":case"e":case"E":return void($l="decimal")}if(!Al.JudgeUtil.isDigit(Nl))return Kl("numeric",Jl*Number(xl));xl+=Wl()},decimal(){switch(Nl){case".":xl+=Wl(),$l="decimalFraction";break;case"e":case"E":xl+=Wl(),$l="decimalExponent"}},decimalPointLeading(){if(Al.JudgeUtil.isDigit(Nl))return xl+=Wl(),void($l="decimalFraction");throw tf(bl.Char,Wl())},decimalFraction(){switch(Nl){case"e":case"E":return xl+=Wl(),void($l="decimalExponent")}if(!Al.JudgeUtil.isDigit(Nl))return Kl("numeric",Jl*Number(xl));xl+=Wl()},decimalExponent(){switch(Nl){case"+":case"-":return xl+=Wl(),void($l="decimalExponentSign")}if(Al.JudgeUtil.isDigit(Nl))return xl+=Wl(),void($l="decimalExponentInteger");throw tf(bl.Char,Wl())},decimalExponentSign(){if(Al.JudgeUtil.isDigit(Nl))return xl+=Wl(),void($l="decimalExponentInteger");throw tf(bl.Char,Wl())},decimalExponentInteger(){if(!Al.JudgeUtil.isDigit(Nl))return Kl("numeric",Jl*Number(xl));xl+=Wl()},hexadecimal(){if(Al.JudgeUtil.isHexDigit(Nl))return xl+=Wl(),void($l="hexadecimalInteger");throw tf(bl.Char,Wl())},hexadecimalInteger(){if(!Al.JudgeUtil.isHexDigit(Nl))return Kl("numeric",Jl*Number(xl));xl+=Wl()},identifierNameStartEscape(){if("u"!==Nl)throw tf(bl.Char,Wl());Wl();const e=Yl();switch(e){case"$":case"_":break;default:if(!Al.JudgeUtil.isIdStartChar(e))throw tf(bl.Identifier)}xl+=e,$l="identifierName"},identifierName(){switch(Nl){case"$":case"_":case"‌":case"‍":return void(xl+=Wl());case"\\":return Wl(),void($l="identifierNameEscape")}if(!Al.JudgeUtil.isIdContinueChar(Nl))return Kl("identifier",xl);xl+=Wl()},identifierNameEscape(){if("u"!==Nl)throw tf(bl.Char,Wl());Wl();const e=Yl();switch(e){case"$":case"_":case"‌":case"‍":break;default:if(!Al.JudgeUtil.isIdContinueChar(e))throw tf(bl.Identifier)}xl+=e,$l="identifierName"},string(){switch(Nl){case"\\":return Wl(),void(xl+=function(){const e=Ul(),t=function(){switch(Ul()){case"b":return Wl(),"\b";case"f":return Wl(),"\f";case"n":return Wl(),"\n";case"r":return Wl(),"\r";case"t":return Wl(),"\t";case"v":return Wl(),"\v"}return}();if(t)return t;switch(e){case"0":if(Wl(),Al.JudgeUtil.isDigit(Ul()))throw tf(bl.Char,Wl());return"\0";case"x":return Wl(),function(){let e="",t=Ul();if(!Al.JudgeUtil.isHexDigit(t))throw tf(bl.Char,Wl());if(e+=Wl(),t=Ul(),!Al.JudgeUtil.isHexDigit(t))throw tf(bl.Char,Wl());return e+=Wl(),String.fromCodePoint(parseInt(e,16))}();case"u":return Wl(),Yl();case"\n":case"\u2028":case"\u2029":return Wl(),"";case"\r":return Wl(),"\n"===Ul()&&Wl(),""}if(void 0===e||Al.JudgeUtil.isDigitWithoutZero(e))throw tf(bl.Char,Wl());return Wl()}());case'"':case"'":if(Nl===Hl){const e=Kl("string",xl);return Wl(),e}return void(xl+=Wl());case"\n":case"\r":case void 0:throw tf(bl.Char,Wl());case"\u2028":case"\u2029":!function(e){Ol.warn(`JSON5: '${ef(e)}' in strings is not valid ECMAScript; consider escaping.`)}(Nl)}xl+=Wl()}};function Kl(e,t){return{type:e,value:t,line:Ml,column:Ll}}function ql(e){for(const t of e){if(Ul()!==t)throw tf(bl.Char,Wl());Wl()}}function Yl(){let e="",t=4;for(;t-- >0;){const t=Ul();if(!Al.JudgeUtil.isHexDigit(t))throw tf(bl.Char,Wl());e+=Wl()}return String.fromCodePoint(parseInt(e,16))}const Xl={start(){if("eof"===_l.type)throw tf(bl.EOF);Zl()},beforePropertyName(){switch(_l.type){case"identifier":case"string":return Pl=_l.value,void(Il="afterPropertyName");case"punctuator":return void Ql();case"eof":throw tf(bl.EOF)}},afterPropertyName(){if("eof"===_l.type)throw tf(bl.EOF);Il="beforePropertyValue"},beforePropertyValue(){if("eof"===_l.type)throw tf(bl.EOF);Zl()},afterPropertyValue(){if("eof"===_l.type)throw tf(bl.EOF);switch(_l.value){case",":return void(Il="beforePropertyName");case"}":Ql()}},beforeArrayValue(){if("eof"===_l.type)throw tf(bl.EOF);"punctuator"!==_l.type||"]"!==_l.value?Zl():Ql()},afterArrayValue(){if("eof"===_l.type)throw tf(bl.EOF);switch(_l.value){case",":return void(Il="beforeArrayValue");case"]":Ql()}},end(){}};function Zl(){const e=function(){let e;switch(_l.type){case"punctuator":switch(_l.value){case"{":e={};break;case"[":e=[]}break;case"null":case"boolean":case"numeric":case"string":e=_l.value}return e}();if(jl&&"object"==typeof e&&(e._line=Ml,e._column=Ll),void 0===kl)kl=e;else{const t=Tl[Tl.length-1];Array.isArray(t)?jl&&"object"!=typeof e?t.push({value:e,_line:Ml,_column:Ll}):t.push(e):t[Pl]=jl&&"object"!=typeof e?{value:e,_line:Ml,_column:Ll}:e}!function(e){if(e&&"object"==typeof e)Tl.push(e),Il=Array.isArray(e)?"beforeArrayValue":"beforePropertyName";else{const e=Tl[Tl.length-1];Il=e?Array.isArray(e)?"afterArrayValue":"afterPropertyValue":"end"}}(e)}function Ql(){Tl.pop();const e=Tl[Tl.length-1];Il=e?Array.isArray(e)?"afterArrayValue":"afterPropertyValue":"end"}function ef(e){const t={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(t[e])return t[e];if(e<" "){const t=e.charCodeAt(0).toString(16);return`\\x${`00${t}`.substring(t.length)}`}return e}function tf(e,t){let n="";switch(e){case bl.Char:n=void 0===t?`JSON5: invalid end of input at ${Ml}:${Ll}`:`JSON5: invalid character '${ef(t)}' at ${Ml}:${Ll}`;break;case bl.EOF:n=`JSON5: invalid end of input at ${Ml}:${Ll}`;break;case bl.Identifier:Ll-=5,n=`JSON5: invalid identifier character at ${Ml}:${Ll}`}const r=new nf(n);return r.lineNumber=Ml,r.columnNumber=Ll,r}class nf extends SyntaxError{}var rf=w&&w.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),uf=w&&w.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),of=w&&w.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&rf(t,e,n);return uf(t,e),t};Object.defineProperty(Y,"__esModule",{value:!0});var sf=Y.cleanWorkSpace=Ff=Y.executeInstallHvigor=yf=Y.isHvigorInstalled=mf=Y.isAllDependenciesInstalled=void 0;const cf=of(D.default),af=of(p.default),lf=b,ff=j,df=$,Df=X;let pf,Ef;var mf=Y.isAllDependenciesInstalled=function(){function e(e){const t=null==e?void 0:e.dependencies;return void 0===t?0:Object.getOwnPropertyNames(t).length}if(pf=gf(),Ef=Af(),e(pf)+1!==e(Ef))return!1;for(const e in null==pf?void 0:pf.dependencies)if(!(0,ff.hasNpmPackInPaths)(e,[lf.HVIGOR_PROJECT_DEPENDENCIES_HOME])||!hf(e,pf,Ef))return!1;return!0};function hf(e,t,n){return void 0!==n.dependencies&&(0,ff.offlinePluginConversion)(lf.HVIGOR_PROJECT_ROOT_DIR,t.dependencies[e])===n.dependencies[e]}var yf=Y.isHvigorInstalled=function(){return pf=gf(),Ef=Af(),(0,ff.hasNpmPackInPaths)(lf.HVIGOR_ENGINE_PACKAGE_NAME,[lf.HVIGOR_PROJECT_DEPENDENCIES_HOME])&&(0,ff.offlinePluginConversion)(lf.HVIGOR_PROJECT_ROOT_DIR,pf.hvigorVersion)===Ef.dependencies[lf.HVIGOR_ENGINE_PACKAGE_NAME]};const Cf={cwd:lf.HVIGOR_PROJECT_DEPENDENCIES_HOME,stdio:["inherit","inherit","inherit"]};var Ff=Y.executeInstallHvigor=function(){(0,df.logInfoPrintConsole)("Hvigor installing...");const e={dependencies:{}};e.dependencies[lf.HVIGOR_ENGINE_PACKAGE_NAME]=(0,ff.offlinePluginConversion)(lf.HVIGOR_PROJECT_ROOT_DIR,pf.hvigorVersion);try{cf.mkdirSync(lf.HVIGOR_PROJECT_DEPENDENCIES_HOME,{recursive:!0});const t=af.resolve(lf.HVIGOR_PROJECT_DEPENDENCIES_HOME,lf.DEFAULT_PACKAGE_JSON);cf.writeFileSync(t,JSON.stringify(e))}catch(e){(0,df.logErrorAndExit)(e)}!function(){const e=["config","set","store-dir",lf.HVIGOR_PNPM_STORE_PATH];(0,ff.executeCommand)(lf.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,e,Cf)}(),(0,ff.executeCommand)(lf.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,["install"],Cf)};function gf(){const e=af.resolve(lf.HVIGOR_PROJECT_WRAPPER_HOME,lf.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME);return cf.existsSync(e)||(0,df.logErrorAndExit)(`Error: Hvigor config file ${e} does not exist.`),(0,Df.parseJsonFile)(e)}function Af(){return cf.existsSync(lf.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH)?(0,Df.parseJsonFile)(lf.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH):{dependencies:{}}}sf=Y.cleanWorkSpace=function(){if((0,df.logInfoPrintConsole)("Hvigor cleaning..."),!cf.existsSync(lf.HVIGOR_PROJECT_DEPENDENCIES_HOME))return;const e=cf.readdirSync(lf.HVIGOR_PROJECT_DEPENDENCIES_HOME);if(e&&0!==e.length){cf.existsSync(lf.HVIGOR_BOOT_JS_FILE_PATH)&&(0,ff.executeCommand)(process.argv[0],[lf.HVIGOR_BOOT_JS_FILE_PATH,"--stop-daemon"],{});try{e.forEach((e=>{cf.rmSync(af.resolve(lf.HVIGOR_PROJECT_DEPENDENCIES_HOME,e),{recursive:!0})}))}catch(e){(0,df.logErrorAndExit)(`The hvigor build tool cannot be installed. Please manually clear the workspace directory and synchronize the project again.\n\n Workspace Path: ${lf.HVIGOR_PROJECT_DEPENDENCIES_HOME}.`)}}};var vf={},Sf=w&&w.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),wf=w&&w.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Of=w&&w.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&Sf(t,e,n);return wf(t,e),t};Object.defineProperty(vf,"__esModule",{value:!0});var bf=vf.executeBuild=void 0;const _f=b,Bf=Of(D.default),Pf=Of(p.default),kf=$;bf=vf.executeBuild=function(){const e=Pf.resolve(_f.HVIGOR_PROJECT_DEPENDENCIES_HOME,"node_modules","@ohos","hvigor","bin","hvigor.js");try{const t=Bf.realpathSync(e);require(t)}catch(t){(0,kf.logErrorAndExit)(`Error: ENOENT: no such file ${e},delete ${_f.HVIGOR_PROJECT_DEPENDENCIES_HOME} and retry.`)}},function(){if(O.checkNpmConifg(),O.environmentHandler(),O.isPnpmAvailable()||O.executeInstallPnpm(),yf()&&mf())bf();else{sf();try{Ff()}catch(e){return void sf()}bf()}}(); \ No newline at end of file diff --git a/unionpi_tiger/sample/app/factory/hvigorfile.ts b/unionpi_tiger/sample/app/factory/hvigorfile.ts deleted file mode 100644 index 64781869..00000000 --- a/unionpi_tiger/sample/app/factory/hvigorfile.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. -export { appTasks } from '@ohos/hvigor-ohos-plugin'; \ No newline at end of file diff --git a/unionpi_tiger/sample/app/factory/hvigorw b/unionpi_tiger/sample/app/factory/hvigorw deleted file mode 100644 index 54aadd22..00000000 --- a/unionpi_tiger/sample/app/factory/hvigorw +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash - -# ---------------------------------------------------------------------------- -# Hvigor startup script, version 1.0.0 -# -# Required ENV vars: -# ------------------ -# NODE_HOME - location of a Node home dir -# or -# Add /usr/local/nodejs/bin to the PATH environment variable -# ---------------------------------------------------------------------------- - -HVIGOR_APP_HOME=$(dirname $(readlink -f $0)) -HVIGOR_WRAPPER_SCRIPT=${HVIGOR_APP_HOME}/hvigor/hvigor-wrapper.js -warn() { - echo "" - echo -e "\033[1;33m`date '+[%Y-%m-%d %H:%M:%S]'`$@\033[0m" -} - -error() { - echo "" - echo -e "\033[1;31m`date '+[%Y-%m-%d %H:%M:%S]'`$@\033[0m" -} - -fail() { - error "$@" - exit 1 -} - -# Determine node to start hvigor wrapper script -if [ -n "${NODE_HOME}" ];then - EXECUTABLE_NODE="${NODE_HOME}/bin/node" - if [ ! -x "$EXECUTABLE_NODE" ];then - fail "ERROR: NODE_HOME is set to an invalid directory,check $NODE_HOME\n\nPlease set NODE_HOME in your environment to the location where your nodejs installed" - fi -else - EXECUTABLE_NODE="node" - which ${EXECUTABLE_NODE} > /dev/null 2>&1 || fail "ERROR: NODE_HOME is not set and not 'node' command found in your path" -fi - -# Check hvigor wrapper script -if [ ! -r "$HVIGOR_WRAPPER_SCRIPT" ];then - fail "ERROR: Couldn't find hvigor/hvigor-wrapper.js in ${HVIGOR_APP_HOME}" -fi - -# start hvigor-wrapper script -exec "${EXECUTABLE_NODE}" \ - "${HVIGOR_WRAPPER_SCRIPT}" "$@" diff --git a/unionpi_tiger/sample/app/factory/hvigorw.bat b/unionpi_tiger/sample/app/factory/hvigorw.bat deleted file mode 100644 index 6861293e..00000000 --- a/unionpi_tiger/sample/app/factory/hvigorw.bat +++ /dev/null @@ -1,64 +0,0 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Hvigor startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -set WRAPPER_MODULE_PATH=%APP_HOME%\hvigor\hvigor-wrapper.js -set NODE_EXE=node.exe - -goto start - -:start -@rem Find node.exe -if defined NODE_HOME goto findNodeFromNodeHome - -%NODE_EXE% --version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute - -echo. -echo ERROR: NODE_HOME is not set and no 'node' command could be found in your PATH. -echo. -echo Please set the NODE_HOME variable in your environment to match the -echo location of your NodeJs installation. - -goto fail - -:findNodeFromNodeHome -set NODE_HOME=%NODE_HOME:"=% -set NODE_EXE_PATH=%NODE_HOME%/%NODE_EXE% - -if exist "%NODE_EXE_PATH%" goto execute -echo. -echo ERROR: NODE_HOME is not set and no 'node' command could be found in your PATH. -echo. -echo Please set the NODE_HOME variable in your environment to match the -echo location of your NodeJs installation. - -goto fail - -:execute -@rem Execute hvigor -"%NODE_EXE%" %WRAPPER_MODULE_PATH% %* - -if "%ERRORLEVEL%" == "0" goto hvigorwEnd - -:fail -exit /b 1 - -:hvigorwEnd -if "%OS%" == "Windows_NT" endlocal - -:end diff --git a/unionpi_tiger/sample/app/factory/oh-package.json5 b/unionpi_tiger/sample/app/factory/oh-package.json5 deleted file mode 100644 index 72841788..00000000 --- a/unionpi_tiger/sample/app/factory/oh-package.json5 +++ /dev/null @@ -1,12 +0,0 @@ -{ - "license": "", - "devDependencies": { - "@ohos/hypium": "1.0.6" - }, - "author": "", - "name": "factory", - "description": "Please describe the basic information.", - "main": "", - "version": "1.0.0", - "dependencies": {} -} diff --git a/unionpi_tiger/sample/app/two_videoPlayer/.gitignore b/unionpi_tiger/sample/app/two_videoPlayer/.gitignore deleted file mode 100644 index 56f46e5c..00000000 --- a/unionpi_tiger/sample/app/two_videoPlayer/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -/node_modules -/local.properties -/.idea -**/build -/.hvigor \ No newline at end of file diff --git a/unionpi_tiger/sample/app/two_videoPlayer/README_zh.md b/unionpi_tiger/sample/app/two_videoPlayer/README_zh.md deleted file mode 100755 index ddadffb2..00000000 --- a/unionpi_tiger/sample/app/two_videoPlayer/README_zh.md +++ /dev/null @@ -1,45 +0,0 @@ -# two_videoPlayer应用 - -### 介绍 -视频播放的主要工作是将视频数据转码并输出到设备进行播放,同时管理播放任务。本文将对视频播放全流程、视频切换、视频循环播放等场景开发进行介绍说明。 -本示例主要展示了播放本地视频和网络视频相关功能。 - -使用说明 - -1.点击视频界面,唤起视频操作面板,再次点击操作面板消失,如果不做任何操作操作界面会5s自动消失; - -2.点击暂停/播放按钮,控制视频暂停播放; - -3.滑动视频进度条,视频跳转到指定位置,在视频中间会出现时间进度方便用户查看视频进度; - -i -### 目录结构 -``` -VideoPlay/src/main/ets/ -|---common -| |---ipVideo.ets // 网络视频 -| |---localVideo.ets // 本地视频 -|---pages -| |---Index.ets // 首页视频界面 -``` - -### 具体实现 -+ 使用VideoController()对象controller来控制video播放,暂停,播放进度; -+ 使用windowClass.setKeepScreenOn接口设置常亮; -+ 暂停、播放:点击暂停、播放时调用controller.pause()、controller.play(); -+ 视频跳转:在拖动滑动条时调用controller.setCurrentTime() - -### 相关权限 - -不涉及。 - -### 依赖 -不涉及。 - -### 约束与限制 - -1.本示例仅支持标准系统上运行,需要联网才能够播放网络视频; - -2.本示例已适配API9版本SDK,版本号:3.2.11.10,镜像版本号:OpenHarmony4.0.7.5; - -3.本示例需要使用DevEco Studio 3.1 Beta2 (Build Version: 3.1.0.400, built on April 7, 2023)才可编译运行。 \ No newline at end of file diff --git a/unionpi_tiger/sample/app/two_videoPlayer/build-profile.json5 b/unionpi_tiger/sample/app/two_videoPlayer/build-profile.json5 deleted file mode 100644 index 6d1238b7..00000000 --- a/unionpi_tiger/sample/app/two_videoPlayer/build-profile.json5 +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -{ - "app": { - "compileSdkVersion": 9, - "compatibleSdkVersion": 9, - "products": [ - { - "name": "default", - "signingConfig": "default", - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} diff --git a/unionpi_tiger/sample/app/two_videoPlayer/entry/.gitignore b/unionpi_tiger/sample/app/two_videoPlayer/entry/.gitignore deleted file mode 100644 index 4a659483..00000000 --- a/unionpi_tiger/sample/app/two_videoPlayer/entry/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -/node_modules -/.preview -/build -/.cxx \ No newline at end of file diff --git a/unionpi_tiger/sample/app/two_videoPlayer/entry/build-profile.json5 b/unionpi_tiger/sample/app/two_videoPlayer/entry/build-profile.json5 deleted file mode 100644 index a965642e..00000000 --- a/unionpi_tiger/sample/app/two_videoPlayer/entry/build-profile.json5 +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -{ - "apiType": 'faMode', - "buildOption": { - }, - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} diff --git a/unionpi_tiger/sample/app/two_videoPlayer/entry/hvigorfile.js b/unionpi_tiger/sample/app/two_videoPlayer/entry/hvigorfile.js deleted file mode 100644 index 79ea2ec0..00000000 --- a/unionpi_tiger/sample/app/two_videoPlayer/entry/hvigorfile.js +++ /dev/null @@ -1,2 +0,0 @@ -// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. -module.exports = require('@ohos/hvigor-ohos-plugin').legacyHapTasks diff --git a/unionpi_tiger/sample/app/two_videoPlayer/entry/package.json b/unionpi_tiger/sample/app/two_videoPlayer/entry/package.json deleted file mode 100644 index 65765836..00000000 --- a/unionpi_tiger/sample/app/two_videoPlayer/entry/package.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "license": "ISC", - "devDependencies": {}, - "name": "entry", - "ohos": { - "org": "huawei", - "directoryLevel": "module", - "buildTool": "hvigor" - }, - "description": "example description", - "repository": {}, - "version": "1.0.0", - "dependencies": {} -} diff --git a/unionpi_tiger/sample/app/two_videoPlayer/entry/src/main/config.json b/unionpi_tiger/sample/app/two_videoPlayer/entry/src/main/config.json deleted file mode 100644 index 8857aa53..00000000 --- a/unionpi_tiger/sample/app/two_videoPlayer/entry/src/main/config.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "app": { - "bundleName": "com.samples.two_videoPlayer", - "vendor": "example", - "version": { - "code": 1000000, - "name": "1.0.0" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.entry", - "name": ".entry", - "mainAbility": ".MainAbility", - "deviceType": [ - "default", - "tablet" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "formsEnabled": false, - "name": ".MainAbility", - "srcLanguage": "ets", - "srcPath": "MainAbility", - "icon": "$media:icon", - "description": "$string:MainAbility_desc", - "label": "$string:MainAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - } - ], - "js": [ - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/two_videoPlayer/entry/src/main/ets/MainAbility/app.ets b/unionpi_tiger/sample/app/two_videoPlayer/entry/src/main/ets/MainAbility/app.ets deleted file mode 100644 index 30dd6e46..00000000 --- a/unionpi_tiger/sample/app/two_videoPlayer/entry/src/main/ets/MainAbility/app.ets +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -export default { - onCreate() { - console.info('Application onCreate') - }, - onDestroy() { - console.info('Application onDestroy') - }, -} diff --git a/unionpi_tiger/sample/app/two_videoPlayer/entry/src/main/ets/MainAbility/common/ipVideo.ets b/unionpi_tiger/sample/app/two_videoPlayer/entry/src/main/ets/MainAbility/common/ipVideo.ets deleted file mode 100644 index 3b629398..00000000 --- a/unionpi_tiger/sample/app/two_videoPlayer/entry/src/main/ets/MainAbility/common/ipVideo.ets +++ /dev/null @@ -1,175 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -import deviceManager from '@ohos.distributedHardware.deviceManager'; -import featureAbility from '@ohos.ability.featureAbility'; -import window from '@ohos.window'; - -@Component -export struct ipVideo { - src: Resource = $r('app.media.EP11'); - - @State videoIndex: number = 0 - @State SpeedIndex: number = 1 - @State title: string = "网络摄像头"; - // 当前视频播放速率 - @State currentProgressRate: number = 1; - @State autoPlays: boolean = true; - // 是否显示控制栏 - @State controls: number = 0; - @State isFullScreen: boolean = false; - // 是否正在播放 - @State isPlay: boolean = true; - // 滑动条进度 - @State inVerticalSetValue: number = 0 - // 当前播放进度 - @State currentTime: number = 0 - // 视频时长 - @State duration: number = 0 - @State currentSpeed: string = '1.0X' - @State intervalID: number = 0 - startx: number - starty: number - endx: number - endy: number - // 设备管理对象 - - controller: VideoController = new VideoController(); - scroller: Scroller = new Scroller() - - setScreenKeepOn() { - //获取当前窗口 - var windowClass = null; - let promise = window.getTopWindow(); - promise.then((data) => { - console.info('XXXXX Succeeded in obtaining the top window. Data: ' + JSON.stringify(data)); - windowClass = data; - - //设置常亮状态 - var isKeepScreenOn = true; - let promise = windowClass.setKeepScreenOn(isKeepScreenOn); - console.log("XXXXX setKeepScreenOn") - promise.then(() => { - console.info('XXXXX Succeeded in setting the screen to be always on.'); - }).catch((err) => { - console.info('XXXXX Failed to set the screen to be always on. Cause: ' + JSON.stringify(err)); - - }); - - }).catch((err) => { - console.error('XXXXX Failed to obtain the top window. Cause: ' + JSON.stringify(err)); - }) - } - - changeFullScreen() { - this.isFullScreen = !this.isFullScreen - //获取当前窗口 - var FullScreen = this.isFullScreen; - var windowClass = null; - let promise = window.getTopWindow(); - promise.then((data) => { - windowClass = data; - console.info('Succeeded in obtaining the top window. Data: ' + JSON.stringify(data)); - //设置全屏状态 - let promise = windowClass.setFullScreen(FullScreen); - promise.then(() => { - console.info('Succeeded in enabling the full-screen mode. '); - }).catch((err) => { - console.error('Failed to enable the full-screen mode. Cause: ' + JSON.stringify(err)); - }); - - }).catch((err) => { - console.error('Failed to obtain the top window. Cause: ' + JSON.stringify(err)); - }) - } - - onPageShow() { - this.setScreenKeepOn() - this.changeFullScreen() - var context = featureAbility.getContext() - context.verifyPermission("ohos.permission.DISTRIBUTED_DATASYNC").then((data) => { - console.info("======================>verifyPermissionCallback====================>"); - console.info("====>data====>" + JSON.stringify(data)); - if (data != 0) { - context.requestPermissionsFromUser( - ["ohos.permission.DISTRIBUTED_DATASYNC"], - 1).then((data) => { - console.info("====>requestdata====>" + JSON.stringify(data)); - }); - } - }) - } - - build() { - Stack({ alignContent: Alignment.TopStart }) { - Video({ - src: this.src, - currentProgressRate: this.currentProgressRate, - controller: this.controller - }) - .focusable(false) - .width('100%') - .height('100%') - .autoPlay(this.autoPlays) - .loop(true) - .controls(false) - .onStart(() => { - this.isPlay = true - }) - .onPause(() => { - this.isPlay = false - }) - .onFinish(() => { - this.isPlay = false - }) - .onError(() => { - this.isPlay = false - }) - .onPrepared((e) => { - console.error('onPrepared is ' + e.duration); - this.duration = e.duration - }) - .onSeeked((e) => { - console.error('onSeekedis ' + e.time); - this.currentTime = e.time - }) - .gesture( - TapGesture({ count: 1 }) - .onAction(() => { - if (this.controls) { - this.controls = 0; - } else { - this.controls = 1; - } - }) - ) - .gesture( - TapGesture({ count: 2 }) - .onAction(() => { - if (this.isPlay) { - this.isPlay = !this.isPlay - this.controller.pause(); - } else { - this.isPlay = !this.isPlay - this.controller.start(); - } - }) - ) - // .border({ width: 1, color: 'red', style: BorderStyle.Solid }) - - } - } -} diff --git a/unionpi_tiger/sample/app/two_videoPlayer/entry/src/main/ets/MainAbility/common/localVideo.ets b/unionpi_tiger/sample/app/two_videoPlayer/entry/src/main/ets/MainAbility/common/localVideo.ets deleted file mode 100644 index 176c937f..00000000 --- a/unionpi_tiger/sample/app/two_videoPlayer/entry/src/main/ets/MainAbility/common/localVideo.ets +++ /dev/null @@ -1,295 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -import prompt from '@ohos.prompt'; -import deviceManager from '@ohos.distributedHardware.deviceManager'; -import featureAbility from '@ohos.ability.featureAbility'; -import window from '@ohos.window'; -import { KeyCode } from '@ohos.multimodalInput.keyCode' -import inputMonitor from '@ohos.multimodalInput.inputMonitor'; - - - -@Component -export struct localVideo { - src: Resource = $r('app.media.EP11'); - - @State videoIndex: number = 0 - @State SpeedIndex: number = 1 - @State title: string = "本地视频"; - // 当前视频播放速率 - @State currentProgressRate: number = 1; - @State autoPlays: boolean = true; - // 是否显示控制栏 - @State controls: number = 0; - @State isFullScreen: boolean = false; - // 是否正在播放 - @State isPlay: boolean = true; - // 滑动条进度 - @State inVerticalSetValue: number = 0 - // 当前播放进度 - @State currentTime: number = 0 - // 视频时长 - @State duration: number = 0 - @State currentSpeed: string = '1.0X' - @State intervalID: number = 0 - - //按下左右键的时长 - @State keyDownTimes: number = 0 - startx: number - starty: number - endx: number - endy: number - //定时器的id - timeoutID :number = 0 - // 设备管理对象 - controller: VideoController = new VideoController(); - scroller: Scroller = new Scroller(); - @State isKeyboardDelegate: boolean = false; - - onPageShow() { - var context = featureAbility.getContext() - context.verifyPermission("ohos.permission.DISTRIBUTED_DATASYNC").then((data) => { - console.info("======================>verifyPermissionCallback====================>"); - console.info("====>data====>" + JSON.stringify(data)); - if (data != 0) { - context.requestPermissionsFromUser( - ["ohos.permission.DISTRIBUTED_DATASYNC"], - 1).then((data) => { - console.info("====>requestdata====>" + JSON.stringify(data)); - }); - } - }) - } - - onInit() { - this.SpeedIndex = 1 - this.isPlay = true - this.currentTime = 0 - this.currentSpeed = '1.0X' - this.currentProgressRate = 1 - this.inVerticalSetValue = 0 - - } - changeScreenmode(){ - this.isFullScreen = !this.isFullScreen - //获取当前窗口 - var FullScreen = this.isFullScreen; - var windowClass = null; - let promise = window.getTopWindow(); - promise.then((data) => { - windowClass = data; - console.info('Succeeded in obtaining the top window. Data: ' + JSON.stringify(data)); - //设置全屏状态 - let promise = windowClass.setFullScreen(FullScreen); - promise.then(() => { - console.info('Succeeded in enabling the full-screen mode. '); - }).catch((err) => { - console.error('Failed to enable the full-screen mode. Cause: ' + JSON.stringify(err)); - }); - }).catch((err) => { - console.error('Failed to obtain the top window. Cause: ' + JSON.stringify(err)); - }) - } - - setScreenKeepOn() { - //获取当前窗口 - var windowClass = null; - let promise = window.getTopWindow(); - promise.then((data) => { - console.info('XXXXX Succeeded in obtaining the top window. Data: ' + JSON.stringify(data)); - windowClass = data; - - //设置常亮状态 - var isKeepScreenOn = true; - let promise = windowClass.setKeepScreenOn(isKeepScreenOn); - console.log("XXXXX setKeepScreenOn") - promise.then(() => { - console.info('XXXXX Succeeded in setting the screen to be always on.'); - }).catch((err) => { - console.info('XXXXX Failed to set the screen to be always on. Cause: ' + JSON.stringify(err)); - - }); - - }).catch((err) => { - console.error('XXXXX Failed to obtain the top window. Cause: ' + JSON.stringify(err)); - }) - } - - timeToString(time){ - let second = Math.floor(time%60) - let minute = Math.floor(time/60) - - return minute+':'+second - } - build() { - Stack({ alignContent: Alignment.Bottom }) { - - Video({ - src: this.src, - currentProgressRate: this.currentProgressRate, - controller: this.controller - }) - .width('100%') - .height('100%') - .autoPlay(this.autoPlays) - .controls(false) - .loop(true) - .focusable(false) - .onStart(() => { - console.log("XXX onStart") - this.isPlay = true - this.setScreenKeepOn() - //this.setTimer() - }) - .onPause(() => { - console.log("XXX onPause") - this.isPlay = false - }) - .onFinish(() => { - console.log("XXX onFinish") - //this.onInit() - //this.controller.setCurrentTime(0, SeekMode.Accurate) - }) - .onError(() => { - this.isPlay = false - }) - .onPrepared((e) => { - console.error('XXX onPrepared is ' + e.duration); - this.duration = e.duration - }) - .onSeeked((e) => { - console.error('XXX onSeekedis ' + e.time); - this.currentTime = e.time - }) - .onUpdate((e) => { - this.currentTime = e.time - }) - - .gesture( - TapGesture({ count: 1 }) - .onAction(() => { - if (this.controls) { - this.controls = 0; - } else { - this.controls = 1; - } - }) - ) - .gesture( - TapGesture({ count: 2 }) - .onAction(() => { - if (this.isPlay) { - this.isPlay = !this.isPlay - this.controller.pause(); - } else { - this.isPlay = !this.isPlay - this.controller.start(); - } - }) - ) - .onTouch((event: TouchEvent) => { - if (event.type === TouchType.Down) { - this.startx = event.touches[0].screenX - this.starty = event.touches[0].screenY - } - if (event.type === TouchType.Up) { - this.endx = event.touches[0].screenX - this.endy = event.touches[0].screenY - //右滑 - if (this.endx > this.startx && Math.abs(this.endy - this.starty) < 100) { - this.videoIndex-- - this.onInit() - } - //左滑 - else if (this.endx < this.startx && Math.abs(this.endy - this.starty) < 100) { - this.videoIndex++ - this.onInit() - } - } - }) - // 控制栏 - Column() { - Row() { - Image(this.isPlay ? $r('app.media.ic_public_pause') : $r('app.media.ic_public_play')) - //Image($r('app.media.ic_public_play')) - .id("Play") - .width(32) - .height(32) - .focusable(false) - .onClick(() => { - this.isPlay = !this.isPlay - if (this.isPlay) { - this.controller.start() - } else { - this.controller.pause() - } - }) - - Slider({ - value: this.currentTime, - min: 0, - max: this.duration, - step: 1, - }) - .id("Slider") - .width('54%') - .blockColor(Color.White) - .trackColor(Color.Gray) - .selectedColor(Color.White) - .onChange((value: number, mode: SliderChangeMode) => { - - this.inVerticalSetValue = value - this.currentTime = value - this.controller.setCurrentTime(value, SeekMode.Accurate) - console.error('XXXX value:' + value + 'mode:' + mode.toString()) - - - - - }) - .focusable(true) - .onFocus(() => { - console.error("XXXX onFocus4") - }) - .onKeyEvent((event: KeyEvent) => { - event.stopPropagation() - console.error("onKeyEvent"+event.keyText) - if (event.type == KeyType.Up && event.keyCode === KeyCode.KEYCODE_ENTER) { - console.error("XXXX 按下home键 4 time" + event.timestamp) - if(this.isPlay == true) - this.controller.pause() - else - this.controller.start() - } - }) - Text(this.timeToString(this.currentTime) + "/" + this.timeToString(this.duration)) - .fontColor(Color.White) - .fontSize(20) - } - .align(Alignment.Bottom) - // .border({ width: 1, color: 'red', style: BorderStyle.Solid }) - } - .padding(10) - // .border({ width: 1, color: 'red', style: BorderStyle.Solid }) - .justifyContent(FlexAlign.Center) - .width('100%') - .visibility(this.controls) - - } - - } -} diff --git a/unionpi_tiger/sample/app/two_videoPlayer/entry/src/main/ets/MainAbility/pages/index.ets b/unionpi_tiger/sample/app/two_videoPlayer/entry/src/main/ets/MainAbility/pages/index.ets deleted file mode 100644 index b6ac77e3..00000000 --- a/unionpi_tiger/sample/app/two_videoPlayer/entry/src/main/ets/MainAbility/pages/index.ets +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -import { localVideo } from '../common/localVideo'; -import { ipVideo } from '../common/ipVideo'; -import { KeyCode } from '@ohos.multimodalInput.keyCode' - -@Entry -@Component -struct Index { - @State localSrc: Resource = $r('app.media.EP11'); - @State ipSrc: Resource = $r('app.media.EP11'); - - build() { - Stack({ alignContent: Alignment.TopEnd }) { - Stack({ alignContent: Alignment.Center }) { - localVideo({ - src: this.localSrc - }); - } - .width('100%') - .height('100%') - - Stack({ alignContent: Alignment.Center }) { - ipVideo({ - src: this.ipSrc - }); - } - .width('40%') - .height('40%') - } - - .width('100%') - .height('100%') - } -} diff --git a/unionpi_tiger/sample/app/two_videoPlayer/entry/src/main/resources/base/element/color.json b/unionpi_tiger/sample/app/two_videoPlayer/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 62a137a6..00000000 --- a/unionpi_tiger/sample/app/two_videoPlayer/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "white", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/two_videoPlayer/entry/src/main/resources/base/element/string.json b/unionpi_tiger/sample/app/two_videoPlayer/entry/src/main/resources/base/element/string.json deleted file mode 100644 index dddf9123..00000000 --- a/unionpi_tiger/sample/app/two_videoPlayer/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "entry_desc", - "value": "description" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/two_videoPlayer/entry/src/main/resources/base/media/EP11.mp4 b/unionpi_tiger/sample/app/two_videoPlayer/entry/src/main/resources/base/media/EP11.mp4 deleted file mode 100644 index e0d410d4..00000000 Binary files a/unionpi_tiger/sample/app/two_videoPlayer/entry/src/main/resources/base/media/EP11.mp4 and /dev/null differ diff --git a/unionpi_tiger/sample/app/two_videoPlayer/entry/src/main/resources/base/media/ic_public_pause.png b/unionpi_tiger/sample/app/two_videoPlayer/entry/src/main/resources/base/media/ic_public_pause.png deleted file mode 100644 index 618e6089..00000000 Binary files a/unionpi_tiger/sample/app/two_videoPlayer/entry/src/main/resources/base/media/ic_public_pause.png and /dev/null differ diff --git a/unionpi_tiger/sample/app/two_videoPlayer/entry/src/main/resources/base/media/ic_public_play.png b/unionpi_tiger/sample/app/two_videoPlayer/entry/src/main/resources/base/media/ic_public_play.png deleted file mode 100644 index 40280c25..00000000 Binary files a/unionpi_tiger/sample/app/two_videoPlayer/entry/src/main/resources/base/media/ic_public_play.png and /dev/null differ diff --git a/unionpi_tiger/sample/app/two_videoPlayer/entry/src/main/resources/base/media/ic_public_reduce.png b/unionpi_tiger/sample/app/two_videoPlayer/entry/src/main/resources/base/media/ic_public_reduce.png deleted file mode 100644 index acf59937..00000000 Binary files a/unionpi_tiger/sample/app/two_videoPlayer/entry/src/main/resources/base/media/ic_public_reduce.png and /dev/null differ diff --git a/unionpi_tiger/sample/app/two_videoPlayer/entry/src/main/resources/base/media/ic_public_wireless_projection_filled.png b/unionpi_tiger/sample/app/two_videoPlayer/entry/src/main/resources/base/media/ic_public_wireless_projection_filled.png deleted file mode 100644 index fa363f79..00000000 Binary files a/unionpi_tiger/sample/app/two_videoPlayer/entry/src/main/resources/base/media/ic_public_wireless_projection_filled.png and /dev/null differ diff --git a/unionpi_tiger/sample/app/two_videoPlayer/entry/src/main/resources/base/media/icon.png b/unionpi_tiger/sample/app/two_videoPlayer/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a88..00000000 Binary files a/unionpi_tiger/sample/app/two_videoPlayer/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/unionpi_tiger/sample/app/two_videoPlayer/entry/src/main/resources/base/media/img.png b/unionpi_tiger/sample/app/two_videoPlayer/entry/src/main/resources/base/media/img.png deleted file mode 100644 index 06d8c0c4..00000000 Binary files a/unionpi_tiger/sample/app/two_videoPlayer/entry/src/main/resources/base/media/img.png and /dev/null differ diff --git a/unionpi_tiger/sample/app/two_videoPlayer/entry/src/ohosTest/config.json b/unionpi_tiger/sample/app/two_videoPlayer/entry/src/ohosTest/config.json deleted file mode 100644 index 2d4bcbd7..00000000 --- a/unionpi_tiger/sample/app/two_videoPlayer/entry/src/ohosTest/config.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "app": { - "bundleName": "com.samples.two_videoPlayer", - "vendor": "example", - "version": { - "code": 1000000, - "name": "1.0.0" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.entry_test", - "name": ".entry_test", - "mainAbility": ".TestAbility", - "srcPath": "", - "deviceType": [ - "default", - "tablet" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry_test", - "moduleType": "feature", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "visible": true, - "srcPath": "TestAbility", - "name": ".TestAbility", - "srcLanguage": "ets", - "icon": "$media:icon", - "description": "$string:description_TestAbility", - "formsEnabled": false, - "label": "$string:entry_TestAbility", - "type": "page", - "launchType": "standard" - } - ], - "js": [ - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index" - ], - "name": ".TestAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/two_videoPlayer/entry/src/ohosTest/ets/TestAbility/app.ets b/unionpi_tiger/sample/app/two_videoPlayer/entry/src/ohosTest/ets/TestAbility/app.ets deleted file mode 100644 index 096e8f0f..00000000 --- a/unionpi_tiger/sample/app/two_videoPlayer/entry/src/ohosTest/ets/TestAbility/app.ets +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from '@ohos/hypium' -import testsuite from '../test/List.test' - -export default { - onCreate() { - console.info('Application onCreate') - var abilityDelegator: any - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments: any - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - }, - onDestroy() { - console.info('Application onDestroy') - }, -} diff --git a/unionpi_tiger/sample/app/two_videoPlayer/entry/src/ohosTest/ets/TestAbility/pages/index.ets b/unionpi_tiger/sample/app/two_videoPlayer/entry/src/ohosTest/ets/TestAbility/pages/index.ets deleted file mode 100644 index 1d022490..00000000 --- a/unionpi_tiger/sample/app/two_videoPlayer/entry/src/ohosTest/ets/TestAbility/pages/index.ets +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -import router from '@system.router'; - -@Entry -@Component -struct Index { - aboutToAppear() { - console.info('TestAbility index aboutToAppear') - } - - @State message: string = 'Hello World' - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - Button() { - Text('next page') - .fontSize(20) - .fontWeight(FontWeight.Bold) - }.type(ButtonType.Capsule) - .margin({ - top: 20 - }) - .backgroundColor('#0D9FFB') - .width('35%') - .height('5%') - .onClick(()=>{ - }) - } - .width('100%') - } - .height('100%') - } - } diff --git a/unionpi_tiger/sample/app/two_videoPlayer/entry/src/ohosTest/ets/TestRunner/OpenHarmonyTestRunner.ts b/unionpi_tiger/sample/app/two_videoPlayer/entry/src/ohosTest/ets/TestRunner/OpenHarmonyTestRunner.ts deleted file mode 100644 index 35585537..00000000 --- a/unionpi_tiger/sample/app/two_videoPlayer/entry/src/ohosTest/ets/TestRunner/OpenHarmonyTestRunner.ts +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import TestRunner from '@ohos.application.testRunner' -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - -var abilityDelegator = undefined -var abilityDelegatorArguments = undefined - -function translateParamsToString(parameters) { - const keySet = new Set([ - '-s class', '-s notClass', '-s suite', '-s itName', - '-s level', '-s testType', '-s size', '-s timeout', - '-s package', '-s dryRun' - ]) - let targetParams = ''; - for (const key in parameters) { - if (keySet.has(key)) { - targetParams += ' ' + key + ' ' + parameters[key] - } - } - return targetParams.trim() -} - -async function onAbilityCreateCallback() { - console.log('onAbilityCreateCallback'); -} - -async function addAbilityMonitorCallback(err: any) { - console.info('addAbilityMonitorCallback : ' + JSON.stringify(err)) -} - -export default class OpenHarmonyTestRunner implements TestRunner { - constructor() { - } - - onPrepare() { - console.info('OpenHarmonyTestRunner OnPrepare') - } - - onRun() { - console.log('OpenHarmonyTestRunner onRun run') - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - - let lMonitor = { - abilityName: testAbilityName, - onAbilityCreate: onAbilityCreateCallback, - }; - var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility' - abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) - var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters["-D"] - if (debug == 'true') - { - cmd += ' -D' - } - console.info('cmd : '+cmd) - abilityDelegator.executeShellCommand(cmd, - (err: any, d: any) => { - console.info('executeShellCommand : err : ' + JSON.stringify(err)); - console.info('executeShellCommand : data : ' + d.stdResult); - console.info('executeShellCommand : data : ' + d.exitCode); - }) - console.info('OpenHarmonyTestRunner onRun call abilityDelegator.getAppContext') - var context = abilityDelegator.getAppContext() - console.info('getAppContext : ' + JSON.stringify(context)) - console.info('OpenHarmonyTestRunner onRun end') - } -}; \ No newline at end of file diff --git a/unionpi_tiger/sample/app/two_videoPlayer/entry/src/ohosTest/ets/test/Ability.test.ets b/unionpi_tiger/sample/app/two_videoPlayer/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index df09b986..00000000 --- a/unionpi_tiger/sample/app/two_videoPlayer/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' - -import hilog from '@ohos.hilog'; - -import { Driver, ON, MatchPattern, Component } from '@ohos.UiTest' -import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry' -import mediaLibrary from '@ohos.multimedia.mediaLibrary' - - -const BUNDLE = 'ComponentCollection_'; - -const DELAY_TIME = 1000; -let driver: Driver = Driver.create(); - -// 获取AbilityDelegator -let abilityDelegatorRegistry = AbilityDelegatorRegistry.getAbilityDelegator(); -// 启动后获取app上下文 -let context; -// 启动后获取resourceManager -let manager; - -export default function abilityTest() { - describe('ActsAbilityTest', function () { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(function () { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }) - beforeEach(function () { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }) - afterEach(function () { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }) - afterAll(function () { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }) - it('assertContain', 0, function () { - /** - * 打开应用 - */ - it(BUNDLE + 'StartAbility_001', 0, async function (done) { - let abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - try { - await abilityDelegator.startAbility({ - bundleName: 'ohos.samples.two_videoPlayer', - abilityName: '.MainAbility' - }) - - context = await abilityDelegatorRegistry.getAppContext(); - manager = context.resourceManager; - - done(); - } catch (exception) { - expect(0).assertEqual(exception.code); - done(); - } - }) - // 通过 ID 滑动 slider - it('Slider_001', 0, async function () { - let driver: Driver = Driver.create(); - let atom = "Slider"; - await driver.assertComponentExist(ON.id(atom)); - let slider_01 = await driver.findComponent(ON.id(atom)); - let rect = await slider_01.getBoundsCenter(); - await driver.drag(rect.x - 100, rect.y, rect.x + 100, rect.y, 800) - - }) - // 通过 ID 点击 暂停 播放 - it('Btn_001', 0, async function () { - let driver: Driver = Driver.create(); - await driver.delayMs(DELAY_TIME); - await driver.assertComponentExist(ON.id("Play")); - let button = await driver.findComponent(ON.id("Play")); - await button.click(); - await driver.delayMs(DELAY_TIME); - - }) - - }) - }) -} diff --git a/unionpi_tiger/sample/app/two_videoPlayer/entry/src/ohosTest/ets/test/List.test.ets b/unionpi_tiger/sample/app/two_videoPlayer/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 188615a9..00000000 --- a/unionpi_tiger/sample/app/two_videoPlayer/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -import abilityTest from './Ability.test' - -export default function testsuite() { - abilityTest() -} diff --git a/unionpi_tiger/sample/app/two_videoPlayer/entry/src/ohosTest/resources/base/element/string.json b/unionpi_tiger/sample/app/two_videoPlayer/entry/src/ohosTest/resources/base/element/string.json deleted file mode 100644 index a0901cfc..00000000 --- a/unionpi_tiger/sample/app/two_videoPlayer/entry/src/ohosTest/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "description_TestAbility", - "value": "eTS_Empty Ability" - }, - { - "name": "entry_TestAbility", - "value": "entry_TestAbility" - } - ] -} \ No newline at end of file diff --git a/unionpi_tiger/sample/app/two_videoPlayer/entry/src/ohosTest/resources/base/media/icon.png b/unionpi_tiger/sample/app/two_videoPlayer/entry/src/ohosTest/resources/base/media/icon.png deleted file mode 100644 index ce307a88..00000000 Binary files a/unionpi_tiger/sample/app/two_videoPlayer/entry/src/ohosTest/resources/base/media/icon.png and /dev/null differ diff --git a/unionpi_tiger/sample/app/two_videoPlayer/hvigor/hvigor-config.json5 b/unionpi_tiger/sample/app/two_videoPlayer/hvigor/hvigor-config.json5 deleted file mode 100644 index ff688122..00000000 --- a/unionpi_tiger/sample/app/two_videoPlayer/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,6 +0,0 @@ -{ - "hvigorVersion": "2.0.0", - "dependencies": { - "@ohos/hvigor-ohos-plugin": "2.0.0" - } -} diff --git a/unionpi_tiger/sample/app/two_videoPlayer/hvigor/hvigor-wrapper.js b/unionpi_tiger/sample/app/two_videoPlayer/hvigor/hvigor-wrapper.js deleted file mode 100644 index 994f2298..00000000 --- a/unionpi_tiger/sample/app/two_videoPlayer/hvigor/hvigor-wrapper.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict";var e=require("fs"),t=require("path"),n=require("os"),r=require("crypto"),u=require("child_process"),o=require("constants"),i=require("stream"),s=require("util"),c=require("assert"),a=require("tty"),l=require("zlib"),f=require("net");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var D=d(e),p=d(t),E=d(n),m=d(r),h=d(u),y=d(o),C=d(i),F=d(s),g=d(c),A=d(a),v=d(l),S=d(f),w="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},O={},b={},_={},B=w&&w.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_,"__esModule",{value:!0}),_.isMac=_.isLinux=_.isWindows=void 0;const P=B(E.default),k="Windows_NT",x="Linux",N="Darwin";_.isWindows=function(){return P.default.type()===k},_.isLinux=function(){return P.default.type()===x},_.isMac=function(){return P.default.type()===N};var I={},T=w&&w.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),R=w&&w.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),M=w&&w.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&T(t,e,n);return R(t,e),t};Object.defineProperty(I,"__esModule",{value:!0}),I.hash=void 0;const L=M(m.default);I.hash=function(e,t="md5"){return L.createHash(t).update(e,"utf-8").digest("hex")},function(e){var t=w&&w.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=w&&w.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=w&&w.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var u in e)"default"!==u&&Object.prototype.hasOwnProperty.call(e,u)&&t(r,e,u);return n(r,e),r};Object.defineProperty(e,"__esModule",{value:!0}),e.HVIGOR_BOOT_JS_FILE_PATH=e.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH=e.HVIGOR_PROJECT_DEPENDENCIES_HOME=e.HVIGOR_PROJECT_WRAPPER_HOME=e.HVIGOR_PROJECT_NAME=e.HVIGOR_PROJECT_ROOT_DIR=e.HVIGOR_PROJECT_CACHES_HOME=e.HVIGOR_PNPM_STORE_PATH=e.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH=e.HVIGOR_WRAPPER_TOOLS_HOME=e.HVIGOR_USER_HOME=e.DEFAULT_PACKAGE_JSON=e.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME=e.PNPM=e.HVIGOR=e.NPM_TOOL=e.PNPM_TOOL=e.HVIGOR_ENGINE_PACKAGE_NAME=void 0;const u=r(p.default),o=r(E.default),i=_,s=I;e.HVIGOR_ENGINE_PACKAGE_NAME="@ohos/hvigor",e.PNPM_TOOL=(0,i.isWindows)()?"pnpm.cmd":"pnpm",e.NPM_TOOL=(0,i.isWindows)()?"npm.cmd":"npm",e.HVIGOR="hvigor",e.PNPM="pnpm",e.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME="hvigor-config.json5",e.DEFAULT_PACKAGE_JSON="package.json",e.HVIGOR_USER_HOME=u.resolve(o.homedir(),".hvigor"),e.HVIGOR_WRAPPER_TOOLS_HOME=u.resolve(e.HVIGOR_USER_HOME,"wrapper","tools"),e.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH=u.resolve(e.HVIGOR_WRAPPER_TOOLS_HOME,"node_modules",".bin",e.PNPM_TOOL),e.HVIGOR_PNPM_STORE_PATH=u.resolve(e.HVIGOR_USER_HOME,"caches"),e.HVIGOR_PROJECT_CACHES_HOME=u.resolve(e.HVIGOR_USER_HOME,"project_caches"),e.HVIGOR_PROJECT_ROOT_DIR=process.cwd(),e.HVIGOR_PROJECT_NAME=u.basename((0,s.hash)(e.HVIGOR_PROJECT_ROOT_DIR)),e.HVIGOR_PROJECT_WRAPPER_HOME=u.resolve(e.HVIGOR_PROJECT_ROOT_DIR,e.HVIGOR),e.HVIGOR_PROJECT_DEPENDENCIES_HOME=u.resolve(e.HVIGOR_PROJECT_CACHES_HOME,e.HVIGOR_PROJECT_NAME,"workspace"),e.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH=u.resolve(e.HVIGOR_PROJECT_DEPENDENCIES_HOME,e.DEFAULT_PACKAGE_JSON),e.HVIGOR_BOOT_JS_FILE_PATH=u.resolve(e.HVIGOR_PROJECT_DEPENDENCIES_HOME,"node_modules","@ohos","hvigor","bin","hvigor.js")}(b);var j={},$={};Object.defineProperty($,"__esModule",{value:!0}),$.logInfoPrintConsole=$.logErrorAndExit=void 0,$.logErrorAndExit=function(e){e instanceof Error?console.error(e.message):console.error(e),process.exit(-1)},$.logInfoPrintConsole=function(e){console.log(e)};var H=w&&w.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),J=w&&w.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),G=w&&w.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&H(t,e,n);return J(t,e),t},V=w&&w.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(j,"__esModule",{value:!0}),j.isFileExists=j.offlinePluginConversion=j.executeCommand=j.getNpmPath=j.hasNpmPackInPaths=void 0;const U=h.default,W=G(p.default),z=b,K=$,q=V(D.default);j.hasNpmPackInPaths=function(e,t){try{return require.resolve(e,{paths:[...t]}),!0}catch(e){return!1}},j.getNpmPath=function(){const e=process.execPath;return W.join(W.dirname(e),z.NPM_TOOL)},j.executeCommand=function(e,t,n){0!==(0,U.spawnSync)(e,t,n).status&&(0,K.logErrorAndExit)(`Error: ${e} ${t} execute failed.See above for details.`)},j.offlinePluginConversion=function(e,t){return t.startsWith("file:")||t.endsWith(".tgz")?W.resolve(e,z.HVIGOR,t.replace("file:","")):t},j.isFileExists=function(e){return q.default.existsSync(e)&&q.default.statSync(e).isFile()},function(e){var t=w&&w.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=w&&w.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=w&&w.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var u in e)"default"!==u&&Object.prototype.hasOwnProperty.call(e,u)&&t(r,e,u);return n(r,e),r},u=w&&w.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.executeInstallPnpm=e.isPnpmAvailable=e.environmentHandler=e.checkNpmConifg=e.PNPM_VERSION=void 0;const o=r(D.default),i=b,s=j,c=r(p.default),a=$,l=h.default,f=u(E.default);e.PNPM_VERSION="7.30.0",e.checkNpmConifg=function(){const e=c.resolve(i.HVIGOR_PROJECT_ROOT_DIR,".npmrc"),t=c.resolve(f.default.homedir(),".npmrc");if((0,s.isFileExists)(e)||(0,s.isFileExists)(t))return;const n=(0,s.getNpmPath)(),r=(0,l.spawnSync)(n,["config","get","prefix"],{cwd:i.HVIGOR_PROJECT_ROOT_DIR});if(0!==r.status||!r.stdout)return void(0,a.logErrorAndExit)("Error: The hvigor depends on the npmrc file. Configure the npmrc file first.");const u=c.resolve(`${r.stdout}`.replace(/[\r\n]/gi,""),".npmrc");(0,s.isFileExists)(u)||(0,a.logErrorAndExit)("Error: The hvigor depends on the npmrc file. Configure the npmrc file first.")},e.environmentHandler=function(){process.env["npm_config_update-notifier"]="false"},e.isPnpmAvailable=function(){return!!o.existsSync(i.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH)&&(0,s.hasNpmPackInPaths)("pnpm",[i.HVIGOR_WRAPPER_TOOLS_HOME])},e.executeInstallPnpm=function(){(0,a.logInfoPrintConsole)(`Installing pnpm@${e.PNPM_VERSION}...`);const t=(0,s.getNpmPath)();!function(){const t=c.resolve(i.HVIGOR_WRAPPER_TOOLS_HOME,i.DEFAULT_PACKAGE_JSON);try{o.existsSync(i.HVIGOR_WRAPPER_TOOLS_HOME)||o.mkdirSync(i.HVIGOR_WRAPPER_TOOLS_HOME,{recursive:!0});const n={dependencies:{}};n.dependencies[i.PNPM]=e.PNPM_VERSION,o.writeFileSync(t,JSON.stringify(n))}catch(e){(0,a.logErrorAndExit)(`Error: EPERM: operation not permitted,create ${t} failed.`)}}(),(0,s.executeCommand)(t,["install","pnpm"],{cwd:i.HVIGOR_WRAPPER_TOOLS_HOME,stdio:["inherit","inherit","inherit"],env:process.env}),(0,a.logInfoPrintConsole)("Pnpm install success.")}}(O);var Y={},X={},Z={},Q={};Object.defineProperty(Q,"__esModule",{value:!0}),Q.Unicode=void 0;class ee{}Q.Unicode=ee,ee.Space_Separator=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,ee.ID_Start=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,ee.ID_Continue=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,Object.defineProperty(Z,"__esModule",{value:!0}),Z.JudgeUtil=void 0;const te=Q;Z.JudgeUtil=class{static isIgnoreChar(e){return"string"==typeof e&&("\t"===e||"\v"===e||"\f"===e||" "===e||" "===e||"\ufeff"===e||"\n"===e||"\r"===e||"\u2028"===e||"\u2029"===e)}static isSpaceSeparator(e){return"string"==typeof e&&te.Unicode.Space_Separator.test(e)}static isIdStartChar(e){return"string"==typeof e&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||"$"===e||"_"===e||te.Unicode.ID_Start.test(e))}static isIdContinueChar(e){return"string"==typeof e&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e>="0"&&e<="9"||"$"===e||"_"===e||"‌"===e||"‍"===e||te.Unicode.ID_Continue.test(e))}static isDigitWithoutZero(e){return/[1-9]/.test(e)}static isDigit(e){return"string"==typeof e&&/[0-9]/.test(e)}static isHexDigit(e){return"string"==typeof e&&/[0-9A-Fa-f]/.test(e)}};var ne={},re={fromCallback:function(e){return Object.defineProperty((function(...t){if("function"!=typeof t[t.length-1])return new Promise(((n,r)=>{e.call(this,...t,((e,t)=>null!=e?r(e):n(t)))}));e.apply(this,t)}),"name",{value:e.name})},fromPromise:function(e){return Object.defineProperty((function(...t){const n=t[t.length-1];if("function"!=typeof n)return e.apply(this,t);e.apply(this,t.slice(0,-1)).then((e=>n(null,e)),n)}),"name",{value:e.name})}},ue=y.default,oe=process.cwd,ie=null,se=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return ie||(ie=oe.call(process)),ie};try{process.cwd()}catch(e){}if("function"==typeof process.chdir){var ce=process.chdir;process.chdir=function(e){ie=null,ce.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,ce)}var ae=function(e){ue.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(e){e.lchmod=function(t,n,r){e.open(t,ue.O_WRONLY|ue.O_SYMLINK,n,(function(t,u){t?r&&r(t):e.fchmod(u,n,(function(t){e.close(u,(function(e){r&&r(t||e)}))}))}))},e.lchmodSync=function(t,n){var r,u=e.openSync(t,ue.O_WRONLY|ue.O_SYMLINK,n),o=!0;try{r=e.fchmodSync(u,n),o=!1}finally{if(o)try{e.closeSync(u)}catch(e){}else e.closeSync(u)}return r}}(e);e.lutimes||function(e){ue.hasOwnProperty("O_SYMLINK")&&e.futimes?(e.lutimes=function(t,n,r,u){e.open(t,ue.O_SYMLINK,(function(t,o){t?u&&u(t):e.futimes(o,n,r,(function(t){e.close(o,(function(e){u&&u(t||e)}))}))}))},e.lutimesSync=function(t,n,r){var u,o=e.openSync(t,ue.O_SYMLINK),i=!0;try{u=e.futimesSync(o,n,r),i=!1}finally{if(i)try{e.closeSync(o)}catch(e){}else e.closeSync(o)}return u}):e.futimes&&(e.lutimes=function(e,t,n,r){r&&process.nextTick(r)},e.lutimesSync=function(){})}(e);e.chown=r(e.chown),e.fchown=r(e.fchown),e.lchown=r(e.lchown),e.chmod=t(e.chmod),e.fchmod=t(e.fchmod),e.lchmod=t(e.lchmod),e.chownSync=u(e.chownSync),e.fchownSync=u(e.fchownSync),e.lchownSync=u(e.lchownSync),e.chmodSync=n(e.chmodSync),e.fchmodSync=n(e.fchmodSync),e.lchmodSync=n(e.lchmodSync),e.stat=o(e.stat),e.fstat=o(e.fstat),e.lstat=o(e.lstat),e.statSync=i(e.statSync),e.fstatSync=i(e.fstatSync),e.lstatSync=i(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(e,t,n){n&&process.nextTick(n)},e.lchmodSync=function(){});e.chown&&!e.lchown&&(e.lchown=function(e,t,n,r){r&&process.nextTick(r)},e.lchownSync=function(){});"win32"===se&&(e.rename="function"!=typeof e.rename?e.rename:function(t){function n(n,r,u){var o=Date.now(),i=0;t(n,r,(function s(c){if(c&&("EACCES"===c.code||"EPERM"===c.code||"EBUSY"===c.code)&&Date.now()-o<6e4)return setTimeout((function(){e.stat(r,(function(e,o){e&&"ENOENT"===e.code?t(n,r,s):u(c)}))}),i),void(i<100&&(i+=10));u&&u(c)}))}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.rename));function t(t){return t?function(n,r,u){return t.call(e,n,r,(function(e){s(e)&&(e=null),u&&u.apply(this,arguments)}))}:t}function n(t){return t?function(n,r){try{return t.call(e,n,r)}catch(e){if(!s(e))throw e}}:t}function r(t){return t?function(n,r,u,o){return t.call(e,n,r,u,(function(e){s(e)&&(e=null),o&&o.apply(this,arguments)}))}:t}function u(t){return t?function(n,r,u){try{return t.call(e,n,r,u)}catch(e){if(!s(e))throw e}}:t}function o(t){return t?function(n,r,u){function o(e,t){t&&(t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296)),u&&u.apply(this,arguments)}return"function"==typeof r&&(u=r,r=null),r?t.call(e,n,r,o):t.call(e,n,o)}:t}function i(t){return t?function(n,r){var u=r?t.call(e,n,r):t.call(e,n);return u&&(u.uid<0&&(u.uid+=4294967296),u.gid<0&&(u.gid+=4294967296)),u}:t}function s(e){return!e||("ENOSYS"===e.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==e.code&&"EPERM"!==e.code))}e.read="function"!=typeof e.read?e.read:function(t){function n(n,r,u,o,i,s){var c;if(s&&"function"==typeof s){var a=0;c=function(l,f,d){if(l&&"EAGAIN"===l.code&&a<10)return a++,t.call(e,n,r,u,o,i,c);s.apply(this,arguments)}}return t.call(e,n,r,u,o,i,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.read),e.readSync="function"!=typeof e.readSync?e.readSync:(c=e.readSync,function(t,n,r,u,o){for(var i=0;;)try{return c.call(e,t,n,r,u,o)}catch(e){if("EAGAIN"===e.code&&i<10){i++;continue}throw e}});var c};var le=C.default.Stream,fe=function(e){return{ReadStream:function t(n,r){if(!(this instanceof t))return new t(n,r);le.call(this);var u=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,r=r||{};for(var o=Object.keys(r),i=0,s=o.length;ithis.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick((function(){u._read()}));e.open(this.path,this.flags,this.mode,(function(e,t){if(e)return u.emit("error",e),void(u.readable=!1);u.fd=t,u.emit("open",t),u._read()}))},WriteStream:function t(n,r){if(!(this instanceof t))return new t(n,r);le.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var u=Object.keys(r),o=0,i=u.length;o= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}};var de=function(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Object)var t={__proto__:De(e)};else t=Object.create(null);return Object.getOwnPropertyNames(e).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t},De=Object.getPrototypeOf||function(e){return e.__proto__};var pe,Ee,me=D.default,he=ae,ye=fe,Ce=de,Fe=F.default;function ge(e,t){Object.defineProperty(e,pe,{get:function(){return t}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(pe=Symbol.for("graceful-fs.queue"),Ee=Symbol.for("graceful-fs.previous")):(pe="___graceful-fs.queue",Ee="___graceful-fs.previous");var Ae=function(){};if(Fe.debuglog?Ae=Fe.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Ae=function(){var e=Fe.format.apply(Fe,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: "),console.error(e)}),!me[pe]){var ve=w[pe]||[];ge(me,ve),me.close=function(e){function t(t,n){return e.call(me,t,(function(e){e||_e(),"function"==typeof n&&n.apply(this,arguments)}))}return Object.defineProperty(t,Ee,{value:e}),t}(me.close),me.closeSync=function(e){function t(t){e.apply(me,arguments),_e()}return Object.defineProperty(t,Ee,{value:e}),t}(me.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){Ae(me[pe]),g.default.equal(me[pe].length,0)}))}w[pe]||ge(w,me[pe]);var Se,we=Oe(Ce(me));function Oe(e){he(e),e.gracefulify=Oe,e.createReadStream=function(t,n){return new e.ReadStream(t,n)},e.createWriteStream=function(t,n){return new e.WriteStream(t,n)};var t=e.readFile;e.readFile=function(e,n,r){"function"==typeof n&&(r=n,n=null);return function e(n,r,u,o){return t(n,r,(function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof u&&u.apply(this,arguments):be([e,[n,r,u],t,o||Date.now(),Date.now()])}))}(e,n,r)};var n=e.writeFile;e.writeFile=function(e,t,r,u){"function"==typeof r&&(u=r,r=null);return function e(t,r,u,o,i){return n(t,r,u,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof o&&o.apply(this,arguments):be([e,[t,r,u,o],n,i||Date.now(),Date.now()])}))}(e,t,r,u)};var r=e.appendFile;r&&(e.appendFile=function(e,t,n,u){"function"==typeof n&&(u=n,n=null);return function e(t,n,u,o,i){return r(t,n,u,(function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?"function"==typeof o&&o.apply(this,arguments):be([e,[t,n,u,o],r,i||Date.now(),Date.now()])}))}(e,t,n,u)});var u=e.copyFile;u&&(e.copyFile=function(e,t,n,r){"function"==typeof n&&(r=n,n=0);return function e(t,n,r,o,i){return u(t,n,r,(function(u){!u||"EMFILE"!==u.code&&"ENFILE"!==u.code?"function"==typeof o&&o.apply(this,arguments):be([e,[t,n,r,o],u,i||Date.now(),Date.now()])}))}(e,t,n,r)});var o=e.readdir;e.readdir=function(e,t,n){"function"==typeof t&&(n=t,t=null);var r=i.test(process.version)?function(e,t,n,r){return o(e,u(e,t,n,r))}:function(e,t,n,r){return o(e,t,u(e,t,n,r))};return r(e,t,n);function u(e,t,n,u){return function(o,i){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?(i&&i.sort&&i.sort(),"function"==typeof n&&n.call(this,o,i)):be([r,[e,t,n],o,u||Date.now(),Date.now()])}}};var i=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var s=ye(e);d=s.ReadStream,D=s.WriteStream}var c=e.ReadStream;c&&(d.prototype=Object.create(c.prototype),d.prototype.open=function(){var e=this;E(e.path,e.flags,e.mode,(function(t,n){t?(e.autoClose&&e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n),e.read())}))});var a=e.WriteStream;a&&(D.prototype=Object.create(a.prototype),D.prototype.open=function(){var e=this;E(e.path,e.flags,e.mode,(function(t,n){t?(e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n))}))}),Object.defineProperty(e,"ReadStream",{get:function(){return d},set:function(e){d=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return D},set:function(e){D=e},enumerable:!0,configurable:!0});var l=d;Object.defineProperty(e,"FileReadStream",{get:function(){return l},set:function(e){l=e},enumerable:!0,configurable:!0});var f=D;function d(e,t){return this instanceof d?(c.apply(this,arguments),this):d.apply(Object.create(d.prototype),arguments)}function D(e,t){return this instanceof D?(a.apply(this,arguments),this):D.apply(Object.create(D.prototype),arguments)}Object.defineProperty(e,"FileWriteStream",{get:function(){return f},set:function(e){f=e},enumerable:!0,configurable:!0});var p=e.open;function E(e,t,n,r){return"function"==typeof n&&(r=n,n=null),function e(t,n,r,u,o){return p(t,n,r,(function(i,s){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?"function"==typeof u&&u.apply(this,arguments):be([e,[t,n,r,u],i,o||Date.now(),Date.now()])}))}(e,t,n,r)}return e.open=E,e}function be(e){Ae("ENQUEUE",e[0].name,e[1]),me[pe].push(e),Be()}function _e(){for(var e=Date.now(),t=0;t2&&(me[pe][t][3]=e,me[pe][t][4]=e);Be()}function Be(){if(clearTimeout(Se),Se=void 0,0!==me[pe].length){var e=me[pe].shift(),t=e[0],n=e[1],r=e[2],u=e[3],o=e[4];if(void 0===u)Ae("RETRY",t.name,n),t.apply(null,n);else if(Date.now()-u>=6e4){Ae("TIMEOUT",t.name,n);var i=n.pop();"function"==typeof i&&i.call(null,r)}else{var s=Date.now()-o,c=Math.max(o-u,1);s>=Math.min(1.2*c,100)?(Ae("RETRY",t.name,n),t.apply(null,n.concat([u]))):me[pe].push(e)}void 0===Se&&(Se=setTimeout(Be,0))}}process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!me.__patched&&(we=Oe(me),me.__patched=!0),function(e){const t=re.fromCallback,n=we,r=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((e=>"function"==typeof n[e]));Object.assign(e,n),r.forEach((r=>{e[r]=t(n[r])})),e.realpath.native=t(n.realpath.native),e.exists=function(e,t){return"function"==typeof t?n.exists(e,t):new Promise((t=>n.exists(e,t)))},e.read=function(e,t,r,u,o,i){return"function"==typeof i?n.read(e,t,r,u,o,i):new Promise(((i,s)=>{n.read(e,t,r,u,o,((e,t,n)=>{if(e)return s(e);i({bytesRead:t,buffer:n})}))}))},e.write=function(e,t,...r){return"function"==typeof r[r.length-1]?n.write(e,t,...r):new Promise(((u,o)=>{n.write(e,t,...r,((e,t,n)=>{if(e)return o(e);u({bytesWritten:t,buffer:n})}))}))},"function"==typeof n.writev&&(e.writev=function(e,t,...r){return"function"==typeof r[r.length-1]?n.writev(e,t,...r):new Promise(((u,o)=>{n.writev(e,t,...r,((e,t,n)=>{if(e)return o(e);u({bytesWritten:t,buffers:n})}))}))})}(ne);var Pe={},ke={};const xe=p.default;ke.checkPath=function(e){if("win32"===process.platform){if(/[<>:"|?*]/.test(e.replace(xe.parse(e).root,""))){const t=new Error(`Path contains invalid characters: ${e}`);throw t.code="EINVAL",t}}};const Ne=ne,{checkPath:Ie}=ke,Te=e=>"number"==typeof e?e:{mode:511,...e}.mode;Pe.makeDir=async(e,t)=>(Ie(e),Ne.mkdir(e,{mode:Te(t),recursive:!0})),Pe.makeDirSync=(e,t)=>(Ie(e),Ne.mkdirSync(e,{mode:Te(t),recursive:!0}));const Re=re.fromPromise,{makeDir:Me,makeDirSync:Le}=Pe,je=Re(Me);var $e={mkdirs:je,mkdirsSync:Le,mkdirp:je,mkdirpSync:Le,ensureDir:je,ensureDirSync:Le};const He=re.fromPromise,Je=ne;var Ge={pathExists:He((function(e){return Je.access(e).then((()=>!0)).catch((()=>!1))})),pathExistsSync:Je.existsSync};const Ve=we;var Ue=function(e,t,n,r){Ve.open(e,"r+",((e,u)=>{if(e)return r(e);Ve.futimes(u,t,n,(e=>{Ve.close(u,(t=>{r&&r(e||t)}))}))}))},We=function(e,t,n){const r=Ve.openSync(e,"r+");return Ve.futimesSync(r,t,n),Ve.closeSync(r)};const ze=ne,Ke=p.default,qe=F.default;function Ye(e,t,n){const r=n.dereference?e=>ze.stat(e,{bigint:!0}):e=>ze.lstat(e,{bigint:!0});return Promise.all([r(e),r(t).catch((e=>{if("ENOENT"===e.code)return null;throw e}))]).then((([e,t])=>({srcStat:e,destStat:t})))}function Xe(e,t){return t.ino&&t.dev&&t.ino===e.ino&&t.dev===e.dev}function Ze(e,t){const n=Ke.resolve(e).split(Ke.sep).filter((e=>e)),r=Ke.resolve(t).split(Ke.sep).filter((e=>e));return n.reduce(((e,t,n)=>e&&r[n]===t),!0)}function Qe(e,t,n){return`Cannot ${n} '${e}' to a subdirectory of itself, '${t}'.`}var et={checkPaths:function(e,t,n,r,u){qe.callbackify(Ye)(e,t,r,((r,o)=>{if(r)return u(r);const{srcStat:i,destStat:s}=o;if(s){if(Xe(i,s)){const r=Ke.basename(e),o=Ke.basename(t);return"move"===n&&r!==o&&r.toLowerCase()===o.toLowerCase()?u(null,{srcStat:i,destStat:s,isChangingCase:!0}):u(new Error("Source and destination must not be the same."))}if(i.isDirectory()&&!s.isDirectory())return u(new Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`));if(!i.isDirectory()&&s.isDirectory())return u(new Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`))}return i.isDirectory()&&Ze(e,t)?u(new Error(Qe(e,t,n))):u(null,{srcStat:i,destStat:s})}))},checkPathsSync:function(e,t,n,r){const{srcStat:u,destStat:o}=function(e,t,n){let r;const u=n.dereference?e=>ze.statSync(e,{bigint:!0}):e=>ze.lstatSync(e,{bigint:!0}),o=u(e);try{r=u(t)}catch(e){if("ENOENT"===e.code)return{srcStat:o,destStat:null};throw e}return{srcStat:o,destStat:r}}(e,t,r);if(o){if(Xe(u,o)){const r=Ke.basename(e),i=Ke.basename(t);if("move"===n&&r!==i&&r.toLowerCase()===i.toLowerCase())return{srcStat:u,destStat:o,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(u.isDirectory()&&!o.isDirectory())throw new Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`);if(!u.isDirectory()&&o.isDirectory())throw new Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`)}if(u.isDirectory()&&Ze(e,t))throw new Error(Qe(e,t,n));return{srcStat:u,destStat:o}},checkParentPaths:function e(t,n,r,u,o){const i=Ke.resolve(Ke.dirname(t)),s=Ke.resolve(Ke.dirname(r));if(s===i||s===Ke.parse(s).root)return o();ze.stat(s,{bigint:!0},((i,c)=>i?"ENOENT"===i.code?o():o(i):Xe(n,c)?o(new Error(Qe(t,r,u))):e(t,n,s,u,o)))},checkParentPathsSync:function e(t,n,r,u){const o=Ke.resolve(Ke.dirname(t)),i=Ke.resolve(Ke.dirname(r));if(i===o||i===Ke.parse(i).root)return;let s;try{s=ze.statSync(i,{bigint:!0})}catch(e){if("ENOENT"===e.code)return;throw e}if(Xe(n,s))throw new Error(Qe(t,r,u));return e(t,n,i,u)},isSrcSubdir:Ze,areIdentical:Xe};const tt=we,nt=p.default,rt=$e.mkdirs,ut=Ge.pathExists,ot=Ue,it=et;function st(e,t,n,r,u){const o=nt.dirname(n);ut(o,((i,s)=>i?u(i):s?at(e,t,n,r,u):void rt(o,(o=>o?u(o):at(e,t,n,r,u)))))}function ct(e,t,n,r,u,o){Promise.resolve(u.filter(n,r)).then((i=>i?e(t,n,r,u,o):o()),(e=>o(e)))}function at(e,t,n,r,u){(r.dereference?tt.stat:tt.lstat)(t,((o,i)=>o?u(o):i.isDirectory()?function(e,t,n,r,u,o){return t?Dt(n,r,u,o):function(e,t,n,r,u){tt.mkdir(n,(o=>{if(o)return u(o);Dt(t,n,r,(t=>t?u(t):dt(n,e,u)))}))}(e.mode,n,r,u,o)}(i,e,t,n,r,u):i.isFile()||i.isCharacterDevice()||i.isBlockDevice()?function(e,t,n,r,u,o){return t?function(e,t,n,r,u){if(!r.overwrite)return r.errorOnExist?u(new Error(`'${n}' already exists`)):u();tt.unlink(n,(o=>o?u(o):lt(e,t,n,r,u)))}(e,n,r,u,o):lt(e,n,r,u,o)}(i,e,t,n,r,u):i.isSymbolicLink()?function(e,t,n,r,u){tt.readlink(t,((t,o)=>t?u(t):(r.dereference&&(o=nt.resolve(process.cwd(),o)),e?void tt.readlink(n,((t,i)=>t?"EINVAL"===t.code||"UNKNOWN"===t.code?tt.symlink(o,n,u):u(t):(r.dereference&&(i=nt.resolve(process.cwd(),i)),it.isSrcSubdir(o,i)?u(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${i}'.`)):e.isDirectory()&&it.isSrcSubdir(i,o)?u(new Error(`Cannot overwrite '${i}' with '${o}'.`)):function(e,t,n){tt.unlink(t,(r=>r?n(r):tt.symlink(e,t,n)))}(o,n,u)))):tt.symlink(o,n,u))))}(e,t,n,r,u):i.isSocket()?u(new Error(`Cannot copy a socket file: ${t}`)):i.isFIFO()?u(new Error(`Cannot copy a FIFO pipe: ${t}`)):u(new Error(`Unknown file: ${t}`))))}function lt(e,t,n,r,u){tt.copyFile(t,n,(o=>o?u(o):r.preserveTimestamps?function(e,t,n,r){if(function(e){return 0==(128&e)}(e))return function(e,t,n){return dt(e,128|t,n)}(n,e,(u=>u?r(u):ft(e,t,n,r)));return ft(e,t,n,r)}(e.mode,t,n,u):dt(n,e.mode,u)))}function ft(e,t,n,r){!function(e,t,n){tt.stat(e,((e,r)=>e?n(e):ot(t,r.atime,r.mtime,n)))}(t,n,(t=>t?r(t):dt(n,e,r)))}function dt(e,t,n){return tt.chmod(e,t,n)}function Dt(e,t,n,r){tt.readdir(e,((u,o)=>u?r(u):pt(o,e,t,n,r)))}function pt(e,t,n,r,u){const o=e.pop();return o?function(e,t,n,r,u,o){const i=nt.join(n,t),s=nt.join(r,t);it.checkPaths(i,s,"copy",u,((t,c)=>{if(t)return o(t);const{destStat:a}=c;!function(e,t,n,r,u){r.filter?ct(at,e,t,n,r,u):at(e,t,n,r,u)}(a,i,s,u,(t=>t?o(t):pt(e,n,r,u,o)))}))}(e,o,t,n,r,u):u()}var Et=function(e,t,n,r){"function"!=typeof n||r?"function"==typeof n&&(n={filter:n}):(r=n,n={}),r=r||function(){},(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269"),it.checkPaths(e,t,"copy",n,((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;it.checkParentPaths(e,i,t,"copy",(u=>u?r(u):n.filter?ct(st,s,e,t,n,r):st(s,e,t,n,r)))}))};const mt=we,ht=p.default,yt=$e.mkdirsSync,Ct=We,Ft=et;function gt(e,t,n,r){const u=(r.dereference?mt.statSync:mt.lstatSync)(t);if(u.isDirectory())return function(e,t,n,r,u){return t?St(n,r,u):function(e,t,n,r){return mt.mkdirSync(n),St(t,n,r),vt(n,e)}(e.mode,n,r,u)}(u,e,t,n,r);if(u.isFile()||u.isCharacterDevice()||u.isBlockDevice())return function(e,t,n,r,u){return t?function(e,t,n,r){if(r.overwrite)return mt.unlinkSync(n),At(e,t,n,r);if(r.errorOnExist)throw new Error(`'${n}' already exists`)}(e,n,r,u):At(e,n,r,u)}(u,e,t,n,r);if(u.isSymbolicLink())return function(e,t,n,r){let u=mt.readlinkSync(t);r.dereference&&(u=ht.resolve(process.cwd(),u));if(e){let e;try{e=mt.readlinkSync(n)}catch(e){if("EINVAL"===e.code||"UNKNOWN"===e.code)return mt.symlinkSync(u,n);throw e}if(r.dereference&&(e=ht.resolve(process.cwd(),e)),Ft.isSrcSubdir(u,e))throw new Error(`Cannot copy '${u}' to a subdirectory of itself, '${e}'.`);if(mt.statSync(n).isDirectory()&&Ft.isSrcSubdir(e,u))throw new Error(`Cannot overwrite '${e}' with '${u}'.`);return function(e,t){return mt.unlinkSync(t),mt.symlinkSync(e,t)}(u,n)}return mt.symlinkSync(u,n)}(e,t,n,r);if(u.isSocket())throw new Error(`Cannot copy a socket file: ${t}`);if(u.isFIFO())throw new Error(`Cannot copy a FIFO pipe: ${t}`);throw new Error(`Unknown file: ${t}`)}function At(e,t,n,r){return mt.copyFileSync(t,n),r.preserveTimestamps&&function(e,t,n){(function(e){return 0==(128&e)})(e)&&function(e,t){vt(e,128|t)}(n,e);(function(e,t){const n=mt.statSync(e);Ct(t,n.atime,n.mtime)})(t,n)}(e.mode,t,n),vt(n,e.mode)}function vt(e,t){return mt.chmodSync(e,t)}function St(e,t,n){mt.readdirSync(e).forEach((r=>function(e,t,n,r){const u=ht.join(t,e),o=ht.join(n,e),{destStat:i}=Ft.checkPathsSync(u,o,"copy",r);return function(e,t,n,r){if(!r.filter||r.filter(t,n))return gt(e,t,n,r)}(i,u,o,r)}(r,e,t,n)))}var wt=function(e,t,n){"function"==typeof n&&(n={filter:n}),(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269");const{srcStat:r,destStat:u}=Ft.checkPathsSync(e,t,"copy",n);return Ft.checkParentPathsSync(e,r,t,"copy"),function(e,t,n,r){if(r.filter&&!r.filter(t,n))return;const u=ht.dirname(n);mt.existsSync(u)||yt(u);return gt(e,t,n,r)}(u,e,t,n)};var Ot={copy:(0,re.fromCallback)(Et),copySync:wt};const bt=we,_t=p.default,Bt=g.default,Pt="win32"===process.platform;function kt(e){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((t=>{e[t]=e[t]||bt[t],e[t+="Sync"]=e[t]||bt[t]})),e.maxBusyTries=e.maxBusyTries||3}function xt(e,t,n){let r=0;"function"==typeof t&&(n=t,t={}),Bt(e,"rimraf: missing path"),Bt.strictEqual(typeof e,"string","rimraf: path should be a string"),Bt.strictEqual(typeof n,"function","rimraf: callback function required"),Bt(t,"rimraf: invalid options argument provided"),Bt.strictEqual(typeof t,"object","rimraf: options should be object"),kt(t),Nt(e,t,(function u(o){if(o){if(("EBUSY"===o.code||"ENOTEMPTY"===o.code||"EPERM"===o.code)&&rNt(e,t,u)),100*r)}"ENOENT"===o.code&&(o=null)}n(o)}))}function Nt(e,t,n){Bt(e),Bt(t),Bt("function"==typeof n),t.lstat(e,((r,u)=>r&&"ENOENT"===r.code?n(null):r&&"EPERM"===r.code&&Pt?It(e,t,r,n):u&&u.isDirectory()?Rt(e,t,r,n):void t.unlink(e,(r=>{if(r){if("ENOENT"===r.code)return n(null);if("EPERM"===r.code)return Pt?It(e,t,r,n):Rt(e,t,r,n);if("EISDIR"===r.code)return Rt(e,t,r,n)}return n(r)}))))}function It(e,t,n,r){Bt(e),Bt(t),Bt("function"==typeof r),t.chmod(e,438,(u=>{u?r("ENOENT"===u.code?null:n):t.stat(e,((u,o)=>{u?r("ENOENT"===u.code?null:n):o.isDirectory()?Rt(e,t,n,r):t.unlink(e,r)}))}))}function Tt(e,t,n){let r;Bt(e),Bt(t);try{t.chmodSync(e,438)}catch(e){if("ENOENT"===e.code)return;throw n}try{r=t.statSync(e)}catch(e){if("ENOENT"===e.code)return;throw n}r.isDirectory()?Lt(e,t,n):t.unlinkSync(e)}function Rt(e,t,n,r){Bt(e),Bt(t),Bt("function"==typeof r),t.rmdir(e,(u=>{!u||"ENOTEMPTY"!==u.code&&"EEXIST"!==u.code&&"EPERM"!==u.code?u&&"ENOTDIR"===u.code?r(n):r(u):function(e,t,n){Bt(e),Bt(t),Bt("function"==typeof n),t.readdir(e,((r,u)=>{if(r)return n(r);let o,i=u.length;if(0===i)return t.rmdir(e,n);u.forEach((r=>{xt(_t.join(e,r),t,(r=>{if(!o)return r?n(o=r):void(0==--i&&t.rmdir(e,n))}))}))}))}(e,t,r)}))}function Mt(e,t){let n;kt(t=t||{}),Bt(e,"rimraf: missing path"),Bt.strictEqual(typeof e,"string","rimraf: path should be a string"),Bt(t,"rimraf: missing options"),Bt.strictEqual(typeof t,"object","rimraf: options should be object");try{n=t.lstatSync(e)}catch(n){if("ENOENT"===n.code)return;"EPERM"===n.code&&Pt&&Tt(e,t,n)}try{n&&n.isDirectory()?Lt(e,t,null):t.unlinkSync(e)}catch(n){if("ENOENT"===n.code)return;if("EPERM"===n.code)return Pt?Tt(e,t,n):Lt(e,t,n);if("EISDIR"!==n.code)throw n;Lt(e,t,n)}}function Lt(e,t,n){Bt(e),Bt(t);try{t.rmdirSync(e)}catch(r){if("ENOTDIR"===r.code)throw n;if("ENOTEMPTY"===r.code||"EEXIST"===r.code||"EPERM"===r.code)!function(e,t){if(Bt(e),Bt(t),t.readdirSync(e).forEach((n=>Mt(_t.join(e,n),t))),!Pt){return t.rmdirSync(e,t)}{const n=Date.now();do{try{return t.rmdirSync(e,t)}catch{}}while(Date.now()-n<500)}}(e,t);else if("ENOENT"!==r.code)throw r}}var jt=xt;xt.sync=Mt;const $t=we,Ht=re.fromCallback,Jt=jt;var Gt={remove:Ht((function(e,t){if($t.rm)return $t.rm(e,{recursive:!0,force:!0},t);Jt(e,t)})),removeSync:function(e){if($t.rmSync)return $t.rmSync(e,{recursive:!0,force:!0});Jt.sync(e)}};const Vt=re.fromPromise,Ut=ne,Wt=p.default,zt=$e,Kt=Gt,qt=Vt((async function(e){let t;try{t=await Ut.readdir(e)}catch{return zt.mkdirs(e)}return Promise.all(t.map((t=>Kt.remove(Wt.join(e,t)))))}));function Yt(e){let t;try{t=Ut.readdirSync(e)}catch{return zt.mkdirsSync(e)}t.forEach((t=>{t=Wt.join(e,t),Kt.removeSync(t)}))}var Xt={emptyDirSync:Yt,emptydirSync:Yt,emptyDir:qt,emptydir:qt};const Zt=re.fromCallback,Qt=p.default,en=we,tn=$e;var nn={createFile:Zt((function(e,t){function n(){en.writeFile(e,"",(e=>{if(e)return t(e);t()}))}en.stat(e,((r,u)=>{if(!r&&u.isFile())return t();const o=Qt.dirname(e);en.stat(o,((e,r)=>{if(e)return"ENOENT"===e.code?tn.mkdirs(o,(e=>{if(e)return t(e);n()})):t(e);r.isDirectory()?n():en.readdir(o,(e=>{if(e)return t(e)}))}))}))})),createFileSync:function(e){let t;try{t=en.statSync(e)}catch{}if(t&&t.isFile())return;const n=Qt.dirname(e);try{en.statSync(n).isDirectory()||en.readdirSync(n)}catch(e){if(!e||"ENOENT"!==e.code)throw e;tn.mkdirsSync(n)}en.writeFileSync(e,"")}};const rn=re.fromCallback,un=p.default,on=we,sn=$e,cn=Ge.pathExists,{areIdentical:an}=et;var ln={createLink:rn((function(e,t,n){function r(e,t){on.link(e,t,(e=>{if(e)return n(e);n(null)}))}on.lstat(t,((u,o)=>{on.lstat(e,((u,i)=>{if(u)return u.message=u.message.replace("lstat","ensureLink"),n(u);if(o&&an(i,o))return n(null);const s=un.dirname(t);cn(s,((u,o)=>u?n(u):o?r(e,t):void sn.mkdirs(s,(u=>{if(u)return n(u);r(e,t)}))))}))}))})),createLinkSync:function(e,t){let n;try{n=on.lstatSync(t)}catch{}try{const t=on.lstatSync(e);if(n&&an(t,n))return}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}const r=un.dirname(t);return on.existsSync(r)||sn.mkdirsSync(r),on.linkSync(e,t)}};const fn=p.default,dn=we,Dn=Ge.pathExists;var pn={symlinkPaths:function(e,t,n){if(fn.isAbsolute(e))return dn.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:e})));{const r=fn.dirname(t),u=fn.join(r,e);return Dn(u,((t,o)=>t?n(t):o?n(null,{toCwd:u,toDst:e}):dn.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:fn.relative(r,e)})))))}},symlinkPathsSync:function(e,t){let n;if(fn.isAbsolute(e)){if(n=dn.existsSync(e),!n)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}{const r=fn.dirname(t),u=fn.join(r,e);if(n=dn.existsSync(u),n)return{toCwd:u,toDst:e};if(n=dn.existsSync(e),!n)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:fn.relative(r,e)}}}};const En=we;var mn={symlinkType:function(e,t,n){if(n="function"==typeof t?t:n,t="function"!=typeof t&&t)return n(null,t);En.lstat(e,((e,r)=>{if(e)return n(null,"file");t=r&&r.isDirectory()?"dir":"file",n(null,t)}))},symlinkTypeSync:function(e,t){let n;if(t)return t;try{n=En.lstatSync(e)}catch{return"file"}return n&&n.isDirectory()?"dir":"file"}};const hn=re.fromCallback,yn=p.default,Cn=ne,Fn=$e.mkdirs,gn=$e.mkdirsSync,An=pn.symlinkPaths,vn=pn.symlinkPathsSync,Sn=mn.symlinkType,wn=mn.symlinkTypeSync,On=Ge.pathExists,{areIdentical:bn}=et;function _n(e,t,n,r){An(e,t,((u,o)=>{if(u)return r(u);e=o.toDst,Sn(o.toCwd,n,((n,u)=>{if(n)return r(n);const o=yn.dirname(t);On(o,((n,i)=>n?r(n):i?Cn.symlink(e,t,u,r):void Fn(o,(n=>{if(n)return r(n);Cn.symlink(e,t,u,r)}))))}))}))}var Bn={createSymlink:hn((function(e,t,n,r){r="function"==typeof n?n:r,n="function"!=typeof n&&n,Cn.lstat(t,((u,o)=>{!u&&o.isSymbolicLink()?Promise.all([Cn.stat(e),Cn.stat(t)]).then((([u,o])=>{if(bn(u,o))return r(null);_n(e,t,n,r)})):_n(e,t,n,r)}))})),createSymlinkSync:function(e,t,n){let r;try{r=Cn.lstatSync(t)}catch{}if(r&&r.isSymbolicLink()){const n=Cn.statSync(e),r=Cn.statSync(t);if(bn(n,r))return}const u=vn(e,t);e=u.toDst,n=wn(u.toCwd,n);const o=yn.dirname(t);return Cn.existsSync(o)||gn(o),Cn.symlinkSync(e,t,n)}};const{createFile:Pn,createFileSync:kn}=nn,{createLink:xn,createLinkSync:Nn}=ln,{createSymlink:In,createSymlinkSync:Tn}=Bn;var Rn={createFile:Pn,createFileSync:kn,ensureFile:Pn,ensureFileSync:kn,createLink:xn,createLinkSync:Nn,ensureLink:xn,ensureLinkSync:Nn,createSymlink:In,createSymlinkSync:Tn,ensureSymlink:In,ensureSymlinkSync:Tn};var Mn={stringify:function(e,{EOL:t="\n",finalEOL:n=!0,replacer:r=null,spaces:u}={}){const o=n?t:"";return JSON.stringify(e,r,u).replace(/\n/g,t)+o},stripBom:function(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e.replace(/^\uFEFF/,"")}};let Ln;try{Ln=we}catch(e){Ln=D.default}const jn=re,{stringify:$n,stripBom:Hn}=Mn;const Jn=jn.fromPromise((async function(e,t={}){"string"==typeof t&&(t={encoding:t});const n=t.fs||Ln,r=!("throws"in t)||t.throws;let u,o=await jn.fromCallback(n.readFile)(e,t);o=Hn(o);try{u=JSON.parse(o,t?t.reviver:null)}catch(t){if(r)throw t.message=`${e}: ${t.message}`,t;return null}return u}));const Gn=jn.fromPromise((async function(e,t,n={}){const r=n.fs||Ln,u=$n(t,n);await jn.fromCallback(r.writeFile)(e,u,n)}));const Vn={readFile:Jn,readFileSync:function(e,t={}){"string"==typeof t&&(t={encoding:t});const n=t.fs||Ln,r=!("throws"in t)||t.throws;try{let r=n.readFileSync(e,t);return r=Hn(r),JSON.parse(r,t.reviver)}catch(t){if(r)throw t.message=`${e}: ${t.message}`,t;return null}},writeFile:Gn,writeFileSync:function(e,t,n={}){const r=n.fs||Ln,u=$n(t,n);return r.writeFileSync(e,u,n)}};var Un={readJson:Vn.readFile,readJsonSync:Vn.readFileSync,writeJson:Vn.writeFile,writeJsonSync:Vn.writeFileSync};const Wn=re.fromCallback,zn=we,Kn=p.default,qn=$e,Yn=Ge.pathExists;var Xn={outputFile:Wn((function(e,t,n,r){"function"==typeof n&&(r=n,n="utf8");const u=Kn.dirname(e);Yn(u,((o,i)=>o?r(o):i?zn.writeFile(e,t,n,r):void qn.mkdirs(u,(u=>{if(u)return r(u);zn.writeFile(e,t,n,r)}))))})),outputFileSync:function(e,...t){const n=Kn.dirname(e);if(zn.existsSync(n))return zn.writeFileSync(e,...t);qn.mkdirsSync(n),zn.writeFileSync(e,...t)}};const{stringify:Zn}=Mn,{outputFile:Qn}=Xn;var er=async function(e,t,n={}){const r=Zn(t,n);await Qn(e,r,n)};const{stringify:tr}=Mn,{outputFileSync:nr}=Xn;var rr=function(e,t,n){const r=tr(t,n);nr(e,r,n)};const ur=re.fromPromise,or=Un;or.outputJson=ur(er),or.outputJsonSync=rr,or.outputJSON=or.outputJson,or.outputJSONSync=or.outputJsonSync,or.writeJSON=or.writeJson,or.writeJSONSync=or.writeJsonSync,or.readJSON=or.readJson,or.readJSONSync=or.readJsonSync;var ir=or;const sr=we,cr=p.default,ar=Ot.copy,lr=Gt.remove,fr=$e.mkdirp,dr=Ge.pathExists,Dr=et;function pr(e,t,n,r,u){return r?Er(e,t,n,u):n?lr(t,(r=>r?u(r):Er(e,t,n,u))):void dr(t,((r,o)=>r?u(r):o?u(new Error("dest already exists.")):Er(e,t,n,u)))}function Er(e,t,n,r){sr.rename(e,t,(u=>u?"EXDEV"!==u.code?r(u):function(e,t,n,r){const u={overwrite:n,errorOnExist:!0};ar(e,t,u,(t=>t?r(t):lr(e,r)))}(e,t,n,r):r()))}var mr=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=n.overwrite||n.clobber||!1;Dr.checkPaths(e,t,"move",n,((n,o)=>{if(n)return r(n);const{srcStat:i,isChangingCase:s=!1}=o;Dr.checkParentPaths(e,i,t,"move",(n=>n?r(n):function(e){const t=cr.dirname(e);return cr.parse(t).root===t}(t)?pr(e,t,u,s,r):void fr(cr.dirname(t),(n=>n?r(n):pr(e,t,u,s,r)))))}))};const hr=we,yr=p.default,Cr=Ot.copySync,Fr=Gt.removeSync,gr=$e.mkdirpSync,Ar=et;function vr(e,t,n){try{hr.renameSync(e,t)}catch(r){if("EXDEV"!==r.code)throw r;return function(e,t,n){const r={overwrite:n,errorOnExist:!0};return Cr(e,t,r),Fr(e)}(e,t,n)}}var Sr=function(e,t,n){const r=(n=n||{}).overwrite||n.clobber||!1,{srcStat:u,isChangingCase:o=!1}=Ar.checkPathsSync(e,t,"move",n);return Ar.checkParentPathsSync(e,u,t,"move"),function(e){const t=yr.dirname(e);return yr.parse(t).root===t}(t)||gr(yr.dirname(t)),function(e,t,n,r){if(r)return vr(e,t,n);if(n)return Fr(t),vr(e,t,n);if(hr.existsSync(t))throw new Error("dest already exists.");return vr(e,t,n)}(e,t,r,o)};var wr,Or,br,_r,Br,Pr={move:(0,re.fromCallback)(mr),moveSync:Sr},kr={...ne,...Ot,...Xt,...Rn,...ir,...$e,...Pr,...Xn,...Ge,...Gt},xr={},Nr={exports:{}},Ir={exports:{}};function Tr(){if(Or)return wr;Or=1;var e=1e3,t=60*e,n=60*t,r=24*n,u=7*r,o=365.25*r;function i(e,t,n,r){var u=t>=1.5*n;return Math.round(e/n)+" "+r+(u?"s":"")}return wr=function(s,c){c=c||{};var a=typeof s;if("string"===a&&s.length>0)return function(i){if((i=String(i)).length>100)return;var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(!s)return;var c=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*u;case"days":case"day":case"d":return c*r;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*t;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(s);if("number"===a&&isFinite(s))return c.long?function(u){var o=Math.abs(u);if(o>=r)return i(u,o,r,"day");if(o>=n)return i(u,o,n,"hour");if(o>=t)return i(u,o,t,"minute");if(o>=e)return i(u,o,e,"second");return u+" ms"}(s):function(u){var o=Math.abs(u);if(o>=r)return Math.round(u/r)+"d";if(o>=n)return Math.round(u/n)+"h";if(o>=t)return Math.round(u/t)+"m";if(o>=e)return Math.round(u/e)+"s";return u+"ms"}(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))}}function Rr(){if(_r)return br;return _r=1,br=function(e){function t(e){let r,u,o,i=null;function s(...e){if(!s.enabled)return;const n=s,u=Number(new Date),o=u-(r||u);n.diff=o,n.prev=r,n.curr=u,r=u,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,u)=>{if("%%"===r)return"%";i++;const o=t.formatters[u];if("function"==typeof o){const t=e[i];r=o.call(n,t),e.splice(i,1),i--}return r})),t.formatArgs.call(n,e);(n.log||t.log).apply(n,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=n,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==i?i:(u!==t.namespaces&&(u=t.namespaces,o=t.enabled(e)),o),set:e=>{i=e}}),"function"==typeof t.init&&t.init(s),s}function n(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function r(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(r),...t.skips.map(r).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),u=r.length;for(n=0;n{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t{const n=e.startsWith("-")?"":1===e.length?"-":"--",r=t.indexOf(n+e),u=t.indexOf("--");return-1!==r&&(-1===u||r{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=function(){if($r)return jr;$r=1;const e=E.default,t=A.default,n=Vr(),{env:r}=process;let u;function o(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function i(t,o){if(0===u)return 0;if(n("color=16m")||n("color=full")||n("color=truecolor"))return 3;if(n("color=256"))return 2;if(t&&!o&&void 0===u)return 0;const i=u||0;if("dumb"===r.TERM)return i;if("win32"===process.platform){const t=e.release().split(".");return Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in r)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((e=>e in r))||"codeship"===r.CI_NAME?1:i;if("TEAMCITY_VERSION"in r)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(r.TEAMCITY_VERSION)?1:0;if("truecolor"===r.COLORTERM)return 3;if("TERM_PROGRAM"in r){const e=parseInt((r.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(r.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(r.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(r.TERM)||"COLORTERM"in r?1:i}return n("no-color")||n("no-colors")||n("color=false")||n("color=never")?u=0:(n("color")||n("colors")||n("color=true")||n("color=always"))&&(u=1),"FORCE_COLOR"in r&&(u="true"===r.FORCE_COLOR?1:"false"===r.FORCE_COLOR?0:0===r.FORCE_COLOR.length?1:Math.min(parseInt(r.FORCE_COLOR,10),3)),jr={supportsColor:function(e){return o(i(e,e&&e.isTTY))},stdout:o(i(!0,t.isatty(1))),stderr:o(i(!0,t.isatty(2)))}}();e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,t)=>{const n=t.substring(6).toLowerCase().replace(/_([a-z])/g,((e,t)=>t.toUpperCase()));let r=process.env[t];return r=!!/^(yes|on|true|enabled)$/i.test(r)||!/^(no|off|false|disabled)$/i.test(r)&&("null"===r?null:Number(r)),e[n]=r,e}),{}),e.exports=Rr()(t);const{formatters:u}=e.exports;u.o=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")},u.O=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts)}}(Gr,Gr.exports)),Gr.exports}Jr=Nr,"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?Jr.exports=(Br||(Br=1,function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,u=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(u=r))})),t.splice(u,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=Rr()(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(Ir,Ir.exports)),Ir.exports):Jr.exports=Ur();var Wr=function(e){return(e=e||{}).circles?function(e){var t=[],n=[];return e.proto?function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=zr(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o}:function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u)if(!1!==Object.hasOwnProperty.call(u,i)){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=zr(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o};function r(e,r){for(var u=Object.keys(e),o=new Array(u.length),i=0;i!e,Qr=e=>e&&"object"==typeof e&&!Array.isArray(e),eu=(e,t,n)=>{(Array.isArray(t)?t:[t]).forEach((t=>{if(t)throw new Error(`Problem with log4js configuration: (${Kr.inspect(e,{depth:5})}) - ${n}`)}))};var tu={configure:e=>{qr("New configuration to be validated: ",e),eu(e,Zr(Qr(e)),"must be an object."),qr(`Calling pre-processing listeners (${Yr.length})`),Yr.forEach((t=>t(e))),qr("Configuration pre-processing finished."),qr(`Calling configuration listeners (${Xr.length})`),Xr.forEach((t=>t(e))),qr("Configuration finished.")},addListener:e=>{Xr.push(e),qr(`Added listener, now ${Xr.length} listeners`)},addPreProcessingListener:e=>{Yr.push(e),qr(`Added pre-processing listener, now ${Yr.length} listeners`)},throwExceptionIf:eu,anObject:Qr,anInteger:e=>e&&"number"==typeof e&&Number.isInteger(e),validIdentifier:e=>/^[A-Za-z][A-Za-z0-9_]*$/g.test(e),not:Zr},nu={exports:{}};!function(e){function t(e,t){for(var n=e.toString();n.length-1?s:c,l=n(u.getHours()),f=n(u.getMinutes()),d=n(u.getSeconds()),D=t(u.getMilliseconds(),3),p=function(e){var t=Math.abs(e),n=String(Math.floor(t/60)),r=String(t%60);return n=("0"+n).slice(-2),r=("0"+r).slice(-2),0===e?"Z":(e<0?"+":"-")+n+":"+r}(u.getTimezoneOffset());return r.replace(/dd/g,o).replace(/MM/g,i).replace(/y{1,4}/g,a).replace(/hh/g,l).replace(/mm/g,f).replace(/ss/g,d).replace(/SSS/g,D).replace(/O/g,p)}function u(e,t,n,r){e["set"+(r?"":"UTC")+t](n)}e.exports=r,e.exports.asString=r,e.exports.parse=function(t,n,r){if(!t)throw new Error("pattern must be supplied");return function(t,n,r){var o=t.indexOf("O")<0,i=!1,s=[{pattern:/y{1,4}/,regexp:"\\d{1,4}",fn:function(e,t){u(e,"FullYear",t,o)}},{pattern:/MM/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Month",t-1,o),e.getMonth()!==t-1&&(i=!0)}},{pattern:/dd/,regexp:"\\d{1,2}",fn:function(e,t){i&&u(e,"Month",e.getMonth()-1,o),u(e,"Date",t,o)}},{pattern:/hh/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Hours",t,o)}},{pattern:/mm/,regexp:"\\d\\d",fn:function(e,t){u(e,"Minutes",t,o)}},{pattern:/ss/,regexp:"\\d\\d",fn:function(e,t){u(e,"Seconds",t,o)}},{pattern:/SSS/,regexp:"\\d\\d\\d",fn:function(e,t){u(e,"Milliseconds",t,o)}},{pattern:/O/,regexp:"[+-]\\d{1,2}:?\\d{2}?|Z",fn:function(e,t){t="Z"===t?0:t.replace(":","");var n=Math.abs(t),r=(t>0?-1:1)*(n%100+60*Math.floor(n/100));e.setUTCMinutes(e.getUTCMinutes()+r)}}],c=s.reduce((function(e,t){return t.pattern.test(e.regexp)?(t.index=e.regexp.match(t.pattern).index,e.regexp=e.regexp.replace(t.pattern,"("+t.regexp+")")):t.index=-1,e}),{regexp:t,index:[]}),a=s.filter((function(e){return e.index>-1}));a.sort((function(e,t){return e.index-t.index}));var l=new RegExp(c.regexp).exec(n);if(l){var f=r||e.exports.now();return a.forEach((function(e,t){e.fn(f,l[t+1])})),f}throw new Error("String '"+n+"' could not be parsed as '"+t+"'")}(t,n,r)},e.exports.now=function(){return new Date},e.exports.ISO8601_FORMAT="yyyy-MM-ddThh:mm:ss.SSS",e.exports.ISO8601_WITH_TZ_OFFSET_FORMAT="yyyy-MM-ddThh:mm:ss.SSSO",e.exports.DATETIME_FORMAT="dd MM yyyy hh:mm:ss.SSS",e.exports.ABSOLUTETIME_FORMAT="hh:mm:ss.SSS"}(nu);const ru=nu.exports,uu=E.default,ou=F.default,iu=p.default,su={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[90,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[91,39],yellow:[33,39]};function cu(e){return e?`[${su[e][0]}m`:""}function au(e){return e?`[${su[e][1]}m`:""}function lu(e,t){return n=ou.format("[%s] [%s] %s - ",ru.asString(e.startTime),e.level.toString(),e.categoryName),cu(r=t)+n+au(r);var n,r}function fu(e){return lu(e)+ou.format(...e.data)}function du(e){return lu(e,e.level.colour)+ou.format(...e.data)}function Du(e){return ou.format(...e.data)}function pu(e){return e.data[0]}function Eu(e,t){const n=/%(-?[0-9]+)?(\.?-?[0-9]+)?([[\]cdhmnprzxXyflos%])(\{([^}]+)\})?|([^%]+)/;function r(e){return e&&e.pid?e.pid.toString():process.pid.toString()}e=e||"%r %p %c - %m%n";const u={c:function(e,t){let n=e.categoryName;if(t){const e=parseInt(t,10),r=n.split(".");ee&&(n=r.slice(-e).join(iu.sep))}return n},l:function(e){return e.lineNumber?`${e.lineNumber}`:""},o:function(e){return e.columnNumber?`${e.columnNumber}`:""},s:function(e){return e.callStack||""}};function o(e,t,n){return u[e](t,n)}function i(e,t,n){let r=e;return r=function(e,t){let n;return e?(n=parseInt(e.substr(1),10),n>0?t.slice(0,n):t.slice(n)):t}(t,r),r=function(e,t){let n;if(e)if("-"===e.charAt(0))for(n=parseInt(e.substr(1),10);t.lengthDu,basic:()=>fu,colored:()=>du,coloured:()=>du,pattern:e=>Eu(e&&e.pattern,e&&e.tokens),dummy:()=>pu};var hu={basicLayout:fu,messagePassThroughLayout:Du,patternLayout:Eu,colouredLayout:du,coloredLayout:du,dummyLayout:pu,addLayout(e,t){mu[e]=t},layout:(e,t)=>mu[e]&&mu[e](t)};const yu=tu,Cu=["white","grey","black","blue","cyan","green","magenta","red","yellow"];class Fu{constructor(e,t,n){this.level=e,this.levelStr=t,this.colour=n}toString(){return this.levelStr}static getLevel(e,t){return e?e instanceof Fu?e:(e instanceof Object&&e.levelStr&&(e=e.levelStr),Fu[e.toString().toUpperCase()]||t):t}static addLevels(e){if(e){Object.keys(e).forEach((t=>{const n=t.toUpperCase();Fu[n]=new Fu(e[t].value,n,e[t].colour);const r=Fu.levels.findIndex((e=>e.levelStr===n));r>-1?Fu.levels[r]=Fu[n]:Fu.levels.push(Fu[n])})),Fu.levels.sort(((e,t)=>e.level-t.level))}}isLessThanOrEqualTo(e){return"string"==typeof e&&(e=Fu.getLevel(e)),this.level<=e.level}isGreaterThanOrEqualTo(e){return"string"==typeof e&&(e=Fu.getLevel(e)),this.level>=e.level}isEqualTo(e){return"string"==typeof e&&(e=Fu.getLevel(e)),this.level===e.level}}Fu.levels=[],Fu.addLevels({ALL:{value:Number.MIN_VALUE,colour:"grey"},TRACE:{value:5e3,colour:"blue"},DEBUG:{value:1e4,colour:"cyan"},INFO:{value:2e4,colour:"green"},WARN:{value:3e4,colour:"yellow"},ERROR:{value:4e4,colour:"red"},FATAL:{value:5e4,colour:"magenta"},MARK:{value:9007199254740992,colour:"grey"},OFF:{value:Number.MAX_VALUE,colour:"grey"}}),yu.addListener((e=>{const t=e.levels;if(t){yu.throwExceptionIf(e,yu.not(yu.anObject(t)),"levels must be an object");Object.keys(t).forEach((n=>{yu.throwExceptionIf(e,yu.not(yu.validIdentifier(n)),`level name "${n}" is not a valid identifier (must start with a letter, only contain A-Z,a-z,0-9,_)`),yu.throwExceptionIf(e,yu.not(yu.anObject(t[n])),`level "${n}" must be an object`),yu.throwExceptionIf(e,yu.not(t[n].value),`level "${n}" must have a 'value' property`),yu.throwExceptionIf(e,yu.not(yu.anInteger(t[n].value)),`level "${n}".value must have an integer value`),yu.throwExceptionIf(e,yu.not(t[n].colour),`level "${n}" must have a 'colour' property`),yu.throwExceptionIf(e,yu.not(Cu.indexOf(t[n].colour)>-1),`level "${n}".colour must be one of ${Cu.join(", ")}`)}))}})),yu.addListener((e=>{Fu.addLevels(e.levels)}));var gu=Fu,Au={exports:{}},vu={};/*! (c) 2020 Andrea Giammarchi */ -const{parse:Su,stringify:wu}=JSON,{keys:Ou}=Object,bu=String,_u="string",Bu={},Pu="object",ku=(e,t)=>t,xu=e=>e instanceof bu?bu(e):e,Nu=(e,t)=>typeof t===_u?new bu(t):t,Iu=(e,t,n,r)=>{const u=[];for(let o=Ou(n),{length:i}=o,s=0;s{const r=bu(t.push(n)-1);return e.set(n,r),r},Ru=(e,t)=>{const n=Su(e,Nu).map(xu),r=n[0],u=t||ku,o=typeof r===Pu&&r?Iu(n,new Set,r,u):r;return u.call({"":o},"",o)};vu.parse=Ru;const Mu=(e,t,n)=>{const r=t&&typeof t===Pu?(e,n)=>""===e||-1Su(Mu(e));vu.fromJSON=e=>Ru(wu(e));const Lu=vu,ju=gu;class $u{constructor(e,t,n,r,u){this.startTime=new Date,this.categoryName=e,this.data=n,this.level=t,this.context=Object.assign({},r),this.pid=process.pid,u&&(this.functionName=u.functionName,this.fileName=u.fileName,this.lineNumber=u.lineNumber,this.columnNumber=u.columnNumber,this.callStack=u.callStack)}serialise(){const e=this.data.map((e=>(e&&e.message&&e.stack&&(e=Object.assign({message:e.message,stack:e.stack},e)),e)));return this.data=e,Lu.stringify(this)}static deserialise(e){let t;try{const n=Lu.parse(e);n.data=n.data.map((e=>{if(e&&e.message&&e.stack){const t=new Error(e);Object.keys(e).forEach((n=>{t[n]=e[n]})),e=t}return e})),t=new $u(n.categoryName,ju.getLevel(n.level.levelStr),n.data,n.context),t.startTime=new Date(n.startTime),t.pid=n.pid,t.cluster=n.cluster}catch(n){t=new $u("log4js",ju.ERROR,["Unable to parse log:",e,"because: ",n])}return t}}var Hu=$u;const Ju=Nr.exports("log4js:clustering"),Gu=Hu,Vu=tu;let Uu=!1,Wu=null;try{Wu=require("cluster")}catch(e){Ju("cluster module not present"),Uu=!0}const zu=[];let Ku=!1,qu="NODE_APP_INSTANCE";const Yu=()=>Ku&&"0"===process.env[qu],Xu=()=>Uu||Wu.isMaster||Yu(),Zu=e=>{zu.forEach((t=>t(e)))},Qu=(e,t)=>{if(Ju("cluster message received from worker ",e,": ",t),e.topic&&e.data&&(t=e,e=void 0),t&&t.topic&&"log4js:message"===t.topic){Ju("received message: ",t.data);const e=Gu.deserialise(t.data);Zu(e)}};Uu||Vu.addListener((e=>{zu.length=0,({pm2:Ku,disableClustering:Uu,pm2InstanceVar:qu="NODE_APP_INSTANCE"}=e),Ju(`clustering disabled ? ${Uu}`),Ju(`cluster.isMaster ? ${Wu&&Wu.isMaster}`),Ju(`pm2 enabled ? ${Ku}`),Ju(`pm2InstanceVar = ${qu}`),Ju(`process.env[${qu}] = ${process.env[qu]}`),Ku&&process.removeListener("message",Qu),Wu&&Wu.removeListener&&Wu.removeListener("message",Qu),Uu||e.disableClustering?Ju("Not listening for cluster messages, because clustering disabled."):Yu()?(Ju("listening for PM2 broadcast messages"),process.on("message",Qu)):Wu.isMaster?(Ju("listening for cluster messages"),Wu.on("message",Qu)):Ju("not listening for messages, because we are not a master process")}));var eo={onlyOnMaster:(e,t)=>Xu()?e():t,isMaster:Xu,send:e=>{Xu()?Zu(e):(Ku||(e.cluster={workerId:Wu.worker.id,worker:process.pid}),process.send({topic:"log4js:message",data:e.serialise()}))},onMessage:e=>{zu.push(e)}},to={};function no(e){if("number"==typeof e&&Number.isInteger(e))return e;const t={K:1024,M:1048576,G:1073741824},n=Object.keys(t),r=e.substr(e.length-1).toLocaleUpperCase(),u=e.substring(0,e.length-1).trim();if(n.indexOf(r)<0||!Number.isInteger(Number(u)))throw Error(`maxLogSize: "${e}" is invalid`);return u*t[r]}function ro(e){return function(e,t){const n=Object.assign({},t);return Object.keys(e).forEach((r=>{n[r]&&(n[r]=e[r](t[r]))})),n}({maxLogSize:no},e)}const uo={file:ro,fileSync:ro};to.modifyConfig=e=>uo[e.type]?uo[e.type](e):e;var oo={};const io=console.log.bind(console);oo.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{io(e(n,t))}}(n,e.timezoneOffset)};var so={};so.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stdout.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var co={};co.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stderr.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var ao={};ao.configure=function(e,t,n,r){const u=n(e.appender);return function(e,t,n,r){const u=r.getLevel(e),o=r.getLevel(t,r.FATAL);return e=>{const t=e.level;t.isGreaterThanOrEqualTo(u)&&t.isLessThanOrEqualTo(o)&&n(e)}}(e.level,e.maxLevel,u,r)};var lo={};const fo=Nr.exports("log4js:categoryFilter");lo.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return"string"==typeof e&&(e=[e]),n=>{fo(`Checking ${n.categoryName} against ${e}`),-1===e.indexOf(n.categoryName)&&(fo("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var Do={};const po=Nr.exports("log4js:noLogFilter");Do.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return n=>{po(`Checking data: ${n.data} against filters: ${e}`),"string"==typeof e&&(e=[e]),e=e.filter((e=>null!=e&&""!==e));const r=new RegExp(e.join("|"),"i");(0===e.length||n.data.findIndex((e=>r.test(e)))<0)&&(po("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var Eo={},mo={exports:{}},ho={},yo={fromCallback:function(e){return Object.defineProperty((function(){if("function"!=typeof arguments[arguments.length-1])return new Promise(((t,n)=>{arguments[arguments.length]=(e,r)=>{if(e)return n(e);t(r)},arguments.length++,e.apply(this,arguments)}));e.apply(this,arguments)}),"name",{value:e.name})},fromPromise:function(e){return Object.defineProperty((function(){const t=arguments[arguments.length-1];if("function"!=typeof t)return e.apply(this,arguments);e.apply(this,arguments).then((e=>t(null,e)),t)}),"name",{value:e.name})}};!function(e){const t=yo.fromCallback,n=we,r=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchown","lchmod","link","lstat","mkdir","mkdtemp","open","readFile","readdir","readlink","realpath","rename","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((e=>"function"==typeof n[e]));Object.keys(n).forEach((t=>{"promises"!==t&&(e[t]=n[t])})),r.forEach((r=>{e[r]=t(n[r])})),e.exists=function(e,t){return"function"==typeof t?n.exists(e,t):new Promise((t=>n.exists(e,t)))},e.read=function(e,t,r,u,o,i){return"function"==typeof i?n.read(e,t,r,u,o,i):new Promise(((i,s)=>{n.read(e,t,r,u,o,((e,t,n)=>{if(e)return s(e);i({bytesRead:t,buffer:n})}))}))},e.write=function(e,t,...r){return"function"==typeof r[r.length-1]?n.write(e,t,...r):new Promise(((u,o)=>{n.write(e,t,...r,((e,t,n)=>{if(e)return o(e);u({bytesWritten:t,buffer:n})}))}))},"function"==typeof n.realpath.native&&(e.realpath.native=t(n.realpath.native))}(ho);const Co=p.default;function Fo(e){return(e=Co.normalize(Co.resolve(e)).split(Co.sep)).length>0?e[0]:null}const go=/[<>:"|?*]/;var Ao=function(e){const t=Fo(e);return e=e.replace(t,""),go.test(e)};const vo=we,So=p.default,wo=Ao,Oo=parseInt("0777",8);var bo=function e(t,n,r,u){if("function"==typeof n?(r=n,n={}):n&&"object"==typeof n||(n={mode:n}),"win32"===process.platform&&wo(t)){const e=new Error(t+" contains invalid WIN32 path characters.");return e.code="EINVAL",r(e)}let o=n.mode;const i=n.fs||vo;void 0===o&&(o=Oo&~process.umask()),u||(u=null),r=r||function(){},t=So.resolve(t),i.mkdir(t,o,(o=>{if(!o)return r(null,u=u||t);if("ENOENT"===o.code){if(So.dirname(t)===t)return r(o);e(So.dirname(t),n,((u,o)=>{u?r(u,o):e(t,n,r,o)}))}else i.stat(t,((e,t)=>{e||!t.isDirectory()?r(o,u):r(null,u)}))}))};const _o=we,Bo=p.default,Po=Ao,ko=parseInt("0777",8);var xo=function e(t,n,r){n&&"object"==typeof n||(n={mode:n});let u=n.mode;const o=n.fs||_o;if("win32"===process.platform&&Po(t)){const e=new Error(t+" contains invalid WIN32 path characters.");throw e.code="EINVAL",e}void 0===u&&(u=ko&~process.umask()),r||(r=null),t=Bo.resolve(t);try{o.mkdirSync(t,u),r=r||t}catch(u){if("ENOENT"===u.code){if(Bo.dirname(t)===t)throw u;r=e(Bo.dirname(t),n,r),e(t,n,r)}else{let e;try{e=o.statSync(t)}catch(e){throw u}if(!e.isDirectory())throw u}}return r};const No=(0,yo.fromCallback)(bo);var Io={mkdirs:No,mkdirsSync:xo,mkdirp:No,mkdirpSync:xo,ensureDir:No,ensureDirSync:xo};const To=we;E.default,p.default;var Ro=function(e,t,n,r){To.open(e,"r+",((e,u)=>{if(e)return r(e);To.futimes(u,t,n,(e=>{To.close(u,(t=>{r&&r(e||t)}))}))}))},Mo=function(e,t,n){const r=To.openSync(e,"r+");return To.futimesSync(r,t,n),To.closeSync(r)};const Lo=we,jo=p.default,$o=10,Ho=5,Jo=0,Go=process.versions.node.split("."),Vo=Number.parseInt(Go[0],10),Uo=Number.parseInt(Go[1],10),Wo=Number.parseInt(Go[2],10);function zo(){if(Vo>$o)return!0;if(Vo===$o){if(Uo>Ho)return!0;if(Uo===Ho&&Wo>=Jo)return!0}return!1}function Ko(e,t){const n=jo.resolve(e).split(jo.sep).filter((e=>e)),r=jo.resolve(t).split(jo.sep).filter((e=>e));return n.reduce(((e,t,n)=>e&&r[n]===t),!0)}function qo(e,t,n){return`Cannot ${n} '${e}' to a subdirectory of itself, '${t}'.`}var Yo,Xo,Zo={checkPaths:function(e,t,n,r){!function(e,t,n){zo()?Lo.stat(e,{bigint:!0},((e,r)=>{if(e)return n(e);Lo.stat(t,{bigint:!0},((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))})):Lo.stat(e,((e,r)=>{if(e)return n(e);Lo.stat(t,((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))}))}(e,t,((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;return s&&s.ino&&s.dev&&s.ino===i.ino&&s.dev===i.dev?r(new Error("Source and destination must not be the same.")):i.isDirectory()&&Ko(e,t)?r(new Error(qo(e,t,n))):r(null,{srcStat:i,destStat:s})}))},checkPathsSync:function(e,t,n){const{srcStat:r,destStat:u}=function(e,t){let n,r;n=zo()?Lo.statSync(e,{bigint:!0}):Lo.statSync(e);try{r=zo()?Lo.statSync(t,{bigint:!0}):Lo.statSync(t)}catch(e){if("ENOENT"===e.code)return{srcStat:n,destStat:null};throw e}return{srcStat:n,destStat:r}}(e,t);if(u&&u.ino&&u.dev&&u.ino===r.ino&&u.dev===r.dev)throw new Error("Source and destination must not be the same.");if(r.isDirectory()&&Ko(e,t))throw new Error(qo(e,t,n));return{srcStat:r,destStat:u}},checkParentPaths:function e(t,n,r,u,o){const i=jo.resolve(jo.dirname(t)),s=jo.resolve(jo.dirname(r));if(s===i||s===jo.parse(s).root)return o();zo()?Lo.stat(s,{bigint:!0},((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(qo(t,r,u))):e(t,n,s,u,o))):Lo.stat(s,((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(qo(t,r,u))):e(t,n,s,u,o)))},checkParentPathsSync:function e(t,n,r,u){const o=jo.resolve(jo.dirname(t)),i=jo.resolve(jo.dirname(r));if(i===o||i===jo.parse(i).root)return;let s;try{s=zo()?Lo.statSync(i,{bigint:!0}):Lo.statSync(i)}catch(e){if("ENOENT"===e.code)return;throw e}if(s.ino&&s.dev&&s.ino===n.ino&&s.dev===n.dev)throw new Error(qo(t,r,u));return e(t,n,i,u)},isSrcSubdir:Ko};const Qo=we,ei=p.default,ti=Io.mkdirsSync,ni=Mo,ri=Zo;function ui(e,t,n,r){if(!r.filter||r.filter(t,n))return function(e,t,n,r){const u=r.dereference?Qo.statSync:Qo.lstatSync,o=u(t);if(o.isDirectory())return function(e,t,n,r,u){if(!t)return function(e,t,n,r){return Qo.mkdirSync(n),ii(t,n,r),Qo.chmodSync(n,e.mode)}(e,n,r,u);if(t&&!t.isDirectory())throw new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`);return ii(n,r,u)}(o,e,t,n,r);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return function(e,t,n,r,u){return t?function(e,t,n,r){if(r.overwrite)return Qo.unlinkSync(n),oi(e,t,n,r);if(r.errorOnExist)throw new Error(`'${n}' already exists`)}(e,n,r,u):oi(e,n,r,u)}(o,e,t,n,r);if(o.isSymbolicLink())return function(e,t,n,r){let u=Qo.readlinkSync(t);r.dereference&&(u=ei.resolve(process.cwd(),u));if(e){let e;try{e=Qo.readlinkSync(n)}catch(e){if("EINVAL"===e.code||"UNKNOWN"===e.code)return Qo.symlinkSync(u,n);throw e}if(r.dereference&&(e=ei.resolve(process.cwd(),e)),ri.isSrcSubdir(u,e))throw new Error(`Cannot copy '${u}' to a subdirectory of itself, '${e}'.`);if(Qo.statSync(n).isDirectory()&&ri.isSrcSubdir(e,u))throw new Error(`Cannot overwrite '${e}' with '${u}'.`);return function(e,t){return Qo.unlinkSync(t),Qo.symlinkSync(e,t)}(u,n)}return Qo.symlinkSync(u,n)}(e,t,n,r)}(e,t,n,r)}function oi(e,t,n,r){return"function"==typeof Qo.copyFileSync?(Qo.copyFileSync(t,n),Qo.chmodSync(n,e.mode),r.preserveTimestamps?ni(n,e.atime,e.mtime):void 0):function(e,t,n,r){const u=65536,o=(Xo?Yo:(Xo=1,Yo=function(e){if("function"==typeof Buffer.allocUnsafe)try{return Buffer.allocUnsafe(e)}catch(t){return new Buffer(e)}return new Buffer(e)}))(u),i=Qo.openSync(t,"r"),s=Qo.openSync(n,"w",e.mode);let c=0;for(;cfunction(e,t,n,r){const u=ei.join(t,e),o=ei.join(n,e),{destStat:i}=ri.checkPathsSync(u,o,"copy");return ui(i,u,o,r)}(r,e,t,n)))}var si=function(e,t,n){"function"==typeof n&&(n={filter:n}),(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269");const{srcStat:r,destStat:u}=ri.checkPathsSync(e,t,"copy");return ri.checkParentPathsSync(e,r,t,"copy"),function(e,t,n,r){if(r.filter&&!r.filter(t,n))return;const u=ei.dirname(n);Qo.existsSync(u)||ti(u);return ui(e,t,n,r)}(u,e,t,n)},ci={copySync:si};const ai=yo.fromPromise,li=ho;var fi={pathExists:ai((function(e){return li.access(e).then((()=>!0)).catch((()=>!1))})),pathExistsSync:li.existsSync};const di=we,Di=p.default,pi=Io.mkdirs,Ei=fi.pathExists,mi=Ro,hi=Zo;function yi(e,t,n,r,u){const o=Di.dirname(n);Ei(o,((i,s)=>i?u(i):s?Fi(e,t,n,r,u):void pi(o,(o=>o?u(o):Fi(e,t,n,r,u)))))}function Ci(e,t,n,r,u,o){Promise.resolve(u.filter(n,r)).then((i=>i?e(t,n,r,u,o):o()),(e=>o(e)))}function Fi(e,t,n,r,u){return r.filter?Ci(gi,e,t,n,r,u):gi(e,t,n,r,u)}function gi(e,t,n,r,u){(r.dereference?di.stat:di.lstat)(t,((o,i)=>o?u(o):i.isDirectory()?function(e,t,n,r,u,o){if(!t)return function(e,t,n,r,u){di.mkdir(n,(o=>{if(o)return u(o);Si(t,n,r,(t=>t?u(t):di.chmod(n,e.mode,u)))}))}(e,n,r,u,o);if(t&&!t.isDirectory())return o(new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`));return Si(n,r,u,o)}(i,e,t,n,r,u):i.isFile()||i.isCharacterDevice()||i.isBlockDevice()?function(e,t,n,r,u,o){return t?function(e,t,n,r,u){if(!r.overwrite)return r.errorOnExist?u(new Error(`'${n}' already exists`)):u();di.unlink(n,(o=>o?u(o):Ai(e,t,n,r,u)))}(e,n,r,u,o):Ai(e,n,r,u,o)}(i,e,t,n,r,u):i.isSymbolicLink()?function(e,t,n,r,u){di.readlink(t,((t,o)=>t?u(t):(r.dereference&&(o=Di.resolve(process.cwd(),o)),e?void di.readlink(n,((t,i)=>t?"EINVAL"===t.code||"UNKNOWN"===t.code?di.symlink(o,n,u):u(t):(r.dereference&&(i=Di.resolve(process.cwd(),i)),hi.isSrcSubdir(o,i)?u(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${i}'.`)):e.isDirectory()&&hi.isSrcSubdir(i,o)?u(new Error(`Cannot overwrite '${i}' with '${o}'.`)):function(e,t,n){di.unlink(t,(r=>r?n(r):di.symlink(e,t,n)))}(o,n,u)))):di.symlink(o,n,u))))}(e,t,n,r,u):void 0))}function Ai(e,t,n,r,u){return"function"==typeof di.copyFile?di.copyFile(t,n,(t=>t?u(t):vi(e,n,r,u))):function(e,t,n,r,u){const o=di.createReadStream(t);o.on("error",(e=>u(e))).once("open",(()=>{const t=di.createWriteStream(n,{mode:e.mode});t.on("error",(e=>u(e))).on("open",(()=>o.pipe(t))).once("close",(()=>vi(e,n,r,u)))}))}(e,t,n,r,u)}function vi(e,t,n,r){di.chmod(t,e.mode,(u=>u?r(u):n.preserveTimestamps?mi(t,e.atime,e.mtime,r):r()))}function Si(e,t,n,r){di.readdir(e,((u,o)=>u?r(u):wi(o,e,t,n,r)))}function wi(e,t,n,r,u){const o=e.pop();return o?function(e,t,n,r,u,o){const i=Di.join(n,t),s=Di.join(r,t);hi.checkPaths(i,s,"copy",((t,c)=>{if(t)return o(t);const{destStat:a}=c;Fi(a,i,s,u,(t=>t?o(t):wi(e,n,r,u,o)))}))}(e,o,t,n,r,u):u()}var Oi=function(e,t,n,r){"function"!=typeof n||r?"function"==typeof n&&(n={filter:n}):(r=n,n={}),r=r||function(){},(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269"),hi.checkPaths(e,t,"copy",((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;hi.checkParentPaths(e,i,t,"copy",(u=>u?r(u):n.filter?Ci(yi,s,e,t,n,r):yi(s,e,t,n,r)))}))};var bi={copy:(0,yo.fromCallback)(Oi)};const _i=we,Bi=p.default,Pi=g.default,ki="win32"===process.platform;function xi(e){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((t=>{e[t]=e[t]||_i[t],e[t+="Sync"]=e[t]||_i[t]})),e.maxBusyTries=e.maxBusyTries||3}function Ni(e,t,n){let r=0;"function"==typeof t&&(n=t,t={}),Pi(e,"rimraf: missing path"),Pi.strictEqual(typeof e,"string","rimraf: path should be a string"),Pi.strictEqual(typeof n,"function","rimraf: callback function required"),Pi(t,"rimraf: invalid options argument provided"),Pi.strictEqual(typeof t,"object","rimraf: options should be object"),xi(t),Ii(e,t,(function u(o){if(o){if(("EBUSY"===o.code||"ENOTEMPTY"===o.code||"EPERM"===o.code)&&rIi(e,t,u)),100*r)}"ENOENT"===o.code&&(o=null)}n(o)}))}function Ii(e,t,n){Pi(e),Pi(t),Pi("function"==typeof n),t.lstat(e,((r,u)=>r&&"ENOENT"===r.code?n(null):r&&"EPERM"===r.code&&ki?Ti(e,t,r,n):u&&u.isDirectory()?Mi(e,t,r,n):void t.unlink(e,(r=>{if(r){if("ENOENT"===r.code)return n(null);if("EPERM"===r.code)return ki?Ti(e,t,r,n):Mi(e,t,r,n);if("EISDIR"===r.code)return Mi(e,t,r,n)}return n(r)}))))}function Ti(e,t,n,r){Pi(e),Pi(t),Pi("function"==typeof r),n&&Pi(n instanceof Error),t.chmod(e,438,(u=>{u?r("ENOENT"===u.code?null:n):t.stat(e,((u,o)=>{u?r("ENOENT"===u.code?null:n):o.isDirectory()?Mi(e,t,n,r):t.unlink(e,r)}))}))}function Ri(e,t,n){let r;Pi(e),Pi(t),n&&Pi(n instanceof Error);try{t.chmodSync(e,438)}catch(e){if("ENOENT"===e.code)return;throw n}try{r=t.statSync(e)}catch(e){if("ENOENT"===e.code)return;throw n}r.isDirectory()?ji(e,t,n):t.unlinkSync(e)}function Mi(e,t,n,r){Pi(e),Pi(t),n&&Pi(n instanceof Error),Pi("function"==typeof r),t.rmdir(e,(u=>{!u||"ENOTEMPTY"!==u.code&&"EEXIST"!==u.code&&"EPERM"!==u.code?u&&"ENOTDIR"===u.code?r(n):r(u):function(e,t,n){Pi(e),Pi(t),Pi("function"==typeof n),t.readdir(e,((r,u)=>{if(r)return n(r);let o,i=u.length;if(0===i)return t.rmdir(e,n);u.forEach((r=>{Ni(Bi.join(e,r),t,(r=>{if(!o)return r?n(o=r):void(0==--i&&t.rmdir(e,n))}))}))}))}(e,t,r)}))}function Li(e,t){let n;xi(t=t||{}),Pi(e,"rimraf: missing path"),Pi.strictEqual(typeof e,"string","rimraf: path should be a string"),Pi(t,"rimraf: missing options"),Pi.strictEqual(typeof t,"object","rimraf: options should be object");try{n=t.lstatSync(e)}catch(n){if("ENOENT"===n.code)return;"EPERM"===n.code&&ki&&Ri(e,t,n)}try{n&&n.isDirectory()?ji(e,t,null):t.unlinkSync(e)}catch(n){if("ENOENT"===n.code)return;if("EPERM"===n.code)return ki?Ri(e,t,n):ji(e,t,n);if("EISDIR"!==n.code)throw n;ji(e,t,n)}}function ji(e,t,n){Pi(e),Pi(t),n&&Pi(n instanceof Error);try{t.rmdirSync(e)}catch(r){if("ENOTDIR"===r.code)throw n;if("ENOTEMPTY"===r.code||"EEXIST"===r.code||"EPERM"===r.code)!function(e,t){if(Pi(e),Pi(t),t.readdirSync(e).forEach((n=>Li(Bi.join(e,n),t))),!ki){return t.rmdirSync(e,t)}{const n=Date.now();do{try{return t.rmdirSync(e,t)}catch(e){}}while(Date.now()-n<500)}}(e,t);else if("ENOENT"!==r.code)throw r}}var $i=Ni;Ni.sync=Li;const Hi=$i;var Ji={remove:(0,yo.fromCallback)(Hi),removeSync:Hi.sync};const Gi=yo.fromCallback,Vi=we,Ui=p.default,Wi=Io,zi=Ji,Ki=Gi((function(e,t){t=t||function(){},Vi.readdir(e,((n,r)=>{if(n)return Wi.mkdirs(e,t);r=r.map((t=>Ui.join(e,t))),function e(){const n=r.pop();if(!n)return t();zi.remove(n,(n=>{if(n)return t(n);e()}))}()}))}));function qi(e){let t;try{t=Vi.readdirSync(e)}catch(t){return Wi.mkdirsSync(e)}t.forEach((t=>{t=Ui.join(e,t),zi.removeSync(t)}))}var Yi={emptyDirSync:qi,emptydirSync:qi,emptyDir:Ki,emptydir:Ki};const Xi=yo.fromCallback,Zi=p.default,Qi=we,es=Io,ts=fi.pathExists;var ns={createFile:Xi((function(e,t){function n(){Qi.writeFile(e,"",(e=>{if(e)return t(e);t()}))}Qi.stat(e,((r,u)=>{if(!r&&u.isFile())return t();const o=Zi.dirname(e);ts(o,((e,r)=>e?t(e):r?n():void es.mkdirs(o,(e=>{if(e)return t(e);n()}))))}))})),createFileSync:function(e){let t;try{t=Qi.statSync(e)}catch(e){}if(t&&t.isFile())return;const n=Zi.dirname(e);Qi.existsSync(n)||es.mkdirsSync(n),Qi.writeFileSync(e,"")}};const rs=yo.fromCallback,us=p.default,os=we,is=Io,ss=fi.pathExists;var cs={createLink:rs((function(e,t,n){function r(e,t){os.link(e,t,(e=>{if(e)return n(e);n(null)}))}ss(t,((u,o)=>u?n(u):o?n(null):void os.lstat(e,(u=>{if(u)return u.message=u.message.replace("lstat","ensureLink"),n(u);const o=us.dirname(t);ss(o,((u,i)=>u?n(u):i?r(e,t):void is.mkdirs(o,(u=>{if(u)return n(u);r(e,t)}))))}))))})),createLinkSync:function(e,t){if(os.existsSync(t))return;try{os.lstatSync(e)}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}const n=us.dirname(t);return os.existsSync(n)||is.mkdirsSync(n),os.linkSync(e,t)}};const as=p.default,ls=we,fs=fi.pathExists;var ds={symlinkPaths:function(e,t,n){if(as.isAbsolute(e))return ls.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:e})));{const r=as.dirname(t),u=as.join(r,e);return fs(u,((t,o)=>t?n(t):o?n(null,{toCwd:u,toDst:e}):ls.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:as.relative(r,e)})))))}},symlinkPathsSync:function(e,t){let n;if(as.isAbsolute(e)){if(n=ls.existsSync(e),!n)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}{const r=as.dirname(t),u=as.join(r,e);if(n=ls.existsSync(u),n)return{toCwd:u,toDst:e};if(n=ls.existsSync(e),!n)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:as.relative(r,e)}}}};const Ds=we;var ps={symlinkType:function(e,t,n){if(n="function"==typeof t?t:n,t="function"!=typeof t&&t)return n(null,t);Ds.lstat(e,((e,r)=>{if(e)return n(null,"file");t=r&&r.isDirectory()?"dir":"file",n(null,t)}))},symlinkTypeSync:function(e,t){let n;if(t)return t;try{n=Ds.lstatSync(e)}catch(e){return"file"}return n&&n.isDirectory()?"dir":"file"}};const Es=yo.fromCallback,ms=p.default,hs=we,ys=Io.mkdirs,Cs=Io.mkdirsSync,Fs=ds.symlinkPaths,gs=ds.symlinkPathsSync,As=ps.symlinkType,vs=ps.symlinkTypeSync,Ss=fi.pathExists;var ws={createSymlink:Es((function(e,t,n,r){r="function"==typeof n?n:r,n="function"!=typeof n&&n,Ss(t,((u,o)=>u?r(u):o?r(null):void Fs(e,t,((u,o)=>{if(u)return r(u);e=o.toDst,As(o.toCwd,n,((n,u)=>{if(n)return r(n);const o=ms.dirname(t);Ss(o,((n,i)=>n?r(n):i?hs.symlink(e,t,u,r):void ys(o,(n=>{if(n)return r(n);hs.symlink(e,t,u,r)}))))}))}))))})),createSymlinkSync:function(e,t,n){if(hs.existsSync(t))return;const r=gs(e,t);e=r.toDst,n=vs(r.toCwd,n);const u=ms.dirname(t);return hs.existsSync(u)||Cs(u),hs.symlinkSync(e,t,n)}};var Os,bs={createFile:ns.createFile,createFileSync:ns.createFileSync,ensureFile:ns.createFile,ensureFileSync:ns.createFileSync,createLink:cs.createLink,createLinkSync:cs.createLinkSync,ensureLink:cs.createLink,ensureLinkSync:cs.createLinkSync,createSymlink:ws.createSymlink,createSymlinkSync:ws.createSymlinkSync,ensureSymlink:ws.createSymlink,ensureSymlinkSync:ws.createSymlinkSync};try{Os=we}catch(e){Os=D.default}function _s(e,t){var n,r="\n";return"object"==typeof t&&null!==t&&(t.spaces&&(n=t.spaces),t.EOL&&(r=t.EOL)),JSON.stringify(e,t?t.replacer:null,n).replace(/\n/g,r)+r}function Bs(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e=e.replace(/^\uFEFF/,"")}var Ps={readFile:function(e,t,n){null==n&&(n=t,t={}),"string"==typeof t&&(t={encoding:t});var r=(t=t||{}).fs||Os,u=!0;"throws"in t&&(u=t.throws),r.readFile(e,t,(function(r,o){if(r)return n(r);var i;o=Bs(o);try{i=JSON.parse(o,t?t.reviver:null)}catch(t){return u?(t.message=e+": "+t.message,n(t)):n(null,null)}n(null,i)}))},readFileSync:function(e,t){"string"==typeof(t=t||{})&&(t={encoding:t});var n=t.fs||Os,r=!0;"throws"in t&&(r=t.throws);try{var u=n.readFileSync(e,t);return u=Bs(u),JSON.parse(u,t.reviver)}catch(t){if(r)throw t.message=e+": "+t.message,t;return null}},writeFile:function(e,t,n,r){null==r&&(r=n,n={});var u=(n=n||{}).fs||Os,o="";try{o=_s(t,n)}catch(e){return void(r&&r(e,null))}u.writeFile(e,o,n,r)},writeFileSync:function(e,t,n){var r=(n=n||{}).fs||Os,u=_s(t,n);return r.writeFileSync(e,u,n)}},ks=Ps;const xs=yo.fromCallback,Ns=ks;var Is={readJson:xs(Ns.readFile),readJsonSync:Ns.readFileSync,writeJson:xs(Ns.writeFile),writeJsonSync:Ns.writeFileSync};const Ts=p.default,Rs=Io,Ms=fi.pathExists,Ls=Is;var js=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=Ts.dirname(e);Ms(u,((o,i)=>o?r(o):i?Ls.writeJson(e,t,n,r):void Rs.mkdirs(u,(u=>{if(u)return r(u);Ls.writeJson(e,t,n,r)}))))};const $s=we,Hs=p.default,Js=Io,Gs=Is;var Vs=function(e,t,n){const r=Hs.dirname(e);$s.existsSync(r)||Js.mkdirsSync(r),Gs.writeJsonSync(e,t,n)};const Us=yo.fromCallback,Ws=Is;Ws.outputJson=Us(js),Ws.outputJsonSync=Vs,Ws.outputJSON=Ws.outputJson,Ws.outputJSONSync=Ws.outputJsonSync,Ws.writeJSON=Ws.writeJson,Ws.writeJSONSync=Ws.writeJsonSync,Ws.readJSON=Ws.readJson,Ws.readJSONSync=Ws.readJsonSync;var zs=Ws;const Ks=we,qs=p.default,Ys=ci.copySync,Xs=Ji.removeSync,Zs=Io.mkdirpSync,Qs=Zo;function ec(e,t,n){try{Ks.renameSync(e,t)}catch(r){if("EXDEV"!==r.code)throw r;return function(e,t,n){const r={overwrite:n,errorOnExist:!0};return Ys(e,t,r),Xs(e)}(e,t,n)}}var tc=function(e,t,n){const r=(n=n||{}).overwrite||n.clobber||!1,{srcStat:u}=Qs.checkPathsSync(e,t,"move");return Qs.checkParentPathsSync(e,u,t,"move"),Zs(qs.dirname(t)),function(e,t,n){if(n)return Xs(t),ec(e,t,n);if(Ks.existsSync(t))throw new Error("dest already exists.");return ec(e,t,n)}(e,t,r)},nc={moveSync:tc};const rc=we,uc=p.default,oc=bi.copy,ic=Ji.remove,sc=Io.mkdirp,cc=fi.pathExists,ac=Zo;function lc(e,t,n,r){rc.rename(e,t,(u=>u?"EXDEV"!==u.code?r(u):function(e,t,n,r){const u={overwrite:n,errorOnExist:!0};oc(e,t,u,(t=>t?r(t):ic(e,r)))}(e,t,n,r):r()))}var fc=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=n.overwrite||n.clobber||!1;ac.checkPaths(e,t,"move",((n,o)=>{if(n)return r(n);const{srcStat:i}=o;ac.checkParentPaths(e,i,t,"move",(n=>{if(n)return r(n);sc(uc.dirname(t),(n=>n?r(n):function(e,t,n,r){if(n)return ic(t,(u=>u?r(u):lc(e,t,n,r)));cc(t,((u,o)=>u?r(u):o?r(new Error("dest already exists.")):lc(e,t,n,r)))}(e,t,u,r)))}))}))};var dc={move:(0,yo.fromCallback)(fc)};const Dc=yo.fromCallback,pc=we,Ec=p.default,mc=Io,hc=fi.pathExists;var yc={outputFile:Dc((function(e,t,n,r){"function"==typeof n&&(r=n,n="utf8");const u=Ec.dirname(e);hc(u,((o,i)=>o?r(o):i?pc.writeFile(e,t,n,r):void mc.mkdirs(u,(u=>{if(u)return r(u);pc.writeFile(e,t,n,r)}))))})),outputFileSync:function(e,...t){const n=Ec.dirname(e);if(pc.existsSync(n))return pc.writeFileSync(e,...t);mc.mkdirsSync(n),pc.writeFileSync(e,...t)}};!function(e){e.exports=Object.assign({},ho,ci,bi,Yi,bs,zs,Io,nc,dc,yc,fi,Ji);const t=D.default;Object.getOwnPropertyDescriptor(t,"promises")&&Object.defineProperty(e.exports,"promises",{get:()=>t.promises})}(mo);const Cc=Nr.exports("streamroller:fileNameFormatter"),Fc=p.default;const gc=Nr.exports("streamroller:fileNameParser"),Ac=nu.exports;const vc=Nr.exports("streamroller:moveAndMaybeCompressFile"),Sc=mo.exports,wc=v.default;var Oc=async(e,t,n)=>{if(n=function(e){const t={mode:parseInt("0600",8),compress:!1},n=Object.assign({},t,e);return vc(`_parseOption: moveAndMaybeCompressFile called with option=${JSON.stringify(n)}`),n}(n),e!==t){if(await Sc.pathExists(e))if(vc(`moveAndMaybeCompressFile: moving file from ${e} to ${t} ${n.compress?"with":"without"} compress`),n.compress)await new Promise(((r,u)=>{let o=!1;const i=Sc.createWriteStream(t,{mode:n.mode,flags:"wx"}).on("open",(()=>{o=!0;const t=Sc.createReadStream(e).on("open",(()=>{t.pipe(wc.createGzip()).pipe(i)})).on("error",(t=>{vc(`moveAndMaybeCompressFile: error reading ${e}`,t),i.destroy(t)}))})).on("finish",(()=>{vc(`moveAndMaybeCompressFile: finished compressing ${t}, deleting ${e}`),Sc.unlink(e).then(r).catch((t=>{vc(`moveAndMaybeCompressFile: error deleting ${e}, truncating instead`,t),Sc.truncate(e).then(r).catch((t=>{vc(`moveAndMaybeCompressFile: error truncating ${e}`,t),u(t)}))}))})).on("error",(e=>{o?(vc(`moveAndMaybeCompressFile: error writing ${t}, deleting`,e),Sc.unlink(t).then((()=>{u(e)})).catch((e=>{vc(`moveAndMaybeCompressFile: error deleting ${t}`,e),u(e)}))):(vc(`moveAndMaybeCompressFile: error creating ${t}`,e),u(e))}))})).catch((()=>{}));else{vc(`moveAndMaybeCompressFile: renaming ${e} to ${t}`);try{await Sc.move(e,t,{overwrite:!0})}catch(n){if(vc(`moveAndMaybeCompressFile: error renaming ${e} to ${t}`,n),"ENOENT"!==n.code){vc("moveAndMaybeCompressFile: trying copy+truncate instead");try{await Sc.copy(e,t,{overwrite:!0}),await Sc.truncate(e)}catch(e){vc("moveAndMaybeCompressFile: error copy+truncate",e)}}}}}else vc("moveAndMaybeCompressFile: source and target are the same, not doing anything")};const bc=Nr.exports("streamroller:RollingFileWriteStream"),_c=mo.exports,Bc=p.default,Pc=E.default,kc=()=>new Date,xc=nu.exports,{Writable:Nc}=C.default,Ic=({file:e,keepFileExt:t,needsIndex:n,alwaysIncludeDate:r,compress:u,fileNameSep:o})=>{let i=o||".";const s=Fc.join(e.dir,e.name),c=t=>t+e.ext,a=(e,t,r)=>!n&&r||!t?e:e+i+t,l=(e,t,n)=>(t>0||r)&&n?e+i+n:e,f=(e,t)=>t&&u?e+".gz":e,d=t?[l,a,c,f]:[c,l,a,f];return({date:e,index:t})=>(Cc(`_formatFileName: date=${e}, index=${t}`),d.reduce(((n,r)=>r(n,t,e)),s))},Tc=({file:e,keepFileExt:t,pattern:n,fileNameSep:r})=>{let u=r||".";const o="__NOT_MATCHING__";let i=[(e,t)=>e.endsWith(".gz")?(gc("it is gzipped"),t.isCompressed=!0,e.slice(0,-1*".gz".length)):e,t?t=>t.startsWith(e.name)&&t.endsWith(e.ext)?(gc("it starts and ends with the right things"),t.slice(e.name.length+1,-1*e.ext.length)):o:t=>t.startsWith(e.base)?(gc("it starts with the right things"),t.slice(e.base.length+1)):o,n?(e,t)=>{const r=e.split(u);let o=r[r.length-1];gc("items: ",r,", indexStr: ",o);let i=e;void 0!==o&&o.match(/^\d+$/)?(i=e.slice(0,-1*(o.length+1)),gc(`dateStr is ${i}`),n&&!i&&(i=o,o="0")):o="0";try{const r=Ac.parse(n,i,new Date(0,0));return Ac.asString(n,r)!==i?e:(t.index=parseInt(o,10),t.date=i,t.timestamp=r.getTime(),"")}catch(t){return gc(`Problem parsing ${i} as ${n}, error was: `,t),e}}:(e,t)=>e.match(/^\d+$/)?(gc("it has an index"),t.index=parseInt(e,10),""):e];return e=>{let t={filename:e,index:0,isCompressed:!1};return i.reduce(((e,n)=>n(e,t)),e)?null:t}},Rc=Oc;var Mc=class extends Nc{constructor(e,t){if(bc(`constructor: creating RollingFileWriteStream. path=${e}`),"string"!=typeof e||0===e.length)throw new Error(`Invalid filename: ${e}`);if(e.endsWith(Bc.sep))throw new Error(`Filename is a directory: ${e}`);0===e.indexOf(`~${Bc.sep}`)&&(e=e.replace("~",Pc.homedir())),super(t),this.options=this._parseOption(t),this.fileObject=Bc.parse(e),""===this.fileObject.dir&&(this.fileObject=Bc.parse(Bc.join(process.cwd(),e))),this.fileFormatter=Ic({file:this.fileObject,alwaysIncludeDate:this.options.alwaysIncludePattern,needsIndex:this.options.maxSize 0`)}else delete n.maxSize;if(n.numBackups||0===n.numBackups){if(n.numBackups<0)throw new Error(`options.numBackups (${n.numBackups}) should be >= 0`);if(n.numBackups>=Number.MAX_SAFE_INTEGER)throw new Error(`options.numBackups (${n.numBackups}) should be < Number.MAX_SAFE_INTEGER`);n.numToKeep=n.numBackups+1}else if(n.numToKeep<=0)throw new Error(`options.numToKeep (${n.numToKeep}) should be > 0`);return bc(`_parseOption: creating stream with option=${JSON.stringify(n)}`),n}_final(e){this.currentFileStream.end("",this.options.encoding,e)}_write(e,t,n){this._shouldRoll().then((()=>{bc(`_write: writing chunk. file=${this.currentFileStream.path} state=${JSON.stringify(this.state)} chunk=${e}`),this.currentFileStream.write(e,t,(t=>{this.state.currentSize+=e.length,n(t)}))}))}async _shouldRoll(){(this._dateChanged()||this._tooBig())&&(bc(`_shouldRoll: rolling because dateChanged? ${this._dateChanged()} or tooBig? ${this._tooBig()}`),await this._roll())}_dateChanged(){return this.state.currentDate&&this.state.currentDate!==xc(this.options.pattern,kc())}_tooBig(){return this.state.currentSize>=this.options.maxSize}_roll(){return bc("_roll: closing the current stream"),new Promise(((e,t)=>{this.currentFileStream.end("",this.options.encoding,(()=>{this._moveOldFiles().then(e).catch(t)}))}))}async _moveOldFiles(){const e=await this._getExistingFiles();for(let t=(this.state.currentDate?e.filter((e=>e.date===this.state.currentDate)):e).length;t>=0;t--){bc(`_moveOldFiles: i = ${t}`);const e=this.fileFormatter({date:this.state.currentDate,index:t}),n=this.fileFormatter({date:this.state.currentDate,index:t+1}),r={compress:this.options.compress&&0===t,mode:this.options.mode};await Rc(e,n,r)}this.state.currentSize=0,this.state.currentDate=this.state.currentDate?xc(this.options.pattern,kc()):null,bc(`_moveOldFiles: finished rolling files. state=${JSON.stringify(this.state)}`),this._renewWriteStream(),await new Promise(((e,t)=>{this.currentFileStream.write("","utf8",(()=>{this._clean().then(e).catch(t)}))}))}async _getExistingFiles(){const e=await _c.readdir(this.fileObject.dir).catch((()=>[]));bc(`_getExistingFiles: files=${e}`);const t=e.map((e=>this.fileNameParser(e))).filter((e=>e)),n=e=>(e.timestamp?e.timestamp:kc().getTime())-e.index;return t.sort(((e,t)=>n(e)-n(t))),t}_renewWriteStream(){const e=this.fileFormatter({date:this.state.currentDate,index:0}),t=e=>{try{return _c.mkdirSync(e,{recursive:!0})}catch(n){if("ENOENT"===n.code)return t(Bc.dirname(e)),t(e);if("EEXIST"!==n.code&&"EROFS"!==n.code)throw n;try{if(_c.statSync(e).isDirectory())return e;throw n}catch(e){throw n}}};t(this.fileObject.dir);const n={flags:this.options.flags,encoding:this.options.encoding,mode:this.options.mode};var r,u;_c.appendFileSync(e,"",(r={...n},u="flags",r["flag"]=r[u],delete r[u],r)),this.currentFileStream=_c.createWriteStream(e,n),this.currentFileStream.on("error",(e=>{this.emit("error",e)}))}async _clean(){const e=await this._getExistingFiles();if(bc(`_clean: numToKeep = ${this.options.numToKeep}, existingFiles = ${e.length}`),bc("_clean: existing files are: ",e),this._tooManyFiles(e.length)){const n=e.slice(0,e.length-this.options.numToKeep).map((e=>Bc.format({dir:this.fileObject.dir,base:e.filename})));await(t=n,bc(`deleteFiles: files to delete: ${t}`),Promise.all(t.map((e=>_c.unlink(e).catch((t=>{bc(`deleteFiles: error when unlinking ${e}, ignoring. Error was ${t}`)}))))))}var t}_tooManyFiles(e){return this.options.numToKeep>0&&e>this.options.numToKeep}};const Lc=Mc;var jc=class extends Lc{constructor(e,t,n,r){r||(r={}),t&&(r.maxSize=t),r.numBackups||0===r.numBackups||(n||0===n||(n=1),r.numBackups=n),super(e,r),this.backups=r.numBackups,this.size=this.options.maxSize}get theStream(){return this.currentFileStream}};const $c=Mc;var Hc={RollingFileWriteStream:Mc,RollingFileStream:jc,DateRollingFileStream:class extends $c{constructor(e,t,n){t&&"object"==typeof t&&(n=t,t=null),n||(n={}),t||(t="yyyy-MM-dd"),n.pattern=t,n.numBackups||0===n.numBackups?n.daysToKeep=n.numBackups:(n.daysToKeep||0===n.daysToKeep?process.emitWarning("options.daysToKeep is deprecated due to the confusion it causes when used together with file size rolling. Please use options.numBackups instead.","DeprecationWarning","streamroller-DEP0001"):n.daysToKeep=1,n.numBackups=n.daysToKeep),super(e,n),this.mode=this.options.mode}get theStream(){return this.currentFileStream}}};const Jc=Nr.exports("log4js:file"),Gc=p.default,Vc=Hc,Uc=E.default.EOL;let Wc=!1;const zc=new Set;function Kc(){zc.forEach((e=>{e.sighupHandler()}))}function qc(e,t,n,r){const u=new Vc.RollingFileStream(e,t,n,r);return u.on("error",(t=>{console.error("log4js.fileAppender - Writing to file %s, error happened ",e,t)})),u.on("drain",(()=>{process.emit("log4js:pause",!1)})),u}Eo.configure=function(e,t){let n=t.basicLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),e.mode=e.mode||384,function(e,t,n,r,u,o){e=Gc.normalize(e),Jc("Creating file appender (",e,", ",n,", ",r=r||0===r?r:5,", ",u,", ",o,")");let i=qc(e,n,r,u);const s=function(e){if(i.writable){if(!0===u.removeColor){const t=/\x1b[[0-9;]*m/g;e.data=e.data.map((e=>"string"==typeof e?e.replace(t,""):e))}i.write(t(e,o)+Uc,"utf8")||process.emit("log4js:pause",!0)}};return s.reopen=function(){i.end((()=>{i=qc(e,n,r,u)}))},s.sighupHandler=function(){Jc("SIGHUP handler called."),s.reopen()},s.shutdown=function(e){zc.delete(s),0===zc.size&&Wc&&(process.removeListener("SIGHUP",Kc),Wc=!1),i.end("","utf-8",e)},zc.add(s),Wc||(process.on("SIGHUP",Kc),Wc=!0),s}(e.filename,n,e.maxLogSize,e.backups,e,e.timezoneOffset)};var Yc={};const Xc=Hc,Zc=E.default.EOL;function Qc(e,t,n,r,u){r.maxSize=r.maxLogSize;const o=function(e,t,n){const r=new Xc.DateRollingFileStream(e,t,n);return r.on("error",(t=>{console.error("log4js.dateFileAppender - Writing to file %s, error happened ",e,t)})),r.on("drain",(()=>{process.emit("log4js:pause",!1)})),r}(e,t,r),i=function(e){o.writable&&(o.write(n(e,u)+Zc,"utf8")||process.emit("log4js:pause",!0))};return i.shutdown=function(e){o.end("","utf-8",e)},i}Yc.configure=function(e,t){let n=t.basicLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),e.alwaysIncludePattern||(e.alwaysIncludePattern=!1),e.mode=e.mode||384,Qc(e.filename,e.pattern,n,e,e.timezoneOffset)};var ea={};const ta=Nr.exports("log4js:fileSync"),na=p.default,ra=D.default,ua=E.default.EOL||"\n";function oa(e,t){if(ra.existsSync(e))return;const n=ra.openSync(e,t.flags,t.mode);ra.closeSync(n)}class ia{constructor(e,t,n,r){ta("In RollingFileStream"),function(){if(!e||!t||t<=0)throw new Error("You must specify a filename and file size")}(),this.filename=e,this.size=t,this.backups=n,this.options=r,this.currentSize=0,this.currentSize=function(e){let t=0;try{t=ra.statSync(e).size}catch(t){oa(e,r)}return t}(this.filename)}shouldRoll(){return ta("should roll with current size %d, and max size %d",this.currentSize,this.size),this.currentSize>=this.size}roll(e){const t=this,n=new RegExp(`^${na.basename(e)}`);function r(e){return n.test(e)}function u(t){return parseInt(t.substring(`${na.basename(e)}.`.length),10)||0}function o(e,t){return u(e)>u(t)?1:u(e) ${e}.${r+1}`),ra.renameSync(na.join(na.dirname(e),n),`${e}.${r+1}`)}}ta("Rolling, rolling, rolling"),ta("Renaming the old files"),ra.readdirSync(na.dirname(e)).filter(r).sort(o).reverse().forEach(i)}write(e,t){const n=this;ta("in write"),this.shouldRoll()&&(this.currentSize=0,this.roll(this.filename)),ta("writing the chunk to the file"),n.currentSize+=e.length,ra.appendFileSync(n.filename,e)}}ea.configure=function(e,t){let n=t.basicLayout;e.layout&&(n=t.layout(e.layout.type,e.layout));const r={flags:e.flags||"a",encoding:e.encoding||"utf8",mode:e.mode||384};return function(e,t,n,r,u,o){ta("fileSync appender created");const i=function(e,t,n){let r;var u;return t?r=new ia(e,t,n,o):(oa(u=e,o),r={write(e){ra.appendFileSync(u,e)}}),r}(e=na.normalize(e),n,r=r||0===r?r:5);return e=>{i.write(t(e,u)+ua)}}(e.filename,n,e.maxLogSize,e.backups,e.timezoneOffset,r)};var sa={};const ca=Nr.exports("log4js:tcp"),aa=S.default;sa.configure=function(e,t){ca(`configure with config = ${e}`);let n=function(e){return e.serialise()};return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){let n=!1;const r=[];let u,o=3,i="__LOG4JS__";function s(e){ca("Writing log event to socket"),n=u.write(`${t(e)}${i}`,"utf8")}function c(){let e;for(ca("emptying buffer");e=r.shift();)s(e)}function a(e){n?s(e):(ca("buffering log event because it cannot write at the moment"),r.push(e))}return function t(){ca(`appender creating socket to ${e.host||"localhost"}:${e.port||5e3}`),i=`${e.endMsg||"__LOG4JS__"}`,u=aa.createConnection(e.port||5e3,e.host||"localhost"),u.on("connect",(()=>{ca("socket connected"),c(),n=!0})),u.on("drain",(()=>{ca("drain event received, emptying buffer"),n=!0,c()})),u.on("timeout",u.end.bind(u)),u.on("error",(e=>{ca("connection error",e),n=!1,c()})),u.on("close",t)}(),a.shutdown=function(e){ca("shutdown called"),r.length&&o?(ca("buffer has items, waiting 100ms to empty"),o-=1,setTimeout((()=>{a.shutdown(e)}),100)):(u.removeAllListeners("close"),u.end(e))},a}(e,n)};const la=p.default,fa=Nr.exports("log4js:appenders"),da=tu,Da=eo,pa=gu,Ea=hu,ma=to,ha=new Map;ha.set("console",oo),ha.set("stdout",so),ha.set("stderr",co),ha.set("logLevelFilter",ao),ha.set("categoryFilter",lo),ha.set("noLogFilter",Do),ha.set("file",Eo),ha.set("dateFile",Yc),ha.set("fileSync",ea),ha.set("tcp",sa);const ya=new Map,Ca=(e,t)=>{fa("Loading module from ",e);try{return require(e)}catch(n){return void da.throwExceptionIf(t,"MODULE_NOT_FOUND"!==n.code,`appender "${e}" could not be loaded (error was: ${n})`)}},Fa=new Set,ga=(e,t)=>{if(ya.has(e))return ya.get(e);if(!t.appenders[e])return!1;if(Fa.has(e))throw new Error(`Dependency loop detected for appender ${e}.`);Fa.add(e),fa(`Creating appender ${e}`);const n=Aa(e,t);return Fa.delete(e),ya.set(e,n),n},Aa=(e,t)=>{const n=t.appenders[e],r=n.type.configure?n.type:((e,t)=>ha.get(e)||Ca(`./${e}`,t)||Ca(e,t)||require.main&&Ca(la.join(la.dirname(require.main.filename),e),t)||Ca(la.join(process.cwd(),e),t))(n.type,t);return da.throwExceptionIf(t,da.not(r),`appender "${e}" is not valid (type "${n.type}" could not be found)`),r.appender&&fa(`DEPRECATION: Appender ${n.type} exports an appender function.`),r.shutdown&&fa(`DEPRECATION: Appender ${n.type} exports a shutdown function.`),fa(`${e}: clustering.isMaster ? ${Da.isMaster()}`),fa(`${e}: appenderModule is ${F.default.inspect(r)}`),Da.onlyOnMaster((()=>(fa(`calling appenderModule.configure for ${e} / ${n.type}`),r.configure(ma.modifyConfig(n),Ea,(e=>ga(e,t)),pa))),(()=>{}))},va=e=>{ya.clear(),Fa.clear();const t=[];Object.values(e.categories).forEach((e=>{t.push(...e.appenders)})),Object.keys(e.appenders).forEach((n=>{(t.includes(n)||"tcp-server"===e.appenders[n].type)&&ga(n,e)}))},Sa=()=>{va({appenders:{out:{type:"stdout"}},categories:{default:{appenders:["out"],level:"trace"}}})};Sa(),da.addListener((e=>{da.throwExceptionIf(e,da.not(da.anObject(e.appenders)),'must have a property "appenders" of type object.');const t=Object.keys(e.appenders);da.throwExceptionIf(e,da.not(t.length),"must define at least one appender."),t.forEach((t=>{da.throwExceptionIf(e,da.not(e.appenders[t].type),`appender "${t}" is not valid (must be an object with property "type")`)}))})),da.addListener(va),Au.exports=ya,Au.exports.init=Sa;var wa={exports:{}};!function(e){const t=Nr.exports("log4js:categories"),n=tu,r=gu,u=Au.exports,o=new Map;function i(e,t,n){if(!1===t.inherit)return;const r=n.lastIndexOf(".");if(r<0)return;const u=n.substring(0,r);let o=e.categories[u];o||(o={inherit:!0,appenders:[]}),i(e,o,u),!e.categories[u]&&o.appenders&&o.appenders.length&&o.level&&(e.categories[u]=o),t.appenders=t.appenders||[],t.level=t.level||o.level,o.appenders.forEach((e=>{t.appenders.includes(e)||t.appenders.push(e)})),t.parent=o}function s(e){if(!e.categories)return;Object.keys(e.categories).forEach((t=>{const n=e.categories[t];i(e,n,t)}))}n.addPreProcessingListener((e=>s(e))),n.addListener((e=>{n.throwExceptionIf(e,n.not(n.anObject(e.categories)),'must have a property "categories" of type object.');const t=Object.keys(e.categories);n.throwExceptionIf(e,n.not(t.length),"must define at least one category."),t.forEach((t=>{const o=e.categories[t];n.throwExceptionIf(e,[n.not(o.appenders),n.not(o.level)],`category "${t}" is not valid (must be an object with properties "appenders" and "level")`),n.throwExceptionIf(e,n.not(Array.isArray(o.appenders)),`category "${t}" is not valid (appenders must be an array of appender names)`),n.throwExceptionIf(e,n.not(o.appenders.length),`category "${t}" is not valid (appenders must contain at least one appender name)`),Object.prototype.hasOwnProperty.call(o,"enableCallStack")&&n.throwExceptionIf(e,"boolean"!=typeof o.enableCallStack,`category "${t}" is not valid (enableCallStack must be boolean type)`),o.appenders.forEach((r=>{n.throwExceptionIf(e,n.not(u.get(r)),`category "${t}" is not valid (appender "${r}" is not defined)`)})),n.throwExceptionIf(e,n.not(r.getLevel(o.level)),`category "${t}" is not valid (level "${o.level}" not recognised; valid levels are ${r.levels.join(", ")})`)})),n.throwExceptionIf(e,n.not(e.categories.default),'must define a "default" category.')}));const c=e=>{o.clear();Object.keys(e.categories).forEach((n=>{const i=e.categories[n],s=[];i.appenders.forEach((e=>{s.push(u.get(e)),t(`Creating category ${n}`),o.set(n,{appenders:s,level:r.getLevel(i.level),enableCallStack:i.enableCallStack||!1})}))}))},a=()=>{c({categories:{default:{appenders:["out"],level:"OFF"}}})};a(),n.addListener(c);const l=e=>(t(`configForCategory: searching for config for ${e}`),o.has(e)?(t(`configForCategory: ${e} exists in config, returning it`),o.get(e)):e.indexOf(".")>0?(t(`configForCategory: ${e} has hierarchy, searching for parents`),l(e.substring(0,e.lastIndexOf(".")))):(t("configForCategory: returning config for default category"),l("default")));e.exports=o,e.exports=Object.assign(e.exports,{appendersForCategory:e=>l(e).appenders,getLevelForCategory:e=>l(e).level,setLevelForCategory:(e,n)=>{let r=o.get(e);if(t(`setLevelForCategory: found ${r} for ${e}`),!r){const n=l(e);t(`setLevelForCategory: no config found for category, found ${n} for parents of ${e}`),r={appenders:n.appenders}}r.level=n,o.set(e,r)},getEnableCallStackForCategory:e=>!0===l(e).enableCallStack,setEnableCallStackForCategory:(e,t)=>{l(e).enableCallStack=t},init:a})}(wa);const Oa=Nr.exports("log4js:logger"),ba=Hu,_a=gu,Ba=eo,Pa=wa.exports,ka=tu,xa=/at (?:(.+)\s+\()?(?:(.+?):(\d+)(?::(\d+))?|([^)]+))\)?/;function Na(e,t=4){const n=e.stack.split("\n").slice(t),r=xa.exec(n[0]);return r&&6===r.length?{functionName:r[1],fileName:r[2],lineNumber:parseInt(r[3],10),columnNumber:parseInt(r[4],10),callStack:n.join("\n")}:null}class Ia{constructor(e){if(!e)throw new Error("No category provided.");this.category=e,this.context={},this.parseCallStack=Na,Oa(`Logger created (${this.category}, ${this.level})`)}get level(){return _a.getLevel(Pa.getLevelForCategory(this.category),_a.TRACE)}set level(e){Pa.setLevelForCategory(this.category,_a.getLevel(e,this.level))}get useCallStack(){return Pa.getEnableCallStackForCategory(this.category)}set useCallStack(e){Pa.setEnableCallStackForCategory(this.category,!0===e)}log(e,...t){let n=_a.getLevel(e);n||(this._log(_a.WARN,"log4js:logger.log: invalid value for log-level as first parameter given: ",e),n=_a.INFO),this.isLevelEnabled(n)&&this._log(n,t)}isLevelEnabled(e){return this.level.isLessThanOrEqualTo(e)}_log(e,t){Oa(`sending log data (${e}) to appenders`);const n=new ba(this.category,e,t,this.context,this.useCallStack&&this.parseCallStack(new Error));Ba.send(n)}addContext(e,t){this.context[e]=t}removeContext(e){delete this.context[e]}clearContext(){this.context={}}setParseCallStackFunction(e){this.parseCallStack=e}}function Ta(e){const t=_a.getLevel(e),n=t.toString().toLowerCase().replace(/_([a-z])/g,(e=>e[1].toUpperCase())),r=n[0].toUpperCase()+n.slice(1);Ia.prototype[`is${r}Enabled`]=function(){return this.isLevelEnabled(t)},Ia.prototype[n]=function(...e){this.log(t,...e)}}_a.levels.forEach(Ta),ka.addListener((()=>{_a.levels.forEach(Ta)}));var Ra=Ia;const Ma=gu;function La(e){return e.originalUrl||e.url}function ja(e,t){for(let n=0;ne.source?e.source:e));t=new RegExp(n.join("|"))}return t}(t.nolog);return(e,i,s)=>{if(e._logging)return s();if(o&&o.test(e.originalUrl))return s();if(n.isLevelEnabled(r)||"auto"===t.level){const o=new Date,{writeHead:s}=i;e._logging=!0,i.writeHead=(e,t)=>{i.writeHead=s,i.writeHead(e,t),i.__statusCode=e,i.__headers=t||{}},i.on("finish",(()=>{i.responseTime=new Date-o,i.statusCode&&"auto"===t.level&&(r=Ma.INFO,i.statusCode>=300&&(r=Ma.WARN),i.statusCode>=400&&(r=Ma.ERROR)),r=function(e,t,n){let r=t;if(n){const t=n.find((t=>{let n=!1;return n=t.from&&t.to?e>=t.from&&e<=t.to:-1!==t.codes.indexOf(e),n}));t&&(r=Ma.getLevel(t.level,r))}return r}(i.statusCode,r,t.statusRules);const s=function(e,t,n){const r=[];return r.push({token:":url",replacement:La(e)}),r.push({token:":protocol",replacement:e.protocol}),r.push({token:":hostname",replacement:e.hostname}),r.push({token:":method",replacement:e.method}),r.push({token:":status",replacement:t.__statusCode||t.statusCode}),r.push({token:":response-time",replacement:t.responseTime}),r.push({token:":date",replacement:(new Date).toUTCString()}),r.push({token:":referrer",replacement:e.headers.referer||e.headers.referrer||""}),r.push({token:":http-version",replacement:`${e.httpVersionMajor}.${e.httpVersionMinor}`}),r.push({token:":remote-addr",replacement:e.headers["x-forwarded-for"]||e.ip||e._remoteAddress||e.socket&&(e.socket.remoteAddress||e.socket.socket&&e.socket.socket.remoteAddress)}),r.push({token:":user-agent",replacement:e.headers["user-agent"]}),r.push({token:":content-length",replacement:t.getHeader("content-length")||t.__headers&&t.__headers["Content-Length"]||"-"}),r.push({token:/:req\[([^\]]+)]/g,replacement:(t,n)=>e.headers[n.toLowerCase()]}),r.push({token:/:res\[([^\]]+)]/g,replacement:(e,n)=>t.getHeader(n.toLowerCase())||t.__headers&&t.__headers[n]}),(e=>{const t=e.concat();for(let e=0;eja(e,s)));t&&n.log(r,t)}else n.log(r,ja(u,s));t.context&&n.removeContext("res")}))}return s()}},nl=Va;let rl=!1;function ul(e){if(!rl)return;Ua("Received log event ",e);Za.appendersForCategory(e.categoryName).forEach((t=>{t(e)}))}function ol(e){rl&&il();let t=e;return"string"==typeof t&&(t=function(e){Ua(`Loading configuration from ${e}`);try{return JSON.parse(Wa.readFileSync(e,"utf8"))}catch(t){throw new Error(`Problem reading config from file "${e}". Error was ${t.message}`,t)}}(e)),Ua(`Configuration is ${t}`),Ka.configure(za(t)),el.onMessage(ul),rl=!0,sl}function il(e){Ua("Shutdown called. Disabling all log writing."),rl=!1;const t=Array.from(Xa.values());Xa.init(),Za.init();const n=t.reduceRight(((e,t)=>t.shutdown?e+1:e),0);if(0===n)return Ua("No appenders with shutdown functions found."),void 0!==e&&e();let r,u=0;function o(t){r=r||t,u+=1,Ua(`Appender shutdowns complete: ${u} / ${n}`),u>=n&&(Ua("All shutdown functions completed."),e&&e(r))}return Ua(`Found ${n} appenders with shutdown functions.`),t.filter((e=>e.shutdown)).forEach((e=>e.shutdown(o))),null}const sl={getLogger:function(e){return rl||ol(process.env.LOG4JS_CONFIG||{appenders:{out:{type:"stdout"}},categories:{default:{appenders:["out"],level:"OFF"}}}),new Qa(e||"default")},configure:ol,shutdown:il,connectLogger:tl,levels:Ya,addLayout:qa.addLayout,recording:function(){return nl}};var cl=sl,al={};Object.defineProperty(al,"__esModule",{value:!0}),al.levelMap=al.getLevel=al.setCategoriesLevel=al.getConfiguration=al.setConfiguration=void 0;const ll=cl;let fl={appenders:{debug:{type:"stdout",layout:{type:"pattern",pattern:"[%d] > hvigor %p %c %[%m%]"}},info:{type:"stdout",layout:{type:"pattern",pattern:"[%d] > hvigor %[%m%]"}},"no-pattern-info":{type:"stdout",layout:{type:"pattern",pattern:"%m"}},wrong:{type:"stderr",layout:{type:"pattern",pattern:"[%d] > hvigor %[%p: %m%]"}},"just-debug":{type:"logLevelFilter",appender:"debug",level:"debug",maxLevel:"debug"},"just-info":{type:"logLevelFilter",appender:"info",level:"info",maxLevel:"info"},"just-wrong":{type:"logLevelFilter",appender:"wrong",level:"warn",maxLevel:"error"}},categories:{default:{appenders:["just-debug","just-info","just-wrong"],level:"debug"},"no-pattern-info":{appenders:["no-pattern-info"],level:"info"}}};al.setConfiguration=e=>{fl=e};al.getConfiguration=()=>fl;let dl=ll.levels.DEBUG;al.setCategoriesLevel=(e,t)=>{dl=e;const n=fl.categories;for(const r in n)(null==t?void 0:t.includes(r))||Object.prototype.hasOwnProperty.call(n,r)&&(n[r].level=e.levelStr)};al.getLevel=()=>dl,al.levelMap=new Map([["ALL",ll.levels.ALL],["MARK",ll.levels.MARK],["TRACE",ll.levels.TRACE],["DEBUG",ll.levels.DEBUG],["INFO",ll.levels.INFO],["WARN",ll.levels.WARN],["ERROR",ll.levels.ERROR],["FATAL",ll.levels.FATAL],["OFF",ll.levels.OFF]]);var Dl=w&&w.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),pl=w&&w.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),El=w&&w.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&Dl(t,e,n);return pl(t,e),t};Object.defineProperty(xr,"__esModule",{value:!0}),xr.evaluateLogLevel=xr.HvigorLogger=void 0;const ml=El(cl),hl=cl,yl=El(F.default),Cl=al;class Fl{constructor(e){ml.configure((0,Cl.getConfiguration)()),this._logger=ml.getLogger(e),this._logger.level=(0,Cl.getLevel)()}static getLogger(e){return new Fl(e)}log(e,...t){this._logger.log(e,...t)}debug(e,...t){this._logger.debug(e,...t)}info(e,...t){this._logger.info(e,...t)}warn(e,...t){void 0!==e&&""!==e&&this._logger.warn(e,...t)}error(e,...t){this._logger.error(e,...t)}_printTaskExecuteInfo(e,t){this.info(`Finished :${e}... after ${t}`)}_printFailedTaskInfo(e){this.error(`Failed :${e}... `)}_printDisabledTaskInfo(e){this.info(`Disabled :${e}... `)}_printUpToDateTaskInfo(e){this.info(`UP-TO-DATE :${e}... `)}errorMessageExit(e,...t){throw new Error(yl.format(e,...t))}errorExit(e,t,...n){t&&this._logger.error(t,n),this._logger.error(e.stack)}setLevel(e,t){(0,Cl.setCategoriesLevel)(e,t),ml.shutdown(),ml.configure((0,Cl.getConfiguration)())}getLevel(){return this._logger.level}configure(e){const t=(0,Cl.getConfiguration)(),n={appenders:{...t.appenders,...e.appenders},categories:{...t.categories,...e.categories}};(0,Cl.setConfiguration)(n),ml.shutdown(),ml.configure(n)}}xr.HvigorLogger=Fl,xr.evaluateLogLevel=function(e,t){t.debug?e.setLevel(hl.levels.DEBUG):t.warn?e.setLevel(hl.levels.WARN):t.error?e.setLevel(hl.levels.ERROR):e.setLevel(hl.levels.INFO)};var gl=w&&w.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(X,"__esModule",{value:!0}),X.parseJsonText=X.parseJsonFile=void 0;const Al=Z,vl=gl(kr),Sl=gl(p.default),wl=gl(E.default),Ol=xr.HvigorLogger.getLogger("parse-json-util");var bl;!function(e){e[e.Char=0]="Char",e[e.EOF=1]="EOF",e[e.Identifier=2]="Identifier"}(bl||(bl={}));let _l,Bl,Pl,kl,xl,Nl,Il="start",Tl=[],Rl=0,Ml=1,Ll=0,jl=!1,$l="default",Hl="'",Jl=1;function Gl(e,t=!1){Bl=String(e),Il="start",Tl=[],Rl=0,Ml=1,Ll=0,kl=void 0,jl=t;do{_l=Vl(),Xl[Il]()}while("eof"!==_l.type);return kl}function Vl(){for($l="default",xl="",Hl="'",Jl=1;;){Nl=Ul();const e=zl[$l]();if(e)return e}}function Ul(){if(Bl[Rl])return String.fromCodePoint(Bl.codePointAt(Rl))}function Wl(){const e=Ul();return"\n"===e?(Ml++,Ll=0):e?Ll+=e.length:Ll++,e&&(Rl+=e.length),e}X.parseJsonFile=function(e,t=!1,n="utf-8"){const r=vl.default.readFileSync(Sl.default.resolve(e),{encoding:n});try{return Gl(r,t)}catch(t){if(t instanceof SyntaxError){const n=t.message.split("at");2===n.length&&Ol.errorMessageExit(`${n[0].trim()}${wl.default.EOL}\t at ${e}:${n[1].trim()}`)}Ol.errorMessageExit(`${e} is not in valid JSON/JSON5 format.`)}},X.parseJsonText=Gl;const zl={default(){switch(Nl){case"/":return Wl(),void($l="comment");case void 0:return Wl(),Kl("eof")}if(!Al.JudgeUtil.isIgnoreChar(Nl)&&!Al.JudgeUtil.isSpaceSeparator(Nl))return zl[Il]();Wl()},start(){$l="value"},beforePropertyName(){switch(Nl){case"$":case"_":return xl=Wl(),void($l="identifierName");case"\\":return Wl(),void($l="identifierNameStartEscape");case"}":return Kl("punctuator",Wl());case'"':case"'":return Hl=Nl,Wl(),void($l="string")}if(Al.JudgeUtil.isIdStartChar(Nl))return xl+=Wl(),void($l="identifierName");throw tf(bl.Char,Wl())},afterPropertyName(){if(":"===Nl)return Kl("punctuator",Wl());throw tf(bl.Char,Wl())},beforePropertyValue(){$l="value"},afterPropertyValue(){switch(Nl){case",":case"}":return Kl("punctuator",Wl())}throw tf(bl.Char,Wl())},beforeArrayValue(){if("]"===Nl)return Kl("punctuator",Wl());$l="value"},afterArrayValue(){switch(Nl){case",":case"]":return Kl("punctuator",Wl())}throw tf(bl.Char,Wl())},end(){throw tf(bl.Char,Wl())},comment(){switch(Nl){case"*":return Wl(),void($l="multiLineComment");case"/":return Wl(),void($l="singleLineComment")}throw tf(bl.Char,Wl())},multiLineComment(){switch(Nl){case"*":return Wl(),void($l="multiLineCommentAsterisk");case void 0:throw tf(bl.Char,Wl())}Wl()},multiLineCommentAsterisk(){switch(Nl){case"*":return void Wl();case"/":return Wl(),void($l="default");case void 0:throw tf(bl.Char,Wl())}Wl(),$l="multiLineComment"},singleLineComment(){switch(Nl){case"\n":case"\r":case"\u2028":case"\u2029":return Wl(),void($l="default");case void 0:return Wl(),Kl("eof")}Wl()},value(){switch(Nl){case"{":case"[":return Kl("punctuator",Wl());case"n":return Wl(),ql("ull"),Kl("null",null);case"t":return Wl(),ql("rue"),Kl("boolean",!0);case"f":return Wl(),ql("alse"),Kl("boolean",!1);case"-":case"+":return"-"===Wl()&&(Jl=-1),void($l="numerical");case".":case"0":case"I":case"N":return void($l="numerical");case'"':case"'":return Hl=Nl,Wl(),xl="",void($l="string")}if(void 0===Nl||!Al.JudgeUtil.isDigitWithoutZero(Nl))throw tf(bl.Char,Wl());$l="numerical"},numerical(){switch(Nl){case".":return xl=Wl(),void($l="decimalPointLeading");case"0":return xl=Wl(),void($l="zero");case"I":return Wl(),ql("nfinity"),Kl("numeric",Jl*(1/0));case"N":return Wl(),ql("aN"),Kl("numeric",NaN)}if(void 0!==Nl&&Al.JudgeUtil.isDigitWithoutZero(Nl))return xl=Wl(),void($l="decimalInteger");throw tf(bl.Char,Wl())},zero(){switch(Nl){case".":case"e":case"E":return void($l="decimal");case"x":case"X":return xl+=Wl(),void($l="hexadecimal")}return Kl("numeric",0)},decimalInteger(){switch(Nl){case".":case"e":case"E":return void($l="decimal")}if(!Al.JudgeUtil.isDigit(Nl))return Kl("numeric",Jl*Number(xl));xl+=Wl()},decimal(){switch(Nl){case".":xl+=Wl(),$l="decimalFraction";break;case"e":case"E":xl+=Wl(),$l="decimalExponent"}},decimalPointLeading(){if(Al.JudgeUtil.isDigit(Nl))return xl+=Wl(),void($l="decimalFraction");throw tf(bl.Char,Wl())},decimalFraction(){switch(Nl){case"e":case"E":return xl+=Wl(),void($l="decimalExponent")}if(!Al.JudgeUtil.isDigit(Nl))return Kl("numeric",Jl*Number(xl));xl+=Wl()},decimalExponent(){switch(Nl){case"+":case"-":return xl+=Wl(),void($l="decimalExponentSign")}if(Al.JudgeUtil.isDigit(Nl))return xl+=Wl(),void($l="decimalExponentInteger");throw tf(bl.Char,Wl())},decimalExponentSign(){if(Al.JudgeUtil.isDigit(Nl))return xl+=Wl(),void($l="decimalExponentInteger");throw tf(bl.Char,Wl())},decimalExponentInteger(){if(!Al.JudgeUtil.isDigit(Nl))return Kl("numeric",Jl*Number(xl));xl+=Wl()},hexadecimal(){if(Al.JudgeUtil.isHexDigit(Nl))return xl+=Wl(),void($l="hexadecimalInteger");throw tf(bl.Char,Wl())},hexadecimalInteger(){if(!Al.JudgeUtil.isHexDigit(Nl))return Kl("numeric",Jl*Number(xl));xl+=Wl()},identifierNameStartEscape(){if("u"!==Nl)throw tf(bl.Char,Wl());Wl();const e=Yl();switch(e){case"$":case"_":break;default:if(!Al.JudgeUtil.isIdStartChar(e))throw tf(bl.Identifier)}xl+=e,$l="identifierName"},identifierName(){switch(Nl){case"$":case"_":case"‌":case"‍":return void(xl+=Wl());case"\\":return Wl(),void($l="identifierNameEscape")}if(!Al.JudgeUtil.isIdContinueChar(Nl))return Kl("identifier",xl);xl+=Wl()},identifierNameEscape(){if("u"!==Nl)throw tf(bl.Char,Wl());Wl();const e=Yl();switch(e){case"$":case"_":case"‌":case"‍":break;default:if(!Al.JudgeUtil.isIdContinueChar(e))throw tf(bl.Identifier)}xl+=e,$l="identifierName"},string(){switch(Nl){case"\\":return Wl(),void(xl+=function(){const e=Ul(),t=function(){switch(Ul()){case"b":return Wl(),"\b";case"f":return Wl(),"\f";case"n":return Wl(),"\n";case"r":return Wl(),"\r";case"t":return Wl(),"\t";case"v":return Wl(),"\v"}return}();if(t)return t;switch(e){case"0":if(Wl(),Al.JudgeUtil.isDigit(Ul()))throw tf(bl.Char,Wl());return"\0";case"x":return Wl(),function(){let e="",t=Ul();if(!Al.JudgeUtil.isHexDigit(t))throw tf(bl.Char,Wl());if(e+=Wl(),t=Ul(),!Al.JudgeUtil.isHexDigit(t))throw tf(bl.Char,Wl());return e+=Wl(),String.fromCodePoint(parseInt(e,16))}();case"u":return Wl(),Yl();case"\n":case"\u2028":case"\u2029":return Wl(),"";case"\r":return Wl(),"\n"===Ul()&&Wl(),""}if(void 0===e||Al.JudgeUtil.isDigitWithoutZero(e))throw tf(bl.Char,Wl());return Wl()}());case'"':case"'":if(Nl===Hl){const e=Kl("string",xl);return Wl(),e}return void(xl+=Wl());case"\n":case"\r":case void 0:throw tf(bl.Char,Wl());case"\u2028":case"\u2029":!function(e){Ol.warn(`JSON5: '${ef(e)}' in strings is not valid ECMAScript; consider escaping.`)}(Nl)}xl+=Wl()}};function Kl(e,t){return{type:e,value:t,line:Ml,column:Ll}}function ql(e){for(const t of e){if(Ul()!==t)throw tf(bl.Char,Wl());Wl()}}function Yl(){let e="",t=4;for(;t-- >0;){const t=Ul();if(!Al.JudgeUtil.isHexDigit(t))throw tf(bl.Char,Wl());e+=Wl()}return String.fromCodePoint(parseInt(e,16))}const Xl={start(){if("eof"===_l.type)throw tf(bl.EOF);Zl()},beforePropertyName(){switch(_l.type){case"identifier":case"string":return Pl=_l.value,void(Il="afterPropertyName");case"punctuator":return void Ql();case"eof":throw tf(bl.EOF)}},afterPropertyName(){if("eof"===_l.type)throw tf(bl.EOF);Il="beforePropertyValue"},beforePropertyValue(){if("eof"===_l.type)throw tf(bl.EOF);Zl()},afterPropertyValue(){if("eof"===_l.type)throw tf(bl.EOF);switch(_l.value){case",":return void(Il="beforePropertyName");case"}":Ql()}},beforeArrayValue(){if("eof"===_l.type)throw tf(bl.EOF);"punctuator"!==_l.type||"]"!==_l.value?Zl():Ql()},afterArrayValue(){if("eof"===_l.type)throw tf(bl.EOF);switch(_l.value){case",":return void(Il="beforeArrayValue");case"]":Ql()}},end(){}};function Zl(){const e=function(){let e;switch(_l.type){case"punctuator":switch(_l.value){case"{":e={};break;case"[":e=[]}break;case"null":case"boolean":case"numeric":case"string":e=_l.value}return e}();if(jl&&"object"==typeof e&&(e._line=Ml,e._column=Ll),void 0===kl)kl=e;else{const t=Tl[Tl.length-1];Array.isArray(t)?jl&&"object"!=typeof e?t.push({value:e,_line:Ml,_column:Ll}):t.push(e):t[Pl]=jl&&"object"!=typeof e?{value:e,_line:Ml,_column:Ll}:e}!function(e){if(e&&"object"==typeof e)Tl.push(e),Il=Array.isArray(e)?"beforeArrayValue":"beforePropertyName";else{const e=Tl[Tl.length-1];Il=e?Array.isArray(e)?"afterArrayValue":"afterPropertyValue":"end"}}(e)}function Ql(){Tl.pop();const e=Tl[Tl.length-1];Il=e?Array.isArray(e)?"afterArrayValue":"afterPropertyValue":"end"}function ef(e){const t={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(t[e])return t[e];if(e<" "){const t=e.charCodeAt(0).toString(16);return`\\x${`00${t}`.substring(t.length)}`}return e}function tf(e,t){let n="";switch(e){case bl.Char:n=void 0===t?`JSON5: invalid end of input at ${Ml}:${Ll}`:`JSON5: invalid character '${ef(t)}' at ${Ml}:${Ll}`;break;case bl.EOF:n=`JSON5: invalid end of input at ${Ml}:${Ll}`;break;case bl.Identifier:Ll-=5,n=`JSON5: invalid identifier character at ${Ml}:${Ll}`}const r=new nf(n);return r.lineNumber=Ml,r.columnNumber=Ll,r}class nf extends SyntaxError{}var rf=w&&w.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),uf=w&&w.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),of=w&&w.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&rf(t,e,n);return uf(t,e),t};Object.defineProperty(Y,"__esModule",{value:!0});var sf=Y.cleanWorkSpace=Ff=Y.executeInstallHvigor=yf=Y.isHvigorInstalled=mf=Y.isAllDependenciesInstalled=void 0;const cf=of(D.default),af=of(p.default),lf=b,ff=j,df=$,Df=X;let pf,Ef;var mf=Y.isAllDependenciesInstalled=function(){function e(e){const t=null==e?void 0:e.dependencies;return void 0===t?0:Object.getOwnPropertyNames(t).length}if(pf=gf(),Ef=Af(),e(pf)+1!==e(Ef))return!1;for(const e in null==pf?void 0:pf.dependencies)if(!(0,ff.hasNpmPackInPaths)(e,[lf.HVIGOR_PROJECT_DEPENDENCIES_HOME])||!hf(e,pf,Ef))return!1;return!0};function hf(e,t,n){return void 0!==n.dependencies&&(0,ff.offlinePluginConversion)(lf.HVIGOR_PROJECT_ROOT_DIR,t.dependencies[e])===n.dependencies[e]}var yf=Y.isHvigorInstalled=function(){return pf=gf(),Ef=Af(),(0,ff.hasNpmPackInPaths)(lf.HVIGOR_ENGINE_PACKAGE_NAME,[lf.HVIGOR_PROJECT_DEPENDENCIES_HOME])&&(0,ff.offlinePluginConversion)(lf.HVIGOR_PROJECT_ROOT_DIR,pf.hvigorVersion)===Ef.dependencies[lf.HVIGOR_ENGINE_PACKAGE_NAME]};const Cf={cwd:lf.HVIGOR_PROJECT_DEPENDENCIES_HOME,stdio:["inherit","inherit","inherit"]};var Ff=Y.executeInstallHvigor=function(){(0,df.logInfoPrintConsole)("Hvigor installing...");const e={dependencies:{}};e.dependencies[lf.HVIGOR_ENGINE_PACKAGE_NAME]=(0,ff.offlinePluginConversion)(lf.HVIGOR_PROJECT_ROOT_DIR,pf.hvigorVersion);try{cf.mkdirSync(lf.HVIGOR_PROJECT_DEPENDENCIES_HOME,{recursive:!0});const t=af.resolve(lf.HVIGOR_PROJECT_DEPENDENCIES_HOME,lf.DEFAULT_PACKAGE_JSON);cf.writeFileSync(t,JSON.stringify(e))}catch(e){(0,df.logErrorAndExit)(e)}!function(){const e=["config","set","store-dir",lf.HVIGOR_PNPM_STORE_PATH];(0,ff.executeCommand)(lf.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,e,Cf)}(),(0,ff.executeCommand)(lf.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,["install"],Cf)};function gf(){const e=af.resolve(lf.HVIGOR_PROJECT_WRAPPER_HOME,lf.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME);return cf.existsSync(e)||(0,df.logErrorAndExit)(`Error: Hvigor config file ${e} does not exist.`),(0,Df.parseJsonFile)(e)}function Af(){return cf.existsSync(lf.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH)?(0,Df.parseJsonFile)(lf.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH):{dependencies:{}}}sf=Y.cleanWorkSpace=function(){if((0,df.logInfoPrintConsole)("Hvigor cleaning..."),!cf.existsSync(lf.HVIGOR_PROJECT_DEPENDENCIES_HOME))return;const e=cf.readdirSync(lf.HVIGOR_PROJECT_DEPENDENCIES_HOME);if(e&&0!==e.length){cf.existsSync(lf.HVIGOR_BOOT_JS_FILE_PATH)&&(0,ff.executeCommand)(process.argv[0],[lf.HVIGOR_BOOT_JS_FILE_PATH,"--stop-daemon"],{});try{e.forEach((e=>{cf.rmSync(af.resolve(lf.HVIGOR_PROJECT_DEPENDENCIES_HOME,e),{recursive:!0})}))}catch(e){(0,df.logErrorAndExit)(`The hvigor build tool cannot be installed. Please manually clear the workspace directory and synchronize the project again.\n\n Workspace Path: ${lf.HVIGOR_PROJECT_DEPENDENCIES_HOME}.`)}}};var vf={},Sf=w&&w.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),wf=w&&w.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Of=w&&w.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&Sf(t,e,n);return wf(t,e),t};Object.defineProperty(vf,"__esModule",{value:!0});var bf=vf.executeBuild=void 0;const _f=b,Bf=Of(D.default),Pf=Of(p.default),kf=$;bf=vf.executeBuild=function(){const e=Pf.resolve(_f.HVIGOR_PROJECT_DEPENDENCIES_HOME,"node_modules","@ohos","hvigor","bin","hvigor.js");try{const t=Bf.realpathSync(e);require(t)}catch(t){(0,kf.logErrorAndExit)(`Error: ENOENT: no such file ${e},delete ${_f.HVIGOR_PROJECT_DEPENDENCIES_HOME} and retry.`)}},function(){if(O.checkNpmConifg(),O.environmentHandler(),O.isPnpmAvailable()||O.executeInstallPnpm(),yf()&&mf())bf();else{sf();try{Ff()}catch(e){return void sf()}bf()}}(); \ No newline at end of file diff --git a/unionpi_tiger/sample/app/two_videoPlayer/hvigorfile.js b/unionpi_tiger/sample/app/two_videoPlayer/hvigorfile.js deleted file mode 100644 index cfe6efdf..00000000 --- a/unionpi_tiger/sample/app/two_videoPlayer/hvigorfile.js +++ /dev/null @@ -1,2 +0,0 @@ -// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. -module.exports = require('@ohos/hvigor-ohos-plugin').legacyAppTasks \ No newline at end of file diff --git a/unionpi_tiger/sample/app/two_videoPlayer/hvigorw b/unionpi_tiger/sample/app/two_videoPlayer/hvigorw deleted file mode 100644 index 54aadd22..00000000 --- a/unionpi_tiger/sample/app/two_videoPlayer/hvigorw +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash - -# ---------------------------------------------------------------------------- -# Hvigor startup script, version 1.0.0 -# -# Required ENV vars: -# ------------------ -# NODE_HOME - location of a Node home dir -# or -# Add /usr/local/nodejs/bin to the PATH environment variable -# ---------------------------------------------------------------------------- - -HVIGOR_APP_HOME=$(dirname $(readlink -f $0)) -HVIGOR_WRAPPER_SCRIPT=${HVIGOR_APP_HOME}/hvigor/hvigor-wrapper.js -warn() { - echo "" - echo -e "\033[1;33m`date '+[%Y-%m-%d %H:%M:%S]'`$@\033[0m" -} - -error() { - echo "" - echo -e "\033[1;31m`date '+[%Y-%m-%d %H:%M:%S]'`$@\033[0m" -} - -fail() { - error "$@" - exit 1 -} - -# Determine node to start hvigor wrapper script -if [ -n "${NODE_HOME}" ];then - EXECUTABLE_NODE="${NODE_HOME}/bin/node" - if [ ! -x "$EXECUTABLE_NODE" ];then - fail "ERROR: NODE_HOME is set to an invalid directory,check $NODE_HOME\n\nPlease set NODE_HOME in your environment to the location where your nodejs installed" - fi -else - EXECUTABLE_NODE="node" - which ${EXECUTABLE_NODE} > /dev/null 2>&1 || fail "ERROR: NODE_HOME is not set and not 'node' command found in your path" -fi - -# Check hvigor wrapper script -if [ ! -r "$HVIGOR_WRAPPER_SCRIPT" ];then - fail "ERROR: Couldn't find hvigor/hvigor-wrapper.js in ${HVIGOR_APP_HOME}" -fi - -# start hvigor-wrapper script -exec "${EXECUTABLE_NODE}" \ - "${HVIGOR_WRAPPER_SCRIPT}" "$@" diff --git a/unionpi_tiger/sample/app/two_videoPlayer/hvigorw.bat b/unionpi_tiger/sample/app/two_videoPlayer/hvigorw.bat deleted file mode 100644 index 29196b4d..00000000 --- a/unionpi_tiger/sample/app/two_videoPlayer/hvigorw.bat +++ /dev/null @@ -1,57 +0,0 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Hvigor startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -set WRAPPER_MODULE_PATH=%APP_HOME%\hvigor\hvigor-wrapper.js -set NODE_EXE=node.exe - -goto start - -:start -@rem Find node.exe -if defined NODE_HOME goto findNodeFromNodeHome - -%NODE_EXE% --version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute - -echo. -echo ERROR: NODE_HOME is not set and no 'node' command could be found in your PATH. -echo. -echo Please set the NODE_HOME variable in your environment to match the -echo location of your NodeJs installation. - -goto fail - -:findNodeFromNodeHome -set NODE_HOME=%NODE_HOME:"=% -set NODE_EXE_PATH=%NODE_HOME%/%NODE_EXE% - -if exist "%NODE_EXE_PATH%" goto execute -echo. -echo ERROR: NODE_HOME is not set and no 'node' command could be found in your PATH. -echo. -echo Please set the NODE_HOME variable in your environment to match the -echo location of your NodeJs installation. - -goto fail - -:execute -@rem Execute hvigor -"%NODE_EXE%" %WRAPPER_MODULE_PATH% %* - -:fail -exit /b 1 diff --git a/unionpi_tiger/sample/app/two_videoPlayer/package.json b/unionpi_tiger/sample/app/two_videoPlayer/package.json deleted file mode 100644 index 7c2a4703..00000000 --- a/unionpi_tiger/sample/app/two_videoPlayer/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "license":"ISC", - "devDependencies":{}, - "name":"two_vedioplayer", - "ohos":{ - "org":"huawei", - "directoryLevel":"project", - "buildTool":"hvigor" - }, - "description":"example description", - "repository":{}, - "version":"1.0.0", - "dependencies":{ - "@ohos/hypium":"1.0.1", - "@ohos/hvigor-ohos-plugin":"1.1.6", - "@ohos/hvigor":"1.1.6" - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/.gitignore b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/.gitignore deleted file mode 100644 index fbabf771..00000000 --- a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -/node_modules -/oh_modules -/local.properties -/.idea -**/build -/.hvigor -.cxx -/.clangd -/.clang-format -/.clang-tidy -**/.test \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/AppScope/app.json5 b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/AppScope/app.json5 deleted file mode 100644 index 48e99921..00000000 --- a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/AppScope/app.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -{ - "app": { - "bundleName": "com.unionman.distributedvideoplayer", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name" - } -} diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/AppScope/resources/base/element/string.json b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/AppScope/resources/base/element/string.json deleted file mode 100644 index 09b6a700..00000000 --- a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "DistributedVideoPlayer" - } - ] -} diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/AppScope/resources/base/media/app_icon.png b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index c394496f..00000000 Binary files a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/README.md b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/README.md deleted file mode 100644 index 8cd12c48..00000000 --- a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/README.md +++ /dev/null @@ -1,123 +0,0 @@ -# 分布式视频播放器 - -### 介绍 - -本示例使用medialibrary获取本地视频文件资源,并通过AVPlayer完成了视频的播放、暂停、跳转、倍速等功能;并使用DeviceManager完成了分布式设备列表的显示和分布式能力完成了视频播放状态的跨设备协同。 - -本示例用到了文件存储管理能力接口[@ohos.fileio](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-fileio.md) - -媒体查询接口[@ohos.mediaquery](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-mediaquery.md) - -分布式键值数据库接口[@ohos.data.distributedKVStore](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-distributed-data.md) - -音视频相关媒体业务能力接口[@ohos.multimedia.media](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-media.md) - -分布式设备管理能力接口(设备管理),实现设备之间的kvStore对象的数据传输交互[@ohos.distributedHardware.deviceManager](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-device-manager.md) - -应用持久化轻量级数据接口[@ohos.data.preferences](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-data-preferences.md) - -屏幕截图接口[@ohos.screenshot](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-screenshot.md) - -### 效果预览 - -| 首页 | 视频列表 | -| ------------------------------------ | ---------------------------------- | -| ![](screenshots/Index.jpeg) | ![](screenshots/VideoList.jpeg) | -| **设备弹窗** | **设置** | -| ![](screenshots/DeviceDialog.jpeg) | ![](screenshots/Settings.jpeg) | - -使用说明 - -1. 首次进入应用会弹出权限弹窗,需要进行授权; -1. 播放视频源可使用hdc命令将视频推到`storage/media/100/local/files/Videos`路径下并重启或使用`scanner`命令刷新; -1. **单击**播放键/暂停键或**双击**界面控制**播放/暂停**; -2. 点击进度条或左右滑动**操控进度**; -3. 点击右上角流转按钮,即可弹出设备选择框; -3. 在设备选择框中点击对端设备名称,拉起对端应用; -3. 对端应用启动后,可在任意一端中操作应用,两端应用可实现数据实时同步; -3. 在设备选择框中选中本机即可关闭对端应用; -3. 点击右上角设置按钮,可对流转模式及分布式认证设备进行设置管理; - -### 工程目录 - -``` -entry/src/main/ets/ -|---pages -| |---Index.ets // 首页 -| |---Settings.ets // 设置页 -|---model -| |---DistributedDataModel.ts // 封装分布式数据类 -| |---Logger.ts // 日志工具 -| |---KvStoreModel.ts // kvstore对象操作类 -| |---RemoteDeviceModel.ts // 远程设备操作类 -|---common -| |---BasicDataSource.ets // 懒加载数据 -| |---DeviceDialog.ets // 分布式设备列表弹窗 -| |---ScreenshotDialog.ets // 屏幕截图弹窗 -| |---TitleBar.ets // 菜单栏模块(包含远端设备拉起) -|---utils -| |---AVPlayerUtils.ts // 封装AVPlayer工具类 -| |---DateTimeUtil.ts // 日期时间工具类 -| |---globalThis.ts -| |---MediaUtils.ts // 媒体库工具类 -| |---utils.ts // 自定义工具类 -``` - -### 具体实现 - -在分布式视频播放器应用中,分布式设备管理包含了分布式设备搜索、分布式设备列表弹窗、远端设备拉起三部分。 -首先在分布式组网内搜索设备,然后把设备展示到分布式设备列表弹窗中,最后根据用户的选择拉起远端设备。 - -#### 分布式设备搜索 - -通过SUBSCRIBE_ID搜索分布式组网内的远端设备,详见startDeviceDiscovery(){}模块[源码参考](https://gitee.com/openharmony/vendor_unionman/blob/master/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/ets/model/RemoteDeviceModel.ets)。 - -#### 分布式设备列表弹窗 - -使用@CustomDialog装饰器来装饰分布式设备列表弹窗,[源码参考](https://gitee.com/openharmony/vendor_unionman/blob/master/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/ets/common/DeviceDialog.ets)。 - -#### 远端设备拉起 - -通过startAbility(deviceId)方法拉起远端设备的包,[源码参考](https://gitee.com/openharmony/vendor_unionman/blob/master/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/ets/common/TitleBar.ets)。 - -#### 分布式数据管理 - -(1) 管理分布式数据库 -创建一个KVManager对象实例,用于管理分布式数据库对象。通过distributedKVStore.createKVManager(config),并通过指定Options和storeId,创建并获取KVStore数据库,并通过Promise方式返回,此方法为异步方法,例如this.kvManager.getKVStore(STORE_ID, options).then((store) => {}) - -(2) 订阅分布式数据变化 -通过订阅分布式数据库所有(本地及远端)数据变化实现数据协同[源码参考](https://gitee.com/openharmony/vendor_unionman/blob/master/unionpi_tiger/sample/app/DistributedVideoPlayer/entry/src/main/ets/model/KvStoreModel.ets)。 - -### 相关权限 - -[ohos.permission.DISTRIBUTED_DATASYNC](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md#ohospermissiondistributed_datasync) - -[ohos.permission.CAPTURE_SCREEN](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md#ohospermissioncapture_screen) - -[ohos.permission.READ_MEDIA](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md#ohospermissionread_media) - -[ohos.permission.WRITE_MEDIA](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md#ohospermissionwrite_media) - -### 依赖 - -不涉及。 - -### 约束与限制 - -1. 本示例仅支持标准系统上运行; -2. 本示例仅支持API10版本SDK,SDK版本号(API Version 10 Release),镜像版本号(4.0 Release); -3. 本示例需要使用DevEco Studio 版本号(4.0 Release)才可编译运行; -4. 本示例涉及使用系统接口:@ohos.distributedHardware.deviceManager,需要手动替换Full SDK才能编译通过,具体操作可参考[替换指南](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/faqs/full-sdk-switch-guide.md); -5. 本示例涉及系统接口,需要配置系统应用签名,可以参考[特殊权限配置方法](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/app-provision-structure.md#修改harmonyappprovision配置文件),把配置文件中的“app-feature”字段信息改为“hos_system_app”。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -``` -git init -git config core.sparsecheckout true -echo unionpi_tiger/sample_api10/app/DistributedVideoPlayer/ > .git/info/sparse-checkout -git remote add origin https://gitee.com/openharmony/vendor_unionman.git -git pull origin master -``` \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/build-profile.json5 b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/build-profile.json5 deleted file mode 100644 index de0e3b9e..00000000 --- a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/build-profile.json5 +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -{ - "app": { - "signingConfigs": [], - "products": [ - { - "name": "default", - "signingConfig": "default", - "compileSdkVersion": 10, - "compatibleSdkVersion": 10, - "runtimeOS": "OpenHarmony", - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/.gitignore b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/.gitignore deleted file mode 100644 index e2713a27..00000000 --- a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/build-profile.json5 b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/build-profile.json5 deleted file mode 100644 index 6ee9f9ec..00000000 --- a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/build-profile.json5 +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -{ - "apiType": "stageMode", - "buildOption": { - "arkOptions": { - // "apPath": "./modules.ap" /* Profile used for profile-guided optimization (PGO), a compiler optimization technique to improve app runtime performance. */ - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": true, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/hvigorfile.ts b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/hvigorfile.ts deleted file mode 100644 index c6edcd90..00000000 --- a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/hvigorfile.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { hapTasks } from '@ohos/hvigor-ohos-plugin'; - -export default { - system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ - plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ -} diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/obfuscation-rules.txt b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/obfuscation-rules.txt deleted file mode 100644 index 985b2aeb..00000000 --- a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/obfuscation-rules.txt +++ /dev/null @@ -1,18 +0,0 @@ -# Define project specific obfuscation rules here. -# You can include the obfuscation configuration files in the current module's build-profile.json5. -# -# For more details, see -# https://gitee.com/openharmony/arkcompiler_ets_frontend/blob/master/arkguard/README.md - -# Obfuscation options: -# -disable-obfuscation: disable all obfuscations -# -enable-property-obfuscation: obfuscate the property names -# -enable-toplevel-obfuscation: obfuscate the names in the global scope -# -compact: remove unnecessary blank spaces and all line feeds -# -remove-log: remove all console.* statements -# -print-namecache: print the name cache that contains the mapping from the old names to new names -# -apply-namecache: reuse the given cache file - -# Keep options: -# -keep-property-name: specifies property names that you want to keep -# -keep-global-name: specifies names that you want to keep in the global scope \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/oh-package.json5 b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/oh-package.json5 deleted file mode 100644 index 248c3b75..00000000 --- a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/oh-package.json5 +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "entry", - "version": "1.0.0", - "description": "Please describe the basic information.", - "main": "", - "author": "", - "license": "", - "dependencies": {} -} - diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/ets/common/BasicDataSource.ets b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/ets/common/BasicDataSource.ets deleted file mode 100644 index 8bcf953a..00000000 --- a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/ets/common/BasicDataSource.ets +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -import mediaLibrary from '@ohos.multimedia.mediaLibrary'; - -class BasicDataSource implements IDataSource { - private listeners: DataChangeListener[] = [] - private originDataArray: mediaLibrary.FileAsset[] = []; - - public totalCount(): number { - return 0 - } - - public getData(index: number): mediaLibrary.FileAsset { - return this.originDataArray[index]; - } - - registerDataChangeListener(listener: DataChangeListener): void { - if (this.listeners.indexOf(listener) < 0) { - this.listeners.push(listener) - } - } - - unregisterDataChangeListener(listener: DataChangeListener): void { - const pos = this.listeners.indexOf(listener); - if (pos >= 0) { - this.listeners.splice(pos, 1) - } - } - - notifyDataReload(): void { - this.listeners.forEach(listener => { - listener.onDataReloaded() - }) - } - - notifyDataAdd(index: number): void { - this.listeners.forEach(listener => { - listener.onDataAdd(index) - }) - } - - notifyDataChange(index: number): void { - this.listeners.forEach(listener => { - listener.onDataChange(index) - }) - } - - notifyDataDelete(index: number): void { - this.listeners.forEach(listener => { - listener.onDataDelete(index) - }) - } - - notifyDataMove(from: number, to: number): void { - this.listeners.forEach(listener => { - listener.onDataMove(from, to) - }) - } -} - -export default class MediaDataSource extends BasicDataSource { - private dataArray: mediaLibrary.FileAsset[] = [] - - constructor(data: mediaLibrary.FileAsset[]) { - super() - this.dataArray = data - } - - public totalCount(): number { - return this.dataArray.length - } - - public getData(index: number): mediaLibrary.FileAsset { - return this.dataArray[index] - } - - public addData(index: number, data: mediaLibrary.FileAsset): void { - this.dataArray.splice(index, 0, data) - this.notifyDataAdd(index) - } - - public pushData(data: mediaLibrary.FileAsset): void { - this.dataArray.push(data) - this.notifyDataAdd(this.dataArray.length - 1) - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/ets/common/DeviceDialog.ets b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/ets/common/DeviceDialog.ets deleted file mode 100644 index d026c9fa..00000000 --- a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/ets/common/DeviceDialog.ets +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -import Logger from '../model/Logger'; -import deviceManager from '@ohos.distributedHardware.deviceManager'; - -const TAG: string = 'DeviceDialog'; - -@CustomDialog -export struct DeviceDialog { - controller?: CustomDialogController - @StorageLink('deviceLists') deviceLists: Array = AppStorage.Get('deviceLists')!; - private selectedIndex: number = 0 - private selectedIndexChange: (selectedIndex: number) => void = () => { - } - cancel: () => void = () => { - } - - build() { - Column() { - Text($r('app.string.choiceDevice')) - .fontSize('32px') - .width('434px') - .fontColor(Color.Black) - .textAlign(TextAlign.Start) - .fontWeight(600) - List() { - ForEach(this.deviceLists, (item: deviceManager.DeviceInfo, index: number | undefined) => { - ListItem() { - Flex({ - direction: FlexDirection.Row, - justifyContent: FlexAlign.SpaceBetween, - alignItems: ItemAlign.Center - }) { - Text(item.deviceName) - .fontSize(18) - .width('86%') - .fontColor(Color.Black) - .textAlign(TextAlign.Start) - Radio({ value: '', group: 'radioGroup' }) - .width('7%') - .checked(index === this.selectedIndex ? true : false) - .onChange(() => { - Logger.info(TAG, `select device: ${item.deviceId}`) - if (index === this.selectedIndex) { - Logger.info(TAG, 'index === this.selectedIndex') - return - } - this.selectedIndex = index !== undefined ? index : 0 - if (this.controller !== undefined) { - this.controller.close() - } - this.selectedIndexChange(this.selectedIndex) - }) - } - .height(55) - } - .width('100%') - .height(80) - }, (item: deviceManager.DeviceInfo) => item.deviceName) - } - .height('36%') - .width('100%') - - Button() { - Text($r('app.string.cancel')) - .width('90%') - .fontSize(21) - .fontColor('#ff0d64fb') - .textAlign(TextAlign.Center) - } - .margin({ bottom: 16 }) - .type(ButtonType.Capsule) - .backgroundColor(Color.White) - .onClick(() => { - if (this.controller !== undefined) { - this.controller.close() - this.cancel() - } - }) - } - .margin({ bottom: 36 }) - .width('500px') - .padding(10) - .backgroundColor(Color.White) - .border({ color: Color.White, radius: 20 }) - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/ets/common/ScreenshotDialog.ets b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/ets/common/ScreenshotDialog.ets deleted file mode 100644 index c6343666..00000000 --- a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/ets/common/ScreenshotDialog.ets +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -const SCALE: number = 0.5; // 缩放比例 - -@CustomDialog -export struct ScreenshotDialog { - screenshotController: CustomDialogController - @Link screenshotUrl: PixelMap - - build() { - Column() { - Image(this.screenshotUrl) - } - .borderRadius(10) - .padding(20) - .backgroundColor(Color.White) - .scale({ x: SCALE, y: SCALE }) - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/ets/common/TitleBar.ets b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/ets/common/TitleBar.ets deleted file mode 100644 index cbae2135..00000000 --- a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/ets/common/TitleBar.ets +++ /dev/null @@ -1,238 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -import router from '@ohos.router'; -import screenshot from '@ohos.screenshot'; -import promptAction from '@ohos.promptAction'; -import deviceManager from '@ohos.distributedHardware.deviceManager'; -import common from '@ohos.app.ability.common'; -import { BusinessError } from '@ohos.base'; -import Logger from '../model/Logger'; -import MediaUtils from '../utils/MediaUtils'; -import { DeviceDialog } from '../common/DeviceDialog'; -import { RemoteDeviceModel } from '../model/RemoteDeviceModel'; -import { ScreenshotDialog } from '../common/ScreenshotDialog'; -import { GlobalThis } from '../utils/globalThis'; - -const TAG = 'TitleBar'; -const DATA_CHANGE = 'dataChange'; -const EXIT = 'exit'; -const ONE_THOUSAND: number = 1000; - -@Component -export struct TitleBar { - @Prop title: string - @Prop isLand: boolean - @State selectedIndex: number = 0 - @StorageLink('deviceLists') deviceLists: Array = [] - @State screenshotUrl: PixelMap | null = null - private startAbilityCallBack: (key: string) => void = () => { - } - private remoteDeviceModel: RemoteDeviceModel = new RemoteDeviceModel() - private dialogController: CustomDialogController | null = null - private mediaUtil: MediaUtils = new MediaUtils() - screenshotDialogController: CustomDialogController = new CustomDialogController({ - builder: ScreenshotDialog({ screenshotUrl: $screenshotUrl }), - autoCancel: true, - customStyle: true, - offset: { dx: -100, dy: 100 } - }) - - aboutToAppear() { - AppStorage.SetOrCreate('deviceLists', this.deviceLists) - } - - clearSelectState() { - this.deviceLists = [] - if (this.dialogController) { - this.dialogController.close() - } - } - - selectDevice() { - Logger.info(TAG, `start ability device:${JSON.stringify(this.deviceLists[this.selectedIndex])}`) - if (this.remoteDeviceModel === null || this.remoteDeviceModel.discoverLists.length <= 0 || this.remoteDeviceModel.deviceLists.includes(this.deviceLists[this.selectedIndex])) { - this.startAbility(this.deviceLists[this.selectedIndex].deviceId) - this.clearSelectState() - return - } - Logger.info(TAG, 'start ability, needAuth') - this.remoteDeviceModel.authenticateDevice(this.deviceLists[this.selectedIndex], (device: deviceManager.DeviceInfo) => { - Logger.info(TAG, 'auth and online finished' + JSON.stringify(device)) - this.startAbility(device.deviceId) - }) - Logger.info(TAG, 'start ability2 ......') - this.clearSelectState() - } - - selectedIndexChange = (index: number) => { - Logger.info(TAG, 'selectedIndexChange') - this.selectedIndex = index - if (this.selectedIndex === 0) { - Logger.info(TAG, 'stop ability') - this.startAbilityCallBack(EXIT) - GlobalThis.getInstance().setObject("isDistributed", false) - if (this.dialogController !== null) { - this.dialogController.close() - } - this.deviceLists = [] - return - } - this.selectDevice() - } - - /** - * 启动远程设备 - * @param deviceId - */ - async startAbility(deviceId: string | undefined) { - Logger.info(TAG, `startAbility deviceId: ${deviceId}`) - let context = GlobalThis.getInstance().getObject("context") as common.UIAbilityContext - await context.startAbility({ - bundleName: 'com.unionman.distributedvideoplayer', - abilityName: 'EntryAbility', - deviceId: deviceId, - parameters: { - isStage: 'Stage', - deviceID: "remote" - } - }).then((data) => { - Logger.info(TAG, `start ability finished: ${JSON.stringify(data)}`) - promptAction.showToast({ message: "流转成功" }) - GlobalThis.getInstance().setObject("isDistributed", true) - // 等待对端KvStore启动再同步数据 - setTimeout(() => { - this.startAbilityCallBack(DATA_CHANGE) - }, 2000) - }).catch((err: BusinessError) => { - Logger.error(TAG, `start ability err: ${JSON.stringify(err)}`); - }); - } - - showDialog() { - // 注册监听回调,发现设备或查找到已认证设备会弹窗显示 - this.remoteDeviceModel.registerDeviceListCallback(() => { - Logger.info(TAG, 'registerDeviceListCallback, callback entered') - this.deviceLists = [] - this.deviceLists.push({ - deviceId: '0', - deviceName: '本机(结束协同)', - deviceType: deviceManager.DeviceType.UNKNOWN_TYPE, - networkId: '', - range: ONE_THOUSAND, - authForm: -1 - }) - let deviceTempList = this.remoteDeviceModel.deviceLists.concat(this.remoteDeviceModel.discoverLists) - Logger.info(TAG, `this.remoteDeviceModel.deviceTempList.length${deviceTempList.length}`) - for (let i = 0; i < deviceTempList.length; i++) { - Logger.info(TAG, `device ${i}/${deviceTempList.length} deviceId= ${deviceTempList[i].deviceId}, deviceName= ${deviceTempList[i].deviceName}, deviceType= ${deviceTempList[i].deviceType}`) - this.deviceLists.push(deviceTempList[i]) - AppStorage.Set('deviceLists', this.deviceLists) - Logger.info(TAG, 'deviceLists push end') - } - Logger.info(TAG, 'CustomDialogController start') - if (this.dialogController !== null) { - this.dialogController.close() - } - this.dialogController = new CustomDialogController({ - builder: DeviceDialog({ - cancel: () => { - this.clearSelectState() - }, - selectedIndex: this.selectedIndex, - selectedIndexChange: this.selectedIndexChange - }), - cancel: () => { - this.clearSelectState() - }, - autoCancel: true, - customStyle: true, - alignment: this.isLand ? DialogAlignment.Center : DialogAlignment.Bottom - }) - this.dialogController.open() - Logger.info(TAG, 'CustomDialogController end') - }) - } - - build() { - Row() { - Image($r("app.media.ic_back")) - .id("back") - .height('60%') - .margin({ right: 4 }) - .width(this.isLand ? '6%' : '8%') - .objectFit(ImageFit.Contain) - .onClick(() => { - let context = GlobalThis.getInstance().getObject("context") as common.UIAbilityContext - context.terminateSelf() - }) - - Text(this.title) - .fontColor(Color.White) - .fontSize(22) - .maxLines(1) - - Blank() - - Image($r("app.media.ic_controlcenter_screenshot_filled")) - .id("screenshot") - .height('60%') - .margin({ right: 8 }) - .width(this.isLand ? '6%' : '8%') - .objectFit(ImageFit.Contain) - .onClick(() => { - let screenshotOptions: screenshot.ScreenshotOptions = {}; - screenshot.save(screenshotOptions).then((pixelMap: PixelMap) => { - this.screenshotUrl = pixelMap - this.mediaUtil.savePicture(pixelMap) - this.screenshotDialogController.open() - }).catch((err: BusinessError) => { - Logger.error('Failed to save screenshot: ' + JSON.stringify(err)); - }); - }) - - Image($r("app.media.ic_hop")) - .id("hop") - .height('60%') - .width(this.isLand ? '6%' : '8%') - .margin({ right: 8 }) - .objectFit(ImageFit.Contain) - .onClick(() => { - this.showDialog() - }) - - Image($r("app.media.ic_settings")) - .id("settings") - .height('60%') - .width(this.isLand ? '6%' : '8%') - .objectFit(ImageFit.Contain) - .onClick(() => { - router.pushUrl({ - url: 'pages/Settings' - }) - }) - } - .width('100%') - .height(this.isLand ? '10%' : '8%') - .constraintSize({ minHeight: 50 }) - .alignItems(VerticalAlign.Center) - .padding({ left: 10, right: 10 }) - .linearGradient({ - direction: GradientDirection.Bottom, - colors: [['#CC000000', 0.0], ['#33000000', 0.66], ['#00000000', 0.99]] - }) - } -} diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/ets/entryability/EntryAbility.ts b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/ets/entryability/EntryAbility.ts deleted file mode 100644 index ad71218e..00000000 --- a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/ets/entryability/EntryAbility.ts +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -import AbilityConstant from '@ohos.app.ability.AbilityConstant'; -import hilog from '@ohos.hilog'; -import UIAbility from '@ohos.app.ability.UIAbility'; -import Want from '@ohos.app.ability.Want'; -import window from '@ohos.window'; -import abilityAccessCtrl from '@ohos.abilityAccessCtrl'; -import { GlobalThis } from '../utils/globalThis'; - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); - if (want.parameters !== undefined) { - AppStorage.setOrCreate('isStage', want.parameters.isStage) - AppStorage.setOrCreate('deviceID', want.parameters.deviceID) - } - GlobalThis.getInstance().setObject("context", this.context) - } - - onDestroy(): void { - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - let AtManager = abilityAccessCtrl.createAtManager(); - AtManager.requestPermissionsFromUser(this.context, ["ohos.permission.DISTRIBUTED_DATASYNC", "ohos.permission.READ_MEDIA", "ohos.permission.WRITE_MEDIA"]) - windowStage.getMainWindowSync().setWindowSystemBarEnable([]) - - windowStage.loadContent('pages/Index', (err, data) => { - if (err.code) { - hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); - return; - } - hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); - } -} diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/ets/model/DistributedDataModel.ts b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/ets/model/DistributedDataModel.ts deleted file mode 100644 index 9fd38d32..00000000 --- a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/ets/model/DistributedDataModel.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -export default class DistributedDataModel { - public title: string - public currentTime: number - public SpeedIndex: number - public isPlay: boolean - public firstHop: boolean - - constructor(title, currentTime, SpeedIndex, isPlay, firstHop) { - this.title = title - this.currentTime = currentTime - this.SpeedIndex = SpeedIndex - this.isPlay = isPlay - this.firstHop = firstHop - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/ets/model/KvStoreModel.ts b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/ets/model/KvStoreModel.ts deleted file mode 100644 index fbc12c1d..00000000 --- a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/ets/model/KvStoreModel.ts +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -import Logger from './Logger'; -import distributedKVStore from '@ohos.data.distributedKVStore'; - -const TAG = 'KvStoreModel'; -const STORE_ID = 'distributedvideoplayer'; - -export class KvStoreModel { - private kvManager: distributedKVStore.KVManager = undefined; - private kvStore: distributedKVStore.SingleKVStore = undefined; - - constructor() { - } - - async createKvStore(callback) { - if ((typeof (this.kvStore) !== 'undefined')) { - callback() - return - } - let kvManagerConfig = { - bundleName: 'com.unionman.distributedvideoplayer', - context: globalThis.context - } - Logger.info(TAG, 'createKVManager begin') - this.kvManager = distributedKVStore.createKVManager(kvManagerConfig) - Logger.info(TAG, `createKVManager success, kvManager`) - - let options = { - createIfMissing: true, // 当数据库文件不存在时创建数据库 - encrypt: false, // 设置数据库文件不加密 - backup: false, // 设置数据库文件不备份 - autoSync: true, // 设置数据库文件自动同步 - kvStoreType: distributedKVStore.KVStoreType.SINGLE_VERSION, // 设置要创建的数据库类型为表示单版本数据库 - securityLevel: distributedKVStore.SecurityLevel.S1, // 设置数据库安全级别为低级别 - } - Logger.info(TAG, 'kvManager.getKVStore begin') - // 通过指定Options和storeId,创建并获取KVStore数据库 - this.kvStore = await this.kvManager.getKVStore(STORE_ID, options) - Logger.info(TAG, `getKVStore success, kvStore=${JSON.stringify(this.kvStore)}`) - callback() - Logger.info(TAG, 'kvManager.getKVStore end') - Logger.info(TAG, 'createKVManager end') - } - - put(key, value) { - Logger.info(TAG, `kvStore.put ${key}=${value}`) - try { - this.kvStore.put(key, value).then((data) => { - Logger.info(TAG, `kvStore.put ${key} finished, data= ${data}`) - }).catch((err) => { - Logger.error(TAG, `kvStore.put ${key} failed ${err}`) - }) - } catch (e) { - Logger.error(TAG, `An unexpected error occurred.code is ${e.code},message is ${e.message}`); - } - } - - setOnMessageReceivedListener(msg, callback) { - Logger.info(TAG, `setOnMessageReceivedListener ${msg}`) - this.createKvStore(() => { - Logger.info(TAG, 'kvStore.on(dataChange) begin') - this.kvStore.on('dataChange', distributedKVStore.SubscribeType.SUBSCRIBE_TYPE_REMOTE, (data) => { - Logger.info(TAG, `dataChange, ${JSON.stringify(data)}`) - Logger.info(TAG, `dataChange, insert ${data.insertEntries.length},udpate ${data.updateEntries.length}`) - let entries = data.insertEntries.length > 0 ? data.insertEntries : data.updateEntries - for (let i = 0; i < entries.length; i++) { - if (entries[i].key === msg) { - let value = entries[i].value.value - Logger.info(TAG, `Entries receive${msg} = ${value}`) - callback(value) - return; - } - } - }); - Logger.info(TAG, 'kvStore.on(dataChange) end') - }) - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/ets/model/Logger.ts b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/ets/model/Logger.ts deleted file mode 100644 index cba6989a..00000000 --- a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/ets/model/Logger.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -import hilog from '@ohos.hilog' - -class Logger { - private domain: number = 0xFF00 - private prefix: string = '' - private format: string = "%{public}s, %{public}s" - - constructor(prefix: string) { - this.prefix = prefix - this.domain = 0xFF00 - } - - debug(...args: any[]) { - hilog.debug(this.domain, this.prefix, this.format, args) - } - - info(...args: any[]) { - hilog.info(this.domain, this.prefix, this.format, args) - } - - warn(...args: any[]) { - hilog.warn(this.domain, this.prefix, this.format, args) - } - - error(...args: any[]) { - hilog.error(this.domain, this.prefix, this.format, args) - } -} - -export default new Logger('[DistributedVideoPlayer]') \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/ets/model/RemoteDeviceModel.ts b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/ets/model/RemoteDeviceModel.ts deleted file mode 100644 index 5150a726..00000000 --- a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/ets/model/RemoteDeviceModel.ts +++ /dev/null @@ -1,242 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -import Logger from './Logger'; -import promptAction from '@ohos.promptAction'; -import deviceManager from '@ohos.distributedHardware.deviceManager'; - -const TAG = 'RemoteDeviceModel'; -const RANDOM: number = 65536; -let SUBSCRIBE_ID = 100; - -export class RemoteDeviceModel { - public deviceLists: Array = [] - public discoverLists: Array = [] - private callback: () => void = null - private authCallback: (device: deviceManager.DeviceInfo) => void = null - private deviceManager: deviceManager.DeviceManager = undefined - - constructor() { - } - - registerDeviceListCallback(callback) { - if (typeof (this.deviceManager) !== 'undefined') { - this.registerDeviceListCallbackImplement(callback) - return - } - Logger.info(TAG, 'deviceManager.createDeviceManager begin') - try { - deviceManager.createDeviceManager("com.unionman.distributedvideoplayer", (error, value) => { - if (error) { - Logger.error(TAG, `createDeviceManager failed.${error}`) - return - } - this.deviceManager = value - this.registerDeviceListCallbackImplement(callback) - Logger.info(TAG, `createDeviceManager callback returned, error= ${error} value= ${JSON.stringify(value)}`) - }) - } catch (error) { - Logger.error(TAG, `createDeviceManager throw error, code=${error.code} message=${error.message}`) - } - Logger.info(TAG, 'deviceManager.createDeviceManager end') - } - - deviceStateChangeActionOffline(device) { - if (this.deviceLists.length <= 0) { - this.callback() - return - } - for (let j = 0; j < this.deviceLists.length; j++) { - if (this.deviceLists[j].deviceId === device.deviceId) { - this.deviceLists[j] = device - break - } - } - Logger.info(TAG, `offline, device list= ${JSON.stringify(this.deviceLists)}`) - this.callback() - } - - changeStateOnline(device) { - this.deviceLists[this.deviceLists.length] = device - Logger.debug(TAG, `online, device list= ${JSON.stringify(this.deviceLists)}`) - this.callback() - } - - registerDeviceListCallbackImplement(callback) { - Logger.info(TAG, 'registerDeviceListCallback') - this.callback = callback - if (this.deviceManager === undefined) { - Logger.error(TAG, 'deviceManager has not initialized') - this.callback() - return - } - Logger.info(TAG, 'getTrustedDeviceListSync begin') - try { - let list = this.deviceManager.getTrustedDeviceListSync() - Logger.info(TAG, `getTrustedDeviceListSync end, deviceList= ${JSON.stringify(list)}`) - if (typeof (list) != 'undefined' && typeof (list.length) != 'undefined') { - this.deviceLists = list - } - } catch (error) { - Logger.error(TAG, `getTrustedDeviceListSync throw error, code=${error.code} message=${error.message}`) - } - - this.callback() - Logger.info(TAG, `callback finished devices = ${JSON.stringify(this.deviceLists)}`) - try { - this.deviceManager.on('deviceStateChange', (data) => { - if (data === null) { - return - } - Logger.info(TAG, `deviceStateChange data= ${JSON.stringify(data)}`) - switch (data.action) { - case deviceManager.DeviceStateChangeAction.ONLINE: - this.changeStateOnline(data.device) - break; - case deviceManager.DeviceStateChangeAction.READY: - this.discoverLists = [] - this.deviceLists.push(data.device) - this.callback() - try { - let list = this.deviceManager.getTrustedDeviceListSync() - if (typeof (list) !== 'undefined' && typeof (list.length) !== 'undefined') { - this.deviceLists = list - } - } catch (error) { - Logger.error(TAG, `getTrustedDeviceListSync throw error, code=${error.code} message=${error.message}`) - } - this.callback() - break; - case deviceManager.DeviceStateChangeAction.OFFLINE: - case deviceManager.DeviceStateChangeAction.CHANGE: - this.deviceStateChangeActionOffline(data.device) - try { - let list = this.deviceManager.getTrustedDeviceListSync() - if (typeof (list) !== 'undefined' && typeof (list.length) !== 'undefined') { - this.deviceLists = list - } - } catch (error) { - Logger.error(TAG, `getTrustedDeviceListSync throw error, code=${error.code} message=${error.message}`) - } - this.callback() - break - default: - break - } - }) - this.deviceManager.on('deviceFound', (data) => { - if (data === null) { - return - } - Logger.info(TAG, `deviceFound data=${JSON.stringify(data)}`) - this.deviceFound(data) - }) - this.deviceManager.on('discoverFail', (data) => { - Logger.info(TAG, `discoverFail data= ${JSON.stringify(data)}`) - }) - this.deviceManager.on('serviceDie', () => { - Logger.error(TAG, 'serviceDie') - }) - } catch (error) { - Logger.error(TAG, `on throw error, code=${error.code} message=${error.message}`) - } - this.startDeviceDiscovery() - } - - deviceFound(data) { - for (var i = 0;i < this.discoverLists.length; i++) { - if (this.discoverLists[i].deviceId === data.device.deviceId) { - Logger.info(TAG, 'device founded ignored') - return - } - } - this.discoverLists[this.discoverLists.length] = data.device - Logger.info(TAG, `deviceFound self.discoverList= ${JSON.stringify(this.discoverLists)}`) - this.callback() - } - - /** - * 通过SUBSCRIBE_ID搜索分布式组网内的设备 - */ - startDeviceDiscovery() { - // 生成发现标识,随机数确保每次调用发现接口的标识不一致,且SUBSCRIBE_ID在0到65536之间 - SUBSCRIBE_ID = Math.floor(RANDOM * Math.random()) - let info = { - subscribeId: SUBSCRIBE_ID, // 发现标识,用于标识不同的发现周期 - mode: 0xAA, // 主动模式 - medium: 2, // WiFi发现类型 - freq: 2, // 高频率 - isSameAccount: false, // 是否同账号 - isWakeRemote: true, // 是否唤醒设备 - capability: 0 // DDMP能力 - } - Logger.info(TAG, `startDeviceDiscovery ${SUBSCRIBE_ID}`) - // 当有设备发现时,通过deviceFound回调通知给应用程序 - try { - this.deviceManager.startDeviceDiscovery(info) - } catch (error) { - Logger.error(TAG, `startDeviceDiscovery throw error, code=${error.code} message=${error.message}`) - } - } - - authenticateDevice(device, callBack) { - Logger.info(TAG, `authenticateDevice ${JSON.stringify(device)}`) - for (let i = 0; i < this.discoverLists.length; i++) { - if (this.discoverLists[i].deviceId !== device.deviceId) { - continue - } - let extraInfo = { - 'targetPkgName': 'com.unionman.distributedvideoplayer', - 'appName': 'Distributed VideoPlayer', - 'appDescription': 'Distributed VideoPlayer', - 'business': '0' - } - let authParam = { - 'authType': 1, //认证类型: 1 - 无账号PIN码认证 - 'appIcon': '', - 'appThumbnail': '', - 'extraInfo': extraInfo - } - try { - this.deviceManager.authenticateDevice(device, authParam, (err, data) => { - if (err) { - Logger.error(TAG, `authenticateDevice error: ${JSON.stringify(err)}`) - this.authCallback = null - return - } - Logger.info(TAG, `authenticateDevice succeed: ${JSON.stringify(data)}`) - this.authCallback = callBack - if (this.authCallback !== null) { - this.authCallback(device) - this.authCallback = null - } - }) - } catch (error) { - Logger.error(TAG, `authenticateDevice throw error, code=${error.code} message=${error.message}`) - } - } - } - - unAuthenticateDevice(device) { - try { - this.deviceManager.unAuthenticateDevice(device); - promptAction.showToast({ message: '解除中,请稍后...', duration: 3000 }) - } catch (err) { - Logger.error(TAG, "unAuthenticateDevice errCode:" + err.code + ",errMessage:" + err.message); - } - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/ets/pages/Index.ets b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 45e8a9bc..00000000 --- a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,546 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -import mediaLibrary from '@ohos.multimedia.mediaLibrary'; -import mediaQuery from '@ohos.mediaquery'; -import preferences from '@ohos.data.preferences'; -import common from '@ohos.app.ability.common'; -import { BusinessError } from '@ohos.base'; -import MediaDataSource from '../common/BasicDataSource'; -import { TitleBar } from '../common/TitleBar'; -import { toTime } from '../utils/utils'; -import { RemoteDeviceModel } from '../model/RemoteDeviceModel'; -import { KvStoreModel } from '../model/KvStoreModel'; -import Logger from '../model/Logger'; -import MediaUtils from '../utils/MediaUtils'; -import AVPlayerUtils from '../utils/AVPlayerUtils'; -import DistributedDataModel from '../model/DistributedDataModel'; -import { GlobalThis } from '../utils/globalThis'; - -const TAG: string = "Index"; -const EXIT: string = 'exit'; -const DATA_CHANGE: string = 'dataChange'; -const PlaybackSpeed: string[] = ['0.75X', '1.0X', '1.25X', '1.75X', '2.0X']; -const PREFERENCES_NAME = 'setting'; -let preferenceSetting: preferences.Preferences | null = null; - -@Component -struct localVideoItem { - private media: mediaLibrary.FileAsset = {} as mediaLibrary.FileAsset - @State pixelMap: PixelMap | null = null - @Link videoIndex: number - @State index: number = 0 - event: (event?: ClickEvent) => void = () => { - } - - async aboutToAppear() { - let size: mediaLibrary.Size = { width: 128, height: 80 } - this.pixelMap = await this.media.getThumbnail(size) - } - - build() { - Row({ space: 10 }) { - Image(this.pixelMap) - .height(80) - .aspectRatio(1.6) - .objectFit(ImageFit.Cover) - .borderRadius(10) - Text(this.media.displayName.replace('.mp4', '')) - .width(172) - .fontSize(14) - .fontColor(this.videoIndex === this.index ? '#E5007DFF' : '#FFFFFF') - } - .width(330) - .height(100) - .padding(10) - .borderRadius(20) - .backgroundColor('#464646') - .alignItems(VerticalAlign.Center) - .onClick(this.event) - } -} - -@Entry -@Component -struct Index { - @State tabsIndex: number = 0 - @State @Watch('resetVideo') videoIndex: number = 0 - @State @Watch('initVideo') title: string = '' - @State @Watch('setSpeed') SpeedIndex: number = 1 - @State @Watch('dataChange') isPlay: boolean = false - // 是否显示控制栏 - @State @Watch('showControlBarEvent') controls: number = Visibility.Visible; - // 是否显示侧边栏 - @State showSideBar: boolean = false - @State showPlaybackProgress: boolean = false - @State currentTime: number = 0 - @State duration: number = 0 - @State kvStoreModel: KvStoreModel = new KvStoreModel() - @State ratio: number = 1.0 - // 是否横屏 - @State isLand: boolean = false - // 是否正在加载 - @State isLoading: boolean = true; - // 流转模式 - @StorageLink('continuationMode') continuationMode: preferences.ValueType = 'continuation' - // 控制栏定时器id - private controlBarTimeoutID: number = -1 - private tabsController: TabsController = new TabsController() - private remoteDeviceModel: RemoteDeviceModel = new RemoteDeviceModel() - private mediaDataSource: MediaDataSource = new MediaDataSource([]) - private mediaUtil: MediaUtils = new MediaUtils() - private mediaList: Array = [] - private mXComponentController: XComponentController = new XComponentController() - private surfaceId: string = '' - private avPlayer: AVPlayerUtils = new AVPlayerUtils() - private fileAsset: mediaLibrary.FileAsset = {} as mediaLibrary.FileAsset - private fd: number = -1 - private listener = mediaQuery.matchMediaSync('screen and (min-aspect-ratio: 1.5) or (orientation: landscape)') - onLand = (mediaQueryResult: mediaQuery.MediaQueryResult) => { - Logger.info(TAG, `onLand: mediaQueryResult.matches= ${mediaQueryResult.matches}`) - if (mediaQueryResult.matches) { - this.isLand = true - } else { - this.isLand = false - } - } - startX: number = 0 - startY: number = 0 - moveX: number = 0 - moveY: number = 0 - - @Builder - TabBuilder(index: number, text: string) { - Column() { - Text(text) - .fontColor(Color.White) - .fontSize(24) - .fontFamily('HarmonyHeiTi') - - Divider() - .width('75%') - .strokeWidth(5) - .color('#007Dff') - .opacity(this.tabsIndex === index ? 1 : 0) - } - } - - async aboutToAppear() { - this.getVideos() - // 订阅DATA_CHANGE类型的数据变更通知 - this.kvStoreModel.setOnMessageReceivedListener(DATA_CHANGE, (value: string) => { - Logger.info(TAG, `DATA_CHANGE ${value}`) - if (GlobalThis.getInstance().getObject("isDistributed")) { - if (value.search(EXIT) !== -1) { - Logger.info(TAG, `EXIT ${EXIT}`) - let context = GlobalThis.getInstance().getObject("context") as common.UIAbilityContext - context.terminateSelf((error: BusinessError) => { - Logger.error(TAG, `terminateSelf finished, error= ${error}`) - }); - } else { - let video: DistributedDataModel = JSON.parse(value) - GlobalThis.getInstance().setObject("dataChange", true) - GlobalThis.getInstance().setObject("firstHop", video.firstHop) - this.title = video.title - this.currentTime = video.currentTime - if (!video.firstHop) { - this.setCurrentTime() - } - this.SpeedIndex = video.SpeedIndex - this.isPlay = video.isPlay - Logger.info(TAG, `title:${this.title},currentTime:${this.currentTime},SpeedIndex:${this.SpeedIndex},isPlay:${this.isPlay},firstHop:${GlobalThis.getInstance() - .getObject("firstHop")}`) - GlobalThis.getInstance().setObject("dataChange", false) - } - } - }) - if (AppStorage.Get('isStage') === 'Stage') { - GlobalThis.getInstance().setObject("isDistributed", true) - } - GlobalThis.getInstance().setObject("deviceID", AppStorage.Get('deviceID')) - this.listener.on('change', this.onLand) - let context = GlobalThis.getInstance().getObject("context") as common.UIAbilityContext - preferenceSetting = await preferences.getPreferences(context, PREFERENCES_NAME) - this.continuationMode = await preferenceSetting.get('continuationMode', 'continuation') - } - - startAbilityCallBack = (key: string) => { - Logger.info(TAG, `startAbilityCallBack ${key}`) - if (DATA_CHANGE === key) { - GlobalThis.getInstance().setObject("deviceID", "local") - GlobalThis.getInstance().setObject("firstHop", true) - let video = new DistributedDataModel(this.title, this.currentTime, this.SpeedIndex, this.isPlay, true) - this.isPlay = false - this.kvStoreModel.put(DATA_CHANGE, JSON.stringify(video)) - if (this.continuationMode == 'continuation') { - let context = GlobalThis.getInstance().getObject("context") as common.UIAbilityContext - context.terminateSelf() - } - } - if (EXIT === key) { - this.kvStoreModel.put(DATA_CHANGE, EXIT) - } - } - - async getVideos() { - let fileList = await this.mediaUtil.getFileAssetsFromType(mediaLibrary.MediaType.VIDEO) - Logger.info(TAG, 'getVideos fileList:' + JSON.stringify(fileList)) - this.mediaList = fileList - for (let i = 0; i < fileList.length; i++) { - this.mediaDataSource.pushData(fileList[i]) - } - Logger.info(TAG, 'getVideos mediaList:' + JSON.stringify(this.mediaList)) - Logger.info(TAG, 'getVideos mediaDataSource:' + JSON.stringify(this.mediaDataSource)) - this.mediaDataSource.notifyDataReload() - if (!GlobalThis.getInstance().getObject("isDistributed")) { - this.title = this.mediaList[this.videoIndex].displayName.replace('.mp4', '') - } - } - - dataChange() { - Logger.info(TAG, `dataChange, title = ${this.title}, currentTime = ${this.currentTime}, SpeedIndex = ${this.SpeedIndex}, isPlay = ${this.isPlay}`) - if (this.isPlay) { - this.playVideo() - } else { - this.avPlayer.pause() - this.controls = Visibility.Visible - clearTimeout(this.controlBarTimeoutID) - } - this.controls = Visibility.Visible - this.distributedDataSync() - } - - distributedDataSync() { - if (GlobalThis.getInstance().getObject("isDistributed") && !GlobalThis.getInstance() - .getObject("firstHop") && !GlobalThis.getInstance().getObject("dataChange")) { - let video = new DistributedDataModel(this.title, this.currentTime, this.SpeedIndex, this.isPlay, false) - this.kvStoreModel.put(DATA_CHANGE, JSON.stringify(video)) - } - } - - showControlBarEvent() { - if (this.controls == Visibility.Visible) { - this.controlBarTimeoutID = setTimeout(() => { - this.controls = Visibility.Hidden - }, 5000) - } - } - - async initVideo() { - Logger.info(TAG, 'initVideo') - try { - this.mediaList.forEach((file, index) => { - if (file.displayName.replace('.mp4', '') === this.title) { - this.fileAsset = file - this.videoIndex = index - } - }) - let fdPath = await this.prepareVideo() - await this.avPlayer.initVideoPlayer(fdPath, this.surfaceId) - if (GlobalThis.getInstance().getObject("firstHop") && GlobalThis.getInstance().getObject("isDistributed")) { - this.setCurrentTime() - } - if (GlobalThis.getInstance().getObject("firstHop") && GlobalThis.getInstance() - .getObject("deviceID") === "remote") { - this.dataChange() - GlobalThis.getInstance().setObject("firstHop", false) - let video = new DistributedDataModel(this.title, this.currentTime, this.SpeedIndex, this.isPlay, false) - this.kvStoreModel.put(DATA_CHANGE, JSON.stringify(video)) - } - } catch (error) { - Logger.info(TAG, `initVideo error ${JSON.stringify(error)}`) - } - } - - async prepareVideo() { - Logger.info(TAG, 'prepareVideo') - this.fd = await this.fileAsset.open('Rw') - this.ratio = this.fileAsset.width / this.fileAsset.height - this.mXComponentController.setXComponentSurfaceSize({ - surfaceWidth: this.fileAsset.width, - surfaceHeight: this.fileAsset.height - }) - this.surfaceId = this.mXComponentController.getXComponentSurfaceId() - this.isLoading = false - this.duration = this.fileAsset.duration / 1000 - return 'fd://' + this.fd - } - - async resetVideo() { - Logger.info(TAG, 'resetVideo') - if (GlobalThis.getInstance().getObject("firstHop")) { - return - } - this.SpeedIndex = 1 - this.currentTime = 0 - this.isLoading = true - await this.fileAsset.close(this.fd) - this.fileAsset = this.mediaList[this.videoIndex] - this.title = this.fileAsset.displayName.replace('.mp4', '') - this.isPlay = false - this.distributedDataSync() - let fdPath = await this.prepareVideo() - await this.avPlayer.reset(fdPath) - } - - async playVideo() { - Logger.info(TAG, 'playVideo') - if (GlobalThis.getInstance().getObject("firstHop")) { - return - } - this.avPlayer.setTimeUpdateCallBackCallBack((time: number) => { - this.currentTime = time / 1000 - }) - this.avPlayer.play() - this.isPlay = true - this.showControlBarEvent() - } - - aboutToDisappear() { - this.clearVideoPlayer() - } - - clearVideoPlayer() { - Logger.info(TAG, 'clearVideoPlayer') - if (this.avPlayer) { - this.avPlayer.stop() - this.avPlayer.release() - } - if (this.fileAsset) { - this.fileAsset.close(this.fd) - } - } - - setCurrentTime() { - Logger.info(TAG, 'setCurrentTime') - this.avPlayer.seek(this.currentTime) - this.isLoading = false - this.distributedDataSync() - } - - setSpeed() { - Logger.info(TAG, 'setSpeed') - this.avPlayer.setSpeed(this.SpeedIndex) - this.distributedDataSync() - } - - build() { - SideBarContainer(SideBarContainerType.Overlay) { - Tabs({ controller: this.tabsController }) { - TabContent() { - Scroll() { - Column({ space: 10 }) { - LazyForEach(this.mediaDataSource, (item: mediaLibrary.FileAsset, index: number) => { - localVideoItem({ media: item, videoIndex: $videoIndex, index: index, event: () => { - this.videoIndex = index - this.title = item.displayName.replace('.mp4', '') - } }) - }) - } - .constraintSize({ minHeight: '100%' }) - } - .edgeEffect(EdgeEffect.Spring) - .padding(10) - }.tabBar(this.TabBuilder(0, '本地视频')) - } - .backgroundColor('#7F000000') - .vertical(false) - .scrollable(false) - - Stack() { - XComponent({ - id: 'xComponent', - type: 'surface', - controller: this.mXComponentController - }) - .width('100%') - .aspectRatio(this.ratio) - - // 控制栏 - Column() { - TitleBar({ - title: this.title, - isLand: this.isLand, - startAbilityCallBack: this.startAbilityCallBack, - remoteDeviceModel: this.remoteDeviceModel, - }) - - Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.SpaceEvenly, alignItems: ItemAlign.Center }) { - Image(this.isPlay ? $r("app.media.ic_pause") : $r("app.media.ic_play")) - .id("playBtn") - .width(36) - .height(36) - .flexShrink(0) - .margin({ right: 10 }) - .onClick(() => { - this.isPlay = !this.isPlay - }) - Text(toTime(this.currentTime)) - .flexShrink(0) - .fontColor(Color.White) - .maxLines(1) - .textOverflow({ overflow: TextOverflow.None }) - Slider({ - value: this.currentTime, - min: 0, - max: this.duration, - step: 1, - }) - .id("slider") - .blockColor(Color.White) - .trackColor(Color.Gray) - .selectedColor(Color.White) - .onChange((value: number, mode: SliderChangeMode) => { - this.currentTime = value - this.setCurrentTime() - }) - Text(toTime(this.duration)) - .flexShrink(0) - .fontColor(Color.White) - .maxLines(1) - .textOverflow({ overflow: TextOverflow.None }) - Select([{ value: PlaybackSpeed[0] }, - { value: PlaybackSpeed[1] }, - { value: PlaybackSpeed[2] }, - { value: PlaybackSpeed[3] }, - { value: PlaybackSpeed[4] }]) - .id("playbackSpeed") - .flexShrink(0) - .backgroundColor('#00000000') - .margin({ left: 10, right: 10 }) - .selected(this.SpeedIndex) - .value(PlaybackSpeed[this.SpeedIndex]) - .font({ size: 24 }) - .fontColor("#E5007DFF") - .selectedOptionFont({ size: 16 }) - .selectedOptionFontColor("#E5007DFF") - .optionFont({ size: 16 }) - .optionFontColor("#7F007DFF") - .onSelect((index: number, value: string) => { - Logger.info(TAG, `index ${index}`) - this.SpeedIndex = index - }) - - Image($r("app.media.ic_public_view_list")) - .id("viewList") - .width(36) - .aspectRatio(1) - .flexShrink(0) - .margin({ right: 10 }) - .onClick(() => { - this.showSideBar = !this.showSideBar - }) - } - .width('100%') - .padding({ left: 10, right: 10 }) - .linearGradient({ - direction: GradientDirection.Top, - colors: [['#CC000000', 0.0], ['#33000000', 0.66], ['#00000000', 0.99]] - }) - } - .width('100%') - .height('100%') - .justifyContent(FlexAlign.SpaceBetween) - .alignItems(HorizontalAlign.Start) - .visibility(this.controls) - - if (this.showPlaybackProgress) { - Text(toTime(this.currentTime) + '/' + toTime(this.duration)) - .fontColor(Color.White) - .padding(12) - .backgroundColor('#CC000000') - .borderRadius(8) - } - - if (this.isLoading) { - Column() { - LoadingProgress() - .height(96) - .width(96) - .color(Color.Grey) - - Text("正在加载...") - .fontColor(Color.White) - .fontFamily('HarmonyHeiTi') - .fontSize(14) - } - } - } - .id("container") - .width('100%') - .height('100%') - .backgroundColor(Color.Black) - .onClick(() => { - if (!this.showSideBar) { - this.controls = (this.controls === Visibility.Hidden) ? Visibility.Visible : Visibility.Hidden - } else { - this.showSideBar = false - } - }) - .priorityGesture( - GestureGroup(GestureMode.Exclusive, - TapGesture({ count: 2 }) - .onAction(() => { - this.isPlay = !this.isPlay - }), - PanGesture({ direction: PanDirection.Left | PanDirection.Right }) - .onActionStart((event: GestureEvent) => { - Logger.info(TAG, 'PlaybackEvent Pan start') - this.startX = event.offsetX - }) - .onActionUpdate((event: GestureEvent) => { - Logger.info(TAG, 'PlaybackEvent Pan update') - // 右滑 - if (event.offsetX - this.startX > 0) { - this.startX = event.offsetX - this.showPlaybackProgress = true - if (this.currentTime === this.duration) { - return - } else { - this.currentTime += 1 - } - } // 左滑 - else if (event.offsetX - this.startX < 0) { - this.startX = event.offsetX - this.showPlaybackProgress = true - if (this.currentTime === 0) { - return - } else { - this.currentTime -= 1 - } - } - }) - .onActionEnd(() => { - Logger.info(TAG, 'PlaybackEvent Pan end') - this.showPlaybackProgress = false - this.isLoading = true - this.setCurrentTime() - }) - ) - ) - } - .showSideBar(this.showSideBar) - .showControlButton(false) - .sideBarPosition(SideBarPosition.End) - .sideBarWidth(350) - .minSideBarWidth(200) - .maxSideBarWidth(400) - .onChange((value: boolean) => { - Logger.info('status:' + value) - }) - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/ets/pages/Settings.ets b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/ets/pages/Settings.ets deleted file mode 100644 index 1ef41c98..00000000 --- a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/ets/pages/Settings.ets +++ /dev/null @@ -1,164 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -import router from '@ohos.router'; -import common from '@ohos.app.ability.common'; -import preferences from '@ohos.data.preferences'; -import deviceManager from '@ohos.distributedHardware.deviceManager'; -import { RemoteDeviceModel } from '../model/RemoteDeviceModel'; -import Logger from '../model/Logger'; -import { GlobalThis } from '../utils/globalThis'; - -const TAG: string = 'Setting'; -const PREFERENCES_NAME = 'setting'; -let preferenceSetting: preferences.Preferences | null = null; - -@Entry -@Component -struct Setting { - @State deviceLists: Array = []; - @StorageLink('continuationMode') @Watch('continuationModeChange') continuationMode: string = 'continuation'; - private remoteDeviceModel: RemoteDeviceModel = new RemoteDeviceModel(); - - async aboutToAppear() { - let context = GlobalThis.getInstance().getObject("context") as common.UIAbilityContext - preferenceSetting = await preferences.getPreferences(context, PREFERENCES_NAME) - this.remoteDeviceModel.registerDeviceListCallback(() => { - Logger.info(TAG, 'registerDeviceListCallback, callback entered') - this.deviceLists = this.remoteDeviceModel.deviceLists - Logger.info(TAG, `deviceLists.length${this.deviceLists.length}`) - }) - } - - async continuationModeChange() { - preferenceSetting!.put('continuationMode', this.continuationMode) - preferenceSetting!.flush() - } - - build() { - Column() { - Row() { - Image($r("app.media.ic_back")) - .id("settings_back") - .width('8%') - .height('50%') - .margin({ right: 4 }) - .objectFit(ImageFit.Contain) - .onClick(() => { - router.back() - }) - - Text('设置') - .fontColor(Color.White) - .fontFamily('HarmonyHeiTi') - .fontSize(20) - .maxLines(1) - } - .width('100%') - .height('8%') - .constraintSize({ minHeight: 50 }) - .padding({ left: 10, right: 10 }) - - Row({ space: 10 }) { - Text('流转模式') - .fontColor(Color.White) - .fontFamily('HarmonyHeiTi') - .fontSize(20) - - Blank() - - Radio({ value: 'continuation', group: 'continuationMode' }) - .id("continuation") - .checked(this.continuationMode == 'continuation' ? true : false) - .height(25) - .width(25) - .onChange((isChecked: boolean) => { - if (isChecked) { - this.continuationMode = 'continuation' - } - }) - - Text('跨端迁移') - .fontColor(Color.White) - .fontFamily('HarmonyHeiTi') - .fontSize(20) - - Radio({ value: 'synchronization', group: 'continuationMode' }) - .id("synchronization") - .checked(this.continuationMode == 'synchronization' ? true : false) - .height(25) - .width(25) - .onChange((isChecked: boolean) => { - if (isChecked) { - this.continuationMode = 'synchronization' - } - }) - - Text('多端协同') - .fontColor(Color.White) - .fontFamily('HarmonyHeiTi') - .fontSize(20) - } - .width('100%') - .height(100) - .padding(10) - .borderRadius(20) - .backgroundColor('#464646') - .alignItems(VerticalAlign.Center) - - Row() { - Text('认证设备管理') - .fontSize(16) - .fontColor(Color.White) - } - .width('100%') - .padding(10) - - Scroll() { - Column() { - ForEach(this.deviceLists, (item: deviceManager.DeviceInfo) => { - Row() { - Text(item.deviceName) - .height('100%') - .fontSize(20) - .fontColor(Color.White) - .fontFamily('HarmonyHeiTi') - - Blank() - - Button('解除认证') - .onClick(() => { - this.remoteDeviceModel.unAuthenticateDevice(item) - }) - } - .width('100%') - .height(80) - .padding(10) - .borderRadius(20) - .backgroundColor('#464646') - .alignItems(VerticalAlign.Center) - }) - } - .constraintSize({ minHeight: '100%' }) - } - } - .width('100%') - .height('100%') - .padding(10) - .backgroundColor('#7F000000') - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/ets/utils/AVPlayerUtils.ts b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/ets/utils/AVPlayerUtils.ts deleted file mode 100644 index c14708c4..00000000 --- a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/ets/utils/AVPlayerUtils.ts +++ /dev/null @@ -1,163 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -import media from '@ohos.multimedia.media'; -import Logger from '../model/Logger'; - -const TAG: string = 'AVPlayerUtils'; - -export default class AVPlayerUtils { - private avPlayer: media.AVPlayer = undefined - private avPlayerState: string = '' - private playPath: string = '' - private surfaceID: string = '' - private timeUpdateCallBack: (time: number) => void = undefined - - async initVideoPlayer(playSrc: string, surfaceID: string) { - await this.release() - this.playPath = playSrc - this.surfaceID = surfaceID - // 创建avPlayer实例对象 - this.avPlayer = await media.createAVPlayer() - Logger.info(TAG, 'createVideoPlayer') - // 创建状态机变化回调函数 - this.setAVPlayerCallback(); - this.avPlayer.url = this.playPath - Logger.info(TAG, 'this.avPlayer.url' + this.avPlayer.url) - this.avPlayer.on('timeUpdate', (time: number) => { - Logger.info(TAG, 'timeUpdate success,and new time is :' + time) - if (this.timeUpdateCallBack) { - this.timeUpdateCallBack(time) - } - }); - Logger.info(TAG, 'init VideoPlayer finish') - } - - // 注册avplayer回调函数 - setAVPlayerCallback() { - // seek操作结果回调函数 - this.avPlayer.on('seekDone', (seekDoneTime: number) => { - Logger.info(TAG, `AVPlayer seek succeeded, seek time is ${seekDoneTime}`); - }) - // error回调监听函数,当avPlayer在操作过程中出现错误时调用 reset接口触发重置流程 - this.avPlayer.on('error', err => { - Logger.error(TAG, `Invoke avPlayer failed, code is ${err.code}, message is ${err.message}`); - this.avPlayer.reset(); // 调用reset重置资源,触发idle状态 - }) - // 状态机变化回调函数 - this.avPlayer.on('stateChange', async (state: string, reason: media.StateChangeReason) => { - switch (state) { - case 'idle': // 成功调用reset接口后触发该状态机上报 - Logger.info(TAG, 'AVPlayer state idle called.'); - this.avPlayerState = 'idle'; - this.avPlayer.release(); // 调用release接口销毁实例对象 - break; - case 'initialized': // avplayer 设置播放源后触发该状态上报 - Logger.info(TAG, 'AVPlayer state initialized called.'); - this.avPlayerState = 'initialized'; - this.avPlayer.surfaceId = this.surfaceID; - Logger.info(TAG, 'setDisplaySurface'); - this.avPlayer.prepare(); - break; - case 'prepared': // prepare调用成功后上报该状态机 - Logger.info(TAG, 'AVPlayer state prepared called.'); - this.avPlayerState = 'prepared'; - break; - case 'playing': // play成功调用后触发该状态机上报 - Logger.info(TAG, 'AVPlayer state playing called.'); - this.avPlayerState = 'playing'; - break; - case 'paused': // pause成功调用后触发该状态机上报 - Logger.info(TAG, 'AVPlayer state paused called.'); - this.avPlayerState = 'paused'; - break; - case 'completed': // 播放结束后触发该状态机上报 - Logger.info(TAG, 'AVPlayer state completed called.'); - this.avPlayerState = 'completed'; - break; - case 'stopped': // stop接口成功调用后触发该状态机上报 - Logger.info(TAG, 'AVPlayer state stopped called.'); - this.avPlayerState = 'stopped'; - break; - case 'released': - Logger.info(TAG, 'AVPlayer state released called.'); - this.avPlayerState = 'released'; - break; - default: - Logger.info(TAG, 'AVPlayer state unknown called.'); - break; - } - }) - } - - async play() { - Logger.info(TAG, 'play') - if (typeof (this.avPlayer) != 'undefined') { - await this.avPlayer.play() - } - } - - async seek(time: number) { - Logger.info(TAG, 'seek') - if (typeof (this.avPlayer) != 'undefined' && - (this.avPlayerState === 'prepared' || this.avPlayerState === 'playing' || this.avPlayerState === 'paused' || this.avPlayerState === 'completed')) { - this.avPlayer.seek(time * 1000) - } - } - - async setSpeed(speed: media.PlaybackSpeed) { - Logger.info(TAG, 'setSpeed') - if (typeof (this.avPlayer) != 'undefined') { - this.avPlayer.setSpeed(speed) - } - } - - async pause() { - Logger.info(TAG, 'pause') - if (typeof (this.avPlayer) != 'undefined') { - await this.avPlayer.pause() - } - } - - async stop() { - Logger.info(TAG, 'stop') - if (typeof (this.avPlayer) != 'undefined') { - await this.avPlayer.stop() - } - } - - async reset(playSrc: string) { - Logger.info(TAG, 'reset') - if (typeof (this.avPlayer) != 'undefined') { - this.playPath = playSrc - await this.avPlayer.reset() - this.avPlayer.url = this.playPath - await this.avPlayer.prepare() - } - } - - async release() { - Logger.info(TAG, 'release') - if (typeof (this.avPlayer) != 'undefined') { - await this.avPlayer.release() - Logger.info(TAG, 'release success') - } - } - - setTimeUpdateCallBackCallBack(callback) { - this.timeUpdateCallBack = callback - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/ets/utils/DateTimeUtil.ts b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/ets/utils/DateTimeUtil.ts deleted file mode 100644 index 0836cd6c..00000000 --- a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/ets/utils/DateTimeUtil.ts +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -/** - * @file 日期工具 - */ -export default class DateTimeUtil { - - /** - * 时分秒 - */ - getTime() { - const DATETIME = new Date() - return this.concatTime(DATETIME.getHours(), DATETIME.getMinutes(), DATETIME.getSeconds()) - } - - /** - * 年月日 - */ - getDate() { - const DATETIME = new Date() - return this.concatDate(DATETIME.getFullYear(), DATETIME.getMonth() + 1, DATETIME.getDate()) - } - - /** - * 日期不足两位补充0 - * @param value-数据值 - */ - fill(value: number) { - return (value > 9 ? '' : '0') + value - } - - /** - * 年月日格式修饰 - * @param year - * @param month - * @param date - */ - concatDate(year: number, month: number, date: number) { - return `${year}${this.fill(month)}${this.fill(date)}` - } - - /** - * 时分秒格式修饰 - * @param hours - * @param minutes - * @param seconds - */ - concatTime(hours: number, minutes: number, seconds: number) { - return `${this.fill(hours)}${this.fill(minutes)}${this.fill(seconds)}` - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/ets/utils/MediaUtils.ts b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/ets/utils/MediaUtils.ts deleted file mode 100644 index 68fecea4..00000000 --- a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/ets/utils/MediaUtils.ts +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -import image from '@ohos.multimedia.image'; -import fileio from '@ohos.fileio'; -import common from '@ohos.app.ability.common'; -import promptAction from '@ohos.promptAction'; -import mediaLibrary from '@ohos.multimedia.mediaLibrary'; -import Logger from '../model/Logger'; -import DateTimeUtil from './DateTimeUtil'; -import { GlobalThis } from './globalThis'; - -const TAG: string = 'MediaUtils'; -let context = GlobalThis.getInstance().getObject("context") as common.UIAbilityContext; - -export default class MediaUtils { - private mediaList: Array = [] - private mediaLib: mediaLibrary.MediaLibrary = undefined - - constructor() { - this.mediaLib = mediaLibrary.getMediaLibrary(context) - } - - async createAndGetFile() { - let mediaTest = mediaLibrary.getMediaLibrary(context) - let info = { - prefix: 'IMG_', suffix: '.jpg', directory: mediaLibrary.DirectoryType.DIR_IMAGE - } - let dateTimeUtil = new DateTimeUtil() - let name = `${dateTimeUtil.getDate()}_${dateTimeUtil.getTime()}` - let displayName = `${info.prefix}${name}${info.suffix}` - let publicPath = await mediaTest.getPublicDirectory(info.directory) - Logger.info(TAG, `publicPath = ${publicPath}`) - return await mediaTest.createAsset(mediaLibrary.MediaType.IMAGE, displayName, publicPath) - } - - async savePicture(data) { - Logger.info(TAG, `savePicture`) - let packOpts: image.PackingOption = { - format: "image/jpeg", quality: 100 - } - let imagePackerApi = image.createImagePacker() - let arrayBuffer = await imagePackerApi.packing(data, packOpts) - let fileAsset = await this.createAndGetFile() - let fd = await fileAsset.open('Rw') - imagePackerApi.release() - try { - await fileio.write(fd, arrayBuffer) - } catch (err) { - Logger.error(`write failed, code is ${err.code}, message is ${err.message}`) - } - await fileAsset.close(fd) - Logger.info(TAG, `write done`) - promptAction.showToast({ - message: '图片保存成功', duration: 1000 - }) - } - - async getFileAssetsFromType(mediaType: number) { - Logger.info(TAG, `getFileAssetsFromType,mediaType = ${mediaType}`) - let fileKeyObj = mediaLibrary.FileKey - let fetchOp = { - selections: `${fileKeyObj.MEDIA_TYPE}=?`, - selectionArgs: [`${mediaType}`], - } - let fetchFileResult = await this.mediaLib.getFileAssets(fetchOp) - Logger.info(TAG, `getFileAssetsFromType,fetchFileResult.count = ${fetchFileResult.getCount()}`) - if (fetchFileResult.getCount() > 0) { - this.mediaList = await fetchFileResult.getAllObject() - Logger.info(TAG, `getFileAssetsFromType,fetchFileResult.count = ${JSON.stringify(this.mediaList)}`) - } - return this.mediaList - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/ets/utils/globalThis.ts b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/ets/utils/globalThis.ts deleted file mode 100644 index 8921b40d..00000000 --- a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/ets/utils/globalThis.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -export class GlobalThis { - private constructor() { - } - - private static instance: GlobalThis; - private context = new Map(); - - public static getInstance(): GlobalThis { - if (!GlobalThis.instance) { - GlobalThis.instance = new GlobalThis(); - } - return GlobalThis.instance; - } - - getObject(key: string): Object | undefined { - return this.context.get(key); - } - - setObject(key: string, objectClass: Object): void { - this.context.set(key, objectClass); - } -} diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/ets/utils/utils.ts b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/ets/utils/utils.ts deleted file mode 100644 index 5eb254a6..00000000 --- a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/ets/utils/utils.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -export function toTime(Number: number): string { - let hour: number - let minute: number - let second: number - hour = Number / 3600 | 0 - minute = Number / 60 % 60 | 0 - second = Number % 60 | 0 - if (hour > 0) { - return (hour < 10 ? '0' + hour : hour.toString()) + ":" + (minute < 10 ? '0' + minute : minute.toString()) + ":" + (second < 10 ? '0' + second : second.toString()) - } else { - return (minute < 10 ? '0' + minute : minute.toString()) + ":" + (second < 10 ? '0' + second : second.toString()) - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/module.json5 b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/module.json5 deleted file mode 100644 index a3078d16..00000000 --- a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/module.json5 +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -{ - "module": { - "name": "entry", - "type": "entry", - "description": "$string:module_desc", - "mainElement": "EntryAbility", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false, - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "EntryAbility", - "srcEntry": "./ets/entryability/EntryAbility.ts", - "description": "$string:EntryAbility_desc", - "icon": "$media:icon", - "label": "$string:EntryAbility_label", - "startWindowIcon": "$media:startIcon", - "startWindowBackground": "$color:start_window_background", - "exported": true, - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ] - } - ], - "requestPermissions": [ - { - "name": "ohos.permission.DISTRIBUTED_DATASYNC", - "reason": "$string:distributed_permission", - "usedScene": { - "abilities": [ - "EntryAbility" - ], - "when": "inuse" - } - }, - { - "name": "ohos.permission.CAPTURE_SCREEN" - }, - { - "name": "ohos.permission.READ_MEDIA", - "reason": "$string:media_reason", - "usedScene": { - "abilities": [ - "EntryAbility" - ], - "when": "inuse" - } - }, - { - "name": "ohos.permission.WRITE_MEDIA", - "reason": "$string:media_reason", - "usedScene": { - "abilities": [ - "EntryAbility" - ], - "when": "inuse" - } - } - ] - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/resources/base/element/color.json b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962..00000000 --- a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/resources/base/element/string.json b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 948c841e..00000000 --- a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "DistributedVideoPlayer" - }, - { - "name": "choiceDevice", - "value": "choiceDevice" - }, - { - "name": "cancel", - "value": "cancel" - }, - { - "name": "distributed_permission", - "value": "Allow data exchange between different devices" - }, - { - "name": "media_reason", - "value": "Allows applications to read media files from external storage" - } - ] -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/resources/base/media/ic_back.png b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/resources/base/media/ic_back.png deleted file mode 100644 index 650fa22d..00000000 Binary files a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/resources/base/media/ic_back.png and /dev/null differ diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/resources/base/media/ic_controlcenter_screenshot_filled.png b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/resources/base/media/ic_controlcenter_screenshot_filled.png deleted file mode 100644 index 854cdfec..00000000 Binary files a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/resources/base/media/ic_controlcenter_screenshot_filled.png and /dev/null differ diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/resources/base/media/ic_hop.png b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/resources/base/media/ic_hop.png deleted file mode 100644 index c5517e48..00000000 Binary files a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/resources/base/media/ic_hop.png and /dev/null differ diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/resources/base/media/ic_pause.png b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/resources/base/media/ic_pause.png deleted file mode 100644 index b2b1e3fc..00000000 Binary files a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/resources/base/media/ic_pause.png and /dev/null differ diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/resources/base/media/ic_play.png b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/resources/base/media/ic_play.png deleted file mode 100644 index 40280c25..00000000 Binary files a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/resources/base/media/ic_play.png and /dev/null differ diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/resources/base/media/ic_public_view_list.png b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/resources/base/media/ic_public_view_list.png deleted file mode 100644 index 39646fda..00000000 Binary files a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/resources/base/media/ic_public_view_list.png and /dev/null differ diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/resources/base/media/ic_settings.png b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/resources/base/media/ic_settings.png deleted file mode 100644 index 9813d442..00000000 Binary files a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/resources/base/media/ic_settings.png and /dev/null differ diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/resources/base/media/icon.png b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index c394496f..00000000 Binary files a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/resources/base/media/startIcon.png b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 366f7645..00000000 Binary files a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/resources/base/profile/main_pages.json b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index cd55405b..00000000 --- a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "src": [ - "pages/Index", - "pages/Settings" - ] -} diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/resources/en_US/element/string.json b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/resources/en_US/element/string.json deleted file mode 100644 index 948c841e..00000000 --- a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/resources/en_US/element/string.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "DistributedVideoPlayer" - }, - { - "name": "choiceDevice", - "value": "choiceDevice" - }, - { - "name": "cancel", - "value": "cancel" - }, - { - "name": "distributed_permission", - "value": "Allow data exchange between different devices" - }, - { - "name": "media_reason", - "value": "Allows applications to read media files from external storage" - } - ] -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/resources/zh_CN/element/string.json b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/resources/zh_CN/element/string.json deleted file mode 100644 index 937e3eb2..00000000 --- a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/main/resources/zh_CN/element/string.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "模块描述" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "分布式视频播放器" - }, - { - "name": "choiceDevice", - "value": "选择设备" - }, - { - "name": "cancel", - "value": "取消" - }, - { - "name": "distributed_permission", - "value": "用于分布式视频播放器进行不同设备间的数据交换" - }, - { - "name": "media_reason", - "value": "用于分布式视频播放器访问用户媒体文件中的地理位置信息" - } - ] -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/ohosTest/ets/test/Ability.test.ets b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index 52757407..00000000 --- a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,398 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' -import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; -import { Driver, ON } from '@ohos.UiTest'; -import resourceManager from '@ohos.resourceManager'; -import Logger from '../../../main/ets/model/Logger'; - -const BUNDLE = 'DistributedVideoPlayer_'; - -const DELAY_TIME = 1000; -const DELAY_TIME_FiVE = 500; -let driver: Driver = Driver.create(); - -// 获取AbilityDelegator -let abilityDelegatorRegistry = AbilityDelegatorRegistry.getAbilityDelegator(); -// 启动后获取app上下文 -let context: Context; -// 启动后获取resourceManager -let manager: resourceManager.ResourceManager; - -// 通过 resource 验证有没有这个组件 有的话点击一下 -async function checkButtonAndClickWithTextByResource(text: Resource) { - let atom: string = await manager.getStringValue(text); - await driver.assertComponentExist(ON.text(atom)); - let button = await driver.findComponent(ON.text(atom)); - await button.click(); - await driver.delayMs(DELAY_TIME_FiVE); - Logger.info(BUNDLE + atom); -} - -// 通过 ID 滑动 slider -async function drawSliderWithId(text: string) { - let atom = text; - await driver.assertComponentExist(ON.id(atom)); - let slider = await driver.findComponent(ON.id(atom)); - let rect = await slider.getBoundsCenter(); - await driver.drag(rect.x - 100, rect.y, rect.x + 100, rect.y, 800) - await driver.delayMs(DELAY_TIME_FiVE); - Logger.info(BUNDLE + atom); -} - -// 通过text验证有没有这个组件 有的话点击一下 -async function checkButtonAndClickWithText(text: string) { - let atom = text; - await driver.assertComponentExist(ON.text(atom)); - let button = await driver.findComponent(ON.text(atom)); - await button.click(); - await driver.delayMs(DELAY_TIME); - Logger.info(BUNDLE + atom); -} - -// 通过id验证有没有这个组件 有的话点击一下 -async function checkButtonAndClickWithID(text: string) { - let atom = text; - await driver.assertComponentExist(ON.id(atom)); - let button = await driver.findComponent(ON.id(atom)); - await button.click(); - await driver.delayMs(DELAY_TIME_FiVE); - Logger.info(BUNDLE + atom); -} - -// 通过id验证有没有这个组件 有的话点击一下 -async function checkButtonAndDoubleClickWithID(text: string) { - let atom = text; - await driver.assertComponentExist(ON.id(atom)); - let button = await driver.findComponent(ON.id(atom)); - await button.doubleClick(); - await driver.delayMs(DELAY_TIME_FiVE); - Logger.info(BUNDLE + atom); -} - -// 展开Select并选择 -async function clickSelectIDAndSelectText(toggleId: string, selectText: string) { - { //展开 - let atom = toggleId; - await checkButtonAndClickWithID(atom); - } - { //选择 - let atom = selectText; - await checkButtonAndClickWithText(atom); - } -} - -export default function abilityTest() { - describe('ActsAbilityTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }) - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }) - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }) - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }) - it("assertContain", 0, () => { - - Logger.info("Sample_DistributedVideoPlayer test start") - /** - * 打开应用 - */ - it(BUNDLE + 'StartAbility_001', 0, async (done: Function) => { - let testName = 'StartAbility'; - Logger.info(BUNDLE + testName + ' begin'); - let abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - try { - await abilityDelegator.startAbility({ - bundleName: 'com.unionman.distributedvideoplayer', - abilityName: 'EntryAbility' - }) - - context = abilityDelegatorRegistry.getAppContext(); - manager = context.resourceManager; - - done(); - } catch (exception) { - Logger.info(BUNDLE, `StartAbility_001 end ${JSON.stringify(exception)}`); - expect(0).assertEqual(exception.code); - done(); - } - Logger.info(BUNDLE + testName + ' end'); - }) - - /** - * 获取权限 - */ - it(BUNDLE + 'RequestPermissionFunction_001', 0, async () => { - let testName = 'RequestPermissionFunction'; - Logger.info(BUNDLE + testName + ' begin'); - await driver.delayMs(DELAY_TIME); - - // 获取多设备协同权限 - await checkButtonAndClickWithTextByResource($r('app.string.permit')); - // 获取文件读写权限 - await checkButtonAndClickWithTextByResource($r('app.string.permit')); - Logger.info(BUNDLE + testName + ' end'); - }) - - /** - * 关闭应用 - */ - it(BUNDLE + 'StopAbility_001', 0, async (done: Function) => { - let testName = 'StopAbility'; - Logger.info(BUNDLE + testName + ' begin'); - try { - await checkButtonAndClickWithID("back"); - await driver.delayMs(DELAY_TIME); - - done(); - } catch (exception) { - Logger.info(BUNDLE, `StopAbility_001 end ${JSON.stringify(exception)}`); - expect(0).assertEqual(exception.code); - done(); - } - Logger.info(BUNDLE + testName + ' end'); - }) - - /** - * 打开应用 - */ - it(BUNDLE + 'StartAbility_002', 0, async (done: Function) => { - let testName = 'StartAbility'; - Logger.info(BUNDLE + testName + ' begin'); - let abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - try { - await abilityDelegator.startAbility({ - bundleName: 'com.unionman.distributedvideoplayer', - abilityName: 'EntryAbility' - }) - - done(); - } catch (exception) { - Logger.info(BUNDLE, `StartAbility_002 end ${JSON.stringify(exception)}`); - expect(0).assertEqual(exception.code); - done(); - } - Logger.info(BUNDLE + testName + ' end'); - }) - - /** - * 单击播放按钮 - */ - it(BUNDLE + 'PlayVideo_001', 0, async () => { - let testName = 'PlayVideo'; - Logger.info(BUNDLE + testName + ' begin'); - await driver.delayMs(DELAY_TIME); - - // 播放 - await checkButtonAndClickWithID('playBtn'); - await driver.delayMs(DELAY_TIME); - - // 暂停 - await checkButtonAndClickWithID('playBtn'); - await driver.delayMs(DELAY_TIME); - - Logger.info(BUNDLE + testName + ' end'); - }); - - /** - * 双击页面 - */ - it(BUNDLE + 'PlayVideo_002', 0, async () => { - let testName = 'PlayVideo'; - Logger.info(BUNDLE + testName + ' begin'); - - // 播放 - await checkButtonAndDoubleClickWithID('container'); - await driver.delayMs(DELAY_TIME); - - // 暂停 - await checkButtonAndDoubleClickWithID('container'); - await driver.delayMs(DELAY_TIME); - - // 播放 - await checkButtonAndDoubleClickWithID('container'); - await driver.delayMs(DELAY_TIME); - - Logger.info(BUNDLE + testName + ' end'); - }); - - /** - * 滑动Slider进度条 - */ - it(BUNDLE + 'Slider_001', 0, async () => { - let testName = 'Slider'; - Logger.info(BUNDLE + testName + ' begin'); - - await drawSliderWithId("slider"); - await driver.delayMs(DELAY_TIME); - - Logger.info(BUNDLE + testName + ' end'); - }); - - /** - * 左右滑动屏幕 - */ - it(BUNDLE + 'Swipe_001', 0, async () => { - let testName = 'Swipe'; - Logger.info(BUNDLE + testName + ' begin'); - - // 左滑 - await driver.swipe(500, 200, 200, 200, 600); - await driver.delayMs(DELAY_TIME); - - // 右滑 - await driver.swipe(200, 200, 500, 200, 600); - await driver.delayMs(DELAY_TIME); - - Logger.info(BUNDLE + testName + ' end'); - }); - - /** - * 调整倍速 - */ - it(BUNDLE + 'PlaybackSpeed_001', 0, async () => { - let testName = 'PlaybackSpeed'; - Logger.info(BUNDLE + testName + ' begin'); - - // 单击屏幕显示控制栏 - await checkButtonAndClickWithID('container'); - await driver.delayMs(DELAY_TIME); - - // 选择2.0X倍速 - await clickSelectIDAndSelectText('playbackSpeed', '2.0X'); - await driver.delayMs(DELAY_TIME); - - // 单击屏幕显示控制栏 - await checkButtonAndClickWithID('container'); - - // 选择0.75X倍速 - await clickSelectIDAndSelectText('playbackSpeed', '0.75X'); - await driver.delayMs(DELAY_TIME); - - Logger.info(BUNDLE + testName + ' end'); - }); - - /** - * 展开视频列表 - */ - it(BUNDLE + 'ShwoVideoList_001', 0, async () => { - let testName = 'ShwoVideoList'; - Logger.info(BUNDLE + testName + ' begin'); - await driver.delayMs(DELAY_TIME); - - // 单击屏幕显示控制栏 - await checkButtonAndClickWithID('container'); - await driver.delayMs(DELAY_TIME); - - // 点击展开视频列表 - await checkButtonAndClickWithID("viewList"); - await driver.delayMs(DELAY_TIME); - - // 单击隐藏视频列表 固定坐标只支持UnionPi-Tiger,其他设备需要调整 - await driver.click(200, 200); - await driver.delayMs(DELAY_TIME); - - Logger.info(BUNDLE + testName + ' end'); - }); - - /** - * 截图 - */ - it(BUNDLE + 'Screenshot_001', 0, async () => { - let testName = 'Screenshot'; - Logger.info(BUNDLE + testName + ' begin'); - await driver.delayMs(DELAY_TIME); - - // 单击屏幕显示控制栏 - await checkButtonAndClickWithID('container'); - await driver.delayMs(DELAY_TIME); - - // 单击截图图标 - await checkButtonAndClickWithID('screenshot'); - await driver.delayMs(DELAY_TIME); - - // 单击隐藏截图窗口 固定坐标只支持UnionPi-Tiger,其他设备需要调整 - await driver.click(800, 200); - await driver.delayMs(DELAY_TIME); - - Logger.info(BUNDLE + testName + ' end'); - }); - - /** - * 测试选择设备弹窗是否能正常弹出 - */ - it(BUNDLE + 'ShwoDeviceDialog_001', 0, async () => { - let testName = 'ShwoDeviceDialog'; - Logger.info(BUNDLE + testName + ' begin'); - await driver.delayMs(DELAY_TIME); - - // 单击屏幕显示控制栏 - await checkButtonAndClickWithID('container'); - await driver.delayMs(DELAY_TIME); - - // 单击流转图标 - await checkButtonAndClickWithID('hop'); - await driver.delayMs(DELAY_TIME); - - // 点击取消 - await checkButtonAndClickWithTextByResource($r('app.string.cancel')); - await driver.delayMs(DELAY_TIME); - - Logger.info(BUNDLE + testName + ' end'); - }); - - /** - * 设置流转模式 - */ - it(BUNDLE + 'SetContinuationMode_001', 0, async () => { - let testName = 'SetContinuationMode'; - Logger.info(BUNDLE + testName + ' begin'); - await driver.delayMs(DELAY_TIME); - - // 单击屏幕显示控制栏 - await checkButtonAndClickWithID('container'); - await driver.delayMs(DELAY_TIME); - - // 单击设置图标 - await checkButtonAndClickWithID('settings'); - await driver.delayMs(DELAY_TIME); - - // 选择多端协同模式 - await checkButtonAndClickWithID('synchronization'); - await driver.delayMs(DELAY_TIME); - - // 返回 - await checkButtonAndClickWithID('settings_back'); - await driver.delayMs(DELAY_TIME); - - Logger.info(BUNDLE + testName + ' end'); - }); - }) - }) -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/ohosTest/ets/test/List.test.ets b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 44c7dfcf..00000000 --- a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -import abilityTest from './Ability.test'; - -export default function testsuite() { - abilityTest(); -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/ohosTest/ets/testability/TestAbility.ets b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/ohosTest/ets/testability/TestAbility.ets deleted file mode 100644 index e5ed3ab3..00000000 --- a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/ohosTest/ets/testability/TestAbility.ets +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -import UIAbility from '@ohos.app.ability.UIAbility'; -import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; -import hilog from '@ohos.hilog'; -import { Hypium } from '@ohos/hypium'; -import testsuite from '../test/List.test'; -import window from '@ohos.window'; -import Want from '@ohos.app.ability.Want'; -import AbilityConstant from '@ohos.app.ability.AbilityConstant'; - -export default class TestAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam) { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onCreate'); - hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? ''); - hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:' + JSON.stringify(launchParam) ?? ''); - let abilityDelegator: AbilityDelegatorRegistry.AbilityDelegator; - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); - let abilityDelegatorArguments: AbilityDelegatorRegistry.AbilityDelegatorArgs; - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments(); - hilog.info(0x0000, 'testTag', '%{public}s', 'start run testcase!!!'); - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite); - } - - onDestroy() { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage) { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageCreate'); - windowStage.loadContent('testability/pages/Index', (err, data) => { - if (err.code) { - hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); - return; - } - hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', - JSON.stringify(data) ?? ''); - }); - } - - onWindowStageDestroy() { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageDestroy'); - } - - onForeground() { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onForeground'); - } - - onBackground() { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onBackground'); - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/ohosTest/ets/testability/pages/Index.ets b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/ohosTest/ets/testability/pages/Index.ets deleted file mode 100644 index cf2336f8..00000000 --- a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/ohosTest/ets/testability/pages/Index.ets +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -@Entry -@Component -struct Index { - @State message: string = 'Hello World'; - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ets b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ets deleted file mode 100644 index de10aac3..00000000 --- a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ets +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -import hilog from '@ohos.hilog'; -import TestRunner from '@ohos.application.testRunner'; -import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; -import Want from '@ohos.app.ability.Want'; - -let abilityDelegator: AbilityDelegatorRegistry.AbilityDelegator | undefined = undefined -let abilityDelegatorArguments: AbilityDelegatorRegistry.AbilityDelegatorArgs | undefined = undefined - -async function onAbilityCreateCallback() { - hilog.info(0x0000, 'testTag', '%{public}s', 'onAbilityCreateCallback'); -} - -async function addAbilityMonitorCallback(err : Error) { - hilog.info(0x0000, 'testTag', 'addAbilityMonitorCallback : %{public}s', JSON.stringify(err) ?? ''); -} - -export default class OpenHarmonyTestRunner implements TestRunner { - constructor() { - } - - onPrepare() { - hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner OnPrepare '); - } - - async onRun() { - hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun run'); - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - const bundleName = abilityDelegatorArguments.bundleName; - const testAbilityName = 'TestAbility'; - let lMonitor: AbilityDelegatorRegistry.AbilityMonitor = { - abilityName: testAbilityName, - onAbilityCreate: onAbilityCreateCallback, - }; - abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) - const want: Want = { - bundleName: bundleName, - abilityName: testAbilityName - }; - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); - abilityDelegator.startAbility(want, (err, data) => { - hilog.info(0x0000, 'testTag', 'startAbility : err : %{public}s', JSON.stringify(err) ?? ''); - hilog.info(0x0000, 'testTag', 'startAbility : data : %{public}s',JSON.stringify(data) ?? ''); - }) - hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun end'); - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/ohosTest/module.json5 b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/ohosTest/module.json5 deleted file mode 100644 index 291306e6..00000000 --- a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -{ - "module": { - "name": "entry_test", - "type": "feature", - "description": "$string:module_test_desc", - "mainElement": "TestAbility", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false, - "pages": "$profile:test_pages", - "abilities": [ - { - "name": "TestAbility", - "srcEntry": "./ets/testability/TestAbility.ets", - "description": "$string:TestAbility_desc", - "icon": "$media:icon", - "label": "$string:TestAbility_label", - "exported": true, - "startWindowIcon": "$media:icon", - "startWindowBackground": "$color:start_window_background", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - } - ] - } - ] - } -} diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/ohosTest/resources/base/element/color.json b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/ohosTest/resources/base/element/color.json deleted file mode 100644 index 3c712962..00000000 --- a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/ohosTest/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/ohosTest/resources/base/element/string.json b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/ohosTest/resources/base/element/string.json deleted file mode 100644 index 1c6c33bc..00000000 --- a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/ohosTest/resources/base/element/string.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "string": [ - { - "name": "module_test_desc", - "value": "test ability description" - }, - { - "name": "TestAbility_desc", - "value": "the test ability" - }, - { - "name": "TestAbility_label", - "value": "test label" - }, - { - "name": "permit", - "value": "permit" - }, - { - "name": "cancel", - "value": "cancel" - } - ] -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/ohosTest/resources/base/media/icon.png b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/ohosTest/resources/base/media/icon.png deleted file mode 100644 index ce307a88..00000000 Binary files a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/ohosTest/resources/base/media/icon.png and /dev/null differ diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/ohosTest/resources/base/profile/test_pages.json b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/ohosTest/resources/base/profile/test_pages.json deleted file mode 100644 index b7e7343c..00000000 --- a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/ohosTest/resources/base/profile/test_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "testability/pages/Index" - ] -} diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/ohosTest/resources/en/element/string.json b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/ohosTest/resources/en/element/string.json deleted file mode 100644 index 1c6c33bc..00000000 --- a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/ohosTest/resources/en/element/string.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "string": [ - { - "name": "module_test_desc", - "value": "test ability description" - }, - { - "name": "TestAbility_desc", - "value": "the test ability" - }, - { - "name": "TestAbility_label", - "value": "test label" - }, - { - "name": "permit", - "value": "permit" - }, - { - "name": "cancel", - "value": "cancel" - } - ] -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/ohosTest/resources/zh/element/string.json b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/ohosTest/resources/zh/element/string.json deleted file mode 100644 index 1757b7ee..00000000 --- a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/ohosTest/resources/zh/element/string.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "string": [ - { - "name": "module_test_desc", - "value": "test ability description" - }, - { - "name": "TestAbility_desc", - "value": "the test ability" - }, - { - "name": "TestAbility_label", - "value": "test label" - }, - { - "name": "permit", - "value": "允许" - }, - { - "name": "cancel", - "value": "取消" - } - ] -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/test/List.test.ets b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/test/List.test.ets deleted file mode 100644 index 9b740fe6..00000000 --- a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/test/List.test.ets +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -import localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/test/LocalUnit.test.ets b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/test/LocalUnit.test.ets deleted file mode 100644 index d811e029..00000000 --- a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest',() => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/hvigor/hvigor-config.json5 b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/hvigor/hvigor-config.json5 deleted file mode 100644 index 1a474900..00000000 --- a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,18 +0,0 @@ -{ - "hvigorVersion": "3.0.9", - "dependencies": { - "@ohos/hvigor-ohos-plugin": "3.0.9" - }, - "execution": { - // "daemon": true, /* Enable daemon compilation. Default: true */ - // "incremental": true, /* Enable incremental compilation. Default: true */ - // "parallel": true, /* Enable parallel compilation. Default: true */ - // "typeCheck": false, /* Enable typeCheck. Default: false */ - }, - "logging": { - // "level": "info" /* Define the log level. Value: [ "debug" | "info" | "warn" | "error" ]. Default: "info" */ - }, - "debugging": { - // "stacktrace": false /* Disable stacktrace compilation. Default: false */ - } -} diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/hvigor/hvigor-wrapper.js b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/hvigor/hvigor-wrapper.js deleted file mode 100644 index 372eae8e..00000000 --- a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/hvigor/hvigor-wrapper.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";var u=require("path"),D=require("os"),e=require("fs"),t=require("crypto"),r=require("child_process"),n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},i={},C={},F=n&&n.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(C,"__esModule",{value:!0}),C.maxPathLength=C.isMac=C.isLinux=C.isWindows=void 0;const E=F(D),A="Windows_NT",o="Darwin";function a(){return E.default.type()===A}function c(){return E.default.type()===o}C.isWindows=a,C.isLinux=function(){return"Linux"===E.default.type()},C.isMac=c,C.maxPathLength=function(){return c()?1016:a()?259:4095},function(e){var t=n&&n.__createBinding||(Object.create?function(u,D,e,t){void 0===t&&(t=e);var r=Object.getOwnPropertyDescriptor(D,e);r&&!("get"in r?!D.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return D[e]}}),Object.defineProperty(u,t,r)}:function(u,D,e,t){void 0===t&&(t=e),u[t]=D[e]}),r=n&&n.__setModuleDefault||(Object.create?function(u,D){Object.defineProperty(u,"default",{enumerable:!0,value:D})}:function(u,D){u.default=D}),i=n&&n.__importStar||function(u){if(u&&u.__esModule)return u;var D={};if(null!=u)for(var e in u)"default"!==e&&Object.prototype.hasOwnProperty.call(u,e)&&t(D,u,e);return r(D,u),D};Object.defineProperty(e,"__esModule",{value:!0}),e.WORK_SPACE=e.HVIGOR_PROJECT_WRAPPER_HOME=e.HVIGOR_PROJECT_ROOT_DIR=e.HVIGOR_PROJECT_CACHES_HOME=e.HVIGOR_PNPM_STORE_PATH=e.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH=e.PROJECT_CACHES=e.HVIGOR_WRAPPER_TOOLS_HOME=e.HVIGOR_USER_HOME=e.DEFAULT_PACKAGE_JSON=e.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME=e.PNPM=e.HVIGOR=e.NPM_TOOL=e.PNPM_TOOL=e.HVIGOR_ENGINE_PACKAGE_NAME=void 0;const F=i(D),E=i(u),A=C;e.HVIGOR_ENGINE_PACKAGE_NAME="@ohos/hvigor",e.PNPM_TOOL=(0,A.isWindows)()?"pnpm.cmd":"pnpm",e.NPM_TOOL=(0,A.isWindows)()?"npm.cmd":"npm",e.HVIGOR="hvigor",e.PNPM="pnpm",e.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME="hvigor-config.json5",e.DEFAULT_PACKAGE_JSON="package.json",e.HVIGOR_USER_HOME=E.resolve(F.homedir(),".hvigor"),e.HVIGOR_WRAPPER_TOOLS_HOME=E.resolve(e.HVIGOR_USER_HOME,"wrapper","tools"),e.PROJECT_CACHES="project_caches",e.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH=E.resolve(e.HVIGOR_WRAPPER_TOOLS_HOME,"node_modules",".bin",e.PNPM_TOOL),e.HVIGOR_PNPM_STORE_PATH=E.resolve(e.HVIGOR_USER_HOME,"caches"),e.HVIGOR_PROJECT_CACHES_HOME=E.resolve(e.HVIGOR_USER_HOME,e.PROJECT_CACHES),e.HVIGOR_PROJECT_ROOT_DIR=process.cwd(),e.HVIGOR_PROJECT_WRAPPER_HOME=E.resolve(e.HVIGOR_PROJECT_ROOT_DIR,e.HVIGOR),e.WORK_SPACE="workspace"}(i);var s={},l={};Object.defineProperty(l,"__esModule",{value:!0}),l.logInfoPrintConsole=l.logErrorAndExit=void 0,l.logErrorAndExit=function(u){u instanceof Error?console.error(u.message):console.error(u),process.exit(-1)},l.logInfoPrintConsole=function(u){console.log(u)};var B=n&&n.__createBinding||(Object.create?function(u,D,e,t){void 0===t&&(t=e);var r=Object.getOwnPropertyDescriptor(D,e);r&&!("get"in r?!D.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return D[e]}}),Object.defineProperty(u,t,r)}:function(u,D,e,t){void 0===t&&(t=e),u[t]=D[e]}),d=n&&n.__setModuleDefault||(Object.create?function(u,D){Object.defineProperty(u,"default",{enumerable:!0,value:D})}:function(u,D){u.default=D}),f=n&&n.__importStar||function(u){if(u&&u.__esModule)return u;var D={};if(null!=u)for(var e in u)"default"!==e&&Object.prototype.hasOwnProperty.call(u,e)&&B(D,u,e);return d(D,u),D};Object.defineProperty(s,"__esModule",{value:!0});var _=s.executeBuild=void 0;const p=f(e),O=f(u),h=l;_=s.executeBuild=function(u){const D=O.resolve(u,"node_modules","@ohos","hvigor","bin","hvigor.js");try{const u=p.realpathSync(D);require(u)}catch(e){(0,h.logErrorAndExit)(`Error: ENOENT: no such file ${D},delete ${u} and retry.`)}};var P={},v={};!function(u){var D=n&&n.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(u,"__esModule",{value:!0}),u.hashFile=u.hash=u.createHash=void 0;const r=D(t),i=D(e);u.createHash=(u="MD5")=>r.default.createHash(u);u.hash=(D,e)=>(0,u.createHash)(e).update(D).digest("hex");u.hashFile=(D,e)=>{if(i.default.existsSync(D))return(0,u.hash)(i.default.readFileSync(D,"utf-8"),e)}}(v);var g={},m={},R={};Object.defineProperty(R,"__esModule",{value:!0}),R.Unicode=void 0;class y{}R.Unicode=y,y.SPACE_SEPARATOR=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,y.ID_START=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,y.ID_CONTINUE=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,Object.defineProperty(m,"__esModule",{value:!0}),m.JudgeUtil=void 0;const I=R;m.JudgeUtil=class{static isIgnoreChar(u){return"string"==typeof u&&("\t"===u||"\v"===u||"\f"===u||" "===u||" "===u||"\ufeff"===u||"\n"===u||"\r"===u||"\u2028"===u||"\u2029"===u)}static isSpaceSeparator(u){return"string"==typeof u&&I.Unicode.SPACE_SEPARATOR.test(u)}static isIdStartChar(u){return"string"==typeof u&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||"$"===u||"_"===u||I.Unicode.ID_START.test(u))}static isIdContinueChar(u){return"string"==typeof u&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||u>="0"&&u<="9"||"$"===u||"_"===u||"‌"===u||"‍"===u||I.Unicode.ID_CONTINUE.test(u))}static isDigitWithoutZero(u){return/[1-9]/.test(u)}static isDigit(u){return"string"==typeof u&&/[0-9]/.test(u)}static isHexDigit(u){return"string"==typeof u&&/[0-9A-Fa-f]/.test(u)}};var N=n&&n.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(g,"__esModule",{value:!0}),g.parseJsonText=g.parseJsonFile=void 0;const b=N(e),S=N(D),w=N(u),H=m;var x;!function(u){u[u.Char=0]="Char",u[u.EOF=1]="EOF",u[u.Identifier=2]="Identifier"}(x||(x={}));let M,T,V,G,j,J,W="start",U=[],L=0,$=1,k=0,K=!1,z="default",q="'",Z=1;function X(u,D=!1){T=String(u),W="start",U=[],L=0,$=1,k=0,G=void 0,K=D;do{M=Q(),nu[W]()}while("eof"!==M.type);return G}function Q(){for(z="default",j="",q="'",Z=1;;){J=Y();const u=Du[z]();if(u)return u}}function Y(){if(T[L])return String.fromCodePoint(T.codePointAt(L))}function uu(){const u=Y();return"\n"===u?($++,k=0):u?k+=u.length:k++,u&&(L+=u.length),u}g.parseJsonFile=function(u,D=!1,e="utf-8"){const t=b.default.readFileSync(w.default.resolve(u),{encoding:e});try{return X(t,D)}catch(D){if(D instanceof SyntaxError){const e=D.message.split("at");if(2===e.length)throw new Error(`${e[0].trim()}${S.default.EOL}\t at ${u}:${e[1].trim()}`)}throw new Error(`${u} is not in valid JSON/JSON5 format.`)}},g.parseJsonText=X;const Du={default(){switch(J){case"/":return uu(),void(z="comment");case void 0:return uu(),eu("eof")}if(!H.JudgeUtil.isIgnoreChar(J)&&!H.JudgeUtil.isSpaceSeparator(J))return Du[W]();uu()},start(){z="value"},beforePropertyName(){switch(J){case"$":case"_":return j=uu(),void(z="identifierName");case"\\":return uu(),void(z="identifierNameStartEscape");case"}":return eu("punctuator",uu());case'"':case"'":return q=J,uu(),void(z="string")}if(H.JudgeUtil.isIdStartChar(J))return j+=uu(),void(z="identifierName");throw Eu(x.Char,uu())},afterPropertyName(){if(":"===J)return eu("punctuator",uu());throw Eu(x.Char,uu())},beforePropertyValue(){z="value"},afterPropertyValue(){switch(J){case",":case"}":return eu("punctuator",uu())}throw Eu(x.Char,uu())},beforeArrayValue(){if("]"===J)return eu("punctuator",uu());z="value"},afterArrayValue(){switch(J){case",":case"]":return eu("punctuator",uu())}throw Eu(x.Char,uu())},end(){throw Eu(x.Char,uu())},comment(){switch(J){case"*":return uu(),void(z="multiLineComment");case"/":return uu(),void(z="singleLineComment")}throw Eu(x.Char,uu())},multiLineComment(){switch(J){case"*":return uu(),void(z="multiLineCommentAsterisk");case void 0:throw Eu(x.Char,uu())}uu()},multiLineCommentAsterisk(){switch(J){case"*":return void uu();case"/":return uu(),void(z="default");case void 0:throw Eu(x.Char,uu())}uu(),z="multiLineComment"},singleLineComment(){switch(J){case"\n":case"\r":case"\u2028":case"\u2029":return uu(),void(z="default");case void 0:return uu(),eu("eof")}uu()},value(){switch(J){case"{":case"[":return eu("punctuator",uu());case"n":return uu(),tu("ull"),eu("null",null);case"t":return uu(),tu("rue"),eu("boolean",!0);case"f":return uu(),tu("alse"),eu("boolean",!1);case"-":case"+":return"-"===uu()&&(Z=-1),void(z="numerical");case".":case"0":case"I":case"N":return void(z="numerical");case'"':case"'":return q=J,uu(),j="",void(z="string")}if(void 0===J||!H.JudgeUtil.isDigitWithoutZero(J))throw Eu(x.Char,uu());z="numerical"},numerical(){switch(J){case".":return j=uu(),void(z="decimalPointLeading");case"0":return j=uu(),void(z="zero");case"I":return uu(),tu("nfinity"),eu("numeric",Z*(1/0));case"N":return uu(),tu("aN"),eu("numeric",NaN)}if(void 0!==J&&H.JudgeUtil.isDigitWithoutZero(J))return j=uu(),void(z="decimalInteger");throw Eu(x.Char,uu())},zero(){switch(J){case".":case"e":case"E":return void(z="decimal");case"x":case"X":return j+=uu(),void(z="hexadecimal")}return eu("numeric",0)},decimalInteger(){switch(J){case".":case"e":case"E":return void(z="decimal")}if(!H.JudgeUtil.isDigit(J))return eu("numeric",Z*Number(j));j+=uu()},decimal(){switch(J){case".":j+=uu(),z="decimalFraction";break;case"e":case"E":j+=uu(),z="decimalExponent"}},decimalPointLeading(){if(H.JudgeUtil.isDigit(J))return j+=uu(),void(z="decimalFraction");throw Eu(x.Char,uu())},decimalFraction(){switch(J){case"e":case"E":return j+=uu(),void(z="decimalExponent")}if(!H.JudgeUtil.isDigit(J))return eu("numeric",Z*Number(j));j+=uu()},decimalExponent(){switch(J){case"+":case"-":return j+=uu(),void(z="decimalExponentSign")}if(H.JudgeUtil.isDigit(J))return j+=uu(),void(z="decimalExponentInteger");throw Eu(x.Char,uu())},decimalExponentSign(){if(H.JudgeUtil.isDigit(J))return j+=uu(),void(z="decimalExponentInteger");throw Eu(x.Char,uu())},decimalExponentInteger(){if(!H.JudgeUtil.isDigit(J))return eu("numeric",Z*Number(j));j+=uu()},hexadecimal(){if(H.JudgeUtil.isHexDigit(J))return j+=uu(),void(z="hexadecimalInteger");throw Eu(x.Char,uu())},hexadecimalInteger(){if(!H.JudgeUtil.isHexDigit(J))return eu("numeric",Z*Number(j));j+=uu()},identifierNameStartEscape(){if("u"!==J)throw Eu(x.Char,uu());uu();const u=ru();switch(u){case"$":case"_":break;default:if(!H.JudgeUtil.isIdStartChar(u))throw Eu(x.Identifier)}j+=u,z="identifierName"},identifierName(){switch(J){case"$":case"_":case"‌":case"‍":return void(j+=uu());case"\\":return uu(),void(z="identifierNameEscape")}if(!H.JudgeUtil.isIdContinueChar(J))return eu("identifier",j);j+=uu()},identifierNameEscape(){if("u"!==J)throw Eu(x.Char,uu());uu();const u=ru();switch(u){case"$":case"_":case"‌":case"‍":break;default:if(!H.JudgeUtil.isIdContinueChar(u))throw Eu(x.Identifier)}j+=u,z="identifierName"},string(){switch(J){case"\\":return uu(),void(j+=function(){const u=Y(),D=function(){switch(Y()){case"b":return uu(),"\b";case"f":return uu(),"\f";case"n":return uu(),"\n";case"r":return uu(),"\r";case"t":return uu(),"\t";case"v":return uu(),"\v"}return}();if(D)return D;switch(u){case"0":if(uu(),H.JudgeUtil.isDigit(Y()))throw Eu(x.Char,uu());return"\0";case"x":return uu(),function(){let u="",D=Y();if(!H.JudgeUtil.isHexDigit(D))throw Eu(x.Char,uu());if(u+=uu(),D=Y(),!H.JudgeUtil.isHexDigit(D))throw Eu(x.Char,uu());return u+=uu(),String.fromCodePoint(parseInt(u,16))}();case"u":return uu(),ru();case"\n":case"\u2028":case"\u2029":return uu(),"";case"\r":return uu(),"\n"===Y()&&uu(),""}if(void 0===u||H.JudgeUtil.isDigitWithoutZero(u))throw Eu(x.Char,uu());return uu()}());case'"':case"'":if(J===q){const u=eu("string",j);return uu(),u}return void(j+=uu());case"\n":case"\r":case void 0:throw Eu(x.Char,uu());case"\u2028":case"\u2029":!function(u){console.warn(`JSON5: '${Fu(u)}' in strings is not valid ECMAScript; consider escaping.`)}(J)}j+=uu()}};function eu(u,D){return{type:u,value:D,line:$,column:k}}function tu(u){for(const D of u){if(Y()!==D)throw Eu(x.Char,uu());uu()}}function ru(){let u="",D=4;for(;D-- >0;){const D=Y();if(!H.JudgeUtil.isHexDigit(D))throw Eu(x.Char,uu());u+=uu()}return String.fromCodePoint(parseInt(u,16))}const nu={start(){if("eof"===M.type)throw Eu(x.EOF);iu()},beforePropertyName(){switch(M.type){case"identifier":case"string":return V=M.value,void(W="afterPropertyName");case"punctuator":return void Cu();case"eof":throw Eu(x.EOF)}},afterPropertyName(){if("eof"===M.type)throw Eu(x.EOF);W="beforePropertyValue"},beforePropertyValue(){if("eof"===M.type)throw Eu(x.EOF);iu()},afterPropertyValue(){if("eof"===M.type)throw Eu(x.EOF);switch(M.value){case",":return void(W="beforePropertyName");case"}":Cu()}},beforeArrayValue(){if("eof"===M.type)throw Eu(x.EOF);"punctuator"!==M.type||"]"!==M.value?iu():Cu()},afterArrayValue(){if("eof"===M.type)throw Eu(x.EOF);switch(M.value){case",":return void(W="beforeArrayValue");case"]":Cu()}},end(){}};function iu(){const u=function(){let u;switch(M.type){case"punctuator":switch(M.value){case"{":u={};break;case"[":u=[]}break;case"null":case"boolean":case"numeric":case"string":u=M.value}return u}();if(K&&"object"==typeof u&&(u._line=$,u._column=k),void 0===G)G=u;else{const D=U[U.length-1];Array.isArray(D)?K&&"object"!=typeof u?D.push({value:u,_line:$,_column:k}):D.push(u):D[V]=K&&"object"!=typeof u?{value:u,_line:$,_column:k}:u}!function(u){if(u&&"object"==typeof u)U.push(u),W=Array.isArray(u)?"beforeArrayValue":"beforePropertyName";else{const u=U[U.length-1];W=u?Array.isArray(u)?"afterArrayValue":"afterPropertyValue":"end"}}(u)}function Cu(){U.pop();const u=U[U.length-1];W=u?Array.isArray(u)?"afterArrayValue":"afterPropertyValue":"end"}function Fu(u){const D={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(D[u])return D[u];if(u<" "){const D=u.charCodeAt(0).toString(16);return`\\x${`00${D}`.substring(D.length)}`}return u}function Eu(u,D){let e="";switch(u){case x.Char:e=void 0===D?`JSON5: invalid end of input at ${$}:${k}`:`JSON5: invalid character '${Fu(D)}' at ${$}:${k}`;break;case x.EOF:e=`JSON5: invalid end of input at ${$}:${k}`;break;case x.Identifier:k-=5,e=`JSON5: invalid identifier character at ${$}:${k}`}const t=new Au(e);return t.lineNumber=$,t.columnNumber=k,t}class Au extends SyntaxError{}var ou={},au=n&&n.__createBinding||(Object.create?function(u,D,e,t){void 0===t&&(t=e);var r=Object.getOwnPropertyDescriptor(D,e);r&&!("get"in r?!D.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return D[e]}}),Object.defineProperty(u,t,r)}:function(u,D,e,t){void 0===t&&(t=e),u[t]=D[e]}),cu=n&&n.__setModuleDefault||(Object.create?function(u,D){Object.defineProperty(u,"default",{enumerable:!0,value:D})}:function(u,D){u.default=D}),su=n&&n.__importStar||function(u){if(u&&u.__esModule)return u;var D={};if(null!=u)for(var e in u)"default"!==e&&Object.prototype.hasOwnProperty.call(u,e)&&au(D,u,e);return cu(D,u),D},lu=n&&n.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(ou,"__esModule",{value:!0}),ou.isFileExists=ou.offlinePluginConversion=ou.executeCommand=ou.getNpmPath=ou.hasNpmPackInPaths=void 0;const Bu=r,du=lu(e),fu=su(u),_u=i,pu=l;ou.hasNpmPackInPaths=function(u,D){try{return require.resolve(u,{paths:[...D]}),!0}catch(u){return!1}},ou.getNpmPath=function(){const u=process.execPath;return fu.join(fu.dirname(u),_u.NPM_TOOL)},ou.executeCommand=function(u,D,e){0!==(0,Bu.spawnSync)(u,D,e).status&&(0,pu.logErrorAndExit)(`Error: ${u} ${D} execute failed.See above for details.`)},ou.offlinePluginConversion=function(u,D){return D.startsWith("file:")||D.endsWith(".tgz")?fu.resolve(u,_u.HVIGOR,D.replace("file:","")):D},ou.isFileExists=function(u){return du.default.existsSync(u)&&du.default.statSync(u).isFile()};var Ou=n&&n.__createBinding||(Object.create?function(u,D,e,t){void 0===t&&(t=e);var r=Object.getOwnPropertyDescriptor(D,e);r&&!("get"in r?!D.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return D[e]}}),Object.defineProperty(u,t,r)}:function(u,D,e,t){void 0===t&&(t=e),u[t]=D[e]}),hu=n&&n.__setModuleDefault||(Object.create?function(u,D){Object.defineProperty(u,"default",{enumerable:!0,value:D})}:function(u,D){u.default=D}),Pu=n&&n.__importStar||function(u){if(u&&u.__esModule)return u;var D={};if(null!=u)for(var e in u)"default"!==e&&Object.prototype.hasOwnProperty.call(u,e)&&Ou(D,u,e);return hu(D,u),D},vu=n&&n.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(P,"__esModule",{value:!0});var gu=P.initProjectWorkSpace=void 0;const mu=Pu(e),Ru=vu(D),yu=Pu(u),Iu=v,Nu=i,bu=g,Su=l,wu=ou;let Hu,xu,Mu;function Tu(u,D,e){return void 0!==e.dependencies&&(0,wu.offlinePluginConversion)(Nu.HVIGOR_PROJECT_ROOT_DIR,D.dependencies[u])===yu.normalize(e.dependencies[u])}function Vu(){const u=yu.join(Mu,Nu.WORK_SPACE);if((0,Su.logInfoPrintConsole)("Hvigor cleaning..."),!mu.existsSync(u))return;const D=mu.readdirSync(u);if(!D||0===D.length)return;const e=yu.resolve(Mu,"node_modules","@ohos","hvigor","bin","hvigor.js");mu.existsSync(e)&&(0,wu.executeCommand)(process.argv[0],[e,"--stop-daemon"],{});try{D.forEach((D=>{mu.rmSync(yu.resolve(u,D),{recursive:!0})}))}catch(D){(0,Su.logErrorAndExit)(`The hvigor build tool cannot be installed. Please manually clear the workspace directory and synchronize the project again.\n\n Workspace Path: ${u}.`)}}gu=P.initProjectWorkSpace=function(){if(Hu=function(){const u=yu.resolve(Nu.HVIGOR_PROJECT_WRAPPER_HOME,Nu.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME);mu.existsSync(u)||(0,Su.logErrorAndExit)(`Error: Hvigor config file ${u} does not exist.`);return(0,bu.parseJsonFile)(u)}(),Mu=function(u){let D;D=function(u){let D=u.hvigorVersion;if(D.startsWith("file:")||D.endsWith(".tgz"))return!1;const e=u.dependencies,t=Object.getOwnPropertyNames(e);for(const u of t){const D=e[u];if(D.startsWith("file:")||D.endsWith(".tgz"))return!1}if(1===t.length&&"@ohos/hvigor-ohos-plugin"===t[0])return D>"2.5.0";return!1}(u)?function(u){let D=`${Nu.HVIGOR_ENGINE_PACKAGE_NAME}@${u.hvigorVersion}`;const e=u.dependencies;if(e){Object.getOwnPropertyNames(e).sort().forEach((u=>{D+=`,${u}@${e[u]}`}))}return(0,Iu.hash)(D)}(u):(0,Iu.hash)(process.cwd());return yu.resolve(Ru.default.homedir(),".hvigor","project_caches",D)}(Hu),xu=function(){const u=yu.resolve(Mu,Nu.WORK_SPACE,Nu.DEFAULT_PACKAGE_JSON);return mu.existsSync(u)?(0,bu.parseJsonFile)(u):{dependencies:{}}}(),!(0,wu.hasNpmPackInPaths)(Nu.HVIGOR_ENGINE_PACKAGE_NAME,[yu.join(Mu,Nu.WORK_SPACE)])||(0,wu.offlinePluginConversion)(Nu.HVIGOR_PROJECT_ROOT_DIR,Hu.hvigorVersion)!==xu.dependencies[Nu.HVIGOR_ENGINE_PACKAGE_NAME]||!function(){function u(u){const D=null==u?void 0:u.dependencies;return void 0===D?0:Object.getOwnPropertyNames(D).length}const D=u(Hu),e=u(xu);if(D+1!==e)return!1;for(const u in null==Hu?void 0:Hu.dependencies)if(!(0,wu.hasNpmPackInPaths)(u,[yu.join(Mu,Nu.WORK_SPACE)])||!Tu(u,Hu,xu))return!1;return!0}()){Vu();try{!function(){(0,Su.logInfoPrintConsole)("Hvigor installing...");for(const u in Hu.dependencies)Hu.dependencies[u]&&(Hu.dependencies[u]=(0,wu.offlinePluginConversion)(Nu.HVIGOR_PROJECT_ROOT_DIR,Hu.dependencies[u]));const u={dependencies:{...Hu.dependencies}};u.dependencies[Nu.HVIGOR_ENGINE_PACKAGE_NAME]=(0,wu.offlinePluginConversion)(Nu.HVIGOR_PROJECT_ROOT_DIR,Hu.hvigorVersion);const D=yu.join(Mu,Nu.WORK_SPACE);try{mu.mkdirSync(D,{recursive:!0});const e=yu.resolve(D,Nu.DEFAULT_PACKAGE_JSON);mu.writeFileSync(e,JSON.stringify(u))}catch(u){(0,Su.logErrorAndExit)(u)}(function(){const u=["config","set","store-dir",Nu.HVIGOR_PNPM_STORE_PATH],D={cwd:yu.join(Mu,Nu.WORK_SPACE),stdio:["inherit","inherit","inherit"]};(0,wu.executeCommand)(Nu.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,u,D)})(),function(){const u=["install"],D={cwd:yu.join(Mu,Nu.WORK_SPACE),stdio:["inherit","inherit","inherit"]};(0,wu.executeCommand)(Nu.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,u,D)}(),(0,Su.logInfoPrintConsole)("Hvigor install success.")}()}catch(u){Vu()}}return Mu};var Gu={};!function(t){var C=n&&n.__createBinding||(Object.create?function(u,D,e,t){void 0===t&&(t=e);var r=Object.getOwnPropertyDescriptor(D,e);r&&!("get"in r?!D.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return D[e]}}),Object.defineProperty(u,t,r)}:function(u,D,e,t){void 0===t&&(t=e),u[t]=D[e]}),F=n&&n.__setModuleDefault||(Object.create?function(u,D){Object.defineProperty(u,"default",{enumerable:!0,value:D})}:function(u,D){u.default=D}),E=n&&n.__importStar||function(u){if(u&&u.__esModule)return u;var D={};if(null!=u)for(var e in u)"default"!==e&&Object.prototype.hasOwnProperty.call(u,e)&&C(D,u,e);return F(D,u),D},A=n&&n.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(t,"__esModule",{value:!0}),t.executeInstallPnpm=t.isPnpmInstalled=t.environmentHandler=t.checkNpmConifg=t.PNPM_VERSION=void 0;const o=r,a=E(e),c=A(D),s=E(u),B=i,d=l,f=ou;t.PNPM_VERSION="7.30.0",t.checkNpmConifg=function(){const u=s.resolve(B.HVIGOR_PROJECT_ROOT_DIR,".npmrc"),D=s.resolve(c.default.homedir(),".npmrc");if((0,f.isFileExists)(u)||(0,f.isFileExists)(D))return;const e=(0,f.getNpmPath)(),t=(0,o.spawnSync)(e,["config","get","prefix"],{cwd:B.HVIGOR_PROJECT_ROOT_DIR});if(0!==t.status||!t.stdout)return void(0,d.logErrorAndExit)("Error: The hvigor depends on the npmrc file. Configure the npmrc file first.");const r=s.resolve(`${t.stdout}`.replace(/[\r\n]/gi,""),".npmrc");(0,f.isFileExists)(r)||(0,d.logErrorAndExit)("Error: The hvigor depends on the npmrc file. Configure the npmrc file first.")},t.environmentHandler=function(){process.env["npm_config_update-notifier"]="false"},t.isPnpmInstalled=function(){return!!a.existsSync(B.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH)&&(0,f.hasNpmPackInPaths)("pnpm",[B.HVIGOR_WRAPPER_TOOLS_HOME])},t.executeInstallPnpm=function(){(0,d.logInfoPrintConsole)(`Installing pnpm@${t.PNPM_VERSION}...`);const u=(0,f.getNpmPath)();!function(){const u=s.resolve(B.HVIGOR_WRAPPER_TOOLS_HOME,B.DEFAULT_PACKAGE_JSON);try{a.existsSync(B.HVIGOR_WRAPPER_TOOLS_HOME)||a.mkdirSync(B.HVIGOR_WRAPPER_TOOLS_HOME,{recursive:!0});const D={dependencies:{}};D.dependencies[B.PNPM]=t.PNPM_VERSION,a.writeFileSync(u,JSON.stringify(D))}catch(D){(0,d.logErrorAndExit)(`Error: EPERM: operation not permitted,create ${u} failed.`)}}(),(0,f.executeCommand)(u,["install","pnpm"],{cwd:B.HVIGOR_WRAPPER_TOOLS_HOME,stdio:["inherit","inherit","inherit"],env:process.env}),(0,d.logInfoPrintConsole)("Pnpm install success.")}}(Gu),function(){Gu.checkNpmConifg(),Gu.environmentHandler(),Gu.isPnpmInstalled()||Gu.executeInstallPnpm();const D=gu();_(u.join(D,i.WORK_SPACE))}(); \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/hvigorfile.ts b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/hvigorfile.ts deleted file mode 100644 index f3cb9f1a..00000000 --- a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/hvigorfile.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { appTasks } from '@ohos/hvigor-ohos-plugin'; - -export default { - system: appTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ - plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ -} diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/hvigorw b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/hvigorw deleted file mode 100644 index ff6a29a2..00000000 --- a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/hvigorw +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash - -# ---------------------------------------------------------------------------- -# Hvigor startup script, version 1.0.0 -# -# Required ENV vars: -# ------------------ -# NODE_HOME - location of a Node home dir -# or -# Add /usr/local/nodejs/bin to the PATH environment variable -# ---------------------------------------------------------------------------- - -HVIGOR_APP_HOME="`pwd -P`" -HVIGOR_WRAPPER_SCRIPT=${HVIGOR_APP_HOME}/hvigor/hvigor-wrapper.js -warn() { - echo "" - echo -e "\033[1;33m`date '+[%Y-%m-%d %H:%M:%S]'`$@\033[0m" -} - -error() { - echo "" - echo -e "\033[1;31m`date '+[%Y-%m-%d %H:%M:%S]'`$@\033[0m" -} - -fail() { - error "$@" - exit 1 -} - -# Determine node to start hvigor wrapper script -if [ -n "${NODE_HOME}" ];then - EXECUTABLE_NODE="${NODE_HOME}/bin/node" - if [ ! -x "$EXECUTABLE_NODE" ];then - fail "ERROR: NODE_HOME is set to an invalid directory,check $NODE_HOME\n\nPlease set NODE_HOME in your environment to the location where your nodejs installed" - fi -else - EXECUTABLE_NODE="node" - which ${EXECUTABLE_NODE} > /dev/null 2>&1 || fail "ERROR: NODE_HOME is not set and not 'node' command found in your path" -fi - -# Check hvigor wrapper script -if [ ! -r "$HVIGOR_WRAPPER_SCRIPT" ];then - fail "ERROR: Couldn't find hvigor/hvigor-wrapper.js in ${HVIGOR_APP_HOME}" -fi - -# start hvigor-wrapper script -exec "${EXECUTABLE_NODE}" \ - "${HVIGOR_WRAPPER_SCRIPT}" "$@" diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/hvigorw.bat b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/hvigorw.bat deleted file mode 100644 index d570007e..00000000 --- a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/hvigorw.bat +++ /dev/null @@ -1,64 +0,0 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Hvigor startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -set WRAPPER_MODULE_PATH=%APP_HOME%\hvigor\hvigor-wrapper.js -set NODE_EXE=node.exe - -goto start - -:start -@rem Find node.exe -if defined NODE_HOME goto findNodeFromNodeHome - -%NODE_EXE% --version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute - -echo. -echo ERROR: NODE_HOME is not set and no 'node' command could be found in your PATH. -echo. -echo Please set the NODE_HOME variable in your environment to match the -echo location of your NodeJs installation. - -goto fail - -:findNodeFromNodeHome -set NODE_HOME=%NODE_HOME:"=% -set NODE_EXE_PATH=%NODE_HOME%/%NODE_EXE% - -if exist "%NODE_EXE_PATH%" goto execute -echo. -echo ERROR: NODE_HOME is not set and no 'node' command could be found in your PATH. -echo. -echo Please set the NODE_HOME variable in your environment to match the -echo location of your NodeJs installation. - -goto fail - -:execute -@rem Execute hvigor -"%NODE_EXE%" "%WRAPPER_MODULE_PATH%" %* - -if "%ERRORLEVEL%" == "0" goto hvigorwEnd - -:fail -exit /b 1 - -:hvigorwEnd -if "%OS%" == "Windows_NT" endlocal - -:end diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/oh-package.json5 b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/oh-package.json5 deleted file mode 100644 index 541c8757..00000000 --- a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/oh-package.json5 +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "distributedvideoplayer", - "version": "1.0.0", - "description": "Please describe the basic information.", - "main": "", - "author": "", - "license": "", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.11" - } -} diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/ohosTest.md b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/ohosTest.md deleted file mode 100644 index 47587613..00000000 --- a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/ohosTest.md +++ /dev/null @@ -1,19 +0,0 @@ -# DistributedVideoPlayer 测试用例归档 - -## 用例表 - -| 测试功能 | 预置条件 | 输入 | 预期输出 | 是否自动 | 测试结果 | -| ---------------- | -------------------------------------------- | ---------------------------------------------- | ---------------------- | -------- | -------- | -| 打开应用 | 设备正常运行 | | 成功拉起应用 | 是 | Pass | -| 获取权限 | 设备正常运行 | 点击权限弹窗允许按钮 | 授权后成功进入首页 | 是 | Pass | -| 关闭应用 | | 点击左上角返回按钮 | 成功退出应用 | 是 | Pass | -| 打开应用 | 设备正常运行 | | 成功拉起应用 | 是 | Pass | -| 单击播放按钮 | 位于首页,控制栏处于显示状态 | 单击播放按钮 | 正常执行 | 是 | Pass | -| 双击页面 | 位于首页 | 双击屏幕 | 正常执行 | 是 | Pass | -| 滑动Slider进度条 | 位于首页,控制栏处于显示状态 | 滑动Slider进度条 | 正常执行 | 是 | Pass | -| 左右滑动屏幕 | | 左右滑动屏幕 | 正常执行 | 是 | Pass | -| 调整倍速 | 位于首页,控制栏处于显示状态,展开倍速选择框 | 点击倍速文本 | 正常执行 | 是 | Pass | -| 切换视频 | 位于首页,控制栏处于显示状态 | 点击视频列表图标 | 展开视频列表侧边栏 | 是 | Pass | -| 截图 | 位于首页,控制栏处于显示状态 | 点击截图按钮 | 成功截图并显示截图窗口 | 是 | Pass | -| 选择设备弹窗 | 位于首页 | 点击流转图标 | 弹出选择设备弹窗 | 是 | Pass | -| 设置流转模式 | 位于首页 | 点击设置图标,进入设置页面后选择“多端协同”模式 | 成功进入设置页面并选择 | 是 | Pass | \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/screenshots/DeviceDialog.jpeg b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/screenshots/DeviceDialog.jpeg deleted file mode 100644 index 77070a7a..00000000 Binary files a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/screenshots/DeviceDialog.jpeg and /dev/null differ diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/screenshots/Index.jpeg b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/screenshots/Index.jpeg deleted file mode 100644 index 76388319..00000000 Binary files a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/screenshots/Index.jpeg and /dev/null differ diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/screenshots/Settings.jpeg b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/screenshots/Settings.jpeg deleted file mode 100644 index ac09659e..00000000 Binary files a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/screenshots/Settings.jpeg and /dev/null differ diff --git a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/screenshots/VideoList.jpeg b/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/screenshots/VideoList.jpeg deleted file mode 100644 index b55b0b90..00000000 Binary files a/unionpi_tiger/sample_api10/app/DistributedVideoPlayer/screenshots/VideoList.jpeg and /dev/null differ diff --git a/unionpi_tiger/sample_api10/app/factory/AppScope/app.json5 b/unionpi_tiger/sample_api10/app/factory/AppScope/app.json5 deleted file mode 100644 index 44959d80..00000000 --- a/unionpi_tiger/sample_api10/app/factory/AppScope/app.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -{ - "app": { - "bundleName": "com.yarward.factorytest", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name" - } -} diff --git a/unionpi_tiger/sample_api10/app/factory/AppScope/resources/base/element/string.json b/unionpi_tiger/sample_api10/app/factory/AppScope/resources/base/element/string.json deleted file mode 100644 index c911a2d7..00000000 --- a/unionpi_tiger/sample_api10/app/factory/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "factory" - } - ] -} diff --git a/unionpi_tiger/sample_api10/app/factory/AppScope/resources/base/media/app_icon.png b/unionpi_tiger/sample_api10/app/factory/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index ce307a88..00000000 Binary files a/unionpi_tiger/sample_api10/app/factory/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/unionpi_tiger/sample_api10/app/factory/README.md b/unionpi_tiger/sample_api10/app/factory/README.md deleted file mode 100644 index f5e5c631..00000000 --- a/unionpi_tiger/sample_api10/app/factory/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# factory - -factory for OpenHarmony \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/factory/build-profile.json5 b/unionpi_tiger/sample_api10/app/factory/build-profile.json5 deleted file mode 100644 index efc41f50..00000000 --- a/unionpi_tiger/sample_api10/app/factory/build-profile.json5 +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -{ - "app": { - "signingConfigs": [ - ], - "products": [ - { - "name": "default", - "signingConfig": "default", - "compileSdkVersion": 10, - "compatibleSdkVersion": 10, - "runtimeOS": "OpenHarmony" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/factory/entry/build-profile.json5 b/unionpi_tiger/sample_api10/app/factory/entry/build-profile.json5 deleted file mode 100644 index 384f23ca..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/build-profile.json5 +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -{ - "apiType": 'stageMode', - "buildOption": { - "sourceOption": { - "workers": [ - "./src/main/ets/pages/workers/fileWorker.ts" - ] - } - }, - "targets": [ - { - "name": "default", - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/factory/entry/hvigorfile.ts b/unionpi_tiger/sample_api10/app/factory/entry/hvigorfile.ts deleted file mode 100644 index 80e4ec5b..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/hvigorfile.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. -export { hapTasks } from '@ohos/hvigor-ohos-plugin'; diff --git a/unionpi_tiger/sample_api10/app/factory/entry/oh-package.json5 b/unionpi_tiger/sample_api10/app/factory/entry/oh-package.json5 deleted file mode 100644 index 22bd75d8..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/oh-package.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -{ - "license": "", - "devDependencies": {}, - "author": "", - "name": "entry", - "description": "Please describe the basic information.", - "main": "", - "version": "1.0.0", - "dependencies": {} -} diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/common/AvailableWifi.ets b/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/common/AvailableWifi.ets deleted file mode 100644 index 82951d81..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/common/AvailableWifi.ets +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import prompt from '@ohos.promptAction' -import Logger from '../model/LoggerEts' -import { PswDialog } from './PswDialog' -import { WifiModel } from '../model/WifiModel' -import { WifiView } from './WifiView' -import WifiDataSource from './BasicDataSource' -import wifi from '@ohos.wifiManager' - -const TAG = 'AvailableWiFi' - -@Component -export struct AvailableWifi { - private wifiModel = new WifiModel() - private linkedInfo: wifi.WifiLinkedInfo = {} as wifi.WifiLinkedInfo - @StorageLink('wifiList') @Watch('wifiListRefresh') wifiList: Array = [] - @State wifiDataResource: WifiDataSource = new WifiDataSource(this.wifiList) - @State scanInfo: wifi.WifiScanInfo = {} as wifi.WifiScanInfo - private pswDialogController: CustomDialogController = new CustomDialogController({ - builder: PswDialog({ scanInfo: $scanInfo, action: (scanInfo: wifi.WifiScanInfo, psw: string)=>{this.onAccept(scanInfo,psw)}}), - autoCancel: true - }) - - build() { - List() { - ListItem() { - Row() { - Text($r('app.string.available_wlan')) - .fontSize(22) - .layoutWeight(1) - } - .id('validWlan') - .width('100%') - } - - LazyForEach(this.wifiDataResource, (item: wifi.WifiScanInfo, index: number) => { - ListItem() { - WifiView({ wifi: item }) - } - .id(`Wifi${index}`) - .onClick(() => { - Logger.info(TAG, 'wifi click') - this.scanInfo = item - if (this.linkedInfo !== null && item.ssid === this.linkedInfo.ssid) { - prompt.showToast({ message: 'this wifi is connected' }) - return - } - if (item.securityType === 0 || item.securityType === 1) { - this.wifiModel.connectNetwork(item, '') - return - } - this.pswDialogController.open() - }) - }, (item: wifi.WifiScanInfo )=> JSON.stringify(item)) - } - .width('100%') - .height('100%') - .padding({ left: 16, right: 16 }) - .layoutWeight(1) - .divider({ strokeWidth: 1, color: Color.Gray, startMargin: 10, endMargin: 10 }) - .margin({ top: 10 }) - } - - onAccept(scanInfo: wifi.WifiScanInfo, psw: string) { - Logger.info(TAG, 'connect wifi') - this.wifiModel.connectNetwork(scanInfo, psw) - } - - aboutToAppear() { - } - - wifiListRefresh() { - this.wifiDataResource.dataArray = this.wifiList - this.wifiDataResource.notifyDataReload() - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/common/BasicDataSource.ets b/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/common/BasicDataSource.ets deleted file mode 100644 index ee605121..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/common/BasicDataSource.ets +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import wifi from '@ohos.wifiManager' -import Logger from '../model/LoggerEts' - -export default class WifiDataSource { - private listeners: DataChangeListener[] = [] - dataArray: wifi.WifiScanInfo[] = [] - - constructor(data: wifi.WifiScanInfo[]) { - this.dataArray = data - } - - public totalCount(): number { - return this.dataArray.length - } - - public getData(index: number): wifi.WifiScanInfo { - return this.dataArray[index] - } - - public addData(index: number, data: wifi.WifiScanInfo): void { - this.dataArray.splice(index, 0, data) - this.notifyDataAdd(index) - } - - public pushData(data: wifi.WifiScanInfo): void { - this.dataArray.push(data) - this.notifyDataAdd(this.dataArray.length - 1) - } - - registerDataChangeListener(listener: DataChangeListener): void { - if (this.listeners.indexOf(listener) < 0) { - Logger.info('add listener') - this.listeners.push(listener) - } - } - - unregisterDataChangeListener(listener: DataChangeListener): void { - const POS = this.listeners.indexOf(listener) - if (POS >= 0) { - Logger.info('remove listener') - this.listeners.splice(POS, 1) - } - } - - notifyDataReload(): void { - this.listeners.forEach(listener => { - listener.onDataReloaded() - }) - } - - notifyDataAdd(index: number): void { - this.listeners.forEach(listener => { - listener.onDataAdd(index) - }) - } - - notifyDataChange(index: number): void { - this.listeners.forEach(listener => { - listener.onDataChange(index) - }) - } - - notifyDataDelete(index: number): void { - this.listeners.forEach(listener => { - listener.onDataDelete(index) - }) - } - - notifyDataMove(from: number, to: number): void { - this.listeners.forEach(listener => { - listener.onDataMove(from, to) - }) - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/common/FirstDialog.ets b/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/common/FirstDialog.ets deleted file mode 100644 index 202d3a87..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/common/FirstDialog.ets +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import data_preferences from '@ohos.data.preferences'; -import { GlobalContext } from './GlobalThis'; - - -export default class FirstDialog { - static ChooseDialog = async (StepTips: string, name: string) => { - let Test :number = 0; - let context = GlobalContext.getContext().getObject("context") as Context - let preferences: data_preferences.Preferences = await data_preferences.getPreferences(context, 'mystore') - - Test = await preferences.get(name, 0) as number; - if (Test != 1) { - AlertDialog.show( - { - title: '操作提示', - message: StepTips, - primaryButton: { - value: '不再提醒', fontColor: Color.Grey, - action: () => { - let promise = preferences.put(name, 1); - promise.then(() => { - console.info("Succeeded in putting value of 'test'."); - }); - promise = preferences.flush(); - promise.then(() => { - console.info("Succeeded in flushing."); - }); - } - }, - secondaryButton: { - value: '我已知晓', - action: () => { - - } - }, - cancel: () => { - - } - } - ) - } - return; - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/common/GlobalThis.ts b/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/common/GlobalThis.ts deleted file mode 100644 index 9f8fdd1f..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/common/GlobalThis.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -import { Context } from '@ohos.abilityAccessCtrl'; - -export class GlobalContext { - private constructor() {} - private static instance: GlobalContext; - private _objects = new Map(); - - public static getContext(): GlobalContext { - if (!GlobalContext.instance) { - GlobalContext.instance = new GlobalContext(); - } - return GlobalContext.instance; - } - - getObject(value: string): Object | undefined { - return this._objects.get(value); - } - - setObject(key: string, objectClass: Object): void { - this._objects.set(key, objectClass); - } -} diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/common/InfoView.ets b/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/common/InfoView.ets deleted file mode 100644 index 2bd80371..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/common/InfoView.ets +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -@Component -export struct InfoView { - private infoList: Array = [] - - build() { - Column() { - ForEach(this.infoList, (item, index) => { - Column() { - Text(item.key) - .fontColor(Color.Black) - .fontSize(20) - .width('100%') - - Text(item.value) - .fontColor(Color.Black) - .fontSize(20) - .width('100%') - .margin({ top: 5, bottom: 5 }) - if (index < this.infoList.length - 1) { - Divider().color(Color.Grey) - } - } - .padding(5) - }, item => JSON.stringify(item)) - } - .margin(10) - .border({ width: 1, color: Color.Gray, radius: 15 }) - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/common/PinDialog.ets b/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/common/PinDialog.ets deleted file mode 100644 index b7cd4414..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/common/PinDialog.ets +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import bluetooth from '@ohos.bluetooth' -import logger from '../Model/Logger' - -const TAG: string = 'PinDialog' - -@CustomDialog -export struct PinDialog { - private controller?: CustomDialogController - private data: bluetooth.PinRequiredParam | null = null - @State titleText: string = '' - @State pinCode: string = '' - - @Builder choiceText(message: Resource, handlerClick) { - Text(message) - .width('50%') - .fontSize(30) - .textAlign(TextAlign.Center) - .fontColor('#ff0742ef') - .onClick(handlerClick) - } - - aboutToAppear() { - this.titleText = `"${this.data.deviceId}"要与您配对。请确认此配对码已在"${this.data.deviceId}"上直接显示,且不是手动输入的。` - this.pinCode = JSON.stringify(this.data.pinCode) - } - - build() { - Column({ space: 10 }) { - Text($r('app.string.match_request')) - .fontSize(30) - .alignSelf(ItemAlign.Start) - Text(this.titleText) - .alignSelf(ItemAlign.Start) - .margin({ top: 20 }) - .fontSize(21) - Text(this.pinCode) - .fontSize(40) - .fontWeight(FontWeight.Bold) - .margin({ top: 20 }) - Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { - Checkbox({ name: 'checkbox' }) - .select(false) - .selectedColor('#ff3d6fb8') - .key('checkBox') - Text($r('app.string.grant_permission')) - .fontSize(15) - .margin({ left: 3, top: 6 }) - } - .alignSelf(ItemAlign.Start) - .width('95%') - .margin({ top: 5 }) - - Row() { - this.choiceText($r('app.string.cancel'), () => { - bluetooth.setDevicePairingConfirmation(this.data.deviceId, false) - logger.info(TAG, `setDevicePairingConfirmation = ${bluetooth.setDevicePairingConfirmation(this.data.deviceId, false)}`) - this.controller.close() - }) - - Divider() - .vertical(true) - .height(32) - - this.choiceText($r('app.string.match'), () => { - bluetooth.setDevicePairingConfirmation(this.data.deviceId, true) - logger.info(TAG, `setDevicePairingConfirmation = ${bluetooth.setDevicePairingConfirmation(this.data.deviceId, true)}`) - this.controller.close() - }) - } - .margin({ top: 20 }) - } - .width('100%') - .padding(15) - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/common/PswDialog.ets b/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/common/PswDialog.ets deleted file mode 100644 index 1f6b85d5..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/common/PswDialog.ets +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import wifi from '@ohos.wifiManager' - -@CustomDialog -export struct PswDialog { - @Link scanInfo: wifi.WifiScanInfo - private psw: string = '' - private controller: CustomDialogController - private action: (scanInfo: wifi.WifiScanInfo, psw: string) => void = () => { - } - - build() { - Column() { - Text(this.scanInfo.ssid) - .fontSize(20) - .width('95%') - - TextInput({ placeholder: 'input password' }) - .id('input') - .type(InputType.Password) - .placeholderColor(Color.Gray) - .fontSize(19) - .margin({ top: 15 }) - .width('95%') - .height(36) - .onChange((value: string) => { - this.psw = value - }) - - Row() { - Button() { - Text($r('app.string.sure')) - .fontColor(Color.Blue) - .fontSize(17) - } - .id('sure') - .layoutWeight(7) - .backgroundColor(Color.White) - .margin(5) - .onClick(() => { - this.controller.close() - this.action(this.scanInfo, this.psw) - }) - - // 分割线 - Text() - .width(1) - .height(35) - .backgroundColor(Color.Black) - - Button() { - Text($r('app.string.cancel')) - .fontColor(Color.Red) - .fontSize(17) - } - .layoutWeight(7) - .backgroundColor(Color.White) - .margin(5) - .onClick(() => { - this.controller.close() - }) - } - .width('100%') - .margin({ top: '3%' }) - } - .padding(15) - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/common/TipsDialog.ets b/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/common/TipsDialog.ets deleted file mode 100644 index a9f5939f..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/common/TipsDialog.ets +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -// xxx.ets -@CustomDialog -export struct TipsDialog { - title: string = "" - text: string = "" - controller: CustomDialogController - // 若尝试在CustomDialog中传入多个其他的Controller,以实现在CustomDialog中打开另一个或另一些CustomDialog,那么此处需要将指向自己的controller放在最后 - cancel: () => void = () => { - } - confirm: () => void = () => { - } - - build() { - Column() { - Text(this.title).fontSize(20).margin({ top: 10, bottom: 10 }) - Text(this.text).fontSize(16).margin({ bottom: 10 }) - - } - - // dialog默认的borderRadius为24vp,如果需要使用border属性,请和borderRadius属性一起使用。 - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/common/TitleBar.ets b/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/common/TitleBar.ets deleted file mode 100644 index fa2c7b6d..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/common/TitleBar.ets +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import router from '@ohos.router' - -// Page title bar -@Component -export struct TitleBar { - private title: Resource | string = "" - - build() { - Column() { - Row() { - Image($r('app.media.ic_back')) - .width(20) - .height(20) - .margin({ left: 26 }) - .objectFit(ImageFit.Contain) - .onClick(() => { - router.back() - }).id('backBtn') - Text(this.title) - .fontSize(20) - .layoutWeight(1) - .margin({ left: 16 }) - .align(Alignment.Start) - Blank() - } - .height(56) - .width('100%') - } - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/common/WifiView.ets b/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/common/WifiView.ets deleted file mode 100644 index 714da497..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/common/WifiView.ets +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import Logger from '../model/LoggerEts' -import wifi from '@ohos.wifiManager' - -const TAG: string = 'WifiView' - -@Component -export struct WifiView { - private wifi: wifi.WifiScanInfo = {} as wifi.WifiScanInfo - private securityString: Resource = $r('app.string.encryption') - @State isLock: boolean = true - - aboutToAppear() { - Logger.debug(TAG, `aboutToAppear ${JSON.stringify(this.wifi)}`) - if (this.wifi) { - if (this.wifi.securityType) { - if (this.wifi.securityType === 0 || this.wifi.securityType === 1) { - this.securityString = $r('app.string.open') - this.isLock = false - } - } - } - } - - build() { - Row() { - Column() { - if (this.wifi) { - if (this.wifi.ssid) { - Text(this.wifi.ssid) - .fontSize(20) - .width('50%') - Text(this.wifi.frequency.toString()) - .fontSize(20) - .width('50%') - } - } - Text(this.securityString) - .fontSize(18) - .fontColor(Color.Gray) - .width('100%') - } - .layoutWeight(1) - - Stack({ alignContent: Alignment.BottomEnd }) { - Image($r('app.media.wifi')) - .height(30) - .width(30) - .objectFit(ImageFit.Contain) - if (this.isLock) { - Image($r('app.media.lock')) - .objectFit(ImageFit.Contain) - .width(15) - .height(15) - } - } - .width(40) - .height(40) - .margin({ right: 10 }) - } - .backgroundColor(Color.White) - .width('100%') - .padding(10) - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/controller/BluetoothDeviceController.ts b/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/controller/BluetoothDeviceController.ts deleted file mode 100644 index 9005e690..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/controller/BluetoothDeviceController.ts +++ /dev/null @@ -1,460 +0,0 @@ -/** - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import deviceInfo from '@ohos.deviceInfo'; -import BluetoothModel, { BondState, ProfileConnectionState } from '../Model/BluetoothModel'; -import BluetoothDevice from '../Model/BluetoothDevice'; -import Logger from '../Model/Logger'; -import settings from '@ohos.settings'; - - -const deviceTypeInfo = deviceInfo.deviceType; -const DISCOVERY_DURING_TIME: number = 30000; // 30' -const DISCOVERY_INTERVAL_TIME: number = 3000; // 3' -let debounceTimer = null; - -export default class BluetoothDeviceController { - private TAG = 'BluetoothDeviceController ' - - //state - private isOn: boolean = false; - private enabled: boolean = false; - - // paired devices - private pairedDevices: BluetoothDevice[] = []; - - // available devices - private isDeviceDiscovering: boolean = false; - private availableDevices: BluetoothDevice[] = []; - private pairPinCode: string = ''; - private discoveryStartTimeoutId: number; - private discoveryStopTimeoutId: number; - - - - initData(){ - Logger.info(this.TAG + 'start to initData bluetooth'); - let isOn = BluetoothModel.isStateOn(); - Logger.info(this.TAG + 'initData bluetooth state isOn ' + isOn + ', typeof isOn = ' + typeof (isOn)) - if (isOn) { - this.refreshPairedDevices(); - } - - Logger.info(this.TAG + 'initData save value to app storage. ') - this.isOn = new Boolean(isOn).valueOf() - this.enabled = true - - AppStorage.SetOrCreate('bluetoothIsOn', this.isOn); - AppStorage.SetOrCreate('bluetoothToggleEnabled', this.enabled); - AppStorage.SetOrCreate('bluetoothAvailableDevices', this.availableDevices); - - return this; - } - - subscribe() { - Logger.info(this.TAG + 'subscribe bluetooth state isOn ' + this.isOn) - this.subscribeStateChange(); - this.subscribeBluetoothDeviceFind(); - this.subscribeBondStateChange(); - this.subscribeDeviceConnectStateChange(); - BluetoothModel.subscribePinRequired((pinRequiredParam: { - deviceId: string; - pinCode: string; - }) => { - Logger.info(this.TAG + 'bluetooth subscribePinRequired callback. pinRequiredParam = ' + pinRequiredParam.pinCode); - let pairData = this.getAvailableDevice(pinRequiredParam.deviceId); - this.pairPinCode = pinRequiredParam.pinCode; - AppStorage.SetOrCreate('pairData', pairData); - AppStorage.SetOrCreate('pinRequiredParam', pinRequiredParam); - }) - return this; - } - - unsubscribe(){ - Logger.info(this.TAG + 'start to unsubscribe bluetooth'); - this.stopBluetoothDiscovery(); - - if (this.discoveryStartTimeoutId) { - clearTimeout(this.discoveryStartTimeoutId); - } - - if (this.discoveryStopTimeoutId) { - clearTimeout(this.discoveryStopTimeoutId); - } - - BluetoothModel.unsubscribeBluetoothDeviceFind(); - BluetoothModel.unsubscribeBondStateChange(); - BluetoothModel.unsubscribeDeviceStateChange(); - AppStorage.Delete('BluetoothFailedDialogFlag'); - return this; - } - - /** - * Set toggle value - */ - toggleValue(isOn: boolean) { - clearTimeout(debounceTimer); - debounceTimer = setTimeout(() => { - let curState = BluetoothModel.getState(); - if ((curState === 2) === isOn) { - return; - } - this.enabled = false - AppStorage.SetOrCreate('bluetoothToggleEnabled', this.enabled); - Logger.info(this.TAG + 'afterCurrentValueChanged bluetooth state isOn = ' + this.isOn) - if (isOn) { - BluetoothModel.enableBluetooth(); - } else { - BluetoothModel.disableBluetooth(); - // remove all elements from availableDevices array - this.availableDevices.splice(0, this.availableDevices.length) - } - },500) - } - - - /** - * Pair device. - * - * @param deviceId device id - * @param success success callback - * @param error error callback - */ - pair(deviceId: string, success?: (pinCode: string) => void, error?: () => void): void { - const device: BluetoothDevice = this.getAvailableDevice(deviceId); - if (device && device.connectionState === BondState.BOND_STATE_BONDING) { - Logger.info(this.TAG + `bluetooth no Aavailable device or device is already pairing.`) - return; - } - // start pairing - BluetoothModel.pairDevice(deviceId); - } - - /** - * Confirm pairing. - * - * @param deviceId device id - * @param accept accept or not - * @param success success callback - * @param error error callback - */ - confirmPairing(deviceId: string, accept: boolean): void { - if (accept) { - try { - this.getAvailableDevice(deviceId).connectionState = BondState.BOND_STATE_BONDING; - } catch (err) { - Logger.error(this.TAG + 'confirmPairing =' + JSON.stringify(err)); - } - } - // set paring confirmation - BluetoothModel.setDevicePairingConfirmation(deviceId, accept); - - } - - /** - * Connect device. - * @param deviceId device id - */ - connect(deviceId: string): Array<{ - profileId: number; - connectRet: boolean; - }> { - return BluetoothModel.connectDevice(deviceId); - } - - /** - * disconnect device. - * @param deviceId device id - */ - disconnect(deviceId: string): Array<{ - profileId: number; - disconnectRet: boolean; - }> { - return BluetoothModel.disconnectDevice(deviceId); - } - - /** - * Unpair device. - * @param deviceId device id - */ - unpair(deviceId: string): boolean { - AppStorage.SetOrCreate('BluetoothFailedDialogFlag', false); - const result = BluetoothModel.unpairDevice(deviceId); - Logger.info(this.TAG + 'bluetooth paired device unpair. result = ' + result) - this.refreshPairedDevices() - return result; - } - - /** - * Refresh paired devices. - */ - refreshPairedDevices() { - let deviceIds: string[] = BluetoothModel.getPairedDeviceIds(); - let list: BluetoothDevice[] = [] - deviceIds.forEach(deviceId => { - list.push(this.getDevice(deviceId)); - }); - this.pairedDevices = list; - this.sortPairedDevices(); - AppStorage.SetOrCreate('bluetoothPairedDevices', this.pairedDevices); - Logger.info(this.TAG + 'bluetooth paired devices. list length = ' + JSON.stringify(list.length)) - } - - /** - * Paired device should be shown on top of the list. - */ - private sortPairedDevices() { - Logger.info(this.TAG + 'sortPairedDevices in.') - this.pairedDevices.sort((a: BluetoothDevice, b: BluetoothDevice) => { - if (a.connectionState == ProfileConnectionState.STATE_DISCONNECTED && b.connectionState == ProfileConnectionState.STATE_DISCONNECTED) { - return 0 - } else if (b.connectionState == ProfileConnectionState.STATE_DISCONNECTED) { - return -1 - } else if (a.connectionState == ProfileConnectionState.STATE_DISCONNECTED) { - return 1 - } else { - return 0 - } - }) - Logger.info(this.TAG + 'sortPairedDevices out.') - } - - //---------------------- subscribe ---------------------- - /** - * Subscribe bluetooth state change - */ - private subscribeStateChange() { - BluetoothModel.subscribeStateChange((isOn: boolean) => { - Logger.info(this.TAG + 'bluetooth state changed. isOn = ' + isOn) - this.isOn = new Boolean(isOn).valueOf(); - this.enabled = true; - - Logger.info(this.TAG + 'bluetooth state changed. save value.') - AppStorage.SetOrCreate('bluetoothIsOn', this.isOn); - AppStorage.SetOrCreate('bluetoothToggleEnabled', this.enabled); - - if (isOn) { - Logger.info(this.TAG + 'bluetooth state changed. unsubscribe') - this.startBluetoothDiscovery(); - } else { - Logger.info(this.TAG + 'bluetooth state changed. subscribe') - this.mStopBluetoothDiscovery(); - } - }); - } - - /** - * Subscribe device find - */ - private subscribeBluetoothDeviceFind() { - BluetoothModel.subscribeBluetoothDeviceFind((deviceIds: Array) => { - Logger.info( this.TAG + 'available bluetooth devices changed.'); - - deviceIds?.forEach(deviceId => { - let device = this.availableDevices.find((availableDevice) => { - return availableDevice.deviceId === deviceId - }) - Logger.info(this.TAG + 'available bluetooth find'); - if (!device) { - let pairedDevice = this.pairedDevices.find((pairedDevice) => { - return pairedDevice.deviceId === deviceId - }) - if (pairedDevice) { - Logger.info(this.TAG + `available bluetooth is paried.`); - } else { - Logger.info(this.TAG + 'available bluetooth new device found. availableDevices length = ' + this.availableDevices.length); - let newDevice = this.getDevice(deviceId); - this.availableDevices.push(newDevice); - Logger.info(this.TAG + 'available bluetooth new device pushed. availableDevices length = ' + this.availableDevices.length); - } - } - }) - AppStorage.SetOrCreate('bluetoothAvailableDevices', this.availableDevices); - }); - } - - /** - * Subscribe bond state change - */ - private subscribeBondStateChange() { - BluetoothModel.subscribeBondStateChange((data: { - deviceId: string; - bondState: number; - }) => { - Logger.info(this.TAG + "data.bondState" + JSON.stringify(data.bondState)) - //paired devices - if (data.bondState !== BondState.BOND_STATE_BONDING) { - AppStorage.SetOrCreate("controlPairing", true) - this.refreshPairedDevices(); - } - - //available devices - if (data.bondState == BondState.BOND_STATE_BONDING) { - AppStorage.SetOrCreate("controlPairing", false) - // case bonding - // do nothing and still listening - Logger.info(this.TAG + 'bluetooth continue listening bondStateChange.'); - if (this.getAvailableDevice(data.deviceId) != null) { - this.getAvailableDevice(data.deviceId).connectionState = ProfileConnectionState.STATE_CONNECTING; - } - - } else if (data.bondState == BondState.BOND_STATE_INVALID) { - AppStorage.SetOrCreate("controlPairing", true) - // case failed - if (this.getAvailableDevice(data.deviceId) != null) { - this.getAvailableDevice(data.deviceId).connectionState = ProfileConnectionState.STATE_DISCONNECTED; - } - this.forceRefresh(this.availableDevices); - AppStorage.SetOrCreate('bluetoothAvailableDevices', this.availableDevices); - let showFlag = AppStorage.Get('BluetoothFailedDialogFlag'); - if (showFlag == false) { - AppStorage.SetOrCreate('BluetoothFailedDialogFlag', true); - return; - } - } else if (data.bondState == BondState.BOND_STATE_BONDED) { - // case success - Logger.info(this.TAG + 'bluetooth bonded : remove device.'); - this.removeAvailableDevice(data.deviceId); - BluetoothModel.connectDevice(data.deviceId); - } - - }); - } - - /** - * Subscribe device connect state change - */ - private subscribeDeviceConnectStateChange() { - BluetoothModel.subscribeDeviceStateChange((data: { - profileId: number; - deviceId: string; - profileConnectionState: number; - }) => { - Logger.info(this.TAG + 'device connection state changed. profileId:' + JSON.stringify(data.profileId) - + ' profileConnectionState: ' + JSON.stringify(data.profileConnectionState)); - for (let device of this.pairedDevices) { - if (device.deviceId === data.deviceId) { - device.setProfile(data); - this.sortPairedDevices(); - AppStorage.SetOrCreate('bluetoothPairedDevices', this.pairedDevices); - break; - } - }; - Logger.info(this.TAG + 'device connection state changed. pairedDevices length = ' - + JSON.stringify(this.pairedDevices.length)) - Logger.info(this.TAG + 'device connection state changed. availableDevices length = ' - + JSON.stringify(this.availableDevices.length)) - this.removeAvailableDevice(data.deviceId); - }); - } - - //---------------------- private ---------------------- - /** - * Get device by device id. - * @param deviceId device id - */ - protected getDevice(deviceId: string): BluetoothDevice { - let device = new BluetoothDevice(); - device.deviceId = deviceId; - device.deviceName = BluetoothModel.getDeviceName(deviceId); - device.deviceType = BluetoothModel.getDeviceType(deviceId); - device.setProfiles(BluetoothModel.getDeviceState(deviceId)); - return device; - } - - /** - * Force refresh array. - * Note: the purpose of this function is just trying to fix page (ets) level's bug below, - * and should be useless if fixed by the future sdk. - * Bug Details: - * @State is not supported well for Array type. - * In the case that the array item's field value changed, while not its length, - * the build method on page will not be triggered! - */ - protected forceRefresh(arr: BluetoothDevice[]): void { - arr.push(new BluetoothDevice()) - arr.pop(); - } - - /** - * Start bluetooth discovery. - */ - public startBluetoothDiscovery() { - this.isDeviceDiscovering = true; - BluetoothModel.startBluetoothDiscovery(); - - this.discoveryStopTimeoutId = setTimeout(() => { - this.stopBluetoothDiscovery(); - }, DISCOVERY_DURING_TIME); - } - - /** - * Stop bluetooth discovery. - */ - private stopBluetoothDiscovery() { - this.isDeviceDiscovering = false; - BluetoothModel.stopBluetoothDiscovery(); - - this.discoveryStartTimeoutId = setTimeout(() => { - this.startBluetoothDiscovery(); - }, DISCOVERY_INTERVAL_TIME); - } - - /** - * Stop bluetooth discovery. - */ - private mStopBluetoothDiscovery() { - this.isDeviceDiscovering = false; - BluetoothModel.stopBluetoothDiscovery(); - if (this.discoveryStartTimeoutId) { - clearTimeout(this.discoveryStartTimeoutId); - } - - if (this.discoveryStopTimeoutId) { - clearTimeout(this.discoveryStopTimeoutId); - } - } - - - /** - * Get available device. - * - * @param deviceId device id - */ - private getAvailableDevice(deviceIds: string): BluetoothDevice { - Logger.info(this.TAG + 'getAvailableDevice length = ' + this.availableDevices.length); - let temp = this.availableDevices; - for (let i = 0; i < temp.length; i++) { - if (temp[i].deviceId === deviceIds) { - return temp[i]; - } - } - return null; - } - - /** - * Remove available device. - * - * @param deviceId device id - */ - private removeAvailableDevice(deviceId: string): void { - Logger.info(this.TAG + 'removeAvailableDevice : before : availableDevices length = ' + this.availableDevices.length); - this.availableDevices = this.availableDevices.filter((device) => device.deviceId !== deviceId) - AppStorage.SetOrCreate('bluetoothAvailableDevices', this.availableDevices); - Logger.info(this.TAG + 'removeAvailableDevice : after : availableDevices length = ' + this.availableDevices.length); - } - - -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/entryability/EntryAbility.ts b/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/entryability/EntryAbility.ts deleted file mode 100644 index 8bf161ef..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/entryability/EntryAbility.ts +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -import UIAbility from '@ohos.app.ability.UIAbility'; -import hilog from '@ohos.hilog'; -import window from '@ohos.window'; -import abilityAccessCtrl from '@ohos.abilityAccessCtrl'; -import worker, { MessageEvents } from '@ohos.worker'; -import { GlobalContext } from '../common/GlobalThis'; - -const TAG = 'EntryAbility' -enum fileOperateType { - WRITE = 0, - READ = 1 -} -export default class EntryAbility extends UIAbility { - - onCreate(want, launchParam) { - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); - GlobalContext.getContext().setObject("context",this.context); - GlobalContext.getContext().setObject("pathDir", this.context.filesDir); - globalThis.nfc = 0; - } - - onDestroy() { - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage) { - // Main window is created, set main page for this ability - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - AppStorage.setOrCreate("writeTimeSpeed",0); - AppStorage.setOrCreate("readTimeSpeed",0); - AppStorage.setOrCreate("btnEnable",true); - let AtManager = abilityAccessCtrl.createAtManager(); - AtManager.requestPermissionsFromUser(this.context, ['ohos.permission.READ_MEDIA', 'ohos.permission.WRITE_MEDIA', - 'ohos.permission.CAPTURE_SCREEN', 'ohos.permission.INTERNET', 'ohos.permission.CAMERA', - 'ohos.permission.MICROPHONE', 'ohos.permission.START_INVISIBLE_ABILITY']).then(() => { - }); - windowStage.loadContent('pages/Index', (err, data) => { - if (err.code) { - hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); - return; - } - hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); - }); - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground() { - // Ability has brought to foreground - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground() { - // Ability has back to background - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); - } -} diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/model/BluetoothDevice.ts b/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/model/BluetoothDevice.ts deleted file mode 100644 index aa1fcd53..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/model/BluetoothDevice.ts +++ /dev/null @@ -1,90 +0,0 @@ -/** - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { ProfileConnectionState } from './BluetoothModel'; -export class Profile { - profileId: number = -1; - profileConnectionState: number = -1 - - constructor() { - } -} - -/** - * Bluetooth device class - */ -export default class BluetoothDevice { - deviceId: string = ''; - deviceName: string = ''; - deviceType: string = ''; - connectionState: number = 0; - profiles: Map = new Map(); - - constructor() { - } - - setProfiles(data: Array<{ - profileId: number; - profileConnectionState: number; - }>): void{ - - data.forEach((item: { - profileId: number; - profileConnectionState: number; - }) => { - this.setProfile({ - profileId: item.profileId, - deviceId: this.deviceId, - profileConnectionState: item.profileConnectionState - }) - }) - } - - setProfile(data: { - profileId: number; - deviceId: string; - profileConnectionState: number; - }): void{ - if (this.deviceId !== data.deviceId) { - return; - } - - this.profiles.set(data.profileId, data) - - let countStateDisconnect = 0; - let countStateConnecting = 0; - let countStateConnected = 0; - let countStateDisconnecting = 0; - - this.profiles.forEach((profile, key) => { - if (profile.profileConnectionState == ProfileConnectionState.STATE_DISCONNECTED) { - countStateDisconnect++; - } else if (profile.profileConnectionState == ProfileConnectionState.STATE_CONNECTING) { - countStateConnecting++; - } else if (profile.profileConnectionState == ProfileConnectionState.STATE_CONNECTED) { - countStateConnected++; - } else if (profile.profileConnectionState == ProfileConnectionState.STATE_DISCONNECTING) { - countStateDisconnecting++; - } - }); - - if (countStateConnected > 0 || countStateDisconnecting > 0) { - this.connectionState = ProfileConnectionState.STATE_CONNECTED; - } else if (countStateConnecting > 0) { - this.connectionState = ProfileConnectionState.STATE_CONNECTING; - } else { - this.connectionState = ProfileConnectionState.STATE_DISCONNECTED; - } - } -} diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/model/BluetoothModel.ts b/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/model/BluetoothModel.ts deleted file mode 100644 index df912f23..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/model/BluetoothModel.ts +++ /dev/null @@ -1,566 +0,0 @@ -/** - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import bluetooth from '@ohos.bluetooth'; -import bluetoothManager from '@ohos.bluetoothManager'; -import Logger from './Logger' - -export enum ProfileCode { - CODE_BT_PROFILE_A2DP_SINK = 0, - CODE_BT_PROFILE_A2DP_SOURCE, - CODE_BT_PROFILE_AVRCP_CT, - CODE_BT_PROFILE_AVRCP_TG, - CODE_BT_PROFILE_HANDS_FREE_AUDIO_GATEWAY, - CODE_BT_PROFILE_HANDS_FREE_UNIT, - CODE_BT_PROFILE_HID_HOST, - CODE_BT_PROFILE_PAN_NETWORK, - CODE_BT_PROFILE_PBAP_CLIENT, - CODE_BT_PROFILE_PBAP_SERVER, -}; - -export enum ProfileConnectionState { - /** the current profile is disconnected */ - STATE_DISCONNECTED = 0, - /** the current profile is being connected */ - STATE_CONNECTING = 1, - /** the current profile is connected */ - STATE_CONNECTED = 2, - /** the current profile is being disconnected */ - STATE_DISCONNECTING = 3 -} - -export enum BondState { - /** Indicate the bond state is invalid */ - BOND_STATE_INVALID = 0, - /** Indicate the bond state is bonding */ - BOND_STATE_BONDING = 1, - /** Indicate the bond state is bonded*/ - BOND_STATE_BONDED = 2 -} - -export enum DeviceType { - BLUETOOTH = '1', - HEADPHONE = '2', - PHONE = '3', - COMPUTER = '4', - WATCH = '5' -} - -export enum BluetoothErrorCode { - SUCCESS = -1, - HOLD_PAIRING_MODE = 1, - APP_PAIR = 2, - PAIR_FAILED = 3, - DEVICE_ILLEGAL = 4, - CONNECT_FAILED = 5 -} - -enum BluetoothState { - /** Indicates the local Bluetooth is off */ - STATE_OFF = 0, - /** Indicates the local Bluetooth is turning on */ - STATE_TURNING_ON = 1, - /** Indicates the local Bluetooth is on, and ready for use */ - STATE_ON = 2, - /** Indicates the local Bluetooth is turning off */ - STATE_TURNING_OFF = 3, - /** Indicates the local Bluetooth is turning LE mode on */ - STATE_BLE_TURNING_ON = 4, - /** Indicates the local Bluetooth is in LE only mode */ - STATE_BLE_ON = 5, - /** Indicates the local Bluetooth is turning off LE only mode */ - STATE_BLE_TURNING_OFF = 6 -} - -/** - * bluetooth service class - */ -export class BluetoothModel { - private TAG = 'BluetoothModel '; - private profiles: any[] = new Array(10); - public canUse: boolean = false; - - /** - * constructor - */ - constructor() { - try{ - Logger.info('bluetooth.getProfile start') - let ProfileId = bluetoothManager.ProfileId; - this.profiles[ProfileId.PROFILE_A2DP_SOURCE] - = bluetoothManager.getProfileInstance(ProfileId.PROFILE_A2DP_SOURCE); - this.profiles[ProfileId.PROFILE_HANDS_FREE_AUDIO_GATEWAY] - = bluetoothManager.getProfileInstance(ProfileId.PROFILE_HANDS_FREE_AUDIO_GATEWAY); - this.profiles[ProfileId.PROFILE_HID_HOST] - = bluetoothManager.getProfileInstance(ProfileId.PROFILE_HID_HOST); - Logger.info('bluetooth.getProfile end') - this.canUse = true; - } - catch(error){ - Logger.info('bluetooth.getProfile error') - this.canUse = false; - Logger.info(`BluetoothModel error: ${JSON.stringify(error)}.`); - } - } - - - /** - * Get Bluetooth status - * @return value of bluetooth.BluetoothState type - */ - getState(): number { - let bluetoothState = bluetooth.getState(); - Logger.info(`${this.TAG} getState: bluetoothState = ${bluetoothState}`); - return bluetoothState; - } - - /** - * Get Bluetooth switch status - */ - isStateOn(): boolean { - let result = false; - let state = bluetooth.getState(); - Logger.info(`${this.TAG} isStateOn: state = ${state}`); - switch (state) { - case BluetoothState.STATE_ON: - result = true - break; - default: - break; - } - Logger.info(`${this.TAG} isStateOn: bluetoothState = ${result}`); - return result; - } - - /** - * Subscribe Bluetooth switch status Change - */ - subscribeStateChange(callback: (data: boolean) => void): void { - Logger.info('bluetooth.subscribeStateChange start'); - bluetooth.on('stateChange', (data) => { - Logger.info(`${this.TAG} subscribeStateChange->stateChange data:${data}`); - if (callback) { - switch (data) { - case BluetoothState.STATE_ON: - bluetooth.setBluetoothScanMode(4, 0); - Logger.info(`${this.TAG} subscribeStateChange->stateChange return: true`); - callback(true) - break; - - case BluetoothState.STATE_OFF: - Logger.info(`${this.TAG} subscribeStateChange->stateChange return: false`); - callback(false) - break; - - default: - break; - } - } - }) - } - - /** - * unsubscribe Bluetooth switch status Change - */ - unsubscribeStateChange(callback?: (data: boolean) => void): void { - Logger.info('bluetooth.unsubscribeStateChange start'); - bluetooth.off('stateChange', (data) => { - Logger.info(`${this.TAG} unsubscribeStateChange->stateChange data:${data}`); - if (callback) { - let result = false; - switch (data) { - case BluetoothState.STATE_ON: - Logger.info(`${this.TAG} unsubscribeStateChange->stateChange return : true`); - callback(true) - break; - case BluetoothState.STATE_OFF: - Logger.info(`${this.TAG} unsubscribeStateChange->stateChange return : false`); - callback(false) - break; - default: - break; - } - } - }) - } - - /** - * Turn on Bluetooth - */ - - enableBluetooth(): boolean { - return bluetooth.enableBluetooth(); - } - - /** - * Turn off Bluetooth - */ - - disableBluetooth(): boolean { - return bluetooth.disableBluetooth(); - } - - /** - * Get local name - */ - getLocalName(): string { - return bluetooth.getLocalName(); - } - - /** - * Set local name - */ - setLocalName(name: string): boolean { - return bluetooth.setLocalName(name); - } - - /** - * Get paired device ids - */ - getPairedDeviceIds(): Array { - return bluetooth.getPairedDevices(); - } - - /** - * Start Bluetooth discovery - */ - - startBluetoothDiscovery(): boolean { - return bluetooth.startBluetoothDiscovery(); - } - - /** - * Stop Bluetooth discovery - */ - - stopBluetoothDiscovery(): boolean { - return bluetooth.stopBluetoothDiscovery(); - } - - /** - * Subscribe Bluetooth status Change - */ - subscribeBluetoothDeviceFind(callback: (data: Array) => void): void { - Logger.info('bluetooth.subscribeBluetoothDeviceFind start'); - bluetooth.on('bluetoothDeviceFind', (data: Array) => { - Logger.info(`${this.TAG} subscribeBluetoothDeviceFind->deviceFind callback`); - if (callback) { - callback(data) - } - }) - } - - /** - * unsubscribe Bluetooth status Change - */ - unsubscribeBluetoothDeviceFind(callback?: (data: Array) => void): void { - Logger.info('bluetooth.unsubscribeBluetoothDeviceFind start'); - bluetooth.off('bluetoothDeviceFind', (data) => { - Logger.info(`${this.TAG} unsubscribeBluetoothDeviceFind->deviceFind callback`); - if (callback) { - callback(data) - } - }) - } - - /** - * Pair device - */ - pairDevice(deviceId: string): boolean { - return bluetooth.pairDevice(deviceId); - } - - /** - * Subscribe PinRequired - */ - subscribePinRequired(callback: (data: { - deviceId: string; - pinCode: string; - }) => void): void { - Logger.info('bluetooth.subscribePinRequired start'); - bluetooth.on('pinRequired', (data: { - deviceId: string; - pinCode: string; - }) => { - Logger.info(`${this.TAG} subscribePinRequired->pinRequired return: ${data.pinCode}`); - if (callback) { - callback(data) - } - }) - } - - /** - * Unsubscribe PinRequired - */ - unsubscribePinRequired(callback?: (data: { - deviceId: string; - pinCode: string; - }) => void): void { - Logger.info('bluetooth.unsubscribePinRequired start'); - bluetooth.off('pinRequired', (data: { - deviceId: string; - pinCode: string; - }) => { - if(data == undefined || !data){ - Logger.error(`${this.TAG} unsubscribePinRequired->pinRequired error`); - return; - } - Logger.info(`${this.TAG} unsubscribePinRequired->pinRequired return: ${data.pinCode}`); - if (callback) { - callback(data) - } - }) - } - - /** - * Set device PairingConfirmation - */ - setDevicePairingConfirmation(deviceId: string, accept: boolean): boolean { - Logger.info('bluetooth.setDevicePairingConfirmation start, accept:' + accept); - let ret = bluetooth.setDevicePairingConfirmation(deviceId, accept); - Logger.info('bluetooth.unsubscribePinRequired end, ret: ' + ret); - return ret; - } - - /** - * Subscribe bondStateChange - */ - subscribeBondStateChange(callback): void { - Logger.info('bluetooth.subscribeBondStateChange start'); - bluetooth.on('bondStateChange', (data) => { - Logger.info(`${this.TAG} subscribeBondStateChange->bondStateChange data.state:${JSON.stringify(data.state)}`); - if (callback) { - let result = { - deviceId: data.deviceId, - bondState: data.state - } - Logger.info(`${this.TAG} subscribeBondStateChange->bondStateChange return:${JSON.stringify(result.bondState)}`); - callback(result); - } - }) - } - - /** - * Unsubscribe bondStateChange - */ - unsubscribeBondStateChange(callback?: (data: { - deviceId: string; - bondState: number; - }) => void): void { - bluetooth.off('bondStateChange', (data) => { - Logger.info(`${this.TAG} unsubscribeBondStateChange->bondStateChange start`); - if (callback) { - let result = { - deviceId: data.deviceId, - bondState: data.state - } - Logger.info(`${this.TAG} unsubscribeBondStateChange->bondStateChange return:${JSON.stringify(result.bondState)}`); - callback(result); - } - }) - } - - /** - * Get device name - */ - getDeviceName(deviceId: string): string { - return bluetooth.getRemoteDeviceName(deviceId); - } - - /** - * Get device type - */ - getDeviceType(deviceId: string): string { - let deviceType = DeviceType.BLUETOOTH; - let deviceClass = bluetooth.getRemoteDeviceClass(deviceId); - switch (deviceClass.majorClass) { - case 0x0100: - deviceType = DeviceType.COMPUTER; - break; - case 0x0400: - if (deviceClass.majorMinorClass === 0x0418 || deviceClass.majorMinorClass === 0x0404) { - deviceType = DeviceType.HEADPHONE; - } - break; - case 0x0700: - if (deviceClass.majorMinorClass === 0x0704) { - deviceType = DeviceType.WATCH; - } - break; - case 0x0200: - deviceType = DeviceType.PHONE; - break; - default: - deviceType = DeviceType.BLUETOOTH; - break; - } - Logger.info('bluetooth.getDeviceType end, return:' + deviceType); - return deviceType; - } - - /** - * Get device state - */ - getDeviceState(deviceId: string): Array<{ - profileId: number; - profileConnectionState: number; - }> { - let result = []; - for (let i = 0;i < this.profiles.length; i++) { - if (this.profiles[i]) { - try { - let state = this.profiles[i].getDeviceState(deviceId); - result.push({ - profileId: i, - profileConnectionState: state - }); - } catch (BusinessError) { - Logger.error("Bluetooth getDeviceState failed , BusinessError is " + JSON.stringify(BusinessError)) - } - } - } - return result; - } - - /** - * Unpair device - */ - unpairDevice(deviceId: string): boolean { - return bluetooth.cancelPairedDevice(deviceId); - } - - /** - * Connect device - */ - connectDevice(deviceId: string): Array<{ - profileId: number; - connectRet: boolean; - }> { - Logger.info('bluetooth.connectDevice start'); - let result = []; - for (let i = 0;i < this.profiles.length; i++) { - if (this.profiles[i]) { - let profile = this.profiles[i]; - let connectRet = true; - try { - profile.connect(deviceId); - } catch (BusinessError) { - Logger.info(`${this.TAG} connect failed. BusinessError is ` + JSON.stringify(BusinessError)); - connectRet = false; - } - result.push({ - profileId: i, - connectRet: connectRet - }); - } - } - Logger.info('bluetooth.connectDevice end, return:' + result); - return result; - } - - /** - * Disconnect device - */ - disconnectDevice(deviceId: string): Array<{ - profileId: number; - disconnectRet: boolean; - }> { - Logger.info('bluetooth.disconnectDevice start'); - let result = []; - for (let i = 0;i < this.profiles.length; i++) { - let profile = this.profiles[i]; - if (this.profiles[i]) { - let profileConnectionState = profile.getDeviceState(deviceId); - let disconnectRet = true; - Logger.info(`${this.TAG} disconnectDevice , connectionState = ${profileConnectionState}`); - if (profileConnectionState === 2) { - try { - profile.disconnect(deviceId); - } catch (BusinessError) { - Logger.info(`${this.TAG} disconnect failed. BusinessError is ` + JSON.stringify(BusinessError)); - disconnectRet = false; - } - } - result.push({ - profileId: i, - disconnectRet: disconnectRet - }); - } - } - Logger.info('bluetooth.connectDevice end, return:' + result); - return result; - } - - /** - * Subscribe device connection state Change - */ - subscribeDeviceStateChange(callback: (data: { - profileId: number; - deviceId: string; - profileConnectionState: number; - }) => void): void { - for (let i = 0;i < this.profiles.length; i++) { - if (this.profiles[i]) { - let profile = this.profiles[i]; - profile.on('connectionStateChange', (data) => { - if (callback) { - let result = { - profileId: i, - deviceId: data.deviceId, - profileConnectionState: data.state - }; - Logger.info(`${this.TAG} subscribeDeviceStateChange->connectionStateChange, - return:${result.profileId} - ${result.profileConnectionState}`); - callback(result); - } - }) - } - } - } - - /** - * unsubscribe device connection state Change - */ - unsubscribeDeviceStateChange(callback?: (data: { - profileId: number; - deviceId: string; - profileConnectionState: number; - }) => void): void { - for (let i = 0;i < this.profiles.length; i++) { - if (this.profiles[i]) { - let profile = this.profiles[i]; - profile.off('connectionStateChange', (data) => { - if(data == undefined || !data){ - Logger.error(`${this.TAG} unsubscribeDeviceStateChange->connectionStateChange error`); - return; - } - if (callback) { - let result = { - profileId: i, - deviceId: data.deviceId, - profileConnectionState: data.state - }; - Logger.info(`${this.TAG} unsubscribeDeviceStateChange->connectionStateChange, - return:${result.profileId} - ${result.profileConnectionState}`); - callback(result); - } - }) - } - } - } -} - -let bluetoothModel = new BluetoothModel(); - -export default bluetoothModel as BluetoothModel; \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/model/DateTimeUtil.ts b/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/model/DateTimeUtil.ts deleted file mode 100644 index b84cfbdc..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/model/DateTimeUtil.ts +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file 日期工具 - */ -export default class DateTimeUtil { - - /** - * 时分秒 - */ - getTime() { - const DATETIME = new Date() - return this.concatTime(DATETIME.getHours(), DATETIME.getMinutes(), DATETIME.getSeconds()) - } - getHour() { - const DATETIME = new Date() - return DATETIME.getHours() - } - getMinute() { - const DATETIME = new Date() - return DATETIME.getMinutes() - } - getSecond() { - const DATETIME = new Date() - return DATETIME.getSeconds() - } - - /** - * 年月日 - */ - getDate() { - const DATETIME = new Date() - return this.concatDate(DATETIME.getFullYear(), DATETIME.getMonth() + 1, DATETIME.getDate()) - } - getFullYear() { - const DATETIME = new Date() - return DATETIME.getFullYear() - } - getMonth() { - const DATETIME = new Date() - return DATETIME.getMonth() + 1 - } - getDay() { - const DATETIME = new Date() - return DATETIME.getDate() - } - - /** - * 日期不足两位补充0 - * @param value-数据值 - */ - fill(value: number) { - return (value > 9 ? '' : '0') + value - } - - /** - * 年月日格式修饰 - * @param year - * @param month - * @param date - */ - concatDate(year: number, month: number, date: number) { - return `${year}${this.fill(month)}${this.fill(date)}` - } - - /** - * 时分秒格式修饰 - * @param hours - * @param minutes - * @param seconds - */ - concatTime(hours: number, minutes: number, seconds: number) { - return `${this.fill(hours)}${this.fill(minutes)}${this.fill(seconds)}` - } - - getDurationString(duration: number) { - let hour = Math.floor(duration / (1000 * 60 * 60)) - let minute = Math.floor((duration - hour * (1000 * 60 * 60)) / (1000 * 60)) - let second = Math.floor((duration - hour * (1000 * 60 * 60) - minute * (60 * 1000)) / 1000) - if (hour > 0) { - return `${this.fill(hour)}:${this.fill(minute)}:${this.fill(second)}` - } - return `${this.fill(minute)}:${this.fill(second)}` - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/model/Logger.ts b/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/model/Logger.ts deleted file mode 100644 index 281f1cdf..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/model/Logger.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import hilog from '@ohos.hilog'; - -class Logger { - private domain: number; - private prefix: string; - private format: string = "%{public}s, %{public}s"; - - constructor(prefix: string) { - this.prefix = prefix; - this.domain = 0xFF00; - } - - debug(...args: any[]) { - hilog.debug(this.domain, this.prefix, this.format, args); - } - - info(...args: any[]) { - hilog.info(this.domain, this.prefix, this.format, args); - } - - warn(...args: any[]) { - hilog.warn(this.domain, this.prefix, this.format, args); - } - - error(...args: any[]) { - hilog.error(this.domain, this.prefix, this.format, args); - } -} - -export default new Logger('[Factory]'); \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/model/LoggerEts.ets b/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/model/LoggerEts.ets deleted file mode 100644 index 4cff9fea..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/model/LoggerEts.ets +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -class Logger { - private prefix: string - - constructor(prefix: string) { - this.prefix = prefix - } - - log(...args: string[]) { - console.log(`[${this.prefix}].${args.join(' ')}`) - } - - info(...args: string[]) { - console.log(`[${this.prefix}].${args.join(' ')}`) - } - - debug(...args: string[]) { - console.log(`[${this.prefix}].${args.join(' ')}`) - } - - error(...args: string[]) { - console.log(`[${this.prefix}].${args.join(' ')}`) - } -} - -export default new Logger('[Sample_Wlan]') \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/model/Utils.ts b/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/model/Utils.ts deleted file mode 100644 index 91d1e49c..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/model/Utils.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export function getTimeString(timeIndex: number, index: number) { - let result = timeIndex + index - 3 - if (result < 0) { - return ' ' - } - if (result % 60 < 10) { - return '0' + Math.floor(result / 60) + ':0' + (result % 60) - } - if (result % 60 >= 10) { - return '0' + Math.floor(result / 60) + ':' + (result % 60) - } -} - -export function updateTime(millisecond: number) { - let minute = parseInt((millisecond / 60000).toString()) - let second = parseInt(((millisecond - (minute * 60000)) / 1000).toString()) - let minuteStr = '' + minute - let secondStr = '' + second - if (minute < 10) { - minuteStr = "0" + minute - } - if (second < 10) { - secondStr = "0" + second - } - return minuteStr + ':' + secondStr; -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/model/WifiModel.ets b/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/model/WifiModel.ets deleted file mode 100644 index b4bc42e4..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/model/WifiModel.ets +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import prompt from '@ohos.promptAction' -import wifi from '@ohos.wifiManager' -import Logger from './LoggerEts' - -const TAG: string = 'WiFiModel' - -export interface WifiType { - ssid: string, - bssid: string, - securityType: wifi.WifiSecurityType, - rssi: number, - band: number, - frequency: number, - timestamp: number -} - -export class WifiModel { - async getScanInfos(): Promise> { - Logger.info(TAG, 'scanWifi begin') - let wifiList: Array = [] - let result: Array = [] - try { - result = await wifi.getScanResults() - } catch (err) { - Logger.info(TAG, `scan info err: ${JSON.stringify(err)}`) - return wifiList - } - Logger.info(TAG, `scan info call back: ${result.length}`) - for (let i = 0; i < result.length; ++i) { - wifiList.push({ - ssid: result[i].ssid, - bssid: result[i].bssid, - securityType: result[i].securityType, - rssi: result[i].rssi, - band: result[i].band, - frequency: result[i].frequency, - timestamp: result[i].timestamp - }) - } - return wifiList - } - - connectNetwork(scanInfo: wifi.WifiScanInfo, psw: string) { - prompt.showToast({ message: 'connecting', duration: 5000 }) - Logger.debug(TAG, `connectNetwork bssid=${scanInfo.bssid}`) - // 这里因为api问题,需要声明为any,已提单 - let deviceConfig: wifi.WifiDeviceConfig = { - ssid: scanInfo.ssid, - bssid: scanInfo.bssid, - preSharedKey: psw, - isHiddenSsid: false, - securityType: scanInfo.securityType - } - try { - wifi.connectToDevice(deviceConfig) - Logger.debug(TAG, `connectToDevice success`) - } catch (err) { - Logger.debug(TAG, `connectToDevice fail err is ${JSON.stringify(err)}`) - } - try { - wifi.addDeviceConfig(deviceConfig) - } catch (err) { - Logger.debug(TAG, `addDeviceConfig fail err is ${JSON.stringify(err)}`) - } - } - - resolveIP(ip: number) { - let address: string = ip.toString() - if (address === '0') { - return '00:00:000:000' - } - address.substring(0, 2) - return `${address.substring(0, 2)}:${address.substring(2, 4)}:${address.substring(4, 7)}:${address.substring(7, 10)}` - } - - getIpInfo() { - let ipInfoMap: Map = new Map(); - let ipInfo = wifi.getIpInfo() - Logger.info(`${TAG} getIpInfo=${JSON.stringify(ipInfo)}`) - ipInfoMap.set($r('app.string.ip_address'), this.resolveIP(ipInfo.ipAddress)) - ipInfoMap.set($r('app.string.gate_way'), this.resolveIP(ipInfo.gateway)) - ipInfoMap.set($r('app.string.net_mask'), this.resolveIP(ipInfo.netmask)) - ipInfoMap.set($r('app.string.primary_dns'), this.resolveIP(ipInfo.primaryDns)) - ipInfoMap.set($r('app.string.second_dns'), this.resolveIP(ipInfo.secondDns)) - ipInfoMap.set($r('app.string.server_ip'), this.resolveIP(ipInfo.serverIp)) - ipInfoMap.set($r('app.string.lease_duration'), ipInfo.leaseDuration.toString()) - return ipInfoMap - } - - getCountryCode() { - let countryCodeList: Map = new Map(); - let countryCode = wifi.getCountryCode() - countryCodeList.set($r('app.string.country_code'), countryCode) - return countryCodeList - } - - getFeatureSupport() { - let featureSupportedList: Map = new Map(); - featureSupportedList.set($r('app.string.infrastructure_feature'), wifi.isFeatureSupported(0x0001).toString() - ) - featureSupportedList.set($r('app.string.ghz_feature'), wifi.isFeatureSupported(0x0002).toString()) - featureSupportedList.set($r('app.string.gas_anqp_feature'), wifi.isFeatureSupported(0x0004).toString()) - featureSupportedList.set($r('app.string.wifi_direct'), wifi.isFeatureSupported(0x0008).toString()) - featureSupportedList.set($r('app.string.soft_ap'), wifi.isFeatureSupported(0x0010).toString()) - featureSupportedList.set($r('app.string.wifi_aware'), wifi.isFeatureSupported(0x0040).toString()) - return featureSupportedList - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/model/deviceInfos.ts b/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/model/deviceInfos.ts deleted file mode 100644 index 1baec4be..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/model/deviceInfos.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -import deviceInfo from '@ohos.deviceInfo' -import statvfs from '@ohos.file.statvfs' -import systemparameter from '@ohos.systemParameterEnhance' -import deviceinfonapi from '@ohos.deviceinfonapi' -import { GlobalContext } from '../common/GlobalThis' - -export class deviceInfos { - public osFullName; // 系统版本 - public sdkApiVersion; // 系统软件API版本 - public deviceType; // 设备类型 - public cpuFrequency; // cpu频率 - public cpuModule; // cpu型号 - public memCapacity; // 内存容量 - public stoCapacity; // 存储容量 - public usedCapacity; // 已使用存储容量 - public freeCapacity; // 剩余容量 - public manufacture;// 设备厂家名称 - public marketName;// 外部产品系列 - public productSeries;// 产品系列 - - constructor() { - - } - bytesToMB(bytes) { return bytes / (1024 * 1024);} - async init(){ - this.osFullName = deviceInfo.osFullName; - this.sdkApiVersion = await systemparameter.get('const.ohos.apiversion'); - this.deviceType = deviceInfo.deviceType; - this.cpuFrequency = (await deviceinfonapi.get_cpu_frequency()/1000).toFixed(0).toString()+ 'MHZ'; - this.cpuModule = await systemparameter.get('const.product.cpu.abilist'); - // 内存容量 - this.memCapacity = this.bytesToMB(await deviceinfonapi.get_mem_capacity()).toFixed(0) + 'M'; - let filesDir = GlobalContext.getContext().getObject('pathDir') as string; - // 存储容量 - let stoCapacityBite = await statvfs.getTotalSize(filesDir); - this.stoCapacity = this.bytesToMB(stoCapacityBite).toFixed(0) + 'M'; - // 剩余容量 - let freeCapacityBite = await statvfs.getFreeSize(filesDir); - this.freeCapacity = this.bytesToMB(freeCapacityBite).toFixed(0) + 'M'; - this.usedCapacity = this.bytesToMB(stoCapacityBite - freeCapacityBite).toFixed(0) + 'M'; - this.manufacture = deviceInfo.manufacture; - this.marketName = deviceInfo.marketName; - this.productSeries = deviceInfo.productSeries; - - } -} diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/Camera/CameraService.ts b/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/Camera/CameraService.ts deleted file mode 100644 index cea1cfe1..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/Camera/CameraService.ts +++ /dev/null @@ -1,455 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -// @ts-nocheck - -import camera from '@ohos.multimedia.camera' -import deviceInfo from '@ohos.deviceInfo' -import fileio from '@ohos.fileio' -import image from '@ohos.multimedia.image' -import media from '@ohos.multimedia.media' -import mediaLibrary from '@ohos.multimedia.mediaLibrary' -import Logger from '../../model/Logger' -import MediaUtils from './MediaUtils' -import ThumbnailGetter from './ThumbnailGetter' -import { GlobalContext } from '../../common/GlobalThis' -import { Context } from '@ohos.abilityAccessCtrl' - -const CameraSize = { - WIDTH: 1280, - HEIGHT: 720 -} -const TAG = 'CameraService' - -class CameraService { - private static instance: CameraService = new CameraService() - private mediaUtil = MediaUtils.getInstance() - private cameraManager: camera.CameraManager = undefined - cameras: Array = undefined - private cameraInput: camera.CameraInput = undefined - private previewOutput: camera.PreviewOutput = undefined - private photoOutput: camera.PhotoOutput = undefined - private cameraOutputCapability: camera.CameraOutputCapability = undefined - private captureSession: camera.CaptureSession = undefined - private mReceiver: image.ImageReceiver = undefined - private videoPrepareFile: mediaLibrary.FileAsset = undefined - private mFileAssetId = 0 - private avRecorder: media.AVRecorder = undefined - private videoOutput: camera.VideoOutput = undefined - private mThumbnailGetter = new ThumbnailGetter() - private handleTakePicture: (photoUri: string) => void = undefined - private videoConfig: any = { - audioSourceType: 1, - videoSourceType: 1, - profile: { - audioBitrate: 48000, - audioChannels: 1, - audioCodec: 'audio/mp4a-latm', - audioSampleRate: 48000, - fileFormat: 'mp4', - videoBitrate: 280000, - videoCodec: 'video/avc', - videoFrameWidth: 640, - videoFrameHeight: 480, - videoFrameRate: 30, - }, - rotation: 0, - url: '', - orientationHint: 0, - location: { latitude: 30, longitude: 130 }, - } - private videoProfileObj: camera.VideoProfile = { - format: 1, - size: { - "width": 640, - "height": 480 - }, - frameRateRange: { - "min": 5, - "max": 5 - } - } - private photoProfileObj: camera.Profile = { - format: 1, - size: { - "width": 640, - "height": 480 - } - } - private videoOutputStopBol: boolean = true - resolution: any = null - photoResolution: any = null - videoResolution: any = null - - constructor() { - try { - this.mReceiver = image.createImageReceiver(CameraSize.WIDTH, CameraSize.HEIGHT, image.ImageFormat.JPEG, 8) - Logger.info(TAG, 'createImageReceiver') - this.mReceiver.on('imageArrival', () => { - Logger.info(TAG, 'imageArrival') - this.mReceiver.readNextImage((err, image) => { - Logger.info(TAG, 'readNextImage') - if (err || image === undefined) { - Logger.error(TAG, 'failed to get valid image') - return - } - image.getComponent(4, (errMsg, img) => { - Logger.info(TAG, 'getComponent') - if (errMsg || img === undefined) { - Logger.info(TAG, 'failed to get valid buffer') - return - } - let buffer - if (img.byteBuffer) { - buffer = img.byteBuffer - } else { - Logger.error(TAG, 'img.byteBuffer is undefined') - } - this.savePicture(buffer, image) - }) - }) - }) - } catch (err) { - Logger.info(TAG, `image Receiver err ${err.message}`) - } - } - - async savePicture(buffer: ArrayBuffer, img: image.Image) { - try { - Logger.info(TAG, 'savePicture') - let imgFileAsset = await this.mediaUtil.createAndGetUri(mediaLibrary.MediaType.IMAGE) - let imgPhotoUri = imgFileAsset.uri - Logger.info(TAG, `photoUri = ${imgPhotoUri}`) - let imgFd = await this.mediaUtil.getFdPath(imgFileAsset) - Logger.info(TAG, `fd = ${imgFd}`) - await fileio.write(imgFd, buffer) - await imgFileAsset.close(imgFd) - await img.release() - Logger.info(TAG, 'save image done') - if (this.handleTakePicture) { - this.handleTakePicture(imgPhotoUri) - } - } catch (err) { - Logger.info(TAG, `save picture err ${err.message}`) - } - } - - public async createVideoFd(): Promise { - Logger.info(TAG, `getVideoFd E`) - try { - let dataUri = await this.mediaUtil.createAndGetUri(mediaLibrary.MediaType.VIDEO) - this.videoPrepareFile = await this.mediaUtil.queryFile(dataUri); - const fdNumber = await this.videoPrepareFile.open('Rw') - return fdNumber; - } catch (err) { - Logger.error(TAG, `createVideoFd err: ` + err) - } - Logger.info(TAG, `getVideoFd X`) - } - - async initCamera(surfaceId: number, cameraDeviceIndex: number, obj?, photoIndex?, previewObj?) { - try { - if (deviceInfo.deviceType === 'default') { - this.videoConfig.videoSourceType = 1 - } else { - this.videoConfig.videoSourceType = 1 - } - Logger.info(TAG, `cameraDeviceIndex success: ${cameraDeviceIndex}`) - await this.releaseCamera() - await this.getCameraManagerFn() - await this.getSupportedCamerasFn() - await this.getSupportedOutputCapabilityFn(cameraDeviceIndex) - if (previewObj) { - previewObj.format = this.cameraOutputCapability.previewProfiles[0].format - Logger.info(TAG, `previewObj format: ${previewObj.format}`) - } - await this.createPreviewOutputFn(previewObj ? previewObj : this.cameraOutputCapability.previewProfiles[0], surfaceId) - await this.createPhotoOutputFn(obj ? obj : this.cameraOutputCapability.photoProfiles[photoIndex?photoIndex:0]) - await this.createCameraInputFn(this.cameras[cameraDeviceIndex]) - await this.cameraInputOpenFn() - await this.sessionFlowFn() - - } catch (err) { - Logger.info(TAG, 'initCamera err: ' + JSON.stringify(err.message)) - } - } - - setTakePictureCallback(callback) { - this.handleTakePicture = callback - } - // 拍照 - async takePicture(imageRotation?) { - try { - Logger.info(TAG, 'takePicture start') - let photoSettings = { - rotation: imageRotation ? Number(imageRotation) : 0, - quality: 1, - location: { - latitude: 0, - longitude: 0, - altitude: 0 - }, - mirror: false - } - Logger.info(TAG, `photoOutput capture photoSettings: ` + JSON.stringify(photoSettings)) - await this.photoOutput.capture(photoSettings) - Logger.info(TAG, 'takePicture end') - } catch (err) { - Logger.info(TAG, `takePicture fail err: ${err}, message: ${err.message}, code: ${err.code}`) - } - } - - public async createVideoOutput() { - Logger.info(TAG, `createVideoOutput start`) - Logger.info(TAG, `createVideoOutput saveCameraAsset: ${this.mSaveCameraAsset}`) - this.mFileAssetId = await this.createVideoFd() - this.videoConfig.url = `fd://${this.mFileAssetId.toString()}` - await media.createAVRecorder().then((recorder) => { - Logger.info(TAG, `createVideoOutput createAVRecorder record: ${recorder}`) - this.avRecorder = recorder - }) - if (this.avRecorder != null) { - this.avRecorder.on('error', (error) => { - if (error) { - Logger.error(TAG, `createVideoOutput error: ${JSON.stringify(error)}`) - } - }) - Logger.info(TAG, `createVideoOutput size = ${JSON.stringify(this.cameraOutputCapability.videoProfiles[0].size)}`) - this.videoConfig.profile.videoFrameWidth = this.cameraOutputCapability.videoProfiles[0].size.width - this.videoConfig.profile.videoFrameHeight = this.cameraOutputCapability.videoProfiles[0].size.height - Logger.info(TAG, `createVideoOutput videoConfig: ` + JSON.stringify(this.videoConfig)) - await this.avRecorder.prepare(this.videoConfig) - Logger.info(TAG, `createVideoOutput AVRecorder.prepare succeed.`) - } else { - Logger.error(TAG, `createVideoOutput createAVRecorder failed.`) - return - } - - const videoId = await this.avRecorder.getInputSurface() - Logger.info(`${this.TAG} createVideoOutput profileVideo = ${JSON.stringify(this.cameraOutputCapability.videoProfiles[0])}.`) - try { - this.videoOutput = this.cameraManager.createVideoOutput(this.cameraOutputCapability.videoProfiles[0], videoId) - } catch (error) { - Logger.error(TAG, `createVideoOutput failed: ${JSON.stringify(error)}`) - } - Logger.info(TAG, `createVideoOutput end`) - } - // 开始录制 - async StartRecording() { - try { - Logger.info(TAG, `StartRecording begin`) - await this.captureSession.stop() - this.captureSession.beginConfig() - // if (this.videoOutput) { - // await this.captureSession.removeOutput(this.videoOutput) - // Logger.info(TAG, `old videoOutput has been removed.`) - // } - await this.createVideoOutput() - this.captureSession.addOutput(this.videoOutput) - Logger.info(TAG, `StartRecording addOutput finished.`) - await this.captureSession.commitConfig() - Logger.info(TAG, `StartRecording commitConfig finished.`) - await this.captureSession.start() - Logger.info(TAG, `StartRecording Session.start finished.`) - } catch (err) { - Logger.info(TAG, `remove videoOutput ${err}`) - } - await this.videoOutput.start().then(() => { - Logger.info(TAG, `videoOutput.start()`) - }) - await this.avRecorder.start().then(() => { - Logger.info(TAG, `AVRecorder.start()`) - }) - Logger.info(TAG, `StartRecording end`) - } - // 停止录制 - async stopRecording() { - if (!this.videoOutput || !this.avRecorder) { - Logger.error(TAG, `stopRecording error videoOutPut: ${this.videoOutput},AVRecorder: ${this.avRecorder} .`) - return - } - try { - await this.avRecorder.stop() - await this.avRecorder.release() - } catch (err) { - Logger.error(TAG, `stop AVRecorder ${err}`) - } - - try { - await this.videoOutput.stop() - } catch (err) { - Logger.error(TAG, `stop videoOutput ${err}`) - } - - if (this.mFileAssetId != undefined) { - await this.videoPrepareFile.close(this.mFileAssetId) - this.mFileAssetId = undefined - Logger.info(TAG, `fileAsset.close().`) - } - - const thumbnailPixelMap = await this.mThumbnailGetter.getThumbnailInfo(1280, 960) - Logger.info(TAG, `stopRecording invoke X.`) - return thumbnailPixelMap - } - // 查询相机设备在模式下支持的输出能力 - async getSupportedOutputCapabilityFn(cameraDeviceIndex) { - Logger.info(TAG, `cameraOutputCapability cameraId: ${this.cameras[cameraDeviceIndex].cameraId}`) - // @ts-ignore - this.cameraOutputCapability = this.cameraManager.getSupportedOutputCapability(this.cameras[cameraDeviceIndex]) - let previewSize = [] - let photoSize = [] - let videoSize = [] - this.cameraOutputCapability.previewProfiles.forEach((item, index) => { - Logger.info(TAG, `cameraOutputCapability previewProfiles index: ${index}, item:` + JSON.stringify(item)) - previewSize.push({ - value: `${item.size.width}x${item.size.height}` - }) - }) - this.cameraOutputCapability.photoProfiles.forEach((item, index) => { - Logger.info(TAG, `cameraOutputCapability photoProfiles index: ${index}, item:` + JSON.stringify(item)) - photoSize.push({ - value: `${item.size.width}x${item.size.height}` - }) - }) - this.cameraOutputCapability.videoProfiles.forEach((item, index) => { - Logger.info(TAG, `cameraOutputCapability videoProfiles index: ${index}, item:` + JSON.stringify(item)) - videoSize.push({ - value: `${item.size.width}x${item.size.height}` - }) - }) - Logger.info(TAG, `cameraOutputCapability previewProfiles:` + JSON.stringify(this.cameraOutputCapability.previewProfiles)) - Logger.info(TAG, `cameraOutputCapability photoProfiles:` + JSON.stringify(this.cameraOutputCapability.photoProfiles)) - Logger.info(TAG, `cameraOutputCapability videoProfiles:` + JSON.stringify(this.cameraOutputCapability.videoProfiles)) - Logger.info(TAG, `cameraOutputCapability previewProfiles previewSize:` + JSON.stringify(previewSize)) - this.resolution = previewSize - this.photoResolution = photoSize - this.videoResolution = videoSize - return previewSize - } - // 释放会话及其相关参数 - async releaseCamera() { - try { - if (this.cameraInput) { - await this.cameraInput.release() - } - if (this.previewOutput) { - await this.previewOutput.release() - } - if (this.photoOutput) { - await this.photoOutput.release() - } - if (this.videoOutput) { - await this.videoOutput.release() - } - if (this.captureSession) { - await this.captureSession.release() - } - Logger.info(TAG, `releaseCamera success`) - } catch (err) { - Logger.info(TAG, `releaseCamera fail err: ${err}, message: ${err.message}, code: ${err.code}`) - } - } - // 释放会话 - async releaseSession() { - await this.previewOutput.stop() - await this.photoOutput.release() - await this.captureSession.release() - Logger.info(TAG, `releaseSession success`) - } - // 获取相机管理器实例 - async getCameraManagerFn() { - try { - this.cameraManager = await camera.getCameraManager(GlobalContext.getContext().getObject("context") as Context) - Logger.info(TAG, `getCameraManager success: ` + JSON.stringify(this.cameraManager)) - } catch (err) { - Logger.info(TAG, `getCameraManagerFn fail err: ${err}, message: ${err.message}, code: ${err.code}`) - } - } - // 获取支持指定的相机设备对象 - async getSupportedCamerasFn() { - try { - this.cameras = await this.cameraManager.getSupportedCameras() - Logger.info(TAG, `getSupportedCameras success: ` + JSON.stringify(this.cameras)) - Logger.info(TAG, `getSupportedCameras length success: ${this.cameras.length}`) - } catch (err) { - Logger.info(TAG, `getSupportedCamerasFn fail err: ${err}, message: ${err.message}, code: ${err.code}`) - } - } - // 创建previewOutput输出对象 - async createPreviewOutputFn(previewProfilesObj, surfaceId) { - try { - Logger.info(TAG, `createPreviewOutputFn previewProfilesObj success: ` + JSON.stringify(previewProfilesObj)) - this.previewOutput = await this.cameraManager.createPreviewOutput(previewProfilesObj, surfaceId.toString()) - Logger.info(TAG, `createPreviewOutputFn success: ` + JSON.stringify(this.previewOutput)) - } catch (err) { - Logger.info(TAG, `createPreviewOutputFn fail err: ${err}, message: ${err.message}, code: ${err.code}`) - } - } - // 创建photoOutput输出对象 - async createPhotoOutputFn(photoProfileObj) { - try { - Logger.info(TAG, `createPhotoOutputFn photoProfileObj success: ` + JSON.stringify(photoProfileObj)) - let mSurfaceId = await this.mReceiver.getReceivingSurfaceId() - this.photoOutput = await this.cameraManager.createPhotoOutput(photoProfileObj, mSurfaceId) - Logger.info(TAG, `createPhotoOutputFn success: ` + JSON.stringify(this.photoOutput)) - } catch (err) { - Logger.info(TAG, `createPhotoOutputFn fail err: ${err}, message: ${err.message}, code: ${err.code}`) - } - } - // 创建cameraInput输出对象 - async createCameraInputFn(cameraDeviceIndex) { - try { - this.cameraInput = await this.cameraManager.createCameraInput(cameraDeviceIndex) - Logger.info(TAG, `createCameraInputFn success: ${this.cameraInput}`) - } catch (err) { - Logger.info(TAG, `createCameraInputFn fail err: ${err}, message: ${err.message}, code: ${err.code}`) - } - } - // 打开相机 - async cameraInputOpenFn() { - await this.cameraInput.open() - .then((data) => { - Logger.info(TAG, `cameraInputOpenFn open success: ${data}`) - }) - .catch((err) => { - Logger.info(TAG, `cameraInputOpenFn fail err: ${err}, message: ${err.message}, code: ${err.code}`) - }) - } - // 会话流程 - async sessionFlowFn() { - try { - // 创建captureSession实例 - this.captureSession = await this.cameraManager.createCaptureSession() - // 开始配置会话 - await this.captureSession.beginConfig() - // cameraInput加入会话 - await this.captureSession.addInput(this.cameraInput) - // previewOutput加入会话 - await this.captureSession.addOutput(this.previewOutput) - // photoOutput加入会话 - await this.captureSession.addOutput(this.photoOutput) - // 提交配置会话 - await this.captureSession.commitConfig() - // 开启会话 - await this.captureSession.start() - Logger.info(TAG, `sessionFlowFn success`) - } catch (err) { - Logger.info(TAG, `sessionFlowFn fail err: ${err}, message: ${err.message}, code: ${err.code}`) - } - } -} - -export default new CameraService() \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/Camera/Camera_index.ets b/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/Camera/Camera_index.ets deleted file mode 100644 index 8fdfe5d0..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/Camera/Camera_index.ets +++ /dev/null @@ -1,184 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -import Logger from '../../model/LoggerEts' -import CameraService from './CameraService' -import FirstDialog from '../../common/FirstDialog' -import prompt from '@ohos.prompt' -import router from '@ohos.router' -import { GlobalContext } from '../../common/GlobalThis' -import common from '@ohos.app.ability.common' - - -const TAG = "Camera" - -@Entry -@Component -struct Camera_index { - @State name: string = 'CameraVideo'; - @State StepTips: string = '测试目的:用于测试相机录像分辨率能力\n预期结果:所有分辨率均可以录像,录像与预览一致'; - private mXComponentController: XComponentController = new XComponentController() - @State surfaceId: number = 0; - @State cameraDeviceIndex: number = 0 - @State assetUri?: string = undefined - @State thumbnail: PixelMap | undefined = undefined - @State isTakePictureEnabled: boolean = true - @State isTakeVideoEnabled: boolean = true - @State clickFrequency: number = 0 // 点击次数 - @State resolutionSelectVal: string = '' // 下拉框默认value - @State captureBtnScale: number = 1 - - async aboutToAppear() { - await FirstDialog.ChooseDialog(this.StepTips, this.name); - CameraService.setTakePictureCallback((assetUri: string):void=>this.handleTakePicture(assetUri)) - Logger.info(TAG, `takePicture end, assetUri: ${this.assetUri}`) - } - - - async cameraInit() { - CameraService.initCamera(this.surfaceId, this.cameraDeviceIndex).then(() => { - this.resolutionSelectVal = String(CameraService.videoResolution[this.clickFrequency].value) - Logger.info(TAG, `resolutionSelectVal ${this.resolutionSelectVal}`) //1280x960 - }) - } - - handleTakePicture(assetUri: string) { - this.assetUri = assetUri - Logger.info(TAG, `takePicture end, assetUri: ${this.assetUri}`) - } - - onPageShow() { - let SurfaceId:string = this.mXComponentController.getXComponentSurfaceId() - this.surfaceId = Number.parseInt(SurfaceId) - CameraService.initCamera(this.surfaceId, this.cameraDeviceIndex) - Logger.info(TAG, `OnPageShow this.cameraDeviceIndex ${this.cameraDeviceIndex}`) - } - - onPageHide() { - CameraService.releaseCamera() - Logger.info(TAG, `onPageHide releaseCamera end`) - } - - build() { - Stack({ alignContent: Alignment.BottomEnd }) { - XComponent({ - id: 'componentId', - type: 'surface', - controller: this.mXComponentController - }) - .size({ width: '100%', height: '100%' }) - .onLoad(async () => { - Logger.info(TAG, 'onLoad is called') - let SurfaceId:string = this.mXComponentController.getXComponentSurfaceId() - this.surfaceId = Number.parseInt(SurfaceId) - Logger.info(TAG, `onLoad surfaceId: ${this.surfaceId}`) - this.cameraInit() - }) - - Row() { - if (this.assetUri !== undefined) { - Image(this.assetUri) - .size({ height: '100%' }) - .border({ width: 1, color: Color.White, style: BorderStyle.Solid }) - .onClick(async () => { - let context = GlobalContext.getContext().getObject("context") as common.UIAbilityContext - await context.startAbility({ - parameters: { uri: 'photodetail' }, - bundleName: 'com.ohos.photos', - abilityName: 'com.ohos.photos.MainAbility' - }) - }) - } - Blank() - if (this.thumbnail !== undefined) { - Image(this.thumbnail) - .height('100%') - .aspectRatio(4 / 3) - .border({ width: 1, color: Color.White, style: BorderStyle.Solid }) - .onClick(async () => { - let context = GlobalContext.getContext().getObject("context") as common.UIAbilityContext - await context.startAbility({ - parameters: { uri: 'photodetail' }, - bundleName: 'com.ohos.photos', - abilityName: 'com.ohos.photos.MainAbility' - }) - }) - } - }.size({ width: '100%', height: '30%' }).justifyContent(FlexAlign.SpaceBetween) - - Column() { - Image(this.isTakeVideoEnabled ? $r('app.media.take_video_normal') : $r('app.media.take_video_stop')) - .width(76).aspectRatio(1).enabled(this.isTakeVideoEnabled) - .onTouch((event: TouchEvent) => { - this.isTakeVideoEnabled = false - if (event.type === TouchType.Up) { - this.isTakeVideoEnabled = false - prompt.showToast({ - message: '录制中,请等待三秒', duration: 1000 - }); - CameraService.StartRecording().then(() => { - setTimeout(() => { - CameraService.stopRecording().then((thumbnailPixelMap :PixelMap) => { - this.thumbnail = thumbnailPixelMap - this.isTakeVideoEnabled = true - }) - }, 3000) - }) - } - }) - }.size({ height: '100%' }).justifyContent(FlexAlign.Center) - - Row() { - Stack({ alignContent: Alignment.Center }) { - Image($r('app.media.ic_circled')).fillColor(Color.White) - Image($r('app.media.ic_circled_filled')) - .width(54) - .aspectRatio(1) - .fillColor(Color.White) - .scale({ x: this.captureBtnScale, y: this.captureBtnScale, z: this.captureBtnScale }) - .enabled(this.isTakePictureEnabled) - .onTouch(async (event: TouchEvent) => { - if (event.type === TouchType.Down) { - animateTo( - { duration: 125, curve: Curve.Sharp, delay: 0 }, - () => { - this.captureBtnScale = 0.85 - }) - } else if (event.type === TouchType.Up) { - animateTo( - { duration: 125, curve: Curve.Sharp, delay: 0, - onFinish: () => { - this.captureBtnScale = 1 - } }, - () => { - this.captureBtnScale = 1 - }) - this.isTakePictureEnabled = false - CameraService.takePicture() - this.isTakePictureEnabled = true - } - }) - }.width(76).aspectRatio(1) - }.size({ width: '100%', height: 76 }).justifyContent(FlexAlign.Center) - }.width('100%').height('100%').backgroundColor(Color.Black) - .gesture( - PanGesture({ direction: PanDirection.Left | PanDirection.Right }) - .onActionEnd(() => { - router.back() - }) - ) - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/Camera/MediaUtils.ts b/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/Camera/MediaUtils.ts deleted file mode 100644 index e93e200c..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/Camera/MediaUtils.ts +++ /dev/null @@ -1,195 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import mediaLibrary from '@ohos.multimedia.mediaLibrary' -import { Context } from '@ohos.abilityAccessCtrl' -import { GlobalContext } from '../../common/GlobalThis' -import DateTimeUtil from '../../model/DateTimeUtil' -import Logger from '../../model/Logger' - -const TAG = 'MediaUtils' - -export default class MediaUtils { - private mediaTest: mediaLibrary.MediaLibrary = mediaLibrary.getMediaLibrary(GlobalContext.getContext().getObject("context") as Context) - private static instance: MediaUtils = new MediaUtils() - - public static getInstance() { - if (this.instance === undefined) { - this.instance = new MediaUtils() - } - return this.instance - } - - async createAndGetUri(mediaType: number) { - let info = this.getInfoFromType(mediaType) - let dateTimeUtil = new DateTimeUtil() - let name = `${dateTimeUtil.getDate()}_${dateTimeUtil.getTime()}` - let displayName = `${info.prefix}${name}${info.suffix}` - Logger.info(TAG, `displayName = ${displayName},mediaType = ${mediaType}`) - Logger.info(TAG, `info.directory = ${info.directory}`) - let publicPath = await this.mediaTest.getPublicDirectory(info.directory) - Logger.info(TAG, `publicPath = ${publicPath}`) - try { - return await this.mediaTest.createAsset(mediaType, displayName, publicPath) - } catch (err) { - Logger.info(TAG, `createAsset err ` + JSON.stringify(err)) - } - } - - async queryFile(dataUri: any) { - let fileKeyObj = mediaLibrary.FileKey - if (dataUri !== undefined) { - let args = dataUri.id.toString() - let fetchOp = { - selections: `${fileKeyObj.ID}=?`, - selectionArgs: [args], - } - const fetchFileResult = await this.mediaTest.getFileAssets(fetchOp) - Logger.info(TAG, `fetchFileResult.getCount() = ${fetchFileResult.getCount()}`) - const fileAsset = await fetchFileResult.getFirstObject() - return fileAsset - } - } - - async getFdPath(fileAsset: any) { - let fd = await fileAsset.open('Rw') - Logger.info(TAG, `fd = ${fd}`) - return fd - } - - async getFileAssetsAlbum(path) { - let fileKeyObj = mediaLibrary.FileKey - // ALBUM_NAME - let fetchOp = { - selections: `${fileKeyObj.RELATIVE_PATH}=?`, - selectionArgs: [`${path}`], - } - const fetchFileResult = await this.mediaTest.getFileAssets(fetchOp) - Logger.info(TAG, `getFileAssetsAlbum,fetchFileResult.count = ${fetchFileResult.getCount()}`) - let fileAssets: Array = [] - if (fetchFileResult.getCount() > 0) { - fileAssets = await fetchFileResult.getAllObject() - } - return fileAssets - } - - async getFileAssetsFromType(mediaType: number) { - Logger.info(TAG, `getFileAssetsFromType,mediaType = ${mediaType}`) - let fileKeyObj = mediaLibrary.FileKey - // ALBUM_NAME - let fetchOp = { - selections: `${fileKeyObj.MEDIA_TYPE}=?`, - selectionArgs: [`${mediaType}`], - } - const fetchFileResult = await this.mediaTest.getFileAssets(fetchOp) - Logger.info(TAG, `getFileAssetsFromType,fetchFileResult.count = ${fetchFileResult.getCount()}`) - let fileAssets = [] - if (fetchFileResult.getCount() > 0) { - fileAssets = await fetchFileResult.getAllObject() - } - return fileAssets - } - - async getAlbums() { - Logger.info(TAG, 'getAlbums begin') - let albums = [] - const [ files, images, videos, audios ] = await Promise.all([ - this.getFileAssetsFromType(mediaLibrary.MediaType.FILE), - this.getFileAssetsFromType(mediaLibrary.MediaType.IMAGE), - this.getFileAssetsFromType(mediaLibrary.MediaType.VIDEO), - this.getFileAssetsFromType(mediaLibrary.MediaType.AUDIO) - ]) - albums.push({ - albumName: 'Documents', count: files.length, mediaType: mediaLibrary.MediaType.FILE - }) - albums.push({ - albumName: 'Pictures', count: images.length, mediaType: mediaLibrary.MediaType.IMAGE - }) - albums.push({ - albumName: 'Videos', count: videos.length, mediaType: mediaLibrary.MediaType.VIDEO - }) - albums.push({ - albumName: 'Audios', count: audios.length, mediaType: mediaLibrary.MediaType.AUDIO - }) - return albums - } - - deleteFile(media: any) { - let uri = media.uri - Logger.info(TAG, `deleteFile,uri = ${uri}`) - // @ts-ignore - return this.mediaTest.deleteAsset(uri) - } - - onDateChange(callback: () => void) { - this.mediaTest.on('albumChange', () => { - Logger.info(TAG, 'albumChange called') - callback() - }) - this.mediaTest.on('imageChange', () => { - Logger.info(TAG, 'imageChange called') - callback() - }) - this.mediaTest.on('audioChange', () => { - Logger.info(TAG, 'audioChange called') - callback() - }) - this.mediaTest.on('videoChange', () => { - Logger.info(TAG, 'videoChange called') - callback() - }) - this.mediaTest.on('fileChange', () => { - Logger.info(TAG, 'fileChange called') - callback() - }) - } - - offDateChange() { - this.mediaTest.off('albumChange') - this.mediaTest.off('imageChange') - this.mediaTest.off('audioChange') - this.mediaTest.off('videoChange') - this.mediaTest.off('fileChange') - } - - getInfoFromType(mediaType: number) { - let result = { - prefix: '', suffix: '', directory: 0 - } - switch (mediaType) { - case mediaLibrary.MediaType.FILE: - result.prefix = 'FILE_' - result.suffix = '.txt' - result.directory = mediaLibrary.DirectoryType.DIR_DOCUMENTS - break - case mediaLibrary.MediaType.IMAGE: - result.prefix = 'IMG_' - result.suffix = '.jpg' - result.directory = mediaLibrary.DirectoryType.DIR_IMAGE - break - case mediaLibrary.MediaType.VIDEO: - result.prefix = 'VID_' - result.suffix = '.mp4' - result.directory = mediaLibrary.DirectoryType.DIR_CAMERA - break - case mediaLibrary.MediaType.AUDIO: - result.prefix = 'AUD_' - result.suffix = '.wav' - result.directory = mediaLibrary.DirectoryType.DIR_AUDIO - break - } - return result - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/Camera/ThumbnailGetter.ts b/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/Camera/ThumbnailGetter.ts deleted file mode 100644 index 6c2bb182..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/Camera/ThumbnailGetter.ts +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import mediaLibrary from '@ohos.multimedia.mediaLibrary' -import { Context } from '@ohos.abilityAccessCtrl' -import { GlobalContext } from '../../common/GlobalThis' - -import Logger from '../../model/Logger' - -export default class ThumbnailGetter { - private TAG = '[ThumbnailGetter]:' - - public async getThumbnailInfo(width: number, height: number, uri?: string): Promise { - Logger.info(`${this.TAG} getThumbnailInfo E`) - Logger.debug(`${this.TAG} getThumbnailInfo width: ${width}, height: ${height}, uri: ${JSON.stringify(uri)}`) - const fileKeyObj = mediaLibrary.FileKey; - let fetchOp: any - const media = mediaLibrary.getMediaLibrary(GlobalContext.getContext().getObject("context") as Context); - let publicPath: string = await media.getPublicDirectory(mediaLibrary.DirectoryType.DIR_CAMERA) - Logger.info(`${this.TAG} getThumbnailInfo media: ${media}`) - fetchOp = { - selections: `${fileKeyObj.RELATIVE_PATH}=?`, - selectionArgs: [publicPath], - order: `${fileKeyObj.DATE_ADDED} DESC LIMIT 0, 1` - } - - Logger.info(`${this.TAG} getThumbnailInfo fetchOp: ${JSON.stringify(fetchOp)}`) - const fetchFileResult = await media.getFileAssets(fetchOp); - const count = fetchFileResult.getCount() - Logger.info(`${this.TAG} getThumbnailInfo fetchFileResult.getCount: ${count}`) - if (count == 0) { - return undefined - } - const lastFileAsset = await fetchFileResult.getLastObject() - await fetchFileResult.close() - if (lastFileAsset == null) { - Logger.error(`${this.TAG} getThumbnailInfo lastFileAsset is null`) - return undefined - } - const thumbnailPixelMap = lastFileAsset.getThumbnail({ - width: width, height: height - }) - Logger.info(`${this.TAG} getThumbnailInfo thumbnailPixelMap: ${JSON.stringify(thumbnailPixelMap)} X`) - return thumbnailPixelMap - } -} diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/Index.ets b/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index 8ced02a5..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -import router from '@ohos.router'; -import { GRAPHIC_TRANSFORMATION, TestButton } from './testData' -import window from '@ohos.window'; -import common from '@ohos.app.ability.common'; -@Entry -@Component -struct Index { - @Builder itemHead(text: Resource | string) { - Text(text) - .fontSize(20) - .height(50) - .backgroundColor('#ffeae9e9') - .width("100%") - .padding(10) - } - onPageShow() { - //获取当前窗口 - let FullScreen = true; - let context = getContext(this) as common.UIAbilityContext - let windowClass : window.Window; - try { - let promise = window.getLastWindow(context); - promise.then((data)=> { - windowClass = data; - console.info('Succeeded in obtaining the top window. Data: ' + JSON.stringify(data)); - //设置全屏状态 - let promise = windowClass.setFullScreen(FullScreen); - promise.then(() => { - console.info('Succeeded in enabling the full-screen mode. '); - }).catch((err : Error) => { - console.error('Failed to enable the full-screen mode. Cause: ' + JSON.stringify(err)); - }); - console.info('Succeeded in obtaining the top window. Data: ' + JSON.stringify(data)); - }).catch((err : Error)=>{ - console.error('Failed to obtain the top window. Cause: ' + JSON.stringify(err)); - }); - } catch (exception) { - console.error('Failed to obtain the top window. Cause: ' + JSON.stringify(exception)); - } - } - build() { - Column() { - Text('yarward测试') - .fontSize(50) - Scroll() { - Column() { - List({ space: 5 }) { - ForEach(GRAPHIC_TRANSFORMATION, (item: TestButton, index: number) => { - ListItemGroup({ header: this.itemHead(item.title) }) { - if (item.childNodes) { - ForEach(item.childNodes, (childItem: TestButton) => { - ListItem() { - Text(childItem.title) - .width("100%") - .height(50) - .fontSize(20) - .padding(10) - .backgroundColor(Color.White) - .onClick(()=>{ - router.pushUrl({url:childItem.url as string}) - }) - } - }) - } - } - .divider({ strokeWidth: 1, color: Color.Black }) // 每行之间的分界线 - .onClick(()=>{ - console.error('onclick') - if(item.childNodes == undefined){ - console.error('onclick item.childNodes == undefined') - router.pushUrl({url:item.url as string}) - } - }) - }) - } - Column() - .margin({bottom:90}) - } - .constraintSize({ minHeight: '100%' }) - } - } - .justifyContent(FlexAlign.Center) - } -} diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/Mic/AnimateView.ets b/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/Mic/AnimateView.ets deleted file mode 100644 index 168fe0be..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/Mic/AnimateView.ets +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { getTimeString } from '../../model/Utils' -import Logger from '../../model/LoggerEts' -import hilog from '@ohos.hilog' - -const TAG = '[Recorder.AnimateView]' - -@Component -export struct AnimateView { - private timeTextNum = [0, 1, 2, 3, 4, 5] - private intervalId: number = 0 - private updateTimeStr: () => void = () => { - } - @State timeAdd: number = 0 - @State translateImage: string = '-0.2%' - @State translateText: string = '-1%' - @StorageLink('recordState') @Watch('onPlayChange') recordState: boolean = true - @StorageLink('playState') @Watch('onPlayChange') playState: boolean = true - @Link @Watch('onResetChange') resetAnimation: boolean - - onPlayChange() { - Logger.info(TAG, `onPlayChange`) - this.animator() - } - - animator() { - Logger.info(TAG, `animator,recordState=${this.recordState},playState=${this.playState}`) - if (this.recordState || this.playState) { - this.intervalId = setInterval(() => { - this.updateTimeStr() - this.translateImage = '16.3%' - this.translateText = '15.5%' - this.timeAdd += 1 - animateTo({ duration: 1100, curve: Curve.Linear }, () => { - this.translateImage = '-0.2%' - this.translateText = '-1%' - }) - }, 1000) - } else { - clearInterval(this.intervalId) - } - } - - onResetChange() { - this.timeAdd = 0 - } - - aboutToAppear() { - this.animator() - } - - build() { - Column() { - Row() { - ForEach(this.timeTextNum, (item:number) => { - Text(getTimeString(this.timeAdd, item)) - .fontSize(12) - .fontColor(Color.Gray) - .textAlign(TextAlign.End) - .maxLines(1) - Blank() - .layoutWeight(1) - }, (item:number) => item.toString()) - } - .width('120%') - .translate({ x: this.translateText }) - - Image($r('app.media.slider_time')) - .width('120%') - .height(20) - .objectFit(ImageFit.Fill) - .translate({ x: this.translateImage }) - } - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/Mic/AudioItem.ets b/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/Mic/AudioItem.ets deleted file mode 100644 index 8e2a5360..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/Mic/AudioItem.ets +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import DateTimeUtil from '../../model/DateTimeUtil'; -import Logger from '../../model/LoggerEts'; -import { Record } from './Record'; - -const TAG = '[Recorder.AudioItem]'; -const TRANSLATE: number = -145; - -@Component -export struct AudioItem { - @Link record: Record; - @State translateLeft: number = 0; - @State translateRight: number = TRANSLATE; - - getTimeString() { - let date = new Date(); - let dateTimeUtil = new DateTimeUtil(); - return `${date.getFullYear()}/${dateTimeUtil.fill(date.getMonth() + 1)}/${dateTimeUtil.fill(date.getDate())}`; - } - - build() { - Row() { - Row() { - Column() { - Text(this.record.title) - .fontSize(22) - .fontColor(Color.Black) - Text(this.getTimeString()) - .fontSize(20) - .fontColor(Color.Gray) - .margin({ top: 10 }) - } - .size({ width: '80%', height: '100%' }) - .alignItems(HorizontalAlign.Start) - .justifyContent(FlexAlign.Center) - - Row() { - Text(this.record.duration) - .fontSize(20) - .fontColor(Color.Gray) - } - .width('20%') - .justifyContent(FlexAlign.End) - } - .width('100%') - .padding({ top: 10, bottom: 10, left: 10, right: 10 }) - .margin({ top: 15, right: 15 }) - .backgroundColor('#FFFFFF') - .borderRadius(20) - } - .width('100%') - .height('15%') - .constraintSize({ minHeight: 100 }) - .translate({ x: this.translateLeft, y: 0 }) - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/Mic/AudioModel.ts b/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/Mic/AudioModel.ts deleted file mode 100644 index 8be3fca3..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/Mic/AudioModel.ts +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import media from '@ohos.multimedia.media' -import mediaLibrary from '@ohos.multimedia.mediaLibrary' -import Logger from '../../model/Logger' - -const TAG: string = '[Recorder.AudioModel]' - -export class AudioModel { - private audioPlayer!:media.AudioPlayer; - private playFile: mediaLibrary.FileAsset = undefined - private dataLoad: boolean = false - - initAudioPlayer(playSrc: mediaLibrary.FileAsset, isPlay) { - this.playFile = playSrc - this.dataLoad = false - this.release() - this.audioPlayer = media.createAudioPlayer() - this.audioPlayer.on('dataLoad', () => { - Logger.info(TAG, `case dataLoad called`) - this.dataLoad = true - }) - this.audioPlayer.on('stop', () => { - Logger.info(TAG, `audioPlayer stop called`) - this.audioPlayer.release() - this.audioPlayer = undefined - }) - this.audioPlayer.on('error', () => { - Logger.info(TAG, `audioPlayer error called`) - }) - this.audioPlayer.reset() - let fdPath = playSrc.open('r') - fdPath.then(fdNumber => { - this.audioPlayer.src = `fd://${fdNumber}` - Logger.info(TAG, `create audioPlayer success`) - }) - } - - release() { - if (typeof (this.audioPlayer) != `undefined`) { - Logger.info(TAG, `audioPlayer release`) - this.audioPlayer.release() - this.audioPlayer = undefined - } - } - - onFinish(callback) { - console.info(`${TAG}set onFinish`) - this.audioPlayer.on('finish', () => { - Logger.info(TAG, `audioPlayer finish called`) - this.audioPlayer.seek(0) - callback() - }); - } - - play(callback) { - if (typeof (this.audioPlayer) != `undefined`) { - this.audioPlayer.on('play', () => { - Logger.info(TAG, `audioPlayer play called`) - callback() - }) - if (this.dataLoad) { - this.audioPlayer.play() - } else { - this.audioPlayer.on('dataLoad', () => { - Logger.info(TAG, `case dataLoad called`) - this.dataLoad = true - this.audioPlayer.play() - }) - } - } - } - - pause(callback) { - if (typeof (this.audioPlayer) != `undefined`) { - this.audioPlayer.on('pause', () => { - Logger.info(TAG, `case pause called`) - callback() - }) - this.audioPlayer.pause() - } - } - - finish() { - if (typeof (this.audioPlayer) != `undefined`) { - this.audioPlayer.stop() - } - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/Mic/MediaManager.ts b/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/Mic/MediaManager.ts deleted file mode 100644 index 0480411d..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/Mic/MediaManager.ts +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import mediaLibrary from '@ohos.multimedia.mediaLibrary'; -import preferences from '@ohos.data.preferences'; -import DateTimeUtil from '../../model/DateTimeUtil'; -import type common from '@ohos.app.ability.common'; -import Logger from '../../model/Logger'; -import { Record } from './Record'; -import hilog from '@ohos.hilog'; - -const TAG: string = '[Recorder.MediaManager]'; - -class MediaManager { - private context: common.UIAbilityContext; - private mediaTest: mediaLibrary.MediaLibrary = null; - private storage: preferences.Preferences = null; - - constructor(context: common.UIAbilityContext) { - this.context = context; - this.mediaTest = mediaLibrary.getMediaLibrary(this.context); - this.initStorage(); - } - - async initStorage(): Promise { - let name = 'com.yarward.factorytest'; - try { - this.storage = await preferences.getPreferences(this.context, `${name}`); - } catch (err) { - Logger.error(`getStorage failed, code is ${err.code}, message is ${err.message}`); - } - if (this.storage === null) { - Logger.info(TAG, 'Create storage is fail.'); - } - } - - async createAudioFile(): Promise { - this.mediaTest = mediaLibrary.getMediaLibrary(this.context); - let info = { - suffix: '.m4a', directory: mediaLibrary.DirectoryType.DIR_AUDIO - }; - let dateTimeUtil = new DateTimeUtil(); - let name = `${dateTimeUtil.getDate()}_${dateTimeUtil.getTime()}`; - let displayName = `${name}${info.suffix}`; - Logger.info(TAG, `createAudioFile displayName=${displayName}`); - let publicPath = await this.mediaTest.getPublicDirectory(info.directory); - Logger.info(TAG, `createAudioFile publicPath=${publicPath}`); - let file: mediaLibrary.FileAsset = await this.mediaTest.createAsset(mediaLibrary.MediaType.AUDIO, displayName, publicPath); - return Promise.resolve(file); - } - - async queryAllAudios(): Promise> { - let fileKeyObj = mediaLibrary.FileKey; - let fetchOp = { - selections: `${fileKeyObj.MEDIA_TYPE}=?`, - selectionArgs: [`${mediaLibrary.MediaType.AUDIO}`], - }; - const fetchFileResult = await this.mediaTest.getFileAssets(fetchOp); - let result: Array = []; - Logger.info(TAG, `queryAllAudios fetchFileResult=${fetchFileResult.getCount()}`); - if (fetchFileResult.getCount() > 0) { - let fileAssets = await fetchFileResult.getAllObject(); - for (let i = 0; i < fileAssets.length; i++) { - let record: Record = new Record(this.context); - await record.init(fileAssets[i]); - result.push(record); - } - } - return Promise.resolve(result); - } - - async queryFile(id: number): Promise { - let fileKeyObj = mediaLibrary.FileKey; - if (id !== undefined) { - let args = id.toString(); - let fetchOp = { - selections: `${fileKeyObj.ID}=?`, - selectionArgs: [args], - }; - const fetchFileResult = await this.mediaTest.getFileAssets(fetchOp); - Logger.info(TAG, `fetchFileResult.getCount() = ${fetchFileResult.getCount()}`); - const fileAsset = await fetchFileResult.getAllObject(); - let record: Record = new Record(this.context); - await record.init(fileAsset[0]); - return Promise.resolve(record); - } else { - return undefined; - } - } - - async deleteFile(fileAsset: mediaLibrary.FileAsset): Promise { - Logger.info(TAG, `deleteFile,title = ${fileAsset.title},uri = ${fileAsset.uri}`); - await this.mediaTest.deleteAsset(fileAsset.uri); - } - - onAudioChange(callback: () => void) { - Logger.info(TAG, `onAudioChange`); - this.mediaTest.on('audioChange', () => { - callback(); - }) - } - - async saveFileDuration(name: string, value): Promise { - Logger.info(TAG, `saveFileDuration`+value); - if (this.storage === null) { - Logger.info(TAG, 'Create storage is fail.'); - return; - } - await this.storage.put(name, value); - await this.storage.flush(); - } - - async getFileDuration(name: string): Promise { - let bundleName = 'com.yarward.factorytest'; - let duration; - try { - let storage = await preferences.getPreferences(this.context, `${bundleName}`); - duration = await storage.get(name, '00:00'); - } catch (err) { - Logger.info(TAG, `Failed to get value of duration,code:${err.code},message:${err.message}`); - } - return duration as string; - } -} - -export default MediaManager; \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/Mic/Mic_index.ets b/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/Mic/Mic_index.ets deleted file mode 100644 index c029f515..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/Mic/Mic_index.ets +++ /dev/null @@ -1,230 +0,0 @@ -/* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import common from '@ohos.app.ability.common'; -import Logger from '../../model/LoggerEts'; -import MediaManager from './MediaManager'; -import { AudioModel } from './AudioModel'; -import { Record } from './Record'; -import { RecordModel } from './RecordModel'; -import mediaLibrary from '@ohos.multimedia.mediaLibrary'; -import { updateTime } from '../../model/Utils'; -import { AnimateView } from './AnimateView'; -import { TitleBar } from '../../common/TitleBar'; -import { AudioItem } from './AudioItem'; -import UIAbility from '@ohos.app.ability.UIAbility'; -import hilog from '@ohos.hilog'; - -let TAG = '[Mic_index]'; - -@Entry -@Component -struct Mic_index { - private mediaManager = new MediaManager(getContext(this) as common.UIAbilityContext); - private audioModel: AudioModel = new AudioModel(); - @State record?: Record = undefined; - private recordModel: RecordModel = new RecordModel(); - private millisecond: number = 0; - @State fileAsset: mediaLibrary.FileAsset = {} as mediaLibrary.FileAsset; - private fd: number = -1; - @StorageLink('recordState') recordState: boolean = false; - @StorageLink('playState') playState: boolean = false; - @State duration: string = '00:00'; - @State resetAnimation: boolean = false; - @State time: string = '00:00'; - - async finish() { - await this.mediaManager.saveFileDuration(this.fileAsset.title, this.duration); - this.recordModel.finish(() => { - this.recordState = false; - }) - let recordList = await this.mediaManager.queryAllAudios(); - this.record = recordList[0] - this.record.init(this.fileAsset) - Logger.info(TAG, "daatdsdfdwsa " + (this?.record?.fileAsset?.dateAdded ?? 0).toString()) - Logger.info(TAG, `handleChangePlayState this.record= ${JSON.stringify(this.record)}`); - this.audioModel.initAudioPlayer(this.fileAsset, true); - } - - async startRecord() { - this.recordModel.initAudioRecorder(); - if (this.record) { - await this.mediaManager.deleteFile(this.record.fileAsset); - } - this.fileAsset = await this.mediaManager.createAudioFile(); - this.fd = await this.fileAsset.open('Rw'); - this.recordModel.startRecorder(`fd://${this.fd}`, () => { - Logger.info(TAG, 'startRecorder callback success'); - this.millisecond = 0; - this.recordState = true; - }) - - } - - updateTimeStr() { - this.millisecond += 1000; - if (this.recordState) { - this.duration = updateTime(this.millisecond); - } else if (this.playState) { - this.time = updateTime(this.millisecond); - } - } - - async aboutToAppear() { - this.record?.init(undefined); - } - - async onPageHide() { - if (this.record) { - await this.mediaManager.deleteFile(this.record.fileAsset); - } - - } - - initAudioPlayer() { - this.audioModel.onFinish(() => { - this.playState = false; - this.reset(); - }); - this.playState = false; - this.reset(); - } - - reset() { - this.time = '00:00'; - this.millisecond = 0; - this.resetAnimation = !this.resetAnimation; - } - - handleChangePlayState = () => { - if (this.record) { - this.initAudioPlayer(); - Logger.info(TAG, `handleChangePlayState this.isPlay= ${this.playState}`); - if (!this.playState) { - this.audioModel.play(() => { - Logger.info(TAG, `handleChangePlayState play success`); - this.playState = !this.playState; - AppStorage.SetOrCreate('playState', this.playState); - }) - } else { - this.audioModel.pause(() => { - Logger.info(TAG, `handleChangePlayState pause success`); - this.playState = !this.playState; - AppStorage.SetOrCreate('playState', this.playState); - }) - } - } - } - - build() { - Row() { - Column() { - TitleBar() - Column() { - if (this.record) { - AudioItem({ record: $record }) - } - } - .layoutWeight(1) - - if (this.recordState) { - Button({ type: ButtonType.Circle, stateEffect: true }) { - Image($r('app.media.ic_pause')) - .objectFit(ImageFit.Contain) - .size({ width: 70, height: 70 }) - } - .width(70) - .height(70) - .borderWidth(1) - .backgroundColor('#FFFFFF') - .margin(10) - .onClick(() => { - this.finish(); - }) - } else { - Button({ type: ButtonType.Circle, stateEffect: true }) { - Image($r('app.media.rectangle')) - .objectFit(ImageFit.Contain) - .size({ width: 30, height: 30 }) - } - .width(70) - .height(70) - .borderWidth(1) - .backgroundColor('#FFFFFF') - .margin(10) - .onClick(() => { - this.startRecord(); - }) - } - } - .layoutWeight(2) - .height('100%') - .backgroundColor('#F5F5F5') - .zIndex(2) - - Column() { - if (this.record) { - Row() { - Text(this.record.title) - .fontColor(Color.Black) - .fontWeight(FontWeight.Bold) - .fontSize(30) - .layoutWeight(1) - } - .size({ width: '100%', height: '8%' }) - .constraintSize({ minHeight: 50 }) - .padding({ left: 20 }) - } - - Column() { - AnimateView({ resetAnimation: $resetAnimation, updateTimeStr: (): void => this.updateTimeStr() }) - Image($r('app.media.bg_play')) - .width('100%') - .height('30%') - .objectFit(ImageFit.Fill) - Column() { - if (this.recordState) { - Text(this.duration) - .fontColor(Color.Black) - .fontSize(35) - } else { - Text(this.time) - .fontColor(Color.Black) - .fontSize(35) - Text(this.record ? this.record.duration : '00:00') - .fontColor(Color.Gray) - .fontSize(25) - } - } - - Button() { - Image(this.playState ? $r('app.media.pause') : $r('app.media.play')) - .objectFit(ImageFit.Contain) - .size({ width: 70, height: 70 }) - } - .type(ButtonType.Circle) - .size({ width: 70, height: 70 }) - .backgroundColor('#FFFFFF') - .layoutWeight(1) - .margin({ bottom: 15 }) - .onClick(this.handleChangePlayState) - } - } - .layoutWeight(3) - } - .size({ width: '100%', height: '100%' }) - .backgroundColor('#F0F0F0') - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/Mic/Record.ts b/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/Mic/Record.ts deleted file mode 100644 index b7da6882..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/Mic/Record.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import mediaLibrary from '@ohos.multimedia.mediaLibrary' -import common from '@ohos.app.ability.common' -import DateTimeUtil from '../../model/DateTimeUtil' -import MediaManager from './MediaManager' - -const dateTimeUtil = new DateTimeUtil() - -export class Record { - fileAsset?: mediaLibrary.FileAsset; - title: string = '' - duration: string = '' - context!: common.UIAbilityContext; - - constructor(context: common.UIAbilityContext) { - this.context = context - } - - async init(fileAsset?: mediaLibrary.FileAsset) { - this.fileAsset = fileAsset; - if (fileAsset) { - if (fileAsset.duration > 0) { - this.duration = dateTimeUtil.getDurationString(fileAsset.duration) - } else { - let mediaManager = new MediaManager(this.context) - this.duration = await mediaManager.getFileDuration(fileAsset.title) - } - this.title = fileAsset.title - } else { - this.duration = '00:00' - this.title = '' - } - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/Mic/RecordEts.ets b/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/Mic/RecordEts.ets deleted file mode 100644 index bd464593..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/Mic/RecordEts.ets +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import mediaLibrary from '@ohos.multimedia.mediaLibrary' -import common from '@ohos.app.ability.common' -import DateTimeUtil from '../../model/DateTimeUtil' -import MediaManager from './MediaManager' - -const dateTimeUtil = new DateTimeUtil() - -@Observed -export class Record { - fileAsset?: mediaLibrary.FileAsset - title: string = '' - duration: string = '' - context: common.UIAbilityContext = {} as common.UIAbilityContext - - constructor(context: common.UIAbilityContext) { - this.context = context - } - - async init(fileAsset?: mediaLibrary.FileAsset) { - this.fileAsset = fileAsset - if (fileAsset) { - if (fileAsset.duration > 0) { - this.duration = dateTimeUtil.getDurationString(fileAsset.duration) - } else { - let mediaManager = new MediaManager(this.context) - this.duration = await mediaManager.getFileDuration(fileAsset.title) - } - this.title = fileAsset.title - } else { - this.duration = '00:00' - this.title = '' - } - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/Mic/RecordModel.ts b/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/Mic/RecordModel.ts deleted file mode 100644 index d72466bc..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/Mic/RecordModel.ts +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import media from '@ohos.multimedia.media'; -import Logger from '../../model/Logger' - -const TAG: string = '[Recorder.RecordModel]' - -let audioConfig = { - audioEncodeBitRate: 48000, - audioSampleRate: 48000, - numberOfChannels: 1, - uri: '', - audioEncoderMime: media.CodecMimeType.AUDIO_AAC, - fileFormat: media.ContainerFormatType.CFT_MPEG_4A, -} - -export class RecordModel { - private audioRecorder = undefined - - initAudioRecorder() { - this.release(); - this.audioRecorder = media.createAudioRecorder() - Logger.info(TAG, 'create audioRecorder success') - } - - release() { - if (typeof (this.audioRecorder) != `undefined`) { - Logger.info(TAG, 'case audioRecorder release') - this.audioRecorder.release() - this.audioRecorder = undefined - } - } - - startRecorder(pathName, callback) { - Logger.info(TAG, `enter the startRecorder,pathName=${pathName}, audioRecorder=${JSON.stringify(this.audioRecorder)}`) - if (typeof (this.audioRecorder) != 'undefined') { - Logger.info(TAG, 'enter the if') - this.audioRecorder.on('prepare', () => { - Logger.info(TAG, 'setCallback prepare case callback is called') - this.audioRecorder.start() - }) - this.audioRecorder.on('start', () => { - Logger.info(TAG, 'setCallback start case callback is called') - callback() - }) - Logger.info(TAG, 'start prepare') - audioConfig.uri = pathName - this.audioRecorder.prepare(audioConfig) - } else { - Logger.info(TAG, 'case failed, audioRecorder is null') - } - } - - pause(callback) { - Logger.info(TAG, 'audioRecorder pause called') - if (typeof (this.audioRecorder) != `undefined`) { - this.audioRecorder.on('pause', () => { - Logger.info(TAG, 'audioRecorder pause finish') - callback() - }) - this.audioRecorder.pause() - } - } - - resume(callback) { - Logger.info(TAG, 'audioRecorder resume called') - if (typeof (this.audioRecorder) != `undefined`) { - this.audioRecorder.on('resume', () => { - Logger.info(TAG, 'audioRecorder resume finish') - callback() - }) - this.audioRecorder.resume() - } - } - - finish(callback) { - if (typeof (this.audioRecorder) != `undefined`) { - this.audioRecorder.on('stop', () => { - Logger.info(TAG, 'audioRecorder stop called') - this.audioRecorder.release() - callback() - }) - this.audioRecorder.stop() - } - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/testData.ets b/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/testData.ets deleted file mode 100644 index f728286b..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/testData.ets +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -export interface TestButton { - title: Resource | string, // Third-level category headings - url?: string, // Third-level category detail page URL - childNodes?: TestButton[] -} -export const GRAPHIC_TRANSFORMATION: TestButton[] = - [ - { - title: '设备信息', - url: 'pages/testSample/information' - }, - { - title: '存储', - url: 'pages/testSample/fileRW' - }, - { - title: '扬声器', - url: 'pages/testSample/audio', - }, - { - title: 'MIC', - url: 'pages/Mic/Mic_index' - }, - { - title: '摄像头', - url: 'pages/Camera/Camera_index' - }, - { - title: '蓝牙', - url: 'pages/testSample/bluetooth' - }, - { - title: 'WIFI', - url: 'pages/testSample/wifi' - }, - { - title: '传感器', - url: 'pages/testSample/sensor' - }, - { - title: '灰度测试', - url: 'pages/testSample/gradient' - }, - { - title: '读卡测试', - url: 'pages/testSample/nfc' - }, - { - title: '触摸测试', - url: 'pages/testSample/touch' - }, - { - title: 'LED测试', - url: 'pages/testSample/led' - } - ] diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/testSample/audio.ets b/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/testSample/audio.ets deleted file mode 100644 index 04868d87..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/testSample/audio.ets +++ /dev/null @@ -1,194 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -import { TitleBar } from '../../common/TitleBar'; -import media from '@ohos.multimedia.media'; -import Logger from '../../model/LoggerEts'; -import config from '@ohos.accessibility.config'; -import { BusinessError } from '@ohos.base'; -import resourceManager from '@ohos.resourceManager'; -import { GlobalContext } from '../../common/GlobalThis'; - -const TAG = 'audioSample' - -enum playType { - LEFT, - RIGHT, - ALL -} - -@Entry -@Component -export struct audioSample { - @State myPlayType: playType = playType.ALL; // - private fileName: string[] = ['EP11.mp4', 'Technology.wav']; - private avPlayer!: media.AVPlayer | undefined; - - async releaseAllAudio() { - if (this.avPlayer) { - await this.avPlayer.stop(); - await this.avPlayer.release(); - this.avPlayer = undefined; - } - } - - // 注册avplayer回调函数 - setAVPlayerCallback() { - // seek操作结果回调函数 - this.avPlayer?.on('seekDone', (seekDoneTime: number) => { - Logger.info(TAG, `AVPlayer seek succeeded, seek time is ${seekDoneTime}`); - }) - // error回调监听函数,当avPlayer在操作过程中出现错误时调用 reset接口触发重置流程 - this.avPlayer?.on('error', (err) => { - Logger.error(`Invoke avPlayer failed, code is ${err.code}, message is ${err.message}`); - this.avPlayer?.reset(); // 调用reset重置资源,触发idle状态 - }) - // 状态机变化回调函数 - this.avPlayer?.on('stateChange', async (state: string, reason: media.StateChangeReason) => { - switch (state) { - case 'idle': // 成功调用reset接口后触发该状态机上报 - Logger.info(TAG, ' AVPlayer state idle called.'); - break; - case 'initialized': // avplayer 设置播放源后触发该状态上报 - Logger.info(TAG, ' AVPlayer state initialized called.'); - this.avPlayer?.prepare(); - break; - case 'prepared': // prepare调用成功后上报该状态机 - Logger.info(TAG, ' AVPlayer state prepared called.'); - this.avPlayer?.play(); // 调用播放接口开始播放 - break; - case 'playing': // play成功调用后触发该状态机上报 - Logger.info(TAG, ' AVPlayer state playing called.'); - break; - case 'paused': // pause成功调用后触发该状态机上报 - Logger.info(TAG, ' AVPlayer state paused called.'); - this.avPlayer?.play(); // 再次播放接口开始播放 - break; - case 'completed': // 播放结束后触发该状态机上报 - Logger.info(TAG, ' AVPlayer state completed called.'); - this.avPlayer?.stop(); //调用播放结束接口 - break; - case 'stopped': // stop接口成功调用后触发该状态机上报 - Logger.info(TAG, ' AVPlayer state stopped called.'); - this.avPlayer?.reset(); // 调用reset接口初始化avplayer状态 - break; - case 'released': - Logger.info(TAG, ' AVPlayer state released called.'); - break; - default: - Logger.info(TAG, ' AVPlayer state unknown called.'); - break; - } - }) - } - - async aboutToDisappear() { - this.releaseAllAudio(); - await config.audioBalance.set(0); - } - - async startPlay(fileDescriptor: resourceManager.RawFileDescriptor) { - // 创建avPlayer实例对象 - this.avPlayer = await media.createAVPlayer(); - // 创建状态机变化回调函数 - this.setAVPlayerCallback(); - // 通过UIAbilityContext的resourceManager成员的getRawFd接口获取媒体资源播放地址 - // 返回类型为{fd,offset,length},fd为HAP包fd地址,offset为媒体资源偏移量,length为播放长度 - let avFileDescriptor: media.AVFileDescriptor = - { fd: fileDescriptor.fd, offset: fileDescriptor.offset, length: fileDescriptor.length }; - // 为fdSrc赋值触发initialized状态机上报 - this.avPlayer.fdSrc = avFileDescriptor; - await this.avPlayer?.prepare(); - // this.avPlayer.setVolume(1); - await this.avPlayer?.play(); - } - - async playAudioAll() { - await this.releaseAllAudio(); - let context: Context = GlobalContext.getContext().getObject("context") as Context - let fileDescriptor: resourceManager.RawFileDescriptor = await context.resourceManager.getRawFd(this.fileName[1]); - - switch (this.myPlayType) { - case playType.LEFT: - config.audioBalance.set(-1).then(() => { - Logger.info(TAG, `accessibilityConfigSetting config success.`); - this.startPlay(fileDescriptor); - }).catch((err: BusinessError) => { - Logger.error(TAG, `accessibilityConfigSetting config fail. err: ${JSON.stringify(err)}`); - return; - }); - break; - case playType.RIGHT: - // TODO:右声道适配存在问题 - config.audioBalance.set(1).then(() => { - this.startPlay(fileDescriptor); - Logger.info(TAG, `accessibilityConfigSetting config success.`); - }).catch((err: BusinessError) => { - Logger.error(TAG, `accessibilityConfigSetting config fail. err: ${JSON.stringify(err)}`); - return; - }); - break; - case playType.ALL: - let conText = GlobalContext.getContext().getObject("context") as Context; - fileDescriptor = await conText.resourceManager.getRawFd(this.fileName[0]); - await this.startPlay(fileDescriptor); - break; - } - } - - build() { - Column() { - TitleBar({ title: '扬声器测试' }) - Scroll() { - Row() { - Text("左声道播放") - .layoutWeight(1) - .height('100%') - .backgroundColor(Color.Blue) - .onClick(() => { - this.myPlayType = playType.LEFT; - this.playAudioAll(); - }) - Column() { - Text("全声道播放") - .height('50%') - .onClick(() => { - this.myPlayType = playType.ALL; - this.playAudioAll(); - }) - Text("暂停播放") - .height('50%') - .onClick(() => { - this.releaseAllAudio(); - }) - }.layoutWeight(1) - - Text("右声道播放") - .layoutWeight(1) - .backgroundColor(Color.Blue) - .height('100%') - .onClick(() => { - this.myPlayType = playType.RIGHT; - this.playAudioAll(); - }) - } - .height(40) - .width('100%') - .constraintSize({ minHeight: '100%' }) - } - } - } -} diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/testSample/bluetooth.ets b/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/testSample/bluetooth.ets deleted file mode 100644 index 0c75bb68..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/testSample/bluetooth.ets +++ /dev/null @@ -1,604 +0,0 @@ -/** - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or - { - "name": "bluetoothTab", agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import Router from '@system.router'; -import deviceInfo from '@ohos.deviceInfo'; -import BluetoothDevice from '../../model/BluetoothDevice'; -import Logger from '../../model/Logger'; -import BluetoothDeviceController from '../../controller/BluetoothDeviceController'; -import { DeviceType, ProfileConnectionState, BondState } from '../../model/BluetoothModel'; -import { TitleBar } from '../../common/TitleBar' - - -const PAIRED_ITEM_NUMBER = 3; -const PAGE_URI_DEVICE_NAME = 'pages/deviceName'; -const PAGE_URI_BLUETOOTH_PAIRED_DEVICE_INFO = 'pages/bluetoothPairedDeviceInfo'; -const deviceTypeInfo = deviceInfo.deviceType; -let pinRequiredTIimer: number = -1; - -@Entry -@Component -export struct Bluetooth { - private PAGE_TAG = 'Bluetooth page '; - private deviceController: BluetoothDeviceController = new BluetoothDeviceController(); - @StorageLink('bluetoothIsOn') isOn: boolean = false; - @StorageLink('bluetoothToggleEnabled') isEnabled: boolean = true; - @StorageLink('bluetoothLocalName') localName: string = ''; - - aboutToAppear(): void { - Logger.info(this.PAGE_TAG + 'aboutToAppear in : isOn = ' + this.isOn) - this.deviceController - .initData() - .subscribe(); - Logger.info(this.PAGE_TAG + 'aboutToAppear out : isOn = ' + this.isOn) - } - - onPageShow(): void { - Logger.info(this.PAGE_TAG + 'onPageShow in : localName = ' + this.localName) - Logger.info(this.PAGE_TAG + 'onPageShow out : localName = ' + this.localName) - } - - aboutToDisappear(): void { - this.deviceController.unsubscribe(); - } - - build() { - Column() { - TitleBar({ title: '蓝牙测试' }) - GridContainer({ gutter: 24, margin: 24 }) { - Column() { - - Row() { - Text("蓝牙") - .fontColor($r('sys.color.ohos_fa_text_primary')) - .fontSize(16) - .fontWeight(FontWeight.Medium) - - Blank() - - Toggle({ type: ToggleType.Switch, isOn: this.isOn }) - .width('36vp') - .height('20vp') - .selectedColor('#007DFF') - .margin({ left: 6 }) - .onChange((isOn: boolean) => { - Logger.info(this.PAGE_TAG + 'Toggle onClick: isOn = ' + isOn + ', enabled = ' + this.isEnabled) - if (!this.isEnabled) return; - this.deviceController.toggleValue(isOn); - }); - } - .margin({ top: 8 }) - .width('100%') - .height(56) - .borderRadius(28) - .padding({ left: 12, right: 6 }) - .alignItems(VerticalAlign.Center) - .borderRadius(24) - - Scroll() { - Column() { - - if (this.isOn) { - AvailableDeviceComponent({ - controller: this.deviceController, - }) - } - } - .width('100%') - } - .scrollBarWidth(0) - .width('100%') - .align(Alignment.TopStart) - .layoutWeight(1) - } - .useSizeType({ - sm: { span: 4, offset: 0 }, - md: { span: 6, offset: 1 }, - lg: { span: 8, offset: 2 } - }); - } - .width('100%') - .height('100%'); - } - .backgroundColor($r("sys.color.ohos_id_color_sub_background")) - .width('100%') - .height('100%'); - } -} - - -/** - * Paired device component - */ -@Component struct PairedDeviceComponent { - private TAG_PAGE = 'PairedDeviceComponent '; - private controller: BluetoothDeviceController = new BluetoothDeviceController(); - @StorageLink('bluetoothPairedDevices') pairedDevices: BluetoothDevice[] = []; - @State isTouched: boolean = false; - @State hide: boolean = true; - - aboutToAppear(): void { - - } - - build() { - Column() { - if ( this.pairedDevices.length > 0) { - // paired devices title - Row() { - Text("已配对的设备") - .width('100%') - .fontSize(14) - .fontWeight(FontWeight.Medium) - .fontColor($r('sys.color.ohos_id_color_text_secondary')) - } - .width('100%') - .padding({ - left: 12, - top: 19, - bottom: 5 - }) - - List() { - // paired devices list - ForEach(this.pairedDevices, (item: BluetoothDevice, index: number) => { - - if (index < PAIRED_ITEM_NUMBER || !this.hide) { - ListItem() { - Row() { - Text(item.deviceId) - } - .width('100%') - .borderRadius(24) - .onClick(() => { - this.itemClicked(item); - }) - } - } - - if ((this.hide && index === PAIRED_ITEM_NUMBER) || //more - (!this.hide && index >= PAIRED_ITEM_NUMBER && index == this.pairedDevices.length - 1)) { //put_away - ListItem() { - Stack({ alignContent: Alignment.Center }) { - Stack({ alignContent: Alignment.Center }) { - - } - .width('100%') - .height(48) - .borderRadius(20) - .onTouch((event: TouchEvent) => { - if (event.type === TouchType.Down) { - this.isTouched = true; - } - if (event.type === TouchType.Up) { - this.isTouched = false; - } - }) - .onClick(() => { - this.hide = !this.hide; - }) - } - .height(48) - .backgroundColor($r("sys.color.ohos_id_color_foreground_contrary")) - } - } - }, (item: BluetoothDevice) => JSON.stringify(item)); - } - .padding(4) - .borderRadius(24) - } - } - } - - /** - * Get connection state text - * @param device - */ - getConnectionStateText(device: BluetoothDevice): string { - let stateText: string = ''; - switch (device.connectionState) { - case ProfileConnectionState.STATE_DISCONNECTED: - stateText = ''; - break; - - case ProfileConnectionState.STATE_CONNECTING: - stateText = JSON.parse("正在连接"); - break; - - case ProfileConnectionState.STATE_CONNECTED: - if (device.deviceType === DeviceType.HEADPHONE) { - stateText = JSON.parse("已连接"); - } else { - stateText = ''; - } - break; - - case ProfileConnectionState.STATE_DISCONNECTING: - stateText = JSON.parse("正在断开"); - break; - - } - return stateText; - } - - /** - * Whether headphone connected. - * @param item device - * @return headphone connected or not - */ - private isHeadPhoneConnected(item: BluetoothDevice): boolean { - return item.deviceType === DeviceType.HEADPHONE && item.connectionState === ProfileConnectionState.STATE_CONNECTED - } - - /** - * Goto paired device Info - * @param item device - */ - private gotoPairedDeviceInfo(item: BluetoothDevice) { - if (item.connectionState != 1 - && item.connectionState != 3) { - Logger.info(this.TAG_PAGE + 'item right icon on click.'); - let paramMap:Map = new Map(); - paramMap.set("bluetoothDevice",JSON.stringify(item)); - Router.push({ - uri: PAGE_URI_BLUETOOTH_PAIRED_DEVICE_INFO, - params: paramMap - }); - } - } - - /** - * Item clicked - * @param item device - */ - private itemClicked(item: BluetoothDevice) { - switch (item.connectionState) { - case 2: - this.showDisconnectDialog(item.deviceName, () => { - this.controller.disconnect(item.deviceId) - }); - break; - - case 0: - if (!this.controller.connect(item.deviceId)) { - } - break; - } - } - - /** - * Disconnect Dialog - */ - showDisconnectDialog(deviceName: string, callback: Function) { - AlertDialog.show({ - title: "断开连接?", - message: "此操作将会断开您与以下设备的连接:" + deviceName, - primaryButton: { - value: $r('app.string.cancel'), - action: () => { - Logger.info('Closed callbacks'); - } - }, - secondaryButton: { - value: $r('app.string.confirm'), - action: () => { - Logger.info(`AlertDialog success:`); - callback(); - } - }, - alignment: deviceTypeInfo === 'phone' || deviceTypeInfo === 'default' ? DialogAlignment.Bottom : DialogAlignment.Center, - offset: ({ dx: 0, dy: deviceTypeInfo === 'phone' || deviceTypeInfo === 'default' ? '-24dp' : 0 }) - }) - } -} - - -/** - * Available device component - */ -class pinRequiredParam{ - deviceId: string = ''; - pinCode: string = '' -} -@Component -struct AvailableDeviceComponent { - private TAG_PAGE = 'AvailableDeviceComponent '; - private controller: BluetoothDeviceController = new BluetoothDeviceController(); - @State isDeviceDiscovering: boolean = false; - @StorageLink('bluetoothAvailableDevices') @Watch("availableDevicesChange") availableDevices: BluetoothDevice[] = []; - @State availableDevicesList: AvailableDevicesDataSource = new AvailableDevicesDataSource(this.availableDevices); - @State pairPinCode: string = ''; - private pairingDevice!: BluetoothDevice; - @StorageLink("controlPairing") controlPairing: boolean = true; - @StorageLink("pairData") pairData: BluetoothDevice = {} as BluetoothDevice; - @StorageLink("pinRequiredParam") @Watch("pinRequiredParamChange") pinRequiredParam: pinRequiredParam = { deviceId: '', pinCode: '' }; - pairDialog: CustomDialogController = new CustomDialogController({ - builder: PairDialog({ - deviceName: this.pairingDevice.deviceName, - pinCode: this.pairPinCode, - action: (accept: boolean) => { - this.confirmPairing(accept); - } - }), - alignment: deviceTypeInfo === 'phone' || deviceTypeInfo === 'default' ? DialogAlignment.Bottom : DialogAlignment.Center, - offset: ({ dx: 0, dy: deviceTypeInfo === 'phone' || deviceTypeInfo === 'default' ? '-24dp' : 0 }), - autoCancel: true, - }); - - availableDevicesChange() { - this.availableDevicesList.setData(this.availableDevices) - } - - aboutToAppear(): void { - if (this.controller) { - - - this.controller.startBluetoothDiscovery(); - } - } - - build() { - Column() { - Row() { - - Blank() - - // bluetooth discovering - if (this.isDeviceDiscovering) { - } - } - .height(48) - .width('100%') - - if (this.availableDevices && this.availableDevices.length >= 1) { - - List() { - // paired devices list - ForEach(this.availableDevices, (item: BluetoothDevice) => { - ListItem() { - Row() { - Column() { - Text(item.deviceId) - .margin({ bottom: 10 }) - Text(item.deviceName) - .margin({ bottom: 10 }) - } - } - .height(70) - .width('100%') - .borderColor('#ffe5e4e4') - .borderWidth({ bottom: 2 }) - .onClick(() => { - Logger.info(this.TAG_PAGE + 'item on click'); - if (this.controlPairing) { - this.pairDevice(item); - } else { - return; - } - }) - } - }, (item: BluetoothDevice) => JSON.stringify(item)); - } - .height('100%') - .padding({ bottom: 90 }) - } else { - // Scanning... - Text("正在扫描。。。。") - .fontSize($r('sys.float.ohos_id_text_size_body2')) - .textCase(TextCase.UpperCase) - .fontWeight(FontWeight.Medium) - .fontColor($r("sys.color.ohos_id_color_primary")) - .height(48) - } - } - } - - /** - * Get pair state text - * @param device - */ - getPairStateText(device: BluetoothDevice): string { - return device.connectionState == 1 ? JSON.parse(JSON.stringify("正在配对…")) : ''; - } - - pinRequiredParamChange() { - clearTimeout(pinRequiredTIimer); - pinRequiredTIimer = setTimeout(() => { - this.pairPinCode = this.pinRequiredParam.pinCode; - this.pairingDevice = this.pairData; - if (this.pairDialog) { - this.pairDialog.open(); - } - () => { - } - }, 1000) - } - - /** - * Pair device - * @param device - */ - pairDevice(device: BluetoothDevice) { - this.controller.pair(device.deviceId) - } - - /** - * Confirm pairing - */ - - confirmPairing(accept: boolean) { - Logger.info(this.TAG_PAGE + 'confirmPairing pairingDevice'); - try { - if (this.pairingDevice && this.pairingDevice.deviceId != null) { - this.controller.confirmPairing(this.pairingDevice.deviceId, accept); - } - } catch (err) { - Logger.info(this.TAG_PAGE + `confirmPairing pairingDevice error ${err}`); - } - } -} - -/** - * AvailableDevicesDataSource For Lazy Loading - */ -class AvailableDevicesDataSource { - private availableDevicesArray: BluetoothDevice[] = []; - constructor(availableDevicesArray: BluetoothDevice[]) { - this.availableDevicesArray = availableDevicesArray; - } - - public setData(data: BluetoothDevice[]) { - this.availableDevicesArray = data; - } - - public totalCount(): number { - if (this.availableDevicesArray) { - return this.availableDevicesArray.length; - } - return 0; - } - - public getData(index: number): BluetoothDevice | null{ - if (!this.availableDevicesArray) { - Logger.info('array is null.'); - return null; - } - if (index < 0 || index >= this.totalCount()) { - Logger.info('index out of range.'); - return null; - } - return this.availableDevicesArray[index]; - } - - public delData(device: BluetoothDevice): void { - let index = this.availableDevicesArray.indexOf(device); - this.availableDevicesArray.splice(index, 1) - } -} - -/** - * Pair dialog - */ -@CustomDialog -struct PairDialog { - dialogController!: CustomDialogController; - action: (accept: boolean) => void = () => { - }; - private deviceName: string = ""; - private pinCode: string = ""; - - aboutToAppear(): void { - Logger.info(`bluetooth PairDialog aboutToAppear.`) - } - - build() { - Column() { - Text("要与" + this.deviceName + "配对吗?") - .fontSize(15) - .height(56) - .width(200) - Column() { - if (this.pinCode) { - Text("蓝牙配对码") - Text(`${this.pinCode}`) - .fontSize(32) - .fontWeight(500) - .fontColor($r("sys.color.ohos_id_color_primary")) - .width(100) - .textAlign(TextAlign.Center) - .margin({ - top: 6, - bottom: 10 - }) - } else { - - Text(this.deviceName) - .fontSize(16) - .width(100) - .fontWeight(FontWeight.Bold) - } - - // button - Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) { - Text($r('app.string.cancel')) - .fontSize(16) - .fontColor('#007DFF') - .fontWeight(500) - .flexGrow(1) - .onClick(() => { - this.dialogController.close(); - this.action(false); - }) - - Divider() - .height(24) - .strokeWidth(0.5) - .vertical(true) - .color($r("sys.color.ohos_id_color_list_separator")) - - Text("配对") - .fontSize(16) - .fontColor('#007DFF') - .fontWeight(500) - .flexGrow(1) - .onClick(() => { - this.dialogController.close(); - this.action(true); - }) - - } - .width(100) - .height(56) - .margin({ top: 10 }) - .padding({ bottom: 16 }) - } - .width('100%') - .padding({ - left: 24, - right: 24 - }) - } - .width(deviceTypeInfo === 'phone' || deviceTypeInfo === 'default' ? '100%' : 500) - .padding(deviceTypeInfo === 'phone' || deviceTypeInfo === 'default' ? { left: 12, right: 12 } : {}) - } -} - -/** - * Pair mode prompt - * @param dialogTitle Dialog title - * @param dialogMessage Dialog message - * @param buttonValue Dialog buttonValue - */ -function showDialog(dialogTitle: string | Resource, dialogMessage: string | Resource, buttonValue: string | Resource) { - Logger.info('Bluetooth page showDialog in.'); - - AlertDialog.show({ - title: dialogTitle, - message: dialogMessage, - confirm: { - value: buttonValue, - action: () => { - Logger.info('Bluetooth page showDialog : Button-clicking callback'); - } - }, - cancel: () => { - Logger.info('Bluetooth page showDialog : Closed callbacks'); - } - }) - - Logger.info('Bluetooth page showDialog out.'); -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/testSample/fileRW.ets b/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/testSample/fileRW.ets deleted file mode 100644 index 561e012b..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/testSample/fileRW.ets +++ /dev/null @@ -1,167 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -import fs from '@ohos.file.fs'; -import systemDateTime from '@ohos.systemDateTime'; -import { BusinessError } from '@ohos.base'; -import { TitleBar } from '../../common/TitleBar'; -import Logger from '../../model/LoggerEts'; -import { TipsDialog } from '../../common/TipsDialog'; -import worker, { Event, MessageEvents } from '@ohos.worker'; -import prompt from '@system.prompt'; -import { GlobalContext } from '../../common/GlobalThis'; - -const TAG = 'fileRW' - - -enum fileOperateType { - WRITE = 0, - READ = 1 -} - -@Entry -@Component -export struct fileRW { - @State message: string = ''; - @StorageLink('btnEnabled') @Watch("btnEnabledOnchange") myBtnEnabled: boolean = true; - private myWriteTimeSpeed: number = 0; - private myReadTimeSpeed: number = 0; - - btnEnabledOnchange() { - Logger.info(TAG, "btnEnabledOnchange:" + this.myBtnEnabled); - if (this.myBtnEnabled) { - Logger.info(TAG, "myWriteTimeSpeed:" + this.myWriteTimeSpeed + "myReadTimeSpeed:" + this.myReadTimeSpeed); - if (this.myWriteTimeSpeed && this.myReadTimeSpeed) { - this.message = "写入速度:" + this.myWriteTimeSpeed + " M/s\n\n" + "读取速度:" + this.myReadTimeSpeed + " M/s\n"; - } - } - else { - this.message = "正在读写测试中...."; - } - } - - getSpeed(mSTime: number): number { - let ret: number = 0; - let sTime: number = mSTime / 1000; - Logger.info(TAG, `getSpeed sTime: ${sTime}`); - ret = 2048 / sTime; - return Math.round(ret); - } - - createFileWork() { - - let writeAndReadWorkerInstance = new worker.ThreadWorker('@bundle:com.yarward.factorytest/entry/ets/pages/workers/fileWorker'); - // 主线程向worker线程传递信息 - let globalContext = GlobalContext.getContext() - let myFilePath: string = globalContext.getObject("pathDir") + "/test.txt"; - writeAndReadWorkerInstance.postMessage(myFilePath); - // 在调用terminate后,执行onexit - writeAndReadWorkerInstance.onexit = () => { - Logger.info(TAG, "writeAndReadWorkerInstance main thread terminate"); - } - // 写入数据接收信息回调监听 - writeAndReadWorkerInstance.addEventListener("message", (event: Event) => { - let workEvent :MessageEvents = event as MessageEvents; - Logger.info(TAG, "writeAndReadWorkerInstance onmessage listener callback"); - if (workEvent.data < 0) { - Logger.info(TAG, "file Operate fail"); - return; - } - Logger.info(TAG, "writeAndReadWorkerInstance onmessage listener event.data:" + workEvent.data); - // 获取写入速度 - let writeTimeSpeed: number = workEvent.data[0]; - let readTimeSpeed: number = workEvent.data[1]; - - this.myWriteTimeSpeed = writeTimeSpeed; - this.myReadTimeSpeed = readTimeSpeed; - - try { - Logger.info(TAG, "writeAndReadWorkerInstance onmessage listener this.writeTimeSpeed:" + writeTimeSpeed + "this.readTimeSpeed:" + writeTimeSpeed); - AppStorage.set("writeTimeSpeed", writeTimeSpeed); - AppStorage.set("readTimeSpeed", readTimeSpeed); - AppStorage.set("btnEnabled", true); - } - catch (err) { - Logger.error(TAG, "AppStorage.setOrCreate fail.err:" + err); - } - - writeAndReadWorkerInstance.terminate(); - - }) - - } - - onPageShow() { - let writeTimeSpeed: number = AppStorage.get("writeTimeSpeed") as number; - let readTimeSpeed: number = AppStorage.get("readTimeSpeed") as number; - let myBtnEnabled = AppStorage.get("btnEnabled") as boolean; - Logger.info(TAG, "aboutToAppear writeTimeSpeed: " + writeTimeSpeed + "readTimeSpeed:" + readTimeSpeed + "myBtnEnabled" + myBtnEnabled); - - if (writeTimeSpeed) { - this.myWriteTimeSpeed = writeTimeSpeed; - } - if (readTimeSpeed) { - this.myReadTimeSpeed = readTimeSpeed; - } - Logger.info(TAG, "aboutToAppear myWriteTimeSecond: " + this.myWriteTimeSpeed + "myReadTimeSecond:" + this.myReadTimeSpeed); - - this.myBtnEnabled = myBtnEnabled; - if (myBtnEnabled === false) { - this.message = "正在读写测试中...."; - } - else { - this.btnEnabledOnchange(); - } - - } - - build() { - Column() { - TitleBar({ title: '存储设备读写测试' }) - Scroll() { - Column() { - Button("读写300M文件开始测试") - .onClick(() => { - Logger.info(TAG, "onClick"); - - if (this.myBtnEnabled === false) { - prompt.showToast({ - message: '正在读写测试,请勿重复点击!', - duration: 2000, - }); - } - else { - try { - AppStorage.setOrCreate("btnEnabled", false); - } catch (err) { - Logger.error(TAG, "AppStorage.setOrCreate fail.err:" + err); - } - this.myWriteTimeSpeed = 0; - this.myReadTimeSpeed = 0; - this.createFileWork(); - } - - }) - Text(this.message) - .margin({ top: 100 }) - - } - .width('100%') - .constraintSize({ minHeight: '100%' }) - } - } - } -} diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/testSample/gradient.ets b/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/testSample/gradient.ets deleted file mode 100644 index 2aae306e..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/testSample/gradient.ets +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -import display from '@ohos.display'; -import { TitleBar } from '../../common/TitleBar' -import Logger from '../../model/LoggerEts'; - -@Entry -@Component -export struct gradient { - @State myAngle: number = 90; - @State windowWidth: number = 0; - @State windowHeight: number = 0; - @State gradientType: number = 0; - @State isTestTime: boolean = true; - private intervalID : number = -1; - private colorWhite: number = 0xffffff; - private colorBlack: number = 0x000000; - - aboutToDisappear() { - clearInterval(this.intervalID); - } - - async aboutToAppear() { - let displayClass : display.Display; - try { - displayClass = display.getDefaultDisplaySync(); - this.windowWidth = displayClass.width; - this.windowHeight = displayClass.height; - } catch (exception) { - console.error('Failed to obtain the default display object. Code: ' + JSON.stringify(exception)); - } - this.intervalID = setInterval(() => { - switch (this.myAngle) { - case 360: - this.myAngle = 225; - break; - case 225: - this.myAngle = 45; - break; - case 45: - if (this.gradientType != 2) { - this.gradientType++; - } - else { - this.gradientType = 0; - this.myAngle = 90; - } - break; - default: - this.myAngle = this.myAngle + 90;break; - } - - }, 2000); - - } - - build() { - Column() { - TitleBar({ title: '灰度测试' }) - .visibility(this.isTestTime ? Visibility.None : Visibility.Visible) - if (this.gradientType == 0) { - Column() { - } - .linearGradient({ - angle: this.myAngle, - colors: [[this.colorWhite, 0.0], [this.colorBlack, 1.0]] - }) - .width('100%') - .height('100%') - } - else { - Column() { - } - .width('100%') - .height('100%') - .radialGradient({ - center: [this.windowWidth / 2, this.windowHeight / 2], - radius: Math.max(this.windowWidth, this.windowHeight) / 2, - colors: [[this.gradientType == 1 ? this.colorWhite : this.colorBlack, 0.0], [this.gradientType == 1 ? this.colorBlack : this.colorWhite, 1.0]] - }) - } - } - .onClick(() => { - this.isTestTime = true; - }) - .gesture( - PinchGesture({ fingers: 5 }) - .onActionEnd(() => { - this.isTestTime = false; - }) - ) - } -} diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/testSample/information.ets b/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/testSample/information.ets deleted file mode 100644 index af64f798..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/testSample/information.ets +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -import { deviceInfos } from '../../model/deviceInfos'; -import statvfs from '@ohos.file.statvfs'; -import { GRAPHIC_TRANSFORMATION, TestButton } from '../testData' -import { TitleBar } from '../../common/TitleBar' - -export class btn { - btnName: string = '' - isPass: boolean = false -} - - -@Entry -@Component -export struct yarwardInformation { - @State infValue: string[] = []; - private message: string = '设备信息'; - private infName: string[] = ['系统版本:', '系统软件API版本:', '设备类型:', 'cpu频率:', - 'cpu型号:', '内存容量:', '存储容量:', '剩余存储容量:','已使用存储容量:','设备厂家名称:','外部产品系列:','产品系列:']; - private myDeviceInfos: deviceInfos = new deviceInfos(); - - async aboutToAppear() { - await this.myDeviceInfos.init(); - this.infValue.push(this.myDeviceInfos.osFullName); - this.infValue.push(this.myDeviceInfos.sdkApiVersion); - this.infValue.push(this.myDeviceInfos.deviceType); - this.infValue.push(this.myDeviceInfos.cpuFrequency); - this.infValue.push("rk3566 rgo_am64v8a"); - this.infValue.push(this.myDeviceInfos.memCapacity); - this.infValue.push(this.myDeviceInfos.stoCapacity); - this.infValue.push(this.myDeviceInfos.freeCapacity); - this.infValue.push(this.myDeviceInfos.usedCapacity); - this.infValue.push(this.myDeviceInfos.manufacture); - this.infValue.push(this.myDeviceInfos.marketName); - this.infValue.push(this.myDeviceInfos.productSeries); - - } - - build() { - Column() { - TitleBar({ title: '设备信息' }) - Scroll() { - Column() { - ForEach(this.infName, (item : string, index : number) => { // ForEach语法,循环创建GridItem - Row() { - Text(item) - .fontSize(20) - .height(50) - .textAlign(TextAlign.Start) - .width('50%') - Text(this.infValue[index]) - .fontSize(20) - .height(50) - .textAlign(TextAlign.Start) - .width('50%') - } - .borderWidth({ bottom: 2 }) - .padding({ left: 30, right: 30 }) - .width('100%') - }) - Column() - .margin({ bottom: 90 }) - } - .width('100%') - .constraintSize({ minHeight: '100%' }) - } - } - } -} diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/testSample/led.ets b/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/testSample/led.ets deleted file mode 100644 index f36ba852..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/testSample/led.ets +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -import { TitleBar } from '../../common/TitleBar' -import Logger from '../../model/LoggerEts'; - -@Entry -@Component -struct Led { - @State color: Color = Color.Red; - @State index: number = 0; - @State isTestTime: boolean = true; - private intervalID: number = -1; - - onPageShow() { - this.intervalID = setInterval(() => { - switch (this.index) { - case 0: - this.color = Color.Yellow; - break; - case 1: - this.color = Color.Blue; - break; - case 2: - this.color = Color.White; - break; - case 3: - this.color = Color.Black; - break; - default: - this.color = Color.Red;this.index = -1;break; - } - this.index++; - - }, 2000) - } - - onPageHide() { - clearInterval(this.intervalID); - } - - build() { - Column() { - TitleBar({ title: 'led测试' }) - .visibility(this.isTestTime ? Visibility.None : Visibility.Visible) - Column() { - } - .backgroundColor(this.color) - .height('100%') - .width('100%') - } - .onClick(() => { - this.isTestTime = true; - }) - .gesture( - PinchGesture({ fingers: 5 }) - .onActionEnd(() => { - this.isTestTime = false; - }) - ) - .height('100%') - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/testSample/nfc.ets b/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/testSample/nfc.ets deleted file mode 100644 index eb06a7a9..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/testSample/nfc.ets +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -import nfctest from '@ohos.nfctest' -import { TitleBar } from '../../common/TitleBar' -import Logger from '../../model/LoggerEts' - -const TAG = 'nfcSample' - -@Entry -@Component -export struct nfcSample { - @State nfc: string[] = [] - @State @Watch('readNfcTimesChange') readNfcTimes: number = 0 - scroller: Scroller = new Scroller() - private message: string = "1、到达此界面时,读卡器已经可以使用;\n2、展示区将展示读卡器发送给本机的数据和分机发送给读卡器的数据;\n3、读卡器读卡成功将发送卡号,本机回复 AA 55 停止读卡;\n4、读卡器读卡失败不会展示任何信息;\n" - - getNfcValue() { - nfctest.get_nfc_value() - .then((ret:string) => { - Logger.info(TAG, "get_nfc_value " + ret); - this.nfc.push(ret); - this.readNfcTimes++; - }) - .catch((err:Error) => { - Logger.error(TAG, `get_nfc_value failed err is ${JSON.stringify(err)}`) - this.readNfcTimes++; - }) - } - - readNfcTimesChange() { - Logger.error(TAG, "messageChange this.readNfcTimes:" + this.readNfcTimes); - this.getNfcValue(); - this.scroller.scrollEdge(Edge.Bottom); - } - - aboutToAppear() { - Logger.info(TAG, "this.message" + this.nfc); - this.getNfcValue(); - } - onPageHide() { - nfctest.nfc_release(); - } - build() { - Column() { - TitleBar({ title: '读卡测试' }) - Text("读卡次数:" + this.nfc.length) - .margin({ bottom: 25 }) - Scroll(this.scroller) { - Column() { - ForEach((this.nfc), (item:string, index:number) => { - Text("第" + (index + 1) + "次数据: " + item) - .width('90%') - .height(50) - .borderWidth({ bottom: 1 }) - .textAlign(TextAlign.Center) - }) - } - .margin({ bottom: 200 }) - } - .width('100%') - .padding({ left: 16, right: 16 }) - } - .margin({ bottom: 80 }) - .width('100%') - .constraintSize({ minHeight: '100%' }) - } -} diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/testSample/sensor.ets b/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/testSample/sensor.ets deleted file mode 100644 index ef8b17ad..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/testSample/sensor.ets +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -import sensor from '@ohos.sensor'; -import { TitleBar } from '../../common/TitleBar'; -import Logger from '../../model/LoggerEts'; - -const TAG = 'sensorSample'; - -@Entry -@Component -export struct sensorSample { - @State myIntensity: string = '0' - @State isDistance: number = 1 - - aboutToAppear() { - // 环境光强度 - try { - sensor.on(sensor.SensorId.AMBIENT_LIGHT, (data) => { - this.myIntensity = data.intensity.toFixed(2); - Logger.info(TAG, 'The ambient light intensity: ' + data.intensity); - }, { interval: 3000000000 }); - } catch (err) { - Logger.error(TAG, 'On fail, errCode: ' + err.code + ' ,msg: ' + err.message); - } - // 接近光程度 - try { - sensor.on(sensor.SensorId.PROXIMITY, (data) => { - this.isDistance = data.distance; - console.info('Distance: ' + data.distance); - }, { interval: 3000000000 }); - } catch (err) { - console.error('On fail, errCode: ' + err.code + ' ,msg: ' + err.message); - } - - } - - build() { - Column() { - TitleBar({ title: '光感测试' }) - Column({space:10}) { - Text("说明: 该测试项对设备感光进行测试,将设备放置于明暗环境下,光感数值有明确变化为测试成功。\n注意: 光线传感器位于摄像头右边") - Column() { - Row() { - Text("设备周围光线强度:") - Text(this.myIntensity).fontSize(50) - Text(" lx") - } - - Row() { - Text("物体与设备显示器") - Text(this.isDistance == 0 ? "接近" : "远离") - .fontSize(50) - } - } - .layoutWeight(1) - .width('100%') - .backgroundColor('#fff3f0f0') - .justifyContent(FlexAlign.Center) - } - .layoutWeight(1) - .width('100%') - .padding(20) - } - .width('100%') - .height('100%') - - } -} diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/testSample/touch.ets b/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/testSample/touch.ets deleted file mode 100644 index 15bf1d56..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/testSample/touch.ets +++ /dev/null @@ -1,195 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -import { TitleBar } from '../../common/TitleBar'; -import Logger from '../../model/LoggerEts'; -import promptAction from '@ohos.promptAction'; -import window from '@ohos.window'; - -const TAG = 'touchSample'; - -@Entry -@Component -export struct touchSample { - @State @Watch('touchTestChange') touchTest: number = 1; // 触摸测试样例 - @State @Watch('touchedCountChange') touchedCount: number = 0; // 触摸测试样例 - @State gridItem: boolean[] = []; - @State buttonsOffsetX: number[] = [0, 100, 200, 300, 400, 500]; - @State buttonsOffsetY: number[] = [0, 100, 200, 300, 400, 500]; - @State myColumnsTemplate: string = "1fr 1fr 1fr 1fr 1fr 1fr"; - @State myRowsTemplate: string = "1fr 1fr 1fr 1fr 1fr 1fr"; - private gridItemArea: Area[] = []; - private gridItemCount: number = 0; - - touchedCountChange() { - Logger.info(TAG, "touchedCount:" + this.touchedCount + "this.gridItemCount" + this.gridItemCount + "this.touchTest:" + this.touchTest); - - if (this.touchedCount >= this.gridItemCount - 1 && this.touchTest == 1) { - Logger.info(TAG, "this.touchTest++"); - this.touchTest++; - } - if (this.touchedCount >= this.gridItemCount - 1 && this.touchTest == 2) { - this.touchTest++; - } - } - - initGridItem() { - for (let i = 0;i < this.gridItemCount; i++) { - this.gridItem[i] = false; - } - } - - promptActionTouchTestChange() { - // 弹窗 - try { - promptAction.showDialog({ - title: '屏幕触摸项目' + this.touchTest, - message: '1、点击确定开始屏幕触控测试,在单元格上执行点击、拖动等操作会消除单元格,消除完屏幕所有单元格后会自动进行下一项测试2、五指同时触控屏幕可跳过此项测试进行下一项测试', - buttons: [ - { - text: '确定', - color: '#000000', - } - ], - }) - .then(data => { - switch (this.touchTest) { - case 1: - this.gridItemCount = 36; - this.initGridItem(); - break; - case 2: - this.gridItemCount = 144; - this.initGridItem(); - break; - default: - ; - } - console.info('showDialog success, click button: ' + data.index); - }) - .catch((err:Error) => { - console.info('showDialog error: ' + err); - }) - } catch (error) { - console.error(`showDialog args error code is ${error.code}, message is ${error.message}`); - } - ; - } - - touchTestChange() { - Logger.info(TAG, "touchTestChange"); - this.touchedCount = 0; - this.gridItem = []; - if (this.touchTest == 2) { - this.myColumnsTemplate = "1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr"; - this.myRowsTemplate = "1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr"; - Logger.info(TAG, "this.gridItem.length" + this.gridItem.length + "this.gridItemArea.length" + this.gridItemArea.length); - } - this.promptActionTouchTestChange(); - } - - aboutToAppear() { - Logger.info(TAG, "aboutToAppear"); - } - - onPageShow() { - this.promptActionTouchTestChange(); - } - - // area.globalPosition: 目标元素左上角相对页面左上角的位置。 - isInArea(area: Area, x: number, y: number): boolean { - if ((x >= (area.globalPosition.x ?? 0) )&&( x <= Number(area.globalPosition.x ?? 0)+ Number(area.width)) ){ - if ((y >= (area.globalPosition.y ?? 0)) && y <= Number(area.globalPosition.y ?? 0) + Number(area.height)) { - return true; - } - } - return false; - } - - build() { - Column() { - TitleBar({ title: '触摸测试' }) - Stack({ alignContent: Alignment.TopStart }) { - Grid() { - ForEach(this.gridItem, (item: string, index: number) => { - GridItem() { - } - .onAreaChange((oldValue: Area, newValue: Area) => { - if (this.gridItemArea.length <= this.gridItem.length) { - this.gridItemArea[index] = newValue; - Logger.log(TAG, "gridItemArea:" + this.gridItemArea.length + this.gridItemCount); - } - }) - .id("GridItem" + index) - .onClick(() => { - if (this.gridItem[index] == false) { - this.gridItem[index] = true; - this.touchedCount++; - } - }) - .borderWidth(1) - .backgroundColor(item ? Color.Black : Color.White) - .borderColor(Color.Black) - .width('100%') - .height('100%') - }, (item: string) => item) - } - .onTouch((event: TouchEvent) => { - Logger.log(TAG, "TouchEventX:" + event.changedTouches[0].screenX + "TouchEventY:" + event.changedTouches[0].screenY); - this.gridItemArea.forEach((element, index) => { - if (this.isInArea(element, event.changedTouches[0].screenX, event.changedTouches[0].screenY)) { - if (this.gridItem[index] == false) { - this.gridItem[index] = true; - this.touchedCount++; - } - } - }); - }) - .width('100%') - .height('100%') - .columnsTemplate(this.myColumnsTemplate) // Grid宽度均分成4份 - .rowsTemplate(this.myRowsTemplate) // Grid高度均分成5份 - } - .hitTestBehavior(HitTestMode.Transparent) - .gesture( - GestureGroup(GestureMode.Parallel, - LongPressGesture({ fingers: 5, repeat: true })// 由于repeat设置为true,长按动作存在时会连续触发,触发间隔为duration(默认值500ms) - .onAction((event: GestureEvent) => { - - Logger.info(TAG, "onActionUpdate"); - let fingerLists = event.fingerList; - Logger.info(TAG, "onActionUpdate" + event.fingerList.length); - fingerLists.forEach((value, index) => { - this.buttonsOffsetX[index] = value.globalX; - this.buttonsOffsetY[index] = value.globalY; - Logger.info(TAG, "GestureEventX:" + value.globalX + "GestureEventY:" + value.globalY); - }) - }), - PinchGesture({ fingers: 5 }) - .onActionEnd(() => { - this.initGridItem(); - this.touchTest++; - }) - ) - ) - .width('100%') - .height('100%') - } - .width('100%') - .height('100%') - - } -} diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/testSample/wifi.ets b/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/testSample/wifi.ets deleted file mode 100644 index 6f291ddf..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/testSample/wifi.ets +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -import fs from '@ohos.file.fs'; -import { TitleBar } from '../../common/TitleBar' -import { AvailableWifi } from '../../common/AvailableWifi' -import wifi from '@ohos.wifiManager' -import Logger from '../../model/LoggerEts' -import { WifiModel, WifiType } from '../../model/WifiModel' - -const TAG = 'wifi' - -@Entry -@Component -export struct wifiSample { - private wifiModel: WifiModel = new WifiModel() - private linkedInfo: wifi.WifiLinkedInfo = {} as wifi.WifiLinkedInfo - @State isLinked: boolean = false - @State isSwitchOn: boolean = false - - // 扫描wifi - async scan() { - // 获取有关Wi-Fi连接的信息,存入linkedInfo - await this.getLinkedInfo() - // 不停地扫描wifi - let result: Array = await this.wifiModel.getScanInfos() - if (this.isSwitchOn) { - AppStorage.SetOrCreate('wifiList', result) - setTimeout(async () => { - await this.scan() - }, 3000) - } - } - - // 获取有关Wi-Fi连接的信息,存入linkedInfo - async getLinkedInfo() { - try { - let wifiLinkedInfo = await wifi.getLinkedInfo() - if (wifiLinkedInfo === null || wifiLinkedInfo.bssid === '') { - this.isLinked = false - this.linkedInfo = {} as wifi.WifiLinkedInfo - return - } - this.isLinked = true - this.linkedInfo = wifiLinkedInfo - } catch (err) { - Logger.info(`getLinkedInfo failed err is ${JSON.stringify(err)}`) - } - } - - // 监听wifi的变化 - addListener() { - // 连接状态改变时,修改连接信息 - wifi.on('wifiConnectionChange', async state => { - Logger.info(TAG, `wifiConnectionChange: ${state}`) - await this.getLinkedInfo() - }) - // wifi状态改变时,先清空wifi列表,然后判断是否是开启状态,如果是就扫描 - wifi.on('wifiStateChange', state => { - Logger.info(TAG, `wifiStateLisener state: ${state}`) - AppStorage.SetOrCreate('wifiList', []) - if (state === 1) { // 1: wifi is enable, 0:wifi is disable - this.scan() - } - }) - } - - aboutToAppear() { - // 如果wifi是开的,就记录下状态,然后扫描wifi,并获取连接信息 - if (wifi.isWifiActive()) { - Logger.info(TAG, 'wifi is active') - this.isSwitchOn = true - wifi.scan() - this.scan() - this.getLinkedInfo() - } - // 启动监听 - this.addListener() - } - - build() { - Column() { - TitleBar({ title: 'wifi测试' }) - Scroll() { - Column() { - Toggle({ type: ToggleType.Switch, isOn: this.isSwitchOn }) - .id('switch') - .onChange((isOn: boolean) => { - Logger.info(`LSQ: wifi swtich is: ${isOn}`) - AppStorage.SetOrCreate('wifiList', []) - try { - // 如果是打开状态,记录状态,打开网络,开始扫描 - if (isOn) { - this.isSwitchOn = true - wifi.enableWifi() - return - } else { - // 记录状态,断开网络禁用网络 - this.isSwitchOn = false - this.isLinked = false - wifi.disconnect() - wifi.disableWifi() - } - } catch (error) { - Logger.error(TAG, `failed,code:${JSON.stringify(error.code)},message:${JSON.stringify(error.message)}`) - } - }) - } - } - .width('100%') - .padding({ left: 16, right: 16 }) - - if (this.isLinked && this.isSwitchOn) { - Column() { - Text($r('app.string.connected')) - .fontSize(22) - .width('100%') - Row() { - Text(this.linkedInfo.ssid) - .fontSize(20) - .fontColor(Color.Black) - .layoutWeight(1) - Text($r('app.string.connected')) - .fontSize(18) - .fontColor(Color.Black) - } - .width('100%') - .padding(10) - .margin({ left: 16, right: 16 }) - .border({ radius: 15, color: Color.Gray, width: 1 }) - .backgroundColor(Color.White) - } - .width('100%') - .padding({ left: 16, right: 16 }) - } - - if (this.isSwitchOn) { - AvailableWifi({ linkedInfo: this.linkedInfo }) - } - } - .width('100%') - .constraintSize({ minHeight: '100%' }) - } -} diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/workers/fileWorker.ts b/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/workers/fileWorker.ts deleted file mode 100644 index 7af1d110..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/main/ets/pages/workers/fileWorker.ts +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -// worker.ts -import worker from '@ohos.worker'; -import systemDateTime from '@ohos.systemDateTime'; -import fs from '@ohos.file.fs'; -import { BusinessError } from '@ohos.base'; -const TAG = 'fileWorker ' - -// 创建worker线程中与主线程通信的对象 -const workerPort = worker.workerPort -enum fileOperateType { - WRITE = 0, - READ = 1 -} - -async function fileRead(filePath) { - console.info(TAG,"fileRead start"); - - fs.open(filePath, fs.OpenMode.READ_ONLY).then(async (file: fs.File)=> { - let readBuf = new ArrayBuffer(67108864); - console.info(TAG, "fileRead filePath:" + filePath); - let readFirstTime = await systemDateTime.getRealActiveTime(false); - console.info(TAG, "fileRead readFirstTime:" + readFirstTime); - let len = 0; - let retLen; - for (let i = 0;i < 32; i++) { - retLen = fs.readSync(file.fd, readBuf, { offset: len }); - len = len + retLen; - } - let readLastTime = await systemDateTime.getRealActiveTime(false); - fs.closeSync(file); - - console.info(TAG, "fileRead readLastTime:" + readLastTime); - - fs.unlink(filePath, (err) => { - if (err) { - console.info(TAG,"remove file failed with error message: " + err.message + ", error code: " + err.code); - } else { - console.info(TAG,"remove file succeed"); - } - }); - let readTimeSecond = readLastTime- readFirstTime; - // worker线程向主线程发送信息 - workerPort.postMessage(readTimeSecond); - - }).catch((err: BusinessError) => { - console.error(TAG,"open file failed with error message: " + err.message + ", error code: " + err.code); - // worker线程向主线程发送信息 - workerPort.postMessage(-1) - }) - console.info(TAG,"fileRead end"); - -} -// worker线程接收主线程信息 -async function fileWrite(filePath: string) { - - console.info(TAG,"fileWrite start filePath:"+filePath); - fs.open(filePath, fs.OpenMode.WRITE_ONLY | fs.OpenMode.CREATE).then(async (file: fs.File) => { - console.log(TAG,"file fd: " + file.fd); - let writeBuf = new ArrayBuffer(67108864); - let len = 0; - let writeFirstTime = await systemDateTime.getRealActiveTime(false); - //41920 - for ( let i = 0;i < 32; i++) { - let retLen = fs.writeSync(file.fd, writeBuf, { offset: len }); - len = len + retLen; - } - let writeLastTime = await systemDateTime.getRealActiveTime(false); - fs.closeSync(file); - let writeTimeSecond = writeLastTime - writeFirstTime; - // worker线程向主线程发送信息 - workerPort.postMessage(writeTimeSecond) - }).catch((err: BusinessError) => { - console.error(TAG,"open file failed with error message: " + err.message + ", error code: " + err.code); - // worker线程向主线程发送信息 - workerPort.postMessage(-1) - }).catch((err: BusinessError) => { - workerPort.postMessage(-1) - console.info(TAG,"remove file failed with error message: " + err.message + ", error code: " + err.code); - }); - console.info(TAG,"fileWrite end"); -} - -async function fileWriteAndRead(filePath: string) { - - console.info(TAG, "fileWriteAndRead start filePath:" + filePath); - fs.open(filePath, fs.OpenMode.READ_WRITE | fs.OpenMode.CREATE).then(async (file: fs.File) => { - console.log(TAG, "file fd: " + file.fd); - let length = 12582912; - let writeBuf = new ArrayBuffer(length); - let readBuf = new ArrayBuffer(length); - - let retLen; - let len = 0; - - let writeFirstTime = await systemDateTime.getRealActiveTime(false); - - for (let i = 0;i < 25; i++) { - - retLen = fs.writeSync(file.fd, writeBuf, { offset: len }); - len = retLen + len; - } - let writeLastTime = await systemDateTime.getRealActiveTime(false); - - let readFirstTime = await systemDateTime.getRealActiveTime(false); - len = 0; - for (let i = 0;i < 25; i++) { - - retLen = fs.readSync(file.fd, readBuf, { offset: len }); - len = retLen + len; - } - let readLastTime = await systemDateTime.getRealActiveTime(false); - fs.closeSync(file); - fs.unlinkSync(filePath); - // 获取读写时间间隔 - let myReadTimeSecond = readLastTime - readFirstTime; - - let myWriteTimeSecond = writeLastTime - writeFirstTime; - console.log(TAG, "file myWriteTimeSecond: " + myWriteTimeSecond+"file myReadTimeSecond: " + myReadTimeSecond); - - - // worker线程向主线程发送信息 - myWriteTimeSecond = myWriteTimeSecond / 1000; - myReadTimeSecond = myReadTimeSecond / 1000; - let myWriteTimeSpeed = Math.floor(300 / myWriteTimeSecond) ; - let myReadTimeSpeed = Math.floor(300 / myReadTimeSecond) ; - - var buffer = new ArrayBuffer(2); - buffer[0] = myWriteTimeSpeed; - buffer[1] = myReadTimeSpeed; - console.log(TAG, "file buffer: " + buffer); - workerPort.postMessage(buffer,[buffer]); - }).catch((err: BusinessError) => { - console.error(TAG, "open file failed with error message: " + err.message + ", error code: " + err.code); - // worker线程向主线程发送信息 - workerPort.postMessage(-1) - }).catch((err: BusinessError) => { - workerPort.postMessage(-1) - console.info(TAG, "remove file failed with error message: " + err.message + ", error code: " + err.code); - }); - console.info(TAG, "fileWriteAndRead end"); - -} - -workerPort.onmessage = async function(e) { - - - - // data:主线程发送的信息 - let workFilePath = e.data; - console.info(TAG, `workFilePath: + ${workFilePath}` ); - fileWriteAndRead(workFilePath); - -} - -// worker线程发生error的回调 -workerPort.onerror= function(e) { - console.log(TAG, "worker.ts onerror"); -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/module.json5 b/unionpi_tiger/sample_api10/app/factory/entry/src/main/module.json5 deleted file mode 100644 index 8c60b9a3..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/main/module.json5 +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -{ - "module": { - "name": "entry", - "type": "entry", - "description": "$string:module_desc", - "mainElement": "EntryAbility", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false, - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "EntryAbility", - "srcEntry": "./ets/entryability/EntryAbility.ts", - "description": "$string:EntryAbility_desc", - "icon": "$media:icon", - "label": "$string:EntryAbility_label", - "startWindowIcon": "$media:icon", - "startWindowBackground": "$color:start_window_background", - "exported": true, - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ] - } - ], - "requestPermissions": [ - // wifi - { - "name": "ohos.permission.FILE_ACCESS_MANAGER" - }, - { - "name": "ohos.permission.GET_WIFI_INFO" - }, - { - "name": "ohos.permission.GET_WIFI_INFO_INTERNAL" - }, - { - "name": "ohos.permission.SET_WIFI_INFO" - }, - { - "name": "ohos.permission.GET_WIFI_PEERS_MAC" - }, - { - "name": "ohos.permission.GET_WIFI_LOCAL_MAC" - }, - { - "name": "ohos.permission.GET_WIFI_CONFIG" - }, - { - "name": "ohos.permission.SET_WIFI_CONFIG" - }, - { - "name": "ohos.permission.MANAGE_WIFI_CONNECTION" - }, - { - "name": "ohos.permission.MANAGE_WIFI_HOTSPOT" - }, - // bluetooth - { - "name": "ohos.permission.LOCATION" - }, - { - "name": "ohos.permission.APPROXIMATELY_LOCATION" - }, - { - "name": "ohos.permission.USE_BLUETOOTH", - }, - { - "name": "ohos.permission.DISCOVER_BLUETOOTH", - }, - { - "name": "ohos.permission.LOCATION", - }, - { - "name": "ohos.permission.APPROXIMATELY_LOCATION", - }, - { - "name": "ohos.permission.MANAGE_BLUETOOTH", - }, - { - "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - }, - { - "name": "ohos.permission.CAPTURE_SCREEN" - }, - { - "name": "ohos.permission.WRITE_MEDIA" - }, - { - "name": "ohos.permission.READ_MEDIA" - }, - { - "name": "ohos.permission.INTERNET" - }, - { - "name": "ohos.permission.MEDIA_LOCATION" - }, - { - "name": "ohos.permission.CAMERA" - }, - { - "name": "ohos.permission.MICROPHONE" - }, - { - "name": "ohos.permission.START_INVISIBLE_ABILITY" - }, - // audio - { - "name": "ohos.permission.WRITE_ACCESSIBILITY_CONFIG" - } - ] - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/base/element/color.json b/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/base/element/color.json deleted file mode 100644 index d66f9a7d..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/base/element/string.json b/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 2639a08a..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,165 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "factoryTest" - }, - { - "name": "entry_MainAbility", - "value": "eTSWLAN" - }, - { - "name": "description_mainability", - "value": "eTSWLAN Ability" - }, - { - "name": "cancel", - "value": "Cancel" - }, - { - "name": "sure", - "value": "Sure" - }, - { - "name": "wlan", - "value": "WLAN" - }, - { - "name": "available_wlan", - "value": "Available WLAN" - }, - { - "name": "connected", - "value": "Connected" - }, - { - "name": "about", - "value": "About" - }, - { - "name": "ip_address", - "value": "IP address:" - }, - { - "name": "gate_way", - "value": "Gateway:" - }, - { - "name": "net_mask", - "value": "Netmask:" - }, - { - "name": "primary_dns", - "value": "Primary Dns IP address:" - }, - { - "name": "second_dns", - "value": "Second DNS IP address:" - }, - { - "name": "server_ip", - "value": "DHCP server IP:" - }, - { - "name": "lease_duration", - "value": "IP address lease duration:" - }, - { - "name": "country_code", - "value": "Country code:" - }, - { - "name": "infrastructure_feature", - "value": "Infrastructure Feature:" - }, - { - "name": "ghz_feature", - "value": "5 GHz Feature:" - }, - { - "name": "gas_anqp_feature", - "value": "GAS/ANQP Feature:" - }, - { - "name": "wifi_direct", - "value": "WiFi-Direct Feature:" - }, - { - "name": "soft_ap", - "value": "Soft AP Feature:" - }, - { - "name": "wifi_aware", - "value": "WiFi Aware Feature:" - }, - { - "name": "encryption", - "value": "encrypted" - }, - { - "name": "open", - "value": "open" - }, - // bluetooth - { - "name": "bluetooth", - "value": "bluetooth" - }, - { - "name": "match", - "value": "pairing" - }, - { - "name": "match_request", - "value": "Bluetooth Pairing Request" - }, - { - "name": "available_device", - "value": "Available Devices" - }, - { - "name": "paired_device", - "value": "Paired Devices" - }, - { - "name": "discovery", - "value": "The device can be detected by nearby devices" - }, - { - "name": "confirm", - "value": "confirm" - }, - { - "name": "grant_permission", - "value": "After paired, access to the address book and call records is granted to the paired device" - }, - { - "name": "disconnect", - "value": "Disconnect?" - }, - { - "name": "grant_use_bluetooth", - "value": "Apply bluetooth permission" - }, - { - "name": "grant_discovery_bluetooth", - "value": "Discover bluetooth permission" - }, - { - "name": "grant_location", - "value": "Obtaining location permission" - }, - { - "name": "grant_manage_bluetooth", - "value": "Managing bluetooth permission" - } - ] -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/base/media/about.png b/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/base/media/about.png deleted file mode 100644 index 2613fc35..00000000 Binary files a/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/base/media/about.png and /dev/null differ diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/base/media/bg_play.png b/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/base/media/bg_play.png deleted file mode 100644 index 8f330e1d..00000000 Binary files a/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/base/media/bg_play.png and /dev/null differ diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/base/media/bg_record.png b/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/base/media/bg_record.png deleted file mode 100644 index 41c12ccb..00000000 Binary files a/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/base/media/bg_record.png and /dev/null differ diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/base/media/ic_back.png b/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/base/media/ic_back.png deleted file mode 100644 index 099eee41..00000000 Binary files a/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/base/media/ic_back.png and /dev/null differ diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/base/media/ic_circled.svg b/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/base/media/ic_circled.svg deleted file mode 100644 index 1d415be3..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/base/media/ic_circled.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - ic_circled - - - - \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/base/media/ic_circled_filled.svg b/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/base/media/ic_circled_filled.svg deleted file mode 100644 index 8f13b88a..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/base/media/ic_circled_filled.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - ic_circled_filled - - - - \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/base/media/ic_pause.png b/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/base/media/ic_pause.png deleted file mode 100644 index 4233656c..00000000 Binary files a/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/base/media/ic_pause.png and /dev/null differ diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/base/media/ic_play.png b/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/base/media/ic_play.png deleted file mode 100644 index 3e89b712..00000000 Binary files a/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/base/media/ic_play.png and /dev/null differ diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/base/media/icon.png b/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a88..00000000 Binary files a/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/base/media/lock.png b/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/base/media/lock.png deleted file mode 100644 index b78d86d2..00000000 Binary files a/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/base/media/lock.png and /dev/null differ diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/base/media/pause.png b/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/base/media/pause.png deleted file mode 100644 index 88dbcb51..00000000 Binary files a/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/base/media/pause.png and /dev/null differ diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/base/media/play.png b/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/base/media/play.png deleted file mode 100644 index 12b58b31..00000000 Binary files a/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/base/media/play.png and /dev/null differ diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/base/media/rectangle.png b/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/base/media/rectangle.png deleted file mode 100644 index c46bda81..00000000 Binary files a/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/base/media/rectangle.png and /dev/null differ diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/base/media/slider_time.png b/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/base/media/slider_time.png deleted file mode 100644 index 5d04b153..00000000 Binary files a/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/base/media/slider_time.png and /dev/null differ diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/base/media/take_video_normal.svg b/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/base/media/take_video_normal.svg deleted file mode 100644 index 550acc1f..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/base/media/take_video_normal.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - ic/camera/shutter/take_video_normal - Created with Sketch. - - - - - \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/base/media/take_video_stop.svg b/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/base/media/take_video_stop.svg deleted file mode 100644 index 0ab5b602..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/base/media/take_video_stop.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - ic/camera/shutter/take_video_stop - Created with Sketch. - - - - - \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/base/media/wifi.png b/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/base/media/wifi.png deleted file mode 100644 index 7017ea92..00000000 Binary files a/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/base/media/wifi.png and /dev/null differ diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/base/profile/main_pages.json b/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 47b1f379..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "src": [ - "pages/Index", - "pages/testSample/information", - "pages/testSample/gradient", - "pages/testSample/fileRW", - "pages/testSample/wifi", - "pages/testSample/bluetooth", - "pages/testSample/audio", - "pages/Mic/Mic_index", - "pages/Camera/Camera_index", - "pages/testSample/sensor", - "pages/testSample/nfc", - "pages/testSample/touch", - "pages/testSample/led" - ] -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/en_US/element/string.json b/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/en_US/element/string.json deleted file mode 100644 index eecbafcd..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/en_US/element/string.json +++ /dev/null @@ -1,166 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "factoryTest" - }, - { - "name": "entry_MainAbility", - "value": "eTSWLAN" - }, - { - "name": "description_mainability", - "value": "eTSWLAN Ability" - }, - { - "name": "cancel", - "value": "Cancel" - }, - { - "name": "wlan", - "value": "WLAN" - }, - { - "name": "sure", - "value": "Sure" - }, - { - "name": "available_wlan", - "value": "Available WLAN" - }, - { - "name": "connected", - "value": "Connected" - }, - { - "name": "about", - "value": "About" - }, - { - "name": "ip_address", - "value": "IP address:" - }, - { - "name": "gate_way", - "value": "Gateway:" - }, - { - "name": "net_mask", - "value": "Netmask:" - }, - { - "name": "primary_dns", - "value": "Primary Dns IP address:" - }, - { - "name": "second_dns", - "value": "Second DNS IP address:" - }, - { - "name": "server_ip", - "value": "DHCP server IP:" - }, - { - "name": "lease_duration", - "value": "IP address lease duration:" - }, - { - "name": "country_code", - "value": "Country code:" - }, - { - "name": "infrastructure_feature", - "value": "Infrastructure Feature:" - }, - { - "name": "ghz_feature", - "value": "5 GHz Feature:" - }, - { - "name": "gas_anqp_feature", - "value": "GAS/ANQP Feature:" - }, - { - "name": "wifi_direct", - "value": "WiFi-Direct Feature:" - }, - { - "name": "soft_ap", - "value": "Soft AP Feature:" - }, - { - "name": "wifi_aware", - "value": "WiFi Aware Feature:" - }, - { - "name": "encryption", - "value": "encrypted" - }, - { - "name": "open", - "value": "open" - }, - // bluetooth - { - "name": "bluetooth", - "value": "bluetooth" - }, - { - "name": "match", - "value": "pairing" - }, - { - "name": "match_request", - "value": "Bluetooth Pairing Request" - }, - { - "name": "available_device", - "value": "Available Devices" - }, - { - "name": "paired_device", - "value": "Paired Devices" - }, - { - "name": "discovery", - "value": "The device can be detected by nearby devices" - }, - { - "name": "confirm", - "value": "confirm" - }, - { - "name": "grant_permission", - "value": "After paired, access to the address book and call records is granted to the paired device" - }, - { - "name": "disconnect", - "value": "Disconnect?" - }, - { - "name": "grant_use_bluetooth", - "value": "Apply bluetooth permission" - }, - { - "name": "grant_discovery_bluetooth", - "value": "Discover bluetooth permission" - }, - { - "name": "grant_location", - "value": "Obtaining location permission" - }, - { - "name": "grant_manage_bluetooth", - "value": "Managing bluetooth permission" - } - - ] -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/rawfile/EP11.mp4 b/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/rawfile/EP11.mp4 deleted file mode 100644 index e0d410d4..00000000 Binary files a/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/rawfile/EP11.mp4 and /dev/null differ diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/rawfile/Technology.mp3 b/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/rawfile/Technology.mp3 deleted file mode 100644 index 74122760..00000000 Binary files a/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/rawfile/Technology.mp3 and /dev/null differ diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/rawfile/Technology.wav b/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/rawfile/Technology.wav deleted file mode 100644 index 2490cc49..00000000 Binary files a/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/rawfile/Technology.wav and /dev/null differ diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/zh_CN/element/string.json b/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/zh_CN/element/string.json deleted file mode 100644 index cc6479aa..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/main/resources/zh_CN/element/string.json +++ /dev/null @@ -1,157 +0,0 @@ -{ - "string": [ - { - "name": "EntryAbility_label", - "value": "factoryTest" - }, - { - "name": "module_desc", - "value": "模块描述" - }, - { - "name": "cancel", - "value": "取消" - }, - { - "name": "sure", - "value": "确定" - }, - { - "name": "wlan", - "value": "WLAN" - }, - { - "name": "available_wlan", - "value": "可用WLAN" - }, - { - "name": "connected", - "value": "已连接" - }, - { - "name": "about", - "value": "关于" - }, - { - "name": "ip_address", - "value": "IP地址:" - }, - { - "name": "gate_way", - "value": "网关:" - }, - { - "name": "net_mask", - "value": "掩码:" - }, - { - "name": "primary_dns", - "value": "主DNS服务器:" - }, - { - "name": "second_dns", - "value": "备DNS服务器:" - }, - { - "name": "server_ip", - "value": "DHCP服务端ip:" - }, - { - "name": "lease_duration", - "value": "IP地址租用时长:" - }, - { - "name": "country_code", - "value": "国家码:" - }, - { - "name": "infrastructure_feature", - "value": "基础结构模式特性:" - }, - { - "name": "ghz_feature", - "value": "5 GHz 宽带特性:" - }, - { - "name": "gas_anqp_feature", - "value": "GAS/ANQP特性:" - }, - { - "name": "wifi_direct", - "value": "WiFi-Direct特性:" - }, - { - "name": "soft_ap", - "value": "Soft AP特性:" - }, - { - "name": "wifi_aware", - "value": "WiFi Aware组网特性:" - }, - { - "name": "encryption", - "value": "加密" - }, - { - "name": "open", - "value": "开放" - }, - // bluetooth - { - "name": "MainAbility_label", - "value": "蓝牙" - }, - { - "name": "bluetooth", - "value": "蓝牙" - }, - { - "name": "match", - "value": "配对" - }, - { - "name": "match_request", - "value": "蓝牙配对请求" - }, - { - "name": "available_device", - "value": "可用设备" - }, - { - "name": "paired_device", - "value": "已配对的设备" - }, - { - "name": "discovery", - "value": "当前可被附近的设备发现" - }, - { - "name": "confirm", - "value": "确定" - }, - { - "name": "grant_permission", - "value": "配对之后,向所配对设备授予通讯录和通话记录的访问权限" - }, - { - "name": "disconnect", - "value": "断开连接?" - }, - { - "name": "grant_use_bluetooth", - "value": "应用蓝牙权限" - }, - { - "name": "grant_discovery_bluetooth", - "value": "发现蓝牙权限" - }, - { - "name": "grant_location", - "value": "获取位置权限" - }, - { - "name": "grant_manage_bluetooth", - "value": "管理蓝牙权限" - } - ] -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/ohosTest/ets/test/Ability.test.ets b/unionpi_tiger/sample_api10/app/factory/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index dbd0a662..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2023 Unionman Technology Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import hilog from '@ohos.hilog'; -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' - -export default function abilityTest() { - describe('ActsAbilityTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }) - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }) - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }) - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }) - /** - * @tc.number : assertContain_0 - * @tc.name : assertContain - * @tc.desc : test - */ - it('assertContain',0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - hilog.info(0x0000, 'testTag', '%{public}s', 'it begin'); - let a = 'abc' - let b = 'b' - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b) - expect(a).assertEqual(a) - }) - }) -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/ohosTest/ets/test/List.test.ets b/unionpi_tiger/sample_api10/app/factory/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 5b03e231..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -import abilityTest from './Ability.test' - -export default function testsuite() { - abilityTest() -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/ohosTest/ets/testability/TestAbility.ets b/unionpi_tiger/sample_api10/app/factory/entry/src/ohosTest/ets/testability/TestAbility.ets deleted file mode 100644 index 0a4ddd62..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/ohosTest/ets/testability/TestAbility.ets +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2023 Unionman Technology Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import UIAbility from '@ohos.app.ability.UIAbility'; -import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; -import hilog from '@ohos.hilog'; -import { Hypium } from '@ohos/hypium'; -import testsuite from '../test/List.test'; -import window from '@ohos.window'; -import Want from '@ohos.app.ability.Want'; -import AbilityConstant from '@ohos.app.ability.AbilityConstant'; - -export default class TestAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam) { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onCreate'); - hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? ''); - hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:'+ JSON.stringify(launchParam) ?? ''); - let abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - let abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - hilog.info(0x0000, 'testTag', '%{public}s', 'start run testcase!!!'); - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - } - - onDestroy() { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage) { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageCreate'); - windowStage.loadContent('testability/pages/Index', (err, data) => { - if (err.code) { - hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); - return; - } - hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', - JSON.stringify(data) ?? ''); - }); - } - - onWindowStageDestroy() { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageDestroy'); - } - - onForeground() { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onForeground'); - } - - onBackground() { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onBackground'); - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/ohosTest/ets/testability/pages/Index.ets b/unionpi_tiger/sample_api10/app/factory/entry/src/ohosTest/ets/testability/pages/Index.ets deleted file mode 100644 index 6f5cbb26..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/ohosTest/ets/testability/pages/Index.ets +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -import hilog from '@ohos.hilog'; - -@Entry -@Component -struct Index { - aboutToAppear() { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility index aboutToAppear'); - } - @State message: string = 'Hello World' - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - Button() { - Text('next page') - .fontSize(20) - .fontWeight(FontWeight.Bold) - }.type(ButtonType.Capsule) - .margin({ - top: 20 - }) - .backgroundColor('#0D9FFB') - .width('35%') - .height('5%') - .onClick(()=>{ - }) - } - .width('100%') - } - .height('100%') - } - } \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ts b/unionpi_tiger/sample_api10/app/factory/entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ts deleted file mode 100644 index 0c1a3f5a..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ts +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -import hilog from '@ohos.hilog'; -import TestRunner from '@ohos.application.testRunner'; -import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; - -var abilityDelegator = undefined -var abilityDelegatorArguments = undefined - -async function onAbilityCreateCallback() { - hilog.info(0x0000, 'testTag', '%{public}s', 'onAbilityCreateCallback'); -} - -async function addAbilityMonitorCallback(err: any) { - hilog.info(0x0000, 'testTag', 'addAbilityMonitorCallback : %{public}s', JSON.stringify(err) ?? ''); -} - -export default class OpenHarmonyTestRunner implements TestRunner { - constructor() { - } - - onPrepare() { - hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner OnPrepare '); - } - - async onRun() { - hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun run'); - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility' - let lMonitor = { - abilityName: testAbilityName, - onAbilityCreate: onAbilityCreateCallback, - }; - abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) - var cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName - var debug = abilityDelegatorArguments.parameters['-D'] - if (debug == 'true') - { - cmd += ' -D' - } - hilog.info(0x0000, 'testTag', 'cmd : %{public}s', cmd); - abilityDelegator.executeShellCommand(cmd, - (err: any, d: any) => { - hilog.info(0x0000, 'testTag', 'executeShellCommand : err : %{public}s', JSON.stringify(err) ?? ''); - hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.stdResult ?? ''); - hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.exitCode ?? ''); - }) - hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun end'); - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/ohosTest/module.json5 b/unionpi_tiger/sample_api10/app/factory/entry/src/ohosTest/module.json5 deleted file mode 100644 index 4eb4cc32..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -{ - "module": { - "name": "entry_test", - "type": "feature", - "description": "$string:module_test_desc", - "mainElement": "TestAbility", - "deviceTypes": [ - "default" - ], - "deliveryWithInstall": true, - "installationFree": false, - "pages": "$profile:test_pages", - "abilities": [ - { - "name": "TestAbility", - "srcEntry": "./ets/testability/TestAbility.ets", - "description": "$string:TestAbility_desc", - "icon": "$media:icon", - "label": "$string:TestAbility_label", - "exported": true, - "startWindowIcon": "$media:icon", - "startWindowBackground": "$color:start_window_background", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - } - ] - } - ] - } -} diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/ohosTest/resources/base/element/color.json b/unionpi_tiger/sample_api10/app/factory/entry/src/ohosTest/resources/base/element/color.json deleted file mode 100644 index 3c712962..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/ohosTest/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/ohosTest/resources/base/element/string.json b/unionpi_tiger/sample_api10/app/factory/entry/src/ohosTest/resources/base/element/string.json deleted file mode 100644 index 65d8fa5a..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/ohosTest/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_test_desc", - "value": "test ability description" - }, - { - "name": "TestAbility_desc", - "value": "the test ability" - }, - { - "name": "TestAbility_label", - "value": "test label" - } - ] -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/ohosTest/resources/base/media/icon.png b/unionpi_tiger/sample_api10/app/factory/entry/src/ohosTest/resources/base/media/icon.png deleted file mode 100644 index ce307a88..00000000 Binary files a/unionpi_tiger/sample_api10/app/factory/entry/src/ohosTest/resources/base/media/icon.png and /dev/null differ diff --git a/unionpi_tiger/sample_api10/app/factory/entry/src/ohosTest/resources/base/profile/test_pages.json b/unionpi_tiger/sample_api10/app/factory/entry/src/ohosTest/resources/base/profile/test_pages.json deleted file mode 100644 index b7e7343c..00000000 --- a/unionpi_tiger/sample_api10/app/factory/entry/src/ohosTest/resources/base/profile/test_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "testability/pages/Index" - ] -} diff --git a/unionpi_tiger/sample_api10/app/factory/hvigor/hvigor-config.json5 b/unionpi_tiger/sample_api10/app/factory/hvigor/hvigor-config.json5 deleted file mode 100644 index 22bdf4d4..00000000 --- a/unionpi_tiger/sample_api10/app/factory/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -{ - "hvigorVersion": "3.0.2", - "dependencies": { - "@ohos/hvigor-ohos-plugin": "3.0.2" - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/factory/hvigor/hvigor-wrapper.js b/unionpi_tiger/sample_api10/app/factory/hvigor/hvigor-wrapper.js deleted file mode 100644 index 994f2298..00000000 --- a/unionpi_tiger/sample_api10/app/factory/hvigor/hvigor-wrapper.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict";var e=require("fs"),t=require("path"),n=require("os"),r=require("crypto"),u=require("child_process"),o=require("constants"),i=require("stream"),s=require("util"),c=require("assert"),a=require("tty"),l=require("zlib"),f=require("net");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var D=d(e),p=d(t),E=d(n),m=d(r),h=d(u),y=d(o),C=d(i),F=d(s),g=d(c),A=d(a),v=d(l),S=d(f),w="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},O={},b={},_={},B=w&&w.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_,"__esModule",{value:!0}),_.isMac=_.isLinux=_.isWindows=void 0;const P=B(E.default),k="Windows_NT",x="Linux",N="Darwin";_.isWindows=function(){return P.default.type()===k},_.isLinux=function(){return P.default.type()===x},_.isMac=function(){return P.default.type()===N};var I={},T=w&&w.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),R=w&&w.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),M=w&&w.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&T(t,e,n);return R(t,e),t};Object.defineProperty(I,"__esModule",{value:!0}),I.hash=void 0;const L=M(m.default);I.hash=function(e,t="md5"){return L.createHash(t).update(e,"utf-8").digest("hex")},function(e){var t=w&&w.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=w&&w.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=w&&w.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var u in e)"default"!==u&&Object.prototype.hasOwnProperty.call(e,u)&&t(r,e,u);return n(r,e),r};Object.defineProperty(e,"__esModule",{value:!0}),e.HVIGOR_BOOT_JS_FILE_PATH=e.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH=e.HVIGOR_PROJECT_DEPENDENCIES_HOME=e.HVIGOR_PROJECT_WRAPPER_HOME=e.HVIGOR_PROJECT_NAME=e.HVIGOR_PROJECT_ROOT_DIR=e.HVIGOR_PROJECT_CACHES_HOME=e.HVIGOR_PNPM_STORE_PATH=e.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH=e.HVIGOR_WRAPPER_TOOLS_HOME=e.HVIGOR_USER_HOME=e.DEFAULT_PACKAGE_JSON=e.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME=e.PNPM=e.HVIGOR=e.NPM_TOOL=e.PNPM_TOOL=e.HVIGOR_ENGINE_PACKAGE_NAME=void 0;const u=r(p.default),o=r(E.default),i=_,s=I;e.HVIGOR_ENGINE_PACKAGE_NAME="@ohos/hvigor",e.PNPM_TOOL=(0,i.isWindows)()?"pnpm.cmd":"pnpm",e.NPM_TOOL=(0,i.isWindows)()?"npm.cmd":"npm",e.HVIGOR="hvigor",e.PNPM="pnpm",e.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME="hvigor-config.json5",e.DEFAULT_PACKAGE_JSON="package.json",e.HVIGOR_USER_HOME=u.resolve(o.homedir(),".hvigor"),e.HVIGOR_WRAPPER_TOOLS_HOME=u.resolve(e.HVIGOR_USER_HOME,"wrapper","tools"),e.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH=u.resolve(e.HVIGOR_WRAPPER_TOOLS_HOME,"node_modules",".bin",e.PNPM_TOOL),e.HVIGOR_PNPM_STORE_PATH=u.resolve(e.HVIGOR_USER_HOME,"caches"),e.HVIGOR_PROJECT_CACHES_HOME=u.resolve(e.HVIGOR_USER_HOME,"project_caches"),e.HVIGOR_PROJECT_ROOT_DIR=process.cwd(),e.HVIGOR_PROJECT_NAME=u.basename((0,s.hash)(e.HVIGOR_PROJECT_ROOT_DIR)),e.HVIGOR_PROJECT_WRAPPER_HOME=u.resolve(e.HVIGOR_PROJECT_ROOT_DIR,e.HVIGOR),e.HVIGOR_PROJECT_DEPENDENCIES_HOME=u.resolve(e.HVIGOR_PROJECT_CACHES_HOME,e.HVIGOR_PROJECT_NAME,"workspace"),e.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH=u.resolve(e.HVIGOR_PROJECT_DEPENDENCIES_HOME,e.DEFAULT_PACKAGE_JSON),e.HVIGOR_BOOT_JS_FILE_PATH=u.resolve(e.HVIGOR_PROJECT_DEPENDENCIES_HOME,"node_modules","@ohos","hvigor","bin","hvigor.js")}(b);var j={},$={};Object.defineProperty($,"__esModule",{value:!0}),$.logInfoPrintConsole=$.logErrorAndExit=void 0,$.logErrorAndExit=function(e){e instanceof Error?console.error(e.message):console.error(e),process.exit(-1)},$.logInfoPrintConsole=function(e){console.log(e)};var H=w&&w.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),J=w&&w.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),G=w&&w.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&H(t,e,n);return J(t,e),t},V=w&&w.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(j,"__esModule",{value:!0}),j.isFileExists=j.offlinePluginConversion=j.executeCommand=j.getNpmPath=j.hasNpmPackInPaths=void 0;const U=h.default,W=G(p.default),z=b,K=$,q=V(D.default);j.hasNpmPackInPaths=function(e,t){try{return require.resolve(e,{paths:[...t]}),!0}catch(e){return!1}},j.getNpmPath=function(){const e=process.execPath;return W.join(W.dirname(e),z.NPM_TOOL)},j.executeCommand=function(e,t,n){0!==(0,U.spawnSync)(e,t,n).status&&(0,K.logErrorAndExit)(`Error: ${e} ${t} execute failed.See above for details.`)},j.offlinePluginConversion=function(e,t){return t.startsWith("file:")||t.endsWith(".tgz")?W.resolve(e,z.HVIGOR,t.replace("file:","")):t},j.isFileExists=function(e){return q.default.existsSync(e)&&q.default.statSync(e).isFile()},function(e){var t=w&&w.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=w&&w.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=w&&w.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var u in e)"default"!==u&&Object.prototype.hasOwnProperty.call(e,u)&&t(r,e,u);return n(r,e),r},u=w&&w.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.executeInstallPnpm=e.isPnpmAvailable=e.environmentHandler=e.checkNpmConifg=e.PNPM_VERSION=void 0;const o=r(D.default),i=b,s=j,c=r(p.default),a=$,l=h.default,f=u(E.default);e.PNPM_VERSION="7.30.0",e.checkNpmConifg=function(){const e=c.resolve(i.HVIGOR_PROJECT_ROOT_DIR,".npmrc"),t=c.resolve(f.default.homedir(),".npmrc");if((0,s.isFileExists)(e)||(0,s.isFileExists)(t))return;const n=(0,s.getNpmPath)(),r=(0,l.spawnSync)(n,["config","get","prefix"],{cwd:i.HVIGOR_PROJECT_ROOT_DIR});if(0!==r.status||!r.stdout)return void(0,a.logErrorAndExit)("Error: The hvigor depends on the npmrc file. Configure the npmrc file first.");const u=c.resolve(`${r.stdout}`.replace(/[\r\n]/gi,""),".npmrc");(0,s.isFileExists)(u)||(0,a.logErrorAndExit)("Error: The hvigor depends on the npmrc file. Configure the npmrc file first.")},e.environmentHandler=function(){process.env["npm_config_update-notifier"]="false"},e.isPnpmAvailable=function(){return!!o.existsSync(i.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH)&&(0,s.hasNpmPackInPaths)("pnpm",[i.HVIGOR_WRAPPER_TOOLS_HOME])},e.executeInstallPnpm=function(){(0,a.logInfoPrintConsole)(`Installing pnpm@${e.PNPM_VERSION}...`);const t=(0,s.getNpmPath)();!function(){const t=c.resolve(i.HVIGOR_WRAPPER_TOOLS_HOME,i.DEFAULT_PACKAGE_JSON);try{o.existsSync(i.HVIGOR_WRAPPER_TOOLS_HOME)||o.mkdirSync(i.HVIGOR_WRAPPER_TOOLS_HOME,{recursive:!0});const n={dependencies:{}};n.dependencies[i.PNPM]=e.PNPM_VERSION,o.writeFileSync(t,JSON.stringify(n))}catch(e){(0,a.logErrorAndExit)(`Error: EPERM: operation not permitted,create ${t} failed.`)}}(),(0,s.executeCommand)(t,["install","pnpm"],{cwd:i.HVIGOR_WRAPPER_TOOLS_HOME,stdio:["inherit","inherit","inherit"],env:process.env}),(0,a.logInfoPrintConsole)("Pnpm install success.")}}(O);var Y={},X={},Z={},Q={};Object.defineProperty(Q,"__esModule",{value:!0}),Q.Unicode=void 0;class ee{}Q.Unicode=ee,ee.Space_Separator=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,ee.ID_Start=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,ee.ID_Continue=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,Object.defineProperty(Z,"__esModule",{value:!0}),Z.JudgeUtil=void 0;const te=Q;Z.JudgeUtil=class{static isIgnoreChar(e){return"string"==typeof e&&("\t"===e||"\v"===e||"\f"===e||" "===e||" "===e||"\ufeff"===e||"\n"===e||"\r"===e||"\u2028"===e||"\u2029"===e)}static isSpaceSeparator(e){return"string"==typeof e&&te.Unicode.Space_Separator.test(e)}static isIdStartChar(e){return"string"==typeof e&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||"$"===e||"_"===e||te.Unicode.ID_Start.test(e))}static isIdContinueChar(e){return"string"==typeof e&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e>="0"&&e<="9"||"$"===e||"_"===e||"‌"===e||"‍"===e||te.Unicode.ID_Continue.test(e))}static isDigitWithoutZero(e){return/[1-9]/.test(e)}static isDigit(e){return"string"==typeof e&&/[0-9]/.test(e)}static isHexDigit(e){return"string"==typeof e&&/[0-9A-Fa-f]/.test(e)}};var ne={},re={fromCallback:function(e){return Object.defineProperty((function(...t){if("function"!=typeof t[t.length-1])return new Promise(((n,r)=>{e.call(this,...t,((e,t)=>null!=e?r(e):n(t)))}));e.apply(this,t)}),"name",{value:e.name})},fromPromise:function(e){return Object.defineProperty((function(...t){const n=t[t.length-1];if("function"!=typeof n)return e.apply(this,t);e.apply(this,t.slice(0,-1)).then((e=>n(null,e)),n)}),"name",{value:e.name})}},ue=y.default,oe=process.cwd,ie=null,se=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return ie||(ie=oe.call(process)),ie};try{process.cwd()}catch(e){}if("function"==typeof process.chdir){var ce=process.chdir;process.chdir=function(e){ie=null,ce.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,ce)}var ae=function(e){ue.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(e){e.lchmod=function(t,n,r){e.open(t,ue.O_WRONLY|ue.O_SYMLINK,n,(function(t,u){t?r&&r(t):e.fchmod(u,n,(function(t){e.close(u,(function(e){r&&r(t||e)}))}))}))},e.lchmodSync=function(t,n){var r,u=e.openSync(t,ue.O_WRONLY|ue.O_SYMLINK,n),o=!0;try{r=e.fchmodSync(u,n),o=!1}finally{if(o)try{e.closeSync(u)}catch(e){}else e.closeSync(u)}return r}}(e);e.lutimes||function(e){ue.hasOwnProperty("O_SYMLINK")&&e.futimes?(e.lutimes=function(t,n,r,u){e.open(t,ue.O_SYMLINK,(function(t,o){t?u&&u(t):e.futimes(o,n,r,(function(t){e.close(o,(function(e){u&&u(t||e)}))}))}))},e.lutimesSync=function(t,n,r){var u,o=e.openSync(t,ue.O_SYMLINK),i=!0;try{u=e.futimesSync(o,n,r),i=!1}finally{if(i)try{e.closeSync(o)}catch(e){}else e.closeSync(o)}return u}):e.futimes&&(e.lutimes=function(e,t,n,r){r&&process.nextTick(r)},e.lutimesSync=function(){})}(e);e.chown=r(e.chown),e.fchown=r(e.fchown),e.lchown=r(e.lchown),e.chmod=t(e.chmod),e.fchmod=t(e.fchmod),e.lchmod=t(e.lchmod),e.chownSync=u(e.chownSync),e.fchownSync=u(e.fchownSync),e.lchownSync=u(e.lchownSync),e.chmodSync=n(e.chmodSync),e.fchmodSync=n(e.fchmodSync),e.lchmodSync=n(e.lchmodSync),e.stat=o(e.stat),e.fstat=o(e.fstat),e.lstat=o(e.lstat),e.statSync=i(e.statSync),e.fstatSync=i(e.fstatSync),e.lstatSync=i(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(e,t,n){n&&process.nextTick(n)},e.lchmodSync=function(){});e.chown&&!e.lchown&&(e.lchown=function(e,t,n,r){r&&process.nextTick(r)},e.lchownSync=function(){});"win32"===se&&(e.rename="function"!=typeof e.rename?e.rename:function(t){function n(n,r,u){var o=Date.now(),i=0;t(n,r,(function s(c){if(c&&("EACCES"===c.code||"EPERM"===c.code||"EBUSY"===c.code)&&Date.now()-o<6e4)return setTimeout((function(){e.stat(r,(function(e,o){e&&"ENOENT"===e.code?t(n,r,s):u(c)}))}),i),void(i<100&&(i+=10));u&&u(c)}))}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.rename));function t(t){return t?function(n,r,u){return t.call(e,n,r,(function(e){s(e)&&(e=null),u&&u.apply(this,arguments)}))}:t}function n(t){return t?function(n,r){try{return t.call(e,n,r)}catch(e){if(!s(e))throw e}}:t}function r(t){return t?function(n,r,u,o){return t.call(e,n,r,u,(function(e){s(e)&&(e=null),o&&o.apply(this,arguments)}))}:t}function u(t){return t?function(n,r,u){try{return t.call(e,n,r,u)}catch(e){if(!s(e))throw e}}:t}function o(t){return t?function(n,r,u){function o(e,t){t&&(t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296)),u&&u.apply(this,arguments)}return"function"==typeof r&&(u=r,r=null),r?t.call(e,n,r,o):t.call(e,n,o)}:t}function i(t){return t?function(n,r){var u=r?t.call(e,n,r):t.call(e,n);return u&&(u.uid<0&&(u.uid+=4294967296),u.gid<0&&(u.gid+=4294967296)),u}:t}function s(e){return!e||("ENOSYS"===e.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==e.code&&"EPERM"!==e.code))}e.read="function"!=typeof e.read?e.read:function(t){function n(n,r,u,o,i,s){var c;if(s&&"function"==typeof s){var a=0;c=function(l,f,d){if(l&&"EAGAIN"===l.code&&a<10)return a++,t.call(e,n,r,u,o,i,c);s.apply(this,arguments)}}return t.call(e,n,r,u,o,i,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.read),e.readSync="function"!=typeof e.readSync?e.readSync:(c=e.readSync,function(t,n,r,u,o){for(var i=0;;)try{return c.call(e,t,n,r,u,o)}catch(e){if("EAGAIN"===e.code&&i<10){i++;continue}throw e}});var c};var le=C.default.Stream,fe=function(e){return{ReadStream:function t(n,r){if(!(this instanceof t))return new t(n,r);le.call(this);var u=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,r=r||{};for(var o=Object.keys(r),i=0,s=o.length;ithis.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick((function(){u._read()}));e.open(this.path,this.flags,this.mode,(function(e,t){if(e)return u.emit("error",e),void(u.readable=!1);u.fd=t,u.emit("open",t),u._read()}))},WriteStream:function t(n,r){if(!(this instanceof t))return new t(n,r);le.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var u=Object.keys(r),o=0,i=u.length;o= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}};var de=function(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Object)var t={__proto__:De(e)};else t=Object.create(null);return Object.getOwnPropertyNames(e).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t},De=Object.getPrototypeOf||function(e){return e.__proto__};var pe,Ee,me=D.default,he=ae,ye=fe,Ce=de,Fe=F.default;function ge(e,t){Object.defineProperty(e,pe,{get:function(){return t}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(pe=Symbol.for("graceful-fs.queue"),Ee=Symbol.for("graceful-fs.previous")):(pe="___graceful-fs.queue",Ee="___graceful-fs.previous");var Ae=function(){};if(Fe.debuglog?Ae=Fe.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Ae=function(){var e=Fe.format.apply(Fe,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: "),console.error(e)}),!me[pe]){var ve=w[pe]||[];ge(me,ve),me.close=function(e){function t(t,n){return e.call(me,t,(function(e){e||_e(),"function"==typeof n&&n.apply(this,arguments)}))}return Object.defineProperty(t,Ee,{value:e}),t}(me.close),me.closeSync=function(e){function t(t){e.apply(me,arguments),_e()}return Object.defineProperty(t,Ee,{value:e}),t}(me.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){Ae(me[pe]),g.default.equal(me[pe].length,0)}))}w[pe]||ge(w,me[pe]);var Se,we=Oe(Ce(me));function Oe(e){he(e),e.gracefulify=Oe,e.createReadStream=function(t,n){return new e.ReadStream(t,n)},e.createWriteStream=function(t,n){return new e.WriteStream(t,n)};var t=e.readFile;e.readFile=function(e,n,r){"function"==typeof n&&(r=n,n=null);return function e(n,r,u,o){return t(n,r,(function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof u&&u.apply(this,arguments):be([e,[n,r,u],t,o||Date.now(),Date.now()])}))}(e,n,r)};var n=e.writeFile;e.writeFile=function(e,t,r,u){"function"==typeof r&&(u=r,r=null);return function e(t,r,u,o,i){return n(t,r,u,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof o&&o.apply(this,arguments):be([e,[t,r,u,o],n,i||Date.now(),Date.now()])}))}(e,t,r,u)};var r=e.appendFile;r&&(e.appendFile=function(e,t,n,u){"function"==typeof n&&(u=n,n=null);return function e(t,n,u,o,i){return r(t,n,u,(function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?"function"==typeof o&&o.apply(this,arguments):be([e,[t,n,u,o],r,i||Date.now(),Date.now()])}))}(e,t,n,u)});var u=e.copyFile;u&&(e.copyFile=function(e,t,n,r){"function"==typeof n&&(r=n,n=0);return function e(t,n,r,o,i){return u(t,n,r,(function(u){!u||"EMFILE"!==u.code&&"ENFILE"!==u.code?"function"==typeof o&&o.apply(this,arguments):be([e,[t,n,r,o],u,i||Date.now(),Date.now()])}))}(e,t,n,r)});var o=e.readdir;e.readdir=function(e,t,n){"function"==typeof t&&(n=t,t=null);var r=i.test(process.version)?function(e,t,n,r){return o(e,u(e,t,n,r))}:function(e,t,n,r){return o(e,t,u(e,t,n,r))};return r(e,t,n);function u(e,t,n,u){return function(o,i){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?(i&&i.sort&&i.sort(),"function"==typeof n&&n.call(this,o,i)):be([r,[e,t,n],o,u||Date.now(),Date.now()])}}};var i=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var s=ye(e);d=s.ReadStream,D=s.WriteStream}var c=e.ReadStream;c&&(d.prototype=Object.create(c.prototype),d.prototype.open=function(){var e=this;E(e.path,e.flags,e.mode,(function(t,n){t?(e.autoClose&&e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n),e.read())}))});var a=e.WriteStream;a&&(D.prototype=Object.create(a.prototype),D.prototype.open=function(){var e=this;E(e.path,e.flags,e.mode,(function(t,n){t?(e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n))}))}),Object.defineProperty(e,"ReadStream",{get:function(){return d},set:function(e){d=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return D},set:function(e){D=e},enumerable:!0,configurable:!0});var l=d;Object.defineProperty(e,"FileReadStream",{get:function(){return l},set:function(e){l=e},enumerable:!0,configurable:!0});var f=D;function d(e,t){return this instanceof d?(c.apply(this,arguments),this):d.apply(Object.create(d.prototype),arguments)}function D(e,t){return this instanceof D?(a.apply(this,arguments),this):D.apply(Object.create(D.prototype),arguments)}Object.defineProperty(e,"FileWriteStream",{get:function(){return f},set:function(e){f=e},enumerable:!0,configurable:!0});var p=e.open;function E(e,t,n,r){return"function"==typeof n&&(r=n,n=null),function e(t,n,r,u,o){return p(t,n,r,(function(i,s){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?"function"==typeof u&&u.apply(this,arguments):be([e,[t,n,r,u],i,o||Date.now(),Date.now()])}))}(e,t,n,r)}return e.open=E,e}function be(e){Ae("ENQUEUE",e[0].name,e[1]),me[pe].push(e),Be()}function _e(){for(var e=Date.now(),t=0;t2&&(me[pe][t][3]=e,me[pe][t][4]=e);Be()}function Be(){if(clearTimeout(Se),Se=void 0,0!==me[pe].length){var e=me[pe].shift(),t=e[0],n=e[1],r=e[2],u=e[3],o=e[4];if(void 0===u)Ae("RETRY",t.name,n),t.apply(null,n);else if(Date.now()-u>=6e4){Ae("TIMEOUT",t.name,n);var i=n.pop();"function"==typeof i&&i.call(null,r)}else{var s=Date.now()-o,c=Math.max(o-u,1);s>=Math.min(1.2*c,100)?(Ae("RETRY",t.name,n),t.apply(null,n.concat([u]))):me[pe].push(e)}void 0===Se&&(Se=setTimeout(Be,0))}}process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!me.__patched&&(we=Oe(me),me.__patched=!0),function(e){const t=re.fromCallback,n=we,r=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((e=>"function"==typeof n[e]));Object.assign(e,n),r.forEach((r=>{e[r]=t(n[r])})),e.realpath.native=t(n.realpath.native),e.exists=function(e,t){return"function"==typeof t?n.exists(e,t):new Promise((t=>n.exists(e,t)))},e.read=function(e,t,r,u,o,i){return"function"==typeof i?n.read(e,t,r,u,o,i):new Promise(((i,s)=>{n.read(e,t,r,u,o,((e,t,n)=>{if(e)return s(e);i({bytesRead:t,buffer:n})}))}))},e.write=function(e,t,...r){return"function"==typeof r[r.length-1]?n.write(e,t,...r):new Promise(((u,o)=>{n.write(e,t,...r,((e,t,n)=>{if(e)return o(e);u({bytesWritten:t,buffer:n})}))}))},"function"==typeof n.writev&&(e.writev=function(e,t,...r){return"function"==typeof r[r.length-1]?n.writev(e,t,...r):new Promise(((u,o)=>{n.writev(e,t,...r,((e,t,n)=>{if(e)return o(e);u({bytesWritten:t,buffers:n})}))}))})}(ne);var Pe={},ke={};const xe=p.default;ke.checkPath=function(e){if("win32"===process.platform){if(/[<>:"|?*]/.test(e.replace(xe.parse(e).root,""))){const t=new Error(`Path contains invalid characters: ${e}`);throw t.code="EINVAL",t}}};const Ne=ne,{checkPath:Ie}=ke,Te=e=>"number"==typeof e?e:{mode:511,...e}.mode;Pe.makeDir=async(e,t)=>(Ie(e),Ne.mkdir(e,{mode:Te(t),recursive:!0})),Pe.makeDirSync=(e,t)=>(Ie(e),Ne.mkdirSync(e,{mode:Te(t),recursive:!0}));const Re=re.fromPromise,{makeDir:Me,makeDirSync:Le}=Pe,je=Re(Me);var $e={mkdirs:je,mkdirsSync:Le,mkdirp:je,mkdirpSync:Le,ensureDir:je,ensureDirSync:Le};const He=re.fromPromise,Je=ne;var Ge={pathExists:He((function(e){return Je.access(e).then((()=>!0)).catch((()=>!1))})),pathExistsSync:Je.existsSync};const Ve=we;var Ue=function(e,t,n,r){Ve.open(e,"r+",((e,u)=>{if(e)return r(e);Ve.futimes(u,t,n,(e=>{Ve.close(u,(t=>{r&&r(e||t)}))}))}))},We=function(e,t,n){const r=Ve.openSync(e,"r+");return Ve.futimesSync(r,t,n),Ve.closeSync(r)};const ze=ne,Ke=p.default,qe=F.default;function Ye(e,t,n){const r=n.dereference?e=>ze.stat(e,{bigint:!0}):e=>ze.lstat(e,{bigint:!0});return Promise.all([r(e),r(t).catch((e=>{if("ENOENT"===e.code)return null;throw e}))]).then((([e,t])=>({srcStat:e,destStat:t})))}function Xe(e,t){return t.ino&&t.dev&&t.ino===e.ino&&t.dev===e.dev}function Ze(e,t){const n=Ke.resolve(e).split(Ke.sep).filter((e=>e)),r=Ke.resolve(t).split(Ke.sep).filter((e=>e));return n.reduce(((e,t,n)=>e&&r[n]===t),!0)}function Qe(e,t,n){return`Cannot ${n} '${e}' to a subdirectory of itself, '${t}'.`}var et={checkPaths:function(e,t,n,r,u){qe.callbackify(Ye)(e,t,r,((r,o)=>{if(r)return u(r);const{srcStat:i,destStat:s}=o;if(s){if(Xe(i,s)){const r=Ke.basename(e),o=Ke.basename(t);return"move"===n&&r!==o&&r.toLowerCase()===o.toLowerCase()?u(null,{srcStat:i,destStat:s,isChangingCase:!0}):u(new Error("Source and destination must not be the same."))}if(i.isDirectory()&&!s.isDirectory())return u(new Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`));if(!i.isDirectory()&&s.isDirectory())return u(new Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`))}return i.isDirectory()&&Ze(e,t)?u(new Error(Qe(e,t,n))):u(null,{srcStat:i,destStat:s})}))},checkPathsSync:function(e,t,n,r){const{srcStat:u,destStat:o}=function(e,t,n){let r;const u=n.dereference?e=>ze.statSync(e,{bigint:!0}):e=>ze.lstatSync(e,{bigint:!0}),o=u(e);try{r=u(t)}catch(e){if("ENOENT"===e.code)return{srcStat:o,destStat:null};throw e}return{srcStat:o,destStat:r}}(e,t,r);if(o){if(Xe(u,o)){const r=Ke.basename(e),i=Ke.basename(t);if("move"===n&&r!==i&&r.toLowerCase()===i.toLowerCase())return{srcStat:u,destStat:o,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(u.isDirectory()&&!o.isDirectory())throw new Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`);if(!u.isDirectory()&&o.isDirectory())throw new Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`)}if(u.isDirectory()&&Ze(e,t))throw new Error(Qe(e,t,n));return{srcStat:u,destStat:o}},checkParentPaths:function e(t,n,r,u,o){const i=Ke.resolve(Ke.dirname(t)),s=Ke.resolve(Ke.dirname(r));if(s===i||s===Ke.parse(s).root)return o();ze.stat(s,{bigint:!0},((i,c)=>i?"ENOENT"===i.code?o():o(i):Xe(n,c)?o(new Error(Qe(t,r,u))):e(t,n,s,u,o)))},checkParentPathsSync:function e(t,n,r,u){const o=Ke.resolve(Ke.dirname(t)),i=Ke.resolve(Ke.dirname(r));if(i===o||i===Ke.parse(i).root)return;let s;try{s=ze.statSync(i,{bigint:!0})}catch(e){if("ENOENT"===e.code)return;throw e}if(Xe(n,s))throw new Error(Qe(t,r,u));return e(t,n,i,u)},isSrcSubdir:Ze,areIdentical:Xe};const tt=we,nt=p.default,rt=$e.mkdirs,ut=Ge.pathExists,ot=Ue,it=et;function st(e,t,n,r,u){const o=nt.dirname(n);ut(o,((i,s)=>i?u(i):s?at(e,t,n,r,u):void rt(o,(o=>o?u(o):at(e,t,n,r,u)))))}function ct(e,t,n,r,u,o){Promise.resolve(u.filter(n,r)).then((i=>i?e(t,n,r,u,o):o()),(e=>o(e)))}function at(e,t,n,r,u){(r.dereference?tt.stat:tt.lstat)(t,((o,i)=>o?u(o):i.isDirectory()?function(e,t,n,r,u,o){return t?Dt(n,r,u,o):function(e,t,n,r,u){tt.mkdir(n,(o=>{if(o)return u(o);Dt(t,n,r,(t=>t?u(t):dt(n,e,u)))}))}(e.mode,n,r,u,o)}(i,e,t,n,r,u):i.isFile()||i.isCharacterDevice()||i.isBlockDevice()?function(e,t,n,r,u,o){return t?function(e,t,n,r,u){if(!r.overwrite)return r.errorOnExist?u(new Error(`'${n}' already exists`)):u();tt.unlink(n,(o=>o?u(o):lt(e,t,n,r,u)))}(e,n,r,u,o):lt(e,n,r,u,o)}(i,e,t,n,r,u):i.isSymbolicLink()?function(e,t,n,r,u){tt.readlink(t,((t,o)=>t?u(t):(r.dereference&&(o=nt.resolve(process.cwd(),o)),e?void tt.readlink(n,((t,i)=>t?"EINVAL"===t.code||"UNKNOWN"===t.code?tt.symlink(o,n,u):u(t):(r.dereference&&(i=nt.resolve(process.cwd(),i)),it.isSrcSubdir(o,i)?u(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${i}'.`)):e.isDirectory()&&it.isSrcSubdir(i,o)?u(new Error(`Cannot overwrite '${i}' with '${o}'.`)):function(e,t,n){tt.unlink(t,(r=>r?n(r):tt.symlink(e,t,n)))}(o,n,u)))):tt.symlink(o,n,u))))}(e,t,n,r,u):i.isSocket()?u(new Error(`Cannot copy a socket file: ${t}`)):i.isFIFO()?u(new Error(`Cannot copy a FIFO pipe: ${t}`)):u(new Error(`Unknown file: ${t}`))))}function lt(e,t,n,r,u){tt.copyFile(t,n,(o=>o?u(o):r.preserveTimestamps?function(e,t,n,r){if(function(e){return 0==(128&e)}(e))return function(e,t,n){return dt(e,128|t,n)}(n,e,(u=>u?r(u):ft(e,t,n,r)));return ft(e,t,n,r)}(e.mode,t,n,u):dt(n,e.mode,u)))}function ft(e,t,n,r){!function(e,t,n){tt.stat(e,((e,r)=>e?n(e):ot(t,r.atime,r.mtime,n)))}(t,n,(t=>t?r(t):dt(n,e,r)))}function dt(e,t,n){return tt.chmod(e,t,n)}function Dt(e,t,n,r){tt.readdir(e,((u,o)=>u?r(u):pt(o,e,t,n,r)))}function pt(e,t,n,r,u){const o=e.pop();return o?function(e,t,n,r,u,o){const i=nt.join(n,t),s=nt.join(r,t);it.checkPaths(i,s,"copy",u,((t,c)=>{if(t)return o(t);const{destStat:a}=c;!function(e,t,n,r,u){r.filter?ct(at,e,t,n,r,u):at(e,t,n,r,u)}(a,i,s,u,(t=>t?o(t):pt(e,n,r,u,o)))}))}(e,o,t,n,r,u):u()}var Et=function(e,t,n,r){"function"!=typeof n||r?"function"==typeof n&&(n={filter:n}):(r=n,n={}),r=r||function(){},(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269"),it.checkPaths(e,t,"copy",n,((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;it.checkParentPaths(e,i,t,"copy",(u=>u?r(u):n.filter?ct(st,s,e,t,n,r):st(s,e,t,n,r)))}))};const mt=we,ht=p.default,yt=$e.mkdirsSync,Ct=We,Ft=et;function gt(e,t,n,r){const u=(r.dereference?mt.statSync:mt.lstatSync)(t);if(u.isDirectory())return function(e,t,n,r,u){return t?St(n,r,u):function(e,t,n,r){return mt.mkdirSync(n),St(t,n,r),vt(n,e)}(e.mode,n,r,u)}(u,e,t,n,r);if(u.isFile()||u.isCharacterDevice()||u.isBlockDevice())return function(e,t,n,r,u){return t?function(e,t,n,r){if(r.overwrite)return mt.unlinkSync(n),At(e,t,n,r);if(r.errorOnExist)throw new Error(`'${n}' already exists`)}(e,n,r,u):At(e,n,r,u)}(u,e,t,n,r);if(u.isSymbolicLink())return function(e,t,n,r){let u=mt.readlinkSync(t);r.dereference&&(u=ht.resolve(process.cwd(),u));if(e){let e;try{e=mt.readlinkSync(n)}catch(e){if("EINVAL"===e.code||"UNKNOWN"===e.code)return mt.symlinkSync(u,n);throw e}if(r.dereference&&(e=ht.resolve(process.cwd(),e)),Ft.isSrcSubdir(u,e))throw new Error(`Cannot copy '${u}' to a subdirectory of itself, '${e}'.`);if(mt.statSync(n).isDirectory()&&Ft.isSrcSubdir(e,u))throw new Error(`Cannot overwrite '${e}' with '${u}'.`);return function(e,t){return mt.unlinkSync(t),mt.symlinkSync(e,t)}(u,n)}return mt.symlinkSync(u,n)}(e,t,n,r);if(u.isSocket())throw new Error(`Cannot copy a socket file: ${t}`);if(u.isFIFO())throw new Error(`Cannot copy a FIFO pipe: ${t}`);throw new Error(`Unknown file: ${t}`)}function At(e,t,n,r){return mt.copyFileSync(t,n),r.preserveTimestamps&&function(e,t,n){(function(e){return 0==(128&e)})(e)&&function(e,t){vt(e,128|t)}(n,e);(function(e,t){const n=mt.statSync(e);Ct(t,n.atime,n.mtime)})(t,n)}(e.mode,t,n),vt(n,e.mode)}function vt(e,t){return mt.chmodSync(e,t)}function St(e,t,n){mt.readdirSync(e).forEach((r=>function(e,t,n,r){const u=ht.join(t,e),o=ht.join(n,e),{destStat:i}=Ft.checkPathsSync(u,o,"copy",r);return function(e,t,n,r){if(!r.filter||r.filter(t,n))return gt(e,t,n,r)}(i,u,o,r)}(r,e,t,n)))}var wt=function(e,t,n){"function"==typeof n&&(n={filter:n}),(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269");const{srcStat:r,destStat:u}=Ft.checkPathsSync(e,t,"copy",n);return Ft.checkParentPathsSync(e,r,t,"copy"),function(e,t,n,r){if(r.filter&&!r.filter(t,n))return;const u=ht.dirname(n);mt.existsSync(u)||yt(u);return gt(e,t,n,r)}(u,e,t,n)};var Ot={copy:(0,re.fromCallback)(Et),copySync:wt};const bt=we,_t=p.default,Bt=g.default,Pt="win32"===process.platform;function kt(e){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((t=>{e[t]=e[t]||bt[t],e[t+="Sync"]=e[t]||bt[t]})),e.maxBusyTries=e.maxBusyTries||3}function xt(e,t,n){let r=0;"function"==typeof t&&(n=t,t={}),Bt(e,"rimraf: missing path"),Bt.strictEqual(typeof e,"string","rimraf: path should be a string"),Bt.strictEqual(typeof n,"function","rimraf: callback function required"),Bt(t,"rimraf: invalid options argument provided"),Bt.strictEqual(typeof t,"object","rimraf: options should be object"),kt(t),Nt(e,t,(function u(o){if(o){if(("EBUSY"===o.code||"ENOTEMPTY"===o.code||"EPERM"===o.code)&&rNt(e,t,u)),100*r)}"ENOENT"===o.code&&(o=null)}n(o)}))}function Nt(e,t,n){Bt(e),Bt(t),Bt("function"==typeof n),t.lstat(e,((r,u)=>r&&"ENOENT"===r.code?n(null):r&&"EPERM"===r.code&&Pt?It(e,t,r,n):u&&u.isDirectory()?Rt(e,t,r,n):void t.unlink(e,(r=>{if(r){if("ENOENT"===r.code)return n(null);if("EPERM"===r.code)return Pt?It(e,t,r,n):Rt(e,t,r,n);if("EISDIR"===r.code)return Rt(e,t,r,n)}return n(r)}))))}function It(e,t,n,r){Bt(e),Bt(t),Bt("function"==typeof r),t.chmod(e,438,(u=>{u?r("ENOENT"===u.code?null:n):t.stat(e,((u,o)=>{u?r("ENOENT"===u.code?null:n):o.isDirectory()?Rt(e,t,n,r):t.unlink(e,r)}))}))}function Tt(e,t,n){let r;Bt(e),Bt(t);try{t.chmodSync(e,438)}catch(e){if("ENOENT"===e.code)return;throw n}try{r=t.statSync(e)}catch(e){if("ENOENT"===e.code)return;throw n}r.isDirectory()?Lt(e,t,n):t.unlinkSync(e)}function Rt(e,t,n,r){Bt(e),Bt(t),Bt("function"==typeof r),t.rmdir(e,(u=>{!u||"ENOTEMPTY"!==u.code&&"EEXIST"!==u.code&&"EPERM"!==u.code?u&&"ENOTDIR"===u.code?r(n):r(u):function(e,t,n){Bt(e),Bt(t),Bt("function"==typeof n),t.readdir(e,((r,u)=>{if(r)return n(r);let o,i=u.length;if(0===i)return t.rmdir(e,n);u.forEach((r=>{xt(_t.join(e,r),t,(r=>{if(!o)return r?n(o=r):void(0==--i&&t.rmdir(e,n))}))}))}))}(e,t,r)}))}function Mt(e,t){let n;kt(t=t||{}),Bt(e,"rimraf: missing path"),Bt.strictEqual(typeof e,"string","rimraf: path should be a string"),Bt(t,"rimraf: missing options"),Bt.strictEqual(typeof t,"object","rimraf: options should be object");try{n=t.lstatSync(e)}catch(n){if("ENOENT"===n.code)return;"EPERM"===n.code&&Pt&&Tt(e,t,n)}try{n&&n.isDirectory()?Lt(e,t,null):t.unlinkSync(e)}catch(n){if("ENOENT"===n.code)return;if("EPERM"===n.code)return Pt?Tt(e,t,n):Lt(e,t,n);if("EISDIR"!==n.code)throw n;Lt(e,t,n)}}function Lt(e,t,n){Bt(e),Bt(t);try{t.rmdirSync(e)}catch(r){if("ENOTDIR"===r.code)throw n;if("ENOTEMPTY"===r.code||"EEXIST"===r.code||"EPERM"===r.code)!function(e,t){if(Bt(e),Bt(t),t.readdirSync(e).forEach((n=>Mt(_t.join(e,n),t))),!Pt){return t.rmdirSync(e,t)}{const n=Date.now();do{try{return t.rmdirSync(e,t)}catch{}}while(Date.now()-n<500)}}(e,t);else if("ENOENT"!==r.code)throw r}}var jt=xt;xt.sync=Mt;const $t=we,Ht=re.fromCallback,Jt=jt;var Gt={remove:Ht((function(e,t){if($t.rm)return $t.rm(e,{recursive:!0,force:!0},t);Jt(e,t)})),removeSync:function(e){if($t.rmSync)return $t.rmSync(e,{recursive:!0,force:!0});Jt.sync(e)}};const Vt=re.fromPromise,Ut=ne,Wt=p.default,zt=$e,Kt=Gt,qt=Vt((async function(e){let t;try{t=await Ut.readdir(e)}catch{return zt.mkdirs(e)}return Promise.all(t.map((t=>Kt.remove(Wt.join(e,t)))))}));function Yt(e){let t;try{t=Ut.readdirSync(e)}catch{return zt.mkdirsSync(e)}t.forEach((t=>{t=Wt.join(e,t),Kt.removeSync(t)}))}var Xt={emptyDirSync:Yt,emptydirSync:Yt,emptyDir:qt,emptydir:qt};const Zt=re.fromCallback,Qt=p.default,en=we,tn=$e;var nn={createFile:Zt((function(e,t){function n(){en.writeFile(e,"",(e=>{if(e)return t(e);t()}))}en.stat(e,((r,u)=>{if(!r&&u.isFile())return t();const o=Qt.dirname(e);en.stat(o,((e,r)=>{if(e)return"ENOENT"===e.code?tn.mkdirs(o,(e=>{if(e)return t(e);n()})):t(e);r.isDirectory()?n():en.readdir(o,(e=>{if(e)return t(e)}))}))}))})),createFileSync:function(e){let t;try{t=en.statSync(e)}catch{}if(t&&t.isFile())return;const n=Qt.dirname(e);try{en.statSync(n).isDirectory()||en.readdirSync(n)}catch(e){if(!e||"ENOENT"!==e.code)throw e;tn.mkdirsSync(n)}en.writeFileSync(e,"")}};const rn=re.fromCallback,un=p.default,on=we,sn=$e,cn=Ge.pathExists,{areIdentical:an}=et;var ln={createLink:rn((function(e,t,n){function r(e,t){on.link(e,t,(e=>{if(e)return n(e);n(null)}))}on.lstat(t,((u,o)=>{on.lstat(e,((u,i)=>{if(u)return u.message=u.message.replace("lstat","ensureLink"),n(u);if(o&&an(i,o))return n(null);const s=un.dirname(t);cn(s,((u,o)=>u?n(u):o?r(e,t):void sn.mkdirs(s,(u=>{if(u)return n(u);r(e,t)}))))}))}))})),createLinkSync:function(e,t){let n;try{n=on.lstatSync(t)}catch{}try{const t=on.lstatSync(e);if(n&&an(t,n))return}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}const r=un.dirname(t);return on.existsSync(r)||sn.mkdirsSync(r),on.linkSync(e,t)}};const fn=p.default,dn=we,Dn=Ge.pathExists;var pn={symlinkPaths:function(e,t,n){if(fn.isAbsolute(e))return dn.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:e})));{const r=fn.dirname(t),u=fn.join(r,e);return Dn(u,((t,o)=>t?n(t):o?n(null,{toCwd:u,toDst:e}):dn.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:fn.relative(r,e)})))))}},symlinkPathsSync:function(e,t){let n;if(fn.isAbsolute(e)){if(n=dn.existsSync(e),!n)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}{const r=fn.dirname(t),u=fn.join(r,e);if(n=dn.existsSync(u),n)return{toCwd:u,toDst:e};if(n=dn.existsSync(e),!n)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:fn.relative(r,e)}}}};const En=we;var mn={symlinkType:function(e,t,n){if(n="function"==typeof t?t:n,t="function"!=typeof t&&t)return n(null,t);En.lstat(e,((e,r)=>{if(e)return n(null,"file");t=r&&r.isDirectory()?"dir":"file",n(null,t)}))},symlinkTypeSync:function(e,t){let n;if(t)return t;try{n=En.lstatSync(e)}catch{return"file"}return n&&n.isDirectory()?"dir":"file"}};const hn=re.fromCallback,yn=p.default,Cn=ne,Fn=$e.mkdirs,gn=$e.mkdirsSync,An=pn.symlinkPaths,vn=pn.symlinkPathsSync,Sn=mn.symlinkType,wn=mn.symlinkTypeSync,On=Ge.pathExists,{areIdentical:bn}=et;function _n(e,t,n,r){An(e,t,((u,o)=>{if(u)return r(u);e=o.toDst,Sn(o.toCwd,n,((n,u)=>{if(n)return r(n);const o=yn.dirname(t);On(o,((n,i)=>n?r(n):i?Cn.symlink(e,t,u,r):void Fn(o,(n=>{if(n)return r(n);Cn.symlink(e,t,u,r)}))))}))}))}var Bn={createSymlink:hn((function(e,t,n,r){r="function"==typeof n?n:r,n="function"!=typeof n&&n,Cn.lstat(t,((u,o)=>{!u&&o.isSymbolicLink()?Promise.all([Cn.stat(e),Cn.stat(t)]).then((([u,o])=>{if(bn(u,o))return r(null);_n(e,t,n,r)})):_n(e,t,n,r)}))})),createSymlinkSync:function(e,t,n){let r;try{r=Cn.lstatSync(t)}catch{}if(r&&r.isSymbolicLink()){const n=Cn.statSync(e),r=Cn.statSync(t);if(bn(n,r))return}const u=vn(e,t);e=u.toDst,n=wn(u.toCwd,n);const o=yn.dirname(t);return Cn.existsSync(o)||gn(o),Cn.symlinkSync(e,t,n)}};const{createFile:Pn,createFileSync:kn}=nn,{createLink:xn,createLinkSync:Nn}=ln,{createSymlink:In,createSymlinkSync:Tn}=Bn;var Rn={createFile:Pn,createFileSync:kn,ensureFile:Pn,ensureFileSync:kn,createLink:xn,createLinkSync:Nn,ensureLink:xn,ensureLinkSync:Nn,createSymlink:In,createSymlinkSync:Tn,ensureSymlink:In,ensureSymlinkSync:Tn};var Mn={stringify:function(e,{EOL:t="\n",finalEOL:n=!0,replacer:r=null,spaces:u}={}){const o=n?t:"";return JSON.stringify(e,r,u).replace(/\n/g,t)+o},stripBom:function(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e.replace(/^\uFEFF/,"")}};let Ln;try{Ln=we}catch(e){Ln=D.default}const jn=re,{stringify:$n,stripBom:Hn}=Mn;const Jn=jn.fromPromise((async function(e,t={}){"string"==typeof t&&(t={encoding:t});const n=t.fs||Ln,r=!("throws"in t)||t.throws;let u,o=await jn.fromCallback(n.readFile)(e,t);o=Hn(o);try{u=JSON.parse(o,t?t.reviver:null)}catch(t){if(r)throw t.message=`${e}: ${t.message}`,t;return null}return u}));const Gn=jn.fromPromise((async function(e,t,n={}){const r=n.fs||Ln,u=$n(t,n);await jn.fromCallback(r.writeFile)(e,u,n)}));const Vn={readFile:Jn,readFileSync:function(e,t={}){"string"==typeof t&&(t={encoding:t});const n=t.fs||Ln,r=!("throws"in t)||t.throws;try{let r=n.readFileSync(e,t);return r=Hn(r),JSON.parse(r,t.reviver)}catch(t){if(r)throw t.message=`${e}: ${t.message}`,t;return null}},writeFile:Gn,writeFileSync:function(e,t,n={}){const r=n.fs||Ln,u=$n(t,n);return r.writeFileSync(e,u,n)}};var Un={readJson:Vn.readFile,readJsonSync:Vn.readFileSync,writeJson:Vn.writeFile,writeJsonSync:Vn.writeFileSync};const Wn=re.fromCallback,zn=we,Kn=p.default,qn=$e,Yn=Ge.pathExists;var Xn={outputFile:Wn((function(e,t,n,r){"function"==typeof n&&(r=n,n="utf8");const u=Kn.dirname(e);Yn(u,((o,i)=>o?r(o):i?zn.writeFile(e,t,n,r):void qn.mkdirs(u,(u=>{if(u)return r(u);zn.writeFile(e,t,n,r)}))))})),outputFileSync:function(e,...t){const n=Kn.dirname(e);if(zn.existsSync(n))return zn.writeFileSync(e,...t);qn.mkdirsSync(n),zn.writeFileSync(e,...t)}};const{stringify:Zn}=Mn,{outputFile:Qn}=Xn;var er=async function(e,t,n={}){const r=Zn(t,n);await Qn(e,r,n)};const{stringify:tr}=Mn,{outputFileSync:nr}=Xn;var rr=function(e,t,n){const r=tr(t,n);nr(e,r,n)};const ur=re.fromPromise,or=Un;or.outputJson=ur(er),or.outputJsonSync=rr,or.outputJSON=or.outputJson,or.outputJSONSync=or.outputJsonSync,or.writeJSON=or.writeJson,or.writeJSONSync=or.writeJsonSync,or.readJSON=or.readJson,or.readJSONSync=or.readJsonSync;var ir=or;const sr=we,cr=p.default,ar=Ot.copy,lr=Gt.remove,fr=$e.mkdirp,dr=Ge.pathExists,Dr=et;function pr(e,t,n,r,u){return r?Er(e,t,n,u):n?lr(t,(r=>r?u(r):Er(e,t,n,u))):void dr(t,((r,o)=>r?u(r):o?u(new Error("dest already exists.")):Er(e,t,n,u)))}function Er(e,t,n,r){sr.rename(e,t,(u=>u?"EXDEV"!==u.code?r(u):function(e,t,n,r){const u={overwrite:n,errorOnExist:!0};ar(e,t,u,(t=>t?r(t):lr(e,r)))}(e,t,n,r):r()))}var mr=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=n.overwrite||n.clobber||!1;Dr.checkPaths(e,t,"move",n,((n,o)=>{if(n)return r(n);const{srcStat:i,isChangingCase:s=!1}=o;Dr.checkParentPaths(e,i,t,"move",(n=>n?r(n):function(e){const t=cr.dirname(e);return cr.parse(t).root===t}(t)?pr(e,t,u,s,r):void fr(cr.dirname(t),(n=>n?r(n):pr(e,t,u,s,r)))))}))};const hr=we,yr=p.default,Cr=Ot.copySync,Fr=Gt.removeSync,gr=$e.mkdirpSync,Ar=et;function vr(e,t,n){try{hr.renameSync(e,t)}catch(r){if("EXDEV"!==r.code)throw r;return function(e,t,n){const r={overwrite:n,errorOnExist:!0};return Cr(e,t,r),Fr(e)}(e,t,n)}}var Sr=function(e,t,n){const r=(n=n||{}).overwrite||n.clobber||!1,{srcStat:u,isChangingCase:o=!1}=Ar.checkPathsSync(e,t,"move",n);return Ar.checkParentPathsSync(e,u,t,"move"),function(e){const t=yr.dirname(e);return yr.parse(t).root===t}(t)||gr(yr.dirname(t)),function(e,t,n,r){if(r)return vr(e,t,n);if(n)return Fr(t),vr(e,t,n);if(hr.existsSync(t))throw new Error("dest already exists.");return vr(e,t,n)}(e,t,r,o)};var wr,Or,br,_r,Br,Pr={move:(0,re.fromCallback)(mr),moveSync:Sr},kr={...ne,...Ot,...Xt,...Rn,...ir,...$e,...Pr,...Xn,...Ge,...Gt},xr={},Nr={exports:{}},Ir={exports:{}};function Tr(){if(Or)return wr;Or=1;var e=1e3,t=60*e,n=60*t,r=24*n,u=7*r,o=365.25*r;function i(e,t,n,r){var u=t>=1.5*n;return Math.round(e/n)+" "+r+(u?"s":"")}return wr=function(s,c){c=c||{};var a=typeof s;if("string"===a&&s.length>0)return function(i){if((i=String(i)).length>100)return;var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(!s)return;var c=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*u;case"days":case"day":case"d":return c*r;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*t;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(s);if("number"===a&&isFinite(s))return c.long?function(u){var o=Math.abs(u);if(o>=r)return i(u,o,r,"day");if(o>=n)return i(u,o,n,"hour");if(o>=t)return i(u,o,t,"minute");if(o>=e)return i(u,o,e,"second");return u+" ms"}(s):function(u){var o=Math.abs(u);if(o>=r)return Math.round(u/r)+"d";if(o>=n)return Math.round(u/n)+"h";if(o>=t)return Math.round(u/t)+"m";if(o>=e)return Math.round(u/e)+"s";return u+"ms"}(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))}}function Rr(){if(_r)return br;return _r=1,br=function(e){function t(e){let r,u,o,i=null;function s(...e){if(!s.enabled)return;const n=s,u=Number(new Date),o=u-(r||u);n.diff=o,n.prev=r,n.curr=u,r=u,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,u)=>{if("%%"===r)return"%";i++;const o=t.formatters[u];if("function"==typeof o){const t=e[i];r=o.call(n,t),e.splice(i,1),i--}return r})),t.formatArgs.call(n,e);(n.log||t.log).apply(n,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=n,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==i?i:(u!==t.namespaces&&(u=t.namespaces,o=t.enabled(e)),o),set:e=>{i=e}}),"function"==typeof t.init&&t.init(s),s}function n(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function r(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(r),...t.skips.map(r).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),u=r.length;for(n=0;n{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t{const n=e.startsWith("-")?"":1===e.length?"-":"--",r=t.indexOf(n+e),u=t.indexOf("--");return-1!==r&&(-1===u||r{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=function(){if($r)return jr;$r=1;const e=E.default,t=A.default,n=Vr(),{env:r}=process;let u;function o(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function i(t,o){if(0===u)return 0;if(n("color=16m")||n("color=full")||n("color=truecolor"))return 3;if(n("color=256"))return 2;if(t&&!o&&void 0===u)return 0;const i=u||0;if("dumb"===r.TERM)return i;if("win32"===process.platform){const t=e.release().split(".");return Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in r)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((e=>e in r))||"codeship"===r.CI_NAME?1:i;if("TEAMCITY_VERSION"in r)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(r.TEAMCITY_VERSION)?1:0;if("truecolor"===r.COLORTERM)return 3;if("TERM_PROGRAM"in r){const e=parseInt((r.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(r.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(r.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(r.TERM)||"COLORTERM"in r?1:i}return n("no-color")||n("no-colors")||n("color=false")||n("color=never")?u=0:(n("color")||n("colors")||n("color=true")||n("color=always"))&&(u=1),"FORCE_COLOR"in r&&(u="true"===r.FORCE_COLOR?1:"false"===r.FORCE_COLOR?0:0===r.FORCE_COLOR.length?1:Math.min(parseInt(r.FORCE_COLOR,10),3)),jr={supportsColor:function(e){return o(i(e,e&&e.isTTY))},stdout:o(i(!0,t.isatty(1))),stderr:o(i(!0,t.isatty(2)))}}();e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,t)=>{const n=t.substring(6).toLowerCase().replace(/_([a-z])/g,((e,t)=>t.toUpperCase()));let r=process.env[t];return r=!!/^(yes|on|true|enabled)$/i.test(r)||!/^(no|off|false|disabled)$/i.test(r)&&("null"===r?null:Number(r)),e[n]=r,e}),{}),e.exports=Rr()(t);const{formatters:u}=e.exports;u.o=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")},u.O=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts)}}(Gr,Gr.exports)),Gr.exports}Jr=Nr,"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?Jr.exports=(Br||(Br=1,function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,u=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(u=r))})),t.splice(u,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=Rr()(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(Ir,Ir.exports)),Ir.exports):Jr.exports=Ur();var Wr=function(e){return(e=e||{}).circles?function(e){var t=[],n=[];return e.proto?function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=zr(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o}:function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u)if(!1!==Object.hasOwnProperty.call(u,i)){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=zr(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o};function r(e,r){for(var u=Object.keys(e),o=new Array(u.length),i=0;i!e,Qr=e=>e&&"object"==typeof e&&!Array.isArray(e),eu=(e,t,n)=>{(Array.isArray(t)?t:[t]).forEach((t=>{if(t)throw new Error(`Problem with log4js configuration: (${Kr.inspect(e,{depth:5})}) - ${n}`)}))};var tu={configure:e=>{qr("New configuration to be validated: ",e),eu(e,Zr(Qr(e)),"must be an object."),qr(`Calling pre-processing listeners (${Yr.length})`),Yr.forEach((t=>t(e))),qr("Configuration pre-processing finished."),qr(`Calling configuration listeners (${Xr.length})`),Xr.forEach((t=>t(e))),qr("Configuration finished.")},addListener:e=>{Xr.push(e),qr(`Added listener, now ${Xr.length} listeners`)},addPreProcessingListener:e=>{Yr.push(e),qr(`Added pre-processing listener, now ${Yr.length} listeners`)},throwExceptionIf:eu,anObject:Qr,anInteger:e=>e&&"number"==typeof e&&Number.isInteger(e),validIdentifier:e=>/^[A-Za-z][A-Za-z0-9_]*$/g.test(e),not:Zr},nu={exports:{}};!function(e){function t(e,t){for(var n=e.toString();n.length-1?s:c,l=n(u.getHours()),f=n(u.getMinutes()),d=n(u.getSeconds()),D=t(u.getMilliseconds(),3),p=function(e){var t=Math.abs(e),n=String(Math.floor(t/60)),r=String(t%60);return n=("0"+n).slice(-2),r=("0"+r).slice(-2),0===e?"Z":(e<0?"+":"-")+n+":"+r}(u.getTimezoneOffset());return r.replace(/dd/g,o).replace(/MM/g,i).replace(/y{1,4}/g,a).replace(/hh/g,l).replace(/mm/g,f).replace(/ss/g,d).replace(/SSS/g,D).replace(/O/g,p)}function u(e,t,n,r){e["set"+(r?"":"UTC")+t](n)}e.exports=r,e.exports.asString=r,e.exports.parse=function(t,n,r){if(!t)throw new Error("pattern must be supplied");return function(t,n,r){var o=t.indexOf("O")<0,i=!1,s=[{pattern:/y{1,4}/,regexp:"\\d{1,4}",fn:function(e,t){u(e,"FullYear",t,o)}},{pattern:/MM/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Month",t-1,o),e.getMonth()!==t-1&&(i=!0)}},{pattern:/dd/,regexp:"\\d{1,2}",fn:function(e,t){i&&u(e,"Month",e.getMonth()-1,o),u(e,"Date",t,o)}},{pattern:/hh/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Hours",t,o)}},{pattern:/mm/,regexp:"\\d\\d",fn:function(e,t){u(e,"Minutes",t,o)}},{pattern:/ss/,regexp:"\\d\\d",fn:function(e,t){u(e,"Seconds",t,o)}},{pattern:/SSS/,regexp:"\\d\\d\\d",fn:function(e,t){u(e,"Milliseconds",t,o)}},{pattern:/O/,regexp:"[+-]\\d{1,2}:?\\d{2}?|Z",fn:function(e,t){t="Z"===t?0:t.replace(":","");var n=Math.abs(t),r=(t>0?-1:1)*(n%100+60*Math.floor(n/100));e.setUTCMinutes(e.getUTCMinutes()+r)}}],c=s.reduce((function(e,t){return t.pattern.test(e.regexp)?(t.index=e.regexp.match(t.pattern).index,e.regexp=e.regexp.replace(t.pattern,"("+t.regexp+")")):t.index=-1,e}),{regexp:t,index:[]}),a=s.filter((function(e){return e.index>-1}));a.sort((function(e,t){return e.index-t.index}));var l=new RegExp(c.regexp).exec(n);if(l){var f=r||e.exports.now();return a.forEach((function(e,t){e.fn(f,l[t+1])})),f}throw new Error("String '"+n+"' could not be parsed as '"+t+"'")}(t,n,r)},e.exports.now=function(){return new Date},e.exports.ISO8601_FORMAT="yyyy-MM-ddThh:mm:ss.SSS",e.exports.ISO8601_WITH_TZ_OFFSET_FORMAT="yyyy-MM-ddThh:mm:ss.SSSO",e.exports.DATETIME_FORMAT="dd MM yyyy hh:mm:ss.SSS",e.exports.ABSOLUTETIME_FORMAT="hh:mm:ss.SSS"}(nu);const ru=nu.exports,uu=E.default,ou=F.default,iu=p.default,su={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[90,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[91,39],yellow:[33,39]};function cu(e){return e?`[${su[e][0]}m`:""}function au(e){return e?`[${su[e][1]}m`:""}function lu(e,t){return n=ou.format("[%s] [%s] %s - ",ru.asString(e.startTime),e.level.toString(),e.categoryName),cu(r=t)+n+au(r);var n,r}function fu(e){return lu(e)+ou.format(...e.data)}function du(e){return lu(e,e.level.colour)+ou.format(...e.data)}function Du(e){return ou.format(...e.data)}function pu(e){return e.data[0]}function Eu(e,t){const n=/%(-?[0-9]+)?(\.?-?[0-9]+)?([[\]cdhmnprzxXyflos%])(\{([^}]+)\})?|([^%]+)/;function r(e){return e&&e.pid?e.pid.toString():process.pid.toString()}e=e||"%r %p %c - %m%n";const u={c:function(e,t){let n=e.categoryName;if(t){const e=parseInt(t,10),r=n.split(".");ee&&(n=r.slice(-e).join(iu.sep))}return n},l:function(e){return e.lineNumber?`${e.lineNumber}`:""},o:function(e){return e.columnNumber?`${e.columnNumber}`:""},s:function(e){return e.callStack||""}};function o(e,t,n){return u[e](t,n)}function i(e,t,n){let r=e;return r=function(e,t){let n;return e?(n=parseInt(e.substr(1),10),n>0?t.slice(0,n):t.slice(n)):t}(t,r),r=function(e,t){let n;if(e)if("-"===e.charAt(0))for(n=parseInt(e.substr(1),10);t.lengthDu,basic:()=>fu,colored:()=>du,coloured:()=>du,pattern:e=>Eu(e&&e.pattern,e&&e.tokens),dummy:()=>pu};var hu={basicLayout:fu,messagePassThroughLayout:Du,patternLayout:Eu,colouredLayout:du,coloredLayout:du,dummyLayout:pu,addLayout(e,t){mu[e]=t},layout:(e,t)=>mu[e]&&mu[e](t)};const yu=tu,Cu=["white","grey","black","blue","cyan","green","magenta","red","yellow"];class Fu{constructor(e,t,n){this.level=e,this.levelStr=t,this.colour=n}toString(){return this.levelStr}static getLevel(e,t){return e?e instanceof Fu?e:(e instanceof Object&&e.levelStr&&(e=e.levelStr),Fu[e.toString().toUpperCase()]||t):t}static addLevels(e){if(e){Object.keys(e).forEach((t=>{const n=t.toUpperCase();Fu[n]=new Fu(e[t].value,n,e[t].colour);const r=Fu.levels.findIndex((e=>e.levelStr===n));r>-1?Fu.levels[r]=Fu[n]:Fu.levels.push(Fu[n])})),Fu.levels.sort(((e,t)=>e.level-t.level))}}isLessThanOrEqualTo(e){return"string"==typeof e&&(e=Fu.getLevel(e)),this.level<=e.level}isGreaterThanOrEqualTo(e){return"string"==typeof e&&(e=Fu.getLevel(e)),this.level>=e.level}isEqualTo(e){return"string"==typeof e&&(e=Fu.getLevel(e)),this.level===e.level}}Fu.levels=[],Fu.addLevels({ALL:{value:Number.MIN_VALUE,colour:"grey"},TRACE:{value:5e3,colour:"blue"},DEBUG:{value:1e4,colour:"cyan"},INFO:{value:2e4,colour:"green"},WARN:{value:3e4,colour:"yellow"},ERROR:{value:4e4,colour:"red"},FATAL:{value:5e4,colour:"magenta"},MARK:{value:9007199254740992,colour:"grey"},OFF:{value:Number.MAX_VALUE,colour:"grey"}}),yu.addListener((e=>{const t=e.levels;if(t){yu.throwExceptionIf(e,yu.not(yu.anObject(t)),"levels must be an object");Object.keys(t).forEach((n=>{yu.throwExceptionIf(e,yu.not(yu.validIdentifier(n)),`level name "${n}" is not a valid identifier (must start with a letter, only contain A-Z,a-z,0-9,_)`),yu.throwExceptionIf(e,yu.not(yu.anObject(t[n])),`level "${n}" must be an object`),yu.throwExceptionIf(e,yu.not(t[n].value),`level "${n}" must have a 'value' property`),yu.throwExceptionIf(e,yu.not(yu.anInteger(t[n].value)),`level "${n}".value must have an integer value`),yu.throwExceptionIf(e,yu.not(t[n].colour),`level "${n}" must have a 'colour' property`),yu.throwExceptionIf(e,yu.not(Cu.indexOf(t[n].colour)>-1),`level "${n}".colour must be one of ${Cu.join(", ")}`)}))}})),yu.addListener((e=>{Fu.addLevels(e.levels)}));var gu=Fu,Au={exports:{}},vu={};/*! (c) 2020 Andrea Giammarchi */ -const{parse:Su,stringify:wu}=JSON,{keys:Ou}=Object,bu=String,_u="string",Bu={},Pu="object",ku=(e,t)=>t,xu=e=>e instanceof bu?bu(e):e,Nu=(e,t)=>typeof t===_u?new bu(t):t,Iu=(e,t,n,r)=>{const u=[];for(let o=Ou(n),{length:i}=o,s=0;s{const r=bu(t.push(n)-1);return e.set(n,r),r},Ru=(e,t)=>{const n=Su(e,Nu).map(xu),r=n[0],u=t||ku,o=typeof r===Pu&&r?Iu(n,new Set,r,u):r;return u.call({"":o},"",o)};vu.parse=Ru;const Mu=(e,t,n)=>{const r=t&&typeof t===Pu?(e,n)=>""===e||-1Su(Mu(e));vu.fromJSON=e=>Ru(wu(e));const Lu=vu,ju=gu;class $u{constructor(e,t,n,r,u){this.startTime=new Date,this.categoryName=e,this.data=n,this.level=t,this.context=Object.assign({},r),this.pid=process.pid,u&&(this.functionName=u.functionName,this.fileName=u.fileName,this.lineNumber=u.lineNumber,this.columnNumber=u.columnNumber,this.callStack=u.callStack)}serialise(){const e=this.data.map((e=>(e&&e.message&&e.stack&&(e=Object.assign({message:e.message,stack:e.stack},e)),e)));return this.data=e,Lu.stringify(this)}static deserialise(e){let t;try{const n=Lu.parse(e);n.data=n.data.map((e=>{if(e&&e.message&&e.stack){const t=new Error(e);Object.keys(e).forEach((n=>{t[n]=e[n]})),e=t}return e})),t=new $u(n.categoryName,ju.getLevel(n.level.levelStr),n.data,n.context),t.startTime=new Date(n.startTime),t.pid=n.pid,t.cluster=n.cluster}catch(n){t=new $u("log4js",ju.ERROR,["Unable to parse log:",e,"because: ",n])}return t}}var Hu=$u;const Ju=Nr.exports("log4js:clustering"),Gu=Hu,Vu=tu;let Uu=!1,Wu=null;try{Wu=require("cluster")}catch(e){Ju("cluster module not present"),Uu=!0}const zu=[];let Ku=!1,qu="NODE_APP_INSTANCE";const Yu=()=>Ku&&"0"===process.env[qu],Xu=()=>Uu||Wu.isMaster||Yu(),Zu=e=>{zu.forEach((t=>t(e)))},Qu=(e,t)=>{if(Ju("cluster message received from worker ",e,": ",t),e.topic&&e.data&&(t=e,e=void 0),t&&t.topic&&"log4js:message"===t.topic){Ju("received message: ",t.data);const e=Gu.deserialise(t.data);Zu(e)}};Uu||Vu.addListener((e=>{zu.length=0,({pm2:Ku,disableClustering:Uu,pm2InstanceVar:qu="NODE_APP_INSTANCE"}=e),Ju(`clustering disabled ? ${Uu}`),Ju(`cluster.isMaster ? ${Wu&&Wu.isMaster}`),Ju(`pm2 enabled ? ${Ku}`),Ju(`pm2InstanceVar = ${qu}`),Ju(`process.env[${qu}] = ${process.env[qu]}`),Ku&&process.removeListener("message",Qu),Wu&&Wu.removeListener&&Wu.removeListener("message",Qu),Uu||e.disableClustering?Ju("Not listening for cluster messages, because clustering disabled."):Yu()?(Ju("listening for PM2 broadcast messages"),process.on("message",Qu)):Wu.isMaster?(Ju("listening for cluster messages"),Wu.on("message",Qu)):Ju("not listening for messages, because we are not a master process")}));var eo={onlyOnMaster:(e,t)=>Xu()?e():t,isMaster:Xu,send:e=>{Xu()?Zu(e):(Ku||(e.cluster={workerId:Wu.worker.id,worker:process.pid}),process.send({topic:"log4js:message",data:e.serialise()}))},onMessage:e=>{zu.push(e)}},to={};function no(e){if("number"==typeof e&&Number.isInteger(e))return e;const t={K:1024,M:1048576,G:1073741824},n=Object.keys(t),r=e.substr(e.length-1).toLocaleUpperCase(),u=e.substring(0,e.length-1).trim();if(n.indexOf(r)<0||!Number.isInteger(Number(u)))throw Error(`maxLogSize: "${e}" is invalid`);return u*t[r]}function ro(e){return function(e,t){const n=Object.assign({},t);return Object.keys(e).forEach((r=>{n[r]&&(n[r]=e[r](t[r]))})),n}({maxLogSize:no},e)}const uo={file:ro,fileSync:ro};to.modifyConfig=e=>uo[e.type]?uo[e.type](e):e;var oo={};const io=console.log.bind(console);oo.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{io(e(n,t))}}(n,e.timezoneOffset)};var so={};so.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stdout.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var co={};co.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stderr.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var ao={};ao.configure=function(e,t,n,r){const u=n(e.appender);return function(e,t,n,r){const u=r.getLevel(e),o=r.getLevel(t,r.FATAL);return e=>{const t=e.level;t.isGreaterThanOrEqualTo(u)&&t.isLessThanOrEqualTo(o)&&n(e)}}(e.level,e.maxLevel,u,r)};var lo={};const fo=Nr.exports("log4js:categoryFilter");lo.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return"string"==typeof e&&(e=[e]),n=>{fo(`Checking ${n.categoryName} against ${e}`),-1===e.indexOf(n.categoryName)&&(fo("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var Do={};const po=Nr.exports("log4js:noLogFilter");Do.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return n=>{po(`Checking data: ${n.data} against filters: ${e}`),"string"==typeof e&&(e=[e]),e=e.filter((e=>null!=e&&""!==e));const r=new RegExp(e.join("|"),"i");(0===e.length||n.data.findIndex((e=>r.test(e)))<0)&&(po("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var Eo={},mo={exports:{}},ho={},yo={fromCallback:function(e){return Object.defineProperty((function(){if("function"!=typeof arguments[arguments.length-1])return new Promise(((t,n)=>{arguments[arguments.length]=(e,r)=>{if(e)return n(e);t(r)},arguments.length++,e.apply(this,arguments)}));e.apply(this,arguments)}),"name",{value:e.name})},fromPromise:function(e){return Object.defineProperty((function(){const t=arguments[arguments.length-1];if("function"!=typeof t)return e.apply(this,arguments);e.apply(this,arguments).then((e=>t(null,e)),t)}),"name",{value:e.name})}};!function(e){const t=yo.fromCallback,n=we,r=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchown","lchmod","link","lstat","mkdir","mkdtemp","open","readFile","readdir","readlink","realpath","rename","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((e=>"function"==typeof n[e]));Object.keys(n).forEach((t=>{"promises"!==t&&(e[t]=n[t])})),r.forEach((r=>{e[r]=t(n[r])})),e.exists=function(e,t){return"function"==typeof t?n.exists(e,t):new Promise((t=>n.exists(e,t)))},e.read=function(e,t,r,u,o,i){return"function"==typeof i?n.read(e,t,r,u,o,i):new Promise(((i,s)=>{n.read(e,t,r,u,o,((e,t,n)=>{if(e)return s(e);i({bytesRead:t,buffer:n})}))}))},e.write=function(e,t,...r){return"function"==typeof r[r.length-1]?n.write(e,t,...r):new Promise(((u,o)=>{n.write(e,t,...r,((e,t,n)=>{if(e)return o(e);u({bytesWritten:t,buffer:n})}))}))},"function"==typeof n.realpath.native&&(e.realpath.native=t(n.realpath.native))}(ho);const Co=p.default;function Fo(e){return(e=Co.normalize(Co.resolve(e)).split(Co.sep)).length>0?e[0]:null}const go=/[<>:"|?*]/;var Ao=function(e){const t=Fo(e);return e=e.replace(t,""),go.test(e)};const vo=we,So=p.default,wo=Ao,Oo=parseInt("0777",8);var bo=function e(t,n,r,u){if("function"==typeof n?(r=n,n={}):n&&"object"==typeof n||(n={mode:n}),"win32"===process.platform&&wo(t)){const e=new Error(t+" contains invalid WIN32 path characters.");return e.code="EINVAL",r(e)}let o=n.mode;const i=n.fs||vo;void 0===o&&(o=Oo&~process.umask()),u||(u=null),r=r||function(){},t=So.resolve(t),i.mkdir(t,o,(o=>{if(!o)return r(null,u=u||t);if("ENOENT"===o.code){if(So.dirname(t)===t)return r(o);e(So.dirname(t),n,((u,o)=>{u?r(u,o):e(t,n,r,o)}))}else i.stat(t,((e,t)=>{e||!t.isDirectory()?r(o,u):r(null,u)}))}))};const _o=we,Bo=p.default,Po=Ao,ko=parseInt("0777",8);var xo=function e(t,n,r){n&&"object"==typeof n||(n={mode:n});let u=n.mode;const o=n.fs||_o;if("win32"===process.platform&&Po(t)){const e=new Error(t+" contains invalid WIN32 path characters.");throw e.code="EINVAL",e}void 0===u&&(u=ko&~process.umask()),r||(r=null),t=Bo.resolve(t);try{o.mkdirSync(t,u),r=r||t}catch(u){if("ENOENT"===u.code){if(Bo.dirname(t)===t)throw u;r=e(Bo.dirname(t),n,r),e(t,n,r)}else{let e;try{e=o.statSync(t)}catch(e){throw u}if(!e.isDirectory())throw u}}return r};const No=(0,yo.fromCallback)(bo);var Io={mkdirs:No,mkdirsSync:xo,mkdirp:No,mkdirpSync:xo,ensureDir:No,ensureDirSync:xo};const To=we;E.default,p.default;var Ro=function(e,t,n,r){To.open(e,"r+",((e,u)=>{if(e)return r(e);To.futimes(u,t,n,(e=>{To.close(u,(t=>{r&&r(e||t)}))}))}))},Mo=function(e,t,n){const r=To.openSync(e,"r+");return To.futimesSync(r,t,n),To.closeSync(r)};const Lo=we,jo=p.default,$o=10,Ho=5,Jo=0,Go=process.versions.node.split("."),Vo=Number.parseInt(Go[0],10),Uo=Number.parseInt(Go[1],10),Wo=Number.parseInt(Go[2],10);function zo(){if(Vo>$o)return!0;if(Vo===$o){if(Uo>Ho)return!0;if(Uo===Ho&&Wo>=Jo)return!0}return!1}function Ko(e,t){const n=jo.resolve(e).split(jo.sep).filter((e=>e)),r=jo.resolve(t).split(jo.sep).filter((e=>e));return n.reduce(((e,t,n)=>e&&r[n]===t),!0)}function qo(e,t,n){return`Cannot ${n} '${e}' to a subdirectory of itself, '${t}'.`}var Yo,Xo,Zo={checkPaths:function(e,t,n,r){!function(e,t,n){zo()?Lo.stat(e,{bigint:!0},((e,r)=>{if(e)return n(e);Lo.stat(t,{bigint:!0},((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))})):Lo.stat(e,((e,r)=>{if(e)return n(e);Lo.stat(t,((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))}))}(e,t,((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;return s&&s.ino&&s.dev&&s.ino===i.ino&&s.dev===i.dev?r(new Error("Source and destination must not be the same.")):i.isDirectory()&&Ko(e,t)?r(new Error(qo(e,t,n))):r(null,{srcStat:i,destStat:s})}))},checkPathsSync:function(e,t,n){const{srcStat:r,destStat:u}=function(e,t){let n,r;n=zo()?Lo.statSync(e,{bigint:!0}):Lo.statSync(e);try{r=zo()?Lo.statSync(t,{bigint:!0}):Lo.statSync(t)}catch(e){if("ENOENT"===e.code)return{srcStat:n,destStat:null};throw e}return{srcStat:n,destStat:r}}(e,t);if(u&&u.ino&&u.dev&&u.ino===r.ino&&u.dev===r.dev)throw new Error("Source and destination must not be the same.");if(r.isDirectory()&&Ko(e,t))throw new Error(qo(e,t,n));return{srcStat:r,destStat:u}},checkParentPaths:function e(t,n,r,u,o){const i=jo.resolve(jo.dirname(t)),s=jo.resolve(jo.dirname(r));if(s===i||s===jo.parse(s).root)return o();zo()?Lo.stat(s,{bigint:!0},((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(qo(t,r,u))):e(t,n,s,u,o))):Lo.stat(s,((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(qo(t,r,u))):e(t,n,s,u,o)))},checkParentPathsSync:function e(t,n,r,u){const o=jo.resolve(jo.dirname(t)),i=jo.resolve(jo.dirname(r));if(i===o||i===jo.parse(i).root)return;let s;try{s=zo()?Lo.statSync(i,{bigint:!0}):Lo.statSync(i)}catch(e){if("ENOENT"===e.code)return;throw e}if(s.ino&&s.dev&&s.ino===n.ino&&s.dev===n.dev)throw new Error(qo(t,r,u));return e(t,n,i,u)},isSrcSubdir:Ko};const Qo=we,ei=p.default,ti=Io.mkdirsSync,ni=Mo,ri=Zo;function ui(e,t,n,r){if(!r.filter||r.filter(t,n))return function(e,t,n,r){const u=r.dereference?Qo.statSync:Qo.lstatSync,o=u(t);if(o.isDirectory())return function(e,t,n,r,u){if(!t)return function(e,t,n,r){return Qo.mkdirSync(n),ii(t,n,r),Qo.chmodSync(n,e.mode)}(e,n,r,u);if(t&&!t.isDirectory())throw new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`);return ii(n,r,u)}(o,e,t,n,r);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return function(e,t,n,r,u){return t?function(e,t,n,r){if(r.overwrite)return Qo.unlinkSync(n),oi(e,t,n,r);if(r.errorOnExist)throw new Error(`'${n}' already exists`)}(e,n,r,u):oi(e,n,r,u)}(o,e,t,n,r);if(o.isSymbolicLink())return function(e,t,n,r){let u=Qo.readlinkSync(t);r.dereference&&(u=ei.resolve(process.cwd(),u));if(e){let e;try{e=Qo.readlinkSync(n)}catch(e){if("EINVAL"===e.code||"UNKNOWN"===e.code)return Qo.symlinkSync(u,n);throw e}if(r.dereference&&(e=ei.resolve(process.cwd(),e)),ri.isSrcSubdir(u,e))throw new Error(`Cannot copy '${u}' to a subdirectory of itself, '${e}'.`);if(Qo.statSync(n).isDirectory()&&ri.isSrcSubdir(e,u))throw new Error(`Cannot overwrite '${e}' with '${u}'.`);return function(e,t){return Qo.unlinkSync(t),Qo.symlinkSync(e,t)}(u,n)}return Qo.symlinkSync(u,n)}(e,t,n,r)}(e,t,n,r)}function oi(e,t,n,r){return"function"==typeof Qo.copyFileSync?(Qo.copyFileSync(t,n),Qo.chmodSync(n,e.mode),r.preserveTimestamps?ni(n,e.atime,e.mtime):void 0):function(e,t,n,r){const u=65536,o=(Xo?Yo:(Xo=1,Yo=function(e){if("function"==typeof Buffer.allocUnsafe)try{return Buffer.allocUnsafe(e)}catch(t){return new Buffer(e)}return new Buffer(e)}))(u),i=Qo.openSync(t,"r"),s=Qo.openSync(n,"w",e.mode);let c=0;for(;cfunction(e,t,n,r){const u=ei.join(t,e),o=ei.join(n,e),{destStat:i}=ri.checkPathsSync(u,o,"copy");return ui(i,u,o,r)}(r,e,t,n)))}var si=function(e,t,n){"function"==typeof n&&(n={filter:n}),(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269");const{srcStat:r,destStat:u}=ri.checkPathsSync(e,t,"copy");return ri.checkParentPathsSync(e,r,t,"copy"),function(e,t,n,r){if(r.filter&&!r.filter(t,n))return;const u=ei.dirname(n);Qo.existsSync(u)||ti(u);return ui(e,t,n,r)}(u,e,t,n)},ci={copySync:si};const ai=yo.fromPromise,li=ho;var fi={pathExists:ai((function(e){return li.access(e).then((()=>!0)).catch((()=>!1))})),pathExistsSync:li.existsSync};const di=we,Di=p.default,pi=Io.mkdirs,Ei=fi.pathExists,mi=Ro,hi=Zo;function yi(e,t,n,r,u){const o=Di.dirname(n);Ei(o,((i,s)=>i?u(i):s?Fi(e,t,n,r,u):void pi(o,(o=>o?u(o):Fi(e,t,n,r,u)))))}function Ci(e,t,n,r,u,o){Promise.resolve(u.filter(n,r)).then((i=>i?e(t,n,r,u,o):o()),(e=>o(e)))}function Fi(e,t,n,r,u){return r.filter?Ci(gi,e,t,n,r,u):gi(e,t,n,r,u)}function gi(e,t,n,r,u){(r.dereference?di.stat:di.lstat)(t,((o,i)=>o?u(o):i.isDirectory()?function(e,t,n,r,u,o){if(!t)return function(e,t,n,r,u){di.mkdir(n,(o=>{if(o)return u(o);Si(t,n,r,(t=>t?u(t):di.chmod(n,e.mode,u)))}))}(e,n,r,u,o);if(t&&!t.isDirectory())return o(new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`));return Si(n,r,u,o)}(i,e,t,n,r,u):i.isFile()||i.isCharacterDevice()||i.isBlockDevice()?function(e,t,n,r,u,o){return t?function(e,t,n,r,u){if(!r.overwrite)return r.errorOnExist?u(new Error(`'${n}' already exists`)):u();di.unlink(n,(o=>o?u(o):Ai(e,t,n,r,u)))}(e,n,r,u,o):Ai(e,n,r,u,o)}(i,e,t,n,r,u):i.isSymbolicLink()?function(e,t,n,r,u){di.readlink(t,((t,o)=>t?u(t):(r.dereference&&(o=Di.resolve(process.cwd(),o)),e?void di.readlink(n,((t,i)=>t?"EINVAL"===t.code||"UNKNOWN"===t.code?di.symlink(o,n,u):u(t):(r.dereference&&(i=Di.resolve(process.cwd(),i)),hi.isSrcSubdir(o,i)?u(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${i}'.`)):e.isDirectory()&&hi.isSrcSubdir(i,o)?u(new Error(`Cannot overwrite '${i}' with '${o}'.`)):function(e,t,n){di.unlink(t,(r=>r?n(r):di.symlink(e,t,n)))}(o,n,u)))):di.symlink(o,n,u))))}(e,t,n,r,u):void 0))}function Ai(e,t,n,r,u){return"function"==typeof di.copyFile?di.copyFile(t,n,(t=>t?u(t):vi(e,n,r,u))):function(e,t,n,r,u){const o=di.createReadStream(t);o.on("error",(e=>u(e))).once("open",(()=>{const t=di.createWriteStream(n,{mode:e.mode});t.on("error",(e=>u(e))).on("open",(()=>o.pipe(t))).once("close",(()=>vi(e,n,r,u)))}))}(e,t,n,r,u)}function vi(e,t,n,r){di.chmod(t,e.mode,(u=>u?r(u):n.preserveTimestamps?mi(t,e.atime,e.mtime,r):r()))}function Si(e,t,n,r){di.readdir(e,((u,o)=>u?r(u):wi(o,e,t,n,r)))}function wi(e,t,n,r,u){const o=e.pop();return o?function(e,t,n,r,u,o){const i=Di.join(n,t),s=Di.join(r,t);hi.checkPaths(i,s,"copy",((t,c)=>{if(t)return o(t);const{destStat:a}=c;Fi(a,i,s,u,(t=>t?o(t):wi(e,n,r,u,o)))}))}(e,o,t,n,r,u):u()}var Oi=function(e,t,n,r){"function"!=typeof n||r?"function"==typeof n&&(n={filter:n}):(r=n,n={}),r=r||function(){},(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269"),hi.checkPaths(e,t,"copy",((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;hi.checkParentPaths(e,i,t,"copy",(u=>u?r(u):n.filter?Ci(yi,s,e,t,n,r):yi(s,e,t,n,r)))}))};var bi={copy:(0,yo.fromCallback)(Oi)};const _i=we,Bi=p.default,Pi=g.default,ki="win32"===process.platform;function xi(e){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((t=>{e[t]=e[t]||_i[t],e[t+="Sync"]=e[t]||_i[t]})),e.maxBusyTries=e.maxBusyTries||3}function Ni(e,t,n){let r=0;"function"==typeof t&&(n=t,t={}),Pi(e,"rimraf: missing path"),Pi.strictEqual(typeof e,"string","rimraf: path should be a string"),Pi.strictEqual(typeof n,"function","rimraf: callback function required"),Pi(t,"rimraf: invalid options argument provided"),Pi.strictEqual(typeof t,"object","rimraf: options should be object"),xi(t),Ii(e,t,(function u(o){if(o){if(("EBUSY"===o.code||"ENOTEMPTY"===o.code||"EPERM"===o.code)&&rIi(e,t,u)),100*r)}"ENOENT"===o.code&&(o=null)}n(o)}))}function Ii(e,t,n){Pi(e),Pi(t),Pi("function"==typeof n),t.lstat(e,((r,u)=>r&&"ENOENT"===r.code?n(null):r&&"EPERM"===r.code&&ki?Ti(e,t,r,n):u&&u.isDirectory()?Mi(e,t,r,n):void t.unlink(e,(r=>{if(r){if("ENOENT"===r.code)return n(null);if("EPERM"===r.code)return ki?Ti(e,t,r,n):Mi(e,t,r,n);if("EISDIR"===r.code)return Mi(e,t,r,n)}return n(r)}))))}function Ti(e,t,n,r){Pi(e),Pi(t),Pi("function"==typeof r),n&&Pi(n instanceof Error),t.chmod(e,438,(u=>{u?r("ENOENT"===u.code?null:n):t.stat(e,((u,o)=>{u?r("ENOENT"===u.code?null:n):o.isDirectory()?Mi(e,t,n,r):t.unlink(e,r)}))}))}function Ri(e,t,n){let r;Pi(e),Pi(t),n&&Pi(n instanceof Error);try{t.chmodSync(e,438)}catch(e){if("ENOENT"===e.code)return;throw n}try{r=t.statSync(e)}catch(e){if("ENOENT"===e.code)return;throw n}r.isDirectory()?ji(e,t,n):t.unlinkSync(e)}function Mi(e,t,n,r){Pi(e),Pi(t),n&&Pi(n instanceof Error),Pi("function"==typeof r),t.rmdir(e,(u=>{!u||"ENOTEMPTY"!==u.code&&"EEXIST"!==u.code&&"EPERM"!==u.code?u&&"ENOTDIR"===u.code?r(n):r(u):function(e,t,n){Pi(e),Pi(t),Pi("function"==typeof n),t.readdir(e,((r,u)=>{if(r)return n(r);let o,i=u.length;if(0===i)return t.rmdir(e,n);u.forEach((r=>{Ni(Bi.join(e,r),t,(r=>{if(!o)return r?n(o=r):void(0==--i&&t.rmdir(e,n))}))}))}))}(e,t,r)}))}function Li(e,t){let n;xi(t=t||{}),Pi(e,"rimraf: missing path"),Pi.strictEqual(typeof e,"string","rimraf: path should be a string"),Pi(t,"rimraf: missing options"),Pi.strictEqual(typeof t,"object","rimraf: options should be object");try{n=t.lstatSync(e)}catch(n){if("ENOENT"===n.code)return;"EPERM"===n.code&&ki&&Ri(e,t,n)}try{n&&n.isDirectory()?ji(e,t,null):t.unlinkSync(e)}catch(n){if("ENOENT"===n.code)return;if("EPERM"===n.code)return ki?Ri(e,t,n):ji(e,t,n);if("EISDIR"!==n.code)throw n;ji(e,t,n)}}function ji(e,t,n){Pi(e),Pi(t),n&&Pi(n instanceof Error);try{t.rmdirSync(e)}catch(r){if("ENOTDIR"===r.code)throw n;if("ENOTEMPTY"===r.code||"EEXIST"===r.code||"EPERM"===r.code)!function(e,t){if(Pi(e),Pi(t),t.readdirSync(e).forEach((n=>Li(Bi.join(e,n),t))),!ki){return t.rmdirSync(e,t)}{const n=Date.now();do{try{return t.rmdirSync(e,t)}catch(e){}}while(Date.now()-n<500)}}(e,t);else if("ENOENT"!==r.code)throw r}}var $i=Ni;Ni.sync=Li;const Hi=$i;var Ji={remove:(0,yo.fromCallback)(Hi),removeSync:Hi.sync};const Gi=yo.fromCallback,Vi=we,Ui=p.default,Wi=Io,zi=Ji,Ki=Gi((function(e,t){t=t||function(){},Vi.readdir(e,((n,r)=>{if(n)return Wi.mkdirs(e,t);r=r.map((t=>Ui.join(e,t))),function e(){const n=r.pop();if(!n)return t();zi.remove(n,(n=>{if(n)return t(n);e()}))}()}))}));function qi(e){let t;try{t=Vi.readdirSync(e)}catch(t){return Wi.mkdirsSync(e)}t.forEach((t=>{t=Ui.join(e,t),zi.removeSync(t)}))}var Yi={emptyDirSync:qi,emptydirSync:qi,emptyDir:Ki,emptydir:Ki};const Xi=yo.fromCallback,Zi=p.default,Qi=we,es=Io,ts=fi.pathExists;var ns={createFile:Xi((function(e,t){function n(){Qi.writeFile(e,"",(e=>{if(e)return t(e);t()}))}Qi.stat(e,((r,u)=>{if(!r&&u.isFile())return t();const o=Zi.dirname(e);ts(o,((e,r)=>e?t(e):r?n():void es.mkdirs(o,(e=>{if(e)return t(e);n()}))))}))})),createFileSync:function(e){let t;try{t=Qi.statSync(e)}catch(e){}if(t&&t.isFile())return;const n=Zi.dirname(e);Qi.existsSync(n)||es.mkdirsSync(n),Qi.writeFileSync(e,"")}};const rs=yo.fromCallback,us=p.default,os=we,is=Io,ss=fi.pathExists;var cs={createLink:rs((function(e,t,n){function r(e,t){os.link(e,t,(e=>{if(e)return n(e);n(null)}))}ss(t,((u,o)=>u?n(u):o?n(null):void os.lstat(e,(u=>{if(u)return u.message=u.message.replace("lstat","ensureLink"),n(u);const o=us.dirname(t);ss(o,((u,i)=>u?n(u):i?r(e,t):void is.mkdirs(o,(u=>{if(u)return n(u);r(e,t)}))))}))))})),createLinkSync:function(e,t){if(os.existsSync(t))return;try{os.lstatSync(e)}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}const n=us.dirname(t);return os.existsSync(n)||is.mkdirsSync(n),os.linkSync(e,t)}};const as=p.default,ls=we,fs=fi.pathExists;var ds={symlinkPaths:function(e,t,n){if(as.isAbsolute(e))return ls.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:e})));{const r=as.dirname(t),u=as.join(r,e);return fs(u,((t,o)=>t?n(t):o?n(null,{toCwd:u,toDst:e}):ls.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:as.relative(r,e)})))))}},symlinkPathsSync:function(e,t){let n;if(as.isAbsolute(e)){if(n=ls.existsSync(e),!n)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}{const r=as.dirname(t),u=as.join(r,e);if(n=ls.existsSync(u),n)return{toCwd:u,toDst:e};if(n=ls.existsSync(e),!n)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:as.relative(r,e)}}}};const Ds=we;var ps={symlinkType:function(e,t,n){if(n="function"==typeof t?t:n,t="function"!=typeof t&&t)return n(null,t);Ds.lstat(e,((e,r)=>{if(e)return n(null,"file");t=r&&r.isDirectory()?"dir":"file",n(null,t)}))},symlinkTypeSync:function(e,t){let n;if(t)return t;try{n=Ds.lstatSync(e)}catch(e){return"file"}return n&&n.isDirectory()?"dir":"file"}};const Es=yo.fromCallback,ms=p.default,hs=we,ys=Io.mkdirs,Cs=Io.mkdirsSync,Fs=ds.symlinkPaths,gs=ds.symlinkPathsSync,As=ps.symlinkType,vs=ps.symlinkTypeSync,Ss=fi.pathExists;var ws={createSymlink:Es((function(e,t,n,r){r="function"==typeof n?n:r,n="function"!=typeof n&&n,Ss(t,((u,o)=>u?r(u):o?r(null):void Fs(e,t,((u,o)=>{if(u)return r(u);e=o.toDst,As(o.toCwd,n,((n,u)=>{if(n)return r(n);const o=ms.dirname(t);Ss(o,((n,i)=>n?r(n):i?hs.symlink(e,t,u,r):void ys(o,(n=>{if(n)return r(n);hs.symlink(e,t,u,r)}))))}))}))))})),createSymlinkSync:function(e,t,n){if(hs.existsSync(t))return;const r=gs(e,t);e=r.toDst,n=vs(r.toCwd,n);const u=ms.dirname(t);return hs.existsSync(u)||Cs(u),hs.symlinkSync(e,t,n)}};var Os,bs={createFile:ns.createFile,createFileSync:ns.createFileSync,ensureFile:ns.createFile,ensureFileSync:ns.createFileSync,createLink:cs.createLink,createLinkSync:cs.createLinkSync,ensureLink:cs.createLink,ensureLinkSync:cs.createLinkSync,createSymlink:ws.createSymlink,createSymlinkSync:ws.createSymlinkSync,ensureSymlink:ws.createSymlink,ensureSymlinkSync:ws.createSymlinkSync};try{Os=we}catch(e){Os=D.default}function _s(e,t){var n,r="\n";return"object"==typeof t&&null!==t&&(t.spaces&&(n=t.spaces),t.EOL&&(r=t.EOL)),JSON.stringify(e,t?t.replacer:null,n).replace(/\n/g,r)+r}function Bs(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e=e.replace(/^\uFEFF/,"")}var Ps={readFile:function(e,t,n){null==n&&(n=t,t={}),"string"==typeof t&&(t={encoding:t});var r=(t=t||{}).fs||Os,u=!0;"throws"in t&&(u=t.throws),r.readFile(e,t,(function(r,o){if(r)return n(r);var i;o=Bs(o);try{i=JSON.parse(o,t?t.reviver:null)}catch(t){return u?(t.message=e+": "+t.message,n(t)):n(null,null)}n(null,i)}))},readFileSync:function(e,t){"string"==typeof(t=t||{})&&(t={encoding:t});var n=t.fs||Os,r=!0;"throws"in t&&(r=t.throws);try{var u=n.readFileSync(e,t);return u=Bs(u),JSON.parse(u,t.reviver)}catch(t){if(r)throw t.message=e+": "+t.message,t;return null}},writeFile:function(e,t,n,r){null==r&&(r=n,n={});var u=(n=n||{}).fs||Os,o="";try{o=_s(t,n)}catch(e){return void(r&&r(e,null))}u.writeFile(e,o,n,r)},writeFileSync:function(e,t,n){var r=(n=n||{}).fs||Os,u=_s(t,n);return r.writeFileSync(e,u,n)}},ks=Ps;const xs=yo.fromCallback,Ns=ks;var Is={readJson:xs(Ns.readFile),readJsonSync:Ns.readFileSync,writeJson:xs(Ns.writeFile),writeJsonSync:Ns.writeFileSync};const Ts=p.default,Rs=Io,Ms=fi.pathExists,Ls=Is;var js=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=Ts.dirname(e);Ms(u,((o,i)=>o?r(o):i?Ls.writeJson(e,t,n,r):void Rs.mkdirs(u,(u=>{if(u)return r(u);Ls.writeJson(e,t,n,r)}))))};const $s=we,Hs=p.default,Js=Io,Gs=Is;var Vs=function(e,t,n){const r=Hs.dirname(e);$s.existsSync(r)||Js.mkdirsSync(r),Gs.writeJsonSync(e,t,n)};const Us=yo.fromCallback,Ws=Is;Ws.outputJson=Us(js),Ws.outputJsonSync=Vs,Ws.outputJSON=Ws.outputJson,Ws.outputJSONSync=Ws.outputJsonSync,Ws.writeJSON=Ws.writeJson,Ws.writeJSONSync=Ws.writeJsonSync,Ws.readJSON=Ws.readJson,Ws.readJSONSync=Ws.readJsonSync;var zs=Ws;const Ks=we,qs=p.default,Ys=ci.copySync,Xs=Ji.removeSync,Zs=Io.mkdirpSync,Qs=Zo;function ec(e,t,n){try{Ks.renameSync(e,t)}catch(r){if("EXDEV"!==r.code)throw r;return function(e,t,n){const r={overwrite:n,errorOnExist:!0};return Ys(e,t,r),Xs(e)}(e,t,n)}}var tc=function(e,t,n){const r=(n=n||{}).overwrite||n.clobber||!1,{srcStat:u}=Qs.checkPathsSync(e,t,"move");return Qs.checkParentPathsSync(e,u,t,"move"),Zs(qs.dirname(t)),function(e,t,n){if(n)return Xs(t),ec(e,t,n);if(Ks.existsSync(t))throw new Error("dest already exists.");return ec(e,t,n)}(e,t,r)},nc={moveSync:tc};const rc=we,uc=p.default,oc=bi.copy,ic=Ji.remove,sc=Io.mkdirp,cc=fi.pathExists,ac=Zo;function lc(e,t,n,r){rc.rename(e,t,(u=>u?"EXDEV"!==u.code?r(u):function(e,t,n,r){const u={overwrite:n,errorOnExist:!0};oc(e,t,u,(t=>t?r(t):ic(e,r)))}(e,t,n,r):r()))}var fc=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=n.overwrite||n.clobber||!1;ac.checkPaths(e,t,"move",((n,o)=>{if(n)return r(n);const{srcStat:i}=o;ac.checkParentPaths(e,i,t,"move",(n=>{if(n)return r(n);sc(uc.dirname(t),(n=>n?r(n):function(e,t,n,r){if(n)return ic(t,(u=>u?r(u):lc(e,t,n,r)));cc(t,((u,o)=>u?r(u):o?r(new Error("dest already exists.")):lc(e,t,n,r)))}(e,t,u,r)))}))}))};var dc={move:(0,yo.fromCallback)(fc)};const Dc=yo.fromCallback,pc=we,Ec=p.default,mc=Io,hc=fi.pathExists;var yc={outputFile:Dc((function(e,t,n,r){"function"==typeof n&&(r=n,n="utf8");const u=Ec.dirname(e);hc(u,((o,i)=>o?r(o):i?pc.writeFile(e,t,n,r):void mc.mkdirs(u,(u=>{if(u)return r(u);pc.writeFile(e,t,n,r)}))))})),outputFileSync:function(e,...t){const n=Ec.dirname(e);if(pc.existsSync(n))return pc.writeFileSync(e,...t);mc.mkdirsSync(n),pc.writeFileSync(e,...t)}};!function(e){e.exports=Object.assign({},ho,ci,bi,Yi,bs,zs,Io,nc,dc,yc,fi,Ji);const t=D.default;Object.getOwnPropertyDescriptor(t,"promises")&&Object.defineProperty(e.exports,"promises",{get:()=>t.promises})}(mo);const Cc=Nr.exports("streamroller:fileNameFormatter"),Fc=p.default;const gc=Nr.exports("streamroller:fileNameParser"),Ac=nu.exports;const vc=Nr.exports("streamroller:moveAndMaybeCompressFile"),Sc=mo.exports,wc=v.default;var Oc=async(e,t,n)=>{if(n=function(e){const t={mode:parseInt("0600",8),compress:!1},n=Object.assign({},t,e);return vc(`_parseOption: moveAndMaybeCompressFile called with option=${JSON.stringify(n)}`),n}(n),e!==t){if(await Sc.pathExists(e))if(vc(`moveAndMaybeCompressFile: moving file from ${e} to ${t} ${n.compress?"with":"without"} compress`),n.compress)await new Promise(((r,u)=>{let o=!1;const i=Sc.createWriteStream(t,{mode:n.mode,flags:"wx"}).on("open",(()=>{o=!0;const t=Sc.createReadStream(e).on("open",(()=>{t.pipe(wc.createGzip()).pipe(i)})).on("error",(t=>{vc(`moveAndMaybeCompressFile: error reading ${e}`,t),i.destroy(t)}))})).on("finish",(()=>{vc(`moveAndMaybeCompressFile: finished compressing ${t}, deleting ${e}`),Sc.unlink(e).then(r).catch((t=>{vc(`moveAndMaybeCompressFile: error deleting ${e}, truncating instead`,t),Sc.truncate(e).then(r).catch((t=>{vc(`moveAndMaybeCompressFile: error truncating ${e}`,t),u(t)}))}))})).on("error",(e=>{o?(vc(`moveAndMaybeCompressFile: error writing ${t}, deleting`,e),Sc.unlink(t).then((()=>{u(e)})).catch((e=>{vc(`moveAndMaybeCompressFile: error deleting ${t}`,e),u(e)}))):(vc(`moveAndMaybeCompressFile: error creating ${t}`,e),u(e))}))})).catch((()=>{}));else{vc(`moveAndMaybeCompressFile: renaming ${e} to ${t}`);try{await Sc.move(e,t,{overwrite:!0})}catch(n){if(vc(`moveAndMaybeCompressFile: error renaming ${e} to ${t}`,n),"ENOENT"!==n.code){vc("moveAndMaybeCompressFile: trying copy+truncate instead");try{await Sc.copy(e,t,{overwrite:!0}),await Sc.truncate(e)}catch(e){vc("moveAndMaybeCompressFile: error copy+truncate",e)}}}}}else vc("moveAndMaybeCompressFile: source and target are the same, not doing anything")};const bc=Nr.exports("streamroller:RollingFileWriteStream"),_c=mo.exports,Bc=p.default,Pc=E.default,kc=()=>new Date,xc=nu.exports,{Writable:Nc}=C.default,Ic=({file:e,keepFileExt:t,needsIndex:n,alwaysIncludeDate:r,compress:u,fileNameSep:o})=>{let i=o||".";const s=Fc.join(e.dir,e.name),c=t=>t+e.ext,a=(e,t,r)=>!n&&r||!t?e:e+i+t,l=(e,t,n)=>(t>0||r)&&n?e+i+n:e,f=(e,t)=>t&&u?e+".gz":e,d=t?[l,a,c,f]:[c,l,a,f];return({date:e,index:t})=>(Cc(`_formatFileName: date=${e}, index=${t}`),d.reduce(((n,r)=>r(n,t,e)),s))},Tc=({file:e,keepFileExt:t,pattern:n,fileNameSep:r})=>{let u=r||".";const o="__NOT_MATCHING__";let i=[(e,t)=>e.endsWith(".gz")?(gc("it is gzipped"),t.isCompressed=!0,e.slice(0,-1*".gz".length)):e,t?t=>t.startsWith(e.name)&&t.endsWith(e.ext)?(gc("it starts and ends with the right things"),t.slice(e.name.length+1,-1*e.ext.length)):o:t=>t.startsWith(e.base)?(gc("it starts with the right things"),t.slice(e.base.length+1)):o,n?(e,t)=>{const r=e.split(u);let o=r[r.length-1];gc("items: ",r,", indexStr: ",o);let i=e;void 0!==o&&o.match(/^\d+$/)?(i=e.slice(0,-1*(o.length+1)),gc(`dateStr is ${i}`),n&&!i&&(i=o,o="0")):o="0";try{const r=Ac.parse(n,i,new Date(0,0));return Ac.asString(n,r)!==i?e:(t.index=parseInt(o,10),t.date=i,t.timestamp=r.getTime(),"")}catch(t){return gc(`Problem parsing ${i} as ${n}, error was: `,t),e}}:(e,t)=>e.match(/^\d+$/)?(gc("it has an index"),t.index=parseInt(e,10),""):e];return e=>{let t={filename:e,index:0,isCompressed:!1};return i.reduce(((e,n)=>n(e,t)),e)?null:t}},Rc=Oc;var Mc=class extends Nc{constructor(e,t){if(bc(`constructor: creating RollingFileWriteStream. path=${e}`),"string"!=typeof e||0===e.length)throw new Error(`Invalid filename: ${e}`);if(e.endsWith(Bc.sep))throw new Error(`Filename is a directory: ${e}`);0===e.indexOf(`~${Bc.sep}`)&&(e=e.replace("~",Pc.homedir())),super(t),this.options=this._parseOption(t),this.fileObject=Bc.parse(e),""===this.fileObject.dir&&(this.fileObject=Bc.parse(Bc.join(process.cwd(),e))),this.fileFormatter=Ic({file:this.fileObject,alwaysIncludeDate:this.options.alwaysIncludePattern,needsIndex:this.options.maxSize 0`)}else delete n.maxSize;if(n.numBackups||0===n.numBackups){if(n.numBackups<0)throw new Error(`options.numBackups (${n.numBackups}) should be >= 0`);if(n.numBackups>=Number.MAX_SAFE_INTEGER)throw new Error(`options.numBackups (${n.numBackups}) should be < Number.MAX_SAFE_INTEGER`);n.numToKeep=n.numBackups+1}else if(n.numToKeep<=0)throw new Error(`options.numToKeep (${n.numToKeep}) should be > 0`);return bc(`_parseOption: creating stream with option=${JSON.stringify(n)}`),n}_final(e){this.currentFileStream.end("",this.options.encoding,e)}_write(e,t,n){this._shouldRoll().then((()=>{bc(`_write: writing chunk. file=${this.currentFileStream.path} state=${JSON.stringify(this.state)} chunk=${e}`),this.currentFileStream.write(e,t,(t=>{this.state.currentSize+=e.length,n(t)}))}))}async _shouldRoll(){(this._dateChanged()||this._tooBig())&&(bc(`_shouldRoll: rolling because dateChanged? ${this._dateChanged()} or tooBig? ${this._tooBig()}`),await this._roll())}_dateChanged(){return this.state.currentDate&&this.state.currentDate!==xc(this.options.pattern,kc())}_tooBig(){return this.state.currentSize>=this.options.maxSize}_roll(){return bc("_roll: closing the current stream"),new Promise(((e,t)=>{this.currentFileStream.end("",this.options.encoding,(()=>{this._moveOldFiles().then(e).catch(t)}))}))}async _moveOldFiles(){const e=await this._getExistingFiles();for(let t=(this.state.currentDate?e.filter((e=>e.date===this.state.currentDate)):e).length;t>=0;t--){bc(`_moveOldFiles: i = ${t}`);const e=this.fileFormatter({date:this.state.currentDate,index:t}),n=this.fileFormatter({date:this.state.currentDate,index:t+1}),r={compress:this.options.compress&&0===t,mode:this.options.mode};await Rc(e,n,r)}this.state.currentSize=0,this.state.currentDate=this.state.currentDate?xc(this.options.pattern,kc()):null,bc(`_moveOldFiles: finished rolling files. state=${JSON.stringify(this.state)}`),this._renewWriteStream(),await new Promise(((e,t)=>{this.currentFileStream.write("","utf8",(()=>{this._clean().then(e).catch(t)}))}))}async _getExistingFiles(){const e=await _c.readdir(this.fileObject.dir).catch((()=>[]));bc(`_getExistingFiles: files=${e}`);const t=e.map((e=>this.fileNameParser(e))).filter((e=>e)),n=e=>(e.timestamp?e.timestamp:kc().getTime())-e.index;return t.sort(((e,t)=>n(e)-n(t))),t}_renewWriteStream(){const e=this.fileFormatter({date:this.state.currentDate,index:0}),t=e=>{try{return _c.mkdirSync(e,{recursive:!0})}catch(n){if("ENOENT"===n.code)return t(Bc.dirname(e)),t(e);if("EEXIST"!==n.code&&"EROFS"!==n.code)throw n;try{if(_c.statSync(e).isDirectory())return e;throw n}catch(e){throw n}}};t(this.fileObject.dir);const n={flags:this.options.flags,encoding:this.options.encoding,mode:this.options.mode};var r,u;_c.appendFileSync(e,"",(r={...n},u="flags",r["flag"]=r[u],delete r[u],r)),this.currentFileStream=_c.createWriteStream(e,n),this.currentFileStream.on("error",(e=>{this.emit("error",e)}))}async _clean(){const e=await this._getExistingFiles();if(bc(`_clean: numToKeep = ${this.options.numToKeep}, existingFiles = ${e.length}`),bc("_clean: existing files are: ",e),this._tooManyFiles(e.length)){const n=e.slice(0,e.length-this.options.numToKeep).map((e=>Bc.format({dir:this.fileObject.dir,base:e.filename})));await(t=n,bc(`deleteFiles: files to delete: ${t}`),Promise.all(t.map((e=>_c.unlink(e).catch((t=>{bc(`deleteFiles: error when unlinking ${e}, ignoring. Error was ${t}`)}))))))}var t}_tooManyFiles(e){return this.options.numToKeep>0&&e>this.options.numToKeep}};const Lc=Mc;var jc=class extends Lc{constructor(e,t,n,r){r||(r={}),t&&(r.maxSize=t),r.numBackups||0===r.numBackups||(n||0===n||(n=1),r.numBackups=n),super(e,r),this.backups=r.numBackups,this.size=this.options.maxSize}get theStream(){return this.currentFileStream}};const $c=Mc;var Hc={RollingFileWriteStream:Mc,RollingFileStream:jc,DateRollingFileStream:class extends $c{constructor(e,t,n){t&&"object"==typeof t&&(n=t,t=null),n||(n={}),t||(t="yyyy-MM-dd"),n.pattern=t,n.numBackups||0===n.numBackups?n.daysToKeep=n.numBackups:(n.daysToKeep||0===n.daysToKeep?process.emitWarning("options.daysToKeep is deprecated due to the confusion it causes when used together with file size rolling. Please use options.numBackups instead.","DeprecationWarning","streamroller-DEP0001"):n.daysToKeep=1,n.numBackups=n.daysToKeep),super(e,n),this.mode=this.options.mode}get theStream(){return this.currentFileStream}}};const Jc=Nr.exports("log4js:file"),Gc=p.default,Vc=Hc,Uc=E.default.EOL;let Wc=!1;const zc=new Set;function Kc(){zc.forEach((e=>{e.sighupHandler()}))}function qc(e,t,n,r){const u=new Vc.RollingFileStream(e,t,n,r);return u.on("error",(t=>{console.error("log4js.fileAppender - Writing to file %s, error happened ",e,t)})),u.on("drain",(()=>{process.emit("log4js:pause",!1)})),u}Eo.configure=function(e,t){let n=t.basicLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),e.mode=e.mode||384,function(e,t,n,r,u,o){e=Gc.normalize(e),Jc("Creating file appender (",e,", ",n,", ",r=r||0===r?r:5,", ",u,", ",o,")");let i=qc(e,n,r,u);const s=function(e){if(i.writable){if(!0===u.removeColor){const t=/\x1b[[0-9;]*m/g;e.data=e.data.map((e=>"string"==typeof e?e.replace(t,""):e))}i.write(t(e,o)+Uc,"utf8")||process.emit("log4js:pause",!0)}};return s.reopen=function(){i.end((()=>{i=qc(e,n,r,u)}))},s.sighupHandler=function(){Jc("SIGHUP handler called."),s.reopen()},s.shutdown=function(e){zc.delete(s),0===zc.size&&Wc&&(process.removeListener("SIGHUP",Kc),Wc=!1),i.end("","utf-8",e)},zc.add(s),Wc||(process.on("SIGHUP",Kc),Wc=!0),s}(e.filename,n,e.maxLogSize,e.backups,e,e.timezoneOffset)};var Yc={};const Xc=Hc,Zc=E.default.EOL;function Qc(e,t,n,r,u){r.maxSize=r.maxLogSize;const o=function(e,t,n){const r=new Xc.DateRollingFileStream(e,t,n);return r.on("error",(t=>{console.error("log4js.dateFileAppender - Writing to file %s, error happened ",e,t)})),r.on("drain",(()=>{process.emit("log4js:pause",!1)})),r}(e,t,r),i=function(e){o.writable&&(o.write(n(e,u)+Zc,"utf8")||process.emit("log4js:pause",!0))};return i.shutdown=function(e){o.end("","utf-8",e)},i}Yc.configure=function(e,t){let n=t.basicLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),e.alwaysIncludePattern||(e.alwaysIncludePattern=!1),e.mode=e.mode||384,Qc(e.filename,e.pattern,n,e,e.timezoneOffset)};var ea={};const ta=Nr.exports("log4js:fileSync"),na=p.default,ra=D.default,ua=E.default.EOL||"\n";function oa(e,t){if(ra.existsSync(e))return;const n=ra.openSync(e,t.flags,t.mode);ra.closeSync(n)}class ia{constructor(e,t,n,r){ta("In RollingFileStream"),function(){if(!e||!t||t<=0)throw new Error("You must specify a filename and file size")}(),this.filename=e,this.size=t,this.backups=n,this.options=r,this.currentSize=0,this.currentSize=function(e){let t=0;try{t=ra.statSync(e).size}catch(t){oa(e,r)}return t}(this.filename)}shouldRoll(){return ta("should roll with current size %d, and max size %d",this.currentSize,this.size),this.currentSize>=this.size}roll(e){const t=this,n=new RegExp(`^${na.basename(e)}`);function r(e){return n.test(e)}function u(t){return parseInt(t.substring(`${na.basename(e)}.`.length),10)||0}function o(e,t){return u(e)>u(t)?1:u(e) ${e}.${r+1}`),ra.renameSync(na.join(na.dirname(e),n),`${e}.${r+1}`)}}ta("Rolling, rolling, rolling"),ta("Renaming the old files"),ra.readdirSync(na.dirname(e)).filter(r).sort(o).reverse().forEach(i)}write(e,t){const n=this;ta("in write"),this.shouldRoll()&&(this.currentSize=0,this.roll(this.filename)),ta("writing the chunk to the file"),n.currentSize+=e.length,ra.appendFileSync(n.filename,e)}}ea.configure=function(e,t){let n=t.basicLayout;e.layout&&(n=t.layout(e.layout.type,e.layout));const r={flags:e.flags||"a",encoding:e.encoding||"utf8",mode:e.mode||384};return function(e,t,n,r,u,o){ta("fileSync appender created");const i=function(e,t,n){let r;var u;return t?r=new ia(e,t,n,o):(oa(u=e,o),r={write(e){ra.appendFileSync(u,e)}}),r}(e=na.normalize(e),n,r=r||0===r?r:5);return e=>{i.write(t(e,u)+ua)}}(e.filename,n,e.maxLogSize,e.backups,e.timezoneOffset,r)};var sa={};const ca=Nr.exports("log4js:tcp"),aa=S.default;sa.configure=function(e,t){ca(`configure with config = ${e}`);let n=function(e){return e.serialise()};return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){let n=!1;const r=[];let u,o=3,i="__LOG4JS__";function s(e){ca("Writing log event to socket"),n=u.write(`${t(e)}${i}`,"utf8")}function c(){let e;for(ca("emptying buffer");e=r.shift();)s(e)}function a(e){n?s(e):(ca("buffering log event because it cannot write at the moment"),r.push(e))}return function t(){ca(`appender creating socket to ${e.host||"localhost"}:${e.port||5e3}`),i=`${e.endMsg||"__LOG4JS__"}`,u=aa.createConnection(e.port||5e3,e.host||"localhost"),u.on("connect",(()=>{ca("socket connected"),c(),n=!0})),u.on("drain",(()=>{ca("drain event received, emptying buffer"),n=!0,c()})),u.on("timeout",u.end.bind(u)),u.on("error",(e=>{ca("connection error",e),n=!1,c()})),u.on("close",t)}(),a.shutdown=function(e){ca("shutdown called"),r.length&&o?(ca("buffer has items, waiting 100ms to empty"),o-=1,setTimeout((()=>{a.shutdown(e)}),100)):(u.removeAllListeners("close"),u.end(e))},a}(e,n)};const la=p.default,fa=Nr.exports("log4js:appenders"),da=tu,Da=eo,pa=gu,Ea=hu,ma=to,ha=new Map;ha.set("console",oo),ha.set("stdout",so),ha.set("stderr",co),ha.set("logLevelFilter",ao),ha.set("categoryFilter",lo),ha.set("noLogFilter",Do),ha.set("file",Eo),ha.set("dateFile",Yc),ha.set("fileSync",ea),ha.set("tcp",sa);const ya=new Map,Ca=(e,t)=>{fa("Loading module from ",e);try{return require(e)}catch(n){return void da.throwExceptionIf(t,"MODULE_NOT_FOUND"!==n.code,`appender "${e}" could not be loaded (error was: ${n})`)}},Fa=new Set,ga=(e,t)=>{if(ya.has(e))return ya.get(e);if(!t.appenders[e])return!1;if(Fa.has(e))throw new Error(`Dependency loop detected for appender ${e}.`);Fa.add(e),fa(`Creating appender ${e}`);const n=Aa(e,t);return Fa.delete(e),ya.set(e,n),n},Aa=(e,t)=>{const n=t.appenders[e],r=n.type.configure?n.type:((e,t)=>ha.get(e)||Ca(`./${e}`,t)||Ca(e,t)||require.main&&Ca(la.join(la.dirname(require.main.filename),e),t)||Ca(la.join(process.cwd(),e),t))(n.type,t);return da.throwExceptionIf(t,da.not(r),`appender "${e}" is not valid (type "${n.type}" could not be found)`),r.appender&&fa(`DEPRECATION: Appender ${n.type} exports an appender function.`),r.shutdown&&fa(`DEPRECATION: Appender ${n.type} exports a shutdown function.`),fa(`${e}: clustering.isMaster ? ${Da.isMaster()}`),fa(`${e}: appenderModule is ${F.default.inspect(r)}`),Da.onlyOnMaster((()=>(fa(`calling appenderModule.configure for ${e} / ${n.type}`),r.configure(ma.modifyConfig(n),Ea,(e=>ga(e,t)),pa))),(()=>{}))},va=e=>{ya.clear(),Fa.clear();const t=[];Object.values(e.categories).forEach((e=>{t.push(...e.appenders)})),Object.keys(e.appenders).forEach((n=>{(t.includes(n)||"tcp-server"===e.appenders[n].type)&&ga(n,e)}))},Sa=()=>{va({appenders:{out:{type:"stdout"}},categories:{default:{appenders:["out"],level:"trace"}}})};Sa(),da.addListener((e=>{da.throwExceptionIf(e,da.not(da.anObject(e.appenders)),'must have a property "appenders" of type object.');const t=Object.keys(e.appenders);da.throwExceptionIf(e,da.not(t.length),"must define at least one appender."),t.forEach((t=>{da.throwExceptionIf(e,da.not(e.appenders[t].type),`appender "${t}" is not valid (must be an object with property "type")`)}))})),da.addListener(va),Au.exports=ya,Au.exports.init=Sa;var wa={exports:{}};!function(e){const t=Nr.exports("log4js:categories"),n=tu,r=gu,u=Au.exports,o=new Map;function i(e,t,n){if(!1===t.inherit)return;const r=n.lastIndexOf(".");if(r<0)return;const u=n.substring(0,r);let o=e.categories[u];o||(o={inherit:!0,appenders:[]}),i(e,o,u),!e.categories[u]&&o.appenders&&o.appenders.length&&o.level&&(e.categories[u]=o),t.appenders=t.appenders||[],t.level=t.level||o.level,o.appenders.forEach((e=>{t.appenders.includes(e)||t.appenders.push(e)})),t.parent=o}function s(e){if(!e.categories)return;Object.keys(e.categories).forEach((t=>{const n=e.categories[t];i(e,n,t)}))}n.addPreProcessingListener((e=>s(e))),n.addListener((e=>{n.throwExceptionIf(e,n.not(n.anObject(e.categories)),'must have a property "categories" of type object.');const t=Object.keys(e.categories);n.throwExceptionIf(e,n.not(t.length),"must define at least one category."),t.forEach((t=>{const o=e.categories[t];n.throwExceptionIf(e,[n.not(o.appenders),n.not(o.level)],`category "${t}" is not valid (must be an object with properties "appenders" and "level")`),n.throwExceptionIf(e,n.not(Array.isArray(o.appenders)),`category "${t}" is not valid (appenders must be an array of appender names)`),n.throwExceptionIf(e,n.not(o.appenders.length),`category "${t}" is not valid (appenders must contain at least one appender name)`),Object.prototype.hasOwnProperty.call(o,"enableCallStack")&&n.throwExceptionIf(e,"boolean"!=typeof o.enableCallStack,`category "${t}" is not valid (enableCallStack must be boolean type)`),o.appenders.forEach((r=>{n.throwExceptionIf(e,n.not(u.get(r)),`category "${t}" is not valid (appender "${r}" is not defined)`)})),n.throwExceptionIf(e,n.not(r.getLevel(o.level)),`category "${t}" is not valid (level "${o.level}" not recognised; valid levels are ${r.levels.join(", ")})`)})),n.throwExceptionIf(e,n.not(e.categories.default),'must define a "default" category.')}));const c=e=>{o.clear();Object.keys(e.categories).forEach((n=>{const i=e.categories[n],s=[];i.appenders.forEach((e=>{s.push(u.get(e)),t(`Creating category ${n}`),o.set(n,{appenders:s,level:r.getLevel(i.level),enableCallStack:i.enableCallStack||!1})}))}))},a=()=>{c({categories:{default:{appenders:["out"],level:"OFF"}}})};a(),n.addListener(c);const l=e=>(t(`configForCategory: searching for config for ${e}`),o.has(e)?(t(`configForCategory: ${e} exists in config, returning it`),o.get(e)):e.indexOf(".")>0?(t(`configForCategory: ${e} has hierarchy, searching for parents`),l(e.substring(0,e.lastIndexOf(".")))):(t("configForCategory: returning config for default category"),l("default")));e.exports=o,e.exports=Object.assign(e.exports,{appendersForCategory:e=>l(e).appenders,getLevelForCategory:e=>l(e).level,setLevelForCategory:(e,n)=>{let r=o.get(e);if(t(`setLevelForCategory: found ${r} for ${e}`),!r){const n=l(e);t(`setLevelForCategory: no config found for category, found ${n} for parents of ${e}`),r={appenders:n.appenders}}r.level=n,o.set(e,r)},getEnableCallStackForCategory:e=>!0===l(e).enableCallStack,setEnableCallStackForCategory:(e,t)=>{l(e).enableCallStack=t},init:a})}(wa);const Oa=Nr.exports("log4js:logger"),ba=Hu,_a=gu,Ba=eo,Pa=wa.exports,ka=tu,xa=/at (?:(.+)\s+\()?(?:(.+?):(\d+)(?::(\d+))?|([^)]+))\)?/;function Na(e,t=4){const n=e.stack.split("\n").slice(t),r=xa.exec(n[0]);return r&&6===r.length?{functionName:r[1],fileName:r[2],lineNumber:parseInt(r[3],10),columnNumber:parseInt(r[4],10),callStack:n.join("\n")}:null}class Ia{constructor(e){if(!e)throw new Error("No category provided.");this.category=e,this.context={},this.parseCallStack=Na,Oa(`Logger created (${this.category}, ${this.level})`)}get level(){return _a.getLevel(Pa.getLevelForCategory(this.category),_a.TRACE)}set level(e){Pa.setLevelForCategory(this.category,_a.getLevel(e,this.level))}get useCallStack(){return Pa.getEnableCallStackForCategory(this.category)}set useCallStack(e){Pa.setEnableCallStackForCategory(this.category,!0===e)}log(e,...t){let n=_a.getLevel(e);n||(this._log(_a.WARN,"log4js:logger.log: invalid value for log-level as first parameter given: ",e),n=_a.INFO),this.isLevelEnabled(n)&&this._log(n,t)}isLevelEnabled(e){return this.level.isLessThanOrEqualTo(e)}_log(e,t){Oa(`sending log data (${e}) to appenders`);const n=new ba(this.category,e,t,this.context,this.useCallStack&&this.parseCallStack(new Error));Ba.send(n)}addContext(e,t){this.context[e]=t}removeContext(e){delete this.context[e]}clearContext(){this.context={}}setParseCallStackFunction(e){this.parseCallStack=e}}function Ta(e){const t=_a.getLevel(e),n=t.toString().toLowerCase().replace(/_([a-z])/g,(e=>e[1].toUpperCase())),r=n[0].toUpperCase()+n.slice(1);Ia.prototype[`is${r}Enabled`]=function(){return this.isLevelEnabled(t)},Ia.prototype[n]=function(...e){this.log(t,...e)}}_a.levels.forEach(Ta),ka.addListener((()=>{_a.levels.forEach(Ta)}));var Ra=Ia;const Ma=gu;function La(e){return e.originalUrl||e.url}function ja(e,t){for(let n=0;ne.source?e.source:e));t=new RegExp(n.join("|"))}return t}(t.nolog);return(e,i,s)=>{if(e._logging)return s();if(o&&o.test(e.originalUrl))return s();if(n.isLevelEnabled(r)||"auto"===t.level){const o=new Date,{writeHead:s}=i;e._logging=!0,i.writeHead=(e,t)=>{i.writeHead=s,i.writeHead(e,t),i.__statusCode=e,i.__headers=t||{}},i.on("finish",(()=>{i.responseTime=new Date-o,i.statusCode&&"auto"===t.level&&(r=Ma.INFO,i.statusCode>=300&&(r=Ma.WARN),i.statusCode>=400&&(r=Ma.ERROR)),r=function(e,t,n){let r=t;if(n){const t=n.find((t=>{let n=!1;return n=t.from&&t.to?e>=t.from&&e<=t.to:-1!==t.codes.indexOf(e),n}));t&&(r=Ma.getLevel(t.level,r))}return r}(i.statusCode,r,t.statusRules);const s=function(e,t,n){const r=[];return r.push({token:":url",replacement:La(e)}),r.push({token:":protocol",replacement:e.protocol}),r.push({token:":hostname",replacement:e.hostname}),r.push({token:":method",replacement:e.method}),r.push({token:":status",replacement:t.__statusCode||t.statusCode}),r.push({token:":response-time",replacement:t.responseTime}),r.push({token:":date",replacement:(new Date).toUTCString()}),r.push({token:":referrer",replacement:e.headers.referer||e.headers.referrer||""}),r.push({token:":http-version",replacement:`${e.httpVersionMajor}.${e.httpVersionMinor}`}),r.push({token:":remote-addr",replacement:e.headers["x-forwarded-for"]||e.ip||e._remoteAddress||e.socket&&(e.socket.remoteAddress||e.socket.socket&&e.socket.socket.remoteAddress)}),r.push({token:":user-agent",replacement:e.headers["user-agent"]}),r.push({token:":content-length",replacement:t.getHeader("content-length")||t.__headers&&t.__headers["Content-Length"]||"-"}),r.push({token:/:req\[([^\]]+)]/g,replacement:(t,n)=>e.headers[n.toLowerCase()]}),r.push({token:/:res\[([^\]]+)]/g,replacement:(e,n)=>t.getHeader(n.toLowerCase())||t.__headers&&t.__headers[n]}),(e=>{const t=e.concat();for(let e=0;eja(e,s)));t&&n.log(r,t)}else n.log(r,ja(u,s));t.context&&n.removeContext("res")}))}return s()}},nl=Va;let rl=!1;function ul(e){if(!rl)return;Ua("Received log event ",e);Za.appendersForCategory(e.categoryName).forEach((t=>{t(e)}))}function ol(e){rl&&il();let t=e;return"string"==typeof t&&(t=function(e){Ua(`Loading configuration from ${e}`);try{return JSON.parse(Wa.readFileSync(e,"utf8"))}catch(t){throw new Error(`Problem reading config from file "${e}". Error was ${t.message}`,t)}}(e)),Ua(`Configuration is ${t}`),Ka.configure(za(t)),el.onMessage(ul),rl=!0,sl}function il(e){Ua("Shutdown called. Disabling all log writing."),rl=!1;const t=Array.from(Xa.values());Xa.init(),Za.init();const n=t.reduceRight(((e,t)=>t.shutdown?e+1:e),0);if(0===n)return Ua("No appenders with shutdown functions found."),void 0!==e&&e();let r,u=0;function o(t){r=r||t,u+=1,Ua(`Appender shutdowns complete: ${u} / ${n}`),u>=n&&(Ua("All shutdown functions completed."),e&&e(r))}return Ua(`Found ${n} appenders with shutdown functions.`),t.filter((e=>e.shutdown)).forEach((e=>e.shutdown(o))),null}const sl={getLogger:function(e){return rl||ol(process.env.LOG4JS_CONFIG||{appenders:{out:{type:"stdout"}},categories:{default:{appenders:["out"],level:"OFF"}}}),new Qa(e||"default")},configure:ol,shutdown:il,connectLogger:tl,levels:Ya,addLayout:qa.addLayout,recording:function(){return nl}};var cl=sl,al={};Object.defineProperty(al,"__esModule",{value:!0}),al.levelMap=al.getLevel=al.setCategoriesLevel=al.getConfiguration=al.setConfiguration=void 0;const ll=cl;let fl={appenders:{debug:{type:"stdout",layout:{type:"pattern",pattern:"[%d] > hvigor %p %c %[%m%]"}},info:{type:"stdout",layout:{type:"pattern",pattern:"[%d] > hvigor %[%m%]"}},"no-pattern-info":{type:"stdout",layout:{type:"pattern",pattern:"%m"}},wrong:{type:"stderr",layout:{type:"pattern",pattern:"[%d] > hvigor %[%p: %m%]"}},"just-debug":{type:"logLevelFilter",appender:"debug",level:"debug",maxLevel:"debug"},"just-info":{type:"logLevelFilter",appender:"info",level:"info",maxLevel:"info"},"just-wrong":{type:"logLevelFilter",appender:"wrong",level:"warn",maxLevel:"error"}},categories:{default:{appenders:["just-debug","just-info","just-wrong"],level:"debug"},"no-pattern-info":{appenders:["no-pattern-info"],level:"info"}}};al.setConfiguration=e=>{fl=e};al.getConfiguration=()=>fl;let dl=ll.levels.DEBUG;al.setCategoriesLevel=(e,t)=>{dl=e;const n=fl.categories;for(const r in n)(null==t?void 0:t.includes(r))||Object.prototype.hasOwnProperty.call(n,r)&&(n[r].level=e.levelStr)};al.getLevel=()=>dl,al.levelMap=new Map([["ALL",ll.levels.ALL],["MARK",ll.levels.MARK],["TRACE",ll.levels.TRACE],["DEBUG",ll.levels.DEBUG],["INFO",ll.levels.INFO],["WARN",ll.levels.WARN],["ERROR",ll.levels.ERROR],["FATAL",ll.levels.FATAL],["OFF",ll.levels.OFF]]);var Dl=w&&w.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),pl=w&&w.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),El=w&&w.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&Dl(t,e,n);return pl(t,e),t};Object.defineProperty(xr,"__esModule",{value:!0}),xr.evaluateLogLevel=xr.HvigorLogger=void 0;const ml=El(cl),hl=cl,yl=El(F.default),Cl=al;class Fl{constructor(e){ml.configure((0,Cl.getConfiguration)()),this._logger=ml.getLogger(e),this._logger.level=(0,Cl.getLevel)()}static getLogger(e){return new Fl(e)}log(e,...t){this._logger.log(e,...t)}debug(e,...t){this._logger.debug(e,...t)}info(e,...t){this._logger.info(e,...t)}warn(e,...t){void 0!==e&&""!==e&&this._logger.warn(e,...t)}error(e,...t){this._logger.error(e,...t)}_printTaskExecuteInfo(e,t){this.info(`Finished :${e}... after ${t}`)}_printFailedTaskInfo(e){this.error(`Failed :${e}... `)}_printDisabledTaskInfo(e){this.info(`Disabled :${e}... `)}_printUpToDateTaskInfo(e){this.info(`UP-TO-DATE :${e}... `)}errorMessageExit(e,...t){throw new Error(yl.format(e,...t))}errorExit(e,t,...n){t&&this._logger.error(t,n),this._logger.error(e.stack)}setLevel(e,t){(0,Cl.setCategoriesLevel)(e,t),ml.shutdown(),ml.configure((0,Cl.getConfiguration)())}getLevel(){return this._logger.level}configure(e){const t=(0,Cl.getConfiguration)(),n={appenders:{...t.appenders,...e.appenders},categories:{...t.categories,...e.categories}};(0,Cl.setConfiguration)(n),ml.shutdown(),ml.configure(n)}}xr.HvigorLogger=Fl,xr.evaluateLogLevel=function(e,t){t.debug?e.setLevel(hl.levels.DEBUG):t.warn?e.setLevel(hl.levels.WARN):t.error?e.setLevel(hl.levels.ERROR):e.setLevel(hl.levels.INFO)};var gl=w&&w.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(X,"__esModule",{value:!0}),X.parseJsonText=X.parseJsonFile=void 0;const Al=Z,vl=gl(kr),Sl=gl(p.default),wl=gl(E.default),Ol=xr.HvigorLogger.getLogger("parse-json-util");var bl;!function(e){e[e.Char=0]="Char",e[e.EOF=1]="EOF",e[e.Identifier=2]="Identifier"}(bl||(bl={}));let _l,Bl,Pl,kl,xl,Nl,Il="start",Tl=[],Rl=0,Ml=1,Ll=0,jl=!1,$l="default",Hl="'",Jl=1;function Gl(e,t=!1){Bl=String(e),Il="start",Tl=[],Rl=0,Ml=1,Ll=0,kl=void 0,jl=t;do{_l=Vl(),Xl[Il]()}while("eof"!==_l.type);return kl}function Vl(){for($l="default",xl="",Hl="'",Jl=1;;){Nl=Ul();const e=zl[$l]();if(e)return e}}function Ul(){if(Bl[Rl])return String.fromCodePoint(Bl.codePointAt(Rl))}function Wl(){const e=Ul();return"\n"===e?(Ml++,Ll=0):e?Ll+=e.length:Ll++,e&&(Rl+=e.length),e}X.parseJsonFile=function(e,t=!1,n="utf-8"){const r=vl.default.readFileSync(Sl.default.resolve(e),{encoding:n});try{return Gl(r,t)}catch(t){if(t instanceof SyntaxError){const n=t.message.split("at");2===n.length&&Ol.errorMessageExit(`${n[0].trim()}${wl.default.EOL}\t at ${e}:${n[1].trim()}`)}Ol.errorMessageExit(`${e} is not in valid JSON/JSON5 format.`)}},X.parseJsonText=Gl;const zl={default(){switch(Nl){case"/":return Wl(),void($l="comment");case void 0:return Wl(),Kl("eof")}if(!Al.JudgeUtil.isIgnoreChar(Nl)&&!Al.JudgeUtil.isSpaceSeparator(Nl))return zl[Il]();Wl()},start(){$l="value"},beforePropertyName(){switch(Nl){case"$":case"_":return xl=Wl(),void($l="identifierName");case"\\":return Wl(),void($l="identifierNameStartEscape");case"}":return Kl("punctuator",Wl());case'"':case"'":return Hl=Nl,Wl(),void($l="string")}if(Al.JudgeUtil.isIdStartChar(Nl))return xl+=Wl(),void($l="identifierName");throw tf(bl.Char,Wl())},afterPropertyName(){if(":"===Nl)return Kl("punctuator",Wl());throw tf(bl.Char,Wl())},beforePropertyValue(){$l="value"},afterPropertyValue(){switch(Nl){case",":case"}":return Kl("punctuator",Wl())}throw tf(bl.Char,Wl())},beforeArrayValue(){if("]"===Nl)return Kl("punctuator",Wl());$l="value"},afterArrayValue(){switch(Nl){case",":case"]":return Kl("punctuator",Wl())}throw tf(bl.Char,Wl())},end(){throw tf(bl.Char,Wl())},comment(){switch(Nl){case"*":return Wl(),void($l="multiLineComment");case"/":return Wl(),void($l="singleLineComment")}throw tf(bl.Char,Wl())},multiLineComment(){switch(Nl){case"*":return Wl(),void($l="multiLineCommentAsterisk");case void 0:throw tf(bl.Char,Wl())}Wl()},multiLineCommentAsterisk(){switch(Nl){case"*":return void Wl();case"/":return Wl(),void($l="default");case void 0:throw tf(bl.Char,Wl())}Wl(),$l="multiLineComment"},singleLineComment(){switch(Nl){case"\n":case"\r":case"\u2028":case"\u2029":return Wl(),void($l="default");case void 0:return Wl(),Kl("eof")}Wl()},value(){switch(Nl){case"{":case"[":return Kl("punctuator",Wl());case"n":return Wl(),ql("ull"),Kl("null",null);case"t":return Wl(),ql("rue"),Kl("boolean",!0);case"f":return Wl(),ql("alse"),Kl("boolean",!1);case"-":case"+":return"-"===Wl()&&(Jl=-1),void($l="numerical");case".":case"0":case"I":case"N":return void($l="numerical");case'"':case"'":return Hl=Nl,Wl(),xl="",void($l="string")}if(void 0===Nl||!Al.JudgeUtil.isDigitWithoutZero(Nl))throw tf(bl.Char,Wl());$l="numerical"},numerical(){switch(Nl){case".":return xl=Wl(),void($l="decimalPointLeading");case"0":return xl=Wl(),void($l="zero");case"I":return Wl(),ql("nfinity"),Kl("numeric",Jl*(1/0));case"N":return Wl(),ql("aN"),Kl("numeric",NaN)}if(void 0!==Nl&&Al.JudgeUtil.isDigitWithoutZero(Nl))return xl=Wl(),void($l="decimalInteger");throw tf(bl.Char,Wl())},zero(){switch(Nl){case".":case"e":case"E":return void($l="decimal");case"x":case"X":return xl+=Wl(),void($l="hexadecimal")}return Kl("numeric",0)},decimalInteger(){switch(Nl){case".":case"e":case"E":return void($l="decimal")}if(!Al.JudgeUtil.isDigit(Nl))return Kl("numeric",Jl*Number(xl));xl+=Wl()},decimal(){switch(Nl){case".":xl+=Wl(),$l="decimalFraction";break;case"e":case"E":xl+=Wl(),$l="decimalExponent"}},decimalPointLeading(){if(Al.JudgeUtil.isDigit(Nl))return xl+=Wl(),void($l="decimalFraction");throw tf(bl.Char,Wl())},decimalFraction(){switch(Nl){case"e":case"E":return xl+=Wl(),void($l="decimalExponent")}if(!Al.JudgeUtil.isDigit(Nl))return Kl("numeric",Jl*Number(xl));xl+=Wl()},decimalExponent(){switch(Nl){case"+":case"-":return xl+=Wl(),void($l="decimalExponentSign")}if(Al.JudgeUtil.isDigit(Nl))return xl+=Wl(),void($l="decimalExponentInteger");throw tf(bl.Char,Wl())},decimalExponentSign(){if(Al.JudgeUtil.isDigit(Nl))return xl+=Wl(),void($l="decimalExponentInteger");throw tf(bl.Char,Wl())},decimalExponentInteger(){if(!Al.JudgeUtil.isDigit(Nl))return Kl("numeric",Jl*Number(xl));xl+=Wl()},hexadecimal(){if(Al.JudgeUtil.isHexDigit(Nl))return xl+=Wl(),void($l="hexadecimalInteger");throw tf(bl.Char,Wl())},hexadecimalInteger(){if(!Al.JudgeUtil.isHexDigit(Nl))return Kl("numeric",Jl*Number(xl));xl+=Wl()},identifierNameStartEscape(){if("u"!==Nl)throw tf(bl.Char,Wl());Wl();const e=Yl();switch(e){case"$":case"_":break;default:if(!Al.JudgeUtil.isIdStartChar(e))throw tf(bl.Identifier)}xl+=e,$l="identifierName"},identifierName(){switch(Nl){case"$":case"_":case"‌":case"‍":return void(xl+=Wl());case"\\":return Wl(),void($l="identifierNameEscape")}if(!Al.JudgeUtil.isIdContinueChar(Nl))return Kl("identifier",xl);xl+=Wl()},identifierNameEscape(){if("u"!==Nl)throw tf(bl.Char,Wl());Wl();const e=Yl();switch(e){case"$":case"_":case"‌":case"‍":break;default:if(!Al.JudgeUtil.isIdContinueChar(e))throw tf(bl.Identifier)}xl+=e,$l="identifierName"},string(){switch(Nl){case"\\":return Wl(),void(xl+=function(){const e=Ul(),t=function(){switch(Ul()){case"b":return Wl(),"\b";case"f":return Wl(),"\f";case"n":return Wl(),"\n";case"r":return Wl(),"\r";case"t":return Wl(),"\t";case"v":return Wl(),"\v"}return}();if(t)return t;switch(e){case"0":if(Wl(),Al.JudgeUtil.isDigit(Ul()))throw tf(bl.Char,Wl());return"\0";case"x":return Wl(),function(){let e="",t=Ul();if(!Al.JudgeUtil.isHexDigit(t))throw tf(bl.Char,Wl());if(e+=Wl(),t=Ul(),!Al.JudgeUtil.isHexDigit(t))throw tf(bl.Char,Wl());return e+=Wl(),String.fromCodePoint(parseInt(e,16))}();case"u":return Wl(),Yl();case"\n":case"\u2028":case"\u2029":return Wl(),"";case"\r":return Wl(),"\n"===Ul()&&Wl(),""}if(void 0===e||Al.JudgeUtil.isDigitWithoutZero(e))throw tf(bl.Char,Wl());return Wl()}());case'"':case"'":if(Nl===Hl){const e=Kl("string",xl);return Wl(),e}return void(xl+=Wl());case"\n":case"\r":case void 0:throw tf(bl.Char,Wl());case"\u2028":case"\u2029":!function(e){Ol.warn(`JSON5: '${ef(e)}' in strings is not valid ECMAScript; consider escaping.`)}(Nl)}xl+=Wl()}};function Kl(e,t){return{type:e,value:t,line:Ml,column:Ll}}function ql(e){for(const t of e){if(Ul()!==t)throw tf(bl.Char,Wl());Wl()}}function Yl(){let e="",t=4;for(;t-- >0;){const t=Ul();if(!Al.JudgeUtil.isHexDigit(t))throw tf(bl.Char,Wl());e+=Wl()}return String.fromCodePoint(parseInt(e,16))}const Xl={start(){if("eof"===_l.type)throw tf(bl.EOF);Zl()},beforePropertyName(){switch(_l.type){case"identifier":case"string":return Pl=_l.value,void(Il="afterPropertyName");case"punctuator":return void Ql();case"eof":throw tf(bl.EOF)}},afterPropertyName(){if("eof"===_l.type)throw tf(bl.EOF);Il="beforePropertyValue"},beforePropertyValue(){if("eof"===_l.type)throw tf(bl.EOF);Zl()},afterPropertyValue(){if("eof"===_l.type)throw tf(bl.EOF);switch(_l.value){case",":return void(Il="beforePropertyName");case"}":Ql()}},beforeArrayValue(){if("eof"===_l.type)throw tf(bl.EOF);"punctuator"!==_l.type||"]"!==_l.value?Zl():Ql()},afterArrayValue(){if("eof"===_l.type)throw tf(bl.EOF);switch(_l.value){case",":return void(Il="beforeArrayValue");case"]":Ql()}},end(){}};function Zl(){const e=function(){let e;switch(_l.type){case"punctuator":switch(_l.value){case"{":e={};break;case"[":e=[]}break;case"null":case"boolean":case"numeric":case"string":e=_l.value}return e}();if(jl&&"object"==typeof e&&(e._line=Ml,e._column=Ll),void 0===kl)kl=e;else{const t=Tl[Tl.length-1];Array.isArray(t)?jl&&"object"!=typeof e?t.push({value:e,_line:Ml,_column:Ll}):t.push(e):t[Pl]=jl&&"object"!=typeof e?{value:e,_line:Ml,_column:Ll}:e}!function(e){if(e&&"object"==typeof e)Tl.push(e),Il=Array.isArray(e)?"beforeArrayValue":"beforePropertyName";else{const e=Tl[Tl.length-1];Il=e?Array.isArray(e)?"afterArrayValue":"afterPropertyValue":"end"}}(e)}function Ql(){Tl.pop();const e=Tl[Tl.length-1];Il=e?Array.isArray(e)?"afterArrayValue":"afterPropertyValue":"end"}function ef(e){const t={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(t[e])return t[e];if(e<" "){const t=e.charCodeAt(0).toString(16);return`\\x${`00${t}`.substring(t.length)}`}return e}function tf(e,t){let n="";switch(e){case bl.Char:n=void 0===t?`JSON5: invalid end of input at ${Ml}:${Ll}`:`JSON5: invalid character '${ef(t)}' at ${Ml}:${Ll}`;break;case bl.EOF:n=`JSON5: invalid end of input at ${Ml}:${Ll}`;break;case bl.Identifier:Ll-=5,n=`JSON5: invalid identifier character at ${Ml}:${Ll}`}const r=new nf(n);return r.lineNumber=Ml,r.columnNumber=Ll,r}class nf extends SyntaxError{}var rf=w&&w.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),uf=w&&w.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),of=w&&w.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&rf(t,e,n);return uf(t,e),t};Object.defineProperty(Y,"__esModule",{value:!0});var sf=Y.cleanWorkSpace=Ff=Y.executeInstallHvigor=yf=Y.isHvigorInstalled=mf=Y.isAllDependenciesInstalled=void 0;const cf=of(D.default),af=of(p.default),lf=b,ff=j,df=$,Df=X;let pf,Ef;var mf=Y.isAllDependenciesInstalled=function(){function e(e){const t=null==e?void 0:e.dependencies;return void 0===t?0:Object.getOwnPropertyNames(t).length}if(pf=gf(),Ef=Af(),e(pf)+1!==e(Ef))return!1;for(const e in null==pf?void 0:pf.dependencies)if(!(0,ff.hasNpmPackInPaths)(e,[lf.HVIGOR_PROJECT_DEPENDENCIES_HOME])||!hf(e,pf,Ef))return!1;return!0};function hf(e,t,n){return void 0!==n.dependencies&&(0,ff.offlinePluginConversion)(lf.HVIGOR_PROJECT_ROOT_DIR,t.dependencies[e])===n.dependencies[e]}var yf=Y.isHvigorInstalled=function(){return pf=gf(),Ef=Af(),(0,ff.hasNpmPackInPaths)(lf.HVIGOR_ENGINE_PACKAGE_NAME,[lf.HVIGOR_PROJECT_DEPENDENCIES_HOME])&&(0,ff.offlinePluginConversion)(lf.HVIGOR_PROJECT_ROOT_DIR,pf.hvigorVersion)===Ef.dependencies[lf.HVIGOR_ENGINE_PACKAGE_NAME]};const Cf={cwd:lf.HVIGOR_PROJECT_DEPENDENCIES_HOME,stdio:["inherit","inherit","inherit"]};var Ff=Y.executeInstallHvigor=function(){(0,df.logInfoPrintConsole)("Hvigor installing...");const e={dependencies:{}};e.dependencies[lf.HVIGOR_ENGINE_PACKAGE_NAME]=(0,ff.offlinePluginConversion)(lf.HVIGOR_PROJECT_ROOT_DIR,pf.hvigorVersion);try{cf.mkdirSync(lf.HVIGOR_PROJECT_DEPENDENCIES_HOME,{recursive:!0});const t=af.resolve(lf.HVIGOR_PROJECT_DEPENDENCIES_HOME,lf.DEFAULT_PACKAGE_JSON);cf.writeFileSync(t,JSON.stringify(e))}catch(e){(0,df.logErrorAndExit)(e)}!function(){const e=["config","set","store-dir",lf.HVIGOR_PNPM_STORE_PATH];(0,ff.executeCommand)(lf.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,e,Cf)}(),(0,ff.executeCommand)(lf.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,["install"],Cf)};function gf(){const e=af.resolve(lf.HVIGOR_PROJECT_WRAPPER_HOME,lf.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME);return cf.existsSync(e)||(0,df.logErrorAndExit)(`Error: Hvigor config file ${e} does not exist.`),(0,Df.parseJsonFile)(e)}function Af(){return cf.existsSync(lf.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH)?(0,Df.parseJsonFile)(lf.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH):{dependencies:{}}}sf=Y.cleanWorkSpace=function(){if((0,df.logInfoPrintConsole)("Hvigor cleaning..."),!cf.existsSync(lf.HVIGOR_PROJECT_DEPENDENCIES_HOME))return;const e=cf.readdirSync(lf.HVIGOR_PROJECT_DEPENDENCIES_HOME);if(e&&0!==e.length){cf.existsSync(lf.HVIGOR_BOOT_JS_FILE_PATH)&&(0,ff.executeCommand)(process.argv[0],[lf.HVIGOR_BOOT_JS_FILE_PATH,"--stop-daemon"],{});try{e.forEach((e=>{cf.rmSync(af.resolve(lf.HVIGOR_PROJECT_DEPENDENCIES_HOME,e),{recursive:!0})}))}catch(e){(0,df.logErrorAndExit)(`The hvigor build tool cannot be installed. Please manually clear the workspace directory and synchronize the project again.\n\n Workspace Path: ${lf.HVIGOR_PROJECT_DEPENDENCIES_HOME}.`)}}};var vf={},Sf=w&&w.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),wf=w&&w.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Of=w&&w.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&Sf(t,e,n);return wf(t,e),t};Object.defineProperty(vf,"__esModule",{value:!0});var bf=vf.executeBuild=void 0;const _f=b,Bf=Of(D.default),Pf=Of(p.default),kf=$;bf=vf.executeBuild=function(){const e=Pf.resolve(_f.HVIGOR_PROJECT_DEPENDENCIES_HOME,"node_modules","@ohos","hvigor","bin","hvigor.js");try{const t=Bf.realpathSync(e);require(t)}catch(t){(0,kf.logErrorAndExit)(`Error: ENOENT: no such file ${e},delete ${_f.HVIGOR_PROJECT_DEPENDENCIES_HOME} and retry.`)}},function(){if(O.checkNpmConifg(),O.environmentHandler(),O.isPnpmAvailable()||O.executeInstallPnpm(),yf()&&mf())bf();else{sf();try{Ff()}catch(e){return void sf()}bf()}}(); \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/factory/hvigorfile.ts b/unionpi_tiger/sample_api10/app/factory/hvigorfile.ts deleted file mode 100644 index 64781869..00000000 --- a/unionpi_tiger/sample_api10/app/factory/hvigorfile.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. -export { appTasks } from '@ohos/hvigor-ohos-plugin'; \ No newline at end of file diff --git a/unionpi_tiger/sample_api10/app/factory/hvigorw b/unionpi_tiger/sample_api10/app/factory/hvigorw deleted file mode 100644 index 54aadd22..00000000 --- a/unionpi_tiger/sample_api10/app/factory/hvigorw +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash - -# ---------------------------------------------------------------------------- -# Hvigor startup script, version 1.0.0 -# -# Required ENV vars: -# ------------------ -# NODE_HOME - location of a Node home dir -# or -# Add /usr/local/nodejs/bin to the PATH environment variable -# ---------------------------------------------------------------------------- - -HVIGOR_APP_HOME=$(dirname $(readlink -f $0)) -HVIGOR_WRAPPER_SCRIPT=${HVIGOR_APP_HOME}/hvigor/hvigor-wrapper.js -warn() { - echo "" - echo -e "\033[1;33m`date '+[%Y-%m-%d %H:%M:%S]'`$@\033[0m" -} - -error() { - echo "" - echo -e "\033[1;31m`date '+[%Y-%m-%d %H:%M:%S]'`$@\033[0m" -} - -fail() { - error "$@" - exit 1 -} - -# Determine node to start hvigor wrapper script -if [ -n "${NODE_HOME}" ];then - EXECUTABLE_NODE="${NODE_HOME}/bin/node" - if [ ! -x "$EXECUTABLE_NODE" ];then - fail "ERROR: NODE_HOME is set to an invalid directory,check $NODE_HOME\n\nPlease set NODE_HOME in your environment to the location where your nodejs installed" - fi -else - EXECUTABLE_NODE="node" - which ${EXECUTABLE_NODE} > /dev/null 2>&1 || fail "ERROR: NODE_HOME is not set and not 'node' command found in your path" -fi - -# Check hvigor wrapper script -if [ ! -r "$HVIGOR_WRAPPER_SCRIPT" ];then - fail "ERROR: Couldn't find hvigor/hvigor-wrapper.js in ${HVIGOR_APP_HOME}" -fi - -# start hvigor-wrapper script -exec "${EXECUTABLE_NODE}" \ - "${HVIGOR_WRAPPER_SCRIPT}" "$@" diff --git a/unionpi_tiger/sample_api10/app/factory/hvigorw.bat b/unionpi_tiger/sample_api10/app/factory/hvigorw.bat deleted file mode 100644 index 6861293e..00000000 --- a/unionpi_tiger/sample_api10/app/factory/hvigorw.bat +++ /dev/null @@ -1,64 +0,0 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Hvigor startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -set WRAPPER_MODULE_PATH=%APP_HOME%\hvigor\hvigor-wrapper.js -set NODE_EXE=node.exe - -goto start - -:start -@rem Find node.exe -if defined NODE_HOME goto findNodeFromNodeHome - -%NODE_EXE% --version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute - -echo. -echo ERROR: NODE_HOME is not set and no 'node' command could be found in your PATH. -echo. -echo Please set the NODE_HOME variable in your environment to match the -echo location of your NodeJs installation. - -goto fail - -:findNodeFromNodeHome -set NODE_HOME=%NODE_HOME:"=% -set NODE_EXE_PATH=%NODE_HOME%/%NODE_EXE% - -if exist "%NODE_EXE_PATH%" goto execute -echo. -echo ERROR: NODE_HOME is not set and no 'node' command could be found in your PATH. -echo. -echo Please set the NODE_HOME variable in your environment to match the -echo location of your NodeJs installation. - -goto fail - -:execute -@rem Execute hvigor -"%NODE_EXE%" %WRAPPER_MODULE_PATH% %* - -if "%ERRORLEVEL%" == "0" goto hvigorwEnd - -:fail -exit /b 1 - -:hvigorwEnd -if "%OS%" == "Windows_NT" endlocal - -:end diff --git a/unionpi_tiger/sample_api10/app/factory/oh-package.json5 b/unionpi_tiger/sample_api10/app/factory/oh-package.json5 deleted file mode 100644 index 92c2a01e..00000000 --- a/unionpi_tiger/sample_api10/app/factory/oh-package.json5 +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -{ - "license": "", - "devDependencies": { - "@ohos/hypium": "1.0.6" - }, - "author": "", - "name": "factory", - "description": "Please describe the basic information.", - "main": "", - "version": "1.0.0", - "dependencies": {} -} diff --git a/unionpi_tiger/sample_hzu/.gitignore b/unionpi_tiger/sample_hzu/.gitignore deleted file mode 100644 index fbabf771..00000000 --- a/unionpi_tiger/sample_hzu/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -/node_modules -/oh_modules -/local.properties -/.idea -**/build -/.hvigor -.cxx -/.clangd -/.clang-format -/.clang-tidy -**/.test \ No newline at end of file diff --git a/unionpi_tiger/sample_hzu/AppScope/app.json5 b/unionpi_tiger/sample_hzu/AppScope/app.json5 deleted file mode 100644 index 48e99921..00000000 --- a/unionpi_tiger/sample_hzu/AppScope/app.json5 +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -{ - "app": { - "bundleName": "com.unionman.distributedvideoplayer", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name" - } -} diff --git a/unionpi_tiger/sample_hzu/AppScope/resources/base/element/string.json b/unionpi_tiger/sample_hzu/AppScope/resources/base/element/string.json deleted file mode 100644 index 09b6a700..00000000 --- a/unionpi_tiger/sample_hzu/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "DistributedVideoPlayer" - } - ] -} diff --git a/unionpi_tiger/sample_hzu/AppScope/resources/base/media/app_icon.png b/unionpi_tiger/sample_hzu/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index c394496f..00000000 Binary files a/unionpi_tiger/sample_hzu/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/unionpi_tiger/sample_hzu/build-profile.json5 b/unionpi_tiger/sample_hzu/build-profile.json5 deleted file mode 100644 index aa71995b..00000000 --- a/unionpi_tiger/sample_hzu/build-profile.json5 +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -{ - "app": { - "products": [ - { - "name": "default", - "signingConfig": "default", - "compileSdkVersion": 10, - "compatibleSdkVersion": 10, - "targetSdkVersion": 10, - "runtimeOS": "OpenHarmony" - } - ], - "buildModeSet": [ - { - "name": "debug" - }, - { - "name": "release" - } - ], - "signingConfigs": [] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/unionpi_tiger/sample_hzu/entry/.gitignore b/unionpi_tiger/sample_hzu/entry/.gitignore deleted file mode 100644 index e2713a27..00000000 --- a/unionpi_tiger/sample_hzu/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/unionpi_tiger/sample_hzu/entry/build-profile.json5 b/unionpi_tiger/sample_hzu/entry/build-profile.json5 deleted file mode 100644 index 6ee9f9ec..00000000 --- a/unionpi_tiger/sample_hzu/entry/build-profile.json5 +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -{ - "apiType": "stageMode", - "buildOption": { - "arkOptions": { - // "apPath": "./modules.ap" /* Profile used for profile-guided optimization (PGO), a compiler optimization technique to improve app runtime performance. */ - } - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": true, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/unionpi_tiger/sample_hzu/entry/hvigorfile.ts b/unionpi_tiger/sample_hzu/entry/hvigorfile.ts deleted file mode 100644 index c6edcd90..00000000 --- a/unionpi_tiger/sample_hzu/entry/hvigorfile.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { hapTasks } from '@ohos/hvigor-ohos-plugin'; - -export default { - system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ - plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ -} diff --git a/unionpi_tiger/sample_hzu/entry/obfuscation-rules.txt b/unionpi_tiger/sample_hzu/entry/obfuscation-rules.txt deleted file mode 100644 index 985b2aeb..00000000 --- a/unionpi_tiger/sample_hzu/entry/obfuscation-rules.txt +++ /dev/null @@ -1,18 +0,0 @@ -# Define project specific obfuscation rules here. -# You can include the obfuscation configuration files in the current module's build-profile.json5. -# -# For more details, see -# https://gitee.com/openharmony/arkcompiler_ets_frontend/blob/master/arkguard/README.md - -# Obfuscation options: -# -disable-obfuscation: disable all obfuscations -# -enable-property-obfuscation: obfuscate the property names -# -enable-toplevel-obfuscation: obfuscate the names in the global scope -# -compact: remove unnecessary blank spaces and all line feeds -# -remove-log: remove all console.* statements -# -print-namecache: print the name cache that contains the mapping from the old names to new names -# -apply-namecache: reuse the given cache file - -# Keep options: -# -keep-property-name: specifies property names that you want to keep -# -keep-global-name: specifies names that you want to keep in the global scope \ No newline at end of file diff --git a/unionpi_tiger/sample_hzu/entry/oh-package.json5 b/unionpi_tiger/sample_hzu/entry/oh-package.json5 deleted file mode 100644 index 225946cb..00000000 --- a/unionpi_tiger/sample_hzu/entry/oh-package.json5 +++ /dev/null @@ -1,10 +0,0 @@ -{ - "license": "", - "devDependencies": {}, - "author": "", - "name": "entry", - "description": "Please describe the basic information.", - "main": "", - "version": "1.0.0", - "dependencies": {} -} diff --git a/unionpi_tiger/sample_hzu/http-test/config.json b/unionpi_tiger/sample_hzu/http-test/config.json deleted file mode 100644 index 338bd035..00000000 --- a/unionpi_tiger/sample_hzu/http-test/config.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "requests" : [ - - ] -} \ No newline at end of file diff --git a/unionpi_tiger/sample_hzu/hvigor/hvigor-config.json5 b/unionpi_tiger/sample_hzu/hvigor/hvigor-config.json5 deleted file mode 100644 index 1a474900..00000000 --- a/unionpi_tiger/sample_hzu/hvigor/hvigor-config.json5 +++ /dev/null @@ -1,18 +0,0 @@ -{ - "hvigorVersion": "3.0.9", - "dependencies": { - "@ohos/hvigor-ohos-plugin": "3.0.9" - }, - "execution": { - // "daemon": true, /* Enable daemon compilation. Default: true */ - // "incremental": true, /* Enable incremental compilation. Default: true */ - // "parallel": true, /* Enable parallel compilation. Default: true */ - // "typeCheck": false, /* Enable typeCheck. Default: false */ - }, - "logging": { - // "level": "info" /* Define the log level. Value: [ "debug" | "info" | "warn" | "error" ]. Default: "info" */ - }, - "debugging": { - // "stacktrace": false /* Disable stacktrace compilation. Default: false */ - } -} diff --git a/unionpi_tiger/sample_hzu/hvigor/hvigor-wrapper.js b/unionpi_tiger/sample_hzu/hvigor/hvigor-wrapper.js deleted file mode 100644 index 372eae8e..00000000 --- a/unionpi_tiger/sample_hzu/hvigor/hvigor-wrapper.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";var u=require("path"),D=require("os"),e=require("fs"),t=require("crypto"),r=require("child_process"),n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},i={},C={},F=n&&n.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(C,"__esModule",{value:!0}),C.maxPathLength=C.isMac=C.isLinux=C.isWindows=void 0;const E=F(D),A="Windows_NT",o="Darwin";function a(){return E.default.type()===A}function c(){return E.default.type()===o}C.isWindows=a,C.isLinux=function(){return"Linux"===E.default.type()},C.isMac=c,C.maxPathLength=function(){return c()?1016:a()?259:4095},function(e){var t=n&&n.__createBinding||(Object.create?function(u,D,e,t){void 0===t&&(t=e);var r=Object.getOwnPropertyDescriptor(D,e);r&&!("get"in r?!D.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return D[e]}}),Object.defineProperty(u,t,r)}:function(u,D,e,t){void 0===t&&(t=e),u[t]=D[e]}),r=n&&n.__setModuleDefault||(Object.create?function(u,D){Object.defineProperty(u,"default",{enumerable:!0,value:D})}:function(u,D){u.default=D}),i=n&&n.__importStar||function(u){if(u&&u.__esModule)return u;var D={};if(null!=u)for(var e in u)"default"!==e&&Object.prototype.hasOwnProperty.call(u,e)&&t(D,u,e);return r(D,u),D};Object.defineProperty(e,"__esModule",{value:!0}),e.WORK_SPACE=e.HVIGOR_PROJECT_WRAPPER_HOME=e.HVIGOR_PROJECT_ROOT_DIR=e.HVIGOR_PROJECT_CACHES_HOME=e.HVIGOR_PNPM_STORE_PATH=e.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH=e.PROJECT_CACHES=e.HVIGOR_WRAPPER_TOOLS_HOME=e.HVIGOR_USER_HOME=e.DEFAULT_PACKAGE_JSON=e.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME=e.PNPM=e.HVIGOR=e.NPM_TOOL=e.PNPM_TOOL=e.HVIGOR_ENGINE_PACKAGE_NAME=void 0;const F=i(D),E=i(u),A=C;e.HVIGOR_ENGINE_PACKAGE_NAME="@ohos/hvigor",e.PNPM_TOOL=(0,A.isWindows)()?"pnpm.cmd":"pnpm",e.NPM_TOOL=(0,A.isWindows)()?"npm.cmd":"npm",e.HVIGOR="hvigor",e.PNPM="pnpm",e.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME="hvigor-config.json5",e.DEFAULT_PACKAGE_JSON="package.json",e.HVIGOR_USER_HOME=E.resolve(F.homedir(),".hvigor"),e.HVIGOR_WRAPPER_TOOLS_HOME=E.resolve(e.HVIGOR_USER_HOME,"wrapper","tools"),e.PROJECT_CACHES="project_caches",e.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH=E.resolve(e.HVIGOR_WRAPPER_TOOLS_HOME,"node_modules",".bin",e.PNPM_TOOL),e.HVIGOR_PNPM_STORE_PATH=E.resolve(e.HVIGOR_USER_HOME,"caches"),e.HVIGOR_PROJECT_CACHES_HOME=E.resolve(e.HVIGOR_USER_HOME,e.PROJECT_CACHES),e.HVIGOR_PROJECT_ROOT_DIR=process.cwd(),e.HVIGOR_PROJECT_WRAPPER_HOME=E.resolve(e.HVIGOR_PROJECT_ROOT_DIR,e.HVIGOR),e.WORK_SPACE="workspace"}(i);var s={},l={};Object.defineProperty(l,"__esModule",{value:!0}),l.logInfoPrintConsole=l.logErrorAndExit=void 0,l.logErrorAndExit=function(u){u instanceof Error?console.error(u.message):console.error(u),process.exit(-1)},l.logInfoPrintConsole=function(u){console.log(u)};var B=n&&n.__createBinding||(Object.create?function(u,D,e,t){void 0===t&&(t=e);var r=Object.getOwnPropertyDescriptor(D,e);r&&!("get"in r?!D.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return D[e]}}),Object.defineProperty(u,t,r)}:function(u,D,e,t){void 0===t&&(t=e),u[t]=D[e]}),d=n&&n.__setModuleDefault||(Object.create?function(u,D){Object.defineProperty(u,"default",{enumerable:!0,value:D})}:function(u,D){u.default=D}),f=n&&n.__importStar||function(u){if(u&&u.__esModule)return u;var D={};if(null!=u)for(var e in u)"default"!==e&&Object.prototype.hasOwnProperty.call(u,e)&&B(D,u,e);return d(D,u),D};Object.defineProperty(s,"__esModule",{value:!0});var _=s.executeBuild=void 0;const p=f(e),O=f(u),h=l;_=s.executeBuild=function(u){const D=O.resolve(u,"node_modules","@ohos","hvigor","bin","hvigor.js");try{const u=p.realpathSync(D);require(u)}catch(e){(0,h.logErrorAndExit)(`Error: ENOENT: no such file ${D},delete ${u} and retry.`)}};var P={},v={};!function(u){var D=n&&n.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(u,"__esModule",{value:!0}),u.hashFile=u.hash=u.createHash=void 0;const r=D(t),i=D(e);u.createHash=(u="MD5")=>r.default.createHash(u);u.hash=(D,e)=>(0,u.createHash)(e).update(D).digest("hex");u.hashFile=(D,e)=>{if(i.default.existsSync(D))return(0,u.hash)(i.default.readFileSync(D,"utf-8"),e)}}(v);var g={},m={},R={};Object.defineProperty(R,"__esModule",{value:!0}),R.Unicode=void 0;class y{}R.Unicode=y,y.SPACE_SEPARATOR=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,y.ID_START=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,y.ID_CONTINUE=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,Object.defineProperty(m,"__esModule",{value:!0}),m.JudgeUtil=void 0;const I=R;m.JudgeUtil=class{static isIgnoreChar(u){return"string"==typeof u&&("\t"===u||"\v"===u||"\f"===u||" "===u||" "===u||"\ufeff"===u||"\n"===u||"\r"===u||"\u2028"===u||"\u2029"===u)}static isSpaceSeparator(u){return"string"==typeof u&&I.Unicode.SPACE_SEPARATOR.test(u)}static isIdStartChar(u){return"string"==typeof u&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||"$"===u||"_"===u||I.Unicode.ID_START.test(u))}static isIdContinueChar(u){return"string"==typeof u&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||u>="0"&&u<="9"||"$"===u||"_"===u||"‌"===u||"‍"===u||I.Unicode.ID_CONTINUE.test(u))}static isDigitWithoutZero(u){return/[1-9]/.test(u)}static isDigit(u){return"string"==typeof u&&/[0-9]/.test(u)}static isHexDigit(u){return"string"==typeof u&&/[0-9A-Fa-f]/.test(u)}};var N=n&&n.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(g,"__esModule",{value:!0}),g.parseJsonText=g.parseJsonFile=void 0;const b=N(e),S=N(D),w=N(u),H=m;var x;!function(u){u[u.Char=0]="Char",u[u.EOF=1]="EOF",u[u.Identifier=2]="Identifier"}(x||(x={}));let M,T,V,G,j,J,W="start",U=[],L=0,$=1,k=0,K=!1,z="default",q="'",Z=1;function X(u,D=!1){T=String(u),W="start",U=[],L=0,$=1,k=0,G=void 0,K=D;do{M=Q(),nu[W]()}while("eof"!==M.type);return G}function Q(){for(z="default",j="",q="'",Z=1;;){J=Y();const u=Du[z]();if(u)return u}}function Y(){if(T[L])return String.fromCodePoint(T.codePointAt(L))}function uu(){const u=Y();return"\n"===u?($++,k=0):u?k+=u.length:k++,u&&(L+=u.length),u}g.parseJsonFile=function(u,D=!1,e="utf-8"){const t=b.default.readFileSync(w.default.resolve(u),{encoding:e});try{return X(t,D)}catch(D){if(D instanceof SyntaxError){const e=D.message.split("at");if(2===e.length)throw new Error(`${e[0].trim()}${S.default.EOL}\t at ${u}:${e[1].trim()}`)}throw new Error(`${u} is not in valid JSON/JSON5 format.`)}},g.parseJsonText=X;const Du={default(){switch(J){case"/":return uu(),void(z="comment");case void 0:return uu(),eu("eof")}if(!H.JudgeUtil.isIgnoreChar(J)&&!H.JudgeUtil.isSpaceSeparator(J))return Du[W]();uu()},start(){z="value"},beforePropertyName(){switch(J){case"$":case"_":return j=uu(),void(z="identifierName");case"\\":return uu(),void(z="identifierNameStartEscape");case"}":return eu("punctuator",uu());case'"':case"'":return q=J,uu(),void(z="string")}if(H.JudgeUtil.isIdStartChar(J))return j+=uu(),void(z="identifierName");throw Eu(x.Char,uu())},afterPropertyName(){if(":"===J)return eu("punctuator",uu());throw Eu(x.Char,uu())},beforePropertyValue(){z="value"},afterPropertyValue(){switch(J){case",":case"}":return eu("punctuator",uu())}throw Eu(x.Char,uu())},beforeArrayValue(){if("]"===J)return eu("punctuator",uu());z="value"},afterArrayValue(){switch(J){case",":case"]":return eu("punctuator",uu())}throw Eu(x.Char,uu())},end(){throw Eu(x.Char,uu())},comment(){switch(J){case"*":return uu(),void(z="multiLineComment");case"/":return uu(),void(z="singleLineComment")}throw Eu(x.Char,uu())},multiLineComment(){switch(J){case"*":return uu(),void(z="multiLineCommentAsterisk");case void 0:throw Eu(x.Char,uu())}uu()},multiLineCommentAsterisk(){switch(J){case"*":return void uu();case"/":return uu(),void(z="default");case void 0:throw Eu(x.Char,uu())}uu(),z="multiLineComment"},singleLineComment(){switch(J){case"\n":case"\r":case"\u2028":case"\u2029":return uu(),void(z="default");case void 0:return uu(),eu("eof")}uu()},value(){switch(J){case"{":case"[":return eu("punctuator",uu());case"n":return uu(),tu("ull"),eu("null",null);case"t":return uu(),tu("rue"),eu("boolean",!0);case"f":return uu(),tu("alse"),eu("boolean",!1);case"-":case"+":return"-"===uu()&&(Z=-1),void(z="numerical");case".":case"0":case"I":case"N":return void(z="numerical");case'"':case"'":return q=J,uu(),j="",void(z="string")}if(void 0===J||!H.JudgeUtil.isDigitWithoutZero(J))throw Eu(x.Char,uu());z="numerical"},numerical(){switch(J){case".":return j=uu(),void(z="decimalPointLeading");case"0":return j=uu(),void(z="zero");case"I":return uu(),tu("nfinity"),eu("numeric",Z*(1/0));case"N":return uu(),tu("aN"),eu("numeric",NaN)}if(void 0!==J&&H.JudgeUtil.isDigitWithoutZero(J))return j=uu(),void(z="decimalInteger");throw Eu(x.Char,uu())},zero(){switch(J){case".":case"e":case"E":return void(z="decimal");case"x":case"X":return j+=uu(),void(z="hexadecimal")}return eu("numeric",0)},decimalInteger(){switch(J){case".":case"e":case"E":return void(z="decimal")}if(!H.JudgeUtil.isDigit(J))return eu("numeric",Z*Number(j));j+=uu()},decimal(){switch(J){case".":j+=uu(),z="decimalFraction";break;case"e":case"E":j+=uu(),z="decimalExponent"}},decimalPointLeading(){if(H.JudgeUtil.isDigit(J))return j+=uu(),void(z="decimalFraction");throw Eu(x.Char,uu())},decimalFraction(){switch(J){case"e":case"E":return j+=uu(),void(z="decimalExponent")}if(!H.JudgeUtil.isDigit(J))return eu("numeric",Z*Number(j));j+=uu()},decimalExponent(){switch(J){case"+":case"-":return j+=uu(),void(z="decimalExponentSign")}if(H.JudgeUtil.isDigit(J))return j+=uu(),void(z="decimalExponentInteger");throw Eu(x.Char,uu())},decimalExponentSign(){if(H.JudgeUtil.isDigit(J))return j+=uu(),void(z="decimalExponentInteger");throw Eu(x.Char,uu())},decimalExponentInteger(){if(!H.JudgeUtil.isDigit(J))return eu("numeric",Z*Number(j));j+=uu()},hexadecimal(){if(H.JudgeUtil.isHexDigit(J))return j+=uu(),void(z="hexadecimalInteger");throw Eu(x.Char,uu())},hexadecimalInteger(){if(!H.JudgeUtil.isHexDigit(J))return eu("numeric",Z*Number(j));j+=uu()},identifierNameStartEscape(){if("u"!==J)throw Eu(x.Char,uu());uu();const u=ru();switch(u){case"$":case"_":break;default:if(!H.JudgeUtil.isIdStartChar(u))throw Eu(x.Identifier)}j+=u,z="identifierName"},identifierName(){switch(J){case"$":case"_":case"‌":case"‍":return void(j+=uu());case"\\":return uu(),void(z="identifierNameEscape")}if(!H.JudgeUtil.isIdContinueChar(J))return eu("identifier",j);j+=uu()},identifierNameEscape(){if("u"!==J)throw Eu(x.Char,uu());uu();const u=ru();switch(u){case"$":case"_":case"‌":case"‍":break;default:if(!H.JudgeUtil.isIdContinueChar(u))throw Eu(x.Identifier)}j+=u,z="identifierName"},string(){switch(J){case"\\":return uu(),void(j+=function(){const u=Y(),D=function(){switch(Y()){case"b":return uu(),"\b";case"f":return uu(),"\f";case"n":return uu(),"\n";case"r":return uu(),"\r";case"t":return uu(),"\t";case"v":return uu(),"\v"}return}();if(D)return D;switch(u){case"0":if(uu(),H.JudgeUtil.isDigit(Y()))throw Eu(x.Char,uu());return"\0";case"x":return uu(),function(){let u="",D=Y();if(!H.JudgeUtil.isHexDigit(D))throw Eu(x.Char,uu());if(u+=uu(),D=Y(),!H.JudgeUtil.isHexDigit(D))throw Eu(x.Char,uu());return u+=uu(),String.fromCodePoint(parseInt(u,16))}();case"u":return uu(),ru();case"\n":case"\u2028":case"\u2029":return uu(),"";case"\r":return uu(),"\n"===Y()&&uu(),""}if(void 0===u||H.JudgeUtil.isDigitWithoutZero(u))throw Eu(x.Char,uu());return uu()}());case'"':case"'":if(J===q){const u=eu("string",j);return uu(),u}return void(j+=uu());case"\n":case"\r":case void 0:throw Eu(x.Char,uu());case"\u2028":case"\u2029":!function(u){console.warn(`JSON5: '${Fu(u)}' in strings is not valid ECMAScript; consider escaping.`)}(J)}j+=uu()}};function eu(u,D){return{type:u,value:D,line:$,column:k}}function tu(u){for(const D of u){if(Y()!==D)throw Eu(x.Char,uu());uu()}}function ru(){let u="",D=4;for(;D-- >0;){const D=Y();if(!H.JudgeUtil.isHexDigit(D))throw Eu(x.Char,uu());u+=uu()}return String.fromCodePoint(parseInt(u,16))}const nu={start(){if("eof"===M.type)throw Eu(x.EOF);iu()},beforePropertyName(){switch(M.type){case"identifier":case"string":return V=M.value,void(W="afterPropertyName");case"punctuator":return void Cu();case"eof":throw Eu(x.EOF)}},afterPropertyName(){if("eof"===M.type)throw Eu(x.EOF);W="beforePropertyValue"},beforePropertyValue(){if("eof"===M.type)throw Eu(x.EOF);iu()},afterPropertyValue(){if("eof"===M.type)throw Eu(x.EOF);switch(M.value){case",":return void(W="beforePropertyName");case"}":Cu()}},beforeArrayValue(){if("eof"===M.type)throw Eu(x.EOF);"punctuator"!==M.type||"]"!==M.value?iu():Cu()},afterArrayValue(){if("eof"===M.type)throw Eu(x.EOF);switch(M.value){case",":return void(W="beforeArrayValue");case"]":Cu()}},end(){}};function iu(){const u=function(){let u;switch(M.type){case"punctuator":switch(M.value){case"{":u={};break;case"[":u=[]}break;case"null":case"boolean":case"numeric":case"string":u=M.value}return u}();if(K&&"object"==typeof u&&(u._line=$,u._column=k),void 0===G)G=u;else{const D=U[U.length-1];Array.isArray(D)?K&&"object"!=typeof u?D.push({value:u,_line:$,_column:k}):D.push(u):D[V]=K&&"object"!=typeof u?{value:u,_line:$,_column:k}:u}!function(u){if(u&&"object"==typeof u)U.push(u),W=Array.isArray(u)?"beforeArrayValue":"beforePropertyName";else{const u=U[U.length-1];W=u?Array.isArray(u)?"afterArrayValue":"afterPropertyValue":"end"}}(u)}function Cu(){U.pop();const u=U[U.length-1];W=u?Array.isArray(u)?"afterArrayValue":"afterPropertyValue":"end"}function Fu(u){const D={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(D[u])return D[u];if(u<" "){const D=u.charCodeAt(0).toString(16);return`\\x${`00${D}`.substring(D.length)}`}return u}function Eu(u,D){let e="";switch(u){case x.Char:e=void 0===D?`JSON5: invalid end of input at ${$}:${k}`:`JSON5: invalid character '${Fu(D)}' at ${$}:${k}`;break;case x.EOF:e=`JSON5: invalid end of input at ${$}:${k}`;break;case x.Identifier:k-=5,e=`JSON5: invalid identifier character at ${$}:${k}`}const t=new Au(e);return t.lineNumber=$,t.columnNumber=k,t}class Au extends SyntaxError{}var ou={},au=n&&n.__createBinding||(Object.create?function(u,D,e,t){void 0===t&&(t=e);var r=Object.getOwnPropertyDescriptor(D,e);r&&!("get"in r?!D.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return D[e]}}),Object.defineProperty(u,t,r)}:function(u,D,e,t){void 0===t&&(t=e),u[t]=D[e]}),cu=n&&n.__setModuleDefault||(Object.create?function(u,D){Object.defineProperty(u,"default",{enumerable:!0,value:D})}:function(u,D){u.default=D}),su=n&&n.__importStar||function(u){if(u&&u.__esModule)return u;var D={};if(null!=u)for(var e in u)"default"!==e&&Object.prototype.hasOwnProperty.call(u,e)&&au(D,u,e);return cu(D,u),D},lu=n&&n.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(ou,"__esModule",{value:!0}),ou.isFileExists=ou.offlinePluginConversion=ou.executeCommand=ou.getNpmPath=ou.hasNpmPackInPaths=void 0;const Bu=r,du=lu(e),fu=su(u),_u=i,pu=l;ou.hasNpmPackInPaths=function(u,D){try{return require.resolve(u,{paths:[...D]}),!0}catch(u){return!1}},ou.getNpmPath=function(){const u=process.execPath;return fu.join(fu.dirname(u),_u.NPM_TOOL)},ou.executeCommand=function(u,D,e){0!==(0,Bu.spawnSync)(u,D,e).status&&(0,pu.logErrorAndExit)(`Error: ${u} ${D} execute failed.See above for details.`)},ou.offlinePluginConversion=function(u,D){return D.startsWith("file:")||D.endsWith(".tgz")?fu.resolve(u,_u.HVIGOR,D.replace("file:","")):D},ou.isFileExists=function(u){return du.default.existsSync(u)&&du.default.statSync(u).isFile()};var Ou=n&&n.__createBinding||(Object.create?function(u,D,e,t){void 0===t&&(t=e);var r=Object.getOwnPropertyDescriptor(D,e);r&&!("get"in r?!D.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return D[e]}}),Object.defineProperty(u,t,r)}:function(u,D,e,t){void 0===t&&(t=e),u[t]=D[e]}),hu=n&&n.__setModuleDefault||(Object.create?function(u,D){Object.defineProperty(u,"default",{enumerable:!0,value:D})}:function(u,D){u.default=D}),Pu=n&&n.__importStar||function(u){if(u&&u.__esModule)return u;var D={};if(null!=u)for(var e in u)"default"!==e&&Object.prototype.hasOwnProperty.call(u,e)&&Ou(D,u,e);return hu(D,u),D},vu=n&&n.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(P,"__esModule",{value:!0});var gu=P.initProjectWorkSpace=void 0;const mu=Pu(e),Ru=vu(D),yu=Pu(u),Iu=v,Nu=i,bu=g,Su=l,wu=ou;let Hu,xu,Mu;function Tu(u,D,e){return void 0!==e.dependencies&&(0,wu.offlinePluginConversion)(Nu.HVIGOR_PROJECT_ROOT_DIR,D.dependencies[u])===yu.normalize(e.dependencies[u])}function Vu(){const u=yu.join(Mu,Nu.WORK_SPACE);if((0,Su.logInfoPrintConsole)("Hvigor cleaning..."),!mu.existsSync(u))return;const D=mu.readdirSync(u);if(!D||0===D.length)return;const e=yu.resolve(Mu,"node_modules","@ohos","hvigor","bin","hvigor.js");mu.existsSync(e)&&(0,wu.executeCommand)(process.argv[0],[e,"--stop-daemon"],{});try{D.forEach((D=>{mu.rmSync(yu.resolve(u,D),{recursive:!0})}))}catch(D){(0,Su.logErrorAndExit)(`The hvigor build tool cannot be installed. Please manually clear the workspace directory and synchronize the project again.\n\n Workspace Path: ${u}.`)}}gu=P.initProjectWorkSpace=function(){if(Hu=function(){const u=yu.resolve(Nu.HVIGOR_PROJECT_WRAPPER_HOME,Nu.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME);mu.existsSync(u)||(0,Su.logErrorAndExit)(`Error: Hvigor config file ${u} does not exist.`);return(0,bu.parseJsonFile)(u)}(),Mu=function(u){let D;D=function(u){let D=u.hvigorVersion;if(D.startsWith("file:")||D.endsWith(".tgz"))return!1;const e=u.dependencies,t=Object.getOwnPropertyNames(e);for(const u of t){const D=e[u];if(D.startsWith("file:")||D.endsWith(".tgz"))return!1}if(1===t.length&&"@ohos/hvigor-ohos-plugin"===t[0])return D>"2.5.0";return!1}(u)?function(u){let D=`${Nu.HVIGOR_ENGINE_PACKAGE_NAME}@${u.hvigorVersion}`;const e=u.dependencies;if(e){Object.getOwnPropertyNames(e).sort().forEach((u=>{D+=`,${u}@${e[u]}`}))}return(0,Iu.hash)(D)}(u):(0,Iu.hash)(process.cwd());return yu.resolve(Ru.default.homedir(),".hvigor","project_caches",D)}(Hu),xu=function(){const u=yu.resolve(Mu,Nu.WORK_SPACE,Nu.DEFAULT_PACKAGE_JSON);return mu.existsSync(u)?(0,bu.parseJsonFile)(u):{dependencies:{}}}(),!(0,wu.hasNpmPackInPaths)(Nu.HVIGOR_ENGINE_PACKAGE_NAME,[yu.join(Mu,Nu.WORK_SPACE)])||(0,wu.offlinePluginConversion)(Nu.HVIGOR_PROJECT_ROOT_DIR,Hu.hvigorVersion)!==xu.dependencies[Nu.HVIGOR_ENGINE_PACKAGE_NAME]||!function(){function u(u){const D=null==u?void 0:u.dependencies;return void 0===D?0:Object.getOwnPropertyNames(D).length}const D=u(Hu),e=u(xu);if(D+1!==e)return!1;for(const u in null==Hu?void 0:Hu.dependencies)if(!(0,wu.hasNpmPackInPaths)(u,[yu.join(Mu,Nu.WORK_SPACE)])||!Tu(u,Hu,xu))return!1;return!0}()){Vu();try{!function(){(0,Su.logInfoPrintConsole)("Hvigor installing...");for(const u in Hu.dependencies)Hu.dependencies[u]&&(Hu.dependencies[u]=(0,wu.offlinePluginConversion)(Nu.HVIGOR_PROJECT_ROOT_DIR,Hu.dependencies[u]));const u={dependencies:{...Hu.dependencies}};u.dependencies[Nu.HVIGOR_ENGINE_PACKAGE_NAME]=(0,wu.offlinePluginConversion)(Nu.HVIGOR_PROJECT_ROOT_DIR,Hu.hvigorVersion);const D=yu.join(Mu,Nu.WORK_SPACE);try{mu.mkdirSync(D,{recursive:!0});const e=yu.resolve(D,Nu.DEFAULT_PACKAGE_JSON);mu.writeFileSync(e,JSON.stringify(u))}catch(u){(0,Su.logErrorAndExit)(u)}(function(){const u=["config","set","store-dir",Nu.HVIGOR_PNPM_STORE_PATH],D={cwd:yu.join(Mu,Nu.WORK_SPACE),stdio:["inherit","inherit","inherit"]};(0,wu.executeCommand)(Nu.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,u,D)})(),function(){const u=["install"],D={cwd:yu.join(Mu,Nu.WORK_SPACE),stdio:["inherit","inherit","inherit"]};(0,wu.executeCommand)(Nu.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,u,D)}(),(0,Su.logInfoPrintConsole)("Hvigor install success.")}()}catch(u){Vu()}}return Mu};var Gu={};!function(t){var C=n&&n.__createBinding||(Object.create?function(u,D,e,t){void 0===t&&(t=e);var r=Object.getOwnPropertyDescriptor(D,e);r&&!("get"in r?!D.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return D[e]}}),Object.defineProperty(u,t,r)}:function(u,D,e,t){void 0===t&&(t=e),u[t]=D[e]}),F=n&&n.__setModuleDefault||(Object.create?function(u,D){Object.defineProperty(u,"default",{enumerable:!0,value:D})}:function(u,D){u.default=D}),E=n&&n.__importStar||function(u){if(u&&u.__esModule)return u;var D={};if(null!=u)for(var e in u)"default"!==e&&Object.prototype.hasOwnProperty.call(u,e)&&C(D,u,e);return F(D,u),D},A=n&&n.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(t,"__esModule",{value:!0}),t.executeInstallPnpm=t.isPnpmInstalled=t.environmentHandler=t.checkNpmConifg=t.PNPM_VERSION=void 0;const o=r,a=E(e),c=A(D),s=E(u),B=i,d=l,f=ou;t.PNPM_VERSION="7.30.0",t.checkNpmConifg=function(){const u=s.resolve(B.HVIGOR_PROJECT_ROOT_DIR,".npmrc"),D=s.resolve(c.default.homedir(),".npmrc");if((0,f.isFileExists)(u)||(0,f.isFileExists)(D))return;const e=(0,f.getNpmPath)(),t=(0,o.spawnSync)(e,["config","get","prefix"],{cwd:B.HVIGOR_PROJECT_ROOT_DIR});if(0!==t.status||!t.stdout)return void(0,d.logErrorAndExit)("Error: The hvigor depends on the npmrc file. Configure the npmrc file first.");const r=s.resolve(`${t.stdout}`.replace(/[\r\n]/gi,""),".npmrc");(0,f.isFileExists)(r)||(0,d.logErrorAndExit)("Error: The hvigor depends on the npmrc file. Configure the npmrc file first.")},t.environmentHandler=function(){process.env["npm_config_update-notifier"]="false"},t.isPnpmInstalled=function(){return!!a.existsSync(B.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH)&&(0,f.hasNpmPackInPaths)("pnpm",[B.HVIGOR_WRAPPER_TOOLS_HOME])},t.executeInstallPnpm=function(){(0,d.logInfoPrintConsole)(`Installing pnpm@${t.PNPM_VERSION}...`);const u=(0,f.getNpmPath)();!function(){const u=s.resolve(B.HVIGOR_WRAPPER_TOOLS_HOME,B.DEFAULT_PACKAGE_JSON);try{a.existsSync(B.HVIGOR_WRAPPER_TOOLS_HOME)||a.mkdirSync(B.HVIGOR_WRAPPER_TOOLS_HOME,{recursive:!0});const D={dependencies:{}};D.dependencies[B.PNPM]=t.PNPM_VERSION,a.writeFileSync(u,JSON.stringify(D))}catch(D){(0,d.logErrorAndExit)(`Error: EPERM: operation not permitted,create ${u} failed.`)}}(),(0,f.executeCommand)(u,["install","pnpm"],{cwd:B.HVIGOR_WRAPPER_TOOLS_HOME,stdio:["inherit","inherit","inherit"],env:process.env}),(0,d.logInfoPrintConsole)("Pnpm install success.")}}(Gu),function(){Gu.checkNpmConifg(),Gu.environmentHandler(),Gu.isPnpmInstalled()||Gu.executeInstallPnpm();const D=gu();_(u.join(D,i.WORK_SPACE))}(); \ No newline at end of file diff --git a/unionpi_tiger/sample_hzu/hvigorfile.ts b/unionpi_tiger/sample_hzu/hvigorfile.ts deleted file mode 100644 index f3cb9f1a..00000000 --- a/unionpi_tiger/sample_hzu/hvigorfile.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { appTasks } from '@ohos/hvigor-ohos-plugin'; - -export default { - system: appTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ - plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ -} diff --git a/unionpi_tiger/sample_hzu/hvigorw b/unionpi_tiger/sample_hzu/hvigorw deleted file mode 100644 index ff6a29a2..00000000 --- a/unionpi_tiger/sample_hzu/hvigorw +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash - -# ---------------------------------------------------------------------------- -# Hvigor startup script, version 1.0.0 -# -# Required ENV vars: -# ------------------ -# NODE_HOME - location of a Node home dir -# or -# Add /usr/local/nodejs/bin to the PATH environment variable -# ---------------------------------------------------------------------------- - -HVIGOR_APP_HOME="`pwd -P`" -HVIGOR_WRAPPER_SCRIPT=${HVIGOR_APP_HOME}/hvigor/hvigor-wrapper.js -warn() { - echo "" - echo -e "\033[1;33m`date '+[%Y-%m-%d %H:%M:%S]'`$@\033[0m" -} - -error() { - echo "" - echo -e "\033[1;31m`date '+[%Y-%m-%d %H:%M:%S]'`$@\033[0m" -} - -fail() { - error "$@" - exit 1 -} - -# Determine node to start hvigor wrapper script -if [ -n "${NODE_HOME}" ];then - EXECUTABLE_NODE="${NODE_HOME}/bin/node" - if [ ! -x "$EXECUTABLE_NODE" ];then - fail "ERROR: NODE_HOME is set to an invalid directory,check $NODE_HOME\n\nPlease set NODE_HOME in your environment to the location where your nodejs installed" - fi -else - EXECUTABLE_NODE="node" - which ${EXECUTABLE_NODE} > /dev/null 2>&1 || fail "ERROR: NODE_HOME is not set and not 'node' command found in your path" -fi - -# Check hvigor wrapper script -if [ ! -r "$HVIGOR_WRAPPER_SCRIPT" ];then - fail "ERROR: Couldn't find hvigor/hvigor-wrapper.js in ${HVIGOR_APP_HOME}" -fi - -# start hvigor-wrapper script -exec "${EXECUTABLE_NODE}" \ - "${HVIGOR_WRAPPER_SCRIPT}" "$@" diff --git a/unionpi_tiger/sample_hzu/hvigorw.bat b/unionpi_tiger/sample_hzu/hvigorw.bat deleted file mode 100644 index d570007e..00000000 --- a/unionpi_tiger/sample_hzu/hvigorw.bat +++ /dev/null @@ -1,64 +0,0 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Hvigor startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -set WRAPPER_MODULE_PATH=%APP_HOME%\hvigor\hvigor-wrapper.js -set NODE_EXE=node.exe - -goto start - -:start -@rem Find node.exe -if defined NODE_HOME goto findNodeFromNodeHome - -%NODE_EXE% --version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute - -echo. -echo ERROR: NODE_HOME is not set and no 'node' command could be found in your PATH. -echo. -echo Please set the NODE_HOME variable in your environment to match the -echo location of your NodeJs installation. - -goto fail - -:findNodeFromNodeHome -set NODE_HOME=%NODE_HOME:"=% -set NODE_EXE_PATH=%NODE_HOME%/%NODE_EXE% - -if exist "%NODE_EXE_PATH%" goto execute -echo. -echo ERROR: NODE_HOME is not set and no 'node' command could be found in your PATH. -echo. -echo Please set the NODE_HOME variable in your environment to match the -echo location of your NodeJs installation. - -goto fail - -:execute -@rem Execute hvigor -"%NODE_EXE%" "%WRAPPER_MODULE_PATH%" %* - -if "%ERRORLEVEL%" == "0" goto hvigorwEnd - -:fail -exit /b 1 - -:hvigorwEnd -if "%OS%" == "Windows_NT" endlocal - -:end diff --git a/unionpi_tiger/sample_hzu/img.png b/unionpi_tiger/sample_hzu/img.png deleted file mode 100644 index f3950320..00000000 Binary files a/unionpi_tiger/sample_hzu/img.png and /dev/null differ diff --git a/unionpi_tiger/sample_hzu/img_1.png b/unionpi_tiger/sample_hzu/img_1.png deleted file mode 100644 index 068e266a..00000000 Binary files a/unionpi_tiger/sample_hzu/img_1.png and /dev/null differ diff --git a/unionpi_tiger/sample_hzu/img_2.png b/unionpi_tiger/sample_hzu/img_2.png deleted file mode 100644 index a23eeb22..00000000 Binary files a/unionpi_tiger/sample_hzu/img_2.png and /dev/null differ diff --git a/unionpi_tiger/sample_hzu/img_3.png b/unionpi_tiger/sample_hzu/img_3.png deleted file mode 100644 index 2f25c099..00000000 Binary files a/unionpi_tiger/sample_hzu/img_3.png and /dev/null differ diff --git a/unionpi_tiger/sample_hzu/oh-package.json5 b/unionpi_tiger/sample_hzu/oh-package.json5 deleted file mode 100644 index 63542e25..00000000 --- a/unionpi_tiger/sample_hzu/oh-package.json5 +++ /dev/null @@ -1,33 +0,0 @@ -/*MIT License - -Copyright (c) 2024 Your Name - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE.*/ -{ - "license": "", - "devDependencies": { - "@ohos/hypium": "1.0.11" - }, - "author": "", - "name": "distributedvideoplayer", - "description": "Please describe the basic information.", - "main": "", - "version": "1.0.0", - "dependencies": {} -} diff --git a/unionpi_tiger/sample_hzu/screenshots/DeviceDialog.jpeg b/unionpi_tiger/sample_hzu/screenshots/DeviceDialog.jpeg deleted file mode 100644 index 77070a7a..00000000 Binary files a/unionpi_tiger/sample_hzu/screenshots/DeviceDialog.jpeg and /dev/null differ diff --git a/unionpi_tiger/sample_hzu/screenshots/Index.jpeg b/unionpi_tiger/sample_hzu/screenshots/Index.jpeg deleted file mode 100644 index 76388319..00000000 Binary files a/unionpi_tiger/sample_hzu/screenshots/Index.jpeg and /dev/null differ diff --git a/unionpi_tiger/sample_hzu/screenshots/Settings.jpeg b/unionpi_tiger/sample_hzu/screenshots/Settings.jpeg deleted file mode 100644 index ac09659e..00000000 Binary files a/unionpi_tiger/sample_hzu/screenshots/Settings.jpeg and /dev/null differ diff --git a/unionpi_tiger/sample_hzu/screenshots/VideoList.jpeg b/unionpi_tiger/sample_hzu/screenshots/VideoList.jpeg deleted file mode 100644 index b55b0b90..00000000 Binary files a/unionpi_tiger/sample_hzu/screenshots/VideoList.jpeg and /dev/null differ diff --git a/unionpi_tiger/sample_hzu/src/README.md b/unionpi_tiger/sample_hzu/src/README.md deleted file mode 100644 index d77495ce..00000000 --- a/unionpi_tiger/sample_hzu/src/README.md +++ /dev/null @@ -1,98 +0,0 @@ -# 0penHarmony 软总线的分布式视频播放器 -## 简介 -分布式视频播放器是一个基于openHarmony的应用程序,它允许用户在多个设备上播放和同步视频内容。 -## 使用说明 -### 功能介绍 -1. 远程设备连接: 通过DeviceDialog组件选择远程设备。 -2. 数据流转: 支持视频列表数据在多个设备间同步。 -3. 播放控制: 包括播放、暂停、快进、快退等操作。 -### 使用方法 -1. 启动应用后,点击“设置”进入设置页面; -2. 在“设备列表”中选择要连接的远程设备; -3. 根据需要配置“流转模式”(跨端迁移、多端协同模式); -4. 开始播放视频。 -## 工程目录 -``` -entry/src/main/ets/ -|---common -| |---BasicDataSource.ets // 懒加载数据 -| |---DeviceDialog.ets // 分布式设备列表弹窗 -| |---TitleBar.ets // 应用标题栏组件,包含导航和设置按钮 -|---model -| |---DistributedDataModel.ts // 封装分布式数据类 -| |---Logger.ts // 日志工具 -| |---KvStoreModel.ts // kvstore对象操作类 -| |---RemoteDeviceModel.ts // 远程设备操作类 -|---utils -| |---AVPlayerUtils.ts // 封装AVPlayer工具类 -| |---DateTimeUtil.ts // 日期时间工具类 -| |---globalThis.ts -| |---MediaUtils.ts // 媒体库工具类 -| |---utils.ts // 自定义工具类 -|---pages -| |---videolist.ets // 视频列表页面,展示视频资源 -| |---Settings.ets // 设置页 -|---Viewmodel -| |---itemCategory.ets -``` -## 效果预览 - -| 首页 | 视频 | -|-------------------------------| ------------------------------- | -| ![img.png](img.png) |![img_1.png](img_1.png) | -| **设备弹窗** | **设置** | -| ![img_2.png](img_2.png) | ![img_3.png](img_3.png) | - -## 核心代码 -```` -startDeviceDiscovery() { - SUBSCRIBE_ID = Math.floor(RANDOM * Math.random()) - let info = { - subscribeId: SUBSCRIBE_ID, - mode: 0xAA, - medium: 2, - freq: 2, - isSameAccount: false, - isWakeRemote: true, - capability: 0 - } - Logger.info(TAG, `startDeviceDiscovery ${SUBSCRIBE_ID}`) - try { - this.deviceManager.startDeviceDiscovery(info) - } catch (error) { - Logger.error(TAG, `startDeviceDiscovery throw error, code=${error.code} message=${error.message}`) - } - } -```` -代码定义了一个名为 startDeviceDiscovery 的方法,作用是初始化并启动一个设备发现过程,通过生成一个随机的订阅ID和配置一组特定的搜索参数,以便在分布式网络环境中搜索并识别可用的设备。此方法调用 deviceManager 的 startDeviceDiscovery 接口,尝试发现设备。 -```` - try { - this.deviceManager.authenticateDevice(device, authParam, (err, data) => { - if (err) { - Logger.error(TAG, `authenticateDevice error: ${JSON.stringify(err)}`) - this.authCallback = null - return - } - Logger.info(TAG, `authenticateDevice succeed: ${JSON.stringify(data)}`) - this.authCallback = callBack - if (this.authCallback !== null) { - this.authCallback(device) - this.authCallback = null - } - }) - } catch (error) { - Logger.error(TAG, `authenticateDevice throw error, code=${error.code} message=${error.message}`) - } - } - } -```` -## 下载 -如需单独下载本工程,执行如下命令: - -``` -git init -git config core.sparsecheckout true -echo unionpi_tiger/sample_api10/app/DistributedVideoPlayer/ > .git/info/sparse-checkout -git remote add origin https://gitee.com/openharmony/vendor_unionman.git - -``` diff --git a/unionpi_tiger/sample_hzu/src/main/ets/Viewmodel/itemCategory.ets b/unionpi_tiger/sample_hzu/src/main/ets/Viewmodel/itemCategory.ets deleted file mode 100644 index afe50c89..00000000 --- a/unionpi_tiger/sample_hzu/src/main/ets/Viewmodel/itemCategory.ets +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -export default class ItemCategory{ - public id:number//视频编号 - public name:String//视频名字 - public video:Resource//视频 - public image:Resource - constructor(id:number,name:String,video:Resource,image:Resource){ - this.id=id - this.name=name - this.video=video - this.image=image - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample_hzu/src/main/ets/common/BasicDataSource.ets b/unionpi_tiger/sample_hzu/src/main/ets/common/BasicDataSource.ets deleted file mode 100644 index b21374a9..00000000 --- a/unionpi_tiger/sample_hzu/src/main/ets/common/BasicDataSource.ets +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -import mediaLibrary from '@ohos.multimedia.mediaLibrary'; -class BasicDataSource implements IDataSource { - private listeners: DataChangeListener[] = [] - private originDataArray: mediaLibrary.FileAsset[] = []; - public totalCount(): number { - return 0 - } - public getData(index: number): mediaLibrary.FileAsset { - return this.originDataArray[index]; - } - registerDataChangeListener(listener: DataChangeListener): void { - if (this.listeners.indexOf(listener) < 0) { - this.listeners.push(listener) - } - } - unregisterDataChangeListener(listener: DataChangeListener): void { - const pos = this.listeners.indexOf(listener); - if (pos >= 0) {this.listeners.splice(pos, 1)} - } - notifyDataReload(): void { - this.listeners.forEach(listener => {listener.onDataReloaded()}) - } - notifyDataAdd(index: number): void { - this.listeners.forEach(listener => {listener.onDataAdd(index)}) - } - notifyDataChange(index: number): void { - this.listeners.forEach(listener => {listener.onDataChange(index)}) - } - notifyDataDelete(index: number): void { - this.listeners.forEach(listener => {listener.onDataDelete(index)}) - } - - notifyDataMove(from: number, to: number): void { - this.listeners.forEach(listener => {listener.onDataMove(from, to)}) - } -} -export default class MediaDataSource extends BasicDataSource { - private dataArray: mediaLibrary.FileAsset[] = [] - constructor(data: mediaLibrary.FileAsset[]) { - super() - this.dataArray = data - } - public totalCount(): number {return this.dataArray.length} - public getData(index: number): mediaLibrary.FileAsset {return this.dataArray[index]} - public addData(index: number, data: mediaLibrary.FileAsset): void { - this.dataArray.splice(index, 0, data) - this.notifyDataAdd(index) - } - public pushData(data: mediaLibrary.FileAsset): void { - this.dataArray.push(data) - this.notifyDataAdd(this.dataArray.length - 1) - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample_hzu/src/main/ets/common/DeviceDialog.ets b/unionpi_tiger/sample_hzu/src/main/ets/common/DeviceDialog.ets deleted file mode 100644 index d79ad896..00000000 --- a/unionpi_tiger/sample_hzu/src/main/ets/common/DeviceDialog.ets +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -import Logger from '../model/Logger'; -import deviceManager from '@ohos.distributedHardware.deviceManager'; -const TAG: string = 'DeviceDialog'; -@CustomDialog -export struct DeviceDialog { - controller?: CustomDialogController - @StorageLink('deviceLists') deviceLists: Array = AppStorage.Get('deviceLists')!; - private selectedIndex: number = 0 - private selectedIndexChange: (selectedIndex: number) => void = () => { - - } - cancel: () => void = () => { - } - build() { - Column() { - Text($r('app.string.choiceDevice')).fontSize('32px').width('434px') - .fontColor(Color.Black).textAlign(TextAlign.Start).fontWeight(600) - List() { - ForEach(this.deviceLists, (item: deviceManager.DeviceInfo, index: number | undefined) => { - ListItem() { - Flex({ - direction: FlexDirection.Row, - justifyContent: FlexAlign.SpaceBetween, - alignItems: ItemAlign.Center - }) { - Text(item.deviceName).fontSize(18).width('86%').fontColor(Color.Black) - .textAlign(TextAlign.Start) - Radio({ value: '', group: 'radioGroup' }) - .width('7%').checked(index === this.selectedIndex ? true : false) - .onChange(() => { - Logger.info(TAG, `select device: ${item.deviceId}`) - if (index === this.selectedIndex) { - Logger.info(TAG, 'index === this.selectedIndex') - return - } - this.selectedIndex = index !== undefined ? index : 0 - if (this.controller !== undefined) {this.controller.close()} - this.selectedIndexChange(this.selectedIndex) - }) - }.height(55) - }.width('100%').height(80) - }, (item: deviceManager.DeviceInfo) => item.deviceName) - }.height('36%').width('100%') - Button() { - Text($r('app.string.cancel')).width('90%').fontSize(21) - .fontColor('#ff0d64fb').textAlign(TextAlign.Center) - } - .margin({ bottom: 16 }) - .type(ButtonType.Capsule) - .backgroundColor(Color.White) - .onClick(() => { - if (this.controller !== undefined) { - this.controller.close() - this.cancel() - } - }) - }.margin({ bottom: 36 }).width('500px').padding(10) - .backgroundColor(Color.White).border({ color: Color.White, radius: 20 }) - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample_hzu/src/main/ets/common/TitleBar.ets b/unionpi_tiger/sample_hzu/src/main/ets/common/TitleBar.ets deleted file mode 100644 index cb276ba7..00000000 --- a/unionpi_tiger/sample_hzu/src/main/ets/common/TitleBar.ets +++ /dev/null @@ -1,172 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -import router from '@ohos.router'; -import screenshot from '@ohos.screenshot'; -import promptAction from '@ohos.promptAction'; -import deviceManager from '@ohos.distributedHardware.deviceManager'; -import common from '@ohos.app.ability.common'; -import { BusinessError } from '@ohos.base'; -import Logger from '../model/Logger'; -import MediaUtils from '../utils/MediaUtils'; -import { DeviceDialog } from '../common/DeviceDialog'; -import { RemoteDeviceModel } from '../model/RemoteDeviceModel'; -import { GlobalThis } from '../utils/globalThis'; -const TAG = 'TitleBar'; -const DATA_CHANGE = 'dataChange'; -const EXIT = 'exit'; -const ONE_THOUSAND: number = 1000; -@Component -export struct TitleBar { - @Prop title: string - @Prop isLand: boolean - @State selectedIndex: number = 0 - @StorageLink('deviceLists') deviceLists: Array = [] - @State screenshotUrl: PixelMap | null = null - private startAbilityCallBack: (key: string) => void = () => { - } - private remoteDeviceModel: RemoteDeviceModel = new RemoteDeviceModel() - private dialogController: CustomDialogController | null = null - private mediaUtil: MediaUtils = new MediaUtils() - aboutToAppear() { - AppStorage.SetOrCreate('deviceLists', this.deviceLists) - } - clearSelectState() { - this.deviceLists = [] - if (this.dialogController) {this.dialogController.close()} - } - selectDevice() { - Logger.info(TAG, `start ability device:${JSON.stringify(this.deviceLists[this.selectedIndex])}`) - if (this.remoteDeviceModel === null || this.remoteDeviceModel.discoverLists.length <= 0 || - this.remoteDeviceModel.deviceLists.includes(this.deviceLists[this.selectedIndex])) { - this.startAbility(this.deviceLists[this.selectedIndex].deviceId) - this.clearSelectState() - return - } - Logger.info(TAG, 'start ability, needAuth') - this.remoteDeviceModel.authenticateDevice(this.deviceLists[this.selectedIndex], - (device: deviceManager.DeviceInfo) => { - Logger.info(TAG, 'auth and online finished' + JSON.stringify(device)) - this.startAbility(device.deviceId) - }) - Logger.info(TAG, 'start ability2 ......') - this.clearSelectState() - } - selectedIndexChange = (index: number) => { - Logger.info(TAG, 'selectedIndexChange') - this.selectedIndex = index - if (this.selectedIndex === 0) { - Logger.info(TAG, 'stop ability') - this.startAbilityCallBack(EXIT) - GlobalThis.getInstance().setObject('isDistributed', false) - if (this.dialogController !== null) { - this.dialogController.close() - } - this.deviceLists = [] - return - } - this.selectDevice() - } - async startAbility(deviceId: string | undefined) { - Logger.info(TAG, `startAbility deviceId: ${deviceId}`) - let context = GlobalThis.getInstance().getObject('context') as common.UIAbilityContext - await context.startAbility({ - bundleName: 'com.unionman.distributedvideoplayer', - abilityName: 'EntryAbility', - deviceId: deviceId, - parameters: { - isStage: 'Stage', - deviceID: 'remote' - } - }).then((data) => { - Logger.info(TAG, `start ability finished: ${JSON.stringify(data)}`) - promptAction.showToast({ message: '流转成功' }) - GlobalThis.getInstance().setObject('isDistributed', true) - setTimeout(() => { - this.startAbilityCallBack(DATA_CHANGE) - }, 2000) - }).catch((err: BusinessError) => { - Logger.error(TAG, `start ability err: ${JSON.stringify(err)}`); - }); - } - showDialog() { - this.remoteDeviceModel.registerDeviceListCallback(() => { - Logger.info(TAG, 'registerDeviceListCallback, callback entered') - this.deviceLists = [] - this.deviceLists.push({ - deviceId: '0', - deviceName: '本机(结束协同)', - deviceType: deviceManager.DeviceType.UNKNOWN_TYPE, - networkId: '', - range: ONE_THOUSAND, - authForm: -1 - }) - let deviceTempList = this.remoteDeviceModel.deviceLists.concat(this.remoteDeviceModel.discoverLists) - Logger.info(TAG, `this.remoteDeviceModel.deviceTempList.length${deviceTempList.length}`) - for (let i = 0; i < deviceTempList.length; i++) { - Logger.info(TAG, `device ${i}/${deviceTempList.length} deviceId= ${deviceTempList[i].deviceId}, deviceName= ${deviceTempList[i].deviceName}, deviceType= ${deviceTempList[i].deviceType}`) - this.deviceLists.push(deviceTempList[i]) - AppStorage.Set('deviceLists', this.deviceLists) - Logger.info(TAG, 'deviceLists push end') - } - Logger.info(TAG, 'CustomDialogController start') - if (this.dialogController !== null) { - this.dialogController.close() - } - this.dialogController = new CustomDialogController({ - builder: DeviceDialog({ - cancel: () => {this.clearSelectState()}, - selectedIndex: this.selectedIndex, - selectedIndexChange: this.selectedIndexChange }), - cancel: () => {this.clearSelectState()}, - autoCancel: true, - customStyle: true, - alignment: this.isLand ? DialogAlignment.Center : DialogAlignment.Bottom - }) - this.dialogController.open() - Logger.info(TAG, 'CustomDialogController end') - }) - } - - build() { - Row() { - Image($r('app.media.ic_back')).id('back').height('60%').margin({ right: 4 }) - .width(this.isLand ? '8%' : '10%').objectFit(ImageFit.Contain) - .onClick(() => { - router.back() - }) - Text(this.title).fontColor(Color.White).fontSize(22).maxLines(1) - Blank() - Image($r('app.media.ic_hop')).id('hop') - .height('60%').width(this.isLand ? '8%' : '10%') - .margin({ right: 8 }).objectFit(ImageFit.Contain) - .onClick(() => {this.showDialog()}) - Image($r('app.media.ic_settings')).id('settings').height('60%') - .width(this.isLand ? '8%' : '10%').objectFit(ImageFit.Contain) - .onClick(() => { - router.pushUrl({ - url: 'pages/Settings' - }) - }) - }.width('100%').height(this.isLand ? '15%' : '10%') - .constraintSize({ minHeight: 50 }).alignItems(VerticalAlign.Center) - .padding({ left: 10, right: 10 }) - .linearGradient({ - direction: GradientDirection.Bottom, - colors: [['#CC000000', 0.0], ['#33000000', 0.66], ['#00000000', 0.99]] - }) - } -} diff --git a/unionpi_tiger/sample_hzu/src/main/ets/entryability/EntryAbility.ts b/unionpi_tiger/sample_hzu/src/main/ets/entryability/EntryAbility.ts deleted file mode 100644 index bdd13bfc..00000000 --- a/unionpi_tiger/sample_hzu/src/main/ets/entryability/EntryAbility.ts +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -import AbilityConstant from '@ohos.app.ability.AbilityConstant'; -import hilog from '@ohos.hilog'; -import UIAbility from '@ohos.app.ability.UIAbility'; -import Want from '@ohos.app.ability.Want'; -import window from '@ohos.window'; -import abilityAccessCtrl from '@ohos.abilityAccessCtrl'; -import { GlobalThis } from '../utils/globalThis'; - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); - if (want.parameters !== undefined) { - AppStorage.setOrCreate('isStage', want.parameters.isStage) - AppStorage.setOrCreate('deviceID', want.parameters.deviceID) - } - GlobalThis.getInstance().setObject("context", this.context) - } - onDestroy(): void { - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); - } - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - let AtManager = abilityAccessCtrl.createAtManager(); - AtManager.requestPermissionsFromUser(this.context, ["ohos.permission.DISTRIBUTED_DATASYNC", "ohos.permission.READ_MEDIA", "ohos.permission.WRITE_MEDIA"]) - windowStage.getMainWindowSync().setWindowSystemBarEnable([]) - windowStage.loadContent('pages/videolist', (err, data) => { - if (err.code) { - hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); - return; - } - hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); - }); - } - onWindowStageDestroy(): void { - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy');} - onForeground(): void { - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); - } - onBackground(): void { - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); - } -} diff --git a/unionpi_tiger/sample_hzu/src/main/ets/model/DistributedDataModel.ts b/unionpi_tiger/sample_hzu/src/main/ets/model/DistributedDataModel.ts deleted file mode 100644 index f8e2cc76..00000000 --- a/unionpi_tiger/sample_hzu/src/main/ets/model/DistributedDataModel.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -export default class DistributedDataModel { - public title: string - public currentTime: number - public SpeedIndex: number - public isPlay: boolean - public firstHop: boolean - constructor(title, currentTime, SpeedIndex, isPlay, firstHop) { - this.title = title - this.currentTime = currentTime - this.SpeedIndex = SpeedIndex - this.isPlay = isPlay - this.firstHop = firstHop - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample_hzu/src/main/ets/model/KvStoreModel.ts b/unionpi_tiger/sample_hzu/src/main/ets/model/KvStoreModel.ts deleted file mode 100644 index 2772360e..00000000 --- a/unionpi_tiger/sample_hzu/src/main/ets/model/KvStoreModel.ts +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -import Logger from './Logger'; -import distributedKVStore from '@ohos.data.distributedKVStore'; -const TAG = 'KvStoreModel'; -const STORE_ID = 'distributedvideoplayer'; -export class KvStoreModel { - private kvManager: distributedKVStore.KVManager = undefined; - private kvStore: distributedKVStore.SingleKVStore = undefined; - constructor() { - } - async createKvStore(callback) { - if ((typeof (this.kvStore) !== 'undefined')) { - callback() - return - } - let kvManagerConfig = { - bundleName: 'com.unionman.distributedvideoplayer', - context: globalThis.context - } - Logger.info(TAG, 'createKVManager begin') - this.kvManager = distributedKVStore.createKVManager(kvManagerConfig) - Logger.info(TAG, `createKVManager success, kvManager`) - - let options = { - createIfMissing: true, // 当数据库文件不存在时创建数据库 - encrypt: false, // 设置数据库文件不加密 - backup: false, // 设置数据库文件不备份 - autoSync: true, // 设置数据库文件自动同步 - kvStoreType: distributedKVStore.KVStoreType.SINGLE_VERSION, // 设置要创建的数据库类型为表示单版本数据库 - securityLevel: distributedKVStore.SecurityLevel.S1, // 设置数据库安全级别为低级别 - } - Logger.info(TAG, 'kvManager.getKVStore begin') - this.kvStore = await this.kvManager.getKVStore(STORE_ID, options) - Logger.info(TAG, `getKVStore success, kvStore=${JSON.stringify(this.kvStore)}`) - callback() - Logger.info(TAG, 'kvManager.getKVStore end') - Logger.info(TAG, 'createKVManager end') - } - put(key, value) { - Logger.info(TAG, `kvStore.put ${key}=${value}`) - try { - this.kvStore.put(key, value).then((data) => { - Logger.info(TAG, `kvStore.put ${key} finished, data= ${data}`) - }).catch((err) => { - Logger.error(TAG, `kvStore.put ${key} failed ${err}`) - }) - } catch (e) { - Logger.error(TAG, `An unexpected error occurred.code is ${e.code},message is ${e.message}`); - } - } - setOnMessageReceivedListener(msg, callback) { - Logger.info(TAG, `setOnMessageReceivedListener ${msg}`) - this.createKvStore(() => { - Logger.info(TAG, 'kvStore.on(dataChange) begin') - this.kvStore.on('dataChange', distributedKVStore.SubscribeType.SUBSCRIBE_TYPE_REMOTE, (data) => { - Logger.info(TAG, `dataChange, ${JSON.stringify(data)}`) - Logger.info(TAG, `dataChange, insert ${data.insertEntries.length},udpate ${data.updateEntries.length}`) - let entries = data.insertEntries.length > 0 ? data.insertEntries : data.updateEntries - for (let i = 0; i < entries.length; i++) { - if (entries[i].key === msg) { - let value = entries[i].value.value - Logger.info(TAG, `Entries receive${msg} = ${value}`) - callback(value) - return; - } - } - }); - Logger.info(TAG, 'kvStore.on(dataChange) end') - }) - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample_hzu/src/main/ets/model/Logger.ts b/unionpi_tiger/sample_hzu/src/main/ets/model/Logger.ts deleted file mode 100644 index a604a9a7..00000000 --- a/unionpi_tiger/sample_hzu/src/main/ets/model/Logger.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -import hilog from '@ohos.hilog' -class Logger { - private domain: number = 0xFF00 - private prefix: string = '' - private format: string = "%{public}s, %{public}s" - constructor(prefix: string) { - this.prefix = prefix - this.domain = 0xFF00 - } - debug(...args: any[]) { - hilog.debug(this.domain, this.prefix, this.format, args) - } - info(...args: any[]) { - hilog.info(this.domain, this.prefix, this.format, args) - } - warn(...args: any[]) { - hilog.warn(this.domain, this.prefix, this.format, args) - } - error(...args: any[]) { - hilog.error(this.domain, this.prefix, this.format, args) - } -} -export default new Logger('[DistributedVideoPlayer]') \ No newline at end of file diff --git a/unionpi_tiger/sample_hzu/src/main/ets/model/RemoteDeviceModel.ts b/unionpi_tiger/sample_hzu/src/main/ets/model/RemoteDeviceModel.ts deleted file mode 100644 index 376574c5..00000000 --- a/unionpi_tiger/sample_hzu/src/main/ets/model/RemoteDeviceModel.ts +++ /dev/null @@ -1,224 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -import Logger from './Logger'; -import promptAction from '@ohos.promptAction'; -import deviceManager from '@ohos.distributedHardware.deviceManager'; -const TAG = 'RemoteDeviceModel'; -const RANDOM: number = 65536; -let SUBSCRIBE_ID = 100; -export class RemoteDeviceModel { - public deviceLists: Array = [] - public discoverLists: Array = [] - private callback: () => void = null - private authCallback: (device: deviceManager.DeviceInfo) => void = null - private deviceManager: deviceManager.DeviceManager = undefined - constructor() { - } - registerDeviceListCallback(callback) { - if (typeof (this.deviceManager) !== 'undefined') { - this.registerDeviceListCallbackImplement(callback) - return - } - Logger.info(TAG, 'deviceManager.createDeviceManager begin') - try { - deviceManager.createDeviceManager("com.unionman.distributedvideoplayer", (error, value) => { - if (error) { - Logger.error(TAG, `createDeviceManager failed.${error}`) - return - } - this.deviceManager = value - this.registerDeviceListCallbackImplement(callback) - Logger.info(TAG, `createDeviceManager callback returned, error= ${error} value= ${JSON.stringify(value)}`) - }) - } catch (error) { - Logger.error(TAG, `createDeviceManager throw error, code=${error.code} message=${error.message}`) - } - Logger.info(TAG, 'deviceManager.createDeviceManager end') - } - - deviceStateChangeActionOffline(device) { - if (this.deviceLists.length <= 0) { - this.callback() - return - } - for (let j = 0; j < this.deviceLists.length; j++) { - if (this.deviceLists[j].deviceId === device.deviceId) { - this.deviceLists[j] = device - break - } - } - Logger.info(TAG, `offline, device list= ${JSON.stringify(this.deviceLists)}`) - this.callback() - } - changeStateOnline(device) { - this.deviceLists[this.deviceLists.length] = device - Logger.debug(TAG, `online, device list= ${JSON.stringify(this.deviceLists)}`) - this.callback() - } - registerDeviceListCallbackImplement(callback) { - Logger.info(TAG, 'registerDeviceListCallback') - this.callback = callback - if (this.deviceManager === undefined) { - Logger.error(TAG, 'deviceManager has not initialized') - this.callback() - return - } - Logger.info(TAG, 'getTrustedDeviceListSync begin') - try { - let list = this.deviceManager.getTrustedDeviceListSync() - Logger.info(TAG, `getTrustedDeviceListSync end, deviceList= ${JSON.stringify(list)}`) - if (typeof (list) != 'undefined' && typeof (list.length) != 'undefined') { - this.deviceLists = list - } - } catch (error) { - Logger.error(TAG, `getTrustedDeviceListSync throw error, code=${error.code} message=${error.message}`) - } - this.callback() - Logger.info(TAG, `callback finished devices = ${JSON.stringify(this.deviceLists)}`) - try { - this.deviceManager.on('deviceStateChange', (data) => { - if (data === null) { - return - } - Logger.info(TAG, `deviceStateChange data= ${JSON.stringify(data)}`) - switch (data.action) { - case deviceManager.DeviceStateChangeAction.ONLINE: - this.changeStateOnline(data.device) - break; - case deviceManager.DeviceStateChangeAction.READY: - this.discoverLists = [] - this.deviceLists.push(data.device) - this.callback() - try { - let list = this.deviceManager.getTrustedDeviceListSync() - if (typeof (list) !== 'undefined' && typeof (list.length) !== 'undefined') { - this.deviceLists = list - } - } catch (error) { - Logger.error(TAG, `getTrustedDeviceListSync throw error, code=${error.code} message=${error.message}`) - } - this.callback() - break; - case deviceManager.DeviceStateChangeAction.OFFLINE: - case deviceManager.DeviceStateChangeAction.CHANGE: - this.deviceStateChangeActionOffline(data.device) - try { - let list = this.deviceManager.getTrustedDeviceListSync() - if (typeof (list) !== 'undefined' && typeof (list.length) !== 'undefined') { - this.deviceLists = list - } - } catch (error) { - Logger.error(TAG, `getTrustedDeviceListSync throw error, code=${error.code} message=${error.message}`) - } - this.callback() - break - default: - break - } - }) - this.deviceManager.on('deviceFound', (data) => { - if (data === null) {return} - Logger.info(TAG, `deviceFound data=${JSON.stringify(data)}`) - this.deviceFound(data)}) - this.deviceManager.on('discoverFail', (data) => { - Logger.info(TAG, `discoverFail data= ${JSON.stringify(data)}`) - }) - this.deviceManager.on('serviceDie', () => { - Logger.error(TAG, 'serviceDie') - }) - } catch (error) { - Logger.error(TAG, `on throw error, code=${error.code} message=${error.message}`) - } - this.startDeviceDiscovery() - } - deviceFound(data) { - for (var i = 0;i < this.discoverLists.length; i++) { - if (this.discoverLists[i].deviceId === data.device.deviceId) { - Logger.info(TAG, 'device founded ignored') - return - } - } - this.discoverLists[this.discoverLists.length] = data.device - Logger.info(TAG, `deviceFound self.discoverList= ${JSON.stringify(this.discoverLists)}`) - this.callback() - } - - startDeviceDiscovery() { - SUBSCRIBE_ID = Math.floor(RANDOM * Math.random()) - let info = { - subscribeId: SUBSCRIBE_ID, // 发现标识,用于标识不同的发现周期 - mode: 0xAA, // 主动模式 - medium: 2, // WiFi发现类型 - freq: 2, // 高频率 - isSameAccount: false, // 是否同账号 - isWakeRemote: true, // 是否唤醒设备 - capability: 0 // DDMP能力 - } - Logger.info(TAG, `startDeviceDiscovery ${SUBSCRIBE_ID}`) - try { - this.deviceManager.startDeviceDiscovery(info) - } catch (error) { - Logger.error(TAG, `startDeviceDiscovery throw error, code=${error.code} message=${error.message}`) - } - } - authenticateDevice(device, callBack) { - Logger.info(TAG, `authenticateDevice ${JSON.stringify(device)}`) - for (let i = 0; i < this.discoverLists.length; i++) { - if (this.discoverLists[i].deviceId !== device.deviceId) { - continue - } - let extraInfo = { - 'targetPkgName': 'com.unionman.distributedvideoplayer', - 'appName': 'Distributed VideoPlayer', - 'appDescription': 'Distributed VideoPlayer', - 'business': '0' - } - let authParam = { - 'authType': 1, //认证类型: 1 - 无账号PIN码认证 - 'appIcon': '', - 'appThumbnail': '', - 'extraInfo': extraInfo - } - try { - this.deviceManager.authenticateDevice(device, authParam, (err, data) => { - if (err) { - Logger.error(TAG, `authenticateDevice error: ${JSON.stringify(err)}`) - this.authCallback = null - return - } - Logger.info(TAG, `authenticateDevice succeed: ${JSON.stringify(data)}`) - this.authCallback = callBack - if (this.authCallback !== null) { - this.authCallback(device) - this.authCallback = null - } - }) - } catch (error) { - Logger.error(TAG, `authenticateDevice throw error, code=${error.code} message=${error.message}`) - } - } - } - unAuthenticateDevice(device) { - try { - this.deviceManager.unAuthenticateDevice(device); - promptAction.showToast({ message: '解除中,请稍后...', duration: 3000 }) - } catch (err) { - Logger.error(TAG, "unAuthenticateDevice errCode:" + err.code + ",errMessage:" + err.message); - } - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample_hzu/src/main/ets/pages/Settings.ets b/unionpi_tiger/sample_hzu/src/main/ets/pages/Settings.ets deleted file mode 100644 index b5b38c0a..00000000 --- a/unionpi_tiger/sample_hzu/src/main/ets/pages/Settings.ets +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -import router from '@ohos.router'; -import common from '@ohos.app.ability.common'; -import preferences from '@ohos.data.preferences'; -import deviceManager from '@ohos.distributedHardware.deviceManager'; -import { RemoteDeviceModel } from '../model/RemoteDeviceModel'; -import Logger from '../model/Logger'; -import { GlobalThis } from '../utils/globalThis'; -const TAG: string = 'Setting'; -const PREFERENCES_NAME = 'setting'; -let preferenceSetting: preferences.Preferences | null = null; -@Entry -@Component -struct Setting { - @State deviceLists: Array = []; - @StorageLink('continuationMode') @Watch('continuationModeChange') continuationMode: string = 'continuation'; - private remoteDeviceModel: RemoteDeviceModel = new RemoteDeviceModel(); - async aboutToAppear() { - let context = GlobalThis.getInstance().getObject('context') as common.UIAbilityContext - preferenceSetting = await preferences.getPreferences(context, PREFERENCES_NAME) - this.remoteDeviceModel.registerDeviceListCallback(() => { - Logger.info(TAG, 'registerDeviceListCallback, callback entered') - this.deviceLists = this.remoteDeviceModel.deviceLists - Logger.info(TAG, `deviceLists.length${this.deviceLists.length}`) - }) - } - async continuationModeChange() { - preferenceSetting!.put('continuationMode', this.continuationMode) - preferenceSetting!.flush() - } - - build() { - Column() { - Row() { - Image($r('app.media.ic_back')).id('settings_back').width('8%').height('50%') - .margin({ right: 4 }).objectFit(ImageFit.Contain) - .onClick(() => {router.back()}) - Text('设置').fontColor(Color.White).fontFamily('HarmonyHeiTi') - .fontSize(20).maxLines(1) - }.width('100%').height('8%').constraintSize({ minHeight: 50 }) - .padding({ left: 10, right: 10 }) - Row({ space: 10 }) { - Text('流转模式').fontColor(Color.White) - .fontFamily('HarmonyHeiTi').fontSize(20) - Blank() - Radio({ - value: 'continuation', group: 'continuationMode' - }).id('continuation') - .checked(this.continuationMode == 'continuation' ? true : false) - .height(25).width(25) - .onChange((isChecked: boolean) => { - if (isChecked) {this.continuationMode = 'continuation'} - }) - Text('跨端迁移').fontColor(Color.White).fontFamily('HarmonyHeiTi').fontSize(20) - Radio({ value: 'synchronization', group: 'continuationMode' }).id('synchronization') - .checked(this.continuationMode == 'synchronization' ? true : false) - .height(25).width(25) - .onChange((isChecked: boolean) => { - if (isChecked) { - this.continuationMode = 'synchronization' - } - }) - Text('多端协同').fontColor(Color.White).fontFamily('HarmonyHeiTi').fontSize(20) - } - .width('100%').height(100).padding(10).borderRadius(20) - .backgroundColor('#464646').alignItems(VerticalAlign.Center) - Row() { - Text('认证设备管理') - .fontSize(16) - .fontColor(Color.White) - } - .width('100%') - .padding(10) - Scroll() { - Column() { - ForEach(this.deviceLists, (item: deviceManager.DeviceInfo) => { - Row() { - Text(item.deviceName).height('100%').fontSize(20) - .fontColor(Color.White).fontFamily('HarmonyHeiTi') - Blank() - Button('解除认证') - .onClick(() => { - this.remoteDeviceModel.unAuthenticateDevice(item) - }) - }.width('100%').height(80).padding(10).borderRadius(20) - .backgroundColor('#464646').alignItems(VerticalAlign.Center) - }) - }.constraintSize({ minHeight: '100%' }) - } - }.width('100%').height('100%').padding(10).backgroundColor('#7F000000') - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample_hzu/src/main/ets/pages/videolist.ets b/unionpi_tiger/sample_hzu/src/main/ets/pages/videolist.ets deleted file mode 100644 index b82d01c3..00000000 --- a/unionpi_tiger/sample_hzu/src/main/ets/pages/videolist.ets +++ /dev/null @@ -1,266 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -import itemCategory from '../Viewmodel/itemCategory'; -import router from '@ohos.router'; -import promptAction from '@ohos.promptAction'; -import deviceManager from '@ohos.distributedHardware.deviceManager'; -import common from '@ohos.app.ability.common'; -import { BusinessError } from '@ohos.base'; -import Logger from '../model/Logger'; -import MediaUtils from '../utils/MediaUtils'; -import { DeviceDialog } from '../common/DeviceDialog'; -import { RemoteDeviceModel } from '../model/RemoteDeviceModel'; -import { GlobalThis } from '../utils/globalThis'; -const TAG = 'TitleBar'; -const DATA_CHANGE = 'dataChange'; -const EXIT = 'exit'; -const ONE_THOUSAND: number = 1000; -@Entry -@Component -struct videolist { - title: string - isLand: boolean - @State selectedIndex: number = 0 - @StorageLink('deviceLists') deviceLists: Array = [] - @State screenshotUrl: PixelMap | null = null - private startAbilityCallBack: (key: string) => void = () => { - } - private remoteDeviceModel: RemoteDeviceModel = new RemoteDeviceModel() - private dialogController: CustomDialogController | null = null - private mediaUtil: MediaUtils = new MediaUtils() - @State itemCategories: itemCategory[] = [ - new itemCategory(1, '视频1', $rawfile('cloud.mp4'), $rawfile('Cloud.jpg')), - new itemCategory(2, '视频2', $rawfile('desert.mp4'), $rawfile('desert.jpg')), - new itemCategory(3, '视频3', $rawfile('flower.mp4'), $rawfile('flowers.jpg')), - new itemCategory(4, '视频4', $rawfile('forest.mp4'), $rawfile('forest.jpg')), - new itemCategory(5, '视频5', $rawfile('duck.mp4'), $rawfile('duck.png')), - ]; - @State index: number = 2 - @State space: number = 8 - @State arrowPosition: BarPosition = BarPosition.End - @State currentProgressRate: PlaybackSpeed = PlaybackSpeed.Speed_Forward_1_00_X; //视频播放倍速 - @State isAutoPlay: boolean = false; //是否自动播放 - @State showControls: boolean = true; //显示视频控件 - @State muted: boolean = false; //是否静音 - @State autoPlay: boolean = false; //是否自动播放 - @State currentProgressRates: PlaybackSpeed[] = this.itemCategories.map(() => PlaybackSpeed.Speed_Forward_1_00_X); - aboutToAppear() { - AppStorage.SetOrCreate('deviceLists', this.deviceLists) - } - clearSelectState() { - this.deviceLists = [] - if (this.dialogController) { - this.dialogController.close() - } - } - selectDevice() { - Logger.info(TAG, `start ability device:${JSON.stringify(this.deviceLists[this.selectedIndex])}`) - if (this.remoteDeviceModel === null || - this.remoteDeviceModel.discoverLists.length <= 0 || this.remoteDeviceModel.deviceLists.includes - (this.deviceLists[this.selectedIndex])) { - this.startAbility(this.deviceLists[this.selectedIndex].deviceId) - this.clearSelectState() - return - } - Logger.info(TAG, 'start ability, needAuth') - this.remoteDeviceModel.authenticateDevice - (this.deviceLists[this.selectedIndex], (device: deviceManager.DeviceInfo) => { - Logger.info(TAG, 'auth and online finished' + JSON.stringify(device)) - this.startAbility(device.deviceId) - }) - Logger.info(TAG, 'start ability2 ......') - this.clearSelectState() - } - - selectedIndexChange = (index: number) => { - Logger.info(TAG, 'selectedIndexChange') - this.selectedIndex = index - if (this.selectedIndex === 0) { - Logger.info(TAG, 'stop ability') - this.startAbilityCallBack(EXIT) - GlobalThis.getInstance().setObject('isDistributed', false) - if (this.dialogController !== null) { - this.dialogController.close() - } - this.deviceLists = [] - return - } - this.selectDevice() - } - async startAbility(deviceId: string | undefined) { - Logger.info(TAG, `startAbility deviceId: ${deviceId}`) - let context = GlobalThis.getInstance().getObject('context') as common.UIAbilityContext - await context.startAbility({ - bundleName: 'com.unionman.distributedvideoplayer', - abilityName: 'EntryAbility', - deviceId: deviceId, - parameters: { - isStage: 'Stage', - deviceID: 'remote' - } - }).then((data) => { - Logger.info(TAG, `start ability finished: ${JSON.stringify(data)}`) - promptAction.showToast({ message: '流转成功' }) - GlobalThis.getInstance().setObject('isDistributed', true) - setTimeout(() => { - this.startAbilityCallBack(DATA_CHANGE) - }, 2000) - }).catch((err: BusinessError) => { - Logger.error(TAG, `start ability err: ${JSON.stringify(err)}`); - }); - } - showDialog() { - this.remoteDeviceModel.registerDeviceListCallback(() => { - Logger.info(TAG, 'registerDeviceListCallback, callback entered') - this.deviceLists = [] - this.deviceLists.push({ - deviceId: '0', - deviceName: '本机(结束协同)', - deviceType: deviceManager.DeviceType.UNKNOWN_TYPE, - networkId: '', - range: ONE_THOUSAND, - authForm: -1 - }) - let deviceTempList = this.remoteDeviceModel.deviceLists.concat(this.remoteDeviceModel.discoverLists) - Logger.info(TAG, `this.remoteDeviceModel.deviceTempList.length${deviceTempList.length}`) - for (let i = 0; i < deviceTempList.length; i++) { - Logger.info(TAG, `device ${i}/${deviceTempList.length} deviceId= ${deviceTempList[i].deviceId}, deviceName= ${deviceTempList[i].deviceName}, deviceType= ${deviceTempList[i].deviceType}`) - this.deviceLists.push(deviceTempList[i]) - AppStorage.Set('deviceLists', this.deviceLists) - Logger.info(TAG, 'deviceLists push end') - } - Logger.info(TAG, 'CustomDialogController start') - if (this.dialogController !== null) { - this.dialogController.close() - } - this.dialogController = new CustomDialogController({ - builder: DeviceDialog({ - cancel: () => { - this.clearSelectState() - }, - selectedIndex: this.selectedIndex, - selectedIndexChange: this.selectedIndexChange - }), - cancel: () => { - this.clearSelectState() - }, - autoCancel: true, customStyle: true, - alignment: this.isLand ? DialogAlignment.Center : DialogAlignment.Bottom - }) - this.dialogController.open() - Logger.info(TAG, 'CustomDialogController end') - }) - } - - build() { - Column() { - Row() { - Image($r('app.media.ic_back')).height('6%').margin({ right: 1 }) - .objectFit(ImageFit.Contain) - .onClick(() => { - let context = GlobalThis.getInstance().getObject('context') as common.UIAbilityContext - context.terminateSelf() - }) - Blank() - Image($r('app.media.ic_hop')).id('hop').height('6%').margin({ right: 8 }) - .objectFit(ImageFit.Contain) - .onClick(() => {this.showDialog()}) - Image($r('app.media.ic_settings')).id('settings').height('6%').objectFit(ImageFit.Contain) - .onClick(() => { - router.pushUrl({ - url: 'pages/Settings' - }) - }) - } - .width('100%').constraintSize({ minHeight: 50 }) - .alignItems(VerticalAlign.Center).padding({ left: 10, right: 10 }) - .linearGradient({ - direction: GradientDirection.Bottom, - colors: [['#CC000000', 0.0], ['#CC000000', 0.66], ['#CC000000', 0.99]] - }) - Grid() { - ForEach(this.itemCategories, (item: itemCategory, index: number) => { - GridItem() { - Column() { - Video({ - previewUri: item.image, - src: item.video, - currentProgressRate: this.currentProgressRates[index], - }) - .width('100%').height('90%') - .backgroundBlurStyle(BlurStyle.Thin, { - colorMode: ThemeColorMode.LIGHT, - adaptiveColor: AdaptiveColor.DEFAULT, - scale: 1.0 - }).borderRadius(18).padding(10).objectFit(ImageFit.Contain) - .autoPlay(this.isAutoPlay).controls(this.showControls) - .onStart(() => {console.info('onStart')}).onPause(() => { - console.info('onPause') - }) - .onFinish(() => { - console.info('onFinish') - }).onError(() => { - console.info('播放错误') - }) - .onPrepared((e) => { - console.info('onPrepared is ' + e.duration) - } - ) - .onSeeking((e) => { - console.info('onSeeking is ' + e.time) - }) - .onSeeked((e) => { - console.info('onSeeked is ' + e.time) - }) - .onUpdate((e) => { - console.info('onUpdate is ' + e.time) - }) - Row() { - Select([ - { value: '0.75x' }, - { value: '1x' }, - { value: '2x' } - ]) - .font({ size: 16, weight: 500 }).fontColor('#182431') - .selectedOptionFont({ size: 16, weight: 400 }) - .optionFont({ size: 16, weight: 400 }).space(this.space) - .selected(this.currentProgressRates[index] === PlaybackSpeed.Speed_Forward_0_75_X ? 0 : - this.currentProgressRates[index] === PlaybackSpeed.Speed_Forward_1_00_X ? 1 : - this.currentProgressRates[index] === PlaybackSpeed.Speed_Forward_2_00_X ? 2 : 1) // 默认选中1x - .onSelect((selectedIndex: number, value?: string) => { - console.info('Select:' + selectedIndex); - if (value) { - let playbackSpeed: PlaybackSpeed; - switch (value) { - case '0.75x': playbackSpeed = PlaybackSpeed.Speed_Forward_0_75_X; break; - case '1x': playbackSpeed = PlaybackSpeed.Speed_Forward_1_00_X; break; - case '2x': playbackSpeed = PlaybackSpeed.Speed_Forward_2_00_X; break; - default: playbackSpeed = PlaybackSpeed.Speed_Forward_1_00_X; // 默认速度 - } - this.currentProgressRates[index] = playbackSpeed; - } - }) - }.width('100%') - }.width('100%').height('100%').borderRadius(18).padding(12) - }.height('83%').width('100%') - }) - } .columnsTemplate('1fr 1fr').columnsGap(10).rowsGap(10).width('100%') - .height('100%').backgroundImage($r('app.media.bj')) - .backgroundImageSize(ImageSize.Cover) - }.width('100%').height('100%') - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample_hzu/src/main/ets/utils/AVPlayerUtils.ts b/unionpi_tiger/sample_hzu/src/main/ets/utils/AVPlayerUtils.ts deleted file mode 100644 index 516a7109..00000000 --- a/unionpi_tiger/sample_hzu/src/main/ets/utils/AVPlayerUtils.ts +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -import media from '@ohos.multimedia.media'; -import Logger from '../model/Logger'; -const TAG: string = 'AVPlayerUtils'; -export default class AVPlayerUtils { - private avPlayer: media.AVPlayer = undefined - private avPlayerState: string = '' - private playPath: string = '' - private surfaceID: string = '' - private timeUpdateCallBack: (time: number) => void = undefined - async initVideoPlayer(playSrc: string, surfaceID: string) { - await this.release() - this.playPath = playSrc - this.surfaceID = surfaceID - this.avPlayer = await media.createAVPlayer() - Logger.info(TAG, 'createVideoPlayer') - this.setAVPlayerCallback(); - this.avPlayer.url = this.playPath - Logger.info(TAG, 'this.avPlayer.url' + this.avPlayer.url) - this.avPlayer.on('timeUpdate', (time: number) => { - Logger.info(TAG, 'timeUpdate success,and new time is :' + time) - if (this.timeUpdateCallBack) { - this.timeUpdateCallBack(time) - } - }); - Logger.info(TAG, 'init VideoPlayer finish') - } - setAVPlayerCallback() { - this.avPlayer.on('seekDone', (seekDoneTime: number) => { - Logger.info(TAG, `AVPlayer seek succeeded, seek time is ${seekDoneTime}`); - }) - this.avPlayer.on('error', err => { - Logger.error(TAG, `Invoke avPlayer failed, code is ${err.code}, message is ${err.message}`); - this.avPlayer.reset(); // 调用reset重置资源,触发idle状态 - }) - this.avPlayer.on('stateChange', async (state: string, reason: media.StateChangeReason) => { - switch (state) { - case 'idle': // 成功调用reset接口后触发该状态机上报 - Logger.info(TAG, 'AVPlayer state idle called.'); - this.avPlayerState = 'idle'; - this.avPlayer.release(); // 调用release接口销毁实例对象 - break; - case 'initialized': // avplayer 设置播放源后触发该状态上报 - Logger.info(TAG, 'AVPlayer state initialized called.'); - this.avPlayerState = 'initialized'; - this.avPlayer.surfaceId = this.surfaceID; - Logger.info(TAG, 'setDisplaySurface'); - this.avPlayer.prepare(); - break; - case 'prepared': // prepare调用成功后上报该状态机 - Logger.info(TAG, 'AVPlayer state prepared called.'); - this.avPlayerState = 'prepared'; - break; - case 'playing': // play成功调用后触发该状态机上报 - Logger.info(TAG, 'AVPlayer state playing called.'); - this.avPlayerState = 'playing'; - break; - case 'paused': // pause成功调用后触发该状态机上报 - Logger.info(TAG, 'AVPlayer state paused called.'); - this.avPlayerState = 'paused'; - break; - case 'completed': // 播放结束后触发该状态机上报 - Logger.info(TAG, 'AVPlayer state completed called.'); - this.avPlayerState = 'completed'; - break; - case 'stopped': // stop接口成功调用后触发该状态机上报 - Logger.info(TAG, 'AVPlayer state stopped called.'); - this.avPlayerState = 'stopped'; - break; - case 'released': - Logger.info(TAG, 'AVPlayer state released called.'); - this.avPlayerState = 'released'; - break; - default: - Logger.info(TAG, 'AVPlayer state unknown called.'); - break; - } - }) - } - async play() { - Logger.info(TAG, 'play') - if (typeof (this.avPlayer) != 'undefined') { - await this.avPlayer.play() - } - } - async seek(time: number) { - Logger.info(TAG, 'seek') - if (typeof (this.avPlayer) != 'undefined' && - (this.avPlayerState === 'prepared' || this.avPlayerState === 'playing' || this.avPlayerState === 'paused' || this.avPlayerState === 'completed')) { - this.avPlayer.seek(time * 1000) - } - } - async setSpeed(speed: media.PlaybackSpeed) { - Logger.info(TAG, 'setSpeed') - if (typeof (this.avPlayer) != 'undefined') { - this.avPlayer.setSpeed(speed) - } - } - async pause() { - Logger.info(TAG, 'pause') - if (typeof (this.avPlayer) != 'undefined') { - await this.avPlayer.pause() - } - } - async stop() { - Logger.info(TAG, 'stop') - if (typeof (this.avPlayer) != 'undefined') { - await this.avPlayer.stop() - } - } - async reset(playSrc: string) { - Logger.info(TAG, 'reset') - if (typeof (this.avPlayer) != 'undefined') { - this.playPath = playSrc - await this.avPlayer.reset() - this.avPlayer.url = this.playPath - await this.avPlayer.prepare() - } - } - async release() { - Logger.info(TAG, 'release') - if (typeof (this.avPlayer) != 'undefined') { - await this.avPlayer.release() - Logger.info(TAG, 'release success') - } - } - setTimeUpdateCallBackCallBack(callback) { - this.timeUpdateCallBack = callback - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample_hzu/src/main/ets/utils/DateTimeUtil.ts b/unionpi_tiger/sample_hzu/src/main/ets/utils/DateTimeUtil.ts deleted file mode 100644 index e5a950e8..00000000 --- a/unionpi_tiger/sample_hzu/src/main/ets/utils/DateTimeUtil.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -export default class DateTimeUtil { - getTime() { - const DATETIME = new Date() - return this.concatTime(DATETIME.getHours(), DATETIME.getMinutes(), DATETIME.getSeconds()) - } - getDate() { - const DATETIME = new Date() - return this.concatDate(DATETIME.getFullYear(), DATETIME.getMonth() + 1, DATETIME.getDate()) - } - fill(value: number) { - return (value > 9 ? '' : '0') + value - } - concatDate(year: number, month: number, date: number) { - return `${year}${this.fill(month)}${this.fill(date)}` - } - concatTime(hours: number, minutes: number, seconds: number) { - return `${this.fill(hours)}${this.fill(minutes)}${this.fill(seconds)}` - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample_hzu/src/main/ets/utils/MediaUtils.ts b/unionpi_tiger/sample_hzu/src/main/ets/utils/MediaUtils.ts deleted file mode 100644 index 5e4c1195..00000000 --- a/unionpi_tiger/sample_hzu/src/main/ets/utils/MediaUtils.ts +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -import image from '@ohos.multimedia.image'; -import fileio from '@ohos.fileio'; -import common from '@ohos.app.ability.common'; -import promptAction from '@ohos.promptAction'; -import mediaLibrary from '@ohos.multimedia.mediaLibrary'; -import Logger from '../model/Logger'; -import DateTimeUtil from './DateTimeUtil'; -import { GlobalThis } from './globalThis'; - -const TAG: string = 'MediaUtils'; -let context = GlobalThis.getInstance().getObject("context") as common.UIAbilityContext; -export default class MediaUtils { - private mediaList: Array = [] - private mediaLib: mediaLibrary.MediaLibrary = undefined - constructor() { - this.mediaLib = mediaLibrary.getMediaLibrary(context) - } - async createAndGetFile() { - let mediaTest = mediaLibrary.getMediaLibrary(context) - let info = { - prefix: 'IMG_', suffix: '.jpg', directory: mediaLibrary.DirectoryType.DIR_IMAGE - } - let dateTimeUtil = new DateTimeUtil() - let name = `${dateTimeUtil.getDate()}_${dateTimeUtil.getTime()}` - let displayName = `${info.prefix}${name}${info.suffix}` - let publicPath = await mediaTest.getPublicDirectory(info.directory) - Logger.info(TAG, `publicPath = ${publicPath}`) - return await mediaTest.createAsset(mediaLibrary.MediaType.IMAGE, displayName, publicPath) - } - async savePicture(data) { - Logger.info(TAG, `savePicture`) - let packOpts: image.PackingOption = { - format: "image/jpeg", quality: 100 - } - let imagePackerApi = image.createImagePacker() - let arrayBuffer = await imagePackerApi.packing(data, packOpts) - let fileAsset = await this.createAndGetFile() - let fd = await fileAsset.open('Rw') - imagePackerApi.release() - try { - await fileio.write(fd, arrayBuffer) - } catch (err) { - Logger.error(`write failed, code is ${err.code}, message is ${err.message}`) - } - await fileAsset.close(fd) - Logger.info(TAG, `write done`) - promptAction.showToast({ - message: '图片保存成功', duration: 1000 - }) - } - async getFileAssetsFromType(mediaType: number) { - Logger.info(TAG, `getFileAssetsFromType,mediaType = ${mediaType}`) - let fileKeyObj = mediaLibrary.FileKey - let fetchOp = { - selections: `${fileKeyObj.MEDIA_TYPE}=?`, - selectionArgs: [`${mediaType}`], - } - let fetchFileResult = await this.mediaLib.getFileAssets(fetchOp) - Logger.info(TAG, `getFileAssetsFromType,fetchFileResult.count = ${fetchFileResult.getCount()}`) - if (fetchFileResult.getCount() > 0) { - this.mediaList = await fetchFileResult.getAllObject() - Logger.info(TAG, `getFileAssetsFromType,fetchFileResult.count = ${JSON.stringify(this.mediaList)}`) - } - return this.mediaList - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample_hzu/src/main/ets/utils/globalThis.ts b/unionpi_tiger/sample_hzu/src/main/ets/utils/globalThis.ts deleted file mode 100644 index 67d75bfa..00000000 --- a/unionpi_tiger/sample_hzu/src/main/ets/utils/globalThis.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -export class GlobalThis { - private constructor() { - } - private static instance: GlobalThis; - private context = new Map(); - - public static getInstance(): GlobalThis { - if (!GlobalThis.instance) { - GlobalThis.instance = new GlobalThis(); - } - return GlobalThis.instance; - } - getObject(key: string): Object | undefined { - return this.context.get(key); - } - setObject(key: string, objectClass: Object): void { - this.context.set(key, objectClass); - } -} diff --git a/unionpi_tiger/sample_hzu/src/main/ets/utils/utils.ts b/unionpi_tiger/sample_hzu/src/main/ets/utils/utils.ts deleted file mode 100644 index b5052ffa..00000000 --- a/unionpi_tiger/sample_hzu/src/main/ets/utils/utils.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -export function toTime(Number: number): string { - let hour: number - let minute: number - let second: number - hour = Number / 3600 | 0 - minute = Number / 60 % 60 | 0 - second = Number % 60 | 0 - if (hour > 0) { - return (hour < 10 ? '0' + hour : hour.toString()) + ":" + (minute < 10 ? '0' + minute : minute.toString()) + ":" + (second < 10 ? '0' + second : second.toString()) - } else { - return (minute < 10 ? '0' + minute : minute.toString()) + ":" + (second < 10 ? '0' + second : second.toString()) - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample_hzu/src/main/module.json5 b/unionpi_tiger/sample_hzu/src/main/module.json5 deleted file mode 100644 index a3078d16..00000000 --- a/unionpi_tiger/sample_hzu/src/main/module.json5 +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -{ - "module": { - "name": "entry", - "type": "entry", - "description": "$string:module_desc", - "mainElement": "EntryAbility", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false, - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "EntryAbility", - "srcEntry": "./ets/entryability/EntryAbility.ts", - "description": "$string:EntryAbility_desc", - "icon": "$media:icon", - "label": "$string:EntryAbility_label", - "startWindowIcon": "$media:startIcon", - "startWindowBackground": "$color:start_window_background", - "exported": true, - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ] - } - ], - "requestPermissions": [ - { - "name": "ohos.permission.DISTRIBUTED_DATASYNC", - "reason": "$string:distributed_permission", - "usedScene": { - "abilities": [ - "EntryAbility" - ], - "when": "inuse" - } - }, - { - "name": "ohos.permission.CAPTURE_SCREEN" - }, - { - "name": "ohos.permission.READ_MEDIA", - "reason": "$string:media_reason", - "usedScene": { - "abilities": [ - "EntryAbility" - ], - "when": "inuse" - } - }, - { - "name": "ohos.permission.WRITE_MEDIA", - "reason": "$string:media_reason", - "usedScene": { - "abilities": [ - "EntryAbility" - ], - "when": "inuse" - } - } - ] - } -} \ No newline at end of file diff --git a/unionpi_tiger/sample_hzu/src/main/resources/base/element/color.json b/unionpi_tiger/sample_hzu/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962..00000000 --- a/unionpi_tiger/sample_hzu/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/unionpi_tiger/sample_hzu/src/main/resources/base/element/string.json b/unionpi_tiger/sample_hzu/src/main/resources/base/element/string.json deleted file mode 100644 index aeb72992..00000000 --- a/unionpi_tiger/sample_hzu/src/main/resources/base/element/string.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "DistributedVideoPlayer" - }, - { - "name": "choiceDevice", - "value": "choiceDevice" - }, - { - "name": "cancel", - "value": "cancel" - }, - { - "name": "distributed_permission", - "value": "Allow data exchange between different devices" - }, - { - "name": "media_reason", - "value": "Allows applications to read media files from external storage" - }, - { - "name": "link_check", - "value": "Link verification" - } - ] -} \ No newline at end of file diff --git a/unionpi_tiger/sample_hzu/src/main/resources/base/media/bj.png b/unionpi_tiger/sample_hzu/src/main/resources/base/media/bj.png deleted file mode 100644 index bb922fb2..00000000 Binary files a/unionpi_tiger/sample_hzu/src/main/resources/base/media/bj.png and /dev/null differ diff --git a/unionpi_tiger/sample_hzu/src/main/resources/base/media/dali.mp4 b/unionpi_tiger/sample_hzu/src/main/resources/base/media/dali.mp4 deleted file mode 100644 index 9dcce871..00000000 Binary files a/unionpi_tiger/sample_hzu/src/main/resources/base/media/dali.mp4 and /dev/null differ diff --git a/unionpi_tiger/sample_hzu/src/main/resources/base/media/file.png b/unionpi_tiger/sample_hzu/src/main/resources/base/media/file.png deleted file mode 100644 index 27ccabe8..00000000 Binary files a/unionpi_tiger/sample_hzu/src/main/resources/base/media/file.png and /dev/null differ diff --git a/unionpi_tiger/sample_hzu/src/main/resources/base/media/ic_back.png b/unionpi_tiger/sample_hzu/src/main/resources/base/media/ic_back.png deleted file mode 100644 index 650fa22d..00000000 Binary files a/unionpi_tiger/sample_hzu/src/main/resources/base/media/ic_back.png and /dev/null differ diff --git a/unionpi_tiger/sample_hzu/src/main/resources/base/media/ic_controlcenter_screenshot_filled.png b/unionpi_tiger/sample_hzu/src/main/resources/base/media/ic_controlcenter_screenshot_filled.png deleted file mode 100644 index 854cdfec..00000000 Binary files a/unionpi_tiger/sample_hzu/src/main/resources/base/media/ic_controlcenter_screenshot_filled.png and /dev/null differ diff --git a/unionpi_tiger/sample_hzu/src/main/resources/base/media/ic_hop.png b/unionpi_tiger/sample_hzu/src/main/resources/base/media/ic_hop.png deleted file mode 100644 index c5517e48..00000000 Binary files a/unionpi_tiger/sample_hzu/src/main/resources/base/media/ic_hop.png and /dev/null differ diff --git a/unionpi_tiger/sample_hzu/src/main/resources/base/media/ic_pause.png b/unionpi_tiger/sample_hzu/src/main/resources/base/media/ic_pause.png deleted file mode 100644 index b2b1e3fc..00000000 Binary files a/unionpi_tiger/sample_hzu/src/main/resources/base/media/ic_pause.png and /dev/null differ diff --git a/unionpi_tiger/sample_hzu/src/main/resources/base/media/ic_play.png b/unionpi_tiger/sample_hzu/src/main/resources/base/media/ic_play.png deleted file mode 100644 index 40280c25..00000000 Binary files a/unionpi_tiger/sample_hzu/src/main/resources/base/media/ic_play.png and /dev/null differ diff --git a/unionpi_tiger/sample_hzu/src/main/resources/base/media/ic_public_folder.svg b/unionpi_tiger/sample_hzu/src/main/resources/base/media/ic_public_folder.svg deleted file mode 100644 index 36b4d5e4..00000000 --- a/unionpi_tiger/sample_hzu/src/main/resources/base/media/ic_public_folder.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - Public/ic_public_folder - - - - - - - - - - \ No newline at end of file diff --git a/unionpi_tiger/sample_hzu/src/main/resources/base/media/ic_public_view_list.png b/unionpi_tiger/sample_hzu/src/main/resources/base/media/ic_public_view_list.png deleted file mode 100644 index 39646fda..00000000 Binary files a/unionpi_tiger/sample_hzu/src/main/resources/base/media/ic_public_view_list.png and /dev/null differ diff --git a/unionpi_tiger/sample_hzu/src/main/resources/base/media/ic_settings.png b/unionpi_tiger/sample_hzu/src/main/resources/base/media/ic_settings.png deleted file mode 100644 index 9813d442..00000000 Binary files a/unionpi_tiger/sample_hzu/src/main/resources/base/media/ic_settings.png and /dev/null differ diff --git a/unionpi_tiger/sample_hzu/src/main/resources/base/media/ic_wlan.svg b/unionpi_tiger/sample_hzu/src/main/resources/base/media/ic_wlan.svg deleted file mode 100644 index d231226a..00000000 --- a/unionpi_tiger/sample_hzu/src/main/resources/base/media/ic_wlan.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - Public/ic_wlan - - - - - - - - - \ No newline at end of file diff --git a/unionpi_tiger/sample_hzu/src/main/resources/base/media/icon.png b/unionpi_tiger/sample_hzu/src/main/resources/base/media/icon.png deleted file mode 100644 index c394496f..00000000 Binary files a/unionpi_tiger/sample_hzu/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/unionpi_tiger/sample_hzu/src/main/resources/base/media/mov_bbb.mp4 b/unionpi_tiger/sample_hzu/src/main/resources/base/media/mov_bbb.mp4 deleted file mode 100644 index 0a4dd5b4..00000000 Binary files a/unionpi_tiger/sample_hzu/src/main/resources/base/media/mov_bbb.mp4 and /dev/null differ diff --git a/unionpi_tiger/sample_hzu/src/main/resources/base/media/startIcon.png b/unionpi_tiger/sample_hzu/src/main/resources/base/media/startIcon.png deleted file mode 100644 index 366f7645..00000000 Binary files a/unionpi_tiger/sample_hzu/src/main/resources/base/media/startIcon.png and /dev/null differ diff --git a/unionpi_tiger/sample_hzu/src/main/resources/base/profile/main_pages.json b/unionpi_tiger/sample_hzu/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index c63089eb..00000000 --- a/unionpi_tiger/sample_hzu/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "src": [ - "pages/Settings", - "pages/videolist" - - ] -} diff --git a/unionpi_tiger/sample_hzu/src/main/resources/en_US/element/string.json b/unionpi_tiger/sample_hzu/src/main/resources/en_US/element/string.json deleted file mode 100644 index 948c841e..00000000 --- a/unionpi_tiger/sample_hzu/src/main/resources/en_US/element/string.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "DistributedVideoPlayer" - }, - { - "name": "choiceDevice", - "value": "choiceDevice" - }, - { - "name": "cancel", - "value": "cancel" - }, - { - "name": "distributed_permission", - "value": "Allow data exchange between different devices" - }, - { - "name": "media_reason", - "value": "Allows applications to read media files from external storage" - } - ] -} \ No newline at end of file diff --git a/unionpi_tiger/sample_hzu/src/main/resources/rawfile/Cloud.jpg b/unionpi_tiger/sample_hzu/src/main/resources/rawfile/Cloud.jpg deleted file mode 100644 index 41314e3a..00000000 Binary files a/unionpi_tiger/sample_hzu/src/main/resources/rawfile/Cloud.jpg and /dev/null differ diff --git a/unionpi_tiger/sample_hzu/src/main/resources/rawfile/cloud.mp4 b/unionpi_tiger/sample_hzu/src/main/resources/rawfile/cloud.mp4 deleted file mode 100644 index 9ba17fc9..00000000 Binary files a/unionpi_tiger/sample_hzu/src/main/resources/rawfile/cloud.mp4 and /dev/null differ diff --git a/unionpi_tiger/sample_hzu/src/main/resources/rawfile/desert.jpg b/unionpi_tiger/sample_hzu/src/main/resources/rawfile/desert.jpg deleted file mode 100644 index 19d07316..00000000 Binary files a/unionpi_tiger/sample_hzu/src/main/resources/rawfile/desert.jpg and /dev/null differ diff --git a/unionpi_tiger/sample_hzu/src/main/resources/rawfile/desert.mp4 b/unionpi_tiger/sample_hzu/src/main/resources/rawfile/desert.mp4 deleted file mode 100644 index 20918fa9..00000000 Binary files a/unionpi_tiger/sample_hzu/src/main/resources/rawfile/desert.mp4 and /dev/null differ diff --git a/unionpi_tiger/sample_hzu/src/main/resources/rawfile/duck.mp4 b/unionpi_tiger/sample_hzu/src/main/resources/rawfile/duck.mp4 deleted file mode 100644 index 6871a4a8..00000000 Binary files a/unionpi_tiger/sample_hzu/src/main/resources/rawfile/duck.mp4 and /dev/null differ diff --git a/unionpi_tiger/sample_hzu/src/main/resources/rawfile/duck.png b/unionpi_tiger/sample_hzu/src/main/resources/rawfile/duck.png deleted file mode 100644 index 1f193acf..00000000 Binary files a/unionpi_tiger/sample_hzu/src/main/resources/rawfile/duck.png and /dev/null differ diff --git a/unionpi_tiger/sample_hzu/src/main/resources/rawfile/flower.mp4 b/unionpi_tiger/sample_hzu/src/main/resources/rawfile/flower.mp4 deleted file mode 100644 index 88848f3d..00000000 Binary files a/unionpi_tiger/sample_hzu/src/main/resources/rawfile/flower.mp4 and /dev/null differ diff --git a/unionpi_tiger/sample_hzu/src/main/resources/rawfile/flowers.jpg b/unionpi_tiger/sample_hzu/src/main/resources/rawfile/flowers.jpg deleted file mode 100644 index 8cc088f2..00000000 Binary files a/unionpi_tiger/sample_hzu/src/main/resources/rawfile/flowers.jpg and /dev/null differ diff --git a/unionpi_tiger/sample_hzu/src/main/resources/rawfile/forest.jpg b/unionpi_tiger/sample_hzu/src/main/resources/rawfile/forest.jpg deleted file mode 100644 index 4bc6a71c..00000000 Binary files a/unionpi_tiger/sample_hzu/src/main/resources/rawfile/forest.jpg and /dev/null differ diff --git a/unionpi_tiger/sample_hzu/src/main/resources/rawfile/forest.mp4 b/unionpi_tiger/sample_hzu/src/main/resources/rawfile/forest.mp4 deleted file mode 100644 index 8eb297ab..00000000 Binary files a/unionpi_tiger/sample_hzu/src/main/resources/rawfile/forest.mp4 and /dev/null differ diff --git a/unionpi_tiger/sample_hzu/src/main/resources/zh_CN/element/string.json b/unionpi_tiger/sample_hzu/src/main/resources/zh_CN/element/string.json deleted file mode 100644 index 937e3eb2..00000000 --- a/unionpi_tiger/sample_hzu/src/main/resources/zh_CN/element/string.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "模块描述" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "分布式视频播放器" - }, - { - "name": "choiceDevice", - "value": "选择设备" - }, - { - "name": "cancel", - "value": "取消" - }, - { - "name": "distributed_permission", - "value": "用于分布式视频播放器进行不同设备间的数据交换" - }, - { - "name": "media_reason", - "value": "用于分布式视频播放器访问用户媒体文件中的地理位置信息" - } - ] -} \ No newline at end of file diff --git a/unionpi_tiger/sample_hzu/src/test/List.test.ets b/unionpi_tiger/sample_hzu/src/test/List.test.ets deleted file mode 100644 index 9b740fe6..00000000 --- a/unionpi_tiger/sample_hzu/src/test/List.test.ets +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -import localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/unionpi_tiger/sample_hzu/src/test/LocalUnit.test.ets b/unionpi_tiger/sample_hzu/src/test/LocalUnit.test.ets deleted file mode 100644 index d811e029..00000000 --- a/unionpi_tiger/sample_hzu/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2023 Unionman Technology Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest',() => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file