@snack-kit/core 0.1.0

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.
@@ -0,0 +1,164 @@
1
+ import React from 'react';
2
+ import SnackSDK, { SnackPageCompleteEvent } from '../sdk';
3
+ import { SnackFormAttribute } from '../interface';
4
+ export interface SnackMapItem {
5
+ [name: string]: Snack;
6
+ }
7
+ /**
8
+ * 国际化对象结构
9
+ */
10
+ export interface I18nMap {
11
+ [name: string]: {
12
+ [name: string]: string;
13
+ };
14
+ }
15
+ export interface SnackData {
16
+ $snackSDK?: SnackSDK;
17
+ $i18n?: I18nMap;
18
+ style?: React.CSSProperties;
19
+ eventScripts?: {
20
+ [eventName: string]: {
21
+ script: string;
22
+ };
23
+ };
24
+ formAttr?: SnackFormAttribute;
25
+ parent?: any;
26
+ content?: any;
27
+ children?: any[];
28
+ [key: string]: any;
29
+ }
30
+ export declare class Snack<T extends SnackData = any> {
31
+ data?: T | undefined;
32
+ /**
33
+ * 当前模块名称
34
+ */
35
+ $name: string;
36
+ /**
37
+ * 页面事件对象
38
+ */
39
+ $page?: SnackPageCompleteEvent;
40
+ /**
41
+ * 当前模块唯一id,每次实例化随机生成
42
+ */
43
+ $id: string;
44
+ /**
45
+ * 国际化语言map集合
46
+ */
47
+ private $i18nMap;
48
+ /**
49
+ * 构造函数初始化传入的国际化,当他存在时则优先从此国际化获取数据
50
+ * @private
51
+ */
52
+ private $i18nMapExternal?;
53
+ /**
54
+ * react重绘hook
55
+ */
56
+ private $forceUpdateHook;
57
+ /**
58
+ * 父级容器Snack对象,通常为M的父级容器Drag
59
+ */
60
+ $parent?: Snack;
61
+ /**
62
+ * 重绘id
63
+ */
64
+ private $forceUpdateId;
65
+ /**
66
+ * 是否基础模块
67
+ */
68
+ isBasic: boolean;
69
+ /**
70
+ * 是否容器
71
+ */
72
+ isContainer: boolean;
73
+ /**
74
+ * 是否放置容器
75
+ */
76
+ isDrop: boolean;
77
+ /**
78
+ * 是否拖拽容器
79
+ */
80
+ isDrag: boolean;
81
+ /**
82
+ * 是否页面模版容器
83
+ */
84
+ isTemplate: boolean;
85
+ /**
86
+ * 是否form组件
87
+ */
88
+ isForm: boolean;
89
+ /**
90
+ * 设置模式
91
+ */
92
+ settingMode: boolean;
93
+ /**
94
+ * @para-snack/sdk 实列对象
95
+ */
96
+ sdk: SnackSDK | undefined;
97
+ /**
98
+ * 优先渲染属性
99
+ */
100
+ props?: T;
101
+ /**
102
+ *
103
+ * @param data 统一数据管理对象
104
+ * @param defData data默认值
105
+ */
106
+ constructor(data?: T | undefined, defData?: T);
107
+ cloneData<T>(obj: any): T;
108
+ /**
109
+ * React组件方法
110
+ * @param data 统一数据管理对象(解构覆盖构造函数data参数)
111
+ * @return FunctionComponent
112
+ */
113
+ private $lastUpdateId;
114
+ FC(data: T): React.ReactNode;
115
+ $component(data?: T): React.ReactNode;
116
+ /**
117
+ * 强制渲染JSX内容
118
+ * @param reload 是否强制重绘
119
+ */
120
+ $forceUpdate(reload?: boolean): void;
121
+ /**
122
+ * this.style 样式赋值方法,同时渲染页面
123
+ * @param key
124
+ * @param value
125
+ */
126
+ $style(key?: keyof React.CSSProperties | Record<keyof React.CSSProperties, any>, value?: any): any;
127
+ /**
128
+ * 外部复写,统一销毁方法
129
+ */
130
+ $destroy(): void;
131
+ /**
132
+ * 国际化切换方法
133
+ * @param lang 语言
134
+ */
135
+ $language(lang: string): void;
136
+ get $lang(): string;
137
+ set $lang(lang: string);
138
+ /**
139
+ * 国际化语言包返回
140
+ */
141
+ get $i18n(): I18nMap;
142
+ /**
143
+ * 国际化语言包设置
144
+ * @param map 语言包对象
145
+ */
146
+ set $i18n(map: I18nMap);
147
+ /**
148
+ * 返回外部导入与默认国际化数据
149
+ */
150
+ $getI18n(): {
151
+ external: I18nMap | null;
152
+ default: I18nMap;
153
+ };
154
+ /**
155
+ * 国际化语言获取
156
+ * @param ops 语言变量
157
+ */
158
+ $intl(ops: {
159
+ id: string;
160
+ } | string, params?: object): string | React.JSX.Element;
161
+ $display(b: boolean): import("../interface").DropChildrenItem<any, any, any, any> | undefined;
162
+ protected cloneDeep(data: any, re?: any): any;
163
+ }
164
+ export default Snack;
@@ -0,0 +1,32 @@
1
+ import Snack from './snack';
2
+ export declare class SnackSetting extends Snack {
3
+ /**
4
+ * 继承实体对象
5
+ */
6
+ main: any;
7
+ /**
8
+ * 设置模块用,快速配置页面生成模块
9
+ */
10
+ model: any;
11
+ /**
12
+ * 是否将当前设置按照普通模式渲染,为true则不以弹窗模式渲染
13
+ */
14
+ $normal: boolean;
15
+ $model(): any;
16
+ /**
17
+ * this.data 数据赋值,同时渲染页面
18
+ * @param field 字段名字,支持 . 操作符
19
+ * @param value
20
+ * @param isRefresh
21
+ */
22
+ $setData(field: string, value?: any, isRefresh?: boolean): any;
23
+ /**
24
+ * 支持 . 操作符设置对象数据
25
+ * @param data
26
+ * @param field
27
+ * @param value
28
+ * @param parseExpr 是否解析表达式
29
+ * @private
30
+ */
31
+ private setFieldValue;
32
+ }
@@ -0,0 +1,27 @@
1
+ import React from 'react';
2
+ import VueESM from 'vue/dist/vue.esm.js';
3
+ import Snack from './snack';
4
+ interface DataPorps<T = any> extends VueESM {
5
+ [key: string]: T;
6
+ }
7
+ export declare class SnackVue extends Snack {
8
+ /**
9
+ * vue 实例
10
+ */
11
+ $vue: null | VueESM;
12
+ /**
13
+ * React组件方法
14
+ * @return FunctionComponent
15
+ */
16
+ FC(): React.ReactNode;
17
+ /**
18
+ * 组件函数
19
+ */
20
+ $component(): DataPorps;
21
+ /**
22
+ * 强制渲染JSX内容
23
+ */
24
+ $forceUpdate(): void;
25
+ }
26
+ export default SnackVue;
27
+ export declare const Vue: any;
@@ -0,0 +1,30 @@
1
+ import SnackVue from "./snackVue";
2
+ export declare class SnackVueSetting extends SnackVue {
3
+ /**
4
+ * 继承实体对象
5
+ */
6
+ main: any;
7
+ /**
8
+ * 设置模块用,快速配置页面生成模块
9
+ */
10
+ model: any;
11
+ /**
12
+ * 是否将当前设置按照普通模式渲染,为true则不以弹窗模式渲染
13
+ */
14
+ $normal: boolean;
15
+ $model(): any;
16
+ /**
17
+ * this.data 数据赋值,同时渲染页面
18
+ * @param key
19
+ * @param value
20
+ * @param isRefresh
21
+ */
22
+ $setData(field: string, value?: any, isRefresh?: boolean): any;
23
+ /**
24
+ * 支持 . 操作符设置对象数据
25
+ * @param data
26
+ * @param field
27
+ * @private
28
+ */
29
+ private setFieldValue;
30
+ }
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ import './index.scss';
3
+ interface Props {
4
+ content?: string | React.ReactNode;
5
+ sub?: string | React.ReactNode;
6
+ info?: string | React.ReactNode;
7
+ }
8
+ export declare const Error: (props: Props) => React.JSX.Element;
9
+ export default Error;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import './index.scss';
3
+ interface Props {
4
+ text?: string | React.ReactNode;
5
+ className?: string;
6
+ size?: number;
7
+ }
8
+ export declare const Loading: (props: Props) => React.JSX.Element;
9
+ export default Loading;
@@ -0,0 +1,150 @@
1
+ /**
2
+ * @author 刘佳
3
+ * @date 2021/8/2 1:59 下午
4
+ * @description Snack Core
5
+ */
6
+ import React from 'react';
7
+ import Snack, { SnackData } from '../class/snack';
8
+ import { I18nData } from '../utils/i18n';
9
+ import { CoreConfig, LoadModuleConfig, LoadConfig, LoadModuleURLConfig, SnackFormAttribute, ImportModules, SnackPageContentModule } from '../interface';
10
+ type SnackMaps = {
11
+ [name: string]: Snack;
12
+ };
13
+ type SDKEvent = 'onComplete' | string;
14
+ type ExprContext = {
15
+ [key: string]: any;
16
+ };
17
+ export declare class Core {
18
+ require: any;
19
+ define: any;
20
+ runtime: boolean;
21
+ runtimeMapping: {
22
+ [id: string]: string;
23
+ };
24
+ service: string;
25
+ cdnUrl?: string;
26
+ cdnPath: string;
27
+ modUrl?: string;
28
+ modPath: string;
29
+ pageUrl: string;
30
+ pagePath: string;
31
+ staticUrl?: string;
32
+ importMaps: {
33
+ [mod: string]: any;
34
+ };
35
+ basicsType: string;
36
+ moduleMaps: SnackMaps;
37
+ global: {
38
+ [key: string]: any;
39
+ };
40
+ message: {
41
+ [key: string]: any;
42
+ };
43
+ i18n: I18nData;
44
+ defaultFormAttr: SnackFormAttribute;
45
+ importModules: ImportModules;
46
+ localeMapping: {
47
+ [locale: string]: string;
48
+ };
49
+ localeDefault: string;
50
+ argv: CoreConfig['argv'];
51
+ /**
52
+ * Core初始化构造函数
53
+ * @param {CoreConfig}
54
+ * @param importMaps 依赖对象导入
55
+ */
56
+ constructor({ runtime, runtimeMapping, service, cdnUrl, cdnPath, modUrl, modPath, pageUrl, pagePath, staticUrl, importMaps, basicsType, defaultFormAttr, importModules, i18n, localeMapping, localeDefault, message, argv }: CoreConfig);
57
+ /**
58
+ * 事件存储对象
59
+ * @private
60
+ */
61
+ private eventList;
62
+ /**
63
+ * 注册事件
64
+ * @param eventName 事件名称
65
+ * @param cb 事件回调函数
66
+ */
67
+ addEvent(eventName: SDKEvent, cb: Function): boolean;
68
+ /**
69
+ * 移除事件
70
+ * @param eventName 事件名称
71
+ * @param cb 解除绑定的事件回调
72
+ */
73
+ removeEvent(eventName: SDKEvent, cb?: Function): boolean;
74
+ /**
75
+ * 发送事件
76
+ * @param eventName 事件名称
77
+ * @param args 事件方法参数
78
+ */
79
+ sendEvent(eventName: SDKEvent, args?: any[]): boolean;
80
+ /**
81
+ * 按模块名称加载模块
82
+ * @param {LoadModuleConfig}
83
+ * @param callback 回调方法,存在该参数则Promises失效
84
+ * @return Snack 模块键值对 {snackName:snackClass}
85
+ */
86
+ module({ module, service, cdnUrl, cdnPath, modUrl, modPath, staticUrl, importMaps, config }: LoadModuleConfig, callback?: (snack: SnackMaps) => void): Promise<void | SnackMaps>;
87
+ /**
88
+ * 按模块地址加载模块
89
+ * @param {LoadModuleURLConfig}
90
+ * @param callback 回调方法,存在该参数则Promises失效
91
+ * @return Snack 模块键值对 {snackName:snackClass}
92
+ */
93
+ moduleURL({ urls, cdnUrl, staticUrl, importMaps, config }: LoadModuleURLConfig, callback?: (snack: SnackMaps) => void): Promise<SnackMaps | null>;
94
+ private addSnack;
95
+ /**
96
+ * umd模块加载方法
97
+ * @param {LoadConfig} snack模块js地址
98
+ * @return Snack 模块类对象
99
+ */
100
+ load({ url, config, importMaps }: LoadConfig): Promise<{} | Error>;
101
+ /**
102
+ * 移除模块
103
+ * @param id snack模块的 $id
104
+ * @param forceUpdate 是否调用$forceUpdate
105
+ */
106
+ remove(id: string, forceUpdate?: boolean): false | undefined;
107
+ /**
108
+ * 清空挂载在sdk内的所有模块
109
+ * @param forceUpdate 是否调用$forceUpdate
110
+ */
111
+ empty(forceUpdate?: boolean): void;
112
+ /**
113
+ * 全局Snack模块语言切换方法
114
+ * @param l 语言,默认 'zh'
115
+ */
116
+ language: (l?: string) => void;
117
+ /**
118
+ * 国际化数据导入
119
+ * @param data
120
+ */
121
+ setI18n(data: I18nData): void;
122
+ /**
123
+ * 获取国际化文本
124
+ * @param ops
125
+ * @param params
126
+ */
127
+ intl(ops: string | {
128
+ id: string;
129
+ }, params?: object): string | React.ReactNode;
130
+ /**
131
+ * 组件数据解析表达式
132
+ * @param data
133
+ */
134
+ exprParseByData(data?: SnackPageContentModule): SnackPageContentModule | undefined;
135
+ private exprRegx;
136
+ private checkHasExpr;
137
+ private evaluateExpression;
138
+ processTemplateString(template: string, context: ExprContext): string;
139
+ recursiveParseJson(obj: SnackData, context: ExprContext, filterPrototype?: boolean): SnackData;
140
+ /**
141
+ * 表达式入参
142
+ */
143
+ getExprArgv(data: any): ExprArgv;
144
+ }
145
+ export type ExprArgv = {
146
+ argv: CoreConfig['argv'];
147
+ sdk: Core;
148
+ data: any;
149
+ };
150
+ export default Core;
package/dist/core.js ADDED
@@ -0,0 +1,4 @@
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("@paraview/lib")):"function"==typeof define&&define.amd?define(["react","@paraview/lib"],t):"object"==typeof exports?exports.SnackCore=t(require("react"),require("@paraview/lib")):e.SnackCore=t(e.react,e["@paraview/lib"])}(self,(function(__WEBPACK_EXTERNAL_MODULE__155__,__WEBPACK_EXTERNAL_MODULE__663__){return function(){"use strict";var __webpack_modules__={839:function(e,t,r){r.d(t,{Is:function(){return a}});var i=r(155),n=r.n(i),o=r(663);function a(e,t,r,i,n,a){var c,u,p,l,d=function(e,t){var r=null==e?void 0:e.localeMapping,i=t||(0,o.GetLanguage)();return r&&void 0!==r[i]?r[i]:i}(e,n);if("string"==typeof t)l=t;else if("object"==typeof t){if("string"!=typeof t.id)return'i18n intl object "id" is missing';l=t.id}if(void 0!==l){var f=r[d]||r[e.localeDefault];"object"==typeof f&&(p=f[l]),void 0===p&&a&&(p=(null===(c=a[d])||void 0===c?void 0:c[l])||(null===(u=a[e.localeDefault])||void 0===u?void 0:u[l]))}return"string"!=typeof p?"{".concat(l,"}"):s(p,i)}var s=function(e,t){if(!t)return e;e=e.replace(/\"/g,'\\"');var r=/({[^{}]+})/g,i=e.split(r),o=!1,a=i.map((function(e){if(e.match(r)){var i=e.replace(/({|})/g,""),n=function(e,t,r){for(var i=e,n=0,o=t.replace(/\[(\d+)\]/g,".$1").split(".");n<o.length;n++){var a=o[n];if(void 0===(i=Object(i)[a]))return r}return i}(t,i);return n&&n.$$typeof&&(o=!0),void 0===n?i:n}return e}));return a.length&&o?n().createElement(n().Fragment,null,a):a.join("")}},339:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){var __webpack_unused_export__;function _default(global,importMaps){function _instanceof(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function _typeof(e){return _typeof="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},_typeof(e)}
2
+ /**
3
+ * @license Snack RequireJS 2.3.6
4
+ */var requirejs,require,define,req,s,head,baseElement,dataMain,src,interactiveScript,currentlyAddingScript,mainScript,subPath,version="2.3.6",commentRegExp=/\/\*[\s\S]*?\*\/|([^:"'=]|^)\/\/.*$/gm,cjsRequireRegExp=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,jsSuffixRegExp=/\.js$/,currDirRegExp=/^\.\//,op=Object.prototype,ostring=op.toString,hasOwn=op.hasOwnProperty,isBrowser=!("undefined"==typeof window||"undefined"==typeof navigator||!window.document),isWebWorker=!isBrowser&&"undefined"!=typeof importScripts,readyRegExp=isBrowser&&"PLAYSTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/,defContextName="_",isOpera="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),contexts={},cfg={},globalDefQueue=[],useInteractive=!1;function commentReplace(e,t){return t||""}function isFunction(e){return"[object Function]"===ostring.call(e)}function isArray(e){return"[object Array]"===ostring.call(e)}function each(e,t){var r;if(e)for(r=0;r<e.length&&(!e[r]||!t(e[r],r,e));r+=1);}function eachReverse(e,t){var r;if(e)for(r=e.length-1;r>-1&&(!e[r]||!t(e[r],r,e));r-=1);}function hasProp(e,t){return hasOwn.call(e,t)}function getOwn(e,t){return hasProp(e,t)&&e[t]}function eachProp(e,t){var r;for(r in e)if(hasProp(e,r)&&t(e[r],r))break}function mixin(e,t,r,i){return t&&eachProp(t,(function(t,n){!r&&hasProp(e,n)||(!i||"object"!==_typeof(t)||!t||isArray(t)||isFunction(t)||_instanceof(t,RegExp)?e[n]=t:(e[n]||(e[n]={}),mixin(e[n],t,r,i)))})),e}function bind(e,t){return function(){return t.apply(e,arguments)}}function scripts(){return document.getElementsByTagName("script")}function defaultOnError(e){throw e}function getGlobal(e){if(!e)return e;var t=global;return each(e.split("."),(function(e){t=t[e]})),t}function makeError(e,t,r,i){var n=new Error(t+e);return n.requireType=e,n.requireModules=i,r&&(n.originalError=r),n}if(void 0===define){if(void 0!==requirejs){if(isFunction(requirejs))return;cfg=requirejs,requirejs=void 0}return void 0===require||isFunction(require)||(cfg=require,require=void 0),req=requirejs=function(e,t,r,i){var n,o,a=defContextName;return isArray(e)||"string"==typeof e||(o=e,isArray(t)?(e=t,t=r,r=i):e=[]),o&&o.context&&(a=o.context),(n=getOwn(contexts,a))||(n=contexts[a]=req.s.newContext(a)),o&&n.configure(o),n.require(e,t,r)},req.config=function(e){return req(e)},req.nextTick="undefined"!=typeof setTimeout?function(e){setTimeout(e,4)}:function(e){e()},require||(require=req),req.version=version,req.jsExtRegExp=/^\/|:|\?|\.js$/,req.isBrowser=isBrowser,s=req.s={contexts:contexts,newContext:newContext},req({}),each(["toUrl","undef","defined","specified"],(function(e){req[e]=function(){var t=contexts[defContextName];return t.require[e].apply(t,arguments)}})),isBrowser&&(head=s.head=document.getElementsByTagName("head")[0],baseElement=document.getElementsByTagName("base")[0],baseElement&&(head=s.head=baseElement.parentNode)),req.onError=defaultOnError,req.createNode=function(e,t,r){var i=e.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script");return i.type=e.scriptType||"text/javascript",i.charset="utf-8",i.async=!0,i},req.load=function(e,t,r){var i,n=e&&e.config||{};if(isBrowser)return(i=req.createNode(n,t,r)).setAttribute("data-requirecontext",e.contextName),i.setAttribute("data-requiremodule",t),!i.attachEvent||i.attachEvent.toString&&i.attachEvent.toString().indexOf("[native code")<0||isOpera?(i.addEventListener("load",e.onScriptLoad,!1),i.addEventListener("error",e.onScriptError,!1)):(useInteractive=!0,i.attachEvent("onreadystatechange",e.onScriptLoad)),importMaps[t]?e.onScriptLoad({id:t,node:req.createNode(n,t,r),type:"noload"}):i.src=r,n.onNodeCreated&&n.onNodeCreated(i,n,t,r),currentlyAddingScript=i,baseElement?head.insertBefore(i,baseElement):head.appendChild(i),currentlyAddingScript=null,i;if(isWebWorker)try{setTimeout((function(){}),0),importScripts(r),e.completeLoad(t)}catch(i){e.onError(makeError("importscripts","importScripts failed for "+t+" at "+r,i,[t]))}},isBrowser&&!cfg.skipDataMain&&eachReverse(scripts(),(function(e){if(head||(head=e.parentNode),dataMain=e.getAttribute("data-main"))return mainScript=dataMain,cfg.baseUrl||-1!==mainScript.indexOf("!")||(src=mainScript.split("/"),mainScript=src.pop(),subPath=src.length?src.join("/")+"/":"./",cfg.baseUrl=subPath),mainScript=mainScript.replace(jsSuffixRegExp,""),req.jsExtRegExp.test(mainScript)&&(mainScript=dataMain),cfg.deps=cfg.deps?cfg.deps.concat(mainScript):[mainScript],!0})),define=function(e,t,r){var i,n,o=function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return o.forEach((function(e,t){if(importMaps[e]){var i=importMaps[e];r[t]=i}})),t.apply(this,r)};"string"!=typeof e&&(r=o,o=e,e=null),isArray(o)||(r=o,o=null),!o&&isFunction(r)&&(o=[],r.length&&(r.toString().replace(commentRegExp,commentReplace).replace(cjsRequireRegExp,(function(e,t){o.push(t)})),o=(1===r.length?["require"]:["require","exports","module"]).concat(o))),useInteractive&&(i=currentlyAddingScript||getInteractiveScript())&&(e||(e=i.getAttribute("data-requiremodule")),n=contexts[i.getAttribute("data-requirecontext")]),n?(n.defQueue.push([e,o,r]),n.defQueueMap[e]=!0):globalDefQueue.push([e,o,r])},define.amd={jQuery:!0},req.exec=function(text){return eval(text)},req(cfg),{requirejs:requirejs,require:require,define:define}}function newContext(e){var t,r,i,n,o,a={waitSeconds:50,baseUrl:"./",paths:{},bundles:{},pkgs:{},shim:{},config:{}},s={},c={},u={},p=[],l={},d={},f={},h=1,m=1;function g(e,t,r){var i,n,o,s,c,u,p,l,d,f,h=t&&t.split("/"),m=a.map,g=m&&m["*"];if(e&&(u=(e=e.split("/")).length-1,a.nodeIdCompat&&jsSuffixRegExp.test(e[u])&&(e[u]=e[u].replace(jsSuffixRegExp,"")),"."===e[0].charAt(0)&&h&&(e=h.slice(0,h.length-1).concat(e)),function(e){var t,r;for(t=0;t<e.length;t++)if("."===(r=e[t]))e.splice(t,1),t-=1;else if(".."===r){if(0===t||1===t&&".."===e[2]||".."===e[t-1])continue;t>0&&(e.splice(t-1,2),t-=2)}}(e),e=e.join("/")),r&&m&&(h||g)){e:for(o=(n=e.split("/")).length;o>0;o-=1){if(c=n.slice(0,o).join("/"),h)for(s=h.length;s>0;s-=1)if((i=getOwn(m,h.slice(0,s).join("/")))&&(i=getOwn(i,c))){p=i,l=o;break e}!d&&g&&getOwn(g,c)&&(d=getOwn(g,c),f=o)}!p&&d&&(p=d,l=f),p&&(n.splice(0,l,p),e=n.join("/"))}return getOwn(a.pkgs,e)||e}function v(e){isBrowser&&each(scripts(),(function(t){if(t.getAttribute("data-requiremodule")===e&&t.getAttribute("data-requirecontext")===i.contextName)return t.parentNode.removeChild(t),!0}))}function _(e){var t=getOwn(a.paths,e);if(t&&isArray(t)&&t.length>1)return t.shift(),i.require.undef(e),i.makeRequire(null,{skipMap:!0})([e]),!0}function b(e){var t,r=e?e.indexOf("!"):-1;return r>-1&&(t=e.substring(0,r),e=e.substring(r+1,e.length)),[t,e]}function y(e,t,r,n){var o,a,s,c,u=null,p=t?t.name:null,d=e,f=!0,v="";return e||(f=!1,e="_@r"+(h+=1)),u=(c=b(e))[0],e=c[1],u&&(u=g(u,p,n),a=getOwn(l,u)),e&&(u?v=r?e:a&&a.normalize?a.normalize(e,(function(e){return g(e,p,n)})):-1===e.indexOf("!")?g(e,p,n):e:(u=(c=b(v=g(e,p,n)))[0],v=c[1],r=!0,o=i.nameToUrl(v))),{prefix:u,name:v,parentMap:t,unnormalized:!!(s=!u||a||r?"":"_unnormalized"+(m+=1)),url:o,originalName:d,isDefine:f,id:(u?u+"!"+v:v)+s}}function x(e){var t=e.id,r=getOwn(s,t);return r||(r=s[t]=new i.Module(e)),r}function w(e,t,r){var i=e.id,n=getOwn(s,i);!hasProp(l,i)||n&&!n.defineEmitComplete?(n=x(e)).error&&"error"===t?r(n.error):n.on(t,r):"defined"===t&&r(l[i])}function E(e,t){var r=e.requireModules,i=!1;t?t(e):(each(r,(function(t){var r=getOwn(s,t);r&&(r.error=e,r.events.error&&(i=!0,r.emit("error",e)))})),i||req.onError(e))}function q(){globalDefQueue.length&&(each(globalDefQueue,(function(e){var t=e[0];"string"==typeof t&&(i.defQueueMap[t]=!0),p.push(e)})),globalDefQueue=[])}function k(e){delete s[e],delete c[e]}function M(e,t,r){var i=e.map.id;e.error?e.emit("error",e.error):(t[i]=!0,each(e.depMaps,(function(i,n){var o=i.id,a=getOwn(s,o);!a||e.depMatched[n]||r[o]||(getOwn(t,o)?(e.defineDep(n,l[o]),e.check()):M(a,t,r))})),r[i]=!0)}function S(e){var r,n,s=1e3*a.waitSeconds,u=s&&i.startTime+s<(new Date).getTime(),p=[],l=[],d=!1,f=!0;if(!t){if(t=!0,eachProp(c,(function(e){var t=e.map,r=t.id;if(e.enabled&&(t.isDefine||l.push(e),!e.error))if(!e.inited&&u)_(r)?(n=!0,d=!0):(p.push(r),v(r));else if(!e.inited&&e.fetched&&t.isDefine&&(d=!0,!t.prefix))return f=!1})),u&&p.length)return(r=makeError("timeout","Load timeout for modules: "+p,null,p)).contextName=i.contextName,E(r);f&&each(l,(function(e){M(e,{},{})})),u&&!n||!d||!isBrowser&&!isWebWorker||o||(o=setTimeout((function(){o=0,S()}),50)),t=!1}}function O(e){hasProp(l,e[0])||x(y(e[0],null,!0)).init(e[1],e[2])}function j(e,t,r,i){e.detachEvent&&!isOpera?i&&e.detachEvent(i,t):e.removeEventListener(r,t,!1)}function P(e){var t=e.currentTarget||e.srcElement;return j(t,i.onScriptLoad,"load","onreadystatechange"),j(t,i.onScriptError,"error"),{node:t,id:t&&t.getAttribute("data-requiremodule")}}function A(){var e;for(q();p.length;){if(null===(e=p.shift())[0])return E(makeError("mismatch","Mismatched anonymous define() module: "+e[e.length-1]));O(e)}i.defQueueMap={}}return n={require:function(e){return e.require?e.require:e.require=i.makeRequire(e.map)},exports:function(e){if(e.usingExports=!0,e.map.isDefine)return e.exports?l[e.map.id]=e.exports:e.exports=l[e.map.id]={}},module:function(e){return e.module?e.module:e.module={id:e.map.id,uri:e.map.url,config:function(){return getOwn(a.config,e.map.id)||{}},exports:e.exports||(e.exports={})}}},(r=function(e){this.events=getOwn(u,e.id)||{},this.map=e,this.shim=getOwn(a.shim,e.id),this.depExports=[],this.depMaps=[],this.depMatched=[],this.pluginMaps={},this.depCount=0}).prototype={init:function(e,t,r,i){i=i||{},this.inited||(this.factory=t,r?this.on("error",r):this.events.error&&(r=bind(this,(function(e){this.emit("error",e)}))),this.depMaps=e&&e.slice(0),this.errback=r,this.inited=!0,this.ignore=i.ignore,i.enabled||this.enabled?this.enable():this.check())},defineDep:function(e,t){this.depMatched[e]||(this.depMatched[e]=!0,this.depCount-=1,this.depExports[e]=t)},fetch:function(){if(!this.fetched){this.fetched=!0,i.startTime=(new Date).getTime();var e=this.map;if(!this.shim)return e.prefix?this.callPlugin():this.load();i.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],bind(this,(function(){return e.prefix?this.callPlugin():this.load()})))}},load:function(){var e=this.map.url;d[e]||(d[e]=!0,i.load(this.map.id,e))},check:function(){if(this.enabled&&!this.enabling){var e,t,r=this.map.id,n=this.depExports,o=this.exports,a=this.factory;if(this.inited){if(this.error)this.emit("error",this.error);else if(!this.defining){if(this.defining=!0,this.depCount<1&&!this.defined){if(isFunction(a)){if(this.events.error&&this.map.isDefine||req.onError!==defaultOnError)try{o=i.execCb(r,a,n,o)}catch(t){e=t}else o=i.execCb(r,a,n,o);if(this.map.isDefine&&void 0===o&&((t=this.module)?o=t.exports:this.usingExports&&(o=this.exports)),e)return e.requireMap=this.map,e.requireModules=this.map.isDefine?[this.map.id]:null,e.requireType=this.map.isDefine?"define":"require",E(this.error=e)}else o=a;if(this.exports=o,this.map.isDefine&&!this.ignore&&(l[r]=o,req.onResourceLoad)){var s=[];each(this.depMaps,(function(e){s.push(e.normalizedMap||e)})),req.onResourceLoad(i,this.map,s)}k(r),this.defined=!0}this.defining=!1,this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}}else hasProp(i.defQueueMap,r)||this.fetch()}},callPlugin:function(){var e=this.map,t=e.id,r=y(e.prefix);this.depMaps.push(r),w(r,"defined",bind(this,(function(r){var n,o,c,u=getOwn(f,this.map.id),p=this.map.name,l=this.map.parentMap?this.map.parentMap.name:null,d=i.makeRequire(e.parentMap,{enableBuildCallback:!0});return this.map.unnormalized?(r.normalize&&(p=r.normalize(p,(function(e){return g(e,l,!0)}))||""),w(o=y(e.prefix+"!"+p,this.map.parentMap,!0),"defined",bind(this,(function(e){this.map.normalizedMap=o,this.init([],(function(){return e}),null,{enabled:!0,ignore:!0})}))),void((c=getOwn(s,o.id))&&(this.depMaps.push(o),this.events.error&&c.on("error",bind(this,(function(e){this.emit("error",e)}))),c.enable()))):u?(this.map.url=i.nameToUrl(u),void this.load()):((n=bind(this,(function(e){this.init([],(function(){return e}),null,{enabled:!0})}))).error=bind(this,(function(e){this.inited=!0,this.error=e,e.requireModules=[t],eachProp(s,(function(e){0===e.map.id.indexOf(t+"_unnormalized")&&k(e.map.id)})),E(e)})),n.fromText=bind(this,(function(r,o){var s=e.name,c=y(s),u=useInteractive;o&&(r=o),u&&(useInteractive=!1),x(c),hasProp(a.config,t)&&(a.config[s]=a.config[t]);try{req.exec(r)}catch(e){return E(makeError("fromtexteval","fromText eval for "+t+" failed: "+e,e,[t]))}u&&(useInteractive=!0),this.depMaps.push(c),i.completeLoad(s),d([s],n)})),void r.load(e.name,d,n,a))}))),i.enable(r,this),this.pluginMaps[r.id]=r},enable:function(){c[this.map.id]=this,this.enabled=!0,this.enabling=!0,each(this.depMaps,bind(this,(function(e,t){var r,o,a;if("string"==typeof e){if(e=y(e,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap),this.depMaps[t]=e,a=getOwn(n,e.id))return void(this.depExports[t]=a(this));this.depCount+=1,w(e,"defined",bind(this,(function(e){this.undefed||(this.defineDep(t,e),this.check())}))),this.errback?w(e,"error",bind(this,this.errback)):this.events.error&&w(e,"error",bind(this,(function(e){this.emit("error",e)})))}r=e.id,o=s[r],hasProp(n,r)||!o||o.enabled||i.enable(e,this)}))),eachProp(this.pluginMaps,bind(this,(function(e){var t=getOwn(s,e.id);t&&!t.enabled&&i.enable(e,this)}))),this.enabling=!1,this.check()},on:function(e,t){var r=this.events[e];r||(r=this.events[e]=[]),r.push(t)},emit:function(e,t){each(this.events[e],(function(e){e(t)})),"error"===e&&delete this.events[e]}},i={config:a,contextName:e,registry:s,defined:l,urlFetched:d,defQueue:p,defQueueMap:{},Module:r,makeModuleMap:y,nextTick:req.nextTick,onError:E,configure:function(e){if(e.baseUrl&&"/"!==e.baseUrl.charAt(e.baseUrl.length-1)&&(e.baseUrl+="/"),"string"==typeof e.urlArgs){var t=e.urlArgs;e.urlArgs=function(e,r){return(-1===r.indexOf("?")?"?":"&")+t}}var r=a.shim,n={paths:!0,bundles:!0,config:!0,map:!0};eachProp(e,(function(e,t){n[t]?(a[t]||(a[t]={}),mixin(a[t],e,!0,!0)):a[t]=e})),e.bundles&&eachProp(e.bundles,(function(e,t){each(e,(function(e){e!==t&&(f[e]=t)}))})),e.shim&&(eachProp(e.shim,(function(e,t){isArray(e)&&(e={deps:e}),!e.exports&&!e.init||e.exportsFn||(e.exportsFn=i.makeShimExports(e)),r[t]=e})),a.shim=r),e.packages&&each(e.packages,(function(e){var t;t=(e="string"==typeof e?{name:e}:e).name,e.location&&(a.paths[t]=e.location),a.pkgs[t]=e.name+"/"+(e.main||"main").replace(currDirRegExp,"").replace(jsSuffixRegExp,"")})),eachProp(s,(function(e,t){e.inited||e.map.unnormalized||(e.map=y(t,null,!0))})),(e.deps||e.callback)&&i.require(e.deps||[],e.callback)},makeShimExports:function(e){return function(){var t;return e.init&&(t=e.init.apply(global,arguments)),t||e.exports&&getGlobal(e.exports)}},makeRequire:function(t,r){function o(a,c,u){var p,d;return r.enableBuildCallback&&c&&isFunction(c)&&(c.__requireJsBuild=!0),"string"==typeof a?isFunction(c)?E(makeError("requireargs","Invalid require call"),u):t&&hasProp(n,a)?n[a](s[t.id]):req.get?req.get(i,a,t,o):(p=y(a,t,!1,!0).id,hasProp(l,p)?l[p]:E(makeError("notloaded",'Module name "'+p+'" has not been loaded yet for context: '+e+(t?"":". Use require([])")))):(A(),i.nextTick((function(){A(),(d=x(y(null,t))).skipMap=r.skipMap,d.init(a,c,u,{enabled:!0}),S()})),o)}return r=r||{},mixin(o,{isBrowser:isBrowser,toUrl:function(e){var r,n=e.lastIndexOf("."),o=e.split("/")[0];return-1!==n&&(!("."===o||".."===o)||n>1)&&(r=e.substring(n,e.length),e=e.substring(0,n)),i.nameToUrl(g(e,t&&t.id,!0),r,!0)},defined:function(e){return hasProp(l,y(e,t,!1,!0).id)},specified:function(e){return e=y(e,t,!1,!0).id,hasProp(l,e)||hasProp(s,e)}}),t||(o.undef=function(e){q();var r=y(e,t,!0),n=getOwn(s,e);n.undefed=!0,v(e),delete l[e],delete d[r.url],delete u[e],eachReverse(p,(function(t,r){t[0]===e&&p.splice(r,1)})),delete i.defQueueMap[e],n&&(n.events.defined&&(u[e]=n.events),k(e))}),o},enable:function(e){getOwn(s,e.id)&&x(e).enable()},completeLoad:function(e){var t,r,n,o=getOwn(a.shim,e)||{},c=o.exports;for(q();p.length;){if(null===(r=p.shift())[0]){if(r[0]=e,t)break;t=!0}else r[0]===e&&(t=!0);O(r)}if(i.defQueueMap={},n=getOwn(s,e),!t&&!hasProp(l,e)&&n&&!n.inited){if(!(!a.enforceDefine||c&&getGlobal(c)))return _(e)?void 0:E(makeError("nodefine","No define call for "+e,null,[e]));O([e,o.deps||[],o.exportsFn])}S()},nameToUrl:function(e,t,r){var n,o,s,c,u,p,l=getOwn(a.pkgs,e);if(l&&(e=l),p=getOwn(f,e))return i.nameToUrl(p,t,r);if(req.jsExtRegExp.test(e))c=e+(t||"");else{for(n=a.paths,s=(o=e.split("/")).length;s>0;s-=1)if(u=getOwn(n,o.slice(0,s).join("/"))){isArray(u)&&(u=u[0]),o.splice(0,s,u);break}c=o.join("/"),c=("/"===(c+=t||(/^data\:|^blob\:|\?/.test(c)||r?"":".js")).charAt(0)||c.match(/^[\w\+\.\-]+:/)?"":a.baseUrl)+c}return a.urlArgs&&!/^blob\:/.test(c)?c+a.urlArgs(e,c):c},load:function(e,t){req.load(i,e,t)},execCb:function(e,t,r,i,n){return t.apply(i,r)},onScriptLoad:function(e){if("noload"!==e.type){if("load"===e.type||readyRegExp.test((e.currentTarget||e.srcElement).readyState)){interactiveScript=null;var t=P(e);i.completeLoad(t.id)}}else i.completeLoad(e.id)},onScriptError:function(e){var t=P(e);if(!_(t.id)){var r=[];return eachProp(s,(function(e,i){0!==i.indexOf("_@r")&&each(e.depMaps,(function(e){if(e.id===t.id)return r.push(i),!0}))})),E(makeError("scripterror",'Script error for "'+t.id+(r.length?'", needed by: '+r.join(", "):'"'),e,[t.id]))}}},i.require=i.makeRequire(),i}function getInteractiveScript(){return interactiveScript&&"interactive"===interactiveScript.readyState||eachReverse(scripts(),(function(e){if("interactive"===e.readyState)return interactiveScript=e})),interactiveScript}}__webpack_require__.d(__webpack_exports__,{A:function(){return _default}}),__webpack_unused_export__={value:!0}},663:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__663__},155:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__155__}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](r,r.exports,__webpack_require__),r.exports}__webpack_require__.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=function(e,t){for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Core:function(){return Core},default:function(){return core}});var lib_require=__webpack_require__(339),locale={zh:{require:"{label}不能为空",noErrorMsg:"未设置错误提示"},en:{require:"{label} is required",noErrorMsg:"Error message not set"}};locale.zh_CN=locale.zh,locale.en_US=locale.en,locale["zh-CN"]=locale.zh,locale["en-US"]=locale.en;var utils_i18n=locale,common=__webpack_require__(839),__assign=function(){return __assign=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},__assign.apply(this,arguments)},__awaiter=function(e,t,r,i){return new(r||(r=Promise))((function(n,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))},__generator=function(e,t){var r,i,n,o,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,i&&(n=2&s[0]?i.return:s[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,s[1])).done)return n;switch(i=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,i=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(n=a.trys,(n=n.length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){a.label=s[1];break}if(6===s[0]&&a.label<n[1]){a.label=n[1],n=s;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(s);break}n[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],i=0}finally{r=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},Core=function(){function e(e){var t=e.runtime,r=e.runtimeMapping,i=e.service,n=(e.cdnUrl,e.cdnPath),o=(e.modUrl,e.modPath),a=e.pageUrl,s=e.pagePath,c=e.staticUrl,u=e.importMaps,p=e.basicsType,l=e.defaultFormAttr,d=e.importModules,f=e.i18n,h=e.localeMapping,m=e.localeDefault,g=e.message,v=void 0===g?{}:g,_=e.argv,b=this;this.runtime=!0,this.runtimeMapping={drop:"dropruntime",drag:"dragruntime"},this.service="",this.cdnPath="/lib",this.modPath="/package",this.pageUrl="",this.pagePath="/page",this.importMaps={},this.basicsType="basics",this.moduleMaps={},this.global={},this.message={},this.i18n=utils_i18n,this.defaultFormAttr={passwordFlag:!0,hideNoSubmit:!0,verifyOnEvents:["onChange","onBlur"],verifyASTime:300},this.importModules={},this.localeMapping={},this.localeDefault="zh",this.argv={},this.eventList={},this.language=function(e){void 0===e&&(e=window.localStorage.getItem("language")||"zh"),Object.values(b.moduleMaps).forEach((function(t){return null==t?void 0:t.$language(e)}))},this.exprRegx=/{{(.*?)}}/g,void 0!==t&&(this.runtime=t),void 0!==r&&(this.runtimeMapping=r),void 0!==i&&(this.service=i),void 0!==n&&(this.cdnPath=n),void 0!==o&&(this.modPath=o),void 0!==s&&(this.pagePath=s),void 0!==l&&(this.defaultFormAttr=__assign(__assign({},this.defaultFormAttr),l)),this.pageUrl=a||this.service+this.pagePath,this.staticUrl=c,u&&(this.importMaps=u),void 0!==p&&(this.basicsType=p),"object"==typeof d&&(this.importModules=d),"object"==typeof f&&this.setI18n(f),"object"==typeof h&&(this.localeMapping=h),"string"==typeof m&&(this.localeDefault=m),"object"==typeof h&&(this.message=v),"object"==typeof _&&(this.argv=_);var y=(0,lib_require.A)(this,u),x=y.require,w=y.define;this.require=x,this.define=w,window.snackdefine=w,window.define=w}return e.prototype.addEvent=function(e,t){return this.eventList[e]||(this.eventList[e]=[]),-1===this.eventList[e].indexOf(t)&&(this.eventList[e].push(t),!0)},e.prototype.removeEvent=function(e,t){if(!this.eventList[e])return!1;t||delete this.eventList[e];var r=this.eventList[e].indexOf(t);return-1!==r&&(this.eventList[e].splice(r,1),!0)},e.prototype.sendEvent=function(e,t){var r=this;return this.eventList[e]instanceof Array&&this.eventList[e].forEach((function(e){return e.apply(r,t),!0})),!1},e.prototype.module=function(e,t){var r,i,n,o,a=e.module,s=e.service,c=void 0===s?this.service:s,u=e.cdnUrl,p=e.cdnPath,l=void 0===p?this.cdnPath:p,d=e.modUrl,f=e.modPath,h=void 0===f?this.modPath:f,m=e.staticUrl,g=void 0===m?this.staticUrl:m,v=e.importMaps,_=e.config,b=void 0===_?{}:_;return __awaiter(this,void 0,void 0,(function(){var e,s,p,f,m,_,y,x,w,E,q,k;return __generator(this,(function(M){switch(M.label){case 0:if(a instanceof Array||"object"!=typeof a||(a=[a]),void 0===u&&(u=null!==(r=this.cdnUrl)&&void 0!==r?r:c+l),void 0===d&&(d=null!==(i=this.modUrl)&&void 0!==i?i:c+h),void 0===d)return[2,console.error('SnackCore: param "modUrl" is missing')];void 0!==u&&(b.baseUrl=u),void 0!==g&&(b.staticUrl=g),e={},s=0,p=a.length,M.label=1;case 1:return s<p?(f=a[s],m=f.type,_=void 0===m?"":m,y=f.name,x=f.setting,w=f.config,y=y.toLowerCase(),(E=null===(n=this.importModules[_])||void 0===n?void 0:n[y])?(e[y]=E,x&&(q=null===(o=this.importModules[_])||void 0===o?void 0:o[y+"setting"])&&(e[y+"setting"]=q),[3,4]):[3,2]):[3,5];case 2:return _&&"string"==typeof _&&(_="/".concat(_)),w=w?__assign(__assign({},b),w):b,[4,this.load({url:"".concat(d).concat(_||"","/").concat(this.runtime&&this.runtimeMapping[y]||y).concat(x?"/setting":"","/index.js"),config:w,importMaps:v})];case 3:if((k=M.sent())instanceof Error)return[3,4];e=this.addSnack(e,k),M.label=4;case 4:return s++,[3,1];case 5:return t&&t(e),[2,e]}}))}))},e.prototype.moduleURL=function(e,t){var r,i=e.urls,n=e.cdnUrl,o=e.staticUrl,a=void 0===o?this.staticUrl:o,s=e.importMaps,c=e.config,u=void 0===c?{}:c;return __awaiter(this,void 0,void 0,(function(){var e,o,c,p,l;return __generator(this,(function(d){switch(d.label){case 0:"string"==typeof i&&(i=[i]),void 0===n&&(n=null!==(r=this.cdnUrl)&&void 0!==r?r:this.service+this.cdnPath),void 0!==n&&(u.baseUrl=n),void 0!==a&&(u.staticUrl=a),e={},o=0,c=i.length,d.label=1;case 1:return o<c?(p=i[o],[4,this.load({url:p,config:u,importMaps:s})]):[3,4];case 2:if((l=d.sent())instanceof Error)return[2,null];e=this.addSnack(e,l),d.label=3;case 3:return o++,[3,1];case 4:return t&&t(e),[2,e]}}))}))},e.prototype.addSnack=function(e,t){return Object.keys(t).forEach((function(r){if("default"===r)return!0;var i=r.toLowerCase();if(e[i])return console.warn("Warn Snack-Core Module: ".concat(r," has existed ")),!0;e[i]=t[r]})),e},e.prototype.load=function(e){var t=this,r=e.url,i=e.config,n=e.importMaps;return new Promise((function(e){try{var o;if(n)o=(0,lib_require.A)(t,t.importMaps).require;else o=t.require;i&&o.config(i);var a=r.split("/");a.pop(),/setting\/index.js$/.test(r)&&a.pop();a.pop();var s=a.pop();window["__snack_static_".concat(s,"__")]=(null==i?void 0:i.staticUrl)||"".concat(a.join("/"),"/").concat(s,"/"),o([r],(function(t){t||console.error("SnackCore load module fail: ",r),e(t)}),(function(t){console.error("SnackCore load module error: ",t),e(t)}))}catch(t){e({})}}))},e.prototype.remove=function(e,t){var r,i,n,o,a;if(void 0===t&&(t=!0),!e||!this.moduleMaps[e])return!1;var s=null===(i=null===(r=this.moduleMaps[e])||void 0===r?void 0:r.data)||void 0===i?void 0:i.parent;this.moduleMaps[e]&&(null===(n=this.moduleMaps[e])||void 0===n||n.$destroy(),this.moduleMaps[e]=null,delete this.moduleMaps[e]),s&&(null===(o=s.removeChild)||void 0===o||o.call(s,e),t&&(null===(a=s.$forceUpdate)||void 0===a||a.call(s))),this.sendEvent("onRemove",[e])},e.prototype.empty=function(e){var t=this;void 0===e&&(e=!0),Object.keys(this.moduleMaps).forEach((function(r){t.remove(r,e)}))},e.prototype.setI18n=function(e){var t=this;Object.keys(e).forEach((function(r){t.i18n[r]?t.i18n[r]=__assign(__assign({},t.i18n[r]),e[r]):t.i18n[r]=e[r]}))},e.prototype.intl=function(e,t){return(0,common.Is)(this,e,this.i18n,t,void 0,this.i18n)},e.prototype.exprParseByData=function(e){var t,r;if(!e)return e;if(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.D){var i=this.checkHasExpr(e.data.D),n=i.expr,o=i.data;n&&(this.recursiveParseJson(o,this.getExprArgv(e.data.D.style)),e.data.D=o)}if(null===(r=null==e?void 0:e.data)||void 0===r?void 0:r.M){var a=this.checkHasExpr(e.data.M),s=(n=a.expr,a.data);n&&(this.recursiveParseJson(s,this.getExprArgv(e.data.M)),e.data.M=s)}return e},e.prototype.checkHasExpr=function(e){if("object"!=typeof e)return{expr:!1,data:e};try{var t=JSON.stringify(e);if(this.exprRegx.test(t))return{expr:!0,data:JSON.parse(t)}}catch(e){}return{expr:!1,data:e}},e.prototype.evaluateExpression=function(e,t){try{return new Function("$","var data = $.data; return ".concat(e))(t)}catch(t){return console.error("Error evaluating expression: ".concat(e),t),"".concat(e,":").concat(t.message)}},e.prototype.processTemplateString=function(e,t){var r=this,i=this.exprRegx;return e.replace(i,(function(e,i){var n=r.evaluateExpression(i.trim(),t);return void 0!==n?n:""}))},e.prototype.recursiveParseJson=function(e,t,r){for(var i in void 0===r&&(r=!1),e)if(e.hasOwnProperty(i)){if(r)try{JSON.stringify(e[i])}catch(e){continue}if("object"==typeof e[i]&&null!==e[i])this.recursiveParseJson(e[i],t,r);else if("string"==typeof e[i])try{e[i]=this.processTemplateString(e[i],t)}catch(e){}}return e},e.prototype.getExprArgv=function(e){return{argv:this.argv,sdk:this,data:e}},e}(),core=Core;return __webpack_exports__}()}));