From 90be9c190165c12c483e70fecb5877691880ad9e Mon Sep 17 00:00:00 2001 From: chrisftian Date: Fri, 24 May 2024 15:38:54 +0800 Subject: [PATCH] Dev/1.8.0 (#208) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: getObject 对 Key 做格式化 --- README.md | 5 +- demo/CIDemos/index.js | 8 + demo/CIDemos/meta.js | 722 ++++++++++++++++++++++++++++++++++++++ demo/demo.js | 157 +++++---- demo/index.html | 18 +- dist/cos-js-sdk-v5.js | 59 +++- dist/cos-js-sdk-v5.min.js | 2 +- index.d.ts | 2 + package.json | 2 +- src/base.js | 22 ++ src/cos.js | 1 + src/util.js | 16 + test/test.js | 120 +++++++ 13 files changed, 1043 insertions(+), 91 deletions(-) create mode 100644 demo/CIDemos/meta.js diff --git a/README.md b/README.md index 5ae5af3..4884ecc 100644 --- a/README.md +++ b/README.md @@ -108,8 +108,9 @@ npm i cos-js-sdk-v5 --save 1. git clone cos-js-sdk-v5 至本地 2. cd cos-js-sdk-v5 进入根目录后执行:npm install 3. 修改 server 文件夹中 sts.js 或 sts.php 中的 secretId、secretKey、bucket、region 配置;注意allowPrefix和allowActions需要设置适当的权限 -4. npm run server # 用 node 启动服务 -5. 浏览器输入 http://127.0.0.1:3000/ 即可进行 demo 演示 +4. 修改 demo/index.html 中config的Bucket、Region 参数 +5. npm run server # 用 node 启动服务 +6. 浏览器输入 http://127.0.0.1:3000/ 即可进行 demo 演示 ``` ## 说明文档 diff --git a/demo/CIDemos/index.js b/demo/CIDemos/index.js index f318989..c020aa1 100644 --- a/demo/CIDemos/index.js +++ b/demo/CIDemos/index.js @@ -7,6 +7,7 @@ import * as docPreview from './docPreview.js'; import * as audit from './audit.js'; import * as fileProcess from './fileProcess.js'; import * as asr from './asr.js'; +import * as meta from './meta.js'; // 函数集合 const moduleFn = {}; @@ -48,6 +49,10 @@ const contentMap = { title: '智能语音', functions: [], }, + // meta: { + // title: '元数据', + // functions: [], + // }, }; function setContent(fnName, module, moduleName) { @@ -82,6 +87,9 @@ for (let fnName in fileProcess) { for (let fnName in asr) { setContent(fnName, asr, 'asr'); } +// for (let fnName in meta) { +// setContent(fnName, meta, 'meta'); +// } (function () { const container = document.querySelector('.ci-main'); diff --git a/demo/CIDemos/meta.js b/demo/CIDemos/meta.js new file mode 100644 index 0000000..03a71dc --- /dev/null +++ b/demo/CIDemos/meta.js @@ -0,0 +1,722 @@ +/** + * 元数据demo集合 + */ + +// 从 Bucket 里拆出 AppId +const AppId = config.Bucket.substr(config.Bucket.lastIndexOf('-') + 1); + +// 创建数据集 +export const createDataset = { + name: '创建数据集', + fn: function createDataset() { + const key = 'dataset/create'; // 固定值 + const host = `${AppId}.ci.${config.Region}.myqcloud.com`; + const url = `https://${host}/${key}`; + const body = JSON.stringify({ + // 数据集名称,同一个账户下唯一。命名规则如下: - 长度为1~128字符 - 只能包含英文字母,数字,短划线(-)和下划线() - 必须以英文字母和下划线()开头;是否必传:是 + DatasetName: 'test-dataset-imagesearch2', + // 数据集描述信息。长度为1~256个英文或中文字符,默认值为空。;是否必传:否 + Description: 'test-dataset-desc', + // 指模板,在建立元数据索引时,后端将根据模板来决定收集哪些元数据。每个模板都包含一个或多个算子,不同的算子表示不同的元数据。目前支持的模板: Official:DefaultEmptyId:默认为空的模板,表示不进行元数据的采集。 Official:COSBasicMeta:基础信息模板,包含 COS 文件基础元信息算子,表示采集 COS 文件的名称、类型、ACL等基础元信息数据。 Official:FaceSearch:人脸检索模板,包含人脸检索、COS 文件基础元信息算子。Official:ImageSearch:图像检索模板,包含图像检索、COS 文件基础元信息算子。;是否必传:否 + TemplateId: 'Official:ImageSearch', + }); + + cos.request( + { + Method: 'POST', // 固定值,必须 + Key: key, // 必须 + Url: url, // 请求的url,必须 + Body: body, // 请求体参数,必须 + RawBody: true, // 设置返回原始响应体,sdk 内部不做解析,固定值,必须 + Headers: { + // 设置请求体为 json,固定值,必须 + 'Content-Type': 'application/json', + // 设置响应体为json,固定值,必须 + Accept: 'application/json', + }, + }, + function (err, data) { + if (err) { + // 处理请求失败 + console.log(err); + } else { + // 处理请求成功 + console.log(data.Body && JSON.parse(data.Body)); + } + } + ); + }, +}; + +// 更新数据集 +export const updateDataset = { + name: '更新数据集', + fn: function updateDataset() { + const key = 'dataset/update'; // 固定值 + const host = `${AppId}.ci.${config.Region}.myqcloud.com`; + const url = `https://${host}/${key}`; + const body = JSON.stringify({ + // 数据集名称,同一个账户下唯一。;是否必传:是 + DatasetName: 'test-dataset-facesearch', + // 数据集描述信息。长度为1~256个英文或中文字符,默认值为空。;是否必传:否 + Description: 'test-dataset-facesearch-desc', + // 该参数表示模板,在建立元数据索引时,后端将根据模板来决定收集哪些元数据。每个模板都包含一个或多个算子,不同的算子表示不同的元数据。目前支持的模板: Official:Empty:默认为空的模板,表示不进行元数据的采集。 Official:COSBasicMeta:基础信息模板,包含COS文件基础元信息算子,表示采集cos文件的名称、类型、acl等基础元信息数据。;是否必传:否 + TemplateId: 'Official:FaceSearch', + }); + + cos.request( + { + Method: 'POST', // 固定值,必须 + Key: key, // 必须 + Url: url, // 请求的url,必须 + Body: body, // 请求体参数,必须 + RawBody: true, // 设置返回原始响应体,sdk 内部不做解析,固定值,必须 + Headers: { + // 设置请求体为 json,固定值,必须 + 'Content-Type': 'application/json', + // 设置响应体为json,固定值,必须 + Accept: 'application/json', + }, + }, + function (err, data) { + if (err) { + // 处理请求失败 + console.log(err); + } else { + // 处理请求成功 + console.log(data.Body && JSON.parse(data.Body)); + } + } + ); + }, +}; + +// 删除数据集 +export const deleteDataset = { + name: '删除数据集', + fn: function deleteDataset() { + const key = 'dataset'; // 固定值 + const host = `${AppId}.ci.${config.Region}.myqcloud.com`; + const url = `https://${host}/${key}`; + const body = JSON.stringify({ + // 数据集名称,同一个账户下唯一。;是否必传:是 + DatasetName: 'test-dataset', + }); + + cos.request( + { + Method: 'DELETE', // 固定值,必须 + Key: key, // 必须 + Url: url, // 请求的url,必须 + Body: body, // 请求体参数,必须 + RawBody: true, // 设置返回原始响应体,sdk 内部不做解析,固定值,必须 + Headers: { + // 设置请求体为 json,固定值,必须 + 'Content-Type': 'application/json', + // 设置响应体为json,固定值,必须 + Accept: 'application/json', + }, + }, + function (err, data) { + if (err) { + // 处理请求失败 + console.log(err); + } else { + // 处理请求成功 + console.log(data.Body && JSON.parse(data.Body)); + } + } + ); + }, +}; + +// 列出数据集 +export const describeDatasets = { + name: '列出数据集', + fn: function describeDatasets() { + const key = 'datasets'; // 固定值 + const host = `${AppId}.ci.${config.Region}.myqcloud.com`; + const url = `https://${host}/${key}`; + cos.request( + { + Method: 'GET', // 固定值,必须 + Key: key, // 必须 + Url: url, // 请求的url,必须 + Query: { + // 本次返回数据集的最大个数,取值范围为0~200。不设置此参数或者设置为0时,则默认值为100。;是否必传:否 + maxresults: 100, + // 翻页标记。当文件总数大于设置的MaxResults时,用于翻页的Token。从NextToken开始按字典序返回文件信息列表。填写上次查询返回的值,首次使用时填写为空。;是否必传:否 + // nexttoken: '', + // 数据集名称前缀。;是否必传:否 + // prefix: 'test', + }, + RawBody: true, // 设置返回原始响应体,sdk 内部不做解析,固定值,必须 + Headers: { + // 设置响应体为json,固定值,必须 + Accept: 'application/json', + }, + }, + function (err, data) { + if (err) { + // 处理请求失败 + console.log(err); + } else { + // 处理请求成功 + console.log(data.Body && JSON.parse(data.Body)); + } + } + ); + }, +}; + +// 查询数据集 +export const describeDataset = { + name: '查询数据集', + fn: function describeDataset() { + const key = 'dataset'; // 固定值 + const host = `${AppId}.ci.${config.Region}.myqcloud.com`; + const url = `https://${host}/${key}`; + + cos.request( + { + Method: 'GET', // 固定值,必须 + Key: key, // 必须 + Url: url, // 请求的url,必须 + Query: { + // 数据集名称,同一个账户下唯一。;是否必传:是 + datasetname: 'test-dataset-base22', + // 是否需要实时统计数据集中文件相关信息。有效值: false:不统计,返回的文件的总大小、数量信息可能不正确也可能都为0。 true:需要统计,返回数据集中当前的文件的总大小、数量信息。 默认值为false。;是否必传:否 + statistics: false, + }, + RawBody: true, // 设置返回原始响应体,sdk 内部不做解析,固定值,必须 + Headers: { + // 设置请求体为 json,固定值,必须 + 'Content-Type': 'application/json', + // 设置响应体为json,固定值,必须 + Accept: 'application/json', + }, + }, + function (err, data) { + if (err) { + // 处理请求失败 + console.log(err.code, err.message); + } else { + // 处理请求成功 + console.log(data.Body && JSON.parse(data.Body)); + } + } + ); + }, +}; + +// 绑定存储桶与数据集 +export const createDatasetBinding = { + name: '绑定存储桶与数据集', + fn: function createDatasetBinding() { + const key = 'datasetbinding/create'; // 固定值 + const host = `${AppId}.ci.${config.Region}.myqcloud.com`; + const url = `https://${host}/${key}`; + const body = JSON.stringify({ + // 数据集名称,同一个账户下唯一。;是否必传:是 + DatasetName: 'test-dataset-imagesearch2', + // 资源标识字段,表示需要与数据集绑定的资源,当前仅支持COS存储桶,字段规则:cos://,其中BucketName表示COS存储桶名称,例如:cos://examplebucket-1250000000;是否必传:是 + URI: `cos://${config.Bucket}`, + }); + + cos.request( + { + Method: 'POST', // 固定值,必须 + Key: key, // 必须 + Url: url, // 请求的url,必须 + Body: body, // 请求体参数,必须 + RawBody: true, // 设置返回原始响应体,sdk 内部不做解析,固定值,必须 + Headers: { + // 设置请求体为 json,固定值,必须 + 'Content-Type': 'application/json', + // 设置响应体为json,固定值,必须 + Accept: 'application/json', + }, + }, + function (err, data) { + if (err) { + // 处理请求失败 + console.log(err); + } else { + // 处理请求成功 + console.log(data.Body && JSON.parse(data.Body)); + } + } + ); + }, +}; + +// 解绑存储桶与数据集 +export const deleteDatasetBinding = { + name: '解绑存储桶与数据集', + fn: function deleteDatasetBinding() { + const key = 'datasetbinding'; // 固定值 + const host = `${AppId}.ci.${config.Region}.myqcloud.com`; + const url = `https://${host}/${key}`; + const body = JSON.stringify({ + // 数据集名称,同一个账户下唯一。;是否必传:是 + DatasetName: 'test-dataset-facesearch', + // 资源标识字段,表示需要与数据集绑定的资源,当前仅支持COS存储桶,字段规则:cos://,其中BucketName表示COS存储桶名称,例如:cos://examplebucket-1250000000;是否必传:是 + URI: `cos://${config.Bucket}`, + }); + + cos.request( + { + Method: 'DELETE', // 固定值,必须 + Key: key, // 必须 + Url: url, // 请求的url,必须 + Body: body, // 请求体参数,必须 + RawBody: true, // 设置返回原始响应体,sdk 内部不做解析,固定值,必须 + Headers: { + // 设置请求体为 json,固定值,必须 + 'Content-Type': 'application/json', + // 设置响应体为json,固定值,必须 + Accept: 'application/json', + }, + }, + function (err, data) { + if (err) { + // 处理请求失败 + console.log(err); + } else { + // 处理请求成功 + console.log(data.Body && JSON.parse(data.Body)); + } + } + ); + }, +}; + +// 查询数据集与存储桶的绑定关系 +export const describeDatasetBinding = { + name: '查询数据集与存储桶的绑定关系', + fn: function describeDatasetBinding() { + const key = 'datasetbinding'; // 固定值 + const host = `${AppId}.ci.${config.Region}.myqcloud.com`; + const url = `https://${host}/${key}`; + + cos.request( + { + Method: 'GET', // 固定值,必须 + Key: key, // 必须 + Url: url, // 请求的url,必须 + Query: { + // 数据集名称,同一个账户下唯一。;是否必传:是 + datasetname: 'test-dataset-base', + // 资源标识字段,表示需要与数据集绑定的资源,当前仅支持COS存储桶,字段规则:cos://,其中BucketName表示COS存储桶名称,例如(需要进行urlencode):cos%3A%2F%2Fexample-125000;是否必传:是 + uri: `cos://${config.Bucket}`, + }, + RawBody: true, // 设置返回原始响应体,sdk 内部不做解析,固定值,必须 + Headers: { + // 设置响应体为json,固定值,必须 + Accept: 'application/json', + }, + }, + function (err, data) { + if (err) { + // 处理请求失败 + console.log(err.code, err.message); + } else { + // 处理请求成功 + console.log(data.Body && JSON.parse(data.Body)); + } + } + ); + }, +}; + +// 查询绑定关系列表 +export const describeDatasetBindings = { + name: '查询绑定关系列表', + fn: function describeDatasetBindings() { + const key = 'datasetbindings'; // 固定值 + const host = `${AppId}.ci.${config.Region}.myqcloud.com`; + const url = `https://${host}/${key}`; + + cos.request( + { + Method: 'GET', // 固定值,必须 + Key: key, // 必须 + Url: url, // 请求的url,必须 + Query: { + // 数据集名称,同一个账户下唯一。;是否必传:否 + datasetname: 'test-dataset-base', + // 返回绑定关系的最大个数,取值范围为0~200。不设置此参数或者设置为0时,则默认值为100。;是否必传:否 + maxresults: 100, + // 当绑定关系总数大于设置的MaxResults时,用于翻页的token。从NextToken开始按字典序返回绑定关系信息列表。第一次调用此接口时,设置为空。;是否必传:是 + // nexttoken: '', + }, + RawBody: true, // 设置返回原始响应体,sdk 内部不做解析,固定值,必须 + Headers: { + // 设置响应体为json,固定值,必须 + Accept: 'application/json', + }, + }, + function (err, data) { + if (err) { + // 处理请求失败 + console.log(err); + } else { + // 处理请求成功 + console.log(data.Body && JSON.parse(data.Body)); + } + } + ); + }, +}; + +// 创建元数据索引 +export const createFileMetaIndex = { + name: '创建元数据索引', + fn: function createFileMetaIndex() { + const key = 'filemeta/create'; // 固定值 + const host = `${AppId}.ci.${config.Region}.myqcloud.com`; + const url = `https://${host}/${key}`; + const body = JSON.stringify({ + // 数据集名称,同一个账户下唯一。;是否必传:是 + DatasetName: 'test-dataset-imagesearch2', + // 元数据索引结果(以回调形式发送至您的回调地址,支持以 http:// 或者 https:// 开头的地址,例如: http://www.callback.com。;是否必传:否 + // Callback: 'http://www.callback.com', + // 用于建立索引的文件信息。;是否必传:是 + File: { + // 自定义ID。该文件索引到数据集后,作为该行元数据的属性存储,用于和您的业务系统进行关联、对应。您可以根据业务需求传入该值,例如将某个URI关联到您系统内的某个ID。推荐传入全局唯一的值。在查询时,该字段支持前缀查询和排序,详情请见字段和操作符的支持列表。 ;是否必传:否 + // CustomId: '001', + // 自定义标签。您可以根据业务需要自定义添加标签键值对信息,用于在查询时可以据此为筛选项进行检索,详情请见字段和操作符的支持列表。 ;是否必传:否 + // CustomLabels: {"age":"18","level":"18"}, + // 可选项,文件媒体类型,枚举值: image:图片。 other:其他。 document:文档。 archive:压缩包。 video:视频。 audio:音频。 ;是否必传:否 + MediaType: 'image', + // 可选项,文件内容类型(MIME Type),如image/jpeg。 ;是否必传:否 + ContentType: 'image/jpeg', + // 资源标识字段,表示需要建立索引的文件地址,当前仅支持COS上的文件,字段规则:cos:///,其中BucketName表示COS存储桶名称,ObjectKey表示文件完整路径,例如:cos://examplebucket-1250000000/test1/img.jpg。 注意: 1、仅支持本账号内的COS文件 2、不支持HTTP开头的地址;是否必传:是 + URI: `cos://${config.Bucket}/ci/dog.jpeg`, + // 输入图片中检索的人脸数量,默认值为20,最大值为20。(仅当数据集模板 ID 为 Official:FaceSearch 有效)。;是否必传:否 + // MaxFaceNum: 20, + // 自定义人物属性(仅当数据集模板 ID 为 Official:FaceSearch 有效)。;是否必传:否 + // Persons: { + // }, + }, + }); + + cos.request( + { + Method: 'POST', // 固定值,必须 + Key: key, // 必须 + Url: url, // 请求的url,必须 + Body: body, // 请求体参数,必须 + RawBody: true, // 设置返回原始响应体,sdk 内部不做解析,固定值,必须 + Headers: { + // 设置请求体为 json,固定值,必须 + 'Content-Type': 'application/json', + // 设置响应体为json,固定值,必须 + Accept: 'application/json', + }, + }, + function (err, data) { + if (err) { + // 处理请求失败 + console.log(err); + } else { + // 处理请求成功 + console.log(data.Body && JSON.parse(data.Body)); + } + } + ); + }, +}; + +// 删除元数据索引 +export const deleteFileMetaIndex = { + name: '删除元数据索引', + fn: function deleteFileMetaIndex() { + const key = 'filemeta'; // 固定值 + const host = `${AppId}.ci.${config.Region}.myqcloud.com`; + const url = `https://${host}/${key}`; + const body = JSON.stringify({ + // 数据集名称,同一个账户下唯一。;是否必传:是 + DatasetName: 'test-dataset-base', + // 资源标识字段,表示需要建立索引的文件地址。;是否必传:是 + URI: `cos://${config.Bucket}/1.png`, + }); + + cos.request( + { + Method: 'DELETE', // 固定值,必须 + Key: key, // 必须 + Url: url, // 请求的url,必须 + Body: body, // 请求体参数,必须 + RawBody: true, // 设置返回原始响应体,sdk 内部不做解析,固定值,必须 + Headers: { + // 设置请求体为 json,固定值,必须 + 'Content-Type': 'application/json', + // 设置响应体为json,固定值,必须 + Accept: 'application/json', + }, + }, + function (err, data) { + if (err) { + // 处理请求失败 + console.log(err); + } else { + // 处理请求成功 + console.log(data.Body && JSON.parse(data.Body)); + } + } + ); + }, +}; + +// 查询元数据索引 +export const describeFileMetaIndex = { + name: '查询元数据索引', + fn: function describeFileMetaIndex() { + const key = 'filemeta'; // 固定值 + const host = `${AppId}.ci.${config.Region}.myqcloud.com`; + const url = `https://${host}/${key}`; + + cos.request( + { + Method: 'GET', // 固定值,必须 + Key: key, // 必须 + Url: url, // 请求的url,必须 + Query: { + // 数据集名称,同一个账户下唯一。;是否必传:是 + datasetname: 'test-dataset-base', + // 资源标识字段,表示需要建立索引的文件地址,当前仅支持COS上的文件,字段规则:cos:///,其中BucketName表示COS存储桶名称,ObjectKey表示文件完整路径,例如:cos://examplebucket-1250000000/test1/img.jpg。 注意: 1、仅支持本账号内的COS文件 2、不支持HTTP开头的地址 3、需UrlEncode;是否必传:是 + uri: `cos://${config.Bucket}/1.png`, + }, + RawBody: true, // 设置返回原始响应体,sdk 内部不做解析,固定值,必须 + Headers: { + // 设置响应体为json,固定值,必须 + Accept: 'application/json', + }, + }, + function (err, data) { + if (err) { + // 处理请求失败 + console.log(err.message); + } else { + // 处理请求成功 + console.log(data.Body && JSON.parse(data.Body)); + } + } + ); + }, +}; + +// 更新元数据索引 +export const updateFileMetaIndex = { + name: '更新元数据索引', + fn: function updateFileMetaIndex() { + const key = 'filemeta/update'; // 固定值 + const host = `${AppId}.ci.${config.Region}.myqcloud.com`; + const url = `https://${host}/${key}`; + const body = JSON.stringify({ + // 数据集名称,同一个账户下唯一。;是否必传:是 + DatasetName: 'test-dataset-base', + // 元数据索引结果(以回调形式发送至您的回调地址,支持以 http:// 或者 https:// 开头的地址,例如: http://www.callback.com;是否必传:是 + // Callback: 'http://www.callback.com', + // 用于建立索引的文件信息。;是否必传:是 + File: { + // 自定义ID。该文件索引到数据集后,作为该行元数据的属性存储,用于和您的业务系统进行关联、对应。您可以根据业务需求传入该值,例如将某个URI关联到您系统内的某个ID。推荐传入全局唯一的值。在查询时,该字段支持前缀查询和排序,详情请见字段和操作符的支持列表。 ;是否必传:否 + CustomId: '002', + // 自定义标签。您可以根据业务需要自定义添加标签键值对信息,用于在查询时可以据此为筛选项进行检索,详情请见字段和操作符的支持列表。 ;是否必传:否 + // CustomLabels: { age: '18', level: '18' }, + // 可选项,文件媒体类型,枚举值: image:图片。 other:其他。 document:文档。 archive:压缩包。 video:视频。 audio:音频。 ;是否必传:否 + MediaType: 'image', + // 可选项,文件内容类型(MIME Type),如image/jpeg。 ;是否必传:否 + ContentType: 'image/jpeg', + // 资源标识字段,表示需要建立索引的文件地址,当前仅支持COS上的文件,字段规则:cos:///,其中BucketName表示COS存储桶名称,ObjectKey表示文件完整路径,例如:cos://examplebucket-1250000000/test1/img.jpg。 注意: 1、仅支持本账号内的COS文件 2、不支持HTTP开头的地址;是否必传:是 + URI: `cos://${config.Bucket}/1.png`, + // 自定义人物属性(仅当数据集模板 ID 为 Official:FaceSearch 有效)。;是否必传:否 + // Persons: {}, + }, + }); + + cos.request( + { + Method: 'POST', // 固定值,必须 + Key: key, // 必须 + Url: url, // 请求的url,必须 + Body: body, // 请求体参数,必须 + RawBody: true, // 设置返回原始响应体,sdk 内部不做解析,固定值,必须 + Headers: { + // 设置请求体为 json,固定值,必须 + 'Content-Type': 'application/json', + // 设置响应体为json,固定值,必须 + Accept: 'application/json', + }, + }, + function (err, data) { + if (err) { + // 处理请求失败 + console.log(err); + } else { + // 处理请求成功 + console.log(data.Body && JSON.parse(data.Body)); + } + } + ); + }, +}; + +// 简单查询 +export const datasetSimpleQuery = { + name: '简单查询', + fn: function datasetSimpleQuery() { + const key = 'datasetquery/simple'; // 固定值 + const host = `${AppId}.ci.${config.Region}.myqcloud.com`; + const url = `https://${host}/${key}`; + const body = JSON.stringify({ + // 数据集名称,同一个账户下唯一。;是否必传:是 + DatasetName: 'test-dataset-base', + // 简单查询参数条件,可自嵌套。;是否必传:否 + // Query: { + // // 操作运算符。枚举值: not:逻辑非。 or:逻辑或。 and:逻辑与。 lt:小于。 lte:小于等于。 gt:大于。 gte:大于等于。 eq:等于。 exist:存在性查询。 prefix:前缀查询。 match-phrase:字符串匹配查询。 nested:字段为数组时,其中同一对象内逻辑条件查询。;是否必传:是 + // Operation: 'and', + // // 子查询的结构体。 只有当Operations为逻辑运算符(and、or、not或nested)时,才能设置子查询条件。 在逻辑运算符为and/or/not时,其SubQueries内描述的所有条件需符合父级设置的and/or/not逻辑关系。 在逻辑运算符为nested时,其父级的Field必须为一个数组类的字段(如:Labels)。 子查询条件SubQueries组的Operation必须为and/or/not中的一个或多个,其Field必须为父级Field的子属性。;是否必传:否 + // SubQueries: [{ + // Operation: '', + // Field: '', + // }], + // Field: '', + // Value: '', + // }, + // 返回文件元数据的最大个数,取值范围为0200。 使用聚合参数时,该值表示返回分组的最大个数,取值范围为02000。 不设置此参数或者设置为0时,则取默认值100。;是否必传:否 + MaxResults: 100, + // 排序字段列表。请参考字段和操作符的支持列表。 多个排序字段可使用半角逗号(,)分隔,例如:Size,Filename。 最多可设置5个排序字段。 排序字段顺序即为排序优先级顺序。;是否必传:是 + Sort: 'CustomId', + // 排序字段的排序方式。取值如下: asc:升序; desc(默认):降序。 多个排序方式可使用半角逗号(,)分隔,例如:asc,desc。 排序方式不可多于排序字段,即参数Order的元素数量需小于等于参数Sort的元素数量。例如Sort取值为Size,Filename时,Order可取值为asc,desc或asc。 排序方式少于排序字段时,未排序的字段默认取值asc。例如Sort取值为Size,Filename,Order取值为asc时,Filename默认排序方式为asc,即升序排列;是否必传:是 + Order: 'desc', + // 聚合字段信息列表。 当您使用聚合查询时,仅返回聚合结果,不再返回匹配到的元信息列表。;是否必传:否 + // Aggregations: { + // Operation: '', + // Field: '' + // }, + }); + + cos.request( + { + Method: 'POST', // 固定值,必须 + Key: key, // 必须 + Url: url, // 请求的url,必须 + Body: body, // 请求体参数,必须 + RawBody: true, // 设置返回原始响应体,sdk 内部不做解析,固定值,必须 + Headers: { + // 设置请求体为 json,固定值,必须 + 'Content-Type': 'application/json', + // 设置响应体为json,固定值,必须 + Accept: 'application/json', + }, + }, + function (err, data) { + if (err) { + // 处理请求失败 + console.log(err); + } else { + // 处理请求成功 + console.log(data.Body && JSON.parse(data.Body)); + } + } + ); + }, +}; + +// 人脸搜索 +export const datasetFaceSearch = { + name: '人脸搜索', + fn: function datasetFaceSearch() { + const key = 'datasetquery/facesearch'; // 固定值 + const host = `${AppId}.ci.${config.Region}.myqcloud.com`; + const url = `https://${host}/${key}`; + const body = JSON.stringify({ + // 数据集名称,同一个账户下唯一。;是否必传:是 + DatasetName: 'test-dataset-facesearch2', + // 资源标识字段,表示需要建立索引的文件地址。;是否必传:是 + URI: `cos://${config.Bucket}/ci/1.jpg`, + // 输入图片中检索的人脸数量,默认值为1(传0或不传采用默认值),最大值为10。;是否必传:否 + MaxFaceNum: 1, + // 检索的每张人脸返回相关人脸数量,默认值为10,最大值为100。;是否必传:否 + Limit: 10, + // 出参 Score 中,只有超过 MatchThreshold 值的结果才会返回。范围:1-100,默认值为0,推荐值为80。;是否必传:否 + MatchThreshold: 10, + }); + + cos.request( + { + Method: 'POST', // 固定值,必须 + Key: key, // 必须 + Url: url, // 请求的url,必须 + Body: body, // 请求体参数,必须 + RawBody: true, // 设置返回原始响应体,sdk 内部不做解析,固定值,必须 + Headers: { + // 设置请求体为 json,固定值,必须 + 'Content-Type': 'application/json', + // 设置响应体为json,固定值,必须 + Accept: 'application/json', + }, + }, + + function (err, data) { + if (err) { + // 处理请求失败 + console.log(err); + } else { + // 处理请求成功 + console.log(data.Body && JSON.parse(data.Body)); + } + } + ); + }, +}; + +// 图像检索 +export const searchImage = { + name: '图像检索', + fn: function searchImage() { + const key = 'datasetquery/imagesearch'; // 固定值 + const host = `${AppId}.ci.${config.Region}.myqcloud.com`; + const url = `https://${host}/${key}`; + const body = JSON.stringify({ + // 数据集名称,同一个账户下唯一。;是否必传:是 + DatasetName: 'test-dataset-imagesearch2', + // 指定检索方式为图片或文本,pic 为图片检索,text 为文本检索,默认为 pic。;是否必传:否 + Mode: 'pic', + // 资源标识字段,表示需要建立索引的文件地址(Mode 为 pic 时必选)。;是否必传:否 + URI: `cos://${config.Bucket}/ci/dog.jpeg`, + // 返回相关图片的数量,默认值为10,最大值为100。;是否必传:否 + Limit: 10, + // 出参 Score(相关图片匹配得分) 中,只有超过 MatchThreshold 值的结果才会返回。默认值为0,推荐值为80。;是否必传:否 + MatchThreshold: 1, + }); + + cos.request( + { + Method: 'POST', // 固定值,必须 + Key: key, // 必须 + Url: url, // 请求的url,必须 + Body: body, // 请求体参数,必须 + RawBody: true, // 设置返回原始响应体,sdk 内部不做解析,固定值,必须 + Headers: { + // 设置请求体为 json,固定值,必须 + 'Content-Type': 'application/json', + // 设置响应体为json,固定值,必须 + Accept: 'application/json', + }, + }, + + function (err, data) { + if (err) { + // 处理请求失败 + console.log(err); + } else { + // 处理请求成功 + console.log(data.Body && JSON.parse(data.Body)); + } + } + ); + }, +}; diff --git a/demo/demo.js b/demo/demo.js index 354a1cc..139854e 100644 --- a/demo/demo.js +++ b/demo/demo.js @@ -1,5 +1,13 @@ var TaskId; +if (typeof logger === 'undefined') { + logger = console; +} + +if (typeof config === 'undefined' || !config || !config.Bucket || !config.Region) { + console.error('请到 demo/index.html 中设置config初始化信息'); +} + function getObjectUrl() { var url = cos.getObjectUrl( { @@ -92,15 +100,16 @@ function headBucket() { } function deleteBucket() { - cos.deleteBucket( - { - Bucket: 'testnew-' + config.Bucket.substr(config.Bucket.lastIndexOf('-') + 1), - Region: 'ap-guangzhou', - }, - function (err, data) { - logger.log('deleteBucket:', err || data); - } - ); + // 谨慎使用,会删除存储桶 + // cos.deleteBucket( + // { + // Bucket: config.Bucket, + // Region: config.Region, + // }, + // function (err, data) { + // logger.log('deleteBucket:', err || data); + // } + // ); } function putBucketAcl() { @@ -205,15 +214,16 @@ function getBucketCors() { } function deleteBucketCors() { - cos.deleteBucketCors( - { - Bucket: config.Bucket, // Bucket 格式:test-1250000000 - Region: config.Region, - }, - function (err, data) { - logger.log('deleteBucketCors:', err || data); - } - ); + // 浏览器端不建议使用 + // cos.deleteBucketCors( + // { + // Bucket: config.Bucket, // Bucket 格式:test-1250000000 + // Region: config.Region, + // }, + // function (err, data) { + // logger.log('deleteBucketCors:', err || data); + // } + // ); } function putBucketTagging() { @@ -916,6 +926,7 @@ function putObject() { Bucket: config.Bucket, // Bucket 格式:test-1250000000 Region: config.Region, Key: filename, // 必须 + // 常见场景是使用 input[type="file"] 标签选择文件后上传,可参考 selectFileToUpload Body: blob, onTaskReady: function (tid) { TaskId = tid; @@ -980,49 +991,50 @@ function putObject_base64ToBlob() { ); } -function appendObject() { - cos.appendObject( - { - Bucket: config.Bucket, // Bucket 格式:test-1250000000 - Region: config.Region, - Key: 'append.txt', // 必须 - Body: '12345', - Position: 0, - }, - function (err, data) { - logger.log('putObject:', err || data); - } - ); -} - -function appendObject_continue() { - cos.headObject( - { - Bucket: config.Bucket, // Bucket 格式:test-1250000000 - Region: config.Region, - Key: 'append.txt', // 必须 - }, - function (err, data) { - if (err) return console.log(err); - // 首先取到要追加的文件当前长度,即需要上送的Position - var position = data.headers['content-length']; - cos.appendObject( - { - Bucket: config.Bucket, // Bucket 格式:test-1250000000 - Region: config.Region, - Key: 'append.txt', // 必须 - Body: '66666', - Position: position, - }, - function (err, data) { - // 也可以取到下一次上传的position继续追加上传 - // var nextPosition = data.headers['x-cos-next-append-position']; - logger.log('putObject:', err || data); - } - ); - } - ); -} +// 追加上传 +// function appendObject() { +// cos.appendObject( +// { +// Bucket: config.Bucket, // Bucket 格式:test-1250000000 +// Region: config.Region, +// Key: 'append.txt', // 必须 +// Body: '12345', +// Position: 0, +// }, +// function (err, data) { +// logger.log('putObject:', err || data); +// } +// ); +// } + +// function appendObject_continue() { +// cos.headObject( +// { +// Bucket: config.Bucket, // Bucket 格式:test-1250000000 +// Region: config.Region, +// Key: 'append.txt', // 必须 +// }, +// function (err, data) { +// if (err) return console.log(err); +// // 首先取到要追加的文件当前长度,即需要上送的Position +// var position = data.headers['content-length']; +// cos.appendObject( +// { +// Bucket: config.Bucket, // Bucket 格式:test-1250000000 +// Region: config.Region, +// Key: 'append.txt', // 必须 +// Body: '66666', +// Position: position, +// }, +// function (err, data) { +// // 也可以取到下一次上传的position继续追加上传 +// // var nextPosition = data.headers['x-cos-next-append-position']; +// logger.log('putObject:', err || data); +// } +// ); +// } +// ); +// } function putObjectCopy() { cos.putObjectCopy( @@ -1277,10 +1289,10 @@ function sliceUploadFile() { { Bucket: config.Bucket, // Bucket 格式:test-1250000000 Region: config.Region, - Key: '3mb.zip', // 必须 + Key: '3mb.jpg', // 必须 Body: blob, Headers: { - // 万象持久化接口,上传时持久化 + // 支持万象持久化接口,上传时持久化 // 'Pic-Operations': '{"is_pic_info": 1, "rules": [{"fileid": "test.jpg", "rule": "imageMogr2/thumbnail/!50p"}]}' }, onTaskReady: function (tid) { @@ -1300,6 +1312,7 @@ function sliceUploadFile() { } function selectFileToUpload() { + // 选择本地文件上传 util.selectLocalFile(function (files) { var file = files && files[0]; if (!file) return; @@ -1313,9 +1326,6 @@ function selectFileToUpload() { onTaskReady: function (tid) { TaskId = tid; }, - onHashProgress: function (progressData) { - logger.log('onHashProgress', JSON.stringify(progressData)); - }, onProgress: function (progressData) { logger.log('onProgress', JSON.stringify(progressData)); }, @@ -1334,9 +1344,6 @@ function selectFileToUpload() { onTaskReady: function (tid) { TaskId = tid; }, - onHashProgress: function (progressData) { - logger.log('onHashProgress', JSON.stringify(progressData)); - }, onProgress: function (progressData) { logger.log(JSON.stringify(progressData)); }, @@ -1419,7 +1426,7 @@ function sliceCopyFile() { Region: config.Region, Key: Key, CopySource: sourcePath, - SliceSize: 2 * 1024 * 1024, // 指定文件多大时用分片复制,小于数值则用单片复制 + CopySliceSize: 5 * 1024 * 1024, // 指定文件多大时用分片复制,小于数值则用单片复制 onProgress: function (info) { var percent = Math.floor(info.percent * 10000) / 100; var speed = Math.floor((info.speed / 1024 / 1024) * 100) / 100; @@ -1670,8 +1677,10 @@ function request() { Action: 'image_process', Headers: { // 通过 imageMogr2 接口使用图片缩放功能:指定图片宽度为 200,宽度等比压缩 - 'Pic-Operations': - '{"is_pic_info": 1, "rules": [{"fileid": "desample_photo.jpg", "rule": "imageMogr2/thumbnail/200x/"}]}', + 'Pic-Operations': JSON.stringify({ + is_pic_info: 1, + rules: [{ fileid: 'desample_photo.jpg', rule: 'imageMogr2/thumbnail/200x/' }], + }), }, }, function (err, data) { @@ -1747,8 +1756,8 @@ function request() { 'selectObjectContent', 'putObject', 'putObject_base64ToBlob', - 'appendObject', - 'appendObject_continue', + // 'appendObject', + // 'appendObject_continue', 'header-高级操作', 'uploadFile', diff --git a/demo/index.html b/demo/index.html index 428dc85..0abbe1e 100644 --- a/demo/index.html +++ b/demo/index.html @@ -107,6 +107,16 @@

+ + @@ -132,12 +142,7 @@

ciMain.className = 'main cos-main show'; }); - // config 替换成自己的存储桶和账号信息 - var config = { - Bucket: 'test-1250000000', - Region: 'ap-guangzhou', - Uin: '10001', - }; + var getAuthorization = function (options, callback) { // 格式一、(推荐)后端通过获取临时密钥给到前端,前端计算签名 // 服务端 JS 和 PHP 例子:https://github.com/tencentyun/cos-js-sdk-v5/blob/master/server/ @@ -332,7 +337,6 @@

/** * 这里demo为了方便挂在了window上 实际使用请结合项目比如可使用模块导出 * */ - window.config = config; window.cos = cos; window.util = util; window.logger = logger; diff --git a/dist/cos-js-sdk-v5.js b/dist/cos-js-sdk-v5.js index 6513784..8eb3e50 100644 --- a/dist/cos-js-sdk-v5.js +++ b/dist/cos-js-sdk-v5.js @@ -679,7 +679,6 @@ var process_to_xml = function process_to_xml(node_data, options) { ret.push(fn(v, 1, level + 1)); //entries that are values of an array are the only ones that can be special node descriptors }); - options.prettyPrint && ret.push('\n'); return ret.join(''); break; @@ -1546,7 +1545,6 @@ var xmlToJSON = function () { // collapse multiple spaces to single space stripElemPrefix: true // for elements of same name in diff namespaces, you can enable namespaces and access the nskey property }; - var prefixMatch = new RegExp(/(?!xmlns)^.*:/); var trimMatch = new RegExp(/^\s+|\s+$/g); this.grokType = function (sValue) { @@ -7283,7 +7281,7 @@ module.exports = function(module) { /*! exports provided: name, version, description, main, types, scripts, repository, keywords, author, license, bugs, homepage, dependencies, devDependencies, default */ /***/ (function(module) { -module.exports = JSON.parse("{\"name\":\"cos-js-sdk-v5\",\"version\":\"1.7.1\",\"description\":\"JavaScript SDK for [腾讯云对象存储](https://cloud.tencent.com/product/cos)\",\"main\":\"dist/cos-js-sdk-v5.js\",\"types\":\"index.d.ts\",\"scripts\":{\"prettier\":\"prettier --write src demo/demo.js demo/CIDemos/*.js test/test.js server/sts.js lib/request.js index.d.ts\",\"server\":\"node server/sts.js\",\"dev\":\"cross-env NODE_ENV=development webpack -w --mode=development\",\"build\":\"cross-env NODE_ENV=production webpack --mode=production\",\"cos-auth.min.js\":\"uglifyjs ./demo/common/cos-auth.js -o ./demo/common/cos-auth.min.js -c -m\",\"test\":\"jest --runInBand --coverage\"},\"repository\":{\"type\":\"git\",\"url\":\"git+https://github.com/tencentyun/cos-js-sdk-v5.git\"},\"keywords\":[],\"author\":\"carsonxu\",\"license\":\"ISC\",\"bugs\":{\"url\":\"https://github.com/tencentyun/cos-js-sdk-v5/issues\"},\"homepage\":\"https://github.com/tencentyun/cos-js-sdk-v5#readme\",\"dependencies\":{\"@xmldom/xmldom\":\"^0.8.6\"},\"devDependencies\":{\"@babel/core\":\"7.17.9\",\"@babel/plugin-transform-runtime\":\"7.18.10\",\"@babel/preset-env\":\"7.16.11\",\"babel-loader\":\"8.2.5\",\"body-parser\":\"^1.18.3\",\"cross-env\":\"^5.2.0\",\"express\":\"^4.16.4\",\"jest\":\"^29.3.1\",\"jest-environment-jsdom\":\"^29.3.1\",\"prettier\":\"^3.0.1\",\"qcloud-cos-sts\":\"^3.0.2\",\"request\":\"^2.87.0\",\"terser-webpack-plugin\":\"4.2.3\",\"uglifyjs\":\"^2.4.11\",\"webpack\":\"4.46.0\",\"webpack-cli\":\"4.10.0\"}}"); +module.exports = JSON.parse("{\"name\":\"cos-js-sdk-v5\",\"version\":\"1.8.0\",\"description\":\"JavaScript SDK for [腾讯云对象存储](https://cloud.tencent.com/product/cos)\",\"main\":\"dist/cos-js-sdk-v5.js\",\"types\":\"index.d.ts\",\"scripts\":{\"prettier\":\"prettier --write src demo/demo.js demo/CIDemos/*.js test/test.js server/sts.js lib/request.js index.d.ts\",\"server\":\"node server/sts.js\",\"dev\":\"cross-env NODE_ENV=development webpack -w --mode=development\",\"build\":\"cross-env NODE_ENV=production webpack --mode=production\",\"cos-auth.min.js\":\"uglifyjs ./demo/common/cos-auth.js -o ./demo/common/cos-auth.min.js -c -m\",\"test\":\"jest --runInBand --coverage\"},\"repository\":{\"type\":\"git\",\"url\":\"git+https://github.com/tencentyun/cos-js-sdk-v5.git\"},\"keywords\":[],\"author\":\"carsonxu\",\"license\":\"ISC\",\"bugs\":{\"url\":\"https://github.com/tencentyun/cos-js-sdk-v5/issues\"},\"homepage\":\"https://github.com/tencentyun/cos-js-sdk-v5#readme\",\"dependencies\":{\"@xmldom/xmldom\":\"^0.8.6\"},\"devDependencies\":{\"@babel/core\":\"7.17.9\",\"@babel/plugin-transform-runtime\":\"7.18.10\",\"@babel/preset-env\":\"7.16.11\",\"babel-loader\":\"8.2.5\",\"body-parser\":\"^1.18.3\",\"cross-env\":\"^5.2.0\",\"express\":\"^4.16.4\",\"jest\":\"^29.3.1\",\"jest-environment-jsdom\":\"^29.3.1\",\"prettier\":\"^3.0.1\",\"qcloud-cos-sts\":\"^3.0.2\",\"request\":\"^2.87.0\",\"terser-webpack-plugin\":\"4.2.3\",\"uglifyjs\":\"^2.4.11\",\"webpack\":\"4.46.0\",\"webpack-cli\":\"4.10.0\"}}"); /***/ }), @@ -10641,6 +10639,14 @@ function listObjectVersions(params, callback) { * @param {Object} data 为对应的 object 数据,包括 body 和 headers */ function getObject(params, callback) { + if (this.options.ObjectKeySimplifyCheck) { + // getObject 的 Key 需要校验,避免调用成 getBucket + var formatKey = util.simplifyPath(params.Key); + if (formatKey === '/') { + callback(util.error(new Error('The Getobject Key is illegal'))); + return; + } + } var reqParams = params.Query || {}; var reqParamsStr = params.QueryString || ''; var onProgress = util.throttleOnProgress.call(this, 0, params.onProgress); @@ -12573,6 +12579,20 @@ function _submitRequest(params, callback) { if (rawBody && statusSuccess) return cb(null, { body: body }); + // if (rawBody) { + // if (statusSuccess) { + // return cb(null, { body: body }); + // } else { + // // 兼容body返回了 json 格式的 error + // var errorBody = {}; + // try { + // errorBody = JSON.parse(body); + // } catch (e) {} + // return cb( + // util.error(new Error(errorBody.Message || 'response body error'), { code: errorBody.Code, error: errorBody }) + // ); + // } + // } // 解析 xml body var json; @@ -12787,6 +12807,8 @@ var defaultOptions = { AutoSwitchHost: true, CopySourceParser: null, // 自定义拷贝源解析器 + ObjectKeySimplifyCheck: true, + // 开启合并校验 getObject Key /** 上报相关 **/ DeepTracker: false, // 上报时是否对每个分块上传做单独上报 @@ -13299,7 +13321,6 @@ var getBeacon = function getBeacon(Beacon, delay) { sessionDuration: 60 * 1000 // session变更的时间间隔, 一个用户持续30分钟(默认值)没有任何上报则算另一次 session,每变更一次session上报一次启动事件(rqd_applaunched),使用毫秒(ms),最小值30秒,选填 }); } - return beacon; }; @@ -13354,7 +13375,6 @@ var utils = { if ((typeof navigator === "undefined" ? "undefined" : _typeof(navigator)) === 'object' && navigator.userAgent.match(exp)) { return true; // 移动端 } - return false; // PC端 }, isAndroid: function isAndroid() { @@ -13690,6 +13710,9 @@ module.exports = Tracker; /* WEBPACK VAR INJECTION */(function(process) { var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "./node_modules/@babel/runtime/helpers/typeof.js"); +function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } var md5 = __webpack_require__(/*! ../lib/md5 */ "./lib/md5.js"); var CryptoJS = __webpack_require__(/*! ../lib/crypto */ "./lib/crypto.js"); var xml2json = __webpack_require__(/*! ../lib/xml2json */ "./lib/xml2json.js"); @@ -14437,6 +14460,29 @@ var encodeBase64 = function encodeBase64(str, safe) { } return base64Str; }; +var simplifyPath = function simplifyPath(path) { + var names = path.split('/'); + var stack = []; + var _iterator = _createForOfIteratorHelper(names), + _step; + try { + for (_iterator.s(); !(_step = _iterator.n()).done;) { + var name = _step.value; + if (name === '..') { + if (stack.length) { + stack.pop(); + } + } else if (name.length && name !== '.') { + stack.push(name); + } + } + } catch (err) { + _iterator.e(err); + } finally { + _iterator.f(); + } + return '/' + stack.join('/'); +}; var util = { noop: noop, formatParams: formatParams, @@ -14472,7 +14518,8 @@ var util = { isNode: isNode, isCIHost: isCIHost, isIOS_QQ: isIOS && isQQ, - encodeBase64: encodeBase64 + encodeBase64: encodeBase64, + simplifyPath: simplifyPath }; module.exports = util; /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node_modules/process/browser.js */ "./node_modules/process/browser.js"))) diff --git a/dist/cos-js-sdk-v5.min.js b/dist/cos-js-sdk-v5.min.js index bae34be..c986421 100644 --- a/dist/cos-js-sdk-v5.min.js +++ b/dist/cos-js-sdk-v5.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.COS=t():e.COS=t()}(this,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/dist/",r(r.s=9)}([function(e,t){function r(t){return e.exports=r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,r(t)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){"use strict";(function(t){var n=r(0),o=r(12),a=r(14),i=r(15),s=r(20),c=r(21),u=r(5);function l(e){return encodeURIComponent(e).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A")}function d(e,t){var r=[];for(var n in e)e.hasOwnProperty(n)&&r.push(t?l(n).toLowerCase():n);return r.sort((function(e,t){return(e=e.toLowerCase())===(t=t.toLowerCase())?0:e>t?1:-1}))}var p,f=["cache-control","content-disposition","content-encoding","content-length","content-md5","expect","expires","host","if-match","if-modified-since","if-none-match","if-unmodified-since","origin","range","transfer-encoding","pic-operations"],h=function(e,t,r){var n=t/8,o=e.slice(r,r+n);return new Uint8Array(o).reverse(),new{8:Uint8Array,16:Uint16Array,32:Uint32Array}[t](o)[0]},g=function(e,t,r,n){var o=e.slice(t,r),a="";return new Uint8Array(o).forEach((function(e){a+=String.fromCharCode(e)})),n&&(a=decodeURIComponent(escape(a))),a},m=function(){},y=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&void 0!==e[r]&&null!==e[r]&&(t[r]=e[r]);return t},v=(p=function(e,t){e=e.split("."),t=t.split(".");for(var r=0;rparseInt(t[r])?1:-1;return 0},function(e){if(!e)return!1;var t=(e.match(/Chrome\/([.\d]+)/)||[])[1],r=(e.match(/QBCore\/([.\d]+)/)||[])[1],n=(e.match(/QQBrowser\/([.\d]+)/)||[])[1];return t&&p(t,"53.0.2785.116")<0&&r&&p(r,"3.53.991.400")<0&&n&&p(n,"9.0.2524.400")<=0||!1}("undefined"!=typeof navigator&&navigator.userAgent)),k=1048576;function C(e){return w(e,(function(e){return"object"===n(e)&&null!==e?C(e):e}))}function b(e,t){return T(t,(function(r,n){e[n]=t[n]})),e}function S(e){return e instanceof Array}function T(e,t){for(var r in e)e.hasOwnProperty(r)&&t(e[r],r)}function w(e,t){var r=S(e)?[]:{};for(var n in e)e.hasOwnProperty(n)&&(r[n]=t(e[n],n));return r}var R=function(e,t){var r=t.Bucket,n=t.Region,o=t.Key,a=this.options.Domain,i=!a||"string"==typeof a&&a.indexOf("{Bucket}")>-1,s=!a||"string"==typeof a&&a.indexOf("{Region}")>-1;if(e.indexOf("Bucket")>-1||"deleteMultipleObject"===e||"multipartList"===e||"listObjectVersions"===e){if(i&&!r)return"Bucket";if(s&&!n)return"Region"}else if(e.indexOf("Object")>-1||e.indexOf("multipart")>-1||"sliceUploadFile"===e||"abortUploadTask"===e||"uploadFile"===e){if(i&&!r)return"Bucket";if(s&&!n)return"Region";if(!o)return"Key"}return!1},x=function(e,t){if(t=b({},t),"getAuth"!==e&&"getV4Auth"!==e&&"getObjectUrl"!==e){var r=t.Headers||{};if(t&&"object"===n(t)){!function(){for(var e in t)t.hasOwnProperty(e)&&e.indexOf("x-cos-")>-1&&(r[e]=t[e])}();D.each({"x-cos-mfa":"MFA","Content-MD5":"ContentMD5","Content-Length":"ContentLength","Content-Type":"ContentType",Expect:"Expect",Expires:"Expires","Cache-Control":"CacheControl","Content-Disposition":"ContentDisposition","Content-Encoding":"ContentEncoding",Range:"Range","If-Modified-Since":"IfModifiedSince","If-Unmodified-Since":"IfUnmodifiedSince","If-Match":"IfMatch","If-None-Match":"IfNoneMatch","x-cos-copy-source":"CopySource","x-cos-copy-source-Range":"CopySourceRange","x-cos-metadata-directive":"MetadataDirective","x-cos-copy-source-If-Modified-Since":"CopySourceIfModifiedSince","x-cos-copy-source-If-Unmodified-Since":"CopySourceIfUnmodifiedSince","x-cos-copy-source-If-Match":"CopySourceIfMatch","x-cos-copy-source-If-None-Match":"CopySourceIfNoneMatch","x-cos-acl":"ACL","x-cos-grant-read":"GrantRead","x-cos-grant-write":"GrantWrite","x-cos-grant-full-control":"GrantFullControl","x-cos-grant-read-acp":"GrantReadAcp","x-cos-grant-write-acp":"GrantWriteAcp","x-cos-storage-class":"StorageClass","x-cos-traffic-limit":"TrafficLimit","x-cos-mime-limit":"MimeLimit","x-cos-server-side-encryption-customer-algorithm":"SSECustomerAlgorithm","x-cos-server-side-encryption-customer-key":"SSECustomerKey","x-cos-server-side-encryption-customer-key-MD5":"SSECustomerKeyMD5","x-cos-server-side-encryption":"ServerSideEncryption","x-cos-server-side-encryption-cos-kms-key-id":"SSEKMSKeyId","x-cos-server-side-encryption-context":"SSEContext","Pic-Operations":"PicOperations"},(function(e,n){void 0!==t[e]&&(r[n]=t[e])})),t.Headers=y(r)}}return t},A=function(e){return Date.now()+(e||0)},E="object"===("undefined"==typeof navigator?"undefined":n(navigator))&&!!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),B="object"===("undefined"==typeof navigator?"undefined":n(navigator))&&/\sQQ/i.test(navigator.userAgent),D={noop:m,formatParams:x,apiWrapper:function(e,t){return function(r,n){var o,a=this;if("function"==typeof r&&(n=r,r={}),r=x(e,r),a.options.EnableReporter)if("sliceUploadFile"===r.calledBySdk||"sliceCopyFile"===r.calledBySdk)o=r.tracker&&r.tracker.generateSubTracker({apiName:e});else if(["uploadFile","uploadFiles"].includes(e))o=null;else{var i=0;r.Body&&(i="string"==typeof r.Body?r.Body.length:r.Body.size||r.Body.byteLength||0);var s=a.options.UseAccelerate||"string"==typeof a.options.Domain&&a.options.Domain.includes("accelerate.");o=new u({Beacon:a.options.BeaconReporter,clsReporter:a.options.ClsReporter,bucket:r.Bucket,region:r.Region,apiName:e,realApi:e,accelerate:s,fileKey:r.Key,fileSize:i,deepTracker:a.options.DeepTracker,customId:a.options.CustomId,delay:a.options.TrackerDelay})}r.tracker=o;var c=function(e){return e&&e.headers&&(e.headers["x-cos-request-id"]&&(e.RequestId=e.headers["x-cos-request-id"]),e.headers["x-ci-request-id"]&&(e.RequestId=e.headers["x-ci-request-id"]),e.headers["x-cos-version-id"]&&(e.VersionId=e.headers["x-cos-version-id"]),e.headers["x-cos-delete-marker"]&&(e.DeleteMarker=e.headers["x-cos-delete-marker"])),e},l=function(e,t){o&&o.report(e,t),n&&n(c(e),c(t))},d=function(){if("getService"!==e&&"abortUploadTask"!==e){var t=R.call(a,e,r);if(t)return"missing param "+t;if(r.Region){if(a.options.CompatibilityMode){if(!/^([a-z\d-.]+)$/.test(r.Region))return"Region format error."}else{if(r.Region.indexOf("cos.")>-1)return'param Region should not be start with "cos."';if(!/^([a-z\d-]+)$/.test(r.Region))return"Region format error."}!a.options.CompatibilityMode&&-1===r.Region.indexOf("-")&&"yfb"!==r.Region&&"default"!==r.Region&&r.Region}if(r.Bucket){if(!/^([a-z\d-]+)-(\d+)$/.test(r.Bucket))if(r.AppId)r.Bucket=r.Bucket+"-"+r.AppId;else{if(!a.options.AppId)return'Bucket should format as "test-1250000000".';r.Bucket=r.Bucket+"-"+a.options.AppId}r.AppId&&delete r.AppId}!a.options.UseRawKey&&r.Key&&"/"===r.Key.substr(0,1)&&(r.Key=r.Key.substr(1))}}(),p=["getAuth","getObjectUrl"].includes(e);if("function"==typeof Promise&&!p&&!n)return new Promise((function(e,o){if(n=function(t,r){t?o(t):e(r)},d)return l(D.error(new Error(d)));t.call(a,r,l)}));if(d)return l(D.error(new Error(d)));var f=t.call(a,r,l);return p?f:void 0}},xml2json:i,json2xml:s,md5:o,clearKey:y,fileSlice:function(e,t,r,n,o){var a;if(e.slice?a=e.slice(t,r):e.mozSlice?a=e.mozSlice(t,r):e.webkitSlice&&(a=e.webkitSlice(t,r)),n&&v){var i=new FileReader;i.onload=function(e){a=null,o(new Blob([i.result]))},i.readAsArrayBuffer(a)}else o(a)},getBodyMd5:function(e,t,r,n){r=r||m,e?"string"==typeof t?r(D.md5(t,!0)):Blob&&t instanceof Blob?D.getFileMd5(t,(function(e,t){r(t)}),n):r():r()},getFileMd5:function(e,t,r){var n=e.size,a=0,i=o.getCtx();!function o(s){if(s>=n){var c=i.digest("hex");t(null,c)}else{var u=Math.min(n,s+k);D.fileSlice(e,s,u,!1,(function(e){!function(e,t){var r,n=new FileReader;FileReader.prototype.readAsBinaryString?(r=FileReader.prototype.readAsBinaryString,n.onload=function(){t(this.result)}):FileReader.prototype.readAsArrayBuffer&&(r=function(e){var r="",n=new FileReader;n.onload=function(e){for(var o=new Uint8Array(n.result),a=o.byteLength,i=0;i-1||f.indexOf(n)>-1)&&(t[r]=e[r])}return t}(C(e.Headers||e.headers||{})),u=e.Key||"";e.UseRawKey?t=e.Pathname||e.pathname||"/"+u:0!==(t=e.Pathname||e.pathname||u).indexOf("/")&&(t="/"+t);var l=!1!==e.ForceSignHost;if(!c.Host&&!c.host&&e.Bucket&&e.Region&&l&&(c.Host=e.Bucket+".cos."+e.Region+".myqcloud.com"),!r)throw new Error("missing param SecretId");if(!n)throw new Error("missing param SecretKey");var p=Math.round(A(e.SystemClockOffset)/1e3)-1,h=p,g=e.Expires||e.expires;h+=void 0===g?900:1*g||0;var m=r,y=o||p+";"+h,v=o||p+";"+h,k=d(c,!0).join(";").toLowerCase(),b=d(s,!0).join(";").toLowerCase(),S=a.HmacSHA1(v,n).toString(),T=[i,t,D.obj2str(s,!0),D.obj2str(c,!0),""].join("\n"),w=["sha1",y,a.SHA1(T).toString(),""].join("\n");return["q-sign-algorithm=sha1","q-ak="+m,"q-sign-time="+y,"q-key-time="+v,"q-header-list="+k,"q-url-param-list="+b,"q-signature="+a.HmacSHA1(w,S).toString()].join("&")},parseSelectPayload:function(e){for(var t={},r=g(e),n={records:[]};e.byteLength;){var o,a=h(e,32,0),i=h(e,32,4),s=a-i-16,c=0;for(e=e.slice(12);c=0))throw new B(A,new Error(e.tagName+"@"+r));for(var o=t.length-1;n"==e&&">")||"&"==e&&"&"||'"'==e&&"""||"&#"+e.charCodeAt()+";"}function H(e,t){if(t(e))return!0;if(e=e.firstChild)do{if(H(e,t))return!0}while(e=e.nextSibling)}function j(){this.ownerDocument=this}function F(e,t,r,n){e&&e._inc++,r.namespaceURI===a.XMLNS&&delete t._nsMap[r.prefix?r.localName:""]}function K(e,t,r){if(e&&e._inc){e._inc++;var n=t.childNodes;if(r)n[n.length++]=r;else{for(var o=t.firstChild,a=0;o;)n[a++]=o,o=o.nextSibling;n.length=a,delete n[n.length]}}}function z(e,t){var r=t.previousSibling,n=t.nextSibling;return r?r.nextSibling=n:e.firstChild=n,n?n.previousSibling=r:e.lastChild=r,t.parentNode=null,t.previousSibling=null,t.nextSibling=null,K(e.ownerDocument,e),t}function V(e){return e&&e.nodeType===M.DOCUMENT_TYPE_NODE}function G(e){return e&&e.nodeType===M.ELEMENT_NODE}function W(e){return e&&e.nodeType===M.TEXT_NODE}function Q(e,t){var r=e.childNodes||[];if(o(r,G)||V(t))return!1;var n=o(r,V);return!(t&&n&&r.indexOf(n)>r.indexOf(t))}function X(e,t){var r=e.childNodes||[];if(o(r,(function(e){return G(e)&&e!==t})))return!1;var n=o(r,V);return!(t&&n&&r.indexOf(n)>r.indexOf(t))}function $(e,t,r){if(!function(e){return e&&(e.nodeType===M.DOCUMENT_NODE||e.nodeType===M.DOCUMENT_FRAGMENT_NODE||e.nodeType===M.ELEMENT_NODE)}(e))throw new B(x,"Unexpected parent node type "+e.nodeType);if(r&&r.parentNode!==e)throw new B(A,"child not in parent");if(!function(e){return e&&(G(e)||W(e)||V(e)||e.nodeType===M.DOCUMENT_FRAGMENT_NODE||e.nodeType===M.COMMENT_NODE||e.nodeType===M.PROCESSING_INSTRUCTION_NODE)}(t)||V(t)&&e.nodeType!==M.DOCUMENT_NODE)throw new B(x,"Unexpected node type "+t.nodeType+" for parent node type "+e.nodeType)}function J(e,t,r){var n=e.childNodes||[],a=t.childNodes||[];if(t.nodeType===M.DOCUMENT_FRAGMENT_NODE){var i=a.filter(G);if(i.length>1||o(a,W))throw new B(x,"More than one element or text in fragment");if(1===i.length&&!Q(e,r))throw new B(x,"Element in fragment can not be inserted before doctype")}if(G(t)&&!Q(e,r))throw new B(x,"Only one element can be added and only after doctype");if(V(t)){if(o(n,V))throw new B(x,"Only one doctype is allowed");var s=o(n,G);if(r&&n.indexOf(s)1||o(a,W))throw new B(x,"More than one element or text in fragment");if(1===i.length&&!X(e,r))throw new B(x,"Element in fragment can not be inserted before doctype")}if(G(t)&&!X(e,r))throw new B(x,"Only one element can be added and only after doctype");if(V(t)){if(o(n,(function(e){return V(e)&&e!==r})))throw new B(x,"Only one doctype is allowed");var s=o(n,G);if(r&&n.indexOf(s)=0;T--){if(""===(w=o[T]).prefix&&w.namespace===e.namespaceURI){d=w.namespace;break}}if(d!==e.namespaceURI)for(T=o.length-1;T>=0;T--){var w;if((w=o[T]).namespace===e.namespaceURI){w.prefix&&(l=w.prefix+":"+u);break}}}t.push("<",l);for(var R=0;R"),r&&/^script$/i.test(u))for(;c;)c.data?t.push(c.data):me(c,t,r,n,o.slice()),c=c.nextSibling;else for(;c;)me(c,t,r,n,o.slice()),c=c.nextSibling;t.push("")}else t.push("/>");return;case C:case S:for(c=e.firstChild;c;)me(c,t,r,n,o.slice()),c=c.nextSibling;return;case f:return ge(t,e.name,e.value);case h:return t.push(e.data.replace(/[<&>]/g,q));case g:return t.push("");case k:return t.push("\x3c!--",e.data,"--\x3e");case b:var B=e.publicId,D=e.systemId;if(t.push("");else if(D&&"."!=D)t.push(" SYSTEM ",D,">");else{var N=e.internalSubset;N&&t.push(" [",N,"]"),t.push(">")}return;case v:return t.push("");case m:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function ye(e,t,r){var n;switch(t.nodeType){case p:(n=t.cloneNode(!1)).ownerDocument=e;case S:break;case f:r=!0}if(n||(n=t.cloneNode(!1)),n.ownerDocument=e,n.parentNode=null,r)for(var o=t.firstChild;o;)n.appendChild(ye(e,o,r)),o=o.nextSibling;return n}function ve(e,t,r){var n=new t.constructor;for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){var a=t[o];"object"!=typeof a&&a!=n[o]&&(n[o]=a)}switch(t.childNodes&&(n.childNodes=new D),n.ownerDocument=e,n.nodeType){case p:var i=t.attributes,s=n.attributes=new I,c=i.length;s._ownerElement=n;for(var u=0;u=0&&e0},lookupPrefix:function(e){for(var t=this;t;){var r=t._nsMap;if(r)for(var n in r)if(Object.prototype.hasOwnProperty.call(r,n)&&r[n]===e)return n;t=t.nodeType==f?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var r=t._nsMap;if(r&&Object.prototype.hasOwnProperty.call(r,e))return r[e];t=t.nodeType==f?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return null==this.lookupPrefix(e)}},u(d,M),u(d,M.prototype),j.prototype={nodeName:"#document",nodeType:C,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==S){for(var r=e.firstChild;r;){var n=r.nextSibling;this.insertBefore(r,t),r=n}return e}return Z(this,e,t),e.ownerDocument=this,null===this.documentElement&&e.nodeType===p&&(this.documentElement=e),e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),z(this,e)},replaceChild:function(e,t){Z(this,e,t,Y),e.ownerDocument=this,t&&this.removeChild(t),G(e)&&(this.documentElement=e)},importNode:function(e,t){return ye(this,e,t)},getElementById:function(e){var t=null;return H(this.documentElement,(function(r){if(r.nodeType==p&&r.getAttribute("id")==e)return t=r,!0})),t},getElementsByClassName:function(e){var t=c(e);return new N(this,(function(r){var n=[];return t.length>0&&H(r.documentElement,(function(o){if(o!==r&&o.nodeType===p){var a=o.getAttribute("class");if(a){var i=e===a;if(!i){var s=c(a);i=t.every((u=s,function(e){return u&&-1!==u.indexOf(e)}))}i&&n.push(o)}}var u})),n}))},createElement:function(e){var t=new ee;return t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.localName=e,t.childNodes=new D,(t.attributes=new I)._ownerElement=t,t},createDocumentFragment:function(){var e=new le;return e.ownerDocument=this,e.childNodes=new D,e},createTextNode:function(e){var t=new ne;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new oe;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){var t=new ae;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var r=new de;return r.ownerDocument=this,r.tagName=r.nodeName=r.target=e,r.nodeValue=r.data=t,r},createAttribute:function(e){var t=new te;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new ue;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var r=new ee,n=t.split(":"),o=r.attributes=new I;return r.childNodes=new D,r.ownerDocument=this,r.nodeName=t,r.tagName=t,r.namespaceURI=e,2==n.length?(r.prefix=n[0],r.localName=n[1]):r.localName=t,o._ownerElement=r,r},createAttributeNS:function(e,t){var r=new te,n=t.split(":");return r.ownerDocument=this,r.nodeName=t,r.name=t,r.namespaceURI=e,r.specified=!0,2==n.length?(r.prefix=n[0],r.localName=n[1]):r.localName=t,r}},l(j,M),ee.prototype={nodeType:p,hasAttribute:function(e){return null!=this.getAttributeNode(e)},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var r=this.ownerDocument.createAttribute(e);r.value=r.nodeValue=""+t,this.setAttributeNode(r)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){return e.nodeType===S?this.insertBefore(e,null):function(e,t){return t.parentNode&&t.parentNode.removeChild(t),t.parentNode=e,t.previousSibling=e.lastChild,t.nextSibling=null,t.previousSibling?t.previousSibling.nextSibling=t:e.firstChild=t,e.lastChild=t,K(e.ownerDocument,e,t),t}(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var r=this.getAttributeNodeNS(e,t);r&&this.removeAttributeNode(r)},hasAttributeNS:function(e,t){return null!=this.getAttributeNodeNS(e,t)},getAttributeNS:function(e,t){var r=this.getAttributeNodeNS(e,t);return r&&r.value||""},setAttributeNS:function(e,t,r){var n=this.ownerDocument.createAttributeNS(e,t);n.value=n.nodeValue=""+r,this.setAttributeNode(n)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new N(this,(function(t){var r=[];return H(t,(function(n){n===t||n.nodeType!=p||"*"!==e&&n.tagName!=e||r.push(n)})),r}))},getElementsByTagNameNS:function(e,t){return new N(this,(function(r){var n=[];return H(r,(function(o){o===r||o.nodeType!==p||"*"!==e&&o.namespaceURI!==e||"*"!==t&&o.localName!=t||n.push(o)})),n}))}},j.prototype.getElementsByTagName=ee.prototype.getElementsByTagName,j.prototype.getElementsByTagNameNS=ee.prototype.getElementsByTagNameNS,l(ee,M),te.prototype.nodeType=f,l(te,M),re.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw new Error(R[x])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,r){r=this.data.substring(0,e)+r+this.data.substring(e+t),this.nodeValue=this.data=r,this.length=r.length}},l(re,M),ne.prototype={nodeName:"#text",nodeType:h,splitText:function(e){var t=this.data,r=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var n=this.ownerDocument.createTextNode(r);return this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling),n}},l(ne,re),oe.prototype={nodeName:"#comment",nodeType:k},l(oe,re),ae.prototype={nodeName:"#cdata-section",nodeType:g},l(ae,re),ie.prototype.nodeType=b,l(ie,M),se.prototype.nodeType=T,l(se,M),ce.prototype.nodeType=y,l(ce,M),ue.prototype.nodeType=m,l(ue,M),le.prototype.nodeName="#document-fragment",le.prototype.nodeType=S,l(le,M),de.prototype.nodeType=v,l(de,M),pe.prototype.serializeToString=function(e,t,r){return fe.call(e,t,r)},M.prototype.toString=fe;try{if(Object.defineProperty){function Ce(e){switch(e.nodeType){case p:case S:var t=[];for(e=e.firstChild;e;)7!==e.nodeType&&8!==e.nodeType&&t.push(Ce(e)),e=e.nextSibling;return t.join("");default:return e.nodeValue}}Object.defineProperty(N.prototype,"length",{get:function(){return O(this),this.$$length}}),Object.defineProperty(M.prototype,"textContent",{get:function(){return Ce(this)},set:function(e){switch(this.nodeType){case p:case S:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),ke=function(e,t,r){e["$$"+t]=r}}}catch(be){}t.DocumentType=ie,t.DOMException=B,t.DOMImplementation=_,t.Element=ee,t.Node=M,t.NodeList=D,t.XMLSerializer=pe},function(e,t,r){var n=r(22),o=r(23),a=r(0),i=r(6),s=null,c=function(e){return!e||e<0?0:(e/1e3).toFixed(3)},u=function(){var e=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()},l=function(){if("object"===("undefined"==typeof navigator?"undefined":a(navigator))){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;return(null==e?void 0:e.type)||(null==e?void 0:e.effectiveType)||"unknown"}return"unknown"},d=function(){return"object"===("undefined"==typeof location?"undefined":a(location))?location.protocol.replace(/:/,""):"unknown protocol"},p=function(){if("object"!==("undefined"==typeof navigator?"undefined":a(navigator)))return"unknown os";var e=navigator.userAgent.toLowerCase(),t=/macintosh|mac os x/i.test(navigator.userAgent);return e.indexOf("win32")>=0||e.indexOf("wow32")>=0?"win32":e.indexOf("win64")>=0||e.indexOf("wow64")>=0?"win64":t?"mac":"unknown os"},f=function(){return!("object"!==("undefined"==typeof navigator?"undefined":a(navigator))||!navigator.userAgent.match(/(Android|Adr|Linux)/i))},h=function(){return!("object"!==("undefined"==typeof navigator?"undefined":a(navigator))||!navigator.userAgent.match(/(iPhone|iPod|iPad|iOS)/i))},g=function(){return"object"!==("undefined"==typeof navigator?"undefined":a(navigator))?"unknown device":navigator.userAgent},m=function(){return!("object"!==("undefined"==typeof navigator?"undefined":a(navigator))||!navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i))}(),y=f()?"android":h?"ios":"other_mobile",v=p(),k=m?y:v,C=g(),b=d();function S(e){return e.replace(/([A-Z])/g,"_$1").toLowerCase()}var T=function(){"use strict";function e(t){n(this,e);var r=t.parent,o=t.traceId,a=t.bucket,c=t.region,l=t.apiName,d=t.realApi,p=t.httpMethod,f=t.fileKey,h=t.fileSize,g=t.accelerate,m=t.customId,y=t.delay,v=t.deepTracker,S=t.Beacon,T=t.clsReporter,w=a&&a.substr(a.lastIndexOf("-")+1)||"";this.parent=r,this.deepTracker=v,this.delay=y,T&&!this.clsReporter&&(this.clsReporter=T),this.params={sdkVersionName:"cos-js-sdk-v5",sdkVersionCode:i.version,osName:k,networkType:"",requestName:l||"",requestResult:"",realApi:d,bucket:a,region:c,accelerate:g,httpMethod:p,url:"",host:"",httpDomain:"",requestPath:f||"",userAgent:C,networkProtocol:b,errorType:"",errorCode:"",errorName:"",errorMessage:"",errorRequestId:"",errorHttpCode:0,errorServiceName:"",errorNode:"",httpTookTime:0,httpSize:h||0,httpMd5:0,httpSign:0,httpFullTime:0,httpSpeed:0,md5StartTime:0,md5EndTime:0,signStartTime:0,signEndTime:0,httpStartTime:0,httpEndTime:0,startTime:(new Date).getTime(),endTime:0,traceId:o||u(),appid:w,partNumber:0,httpRetryTimes:0,customId:m||"",partTime:0},S&&(this.beacon=function(e,t){if(!s){if("function"!=typeof e)throw new Error("Beacon not found");s=new e({appkey:"0WEB05PY6MHRGK0U",versionCode:i.version,channelID:"js_sdk",openid:"openid",unionid:"unid",strictMode:!1,delay:t,sessionDuration:6e4})}return s}(S,y))}return o(e,[{key:"formatResult",value:function(e,t){var r,n,o,a,i,s,u=(new Date).getTime(),d=l(),p=e?(null==e?void 0:e.code)||(null==e||null===(r=e.error)||void 0===r?void 0:r.code)||(null==e||null===(n=e.error)||void 0===n?void 0:n.Code):"",f=e?(null==e?void 0:e.message)||(null==e||null===(o=e.error)||void 0===o?void 0:o.message)||(null==e||null===(a=e.error)||void 0===a?void 0:a.Message):"",h=f,g=e?(null==e?void 0:e.resource)||(null==e||null===(i=e.error)||void 0===i?void 0:i.resource)||(null==e||null===(s=e.error)||void 0===s?void 0:s.Resource):"",m=e?null==e?void 0:e.statusCode:t.statusCode,y=e?(null==e?void 0:e.headers)&&(null==e?void 0:e.headers["x-cos-request-id"]):(null==t?void 0:t.headers)&&(null==t?void 0:t.headers["x-cos-request-id"]),v=e?y?"Server":"Client":"";"getObject"===this.params.requestName&&(this.params.httpSize=t?t.headers&&t.headers["content-length"]:0);var k="sliceUploadFile"===this.params.realApi,C="sliceCopyFile"===this.params.realApi;if(k||C){var b=this.params.httpSize/1024/this.params.partTime;Object.assign(this.params,{httpSpeed:b<0?0:b.toFixed(3)})}else{var S=u-this.params.startTime,T=this.params.httpEndTime-this.params.httpStartTime,w=this.params.httpSize/1024/(T/1e3),R=this.params.md5EndTime-this.params.md5StartTime,x=this.params.signEndTime-this.params.signStartTime;this.parent&&(this.parent.addParamValue("httpTookTime",c(T)),this.parent.addParamValue("httpFullTime",c(S)),this.parent.addParamValue("httpMd5",c(R)),this.parent.addParamValue("httpSign",c(x)),["multipartUpload","uploadPartCopy","putObjectCopy"].includes(this.params.requestName)&&this.parent.addParamValue("partTime",c(T))),Object.assign(this.params,{httpFullTime:c(S),httpMd5:c(R),httpSign:c(x),httpTookTime:c(T),httpSpeed:w<0?0:w.toFixed(3)})}if(Object.assign(this.params,{networkType:d,requestResult:e?"Failure":"Success",errorType:v,errorCode:p,errorHttpCode:m,errorName:h,errorMessage:f,errorServiceName:g,errorRequestId:y}),!e||p&&f||(this.params.fullError=e?JSON.stringify(e):""),this.params.url){try{var A=/^http(s)?:\/\/(.*?)\//.exec(this.params.url);this.params.host=A[2]}catch(e){this.params.host=this.params.url}this.params.httpDomain=this.params.host}}},{key:"report",value:function(e,t){if(this.beacon||this.clsReporter){this.formatResult(e,t);var r=function(e){var t,r={},n=["sdkVersionName","sdkVersionCode","osName","networkType","requestName","requestResult","bucket","region","appid","accelerate","url","host","requestPath","userAgent","networkProtocol","httpMethod","httpSize","httpSpeed","httpTookTime","httpMd5","httpSign","httpFullTime","httpDomain","partNumber","httpRetryTimes","customId","traceId","realApi"],o=[].concat(n,["errorNode","errorCode","errorName","errorMessage","errorRequestId","errorHttpCode","errorServiceName","errorType","fullError"]),a="Success"===e.requestResult?n:o;for(var i in e)a.includes(i)&&(r[S(i)]=e[i]);return r.request_name=e.realApi?(t=e.realApi,["putObject","sliceUploadFile","uploadFile","uploadFiles"].includes(t)?"UploadTask":"getObject"===t?"DownloadTask":["putObjectCopy","sliceCopyFile"].includes(t)?"CopyTask":t):e.requestName,r}(this.params);this.beacon&&this.sendEventsToBeacon(r),this.clsReporter&&this.sendEventsToCLS(r)}}},{key:"setParams",value:function(e){Object.assign(this.params,e)}},{key:"addParamValue",value:function(e,t){this.params[e]=(+this.params[e]+ +t).toFixed(3)}},{key:"sendEventsToBeacon",value:function(e){if(!("sliceUploadFile"===this.params.requestName||"sliceUploadFile"===this.params.realApi)||this.deepTracker){var t="qcloud_track_cos_sdk";0===this.delay?this.beacon&&this.beacon.onDirectUserAction(t,e):this.beacon&&this.beacon.onUserAction(t,e)}}},{key:"sendEventsToCLS",value:function(e){var t=!(0!==this.delay);this.clsReporter.log(e,t)}},{key:"generateSubTracker",value:function(t){return Object.assign(t,{parent:this,deepTracker:this.deepTracker,traceId:this.params.traceId,bucket:this.params.bucket,region:this.params.region,accelerate:this.params.accelerate,fileKey:this.params.requestPath,customId:this.params.customId,delay:this.delay,clsReporter:this.clsReporter}),new e(t)}}]),e}();e.exports=T},function(e){e.exports=JSON.parse('{"name":"cos-js-sdk-v5","version":"1.7.1","description":"JavaScript SDK for [腾讯云对象存储](https://cloud.tencent.com/product/cos)","main":"dist/cos-js-sdk-v5.js","types":"index.d.ts","scripts":{"prettier":"prettier --write src demo/demo.js demo/CIDemos/*.js test/test.js server/sts.js lib/request.js index.d.ts","server":"node server/sts.js","dev":"cross-env NODE_ENV=development webpack -w --mode=development","build":"cross-env NODE_ENV=production webpack --mode=production","cos-auth.min.js":"uglifyjs ./demo/common/cos-auth.js -o ./demo/common/cos-auth.min.js -c -m","test":"jest --runInBand --coverage"},"repository":{"type":"git","url":"git+https://github.com/tencentyun/cos-js-sdk-v5.git"},"keywords":[],"author":"carsonxu","license":"ISC","bugs":{"url":"https://github.com/tencentyun/cos-js-sdk-v5/issues"},"homepage":"https://github.com/tencentyun/cos-js-sdk-v5#readme","dependencies":{"@xmldom/xmldom":"^0.8.6"},"devDependencies":{"@babel/core":"7.17.9","@babel/plugin-transform-runtime":"7.18.10","@babel/preset-env":"7.16.11","babel-loader":"8.2.5","body-parser":"^1.18.3","cross-env":"^5.2.0","express":"^4.16.4","jest":"^29.3.1","jest-environment-jsdom":"^29.3.1","prettier":"^3.0.1","qcloud-cos-sts":"^3.0.2","request":"^2.87.0","terser-webpack-plugin":"4.2.3","uglifyjs":"^2.4.11","webpack":"4.46.0","webpack-cli":"4.10.0"}}')},function(e,t){var r=function(e){var t={},r=function(e){return!t[e]&&(t[e]=[]),t[e]};e.on=function(e,t){r(e).push(t)},e.off=function(e,t){for(var n=r(e),o=n.length-1;o>=0;o--)t===n[o]&&n.splice(o,1)},e.emit=function(e,t){for(var n=r(e).map((function(e){return e})),o=0;o=0;r--){var o=n[r][2];(!o||o+2592e3=0;o--){var a=n[o];a[0]===e&&a[1]===t&&n.splice(o,1)}n.unshift([e,t,Math.round(Date.now()/1e3)]),n.length>r&&n.splice(r),l()}},removeUploadId:function(e){u.call(this),delete d.using[e];for(var t=n.length-1;t>=0;t--)n[t][1]===e&&n.splice(t,1);l()}};e.exports=d},function(e,t,r){var n=r(10);e.exports=n},function(e,t,r){"use strict";var n=r(1),o=r(7),a=r(26),i=r(27),s=r(29),c=r(6),u={AppId:"",SecretId:"",SecretKey:"",SecurityToken:"",ChunkRetryTimes:2,FileParallelLimit:3,ChunkParallelLimit:3,ChunkSize:1048576,SliceSize:1048576,CopyChunkParallelLimit:20,CopyChunkSize:10485760,CopySliceSize:10485760,MaxPartNumber:1e4,ProgressInterval:1e3,Domain:"",ServiceDomain:"",Protocol:"",CompatibilityMode:!1,ForcePathStyle:!1,UseRawKey:!1,Timeout:0,CorrectClockSkew:!0,SystemClockOffset:0,UploadCheckContentMd5:!1,UploadQueueSize:1e4,UploadAddMetaMd5:!1,UploadIdCacheLimit:50,UseAccelerate:!1,ForceSignHost:!0,AutoSwitchHost:!0,CopySourceParser:null,DeepTracker:!1,TrackerDelay:5e3,CustomId:"",BeaconReporter:null,ClsReporter:null},l=function(e){if(this.options=n.extend(n.clone(u),e||{}),this.options.FileParallelLimit=Math.max(1,this.options.FileParallelLimit),this.options.ChunkParallelLimit=Math.max(1,this.options.ChunkParallelLimit),this.options.ChunkRetryTimes=Math.max(0,this.options.ChunkRetryTimes),this.options.ChunkSize=Math.max(1048576,this.options.ChunkSize),this.options.CopyChunkParallelLimit=Math.max(1,this.options.CopyChunkParallelLimit),this.options.CopyChunkSize=Math.max(1048576,this.options.CopyChunkSize),this.options.CopySliceSize=Math.max(0,this.options.CopySliceSize),this.options.MaxPartNumber=Math.max(1024,Math.min(1e4,this.options.MaxPartNumber)),this.options.Timeout=Math.max(0,this.options.Timeout),this.options.EnableReporter=this.options.BeaconReporter||this.options.ClsReporter,this.options.AppId,this.options.SecretId&&this.options.SecretId.indexOf(" "),this.options.SecretKey&&this.options.SecretKey.indexOf(" "),n.isNode(),this.options.ForcePathStyle)throw new Error("ForcePathStyle is not supported");o.init(this),a.init(this)};i.init(l,a),s.init(l,a),l.util={md5:n.md5,xml2json:n.xml2json,json2xml:n.json2xml,encodeBase64:n.encodeBase64},l.getAuthorization=n.getAuth,l.version=c.version,e.exports=l},function(e,t){var r,n,o=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function s(e){if(r===setTimeout)return setTimeout(e,0);if((r===a||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:a}catch(e){r=a}try{n="function"==typeof clearTimeout?clearTimeout:i}catch(e){n=i}}();var c,u=[],l=!1,d=-1;function p(){l&&c&&(l=!1,c.length?u=c.concat(u):d=-1,u.length&&f())}function f(){if(!l){var e=s(p);l=!0;for(var t=u.length;t;){for(c=u,u=[];++d1)for(var r=1;r>6,s[n++]=128|63&r):r<55296||r>=57344?(s[n++]=224|r>>12,s[n++]=128|r>>6&63,s[n++]=128|63&r):(r=65536+((1023&r)<<10|1023&e.charCodeAt(++o)),s[n++]=240|r>>18,s[n++]=128|r>>12&63,s[n++]=128|r>>6&63,s[n++]=128|63&r);else for(n=this.start;o>2]|=r<>2]|=(192|r>>6)<>2]|=(128|63&r)<=57344?(i[n>>2]|=(224|r>>12)<>2]|=(128|r>>6&63)<>2]|=(128|63&r)<>2]|=(240|r>>18)<>2]|=(128|r>>12&63)<>2]|=(128|r>>6&63)<>2]|=(128|63&r)<=64?(this.start=n-64,this.hash(),this.hashed=!0):this.start=n}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},v.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[t>>2]|=d[3&t],t>=56&&(this.hashed||this.hash(),e[0]=e[16],e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.bytes<<3,e[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},v.prototype.hash=function(){var e,t,r,n,o,a,i=this.blocks;this.first?t=((t=((e=((e=i[0]-680876937)<<7|e>>>25)-271733879<<0)^(r=((r=(-271733879^(n=((n=(-1732584194^2004318071&e)+i[1]-117830708)<<12|n>>>20)+e<<0)&(-271733879^e))+i[2]-1126478375)<<17|r>>>15)+n<<0)&(n^e))+i[3]-1316259209)<<22|t>>>10)+r<<0:(e=this.h0,t=this.h1,r=this.h2,t=((t+=((e=((e+=((n=this.h3)^t&(r^n))+i[0]-680876936)<<7|e>>>25)+t<<0)^(r=((r+=(t^(n=((n+=(r^e&(t^r))+i[1]-389564586)<<12|n>>>20)+e<<0)&(e^t))+i[2]+606105819)<<17|r>>>15)+n<<0)&(n^e))+i[3]-1044525330)<<22|t>>>10)+r<<0),t=((t+=((e=((e+=(n^t&(r^n))+i[4]-176418897)<<7|e>>>25)+t<<0)^(r=((r+=(t^(n=((n+=(r^e&(t^r))+i[5]+1200080426)<<12|n>>>20)+e<<0)&(e^t))+i[6]-1473231341)<<17|r>>>15)+n<<0)&(n^e))+i[7]-45705983)<<22|t>>>10)+r<<0,t=((t+=((e=((e+=(n^t&(r^n))+i[8]+1770035416)<<7|e>>>25)+t<<0)^(r=((r+=(t^(n=((n+=(r^e&(t^r))+i[9]-1958414417)<<12|n>>>20)+e<<0)&(e^t))+i[10]-42063)<<17|r>>>15)+n<<0)&(n^e))+i[11]-1990404162)<<22|t>>>10)+r<<0,t=((t+=((e=((e+=(n^t&(r^n))+i[12]+1804603682)<<7|e>>>25)+t<<0)^(r=((r+=(t^(n=((n+=(r^e&(t^r))+i[13]-40341101)<<12|n>>>20)+e<<0)&(e^t))+i[14]-1502002290)<<17|r>>>15)+n<<0)&(n^e))+i[15]+1236535329)<<22|t>>>10)+r<<0,t=((t+=((n=((n+=(t^r&((e=((e+=(r^n&(t^r))+i[1]-165796510)<<5|e>>>27)+t<<0)^t))+i[6]-1069501632)<<9|n>>>23)+e<<0)^e&((r=((r+=(e^t&(n^e))+i[11]+643717713)<<14|r>>>18)+n<<0)^n))+i[0]-373897302)<<20|t>>>12)+r<<0,t=((t+=((n=((n+=(t^r&((e=((e+=(r^n&(t^r))+i[5]-701558691)<<5|e>>>27)+t<<0)^t))+i[10]+38016083)<<9|n>>>23)+e<<0)^e&((r=((r+=(e^t&(n^e))+i[15]-660478335)<<14|r>>>18)+n<<0)^n))+i[4]-405537848)<<20|t>>>12)+r<<0,t=((t+=((n=((n+=(t^r&((e=((e+=(r^n&(t^r))+i[9]+568446438)<<5|e>>>27)+t<<0)^t))+i[14]-1019803690)<<9|n>>>23)+e<<0)^e&((r=((r+=(e^t&(n^e))+i[3]-187363961)<<14|r>>>18)+n<<0)^n))+i[8]+1163531501)<<20|t>>>12)+r<<0,t=((t+=((n=((n+=(t^r&((e=((e+=(r^n&(t^r))+i[13]-1444681467)<<5|e>>>27)+t<<0)^t))+i[2]-51403784)<<9|n>>>23)+e<<0)^e&((r=((r+=(e^t&(n^e))+i[7]+1735328473)<<14|r>>>18)+n<<0)^n))+i[12]-1926607734)<<20|t>>>12)+r<<0,t=((t+=((a=(n=((n+=((o=t^r)^(e=((e+=(o^n)+i[5]-378558)<<4|e>>>28)+t<<0))+i[8]-2022574463)<<11|n>>>21)+e<<0)^e)^(r=((r+=(a^t)+i[11]+1839030562)<<16|r>>>16)+n<<0))+i[14]-35309556)<<23|t>>>9)+r<<0,t=((t+=((a=(n=((n+=((o=t^r)^(e=((e+=(o^n)+i[1]-1530992060)<<4|e>>>28)+t<<0))+i[4]+1272893353)<<11|n>>>21)+e<<0)^e)^(r=((r+=(a^t)+i[7]-155497632)<<16|r>>>16)+n<<0))+i[10]-1094730640)<<23|t>>>9)+r<<0,t=((t+=((a=(n=((n+=((o=t^r)^(e=((e+=(o^n)+i[13]+681279174)<<4|e>>>28)+t<<0))+i[0]-358537222)<<11|n>>>21)+e<<0)^e)^(r=((r+=(a^t)+i[3]-722521979)<<16|r>>>16)+n<<0))+i[6]+76029189)<<23|t>>>9)+r<<0,t=((t+=((a=(n=((n+=((o=t^r)^(e=((e+=(o^n)+i[9]-640364487)<<4|e>>>28)+t<<0))+i[12]-421815835)<<11|n>>>21)+e<<0)^e)^(r=((r+=(a^t)+i[15]+530742520)<<16|r>>>16)+n<<0))+i[2]-995338651)<<23|t>>>9)+r<<0,t=((t+=((n=((n+=(t^((e=((e+=(r^(t|~n))+i[0]-198630844)<<6|e>>>26)+t<<0)|~r))+i[7]+1126891415)<<10|n>>>22)+e<<0)^((r=((r+=(e^(n|~t))+i[14]-1416354905)<<15|r>>>17)+n<<0)|~e))+i[5]-57434055)<<21|t>>>11)+r<<0,t=((t+=((n=((n+=(t^((e=((e+=(r^(t|~n))+i[12]+1700485571)<<6|e>>>26)+t<<0)|~r))+i[3]-1894986606)<<10|n>>>22)+e<<0)^((r=((r+=(e^(n|~t))+i[10]-1051523)<<15|r>>>17)+n<<0)|~e))+i[1]-2054922799)<<21|t>>>11)+r<<0,t=((t+=((n=((n+=(t^((e=((e+=(r^(t|~n))+i[8]+1873313359)<<6|e>>>26)+t<<0)|~r))+i[15]-30611744)<<10|n>>>22)+e<<0)^((r=((r+=(e^(n|~t))+i[6]-1560198380)<<15|r>>>17)+n<<0)|~e))+i[13]+1309151649)<<21|t>>>11)+r<<0,t=((t+=((n=((n+=(t^((e=((e+=(r^(t|~n))+i[4]-145523070)<<6|e>>>26)+t<<0)|~r))+i[11]-1120210379)<<10|n>>>22)+e<<0)^((r=((r+=(e^(n|~t))+i[2]+718787259)<<15|r>>>17)+n<<0)|~e))+i[9]-343485551)<<21|t>>>11)+r<<0,this.first?(this.h0=e+1732584193<<0,this.h1=t-271733879<<0,this.h2=r-1732584194<<0,this.h3=n+271733878<<0,this.first=!1):(this.h0=this.h0+e<<0,this.h1=this.h1+t<<0,this.h2=this.h2+r<<0,this.h3=this.h3+n<<0)},v.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,n=this.h3;return l[e>>4&15]+l[15&e]+l[e>>12&15]+l[e>>8&15]+l[e>>20&15]+l[e>>16&15]+l[e>>28&15]+l[e>>24&15]+l[t>>4&15]+l[15&t]+l[t>>12&15]+l[t>>8&15]+l[t>>20&15]+l[t>>16&15]+l[t>>28&15]+l[t>>24&15]+l[r>>4&15]+l[15&r]+l[r>>12&15]+l[r>>8&15]+l[r>>20&15]+l[r>>16&15]+l[r>>28&15]+l[r>>24&15]+l[n>>4&15]+l[15&n]+l[n>>12&15]+l[n>>8&15]+l[n>>20&15]+l[n>>16&15]+l[n>>28&15]+l[n>>24&15]},v.prototype.toString=v.prototype.hex,v.prototype.digest=function(e){if("hex"===e)return this.hex();this.finalize();var t=this.h0,r=this.h1,n=this.h2,o=this.h3;return[255&t,t>>8&255,t>>16&255,t>>24&255,255&r,r>>8&255,r>>16&255,r>>24&255,255&n,n>>8&255,n>>16&255,n>>24&255,255&o,o>>8&255,o>>16&255,o>>24&255]},v.prototype.array=v.prototype.digest,v.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(16),t=new Uint32Array(e);return t[0]=this.h0,t[1]=this.h1,t[2]=this.h2,t[3]=this.h3,e},v.prototype.buffer=v.prototype.arrayBuffer,v.prototype.base64=function(){for(var e,t,r,n="",o=this.array(),a=0;a<15;)e=o[a++],t=o[a++],r=o[a++],n+=h[e>>>2]+h[63&(e<<4|t>>>4)]+h[63&(t<<2|r>>>6)]+h[63&r];return e=o[a],n+=h[e>>>2]+h[e<<4&63]+"=="};var k=function(){var e=y("hex");e.getCtx=e.create=function(){return new v},e.update=function(t){return e.create().update(t)};for(var t=0;t>>2]|=(r[o>>>2]>>>24-o%4*8&255)<<24-(n+o)%4*8;else if(65535>>2]=r[o>>>2];else t.push.apply(t,r);return this.sigBytes+=e,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=a.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var r=[],n=0;n>>2]>>>24-n%4*8&255;r.push((o>>>4).toString(16)),r.push((15&o).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new i.init(r,t/2)}},u=s.Latin1={stringify:function(e){var t=e.words;e=e.sigBytes;for(var r=[],n=0;n>>2]>>>24-n%4*8&255));return r.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new i.init(r,t)}},l=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(u.stringify(e)))}catch(e){throw Error("Malformed UTF-8 data")}},parse:function(e){return u.parse(unescape(encodeURIComponent(e)))}},d=n.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new i.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=l.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var r=this._data,n=r.words,o=r.sigBytes,a=this.blockSize,s=o/(4*a);if(t=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*a,o=e.min(4*t,o),t){for(var c=0;cu;u++){if(16>u)a[u]=0|e[t+u];else{var l=a[u-3]^a[u-8]^a[u-14]^a[u-16];a[u]=l<<1|l>>>31}l=(n<<5|n>>>27)+c+a[u],l=20>u?l+(1518500249+(o&i|~o&s)):40>u?l+(1859775393+(o^i^s)):60>u?l+((o&i|o&s|i&s)-1894007588):l+((o^i^s)-899497514),c=s,s=i,i=o<<30|o>>>2,o=n,n=l}r[0]=r[0]+n|0,r[1]=r[1]+o|0,r[2]=r[2]+i|0,r[3]=r[3]+s|0,r[4]=r[4]+c|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),t[15+(n+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}}),t.SHA1=o._createHelper(i),t.HmacSHA1=o._createHmacHelper(i),function(){var e=l,t=e.enc.Utf8;e.algo.HMAC=e.lib.Base.extend({init:function(e,r){e=this._hasher=new e.init,"string"==typeof r&&(r=t.parse(r));var n=e.blockSize,o=4*n;r.sigBytes>o&&(r=e.finalize(r)),r.clamp();for(var a=this._oKey=r.clone(),i=this._iKey=r.clone(),s=a.words,c=i.words,u=0;u>>2]>>>24-a%4*8&255)<<16|(t[a+1>>>2]>>>24-(a+1)%4*8&255)<<8|t[a+2>>>2]>>>24-(a+2)%4*8&255,s=0;s<4&&a+.75*s>>6*(3-s)&63));var c=n.charAt(64);if(c)for(;o.length%4;)o.push(c);return o.join("")},parse:function(e){var t=e.length,r=this._map,n=r.charAt(64);if(n){var o=e.indexOf(n);-1!=o&&(t=o)}for(var a=[],i=0,s=0;s>>6-s%4*2;a[i>>>2]|=(u|l)<<24-i%4*8,i++}return c.create(a,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},"object"===u(e)?e.exports=l:window.CryptoJS=l}).call(this,r(3)(e))},function(e,t,r){var n=r(16).DOMParser,o=function(){this.version="1.3.5";var e={mergeCDATA:!0,normalize:!0,stripElemPrefix:!0},t=new RegExp(/(?!xmlns)^.*:/);new RegExp(/^\s+|\s+$/g);return this.grokType=function(e){return/^\s*$/.test(e)?null:/^(?:true|false)$/i.test(e)?"true"===e.toLowerCase():isFinite(e)?parseFloat(e):e},this.parseString=function(e,t){if(e){var r=this.stringToXML(e);return r.getElementsByTagName("parsererror").length?null:this.parseXML(r,t)}return null},this.parseXML=function(r,n){for(var a in n)e[a]=n[a];var i={},s=0,c="";if(r.childNodes.length)for(var u,l,d,p=0;p=t+r||t?new java.lang.String(e,t,r)+"":e}function m(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}p.prototype.parseFromString=function(e,t){var r=this.options,n=new l,o=r.domBuilder||new f,i=r.errorHandler,s=r.locator,u=r.xmlns||{},p=/\/x?html?$/.test(t),h=p?a.HTML_ENTITIES:a.XML_ENTITIES;s&&o.setDocumentLocator(s),n.errorHandler=function(e,t,r){if(!e){if(t instanceof f)return t;e=t}var n={},o=e instanceof Function;function a(t){var a=e[t];!a&&o&&(a=2==e.length?function(r){e(t,r)}:e),n[t]=a&&function(e){a("[xmldom "+t+"]\t"+e+function(e){if(e)return"\n@"+(e.systemId||"")+"#[line:"+e.lineNumber+",col:"+e.columnNumber+"]"}(r))}||function(){}}return r=r||{},a("warning"),a("error"),a("fatalError"),n}(i,o,s),n.domBuilder=r.domBuilder||o,p&&(u[""]=c.HTML),u.xml=u.xml||c.XML;var g=r.normalizeLineEndings||d;return e&&"string"==typeof e?n.parse(g(e),u,h):n.errorHandler.error("invalid doc source"),o.doc},f.prototype={startDocument:function(){this.doc=(new s).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,r,n){var o=this.doc,a=o.createElementNS(e,r||t),i=n.length;m(this,a),this.currentElement=a,this.locator&&h(this.locator,a);for(var s=0;s",lt:"<",quot:'"'}),t.HTML_ENTITIES=n({Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",Gt:"≫",GT:">",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",Lt:"≪",LT:"<",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:"\t",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"}),t.entityMap=t.HTML_ENTITIES},function(e,t,r){var n=r(2).NAMESPACE,o=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,a=new RegExp("[\\-\\.0-9"+o.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),i=new RegExp("^"+o.source+a.source+"*(?::"+o.source+a.source+"*)?$"),s=0,c=1,u=2,l=3,d=4,p=5,f=6,h=7;function g(e,t){this.message=e,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,g)}function m(){}function y(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function v(e,t,r,o,a,i){function g(e,t,n){r.attributeNames.hasOwnProperty(e)&&i.fatalError("Attribute "+e+" redefined"),r.addValue(e,t.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,a),n)}for(var m,y=++t,v=s;;){var k=e.charAt(y);switch(k){case"=":if(v===c)m=e.slice(t,y),v=l;else{if(v!==u)throw new Error("attribute equal must after attrName");v=l}break;case"'":case'"':if(v===l||v===c){if(v===c&&(i.warning('attribute value must after "="'),m=e.slice(t,y)),t=y+1,!((y=e.indexOf(k,t))>0))throw new Error("attribute value no end '"+k+"' match");g(m,C=e.slice(t,y),t-1),v=p}else{if(v!=d)throw new Error('attribute value must after "="');g(m,C=e.slice(t,y),t),i.warning('attribute "'+m+'" missed start quot('+k+")!!"),t=y+1,v=p}break;case"/":switch(v){case s:r.setTagName(e.slice(t,y));case p:case f:case h:v=h,r.closed=!0;case d:case c:break;case u:r.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return i.error("unexpected end of input"),v==s&&r.setTagName(e.slice(t,y)),y;case">":switch(v){case s:r.setTagName(e.slice(t,y));case p:case f:case h:break;case d:case c:"/"===(C=e.slice(t,y)).slice(-1)&&(r.closed=!0,C=C.slice(0,-1));case u:v===u&&(C=m),v==d?(i.warning('attribute "'+C+'" missed quot(")!'),g(m,C,t)):(n.isHTML(o[""])&&C.match(/^(?:disabled|checked|selected)$/i)||i.warning('attribute "'+C+'" missed value!! "'+C+'" instead!!'),g(C,C,t));break;case l:throw new Error("attribute value missed!!")}return y;case"€":k=" ";default:if(k<=" ")switch(v){case s:r.setTagName(e.slice(t,y)),v=f;break;case c:m=e.slice(t,y),v=u;break;case d:var C=e.slice(t,y);i.warning('attribute "'+C+'" missed quot(")!!'),g(m,C,t);case p:v=f}else switch(v){case u:r.tagName;n.isHTML(o[""])&&m.match(/^(?:disabled|checked|selected)$/i)||i.warning('attribute "'+m+'" missed value!! "'+m+'" instead2!!'),g(m,m,t),t=y,v=c;break;case p:i.warning('attribute space is required"'+m+'"!!');case f:v=c,t=y;break;case l:v=d,t=y;break;case h:throw new Error("elements closed character '/' and '>' must be connected to")}}y++}}function k(e,t,r){for(var o=e.tagName,a=null,i=e.length;i--;){var s=e[i],c=s.qName,u=s.value;if((f=c.indexOf(":"))>0)var l=s.prefix=c.slice(0,f),d=c.slice(f+1),p="xmlns"===l&&d;else d=c,l=null,p="xmlns"===c&&"";s.localName=d,!1!==p&&(null==a&&(a={},S(r,r={})),r[p]=a[p]=u,s.uri=n.XMLNS,t.startPrefixMapping(p,u))}for(i=e.length;i--;){(l=(s=e[i]).prefix)&&("xml"===l&&(s.uri=n.XML),"xmlns"!==l&&(s.uri=r[l||""]))}var f;(f=o.indexOf(":"))>0?(l=e.prefix=o.slice(0,f),d=e.localName=o.slice(f+1)):(l=null,d=e.localName=o);var h=e.uri=r[l||""];if(t.startElement(h,d,o,e),!e.closed)return e.currentNSMap=r,e.localNSMap=a,!0;if(t.endElement(h,d,o),a)for(l in a)Object.prototype.hasOwnProperty.call(a,l)&&t.endPrefixMapping(l)}function C(e,t,r,n,o){if(/^(?:script|textarea)$/i.test(r)){var a=e.indexOf("",t),i=e.substring(t+1,a);if(/[&<]/.test(i))return/^script$/i.test(r)?(o.characters(i,0,i.length),a):(i=i.replace(/&#?\w+;/g,n),o.characters(i,0,i.length),a)}return t+1}function b(e,t,r,n){var o=n[r];return null==o&&((o=e.lastIndexOf(""))t?(r.comment(e,t+4,o-t-4),o+3):(n.error("Unclosed comment"),-1):-1;if("CDATA["==e.substr(t+3,6)){var o=e.indexOf("]]>",t+9);return r.startCDATA(),r.characters(e,t+9,o-t-9),r.endCDATA(),o+3}var a=function(e,t){var r,n=[],o=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;o.lastIndex=t,o.exec(e);for(;r=o.exec(e);)if(n.push(r),r[1])return n}(e,t),i=a.length;if(i>1&&/!doctype/i.test(a[0][0])){var s=a[1][0],c=!1,u=!1;i>3&&(/^public$/i.test(a[2][0])?(c=a[3][0],u=i>4&&a[4][0]):/^system$/i.test(a[2][0])&&(u=a[3][0]));var l=a[i-1];return r.startDTD(s,c,u),r.endDTD(),l.index+l[0].length}return-1}function w(e,t,r){var n=e.indexOf("?>",t);if(n){var o=e.substring(t,n).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(o){o[0].length;return r.processingInstruction(o[1],o[2]),n+2}return-1}return-1}function R(){this.attributeNames={}}g.prototype=new Error,g.prototype.name=g.name,m.prototype={parse:function(e,t,r){var o=this.domBuilder;o.startDocument(),S(t,t={}),function(e,t,r,o,a){function i(e){if(e>65535){var t=55296+((e-=65536)>>10),r=56320+(1023&e);return String.fromCharCode(t,r)}return String.fromCharCode(e)}function s(e){var t=e.slice(1,-1);return Object.hasOwnProperty.call(r,t)?r[t]:"#"===t.charAt(0)?i(parseInt(t.substr(1).replace("x","0x"))):(a.error("entity not found:"+e),e)}function c(t){if(t>S){var r=e.substring(S,t).replace(/&#?\w+;/g,s);f&&u(S),o.characters(r,0,t-S),S=t}}function u(t,r){for(;t>=d&&(r=p.exec(e));)l=r.index,d=l+r[0].length,f.lineNumber++;f.columnNumber=t-l+1}var l=0,d=0,p=/.*(?:\r\n?|\n)|.*$/g,f=o.locator,h=[{currentNSMap:t}],m={},S=0;for(;;){try{var x=e.indexOf("<",S);if(x<0){if(!e.substr(S).match(/^\s*$/)){var A=o.doc,E=A.createTextNode(e.substr(S));A.appendChild(E),o.currentElement=E}return}switch(x>S&&c(x),e.charAt(x+1)){case"/":var B=e.indexOf(">",x+3),D=e.substring(x+2,B).replace(/[ \t\n\r]+$/g,""),N=h.pop();B<0?(D=e.substring(x+2).replace(/[\s<].*/,""),a.error("end tag name: "+D+" is not complete:"+N.tagName),B=x+1+D.length):D.match(/\sS?S=B:c(Math.max(x,S)+1)}}(e,t,r,o,this.errorHandler),o.endDocument()}},R.prototype={setTagName:function(e){if(!i.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},addValue:function(e,t,r){if(!i.test(e))throw new Error("invalid attribute:"+e);this.attributeNames[e]=this.length,this[this.length++]={qName:e,value:t,offset:r}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}},t.XMLReader=m,t.ParseError=g},function(e,t,r){var n=r(0),o="a-zA-Z_À-ÖØ-öø-ÿͰ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿿、-퟿豈-﷏ﷰ-�",a=new RegExp("^([^"+o+"])|^((x|X)(m|M)(l|L))|([^"+o+"-.0-9·̀-ͯ‿⁀])","g"),i=/[^\x09\x0A\x0D\x20-\xFF\x85\xA0-\uD7FF\uE000-\uFDCF\uFDE0-\uFFFD]/gm,s=function(e){var t=[];if(e instanceof Object)for(var r in e)e.hasOwnProperty(r)&&t.push(r);return t},c=function(e,t){var r=function(e,r,n,o,i){var s=void 0!==t.indent?t.indent:"\t",c=t.prettyPrint?"\n"+new Array(o).join(s):"";t.removeIllegalNameCharacters&&(e=e.replace(a,"_"));var u=[c,"<",e,n||""];return r&&r.length>0?(u.push(">"),u.push(r),i&&u.push(c),u.push("")):u.push("/>"),u.join("")};return function e(o,a,c){var u=n(o);switch((Array.isArray?Array.isArray(o):o instanceof Array)?u="array":o instanceof Date&&(u="date"),u){case"array":var l=[];return o.map((function(t){l.push(e(t,1,c+1))})),t.prettyPrint&&l.push("\n"),l.join("");case"date":return o.toJSON?o.toJSON():o+"";case"object":var d=[];for(var p in o)if(o.hasOwnProperty(p))if(o[p]instanceof Array)for(var f=0;f0&&d.push("\n"),d.join("");case"function":return o();default:return t.escape?(""+o).replace(/&/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""").replace(i,""):""+o}}(e,0,0)},u=function(e){var t=['"),t.join("")};e.exports=function(e,t){if(t||(t={xmlHeader:{standalone:!0},prettyPrint:!0,indent:" ",escape:!0}),"string"==typeof e)try{e=JSON.parse(e.toString())}catch(e){return!1}var r="",o="";return t&&("object"==n(t)?(t.xmlHeader&&(r=u(!!t.xmlHeader.standalone)),void 0!==t.docType&&(o="")):r=u()),[r,(t=t||{}).prettyPrint&&o?"\n":"",o,c(e,t)].join("").replace(/\n{2,}/g,"\n").replace(/\s+$/g,"")}},function(e,t){var r=function(e){var t=(e=e||{}).Base64,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=function(e){for(var t={},r=0,n=e.length;r>>6)+o(128|63&t):o(224|t>>>12&15)+o(128|t>>>6&63)+o(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return o(240|t>>>18&7)+o(128|t>>>12&63)+o(128|t>>>6&63)+o(128|63&t)},i=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,s=function(e){return e.replace(i,a)},c=function(e){var t=[0,2,1][e.length%3],n=e.charCodeAt(0)<<16|(e.length>1?e.charCodeAt(1):0)<<8|(e.length>2?e.charCodeAt(2):0);return[r.charAt(n>>>18),r.charAt(n>>>12&63),t>=2?"=":r.charAt(n>>>6&63),t>=1?"=":r.charAt(63&n)].join("")},u=e.btoa?function(t){return e.btoa(t)}:function(e){return e.replace(/[\s\S]{1,3}/g,c)},l=function(e){return u(s(e))},d=function(e,t){return t?l(String(e)).replace(/[+\/]/g,(function(e){return"+"==e?"-":"_"})).replace(/=/g,""):l(String(e))},p=new RegExp(["[À-ß][€-¿]","[à-ï][€-¿]{2}","[ð-÷][€-¿]{3}"].join("|"),"g"),f=function(e){switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return o(55296+(t>>>10))+o(56320+(1023&t));case 3:return o((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return o((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},h=function(e){return e.replace(p,f)},g=function(e){var t=e.length,r=t%4,a=(t>0?n[e.charAt(0)]<<18:0)|(t>1?n[e.charAt(1)]<<12:0)|(t>2?n[e.charAt(2)]<<6:0)|(t>3?n[e.charAt(3)]:0),i=[o(a>>>16),o(a>>>8&255),o(255&a)];return i.length-=[0,0,2,1][r],i.join("")},m=e.atob?function(t){return e.atob(t)}:function(e){return e.replace(/[\s\S]{1,4}/g,g)},y=function(e){return h(m(e))},v=function(e){return y(String(e).replace(/[-_]/g,(function(e){return"-"==e?"+":"/"})).replace(/[^A-Za-z0-9\+\/]/g,""))};return{VERSION:"2.1.9",atob:m,btoa:u,fromBase64:v,toBase64:d,utob:s,encode:d,encodeURI:function(e){return d(e,!0)},btou:h,decode:v,noConflict:function(){var r=e.Base64;return e.Base64=t,r}}}();e.exports=r},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){var n=r(24);function o(e,t){for(var r=0;re.options.UploadQueueSize;){var r="waiting"===i[t].state||"checking"===i[t].state||"uploading"===i[t].state;i[t]&&r?t++:(s[i[t].id]&&delete s[i[t].id],i.splice(t,1),u--)}d()}},f=function t(){if(!(c>=e.options.FileParallelLimit)){for(;i[u]&&"waiting"!==i[u].state;)u++;if(!(u>=i.length)){var r=i[u];u++,c++,r.state="checking",r.params.onTaskStart&&r.params.onTaskStart(l(r)),!r.params.UploadData&&(r.params.UploadData={});var n=o.formatParams(r.api,r.params);a[r.api].call(e,n,(function(n,o){e._isRunningTask(r.id)&&("checking"!==r.state&&"uploading"!==r.state||(r.state=n?"error":"success",n&&(r.error=n),c--,d(),t(),r.callback&&r.callback(n,o),"success"===r.state&&(r.params&&(delete r.params.UploadData,delete r.params.Body,delete r.params),delete r.callback)),p())})),d(),setTimeout(t)}}},h=function(t,r){var o=s[t];if(o){var a=o&&"waiting"===o.state,i=o&&("checking"===o.state||"uploading"===o.state);if("canceled"===r&&"canceled"!==o.state||"paused"===r&&a||"paused"===r&&i){o.state=r,e.emit("inner-kill-task",{TaskId:t,toState:r});try{var u=o&&o.params&&o.params.UploadData.UploadId}catch(e){}"canceled"===r&&u&&n.removeUsing(u),d(),i&&(c--,f()),"canceled"===r&&(o.params&&(delete o.params.UploadData,delete o.params.Body,delete o.params),delete o.callback)}p()}};e._addTasks=function(t){o.each(t,(function(t){e._addTask(t.api,t.params,t.callback,!0)})),d()};e._addTask=function(t,r,n,a){r=o.formatParams(t,r);var c=o.uuid();r.TaskId=c,r.onTaskReady&&r.onTaskReady(c),r.TaskReady&&(r.TaskReady(c),!1);var u={params:r,callback:n,api:t,index:i.length,id:c,Bucket:r.Bucket,Region:r.Region,Key:r.Key,FilePath:r.FilePath||"",state:"waiting",loaded:0,size:0,speed:0,percent:0,hashPercent:0,error:null,_custom:r._custom},l=r.onHashProgress;r.onHashProgress=function(t){e._isRunningTask(u.id)&&(u.hashPercent=t.percent,l&&l(t),d())};var h=r.onProgress;return r.onProgress=function(t){e._isRunningTask(u.id)&&("checking"===u.state&&(u.state="uploading"),u.loaded=t.loaded,u.speed=t.speed,u.percent=t.percent,h&&h(t),d())},o.getFileSize(t,r,(function(e,t){if(e)return n(o.error(e));s[c]=u,i.push(u),u.size=t,!a&&d(),f(),p()})),c},e._isRunningTask=function(e){var t=s[e];return!(!t||"checking"!==t.state&&"uploading"!==t.state)},e.getTaskList=function(){return o.map(i,l)},e.cancelTask=function(e){h(e,"canceled")},e.pauseTask=function(e){h(e,"paused")},e.restartTask=function(e){var t=s[e];!t||"paused"!==t.state&&"error"!==t.state||(t.state="waiting",d(),u=Math.min(u,t.index),f())},e.isUploadRunning=function(){return c||u-1&&(i["SSE-COS"]=i.SSECOS,delete i.SSECOS)}var s=a.json2xml({InventoryConfiguration:n}),c=t.Headers;c["Content-Type"]="application/xml",c["Content-MD5"]=a.b64(a.md5(s));var u="PUT"===e?"name/cos:PutBucketInventory":"name/cos:PostBucketInventory";h.call(this,{Action:u,method:e,Bucket:t.Bucket,Region:t.Region,body:s,action:"inventory",qs:{id:t.Id},headers:c,tracker:t.tracker},(function(e,t){return e&&204===e.statusCode?r(null,{statusCode:e.statusCode}):e?r(e):void r(null,{statusCode:t.statusCode,headers:t.headers})}))}function s(e){var t={GrantFullControl:[],GrantWrite:[],GrantRead:[],GrantReadAcp:[],GrantWriteAcp:[],ACL:""},r={FULL_CONTROL:"GrantFullControl",WRITE:"GrantWrite",READ:"GrantRead",READ_ACP:"GrantReadAcp",WRITE_ACP:"GrantWriteAcp"},n=(e&&e.AccessControlList||{}).Grant;n&&(n=a.isArray(n)?n:[n]);var o={READ:0,WRITE:0,FULL_CONTROL:0};return n&&n.length&&a.each(n,(function(n){"qcs::cam::anyone:anyone"===n.Grantee.ID||"http://cam.qcloud.com/groups/global/AllUsers"===n.Grantee.URI?o[n.Permission]=1:n.Grantee.ID!==e.Owner.ID&&t[r[n.Permission]].push('id="'+n.Grantee.ID+'"')})),o.FULL_CONTROL||o.WRITE&&o.READ?t.ACL="public-read-write":o.READ?t.ACL="public-read":t.ACL="private",a.each(r,(function(e){t[e]=c(t[e].join(","))})),t}function c(e){var t,r,n=e.split(","),o={};for(t=0;t-1?"{Region}.myqcloud.com":"cos.{Region}.myqcloud.com",e.ForcePathStyle||(s="{Bucket}."+s)),s=(s=s.replace(/\{\{AppId\}\}/gi,i).replace(/\{\{Bucket\}\}/gi,o).replace(/\{\{Region\}\}/gi,t).replace(/\{\{.*?\}\}/gi,"")).replace(/\{AppId\}/gi,i).replace(/\{BucketName\}/gi,o).replace(/\{Bucket\}/gi,r).replace(/\{Region\}/gi,t).replace(/\{.*?\}/gi,""),/^[a-zA-Z]+:\/\//.test(s)||(s=u+"//"+s),"/"===s.slice(-1)&&(s=s.slice(0,-1));var l=s;return e.ForcePathStyle&&(l+="/"+r),l+="/",c&&(l+=a.camSafeUrlEncode(c).replace(/%2F/g,"/")),e.isLocation&&(l=l.replace(/^https?:\/\//,"")),l}var l=function(e){if(!e.Bucket||!e.Region)return"";var t=void 0===e.UseAccelerate?this.options.UseAccelerate:e.UseAccelerate;return(e.Url||u({ForcePathStyle:this.options.ForcePathStyle,protocol:this.options.Protocol,domain:this.options.Domain,bucket:e.Bucket,region:t?"accelerate":e.Region})).replace(/^https?:\/\/([^/]+)(\/.*)?$/,"$1")};function d(e,t){var r=a.clone(e.Headers),n="";a.each(r,(function(e,t){(""===e||["content-type","cache-control","expires"].indexOf(t.toLowerCase())>-1)&&delete r[t],"host"===t.toLowerCase()&&(n=e)}));var o=!1!==e.ForceSignHost;!n&&e.SignHost&&o&&(r.Host=e.SignHost);var i=!1,s=function(e,r){i||(i=!0,r&&r.XCosSecurityToken&&!r.SecurityToken&&((r=a.clone(r)).SecurityToken=r.XCosSecurityToken,delete r.XCosSecurityToken),t&&t(e,r))},c=this,u=e.Bucket||"",l=e.Region||"",d=e.Key||"";c.options.ForcePathStyle&&u&&(d=u+"/"+d);var p="/"+d,f={},h=e.Scope;if(!h){var g=e.Action||"",m=e.ResourceKey||e.Key||"";h=e.Scope||[{action:g,bucket:u,region:l,prefix:m}]}var y=a.md5(JSON.stringify(h));c._StsCache=c._StsCache||[],function(){var e,t;for(e=c._StsCache.length-1;e>=0;e--){t=c._StsCache[e];var r=Math.round(a.getSkewTime(c.options.SystemClockOffset)/1e3)+30;if(t.StartTime&&r=t.ExpiredTime)c._StsCache.splice(e,1);else if(!t.ScopeLimit||t.ScopeLimit&&t.ScopeKey===y){f=t;break}}}();var v,k=function(){var t="";f.StartTime&&e.Expires?t=f.StartTime+";"+(f.StartTime+1*e.Expires):f.StartTime&&f.ExpiredTime&&(t=f.StartTime+";"+f.ExpiredTime);var n={Authorization:a.getAuth({SecretId:f.TmpSecretId,SecretKey:f.TmpSecretKey,Method:e.Method,Pathname:p,Query:e.Query,Headers:r,Expires:e.Expires,UseRawKey:c.options.UseRawKey,SystemClockOffset:c.options.SystemClockOffset,KeyTime:t,ForceSignHost:o}),SecurityToken:f.SecurityToken||f.XCosSecurityToken||"",Token:f.Token||"",ClientIP:f.ClientIP||"",ClientUA:f.ClientUA||"",SignFrom:"client"};s(null,n)},C=function(e){if(e.Authorization){var t=!1,r=e.Authorization;if(r)if(r.indexOf(" ")>-1)t=!1;else if(r.indexOf("q-sign-algorithm=")>-1&&r.indexOf("q-ak=")>-1&&r.indexOf("q-sign-time=")>-1&&r.indexOf("q-key-time=")>-1&&r.indexOf("q-url-param-list=")>-1)t=!0;else try{(r=atob(r)).indexOf("a=")>-1&&r.indexOf("k=")>-1&&r.indexOf("t=")>-1&&r.indexOf("r=")>-1&&r.indexOf("b=")>-1&&(t=!0)}catch(e){}if(!t)return a.error(new Error("getAuthorization callback params format error"))}else{if(!e.TmpSecretId)return a.error(new Error('getAuthorization callback params missing "TmpSecretId"'));if(!e.TmpSecretKey)return a.error(new Error('getAuthorization callback params missing "TmpSecretKey"'));if(!e.SecurityToken&&!e.XCosSecurityToken)return a.error(new Error('getAuthorization callback params missing "SecurityToken"'));if(!e.ExpiredTime)return a.error(new Error('getAuthorization callback params missing "ExpiredTime"'));if(e.ExpiredTime&&10!==e.ExpiredTime.toString().length)return a.error(new Error('getAuthorization callback params "ExpiredTime" should be 10 digits'));if(e.StartTime&&10!==e.StartTime.toString().length)return a.error(new Error('getAuthorization callback params "StartTime" should be 10 StartTime'))}return!1};if(f.ExpiredTime&&f.ExpiredTime-a.getSkewTime(c.options.SystemClockOffset)/1e3>60)k();else if(c.options.getAuthorization)c.options.getAuthorization.call(c,{Bucket:u,Region:l,Method:e.Method,Key:d,Pathname:p,Query:e.Query,Headers:r,Scope:h,SystemClockOffset:c.options.SystemClockOffset,ForceSignHost:o},(function(e){"string"==typeof e&&(e={Authorization:e});var t=C(e);if(t)return s(t);e.Authorization?s(null,e):((f=e||{}).Scope=h,f.ScopeKey=y,c._StsCache.push(f),k())}));else{if(!c.options.getSTS)return v={Authorization:a.getAuth({SecretId:e.SecretId||c.options.SecretId,SecretKey:e.SecretKey||c.options.SecretKey,Method:e.Method,Pathname:p,Query:e.Query,Headers:r,Expires:e.Expires,UseRawKey:c.options.UseRawKey,SystemClockOffset:c.options.SystemClockOffset,ForceSignHost:o}),SecurityToken:c.options.SecurityToken||c.options.XCosSecurityToken,SignFrom:"client"},s(null,v),v;c.options.getSTS.call(c,{Bucket:u,Region:l},(function(e){(f=e||{}).Scope=h,f.ScopeKey=y,f.TmpSecretId||(f.TmpSecretId=f.SecretId),f.TmpSecretKey||(f.TmpSecretKey=f.SecretKey);var t=C(f);if(t)return s(t);c._StsCache.push(f),k()}))}return""}function p(e){var t=!1,r=!1,n=!1,o=e.headers&&(e.headers.date||e.headers.Date)||e.error&&e.error.ServerTime;try{var i=e.error.Code,s=e.error.Message;("RequestTimeTooSkewed"===i||"AccessDenied"===i&&"Request has expired"===s)&&(r=!0)}catch(e){}if(e)if(r&&o){var c=Date.parse(o);this.options.CorrectClockSkew&&Math.abs(a.getSkewTime(this.options.SystemClockOffset)-c)>=3e4&&(this.options.SystemClockOffset=c-Date.now(),t=!0)}else 5===Math.floor(e.statusCode/100)?t=!0:"CORS blocked or network error"===e.message&&(n=!0,t=this.options.AutoSwitchHost);return{canRetry:t,networkError:n}}function f(e){var t=e.requestUrl,r=e.clientCalcSign,n=e.networkError;if(!this.options.AutoSwitchHost)return!1;if(!t)return!1;if(!r)return!1;if(!n)return!1;return/^https?:\/\/[^\/]*\.cos\.[^\/]*\.myqcloud\.com(\/.*)?$/.test(t)&&!/^https?:\/\/[^\/]*\.cos\.accelerate\.myqcloud\.com(\/.*)?$/.test(t)}function h(e,t){var r=this;!e.headers&&(e.headers={}),!e.qs&&(e.qs={}),e.VersionId&&(e.qs.versionId=e.VersionId),e.qs=a.clearKey(e.qs),e.headers&&(e.headers=a.clearKey(e.headers)),e.qs&&(e.qs=a.clearKey(e.qs));var n=a.clone(e.qs);e.action&&(n[e.action]="");var o=e.url||e.Url,i=e.SignHost||l.call(this,{Bucket:e.Bucket,Region:e.Region,Url:o}),s=e.tracker;!function o(a){var c=r.options.SystemClockOffset;s&&s.setParams({signStartTime:(new Date).getTime(),httpRetryTimes:a-1}),e.SwitchHost&&(i=i.replace(/myqcloud.com/,"tencentcos.cn")),d.call(r,{Bucket:e.Bucket||"",Region:e.Region||"",Method:e.method,Key:e.Key,Query:n,Headers:e.headers,SignHost:i,Action:e.Action,ResourceKey:e.ResourceKey,Scope:e.Scope,ForceSignHost:r.options.ForceSignHost,SwitchHost:e.SwitchHost},(function(n,i){n?t(n):(s&&s.setParams({signEndTime:(new Date).getTime(),httpStartTime:(new Date).getTime()}),e.AuthData=i,g.call(r,e,(function(n,u){s&&s.setParams({httpEndTime:(new Date).getTime()});var l=!1,d=!1;if(n){var h=p.call(r,n);l=h.canRetry||c!==r.options.SystemClockOffset,d=h.networkError}if(n&&a<2&&l){e.headers&&(delete e.headers.Authorization,delete e.headers.token,delete e.headers.clientIP,delete e.headers.clientUA,e.headers["x-cos-security-token"]&&delete e.headers["x-cos-security-token"],e.headers["x-ci-security-token"]&&delete e.headers["x-ci-security-token"]);var g=f.call(r,{requestUrl:(null==n?void 0:n.url)||"",clientCalcSign:"client"===i.SignFrom,networkError:d});e.SwitchHost=g,o(a+1)}else t(n,u)})))}))}(1)}function g(e,t){var r=this,n=e.TaskId;if(!n||r._isRunningTask(n)){var i=e.Bucket,s=e.Region,c=e.Key,l=e.method||"GET",d=e.Url||e.url,p=e.body,f=e.rawBody;r.options.UseAccelerate&&(s="accelerate"),d=d||u({ForcePathStyle:r.options.ForcePathStyle,protocol:r.options.Protocol,domain:r.options.Domain,bucket:i,region:s,object:c}),e.SwitchHost&&(d=d.replace(/myqcloud.com/,"tencentcos.cn"));var h=c?d:"";e.action&&(d=d+"?"+(a.isIOS_QQ?"".concat(e.action,"="):e.action)),e.qsStr&&(d=d.indexOf("?")>-1?d+"&"+e.qsStr:d+"?"+e.qsStr);var g={method:l,url:d,headers:e.headers,qs:e.qs,body:p},m="x-cos-security-token";if(a.isCIHost(d)&&(m="x-ci-security-token"),g.headers.Authorization=e.AuthData.Authorization,e.AuthData.Token&&(g.headers.token=e.AuthData.Token),e.AuthData.ClientIP&&(g.headers.clientIP=e.AuthData.ClientIP),e.AuthData.ClientUA&&(g.headers.clientUA=e.AuthData.ClientUA),e.AuthData.SecurityToken&&(g.headers[m]=e.AuthData.SecurityToken),g.headers&&(g.headers=a.clearKey(g.headers)),g=a.clearKey(g),e.onProgress&&"function"==typeof e.onProgress){var y=p&&(p.size||p.length)||0;g.onProgress=function(t){if(!n||r._isRunningTask(n)){var o=t?t.loaded:0;e.onProgress({loaded:o,total:y})}}}e.onDownloadProgress&&(g.onDownloadProgress=e.onDownloadProgress),e.DataType&&(g.dataType=e.DataType),this.options.Timeout&&(g.timeout=this.options.Timeout),r.options.ForcePathStyle&&(g.pathStyle=r.options.ForcePathStyle),r.emit("before-send",g);var v,k=g.url.includes("accelerate."),C=g.qs?Object.keys(g.qs).map((function(e){return"".concat(e,"=").concat(g.qs[e])})).join("&"):"",b=C?g.url+"?"+C:g.url;if(e.tracker)e.tracker.setParams({url:b,httpMethod:g.method,accelerate:k,httpSize:(null===(v=g.body)||void 0===v?void 0:v.size)||0}),e.tracker.parent&&!e.tracker.parent.params.url&&e.tracker.parent.setParams({url:h,accelerate:k});var S=(r.options.Request||o)(g,(function(e){if(!e||"abort"!==e.error){var o={options:g,error:e&&e.error,statusCode:e&&e.statusCode||0,statusMessage:e&&e.statusMessage||"",headers:e&&e.headers||{},body:e&&e.body};r.emit("after-receive",o);var i,s=o.error,c=o.body,u={statusCode:o.statusCode,statusMessage:o.statusMessage,headers:o.headers},l=function(e,o){if(n&&r.off("inner-kill-task",T),!i){i=!0;var s={};u&&u.statusCode&&(s.statusCode=u.statusCode),u&&u.headers&&(s.headers=u.headers),e?(g.url&&(s.url=g.url),g.method&&(s.method=g.method),e=a.extend(e||{},s),t(e,null)):(o=a.extend(o||{},s),t(null,o)),S=null}};if(s)return l(a.error(s));var d,p=u.statusCode,h=2===Math.floor(p/100);if(f&&h)return l(null,{body:c});try{d=c&&c.indexOf("<")>-1&&c.indexOf(">")>-1&&a.xml2json(c)||{}}catch(e){d={}}var m=d&&d.Error;h?l(null,d):m?l(a.error(new Error(m.Message),{code:m.Code,error:m})):p?l(a.error(new Error(u.statusMessage),{code:""+p})):p&&l(a.error(new Error("statusCode error")))}})),T=function e(t){t.TaskId===n&&(S&&S.abort&&S.abort(),r.off("inner-kill-task",e))};n&&r.on("inner-kill-task",T)}}var m={getService:function(e,t){var r=this.options.Protocol||(a.isBrowser&&"object"===("undefined"==typeof location?"undefined":n(location))&&"http:"===location.protocol?"http:":"https:"),o=this.options.ServiceDomain,i=e.AppId||this.options.appId,s=e.Region;o?(o=o.replace(/\{\{AppId\}\}/gi,i||"").replace(/\{\{Region\}\}/gi,s||"").replace(/\{\{.*?\}\}/gi,""),/^[a-zA-Z]+:\/\//.test(o)||(o=r+"//"+o),"/"===o.slice(-1)&&(o=o.slice(0,-1))):o=s?r+"//cos."+s+".myqcloud.com":r+"//service.cos.myqcloud.com";var c="",u=s?"cos."+s+".myqcloud.com":"service.cos.myqcloud.com";u===o.replace(/^https?:\/\/([^/]+)(\/.*)?$/,"$1")&&(c=u),h.call(this,{Action:"name/cos:GetService",url:o,method:"GET",headers:e.Headers,SignHost:c,tracker:e.tracker},(function(e,r){if(e)return t(e);var n=r&&r.ListAllMyBucketsResult&&r.ListAllMyBucketsResult.Buckets&&r.ListAllMyBucketsResult.Buckets.Bucket||[];n=a.isArray(n)?n:[n];var o=r&&r.ListAllMyBucketsResult&&r.ListAllMyBucketsResult.Owner||{};t(null,{Buckets:n,Owner:o,statusCode:r.statusCode,headers:r.headers})}))},putBucket:function(e,t){var r=this,n="";if(e.BucketAZConfig){var o={BucketAZConfig:e.BucketAZConfig};n=a.json2xml({CreateBucketConfiguration:o})}h.call(this,{Action:"name/cos:PutBucket",method:"PUT",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,body:n,tracker:e.tracker},(function(n,o){if(n)return t(n);var a=u({protocol:r.options.Protocol,domain:r.options.Domain,bucket:e.Bucket,region:e.Region,isLocation:!0});t(null,{Location:a,statusCode:o.statusCode,headers:o.headers})}))},headBucket:function(e,t){h.call(this,{Action:"name/cos:HeadBucket",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,method:"HEAD",tracker:e.tracker},t)},getBucket:function(e,t){var r={};r.prefix=e.Prefix||"",r.delimiter=e.Delimiter,r.marker=e.Marker,r["max-keys"]=e.MaxKeys,r["encoding-type"]=e.EncodingType,h.call(this,{Action:"name/cos:GetBucket",ResourceKey:r.prefix,method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,qs:r,tracker:e.tracker},(function(e,r){if(e)return t(e);var n=r.ListBucketResult||{},o=n.Contents||[],i=n.CommonPrefixes||[];o=a.isArray(o)?o:[o],i=a.isArray(i)?i:[i];var s=a.clone(n);a.extend(s,{Contents:o,CommonPrefixes:i,statusCode:r.statusCode,headers:r.headers}),t(null,s)}))},deleteBucket:function(e,t){h.call(this,{Action:"name/cos:DeleteBucket",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,method:"DELETE",tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))},putBucketAcl:function(e,t){var r=e.Headers,n="";if(e.AccessControlPolicy){var o=a.clone(e.AccessControlPolicy||{}),i=o.Grants||o.Grant;i=a.isArray(i)?i:[i],delete o.Grant,delete o.Grants,o.AccessControlList={Grant:i},n=a.json2xml({AccessControlPolicy:o}),r["Content-Type"]="application/xml",r["Content-MD5"]=a.b64(a.md5(n))}a.each(r,(function(e,t){0===t.indexOf("x-cos-grant-")&&(r[t]=c(r[t]))})),h.call(this,{Action:"name/cos:PutBucketACL",method:"PUT",Bucket:e.Bucket,Region:e.Region,headers:r,action:"acl",body:n,tracker:e.tracker},(function(e,r){if(e)return t(e);t(null,{statusCode:r.statusCode,headers:r.headers})}))},getBucketAcl:function(e,t){h.call(this,{Action:"name/cos:GetBucketACL",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"acl",tracker:e.tracker},(function(e,r){if(e)return t(e);var n=r.AccessControlPolicy||{},o=n.Owner||{},i=n.AccessControlList.Grant||[];i=a.isArray(i)?i:[i];var c=s(n);r.headers&&r.headers["x-cos-acl"]&&(c.ACL=r.headers["x-cos-acl"]),c=a.extend(c,{Owner:o,Grants:i,statusCode:r.statusCode,headers:r.headers}),t(null,c)}))},putBucketCors:function(e,t){var r=(e.CORSConfiguration||{}).CORSRules||e.CORSRules||[];r=a.clone(a.isArray(r)?r:[r]),a.each(r,(function(e){a.each(["AllowedOrigin","AllowedHeader","AllowedMethod","ExposeHeader"],(function(t){var r=t+"s",n=e[r]||e[t]||[];delete e[r],e[t]=a.isArray(n)?n:[n]}))}));var n={CORSRule:r};e.ResponseVary&&(n.ResponseVary=e.ResponseVary);var o=a.json2xml({CORSConfiguration:n}),i=e.Headers;i["Content-Type"]="application/xml",i["Content-MD5"]=a.b64(a.md5(o)),h.call(this,{Action:"name/cos:PutBucketCORS",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:o,action:"cors",headers:i,tracker:e.tracker},(function(e,r){if(e)return t(e);t(null,{statusCode:r.statusCode,headers:r.headers})}))},getBucketCors:function(e,t){h.call(this,{Action:"name/cos:GetBucketCORS",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"cors",tracker:e.tracker},(function(e,r){if(e)if(404===e.statusCode&&e.error&&"NoSuchCORSConfiguration"===e.error.Code){var n={CORSRules:[],statusCode:e.statusCode};e.headers&&(n.headers=e.headers),t(null,n)}else t(e);else{var o=r.CORSConfiguration||{},i=o.CORSRules||o.CORSRule||[];i=a.clone(a.isArray(i)?i:[i]);var s=o.ResponseVary;a.each(i,(function(e){a.each(["AllowedOrigin","AllowedHeader","AllowedMethod","ExposeHeader"],(function(t){var r=t+"s",n=e[r]||e[t]||[];delete e[t],e[r]=a.isArray(n)?n:[n]}))})),t(null,{CORSRules:i,ResponseVary:s,statusCode:r.statusCode,headers:r.headers})}}))},deleteBucketCors:function(e,t){h.call(this,{Action:"name/cos:DeleteBucketCORS",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"cors",tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode||e.statusCode,headers:r.headers})}))},getBucketLocation:function(e,t){h.call(this,{Action:"name/cos:GetBucketLocation",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"location",tracker:e.tracker},t)},getBucketPolicy:function(e,t){h.call(this,{Action:"name/cos:GetBucketPolicy",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"policy",rawBody:!0,tracker:e.tracker},(function(e,r){if(e)return e.statusCode&&403===e.statusCode?t(a.error(e,{ErrorStatus:"Access Denied"})):e.statusCode&&405===e.statusCode?t(a.error(e,{ErrorStatus:"Method Not Allowed"})):e.statusCode&&404===e.statusCode?t(a.error(e,{ErrorStatus:"Policy Not Found"})):t(e);var n={};try{n=JSON.parse(r.body)}catch(e){}t(null,{Policy:n,statusCode:r.statusCode,headers:r.headers})}))},putBucketPolicy:function(e,t){var r=e.Policy;try{"string"==typeof r&&(r=JSON.parse(r))}catch(e){}if(!r||"string"==typeof r)return t(a.error(new Error("Policy format error")));var n=JSON.stringify(r);r.version||(r.version="2.0");var o=e.Headers;o["Content-Type"]="application/json",o["Content-MD5"]=a.b64(a.md5(n)),h.call(this,{Action:"name/cos:PutBucketPolicy",method:"PUT",Bucket:e.Bucket,Region:e.Region,action:"policy",body:n,headers:o,tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))},deleteBucketPolicy:function(e,t){h.call(this,{Action:"name/cos:DeleteBucketPolicy",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"policy",tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode||e.statusCode,headers:r.headers})}))},putBucketTagging:function(e,t){var r=e.Tagging||{},n=r.TagSet||r.Tags||e.Tags||[];n=a.clone(a.isArray(n)?n:[n]);var o=a.json2xml({Tagging:{TagSet:{Tag:n}}}),i=e.Headers;i["Content-Type"]="application/xml",i["Content-MD5"]=a.b64(a.md5(o)),h.call(this,{Action:"name/cos:PutBucketTagging",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:o,action:"tagging",headers:i,tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))},getBucketTagging:function(e,t){h.call(this,{Action:"name/cos:GetBucketTagging",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"tagging",tracker:e.tracker},(function(e,r){if(e)if(404!==e.statusCode||!e.error||"Not Found"!==e.error&&"NoSuchTagSet"!==e.error.Code)t(e);else{var n={Tags:[],statusCode:e.statusCode};e.headers&&(n.headers=e.headers),t(null,n)}else{var o=[];try{o=r.Tagging.TagSet.Tag||[]}catch(e){}o=a.clone(a.isArray(o)?o:[o]),t(null,{Tags:o,statusCode:r.statusCode,headers:r.headers})}}))},deleteBucketTagging:function(e,t){h.call(this,{Action:"name/cos:DeleteBucketTagging",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"tagging",tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))},putBucketLifecycle:function(e,t){var r=(e.LifecycleConfiguration||{}).Rules||e.Rules||[];r=a.clone(r);var n=a.json2xml({LifecycleConfiguration:{Rule:r}}),o=e.Headers;o["Content-Type"]="application/xml",o["Content-MD5"]=a.b64(a.md5(n)),h.call(this,{Action:"name/cos:PutBucketLifecycle",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:n,action:"lifecycle",headers:o,tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))},getBucketLifecycle:function(e,t){h.call(this,{Action:"name/cos:GetBucketLifecycle",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"lifecycle",tracker:e.tracker},(function(e,r){if(e)if(404===e.statusCode&&e.error&&"NoSuchLifecycleConfiguration"===e.error.Code){var n={Rules:[],statusCode:e.statusCode};e.headers&&(n.headers=e.headers),t(null,n)}else t(e);else{var o=[];try{o=r.LifecycleConfiguration.Rule||[]}catch(e){}o=a.clone(a.isArray(o)?o:[o]),t(null,{Rules:o,statusCode:r.statusCode,headers:r.headers})}}))},deleteBucketLifecycle:function(e,t){h.call(this,{Action:"name/cos:DeleteBucketLifecycle",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"lifecycle",tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))},putBucketVersioning:function(e,t){if(e.VersioningConfiguration){var r=e.VersioningConfiguration||{},n=a.json2xml({VersioningConfiguration:r}),o=e.Headers;o["Content-Type"]="application/xml",o["Content-MD5"]=a.b64(a.md5(n)),h.call(this,{Action:"name/cos:PutBucketVersioning",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:n,action:"versioning",headers:o,tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))}else t(a.error(new Error("missing param VersioningConfiguration")))},getBucketVersioning:function(e,t){h.call(this,{Action:"name/cos:GetBucketVersioning",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"versioning",tracker:e.tracker},(function(e,r){e||!r.VersioningConfiguration&&(r.VersioningConfiguration={}),t(e,r)}))},putBucketReplication:function(e,t){var r=a.clone(e.ReplicationConfiguration),n=a.json2xml({ReplicationConfiguration:r});n=(n=n.replace(/<(\/?)Rules>/gi,"<$1Rule>")).replace(/<(\/?)Tags>/gi,"<$1Tag>");var o=e.Headers;o["Content-Type"]="application/xml",o["Content-MD5"]=a.b64(a.md5(n)),h.call(this,{Action:"name/cos:PutBucketReplication",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:n,action:"replication",headers:o,tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))},getBucketReplication:function(e,t){h.call(this,{Action:"name/cos:GetBucketReplication",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"replication",tracker:e.tracker},(function(e,r){if(e)if(404!==e.statusCode||!e.error||"Not Found"!==e.error&&"ReplicationConfigurationnotFoundError"!==e.error.Code)t(e);else{var n={ReplicationConfiguration:{Rules:[]},statusCode:e.statusCode};e.headers&&(n.headers=e.headers),t(null,n)}else!r.ReplicationConfiguration&&(r.ReplicationConfiguration={}),r.ReplicationConfiguration.Rule&&(r.ReplicationConfiguration.Rules=a.makeArray(r.ReplicationConfiguration.Rule),delete r.ReplicationConfiguration.Rule),t(e,r)}))},deleteBucketReplication:function(e,t){h.call(this,{Action:"name/cos:DeleteBucketReplication",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"replication",tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))},putBucketWebsite:function(e,t){if(e.WebsiteConfiguration){var r=a.clone(e.WebsiteConfiguration||{}),n=r.RoutingRules||r.RoutingRule||[];n=a.isArray(n)?n:[n],delete r.RoutingRule,delete r.RoutingRules,n.length&&(r.RoutingRules={RoutingRule:n});var o=a.json2xml({WebsiteConfiguration:r}),i=e.Headers;i["Content-Type"]="application/xml",i["Content-MD5"]=a.b64(a.md5(o)),h.call(this,{Action:"name/cos:PutBucketWebsite",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:o,action:"website",headers:i,tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))}else t(a.error(new Error("missing param WebsiteConfiguration")))},getBucketWebsite:function(e,t){h.call(this,{Action:"name/cos:GetBucketWebsite",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"website",tracker:e.tracker},(function(e,r){if(e)if(404===e.statusCode&&"NoSuchWebsiteConfiguration"===e.error.Code){var n={WebsiteConfiguration:{},statusCode:e.statusCode};e.headers&&(n.headers=e.headers),t(null,n)}else t(e);else{var o=r.WebsiteConfiguration||{};if(o.RoutingRules){var i=a.clone(o.RoutingRules.RoutingRule||[]);i=a.makeArray(i),o.RoutingRules=i}t(null,{WebsiteConfiguration:o,statusCode:r.statusCode,headers:r.headers})}}))},deleteBucketWebsite:function(e,t){h.call(this,{Action:"name/cos:DeleteBucketWebsite",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"website",tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))},putBucketReferer:function(e,t){if(e.RefererConfiguration){var r=a.clone(e.RefererConfiguration||{}),n=r.DomainList||{},o=n.Domains||n.Domain||[];(o=a.isArray(o)?o:[o]).length&&(r.DomainList={Domain:o});var i=a.json2xml({RefererConfiguration:r}),s=e.Headers;s["Content-Type"]="application/xml",s["Content-MD5"]=a.b64(a.md5(i)),h.call(this,{Action:"name/cos:PutBucketReferer",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:i,action:"referer",headers:s,tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))}else t(a.error(new Error("missing param RefererConfiguration")))},getBucketReferer:function(e,t){h.call(this,{Action:"name/cos:GetBucketReferer",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"referer",tracker:e.tracker},(function(e,r){if(e)if(404===e.statusCode&&"NoSuchRefererConfiguration"===e.error.Code){var n={WebsiteConfiguration:{},statusCode:e.statusCode};e.headers&&(n.headers=e.headers),t(null,n)}else t(e);else{var o=r.RefererConfiguration||{};if(o.DomainList){var i=a.makeArray(o.DomainList.Domain||[]);o.DomainList={Domains:i}}t(null,{RefererConfiguration:o,statusCode:r.statusCode,headers:r.headers})}}))},putBucketDomain:function(e,t){var r=(e.DomainConfiguration||{}).DomainRule||e.DomainRule||[];r=a.clone(r);var n=a.json2xml({DomainConfiguration:{DomainRule:r}}),o=e.Headers;o["Content-Type"]="application/xml",o["Content-MD5"]=a.b64(a.md5(n)),h.call(this,{Action:"name/cos:PutBucketDomain",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:n,action:"domain",headers:o,tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))},getBucketDomain:function(e,t){h.call(this,{Action:"name/cos:GetBucketDomain",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"domain",tracker:e.tracker},(function(e,r){if(e)return t(e);var n=[];try{n=r.DomainConfiguration.DomainRule||[]}catch(e){}n=a.clone(a.isArray(n)?n:[n]),t(null,{DomainRule:n,statusCode:r.statusCode,headers:r.headers})}))},deleteBucketDomain:function(e,t){h.call(this,{Action:"name/cos:DeleteBucketDomain",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"domain",tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))},putBucketOrigin:function(e,t){var r=(e.OriginConfiguration||{}).OriginRule||e.OriginRule||[];r=a.clone(r);var n=a.json2xml({OriginConfiguration:{OriginRule:r}}),o=e.Headers;o["Content-Type"]="application/xml",o["Content-MD5"]=a.b64(a.md5(n)),h.call(this,{Action:"name/cos:PutBucketOrigin",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:n,action:"origin",headers:o,tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))},getBucketOrigin:function(e,t){h.call(this,{Action:"name/cos:GetBucketOrigin",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"origin",tracker:e.tracker},(function(e,r){if(e)return t(e);var n=[];try{n=r.OriginConfiguration.OriginRule||[]}catch(e){}n=a.clone(a.isArray(n)?n:[n]),t(null,{OriginRule:n,statusCode:r.statusCode,headers:r.headers})}))},deleteBucketOrigin:function(e,t){h.call(this,{Action:"name/cos:DeleteBucketOrigin",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"origin",tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))},putBucketLogging:function(e,t){var r=a.json2xml({BucketLoggingStatus:e.BucketLoggingStatus||""}),n=e.Headers;n["Content-Type"]="application/xml",n["Content-MD5"]=a.b64(a.md5(r)),h.call(this,{Action:"name/cos:PutBucketLogging",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:r,action:"logging",headers:n,tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))},getBucketLogging:function(e,t){h.call(this,{Action:"name/cos:GetBucketLogging",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"logging",tracker:e.tracker},(function(e,r){if(e)return t(e);t(null,{BucketLoggingStatus:r.BucketLoggingStatus,statusCode:r.statusCode,headers:r.headers})}))},putBucketInventory:function(e,t){return i.call(this,"PUT",e,t)},postBucketInventory:function(e,t){return i.call(this,"POST",e,t)},getBucketInventory:function(e,t){h.call(this,{Action:"name/cos:GetBucketInventory",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"inventory",qs:{id:e.Id},tracker:e.tracker},(function(e,r){if(e)return t(e);var n=r.InventoryConfiguration;if(n&&n.OptionalFields&&n.OptionalFields.Field){var o=n.OptionalFields.Field;a.isArray(o)||(o=[o]),n.OptionalFields=o}if(n.Destination&&n.Destination.COSBucketDestination&&n.Destination.COSBucketDestination.Encryption){var i=n.Destination.COSBucketDestination.Encryption;Object.keys(i).indexOf("SSE-COS")>-1&&(i.SSECOS=i["SSE-COS"],delete i["SSE-COS"])}t(null,{InventoryConfiguration:n,statusCode:r.statusCode,headers:r.headers})}))},listBucketInventory:function(e,t){h.call(this,{Action:"name/cos:ListBucketInventory",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"inventory",qs:{"continuation-token":e.ContinuationToken},tracker:e.tracker},(function(e,r){if(e)return t(e);var n=r.ListInventoryConfigurationResult,o=n.InventoryConfiguration||[];o=a.isArray(o)?o:[o],delete n.InventoryConfiguration,a.each(o,(function(e){if(e&&e.OptionalFields&&e.OptionalFields.Field){var t=e.OptionalFields.Field;a.isArray(t)||(t=[t]),e.OptionalFields=t}if(e.Destination&&e.Destination.COSBucketDestination&&e.Destination.COSBucketDestination.Encryption){var r=e.Destination.COSBucketDestination.Encryption;Object.keys(r).indexOf("SSE-COS")>-1&&(r.SSECOS=r["SSE-COS"],delete r["SSE-COS"])}})),n.InventoryConfigurations=o,a.extend(n,{statusCode:r.statusCode,headers:r.headers}),t(null,n)}))},deleteBucketInventory:function(e,t){h.call(this,{Action:"name/cos:DeleteBucketInventory",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"inventory",qs:{id:e.Id},tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))},putBucketAccelerate:function(e,t){if(e.AccelerateConfiguration){var r={AccelerateConfiguration:e.AccelerateConfiguration||{}},n=a.json2xml(r),o={"Content-Type":"application/xml"};o["Content-MD5"]=a.b64(a.md5(n)),h.call(this,{Action:"name/cos:PutBucketAccelerate",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:n,action:"accelerate",headers:o,tracker:e.tracker},(function(e,r){if(e)return t(e);t(null,{statusCode:r.statusCode,headers:r.headers})}))}else t(a.error(new Error("missing param AccelerateConfiguration")))},getBucketAccelerate:function(e,t){h.call(this,{Action:"name/cos:GetBucketAccelerate",method:"GET",Bucket:e.Bucket,Region:e.Region,action:"accelerate",tracker:e.tracker},(function(e,r){e||!r.AccelerateConfiguration&&(r.AccelerateConfiguration={}),t(e,r)}))},putBucketEncryption:function(e,t){var r=e.ServerSideEncryptionConfiguration||{},n=r.Rule||r.Rules||[],o=a.json2xml({ServerSideEncryptionConfiguration:{Rule:n}}),i=e.Headers;i["Content-Type"]="application/xml",i["Content-MD5"]=a.b64(a.md5(o)),h.call(this,{Action:"name/cos:PutBucketEncryption",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:o,action:"encryption",headers:i,tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))},getBucketEncryption:function(e,t){h.call(this,{Action:"name/cos:GetBucketEncryption",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"encryption",tracker:e.tracker},(function(e,r){if(e)if(404===e.statusCode&&"NoSuchEncryptionConfiguration"===e.code){var n={EncryptionConfiguration:{Rules:[]},statusCode:e.statusCode};e.headers&&(n.headers=e.headers),t(null,n)}else t(e);else{var o=a.makeArray(r.EncryptionConfiguration&&r.EncryptionConfiguration.Rule||[]);r.EncryptionConfiguration={Rules:o},t(e,r)}}))},deleteBucketEncryption:function(e,t){h.call(this,{Action:"name/cos:DeleteBucketReplication",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"encryption",tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))},getObject:function(e,t){var r=e.Query||{},n=e.QueryString||"",o=a.throttleOnProgress.call(this,0,e.onProgress),i=e.tracker;i&&i.setParams({signStartTime:(new Date).getTime()}),r["response-content-type"]=e.ResponseContentType,r["response-content-language"]=e.ResponseContentLanguage,r["response-expires"]=e.ResponseExpires,r["response-cache-control"]=e.ResponseCacheControl,r["response-content-disposition"]=e.ResponseContentDisposition,r["response-content-encoding"]=e.ResponseContentEncoding,h.call(this,{Action:"name/cos:GetObject",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,DataType:e.DataType,headers:e.Headers,qs:r,qsStr:n,rawBody:!0,onDownloadProgress:o,tracker:i},(function(r,n){if(o(null,!0),r){var i=r.statusCode;return e.Headers["If-Modified-Since"]&&i&&304===i?t(null,{NotModified:!0}):t(r)}t(null,{Body:n.body,ETag:a.attr(n.headers,"etag",""),statusCode:n.statusCode,headers:n.headers})}))},headObject:function(e,t){h.call(this,{Action:"name/cos:HeadObject",method:"HEAD",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,headers:e.Headers,tracker:e.tracker},(function(r,n){if(r){var o=r.statusCode;return e.Headers["If-Modified-Since"]&&o&&304===o?t(null,{NotModified:!0,statusCode:o}):t(r)}n.ETag=a.attr(n.headers,"etag",""),t(null,n)}))},listObjectVersions:function(e,t){var r={};r.prefix=e.Prefix||"",r.delimiter=e.Delimiter,r["key-marker"]=e.KeyMarker,r["version-id-marker"]=e.VersionIdMarker,r["max-keys"]=e.MaxKeys,r["encoding-type"]=e.EncodingType,h.call(this,{Action:"name/cos:GetBucketObjectVersions",ResourceKey:r.prefix,method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,qs:r,action:"versions",tracker:e.tracker},(function(e,r){if(e)return t(e);var n=r.ListVersionsResult||{},o=n.DeleteMarker||[];o=a.isArray(o)?o:[o];var i=n.Version||[];i=a.isArray(i)?i:[i];var s=a.clone(n);delete s.DeleteMarker,delete s.Version,a.extend(s,{DeleteMarkers:o,Versions:i,statusCode:r.statusCode,headers:r.headers}),t(null,s)}))},putObject:function(e,t){var r=this,n=e.ContentLength,o=a.throttleOnProgress.call(r,n,e.onProgress),i=e.Headers;i["Cache-Control"]||i["cache-control"]||(i["Cache-Control"]=""),i["Content-Type"]||i["content-type"]||(i["Content-Type"]=e.Body&&e.Body.type||"");var s=e.UploadAddMetaMd5||r.options.UploadAddMetaMd5||r.options.UploadCheckContentMd5,c=e.tracker;s&&c&&c.setParams({md5StartTime:(new Date).getTime()}),a.getBodyMd5(s,e.Body,(function(s){s&&(c&&c.setParams({md5EndTime:(new Date).getTime()}),r.options.UploadCheckContentMd5&&(i["Content-MD5"]=a.b64(s)),(e.UploadAddMetaMd5||r.options.UploadAddMetaMd5)&&(i["x-cos-meta-md5"]=s)),void 0!==e.ContentLength&&(i["Content-Length"]=e.ContentLength),o(null,!0),h.call(r,{Action:"name/cos:PutObject",TaskId:e.TaskId,method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,qs:e.Query,body:e.Body,onProgress:o,tracker:c},(function(i,s){if(i)return o(null,!0),t(i);o({loaded:n,total:n},!0);var c=u({ForcePathStyle:r.options.ForcePathStyle,protocol:r.options.Protocol,domain:r.options.Domain,bucket:e.Bucket,region:r.options.UseAccelerate?"accelerate":e.Region,object:e.Key});c=c.substr(c.indexOf("://")+3),s.Location=c,s.ETag=a.attr(s.headers,"etag",""),t(null,s)}))}),e.onHashProgress)},deleteObject:function(e,t){h.call(this,{Action:"name/cos:DeleteObject",method:"DELETE",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,VersionId:e.VersionId,action:e.Recursive?"recursive":"",tracker:e.tracker},(function(e,r){if(e){var n=e.statusCode;return n&&404===n?t(null,{BucketNotFound:!0,statusCode:n}):t(e)}t(null,{statusCode:r.statusCode,headers:r.headers})}))},getObjectAcl:function(e,t){var r={};e.VersionId&&(r.versionId=e.VersionId),h.call(this,{Action:"name/cos:GetObjectACL",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,qs:r,action:"acl",tracker:e.tracker},(function(e,r){if(e)return t(e);var n=r.AccessControlPolicy||{},o=n.Owner||{},i=n.AccessControlList&&n.AccessControlList.Grant||[];i=a.isArray(i)?i:[i];var c=s(n);delete c.GrantWrite,r.headers&&r.headers["x-cos-acl"]&&(c.ACL=r.headers["x-cos-acl"]),c=a.extend(c,{Owner:o,Grants:i,statusCode:r.statusCode,headers:r.headers}),t(null,c)}))},putObjectAcl:function(e,t){var r=e.Headers,n="";if(e.AccessControlPolicy){var o=a.clone(e.AccessControlPolicy||{}),i=o.Grants||o.Grant;i=a.isArray(i)?i:[i],delete o.Grant,delete o.Grants,o.AccessControlList={Grant:i},n=a.json2xml({AccessControlPolicy:o}),r["Content-Type"]="application/xml",r["Content-MD5"]=a.b64(a.md5(n))}a.each(r,(function(e,t){0===t.indexOf("x-cos-grant-")&&(r[t]=c(r[t]))})),h.call(this,{Action:"name/cos:PutObjectACL",method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,action:"acl",headers:r,body:n,tracker:e.tracker},(function(e,r){if(e)return t(e);t(null,{statusCode:r.statusCode,headers:r.headers})}))},optionsObject:function(e,t){var r=e.Headers;r.Origin=e.Origin,r["Access-Control-Request-Method"]=e.AccessControlRequestMethod,r["Access-Control-Request-Headers"]=e.AccessControlRequestHeaders,h.call(this,{Action:"name/cos:OptionsObject",method:"OPTIONS",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:r,tracker:e.tracker},(function(e,r){if(e)return e.statusCode&&403===e.statusCode?t(null,{OptionsForbidden:!0,statusCode:e.statusCode}):t(e);var n=r.headers||{};t(null,{AccessControlAllowOrigin:n["access-control-allow-origin"],AccessControlAllowMethods:n["access-control-allow-methods"],AccessControlAllowHeaders:n["access-control-allow-headers"],AccessControlExposeHeaders:n["access-control-expose-headers"],AccessControlMaxAge:n["access-control-max-age"],statusCode:r.statusCode,headers:r.headers})}))},putObjectCopy:function(e,t){var r=this,n=e.Headers;n["Cache-Control"]||n["cache-control"]||(n["Cache-Control"]="");var o=e.CopySource||"",i=a.getSourceParams.call(this,o);if(i){var s=i.Bucket,c=i.Region,l=decodeURIComponent(i.Key);h.call(this,{Scope:[{action:"name/cos:GetObject",bucket:s,region:c,prefix:l},{action:"name/cos:PutObject",bucket:e.Bucket,region:e.Region,prefix:e.Key}],method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,headers:e.Headers,tracker:e.tracker},(function(n,o){if(n)return t(n);var i=a.clone(o.CopyObjectResult||{}),s=u({ForcePathStyle:r.options.ForcePathStyle,protocol:r.options.Protocol,domain:r.options.Domain,bucket:e.Bucket,region:e.Region,object:e.Key,isLocation:!0});a.extend(i,{Location:s,statusCode:o.statusCode,headers:o.headers}),t(null,i)}))}else t(a.error(new Error("CopySource format error")))},deleteMultipleObject:function(e,t){var r=e.Objects||[],n=e.Quiet;r=a.isArray(r)?r:[r];var o=a.json2xml({Delete:{Object:r,Quiet:n||!1}}),i=e.Headers;i["Content-Type"]="application/xml",i["Content-MD5"]=a.b64(a.md5(o));var s=a.map(r,(function(t){return{action:"name/cos:DeleteObject",bucket:e.Bucket,region:e.Region,prefix:t.Key}}));h.call(this,{Scope:s,method:"POST",Bucket:e.Bucket,Region:e.Region,body:o,action:"delete",headers:i,tracker:e.tracker},(function(e,r){if(e)return t(e);var n=r.DeleteResult||{},o=n.Deleted||[],i=n.Error||[];o=a.isArray(o)?o:[o],i=a.isArray(i)?i:[i];var s=a.clone(n);a.extend(s,{Error:i,Deleted:o,statusCode:r.statusCode,headers:r.headers}),t(null,s)}))},restoreObject:function(e,t){var r=e.Headers;if(e.RestoreRequest){var n=e.RestoreRequest||{},o=a.json2xml({RestoreRequest:n});r["Content-Type"]="application/xml",r["Content-MD5"]=a.b64(a.md5(o)),h.call(this,{Action:"name/cos:RestoreObject",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,body:o,action:"restore",headers:r,tracker:e.tracker},t)}else t(a.error(new Error("missing param RestoreRequest")))},putObjectTagging:function(e,t){var r=e.Tagging||{},n=r.TagSet||r.Tags||e.Tags||[];n=a.clone(a.isArray(n)?n:[n]);var o=a.json2xml({Tagging:{TagSet:{Tag:n}}}),i=e.Headers;i["Content-Type"]="application/xml",i["Content-MD5"]=a.b64(a.md5(o)),h.call(this,{Action:"name/cos:PutObjectTagging",method:"PUT",Bucket:e.Bucket,Key:e.Key,Region:e.Region,body:o,action:"tagging",headers:i,VersionId:e.VersionId,tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))},getObjectTagging:function(e,t){h.call(this,{Action:"name/cos:GetObjectTagging",method:"GET",Key:e.Key,Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"tagging",VersionId:e.VersionId,tracker:e.tracker},(function(e,r){if(e)if(404!==e.statusCode||!e.error||"Not Found"!==e.error&&"NoSuchTagSet"!==e.error.Code)t(e);else{var n={Tags:[],statusCode:e.statusCode};e.headers&&(n.headers=e.headers),t(null,n)}else{var o=[];try{o=r.Tagging.TagSet.Tag||[]}catch(e){}o=a.clone(a.isArray(o)?o:[o]),t(null,{Tags:o,statusCode:r.statusCode,headers:r.headers})}}))},deleteObjectTagging:function(e,t){h.call(this,{Action:"name/cos:DeleteObjectTagging",method:"DELETE",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"tagging",VersionId:e.VersionId,tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))},selectObjectContent:function(e,t){if(!e.SelectType)return t(a.error(new Error("missing param SelectType")));var r=e.SelectRequest||{},n=a.json2xml({SelectRequest:r}),o=e.Headers;o["Content-Type"]="application/xml",o["Content-MD5"]=a.b64(a.md5(n)),h.call(this,{Action:"name/cos:GetObject",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"select",qs:{"select-type":e.SelectType},VersionId:e.VersionId,body:n,DataType:"arraybuffer",rawBody:!0,tracker:e.tracker},(function(e,r){if(e&&204===e.statusCode)return t(null,{statusCode:e.statusCode});if(e)return t(e);var n=a.parseSelectPayload(r.body);t(null,{statusCode:r.statusCode,headers:r.headers,Body:n.body,Payload:n.payload})}))},appendObject:function(e,t){var r=e.Headers;r["Cache-Control"]||r["cache-control"]||(r["Cache-Control"]=""),r["Content-Type"]||r["content-type"]||(r["Content-Type"]=e.Body&&e.Body.type||""),h.call(this,{Action:"name/cos:AppendObject",method:"POST",Bucket:e.Bucket,Region:e.Region,action:"append",Key:e.Key,body:e.Body,qs:{position:e.Position},headers:e.Headers,tracker:e.tracker},(function(e,r){if(e)return t(e);t(null,r)}))},uploadPartCopy:function(e,t){var r=e.CopySource||"",n=a.getSourceParams.call(this,r);if(n){var o=n.Bucket,i=n.Region,s=decodeURIComponent(n.Key);h.call(this,{Scope:[{action:"name/cos:GetObject",bucket:o,region:i,prefix:s},{action:"name/cos:PutObject",bucket:e.Bucket,region:e.Region,prefix:e.Key}],method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,qs:{partNumber:e.PartNumber,uploadId:e.UploadId},headers:e.Headers,tracker:e.tracker},(function(e,r){if(e)return t(e);var n=a.clone(r.CopyPartResult||{});a.extend(n,{statusCode:r.statusCode,headers:r.headers}),t(null,n)}))}else t(a.error(new Error("CopySource format error")))},multipartInit:function(e,t){var r=this,n=e.Headers,o=e.tracker;n["Cache-Control"]||n["cache-control"]||(n["Cache-Control"]=""),n["Content-Type"]||n["content-type"]||(n["Content-Type"]=e.Body&&e.Body.type||"");var i=e.Body&&(e.UploadAddMetaMd5||r.options.UploadAddMetaMd5);i&&o&&o.setParams({md5StartTime:(new Date).getTime()}),a.getBodyMd5(i,e.Body,(function(n){n&&(e.Headers["x-cos-meta-md5"]=n),i&&o&&o.setParams({md5EndTime:(new Date).getTime()}),h.call(r,{Action:"name/cos:InitiateMultipartUpload",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,action:"uploads",headers:e.Headers,qs:e.Query,tracker:o},(function(e,r){return e?(o&&o.parent&&o.parent.setParams({errorNode:"multipartInit"}),t(e)):(r=a.clone(r||{}))&&r.InitiateMultipartUploadResult?t(null,a.extend(r.InitiateMultipartUploadResult,{statusCode:r.statusCode,headers:r.headers})):void t(null,r)}))}),e.onHashProgress)},multipartUpload:function(e,t){var r=this;a.getFileSize("multipartUpload",e,(function(){var n=e.tracker,o=r.options.UploadCheckContentMd5;o&&n&&n.setParams({md5StartTime:(new Date).getTime()}),a.getBodyMd5(o,e.Body,(function(i){i&&(e.Headers["Content-MD5"]=a.b64(i)),o&&n&&n.setParams({md5EndTime:(new Date).getTime()}),n&&n.setParams({partNumber:e.PartNumber}),h.call(r,{Action:"name/cos:UploadPart",TaskId:e.TaskId,method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,qs:{partNumber:e.PartNumber,uploadId:e.UploadId},headers:e.Headers,onProgress:e.onProgress,body:e.Body||null,tracker:n},(function(e,r){if(e)return n&&n.parent&&n.parent.setParams({errorNode:"multipartUpload"}),t(e);t(null,{ETag:a.attr(r.headers,"etag",""),statusCode:r.statusCode,headers:r.headers})}))}))}))},multipartComplete:function(e,t){for(var r=this,n=e.UploadId,o=e.Parts,i=e.tracker,s=0,c=o.length;s-1?function(e){var t=e.match(/q-url-param-list.*?(?=&)/g)[0],r="q-url-param-list="+encodeURIComponent(t.replace(/q-url-param-list=/,"")).toLowerCase(),n=new RegExp(t,"g");return e.replace(n,r)}(r.Authorization):"sign="+encodeURIComponent(r.Authorization)),r.SecurityToken&&(n+="&x-cos-security-token="+r.SecurityToken),r.ClientIP&&(n+="&clientIP="+r.ClientIP),r.ClientUA&&(n+="&clientUA="+r.ClientUA),r.Token&&(n+="&token="+r.Token),i&&(n+="&"+i),setTimeout((function(){t(null,{Url:n})}))}}));return p?(s+="?"+p.Authorization+(p.SecurityToken?"&x-cos-security-token="+p.SecurityToken:""),i&&(s+="&"+i)):i&&(s+="?"+i),s},getAuth:function(e){return a.getAuth({SecretId:e.SecretId||this.options.SecretId||"",SecretKey:e.SecretKey||this.options.SecretKey||"",Bucket:e.Bucket,Region:e.Region,Method:e.Method,Key:e.Key,Query:e.Query,Headers:e.Headers,Expires:e.Expires,UseRawKey:this.options.UseRawKey,SystemClockOffset:this.options.SystemClockOffset})}};e.exports.init=function(e,t){t.transferToTaskMethod(m,"putObject"),a.each(m,(function(t,r){e.prototype[r]=a.apiWrapper(r,t),function(e,t,r){a.each(["Cors","Acl"],(function(n){if(e.slice(-n.length)===n){var o=e.slice(0,-n.length)+n.toUpperCase(),i=a.apiWrapper(e,t);r[o]=function(){i.apply(this,arguments)}}}))}(r,t,e.prototype)}))}},function(e,t,r){var n=r(0),o=function(e){switch(n(e)){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}},a=function(e,t,r){var n={},o=t.getAllResponseHeaders();return o&&o.length>0&&o.trim().split("\n").forEach((function(e){if(e){var t=e.indexOf(":"),r=e.substr(0,t).trim().toLowerCase(),o=e.substr(t+1).trim();n[r]=o}})),{error:e,statusCode:t.status,statusMessage:t.statusText,headers:n,body:r}},i=function(e,t){return t||"text"!==t?e.response:e.responseText};e.exports=function(e,t){var r,s,c,u,l=(e.method||"GET").toUpperCase(),d=e.url;if(e.qs){var p=(r=e.qs,s=s||"&",c=c||"=",null===r&&(r=void 0),"object"===n(r)?Object.keys(r).map((function(e){var t=encodeURIComponent(o(e))+c;return Array.isArray(r[e])?r[e].map((function(e){return t+encodeURIComponent(o(e))})).join(s):t+encodeURIComponent(o(r[e]))})).filter(Boolean).join(s):u?encodeURIComponent(o(u))+c+encodeURIComponent(o(r)):"");p&&(d+=(-1===d.indexOf("?")?"?":"&")+p)}var f=new XMLHttpRequest;if(f.open(l,d,!0),f.responseType=e.dataType||"text",e.xhrFields)for(var h in e.xhrFields)f[h]=e.xhrFields[h];var g=e.headers;if(g)for(var m in g)g.hasOwnProperty(m)&&"content-length"!==m.toLowerCase()&&"user-agent"!==m.toLowerCase()&&"origin"!==m.toLowerCase()&&"host"!==m.toLowerCase()&&f.setRequestHeader(m,g[m]);return e.onProgress&&f.upload&&(f.upload.onprogress=e.onProgress),e.onDownloadProgress&&(f.onprogress=e.onDownloadProgress),e.timeout&&(f.timeout=e.timeout),f.ontimeout=function(e){var r=new Error("timeout");t(a(r,f))},f.onload=function(){t(a(null,f,i(f,e.dataType)))},f.onerror=function(r){var n=i(f,e.dataType);if(n)t(a(null,f,n));else{var o=f.statusText;o||0!==f.status||(o=new Error("CORS blocked or network error")),t(a(o,f,n))}},f.send(e.body||""),f}},function(e,t,r){var n=r(0),o=r(8),a=r(30),i=r(7).EventProxy,s=r(1),c=r(5);function u(e,t){var r=e.TaskId,n=e.Bucket,c=e.Region,u=e.Key,p=e.StorageClass,f=this,h={},g=e.FileSize,m=e.SliceSize,y=Math.ceil(g/m),v=0,k=s.throttleOnProgress.call(f,g,e.onHashProgress),C=function(t,r){var n=t.length;if(0===n)return r(null,!0);if(n>y)return r(null,!1);if(n>1&&Math.max(t[0].Size,t[1].Size)!==m)return r(null,!1);!function o(a){if(a=i.length)b.emit("has_and_check_upload_id",t);else{var p=i[l];if(!s.isInArray(t,p))return o.removeUploadId.call(f,p),void a(l+1);o.using[p]?a(l+1):d.call(f,{Bucket:n,Region:c,Key:u,UploadId:p,tracker:e.tracker},(function(e,t){f._isRunningTask(r)&&(e?(o.removeUploadId.call(f,p),a(l+1)):b.emit("upload_id_available",{UploadId:p,PartList:t.PartList}))}))}}(0)}else b.emit("has_and_check_upload_id",t)})),b.on("get_remote_upload_id_list",(function(){l.call(f,{Bucket:n,Region:c,Key:u,tracker:e.tracker},(function(t,a){if(f._isRunningTask(r)){if(t)return b.emit("error",t);var i=s.filter(a.UploadList,(function(e){return e.Key===u&&(!p||e.StorageClass.toUpperCase()===p.toUpperCase())})).reverse().map((function(e){return e.UploadId||e.UploadID}));if(i.length)b.emit("seek_local_avail_upload_id",i);else{var c,l=o.getFileId(e.Body,e.ChunkSize,n,u);l&&(c=o.getUploadIdList.call(f,l))&&s.each(c,(function(e){o.removeUploadId.call(f,e)})),b.emit("no_available_upload_id")}}}))})),b.emit("get_remote_upload_id_list")}function l(e,t){var r=this,n=[],o={Bucket:e.Bucket,Region:e.Region,Prefix:e.Key,calledBySdk:e.calledBySdk||"sliceUploadFile",tracker:e.tracker};!function e(){r.multipartList(o,(function(r,a){if(r)return t(r);n.push.apply(n,a.Upload||[]),"true"===a.IsTruncated?(o.KeyMarker=a.NextKeyMarker,o.UploadIdMarker=a.NextUploadIdMarker,e()):t(null,{UploadList:n})}))}()}function d(e,t){var r=this,n=[],o={Bucket:e.Bucket,Region:e.Region,Key:e.Key,UploadId:e.UploadId,calledBySdk:"sliceUploadFile",tracker:e.tracker};!function e(){r.multipartListPart(o,(function(r,a){if(r)return t(r);n.push.apply(n,a.Part||[]),"true"===a.IsTruncated?(o.PartNumberMarker=a.NextPartNumberMarker,e()):t(null,{PartList:n})}))}()}function p(e,t){var r=this,n=e.TaskId,o=e.Bucket,i=e.Region,c=e.Key,u=e.UploadData,l=e.FileSize,d=e.SliceSize,p=Math.min(e.AsyncLimit||r.options.ChunkParallelLimit||1,256),h=e.Body,g=Math.ceil(l/d),m=0,y=e.ServerSideEncryption,v=e.Headers,k=s.filter(u.PartList,(function(e){return e.Uploaded&&(m+=e.PartNumber>=g&&l%d||d),!e.Uploaded})),C=e.onProgress;a.eachLimit(k,p,(function(t,a){if(r._isRunningTask(n)){var s=t.PartNumber,p=Math.min(l,t.PartNumber*d)-(t.PartNumber-1)*d,g=0;f.call(r,{TaskId:n,Bucket:o,Region:i,Key:c,SliceSize:d,FileSize:l,PartNumber:s,ServerSideEncryption:y,Body:h,UploadData:u,Headers:v,onProgress:function(e){m+=e.loaded-g,g=e.loaded,C({loaded:m,total:l})},tracker:e.tracker},(function(e,o){r._isRunningTask(n)&&(e||o.ETag||(e='get ETag error, please add "ETag" to CORS ExposeHeader setting.( 获取ETag失败,请在CORS ExposeHeader设置中添加ETag,请参考文档:https://cloud.tencent.com/document/product/436/13318 )'),e?m-=g:(m+=p-g,t.ETag=o.ETag),C({loaded:m,total:l}),a(e||null,o))}))}}),(function(e){if(r._isRunningTask(n))return e?t(e):void t(null,{UploadId:u.UploadId,SliceList:u.PartList})}))}function f(e,t){var r=this,n=e.TaskId,o=e.Bucket,i=e.Region,c=e.Key,u=e.FileSize,l=e.Body,d=1*e.PartNumber,p=e.SliceSize,f=e.ServerSideEncryption,h=e.UploadData,g=e.Headers||{},m=r.options.ChunkRetryTimes+1,y=p*(d-1),v=p,k=y+p;k>u&&(v=(k=u)-y);var C=["x-cos-traffic-limit","x-cos-mime-limit"],b={};s.each(g,(function(e,t){C.indexOf(t)>-1&&(b[t]=e)}));var S=h.PartList[d-1];a.retry(m,(function(t){r._isRunningTask(n)&&s.fileSlice(l,y,k,!0,(function(a){r.multipartUpload({TaskId:n,Bucket:o,Region:i,Key:c,ContentLength:v,PartNumber:d,UploadId:h.UploadId,ServerSideEncryption:f,Body:a,Headers:b,onProgress:e.onProgress,calledBySdk:"sliceUploadFile",tracker:e.tracker},(function(e,o){if(r._isRunningTask(n))return e?t(e):(S.Uploaded=!0,t(null,o))}))}))}),(function(e,o){if(r._isRunningTask(n))return t(e,o)}))}function h(e,t){var r=e.Bucket,n=e.Region,o=e.Key,i=e.UploadId,s=e.SliceList,c=this,u=this.options.ChunkRetryTimes+1,l=e.Headers,d=s.map((function(e){return{PartNumber:e.PartNumber,ETag:e.ETag}}));a.retry(u,(function(t){c.multipartComplete({Bucket:r,Region:n,Key:o,UploadId:i,Parts:d,Headers:l,calledBySdk:"sliceUploadFile",tracker:e.tracker},t)}),(function(e,r){t(e,r)}))}function g(e,t){var r=e.Bucket,n=e.Region,o=e.Key,i=e.AbortArray,s=e.AsyncLimit||1,c=this,u=0,l=new Array(i.length);a.eachLimit(i,s,(function(t,a){var i=u;if(o&&o!==t.Key)return l[i]={error:{KeyNotMatch:!0}},void a(null);var s=t.UploadId||t.UploadID;c.multipartAbort({Bucket:r,Region:n,Key:t.Key,Headers:e.Headers,UploadId:s},(function(e){var o={Bucket:r,Region:n,Key:t.Key,UploadId:s};l[i]={error:e,task:o},a(null)})),u++}),(function(e){if(e)return t(e);for(var r=[],n=[],o=0,a=l.length;oo?"sliceUploadFile":"putObject";e.tracker=new c({Beacon:r.options.BeaconReporter,clsReporter:r.options.ClsReporter,bucket:e.Bucket,region:e.Region,apiName:"uploadFile",realApi:p,fileKey:e.Key,fileSize:u,accelerate:d,deepTracker:r.options.DeepTracker,customId:r.options.CustomId,delay:r.options.TrackerDelay})}s.each(e,(function(e,t){"object"!==n(e)&&"function"!=typeof e&&(l[t]=e)}));var f=e.onTaskReady;e.onTaskReady=function(e){l.TaskId=e,f&&f(e)};var h=u>o?"sliceUploadFile":"putObject",g=e.onFileFinish;a.push({api:h,params:e,callback:function(r,n){e.tracker&&e.tracker.report(r,n),g&&g(r,n,l),t&&t(r,n)}}),r._addTasks(a)},uploadFiles:function(e,t){var r=this,o=void 0===e.SliceSize?r.options.SliceSize:e.SliceSize,a=0,i=0,u=s.throttleOnProgress.call(r,i,e.onProgress),l=e.files.length,d=e.onFileFinish,p=Array(l),f=function(e,r,n){u(null,!0),d&&d(e,r,n),p[n.Index]={options:n,error:e,data:r},--l<=0&&t&&t(null,{files:p})},h=[];s.each(e.files,(function(e,t){!function(){var l=e.Body,d=l.size||l.length||0,p={Index:t,TaskId:""};if(!r.options.UseRawKey&&e.Key&&"/"===e.Key.substr(0,1)&&(e.Key=e.Key.substr(1)),a+=d,r.options.EnableReporter){var g=r.options.UseAccelerate||"string"==typeof r.options.Domain&&r.options.Domain.includes("accelerate."),m=d>o?"sliceUploadFile":"putObject";e.tracker=new c({Beacon:r.options.BeaconReporter,clsReporter:r.options.ClsReporter,bucket:e.Bucket,region:e.Region,apiName:"uploadFiles",realApi:m,fileKey:e.Key,fileSize:d,accelerate:g,deepTracker:r.options.DeepTracker,customId:r.options.CustomId,delay:r.options.TrackerDelay})}s.each(e,(function(e,t){"object"!==n(e)&&"function"!=typeof e&&(p[t]=e)}));var y=e.onTaskReady;e.onTaskReady=function(e){p.TaskId=e,y&&y(e)};var v=0,k=e.onProgress;e.onProgress=function(e){i=i-v+e.loaded,v=e.loaded,k&&k(e),u({loaded:i,total:a})};var C=d>o?"sliceUploadFile":"putObject",b=e.onFileFinish;h.push({api:C,params:e,callback:function(t,r){e.tracker&&e.tracker.report(t,r),b&&b(t,r),f&&f(t,r,p)}})}()})),r._addTasks(h)},sliceCopyFile:function(e,t){var r=new i,n=this,c=e.Bucket,u=e.Region,l=e.Key,p=e.CopySource,f=s.getSourceParams.call(this,p);if(f){var h=f.Bucket,g=f.Region,y=decodeURIComponent(f.Key),v=void 0===e.CopySliceSize?n.options.CopySliceSize:e.CopySliceSize;v=Math.max(0,v);var k,C,b=e.CopyChunkSize||this.options.CopyChunkSize,S=this.options.CopyChunkParallelLimit,T=this.options.ChunkRetryTimes+1,w=0,R=0,x={},A={},E={};r.on("copy_slice_complete",(function(r){var i={};s.each(e.Headers,(function(e,t){0===t.toLowerCase().indexOf("x-cos-meta-")&&(i[t]=e)}));var d=s.map(r.PartList,(function(e){return{PartNumber:e.PartNumber,ETag:e.ETag}}));a.retry(T,(function(t){n.multipartComplete({Bucket:c,Region:u,Key:l,UploadId:r.UploadId,Parts:d,tracker:e.tracker,calledBySdk:"sliceCopyFile"},t)}),(function(e,n){if(o.removeUsing(r.UploadId),e)return C(null,!0),t(e);o.removeUploadId(r.UploadId),C({loaded:k,total:k},!0),t(null,n)}))})),r.on("get_copy_data_finish",(function(i){var d=o.getCopyFileId(p,x,b,c,l);d&&o.saveUploadId(d,i.UploadId,n.options.UploadIdCacheLimit),o.setUsing(i.UploadId);var f=s.filter(i.PartList,(function(e){return e.Uploaded&&(R+=e.PartNumber>=w&&k%b||b),!e.Uploaded}));a.eachLimit(f,S,(function(t,r){var o=t.PartNumber,s=t.CopySourceRange,d=t.end-t.start;a.retry(T,(function(t){m.call(n,{Bucket:c,Region:u,Key:l,CopySource:p,UploadId:i.UploadId,PartNumber:o,CopySourceRange:s,tracker:e.tracker,calledBySdk:"sliceCopyFile"},t)}),(function(e,n){if(e)return r(e);C({loaded:R+=d,total:k}),t.ETag=n.ETag,r(e||null,n)}))}),(function(e){if(e)return o.removeUsing(i.UploadId),C(null,!0),t(e);r.emit("copy_slice_complete",i)}))})),r.on("get_chunk_size_finish",(function(){var a=function(){n.multipartInit({Bucket:c,Region:u,Key:l,Headers:E,tracker:e.tracker,calledBySdk:"sliceCopyFile"},(function(n,o){if(n)return t(n);e.UploadId=o.UploadId,r.emit("get_copy_data_finish",{UploadId:e.UploadId,PartList:e.PartList})}))},i=o.getCopyFileId(p,x,b,c,l),f=o.getUploadIdList(i);if(!i||!f)return a();!function t(i){if(i>=f.length)return a();var p=f[i];if(o.using[p])return t(i+1);d.call(n,{Bucket:c,Region:u,Key:l,UploadId:p,tracker:e.tracker,calledBySdk:"sliceCopyFile"},(function(n,a){if(n)o.removeUploadId(p),t(i+1);else{if(o.using[p])return t(i+1);var c={},u=0;s.each(a.PartList,(function(e){var t=parseInt(e.Size),r=u+t-1;c[e.PartNumber+"|"+u+"|"+r]=e.ETag,u+=t})),s.each(e.PartList,(function(e){var t=c[e.PartNumber+"|"+e.start+"|"+e.end];t&&(e.ETag=t,e.Uploaded=!0)})),r.emit("get_copy_data_finish",{UploadId:p,PartList:e.PartList})}}))}(0)})),r.on("get_file_size_finish",(function(){if(function(){for(var t=[1,2,4,8,16,32,64,128,256,512,1024,2048,4096,5120],r=1048576,o=0;o11&&(A[t]=e)})),r.emit("get_file_size_finish")}else t(s.error(new Error('get Content-Length error, please add "Content-Length" to CORS ExposeHeader setting.( 获取Content-Length失败,请在CORS ExposeHeader设置中添加Content-Length,请参考文档:https://cloud.tencent.com/document/product/436/13318 )')))}))}else t(s.error(new Error("CopySource format error")))}};e.exports.init=function(e,t){t.transferToTaskMethod(y,"sliceUploadFile"),s.each(y,(function(t,r){e.prototype[r]=s.apiWrapper(r,t)}))}},function(e,t){var r={eachLimit:function(e,t,r,n){if(n=n||function(){},!e.length||t<=0)return n();var o=0,a=0,i=0;!function s(){if(o>=e.length)return n();for(;i=e.length?n():s())}))}()},retry:function(e,t,r){e<1?r():function n(o){t((function(t,a){t&&o=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,c=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){c=!0,i=e},f:function(){try{s||null==r.return||r.return()}finally{if(c)throw i}}}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);rt?1:-1}))}var h,g=["cache-control","content-disposition","content-encoding","content-length","content-md5","expect","expires","host","if-match","if-modified-since","if-none-match","if-unmodified-since","origin","range","transfer-encoding","pic-operations"],m=function(e,t,r){var n=t/8,o=e.slice(r,r+n);return new Uint8Array(o).reverse(),new{8:Uint8Array,16:Uint16Array,32:Uint32Array}[t](o)[0]},y=function(e,t,r,n){var o=e.slice(t,r),a="";return new Uint8Array(o).forEach((function(e){a+=String.fromCharCode(e)})),n&&(a=decodeURIComponent(escape(a))),a},v=function(){},k=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&void 0!==e[r]&&null!==e[r]&&(t[r]=e[r]);return t},C=(h=function(e,t){e=e.split("."),t=t.split(".");for(var r=0;rparseInt(t[r])?1:-1;return 0},function(e){if(!e)return!1;var t=(e.match(/Chrome\/([.\d]+)/)||[])[1],r=(e.match(/QBCore\/([.\d]+)/)||[])[1],n=(e.match(/QQBrowser\/([.\d]+)/)||[])[1];return t&&h(t,"53.0.2785.116")<0&&r&&h(r,"3.53.991.400")<0&&n&&h(n,"9.0.2524.400")<=0||!1}("undefined"!=typeof navigator&&navigator.userAgent)),b=1048576;function S(e){return x(e,(function(e){return"object"===n(e)&&null!==e?S(e):e}))}function T(e,t){return R(t,(function(r,n){e[n]=t[n]})),e}function w(e){return e instanceof Array}function R(e,t){for(var r in e)e.hasOwnProperty(r)&&t(e[r],r)}function x(e,t){var r=w(e)?[]:{};for(var n in e)e.hasOwnProperty(n)&&(r[n]=t(e[n],n));return r}var A=function(e,t){var r=t.Bucket,n=t.Region,o=t.Key,a=this.options.Domain,i=!a||"string"==typeof a&&a.indexOf("{Bucket}")>-1,s=!a||"string"==typeof a&&a.indexOf("{Region}")>-1;if(e.indexOf("Bucket")>-1||"deleteMultipleObject"===e||"multipartList"===e||"listObjectVersions"===e){if(i&&!r)return"Bucket";if(s&&!n)return"Region"}else if(e.indexOf("Object")>-1||e.indexOf("multipart")>-1||"sliceUploadFile"===e||"abortUploadTask"===e||"uploadFile"===e){if(i&&!r)return"Bucket";if(s&&!n)return"Region";if(!o)return"Key"}return!1},E=function(e,t){if(t=T({},t),"getAuth"!==e&&"getV4Auth"!==e&&"getObjectUrl"!==e){var r=t.Headers||{};if(t&&"object"===n(t)){!function(){for(var e in t)t.hasOwnProperty(e)&&e.indexOf("x-cos-")>-1&&(r[e]=t[e])}();O.each({"x-cos-mfa":"MFA","Content-MD5":"ContentMD5","Content-Length":"ContentLength","Content-Type":"ContentType",Expect:"Expect",Expires:"Expires","Cache-Control":"CacheControl","Content-Disposition":"ContentDisposition","Content-Encoding":"ContentEncoding",Range:"Range","If-Modified-Since":"IfModifiedSince","If-Unmodified-Since":"IfUnmodifiedSince","If-Match":"IfMatch","If-None-Match":"IfNoneMatch","x-cos-copy-source":"CopySource","x-cos-copy-source-Range":"CopySourceRange","x-cos-metadata-directive":"MetadataDirective","x-cos-copy-source-If-Modified-Since":"CopySourceIfModifiedSince","x-cos-copy-source-If-Unmodified-Since":"CopySourceIfUnmodifiedSince","x-cos-copy-source-If-Match":"CopySourceIfMatch","x-cos-copy-source-If-None-Match":"CopySourceIfNoneMatch","x-cos-acl":"ACL","x-cos-grant-read":"GrantRead","x-cos-grant-write":"GrantWrite","x-cos-grant-full-control":"GrantFullControl","x-cos-grant-read-acp":"GrantReadAcp","x-cos-grant-write-acp":"GrantWriteAcp","x-cos-storage-class":"StorageClass","x-cos-traffic-limit":"TrafficLimit","x-cos-mime-limit":"MimeLimit","x-cos-server-side-encryption-customer-algorithm":"SSECustomerAlgorithm","x-cos-server-side-encryption-customer-key":"SSECustomerKey","x-cos-server-side-encryption-customer-key-MD5":"SSECustomerKeyMD5","x-cos-server-side-encryption":"ServerSideEncryption","x-cos-server-side-encryption-cos-kms-key-id":"SSEKMSKeyId","x-cos-server-side-encryption-context":"SSEContext","Pic-Operations":"PicOperations"},(function(e,n){void 0!==t[e]&&(r[n]=t[e])})),t.Headers=k(r)}}return t},B=function(e){return Date.now()+(e||0)},D="object"===("undefined"==typeof navigator?"undefined":n(navigator))&&!!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),N="object"===("undefined"==typeof navigator?"undefined":n(navigator))&&/\sQQ/i.test(navigator.userAgent),O={noop:v,formatParams:E,apiWrapper:function(e,t){return function(r,n){var o,a=this;if("function"==typeof r&&(n=r,r={}),r=E(e,r),a.options.EnableReporter)if("sliceUploadFile"===r.calledBySdk||"sliceCopyFile"===r.calledBySdk)o=r.tracker&&r.tracker.generateSubTracker({apiName:e});else if(["uploadFile","uploadFiles"].includes(e))o=null;else{var i=0;r.Body&&(i="string"==typeof r.Body?r.Body.length:r.Body.size||r.Body.byteLength||0);var s=a.options.UseAccelerate||"string"==typeof a.options.Domain&&a.options.Domain.includes("accelerate.");o=new d({Beacon:a.options.BeaconReporter,clsReporter:a.options.ClsReporter,bucket:r.Bucket,region:r.Region,apiName:e,realApi:e,accelerate:s,fileKey:r.Key,fileSize:i,deepTracker:a.options.DeepTracker,customId:a.options.CustomId,delay:a.options.TrackerDelay})}r.tracker=o;var c=function(e){return e&&e.headers&&(e.headers["x-cos-request-id"]&&(e.RequestId=e.headers["x-cos-request-id"]),e.headers["x-ci-request-id"]&&(e.RequestId=e.headers["x-ci-request-id"]),e.headers["x-cos-version-id"]&&(e.VersionId=e.headers["x-cos-version-id"]),e.headers["x-cos-delete-marker"]&&(e.DeleteMarker=e.headers["x-cos-delete-marker"])),e},u=function(e,t){o&&o.report(e,t),n&&n(c(e),c(t))},l=function(){if("getService"!==e&&"abortUploadTask"!==e){var t=A.call(a,e,r);if(t)return"missing param "+t;if(r.Region){if(a.options.CompatibilityMode){if(!/^([a-z\d-.]+)$/.test(r.Region))return"Region format error."}else{if(r.Region.indexOf("cos.")>-1)return'param Region should not be start with "cos."';if(!/^([a-z\d-]+)$/.test(r.Region))return"Region format error."}!a.options.CompatibilityMode&&-1===r.Region.indexOf("-")&&"yfb"!==r.Region&&"default"!==r.Region&&r.Region}if(r.Bucket){if(!/^([a-z\d-]+)-(\d+)$/.test(r.Bucket))if(r.AppId)r.Bucket=r.Bucket+"-"+r.AppId;else{if(!a.options.AppId)return'Bucket should format as "test-1250000000".';r.Bucket=r.Bucket+"-"+a.options.AppId}r.AppId&&delete r.AppId}!a.options.UseRawKey&&r.Key&&"/"===r.Key.substr(0,1)&&(r.Key=r.Key.substr(1))}}(),p=["getAuth","getObjectUrl"].includes(e);if("function"==typeof Promise&&!p&&!n)return new Promise((function(e,o){if(n=function(t,r){t?o(t):e(r)},l)return u(O.error(new Error(l)));t.call(a,r,u)}));if(l)return u(O.error(new Error(l)));var f=t.call(a,r,u);return p?f:void 0}},xml2json:c,json2xml:u,md5:i,clearKey:k,fileSlice:function(e,t,r,n,o){var a;if(e.slice?a=e.slice(t,r):e.mozSlice?a=e.mozSlice(t,r):e.webkitSlice&&(a=e.webkitSlice(t,r)),n&&C){var i=new FileReader;i.onload=function(e){a=null,o(new Blob([i.result]))},i.readAsArrayBuffer(a)}else o(a)},getBodyMd5:function(e,t,r,n){r=r||v,e?"string"==typeof t?r(O.md5(t,!0)):Blob&&t instanceof Blob?O.getFileMd5(t,(function(e,t){r(t)}),n):r():r()},getFileMd5:function(e,t,r){var n=e.size,o=0,a=i.getCtx();!function i(s){if(s>=n){var c=a.digest("hex");t(null,c)}else{var u=Math.min(n,s+b);O.fileSlice(e,s,u,!1,(function(e){!function(e,t){var r,n=new FileReader;FileReader.prototype.readAsBinaryString?(r=FileReader.prototype.readAsBinaryString,n.onload=function(){t(this.result)}):FileReader.prototype.readAsArrayBuffer&&(r=function(e){var r="",n=new FileReader;n.onload=function(e){for(var o=new Uint8Array(n.result),a=o.byteLength,i=0;i-1||g.indexOf(n)>-1)&&(t[r]=e[r])}return t}(S(e.Headers||e.headers||{})),u=e.Key||"";e.UseRawKey?t=e.Pathname||e.pathname||"/"+u:0!==(t=e.Pathname||e.pathname||u).indexOf("/")&&(t="/"+t);var l=!1!==e.ForceSignHost;if(!c.Host&&!c.host&&e.Bucket&&e.Region&&l&&(c.Host=e.Bucket+".cos."+e.Region+".myqcloud.com"),!r)throw new Error("missing param SecretId");if(!n)throw new Error("missing param SecretKey");var d=Math.round(B(e.SystemClockOffset)/1e3)-1,p=d,h=e.Expires||e.expires;p+=void 0===h?900:1*h||0;var m=r,y=o||d+";"+p,v=o||d+";"+p,k=f(c,!0).join(";").toLowerCase(),C=f(i,!0).join(";").toLowerCase(),b=s.HmacSHA1(v,n).toString(),T=[a,t,O.obj2str(i,!0),O.obj2str(c,!0),""].join("\n"),w=["sha1",y,s.SHA1(T).toString(),""].join("\n");return["q-sign-algorithm=sha1","q-ak="+m,"q-sign-time="+y,"q-key-time="+v,"q-header-list="+k,"q-url-param-list="+C,"q-signature="+s.HmacSHA1(w,b).toString()].join("&")},parseSelectPayload:function(e){for(var t={},r=y(e),n={records:[]};e.byteLength;){var o,a=m(e,32,0),i=m(e,32,4),s=a-i-16,c=0;for(e=e.slice(12);c=0))throw new B(A,new Error(e.tagName+"@"+r));for(var o=t.length-1;n"==e&&">")||"&"==e&&"&"||'"'==e&&"""||"&#"+e.charCodeAt()+";"}function H(e,t){if(t(e))return!0;if(e=e.firstChild)do{if(H(e,t))return!0}while(e=e.nextSibling)}function j(){this.ownerDocument=this}function F(e,t,r,n){e&&e._inc++,r.namespaceURI===a.XMLNS&&delete t._nsMap[r.prefix?r.localName:""]}function K(e,t,r){if(e&&e._inc){e._inc++;var n=t.childNodes;if(r)n[n.length++]=r;else{for(var o=t.firstChild,a=0;o;)n[a++]=o,o=o.nextSibling;n.length=a,delete n[n.length]}}}function z(e,t){var r=t.previousSibling,n=t.nextSibling;return r?r.nextSibling=n:e.firstChild=n,n?n.previousSibling=r:e.lastChild=r,t.parentNode=null,t.previousSibling=null,t.nextSibling=null,K(e.ownerDocument,e),t}function V(e){return e&&e.nodeType===M.DOCUMENT_TYPE_NODE}function G(e){return e&&e.nodeType===M.ELEMENT_NODE}function W(e){return e&&e.nodeType===M.TEXT_NODE}function Q(e,t){var r=e.childNodes||[];if(o(r,G)||V(t))return!1;var n=o(r,V);return!(t&&n&&r.indexOf(n)>r.indexOf(t))}function X(e,t){var r=e.childNodes||[];if(o(r,(function(e){return G(e)&&e!==t})))return!1;var n=o(r,V);return!(t&&n&&r.indexOf(n)>r.indexOf(t))}function $(e,t,r){if(!function(e){return e&&(e.nodeType===M.DOCUMENT_NODE||e.nodeType===M.DOCUMENT_FRAGMENT_NODE||e.nodeType===M.ELEMENT_NODE)}(e))throw new B(x,"Unexpected parent node type "+e.nodeType);if(r&&r.parentNode!==e)throw new B(A,"child not in parent");if(!function(e){return e&&(G(e)||W(e)||V(e)||e.nodeType===M.DOCUMENT_FRAGMENT_NODE||e.nodeType===M.COMMENT_NODE||e.nodeType===M.PROCESSING_INSTRUCTION_NODE)}(t)||V(t)&&e.nodeType!==M.DOCUMENT_NODE)throw new B(x,"Unexpected node type "+t.nodeType+" for parent node type "+e.nodeType)}function J(e,t,r){var n=e.childNodes||[],a=t.childNodes||[];if(t.nodeType===M.DOCUMENT_FRAGMENT_NODE){var i=a.filter(G);if(i.length>1||o(a,W))throw new B(x,"More than one element or text in fragment");if(1===i.length&&!Q(e,r))throw new B(x,"Element in fragment can not be inserted before doctype")}if(G(t)&&!Q(e,r))throw new B(x,"Only one element can be added and only after doctype");if(V(t)){if(o(n,V))throw new B(x,"Only one doctype is allowed");var s=o(n,G);if(r&&n.indexOf(s)1||o(a,W))throw new B(x,"More than one element or text in fragment");if(1===i.length&&!X(e,r))throw new B(x,"Element in fragment can not be inserted before doctype")}if(G(t)&&!X(e,r))throw new B(x,"Only one element can be added and only after doctype");if(V(t)){if(o(n,(function(e){return V(e)&&e!==r})))throw new B(x,"Only one doctype is allowed");var s=o(n,G);if(r&&n.indexOf(s)=0;T--){if(""===(w=o[T]).prefix&&w.namespace===e.namespaceURI){d=w.namespace;break}}if(d!==e.namespaceURI)for(T=o.length-1;T>=0;T--){var w;if((w=o[T]).namespace===e.namespaceURI){w.prefix&&(l=w.prefix+":"+u);break}}}t.push("<",l);for(var R=0;R"),r&&/^script$/i.test(u))for(;c;)c.data?t.push(c.data):me(c,t,r,n,o.slice()),c=c.nextSibling;else for(;c;)me(c,t,r,n,o.slice()),c=c.nextSibling;t.push("")}else t.push("/>");return;case C:case S:for(c=e.firstChild;c;)me(c,t,r,n,o.slice()),c=c.nextSibling;return;case f:return ge(t,e.name,e.value);case h:return t.push(e.data.replace(/[<&>]/g,q));case g:return t.push("");case k:return t.push("\x3c!--",e.data,"--\x3e");case b:var B=e.publicId,D=e.systemId;if(t.push("");else if(D&&"."!=D)t.push(" SYSTEM ",D,">");else{var N=e.internalSubset;N&&t.push(" [",N,"]"),t.push(">")}return;case v:return t.push("");case m:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function ye(e,t,r){var n;switch(t.nodeType){case p:(n=t.cloneNode(!1)).ownerDocument=e;case S:break;case f:r=!0}if(n||(n=t.cloneNode(!1)),n.ownerDocument=e,n.parentNode=null,r)for(var o=t.firstChild;o;)n.appendChild(ye(e,o,r)),o=o.nextSibling;return n}function ve(e,t,r){var n=new t.constructor;for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){var a=t[o];"object"!=typeof a&&a!=n[o]&&(n[o]=a)}switch(t.childNodes&&(n.childNodes=new D),n.ownerDocument=e,n.nodeType){case p:var i=t.attributes,s=n.attributes=new I,c=i.length;s._ownerElement=n;for(var u=0;u=0&&e0},lookupPrefix:function(e){for(var t=this;t;){var r=t._nsMap;if(r)for(var n in r)if(Object.prototype.hasOwnProperty.call(r,n)&&r[n]===e)return n;t=t.nodeType==f?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var r=t._nsMap;if(r&&Object.prototype.hasOwnProperty.call(r,e))return r[e];t=t.nodeType==f?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return null==this.lookupPrefix(e)}},u(d,M),u(d,M.prototype),j.prototype={nodeName:"#document",nodeType:C,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==S){for(var r=e.firstChild;r;){var n=r.nextSibling;this.insertBefore(r,t),r=n}return e}return Z(this,e,t),e.ownerDocument=this,null===this.documentElement&&e.nodeType===p&&(this.documentElement=e),e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),z(this,e)},replaceChild:function(e,t){Z(this,e,t,Y),e.ownerDocument=this,t&&this.removeChild(t),G(e)&&(this.documentElement=e)},importNode:function(e,t){return ye(this,e,t)},getElementById:function(e){var t=null;return H(this.documentElement,(function(r){if(r.nodeType==p&&r.getAttribute("id")==e)return t=r,!0})),t},getElementsByClassName:function(e){var t=c(e);return new N(this,(function(r){var n=[];return t.length>0&&H(r.documentElement,(function(o){if(o!==r&&o.nodeType===p){var a=o.getAttribute("class");if(a){var i=e===a;if(!i){var s=c(a);i=t.every((u=s,function(e){return u&&-1!==u.indexOf(e)}))}i&&n.push(o)}}var u})),n}))},createElement:function(e){var t=new ee;return t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.localName=e,t.childNodes=new D,(t.attributes=new I)._ownerElement=t,t},createDocumentFragment:function(){var e=new le;return e.ownerDocument=this,e.childNodes=new D,e},createTextNode:function(e){var t=new ne;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new oe;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){var t=new ae;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var r=new de;return r.ownerDocument=this,r.tagName=r.nodeName=r.target=e,r.nodeValue=r.data=t,r},createAttribute:function(e){var t=new te;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new ue;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var r=new ee,n=t.split(":"),o=r.attributes=new I;return r.childNodes=new D,r.ownerDocument=this,r.nodeName=t,r.tagName=t,r.namespaceURI=e,2==n.length?(r.prefix=n[0],r.localName=n[1]):r.localName=t,o._ownerElement=r,r},createAttributeNS:function(e,t){var r=new te,n=t.split(":");return r.ownerDocument=this,r.nodeName=t,r.name=t,r.namespaceURI=e,r.specified=!0,2==n.length?(r.prefix=n[0],r.localName=n[1]):r.localName=t,r}},l(j,M),ee.prototype={nodeType:p,hasAttribute:function(e){return null!=this.getAttributeNode(e)},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var r=this.ownerDocument.createAttribute(e);r.value=r.nodeValue=""+t,this.setAttributeNode(r)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){return e.nodeType===S?this.insertBefore(e,null):function(e,t){return t.parentNode&&t.parentNode.removeChild(t),t.parentNode=e,t.previousSibling=e.lastChild,t.nextSibling=null,t.previousSibling?t.previousSibling.nextSibling=t:e.firstChild=t,e.lastChild=t,K(e.ownerDocument,e,t),t}(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var r=this.getAttributeNodeNS(e,t);r&&this.removeAttributeNode(r)},hasAttributeNS:function(e,t){return null!=this.getAttributeNodeNS(e,t)},getAttributeNS:function(e,t){var r=this.getAttributeNodeNS(e,t);return r&&r.value||""},setAttributeNS:function(e,t,r){var n=this.ownerDocument.createAttributeNS(e,t);n.value=n.nodeValue=""+r,this.setAttributeNode(n)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new N(this,(function(t){var r=[];return H(t,(function(n){n===t||n.nodeType!=p||"*"!==e&&n.tagName!=e||r.push(n)})),r}))},getElementsByTagNameNS:function(e,t){return new N(this,(function(r){var n=[];return H(r,(function(o){o===r||o.nodeType!==p||"*"!==e&&o.namespaceURI!==e||"*"!==t&&o.localName!=t||n.push(o)})),n}))}},j.prototype.getElementsByTagName=ee.prototype.getElementsByTagName,j.prototype.getElementsByTagNameNS=ee.prototype.getElementsByTagNameNS,l(ee,M),te.prototype.nodeType=f,l(te,M),re.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw new Error(R[x])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,r){r=this.data.substring(0,e)+r+this.data.substring(e+t),this.nodeValue=this.data=r,this.length=r.length}},l(re,M),ne.prototype={nodeName:"#text",nodeType:h,splitText:function(e){var t=this.data,r=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var n=this.ownerDocument.createTextNode(r);return this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling),n}},l(ne,re),oe.prototype={nodeName:"#comment",nodeType:k},l(oe,re),ae.prototype={nodeName:"#cdata-section",nodeType:g},l(ae,re),ie.prototype.nodeType=b,l(ie,M),se.prototype.nodeType=T,l(se,M),ce.prototype.nodeType=y,l(ce,M),ue.prototype.nodeType=m,l(ue,M),le.prototype.nodeName="#document-fragment",le.prototype.nodeType=S,l(le,M),de.prototype.nodeType=v,l(de,M),pe.prototype.serializeToString=function(e,t,r){return fe.call(e,t,r)},M.prototype.toString=fe;try{if(Object.defineProperty){function Ce(e){switch(e.nodeType){case p:case S:var t=[];for(e=e.firstChild;e;)7!==e.nodeType&&8!==e.nodeType&&t.push(Ce(e)),e=e.nextSibling;return t.join("");default:return e.nodeValue}}Object.defineProperty(N.prototype,"length",{get:function(){return O(this),this.$$length}}),Object.defineProperty(M.prototype,"textContent",{get:function(){return Ce(this)},set:function(e){switch(this.nodeType){case p:case S:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),ke=function(e,t,r){e["$$"+t]=r}}}catch(be){}t.DocumentType=ie,t.DOMException=B,t.DOMImplementation=_,t.Element=ee,t.Node=M,t.NodeList=D,t.XMLSerializer=pe},function(e,t,r){var n=r(22),o=r(23),a=r(0),i=r(6),s=null,c=function(e){return!e||e<0?0:(e/1e3).toFixed(3)},u=function(){var e=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()},l=function(){if("object"===("undefined"==typeof navigator?"undefined":a(navigator))){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;return(null==e?void 0:e.type)||(null==e?void 0:e.effectiveType)||"unknown"}return"unknown"},d=function(){return"object"===("undefined"==typeof location?"undefined":a(location))?location.protocol.replace(/:/,""):"unknown protocol"},p=function(){if("object"!==("undefined"==typeof navigator?"undefined":a(navigator)))return"unknown os";var e=navigator.userAgent.toLowerCase(),t=/macintosh|mac os x/i.test(navigator.userAgent);return e.indexOf("win32")>=0||e.indexOf("wow32")>=0?"win32":e.indexOf("win64")>=0||e.indexOf("wow64")>=0?"win64":t?"mac":"unknown os"},f=function(){return!("object"!==("undefined"==typeof navigator?"undefined":a(navigator))||!navigator.userAgent.match(/(Android|Adr|Linux)/i))},h=function(){return!("object"!==("undefined"==typeof navigator?"undefined":a(navigator))||!navigator.userAgent.match(/(iPhone|iPod|iPad|iOS)/i))},g=function(){return"object"!==("undefined"==typeof navigator?"undefined":a(navigator))?"unknown device":navigator.userAgent},m=function(){return!("object"!==("undefined"==typeof navigator?"undefined":a(navigator))||!navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i))}(),y=f()?"android":h?"ios":"other_mobile",v=p(),k=m?y:v,C=g(),b=d();function S(e){return e.replace(/([A-Z])/g,"_$1").toLowerCase()}var T=function(){"use strict";function e(t){n(this,e);var r=t.parent,o=t.traceId,a=t.bucket,c=t.region,l=t.apiName,d=t.realApi,p=t.httpMethod,f=t.fileKey,h=t.fileSize,g=t.accelerate,m=t.customId,y=t.delay,v=t.deepTracker,S=t.Beacon,T=t.clsReporter,w=a&&a.substr(a.lastIndexOf("-")+1)||"";this.parent=r,this.deepTracker=v,this.delay=y,T&&!this.clsReporter&&(this.clsReporter=T),this.params={sdkVersionName:"cos-js-sdk-v5",sdkVersionCode:i.version,osName:k,networkType:"",requestName:l||"",requestResult:"",realApi:d,bucket:a,region:c,accelerate:g,httpMethod:p,url:"",host:"",httpDomain:"",requestPath:f||"",userAgent:C,networkProtocol:b,errorType:"",errorCode:"",errorName:"",errorMessage:"",errorRequestId:"",errorHttpCode:0,errorServiceName:"",errorNode:"",httpTookTime:0,httpSize:h||0,httpMd5:0,httpSign:0,httpFullTime:0,httpSpeed:0,md5StartTime:0,md5EndTime:0,signStartTime:0,signEndTime:0,httpStartTime:0,httpEndTime:0,startTime:(new Date).getTime(),endTime:0,traceId:o||u(),appid:w,partNumber:0,httpRetryTimes:0,customId:m||"",partTime:0},S&&(this.beacon=function(e,t){if(!s){if("function"!=typeof e)throw new Error("Beacon not found");s=new e({appkey:"0WEB05PY6MHRGK0U",versionCode:i.version,channelID:"js_sdk",openid:"openid",unionid:"unid",strictMode:!1,delay:t,sessionDuration:6e4})}return s}(S,y))}return o(e,[{key:"formatResult",value:function(e,t){var r,n,o,a,i,s,u=(new Date).getTime(),d=l(),p=e?(null==e?void 0:e.code)||(null==e||null===(r=e.error)||void 0===r?void 0:r.code)||(null==e||null===(n=e.error)||void 0===n?void 0:n.Code):"",f=e?(null==e?void 0:e.message)||(null==e||null===(o=e.error)||void 0===o?void 0:o.message)||(null==e||null===(a=e.error)||void 0===a?void 0:a.Message):"",h=f,g=e?(null==e?void 0:e.resource)||(null==e||null===(i=e.error)||void 0===i?void 0:i.resource)||(null==e||null===(s=e.error)||void 0===s?void 0:s.Resource):"",m=e?null==e?void 0:e.statusCode:t.statusCode,y=e?(null==e?void 0:e.headers)&&(null==e?void 0:e.headers["x-cos-request-id"]):(null==t?void 0:t.headers)&&(null==t?void 0:t.headers["x-cos-request-id"]),v=e?y?"Server":"Client":"";"getObject"===this.params.requestName&&(this.params.httpSize=t?t.headers&&t.headers["content-length"]:0);var k="sliceUploadFile"===this.params.realApi,C="sliceCopyFile"===this.params.realApi;if(k||C){var b=this.params.httpSize/1024/this.params.partTime;Object.assign(this.params,{httpSpeed:b<0?0:b.toFixed(3)})}else{var S=u-this.params.startTime,T=this.params.httpEndTime-this.params.httpStartTime,w=this.params.httpSize/1024/(T/1e3),R=this.params.md5EndTime-this.params.md5StartTime,x=this.params.signEndTime-this.params.signStartTime;this.parent&&(this.parent.addParamValue("httpTookTime",c(T)),this.parent.addParamValue("httpFullTime",c(S)),this.parent.addParamValue("httpMd5",c(R)),this.parent.addParamValue("httpSign",c(x)),["multipartUpload","uploadPartCopy","putObjectCopy"].includes(this.params.requestName)&&this.parent.addParamValue("partTime",c(T))),Object.assign(this.params,{httpFullTime:c(S),httpMd5:c(R),httpSign:c(x),httpTookTime:c(T),httpSpeed:w<0?0:w.toFixed(3)})}if(Object.assign(this.params,{networkType:d,requestResult:e?"Failure":"Success",errorType:v,errorCode:p,errorHttpCode:m,errorName:h,errorMessage:f,errorServiceName:g,errorRequestId:y}),!e||p&&f||(this.params.fullError=e?JSON.stringify(e):""),this.params.url){try{var A=/^http(s)?:\/\/(.*?)\//.exec(this.params.url);this.params.host=A[2]}catch(e){this.params.host=this.params.url}this.params.httpDomain=this.params.host}}},{key:"report",value:function(e,t){if(this.beacon||this.clsReporter){this.formatResult(e,t);var r=function(e){var t,r={},n=["sdkVersionName","sdkVersionCode","osName","networkType","requestName","requestResult","bucket","region","appid","accelerate","url","host","requestPath","userAgent","networkProtocol","httpMethod","httpSize","httpSpeed","httpTookTime","httpMd5","httpSign","httpFullTime","httpDomain","partNumber","httpRetryTimes","customId","traceId","realApi"],o=[].concat(n,["errorNode","errorCode","errorName","errorMessage","errorRequestId","errorHttpCode","errorServiceName","errorType","fullError"]),a="Success"===e.requestResult?n:o;for(var i in e)a.includes(i)&&(r[S(i)]=e[i]);return r.request_name=e.realApi?(t=e.realApi,["putObject","sliceUploadFile","uploadFile","uploadFiles"].includes(t)?"UploadTask":"getObject"===t?"DownloadTask":["putObjectCopy","sliceCopyFile"].includes(t)?"CopyTask":t):e.requestName,r}(this.params);this.beacon&&this.sendEventsToBeacon(r),this.clsReporter&&this.sendEventsToCLS(r)}}},{key:"setParams",value:function(e){Object.assign(this.params,e)}},{key:"addParamValue",value:function(e,t){this.params[e]=(+this.params[e]+ +t).toFixed(3)}},{key:"sendEventsToBeacon",value:function(e){if(!("sliceUploadFile"===this.params.requestName||"sliceUploadFile"===this.params.realApi)||this.deepTracker){var t="qcloud_track_cos_sdk";0===this.delay?this.beacon&&this.beacon.onDirectUserAction(t,e):this.beacon&&this.beacon.onUserAction(t,e)}}},{key:"sendEventsToCLS",value:function(e){var t=!(0!==this.delay);this.clsReporter.log(e,t)}},{key:"generateSubTracker",value:function(t){return Object.assign(t,{parent:this,deepTracker:this.deepTracker,traceId:this.params.traceId,bucket:this.params.bucket,region:this.params.region,accelerate:this.params.accelerate,fileKey:this.params.requestPath,customId:this.params.customId,delay:this.delay,clsReporter:this.clsReporter}),new e(t)}}]),e}();e.exports=T},function(e){e.exports=JSON.parse('{"name":"cos-js-sdk-v5","version":"1.8.0","description":"JavaScript SDK for [腾讯云对象存储](https://cloud.tencent.com/product/cos)","main":"dist/cos-js-sdk-v5.js","types":"index.d.ts","scripts":{"prettier":"prettier --write src demo/demo.js demo/CIDemos/*.js test/test.js server/sts.js lib/request.js index.d.ts","server":"node server/sts.js","dev":"cross-env NODE_ENV=development webpack -w --mode=development","build":"cross-env NODE_ENV=production webpack --mode=production","cos-auth.min.js":"uglifyjs ./demo/common/cos-auth.js -o ./demo/common/cos-auth.min.js -c -m","test":"jest --runInBand --coverage"},"repository":{"type":"git","url":"git+https://github.com/tencentyun/cos-js-sdk-v5.git"},"keywords":[],"author":"carsonxu","license":"ISC","bugs":{"url":"https://github.com/tencentyun/cos-js-sdk-v5/issues"},"homepage":"https://github.com/tencentyun/cos-js-sdk-v5#readme","dependencies":{"@xmldom/xmldom":"^0.8.6"},"devDependencies":{"@babel/core":"7.17.9","@babel/plugin-transform-runtime":"7.18.10","@babel/preset-env":"7.16.11","babel-loader":"8.2.5","body-parser":"^1.18.3","cross-env":"^5.2.0","express":"^4.16.4","jest":"^29.3.1","jest-environment-jsdom":"^29.3.1","prettier":"^3.0.1","qcloud-cos-sts":"^3.0.2","request":"^2.87.0","terser-webpack-plugin":"4.2.3","uglifyjs":"^2.4.11","webpack":"4.46.0","webpack-cli":"4.10.0"}}')},function(e,t){var r=function(e){var t={},r=function(e){return!t[e]&&(t[e]=[]),t[e]};e.on=function(e,t){r(e).push(t)},e.off=function(e,t){for(var n=r(e),o=n.length-1;o>=0;o--)t===n[o]&&n.splice(o,1)},e.emit=function(e,t){for(var n=r(e).map((function(e){return e})),o=0;o=0;r--){var o=n[r][2];(!o||o+2592e3=0;o--){var a=n[o];a[0]===e&&a[1]===t&&n.splice(o,1)}n.unshift([e,t,Math.round(Date.now()/1e3)]),n.length>r&&n.splice(r),l()}},removeUploadId:function(e){u.call(this),delete d.using[e];for(var t=n.length-1;t>=0;t--)n[t][1]===e&&n.splice(t,1);l()}};e.exports=d},function(e,t,r){var n=r(10);e.exports=n},function(e,t,r){"use strict";var n=r(1),o=r(7),a=r(26),i=r(27),s=r(29),c=r(6),u={AppId:"",SecretId:"",SecretKey:"",SecurityToken:"",ChunkRetryTimes:2,FileParallelLimit:3,ChunkParallelLimit:3,ChunkSize:1048576,SliceSize:1048576,CopyChunkParallelLimit:20,CopyChunkSize:10485760,CopySliceSize:10485760,MaxPartNumber:1e4,ProgressInterval:1e3,Domain:"",ServiceDomain:"",Protocol:"",CompatibilityMode:!1,ForcePathStyle:!1,UseRawKey:!1,Timeout:0,CorrectClockSkew:!0,SystemClockOffset:0,UploadCheckContentMd5:!1,UploadQueueSize:1e4,UploadAddMetaMd5:!1,UploadIdCacheLimit:50,UseAccelerate:!1,ForceSignHost:!0,AutoSwitchHost:!0,CopySourceParser:null,ObjectKeySimplifyCheck:!0,DeepTracker:!1,TrackerDelay:5e3,CustomId:"",BeaconReporter:null,ClsReporter:null},l=function(e){if(this.options=n.extend(n.clone(u),e||{}),this.options.FileParallelLimit=Math.max(1,this.options.FileParallelLimit),this.options.ChunkParallelLimit=Math.max(1,this.options.ChunkParallelLimit),this.options.ChunkRetryTimes=Math.max(0,this.options.ChunkRetryTimes),this.options.ChunkSize=Math.max(1048576,this.options.ChunkSize),this.options.CopyChunkParallelLimit=Math.max(1,this.options.CopyChunkParallelLimit),this.options.CopyChunkSize=Math.max(1048576,this.options.CopyChunkSize),this.options.CopySliceSize=Math.max(0,this.options.CopySliceSize),this.options.MaxPartNumber=Math.max(1024,Math.min(1e4,this.options.MaxPartNumber)),this.options.Timeout=Math.max(0,this.options.Timeout),this.options.EnableReporter=this.options.BeaconReporter||this.options.ClsReporter,this.options.AppId,this.options.SecretId&&this.options.SecretId.indexOf(" "),this.options.SecretKey&&this.options.SecretKey.indexOf(" "),n.isNode(),this.options.ForcePathStyle)throw new Error("ForcePathStyle is not supported");o.init(this),a.init(this)};i.init(l,a),s.init(l,a),l.util={md5:n.md5,xml2json:n.xml2json,json2xml:n.json2xml,encodeBase64:n.encodeBase64},l.getAuthorization=n.getAuth,l.version=c.version,e.exports=l},function(e,t){var r,n,o=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function s(e){if(r===setTimeout)return setTimeout(e,0);if((r===a||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:a}catch(e){r=a}try{n="function"==typeof clearTimeout?clearTimeout:i}catch(e){n=i}}();var c,u=[],l=!1,d=-1;function p(){l&&c&&(l=!1,c.length?u=c.concat(u):d=-1,u.length&&f())}function f(){if(!l){var e=s(p);l=!0;for(var t=u.length;t;){for(c=u,u=[];++d1)for(var r=1;r>6,s[n++]=128|63&r):r<55296||r>=57344?(s[n++]=224|r>>12,s[n++]=128|r>>6&63,s[n++]=128|63&r):(r=65536+((1023&r)<<10|1023&e.charCodeAt(++o)),s[n++]=240|r>>18,s[n++]=128|r>>12&63,s[n++]=128|r>>6&63,s[n++]=128|63&r);else for(n=this.start;o>2]|=r<>2]|=(192|r>>6)<>2]|=(128|63&r)<=57344?(i[n>>2]|=(224|r>>12)<>2]|=(128|r>>6&63)<>2]|=(128|63&r)<>2]|=(240|r>>18)<>2]|=(128|r>>12&63)<>2]|=(128|r>>6&63)<>2]|=(128|63&r)<=64?(this.start=n-64,this.hash(),this.hashed=!0):this.start=n}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296|0,this.bytes=this.bytes%4294967296),this}},v.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[t>>2]|=d[3&t],t>=56&&(this.hashed||this.hash(),e[0]=e[16],e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.bytes<<3,e[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},v.prototype.hash=function(){var e,t,r,n,o,a,i=this.blocks;this.first?t=((t=((e=((e=i[0]-680876937)<<7|e>>>25)-271733879|0)^(r=((r=(-271733879^(n=((n=(-1732584194^2004318071&e)+i[1]-117830708)<<12|n>>>20)+e|0)&(-271733879^e))+i[2]-1126478375)<<17|r>>>15)+n|0)&(n^e))+i[3]-1316259209)<<22|t>>>10)+r|0:(e=this.h0,t=this.h1,r=this.h2,t=((t+=((e=((e+=((n=this.h3)^t&(r^n))+i[0]-680876936)<<7|e>>>25)+t|0)^(r=((r+=(t^(n=((n+=(r^e&(t^r))+i[1]-389564586)<<12|n>>>20)+e|0)&(e^t))+i[2]+606105819)<<17|r>>>15)+n|0)&(n^e))+i[3]-1044525330)<<22|t>>>10)+r|0),t=((t+=((e=((e+=(n^t&(r^n))+i[4]-176418897)<<7|e>>>25)+t|0)^(r=((r+=(t^(n=((n+=(r^e&(t^r))+i[5]+1200080426)<<12|n>>>20)+e|0)&(e^t))+i[6]-1473231341)<<17|r>>>15)+n|0)&(n^e))+i[7]-45705983)<<22|t>>>10)+r|0,t=((t+=((e=((e+=(n^t&(r^n))+i[8]+1770035416)<<7|e>>>25)+t|0)^(r=((r+=(t^(n=((n+=(r^e&(t^r))+i[9]-1958414417)<<12|n>>>20)+e|0)&(e^t))+i[10]-42063)<<17|r>>>15)+n|0)&(n^e))+i[11]-1990404162)<<22|t>>>10)+r|0,t=((t+=((e=((e+=(n^t&(r^n))+i[12]+1804603682)<<7|e>>>25)+t|0)^(r=((r+=(t^(n=((n+=(r^e&(t^r))+i[13]-40341101)<<12|n>>>20)+e|0)&(e^t))+i[14]-1502002290)<<17|r>>>15)+n|0)&(n^e))+i[15]+1236535329)<<22|t>>>10)+r|0,t=((t+=((n=((n+=(t^r&((e=((e+=(r^n&(t^r))+i[1]-165796510)<<5|e>>>27)+t|0)^t))+i[6]-1069501632)<<9|n>>>23)+e|0)^e&((r=((r+=(e^t&(n^e))+i[11]+643717713)<<14|r>>>18)+n|0)^n))+i[0]-373897302)<<20|t>>>12)+r|0,t=((t+=((n=((n+=(t^r&((e=((e+=(r^n&(t^r))+i[5]-701558691)<<5|e>>>27)+t|0)^t))+i[10]+38016083)<<9|n>>>23)+e|0)^e&((r=((r+=(e^t&(n^e))+i[15]-660478335)<<14|r>>>18)+n|0)^n))+i[4]-405537848)<<20|t>>>12)+r|0,t=((t+=((n=((n+=(t^r&((e=((e+=(r^n&(t^r))+i[9]+568446438)<<5|e>>>27)+t|0)^t))+i[14]-1019803690)<<9|n>>>23)+e|0)^e&((r=((r+=(e^t&(n^e))+i[3]-187363961)<<14|r>>>18)+n|0)^n))+i[8]+1163531501)<<20|t>>>12)+r|0,t=((t+=((n=((n+=(t^r&((e=((e+=(r^n&(t^r))+i[13]-1444681467)<<5|e>>>27)+t|0)^t))+i[2]-51403784)<<9|n>>>23)+e|0)^e&((r=((r+=(e^t&(n^e))+i[7]+1735328473)<<14|r>>>18)+n|0)^n))+i[12]-1926607734)<<20|t>>>12)+r|0,t=((t+=((a=(n=((n+=((o=t^r)^(e=((e+=(o^n)+i[5]-378558)<<4|e>>>28)+t|0))+i[8]-2022574463)<<11|n>>>21)+e|0)^e)^(r=((r+=(a^t)+i[11]+1839030562)<<16|r>>>16)+n|0))+i[14]-35309556)<<23|t>>>9)+r|0,t=((t+=((a=(n=((n+=((o=t^r)^(e=((e+=(o^n)+i[1]-1530992060)<<4|e>>>28)+t|0))+i[4]+1272893353)<<11|n>>>21)+e|0)^e)^(r=((r+=(a^t)+i[7]-155497632)<<16|r>>>16)+n|0))+i[10]-1094730640)<<23|t>>>9)+r|0,t=((t+=((a=(n=((n+=((o=t^r)^(e=((e+=(o^n)+i[13]+681279174)<<4|e>>>28)+t|0))+i[0]-358537222)<<11|n>>>21)+e|0)^e)^(r=((r+=(a^t)+i[3]-722521979)<<16|r>>>16)+n|0))+i[6]+76029189)<<23|t>>>9)+r|0,t=((t+=((a=(n=((n+=((o=t^r)^(e=((e+=(o^n)+i[9]-640364487)<<4|e>>>28)+t|0))+i[12]-421815835)<<11|n>>>21)+e|0)^e)^(r=((r+=(a^t)+i[15]+530742520)<<16|r>>>16)+n|0))+i[2]-995338651)<<23|t>>>9)+r|0,t=((t+=((n=((n+=(t^((e=((e+=(r^(t|~n))+i[0]-198630844)<<6|e>>>26)+t|0)|~r))+i[7]+1126891415)<<10|n>>>22)+e|0)^((r=((r+=(e^(n|~t))+i[14]-1416354905)<<15|r>>>17)+n|0)|~e))+i[5]-57434055)<<21|t>>>11)+r|0,t=((t+=((n=((n+=(t^((e=((e+=(r^(t|~n))+i[12]+1700485571)<<6|e>>>26)+t|0)|~r))+i[3]-1894986606)<<10|n>>>22)+e|0)^((r=((r+=(e^(n|~t))+i[10]-1051523)<<15|r>>>17)+n|0)|~e))+i[1]-2054922799)<<21|t>>>11)+r|0,t=((t+=((n=((n+=(t^((e=((e+=(r^(t|~n))+i[8]+1873313359)<<6|e>>>26)+t|0)|~r))+i[15]-30611744)<<10|n>>>22)+e|0)^((r=((r+=(e^(n|~t))+i[6]-1560198380)<<15|r>>>17)+n|0)|~e))+i[13]+1309151649)<<21|t>>>11)+r|0,t=((t+=((n=((n+=(t^((e=((e+=(r^(t|~n))+i[4]-145523070)<<6|e>>>26)+t|0)|~r))+i[11]-1120210379)<<10|n>>>22)+e|0)^((r=((r+=(e^(n|~t))+i[2]+718787259)<<15|r>>>17)+n|0)|~e))+i[9]-343485551)<<21|t>>>11)+r|0,this.first?(this.h0=e+1732584193|0,this.h1=t-271733879|0,this.h2=r-1732584194|0,this.h3=n+271733878|0,this.first=!1):(this.h0=this.h0+e|0,this.h1=this.h1+t|0,this.h2=this.h2+r|0,this.h3=this.h3+n|0)},v.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,n=this.h3;return l[e>>4&15]+l[15&e]+l[e>>12&15]+l[e>>8&15]+l[e>>20&15]+l[e>>16&15]+l[e>>28&15]+l[e>>24&15]+l[t>>4&15]+l[15&t]+l[t>>12&15]+l[t>>8&15]+l[t>>20&15]+l[t>>16&15]+l[t>>28&15]+l[t>>24&15]+l[r>>4&15]+l[15&r]+l[r>>12&15]+l[r>>8&15]+l[r>>20&15]+l[r>>16&15]+l[r>>28&15]+l[r>>24&15]+l[n>>4&15]+l[15&n]+l[n>>12&15]+l[n>>8&15]+l[n>>20&15]+l[n>>16&15]+l[n>>28&15]+l[n>>24&15]},v.prototype.toString=v.prototype.hex,v.prototype.digest=function(e){if("hex"===e)return this.hex();this.finalize();var t=this.h0,r=this.h1,n=this.h2,o=this.h3;return[255&t,t>>8&255,t>>16&255,t>>24&255,255&r,r>>8&255,r>>16&255,r>>24&255,255&n,n>>8&255,n>>16&255,n>>24&255,255&o,o>>8&255,o>>16&255,o>>24&255]},v.prototype.array=v.prototype.digest,v.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(16),t=new Uint32Array(e);return t[0]=this.h0,t[1]=this.h1,t[2]=this.h2,t[3]=this.h3,e},v.prototype.buffer=v.prototype.arrayBuffer,v.prototype.base64=function(){for(var e,t,r,n="",o=this.array(),a=0;a<15;)e=o[a++],t=o[a++],r=o[a++],n+=h[e>>>2]+h[63&(e<<4|t>>>4)]+h[63&(t<<2|r>>>6)]+h[63&r];return e=o[a],n+=h[e>>>2]+h[e<<4&63]+"=="};var k=function(){var e=y("hex");e.getCtx=e.create=function(){return new v},e.update=function(t){return e.create().update(t)};for(var t=0;t>>2]|=(r[o>>>2]>>>24-o%4*8&255)<<24-(n+o)%4*8;else if(65535>>2]=r[o>>>2];else t.push.apply(t,r);return this.sigBytes+=e,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=a.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var r=[],n=0;n>>2]>>>24-n%4*8&255;r.push((o>>>4).toString(16)),r.push((15&o).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new i.init(r,t/2)}},u=s.Latin1={stringify:function(e){var t=e.words;e=e.sigBytes;for(var r=[],n=0;n>>2]>>>24-n%4*8&255));return r.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new i.init(r,t)}},l=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(u.stringify(e)))}catch(e){throw Error("Malformed UTF-8 data")}},parse:function(e){return u.parse(unescape(encodeURIComponent(e)))}},d=n.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new i.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=l.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var r=this._data,n=r.words,o=r.sigBytes,a=this.blockSize,s=o/(4*a);if(t=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*a,o=e.min(4*t,o),t){for(var c=0;cu;u++){if(16>u)a[u]=0|e[t+u];else{var l=a[u-3]^a[u-8]^a[u-14]^a[u-16];a[u]=l<<1|l>>>31}l=(n<<5|n>>>27)+c+a[u],l=20>u?l+(1518500249+(o&i|~o&s)):40>u?l+(1859775393+(o^i^s)):60>u?l+((o&i|o&s|i&s)-1894007588):l+((o^i^s)-899497514),c=s,s=i,i=o<<30|o>>>2,o=n,n=l}r[0]=r[0]+n|0,r[1]=r[1]+o|0,r[2]=r[2]+i|0,r[3]=r[3]+s|0,r[4]=r[4]+c|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),t[15+(n+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}}),t.SHA1=o._createHelper(i),t.HmacSHA1=o._createHmacHelper(i),function(){var e=l,t=e.enc.Utf8;e.algo.HMAC=e.lib.Base.extend({init:function(e,r){e=this._hasher=new e.init,"string"==typeof r&&(r=t.parse(r));var n=e.blockSize,o=4*n;r.sigBytes>o&&(r=e.finalize(r)),r.clamp();for(var a=this._oKey=r.clone(),i=this._iKey=r.clone(),s=a.words,c=i.words,u=0;u>>2]>>>24-a%4*8&255)<<16|(t[a+1>>>2]>>>24-(a+1)%4*8&255)<<8|t[a+2>>>2]>>>24-(a+2)%4*8&255,s=0;s<4&&a+.75*s>>6*(3-s)&63));var c=n.charAt(64);if(c)for(;o.length%4;)o.push(c);return o.join("")},parse:function(e){var t=e.length,r=this._map,n=r.charAt(64);if(n){var o=e.indexOf(n);-1!=o&&(t=o)}for(var a=[],i=0,s=0;s>>6-s%4*2;a[i>>>2]|=(u|l)<<24-i%4*8,i++}return c.create(a,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},"object"===u(e)?e.exports=l:window.CryptoJS=l}).call(this,r(3)(e))},function(e,t,r){var n=r(16).DOMParser,o=function(){this.version="1.3.5";var e={mergeCDATA:!0,normalize:!0,stripElemPrefix:!0},t=new RegExp(/(?!xmlns)^.*:/);new RegExp(/^\s+|\s+$/g);return this.grokType=function(e){return/^\s*$/.test(e)?null:/^(?:true|false)$/i.test(e)?"true"===e.toLowerCase():isFinite(e)?parseFloat(e):e},this.parseString=function(e,t){if(e){var r=this.stringToXML(e);return r.getElementsByTagName("parsererror").length?null:this.parseXML(r,t)}return null},this.parseXML=function(r,n){for(var a in n)e[a]=n[a];var i={},s=0,c="";if(r.childNodes.length)for(var u,l,d,p=0;p=t+r||t?new java.lang.String(e,t,r)+"":e}function m(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}p.prototype.parseFromString=function(e,t){var r=this.options,n=new l,o=r.domBuilder||new f,i=r.errorHandler,s=r.locator,u=r.xmlns||{},p=/\/x?html?$/.test(t),h=p?a.HTML_ENTITIES:a.XML_ENTITIES;s&&o.setDocumentLocator(s),n.errorHandler=function(e,t,r){if(!e){if(t instanceof f)return t;e=t}var n={},o=e instanceof Function;function a(t){var a=e[t];!a&&o&&(a=2==e.length?function(r){e(t,r)}:e),n[t]=a&&function(e){a("[xmldom "+t+"]\t"+e+function(e){if(e)return"\n@"+(e.systemId||"")+"#[line:"+e.lineNumber+",col:"+e.columnNumber+"]"}(r))}||function(){}}return r=r||{},a("warning"),a("error"),a("fatalError"),n}(i,o,s),n.domBuilder=r.domBuilder||o,p&&(u[""]=c.HTML),u.xml=u.xml||c.XML;var g=r.normalizeLineEndings||d;return e&&"string"==typeof e?n.parse(g(e),u,h):n.errorHandler.error("invalid doc source"),o.doc},f.prototype={startDocument:function(){this.doc=(new s).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,r,n){var o=this.doc,a=o.createElementNS(e,r||t),i=n.length;m(this,a),this.currentElement=a,this.locator&&h(this.locator,a);for(var s=0;s",lt:"<",quot:'"'}),t.HTML_ENTITIES=n({Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",Gt:"≫",GT:">",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",Lt:"≪",LT:"<",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:"\t",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"}),t.entityMap=t.HTML_ENTITIES},function(e,t,r){var n=r(2).NAMESPACE,o=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,a=new RegExp("[\\-\\.0-9"+o.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),i=new RegExp("^"+o.source+a.source+"*(?::"+o.source+a.source+"*)?$"),s=0,c=1,u=2,l=3,d=4,p=5,f=6,h=7;function g(e,t){this.message=e,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,g)}function m(){}function y(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function v(e,t,r,o,a,i){function g(e,t,n){r.attributeNames.hasOwnProperty(e)&&i.fatalError("Attribute "+e+" redefined"),r.addValue(e,t.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,a),n)}for(var m,y=++t,v=s;;){var k=e.charAt(y);switch(k){case"=":if(v===c)m=e.slice(t,y),v=l;else{if(v!==u)throw new Error("attribute equal must after attrName");v=l}break;case"'":case'"':if(v===l||v===c){if(v===c&&(i.warning('attribute value must after "="'),m=e.slice(t,y)),t=y+1,!((y=e.indexOf(k,t))>0))throw new Error("attribute value no end '"+k+"' match");g(m,C=e.slice(t,y),t-1),v=p}else{if(v!=d)throw new Error('attribute value must after "="');g(m,C=e.slice(t,y),t),i.warning('attribute "'+m+'" missed start quot('+k+")!!"),t=y+1,v=p}break;case"/":switch(v){case s:r.setTagName(e.slice(t,y));case p:case f:case h:v=h,r.closed=!0;case d:case c:break;case u:r.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return i.error("unexpected end of input"),v==s&&r.setTagName(e.slice(t,y)),y;case">":switch(v){case s:r.setTagName(e.slice(t,y));case p:case f:case h:break;case d:case c:"/"===(C=e.slice(t,y)).slice(-1)&&(r.closed=!0,C=C.slice(0,-1));case u:v===u&&(C=m),v==d?(i.warning('attribute "'+C+'" missed quot(")!'),g(m,C,t)):(n.isHTML(o[""])&&C.match(/^(?:disabled|checked|selected)$/i)||i.warning('attribute "'+C+'" missed value!! "'+C+'" instead!!'),g(C,C,t));break;case l:throw new Error("attribute value missed!!")}return y;case"€":k=" ";default:if(k<=" ")switch(v){case s:r.setTagName(e.slice(t,y)),v=f;break;case c:m=e.slice(t,y),v=u;break;case d:var C=e.slice(t,y);i.warning('attribute "'+C+'" missed quot(")!!'),g(m,C,t);case p:v=f}else switch(v){case u:r.tagName;n.isHTML(o[""])&&m.match(/^(?:disabled|checked|selected)$/i)||i.warning('attribute "'+m+'" missed value!! "'+m+'" instead2!!'),g(m,m,t),t=y,v=c;break;case p:i.warning('attribute space is required"'+m+'"!!');case f:v=c,t=y;break;case l:v=d,t=y;break;case h:throw new Error("elements closed character '/' and '>' must be connected to")}}y++}}function k(e,t,r){for(var o=e.tagName,a=null,i=e.length;i--;){var s=e[i],c=s.qName,u=s.value;if((f=c.indexOf(":"))>0)var l=s.prefix=c.slice(0,f),d=c.slice(f+1),p="xmlns"===l&&d;else d=c,l=null,p="xmlns"===c&&"";s.localName=d,!1!==p&&(null==a&&(a={},S(r,r={})),r[p]=a[p]=u,s.uri=n.XMLNS,t.startPrefixMapping(p,u))}for(i=e.length;i--;){(l=(s=e[i]).prefix)&&("xml"===l&&(s.uri=n.XML),"xmlns"!==l&&(s.uri=r[l||""]))}var f;(f=o.indexOf(":"))>0?(l=e.prefix=o.slice(0,f),d=e.localName=o.slice(f+1)):(l=null,d=e.localName=o);var h=e.uri=r[l||""];if(t.startElement(h,d,o,e),!e.closed)return e.currentNSMap=r,e.localNSMap=a,!0;if(t.endElement(h,d,o),a)for(l in a)Object.prototype.hasOwnProperty.call(a,l)&&t.endPrefixMapping(l)}function C(e,t,r,n,o){if(/^(?:script|textarea)$/i.test(r)){var a=e.indexOf("",t),i=e.substring(t+1,a);if(/[&<]/.test(i))return/^script$/i.test(r)?(o.characters(i,0,i.length),a):(i=i.replace(/&#?\w+;/g,n),o.characters(i,0,i.length),a)}return t+1}function b(e,t,r,n){var o=n[r];return null==o&&((o=e.lastIndexOf(""))t?(r.comment(e,t+4,o-t-4),o+3):(n.error("Unclosed comment"),-1):-1;if("CDATA["==e.substr(t+3,6)){var o=e.indexOf("]]>",t+9);return r.startCDATA(),r.characters(e,t+9,o-t-9),r.endCDATA(),o+3}var a=function(e,t){var r,n=[],o=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;o.lastIndex=t,o.exec(e);for(;r=o.exec(e);)if(n.push(r),r[1])return n}(e,t),i=a.length;if(i>1&&/!doctype/i.test(a[0][0])){var s=a[1][0],c=!1,u=!1;i>3&&(/^public$/i.test(a[2][0])?(c=a[3][0],u=i>4&&a[4][0]):/^system$/i.test(a[2][0])&&(u=a[3][0]));var l=a[i-1];return r.startDTD(s,c,u),r.endDTD(),l.index+l[0].length}return-1}function w(e,t,r){var n=e.indexOf("?>",t);if(n){var o=e.substring(t,n).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(o){o[0].length;return r.processingInstruction(o[1],o[2]),n+2}return-1}return-1}function R(){this.attributeNames={}}g.prototype=new Error,g.prototype.name=g.name,m.prototype={parse:function(e,t,r){var o=this.domBuilder;o.startDocument(),S(t,t={}),function(e,t,r,o,a){function i(e){if(e>65535){var t=55296+((e-=65536)>>10),r=56320+(1023&e);return String.fromCharCode(t,r)}return String.fromCharCode(e)}function s(e){var t=e.slice(1,-1);return Object.hasOwnProperty.call(r,t)?r[t]:"#"===t.charAt(0)?i(parseInt(t.substr(1).replace("x","0x"))):(a.error("entity not found:"+e),e)}function c(t){if(t>S){var r=e.substring(S,t).replace(/&#?\w+;/g,s);f&&u(S),o.characters(r,0,t-S),S=t}}function u(t,r){for(;t>=d&&(r=p.exec(e));)l=r.index,d=l+r[0].length,f.lineNumber++;f.columnNumber=t-l+1}var l=0,d=0,p=/.*(?:\r\n?|\n)|.*$/g,f=o.locator,h=[{currentNSMap:t}],m={},S=0;for(;;){try{var x=e.indexOf("<",S);if(x<0){if(!e.substr(S).match(/^\s*$/)){var A=o.doc,E=A.createTextNode(e.substr(S));A.appendChild(E),o.currentElement=E}return}switch(x>S&&c(x),e.charAt(x+1)){case"/":var B=e.indexOf(">",x+3),D=e.substring(x+2,B).replace(/[ \t\n\r]+$/g,""),N=h.pop();B<0?(D=e.substring(x+2).replace(/[\s<].*/,""),a.error("end tag name: "+D+" is not complete:"+N.tagName),B=x+1+D.length):D.match(/\sS?S=B:c(Math.max(x,S)+1)}}(e,t,r,o,this.errorHandler),o.endDocument()}},R.prototype={setTagName:function(e){if(!i.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},addValue:function(e,t,r){if(!i.test(e))throw new Error("invalid attribute:"+e);this.attributeNames[e]=this.length,this[this.length++]={qName:e,value:t,offset:r}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}},t.XMLReader=m,t.ParseError=g},function(e,t,r){var n=r(0),o="a-zA-Z_À-ÖØ-öø-ÿͰ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿿、-퟿豈-﷏ﷰ-�",a=new RegExp("^([^"+o+"])|^((x|X)(m|M)(l|L))|([^"+o+"-.0-9·̀-ͯ‿⁀])","g"),i=/[^\x09\x0A\x0D\x20-\xFF\x85\xA0-\uD7FF\uE000-\uFDCF\uFDE0-\uFFFD]/gm,s=function(e){var t=[];if(e instanceof Object)for(var r in e)e.hasOwnProperty(r)&&t.push(r);return t},c=function(e,t){var r=function(e,r,n,o,i){var s=void 0!==t.indent?t.indent:"\t",c=t.prettyPrint?"\n"+new Array(o).join(s):"";t.removeIllegalNameCharacters&&(e=e.replace(a,"_"));var u=[c,"<",e,n||""];return r&&r.length>0?(u.push(">"),u.push(r),i&&u.push(c),u.push("")):u.push("/>"),u.join("")};return function e(o,a,c){var u=n(o);switch((Array.isArray?Array.isArray(o):o instanceof Array)?u="array":o instanceof Date&&(u="date"),u){case"array":var l=[];return o.map((function(t){l.push(e(t,1,c+1))})),t.prettyPrint&&l.push("\n"),l.join("");case"date":return o.toJSON?o.toJSON():o+"";case"object":var d=[];for(var p in o)if(o.hasOwnProperty(p))if(o[p]instanceof Array)for(var f=0;f0&&d.push("\n"),d.join("");case"function":return o();default:return t.escape?(""+o).replace(/&/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""").replace(i,""):""+o}}(e,0,0)},u=function(e){var t=['"),t.join("")};e.exports=function(e,t){if(t||(t={xmlHeader:{standalone:!0},prettyPrint:!0,indent:" ",escape:!0}),"string"==typeof e)try{e=JSON.parse(e.toString())}catch(e){return!1}var r="",o="";return t&&("object"==n(t)?(t.xmlHeader&&(r=u(!!t.xmlHeader.standalone)),void 0!==t.docType&&(o="")):r=u()),[r,(t=t||{}).prettyPrint&&o?"\n":"",o,c(e,t)].join("").replace(/\n{2,}/g,"\n").replace(/\s+$/g,"")}},function(e,t){var r=function(e){var t=(e=e||{}).Base64,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=function(e){for(var t={},r=0,n=e.length;r>>6)+o(128|63&t):o(224|t>>>12&15)+o(128|t>>>6&63)+o(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return o(240|t>>>18&7)+o(128|t>>>12&63)+o(128|t>>>6&63)+o(128|63&t)},i=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,s=function(e){return e.replace(i,a)},c=function(e){var t=[0,2,1][e.length%3],n=e.charCodeAt(0)<<16|(e.length>1?e.charCodeAt(1):0)<<8|(e.length>2?e.charCodeAt(2):0);return[r.charAt(n>>>18),r.charAt(n>>>12&63),t>=2?"=":r.charAt(n>>>6&63),t>=1?"=":r.charAt(63&n)].join("")},u=e.btoa?function(t){return e.btoa(t)}:function(e){return e.replace(/[\s\S]{1,3}/g,c)},l=function(e){return u(s(e))},d=function(e,t){return t?l(String(e)).replace(/[+\/]/g,(function(e){return"+"==e?"-":"_"})).replace(/=/g,""):l(String(e))},p=new RegExp(["[À-ß][€-¿]","[à-ï][€-¿]{2}","[ð-÷][€-¿]{3}"].join("|"),"g"),f=function(e){switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return o(55296+(t>>>10))+o(56320+(1023&t));case 3:return o((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return o((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},h=function(e){return e.replace(p,f)},g=function(e){var t=e.length,r=t%4,a=(t>0?n[e.charAt(0)]<<18:0)|(t>1?n[e.charAt(1)]<<12:0)|(t>2?n[e.charAt(2)]<<6:0)|(t>3?n[e.charAt(3)]:0),i=[o(a>>>16),o(a>>>8&255),o(255&a)];return i.length-=[0,0,2,1][r],i.join("")},m=e.atob?function(t){return e.atob(t)}:function(e){return e.replace(/[\s\S]{1,4}/g,g)},y=function(e){return h(m(e))},v=function(e){return y(String(e).replace(/[-_]/g,(function(e){return"-"==e?"+":"/"})).replace(/[^A-Za-z0-9\+\/]/g,""))};return{VERSION:"2.1.9",atob:m,btoa:u,fromBase64:v,toBase64:d,utob:s,encode:d,encodeURI:function(e){return d(e,!0)},btou:h,decode:v,noConflict:function(){var r=e.Base64;return e.Base64=t,r}}}();e.exports=r},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){var n=r(24);function o(e,t){for(var r=0;re.options.UploadQueueSize;){var r="waiting"===i[t].state||"checking"===i[t].state||"uploading"===i[t].state;i[t]&&r?t++:(s[i[t].id]&&delete s[i[t].id],i.splice(t,1),u--)}d()}},f=function t(){if(!(c>=e.options.FileParallelLimit)){for(;i[u]&&"waiting"!==i[u].state;)u++;if(!(u>=i.length)){var r=i[u];u++,c++,r.state="checking",r.params.onTaskStart&&r.params.onTaskStart(l(r)),!r.params.UploadData&&(r.params.UploadData={});var n=o.formatParams(r.api,r.params);a[r.api].call(e,n,(function(n,o){e._isRunningTask(r.id)&&("checking"!==r.state&&"uploading"!==r.state||(r.state=n?"error":"success",n&&(r.error=n),c--,d(),t(),r.callback&&r.callback(n,o),"success"===r.state&&(r.params&&(delete r.params.UploadData,delete r.params.Body,delete r.params),delete r.callback)),p())})),d(),setTimeout(t)}}},h=function(t,r){var o=s[t];if(o){var a=o&&"waiting"===o.state,i=o&&("checking"===o.state||"uploading"===o.state);if("canceled"===r&&"canceled"!==o.state||"paused"===r&&a||"paused"===r&&i){o.state=r,e.emit("inner-kill-task",{TaskId:t,toState:r});try{var u=o&&o.params&&o.params.UploadData.UploadId}catch(e){}"canceled"===r&&u&&n.removeUsing(u),d(),i&&(c--,f()),"canceled"===r&&(o.params&&(delete o.params.UploadData,delete o.params.Body,delete o.params),delete o.callback)}p()}};e._addTasks=function(t){o.each(t,(function(t){e._addTask(t.api,t.params,t.callback,!0)})),d()};e._addTask=function(t,r,n,a){r=o.formatParams(t,r);var c=o.uuid();r.TaskId=c,r.onTaskReady&&r.onTaskReady(c),r.TaskReady&&(r.TaskReady(c),!1);var u={params:r,callback:n,api:t,index:i.length,id:c,Bucket:r.Bucket,Region:r.Region,Key:r.Key,FilePath:r.FilePath||"",state:"waiting",loaded:0,size:0,speed:0,percent:0,hashPercent:0,error:null,_custom:r._custom},l=r.onHashProgress;r.onHashProgress=function(t){e._isRunningTask(u.id)&&(u.hashPercent=t.percent,l&&l(t),d())};var h=r.onProgress;return r.onProgress=function(t){e._isRunningTask(u.id)&&("checking"===u.state&&(u.state="uploading"),u.loaded=t.loaded,u.speed=t.speed,u.percent=t.percent,h&&h(t),d())},o.getFileSize(t,r,(function(e,t){if(e)return n(o.error(e));s[c]=u,i.push(u),u.size=t,!a&&d(),f(),p()})),c},e._isRunningTask=function(e){var t=s[e];return!(!t||"checking"!==t.state&&"uploading"!==t.state)},e.getTaskList=function(){return o.map(i,l)},e.cancelTask=function(e){h(e,"canceled")},e.pauseTask=function(e){h(e,"paused")},e.restartTask=function(e){var t=s[e];!t||"paused"!==t.state&&"error"!==t.state||(t.state="waiting",d(),u=Math.min(u,t.index),f())},e.isUploadRunning=function(){return c||u-1&&(i["SSE-COS"]=i.SSECOS,delete i.SSECOS)}var s=a.json2xml({InventoryConfiguration:n}),c=t.Headers;c["Content-Type"]="application/xml",c["Content-MD5"]=a.b64(a.md5(s));var u="PUT"===e?"name/cos:PutBucketInventory":"name/cos:PostBucketInventory";h.call(this,{Action:u,method:e,Bucket:t.Bucket,Region:t.Region,body:s,action:"inventory",qs:{id:t.Id},headers:c,tracker:t.tracker},(function(e,t){return e&&204===e.statusCode?r(null,{statusCode:e.statusCode}):e?r(e):void r(null,{statusCode:t.statusCode,headers:t.headers})}))}function s(e){var t={GrantFullControl:[],GrantWrite:[],GrantRead:[],GrantReadAcp:[],GrantWriteAcp:[],ACL:""},r={FULL_CONTROL:"GrantFullControl",WRITE:"GrantWrite",READ:"GrantRead",READ_ACP:"GrantReadAcp",WRITE_ACP:"GrantWriteAcp"},n=(e&&e.AccessControlList||{}).Grant;n&&(n=a.isArray(n)?n:[n]);var o={READ:0,WRITE:0,FULL_CONTROL:0};return n&&n.length&&a.each(n,(function(n){"qcs::cam::anyone:anyone"===n.Grantee.ID||"http://cam.qcloud.com/groups/global/AllUsers"===n.Grantee.URI?o[n.Permission]=1:n.Grantee.ID!==e.Owner.ID&&t[r[n.Permission]].push('id="'+n.Grantee.ID+'"')})),o.FULL_CONTROL||o.WRITE&&o.READ?t.ACL="public-read-write":o.READ?t.ACL="public-read":t.ACL="private",a.each(r,(function(e){t[e]=c(t[e].join(","))})),t}function c(e){var t,r,n=e.split(","),o={};for(t=0;t-1?"{Region}.myqcloud.com":"cos.{Region}.myqcloud.com",e.ForcePathStyle||(s="{Bucket}."+s)),s=(s=s.replace(/\{\{AppId\}\}/gi,i).replace(/\{\{Bucket\}\}/gi,o).replace(/\{\{Region\}\}/gi,t).replace(/\{\{.*?\}\}/gi,"")).replace(/\{AppId\}/gi,i).replace(/\{BucketName\}/gi,o).replace(/\{Bucket\}/gi,r).replace(/\{Region\}/gi,t).replace(/\{.*?\}/gi,""),/^[a-zA-Z]+:\/\//.test(s)||(s=u+"//"+s),"/"===s.slice(-1)&&(s=s.slice(0,-1));var l=s;return e.ForcePathStyle&&(l+="/"+r),l+="/",c&&(l+=a.camSafeUrlEncode(c).replace(/%2F/g,"/")),e.isLocation&&(l=l.replace(/^https?:\/\//,"")),l}var l=function(e){if(!e.Bucket||!e.Region)return"";var t=void 0===e.UseAccelerate?this.options.UseAccelerate:e.UseAccelerate;return(e.Url||u({ForcePathStyle:this.options.ForcePathStyle,protocol:this.options.Protocol,domain:this.options.Domain,bucket:e.Bucket,region:t?"accelerate":e.Region})).replace(/^https?:\/\/([^/]+)(\/.*)?$/,"$1")};function d(e,t){var r=a.clone(e.Headers),n="";a.each(r,(function(e,t){(""===e||["content-type","cache-control","expires"].indexOf(t.toLowerCase())>-1)&&delete r[t],"host"===t.toLowerCase()&&(n=e)}));var o=!1!==e.ForceSignHost;!n&&e.SignHost&&o&&(r.Host=e.SignHost);var i=!1,s=function(e,r){i||(i=!0,r&&r.XCosSecurityToken&&!r.SecurityToken&&((r=a.clone(r)).SecurityToken=r.XCosSecurityToken,delete r.XCosSecurityToken),t&&t(e,r))},c=this,u=e.Bucket||"",l=e.Region||"",d=e.Key||"";c.options.ForcePathStyle&&u&&(d=u+"/"+d);var p="/"+d,f={},h=e.Scope;if(!h){var g=e.Action||"",m=e.ResourceKey||e.Key||"";h=e.Scope||[{action:g,bucket:u,region:l,prefix:m}]}var y=a.md5(JSON.stringify(h));c._StsCache=c._StsCache||[],function(){var e,t;for(e=c._StsCache.length-1;e>=0;e--){t=c._StsCache[e];var r=Math.round(a.getSkewTime(c.options.SystemClockOffset)/1e3)+30;if(t.StartTime&&r=t.ExpiredTime)c._StsCache.splice(e,1);else if(!t.ScopeLimit||t.ScopeLimit&&t.ScopeKey===y){f=t;break}}}();var v,k=function(){var t="";f.StartTime&&e.Expires?t=f.StartTime+";"+(f.StartTime+1*e.Expires):f.StartTime&&f.ExpiredTime&&(t=f.StartTime+";"+f.ExpiredTime);var n={Authorization:a.getAuth({SecretId:f.TmpSecretId,SecretKey:f.TmpSecretKey,Method:e.Method,Pathname:p,Query:e.Query,Headers:r,Expires:e.Expires,UseRawKey:c.options.UseRawKey,SystemClockOffset:c.options.SystemClockOffset,KeyTime:t,ForceSignHost:o}),SecurityToken:f.SecurityToken||f.XCosSecurityToken||"",Token:f.Token||"",ClientIP:f.ClientIP||"",ClientUA:f.ClientUA||"",SignFrom:"client"};s(null,n)},C=function(e){if(e.Authorization){var t=!1,r=e.Authorization;if(r)if(r.indexOf(" ")>-1)t=!1;else if(r.indexOf("q-sign-algorithm=")>-1&&r.indexOf("q-ak=")>-1&&r.indexOf("q-sign-time=")>-1&&r.indexOf("q-key-time=")>-1&&r.indexOf("q-url-param-list=")>-1)t=!0;else try{(r=atob(r)).indexOf("a=")>-1&&r.indexOf("k=")>-1&&r.indexOf("t=")>-1&&r.indexOf("r=")>-1&&r.indexOf("b=")>-1&&(t=!0)}catch(e){}if(!t)return a.error(new Error("getAuthorization callback params format error"))}else{if(!e.TmpSecretId)return a.error(new Error('getAuthorization callback params missing "TmpSecretId"'));if(!e.TmpSecretKey)return a.error(new Error('getAuthorization callback params missing "TmpSecretKey"'));if(!e.SecurityToken&&!e.XCosSecurityToken)return a.error(new Error('getAuthorization callback params missing "SecurityToken"'));if(!e.ExpiredTime)return a.error(new Error('getAuthorization callback params missing "ExpiredTime"'));if(e.ExpiredTime&&10!==e.ExpiredTime.toString().length)return a.error(new Error('getAuthorization callback params "ExpiredTime" should be 10 digits'));if(e.StartTime&&10!==e.StartTime.toString().length)return a.error(new Error('getAuthorization callback params "StartTime" should be 10 StartTime'))}return!1};if(f.ExpiredTime&&f.ExpiredTime-a.getSkewTime(c.options.SystemClockOffset)/1e3>60)k();else if(c.options.getAuthorization)c.options.getAuthorization.call(c,{Bucket:u,Region:l,Method:e.Method,Key:d,Pathname:p,Query:e.Query,Headers:r,Scope:h,SystemClockOffset:c.options.SystemClockOffset,ForceSignHost:o},(function(e){"string"==typeof e&&(e={Authorization:e});var t=C(e);if(t)return s(t);e.Authorization?s(null,e):((f=e||{}).Scope=h,f.ScopeKey=y,c._StsCache.push(f),k())}));else{if(!c.options.getSTS)return v={Authorization:a.getAuth({SecretId:e.SecretId||c.options.SecretId,SecretKey:e.SecretKey||c.options.SecretKey,Method:e.Method,Pathname:p,Query:e.Query,Headers:r,Expires:e.Expires,UseRawKey:c.options.UseRawKey,SystemClockOffset:c.options.SystemClockOffset,ForceSignHost:o}),SecurityToken:c.options.SecurityToken||c.options.XCosSecurityToken,SignFrom:"client"},s(null,v),v;c.options.getSTS.call(c,{Bucket:u,Region:l},(function(e){(f=e||{}).Scope=h,f.ScopeKey=y,f.TmpSecretId||(f.TmpSecretId=f.SecretId),f.TmpSecretKey||(f.TmpSecretKey=f.SecretKey);var t=C(f);if(t)return s(t);c._StsCache.push(f),k()}))}return""}function p(e){var t=!1,r=!1,n=!1,o=e.headers&&(e.headers.date||e.headers.Date)||e.error&&e.error.ServerTime;try{var i=e.error.Code,s=e.error.Message;("RequestTimeTooSkewed"===i||"AccessDenied"===i&&"Request has expired"===s)&&(r=!0)}catch(e){}if(e)if(r&&o){var c=Date.parse(o);this.options.CorrectClockSkew&&Math.abs(a.getSkewTime(this.options.SystemClockOffset)-c)>=3e4&&(this.options.SystemClockOffset=c-Date.now(),t=!0)}else 5===Math.floor(e.statusCode/100)?t=!0:"CORS blocked or network error"===e.message&&(n=!0,t=this.options.AutoSwitchHost);return{canRetry:t,networkError:n}}function f(e){var t=e.requestUrl,r=e.clientCalcSign,n=e.networkError;if(!this.options.AutoSwitchHost)return!1;if(!t)return!1;if(!r)return!1;if(!n)return!1;return/^https?:\/\/[^\/]*\.cos\.[^\/]*\.myqcloud\.com(\/.*)?$/.test(t)&&!/^https?:\/\/[^\/]*\.cos\.accelerate\.myqcloud\.com(\/.*)?$/.test(t)}function h(e,t){var r=this;!e.headers&&(e.headers={}),!e.qs&&(e.qs={}),e.VersionId&&(e.qs.versionId=e.VersionId),e.qs=a.clearKey(e.qs),e.headers&&(e.headers=a.clearKey(e.headers)),e.qs&&(e.qs=a.clearKey(e.qs));var n=a.clone(e.qs);e.action&&(n[e.action]="");var o=e.url||e.Url,i=e.SignHost||l.call(this,{Bucket:e.Bucket,Region:e.Region,Url:o}),s=e.tracker;!function o(a){var c=r.options.SystemClockOffset;s&&s.setParams({signStartTime:(new Date).getTime(),httpRetryTimes:a-1}),e.SwitchHost&&(i=i.replace(/myqcloud.com/,"tencentcos.cn")),d.call(r,{Bucket:e.Bucket||"",Region:e.Region||"",Method:e.method,Key:e.Key,Query:n,Headers:e.headers,SignHost:i,Action:e.Action,ResourceKey:e.ResourceKey,Scope:e.Scope,ForceSignHost:r.options.ForceSignHost,SwitchHost:e.SwitchHost},(function(n,i){n?t(n):(s&&s.setParams({signEndTime:(new Date).getTime(),httpStartTime:(new Date).getTime()}),e.AuthData=i,g.call(r,e,(function(n,u){s&&s.setParams({httpEndTime:(new Date).getTime()});var l=!1,d=!1;if(n){var h=p.call(r,n);l=h.canRetry||c!==r.options.SystemClockOffset,d=h.networkError}if(n&&a<2&&l){e.headers&&(delete e.headers.Authorization,delete e.headers.token,delete e.headers.clientIP,delete e.headers.clientUA,e.headers["x-cos-security-token"]&&delete e.headers["x-cos-security-token"],e.headers["x-ci-security-token"]&&delete e.headers["x-ci-security-token"]);var g=f.call(r,{requestUrl:(null==n?void 0:n.url)||"",clientCalcSign:"client"===i.SignFrom,networkError:d});e.SwitchHost=g,o(a+1)}else t(n,u)})))}))}(1)}function g(e,t){var r=this,n=e.TaskId;if(!n||r._isRunningTask(n)){var i=e.Bucket,s=e.Region,c=e.Key,l=e.method||"GET",d=e.Url||e.url,p=e.body,f=e.rawBody;r.options.UseAccelerate&&(s="accelerate"),d=d||u({ForcePathStyle:r.options.ForcePathStyle,protocol:r.options.Protocol,domain:r.options.Domain,bucket:i,region:s,object:c}),e.SwitchHost&&(d=d.replace(/myqcloud.com/,"tencentcos.cn"));var h=c?d:"";e.action&&(d=d+"?"+(a.isIOS_QQ?"".concat(e.action,"="):e.action)),e.qsStr&&(d=d.indexOf("?")>-1?d+"&"+e.qsStr:d+"?"+e.qsStr);var g={method:l,url:d,headers:e.headers,qs:e.qs,body:p},m="x-cos-security-token";if(a.isCIHost(d)&&(m="x-ci-security-token"),g.headers.Authorization=e.AuthData.Authorization,e.AuthData.Token&&(g.headers.token=e.AuthData.Token),e.AuthData.ClientIP&&(g.headers.clientIP=e.AuthData.ClientIP),e.AuthData.ClientUA&&(g.headers.clientUA=e.AuthData.ClientUA),e.AuthData.SecurityToken&&(g.headers[m]=e.AuthData.SecurityToken),g.headers&&(g.headers=a.clearKey(g.headers)),g=a.clearKey(g),e.onProgress&&"function"==typeof e.onProgress){var y=p&&(p.size||p.length)||0;g.onProgress=function(t){if(!n||r._isRunningTask(n)){var o=t?t.loaded:0;e.onProgress({loaded:o,total:y})}}}e.onDownloadProgress&&(g.onDownloadProgress=e.onDownloadProgress),e.DataType&&(g.dataType=e.DataType),this.options.Timeout&&(g.timeout=this.options.Timeout),r.options.ForcePathStyle&&(g.pathStyle=r.options.ForcePathStyle),r.emit("before-send",g);var v,k=g.url.includes("accelerate."),C=g.qs?Object.keys(g.qs).map((function(e){return"".concat(e,"=").concat(g.qs[e])})).join("&"):"",b=C?g.url+"?"+C:g.url;if(e.tracker)e.tracker.setParams({url:b,httpMethod:g.method,accelerate:k,httpSize:(null===(v=g.body)||void 0===v?void 0:v.size)||0}),e.tracker.parent&&!e.tracker.parent.params.url&&e.tracker.parent.setParams({url:h,accelerate:k});var S=(r.options.Request||o)(g,(function(e){if(!e||"abort"!==e.error){var o={options:g,error:e&&e.error,statusCode:e&&e.statusCode||0,statusMessage:e&&e.statusMessage||"",headers:e&&e.headers||{},body:e&&e.body};r.emit("after-receive",o);var i,s=o.error,c=o.body,u={statusCode:o.statusCode,statusMessage:o.statusMessage,headers:o.headers},l=function(e,o){if(n&&r.off("inner-kill-task",T),!i){i=!0;var s={};u&&u.statusCode&&(s.statusCode=u.statusCode),u&&u.headers&&(s.headers=u.headers),e?(g.url&&(s.url=g.url),g.method&&(s.method=g.method),e=a.extend(e||{},s),t(e,null)):(o=a.extend(o||{},s),t(null,o)),S=null}};if(s)return l(a.error(s));var d,p=u.statusCode,h=2===Math.floor(p/100);if(f&&h)return l(null,{body:c});try{d=c&&c.indexOf("<")>-1&&c.indexOf(">")>-1&&a.xml2json(c)||{}}catch(e){d={}}var m=d&&d.Error;h?l(null,d):m?l(a.error(new Error(m.Message),{code:m.Code,error:m})):p?l(a.error(new Error(u.statusMessage),{code:""+p})):p&&l(a.error(new Error("statusCode error")))}})),T=function e(t){t.TaskId===n&&(S&&S.abort&&S.abort(),r.off("inner-kill-task",e))};n&&r.on("inner-kill-task",T)}}var m={getService:function(e,t){var r=this.options.Protocol||(a.isBrowser&&"object"===("undefined"==typeof location?"undefined":n(location))&&"http:"===location.protocol?"http:":"https:"),o=this.options.ServiceDomain,i=e.AppId||this.options.appId,s=e.Region;o?(o=o.replace(/\{\{AppId\}\}/gi,i||"").replace(/\{\{Region\}\}/gi,s||"").replace(/\{\{.*?\}\}/gi,""),/^[a-zA-Z]+:\/\//.test(o)||(o=r+"//"+o),"/"===o.slice(-1)&&(o=o.slice(0,-1))):o=s?r+"//cos."+s+".myqcloud.com":r+"//service.cos.myqcloud.com";var c="",u=s?"cos."+s+".myqcloud.com":"service.cos.myqcloud.com";u===o.replace(/^https?:\/\/([^/]+)(\/.*)?$/,"$1")&&(c=u),h.call(this,{Action:"name/cos:GetService",url:o,method:"GET",headers:e.Headers,SignHost:c,tracker:e.tracker},(function(e,r){if(e)return t(e);var n=r&&r.ListAllMyBucketsResult&&r.ListAllMyBucketsResult.Buckets&&r.ListAllMyBucketsResult.Buckets.Bucket||[];n=a.isArray(n)?n:[n];var o=r&&r.ListAllMyBucketsResult&&r.ListAllMyBucketsResult.Owner||{};t(null,{Buckets:n,Owner:o,statusCode:r.statusCode,headers:r.headers})}))},putBucket:function(e,t){var r=this,n="";if(e.BucketAZConfig){var o={BucketAZConfig:e.BucketAZConfig};n=a.json2xml({CreateBucketConfiguration:o})}h.call(this,{Action:"name/cos:PutBucket",method:"PUT",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,body:n,tracker:e.tracker},(function(n,o){if(n)return t(n);var a=u({protocol:r.options.Protocol,domain:r.options.Domain,bucket:e.Bucket,region:e.Region,isLocation:!0});t(null,{Location:a,statusCode:o.statusCode,headers:o.headers})}))},headBucket:function(e,t){h.call(this,{Action:"name/cos:HeadBucket",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,method:"HEAD",tracker:e.tracker},t)},getBucket:function(e,t){var r={};r.prefix=e.Prefix||"",r.delimiter=e.Delimiter,r.marker=e.Marker,r["max-keys"]=e.MaxKeys,r["encoding-type"]=e.EncodingType,h.call(this,{Action:"name/cos:GetBucket",ResourceKey:r.prefix,method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,qs:r,tracker:e.tracker},(function(e,r){if(e)return t(e);var n=r.ListBucketResult||{},o=n.Contents||[],i=n.CommonPrefixes||[];o=a.isArray(o)?o:[o],i=a.isArray(i)?i:[i];var s=a.clone(n);a.extend(s,{Contents:o,CommonPrefixes:i,statusCode:r.statusCode,headers:r.headers}),t(null,s)}))},deleteBucket:function(e,t){h.call(this,{Action:"name/cos:DeleteBucket",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,method:"DELETE",tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))},putBucketAcl:function(e,t){var r=e.Headers,n="";if(e.AccessControlPolicy){var o=a.clone(e.AccessControlPolicy||{}),i=o.Grants||o.Grant;i=a.isArray(i)?i:[i],delete o.Grant,delete o.Grants,o.AccessControlList={Grant:i},n=a.json2xml({AccessControlPolicy:o}),r["Content-Type"]="application/xml",r["Content-MD5"]=a.b64(a.md5(n))}a.each(r,(function(e,t){0===t.indexOf("x-cos-grant-")&&(r[t]=c(r[t]))})),h.call(this,{Action:"name/cos:PutBucketACL",method:"PUT",Bucket:e.Bucket,Region:e.Region,headers:r,action:"acl",body:n,tracker:e.tracker},(function(e,r){if(e)return t(e);t(null,{statusCode:r.statusCode,headers:r.headers})}))},getBucketAcl:function(e,t){h.call(this,{Action:"name/cos:GetBucketACL",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"acl",tracker:e.tracker},(function(e,r){if(e)return t(e);var n=r.AccessControlPolicy||{},o=n.Owner||{},i=n.AccessControlList.Grant||[];i=a.isArray(i)?i:[i];var c=s(n);r.headers&&r.headers["x-cos-acl"]&&(c.ACL=r.headers["x-cos-acl"]),c=a.extend(c,{Owner:o,Grants:i,statusCode:r.statusCode,headers:r.headers}),t(null,c)}))},putBucketCors:function(e,t){var r=(e.CORSConfiguration||{}).CORSRules||e.CORSRules||[];r=a.clone(a.isArray(r)?r:[r]),a.each(r,(function(e){a.each(["AllowedOrigin","AllowedHeader","AllowedMethod","ExposeHeader"],(function(t){var r=t+"s",n=e[r]||e[t]||[];delete e[r],e[t]=a.isArray(n)?n:[n]}))}));var n={CORSRule:r};e.ResponseVary&&(n.ResponseVary=e.ResponseVary);var o=a.json2xml({CORSConfiguration:n}),i=e.Headers;i["Content-Type"]="application/xml",i["Content-MD5"]=a.b64(a.md5(o)),h.call(this,{Action:"name/cos:PutBucketCORS",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:o,action:"cors",headers:i,tracker:e.tracker},(function(e,r){if(e)return t(e);t(null,{statusCode:r.statusCode,headers:r.headers})}))},getBucketCors:function(e,t){h.call(this,{Action:"name/cos:GetBucketCORS",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"cors",tracker:e.tracker},(function(e,r){if(e)if(404===e.statusCode&&e.error&&"NoSuchCORSConfiguration"===e.error.Code){var n={CORSRules:[],statusCode:e.statusCode};e.headers&&(n.headers=e.headers),t(null,n)}else t(e);else{var o=r.CORSConfiguration||{},i=o.CORSRules||o.CORSRule||[];i=a.clone(a.isArray(i)?i:[i]);var s=o.ResponseVary;a.each(i,(function(e){a.each(["AllowedOrigin","AllowedHeader","AllowedMethod","ExposeHeader"],(function(t){var r=t+"s",n=e[r]||e[t]||[];delete e[t],e[r]=a.isArray(n)?n:[n]}))})),t(null,{CORSRules:i,ResponseVary:s,statusCode:r.statusCode,headers:r.headers})}}))},deleteBucketCors:function(e,t){h.call(this,{Action:"name/cos:DeleteBucketCORS",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"cors",tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode||e.statusCode,headers:r.headers})}))},getBucketLocation:function(e,t){h.call(this,{Action:"name/cos:GetBucketLocation",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"location",tracker:e.tracker},t)},getBucketPolicy:function(e,t){h.call(this,{Action:"name/cos:GetBucketPolicy",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"policy",rawBody:!0,tracker:e.tracker},(function(e,r){if(e)return e.statusCode&&403===e.statusCode?t(a.error(e,{ErrorStatus:"Access Denied"})):e.statusCode&&405===e.statusCode?t(a.error(e,{ErrorStatus:"Method Not Allowed"})):e.statusCode&&404===e.statusCode?t(a.error(e,{ErrorStatus:"Policy Not Found"})):t(e);var n={};try{n=JSON.parse(r.body)}catch(e){}t(null,{Policy:n,statusCode:r.statusCode,headers:r.headers})}))},putBucketPolicy:function(e,t){var r=e.Policy;try{"string"==typeof r&&(r=JSON.parse(r))}catch(e){}if(!r||"string"==typeof r)return t(a.error(new Error("Policy format error")));var n=JSON.stringify(r);r.version||(r.version="2.0");var o=e.Headers;o["Content-Type"]="application/json",o["Content-MD5"]=a.b64(a.md5(n)),h.call(this,{Action:"name/cos:PutBucketPolicy",method:"PUT",Bucket:e.Bucket,Region:e.Region,action:"policy",body:n,headers:o,tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))},deleteBucketPolicy:function(e,t){h.call(this,{Action:"name/cos:DeleteBucketPolicy",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"policy",tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode||e.statusCode,headers:r.headers})}))},putBucketTagging:function(e,t){var r=e.Tagging||{},n=r.TagSet||r.Tags||e.Tags||[];n=a.clone(a.isArray(n)?n:[n]);var o=a.json2xml({Tagging:{TagSet:{Tag:n}}}),i=e.Headers;i["Content-Type"]="application/xml",i["Content-MD5"]=a.b64(a.md5(o)),h.call(this,{Action:"name/cos:PutBucketTagging",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:o,action:"tagging",headers:i,tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))},getBucketTagging:function(e,t){h.call(this,{Action:"name/cos:GetBucketTagging",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"tagging",tracker:e.tracker},(function(e,r){if(e)if(404!==e.statusCode||!e.error||"Not Found"!==e.error&&"NoSuchTagSet"!==e.error.Code)t(e);else{var n={Tags:[],statusCode:e.statusCode};e.headers&&(n.headers=e.headers),t(null,n)}else{var o=[];try{o=r.Tagging.TagSet.Tag||[]}catch(e){}o=a.clone(a.isArray(o)?o:[o]),t(null,{Tags:o,statusCode:r.statusCode,headers:r.headers})}}))},deleteBucketTagging:function(e,t){h.call(this,{Action:"name/cos:DeleteBucketTagging",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"tagging",tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))},putBucketLifecycle:function(e,t){var r=(e.LifecycleConfiguration||{}).Rules||e.Rules||[];r=a.clone(r);var n=a.json2xml({LifecycleConfiguration:{Rule:r}}),o=e.Headers;o["Content-Type"]="application/xml",o["Content-MD5"]=a.b64(a.md5(n)),h.call(this,{Action:"name/cos:PutBucketLifecycle",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:n,action:"lifecycle",headers:o,tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))},getBucketLifecycle:function(e,t){h.call(this,{Action:"name/cos:GetBucketLifecycle",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"lifecycle",tracker:e.tracker},(function(e,r){if(e)if(404===e.statusCode&&e.error&&"NoSuchLifecycleConfiguration"===e.error.Code){var n={Rules:[],statusCode:e.statusCode};e.headers&&(n.headers=e.headers),t(null,n)}else t(e);else{var o=[];try{o=r.LifecycleConfiguration.Rule||[]}catch(e){}o=a.clone(a.isArray(o)?o:[o]),t(null,{Rules:o,statusCode:r.statusCode,headers:r.headers})}}))},deleteBucketLifecycle:function(e,t){h.call(this,{Action:"name/cos:DeleteBucketLifecycle",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"lifecycle",tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))},putBucketVersioning:function(e,t){if(e.VersioningConfiguration){var r=e.VersioningConfiguration||{},n=a.json2xml({VersioningConfiguration:r}),o=e.Headers;o["Content-Type"]="application/xml",o["Content-MD5"]=a.b64(a.md5(n)),h.call(this,{Action:"name/cos:PutBucketVersioning",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:n,action:"versioning",headers:o,tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))}else t(a.error(new Error("missing param VersioningConfiguration")))},getBucketVersioning:function(e,t){h.call(this,{Action:"name/cos:GetBucketVersioning",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"versioning",tracker:e.tracker},(function(e,r){e||!r.VersioningConfiguration&&(r.VersioningConfiguration={}),t(e,r)}))},putBucketReplication:function(e,t){var r=a.clone(e.ReplicationConfiguration),n=a.json2xml({ReplicationConfiguration:r});n=(n=n.replace(/<(\/?)Rules>/gi,"<$1Rule>")).replace(/<(\/?)Tags>/gi,"<$1Tag>");var o=e.Headers;o["Content-Type"]="application/xml",o["Content-MD5"]=a.b64(a.md5(n)),h.call(this,{Action:"name/cos:PutBucketReplication",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:n,action:"replication",headers:o,tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))},getBucketReplication:function(e,t){h.call(this,{Action:"name/cos:GetBucketReplication",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"replication",tracker:e.tracker},(function(e,r){if(e)if(404!==e.statusCode||!e.error||"Not Found"!==e.error&&"ReplicationConfigurationnotFoundError"!==e.error.Code)t(e);else{var n={ReplicationConfiguration:{Rules:[]},statusCode:e.statusCode};e.headers&&(n.headers=e.headers),t(null,n)}else!r.ReplicationConfiguration&&(r.ReplicationConfiguration={}),r.ReplicationConfiguration.Rule&&(r.ReplicationConfiguration.Rules=a.makeArray(r.ReplicationConfiguration.Rule),delete r.ReplicationConfiguration.Rule),t(e,r)}))},deleteBucketReplication:function(e,t){h.call(this,{Action:"name/cos:DeleteBucketReplication",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"replication",tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))},putBucketWebsite:function(e,t){if(e.WebsiteConfiguration){var r=a.clone(e.WebsiteConfiguration||{}),n=r.RoutingRules||r.RoutingRule||[];n=a.isArray(n)?n:[n],delete r.RoutingRule,delete r.RoutingRules,n.length&&(r.RoutingRules={RoutingRule:n});var o=a.json2xml({WebsiteConfiguration:r}),i=e.Headers;i["Content-Type"]="application/xml",i["Content-MD5"]=a.b64(a.md5(o)),h.call(this,{Action:"name/cos:PutBucketWebsite",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:o,action:"website",headers:i,tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))}else t(a.error(new Error("missing param WebsiteConfiguration")))},getBucketWebsite:function(e,t){h.call(this,{Action:"name/cos:GetBucketWebsite",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"website",tracker:e.tracker},(function(e,r){if(e)if(404===e.statusCode&&"NoSuchWebsiteConfiguration"===e.error.Code){var n={WebsiteConfiguration:{},statusCode:e.statusCode};e.headers&&(n.headers=e.headers),t(null,n)}else t(e);else{var o=r.WebsiteConfiguration||{};if(o.RoutingRules){var i=a.clone(o.RoutingRules.RoutingRule||[]);i=a.makeArray(i),o.RoutingRules=i}t(null,{WebsiteConfiguration:o,statusCode:r.statusCode,headers:r.headers})}}))},deleteBucketWebsite:function(e,t){h.call(this,{Action:"name/cos:DeleteBucketWebsite",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"website",tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))},putBucketReferer:function(e,t){if(e.RefererConfiguration){var r=a.clone(e.RefererConfiguration||{}),n=r.DomainList||{},o=n.Domains||n.Domain||[];(o=a.isArray(o)?o:[o]).length&&(r.DomainList={Domain:o});var i=a.json2xml({RefererConfiguration:r}),s=e.Headers;s["Content-Type"]="application/xml",s["Content-MD5"]=a.b64(a.md5(i)),h.call(this,{Action:"name/cos:PutBucketReferer",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:i,action:"referer",headers:s,tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))}else t(a.error(new Error("missing param RefererConfiguration")))},getBucketReferer:function(e,t){h.call(this,{Action:"name/cos:GetBucketReferer",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"referer",tracker:e.tracker},(function(e,r){if(e)if(404===e.statusCode&&"NoSuchRefererConfiguration"===e.error.Code){var n={WebsiteConfiguration:{},statusCode:e.statusCode};e.headers&&(n.headers=e.headers),t(null,n)}else t(e);else{var o=r.RefererConfiguration||{};if(o.DomainList){var i=a.makeArray(o.DomainList.Domain||[]);o.DomainList={Domains:i}}t(null,{RefererConfiguration:o,statusCode:r.statusCode,headers:r.headers})}}))},putBucketDomain:function(e,t){var r=(e.DomainConfiguration||{}).DomainRule||e.DomainRule||[];r=a.clone(r);var n=a.json2xml({DomainConfiguration:{DomainRule:r}}),o=e.Headers;o["Content-Type"]="application/xml",o["Content-MD5"]=a.b64(a.md5(n)),h.call(this,{Action:"name/cos:PutBucketDomain",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:n,action:"domain",headers:o,tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))},getBucketDomain:function(e,t){h.call(this,{Action:"name/cos:GetBucketDomain",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"domain",tracker:e.tracker},(function(e,r){if(e)return t(e);var n=[];try{n=r.DomainConfiguration.DomainRule||[]}catch(e){}n=a.clone(a.isArray(n)?n:[n]),t(null,{DomainRule:n,statusCode:r.statusCode,headers:r.headers})}))},deleteBucketDomain:function(e,t){h.call(this,{Action:"name/cos:DeleteBucketDomain",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"domain",tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))},putBucketOrigin:function(e,t){var r=(e.OriginConfiguration||{}).OriginRule||e.OriginRule||[];r=a.clone(r);var n=a.json2xml({OriginConfiguration:{OriginRule:r}}),o=e.Headers;o["Content-Type"]="application/xml",o["Content-MD5"]=a.b64(a.md5(n)),h.call(this,{Action:"name/cos:PutBucketOrigin",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:n,action:"origin",headers:o,tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))},getBucketOrigin:function(e,t){h.call(this,{Action:"name/cos:GetBucketOrigin",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"origin",tracker:e.tracker},(function(e,r){if(e)return t(e);var n=[];try{n=r.OriginConfiguration.OriginRule||[]}catch(e){}n=a.clone(a.isArray(n)?n:[n]),t(null,{OriginRule:n,statusCode:r.statusCode,headers:r.headers})}))},deleteBucketOrigin:function(e,t){h.call(this,{Action:"name/cos:DeleteBucketOrigin",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"origin",tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))},putBucketLogging:function(e,t){var r=a.json2xml({BucketLoggingStatus:e.BucketLoggingStatus||""}),n=e.Headers;n["Content-Type"]="application/xml",n["Content-MD5"]=a.b64(a.md5(r)),h.call(this,{Action:"name/cos:PutBucketLogging",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:r,action:"logging",headers:n,tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))},getBucketLogging:function(e,t){h.call(this,{Action:"name/cos:GetBucketLogging",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"logging",tracker:e.tracker},(function(e,r){if(e)return t(e);t(null,{BucketLoggingStatus:r.BucketLoggingStatus,statusCode:r.statusCode,headers:r.headers})}))},putBucketInventory:function(e,t){return i.call(this,"PUT",e,t)},postBucketInventory:function(e,t){return i.call(this,"POST",e,t)},getBucketInventory:function(e,t){h.call(this,{Action:"name/cos:GetBucketInventory",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"inventory",qs:{id:e.Id},tracker:e.tracker},(function(e,r){if(e)return t(e);var n=r.InventoryConfiguration;if(n&&n.OptionalFields&&n.OptionalFields.Field){var o=n.OptionalFields.Field;a.isArray(o)||(o=[o]),n.OptionalFields=o}if(n.Destination&&n.Destination.COSBucketDestination&&n.Destination.COSBucketDestination.Encryption){var i=n.Destination.COSBucketDestination.Encryption;Object.keys(i).indexOf("SSE-COS")>-1&&(i.SSECOS=i["SSE-COS"],delete i["SSE-COS"])}t(null,{InventoryConfiguration:n,statusCode:r.statusCode,headers:r.headers})}))},listBucketInventory:function(e,t){h.call(this,{Action:"name/cos:ListBucketInventory",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"inventory",qs:{"continuation-token":e.ContinuationToken},tracker:e.tracker},(function(e,r){if(e)return t(e);var n=r.ListInventoryConfigurationResult,o=n.InventoryConfiguration||[];o=a.isArray(o)?o:[o],delete n.InventoryConfiguration,a.each(o,(function(e){if(e&&e.OptionalFields&&e.OptionalFields.Field){var t=e.OptionalFields.Field;a.isArray(t)||(t=[t]),e.OptionalFields=t}if(e.Destination&&e.Destination.COSBucketDestination&&e.Destination.COSBucketDestination.Encryption){var r=e.Destination.COSBucketDestination.Encryption;Object.keys(r).indexOf("SSE-COS")>-1&&(r.SSECOS=r["SSE-COS"],delete r["SSE-COS"])}})),n.InventoryConfigurations=o,a.extend(n,{statusCode:r.statusCode,headers:r.headers}),t(null,n)}))},deleteBucketInventory:function(e,t){h.call(this,{Action:"name/cos:DeleteBucketInventory",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"inventory",qs:{id:e.Id},tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))},putBucketAccelerate:function(e,t){if(e.AccelerateConfiguration){var r={AccelerateConfiguration:e.AccelerateConfiguration||{}},n=a.json2xml(r),o={"Content-Type":"application/xml"};o["Content-MD5"]=a.b64(a.md5(n)),h.call(this,{Action:"name/cos:PutBucketAccelerate",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:n,action:"accelerate",headers:o,tracker:e.tracker},(function(e,r){if(e)return t(e);t(null,{statusCode:r.statusCode,headers:r.headers})}))}else t(a.error(new Error("missing param AccelerateConfiguration")))},getBucketAccelerate:function(e,t){h.call(this,{Action:"name/cos:GetBucketAccelerate",method:"GET",Bucket:e.Bucket,Region:e.Region,action:"accelerate",tracker:e.tracker},(function(e,r){e||!r.AccelerateConfiguration&&(r.AccelerateConfiguration={}),t(e,r)}))},putBucketEncryption:function(e,t){var r=e.ServerSideEncryptionConfiguration||{},n=r.Rule||r.Rules||[],o=a.json2xml({ServerSideEncryptionConfiguration:{Rule:n}}),i=e.Headers;i["Content-Type"]="application/xml",i["Content-MD5"]=a.b64(a.md5(o)),h.call(this,{Action:"name/cos:PutBucketEncryption",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:o,action:"encryption",headers:i,tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))},getBucketEncryption:function(e,t){h.call(this,{Action:"name/cos:GetBucketEncryption",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"encryption",tracker:e.tracker},(function(e,r){if(e)if(404===e.statusCode&&"NoSuchEncryptionConfiguration"===e.code){var n={EncryptionConfiguration:{Rules:[]},statusCode:e.statusCode};e.headers&&(n.headers=e.headers),t(null,n)}else t(e);else{var o=a.makeArray(r.EncryptionConfiguration&&r.EncryptionConfiguration.Rule||[]);r.EncryptionConfiguration={Rules:o},t(e,r)}}))},deleteBucketEncryption:function(e,t){h.call(this,{Action:"name/cos:DeleteBucketReplication",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"encryption",tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))},getObject:function(e,t){if(this.options.ObjectKeySimplifyCheck&&"/"===a.simplifyPath(e.Key))return void t(a.error(new Error("The Getobject Key is illegal")));var r=e.Query||{},n=e.QueryString||"",o=a.throttleOnProgress.call(this,0,e.onProgress),i=e.tracker;i&&i.setParams({signStartTime:(new Date).getTime()}),r["response-content-type"]=e.ResponseContentType,r["response-content-language"]=e.ResponseContentLanguage,r["response-expires"]=e.ResponseExpires,r["response-cache-control"]=e.ResponseCacheControl,r["response-content-disposition"]=e.ResponseContentDisposition,r["response-content-encoding"]=e.ResponseContentEncoding,h.call(this,{Action:"name/cos:GetObject",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,DataType:e.DataType,headers:e.Headers,qs:r,qsStr:n,rawBody:!0,onDownloadProgress:o,tracker:i},(function(r,n){if(o(null,!0),r){var i=r.statusCode;return e.Headers["If-Modified-Since"]&&i&&304===i?t(null,{NotModified:!0}):t(r)}t(null,{Body:n.body,ETag:a.attr(n.headers,"etag",""),statusCode:n.statusCode,headers:n.headers})}))},headObject:function(e,t){h.call(this,{Action:"name/cos:HeadObject",method:"HEAD",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,headers:e.Headers,tracker:e.tracker},(function(r,n){if(r){var o=r.statusCode;return e.Headers["If-Modified-Since"]&&o&&304===o?t(null,{NotModified:!0,statusCode:o}):t(r)}n.ETag=a.attr(n.headers,"etag",""),t(null,n)}))},listObjectVersions:function(e,t){var r={};r.prefix=e.Prefix||"",r.delimiter=e.Delimiter,r["key-marker"]=e.KeyMarker,r["version-id-marker"]=e.VersionIdMarker,r["max-keys"]=e.MaxKeys,r["encoding-type"]=e.EncodingType,h.call(this,{Action:"name/cos:GetBucketObjectVersions",ResourceKey:r.prefix,method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,qs:r,action:"versions",tracker:e.tracker},(function(e,r){if(e)return t(e);var n=r.ListVersionsResult||{},o=n.DeleteMarker||[];o=a.isArray(o)?o:[o];var i=n.Version||[];i=a.isArray(i)?i:[i];var s=a.clone(n);delete s.DeleteMarker,delete s.Version,a.extend(s,{DeleteMarkers:o,Versions:i,statusCode:r.statusCode,headers:r.headers}),t(null,s)}))},putObject:function(e,t){var r=this,n=e.ContentLength,o=a.throttleOnProgress.call(r,n,e.onProgress),i=e.Headers;i["Cache-Control"]||i["cache-control"]||(i["Cache-Control"]=""),i["Content-Type"]||i["content-type"]||(i["Content-Type"]=e.Body&&e.Body.type||"");var s=e.UploadAddMetaMd5||r.options.UploadAddMetaMd5||r.options.UploadCheckContentMd5,c=e.tracker;s&&c&&c.setParams({md5StartTime:(new Date).getTime()}),a.getBodyMd5(s,e.Body,(function(s){s&&(c&&c.setParams({md5EndTime:(new Date).getTime()}),r.options.UploadCheckContentMd5&&(i["Content-MD5"]=a.b64(s)),(e.UploadAddMetaMd5||r.options.UploadAddMetaMd5)&&(i["x-cos-meta-md5"]=s)),void 0!==e.ContentLength&&(i["Content-Length"]=e.ContentLength),o(null,!0),h.call(r,{Action:"name/cos:PutObject",TaskId:e.TaskId,method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,qs:e.Query,body:e.Body,onProgress:o,tracker:c},(function(i,s){if(i)return o(null,!0),t(i);o({loaded:n,total:n},!0);var c=u({ForcePathStyle:r.options.ForcePathStyle,protocol:r.options.Protocol,domain:r.options.Domain,bucket:e.Bucket,region:r.options.UseAccelerate?"accelerate":e.Region,object:e.Key});c=c.substr(c.indexOf("://")+3),s.Location=c,s.ETag=a.attr(s.headers,"etag",""),t(null,s)}))}),e.onHashProgress)},deleteObject:function(e,t){h.call(this,{Action:"name/cos:DeleteObject",method:"DELETE",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,VersionId:e.VersionId,action:e.Recursive?"recursive":"",tracker:e.tracker},(function(e,r){if(e){var n=e.statusCode;return n&&404===n?t(null,{BucketNotFound:!0,statusCode:n}):t(e)}t(null,{statusCode:r.statusCode,headers:r.headers})}))},getObjectAcl:function(e,t){var r={};e.VersionId&&(r.versionId=e.VersionId),h.call(this,{Action:"name/cos:GetObjectACL",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,qs:r,action:"acl",tracker:e.tracker},(function(e,r){if(e)return t(e);var n=r.AccessControlPolicy||{},o=n.Owner||{},i=n.AccessControlList&&n.AccessControlList.Grant||[];i=a.isArray(i)?i:[i];var c=s(n);delete c.GrantWrite,r.headers&&r.headers["x-cos-acl"]&&(c.ACL=r.headers["x-cos-acl"]),c=a.extend(c,{Owner:o,Grants:i,statusCode:r.statusCode,headers:r.headers}),t(null,c)}))},putObjectAcl:function(e,t){var r=e.Headers,n="";if(e.AccessControlPolicy){var o=a.clone(e.AccessControlPolicy||{}),i=o.Grants||o.Grant;i=a.isArray(i)?i:[i],delete o.Grant,delete o.Grants,o.AccessControlList={Grant:i},n=a.json2xml({AccessControlPolicy:o}),r["Content-Type"]="application/xml",r["Content-MD5"]=a.b64(a.md5(n))}a.each(r,(function(e,t){0===t.indexOf("x-cos-grant-")&&(r[t]=c(r[t]))})),h.call(this,{Action:"name/cos:PutObjectACL",method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,action:"acl",headers:r,body:n,tracker:e.tracker},(function(e,r){if(e)return t(e);t(null,{statusCode:r.statusCode,headers:r.headers})}))},optionsObject:function(e,t){var r=e.Headers;r.Origin=e.Origin,r["Access-Control-Request-Method"]=e.AccessControlRequestMethod,r["Access-Control-Request-Headers"]=e.AccessControlRequestHeaders,h.call(this,{Action:"name/cos:OptionsObject",method:"OPTIONS",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:r,tracker:e.tracker},(function(e,r){if(e)return e.statusCode&&403===e.statusCode?t(null,{OptionsForbidden:!0,statusCode:e.statusCode}):t(e);var n=r.headers||{};t(null,{AccessControlAllowOrigin:n["access-control-allow-origin"],AccessControlAllowMethods:n["access-control-allow-methods"],AccessControlAllowHeaders:n["access-control-allow-headers"],AccessControlExposeHeaders:n["access-control-expose-headers"],AccessControlMaxAge:n["access-control-max-age"],statusCode:r.statusCode,headers:r.headers})}))},putObjectCopy:function(e,t){var r=this,n=e.Headers;n["Cache-Control"]||n["cache-control"]||(n["Cache-Control"]="");var o=e.CopySource||"",i=a.getSourceParams.call(this,o);if(i){var s=i.Bucket,c=i.Region,l=decodeURIComponent(i.Key);h.call(this,{Scope:[{action:"name/cos:GetObject",bucket:s,region:c,prefix:l},{action:"name/cos:PutObject",bucket:e.Bucket,region:e.Region,prefix:e.Key}],method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,headers:e.Headers,tracker:e.tracker},(function(n,o){if(n)return t(n);var i=a.clone(o.CopyObjectResult||{}),s=u({ForcePathStyle:r.options.ForcePathStyle,protocol:r.options.Protocol,domain:r.options.Domain,bucket:e.Bucket,region:e.Region,object:e.Key,isLocation:!0});a.extend(i,{Location:s,statusCode:o.statusCode,headers:o.headers}),t(null,i)}))}else t(a.error(new Error("CopySource format error")))},deleteMultipleObject:function(e,t){var r=e.Objects||[],n=e.Quiet;r=a.isArray(r)?r:[r];var o=a.json2xml({Delete:{Object:r,Quiet:n||!1}}),i=e.Headers;i["Content-Type"]="application/xml",i["Content-MD5"]=a.b64(a.md5(o));var s=a.map(r,(function(t){return{action:"name/cos:DeleteObject",bucket:e.Bucket,region:e.Region,prefix:t.Key}}));h.call(this,{Scope:s,method:"POST",Bucket:e.Bucket,Region:e.Region,body:o,action:"delete",headers:i,tracker:e.tracker},(function(e,r){if(e)return t(e);var n=r.DeleteResult||{},o=n.Deleted||[],i=n.Error||[];o=a.isArray(o)?o:[o],i=a.isArray(i)?i:[i];var s=a.clone(n);a.extend(s,{Error:i,Deleted:o,statusCode:r.statusCode,headers:r.headers}),t(null,s)}))},restoreObject:function(e,t){var r=e.Headers;if(e.RestoreRequest){var n=e.RestoreRequest||{},o=a.json2xml({RestoreRequest:n});r["Content-Type"]="application/xml",r["Content-MD5"]=a.b64(a.md5(o)),h.call(this,{Action:"name/cos:RestoreObject",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,body:o,action:"restore",headers:r,tracker:e.tracker},t)}else t(a.error(new Error("missing param RestoreRequest")))},putObjectTagging:function(e,t){var r=e.Tagging||{},n=r.TagSet||r.Tags||e.Tags||[];n=a.clone(a.isArray(n)?n:[n]);var o=a.json2xml({Tagging:{TagSet:{Tag:n}}}),i=e.Headers;i["Content-Type"]="application/xml",i["Content-MD5"]=a.b64(a.md5(o)),h.call(this,{Action:"name/cos:PutObjectTagging",method:"PUT",Bucket:e.Bucket,Key:e.Key,Region:e.Region,body:o,action:"tagging",headers:i,VersionId:e.VersionId,tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))},getObjectTagging:function(e,t){h.call(this,{Action:"name/cos:GetObjectTagging",method:"GET",Key:e.Key,Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"tagging",VersionId:e.VersionId,tracker:e.tracker},(function(e,r){if(e)if(404!==e.statusCode||!e.error||"Not Found"!==e.error&&"NoSuchTagSet"!==e.error.Code)t(e);else{var n={Tags:[],statusCode:e.statusCode};e.headers&&(n.headers=e.headers),t(null,n)}else{var o=[];try{o=r.Tagging.TagSet.Tag||[]}catch(e){}o=a.clone(a.isArray(o)?o:[o]),t(null,{Tags:o,statusCode:r.statusCode,headers:r.headers})}}))},deleteObjectTagging:function(e,t){h.call(this,{Action:"name/cos:DeleteObjectTagging",method:"DELETE",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"tagging",VersionId:e.VersionId,tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))},selectObjectContent:function(e,t){if(!e.SelectType)return t(a.error(new Error("missing param SelectType")));var r=e.SelectRequest||{},n=a.json2xml({SelectRequest:r}),o=e.Headers;o["Content-Type"]="application/xml",o["Content-MD5"]=a.b64(a.md5(n)),h.call(this,{Action:"name/cos:GetObject",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"select",qs:{"select-type":e.SelectType},VersionId:e.VersionId,body:n,DataType:"arraybuffer",rawBody:!0,tracker:e.tracker},(function(e,r){if(e&&204===e.statusCode)return t(null,{statusCode:e.statusCode});if(e)return t(e);var n=a.parseSelectPayload(r.body);t(null,{statusCode:r.statusCode,headers:r.headers,Body:n.body,Payload:n.payload})}))},appendObject:function(e,t){var r=e.Headers;r["Cache-Control"]||r["cache-control"]||(r["Cache-Control"]=""),r["Content-Type"]||r["content-type"]||(r["Content-Type"]=e.Body&&e.Body.type||""),h.call(this,{Action:"name/cos:AppendObject",method:"POST",Bucket:e.Bucket,Region:e.Region,action:"append",Key:e.Key,body:e.Body,qs:{position:e.Position},headers:e.Headers,tracker:e.tracker},(function(e,r){if(e)return t(e);t(null,r)}))},uploadPartCopy:function(e,t){var r=e.CopySource||"",n=a.getSourceParams.call(this,r);if(n){var o=n.Bucket,i=n.Region,s=decodeURIComponent(n.Key);h.call(this,{Scope:[{action:"name/cos:GetObject",bucket:o,region:i,prefix:s},{action:"name/cos:PutObject",bucket:e.Bucket,region:e.Region,prefix:e.Key}],method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,qs:{partNumber:e.PartNumber,uploadId:e.UploadId},headers:e.Headers,tracker:e.tracker},(function(e,r){if(e)return t(e);var n=a.clone(r.CopyPartResult||{});a.extend(n,{statusCode:r.statusCode,headers:r.headers}),t(null,n)}))}else t(a.error(new Error("CopySource format error")))},multipartInit:function(e,t){var r=this,n=e.Headers,o=e.tracker;n["Cache-Control"]||n["cache-control"]||(n["Cache-Control"]=""),n["Content-Type"]||n["content-type"]||(n["Content-Type"]=e.Body&&e.Body.type||"");var i=e.Body&&(e.UploadAddMetaMd5||r.options.UploadAddMetaMd5);i&&o&&o.setParams({md5StartTime:(new Date).getTime()}),a.getBodyMd5(i,e.Body,(function(n){n&&(e.Headers["x-cos-meta-md5"]=n),i&&o&&o.setParams({md5EndTime:(new Date).getTime()}),h.call(r,{Action:"name/cos:InitiateMultipartUpload",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,action:"uploads",headers:e.Headers,qs:e.Query,tracker:o},(function(e,r){return e?(o&&o.parent&&o.parent.setParams({errorNode:"multipartInit"}),t(e)):(r=a.clone(r||{}))&&r.InitiateMultipartUploadResult?t(null,a.extend(r.InitiateMultipartUploadResult,{statusCode:r.statusCode,headers:r.headers})):void t(null,r)}))}),e.onHashProgress)},multipartUpload:function(e,t){var r=this;a.getFileSize("multipartUpload",e,(function(){var n=e.tracker,o=r.options.UploadCheckContentMd5;o&&n&&n.setParams({md5StartTime:(new Date).getTime()}),a.getBodyMd5(o,e.Body,(function(i){i&&(e.Headers["Content-MD5"]=a.b64(i)),o&&n&&n.setParams({md5EndTime:(new Date).getTime()}),n&&n.setParams({partNumber:e.PartNumber}),h.call(r,{Action:"name/cos:UploadPart",TaskId:e.TaskId,method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,qs:{partNumber:e.PartNumber,uploadId:e.UploadId},headers:e.Headers,onProgress:e.onProgress,body:e.Body||null,tracker:n},(function(e,r){if(e)return n&&n.parent&&n.parent.setParams({errorNode:"multipartUpload"}),t(e);t(null,{ETag:a.attr(r.headers,"etag",""),statusCode:r.statusCode,headers:r.headers})}))}))}))},multipartComplete:function(e,t){for(var r=this,n=e.UploadId,o=e.Parts,i=e.tracker,s=0,c=o.length;s-1?function(e){var t=e.match(/q-url-param-list.*?(?=&)/g)[0],r="q-url-param-list="+encodeURIComponent(t.replace(/q-url-param-list=/,"")).toLowerCase(),n=new RegExp(t,"g");return e.replace(n,r)}(r.Authorization):"sign="+encodeURIComponent(r.Authorization)),r.SecurityToken&&(n+="&x-cos-security-token="+r.SecurityToken),r.ClientIP&&(n+="&clientIP="+r.ClientIP),r.ClientUA&&(n+="&clientUA="+r.ClientUA),r.Token&&(n+="&token="+r.Token),i&&(n+="&"+i),setTimeout((function(){t(null,{Url:n})}))}}));return p?(s+="?"+p.Authorization+(p.SecurityToken?"&x-cos-security-token="+p.SecurityToken:""),i&&(s+="&"+i)):i&&(s+="?"+i),s},getAuth:function(e){return a.getAuth({SecretId:e.SecretId||this.options.SecretId||"",SecretKey:e.SecretKey||this.options.SecretKey||"",Bucket:e.Bucket,Region:e.Region,Method:e.Method,Key:e.Key,Query:e.Query,Headers:e.Headers,Expires:e.Expires,UseRawKey:this.options.UseRawKey,SystemClockOffset:this.options.SystemClockOffset})}};e.exports.init=function(e,t){t.transferToTaskMethod(m,"putObject"),a.each(m,(function(t,r){e.prototype[r]=a.apiWrapper(r,t),function(e,t,r){a.each(["Cors","Acl"],(function(n){if(e.slice(-n.length)===n){var o=e.slice(0,-n.length)+n.toUpperCase(),i=a.apiWrapper(e,t);r[o]=function(){i.apply(this,arguments)}}}))}(r,t,e.prototype)}))}},function(e,t,r){var n=r(0),o=function(e){switch(n(e)){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}},a=function(e,t,r){var n={},o=t.getAllResponseHeaders();return o&&o.length>0&&o.trim().split("\n").forEach((function(e){if(e){var t=e.indexOf(":"),r=e.substr(0,t).trim().toLowerCase(),o=e.substr(t+1).trim();n[r]=o}})),{error:e,statusCode:t.status,statusMessage:t.statusText,headers:n,body:r}},i=function(e,t){return t||"text"!==t?e.response:e.responseText};e.exports=function(e,t){var r,s,c,u,l=(e.method||"GET").toUpperCase(),d=e.url;if(e.qs){var p=(r=e.qs,s=s||"&",c=c||"=",null===r&&(r=void 0),"object"===n(r)?Object.keys(r).map((function(e){var t=encodeURIComponent(o(e))+c;return Array.isArray(r[e])?r[e].map((function(e){return t+encodeURIComponent(o(e))})).join(s):t+encodeURIComponent(o(r[e]))})).filter(Boolean).join(s):u?encodeURIComponent(o(u))+c+encodeURIComponent(o(r)):"");p&&(d+=(-1===d.indexOf("?")?"?":"&")+p)}var f=new XMLHttpRequest;if(f.open(l,d,!0),f.responseType=e.dataType||"text",e.xhrFields)for(var h in e.xhrFields)f[h]=e.xhrFields[h];var g=e.headers;if(g)for(var m in g)g.hasOwnProperty(m)&&"content-length"!==m.toLowerCase()&&"user-agent"!==m.toLowerCase()&&"origin"!==m.toLowerCase()&&"host"!==m.toLowerCase()&&f.setRequestHeader(m,g[m]);return e.onProgress&&f.upload&&(f.upload.onprogress=e.onProgress),e.onDownloadProgress&&(f.onprogress=e.onDownloadProgress),e.timeout&&(f.timeout=e.timeout),f.ontimeout=function(e){var r=new Error("timeout");t(a(r,f))},f.onload=function(){t(a(null,f,i(f,e.dataType)))},f.onerror=function(r){var n=i(f,e.dataType);if(n)t(a(null,f,n));else{var o=f.statusText;o||0!==f.status||(o=new Error("CORS blocked or network error")),t(a(o,f,n))}},f.send(e.body||""),f}},function(e,t,r){var n=r(0),o=r(8),a=r(30),i=r(7).EventProxy,s=r(1),c=r(5);function u(e,t){var r=e.TaskId,n=e.Bucket,c=e.Region,u=e.Key,p=e.StorageClass,f=this,h={},g=e.FileSize,m=e.SliceSize,y=Math.ceil(g/m),v=0,k=s.throttleOnProgress.call(f,g,e.onHashProgress),C=function(t,r){var n=t.length;if(0===n)return r(null,!0);if(n>y)return r(null,!1);if(n>1&&Math.max(t[0].Size,t[1].Size)!==m)return r(null,!1);!function o(a){if(a=i.length)b.emit("has_and_check_upload_id",t);else{var p=i[l];if(!s.isInArray(t,p))return o.removeUploadId.call(f,p),void a(l+1);o.using[p]?a(l+1):d.call(f,{Bucket:n,Region:c,Key:u,UploadId:p,tracker:e.tracker},(function(e,t){f._isRunningTask(r)&&(e?(o.removeUploadId.call(f,p),a(l+1)):b.emit("upload_id_available",{UploadId:p,PartList:t.PartList}))}))}}(0)}else b.emit("has_and_check_upload_id",t)})),b.on("get_remote_upload_id_list",(function(){l.call(f,{Bucket:n,Region:c,Key:u,tracker:e.tracker},(function(t,a){if(f._isRunningTask(r)){if(t)return b.emit("error",t);var i=s.filter(a.UploadList,(function(e){return e.Key===u&&(!p||e.StorageClass.toUpperCase()===p.toUpperCase())})).reverse().map((function(e){return e.UploadId||e.UploadID}));if(i.length)b.emit("seek_local_avail_upload_id",i);else{var c,l=o.getFileId(e.Body,e.ChunkSize,n,u);l&&(c=o.getUploadIdList.call(f,l))&&s.each(c,(function(e){o.removeUploadId.call(f,e)})),b.emit("no_available_upload_id")}}}))})),b.emit("get_remote_upload_id_list")}function l(e,t){var r=this,n=[],o={Bucket:e.Bucket,Region:e.Region,Prefix:e.Key,calledBySdk:e.calledBySdk||"sliceUploadFile",tracker:e.tracker};!function e(){r.multipartList(o,(function(r,a){if(r)return t(r);n.push.apply(n,a.Upload||[]),"true"===a.IsTruncated?(o.KeyMarker=a.NextKeyMarker,o.UploadIdMarker=a.NextUploadIdMarker,e()):t(null,{UploadList:n})}))}()}function d(e,t){var r=this,n=[],o={Bucket:e.Bucket,Region:e.Region,Key:e.Key,UploadId:e.UploadId,calledBySdk:"sliceUploadFile",tracker:e.tracker};!function e(){r.multipartListPart(o,(function(r,a){if(r)return t(r);n.push.apply(n,a.Part||[]),"true"===a.IsTruncated?(o.PartNumberMarker=a.NextPartNumberMarker,e()):t(null,{PartList:n})}))}()}function p(e,t){var r=this,n=e.TaskId,o=e.Bucket,i=e.Region,c=e.Key,u=e.UploadData,l=e.FileSize,d=e.SliceSize,p=Math.min(e.AsyncLimit||r.options.ChunkParallelLimit||1,256),h=e.Body,g=Math.ceil(l/d),m=0,y=e.ServerSideEncryption,v=e.Headers,k=s.filter(u.PartList,(function(e){return e.Uploaded&&(m+=e.PartNumber>=g&&l%d||d),!e.Uploaded})),C=e.onProgress;a.eachLimit(k,p,(function(t,a){if(r._isRunningTask(n)){var s=t.PartNumber,p=Math.min(l,t.PartNumber*d)-(t.PartNumber-1)*d,g=0;f.call(r,{TaskId:n,Bucket:o,Region:i,Key:c,SliceSize:d,FileSize:l,PartNumber:s,ServerSideEncryption:y,Body:h,UploadData:u,Headers:v,onProgress:function(e){m+=e.loaded-g,g=e.loaded,C({loaded:m,total:l})},tracker:e.tracker},(function(e,o){r._isRunningTask(n)&&(e||o.ETag||(e='get ETag error, please add "ETag" to CORS ExposeHeader setting.( 获取ETag失败,请在CORS ExposeHeader设置中添加ETag,请参考文档:https://cloud.tencent.com/document/product/436/13318 )'),e?m-=g:(m+=p-g,t.ETag=o.ETag),C({loaded:m,total:l}),a(e||null,o))}))}}),(function(e){if(r._isRunningTask(n))return e?t(e):void t(null,{UploadId:u.UploadId,SliceList:u.PartList})}))}function f(e,t){var r=this,n=e.TaskId,o=e.Bucket,i=e.Region,c=e.Key,u=e.FileSize,l=e.Body,d=1*e.PartNumber,p=e.SliceSize,f=e.ServerSideEncryption,h=e.UploadData,g=e.Headers||{},m=r.options.ChunkRetryTimes+1,y=p*(d-1),v=p,k=y+p;k>u&&(v=(k=u)-y);var C=["x-cos-traffic-limit","x-cos-mime-limit"],b={};s.each(g,(function(e,t){C.indexOf(t)>-1&&(b[t]=e)}));var S=h.PartList[d-1];a.retry(m,(function(t){r._isRunningTask(n)&&s.fileSlice(l,y,k,!0,(function(a){r.multipartUpload({TaskId:n,Bucket:o,Region:i,Key:c,ContentLength:v,PartNumber:d,UploadId:h.UploadId,ServerSideEncryption:f,Body:a,Headers:b,onProgress:e.onProgress,calledBySdk:"sliceUploadFile",tracker:e.tracker},(function(e,o){if(r._isRunningTask(n))return e?t(e):(S.Uploaded=!0,t(null,o))}))}))}),(function(e,o){if(r._isRunningTask(n))return t(e,o)}))}function h(e,t){var r=e.Bucket,n=e.Region,o=e.Key,i=e.UploadId,s=e.SliceList,c=this,u=this.options.ChunkRetryTimes+1,l=e.Headers,d=s.map((function(e){return{PartNumber:e.PartNumber,ETag:e.ETag}}));a.retry(u,(function(t){c.multipartComplete({Bucket:r,Region:n,Key:o,UploadId:i,Parts:d,Headers:l,calledBySdk:"sliceUploadFile",tracker:e.tracker},t)}),(function(e,r){t(e,r)}))}function g(e,t){var r=e.Bucket,n=e.Region,o=e.Key,i=e.AbortArray,s=e.AsyncLimit||1,c=this,u=0,l=new Array(i.length);a.eachLimit(i,s,(function(t,a){var i=u;if(o&&o!==t.Key)return l[i]={error:{KeyNotMatch:!0}},void a(null);var s=t.UploadId||t.UploadID;c.multipartAbort({Bucket:r,Region:n,Key:t.Key,Headers:e.Headers,UploadId:s},(function(e){var o={Bucket:r,Region:n,Key:t.Key,UploadId:s};l[i]={error:e,task:o},a(null)})),u++}),(function(e){if(e)return t(e);for(var r=[],n=[],o=0,a=l.length;oo?"sliceUploadFile":"putObject";e.tracker=new c({Beacon:r.options.BeaconReporter,clsReporter:r.options.ClsReporter,bucket:e.Bucket,region:e.Region,apiName:"uploadFile",realApi:p,fileKey:e.Key,fileSize:u,accelerate:d,deepTracker:r.options.DeepTracker,customId:r.options.CustomId,delay:r.options.TrackerDelay})}s.each(e,(function(e,t){"object"!==n(e)&&"function"!=typeof e&&(l[t]=e)}));var f=e.onTaskReady;e.onTaskReady=function(e){l.TaskId=e,f&&f(e)};var h=u>o?"sliceUploadFile":"putObject",g=e.onFileFinish;a.push({api:h,params:e,callback:function(r,n){e.tracker&&e.tracker.report(r,n),g&&g(r,n,l),t&&t(r,n)}}),r._addTasks(a)},uploadFiles:function(e,t){var r=this,o=void 0===e.SliceSize?r.options.SliceSize:e.SliceSize,a=0,i=0,u=s.throttleOnProgress.call(r,i,e.onProgress),l=e.files.length,d=e.onFileFinish,p=Array(l),f=function(e,r,n){u(null,!0),d&&d(e,r,n),p[n.Index]={options:n,error:e,data:r},--l<=0&&t&&t(null,{files:p})},h=[];s.each(e.files,(function(e,t){!function(){var l=e.Body,d=l.size||l.length||0,p={Index:t,TaskId:""};if(!r.options.UseRawKey&&e.Key&&"/"===e.Key.substr(0,1)&&(e.Key=e.Key.substr(1)),a+=d,r.options.EnableReporter){var g=r.options.UseAccelerate||"string"==typeof r.options.Domain&&r.options.Domain.includes("accelerate."),m=d>o?"sliceUploadFile":"putObject";e.tracker=new c({Beacon:r.options.BeaconReporter,clsReporter:r.options.ClsReporter,bucket:e.Bucket,region:e.Region,apiName:"uploadFiles",realApi:m,fileKey:e.Key,fileSize:d,accelerate:g,deepTracker:r.options.DeepTracker,customId:r.options.CustomId,delay:r.options.TrackerDelay})}s.each(e,(function(e,t){"object"!==n(e)&&"function"!=typeof e&&(p[t]=e)}));var y=e.onTaskReady;e.onTaskReady=function(e){p.TaskId=e,y&&y(e)};var v=0,k=e.onProgress;e.onProgress=function(e){i=i-v+e.loaded,v=e.loaded,k&&k(e),u({loaded:i,total:a})};var C=d>o?"sliceUploadFile":"putObject",b=e.onFileFinish;h.push({api:C,params:e,callback:function(t,r){e.tracker&&e.tracker.report(t,r),b&&b(t,r),f&&f(t,r,p)}})}()})),r._addTasks(h)},sliceCopyFile:function(e,t){var r=new i,n=this,c=e.Bucket,u=e.Region,l=e.Key,p=e.CopySource,f=s.getSourceParams.call(this,p);if(f){var h=f.Bucket,g=f.Region,y=decodeURIComponent(f.Key),v=void 0===e.CopySliceSize?n.options.CopySliceSize:e.CopySliceSize;v=Math.max(0,v);var k,C,b=e.CopyChunkSize||this.options.CopyChunkSize,S=this.options.CopyChunkParallelLimit,T=this.options.ChunkRetryTimes+1,w=0,R=0,x={},A={},E={};r.on("copy_slice_complete",(function(r){var i={};s.each(e.Headers,(function(e,t){0===t.toLowerCase().indexOf("x-cos-meta-")&&(i[t]=e)}));var d=s.map(r.PartList,(function(e){return{PartNumber:e.PartNumber,ETag:e.ETag}}));a.retry(T,(function(t){n.multipartComplete({Bucket:c,Region:u,Key:l,UploadId:r.UploadId,Parts:d,tracker:e.tracker,calledBySdk:"sliceCopyFile"},t)}),(function(e,n){if(o.removeUsing(r.UploadId),e)return C(null,!0),t(e);o.removeUploadId(r.UploadId),C({loaded:k,total:k},!0),t(null,n)}))})),r.on("get_copy_data_finish",(function(i){var d=o.getCopyFileId(p,x,b,c,l);d&&o.saveUploadId(d,i.UploadId,n.options.UploadIdCacheLimit),o.setUsing(i.UploadId);var f=s.filter(i.PartList,(function(e){return e.Uploaded&&(R+=e.PartNumber>=w&&k%b||b),!e.Uploaded}));a.eachLimit(f,S,(function(t,r){var o=t.PartNumber,s=t.CopySourceRange,d=t.end-t.start;a.retry(T,(function(t){m.call(n,{Bucket:c,Region:u,Key:l,CopySource:p,UploadId:i.UploadId,PartNumber:o,CopySourceRange:s,tracker:e.tracker,calledBySdk:"sliceCopyFile"},t)}),(function(e,n){if(e)return r(e);C({loaded:R+=d,total:k}),t.ETag=n.ETag,r(e||null,n)}))}),(function(e){if(e)return o.removeUsing(i.UploadId),C(null,!0),t(e);r.emit("copy_slice_complete",i)}))})),r.on("get_chunk_size_finish",(function(){var a=function(){n.multipartInit({Bucket:c,Region:u,Key:l,Headers:E,tracker:e.tracker,calledBySdk:"sliceCopyFile"},(function(n,o){if(n)return t(n);e.UploadId=o.UploadId,r.emit("get_copy_data_finish",{UploadId:e.UploadId,PartList:e.PartList})}))},i=o.getCopyFileId(p,x,b,c,l),f=o.getUploadIdList(i);if(!i||!f)return a();!function t(i){if(i>=f.length)return a();var p=f[i];if(o.using[p])return t(i+1);d.call(n,{Bucket:c,Region:u,Key:l,UploadId:p,tracker:e.tracker,calledBySdk:"sliceCopyFile"},(function(n,a){if(n)o.removeUploadId(p),t(i+1);else{if(o.using[p])return t(i+1);var c={},u=0;s.each(a.PartList,(function(e){var t=parseInt(e.Size),r=u+t-1;c[e.PartNumber+"|"+u+"|"+r]=e.ETag,u+=t})),s.each(e.PartList,(function(e){var t=c[e.PartNumber+"|"+e.start+"|"+e.end];t&&(e.ETag=t,e.Uploaded=!0)})),r.emit("get_copy_data_finish",{UploadId:p,PartList:e.PartList})}}))}(0)})),r.on("get_file_size_finish",(function(){if(function(){for(var t=[1,2,4,8,16,32,64,128,256,512,1024,2048,4096,5120],r=1048576,o=0;o11&&(A[t]=e)})),r.emit("get_file_size_finish")}else t(s.error(new Error('get Content-Length error, please add "Content-Length" to CORS ExposeHeader setting.( 获取Content-Length失败,请在CORS ExposeHeader设置中添加Content-Length,请参考文档:https://cloud.tencent.com/document/product/436/13318 )')))}))}else t(s.error(new Error("CopySource format error")))}};e.exports.init=function(e,t){t.transferToTaskMethod(y,"sliceUploadFile"),s.each(y,(function(t,r){e.prototype[r]=s.apiWrapper(r,t)}))}},function(e,t){var r={eachLimit:function(e,t,r,n){if(n=n||function(){},!e.length||t<=0)return n();var o=0,a=0,i=0;!function s(){if(o>=e.length)return n();for(;i=e.length?n():s())}))}()},retry:function(e,t,r){e<1?r():function n(o){t((function(t,a){t&&o