From 81d683f0fe51afb15812fd9ed410897a8284254d Mon Sep 17 00:00:00 2001 From: anne-lxm <1076217653@qq.com> Date: Fri, 9 Sep 2022 17:44:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BE=9D=E8=B5=96=E6=8F=92?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + pages.json | 20 +- uni_modules/uni-badge/changelog.md | 13 + .../components/uni-badge/uni-badge.vue | 158 +-- uni_modules/uni-badge/package.json | 17 +- uni_modules/uni-badge/readme.md | 52 +- uni_modules/uni-captcha/changelog.md | 32 +- .../components/uni-captcha/uni-captcha.vue | 167 +++ .../uni-popup-captcha/uni-popup-captcha.vue | 140 +++ uni_modules/uni-captcha/package.json | 14 +- uni_modules/uni-captcha/readme.md | 95 +- .../common/uni-captcha/fonts/font.ttf | Bin 0 -> 7080 bytes .../common/uni-captcha/index.js | 2 +- .../common/uni-captcha/package.json | 7 +- .../uni-captcha-co/index.obj.js | 32 + .../uni-captcha-co/package.json | 10 + .../database/opendb-verify-codes.schema.json | 45 + uni_modules/uni-card/changelog.md | 24 + .../uni-card/components/uni-card/uni-card.vue | 478 +++----- uni_modules/uni-card/package.json | 19 +- uni_modules/uni-card/readme.md | 91 +- uni_modules/uni-config-center/changelog.md | 2 + uni_modules/uni-config-center/package.json | 6 +- uni_modules/uni-config-center/readme.md | 2 +- .../common/uni-config-center/package.json | 4 +- uni_modules/uni-data-checkbox/changelog.md | 2 + .../uni-data-checkbox/uni-data-checkbox.vue | 48 +- uni_modules/uni-data-checkbox/package.json | 2 +- uni_modules/uni-data-picker/changelog.md | 6 + .../uni-data-picker/uni-data-picker.vue | 33 +- .../uni-data-pickerview.vue | 6 +- uni_modules/uni-data-picker/package.json | 5 +- uni_modules/uni-datetime-picker/changelog.md | 6 + .../uni-datetime-picker/calendar.vue | 7 +- .../uni-datetime-picker.vue | 92 +- uni_modules/uni-datetime-picker/package.json | 11 +- uni_modules/uni-easyinput/changelog.md | 6 + .../uni-easyinput/uni-easyinput.vue | 322 ++++-- uni_modules/uni-easyinput/package.json | 2 +- uni_modules/uni-fab/changelog.md | 15 + .../uni-fab/components/uni-fab/uni-fab.vue | 168 ++- uni_modules/uni-fab/package.json | 17 +- uni_modules/uni-fab/readme.md | 86 +- uni_modules/uni-file-picker/changelog.md | 2 + .../uni-file-picker/uni-file-picker.vue | 10 +- uni_modules/uni-file-picker/package.json | 2 +- uni_modules/uni-forms/changelog.md | 28 + .../uni-forms-item/uni-forms-item.vue | 1030 +++++++++-------- .../components/uni-forms/uni-forms.vue | 470 +++----- .../uni-forms/components/uni-forms/utils.js | 293 +++++ uni_modules/uni-forms/package.json | 14 +- uni_modules/uni-group/changelog.md | 13 + .../components/uni-group/uni-group.vue | 20 +- uni_modules/uni-group/package.json | 15 +- uni_modules/uni-group/readme.md | 51 +- uni_modules/uni-id/changelog.md | 91 ++ uni_modules/uni-id/package.json | 21 +- .../cloudfunctions/common/uni-id/index.js | 2 +- .../cloudfunctions/common/uni-id/package.json | 4 +- uni_modules/uni-link/changelog.md | 8 + .../uni-link/components/uni-link/uni-link.vue | 16 +- uni_modules/uni-link/package.json | 8 +- uni_modules/uni-link/readme.md | 34 +- uni_modules/uni-list/changelog.md | 9 + .../components/uni-list-ad/uni-list-ad.vue | 2 +- .../uni-list-chat/uni-list-chat.vue | 9 +- .../uni-list-item/uni-list-item.vue | 806 ++++++------- .../uni-list/components/uni-list/uni-list.vue | 4 +- uni_modules/uni-list/package.json | 6 +- uni_modules/uni-list/readme.md | 7 +- uni_modules/uni-notice-bar/changelog.md | 14 + .../uni-notice-bar/uni-notice-bar.vue | 97 +- uni_modules/uni-notice-bar/package.json | 26 +- uni_modules/uni-notice-bar/readme.md | 57 +- uni_modules/uni-number-box/changelog.md | 18 + .../uni-number-box/uni-number-box.vue | 141 +-- uni_modules/uni-number-box/package.json | 12 +- uni_modules/uni-number-box/readme.md | 36 +- uni_modules/uni-pagination/changelog.md | 2 + .../components/uni-pagination/i18n/en.json | 3 +- .../components/uni-pagination/i18n/es.json | 3 +- .../components/uni-pagination/i18n/fr.json | 3 +- .../uni-pagination/i18n/zh-Hans.json | 3 +- .../uni-pagination/i18n/zh-Hant.json | 3 +- .../uni-pagination/uni-pagination.vue | 60 +- uni_modules/uni-pagination/package.json | 2 +- uni_modules/uni-pagination/readme.md | 2 - uni_modules/uni-popup/changelog.md | 27 + .../uni-popup-dialog/uni-popup-dialog.vue | 54 +- .../uni-popup-message/uni-popup-message.vue | 2 +- .../uni-popup-share/uni-popup-share.vue | 46 +- .../components/uni-popup/i18n/en.json | 7 + .../components/uni-popup/i18n/index.js | 8 + .../components/uni-popup/i18n/zh-Hans.json | 7 + .../components/uni-popup/i18n/zh-Hant.json | 7 + .../components/uni-popup/uni-popup.vue | 775 +++++++------ uni_modules/uni-popup/package.json | 169 +-- uni_modules/uni-popup/readme.md | 285 +---- .../uni-segmented-control/changelog.md | 7 + .../uni-segmented-control.vue | 44 +- .../uni-segmented-control/package.json | 13 +- uni_modules/uni-segmented-control/readme.md | 47 +- uni_modules/uni-swipe-action/changelog.md | 32 + .../uni-swipe-action-item/bindingx.js | 28 +- .../components/uni-swipe-action-item/isPC.js | 2 +- .../uni-swipe-action-item/mpalipay.js | 24 +- .../uni-swipe-action-item/mpother.js | 41 +- .../components/uni-swipe-action-item/mpwxs.js | 100 +- .../uni-swipe-action-item/render.js | 270 +++++ .../uni-swipe-action-item.vue | 346 +++--- .../components/uni-swipe-action-item/wx.wxs | 341 ++++++ .../uni-swipe-action/uni-swipe-action.vue | 30 +- uni_modules/uni-swipe-action/package.json | 167 +-- uni_modules/uni-swipe-action/readme.md | 157 +-- uni_modules/uni-transition/changelog.md | 13 +- .../uni-transition/uni-transition.vue | 3 +- uni_modules/uni-transition/package.json | 8 +- uni_modules/uni-transition/readme.md | 390 +------ .../uni-upgrade-center-app/changelog.md | 6 +- .../uni-upgrade-center-app/package.json | 14 +- .../pages/upgrade-popup.vue | 66 +- uni_modules/uni-upgrade-center-app/readme.md | 8 +- .../uniCloud/cloudfunctions/temp.png | Bin 0 -> 7644 bytes .../utils/call-check-version.js | 25 +- uni_modules/uni-upgrade-center/changelog.md | 7 + uni_modules/uni-upgrade-center/package.json | 6 +- .../pages/components/show-info.vue | 6 +- .../pages/mixin/version_add_detail_mixin.js | 40 +- .../uni-upgrade-center/pages/version/add.vue | 92 +- .../pages/version/detail.vue | 65 +- .../uni-upgrade-center/pages/version/list.vue | 38 +- uni_modules/uni-upgrade-center/readme.md | 38 +- 132 files changed, 5278 insertions(+), 4305 deletions(-) create mode 100644 uni_modules/uni-captcha/components/uni-captcha/uni-captcha.vue create mode 100644 uni_modules/uni-captcha/components/uni-popup-captcha/uni-popup-captcha.vue create mode 100644 uni_modules/uni-captcha/uniCloud/cloudfunctions/common/uni-captcha/fonts/font.ttf create mode 100644 uni_modules/uni-captcha/uniCloud/cloudfunctions/uni-captcha-co/index.obj.js create mode 100644 uni_modules/uni-captcha/uniCloud/cloudfunctions/uni-captcha-co/package.json create mode 100644 uni_modules/uni-captcha/uniCloud/database/opendb-verify-codes.schema.json create mode 100644 uni_modules/uni-forms/components/uni-forms/utils.js create mode 100644 uni_modules/uni-popup/components/uni-popup/i18n/en.json create mode 100644 uni_modules/uni-popup/components/uni-popup/i18n/index.js create mode 100644 uni_modules/uni-popup/components/uni-popup/i18n/zh-Hans.json create mode 100644 uni_modules/uni-popup/components/uni-popup/i18n/zh-Hant.json create mode 100644 uni_modules/uni-swipe-action/components/uni-swipe-action-item/render.js create mode 100644 uni_modules/uni-swipe-action/components/uni-swipe-action-item/wx.wxs create mode 100644 uni_modules/uni-upgrade-center-app/uniCloud/cloudfunctions/temp.png diff --git a/.gitignore b/.gitignore index 1c8ab34..09c0a23 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /node_modules/ /unpackage/ /vue.config.js +/manifest.json diff --git a/pages.json b/pages.json index 7473b51..b9ff26d 100644 --- a/pages.json +++ b/pages.json @@ -182,7 +182,25 @@ "enablePullDownRefresh": false } } - ], + ,{ + "path": "uni_modules/uni-upgrade-center/pages/version/list", + "style": { + "navigationBarTitleText": "版本列表" + } +} +,{ + "path": "uni_modules/uni-upgrade-center/pages/version/add", + "style": { + "navigationBarTitleText": "新版发布" + } +} +,{ + "path": "uni_modules/uni-upgrade-center/pages/version/detail", + "style": { + "navigationBarTitleText": "版本信息查看" + } +} +], "tabBar": { "color": "#7A7E83", "selectedColor": "#1296db", diff --git a/uni_modules/uni-badge/changelog.md b/uni_modules/uni-badge/changelog.md index c3a043d..56581c4 100644 --- a/uni_modules/uni-badge/changelog.md +++ b/uni_modules/uni-badge/changelog.md @@ -1,3 +1,16 @@ +## 1.2.1(2022-09-05) +- 修复 当 text 超过 max-num 时,badge 的宽度计算是根据 text 的长度计算,更改为 css 计算实际展示宽度,详见:[https://ask.dcloud.net.cn/question/150473](https://ask.dcloud.net.cn/question/150473) +## 1.2.0(2021-11-19) +- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) +- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-badge](https://uniapp.dcloud.io/component/uniui/uni-badge) +## 1.1.7(2021-11-08) +- 优化 升级ui +- 修改 size 属性默认值调整为 small +- 修改 type 属性,默认值调整为 error,info 替换 default +## 1.1.6(2021-09-22) +- 修复 在字节小程序上样式不生效的 bug +## 1.1.5(2021-07-30) +- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) ## 1.1.4(2021-07-29) - 修复 去掉 nvue 不支持css 的 align-self 属性,nvue 下不暂支持 absolute 属性 ## 1.1.3(2021-06-24) diff --git a/uni_modules/uni-badge/components/uni-badge/uni-badge.vue b/uni_modules/uni-badge/components/uni-badge/uni-badge.vue index 1544226..498bb1c 100644 --- a/uni_modules/uni-badge/components/uni-badge/uni-badge.vue +++ b/uni_modules/uni-badge/components/uni-badge/uni-badge.vue @@ -1,9 +1,8 @@ @@ -13,25 +12,33 @@ * @description 数字角标一般和其它控件(列表、9宫格等)配合使用,用于进行数量提示,默认为实心灰色背景 * @tutorial https://ext.dcloud.net.cn/plugin?id=21 * @property {String} text 角标内容 - * @property {String} type = [default|primary|success|warning|error] 颜色类型 - * @value default 灰色 + * @property {String} size = [normal|small] 角标内容 + * @property {String} type = [info|primary|success|warning|error] 颜色类型 + * @value info 灰色 * @value primary 蓝色 * @value success 绿色 * @value warning 黄色 * @value error 红色 - * @property {String} size = [normal|small] Badge 大小 - * @value normal 一般尺寸 - * @value small 小尺寸 * @property {String} inverted = [true|false] 是否无需背景颜色 + * @property {Number} maxNum 展示封顶的数字值,超过 99 显示 99+ + * @property {String} absolute = [rightTop|rightBottom|leftBottom|leftTop] 开启绝对定位, 角标将定位到其包裹的标签的四角上 + * @value rightTop 右上 + * @value rightBottom 右下 + * @value leftTop 左上 + * @value leftBottom 左下 + * @property {Array[number]} offset 距定位角中心点的偏移量,只有存在 absolute 属性时有效,例如:[-10, -10] 表示向外偏移 10px,[10, 10] 表示向 absolute 指定的内偏移 10px + * @property {String} isDot = [true|false] 是否显示为一个小点 * @event {Function} click 点击 Badge 触发事件 * @example */ + export default { name: 'UniBadge', + emits: ['click'], props: { type: { type: String, - default: 'default' + default: 'error' }, inverted: { type: Boolean, @@ -61,7 +68,7 @@ }, size: { type: String, - default: 'normal' + default: 'small' }, customStyle: { type: Object, @@ -89,7 +96,7 @@ 'uni-badge--' + type, 'uni-badge--' + size, absolute ? 'uni-badge--absolute' : '' - ] + ].join(' ') }, positionStyle() { if (!this.absolute) return {} @@ -123,21 +130,22 @@ const match = whiteList[this.absolute] return match ? match : whiteList['rightTop'] }, - badgeWidth() { - return { - width: `${this.width}px` - } - }, dotStyle() { if (!this.isDot) return {} return { width: '10px', + minWidth: '0', height: '10px', + padding: '0', borderRadius: '10px' } }, displayValue() { - const { isDot, text, maxNum } = this + const { + isDot, + text, + maxNum + } = this return isDot ? '' : (Number(text) > maxNum ? `${maxNum}+` : text) } }, @@ -149,10 +157,16 @@ }; - diff --git a/uni_modules/uni-badge/package.json b/uni_modules/uni-badge/package.json index bb166ea..7a34d9c 100644 --- a/uni_modules/uni-badge/package.json +++ b/uni_modules/uni-badge/package.json @@ -1,7 +1,7 @@ { "id": "uni-badge", "displayName": "uni-badge 数字角标", - "version": "1.1.4", + "version": "1.2.1", "description": "数字角标(徽章)组件,在元素周围展示消息提醒,一般用于列表、九宫格、按钮等地方。", "keywords": [ "", @@ -18,11 +18,7 @@ "directories": { "example": "../../temps/example_temps" }, - "dcloudext": { - "category": [ - "前端组件", - "通用组件" - ], +"dcloudext": { "sale": { "regular": { "price": "0.00" @@ -39,10 +35,11 @@ "data": "无", "permissions": "无" }, - "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" + "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui", + "type": "component-vue" }, "uni_modules": { - "dependencies": [], + "dependencies": ["uni-scss"], "encrypt": [], "platforms": { "cloud": { @@ -77,6 +74,10 @@ "快应用": { "华为": "y", "联盟": "y" + }, + "Vue": { + "vue2": "y", + "vue3": "y" } } } diff --git a/uni_modules/uni-badge/readme.md b/uni_modules/uni-badge/readme.md index d29680b..bdf175d 100644 --- a/uni_modules/uni-badge/readme.md +++ b/uni_modules/uni-badge/readme.md @@ -1,58 +1,10 @@ - - ## Badge 数字角标 > **组件名:uni-badge** > 代码块: `uBadge` - 数字角标一般和其它控件(列表、9宫格等)配合使用,用于进行数量提示,默认为实心灰色背景, -### 安装方式 - -本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。 - -如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55) - -### 基本用法 - -在 ``template`` 中使用组件 - -```html - - - - - - - -``` - - -## API - -### Badge Props - -|属性名 |类型 |默认值 |说明 | -|:-: |:-: |:-: |:-: | -|text |String |- |角标内容 | -|type |String |default|颜色类型,可选值:default(灰色)、primary(蓝色)、success(绿色)、warning(黄色)、error(红色)| -|size |String |normal |Badge 大小,可取值:normal、small | -|is-dot |Boolean|false |不展示数字,只有一个小点 | -|max-num |String/Numbuer|99 |展示封顶的数字值,超过 99 显示99+ | -|custom-style |Object | {} |自定义 Badge 样式, 样式对象语法 | -|inverted |Boolean|false |是否无需背景颜色,为 true 时,背景颜色将变为文字的字体颜色 | -|absolute (不支持 nvue) |String| rightTop|开启绝对定位, 角标将定位到其包裹的标签的四个角上,可选值: rightTop(右上角)、rightBottom(右下角)、leftBottom(左下角) 、leftTop(左上角) | -|offset |Array[number]| [0, 0]|距定位角中心点的偏移量,[-10, -10] 表示向 absolute 指定的方向偏移 10px,[10, 10] 表示向 absolute 指定的反方向偏移 10px,只有存在 absolute 属性时有效,与absolute 的值一一对应(例如:值为rightTop, 对应 offset 为 [right, Top])| - -### Badge Events - -|事件名 |事件说明 |返回参数 | -|:-: |:-: |:-: | -|@click |点击 Badge 触发事件| - | - - - +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-badge) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 -## 组件示例 -点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/badge/badge](https://hellouniapp.dcloud.net.cn/pages/extUI/badge/badge) \ No newline at end of file diff --git a/uni_modules/uni-captcha/changelog.md b/uni_modules/uni-captcha/changelog.md index a710020..496672f 100644 --- a/uni_modules/uni-captcha/changelog.md +++ b/uni_modules/uni-captcha/changelog.md @@ -1,4 +1,32 @@ -## 0.1.1(2021-03-04) -- refresh不再读取上一条验证码状态 +## 0.6.1(2022-06-23) +- 修复:部分返回值,不符合响应体规范的问题 +## 0.6.0(2022-05-27) +- 新增:支持在`uni-config-center`中根据场景值配置 +- 修复:弹窗式验证码,输入内容后点击取消,重新打开验证码的值仍然存在的问题 +## 0.5.2(2022-05-19) +- 修复在Vue3的兼容问题 +## 0.5.1(2022-05-18) +- 修复在某些情况下微信小程序端验证码显示错误的问题 +## 0.5.0(2022-05-17) +- 新增支持在`uni-captcha-co`->`config`配置验证码 +## 0.4.1(2022-05-16) +- 新增示例项目 +## 0.4.0(2022-05-16) +- 集成创建、刷新、显示验证码的云端一体验证码组件 +- 云对象`uni-captcha-co`集成获取验证码的api,`getImageCaptcha` +## 0.3.1(2022-05-13) +- 新增 返回值符合响应体规范 +## 0.3.0(2022-05-13) +- 新增 支持 uni-config-center 配置 +## 0.2.2(2022-04-25) +- 修复 0.2.1 版本引起的使用 image 组件验证码不显示的Bug +## 0.2.1(2022-04-18) +- 更新 优化字体 +## 0.2.0(2022-04-14) +- 新增 使用 svg 表现形式更好 +- 新增 使用字体,可以任意替换默认字体 +- 新增 支持设置字体大小 +- 新增 支持忽略某些字符 +- 注意 更新之后请重新上传公共模块 ## 0.1.0(2021-03-01) - 调整为uni_modules目录规范 diff --git a/uni_modules/uni-captcha/components/uni-captcha/uni-captcha.vue b/uni_modules/uni-captcha/components/uni-captcha/uni-captcha.vue new file mode 100644 index 0000000..3d33343 --- /dev/null +++ b/uni_modules/uni-captcha/components/uni-captcha/uni-captcha.vue @@ -0,0 +1,167 @@ + + + + + \ No newline at end of file diff --git a/uni_modules/uni-captcha/components/uni-popup-captcha/uni-popup-captcha.vue b/uni_modules/uni-captcha/components/uni-popup-captcha/uni-popup-captcha.vue new file mode 100644 index 0000000..64ec5b1 --- /dev/null +++ b/uni_modules/uni-captcha/components/uni-popup-captcha/uni-popup-captcha.vue @@ -0,0 +1,140 @@ + + + + + diff --git a/uni_modules/uni-captcha/package.json b/uni_modules/uni-captcha/package.json index 7245ea0..5e20db3 100644 --- a/uni_modules/uni-captcha/package.json +++ b/uni_modules/uni-captcha/package.json @@ -1,14 +1,14 @@ { "id": "uni-captcha", "displayName": "uni-captcha", - "version": "0.1.1", - "description": "简洁、高效、灵活可配置的云端验证码模块", + "version": "0.6.1", + "description": "云端一体图形验证码组件", "keywords": [ - "uniCloud", "captcha", - "验证码", "图形验证码", - "人机验证" + "人机验证", + "防刷", + "防脚本" ], "repository": "https://gitee.com/dcloud/uni-captcha", "engines": { @@ -73,6 +73,10 @@ "快应用": { "华为": "u", "联盟": "u" + }, + "Vue": { + "vue2": "y", + "vue3": "u" } } } diff --git a/uni_modules/uni-captcha/readme.md b/uni_modules/uni-captcha/readme.md index 295d852..d929f63 100644 --- a/uni_modules/uni-captcha/readme.md +++ b/uni_modules/uni-captcha/readme.md @@ -1,92 +1,3 @@ -## uni 验证码验证文档 - -> 用途:主要使用在登录、需要人机校验或其他限制调用的场景 - -> 验证码生成、校验都在服务端。页面使用返回的 base64 显示。[云端一体登陆模板](https://ext.dcloud.net.cn/plugin?id=13)已集成,可下载体验。 - -> 数据表使用[opendb-verify-codes](https://gitee.com/dcloud/opendb/blob/master/collection/opendb-verify-codes/collection.json) - -### 获取验证码@create - -用法:`uniCaptcha.create(Object params);` - -**参数说明** - -| 字段 | 类型 | 必填 | 默认值 | 说明 | -| --------------- | ------ | ---- | ------- | ----------------------------------------------- | -| scene | String | 是 | 4 | 使用场景值,用于防止不同功能的验证码混用 | -| deviceId | String | - | - | 设备 id,如果不传,将自动从 uniCloud 上下文获取 | -| width | Number | - | 100 | 图片宽度 | -| height | Number | - | 40 | 图片高度 | -| backgroundColor | String | - | #FFFAE8 | 验证码背景色 | -| size | Number | - | 4 | 验证码长度,最多 6 个字符 | -| noise | Number | - | 4 | 验证码干扰线条数 | -| expiresDate | Number | - | 180 | 验证码过期时间(s) | - -**响应参数** - -| 字段 | 类型 | 说明 | -| ------------- | ------ | ------------------- | -| code | Number | 错误码,0 表示成功 | -| message | String | 详细信息 | -| captchaBase64 | String | 验证码:base64 格式 | - -`注意:` - -- 重新生成后,上条验证码作废 - -### 校验验证码@verify - -用法:`uniCaptcha.verify(Object params);` - -**参数说明** - -| 字段 | 类型 | 必填 | 默认值 | 说明 | -| -------- | ------ | ---- | ------ | ----------------------------------------------- | -| scene | String | 是 | - | 类型,用于防止不同功能的验证码混用 | -| captcha | String | 是 | - | 验证码 | -| deviceId | String | - | - | 设备 id,如果不传,将自动从 uniCloud 上下文获取 | - -**响应参数** - -| 字段 | 类型 | 说明 | -| ------- | ------ | ------------------ | -| code | Number | 错误码,0 表示成功 | -| message | String | 详细信息 | - -`注意:` - -- 若提示验证码失效,请重新获取 - -### 刷新验证码@refresh - -用法:`uniCaptcha.refresh(Object params);` - -**参数说明** - -| 字段 | 类型 | 必填 | 默认值 | 说明 | -| -------- | ------ | ---- | ------ | ----------------------------------------------- | -| scene | String | 是 | - | 类型,用于防止不同功能的验证码混用 | -| deviceId | String | - | - | 设备 id,如果不传,将自动从 uniCloud 上下文获取 | - -**响应参数** - -| 字段 | 类型 | 说明 | -| ------------- | ------ | ------------------- | -| code | Number | 错误码,0 表示成功 | -| message | String | 详细信息 | -| captchaBase64 | String | 验证码:base64 格式 | - -`注意:` - -- 支持传入 create 方法的所有参数,如果不传,则自动按照 deviceId 匹配上次生成时的配置生成新的验证码 - -## 错误码 - -_详细信息请查看 message 中查看_ - -| 模块 | 模块码 | 错误代码 | 错误信息 | -| :----: | :----: | :------: | :---------------------: | -| 验证码 | 100 | 01 | (10001)验证码生成失败 | -| | | 02 | (10002)验证码校验失败 | -| | | 03 | (10003)验证码刷新失败 | +

+文档已移至 uni-captcha文档 +

\ No newline at end of file diff --git a/uni_modules/uni-captcha/uniCloud/cloudfunctions/common/uni-captcha/fonts/font.ttf b/uni_modules/uni-captcha/uniCloud/cloudfunctions/common/uni-captcha/fonts/font.ttf new file mode 100644 index 0000000000000000000000000000000000000000..a60ce88613704bc7fe02dbff52043c3757a0c9d7 GIT binary patch literal 7080 zcmcgx36L9AdVYWFXw7&=cXz9Gw$zeZ8l9saNi#n1cs#!Gfx)vIGvGBg4t6j$zObES z1KF^HV^?vNvzP$c0t^Jh8b~%A3D;&TRDlx`7B+=b9K~isD#<2++GN8~Qoh%c>>-${ zO;svg_4MBB{`>vc_y6yIEk=y7es&|XF>URomD<$vdtbwy$I!m9W#{JIi;Pd*jL`tv zj$gg@(6&GO@lBsFCLClec;=d`H*bwSaSXJ|BzseU3>S5 zPl_uUi{LSPh}mg1-Nqc?e?kBiyS3BPKQoj1aF;o4oY1<++Z&-@w{6K*_7W?w!?t3( z$fj*Y_9kv~-I*=Kf0<^@`1`y?JI~lw%s5q)+1YaRZsy`_uu_SQu?1`+JKS#LKA%@H zU&J=I+wC8>-)jG;{nzckY`@Z72PD0VoW0R6)f4zJo893QU48v?;0HE{=Jt4f{y^aL}T%UmQ3mCOxEZun#&IriluU;I$SeH>W${;*xY&Z7hJS(e9=v$&}2xNyZ*y_ikg) zeFqO_4;}783sz&2WqcBojKVy{tep#nwsOU0R2m_Nk2z(v#yIBpVsxJ^vU7}o-K`heEYG_J}GS3l7H(h zkal&NVSqRHpvWC8D%@~z8`nbQT5>HEt_7bwBKrew{{yc^^8G<6oK+PfMKubtES8;d zZDli)Axfpk$mVo7T)T_Use^s}N+_2Jg@}9sSxcpaOr|-OPKjL%RbkU4t9=ne=d7Cr zTh89(yv5nJxdpzo7kvqgAWnxi!$<7^Og@>BWD6-v>G0EnW z&dzpo9D>`CtS6Hsv|7BK&FAmSS#-$pbTfP>A|hBox0y{-F*8l&z0s4^;U83nTmQCp z9nG{3U4Q-EFT8-&uwT-3pbsEB4k0gcjB!8eKAuhLmg{;sr9g^Uw1QS(iL3;@zMoR@bH0O5m2f}Hu_j@!$ zQZO3#`3acgc)A%rNC8V=$`k4NDBz$%sm2!EE zjt_K=qDZkNujdvdQ|GMa^J`{2##ONNxwfm1giVu6iT#Kc{-jv^2@>z)kGBq;J`I8n zEt|#=`(^-y)5Ri38q9)ceemx9o+07_KE69b2BXzS$0hL&Xm^HR?q5 z#>R~eTpL#BbGiKT<@p>@F2DG^>xAamhN;offz};8-=Uve4CMDPz6}BlaEv#tLIunU zC_`=wY|tFXiM=-^yaK!BvBbBekyuvYBE`R)g<+QOoF{C<;EG z&(o-{f{p@@;q_xpM_yLR)#tnF%NqA|J^-CPEX;KVEFd2bY_7Hy*?f~X^yyo!9NDJF zVmt}Y|I^};0yY&P9!t#}KYp*MhMHr^q-B7hlr4F^WcfS*3{OFS%BAxN=--o;z8y-pPwzA#GO|8h~$a`SFhYU|p7AP2q zmy!tqRoU=Hk7q&3?-hc9p++(ljWws;-bI!yF5qqn^c2x2tpd@cC9OX{QbbbYRpRA{ zxdP<90W=b5cui<<*^n}NyIP%AQaW87*3(oHO2t*HN+qJ1_a_r^qIhER{rA?EE0xNc z_wYKr&**xr#S4TvqzB9ZjnB+f?=$ZM+E3927|Y55{7l7T4d)92kq%mmoFdz6hbvpR zo7=Zm4%cXT>lwWFjMXpi=7@F+@APtwjzCmI(~9fOqx<)c-hR*MH*Xxhmu60!c>dLg zAAXe)KQGZ<@PaKClJ$aQzW!kS=HF?YEZqIG7hn9@-7pno_u*$L=sI~86%DVAX=&^A z&)QUPBhwDG&gAo)wo?m?QV}-G!pj`CJv_t6y2KsIE0^B>WK}K?FU@9&ve}7DIP5JJ zz2R`uS&v2{(P}LmiG)jJ_7w`_6GH_WbgNY|s;b*9wm#C5m9nM@f~J)#Ne#RW_-iHI zJBzoK+qk>BAU16OllRL*;jphz@P)(KMMjz^Z7dKQVO+IZ1Xr0%(d||rYHb12K`IPQ zj28-hU*b(x4OE5ReE*%rqf>>>HiNbQo~}n@vFNZS%l(zXOnPL};07=zN79+WO1~^e z(_Q7r>rsnpgoLgEBH^Oy^PIEuY+e7)?R@V;Utwon?{ObTSf-<`VSXWl@xtFy)8H~$ zr>N7lNYwtHMs{)u*VM>Qj-*na;Q>ij?b&eH@rqLoSJIJ4&JXhnJ!L~`PIeFegBVf` zLk%HPfkpm%itgtz8K~y-Hk77?NnTy|&SG_+INPP5)oB1I%}mU~t*q9PvfMX3m`aUJ z=$WHk0K<0_QA=c0LTGP8wg%Jy7+v;I<34cmdUXtd@4 zMq*L_iq_k|UCUyp?%>Xk9M<2#o%JP(;|_oW>}JJ1pYWW*A6lOiZeI|K4^BJCMCPGV74pAcNyHgT1sHAG0eG ziHsttDo+T|I;mIEO2~s?eKZ%gzPjX2JvOc-kPm=U;_*mvtjE7opj<$?@vm20S=~3X zmyBQhqV+bO5U=^^X^c>hWKfQP%%W^k&YZ3+TRFUHS>+0I1z7w$uGZWC!q?@sP8jcW z^27N$BrtaIs=3$h9lP|>F|gRZ`_{V-9lDFt14C)hBez>+NI*0xJ-m6-@WDEE`;R|v zy?Yo2Ab$2?pMnl`2)*nsK=;Xc;vyoYz#YnVrwpS{fb@l2;Av(fY56NL^LG`Ho0Aj`24wu2qUzY{Hz zQPV#{&k35aNBFjIpYVY#Y+GuZw(Yik&-O#x8@B(ld+nNiu6@1znEj6(PREGju;ZBH zDaT(p{@(Gq)9cJSw>s~4o)tsllz31)BmUgwbcI}1*F~-yU5~il?~C_M_Z{wgq3_MU z&->l|x&HC~%lfy$C*0Q)_|F0;{)%gW{a)9PojBuf@cisV)OE%-)G*%e*p9n}?$`l8 z*Slj*eJQw*oyTjCUC|v2h>7dFV;gI*-|UX->}=b%>$-hcZ{5Cc z*Phkr_U~MZ`4Vfc4VSChT2;d}Pq7;1Zt literal 0 HcmV?d00001 diff --git a/uni_modules/uni-captcha/uniCloud/cloudfunctions/common/uni-captcha/index.js b/uni_modules/uni-captcha/uniCloud/cloudfunctions/common/uni-captcha/index.js index 241fb67..b170e62 100644 --- a/uni_modules/uni-captcha/uniCloud/cloudfunctions/common/uni-captcha/index.js +++ b/uni_modules/uni-captcha/uniCloud/cloudfunctions/common/uni-captcha/index.js @@ -1 +1 @@ -"use strict";var t,e=(t=require("fs"))&&"object"==typeof t&&"default"in t?t.default:t,n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function r(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function o(t,e){return t(e={exports:{}},e.exports),e.exports}var i=o((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.font16x32=e.font12x24=e.font8x16=void 0;var n="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";e.font8x16={w:8,h:16,fonts:n,data:[[0,0,0,0,0,0,0,60,66,30,34,66,66,63,0,0],[0,0,0,192,64,64,64,88,100,66,66,66,100,88,0,0],[0,0,0,0,0,0,0,28,34,64,64,64,34,28,0,0],[0,0,0,6,2,2,2,30,34,66,66,66,38,27,0,0],[0,0,0,0,0,0,0,60,66,126,64,64,66,60,0,0],[0,0,0,15,17,16,16,126,16,16,16,16,16,124,0,0],[0,0,0,0,0,0,0,62,68,68,56,64,60,66,66,60],[0,0,0,192,64,64,64,92,98,66,66,66,66,231,0,0],[0,0,0,48,48,0,0,112,16,16,16,16,16,124,0,0],[0,0,0,12,12,0,0,28,4,4,4,4,4,4,68,120],[0,0,0,192,64,64,64,78,72,80,104,72,68,238,0,0],[0,0,0,112,16,16,16,16,16,16,16,16,16,124,0,0],[0,0,0,0,0,0,0,254,73,73,73,73,73,237,0,0],[0,0,0,0,0,0,0,220,98,66,66,66,66,231,0,0],[0,0,0,0,0,0,0,60,66,66,66,66,66,60,0,0],[0,0,0,0,0,0,0,216,100,66,66,66,68,120,64,224],[0,0,0,0,0,0,0,30,34,66,66,66,34,30,2,7],[0,0,0,0,0,0,0,238,50,32,32,32,32,248,0,0],[0,0,0,0,0,0,0,62,66,64,60,2,66,124,0,0],[0,0,0,0,0,16,16,124,16,16,16,16,16,12,0,0],[0,0,0,0,0,0,0,198,66,66,66,66,70,59,0,0],[0,0,0,0,0,0,0,231,66,36,36,40,16,16,0,0],[0,0,0,0,0,0,0,215,146,146,170,170,68,68,0,0],[0,0,0,0,0,0,0,110,36,24,24,24,36,118,0,0],[0,0,0,0,0,0,0,231,66,36,36,40,24,16,16,224],[0,0,0,0,0,0,0,126,68,8,16,16,34,126,0,0],[0,0,0,16,16,24,40,40,36,60,68,66,66,231,0,0],[0,0,0,248,68,68,68,120,68,66,66,66,68,248,0,0],[0,0,0,62,66,66,128,128,128,128,128,66,68,56,0,0],[0,0,0,248,68,66,66,66,66,66,66,66,68,248,0,0],[0,0,0,252,66,72,72,120,72,72,64,66,66,252,0,0],[0,0,0,252,66,72,72,120,72,72,64,64,64,224,0,0],[0,0,0,60,68,68,128,128,128,142,132,68,68,56,0,0],[0,0,0,231,66,66,66,66,126,66,66,66,66,231,0,0],[0,0,0,124,16,16,16,16,16,16,16,16,16,124,0,0],[0,0,0,62,8,8,8,8,8,8,8,8,8,8,136,240],[0,0,0,238,68,72,80,112,80,72,72,68,68,238,0,0],[0,0,0,224,64,64,64,64,64,64,64,64,66,254,0,0],[0,0,0,238,108,108,108,108,84,84,84,84,84,214,0,0],[0,0,0,199,98,98,82,82,74,74,74,70,70,226,0,0],[0,0,0,56,68,130,130,130,130,130,130,130,68,56,0,0],[0,0,0,252,66,66,66,66,124,64,64,64,64,224,0,0],[0,0,0,56,68,130,130,130,130,130,178,202,76,56,6,0],[0,0,0,252,66,66,66,124,72,72,68,68,66,227,0,0],[0,0,0,62,66,66,64,32,24,4,2,66,66,124,0,0],[0,0,0,254,146,16,16,16,16,16,16,16,16,56,0,0],[0,0,0,231,66,66,66,66,66,66,66,66,66,60,0,0],[0,0,0,231,66,66,68,36,36,40,40,24,16,16,0,0],[0,0,0,214,146,146,146,146,170,170,108,68,68,68,0,0],[0,0,0,231,66,36,36,24,24,24,36,36,66,231,0,0],[0,0,0,238,68,68,40,40,16,16,16,16,16,56,0,0],[0,0,0,126,132,4,8,8,16,32,32,66,66,252,0,0],[0,0,0,24,36,66,66,66,66,66,66,66,36,24,0,0],[0,0,0,16,112,16,16,16,16,16,16,16,16,124,0,0],[0,0,0,60,66,66,66,4,4,8,16,32,66,126,0,0],[0,0,0,60,66,66,4,24,4,2,2,66,68,56,0,0],[0,0,0,4,12,20,36,36,68,68,126,4,4,30,0,0],[0,0,0,126,64,64,64,88,100,2,2,66,68,56,0,0],[0,0,0,28,36,64,64,88,100,66,66,66,36,24,0,0],[0,0,0,126,68,68,8,8,16,16,16,16,16,16,0,0],[0,0,0,60,66,66,66,36,24,36,66,66,66,60,0,0],[0,0,0,24,36,66,66,66,38,26,2,2,36,56,0,0]]},e.font12x24={w:12,h:24,fonts:n,data:[[0,0,0,0,0,0,0,0,0,0,15,48,48,7,28,48,96,96,96,113,62,0,0,0,0,0,0,0,0,0,0,0,0,0,128,192,192,192,192,192,192,192,192,208,240,0,0,0],[0,0,0,0,16,112,48,48,48,48,51,60,56,48,48,48,48,48,48,56,47,0,0,0,0,0,0,0,0,0,0,0,0,0,128,192,96,96,96,96,96,96,64,192,128,0,0,0],[0,0,0,0,0,0,0,0,0,0,15,49,49,97,96,96,96,96,48,48,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,128,128,0,0,0,64,64,128,0,0,0,0],[0,0,0,0,0,1,0,0,0,0,30,49,48,96,96,96,96,96,32,49,30,0,0,0,0,0,0,0,64,192,192,192,192,192,192,192,192,192,192,192,192,192,192,224,128,0,0,0],[0,0,0,0,0,0,0,0,0,0,7,24,16,48,63,48,48,48,24,28,7,0,0,0,0,0,0,0,0,0,0,0,0,0,128,192,96,96,224,0,0,0,32,64,128,0,0,0],[0,0,0,0,0,3,6,12,12,12,127,12,12,12,12,12,12,12,12,12,63,0,0,0,0,0,0,0,0,192,96,96,0,0,192,0,0,0,0,0,0,0,0,0,128,0,0,0],[0,0,0,0,0,0,0,0,0,0,15,25,48,48,48,25,31,48,62,31,96,96,112,31,0,0,0,0,0,0,0,0,0,0,112,144,192,192,192,128,0,0,0,192,96,96,224,128],[0,0,0,0,16,112,48,48,48,48,55,56,48,48,48,48,48,48,48,48,121,0,0,0,0,0,0,0,0,0,0,0,0,0,128,192,192,192,192,192,192,192,192,192,224,0,0,0],[0,0,0,0,0,6,6,0,0,0,62,6,6,6,6,6,6,6,6,6,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,0,0,0],[0,0,0,0,0,1,1,0,0,0,15,1,1,1,1,1,1,1,1,1,1,1,51,62,0,0,0,0,0,128,128,0,0,0,128,128,128,128,128,128,128,128,128,128,128,128,0,0],[0,0,0,0,16,112,48,48,48,48,51,49,51,50,54,62,59,51,49,49,121,0,0,0,0,0,0,0,0,0,0,0,0,0,192,0,0,0,0,0,0,0,128,128,224,0,0,0],[0,0,0,0,2,62,6,6,6,6,6,6,6,6,6,6,6,6,6,6,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,0,0,0],[0,0,0,0,0,0,0,0,0,0,238,119,102,102,102,102,102,102,102,102,247,0,0,0,0,0,0,0,0,0,0,0,0,0,224,96,96,96,96,96,96,96,96,96,112,0,0,0],[0,0,0,0,0,0,0,0,0,0,115,60,48,48,48,48,48,48,48,48,121,0,0,0,0,0,0,0,0,0,0,0,0,0,128,192,192,192,192,192,192,192,192,192,224,0,0,0],[0,0,0,0,0,0,0,0,0,0,15,25,48,96,96,96,96,96,48,48,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,192,96,96,96,96,96,192,192,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,119,56,48,48,48,48,48,48,48,56,55,48,48,124,0,0,0,0,0,0,0,0,0,0,128,192,96,96,96,96,96,96,192,192,128,0,0,0],[0,0,0,0,0,0,0,0,0,0,30,49,48,96,96,96,96,96,32,49,30,0,0,3,0,0,0,0,0,0,0,0,0,0,64,192,192,192,192,192,192,192,192,192,192,192,192,224],[0,0,0,0,0,0,0,0,0,0,249,26,28,24,24,24,24,24,24,24,255,0,0,0,0,0,0,0,0,0,0,0,0,0,224,96,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,15,24,48,48,28,15,1,32,32,48,63,0,0,0,0,0,0,0,0,0,0,0,0,0,224,96,32,0,0,128,192,96,96,192,128,0,0,0],[0,0,0,0,0,0,4,4,12,12,127,12,12,12,12,12,12,12,12,12,7,0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,0,0,0,0,0,0,64,64,128,0,0,0],[0,0,0,0,0,0,0,0,0,16,113,48,48,48,48,48,48,48,48,57,30,0,0,0,0,0,0,0,0,0,0,0,0,64,192,192,192,192,192,192,192,192,192,224,128,0,0,0],[0,0,0,0,0,0,0,0,0,0,124,56,24,24,12,12,12,7,7,7,2,0,0,0,0,0,0,0,0,0,0,0,0,0,240,96,64,64,128,128,128,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,247,99,99,103,55,53,57,57,57,16,16,0,0,0,0,0,0,0,0,0,0,0,0,0,176,32,32,32,32,192,192,192,192,128,128,0,0,0],[0,0,0,0,0,0,0,0,0,0,125,24,25,13,14,6,7,11,25,17,123,0,0,0,0,0,0,0,0,0,0,0,0,0,224,128,128,0,0,0,0,0,128,192,224,0,0,0],[0,0,0,0,0,0,0,0,0,0,125,56,24,24,13,13,13,6,6,2,4,4,40,56,0,0,0,0,0,0,0,0,0,0,224,128,128,128,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,63,33,35,3,7,6,14,12,28,24,63,0,0,0,0,0,0,0,0,0,0,0,0,0,192,128,128,0,0,0,0,32,32,96,192,0,0,0],[0,0,0,0,0,6,6,14,11,11,19,17,17,17,31,32,32,32,32,96,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,128,128,128,192,192,192,96,96,240,0,0,0],[0,0,0,0,0,255,97,96,96,96,96,97,127,96,96,96,96,96,96,96,255,0,0,0,0,0,0,0,0,0,128,192,192,192,192,128,0,192,64,96,96,96,96,192,128,0,0,0],[0,0,0,0,0,7,24,48,48,32,96,96,96,96,96,96,96,48,48,24,15,0,0,0,0,0,0,0,0,224,96,32,32,0,0,0,0,0,0,0,32,32,64,128,0,0,0,0],[0,0,0,0,0,254,97,96,96,96,96,96,96,96,96,96,96,96,96,99,254,0,0,0,0,0,0,0,0,0,128,192,192,96,96,96,96,96,96,96,96,192,192,128,0,0,0,0],[0,0,0,0,0,255,96,96,96,96,97,97,127,97,97,96,96,96,96,96,255,0,0,0,0,0,0,0,0,192,64,32,0,0,0,0,0,0,0,0,0,32,32,64,192,0,0,0],[0,0,0,0,0,255,96,96,96,96,97,97,127,97,97,96,96,96,96,96,240,0,0,0,0,0,0,0,0,192,192,32,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,15,24,48,48,32,96,96,96,96,99,96,96,48,48,24,15,0,0,0,0,0,0,0,0,64,192,64,64,0,0,0,0,0,240,192,192,192,192,192,0,0,0,0],[0,0,0,0,0,240,96,96,96,96,96,96,127,96,96,96,96,96,96,96,240,0,0,0,0,0,0,0,0,240,96,96,96,96,96,96,224,96,96,96,96,96,96,96,240,0,0,0],[0,0,0,0,0,63,6,6,6,6,6,6,6,6,6,6,6,6,6,6,63,0,0,0,0,0,0,0,0,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,0,0,0],[0,0,0,0,0,15,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,97,99,62,0,0,0,0,0,240,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,0,0],[0,0,0,0,0,243,96,97,98,98,100,108,124,118,103,99,99,97,96,96,241,0,0,0,0,0,0,0,0,224,128,0,0,0,0,0,0,0,0,0,128,128,192,224,240,0,0,0],[0,0,0,0,0,240,96,96,96,96,96,96,96,96,96,96,96,96,96,96,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,32,64,192,0,0,0],[0,0,0,0,0,240,112,112,112,89,89,89,89,90,78,78,78,78,68,68,228,0,0,0,0,0,0,0,0,240,224,224,224,96,96,96,96,96,96,96,96,96,96,96,240,0,0,0],[0,0,0,0,0,224,112,112,88,88,76,70,70,67,67,65,64,64,64,64,224,0,0,0,0,0,0,0,0,112,32,32,32,32,32,32,32,32,32,160,224,224,96,96,32,0,0,0],[0,0,0,0,0,15,25,48,48,96,96,96,96,96,96,96,96,48,48,25,15,0,0,0,0,0,0,0,0,0,128,192,64,96,96,96,96,96,96,96,96,64,192,128,0,0,0,0],[0,0,0,0,0,255,96,96,96,96,96,96,96,127,96,96,96,96,96,96,240,0,0,0,0,0,0,0,0,128,192,96,96,96,96,96,192,128,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,15,25,48,48,96,96,96,96,96,96,96,110,50,49,17,15,1,0,0,0,0,0,0,0,0,128,192,64,96,96,96,96,96,96,96,96,64,192,128,128,224,192,0],[0,0,0,0,0,255,96,96,96,96,96,96,127,102,99,99,97,97,96,96,240,0,0,0,0,0,0,0,0,128,192,96,96,96,96,192,0,0,0,0,128,128,192,192,112,0,0,0],[0,0,0,0,0,31,48,96,96,96,112,60,15,3,0,0,64,64,96,112,79,0,0,0,0,0,0,0,0,32,224,32,32,0,0,0,0,192,192,96,96,96,96,192,128,0,0,0],[0,0,0,0,0,127,70,134,134,6,6,6,6,6,6,6,6,6,6,6,15,0,0,0,0,0,0,0,0,224,32,16,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,240,96,96,96,96,96,96,96,96,96,96,96,96,96,48,31,0,0,0,0,0,0,0,0,112,32,32,32,32,32,32,32,32,32,32,32,32,32,64,128,0,0,0],[0,0,0,0,0,248,112,48,48,48,48,24,24,24,24,13,13,13,15,6,6,0,0,0,0,0,0,0,0,240,96,64,64,64,128,128,128,128,128,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,247,102,102,102,102,103,55,55,59,59,59,59,57,17,17,17,0,0,0,0,0,0,0,0,112,32,32,64,64,64,64,64,128,128,128,128,128,0,0,0,0,0,0],[0,0,0,0,0,121,48,24,24,25,13,14,6,6,7,11,11,25,17,48,121,0,0,0,0,0,0,0,0,224,192,128,128,0,0,0,0,0,0,0,128,128,128,192,224,0,0,0],[0,0,0,0,0,248,112,48,48,24,24,13,13,14,6,6,6,6,6,6,31,0,0,0,0,0,0,0,0,240,96,64,128,128,128,0,0,0,0,0,0,0,0,0,128,0,0,0],[0,0,0,0,0,63,32,65,1,3,3,3,6,6,12,12,24,24,56,48,127,0,0,0,0,0,0,0,0,224,192,192,128,128,0,0,0,0,0,0,0,32,32,64,192,0,0,0],[0,0,0,0,0,15,25,48,48,96,96,96,96,96,96,96,96,48,48,25,15,0,0,0,0,0,0,0,0,0,128,192,192,96,96,96,96,96,96,96,96,192,192,128,0,0,0,0],[0,0,0,0,0,2,6,62,6,6,6,6,6,6,6,6,6,6,6,6,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,0,0,0],[0,0,0,0,0,31,33,64,96,96,0,1,1,3,4,8,16,32,64,127,127,0,0,0,0,0,0,0,0,0,128,192,192,192,192,128,128,0,0,0,64,64,64,192,192,0,0,0],[0,0,0,0,0,30,35,97,97,97,1,3,14,1,0,0,96,96,96,33,31,0,0,0,0,0,0,0,0,0,0,128,128,128,128,0,0,128,128,192,192,192,192,128,0,0,0,0],[0,0,0,0,0,1,3,3,5,9,9,17,33,33,65,127,1,1,1,1,7,0,0,0,0,0,0,0,128,128,128,128,128,128,128,128,128,128,128,224,128,128,128,128,224,0,0,0],[0,0,0,0,0,63,63,32,32,32,32,47,49,32,0,0,96,96,65,33,31,0,0,0,0,0,0,0,0,192,192,0,0,0,0,0,128,192,192,192,192,192,128,128,0,0,0,0],[0,0,0,0,0,7,24,48,48,32,96,103,104,112,96,96,96,32,48,24,15,0,0,0,0,0,0,0,0,128,192,192,0,0,0,128,192,96,96,96,96,96,64,192,0,0,0,0],[0,0,0,0,0,31,63,48,32,32,0,1,1,2,2,2,6,6,6,6,6,0,0,0,0,0,0,0,0,224,224,64,128,128,128,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,31,48,96,96,96,112,60,15,51,32,96,96,96,96,48,15,0,0,0,0,0,0,0,0,128,192,96,96,96,64,192,0,128,192,96,96,96,96,192,128,0,0,0],[0,0,0,0,0,15,48,48,96,96,96,96,96,49,30,0,0,0,48,49,30,0,0,0,0,0,0,0,0,0,128,192,64,96,96,96,224,96,96,96,192,192,128,128,0,0,0,0]]},e.font16x32={w:16,h:32,fonts:n,data:[[0,0,0,0,0,0,0,0,0,0,0,0,0,15,24,48,48,0,1,14,56,48,96,96,96,48,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,96,48,48,48,240,48,48,48,48,48,50,242,28,0,0,0,0,0],[0,0,0,0,0,8,120,24,24,24,24,24,24,24,27,28,28,24,24,24,24,24,24,24,28,30,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,24,12,6,6,6,6,6,6,6,4,12,24,224,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,3,14,24,24,48,48,48,48,48,48,24,24,12,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,224,48,24,24,24,0,0,0,0,4,4,8,16,224,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,7,12,24,24,48,48,48,48,48,48,16,24,12,7,0,0,0,0,0,0,0,0,0,0,8,120,24,24,24,24,24,24,216,56,24,24,24,24,24,24,24,24,24,56,94,144,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,3,12,24,16,48,48,63,48,48,48,24,24,14,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,224,48,24,8,12,12,252,0,0,0,4,8,24,224,0,0,0,0,0],[0,0,0,0,0,0,0,1,1,3,3,3,3,63,3,3,3,3,3,3,3,3,3,3,3,3,31,0,0,0,0,0,0,0,0,0,0,0,124,195,3,3,0,0,0,248,0,0,0,0,0,0,0,0,0,0,0,0,240,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,3,12,8,24,24,24,8,12,15,24,24,15,15,16,48,48,48,28,7,0,0,0,0,0,0,0,0,0,0,0,0,0,238,54,24,24,24,24,24,48,224,0,0,240,252,14,6,6,6,28,240],[0,0,0,0,0,8,120,24,24,24,24,24,24,25,27,28,24,24,24,24,24,24,24,24,24,24,126,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,24,12,12,12,12,12,12,12,12,12,12,12,63,0,0,0,0,0],[0,0,0,0,0,0,1,1,1,0,0,0,0,31,1,1,1,1,1,1,1,1,1,1,1,1,31,0,0,0,0,0,0,0,0,0,0,0,192,192,192,0,0,0,128,128,128,128,128,128,128,128,128,128,128,128,128,128,248,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,24,15,0,0,0,0,0,0,28,28,28,0,0,0,8,248,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,48,96,192],[0,0,0,0,0,8,120,24,24,24,24,24,24,24,24,24,24,24,25,27,28,24,24,24,24,24,126,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,124,48,96,192,128,128,128,192,224,96,48,56,24,62,0,0,0,0,0],[0,0,0,0,0,0,31,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,31,0,0,0,0,0,0,0,0,0,0,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,248,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,16,119,57,49,49,49,49,49,49,49,49,49,49,49,123,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56,204,140,140,140,140,140,140,140,140,140,140,140,222,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,8,120,27,28,24,24,24,24,24,24,24,24,24,24,126,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,24,12,12,12,12,12,12,12,12,12,12,12,63,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,3,14,8,24,48,48,48,48,48,48,24,24,12,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,224,56,12,12,6,6,6,6,6,6,12,12,24,224,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,8,121,26,28,24,24,24,24,24,24,24,24,28,30,25,24,24,24,24,126,0,0,0,0,0,0,0,0,0,0,0,0,0,240,24,12,4,6,6,6,6,6,6,12,12,24,224,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,3,12,24,24,48,48,48,48,48,48,16,24,12,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,196,60,28,12,12,12,12,12,12,12,12,28,60,204,12,12,12,12,63],[0,0,0,0,0,0,0,0,0,0,0,0,6,126,6,6,7,7,6,6,6,6,6,6,6,6,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,102,134,0,0,0,0,0,0,0,0,0,0,224,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,7,12,24,24,24,14,7,1,0,32,32,48,56,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,228,28,12,4,0,0,192,240,56,12,12,12,24,240,0,0,0,0,0],[0,0,0,0,0,0,0,0,1,1,1,3,7,63,3,3,3,3,3,3,3,3,3,3,3,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,248,0,0,0,0,0,0,0,0,0,4,4,136,240,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,8,120,24,24,24,24,24,24,24,24,24,24,24,12,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,60,12,12,12,12,12,12,12,12,12,12,28,47,200,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,126,24,24,28,12,12,14,6,6,7,3,3,3,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,24,16,16,32,32,64,64,64,128,128,128,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,251,113,48,49,49,25,25,26,26,14,14,14,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,239,198,196,196,196,200,200,104,104,112,112,112,32,32,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,63,14,14,7,3,3,1,1,2,6,4,8,24,124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,124,16,32,32,64,128,192,192,224,96,48,48,24,126,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,126,24,24,12,12,12,6,6,3,3,3,1,1,1,1,1,1,50,60,0,0,0,0,0,0,0,0,0,0,0,0,0,62,24,16,16,16,32,32,32,64,64,64,128,128,128,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,63,48,32,32,0,1,1,3,7,14,12,28,56,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,248,48,112,96,192,192,128,0,0,4,4,12,24,248,0,0,0,0,0],[0,0,0,0,0,0,3,3,3,2,6,4,4,4,12,8,8,8,31,16,16,16,48,32,32,96,248,0,0,0,0,0,0,0,0,0,0,128,128,128,128,128,192,192,192,192,96,96,96,96,240,48,48,48,48,24,24,24,62,0,0,0,0,0],[0,0,0,0,0,0,127,24,24,24,24,24,24,24,24,31,24,24,24,24,24,24,24,24,24,24,127,0,0,0,0,0,0,0,0,0,0,0,224,56,28,12,12,12,12,24,48,224,24,12,4,6,6,6,6,6,12,24,240,0,0,0,0,0],[0,0,0,0,0,0,3,6,8,24,48,48,32,96,96,96,96,96,96,96,96,48,48,48,24,12,3,0,0,0,0,0,0,0,0,0,0,0,228,28,12,4,2,2,0,0,0,0,0,0,0,0,0,2,2,4,12,24,224,0,0,0,0,0],[0,0,0,0,0,0,127,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,127,0,0,0,0,0,0,0,0,0,0,0,192,112,24,12,12,12,6,6,6,6,6,6,6,6,6,12,12,8,24,112,192,0,0,0,0,0],[0,0,0,0,0,0,127,24,24,24,24,24,24,24,24,31,24,24,24,24,24,24,24,24,24,24,127,0,0,0,0,0,0,0,0,0,0,0,252,12,4,6,2,0,16,16,48,240,48,16,16,0,0,0,2,2,4,12,252,0,0,0,0,0],[0,0,0,0,0,0,127,24,24,24,24,24,24,24,24,31,24,24,24,24,24,24,24,24,24,24,126,0,0,0,0,0,0,0,0,0,0,0,254,14,2,3,1,0,8,8,24,248,24,8,8,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,3,14,8,24,48,48,32,96,96,96,96,96,96,96,96,48,48,24,24,12,3,0,0,0,0,0,0,0,0,0,0,0,200,56,8,8,4,4,0,0,0,0,0,0,63,12,12,12,12,12,12,16,224,0,0,0,0,0],[0,0,0,0,0,0,252,48,48,48,48,48,48,48,48,48,63,48,48,48,48,48,48,48,48,48,252,0,0,0,0,0,0,0,0,0,0,0,126,24,24,24,24,24,24,24,24,24,248,24,24,24,24,24,24,24,24,24,126,0,0,0,0,0],[0,0,0,0,0,0,31,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,31,0,0,0,0,0,0,0,0,0,0,0,248,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,248,0,0,0,0,0],[0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,112,113,63,0,0,0,0,0,0,254,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,192,128,0],[0,0,0,0,0,0,126,24,24,24,24,24,24,25,25,27,29,28,24,24,24,24,24,24,24,24,126,0,0,0,0,0,0,0,0,0,0,0,62,24,16,32,96,64,128,128,128,128,192,192,224,96,112,48,56,24,12,12,63,0,0,0,0,0],[0,0,0,0,0,0,126,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,4,12,252,0,0,0,0,0],[0,0,0,0,0,0,248,56,56,56,56,44,44,44,44,46,38,38,38,38,35,35,35,35,35,33,249,0,0,0,0,0,0,0,0,0,0,0,31,28,28,28,60,44,44,44,108,76,76,76,76,140,140,140,140,12,12,12,63,0,0,0,0,0],[0,0,0,0,0,0,248,56,60,44,44,46,38,39,35,35,33,33,32,32,32,32,32,32,32,32,248,0,0,0,0,0,0,0,0,0,0,0,62,8,8,8,8,8,8,8,8,136,136,200,200,232,104,120,56,56,56,24,24,0,0,0,0,0],[0,0,0,0,0,0,3,12,24,16,48,48,96,96,96,96,96,96,96,96,96,48,48,16,24,12,3,0,0,0,0,0,0,0,0,0,0,0,192,48,24,8,12,12,6,6,6,6,6,6,6,6,6,4,12,8,24,48,192,0,0,0,0,0],[0,0,0,0,0,0,127,24,24,24,24,24,24,24,24,24,31,24,24,24,24,24,24,24,24,24,126,0,0,0,0,0,0,0,0,0,0,0,240,24,12,6,6,6,6,6,12,24,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,3,12,24,48,48,48,96,96,96,96,96,96,96,96,96,39,52,56,24,12,3,0,0,0,0,0,0,0,0,0,0,0,192,48,24,8,12,4,6,6,6,6,6,6,6,6,6,134,204,76,104,112,224,50,62,28,0,0],[0,0,0,0,0,0,127,24,24,24,24,24,24,24,24,31,25,24,24,24,24,24,24,24,24,24,126,0,0,0,0,0,0,0,0,0,0,0,224,56,28,12,12,12,12,24,48,224,192,192,224,96,96,112,48,48,56,24,30,0,0,0,0,0],[0,0,0,0,0,0,7,12,24,48,48,48,48,24,30,7,1,0,0,0,0,32,32,16,24,28,19,0,0,0,0,0,0,0,0,0,0,0,228,28,12,4,4,0,0,0,0,192,240,120,28,14,6,6,6,6,12,24,240,0,0,0,0,0],[0,0,0,0,0,0,63,49,33,65,65,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,7,0,0,0,0,0,0,0,0,0,0,0,252,132,134,130,130,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,224,0,0,0,0,0],[0,0,0,0,0,0,252,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,16,28,7,0,0,0,0,0,0,0,0,0,0,0,62,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,16,32,192,0,0,0,0,0],[0,0,0,0,0,0,124,24,24,24,12,12,12,12,6,6,6,7,3,3,3,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,31,4,4,4,8,8,8,8,16,16,16,48,32,32,32,192,192,192,192,128,128,0,0,0,0,0],[0,0,0,0,0,0,251,97,97,97,49,48,49,49,49,49,50,26,26,26,28,28,28,12,8,8,8,0,0,0,0,0,0,0,0,0,0,0,207,134,132,132,132,132,196,200,200,200,200,72,104,112,112,112,112,48,32,32,32,0,0,0,0,0],[0,0,0,0,0,0,126,24,28,12,12,14,6,7,3,3,1,1,2,2,4,4,8,8,16,16,124,0,0,0,0,0,0,0,0,0,0,0,124,16,16,32,32,64,64,128,128,128,128,192,192,224,96,96,48,48,24,24,62,0,0,0,0,0],[0,0,0,0,0,0,126,56,24,24,12,12,14,6,6,3,3,3,1,1,1,1,1,1,1,1,7,0,0,0,0,0,0,0,0,0,0,0,62,8,8,16,16,48,32,32,64,64,64,128,128,128,128,128,128,128,128,128,224,0,0,0,0,0],[0,0,0,0,0,0,31,24,16,32,32,0,0,0,1,1,3,3,7,6,14,12,28,24,56,48,127,0,0,0,0,0,0,0,0,0,0,0,252,24,24,48,112,96,224,192,192,128,128,0,0,0,0,0,4,4,8,24,248,0,0,0,0,0],[0,0,0,0,0,0,3,6,12,24,24,24,48,48,48,48,48,48,48,48,48,24,24,24,12,6,3,0,0,0,0,0,0,0,0,0,0,0,224,48,24,12,12,4,6,6,6,6,6,6,6,6,6,4,12,12,24,48,224,0,0,0,0,0],[0,0,0,0,0,0,0,1,31,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3,31,0,0,0,0,0,0,0,0,0,0,0,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,192,248,0,0,0,0,0],[0,0,0,0,0,0,7,8,16,32,32,48,48,0,0,0,0,0,0,1,2,4,8,16,32,63,63,0,0,0,0,0,0,0,0,0,0,0,224,56,24,12,12,12,12,12,24,16,32,64,128,0,0,4,4,4,12,248,248,0,0,0,0,0],[0,0,0,0,0,0,7,24,48,48,48,48,0,0,0,3,0,0,0,0,0,48,48,48,48,24,7,0,0,0,0,0,0,0,0,0,0,0,192,112,48,24,24,24,24,48,96,192,112,24,8,12,12,12,12,8,24,48,192,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,1,1,2,6,4,8,8,16,32,32,127,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,48,112,112,240,112,112,112,112,112,112,112,112,112,112,254,112,112,112,112,112,112,254,0,0,0,0],[0,0,0,0,0,0,15,15,8,8,8,16,16,19,20,24,16,0,0,0,0,48,48,32,32,16,15,0,0,0,0,0,0,0,0,0,0,0,252,252,0,0,0,0,0,224,48,24,8,12,12,12,12,12,12,24,24,48,192,0,0,0,0,0],[0,0,0,0,0,0,1,3,4,8,24,24,16,48,49,54,60,56,48,48,48,48,24,24,12,6,3,0,0,0,0,0,0,0,0,0,0,0,240,8,12,12,0,0,0,0,240,24,12,6,6,6,6,6,6,4,12,24,224,0,0,0,0,0],[0,0,0,0,0,0,31,31,56,48,32,32,0,0,0,0,0,0,1,1,1,3,3,3,3,3,3,0,0,0,0,0,0,0,0,0,0,0,252,252,8,16,16,32,32,64,64,128,128,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,7,12,24,48,48,48,56,28,14,7,13,24,48,96,96,96,96,96,48,24,7,0,0,0,0,0,0,0,0,0,0,0,224,48,24,12,12,12,12,24,16,224,224,112,56,28,12,12,12,12,24,48,192,0,0,0,0,0],[0,0,0,0,0,0,7,24,48,48,96,96,96,96,96,96,48,24,15,0,0,0,0,48,48,48,15,0,0,0,0,0,0,0,0,0,0,0,192,32,16,24,8,12,12,12,12,28,60,108,140,12,24,24,24,48,96,192,128,0,0,0,0,0]]}}));r(i);i.font16x32,i.font12x24,i.font8x16;var a=o((function(t,r){var o=n&&n.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{s(r.next(t))}catch(t){i(t)}}function c(t){try{s(r.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,c)}s((r=r.apply(t,e||[])).next())}))},a=n&&n.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]>16&255,green:n>>8&255,blue:255&n})},t.prototype.drawPointRGB=function(t,e,n){if(!(t>=this.w||e>=this.h||t<0||e<0)){var r=this.h-e-1,o=54+3*t+this._lineByteNum*r;this._data.writeUInt8(n.blue,o),this._data.writeUInt8(n.green,o+1),this._data.writeUInt8(n.red,o+2)}},t.prototype.getPointRGB=function(t,e){if(t>=this.w||e>=this.h||t<0||e<0)throw new Error("out of range");var n=this.h-e-1,r=54+3*t+this._lineByteNum*n;return{blue:this._data.readUInt8(r),green:this._data.readUInt8(r+1),red:this._data.readUInt8(r+2)}},t.prototype.drawLineH=function(t,e,n,r){if(t>e){var o=e;e=t,t=o}for(;t<=e;t++)this.drawPoint(t,n,r)},t.prototype.drawLineV=function(t,e,n,r){if(t>e){var o=e;e=t,t=o}for(;t<=e;t++)this.drawPoint(n,t,r)},t.prototype.drawLine=function(t,e,n,r,o){var i=t,a=e,c=n>t?n-t:t-n,s=r>e?r-e:e-r,d=!1,f=n>t?1:-1,u=r>e?1:-1;if(s>c){var h=c;c=s,s=h,d=!0}for(var l=(s<<1)-c,w=0;w<=c;w++)this.drawPoint(i,a,o),l>=0&&(d?i+=f:a+=u,l-=c<<1),d?a+=u:i+=f,l+=s<<1},t.prototype.drawRect=function(t,e,n,r,o){var i=t+n-1,a=e+r-1;this.drawLineH(t,i,e,o),this.drawLineH(t,i,a,o),this.drawLineV(e,a,t,o),this.drawLineV(e,a,i,o)},t.prototype.fillRect=function(t,e,n,r,o){var i=t+n-1,a=e+r-1;if(t>i){var c=i;i=t,t=c}if(e>a){c=a;a=e,e=c}for(;e<=a;e++)for(var s=t;s<=i;s++)this.drawPoint(s,e,o)},t.prototype.drawCircle=function(t,e,n,r){for(var o=0,i=n,a=3-2*n;o0;f<<=1)128&f&&this.drawPoint(c,a,o),c++;++a-n>=r.h&&(a=n,e+=8)}},t.prototype.drawString=function(t,e,n,r,o){for(var i=0,a=t;i(t.includes(r)&&n.push(e[r]),n),[]);return n[Math.random()*n.length|0]}function u(t={}){const e=["small","medium","big"],n={backgroundColor:16775912,size:4,noise:4,width:100,height:40,fontSize:["medium","big"]};let{backgroundColor:r,size:o,noise:i,width:a,height:s,fontSize:f}=Object.assign({},n,t);"string"==typeof r&&(r=r.replace("#","0x")),f instanceof Array||(f=[]),f.filter(t=>e.includes(t)),f.length||(f=n.fontSize),o=o>6?6:o;const u=new c(a,s);u.fillRect(0,0,a,s,r),function(t,e){for(let n=1;n>16,r=e>>8&255,o=255&e,i=Math.max(n,r,o),a=Math.min(n,r,o);return(i+a)/510}(t):1;let o,i;r>=.5?(o=Math.round(100*r)-45,i=Math.round(100*r)-25):(o=Math.round(100*r)+25,i=Math.round(100*r)+45);const a=h(o,i)/100,c=a<.5?a*(a+n):a+n-a*n,s=2*a-c,d=Math.floor(255*w(s,c,e+1/3)),f=Math.floor(255*w(s,c,e));return"#"+(Math.floor(255*w(s,c,e-1/3))|f<<8|d<<16|1<<24).toString(16).slice(1)};function w(t,e,n){return 6*(n=(n+1)%1)<1?t+(e-t)*n*6:2*n<1?e:3*n<2?t+(e-t)*(2/3-n)*6:t}const p=Object.prototype.toString;function g(t){return"[object Object]"===p.call(t)}function y(){"development"===process.env.NODE_ENV&&console.log(...arguments)}const v=async function(){};function m(t){return v.constructor===t.constructor?async function(){const e=await t.apply(this,arguments);return g(e)&&e.msg&&(e.message=e.msg),e}:function(){const e=t.apply(this,arguments);return g(e)&&e.msg&&(e.message=e.msg),e}}const b=uniCloud.database().collection("opendb-verify-codes"),_={};var I=Object.freeze({__proto__:null,create:async function(t={}){let{scene:e,expiresDate:n,deviceId:r,...o}=t;if(r=r||__ctx__.DEVICEID,!r)throw new Error("deviceId不可为空");if(!e)throw new Error("scene验证码场景不可为空");try{const{text:i,base64:a}=u(o),c=await this.setVerifyCode({deviceId:r,code:i,expiresDate:n,scene:e});return c.code>0?{...c,code:10001}:(_[r]=t,{code:0,msg:"验证码获取成功",captchaBase64:a})}catch(t){return{code:10001,msg:"验证码生成失败:"+t.message}}},verify:async function({deviceId:t,captcha:e,scene:n}){if(!(t=t||__ctx__.DEVICEID))throw new Error("deviceId不可为空");if(!n)throw new Error("scene验证码场景不可为空");try{const r=await this.verifyCode({deviceId:t,code:e,scene:n});return r.code>0?{...r,code:10002}:{code:0,msg:"验证码通过"}}catch(t){return{code:10002,msg:"验证码校验失败:"+t.message}}},refresh:async function(t={}){let{scene:e,expiresDate:n,deviceId:r,...o}=t;if(r=r||__ctx__.DEVICEID,!r)throw new Error("deviceId不可为空");if(!e)throw new Error("scene验证码场景不可为空");const i=await b.where({deviceId:r,scene:e}).orderBy("created_date","desc").limit(1).get();if(i&&i.data&&i.data.length>0){const t=i.data[0];await b.doc(t._id).update({state:2});let a={};Object.keys(o).length>0&&(_[r]=Object.assign({},_[r],o)),a=_[r];let c={};try{c=await this.create(Object.assign({},a,{deviceId:r,scene:e,expiresDate:n}))}catch(t){return{code:50403,msg:t.message}}return c.code>0?{...c,code:10003}:{code:0,msg:"验证码刷新成功",captchaBase64:c.captchaBase64}}return{code:10003,msg:`验证码刷新失败:无此设备在${e}场景信息,请重新获取`}},setVerifyCode:async function({deviceId:t,code:e,expiresDate:n,scene:r}){if(!t)return{code:10101,msg:"deviceId不可为空"};if(!e)return{code:10102,msg:"验证码不可为空"};n||(n=180);const o=Date.now(),i={deviceId:t,scene:r,code:e.toLocaleLowerCase(),state:0,ip:__ctx__.CLIENTIP,created_date:o,expired_date:o+1e3*n};return y("addRes",await b.add(i)),{code:0,deviceId:t}},verifyCode:async function({deviceId:t,code:e,scene:n}){if(!t)return{code:10101,msg:"deviceId不可为空"};if(!e)return{code:10102,msg:"验证码不可为空"};const r=Date.now(),o={deviceId:t,scene:n,code:e.toLocaleLowerCase(),state:0},i=await b.where(o).orderBy("created_date","desc").limit(1).get();if(y("verifyRecord:",i),i&&i.data&&i.data.length>0){const t=i.data[0];if(t.expired_date=1)throw RangeError("spliteCurveAt requires position > 0 && position < 1");return u=[],p=0,i={},l={},c={},i.x=t,i.y=n,l.x=o,l.y=r,c.x=s,c.y=a,h=e,u[p++]=i.x,u[p++]=i.y,u[p++]=i.x+=(l.x-i.x)*h,u[p++]=i.y+=(l.y-i.y)*h,l.x+=(c.x-l.x)*h,l.y+=(c.y-l.y)*h,u[p++]=i.x+(l.x-i.x)*h,u[p++]=i.y+(l.y-i.y)*h,u[p++]=l.x,u[p++]=l.y,u[p++]=c.x,u[p++]=c.y,u}function l(e,t){return Math.random()*(t-e)+e}var c=function(e,t){const n=e[0];o.default(n,"expect a string");const r=t.fontSize,s=r/t.font.unitsPerEm,c=t.font.charToGlyph(n),u=c.advanceWidth?c.advanceWidth*s:0,p=t.x-u/2,h=(t.ascender+t.descender)*s,f=t.y+h/2,d=c.getPath(p,f,r);d.commands.forEach(a),d.commands=function(e,t){const n=[];for(let o=0;ot.truncateLineProbability){const e=l(-.1,.1);n.push(r),n.push({type:"L",x:(r.x+s.x)/2+e,y:(r.y+s.y)/2+e})}else n.push(r)}else if("Q"===r.type&&o>=1){const s=e[o-1];if(("L"===s.type||"M"===s.type)&&Math.random()>t.truncateCurveProbability){const e=s.x,o=s.y,a=l(-.1,.1),c=r.x1+a,u=r.y1+a,p=r.x+a,h=r.y+a,f=i(l(t.truncateCurvePositionMin,t.truncateCurvePositionMax),e,o,c,u,p,h),d={type:"Q",x1:f[2],y1:f[3],x:f[4],y:f[5]},g={type:"L",x:f[4],y:f[5]},m={type:"Q",x1:f[6],y1:f[7],x:f[8],y:f[9]},y={type:"L",x:f[8],y:f[9]};n.push(d),n.push(g),n.push(m),n.push(y)}}else n.push(r)}return n}(d.commands,t);return d.toPathData()};function u(){this.table=new Uint16Array(16),this.trans=new Uint16Array(288)}function p(e,t){this.source=e,this.sourceIndex=0,this.tag=0,this.bitcount=0,this.dest=t,this.destLen=0,this.ltree=new u,this.dtree=new u}var h=new u,f=new u,d=new Uint8Array(30),g=new Uint16Array(30),m=new Uint8Array(30),y=new Uint16Array(30),v=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),b=new u,S=new Uint8Array(320);function x(e,t,n,o){var r,s;for(r=0;r>>=1,t}function O(e,t,n){if(!t)return n;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>16-t;return e.tag>>>=t,e.bitcount-=t,o+n}function w(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>=1,++r,n+=t.table[r],o-=t.table[r]}while(o>=0);return e.tag=s,e.bitcount-=r,t.trans[n+o]}function k(e,t,n){var o,r,s,a,i,l;for(o=O(e,5,257),r=O(e,5,1),s=O(e,4,4),a=0;a<19;++a)S[a]=0;for(a=0;a8;)e.sourceIndex--,e.bitcount-=8;if((t=256*(t=e.source[e.sourceIndex+1])+e.source[e.sourceIndex])!==(65535&~(256*e.source[e.sourceIndex+3]+e.source[e.sourceIndex+2])))return-3;for(e.sourceIndex+=4,n=t;n;--n)e.dest[e.destLen++]=e.source[e.sourceIndex++];return e.bitcount=0,0}!function(e,t){var n;for(n=0;n<7;++n)e.table[n]=0;for(e.table[7]=24,e.table[8]=152,e.table[9]=112,n=0;n<24;++n)e.trans[n]=256+n;for(n=0;n<144;++n)e.trans[24+n]=n;for(n=0;n<8;++n)e.trans[168+n]=280+n;for(n=0;n<112;++n)e.trans[176+n]=144+n;for(n=0;n<5;++n)t.table[n]=0;for(t.table[5]=32,n=0;n<32;++n)t.trans[n]=n}(h,f),x(d,g,4,3),x(m,y,2,1),d[28]=0,g[28]=258;var C=function(e,t){var n,o,r=new p(e,t);do{switch(n=E(r),O(r,2,0)){case 0:o=D(r);break;case 1:o=R(r,h,f);break;case 2:k(r,r.ltree,r.dtree),o=R(r,r.ltree,r.dtree);break;default:o=-3}if(0!==o)throw new Error("Data error")}while(!n);return r.destLenthis.x2&&(this.x2=e)),"number"==typeof t&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),tthis.y2&&(this.y2=t))},I.prototype.addX=function(e){this.addPoint(e,null)},I.prototype.addY=function(e){this.addPoint(null,e)},I.prototype.addBezier=function(e,t,n,o,r,s,a,i){const l=[e,t],c=[n,o],u=[r,s],p=[a,i];this.addPoint(e,t),this.addPoint(a,i);for(let e=0;e<=1;e++){const t=6*l[e]-12*c[e]+6*u[e],n=-3*l[e]+9*c[e]-9*u[e]+3*p[e],o=3*c[e]-3*l[e];if(0===n){if(0===t)continue;const n=-o/t;0=0&&n>0&&(e+=" "),e+=t(o)}return e}e=void 0!==e?e:2;let o="";for(let e=0;e=0&&e<=255,"Byte value should be between 0 and 255."),[e]},F.BYTE=H(1),A.CHAR=function(e){return[e.charCodeAt(0)]},F.CHAR=H(1),A.CHARARRAY=function(e){const t=[];for(let n=0;n>8&255,255&e]},F.USHORT=H(2),A.SHORT=function(e){return e>=32768&&(e=-(65536-e)),[e>>8&255,255&e]},F.SHORT=H(2),A.UINT24=function(e){return[e>>16&255,e>>8&255,255&e]},F.UINT24=H(3),A.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},F.ULONG=H(4),A.LONG=function(e){return e>=2147483648&&(e=-(4294967296-e)),[e>>24&255,e>>16&255,e>>8&255,255&e]},F.LONG=H(4),A.FIXED=A.ULONG,F.FIXED=F.ULONG,A.FWORD=A.SHORT,F.FWORD=F.SHORT,A.UFWORD=A.USHORT,F.UFWORD=F.USHORT,A.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,255&e]},F.LONGDATETIME=H(8),A.TAG=function(e){return N.argument(4===e.length,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},F.TAG=H(4),A.Card8=A.BYTE,F.Card8=F.BYTE,A.Card16=A.USHORT,F.Card16=F.USHORT,A.OffSize=A.BYTE,F.OffSize=F.BYTE,A.SID=A.USHORT,F.SID=F.USHORT,A.NUMBER=function(e){return e>=-107&&e<=107?[e+139]:e>=108&&e<=1131?[247+((e-=108)>>8),255&e]:e>=-1131&&e<=-108?[251+((e=-e-108)>>8),255&e]:e>=-32768&&e<=32767?A.NUMBER16(e):A.NUMBER32(e)},F.NUMBER=function(e){return A.NUMBER(e).length},A.NUMBER16=function(e){return[28,e>>8&255,255&e]},F.NUMBER16=H(3),A.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,255&e]},F.NUMBER32=H(5),A.REAL=function(e){let t=e.toString();const n=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t);if(n){const o=parseFloat("1e"+((n[2]?+n[2]:0)+n[1].length));t=(Math.round(e*o)/o).toString()}let o="";for(let e=0,n=t.length;e>8&255,t[t.length]=255&o}return t},F.UTF16=function(e){return 2*e.length};const z={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈Ć«Č… ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüÝ°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};P.MACSTRING=function(e,t,n,o){const r=z[o];if(void 0===r)return;let s="";for(let o=0;o=-128&&e<=127}function X(e,t,n){let o=0;const r=e.length;for(;t>8&255,t+256&255)}return s}A.MACSTRING=function(e,t){const n=function(e){if(!_){_={};for(let e in z)_[e]=new String(e)}const t=_[e];if(void 0===t)return;if(W){const e=W.get(t);if(void 0!==e)return e}const n=z[e];if(void 0===n)return;const o={};for(let e=0;e=128&&(r=n[r],void 0===r))return;o[t]=r}return o},F.MACSTRING=function(e,t){const n=A.MACSTRING(e,t);return void 0!==n?n.length:0},A.VARDELTAS=function(e){let t=0;const n=[];for(;t=-128&&o<=127?V(e,t,n):j(e,t,n)}return n},A.INDEX=function(e){let t=1;const n=[t],o=[];for(let r=0;r>8,t[s+1]=255&a,t=t.concat(o[n])}return t},F.TABLE=function(e){let t=0;const n=e.fields.length;for(let o=0;o0)return new ce(this.data,this.offset+t).parseStruct(e)},ce.prototype.parseListOfLists=function(e){const t=this.parseOffset16List(),n=t.length,o=this.relativeOffset,r=new Array(n);for(let o=0;o=0;r-=1){const n=pe.getUShort(e,t+4+8*r),s=pe.getUShort(e,t+4+8*r+2);if(3===n&&(0===s||1===s||10===s)){o=pe.getULong(e,t+4+8*r+4);break}}if(-1===o)throw new Error("No valid cmap sub-tables found.");const r=new pe.Parser(e,t+o);if(n.format=r.parseUShort(),12===n.format)!function(e,t){let n;t.parseUShort(),e.length=t.parseULong(),e.language=t.parseULong(),e.groupCount=n=t.parseULong(),e.glyphIndexMap={};for(let o=0;o>1,t.skip("uShort",3),e.glyphIndexMap={};const a=new pe.Parser(n,o+r+14),i=new pe.Parser(n,o+r+16+2*s),l=new pe.Parser(n,o+r+16+4*s),c=new pe.Parser(n,o+r+16+6*s);let u=o+r+16+8*s;for(let t=0;t0?(s=e.parseByte(),0==(t&r)&&(s=-s),s=n+s):s=(t&r)>0?n:n+e.parseShort(),s}function Ee(e,t,n){const o=new pe.Parser(t,n);let r,s;if(e.numberOfContours=o.parseShort(),e._xMin=o.parseShort(),e._yMin=o.parseShort(),e._xMax=o.parseShort(),e._yMax=o.parseShort(),e.numberOfContours>0){const t=e.endPointIndices=[];for(let n=0;n0){const t=o.parseByte();for(let n=0;n0){const a=[];let i;if(n>0){for(let e=0;e=0,a.push(i);let e=0;for(let t=0;t0?(2&r)>0?(n.dx=o.parseShort(),n.dy=o.parseShort()):n.matchedPoints=[o.parseUShort(),o.parseUShort()]:(2&r)>0?(n.dx=o.parseChar(),n.dy=o.parseChar()):n.matchedPoints=[o.parseByte(),o.parseByte()],(8&r)>0?n.xScale=n.yScale=o.parseF2Dot14():(64&r)>0?(n.xScale=o.parseF2Dot14(),n.yScale=o.parseF2Dot14()):(128&r)>0&&(n.xScale=o.parseF2Dot14(),n.scale01=o.parseF2Dot14(),n.scale10=o.parseF2Dot14(),n.yScale=o.parseF2Dot14()),e.components.push(n),t=!!(32&r)}if(256&r){e.instructionLength=o.parseUShort(),e.instructions=[];for(let t=0;tt.points.length-1||o.matchedPoints[1]>r.points.length-1)throw Error("Matched points out of range in "+t.name);const n=t.points[o.matchedPoints[0]];let s=r.points[o.matchedPoints[1]];const a={xScale:o.xScale,scale01:o.scale01,scale10:o.scale10,yScale:o.yScale,dx:0,dy:0};s=Oe([s],a)[0],a.dx=n.x-s.x,a.dy=n.y-s.y,e=Oe(r.points,a)}t.points=t.points.concat(e)}}return we(t.points)}var Re={getPath:we,parse:function(e,t,n,o){const r=new Ie.GlyphSet(o);for(let s=0;s>4,s=15&o;if(15===r)break;if(t+=n[r],15===s)break;t+=n[s]}return parseFloat(t)}(e);if(t>=32&&t<=246)return t-139;if(t>=247&&t<=250)return n=e.parseByte(),256*(t-247)+n+108;if(t>=251&&t<=254)return n=e.parseByte(),256*-(t-251)-n-108;throw new Error("Invalid b0 "+t)}function Pe(e,t,n){t=void 0!==t?t:0;const o=new pe.Parser(e,t),r=[];let s=[];for(n=void 0!==n?n:e.length;o.relativeOffset>1,l.length=0,d=!0}return function n(p){let x,U,T,E,O,w,k,R,D,C,L,I,M=0;for(;M1&&!d&&(v=l.shift()+h,d=!0),y+=l.pop(),b(m,y);break;case 5:for(;l.length>0;)m+=l.shift(),y+=l.shift(),i.lineTo(m,y);break;case 6:for(;l.length>0&&(m+=l.shift(),i.lineTo(m,y),0!==l.length);)y+=l.shift(),i.lineTo(m,y);break;case 7:for(;l.length>0&&(y+=l.shift(),i.lineTo(m,y),0!==l.length);)m+=l.shift(),i.lineTo(m,y);break;case 8:for(;l.length>0;)o=m+l.shift(),r=y+l.shift(),s=o+l.shift(),a=r+l.shift(),m=s+l.shift(),y=a+l.shift(),i.curveTo(o,r,s,a,m,y);break;case 10:O=l.pop()+u,w=c[O],w&&n(w);break;case 11:return;case 12:switch(B=p[M],M+=1,B){case 35:o=m+l.shift(),r=y+l.shift(),s=o+l.shift(),a=r+l.shift(),k=s+l.shift(),R=a+l.shift(),D=k+l.shift(),C=R+l.shift(),L=D+l.shift(),I=C+l.shift(),m=L+l.shift(),y=I+l.shift(),l.shift(),i.curveTo(o,r,s,a,k,R),i.curveTo(D,C,L,I,m,y);break;case 34:o=m+l.shift(),r=y,s=o+l.shift(),a=r+l.shift(),k=s+l.shift(),R=a,D=k+l.shift(),C=a,L=D+l.shift(),I=y,m=L+l.shift(),i.curveTo(o,r,s,a,k,R),i.curveTo(D,C,L,I,m,y);break;case 36:o=m+l.shift(),r=y+l.shift(),s=o+l.shift(),a=r+l.shift(),k=s+l.shift(),R=a,D=k+l.shift(),C=a,L=D+l.shift(),I=C+l.shift(),m=L+l.shift(),i.curveTo(o,r,s,a,k,R),i.curveTo(D,C,L,I,m,y);break;case 37:o=m+l.shift(),r=y+l.shift(),s=o+l.shift(),a=r+l.shift(),k=s+l.shift(),R=a+l.shift(),D=k+l.shift(),C=R+l.shift(),L=D+l.shift(),I=C+l.shift(),Math.abs(L-m)>Math.abs(I-y)?m=L+l.shift():y=I+l.shift(),i.curveTo(o,r,s,a,k,R),i.curveTo(D,C,L,I,m,y);break;default:console.log("Glyph "+t.index+": unknown operator 1200"+B),l.length=0}break;case 14:l.length>0&&!d&&(v=l.shift()+h,d=!0),g&&(i.closePath(),g=!1);break;case 18:S();break;case 19:case 20:S(),M+=f+7>>3;break;case 21:l.length>2&&!d&&(v=l.shift()+h,d=!0),y+=l.pop(),m+=l.pop(),b(m,y);break;case 22:l.length>1&&!d&&(v=l.shift()+h,d=!0),m+=l.pop(),b(m,y);break;case 23:S();break;case 24:for(;l.length>2;)o=m+l.shift(),r=y+l.shift(),s=o+l.shift(),a=r+l.shift(),m=s+l.shift(),y=a+l.shift(),i.curveTo(o,r,s,a,m,y);m+=l.shift(),y+=l.shift(),i.lineTo(m,y);break;case 25:for(;l.length>6;)m+=l.shift(),y+=l.shift(),i.lineTo(m,y);o=m+l.shift(),r=y+l.shift(),s=o+l.shift(),a=r+l.shift(),m=s+l.shift(),y=a+l.shift(),i.curveTo(o,r,s,a,m,y);break;case 26:for(l.length%2&&(m+=l.shift());l.length>0;)o=m,r=y+l.shift(),s=o+l.shift(),a=r+l.shift(),m=s,y=a+l.shift(),i.curveTo(o,r,s,a,m,y);break;case 27:for(l.length%2&&(y+=l.shift());l.length>0;)o=m+l.shift(),r=y,s=o+l.shift(),a=r+l.shift(),m=s+l.shift(),y=a,i.curveTo(o,r,s,a,m,y);break;case 28:x=p[M],U=p[M+1],l.push((x<<24|U<<16)>>16),M+=2;break;case 29:O=l.pop()+e.gsubrsBias,w=e.gsubrs[O],w&&n(w);break;case 30:for(;l.length>0&&(o=m,r=y+l.shift(),s=o+l.shift(),a=r+l.shift(),m=s+l.shift(),y=a+(1===l.length?l.shift():0),i.curveTo(o,r,s,a,m,y),0!==l.length);)o=m+l.shift(),r=y,s=o+l.shift(),a=r+l.shift(),y=a+l.shift(),m=s+(1===l.length?l.shift():0),i.curveTo(o,r,s,a,m,y);break;case 31:for(;l.length>0&&(o=m+l.shift(),r=y,s=o+l.shift(),a=r+l.shift(),y=a+l.shift(),m=s+(1===l.length?l.shift():0),i.curveTo(o,r,s,a,m,y),0!==l.length);)o=m,r=y+l.shift(),s=o+l.shift(),a=r+l.shift(),m=s+l.shift(),y=a+(1===l.length?l.shift():0),i.curveTo(o,r,s,a,m,y);break;default:B<32?console.log("Glyph "+t.index+": unknown operator "+B):B<247?l.push(B-139):B<251?(x=p[M],M+=1,l.push(256*(B-247)+x+108)):B<255?(x=p[M],M+=1,l.push(256*-(B-251)-x-108)):(x=p[M],U=p[M+1],T=p[M+2],E=p[M+3],M+=4,l.push((x<<24|U<<16|T<<8|E)/65536))}}}(n),t.advanceWidth=v,i}function Ve(e,t){let n,o=de.indexOf(e);return o>=0&&(n=o),o=t.indexOf(e),o>=0?n=o+de.length:(n=de.length+t.length,t.push(e)),n}function je(e,t,n){const o={};for(let r=0;r=o)throw new Error("CFF table CID Font FDSelect has bad FD index value "+s+" (FD count "+o+")");r.push(s)}else{if(3!==i)throw new Error("CFF Table CID Font FDSelect table has unsupported format "+i);{const e=a.parseCard16();let t,i=a.parseCard16();if(0!==i)throw new Error("CFF Table CID Font FDSelect format 3 range has bad initial GID "+i);for(let l=0;l=o)throw new Error("CFF table CID Font FDSelect has bad FD index value "+s+" (FD count "+o+")");if(t>n)throw new Error("CFF Table CID Font FDSelect format 3 range has bad GID "+t);for(;i=1&&(n.ulCodePageRange1=o.parseULong(),n.ulCodePageRange2=o.parseULong()),n.version>=2&&(n.sxHeight=o.parseShort(),n.sCapHeight=o.parseShort(),n.usDefaultChar=o.parseUShort(),n.usBreakChar=o.parseUShort(),n.usMaxContent=o.parseUShort()),n},make:function(e){return new oe.Table("OS/2",[{name:"version",type:"USHORT",value:3},{name:"xAvgCharWidth",type:"SHORT",value:0},{name:"usWeightClass",type:"USHORT",value:0},{name:"usWidthClass",type:"USHORT",value:0},{name:"fsType",type:"USHORT",value:0},{name:"ySubscriptXSize",type:"SHORT",value:650},{name:"ySubscriptYSize",type:"SHORT",value:699},{name:"ySubscriptXOffset",type:"SHORT",value:0},{name:"ySubscriptYOffset",type:"SHORT",value:140},{name:"ySuperscriptXSize",type:"SHORT",value:650},{name:"ySuperscriptYSize",type:"SHORT",value:699},{name:"ySuperscriptXOffset",type:"SHORT",value:0},{name:"ySuperscriptYOffset",type:"SHORT",value:479},{name:"yStrikeoutSize",type:"SHORT",value:49},{name:"yStrikeoutPosition",type:"SHORT",value:258},{name:"sFamilyClass",type:"SHORT",value:0},{name:"bFamilyType",type:"BYTE",value:0},{name:"bSerifStyle",type:"BYTE",value:0},{name:"bWeight",type:"BYTE",value:0},{name:"bProportion",type:"BYTE",value:0},{name:"bContrast",type:"BYTE",value:0},{name:"bStrokeVariation",type:"BYTE",value:0},{name:"bArmStyle",type:"BYTE",value:0},{name:"bLetterform",type:"BYTE",value:0},{name:"bMidline",type:"BYTE",value:0},{name:"bXHeight",type:"BYTE",value:0},{name:"ulUnicodeRange1",type:"ULONG",value:0},{name:"ulUnicodeRange2",type:"ULONG",value:0},{name:"ulUnicodeRange3",type:"ULONG",value:0},{name:"ulUnicodeRange4",type:"ULONG",value:0},{name:"achVendID",type:"CHARARRAY",value:"XXXX"},{name:"fsSelection",type:"USHORT",value:0},{name:"usFirstCharIndex",type:"USHORT",value:0},{name:"usLastCharIndex",type:"USHORT",value:0},{name:"sTypoAscender",type:"SHORT",value:0},{name:"sTypoDescender",type:"SHORT",value:0},{name:"sTypoLineGap",type:"SHORT",value:0},{name:"usWinAscent",type:"USHORT",value:0},{name:"usWinDescent",type:"USHORT",value:0},{name:"ulCodePageRange1",type:"ULONG",value:0},{name:"ulCodePageRange2",type:"ULONG",value:0},{name:"sxHeight",type:"SHORT",value:0},{name:"sCapHeight",type:"SHORT",value:0},{name:"usDefaultChar",type:"USHORT",value:0},{name:"usBreakChar",type:"USHORT",value:0},{name:"usMaxContext",type:"USHORT",value:0}],e)},unicodeRanges:gt,getUnicodeRange:function(e){for(let t=0;t=n.begin&&e=ye.length){const e=o.parseChar();n.names.push(o.parseString(e))}break;case 2.5:n.numberOfGlyphs=o.parseUShort(),n.offset=new Array(n.numberOfGlyphs);for(let e=0;et.value.tag?1:-1})),t.fields=t.fields.concat(o),t.fields=t.fields.concat(r),t}function kt(e,t,n){for(let n=0;n0){return e.glyphs.get(o).getMetrics()}}return n}function Rt(e){let t=0;for(let n=0;nm||void 0===l)&&m>0&&(l=m),c 123 are reserved for internal usage");f|=1<0?tt.make(w):void 0,D=yt.make(),C=$e.make(e.glyphs,{version:e.getEnglishName("version"),fullName:T,familyName:x,weightName:U,postScriptName:E,unitsPerEm:e.unitsPerEm,fontBBox:[0,d.yMin,d.ascender,d.advanceWidthMax]}),L=e.metas&&Object.keys(e.metas).length>0?Ut.make(e.metas):void 0,I=[g,m,y,v,k,S,D,C,b];R&&I.push(R),e.tables.gsub&&I.push(xt.make(e.tables.gsub)),L&&I.push(L);const M=wt(I),B=Et(M.encode()),G=M.fields;let N=!1;for(let e=0;e>>1,s=e[r].tag;if(s===t)return r;s>>1,s=e[r];if(s===t)return r;s=0)return o[r].script;if(t){const t={tag:e,script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}};return o.splice(-1-r,0,t),t.script}}},getLangSysTable:function(e,t,n){const o=this.getScriptTable(e,n);if(o){if(!t||"dflt"===t||"DFLT"===t)return o.defaultLangSys;const e=Ct(o.langSysRecords,t);if(e>=0)return o.langSysRecords[e].langSys;if(n){const n={tag:t,langSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]}};return o.langSysRecords.splice(-1-e,0,n),n.langSys}}},getFeatureTable:function(e,t,n,o){const r=this.getLangSysTable(e,t,o);if(r){let e;const t=r.featureIndexes,s=this.font.tables[this.tableName].features;for(let o=0;o=s[o-1].tag,"Features must be added in alphabetical order."),e={tag:n,feature:{params:0,lookupListIndexes:[]}},s.push(e),t.push(o),e.feature}}},getLookupTables:function(e,t,n,o,r){const s=this.getFeatureTable(e,t,n,r),a=[];if(s){let e;const t=s.lookupListIndexes,n=this.font.tables[this.tableName].lookups;for(let r=0;r=0){const e=s.ligatureSets[c];for(let t=0;t0&&e<0?n:o<0&&e>0?-n:e*o},Zt={x:1,y:0,axis:"x",distance:function(e,t,n,o){return(n?e.xo:e.x)-(o?t.xo:t.x)},interpolate:function(e,t,n,o){let r,s,a,i,l,c,u;if(!o||o===this)return r=e.xo-t.xo,s=e.xo-n.xo,l=t.x-t.xo,c=n.x-n.xo,a=Math.abs(r),i=Math.abs(s),u=a+i,0===u?void(e.x=e.xo+(l+c)/2):void(e.x=e.xo+(l*i+c*a)/u);r=o.distance(e,t,!0,!0),s=o.distance(e,n,!0,!0),l=o.distance(t,t,!1,!0),c=o.distance(n,n,!1,!0),a=Math.abs(r),i=Math.abs(s),u=a+i,0!==u?Zt.setRelative(e,e,(l*i+c*a)/u,o,!0):Zt.setRelative(e,e,(l+c)/2,o,!0)},normalSlope:Number.NEGATIVE_INFINITY,setRelative:function(e,t,n,o,r){if(!o||o===this)return void(e.x=(r?t.xo:t.x)+n);const s=r?t.xo:t.x,a=r?t.yo:t.y,i=s+n*o.x,l=a+n*o.y;e.x=i+(e.y-l)/o.normalSlope},slope:0,touch:function(e){e.xTouched=!0},touched:function(e){return e.xTouched},untouch:function(e){e.xTouched=!1}},Qt={x:0,y:1,axis:"y",distance:function(e,t,n,o){return(n?e.yo:e.y)-(o?t.yo:t.y)},interpolate:function(e,t,n,o){let r,s,a,i,l,c,u;if(!o||o===this)return r=e.yo-t.yo,s=e.yo-n.yo,l=t.y-t.yo,c=n.y-n.yo,a=Math.abs(r),i=Math.abs(s),u=a+i,0===u?void(e.y=e.yo+(l+c)/2):void(e.y=e.yo+(l*i+c*a)/u);r=o.distance(e,t,!0,!0),s=o.distance(e,n,!0,!0),l=o.distance(t,t,!1,!0),c=o.distance(n,n,!1,!0),a=Math.abs(r),i=Math.abs(s),u=a+i,0!==u?Qt.setRelative(e,e,(l*i+c*a)/u,o,!0):Qt.setRelative(e,e,(l+c)/2,o,!0)},normalSlope:0,setRelative:function(e,t,n,o,r){if(!o||o===this)return void(e.y=(r?t.yo:t.y)+n);const s=r?t.xo:t.x,a=r?t.yo:t.y,i=s+n*o.x,l=a+n*o.y;e.y=l+o.normalSlope*(e.x-i)},slope:Number.POSITIVE_INFINITY,touch:function(e){e.yTouched=!0},touched:function(e){return e.yTouched},untouch:function(e){e.yTouched=!1}};function $t(e,t){this.x=e,this.y=t,this.axis=void 0,this.slope=t/e,this.normalSlope=-e/t,Object.freeze(this)}function Kt(e,t){const n=Math.sqrt(e*e+t*t);return t/=n,1===(e/=n)&&0===t?Zt:0===e&&1===t?Qt:new $t(e,t)}function Jt(e,t,n,o){this.x=this.xo=Math.round(64*e)/64,this.y=this.yo=Math.round(64*t)/64,this.lastPointOfContour=n,this.onCurve=o,this.prevPointOnContour=void 0,this.nextPointOnContour=void 0,this.xTouched=!1,this.yTouched=!1,Object.preventExtensions(this)}Object.freeze(Zt),Object.freeze(Qt),$t.prototype.distance=function(e,t,n,o){return this.x*Zt.distance(e,t,n,o)+this.y*Qt.distance(e,t,n,o)},$t.prototype.interpolate=function(e,t,n,o){let r,s,a,i,l,c,u;a=o.distance(e,t,!0,!0),i=o.distance(e,n,!0,!0),r=o.distance(t,t,!1,!0),s=o.distance(n,n,!1,!0),l=Math.abs(a),c=Math.abs(i),u=l+c,0!==u?this.setRelative(e,e,(r*c+s*l)/u,o,!0):this.setRelative(e,e,(r+s)/2,o,!0)},$t.prototype.setRelative=function(e,t,n,o,r){o=o||this;const s=r?t.xo:t.x,a=r?t.yo:t.y,i=s+n*o.x,l=a+n*o.y,c=o.normalSlope,u=this.slope,p=e.x,h=e.y;e.x=(u*p-c*i+l-h)/(u-c),e.y=u*(e.x-p)+h},$t.prototype.touch=function(e){e.xTouched=!0,e.yTouched=!0},Jt.prototype.nextTouched=function(e){let t=this.nextPointOnContour;for(;!e.touched(t)&&t!==this;)t=t.nextPointOnContour;return t},Jt.prototype.prevTouched=function(e){let t=this.prevPointOnContour;for(;!e.touched(t)&&t!==this;)t=t.prevPointOnContour;return t};const en=Object.freeze(new Jt(0,0)),tn={cvCutIn:17/16,deltaBase:9,deltaShift:.125,loop:1,minDis:1,autoFlip:!0};function nn(e,t){switch(this.env=e,this.stack=[],this.prog=t,e){case"glyf":this.zp0=this.zp1=this.zp2=1,this.rp0=this.rp1=this.rp2=0;case"prep":this.fv=this.pv=this.dpv=Zt,this.round=_t}}function on(e){const t=e.tZone=new Array(e.gZone.length);for(let e=0;e=176&&o<=183)r+=o-176+1;else if(o>=184&&o<=191)r+=2*(o-184+1);else if(t&&1===s&&27===o)break}while(s>0);e.ip=r}function sn(e,t){exports.DEBUG&&console.log(t.step,"SVTCA["+e.axis+"]"),t.fv=t.pv=t.dpv=e}function an(e,t){exports.DEBUG&&console.log(t.step,"SPVTCA["+e.axis+"]"),t.pv=t.dpv=e}function ln(e,t){exports.DEBUG&&console.log(t.step,"SFVTCA["+e.axis+"]"),t.fv=e}function cn(e,t){const n=t.stack,o=n.pop(),r=n.pop(),s=t.z2[o],a=t.z1[r];let i,l;exports.DEBUG&&console.log("SPVTL["+e+"]",o,r),e?(i=s.y-a.y,l=a.x-s.x):(i=a.x-s.x,l=a.y-s.y),t.pv=t.dpv=Kt(i,l)}function un(e,t){const n=t.stack,o=n.pop(),r=n.pop(),s=t.z2[o],a=t.z1[r];let i,l;exports.DEBUG&&console.log("SFVTL["+e+"]",o,r),e?(i=s.y-a.y,l=a.x-s.x):(i=a.x-s.x,l=a.y-s.y),t.fv=Kt(i,l)}function pn(e){exports.DEBUG&&console.log(e.step,"POP[]"),e.stack.pop()}function hn(e,t){const n=t.stack.pop(),o=t.z0[n],r=t.fv,s=t.pv;exports.DEBUG&&console.log(t.step,"MDAP["+e+"]",n);let a=s.distance(o,en);e&&(a=t.round(a)),r.setRelative(o,en,a,s),r.touch(o),t.rp0=t.rp1=n}function fn(e,t){const n=t.z2,o=n.length-2;let r,s,a;exports.DEBUG&&console.log(t.step,"IUP["+e.axis+"]");for(let t=0;t1?"loop "+(t.loop-i)+": ":"")+"SHP["+(e?"rp1":"rp2")+"]",o)}t.loop=1}function gn(e,t){const n=t.stack,o=e?t.rp1:t.rp2,r=(e?t.z0:t.z1)[o],s=t.fv,a=t.pv,i=n.pop(),l=t.z2[t.contours[i]];let c=l;exports.DEBUG&&console.log(t.step,"SHC["+e+"]",i);const u=a.distance(r,r,!1,!0);do{c!==r&&s.setRelative(c,c,u,a),c=c.nextPointOnContour}while(c!==l)}function mn(e,t){const n=t.stack,o=e?t.rp1:t.rp2,r=(e?t.z0:t.z1)[o],s=t.fv,a=t.pv,i=n.pop();let l,c;switch(exports.DEBUG&&console.log(t.step,"SHZ["+e+"]",i),i){case 0:l=t.tZone;break;case 1:l=t.gZone;break;default:throw new Error("Invalid zone")}const u=a.distance(r,r,!1,!0),p=l.length-2;for(let e=0;e",i),t.stack.push(Math.round(64*i))}function xn(e,t){const n=t.stack,o=n.pop(),r=t.fv,s=t.pv,a=t.ppem,i=t.deltaBase+16*(e-1),l=t.deltaShift,c=t.z0;exports.DEBUG&&console.log(t.step,"DELTAP["+e+"]",o,n);for(let e=0;e>4)!==a)continue;let u=(15&o)-8;u>=0&&u++,exports.DEBUG&&console.log(t.step,"DELTAPFIX",e,"by",u*l);const p=c[e];r.setRelative(p,p,u*l,s)}}function Un(e,t){const n=t.stack,o=n.pop();exports.DEBUG&&console.log(t.step,"ROUND[]"),n.push(64*t.round(o/64))}function Tn(e,t){const n=t.stack,o=n.pop(),r=t.ppem,s=t.deltaBase+16*(e-1),a=t.deltaShift;exports.DEBUG&&console.log(t.step,"DELTAC["+e+"]",o,n);for(let e=0;e>4)!==r)continue;let i=(15&o)-8;i>=0&&i++;const l=i*a;exports.DEBUG&&console.log(t.step,"DELTACFIX",e,"by",l),t.cvt[e]+=l}}function En(e,t){const n=t.stack,o=n.pop(),r=n.pop(),s=t.z2[o],a=t.z1[r];let i,l;exports.DEBUG&&console.log("SDPVTL["+e+"]",o,r),e?(i=s.y-a.y,l=a.x-s.x):(i=a.x-s.x,l=a.y-s.y),t.dpv=Kt(i,l)}function On(e,t){const n=t.stack,o=t.prog;let r=t.ip;exports.DEBUG&&console.log(t.step,"PUSHB["+e+"]");for(let t=0;t=0?1:-1,m=Math.abs(m),e&&(v=s.cvt[i],o&&Math.abs(m-v)":"_")+(o?"R":"_")+(0===r?"Gr":1===r?"Bl":2===r?"Wh":"")+"]",e?i+"("+s.cvt[i]+","+v+")":"",l,"(d =",g,"->",y*m,")"),s.rp1=s.rp0,s.rp2=l,t&&(s.rp0=l)}function Rn(e){(e=e||{}).empty||(Nt(e.familyName,"When creating a new Font object, familyName is required."),Nt(e.styleName,"When creating a new Font object, styleName is required."),Nt(e.unitsPerEm,"When creating a new Font object, unitsPerEm is required."),Nt(e.ascender,"When creating a new Font object, ascender is required."),Nt(e.descender,"When creating a new Font object, descender is required."),Nt(e.descender<0,"Descender should be negative (e.g. -512)."),this.names={fontFamily:{en:e.familyName||" "},fontSubfamily:{en:e.styleName||" "},fullName:{en:e.fullName||e.familyName+" "+e.styleName},postScriptName:{en:e.postScriptName||e.familyName+e.styleName},designer:{en:e.designer||" "},designerURL:{en:e.designerURL||" "},manufacturer:{en:e.manufacturer||" "},manufacturerURL:{en:e.manufacturerURL||" "},license:{en:e.license||" "},licenseURL:{en:e.licenseURL||" "},version:{en:e.version||"Version 0.1"},description:{en:e.description||" "},copyright:{en:e.copyright||" "},trademark:{en:e.trademark||" "}},this.unitsPerEm=e.unitsPerEm||1e3,this.ascender=e.ascender,this.descender=e.descender,this.createdTimestamp=e.createdTimestamp,this.tables={os2:{usWeightClass:e.weightClass||this.usWeightClasses.MEDIUM,usWidthClass:e.widthClass||this.usWidthClasses.MEDIUM,fsSelection:e.fsSelection||this.fsSelectionValues.REGULAR}}),this.supported=!0,this.glyphs=new Ie.GlyphSet(this,e.glyphs||[]),this.encoding=new ve(this),this.substitution=new It(this),this.tables=this.tables||{},Object.defineProperty(this,"hinting",{get:function(){return this._hinting?this._hinting:"truetype"===this.outlinesFormat?this._hinting=new zt(this):void 0}})}function Dn(e,t){const n=JSON.stringify(e);let o=256;for(let e in t){let r=parseInt(e);if(r&&!(r<256)){if(JSON.stringify(t[e])===n)return r;o<=r&&(o=r+1)}}return t[o]=e,o}function Cn(e,t,n){const o=Dn(t.name,n);return[{name:"tag_"+e,type:"TAG",value:t.tag},{name:"minValue_"+e,type:"FIXED",value:t.minValue<<16},{name:"defaultValue_"+e,type:"FIXED",value:t.defaultValue<<16},{name:"maxValue_"+e,type:"FIXED",value:t.maxValue<<16},{name:"flags_"+e,type:"USHORT",value:0},{name:"nameID_"+e,type:"USHORT",value:o}]}function Ln(e,t,n){const o={},r=new pe.Parser(e,t);return o.tag=r.parseTag(),o.minValue=r.parseFixed(),o.defaultValue=r.parseFixed(),o.maxValue=r.parseFixed(),r.skip("uShort",1),o.name=n[r.parseUShort()]||{},o}function In(e,t,n,o){const r=[{name:"nameID_"+e,type:"USHORT",value:Dn(t.name,o)},{name:"flags_"+e,type:"USHORT",value:0}];for(let o=0;o2)return;const n=this.font;let o=this._prepState;if(!o||o.ppem!==t){let e=this._fpgmState;if(!e){nn.prototype=tn,e=this._fpgmState=new nn("fpgm",n.tables.fpgm),e.funcs=[],e.font=n,exports.DEBUG&&(console.log("---EXEC FPGM---"),e.step=-1);try{At(e)}catch(e){return console.log("Hinting error in FPGM:"+e),void(this._errorState=3)}}nn.prototype=e,o=this._prepState=new nn("prep",n.tables.prep),o.ppem=t;const r=n.tables.cvt;if(r){const e=o.cvt=new Array(r.length),s=t/n.unitsPerEm;for(let t=0;t1))try{return Ft(e,o)}catch(e){return this._errorState<1&&(console.log("Hinting error:"+e),console.log("Note: further hinting errors are silenced")),void(this._errorState=1)}},Ft=function(e,t){const n=t.ppem/t.font.unitsPerEm,o=n;let r,s,a,i=e.components;if(nn.prototype=t,i){const l=t.font;s=[],r=[];for(let e=0;e1?"loop "+(e.loop-n)+": ":"")+"SHPIX[]",a,r),o.setRelative(i,i,r),o.touch(i)}e.loop=1},function(e){const t=e.stack,n=e.rp1,o=e.rp2;let r=e.loop;const s=e.z0[n],a=e.z1[o],i=e.fv,l=e.dpv,c=e.z2;for(;r--;){const u=t.pop(),p=c[u];exports.DEBUG&&console.log(e.step,(e.loop>1?"loop "+(e.loop-r)+": ":"")+"IP[]",u,n,"<->",o),i.interpolate(p,s,a,l),i.touch(p)}e.loop=1},yn.bind(void 0,0),yn.bind(void 0,1),function(e){const t=e.stack,n=e.rp0,o=e.z0[n];let r=e.loop;const s=e.fv,a=e.pv,i=e.z1;for(;r--;){const n=t.pop(),l=i[n];exports.DEBUG&&console.log(e.step,(e.loop>1?"loop "+(e.loop-r)+": ":"")+"ALIGNRP[]",n),s.setRelative(l,o,0,a),s.touch(l)}e.loop=1},function(e){exports.DEBUG&&console.log(e.step,"RTDG[]"),e.round=qt},vn.bind(void 0,0),vn.bind(void 0,1),function(e){const t=e.prog;let n=e.ip;const o=e.stack,r=t[++n];exports.DEBUG&&console.log(e.step,"NPUSHB[]",r);for(let e=0;en?1:0)},function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"GTEQ[]",n,o),t.push(o>=n?1:0)},function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"EQ[]",n,o),t.push(n===o?1:0)},function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"NEQ[]",n,o),t.push(n!==o?1:0)},function(e){const t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,"ODD[]",n),t.push(Math.trunc(n)%2?1:0)},function(e){const t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,"EVEN[]",n),t.push(Math.trunc(n)%2?0:1)},function(e){let t=e.stack.pop();exports.DEBUG&&console.log(e.step,"IF[]",t),t||(rn(e,!0),exports.DEBUG&&console.log(e.step,"EIF[]"))},function(e){exports.DEBUG&&console.log(e.step,"EIF[]")},function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"AND[]",n,o),t.push(n&&o?1:0)},function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"OR[]",n,o),t.push(n||o?1:0)},function(e){const t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,"NOT[]",n),t.push(n?0:1)},xn.bind(void 0,1),function(e){const t=e.stack.pop();exports.DEBUG&&console.log(e.step,"SDB[]",t),e.deltaBase=t},function(e){const t=e.stack.pop();exports.DEBUG&&console.log(e.step,"SDS[]",t),e.deltaShift=Math.pow(.5,t)},function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"ADD[]",n,o),t.push(o+n)},function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"SUB[]",n,o),t.push(o-n)},function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"DIV[]",n,o),t.push(64*o/n)},function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"MUL[]",n,o),t.push(o*n/64)},function(e){const t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,"ABS[]",n),t.push(Math.abs(n))},function(e){const t=e.stack;let n=t.pop();exports.DEBUG&&console.log(e.step,"NEG[]",n),t.push(-n)},function(e){const t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,"FLOOR[]",n),t.push(64*Math.floor(n/64))},function(e){const t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,"CEILING[]",n),t.push(64*Math.ceil(n/64))},Un.bind(void 0,0),Un.bind(void 0,1),Un.bind(void 0,2),Un.bind(void 0,3),void 0,void 0,void 0,void 0,function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"WCVTF[]",n,o),e.cvt[o]=n*e.ppem/e.font.unitsPerEm},xn.bind(void 0,2),xn.bind(void 0,3),Tn.bind(void 0,1),Tn.bind(void 0,2),Tn.bind(void 0,3),function(e){let t,n=e.stack.pop();switch(exports.DEBUG&&console.log(e.step,"SROUND[]",n),e.round=Yt,192&n){case 0:t=.5;break;case 64:t=1;break;case 128:t=2;break;default:throw new Error("invalid SROUND value")}switch(e.srPeriod=t,48&n){case 0:e.srPhase=0;break;case 16:e.srPhase=.25*t;break;case 32:e.srPhase=.5*t;break;case 48:e.srPhase=.75*t;break;default:throw new Error("invalid SROUND value")}n&=15,e.srThreshold=0===n?0:(n/8-.5)*t},function(e){let t,n=e.stack.pop();switch(exports.DEBUG&&console.log(e.step,"S45ROUND[]",n),e.round=Yt,192&n){case 0:t=Math.sqrt(2)/2;break;case 64:t=Math.sqrt(2);break;case 128:t=2*Math.sqrt(2);break;default:throw new Error("invalid S45ROUND value")}switch(e.srPeriod=t,48&n){case 0:e.srPhase=0;break;case 16:e.srPhase=.25*t;break;case 32:e.srPhase=.5*t;break;case 48:e.srPhase=.75*t;break;default:throw new Error("invalid S45ROUND value")}n&=15,e.srThreshold=0===n?0:(n/8-.5)*t},void 0,void 0,function(e){exports.DEBUG&&console.log(e.step,"ROFF[]"),e.round=Wt},void 0,function(e){exports.DEBUG&&console.log(e.step,"RUTG[]"),e.round=Vt},function(e){exports.DEBUG&&console.log(e.step,"RDTG[]"),e.round=jt},pn,pn,void 0,void 0,void 0,void 0,void 0,function(e){const t=e.stack.pop();exports.DEBUG&&console.log(e.step,"SCANCTRL[]",t)},En.bind(void 0,0),En.bind(void 0,1),function(e){const t=e.stack,n=t.pop();let o=0;exports.DEBUG&&console.log(e.step,"GETINFO[]",n),1&n&&(o=35),32&n&&(o|=4096),t.push(o)},void 0,function(e){const t=e.stack,n=t.pop(),o=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,"ROLL[]"),t.push(o),t.push(n),t.push(r)},function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"MAX[]",n,o),t.push(Math.max(o,n))},function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"MIN[]",n,o),t.push(Math.min(o,n))},function(e){const t=e.stack.pop();exports.DEBUG&&console.log(e.step,"SCANTYPE[]",t)},function(e){const t=e.stack.pop();let n=e.stack.pop();switch(exports.DEBUG&&console.log(e.step,"INSTCTRL[]",t,n),t){case 1:return void(e.inhibitGridFit=!!n);case 2:return void(e.ignoreCvt=!!n);default:throw new Error("invalid INSTCTRL[] selector")}},void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,On.bind(void 0,1),On.bind(void 0,2),On.bind(void 0,3),On.bind(void 0,4),On.bind(void 0,5),On.bind(void 0,6),On.bind(void 0,7),On.bind(void 0,8),wn.bind(void 0,1),wn.bind(void 0,2),wn.bind(void 0,3),wn.bind(void 0,4),wn.bind(void 0,5),wn.bind(void 0,6),wn.bind(void 0,7),wn.bind(void 0,8),kn.bind(void 0,0,0,0,0,0),kn.bind(void 0,0,0,0,0,1),kn.bind(void 0,0,0,0,0,2),kn.bind(void 0,0,0,0,0,3),kn.bind(void 0,0,0,0,1,0),kn.bind(void 0,0,0,0,1,1),kn.bind(void 0,0,0,0,1,2),kn.bind(void 0,0,0,0,1,3),kn.bind(void 0,0,0,1,0,0),kn.bind(void 0,0,0,1,0,1),kn.bind(void 0,0,0,1,0,2),kn.bind(void 0,0,0,1,0,3),kn.bind(void 0,0,0,1,1,0),kn.bind(void 0,0,0,1,1,1),kn.bind(void 0,0,0,1,1,2),kn.bind(void 0,0,0,1,1,3),kn.bind(void 0,0,1,0,0,0),kn.bind(void 0,0,1,0,0,1),kn.bind(void 0,0,1,0,0,2),kn.bind(void 0,0,1,0,0,3),kn.bind(void 0,0,1,0,1,0),kn.bind(void 0,0,1,0,1,1),kn.bind(void 0,0,1,0,1,2),kn.bind(void 0,0,1,0,1,3),kn.bind(void 0,0,1,1,0,0),kn.bind(void 0,0,1,1,0,1),kn.bind(void 0,0,1,1,0,2),kn.bind(void 0,0,1,1,0,3),kn.bind(void 0,0,1,1,1,0),kn.bind(void 0,0,1,1,1,1),kn.bind(void 0,0,1,1,1,2),kn.bind(void 0,0,1,1,1,3),kn.bind(void 0,1,0,0,0,0),kn.bind(void 0,1,0,0,0,1),kn.bind(void 0,1,0,0,0,2),kn.bind(void 0,1,0,0,0,3),kn.bind(void 0,1,0,0,1,0),kn.bind(void 0,1,0,0,1,1),kn.bind(void 0,1,0,0,1,2),kn.bind(void 0,1,0,0,1,3),kn.bind(void 0,1,0,1,0,0),kn.bind(void 0,1,0,1,0,1),kn.bind(void 0,1,0,1,0,2),kn.bind(void 0,1,0,1,0,3),kn.bind(void 0,1,0,1,1,0),kn.bind(void 0,1,0,1,1,1),kn.bind(void 0,1,0,1,1,2),kn.bind(void 0,1,0,1,1,3),kn.bind(void 0,1,1,0,0,0),kn.bind(void 0,1,1,0,0,1),kn.bind(void 0,1,1,0,0,2),kn.bind(void 0,1,1,0,0,3),kn.bind(void 0,1,1,0,1,0),kn.bind(void 0,1,1,0,1,1),kn.bind(void 0,1,1,0,1,2),kn.bind(void 0,1,1,0,1,3),kn.bind(void 0,1,1,1,0,0),kn.bind(void 0,1,1,1,0,1),kn.bind(void 0,1,1,1,0,2),kn.bind(void 0,1,1,1,0,3),kn.bind(void 0,1,1,1,1,0),kn.bind(void 0,1,1,1,1,1),kn.bind(void 0,1,1,1,1,2),kn.bind(void 0,1,1,1,1,3)],Rn.prototype.hasChar=function(e){return null!==this.encoding.charToGlyphIndex(e)},Rn.prototype.charToGlyphIndex=function(e){return this.encoding.charToGlyphIndex(e)},Rn.prototype.charToGlyph=function(e){const t=this.charToGlyphIndex(e);let n=this.glyphs.get(t);return n||(n=this.glyphs.get(0)),n},Rn.prototype.stringToGlyphs=function(e,t){t=t||this.defaultRenderOptions;const n=[];for(let t=0;t>1;e1&&console.warn("Only the first kern subtable is supported."),e.skip("uLong");const n=255&e.parseUShort();if(e.skip("uShort"),0===n){const n=e.parseUShort();e.skip("uShort",3);for(let o=0;o{const t=jn.loadSync(e);Qn.font=t,Qn.ascender=t.ascender,Qn.descender=t.descender}};const Kn=$n.options,Jn=function(e,t){return Math.round(e+Math.random()*(t-e))};const eo=function(e,t){return{text:(e+t).toString(),equation:e+"+"+t}},to=function(e,t){return{text:(e-t).toString(),equation:e+"-"+t}};function no(e,t,n){return 6*(n=(n+1)%1)<1?e+(t-e)*n*6:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}var oo={int:Jn,greyColor:function(e,t){const n=Jn(e=e||1,t=t||9).toString(16);return`#${n}${n}${n}`},captchaText:function(e){"number"==typeof e&&(e={size:e});const t=(e=e||{}).size||4,n=e.ignoreChars||"";let o=-1,r="",s=e.charPreset||Kn.charPreset;n&&(s=function(e,t){return e.split("").filter(e=>-1===t.indexOf(e))}(s,n));const a=s.length-1;for(;++o>16,o=t>>8&255,r=255&t,s=Math.max(n,o,r),a=Math.min(n,o,r);return(s+a)/510}(e):1;let r,s;o>=.5?(r=Math.round(100*o)-45,s=Math.round(100*o)-25):(r=Math.round(100*o)+25,s=Math.round(100*o)+45);const a=Jn(r,s)/100,i=a<.5?a*(a+n):a+n-a*n,l=2*a-i,c=Math.floor(255*no(l,i,t+1/3)),u=Math.floor(255*no(l,i,t));return"#"+(Math.floor(255*no(l,i,t-1/3))|u<<8|c<<16|1<<24).toString(16).slice(1)}};const ro=$n.options,so=function(e,t){e=e||oo.captchaText();const n=(t=Object.assign({},ro,t)).width,o=t.height,r=t.background||t.backgroundColor;r&&(t.color=!0);const s=r?``:"",a=[].concat(function(e,t,n){const o=n.color,r=[],s=n.inverse?7:1,a=n.inverse?15:9;let i=-1;for(;++i`)}return r}(n,o,t)).concat(function(e,t,n,o,r){const s=e.length,a=(t-2)/(s+1),i=o.inverse?10:0,l=o.inverse?14:4;let u=-1;const p=[],h=r||o.color?oo.color(o.background):oo.greyColor(i,l);for(;++u`)}return p}(e,n,o,t)).sort(()=>Math.random()-.5).join("");return`${``}${s}${a}`};var ao=so,io=oo.captchaText,lo=function(e){const t=e.text||oo.captchaText(e);return{text:t,data:so(t,e)}},co=function(e){const t=oo.mathExpr(e.mathMin,e.mathMax,e.mathOperator);return{text:t.text,data:so(t.equation,e)}},uo=ro,po=$n.loadFont;ao.randomText=io,ao.create=lo,ao.createMathExpr=co,ao.options=uo,ao.loadFont=po;var ho=ao;const fo=Object.prototype.toString;function go(e){return"[object Object]"===fo.call(e)}function mo(){"development"===process.env.NODE_ENV&&console.log(...arguments)}const yo=async function(){};function vo(e){return yo.constructor===e.constructor?async function(){const t=await e.apply(this,arguments);return go(t)&&(t.msg&&(t.message=t.msg,t.errMsg=t.msg),0===t.code?t.errCode=t.code:t.errCode=s[t.code]||t.code),t}:function(){const t=e.apply(this,arguments);return go(t)&&(t.msg&&(t.message=t.msg,t.errMsg=t.msg),0===t.code?t.errCode=t.code:t.errCode=s[t.code]||t.code),t}}const bo=uniCloud.database().collection("opendb-verify-codes");class So{async setVerifyCode({deviceId:e,code:t,expiresDate:n,scene:o}){if(!e)return{code:10101,msg:"deviceId不可为空"};if(!t)return{code:10102,msg:"验证码不可为空"};n||(n=180);const r=Date.now(),s={deviceId:e,scene:o,code:t.toLocaleLowerCase(),state:0,ip:__ctx__.CLIENTIP,created_date:r,expired_date:r+1e3*n};return mo("addRes",await bo.add(s)),{code:0,deviceId:e}}async verifyCode({deviceId:e,code:t,scene:n}){if(!e)return{code:10101,msg:"deviceId不可为空"};if(!t)return{code:10102,msg:"验证码不可为空"};const o=Date.now(),r={deviceId:e,scene:n,code:t.toLocaleLowerCase(),state:0},s=await bo.where(r).orderBy("created_date","desc").limit(1).get();if(mo("verifyRecord:",s),s&&s.data&&s.data.length>0){const e=s.data[0];if(e.expired_date{e.scene&&delete e.scene,this.pluginConfig.scene[n]=Object.assign({},t,e[n])})}}}{constructor(){super(),this.DEVICEID2opts={}}mergeConfig(e){const t=go(this.pluginConfig.scene)?this.pluginConfig.scene[e.scene]:e.scene;return Object.assign({},go(t)?t:this.pluginConfig,e)}async create(e={}){if(!e.scene)throw new Error("scene验证码场景不可为空");e=this.mergeConfig(e);let{scene:t,expiresDate:n,deviceId:o,...r}=e;if(o=o||__ctx__.DEVICEID,!o)throw new Error("deviceId不可为空");const s=new So;try{const{text:a,base64:i}=function(e={}){const{uniPlatform:t=""}=e;let n;n=e.mathExpr?ho.createMathExpr(e):ho.create(e);let o="data:image/svg+xml;utf8,"+n.data.replace(/#/g,"%23");return(!t||"string"==typeof t&&-1===t.indexOf("mp-"))&&(o=o.replace(/"/g,"'").replace(//g,"%3E")),{text:n.text,base64:o}}(r),l=await s.setVerifyCode({deviceId:o,code:a,expiresDate:n,scene:t});return l.code>0?{...l,code:10001}:(this.DEVICEID2opts[o]=e,{code:0,msg:"验证码获取成功",captchaBase64:i})}catch(e){return{code:10001,msg:"验证码生成失败:"+e.message}}}async verify({deviceId:e,captcha:t,scene:n}){if(!(e=e||__ctx__.DEVICEID))throw new Error("deviceId不可为空");if(!n)throw new Error("scene验证码场景不可为空");const o=new So;try{const r=await o.verifyCode({deviceId:e,code:t,scene:n});return r.code>0?r:{code:0,msg:"验证码通过"}}catch(e){return{code:10002,msg:"验证码校验失败:"+e.message}}}async refresh(e={}){let{scene:t,expiresDate:n,deviceId:o,...r}=e;if(o=o||__ctx__.DEVICEID,!o)throw new Error("deviceId不可为空");if(!t)throw new Error("scene验证码场景不可为空");const s=await bo.where({deviceId:o,scene:t}).orderBy("created_date","desc").limit(1).get();if(s&&s.data&&s.data.length>0){const e=s.data[0];await bo.doc(e._id).update({state:2}),Object.keys(r).length>0&&(this.DEVICEID2opts[o]=Object.assign({},this.DEVICEID2opts[o],r));let a={};try{a=await this.create(Object.assign({},this.DEVICEID2opts[o],{deviceId:o,scene:t,expiresDate:n}))}catch(e){return{code:50403,msg:e.message}}return a.code>0?{...a,code:50403}:{code:0,msg:"验证码刷新成功",captchaBase64:a.captchaBase64}}return{code:10003,msg:`验证码刷新失败:无此设备在 ${t} 场景信息,请重新获取`}}}const To=new So;Object.keys(To).forEach(e=>{Uo.prototype[e]=vo(To[e])});const Eo=new Uo,Oo=new Proxy(Eo,{get(e,t){if(t in e)return"function"==typeof e[t]?vo(e[t]).bind(Oo):e[t]}});module.exports=Oo; diff --git a/uni_modules/uni-captcha/uniCloud/cloudfunctions/common/uni-captcha/package.json b/uni_modules/uni-captcha/uniCloud/cloudfunctions/common/uni-captcha/package.json index f5e9cd9..2bb07ec 100644 --- a/uni_modules/uni-captcha/uniCloud/cloudfunctions/common/uni-captcha/package.json +++ b/uni_modules/uni-captcha/uniCloud/cloudfunctions/common/uni-captcha/package.json @@ -1,6 +1,6 @@ { "name": "uni-captcha", - "version": "0.1.1", + "version": "0.2.2", "description": "uni-captcha", "main": "index.js", "homepage": "https://ext.dcloud.net.cn/plugin?id=4048", @@ -9,5 +9,8 @@ "url": "git+https://gitee.com/dcloud/uni-captcha" }, "author": "DCloud", - "license": "Apache-2.0" + "license": "Apache-2.0", + "dependencies": { + "uni-config-center": "file:../../../../../uni-config-center/uniCloud/cloudfunctions/common/uni-config-center" + } } \ No newline at end of file diff --git a/uni_modules/uni-captcha/uniCloud/cloudfunctions/uni-captcha-co/index.obj.js b/uni_modules/uni-captcha/uniCloud/cloudfunctions/uni-captcha-co/index.obj.js new file mode 100644 index 0000000..09b36ac --- /dev/null +++ b/uni_modules/uni-captcha/uniCloud/cloudfunctions/uni-captcha-co/index.obj.js @@ -0,0 +1,32 @@ +// 开发文档: https://uniapp.dcloud.net.cn/uniCloud/cloud-obj +//导入验证码公共模块 +const uniCaptcha = require('uni-captcha') +//获取数据库对象 +const db = uniCloud.database(); +//获取数据表opendb-verify-codes对象 +const verifyCodes = db.collection('opendb-verify-codes') +module.exports = { + async getImageCaptcha({ + scene + }) { + //获取设备id + let { + deviceId, + platform + } = this.getClientInfo(); + //根据:设备id、场景值、状态,查找记录是否存在 + let res = await verifyCodes.where({ + scene, + deviceId, + state: 0 + }).limit(1).get() + //如果已存在则调用刷新接口,反之调用插件接口 + let action = res.data.length ? 'refresh' : 'create' + //执行并返回结果 + //导入配置,配置优先级说明:此处配置 > uni-config-center + return await uniCaptcha[action]({ + scene, //来源客户端传递,表示:使用场景值,用于防止不同功能的验证码混用 + uniPlatform: platform + }) + } +} diff --git a/uni_modules/uni-captcha/uniCloud/cloudfunctions/uni-captcha-co/package.json b/uni_modules/uni-captcha/uniCloud/cloudfunctions/uni-captcha-co/package.json new file mode 100644 index 0000000..b5188c3 --- /dev/null +++ b/uni_modules/uni-captcha/uniCloud/cloudfunctions/uni-captcha-co/package.json @@ -0,0 +1,10 @@ +{ + "name": "uni-captcha-co", + "dependencies": { + "uni-captcha": "file:../common/uni-captcha", + "uni-config-center": "file:../../../../uni-config-center/uniCloud/cloudfunctions/common/uni-config-center" + }, + "extensions": { + "uni-cloud-jql": {} + } +} \ No newline at end of file diff --git a/uni_modules/uni-captcha/uniCloud/database/opendb-verify-codes.schema.json b/uni_modules/uni-captcha/uniCloud/database/opendb-verify-codes.schema.json new file mode 100644 index 0000000..1f3be59 --- /dev/null +++ b/uni_modules/uni-captcha/uniCloud/database/opendb-verify-codes.schema.json @@ -0,0 +1,45 @@ +{ + "bsonType": "object", + "properties": { + "_id": { + "description": "ID,系统自动生成" + }, + "code": { + "bsonType": "string", + "description": "验证码" + }, + "create_date": { + "bsonType": "timestamp", + "description": "创建时间" + }, + "device_uuid": { + "bsonType": "string", + "description": "设备UUID,常用于图片验证码" + }, + "email": { + "bsonType": "string", + "description": "邮箱" + }, + "expired_date": { + "bsonType": "timestamp", + "description": "过期时间" + }, + "ip": { + "bsonType": "string", + "description": "请求时客户端IP地址" + }, + "mobile": { + "bsonType": "string", + "description": "手机号码" + }, + "scene": { + "bsonType": "string", + "description": "使用验证码的场景,如:login, bind, unbind, pay" + }, + "state": { + "bsonType": "int", + "description": "验证状态:0 未验证、1 已验证、2 已作废" + } + }, + "required": [] +} \ No newline at end of file diff --git a/uni_modules/uni-card/changelog.md b/uni_modules/uni-card/changelog.md index 359ce17..c3cd8c4 100644 --- a/uni_modules/uni-card/changelog.md +++ b/uni_modules/uni-card/changelog.md @@ -1,2 +1,26 @@ +## 1.3.1(2021-12-20) +- 修复 在vue页面下略缩图显示不正常的bug +## 1.3.0(2021-11-19) +- 重构插槽的用法 ,header 替换为 title +- 新增 actions 插槽 +- 新增 cover 封面图属性和插槽 +- 新增 padding 内容默认内边距离 +- 新增 margin 卡片默认外边距离 +- 新增 spacing 卡片默认内边距 +- 新增 shadow 卡片阴影属性 +- 取消 mode 属性,可使用组合插槽代替 +- 取消 note 属性 ,使用actions插槽代替 +- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) +- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-card](https://uniapp.dcloud.io/component/uniui/uni-card) +## 1.2.1(2021-07-30) +- 优化 vue3下事件警告的问题 +## 1.2.0(2021-07-13) +- 组件兼容 vue3,如何创建vue3项目详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) +## 1.1.8(2021-07-01) +- 优化 图文卡片无图片加载时,提供占位图标 +- 新增 header 插槽,自定义卡片头部( 图文卡片 mode="style" 时,不支持) +- 修复 thumbnail 不存在仍然占位的 bug +## 1.1.7(2021-05-12) +- 新增 组件示例地址 ## 1.1.6(2021-02-04) - 调整为uni_modules目录规范 diff --git a/uni_modules/uni-card/components/uni-card/uni-card.vue b/uni_modules/uni-card/components/uni-card/uni-card.vue index b76aa72..38cf594 100644 --- a/uni_modules/uni-card/components/uni-card/uni-card.vue +++ b/uni_modules/uni-card/components/uni-card/uni-card.vue @@ -1,45 +1,36 @@ @@ -50,21 +41,22 @@ * @description 卡片视图组件 * @tutorial https://ext.dcloud.net.cn/plugin?id=22 * @property {String} title 标题文字 - * @property {String} subTitle 副标题(仅仅mode=title下生效) + * @property {String} subTitle 副标题 + * @property {Number} padding 内容内边距 + * @property {Number} margin 卡片外边距 + * @property {Number} spacing 卡片内边距 * @property {String} extra 标题额外信息 - * @property {String} note 标题左侧缩略图 - * @property {String} thumbnail 底部信息 - * @property {String} mode = [basic|style|title] 卡片模式 - * @value basic 基础卡片 - * @value style 图文卡片 - * @value title 标题卡片 - * @property {Boolean} isFull = [true | false] 卡片内容是否通栏,为 true 时将去除padding值 - * @property {Boolean} isShadow = [true | false] 卡片内容是否开启阴影 + * @property {String} cover 封面图(本地路径需要引入) + * @property {String} thumbnail 标题左侧缩略图 + * @property {Boolean} is-full = [true | false] 卡片内容是否通栏,为 true 时将去除padding值 + * @property {Boolean} is-shadow = [true | false] 卡片内容是否开启阴影 + * @property {String} shadow 卡片阴影 + * @property {Boolean} border 卡片边框 * @event {Function} click 点击 Card 触发事件 - * @example 内容主体,可自定义内容及样式 */ export default { name: 'UniCard', + emits: ['click'], props: { title: { type: String, @@ -74,11 +66,23 @@ type: String, default: '' }, + padding: { + type: String, + default: '10px' + }, + margin: { + type: String, + default: '15px' + }, + spacing: { + type: String, + default: '0 10px' + }, extra: { type: String, default: '' }, - note: { + cover: { type: String, default: '' }, @@ -86,10 +90,6 @@ type: String, default: '' }, - mode: { - type: String, - default: 'basic' - }, isFull: { // 内容区域是否通栏 type: Boolean, @@ -97,293 +97,157 @@ }, isShadow: { // 是否开启阴影 - type: [Boolean, String], - default: false + type: Boolean, + default: true + }, + shadow: { + type: String, + default: '0px 0px 3px 1px rgba(0, 0, 0, 0.08)' + }, + border: { + type: Boolean, + default: true } }, methods: { - onClick() { - this.$emit('click') + onClick(type) { + this.$emit('click', type) } } } - diff --git a/uni_modules/uni-forms/components/uni-forms/uni-forms.vue b/uni_modules/uni-forms/components/uni-forms/uni-forms.vue index 42ecac6..ed2f6d9 100644 --- a/uni_modules/uni-forms/components/uni-forms/uni-forms.vue +++ b/uni_modules/uni-forms/components/uni-forms/uni-forms.vue @@ -1,13 +1,27 @@ - diff --git a/uni_modules/uni-forms/components/uni-forms/utils.js b/uni_modules/uni-forms/components/uni-forms/utils.js new file mode 100644 index 0000000..6da2421 --- /dev/null +++ b/uni_modules/uni-forms/components/uni-forms/utils.js @@ -0,0 +1,293 @@ +/** + * 简单处理对象拷贝 + * @param {Obejct} 被拷贝对象 + * @@return {Object} 拷贝对象 + */ +export const deepCopy = (val) => { + return JSON.parse(JSON.stringify(val)) +} +/** + * 过滤数字类型 + * @param {String} format 数字类型 + * @@return {Boolean} 返回是否为数字类型 + */ +export const typeFilter = (format) => { + return format === 'int' || format === 'double' || format === 'number' || format === 'timestamp'; +} + +/** + * 把 value 转换成指定的类型,用于处理初始值,原因是初始值需要入库不能为 undefined + * @param {String} key 字段名 + * @param {any} value 字段值 + * @param {Object} rules 表单校验规则 + */ +export const getValue = (key, value, rules) => { + const isRuleNumType = rules.find(val => val.format && typeFilter(val.format)); + const isRuleBoolType = rules.find(val => (val.format && val.format === 'boolean') || val.format === 'bool'); + // 输入类型为 number + if (!!isRuleNumType) { + if (!value && value !== 0) { + value = null + } else { + value = isNumber(Number(value)) ? Number(value) : value + } + } + + // 输入类型为 boolean + if (!!isRuleBoolType) { + value = isBoolean(value) ? value : false + } + + return value; +} + +/** + * 获取表单数据 + * @param {String|Array} name 真实名称,需要使用 realName 获取 + * @param {Object} data 原始数据 + * @param {any} value 需要设置的值 + */ +export const setDataValue = (field, formdata, value) => { + formdata[field] = value + return value || '' +} + +/** + * 获取表单数据 + * @param {String|Array} field 真实名称,需要使用 realName 获取 + * @param {Object} data 原始数据 + */ +export const getDataValue = (field, data) => { + return objGet(data, field) +} + +/** + * 获取表单类型 + * @param {String|Array} field 真实名称,需要使用 realName 获取 + */ +export const getDataValueType = (field, data) => { + const value = getDataValue(field, data) + return { + type: type(value), + value + } +} + +/** + * 获取表单可用的真实name + * @param {String|Array} name 表单name + * @@return {String} 表单可用的真实name + */ +export const realName = (name, data = {}) => { + const base_name = _basePath(name) + if (typeof base_name === 'object' && Array.isArray(base_name) && base_name.length > 1) { + const realname = base_name.reduce((a, b) => a += `#${b}`, '_formdata_') + return realname + } + return base_name[0] || name +} + +/** + * 判断是否表单可用的真实name + * @param {String|Array} name 表单name + * @@return {String} 表单可用的真实name + */ +export const isRealName = (name) => { + const reg = /^_formdata_#*/ + return reg.test(name) +} + +/** + * 获取表单数据的原始格式 + * @@return {Object|Array} object 需要解析的数据 + */ +export const rawData = (object = {}, name) => { + let newData = JSON.parse(JSON.stringify(object)) + let formData = {} + for(let i in newData){ + let path = name2arr(i) + objSet(formData,path,newData[i]) + } + return formData +} + +/** + * 真实name还原为 array + * @param {*} name + */ +export const name2arr = (name) => { + let field = name.replace('_formdata_#', '') + field = field.split('#').map(v => (isNumber(v) ? Number(v) : v)) + return field +} + +/** + * 对象中设置值 + * @param {Object|Array} object 源数据 + * @param {String| Array} path 'a.b.c' 或 ['a',0,'b','c'] + * @param {String} value 需要设置的值 + */ +export const objSet = (object, path, value) => { + if (typeof object !== 'object') return object; + _basePath(path).reduce((o, k, i, _) => { + if (i === _.length - 1) { + // 若遍历结束直接赋值 + o[k] = value + return null + } else if (k in o) { + // 若存在对应路径,则返回找到的对象,进行下一次遍历 + return o[k] + } else { + // 若不存在对应路径,则创建对应对象,若下一路径是数字,新对象赋值为空数组,否则赋值为空对象 + o[k] = /^[0-9]{1,}$/.test(_[i + 1]) ? [] : {} + return o[k] + } + }, object) + // 返回object + return object; +} + +// 处理 path, path有三种形式:'a[0].b.c'、'a.0.b.c' 和 ['a','0','b','c'],需要统一处理成数组,便于后续使用 +function _basePath(path) { + // 若是数组,则直接返回 + if (Array.isArray(path)) return path + // 若有 '[',']',则替换成将 '[' 替换成 '.',去掉 ']' + return path.replace(/\[/g, '.').replace(/\]/g, '').split('.') +} + +/** + * 从对象中获取值 + * @param {Object|Array} object 源数据 + * @param {String| Array} path 'a.b.c' 或 ['a',0,'b','c'] + * @param {String} defaultVal 如果无法从调用链中获取值的默认值 + */ +export const objGet = (object, path, defaultVal = 'undefined') => { + // 先将path处理成统一格式 + let newPath = _basePath(path) + // 递归处理,返回最后结果 + let val = newPath.reduce((o, k) => { + return (o || {})[k] + }, object); + return !val || val !== undefined ? val : defaultVal +} + + +/** + * 是否为 number 类型 + * @param {any} num 需要判断的值 + * @return {Boolean} 是否为 number + */ +export const isNumber = (num) => { + return !isNaN(Number(num)) +} + +/** + * 是否为 boolean 类型 + * @param {any} bool 需要判断的值 + * @return {Boolean} 是否为 boolean + */ +export const isBoolean = (bool) => { + return (typeof bool === 'boolean') +} +/** + * 是否有必填字段 + * @param {Object} rules 规则 + * @return {Boolean} 是否有必填字段 + */ +export const isRequiredField = (rules) => { + let isNoField = false; + for (let i = 0; i < rules.length; i++) { + const ruleData = rules[i]; + if (ruleData.required) { + isNoField = true; + break; + } + } + return isNoField; +} + + +/** + * 获取数据类型 + * @param {Any} obj 需要获取数据类型的值 + */ +export const type = (obj) => { + var class2type = {}; + + // 生成class2type映射 + "Boolean Number String Function Array Date RegExp Object Error".split(" ").map(function(item, index) { + class2type["[object " + item + "]"] = item.toLowerCase(); + }) + if (obj == null) { + return obj + ""; + } + return typeof obj === "object" || typeof obj === "function" ? + class2type[Object.prototype.toString.call(obj)] || "object" : + typeof obj; +} + +/** + * 判断两个值是否相等 + * @param {any} a 值 + * @param {any} b 值 + * @return {Boolean} 是否相等 + */ +export const isEqual = (a, b) => { + //如果a和b本来就全等 + if (a === b) { + //判断是否为0和-0 + return a !== 0 || 1 / a === 1 / b; + } + //判断是否为null和undefined + if (a == null || b == null) { + return a === b; + } + //接下来判断a和b的数据类型 + var classNameA = toString.call(a), + classNameB = toString.call(b); + //如果数据类型不相等,则返回false + if (classNameA !== classNameB) { + return false; + } + //如果数据类型相等,再根据不同数据类型分别判断 + switch (classNameA) { + case '[object RegExp]': + case '[object String]': + //进行字符串转换比较 + return '' + a === '' + b; + case '[object Number]': + //进行数字转换比较,判断是否为NaN + if (+a !== +a) { + return +b !== +b; + } + //判断是否为0或-0 + return +a === 0 ? 1 / +a === 1 / b : +a === +b; + case '[object Date]': + case '[object Boolean]': + return +a === +b; + } + //如果是对象类型 + if (classNameA == '[object Object]') { + //获取a和b的属性长度 + var propsA = Object.getOwnPropertyNames(a), + propsB = Object.getOwnPropertyNames(b); + if (propsA.length != propsB.length) { + return false; + } + for (var i = 0; i < propsA.length; i++) { + var propName = propsA[i]; + //如果对应属性对应值不相等,则返回false + if (a[propName] !== b[propName]) { + return false; + } + } + return true; + } + //如果是数组类型 + if (classNameA == '[object Array]') { + if (a.toString() == b.toString()) { + return true; + } + return false; + } +} diff --git a/uni_modules/uni-forms/package.json b/uni_modules/uni-forms/package.json index 4253d5c..e3736c4 100644 --- a/uni_modules/uni-forms/package.json +++ b/uni_modules/uni-forms/package.json @@ -1,7 +1,7 @@ { "id": "uni-forms", "displayName": "uni-forms 表单", - "version": "1.3.3", + "version": "1.4.8", "description": "由输入框、选择器、单选框、多选框等控件组成,用以收集、校验、提交数据", "keywords": [ "uni-ui", @@ -17,11 +17,7 @@ "directories": { "example": "../../temps/example_temps" }, - "dcloudext": { - "category": [ - "前端组件", - "通用组件" - ], +"dcloudext": { "sale": { "regular": { "price": "0.00" @@ -38,7 +34,8 @@ "data": "无", "permissions": "无" }, - "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" + "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui", + "type": "component-vue" }, "uni_modules": { "dependencies": [ @@ -74,7 +71,8 @@ "阿里": "y", "百度": "y", "字节跳动": "y", - "QQ": "y" + "QQ": "y", + "京东": "u" }, "快应用": { "华为": "u", diff --git a/uni_modules/uni-group/changelog.md b/uni_modules/uni-group/changelog.md index ddaac00..a7024fd 100644 --- a/uni_modules/uni-group/changelog.md +++ b/uni_modules/uni-group/changelog.md @@ -1,3 +1,16 @@ +## 1.2.2(2022-05-30) +- 新增 stat属性,是否开启uni统计功能 +## 1.2.1(2021-11-22) +- 修复 vue3中某些scss变量无法找到的问题 +## 1.2.0(2021-11-19) +- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) +- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-group](https://uniapp.dcloud.io/component/uniui/uni-group) +## 1.1.7(2021-11-08) +## 1.1.0(2021-07-30) +- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) +- 优化 组件文档 +## 1.0.3(2021-05-12) +- 新增 组件示例地址 ## 1.0.2(2021-02-05) - 调整为uni_modules目录规范 - 优化 兼容 nvue 页面 diff --git a/uni_modules/uni-group/components/uni-group/uni-group.vue b/uni_modules/uni-group/components/uni-group/uni-group.vue index 6af22d0..3425ecd 100644 --- a/uni_modules/uni-group/components/uni-group/uni-group.vue +++ b/uni_modules/uni-group/components/uni-group/uni-group.vue @@ -15,12 +15,14 @@ /** * Group 分组 * @description 表单字段分组 - * @tutorial https://ext.dcloud.net.cn/plugin?id=21002 + * @tutorial https://ext.dcloud.net.cn/plugin?id=3281 * @property {String} title 主标题 * @property {Number} top 分组间隔 + * @property {Number} mode 模式 */ export default { name: 'uniGroup', + emits:['click'], props: { title: { type: String, @@ -33,6 +35,10 @@ mode: { type: String, default: 'default' + }, + stat:{ + type: Boolean, + default: false } }, data() { @@ -43,7 +49,7 @@ }, watch: { title(newVal) { - if (uni.report && newVal !== '') { + if (uni.report && this.stat && newVal !== '') { uni.report('title', newVal) } } @@ -75,7 +81,7 @@ } } - diff --git a/uni_modules/uni-list/components/uni-list/uni-list.vue b/uni_modules/uni-list/components/uni-list/uni-list.vue index d478729..ecda676 100644 --- a/uni_modules/uni-list/components/uni-list/uni-list.vue +++ b/uni_modules/uni-list/components/uni-list/uni-list.vue @@ -54,7 +54,9 @@ export default { } }; - diff --git a/uni_modules/uni-popup/package.json b/uni_modules/uni-popup/package.json index e03b299..069e9ce 100644 --- a/uni_modules/uni-popup/package.json +++ b/uni_modules/uni-popup/package.json @@ -1,83 +1,90 @@ { - "id": "uni-popup", - "displayName": "uni-popup 弹出层", - "version": "1.6.0", - "description": " Popup 组件,提供常用的弹层", - "keywords": [ - "uni-ui", - "uniui", - "弹出层" -], - "repository": "https://github.com/dcloudio/uni-ui", - "engines": { - "HBuilderX": "" - }, - "directories": { - "example": "../../temps/example_temps" - }, - "dcloudext": { - "category": [ - "前端组件", - "通用组件" + "id": "uni-popup", + "displayName": "uni-popup 弹出层", + "version": "1.7.9", + "description": " Popup 组件,提供常用的弹层", + "keywords": [ + "uni-ui", + "弹出层", + "弹窗", + "popup", + "弹框" ], - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无", - "data": "无", - "permissions": "无" - }, - "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" - }, - "uni_modules": { - "dependencies": [ - "uni-transition" - ], - "encrypt": [], - "platforms": { - "cloud": { - "tcb": "y", - "aliyun": "y" - }, - "client": { - "App": { - "app-vue": "y", - "app-nvue": "y" - }, - "H5-mobile": { - "Safari": "y", - "Android Browser": "y", - "微信浏览器(Android)": "y", - "QQ浏览器(Android)": "y" - }, - "H5-pc": { - "Chrome": "y", - "IE": "y", - "Edge": "y", - "Firefox": "y", - "Safari": "y" - }, - "小程序": { - "微信": "y", - "阿里": "y", - "百度": "y", - "字节跳动": "y", - "QQ": "y" - }, - "快应用": { - "华为": "u", - "联盟": "u" - } - } - } - } -} \ No newline at end of file + "repository": "https://github.com/dcloudio/uni-ui", + "engines": { + "HBuilderX": "" + }, + "directories": { + "example": "../../temps/example_temps" + }, + "dcloudext": { + "category": [ + "前端组件", + "通用组件" + ], + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "无", + "data": "无", + "permissions": "无" + }, + "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" + }, + "uni_modules": { + "dependencies": [ + "uni-scss", + "uni-transition" + ], + "encrypt": [], + "platforms": { + "cloud": { + "tcb": "y", + "aliyun": "y" + }, + "client": { + "App": { + "app-vue": "y", + "app-nvue": "y" + }, + "H5-mobile": { + "Safari": "y", + "Android Browser": "y", + "微信浏览器(Android)": "y", + "QQ浏览器(Android)": "y" + }, + "H5-pc": { + "Chrome": "y", + "IE": "y", + "Edge": "y", + "Firefox": "y", + "Safari": "y" + }, + "小程序": { + "微信": "y", + "阿里": "y", + "百度": "y", + "字节跳动": "y", + "QQ": "y" + }, + "快应用": { + "华为": "u", + "联盟": "u" + }, + "Vue": { + "vue2": "y", + "vue3": "y" + } + } + } + } +} diff --git a/uni_modules/uni-popup/readme.md b/uni_modules/uni-popup/readme.md index d8a0899..fdad4b3 100644 --- a/uni_modules/uni-popup/readme.md +++ b/uni_modules/uni-popup/readme.md @@ -3,294 +3,15 @@ ## Popup 弹出层 > **组件名:uni-popup** > 代码块: `uPopup` -> 关联组件:`uni-popup-dialog`,`uni-popup-message`,`uni-popup-share`,`uni-transition` +> 关联组件:`uni-transition` 弹出层组件,在应用中弹出一个消息提示窗口、提示框等 +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-popup) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 -> **注意事项** -> 为了避免错误使用,给大家带来不好的开发体验,请在使用组件前仔细阅读下面的注意事项,可以帮你避免一些错误。 -> - 组件需要依赖 `sass` 插件 ,请自行手动安装 -> - `uni-popup-message` 、 `uni-popup-dialog` 等扩展ui组件,需要和 `uni-popup` 配套使用,暂不支持单独使用 -> - `nvue` 中使用 `uni-popup` 时,尽量将组件置于其他元素后面,避免出现层级问题 -> - `uni-popup` 并不能完全阻止页面滚动,可在打开 `uni-popup` 的时候手动去做一些处理,禁止页面滚动 -> - 如果想在页面渲染完毕后就打开 `uni-popup` ,请在 `onReady` 或 `mounted` 生命周期内调用,确保组件渲染完毕 -> - 在微信小程序开发者工具中,启用真机调试,popup 会延时出现,是因为 setTimeout 在真机调试中的延时问题导致的,预览和发布小程序不会出现此问题 -> - 使用 `npm` 方式引入组件,如果确认引用正确,但是提示未注册组件或显示不正常,请尝试重新编译项目 -> - `uni-popup` 中尽量不要使用 `scroll-view` 嵌套过多的内容,可能会影响组件的性能,导致组件无法打开或者打开卡顿 -> - `uni-popup` 不会覆盖原生 tabbar 和原生导航栏 -> - 组件支持 nvue ,需要在 `manifest.json > app-plus` 节点下配置 `"nvueStyleCompiler" : "uni-app"` -> - 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 -### 安装方式 -本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。 - -如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55) - - -### 基本用法 - -**示例** - -```html - -底部弹出 Popup -``` - -```javascript -export default { - methods:{ - open(){ - // 通过组件定义的ref调用uni-popup方法 ,如果传入参数 ,type 属性将失效 ,仅支持 ['top','left','bottom','right','center'] - this.$refs.popup.open('top') - } - } -} - -``` - -### 设置主窗口背景色 - -在大多数场景下,并不需要设置 `background-color` 属性,因为`uni-popup`的主窗口默认是透明的,在向里面插入内容的时候 ,样式完全交由用户定制,如果设置了背景色 ,例如 `uni-popup-dialog` 中的圆角就很难去实现,不设置背景色,更适合用户去自由发挥。 - -而也有特例,需要我们主动去设置背景色,例如 `type = 'bottom'` 的时候 ,在异型屏中遇到了底部安全区问题(如 iphone 11),因为 `uni-popup`的主要内容避开了安全区(设置`safe-area:true`),导致底部的颜色我们无法自定义,这时候使用 `background-color` 就可以解决这个问题。 - -**示例** - -```html - -底部弹出 Popup -``` - -### 禁用打开动画 -在某些场景 ,可能不希望弹层有动画效果 ,只需要将 `animation` 属性设置为 `false` 即可以关闭动画。 - -**示例** - -```html - -中间弹出 Popup -``` - -### 禁用点击遮罩关闭 -默认情况下,点击遮罩会自动关闭`uni-popup`,如不想点击关闭,只需将`mask-click`设置为`false`,这时候要关闭`uni-popup`,只能手动调用 `close` 方法。 - -**示例** - -```html - - - Popup - - -``` - -```javascript -export default { - data() { - return {} - }, - onReady() {}, - methods: { - open() { - this.$refs.popup.open('top') - }, - close() { - this.$refs.popup.close() - } - } -} - -``` - -## API - -### Popup Props - -|属性名|类型|默认值|说明| -|:-:|:-:|:-:|:-:| -|animation|Boolean|true|是否开启动画| -|type|String|'center'|弹出方式| -|mask-click|Boolean|true|蒙版点击是否关闭弹窗| -|background-color|String|'none'|主窗口背景色| -|safe-area|Boolean|true|是否适配底部安全区| - -#### Type Options - -|属性名|说明| -|:-:| :-:| -|top|顶部弹出 | -|center|居中弹出| -|bottom|底部弹出| -|left|左侧弹出| -|right|右侧弹出| -|message|预置样式 :消息提示| -|dialog|预置样式 :对话框| -|share|预置样式 :底部弹出分享示例 | - - -### Popup Methods - -|方法称名 |说明|参数| -|:-:|:-:|:-:| -|open|打开弹出层|open(String:type) ,如果参数可代替 type 属性| -|close|关闭弹出层 |-| - - -### Popup Events - -|事件称名|说明|返回值| -|:-:|:-:|:-:| -|change|组件状态发生变化触发|e={show: true|false,type:当前模式}| -|maskClick|点击遮罩层触发|-| - - -## 扩展组件说明 -`uni-popup` 其实并没有任何样式,只提供基础的动画效果,给用户一个弹出层解决方案,仅仅是这样并不能满足开发需求,所以我们提供了三种基础扩展样式 - -### uni-popup-message 提示信息 - -将 `uni-popup` 的`type`属性改为 `message`,并引入对应组件即可使用消息提示 ,*该组件不支持单独使用* - -**示例** - -```html - - - -``` - -### PopupMessage Props - -|属性名|类型|默认值|说明| -|:-:|:-:|:-:|:-:| -|type|String|success|消息提示主题| -|message|String|-|消息提示文字| -|duration|Number|3000|消息显示时间,超过显示时间组件自动关闭,设置为0 将不会关闭,需手动调用 close 方法关闭| - -#### Type Options - -|属性名|说明| -|:-:| :-:| -|success|成功 | -|warn|警告| -|error|失败| -|info|消息| - -### PopupMessage Slots - -|名称|说明| -|:-:|:-:| -|default|消息内容,会覆盖 message 属性| - -### uni-popup-dialog 对话框 - -将 `uni-popup` 的`type`属性改为 `dialog`,并引入对应组件即可使用对话框 ,*该组件不支持单独使用* - -**示例** - -```html - - - - -``` - -```javascript -export default { - methods: { - open() { - this.$refs.popup.open() - }, - /** - * 点击取消按钮触发 - * @param {Object} done - */ - close() { - // TODO 做一些其他的事情,before-close 为true的情况下,手动执行 close 才会关闭对话框 - // ... - this.$refs.popup.close() - }, - /** - * 点击确认按钮触发 - * @param {Object} done - * @param {Object} value - */ - confirm(value) { - // 输入框的值 - console.log(value) - // TODO 做一些其他的事情,手动执行 close 才会关闭对话框 - // ... - this.$refs.popup.close() - } - } -} -``` - -### PopupDialog Props - -|属性名|类型|默认值|说明| -|:-:|:-:|:-:|:-:| -|type|String|success|对话框标题主题,可选值: success/warn/info/error| -|mode|String|base| 对话框模式,可选值:base(提示对话框)/input(可输入对话框)| -|title|String|-|对话框标题| -|content|String|-|对话框内容,base模式下生效| -|value| String\Number|-|输入框默认值,input模式下生效| -|placeholder|String|-|输入框提示文字,input模式下生效| -|before-close|Boolean|false | 是否拦截按钮事件,如为true,则不会关闭对话框,关闭需要手动执行 uni-popup 的 close 方法| - -#### PopupDialog Events - -|事件称名 |说明|返回值| -|:-:|:-:|:-:| -|close|点击dialog取消按钮触发|-| -|confirm|点击dialog确定按钮触发|e={value:input模式下输入框的值}| - -### PopupDialog Slots - -|名称|说明| -|:-:|:-:| -|default|自定义内容,回覆盖原有的内容显示| - -### uni-popup-share 分享示例 - -分享示例,不作为最终可使用的组件,只做为样式组件,供用户自行修改,`后续的开发计划是实现实际的分享逻辑,参数可配置`。 - -将 `uni-popup` 的 `type` 属性改为 `share`,并引入对应组件即可使用 ,*该组件不支持单独使用* - -**示例** - -```html - - - -``` - -### PopupShare Props - -|属性名|类型|默认值|说明| -|:-:|:-:|:-:| :-: | -|title|String|-|分享弹窗标题| -|before-close|Boolean|false | 是否拦截按钮事件,如为true,则不会关闭对话框,关闭需要手动执行 uni-popup 的 close 方法| - -### PopupShare Events - -|事件称名|说明|返回值| -|:-:|:-:|:-:| -|select|选择触发|e = {item,index}:所选参数| - -**Tips** -- share 分享组件,只是作为一个扩展示例,如果需要修改数据源,请到组件内修改 - -## 帮助 -在使用中如遇到无法解决的问题,请提 [Issues](https://github.com/dcloudio/uni-ui/issues) 给我们。 - - - -## 组件示例 - -点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/popup/popup](https://hellouniapp.dcloud.net.cn/pages/extUI/popup/popup) \ No newline at end of file diff --git a/uni_modules/uni-segmented-control/changelog.md b/uni_modules/uni-segmented-control/changelog.md index aec4bdd..a44385d 100644 --- a/uni_modules/uni-segmented-control/changelog.md +++ b/uni_modules/uni-segmented-control/changelog.md @@ -1,2 +1,9 @@ +## 1.2.0(2021-11-19) +- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) +- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-segmented-control](https://uniapp.dcloud.io/component/uniui/uni-segmented-control) +## 1.1.0(2021-07-30) +- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) +## 1.0.5(2021-05-12) +- 新增 项目示例地址 ## 1.0.4(2021-02-05) - 调整为uni_modules目录规范 diff --git a/uni_modules/uni-segmented-control/components/uni-segmented-control/uni-segmented-control.vue b/uni_modules/uni-segmented-control/components/uni-segmented-control/uni-segmented-control.vue index 19f1328..044a495 100644 --- a/uni_modules/uni-segmented-control/components/uni-segmented-control/uni-segmented-control.vue +++ b/uni_modules/uni-segmented-control/components/uni-segmented-control/uni-segmented-control.vue @@ -1,20 +1,23 @@ @@ -35,6 +38,7 @@ export default { name: 'UniSegmentedControl', + emits: ['clickItem'], props: { current: { type: Number, @@ -48,7 +52,7 @@ }, activeColor: { type: String, - default: '#007aff' + default: '#2979FF' }, styleType: { type: String, @@ -84,7 +88,6 @@ - -``` - - -如果使用 `styles` 注意带’-‘连接符的属性需要使用小驼峰写法如:`backgroundColor:red` - -```html - - -``` - -### 自定义动画 -当内置动画类型不能满足需求的时候 ,可以使用 `step()` 和 `run()` 自定义动画,入参以及具体用法参考下方属性说明 - -`init()` 方法可以覆盖默认配置 - - -```html - - - -``` - - -## API - -### Transition Props - -|属性名 |类型 |默认值 |说明 | -|:-: |:-: |:-: |:-:| -|show |Boolean|false |控制组件显示或隐藏 | -|mode-class |Array/String |- |内置过渡动画类型 | -|custom-class |String |- |自定义类名 | -|duration |Number |300 |过渡动画持续时间 | -|styles |Object |- |组件样式,同 css 样式,注意带’-‘连接符的属性需要使用小驼峰写法如:`backgroundColor:red` | - -#### mode-class 内置过渡动画类型说明 -**格式为** :`'fade'` 或者 `['fade','slide-top']` - -|属性名 |说明 | -|:-: |:-: | -|fade |渐隐渐出过渡 | -|slide-top |由上至下过渡 | -|slide-right |由右至左过渡 | -|slide-bottom |由下至上过渡 | -|slide-left |由左至右过渡 | -|zoom-in |由小到大过渡 | -|zoom-out |由大到小过渡 | - -**注意** - -组合使用时,同一种类型相反的过渡动画如(slide-top、slide-bottom)同时使用时,只有最后一个生效 - -### Transition Events - -|事件名 |说明 |返回值 | -|:-: |:-: |:-: | -|click |点击组件触发 |- | -|change |过渡动画结束时触发 | e = {detail:true} | - -### Transition Methons - -|方法名|说明|参数| -|:-:|:-:|:-:| -|init()|手动初始化配置|Function(OBJECT:config)| -|step()|动画队列|Function(OBJECT:type,OBJECT:config)| -|run()|执行动画|Function(FUNCTION:callback) | - -### init(OBJECT:config) -**通过 ref 调用方法** - -手动设置动画配置,需要在页面渲染完毕后调用 - -```javascript -this.$refs.ani.init({ - duration: 1000, - timingFunction:'ease', - delay:500, - transformOrigin:'left center' -}) -``` - -### step(OBJECT:type,OBJECT:config) 动画队列 -**通过 ref 调用方法** - -调用 `step()` 来表示一组动画完成,`step` 第一个参数可以传入任意多个动画方法,一组动画中的所有动画会同时开始,一组动画完成后才会进行下一组动画。`step` 第二个参数可以传入一个跟 `uni.createAnimation()` 一样的配置参数用于指定当前组动画的配置。 - -Tips -- 第一个参数支持的动画参考下面的 `支持的动画` -- 第二个参数参考下面的 `动画配置`,可省略,如果省略继承`init`的配置 - - -```javascript -this.$refs.ani.step({ - translateX: '100px' -},{ - duration: 1000, - timingFunction:'ease', - delay:500, - transformOrigin:'left center' -}) -``` - -### run(FUNCTION:callback) 执行动画 -**通过 ref 调用方法** - -在执行 `step()` 后,需要调用 `run()` 来运行动画 ,否则动画会一直等待 - -`run()` 方法可以传入一个 `callback` 函数 ,会在所有动画执行完毕后回调 - -```javascript -this.$refs.ani.step({ - translateX: '100px' -}) -this.$refs.ani.run(()=>{ - console.log('动画执行完毕') -}) - -``` - -### 动画配置 -动画配置 , `init()` 与 `step()` 第二个参数配置相同 ,如果配置`step() `第二个参数,将会覆盖 `init()` 的配置 - -|属性名|值|必填|默认值|说明|平台差异| -|:-:|:-:|:-:|:-:|:-:|:-:| -|duration|Number|否|400|动画持续时间,单位ms|-| -|timingFunction|String|否|"linear"|定义动画的效果|-| -|delay|Number|否|0|动画延迟时间,单位 ms|-| -|needLayout|Boolean|否|false |动画执行是否影响布局|仅 nvue 支持| -|transformOrigin|String |否|"center center"|设置 [transform-origin](https://developer.mozilla.org/en-US/docs/Web/CSS/transform-origin)|-| - - -### timingFunction 属性说明 - -|值|说明|平台差异| -|:-:|:-:|:-:| -|linear|动画从头到尾的速度是相同的|-| -|ease|动画以低速开始,然后加快,在结束前变慢|-| -|ease-in| 动画以低速开始|-| -|ease-in-out| 动画以低速开始和结束|-| -|ease-out|动画以低速结束|-| -|step-start|动画第一帧就跳至结束状态直到结束|nvue不支持| -|step-end|动画一直保持开始状态,最后一帧跳到结束状态|nvue不支持| - -```javascript -// init 配置 -this.$refs.ani.init({ - duration: 1000, - timingFunction:'ease', - delay:500, - transformOrigin:'left center' -}) -// step 配置 -this.$refs.ani.step({ - translateX: '100px' -},{ - duration: 1000, - timingFunction:'ease', - delay:500, - transformOrigin:'left center' -}) -``` - -### 支持的动画 -动画方法 - -如果同一个动画方法有多个值,多个值使用数组分隔 - -```javascript -this.$refs.ani.step({ - width:'100px', - scale: [1.2,0.8], -}) -``` - -**样式:** - -|属性名|值|说明|平台差异| -|:-:|:-:|:-:|:-:| -|opacity|value|透明度,参数范围 0~1|-| -|backgroundColor|color|颜色值|-| -|width|length|长度值,如果传入 Number 则默认使用 px,可传入其他自定义单位的长度值|-| -|height|length|长度值,如果传入 Number 则默认使用 px,可传入其他自定义单位的长度值|-| -|top|length|长度值,如果传入 Number 则默认使用 px,可传入其他自定义单位的长度值|nvue 不支持| -|left|length|长度值,如果传入 Number 则默认使用 px,可传入其他自定义单位的长度值|nvue 不支持| -|bottom|length|长度值,如果传入 Number 则默认使用 px,可传入其他自定义单位的长度值|nvue 不支持| -|right|length|长度值,如果传入 Number 则默认使用 px,可传入其他自定义单位的长度值|nvue 不支持| - -```javascript -this.$refs.ani.step({ - opacity: 1, - backgroundColor: '#ff5a5f', - widht:'100px', - height:'50rpx', -}) -``` - -**旋转:** - -旋转属性的值不需要填写单位 - -|属性名|值|说明|平台差异 | -|:-:|:-:|:-:|:-:| -|rotate|deg|deg的范围-180~180,从原点顺时针旋转一个deg角度 |-| -|rotateX|deg|deg的范围-180~180,在X轴旋转一个deg角度 |-| -|rotateY|deg|deg的范围-180~180,在Y轴旋转一个deg角度 |-| -|rotateZ|deg|deg的范围-180~180,在Z轴旋转一个deg角度 |nvue不支持| -|rotate3d|x,y,z,deg| 同 [transform-function rotate3d](https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/rotate3d()) |nvue不支持| - -```javascript -this.$refs.ani.step({ - rotateX: 45, - rotateY: 45 -}) -``` - -**缩放:** - -|属性名|值|说明|平台差异| -|:-:|:-:|:-: |:-:| -|scale|sx,[sy]|一个参数时,表示在X轴、Y轴同时缩放sx倍数;两个参数时表示在X轴缩放sx倍数,在Y轴缩放sy倍数|-| -|scaleX|sx|在X轴缩放sx倍数|-| -|scaleY|sy|在Y轴缩放sy倍数|-| -|scaleZ|sz|在Z轴缩放sy倍数|nvue不支持| -|scale3d|sx,sy,sz|在X轴缩放sx倍数,在Y轴缩放sy倍数,在Z轴缩放sz倍数|nvue不支持| - -```javascript -this.$refs.ani.step({ - scale: [1.2,0.8] -}) -``` - -**偏移:** - -|属性名|值|说明|平台差异| -|:-:|:-:|:-:|:-:| -|translate|tx,[ty]|一个参数时,表示在X轴偏移tx,单位px;两个参数时,表示在X轴偏移tx,在Y轴偏移ty,单位px。|-| -|translateX|tx| 在X轴偏移tx,单位px|-| -|translateY|ty| 在Y轴偏移tx,单位px|-| -|translateZ|tz| 在Z轴偏移tx,单位px|nvue不支持| -|translate3d|tx,ty,tz| 在X轴偏移tx,在Y轴偏移ty,在Z轴偏移tz,单位px|nvue不支持| - -```javascript -this.$refs.ani.step({ - translateX: '100px' -}) -``` - - - -## 组件示例 - -点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/transition/transition](https://hellouniapp.dcloud.net.cn/pages/extUI/transition/transition) \ No newline at end of file +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-transition) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 \ No newline at end of file diff --git a/uni_modules/uni-upgrade-center-app/changelog.md b/uni_modules/uni-upgrade-center-app/changelog.md index a7fb126..e57cfe5 100644 --- a/uni_modules/uni-upgrade-center-app/changelog.md +++ b/uni_modules/uni-upgrade-center-app/changelog.md @@ -1,5 +1,7 @@ -## 0.4.2(2022-06-02) -- 修复 wgt 包更新时错误处理的 bug +## 0.6.1(2022-08-17) +- 修复 后台添加应用市场,但都没有启用的情况下报错的Bug (需要 uni-admin 1.9.3+) +## 0.6.0(2022-07-19) +- 新增 支持多应用商店配置(需要 uni-admin 1.9.3+) ## 0.4.1(2022-05-27) - 修复 上版引出的报错问题 ## 0.4.0(2022-05-27) diff --git a/uni_modules/uni-upgrade-center-app/package.json b/uni_modules/uni-upgrade-center-app/package.json index bfca493..e50766d 100644 --- a/uni_modules/uni-upgrade-center-app/package.json +++ b/uni_modules/uni-upgrade-center-app/package.json @@ -1,7 +1,7 @@ { "id": "uni-upgrade-center-app", "displayName": "升级中心 uni-upgrade-center - App", - "version": "0.4.2", + "version": "0.6.1", "description": "uni升级中心 - 客户端检查更新", "keywords": [ "uniCloud", @@ -13,11 +13,7 @@ "engines": { "HBuilderX": "^3.1.0" }, - "dcloudext": { - "category": [ - "uniCloud", - "云端一体页面模板" - ], +"dcloudext": { "sale": { "regular": { "price": "0.00" @@ -34,7 +30,8 @@ "data": "插件不采集任何数据", "permissions": "无" }, - "npmurl": "" + "npmurl": "", + "type": "unicloud-template-page" }, "uni_modules": { "dependencies": [], @@ -67,7 +64,8 @@ "阿里": "u", "百度": "u", "字节跳动": "u", - "QQ": "u" + "QQ": "u", + "京东": "u" }, "快应用": { "华为": "u", diff --git a/uni_modules/uni-upgrade-center-app/pages/upgrade-popup.vue b/uni_modules/uni-upgrade-center-app/pages/upgrade-popup.vue index 8778e64..d0ac7d0 100644 --- a/uni_modules/uni-upgrade-center-app/pages/upgrade-popup.vue +++ b/uni_modules/uni-upgrade-center-app/pages/upgrade-popup.vue @@ -37,7 +37,7 @@ @@ -62,9 +62,10 @@