giime 0.1.17 → 0.1.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +4 -4
- package/es/giime/version.d.ts +1 -1
- package/es/giime/version.mjs +1 -1
- package/es/giime/version.mjs.map +1 -1
- package/es/index.css +4 -4
- package/es/utils/src/http/createAxios.mjs +2 -1
- package/es/utils/src/http/createAxios.mjs.map +1 -1
- package/lib/giime/version.d.ts +1 -1
- package/lib/giime/version.js +1 -1
- package/lib/giime/version.js.map +1 -1
- package/lib/index.css +4 -4
- package/lib/utils/src/http/createAxios.js +2 -1
- package/lib/utils/src/http/createAxios.js.map +1 -1
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -692,10 +692,6 @@ video {
|
|
|
692
692
|
margin: 0;
|
|
693
693
|
}
|
|
694
694
|
|
|
695
|
-
[data-v-512cf874] .gmSearchForm .el-form-item {
|
|
696
|
-
margin-right: 8px;
|
|
697
|
-
margin-bottom: 8px;
|
|
698
|
-
}
|
|
699
695
|
[data-v-06213d16] .gmTableNoBorder .el-table__body .el-table__cell {
|
|
700
696
|
border-right: none;
|
|
701
697
|
}
|
|
@@ -726,6 +722,10 @@ video {
|
|
|
726
722
|
.gm-flex-justify-between[data-v-d1c6dac0] {
|
|
727
723
|
justify-content: space-between;
|
|
728
724
|
}
|
|
725
|
+
[data-v-512cf874] .gmSearchForm .el-form-item {
|
|
726
|
+
margin-right: 8px;
|
|
727
|
+
margin-bottom: 8px;
|
|
728
|
+
}
|
|
729
729
|
|
|
730
730
|
.pagination-container[data-v-8a95ba6d] {
|
|
731
731
|
background: #fff;
|
package/es/giime/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "0.1.
|
|
1
|
+
export declare const version = "0.1.18";
|
package/es/giime/version.mjs
CHANGED
package/es/giime/version.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.mjs","sources":["../../../../packages/giime/version.ts"],"sourcesContent":["export const version = '0.1.
|
|
1
|
+
{"version":3,"file":"version.mjs","sources":["../../../../packages/giime/version.ts"],"sourcesContent":["export const version = '0.1.17';\n"],"names":[],"mappings":"AAAO,MAAM,OAAU,GAAA;;;;"}
|
package/es/index.css
CHANGED
|
@@ -692,10 +692,6 @@ video {
|
|
|
692
692
|
margin: 0;
|
|
693
693
|
}
|
|
694
694
|
|
|
695
|
-
[data-v-512cf874] .gmSearchForm .el-form-item {
|
|
696
|
-
margin-right: 8px;
|
|
697
|
-
margin-bottom: 8px;
|
|
698
|
-
}
|
|
699
695
|
[data-v-06213d16] .gmTableNoBorder .el-table__body .el-table__cell {
|
|
700
696
|
border-right: none;
|
|
701
697
|
}
|
|
@@ -726,6 +722,10 @@ video {
|
|
|
726
722
|
.gm-flex-justify-between[data-v-d1c6dac0] {
|
|
727
723
|
justify-content: space-between;
|
|
728
724
|
}
|
|
725
|
+
[data-v-512cf874] .gmSearchForm .el-form-item {
|
|
726
|
+
margin-right: 8px;
|
|
727
|
+
margin-bottom: 8px;
|
|
728
|
+
}
|
|
729
729
|
|
|
730
730
|
.pagination-container[data-v-8a95ba6d] {
|
|
731
731
|
background: #fff;
|
|
@@ -2,6 +2,7 @@ import axios from 'axios';
|
|
|
2
2
|
import { ElMessage } from 'element-plus';
|
|
3
3
|
import Cookies from 'js-cookie';
|
|
4
4
|
import { useLoginStore } from '../../../hooks/store/useLogin/index.mjs';
|
|
5
|
+
import { isNumber } from '../is.mjs';
|
|
5
6
|
import { res401Interceptors } from './interceptors.mjs';
|
|
6
7
|
import { responseErrorMessage } from './errorMessage.mjs';
|
|
7
8
|
|
|
@@ -39,7 +40,7 @@ const createAxios = (config, options) => {
|
|
|
39
40
|
service.interceptors.response.use(
|
|
40
41
|
async (response) => {
|
|
41
42
|
const res = response.data;
|
|
42
|
-
if (!res?.code) {
|
|
43
|
+
if (!isNumber(res?.code)) {
|
|
43
44
|
return response;
|
|
44
45
|
}
|
|
45
46
|
if (res.code === 401) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createAxios.mjs","sources":["../../../../../../packages/utils/src/http/createAxios.ts"],"sourcesContent":["import axios from 'axios';\r\nimport { ElMessage } from 'element-plus';\r\nimport Cookies from 'js-cookie';\r\nimport { useLoginStore } from '@giime/hooks/store/useLogin';\r\nimport { res401Interceptors } from './interceptors';\r\nimport { responseErrorMessage } from './errorMessage';\r\nimport type { AxiosError, CreateAxiosDefaults, InternalAxiosRequestConfig } from 'axios';\r\nexport interface CreateAxiosConfig extends CreateAxiosDefaults {\r\n baseURL: string;\r\n /**服务器调用成功的code 一般是 0 或 200 */\r\n successCode: number;\r\n}\r\n\r\nexport const createAxios = (\r\n config: CreateAxiosConfig,\r\n options?: {\r\n requestInterceptors?: (config: InternalAxiosRequestConfig<any>) => any;\r\n },\r\n) => {\r\n const successCode = config.successCode ?? 0;\r\n const service = axios.create({\r\n withCredentials: true, // send cookies when cross-domain requests\r\n timeout: 120_000,\r\n headers: {\r\n 'content-type': 'application/json',\r\n Accept: '*/*',\r\n },\r\n ...config,\r\n });\r\n\r\n // 请求拦截器\r\n service.interceptors.request.use(\r\n async config => {\r\n const logingStore = useLoginStore();\r\n const _token = Cookies.get('token') ?? logingStore.userToken;\r\n const _user = Cookies.get('sso_user_id') ?? logingStore.userId;\r\n if (!config.params) {\r\n config.params = {};\r\n }\r\n config.params._token = _token;\r\n config.params._user = _user;\r\n config.headers.Authorization = `Bearer ${_token}`;\r\n await options?.requestInterceptors?.(config);\r\n return config;\r\n },\r\n error => {\r\n console.error('请求错误', error); // for debug\r\n return Promise.reject(error);\r\n },\r\n );\r\n // 添加响应拦截器\r\n service.interceptors.response.use(\r\n async response => {\r\n // 对响应数据做点什么\r\n const res = response.data;\r\n if (!res?.code) {\r\n return response;\r\n }\r\n if (res.code === 401) {\r\n const res = await res401Interceptors(service, response.config);\r\n return res;\r\n } else if (res.code !== successCode && res.errCode !== successCode) {\r\n ElMessage({\r\n message: res.comment ?? res.message ?? res.errMsg ?? res.msg,\r\n type: 'error',\r\n grouping: true,\r\n duration: 5 * 1000,\r\n });\r\n }\r\n return response;\r\n },\r\n async (err: AxiosError) => {\r\n console.error(err.config);\r\n if (err?.response?.status === 401 && !err.message.includes('timeout')) {\r\n const res = await res401Interceptors(service, err.config!);\r\n return res;\r\n } else {\r\n // 对响应错误做点什么\r\n responseErrorMessage(err);\r\n return Promise.reject(err);\r\n }\r\n },\r\n );\r\n\r\n return {\r\n service,\r\n };\r\n};\r\n"],"names":["config","res"],"mappings":"
|
|
1
|
+
{"version":3,"file":"createAxios.mjs","sources":["../../../../../../packages/utils/src/http/createAxios.ts"],"sourcesContent":["import axios from 'axios';\r\nimport { ElMessage } from 'element-plus';\r\nimport Cookies from 'js-cookie';\r\nimport { useLoginStore } from '@giime/hooks/store/useLogin';\r\nimport { isNumber } from '../is';\r\nimport { res401Interceptors } from './interceptors';\r\nimport { responseErrorMessage } from './errorMessage';\r\nimport type { AxiosError, CreateAxiosDefaults, InternalAxiosRequestConfig } from 'axios';\r\nexport interface CreateAxiosConfig extends CreateAxiosDefaults {\r\n baseURL: string;\r\n /**服务器调用成功的code 一般是 0 或 200 */\r\n successCode: number;\r\n}\r\n\r\nexport const createAxios = (\r\n config: CreateAxiosConfig,\r\n options?: {\r\n requestInterceptors?: (config: InternalAxiosRequestConfig<any>) => any;\r\n },\r\n) => {\r\n const successCode = config.successCode ?? 0;\r\n const service = axios.create({\r\n withCredentials: true, // send cookies when cross-domain requests\r\n timeout: 120_000,\r\n headers: {\r\n 'content-type': 'application/json',\r\n Accept: '*/*',\r\n },\r\n ...config,\r\n });\r\n\r\n // 请求拦截器\r\n service.interceptors.request.use(\r\n async config => {\r\n const logingStore = useLoginStore();\r\n const _token = Cookies.get('token') ?? logingStore.userToken;\r\n const _user = Cookies.get('sso_user_id') ?? logingStore.userId;\r\n if (!config.params) {\r\n config.params = {};\r\n }\r\n config.params._token = _token;\r\n config.params._user = _user;\r\n config.headers.Authorization = `Bearer ${_token}`;\r\n await options?.requestInterceptors?.(config);\r\n return config;\r\n },\r\n error => {\r\n console.error('请求错误', error); // for debug\r\n return Promise.reject(error);\r\n },\r\n );\r\n // 添加响应拦截器\r\n service.interceptors.response.use(\r\n async response => {\r\n // 对响应数据做点什么\r\n const res = response.data;\r\n if (!isNumber(res?.code)) {\r\n return response;\r\n }\r\n if (res.code === 401) {\r\n const res = await res401Interceptors(service, response.config);\r\n return res;\r\n } else if (res.code !== successCode && res.errCode !== successCode) {\r\n ElMessage({\r\n message: res.comment ?? res.message ?? res.errMsg ?? res.msg,\r\n type: 'error',\r\n grouping: true,\r\n duration: 5 * 1000,\r\n });\r\n }\r\n return response;\r\n },\r\n async (err: AxiosError) => {\r\n console.error(err.config);\r\n if (err?.response?.status === 401 && !err.message.includes('timeout')) {\r\n const res = await res401Interceptors(service, err.config!);\r\n return res;\r\n } else {\r\n // 对响应错误做点什么\r\n responseErrorMessage(err);\r\n return Promise.reject(err);\r\n }\r\n },\r\n );\r\n\r\n return {\r\n service,\r\n };\r\n};\r\n"],"names":["config","res"],"mappings":";;;;;;;;AAca,MAAA,WAAA,GAAc,CACzB,MAAA,EACA,OAGG,KAAA;AACH,EAAM,MAAA,WAAA,GAAc,OAAO,WAAe,IAAA,CAAA,CAAA;AAC1C,EAAM,MAAA,OAAA,GAAU,MAAM,MAAO,CAAA;AAAA,IAC3B,eAAiB,EAAA,IAAA;AAAA;AAAA,IACjB,OAAS,EAAA,IAAA;AAAA,IACT,OAAS,EAAA;AAAA,MACP,cAAgB,EAAA,kBAAA;AAAA,MAChB,MAAQ,EAAA,KAAA;AAAA,KACV;AAAA,IACA,GAAG,MAAA;AAAA,GACJ,CAAA,CAAA;AAGD,EAAA,OAAA,CAAQ,aAAa,OAAQ,CAAA,GAAA;AAAA,IAC3B,OAAMA,OAAU,KAAA;AACd,MAAA,MAAM,cAAc,aAAc,EAAA,CAAA;AAClC,MAAA,MAAM,MAAS,GAAA,OAAA,CAAQ,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AA,CAAA;AAAA,UACR,SAAS,GAAI,CAAA,OAAA,IAAW,IAAI,OAAW,IAAA,GAAA,CAAI,UAAU,GAAI,CAAA,GAAA;AAAA,UACzD,IAAM,EAAA,OAAA;AAAA,UACN,QAAU,EAAA,IAAA;AAAA,UACV,UAAU,CAAI,GAAA,GAAA;AAAA,SACf,CAAA,CAAA;AAAA,OACH;AACA,MAAO,OAAA,QAAA,CAAA;AAAA,KACT;AAAA,IACA,OAAO,GAAoB,KAAA;AACzB,MAAQ,OAAA,CAAA,KAAA,CAAM,IAAI,MAAM,CAAA,CAAA;AACxB,MAAI,IAAA,GAAA,EAAK,UAAU,MAAW,KAAA,GAAA,IAAO,CAAC,GAAI,CAAA,OAAA,CAAQ,QAAS,CAAA,SAAS,CAAG,EAAA;AACrE,QAAA,MAAM,GAAM,GAAA,MAAM,kBAAmB,CAAA,OAAA,EAAS,IAAI,MAAO,CAAA,CAAA;AACzD,QAAO,OAAA,GAAA,CAAA;AAAA,OACF,MAAA;AAEL,QAAA,oBAAA,CAAqB,GAAG,CAAA,CAAA;AACxB,QAAO,OAAA,OAAA,CAAQ,OAAO,GAAG,CAAA,CAAA;AAAA,OAC3B;AAAA,KACF;AAAA,GACF,CAAA;AAEA,EAAO,OAAA;AAAA,IACL,OAAA;AAAA,GACF,CAAA;AACF;;;;"}
|
package/lib/giime/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "0.1.
|
|
1
|
+
export declare const version = "0.1.18";
|
package/lib/giime/version.js
CHANGED
package/lib/giime/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sources":["../../../../packages/giime/version.ts"],"sourcesContent":["export const version = '0.1.
|
|
1
|
+
{"version":3,"file":"version.js","sources":["../../../../packages/giime/version.ts"],"sourcesContent":["export const version = '0.1.17';\n"],"names":[],"mappings":";;AAAO,MAAM,OAAU,GAAA;;;;"}
|
package/lib/index.css
CHANGED
|
@@ -692,10 +692,6 @@ video {
|
|
|
692
692
|
margin: 0;
|
|
693
693
|
}
|
|
694
694
|
|
|
695
|
-
[data-v-512cf874] .gmSearchForm .el-form-item {
|
|
696
|
-
margin-right: 8px;
|
|
697
|
-
margin-bottom: 8px;
|
|
698
|
-
}
|
|
699
695
|
[data-v-06213d16] .gmTableNoBorder .el-table__body .el-table__cell {
|
|
700
696
|
border-right: none;
|
|
701
697
|
}
|
|
@@ -726,6 +722,10 @@ video {
|
|
|
726
722
|
.gm-flex-justify-between[data-v-d1c6dac0] {
|
|
727
723
|
justify-content: space-between;
|
|
728
724
|
}
|
|
725
|
+
[data-v-512cf874] .gmSearchForm .el-form-item {
|
|
726
|
+
margin-right: 8px;
|
|
727
|
+
margin-bottom: 8px;
|
|
728
|
+
}
|
|
729
729
|
|
|
730
730
|
.pagination-container[data-v-8a95ba6d] {
|
|
731
731
|
background: #fff;
|
|
@@ -4,6 +4,7 @@ var axios = require('axios');
|
|
|
4
4
|
var elementPlus = require('element-plus');
|
|
5
5
|
var Cookies = require('js-cookie');
|
|
6
6
|
var index = require('../../../hooks/store/useLogin/index.js');
|
|
7
|
+
var is = require('../is.js');
|
|
7
8
|
var interceptors = require('./interceptors.js');
|
|
8
9
|
var errorMessage = require('./errorMessage.js');
|
|
9
10
|
|
|
@@ -41,7 +42,7 @@ const createAxios = (config, options) => {
|
|
|
41
42
|
service.interceptors.response.use(
|
|
42
43
|
async (response) => {
|
|
43
44
|
const res = response.data;
|
|
44
|
-
if (!res?.code) {
|
|
45
|
+
if (!is.isNumber(res?.code)) {
|
|
45
46
|
return response;
|
|
46
47
|
}
|
|
47
48
|
if (res.code === 401) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createAxios.js","sources":["../../../../../../packages/utils/src/http/createAxios.ts"],"sourcesContent":["import axios from 'axios';\r\nimport { ElMessage } from 'element-plus';\r\nimport Cookies from 'js-cookie';\r\nimport { useLoginStore } from '@giime/hooks/store/useLogin';\r\nimport { res401Interceptors } from './interceptors';\r\nimport { responseErrorMessage } from './errorMessage';\r\nimport type { AxiosError, CreateAxiosDefaults, InternalAxiosRequestConfig } from 'axios';\r\nexport interface CreateAxiosConfig extends CreateAxiosDefaults {\r\n baseURL: string;\r\n /**服务器调用成功的code 一般是 0 或 200 */\r\n successCode: number;\r\n}\r\n\r\nexport const createAxios = (\r\n config: CreateAxiosConfig,\r\n options?: {\r\n requestInterceptors?: (config: InternalAxiosRequestConfig<any>) => any;\r\n },\r\n) => {\r\n const successCode = config.successCode ?? 0;\r\n const service = axios.create({\r\n withCredentials: true, // send cookies when cross-domain requests\r\n timeout: 120_000,\r\n headers: {\r\n 'content-type': 'application/json',\r\n Accept: '*/*',\r\n },\r\n ...config,\r\n });\r\n\r\n // 请求拦截器\r\n service.interceptors.request.use(\r\n async config => {\r\n const logingStore = useLoginStore();\r\n const _token = Cookies.get('token') ?? logingStore.userToken;\r\n const _user = Cookies.get('sso_user_id') ?? logingStore.userId;\r\n if (!config.params) {\r\n config.params = {};\r\n }\r\n config.params._token = _token;\r\n config.params._user = _user;\r\n config.headers.Authorization = `Bearer ${_token}`;\r\n await options?.requestInterceptors?.(config);\r\n return config;\r\n },\r\n error => {\r\n console.error('请求错误', error); // for debug\r\n return Promise.reject(error);\r\n },\r\n );\r\n // 添加响应拦截器\r\n service.interceptors.response.use(\r\n async response => {\r\n // 对响应数据做点什么\r\n const res = response.data;\r\n if (!res?.code) {\r\n return response;\r\n }\r\n if (res.code === 401) {\r\n const res = await res401Interceptors(service, response.config);\r\n return res;\r\n } else if (res.code !== successCode && res.errCode !== successCode) {\r\n ElMessage({\r\n message: res.comment ?? res.message ?? res.errMsg ?? res.msg,\r\n type: 'error',\r\n grouping: true,\r\n duration: 5 * 1000,\r\n });\r\n }\r\n return response;\r\n },\r\n async (err: AxiosError) => {\r\n console.error(err.config);\r\n if (err?.response?.status === 401 && !err.message.includes('timeout')) {\r\n const res = await res401Interceptors(service, err.config!);\r\n return res;\r\n } else {\r\n // 对响应错误做点什么\r\n responseErrorMessage(err);\r\n return Promise.reject(err);\r\n }\r\n },\r\n );\r\n\r\n return {\r\n service,\r\n };\r\n};\r\n"],"names":["config","useLoginStore","res","res401Interceptors","ElMessage","responseErrorMessage"],"mappings":"
|
|
1
|
+
{"version":3,"file":"createAxios.js","sources":["../../../../../../packages/utils/src/http/createAxios.ts"],"sourcesContent":["import axios from 'axios';\r\nimport { ElMessage } from 'element-plus';\r\nimport Cookies from 'js-cookie';\r\nimport { useLoginStore } from '@giime/hooks/store/useLogin';\r\nimport { isNumber } from '../is';\r\nimport { res401Interceptors } from './interceptors';\r\nimport { responseErrorMessage } from './errorMessage';\r\nimport type { AxiosError, CreateAxiosDefaults, InternalAxiosRequestConfig } from 'axios';\r\nexport interface CreateAxiosConfig extends CreateAxiosDefaults {\r\n baseURL: string;\r\n /**服务器调用成功的code 一般是 0 或 200 */\r\n successCode: number;\r\n}\r\n\r\nexport const createAxios = (\r\n config: CreateAxiosConfig,\r\n options?: {\r\n requestInterceptors?: (config: InternalAxiosRequestConfig<any>) => any;\r\n },\r\n) => {\r\n const successCode = config.successCode ?? 0;\r\n const service = axios.create({\r\n withCredentials: true, // send cookies when cross-domain requests\r\n timeout: 120_000,\r\n headers: {\r\n 'content-type': 'application/json',\r\n Accept: '*/*',\r\n },\r\n ...config,\r\n });\r\n\r\n // 请求拦截器\r\n service.interceptors.request.use(\r\n async config => {\r\n const logingStore = useLoginStore();\r\n const _token = Cookies.get('token') ?? logingStore.userToken;\r\n const _user = Cookies.get('sso_user_id') ?? logingStore.userId;\r\n if (!config.params) {\r\n config.params = {};\r\n }\r\n config.params._token = _token;\r\n config.params._user = _user;\r\n config.headers.Authorization = `Bearer ${_token}`;\r\n await options?.requestInterceptors?.(config);\r\n return config;\r\n },\r\n error => {\r\n console.error('请求错误', error); // for debug\r\n return Promise.reject(error);\r\n },\r\n );\r\n // 添加响应拦截器\r\n service.interceptors.response.use(\r\n async response => {\r\n // 对响应数据做点什么\r\n const res = response.data;\r\n if (!isNumber(res?.code)) {\r\n return response;\r\n }\r\n if (res.code === 401) {\r\n const res = await res401Interceptors(service, response.config);\r\n return res;\r\n } else if (res.code !== successCode && res.errCode !== successCode) {\r\n ElMessage({\r\n message: res.comment ?? res.message ?? res.errMsg ?? res.msg,\r\n type: 'error',\r\n grouping: true,\r\n duration: 5 * 1000,\r\n });\r\n }\r\n return response;\r\n },\r\n async (err: AxiosError) => {\r\n console.error(err.config);\r\n if (err?.response?.status === 401 && !err.message.includes('timeout')) {\r\n const res = await res401Interceptors(service, err.config!);\r\n return res;\r\n } else {\r\n // 对响应错误做点什么\r\n responseErrorMessage(err);\r\n return Promise.reject(err);\r\n }\r\n },\r\n );\r\n\r\n return {\r\n service,\r\n };\r\n};\r\n"],"names":["config","useLoginStore","isNumber","res","res401Interceptors","ElMessage","responseErrorMessage"],"mappings":";;;;;;;;;;AAca,MAAA,WAAA,GAAc,CACzB,MAAA,EACA,OAGG,KAAA;AACH,EAAM,MAAA,WAAA,GAAc,OAAO,WAAe,IAAA,CAAA,CAAA;AAC1C,EAAM,MAAA,OAAA,GAAU,MAAM,MAAO,CAAA;AAAA,IAC3B,eAAiB,EAAA,IAAA;AAAA;AAAA,IACjB,OAAS,EAAA,IAAA;AAAA,IACT,OAAS,EAAA;AAAA,MACP,cAAgB,EAAA,kBAAA;AAAA,MAChB,MAAQ,EAAA,KAAA;AAAA,KACV;AAAA,IACA,GAAG,MAAA;AAAA,GACJ,CAAA,CAAA;AAGD,EAAA,OAAA,CAAQ,aAAa,OAAQ,CAAA,GAAA;AAAA,IAC3B,OAAMA,OAAU,KAAA;AACd,MAAA,MAAM,cAAcC,mBAAc,EAAA,CAAA;AAClC,MAAA,MAAM,MAAS,GAAA,OAAA,CAAQ,GAAI,CAAA,OAAO,KAAK,WAAY,CAAA,SAAA,CAAA;AACnD,MAAA,MAAM,KAAQ,GAAA,OAAA,CAAQ,GAAI,CAAA,aAAa,KAAK,WAAY,CAAA,MAAA,CAAA;AACxD,MAAI,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