├── CHANGE.txt ├── LICENSE ├── README-cn.md ├── README-en.md ├── README.md ├── css ├── README.md └── atomic-css-rules.txt ├── dist ├── index.html ├── preview.html ├── res │ ├── html.min.js │ ├── moloader.min.js │ ├── polyfill.js │ ├── sdrag.min.js │ ├── split.css │ ├── split.js │ ├── style.css │ └── uglifyjs.js ├── z-data.min.all.js ├── z-data.min.es2015.js ├── z-data.min.js └── z-minifier.min.js ├── hello-world.html ├── package.json ├── src └── z-data.js └── www ├── favicon.ico └── index.html /CHANGE.txt: -------------------------------------------------------------------------------- 1 | 2 | 2023-09-09 3 | * json2css() 4 | + filter, backdrop-filter 5 | 6 | 2023-09-08 7 | * json2css() 8 | + transform 9 | 10 | 2023-04-07 11 | dist for 12 | Chrome 49, Firefox 44, Opera 36, iOS 10, Android 7 13 | 14 | - z-data.js, z-data.min.js 15 | 2017: Chrome 61, Firefox 55, Opera 48 16 | 17 | - z-data.min.es2015.js, z-data.min.all.js 18 | 2016: Chrome 49, Firefox 44, Opera 36, iOS 10, Android 7 19 | 20 | 2023-04-06 21 | Chrome 61+, Firefox 55+, Opera 48+, ES2018 22 | 23 | - z-data.min.es2015.js 24 | Chrome 49+, Firefox 44+, Opera 36+, iOS 10+, Android 7+ 25 | - z-data.min.all.js 26 | Chrome 49+, Firefox 47+, Opera 36+, iOS 10+, Android 7+ 27 | - z-data.min.all.es5.js 28 | Chrome 49+, Firefox 43+, Opera 36+, iOS 10+, Android 7+ 29 | 30 | 2023-03-31 31 | * z-data.min.all.es5.js 32 | Chrome 49+, Firefox 43+, Opera 36+, iOS 10+, Android 6+ 33 | 34 | 2023-03-29 35 | * z-data.min.all.js for es2015 (es6) 36 | Chrome 54+, Firefox 50+, Opera 41+, iOS 10+, Android 7+ 37 | 38 | 2022-11-06 39 | * setAttrs.fn() 40 | + , ps.k ? nil : 1 41 | supports z-d- inner closure function 42 | 43 | 2022-11-05 44 | * tryEval() 45 | exp && ... 46 | * setAttrs.fn() 47 | + , ps.k || (ps.e = nil) 48 | call only once (for z-d-...) 49 | 50 | 2022-10-30 51 | + custom directive, z-d-...=... 52 | * re_bind, re_attr, setAttrs() 53 | 54 | 2022-10-17 55 | * :! and .attr 56 | ps.A 57 | 58 | 2022-10-16 59 | + syntax sugar to .attr 60 | :!tag-attr -> :tag-attr.attr 61 | ::!tag-attr -> ::tag-attr.attr 62 | 63 | 2022-10-15 64 | * goAnode()/146,+147 65 | support template in svg 66 | 67 | 2022-09-09 68 | + .deb(fn, ms), debounce 69 | 70 | 2022-08-13 71 | * fix @xxx.out 72 | 73 | 2022-08-03 74 | * fix bug for empty z-data file 75 | 76 | 2022-05-16 77 | * Object.keys(...).forEach -> for (...in...) 78 | 79 | 2022-05-07 80 | * cb.i --Date.now()-> Math.random() 81 | 82 | 2022-05-06 83 | * loadHTML() 84 | * fix for style local (ignore list) 85 | 86 | 2022-04-26 87 | * expand() 88 | * template use (else) 89 | DONT cache 90 | 91 | 2022-04-15 92 | + attr handler (ZData.ss(name, value)) 93 | attr atomic css on demand 94 |
95 | * setEvent() 96 | event this -> current element (from e.target) 97 | + atomic css rules 98 | 99 | 2022-04-11 100 | * setValue(), fix issue for .xxx-=yyy 101 | 102 | 2022-04-10 103 | * observe(), fix issue 104 | 105 | 2022-04-09 106 | * loadHTML() and start() 107 | load / start optimized 108 | * goFor() 109 | fix - key DUPLICATE !!! 110 | * goAnode() and setAttrs() 111 | fix - nodeCache[] 112 | 113 | 2022-04-08 114 | + $emit(el, name, detail) 115 | * liteProxy 116 | performance optimized 117 | 118 | 2022-04-06 119 | * ZData.ss(s) for style shorthand 120 | -> compile time 121 | 122 | 2022-04-05 123 | + ZData.ss(s) for style shorthand 124 | 125 | 2022-04-03 126 | * loadHTML() 127 | * fix bug for style local (ignore list) 128 | prefix with @, \d% 129 | 130 | 2022-04-02 131 | * loadHTML() 132 | insert HTML after all .js on load 133 | load js with ZData.get() 134 | 135 | 2022-03-28 136 | * z-data html module 137 | - remove z-data=$... support 138 | + export default {...} --replaced-> return {...} 139 | 140 | 2022-03-27 141 | * z-data expression 142 | can be a function expression 143 | * initComponent() and tryEval() 144 | + z-data html module (begin with z-data) 145 | * loadHTML() 146 | 147 | 2022-03-25 148 | * setAttrs().fn() for * 149 | 150 | 2022-03-19 151 | * function events 152 | fns: { 153 | fn($el) { 154 | event // the event ctx 155 | this // the event element 156 | $el // z-data root element 157 | } 158 | } 159 | 160 | 2022-03-12 161 | * z-json 162 | onStringify(), {} --changed-> new WeakMap() 163 | + json2css() 164 | 165 | 2022-03-11 166 | * z-json 167 | onStringify(), duplicate object ignored 168 | 169 | 2022-03-07 170 | * z-json 171 | + qs2json(), json2qs() 172 | 173 | 2022-03-04 174 | * liteProxy 175 | + proxy chain back again 176 | ! proxy chain + cbs 177 | * loadHTML() 178 | load script one by one 179 | 180 | 2022-03-03 181 | * liteProxy 182 | + delete data-aware 183 | delete obj[prop]; 184 | 185 | 2022-03-01 186 | + z-pen\to-es2015.fun 187 | 188 | 2022-02-28 189 | * template use 190 | DONT cache 191 | * goIf(), expand() 192 | 193 | 2022-02-27 194 | * liteProxy 195 | * CHANGE proxy chain (proxy -> proxy... -> target) TO proxy handler.cs [cb1, cb2...] 196 | 197 | 2022-02-24 198 | * goNodes() 199 | * cbIf(args) -> cbIf(el) 200 | * goFor() 201 | + goNodes() before insert 202 | 203 | 2022-01-26 204 | * ES2018 => ES2015 205 | * { ...x, y, z: z } => Object.assign({}, x, {y , z: z}) 206 | (\{)[\s\r\n]*\.\.\.([\w.]+),?\s*(([^{}]+|\{[^{}]+\})*\}) 207 | -> 208 | Object.assign({},$2,$1$3) 209 | 210 | - z-data.min.es2015.js 211 | 212 | Chrome 54+, Firefox 50+, Opera 41+ 213 | 214 | 2021-10-22 215 | * setAttrs(), dynamic props/attrs/events supported 216 | :*={...} 217 | :*.attr={...} 218 | @*={...} 219 | 220 | 2021-10-21 221 | * expand() 222 | * re_modifiers / setEvent() 223 | * .away -> .out 224 | - .super 225 | 226 | 2021-10-15 227 | * setValue() 228 | value: undefined -> "" 229 | 230 | 2021-10-12 231 | + unit to .number (input) 232 | 233 | 2021-09-28 234 | * fix bug for :: changed value not in vs[i] cache 235 | 236 | 2021-09-22 237 | * fix bug for key event (autocomplete list) 238 | 239 | 2021-09-15 240 | - remove :xxx.attr .bool 241 | :xxx.attr.bool -> :xxx.attr (removeAttribute when false) 242 | 243 | 2021-09-13 244 | * load z-comp (fix bug for fetch twice) 245 | 246 | 2021-09-12 247 | + .on(name, fn) 248 | + .call(name, args) 249 | 250 | 2021-09-10 251 | * remove z-data string (to el._z) after init 252 | * remove bind attrs after init 253 | 254 | 2021-09-09 255 | * loadHTML() 256 | replace scope of style for scoped [z-i... 257 | 258 | 2021-09-08~09 259 | * loadHTML() 260 | ignore scope style for scoped [z-i... 261 | 262 | 2021-09-08 263 | + modifier bool, for .attr modifier 264 | :xxx.attr.bool xxx is a boolean attribute 265 | 266 | 2021-09-05 267 | * loadHTML() 268 | 74 | ``` 75 | 76 | ## 2.1. z-data studio 77 | 78 | 可以在线创建/调试/预览 z-data 代码 79 | 80 | * https://funlang.org/z-data/ 81 | 82 | # 3. 用法 83 | 84 | ## 3.1. 安装 85 | 86 | - CDN https://cdn.jsdelivr.net/gh/Funlang/z-data@main/dist/z-data.min.js 87 | 88 | ```html 89 | 90 | ``` 91 | 92 | ## 3.2. 作用域 93 | 94 | - z-data 属性创建 ZData 作用域 95 | 96 | ```html 97 | 98 | ``` 99 | z-data 支持一个 init 函数, 在组件初始化时执行 100 | 101 | ```html 102 | 103 | ``` 104 | 105 | z-data 表达式可以是一个函数表达式, 如: 106 | 107 | ```html 108 | 114 | 115 | 121 | ``` 122 | 123 | z-data HTML 模块文件 (文件开头是 z-data) 124 | 125 | ```html 126 | z-data 127 | 128 | 129 | 135 | ``` 136 | 137 | - z-none 关闭 ZData 作用域, 其内部节点 ZData 会跳过 138 | 139 | ```html 140 | 141 | ... 142 | 143 | ``` 144 | 145 | - 与其他框架共存 146 | 147 | 在 ZData 根节点用类似以下的方式处理 (x-ignore 改为其他框架关闭作用域的属性名) 148 | ```html 149 | 150 | ``` 151 | 在其他框架根节点加 z-none 即可 152 | 153 | ## 3.3. 模板 154 | 155 | - template for 156 | 157 | ```html 158 | 159 | ``` 160 | ZData 依赖 key, 如果没有指定 key, 则优先选用 k 做 key, 否则用 v 做 key 键 161 | k : v , i 可以部分可选, 如: 162 | 163 | ```html 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | ``` 172 | 173 | - template if/else 174 | 175 | ```html 176 | 177 | 178 | 179 | ``` 180 | 181 | - template use 182 | 183 | ```html 184 | 185 | 188 | 189 | 190 | 191 | ``` 192 | 193 | ## 3.4. 绑定 194 | 195 | - : 用来做属性绑定, 其中 :: 是双向绑定 196 | 197 | ```html 198 | 199 | ``` 200 | 201 | ### 3.4.1. :text :html 202 | 203 | :text :html 分别对应 textContent 和 innerHTML 204 | 205 | ### 3.4.2. :class 206 | 207 | :class 支持 [] {} 和 字符串三种, 这些 classname 会按顺序合并处理 208 | 209 | ### 3.4.3. :class 简写 210 | 211 | :class 支持 :class.name1.name2=... 212 | ``` 213 | 可以简写为 .name1.name2=... 214 | 如果 classname 后面为 -, 且返回值不是 boolean, 则将其值加入到 classname, 如: 215 | .p-=1 则 classList 里会增加 p-1 216 | ``` 217 | 218 | ### 3.4.4. :style 219 | 220 | :style 支持 :css 别名, 支持 {} 和字符串两种, 字符串会按顺序覆盖 221 | 222 | ### 3.4.5. :style 简写 223 | 224 | :style 支持 :style.name.value=... 225 | ``` 226 | :style.name=value / :css.name=value 227 | :style.name.value=条件 / :css.name.value=... 228 | 可以简写为 ..name 和 #name, 以及 !name=string-value, 如下: 229 | ..width=`100px` 230 | #border-width=`4px` 231 | !border-width=4px 232 | #--a-css-var=`'${theCssVarValue}'` 233 | ``` 234 | 235 | #### 3.4.5.1 ZData.ss(s) 236 | 237 | ``` 238 | ZData.ss = (s) => AShorthandMap[s] || s; 239 | ``` 240 | 241 | ### 3.4.6. !!! 特别注意 242 | 243 | #### 3.4.6.1. : :: @ . .. \# 244 | 245 | 后面的值全部都是 js 表达式, 可以是 js 变量, 或者是字符串, 字符串要用 ' " ` 套住 246 | 247 | #### 3.4.6.2. ${...} 248 | 249 | 非绑定的属性值中含有 \${...}, 会自动解析成一个字符串, 相当于 \`...${...}...` 250 | 251 | #### 3.4.6.3. ! 252 | 253 | ! 与 含有 ${} 的属性值类似, 会自动解析成 :css.style-name=\`string-value` 254 | 255 | ### 3.4.7. attr 256 | 257 | :xxx.attr 表示为可视 attribute 属性, 否则默认为不可见 prop 属性 258 | 259 | :xxx.attr === false 表示为 boolean attribute 属性 260 | 261 | #### 3.4.7.1. attr 简写 262 | ``` 263 | :!tag-attr -> :tag-attr.attr 264 | ::!tag-attr -> ::tag-attr.attr 265 | ``` 266 | ### 3.4.8. camel 267 | 268 | :xxx.camel 支持驼峰表示法 269 | 270 | ::value=propName, ::style.value=propName, ::css.value=propName 271 | ``` 272 | 其中 propName 只支持驼峰表示法, DOM 属性(包括 style)可以增加 .camel 修饰符 273 | 双向绑定默认在 change 中触发回写行为, 只有 input text 同时在 input 中触发回写 274 | 可以增加 .input / .change 强制在 input / change 中回写 275 | 支持 .trim / .number 修饰符 276 | ``` 277 | ``` 278 | 目前有些属性如 style.value 修改, 不会自动触发响应式, 需要在当前执行 el 执行 el.fireChange() 279 | ``` 280 | 281 | ### 3.4.9. input type='radio' 282 | ``` 283 | ::checked=opt==this.value 284 | 285 | 注: opt 是一个 data 内的属性变量名 286 | ``` 287 | 288 | ## 3.5. 事件 289 | 290 | @ 用来绑定事件, 支持 modifiers 291 | 292 | ### 3.5.1. 全局 293 | 294 | ``` 295 | camel 事件名驼峰表示法 296 | prevent preventDefault 297 | stop stopPropagation 298 | debounce debounce mode, follow a time optional, such as 299 | debounce.750ms, debounce.2s, default 250ms 300 | capture capture mode 301 | once once mode, run once only 302 | passive passive mode 303 | ``` 304 | 305 | ### 3.5.2. 范围 306 | 307 | ``` 308 | self tag only 309 | out tag not 310 | window 311 | document 312 | ``` 313 | 314 | ### 3.5.3. 键鼠 315 | 316 | ``` 317 | shift 318 | ctrl 319 | alt 320 | meta or cmd 321 | ``` 322 | 323 | ### 3.5.4. 键盘 324 | ``` 325 | enter, escape, space, f1 etc., details refer to: 326 | https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values 327 | alias: space: " ", slash: /, gt: >, eq: = 328 | ``` 329 | 330 | ### 3.5.5. 鼠标 331 | ``` 332 |
|
-------------------------------------------------------------------------------- /dist/preview.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | z-data studio 7 | 8 | 9 | 10 | 11 | 12 | 13 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 46 | 47 | -------------------------------------------------------------------------------- /dist/res/html.min.js: -------------------------------------------------------------------------------- 1 | var lang_zdata={defaultToken:"",tokenPostfix:".html",ignoreCase:!0,tokenizer:{root:[[/)/,["delimiter","tag","","delimiter"]],[/(<)(script)/,["delimiter",{token:"tag",next:"@script"}]],[/(<)(style)/,["delimiter",{token:"tag",next:"@style"}]],[/(<)((?:[\w\-]+:)?[\w\-]+)/,["delimiter",{token:"tag",next:"@otherTag"}]],[/(<\/)((?:[\w\-]+:)?[\w\-]+)/,["delimiter",{token:"tag",next:"@otherTag"}]],[/]+/,"metatag.content"],[/>/,"metatag","@pop"]],comment:[[/-->/,"comment","@pop"],[/[^-]+/,"comment.content"],[/./,"comment.content"]],otherTag:[[/\/?>/,"delimiter","@pop"],[/(=)(\s*)("(?:[^"]*?)"|'(?:[^']*?)'|[^\s>]+)/,["delimiter","","attribute.value"]],[/\b(z-data)(=)(')/,["keyword","delimiter",{token:"attribute.name",next:"@scriptEmbedded1",nextEmbedded:"text/javascript"}]],[/\b(z-data)(=)(")/,["keyword","delimiter",{token:"attribute.name",next:"@scriptEmbedded2",nextEmbedded:"text/javascript"}]],[/([:.@!#]*)([\w\-]+)/,["attribute.value","attribute.name"]],[/=/,"delimiter"],[/[ \t\r\n]+/]],script:[[/type/,"attribute.name","@scriptAfterType"],[/(=)(\s*)("(?:[^"]*?)"|'(?:[^']*?)'|[^\s>]+)/,["delimiter","","attribute.value"]],[/([:.@!#]*)([\w\-]+)/,["attribute.value","attribute.name"]],[/=/,"delimiter"],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/(<\/)(script\s*)(>)/,["delimiter","tag",{token:"delimiter",next:"@pop"}]]],scriptAfterType:[[/=/,"delimiter","@scriptAfterTypeEquals"],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptAfterTypeEquals:[[/"([^"]*)"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptWithCustomType:[[/>/,{token:"delimiter",next:"@scriptEmbedded.$S2",nextEmbedded:"$S2"}],[/(=)(\s*)("(?:[^"]*?)"|'(?:[^']*?)'|[^\s>]+)/,["delimiter","","attribute.value"]],[/([:.@!#]*)([\w\-]+)/,["attribute.value","attribute.name"]],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptEmbedded:[[/<\/script/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}],[/[^<]+/,""]],scriptEmbedded1:[[/'/,{token:"attribute.name",next:"@pop",nextEmbedded:"@pop"}],[/[^']+/,""]],scriptEmbedded2:[[/"/,{token:"attribute.name",next:"@pop",nextEmbedded:"@pop"}],[/[^"]+/,""]],style:[[/type/,"attribute.name","@styleAfterType"],[/(=)(\s*)("(?:[^"]*?)"|'(?:[^']*?)'|[^\s>]+)/,["delimiter","","attribute.value"]],[/([:.@!#]*)([\w\-]+)/,["attribute.value","attribute.name"]],[/=/,"delimiter"],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/(<\/)(style\s*)(>)/,["delimiter","tag",{token:"delimiter",next:"@pop"}]]],styleAfterType:[[/=/,"delimiter","@styleAfterTypeEquals"],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleAfterTypeEquals:[[/"([^"]*)"/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleWithCustomType:[[/>/,{token:"delimiter",next:"@styleEmbedded.$S2",nextEmbedded:"$S2"}],[/(=)(\s*)("(?:[^"]*?)"|'(?:[^']*?)'|[^\s>]+)/,["delimiter","","attribute.value"]],[/([:.@!#]*)([\w\-]+)/,["attribute.value","attribute.name"]],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleEmbedded:[[/<\/style/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}],[/[^<]+/,""]]}}; 2 | const EmpELs=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"],lang_conf={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,comments:{blockComment:[""]},brackets:[[""],["<",">"],["{","}"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:'"',close:'"'},{open:"'",close:"'"},{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"}],onEnterRules:[{beforeText:new RegExp(`<(?!(?:${EmpELs.join("|")}))([_:\\w][_:\\w-.\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),afterText:/^<\/([_:\w][_:\w-.\d]*)\s*>$/i,action:{indentAction:2}},{beforeText:new RegExp(`<(?!(?:${EmpELs.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),action:{indentAction:1}}],folding:{markers:{start:new RegExp("^\\s*"),end:new RegExp("^\\s*")}}}; 3 | -------------------------------------------------------------------------------- /dist/res/moloader.min.js: -------------------------------------------------------------------------------- 1 | "use strict";var define,AMDLoader,_amdLoaderGlobal=this,_commonjsGlobal="object"==typeof global?global:{};!function(e){e.global=_amdLoaderGlobal;var t=(Object.defineProperty(r.prototype,"isWindows",{get:function(){return this._detect(),this._isWindows},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"isNode",{get:function(){return this._detect(),this._isNode},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"isElectronRenderer",{get:function(){return this._detect(),this._isElectronRenderer},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"isWebWorker",{get:function(){return this._detect(),this._isWebWorker},enumerable:!1,configurable:!0}),r.prototype._detect=function(){this._detected||(this._detected=!0,this._isWindows=r._isWindows(),this._isNode="undefined"!=typeof module&&!!module.exports,this._isElectronRenderer="undefined"!=typeof process&&void 0!==process.versions&&void 0!==process.versions.electron&&"renderer"===process.type,this._isWebWorker="function"==typeof e.global.importScripts)},r._isWindows=function(){return!!("undefined"!=typeof navigator&&navigator.userAgent&&0<=navigator.userAgent.indexOf("Windows"))||"undefined"!=typeof process&&"win32"===process.platform},r);function r(){this._detected=!1,this._isWindows=!1,this._isNode=!1,this._isElectronRenderer=!1,this._isWebWorker=!1}e.Environment=t}(AMDLoader=AMDLoader||{}),function(r){var n=function(e,t,r){this.type=e,this.detail=t,this.timestamp=r};r.LoaderEvent=n;var e=(t.prototype.record=function(e,t){this._events.push(new n(e,t,r.Utilities.getHighPerformanceTimestamp()))},t.prototype.getEvents=function(){return this._events},t);function t(e){this._events=[new n(1,"",e)]}r.LoaderEventRecorder=e;o.prototype.record=function(e,t){},o.prototype.getEvents=function(){return[]},o.INSTANCE=new o,e=o;function o(){}r.NullLoaderEventRecorder=e}(AMDLoader=AMDLoader||{}),function(e){var t=(n.fileUriToFilePath=function(e,t){if(t=decodeURI(t).replace(/%23/g,"#"),e){if(/^file:\/\/\//.test(t))return t.substr(8);if(/^file:\/\//.test(t))return t.substr(5)}else if(/^file:\/\//.test(t))return t.substr(7);return t},n.startsWith=function(e,t){return e.length>=t.length&&e.substr(0,t.length)===t},n.endsWith=function(e,t){return e.length>=t.length&&e.substr(e.length-t.length)===t},n.containsQueryString=function(e){return/^[^\#]*\?/gi.test(e)},n.isAbsolutePath=function(e){return/^((http:\/\/)|(https:\/\/)|(file:\/\/)|(\/))/.test(e)},n.forEachProperty=function(e,t){if(e){var r=void 0;for(r in e)e.hasOwnProperty(r)&&t(r,e[r])}},n.isEmpty=function(e){var t=!0;return n.forEachProperty(e,function(){t=!1}),t},n.recursiveClone=function(e){if(!e||"object"!=typeof e||e instanceof RegExp||!Array.isArray(e)&&Object.getPrototypeOf(e)!==Object.prototype)return e;var r=Array.isArray(e)?[]:{};return n.forEachProperty(e,function(e,t){r[e]=t&&"object"==typeof t?n.recursiveClone(t):t}),r},n.generateAnonymousModule=function(){return"===anonymous"+n.NEXT_ANONYMOUS_ID+++"==="},n.isAnonymousModule=function(e){return n.startsWith(e,"===anonymous")},n.getHighPerformanceTimestamp=function(){return this.PERFORMANCE_NOW_PROBED||(this.PERFORMANCE_NOW_PROBED=!0,this.HAS_PERFORMANCE_NOW=e.global.performance&&"function"==typeof e.global.performance.now),(this.HAS_PERFORMANCE_NOW?e.global.performance:Date).now()},n.NEXT_ANONYMOUS_ID=1,n.PERFORMANCE_NOW_PROBED=!1,n.HAS_PERFORMANCE_NOW=!1,n);function n(){}e.Utilities=t}(AMDLoader=AMDLoader||{}),function(a){function r(e){if(e instanceof Error)return e;var t=new Error(e.message||String(e)||"Unknown Error");return e.stack&&(t.stack=e.stack),t}a.ensureError=r;var o=(n.validateConfigurationOptions=function(e){var t;return"string"!=typeof(e=e||{}).baseUrl&&(e.baseUrl=""),"boolean"!=typeof e.isBuild&&(e.isBuild=!1),"object"!=typeof e.paths&&(e.paths={}),"object"!=typeof e.config&&(e.config={}),void 0===e.catchError&&(e.catchError=!1),void 0===e.recordStats&&(e.recordStats=!1),"string"!=typeof e.urlArgs&&(e.urlArgs=""),"function"!=typeof e.onError&&(e.onError=function(e){if("loading"===e.phase)return console.error('Loading "'+e.moduleId+'" failed'),console.error(e),console.error("Here are the modules that depend on it:"),void console.error(e.neededBy);"factory"===e.phase&&(console.error('The factory method of "'+e.moduleId+'" has thrown an exception'),console.error(e))}),Array.isArray(e.ignoreDuplicateModules)||(e.ignoreDuplicateModules=[]),0]+)/,['delimiter','','attribute.value']],[/([:.@!#]*)([\\w\\-]+)/,['attribute.value','attribute.name']]`)+` 2 | //# sourceURL=`+t,(o?self.eval(o.createScript("",e)):new Function(e)).call(self),r()}).then(void 0,n)):((s=document.createElement("script")).setAttribute("async","async"),s.setAttribute("type","text/javascript"),this.attachListeners(s,r,n),(n=e.getConfig().getOptionsLiteral().trustedTypesPolicy)&&(t=n.createScriptURL(t)),s.setAttribute("src",t),(e=e.getConfig().getOptionsLiteral().cspNonce)&&s.setAttribute("nonce",e),document.getElementsByTagName("head")[0].appendChild(s))},r),a=(e.prototype.load=function(e,t,r,n){var o=e.getConfig().getOptionsLiteral().trustedTypesPolicy,e=/^((http:)|(https:)|(file:))/.test(t)&&t.substring(0,self.origin.length)!==self.origin;if(!/html\.js$/.test(t)&&e)try{o&&(t=o.createScriptURL(t)),importScripts(t),r()}catch(e){n(e)}else fetch(t).then(function(e){if(200!==e.status)throw new Error(e.statusText);return e.text()}).then(function(e){e=e.replace(/\[\/"\(\[\^"\]\*\)"\/,".*?"attribute.name"\]/g,`[/(=)(\\s*)("(?:[^"]*?)"|'(?:[^']*?)'|[^\\s>]+)/,['delimiter','','attribute.value']],[/([:.@!#]*)([\\w\\-]+)/,['attribute.value','attribute.name']]`)+` 3 | //# sourceURL=`+t,(o?self.eval(o.createScript("",e)):new Function(e)).call(self),r()}).then(void 0,n)},e),d=(g.prototype._init=function(e){this._didInitialize||(this._didInitialize=!0,this._fs=e("fs"),this._vm=e("vm"),this._path=e("path"),this._crypto=e("crypto"))},g.prototype._initNodeRequire=function(e,u){var l,c,h=u.getConfig().getOptionsLiteral().nodeCachedData;function p(r){function e(e){return r.require(e)}var n=r.constructor;return(e.resolve=function(e,t){return n._resolveFilename(e,r,!1,t)}).paths=function(e){return n._resolveLookupPaths(e,r)},e.main=process.mainModule,e.extensions=n._extensions,e.cache=n._cache,e}h&&!this._didPatchNodeRequire&&(this._didPatchNodeRequire=!0,l=this,(c=e("module")).prototype._compile=function(e,t){var r=c.wrap(e.replace(/^#!.*/,"")),n=u.getRecorder(),o=l._getCachedDataPath(h,t),i={filename:t};try{var s=l._fs.readFileSync(o),a=s.slice(0,16);i.cachedData=s.slice(16),n.record(60,o)}catch(e){n.record(61,o)}var d=new l._vm.Script(r,i),e=d.runInThisContext(i),s=l._path.dirname(t),n=p(this),s=[this.exports,n,this,t,s,process,_commonjsGlobal,Buffer],s=e.apply(this.exports,s);return l._handleCachedData(d,r,o,!i.cachedData,u),l._verifyCachedData(d,r,o,a,u),s})},g.prototype.load=function(o,e,i,s){var a=this,t=o.getConfig().getOptionsLiteral(),r=v(o.getRecorder(),t.nodeRequire||_.global.nodeRequire),d=t.nodeInstrumenter||function(e){return e};this._init(r),this._initNodeRequire(r,o);var n=o.getRecorder();if(/^node\|/.test(e)){var u=e.split("|"),l=null;try{l=r(u[1])}catch(e){return void s(e)}o.enqueueDefineAnonymousModule([],function(){return l}),i()}else{e=_.Utilities.fileUriToFilePath(this._env.isWindows,e);var c=this._path.normalize(e),h=this._getElectronRendererScriptPathOrUri(c),p=Boolean(t.nodeCachedData),f=p?this._getCachedDataPath(t.nodeCachedData,e):void 0;this._readSourceAndCachedData(c,f,n,function(e,t,r,n){e?s(e):(e=t.charCodeAt(0)===g._BOM?g._PREFIX+t.substring(1)+g._SUFFIX:g._PREFIX+t+g._SUFFIX,e=d(e,c),t=a._createAndEvalScript(o,e,{filename:h,cachedData:r},i,s),a._handleCachedData(t,e,f,p&&!r,o),a._verifyCachedData(t,e,f,n,o))})}},g.prototype._createAndEvalScript=function(e,t,r,n,o){var i=e.getRecorder();i.record(31,r.filename);var s=new this._vm.Script(t,r),a=s.runInThisContext(r),d=e.getGlobalAMDDefineFunc(),u=!1,t=function(){return u=!0,d.apply(null,arguments)};return t.amd=d.amd,a.call(_.global,e.getGlobalAMDRequireFunc(),t,r.filename,this._path.dirname(r.filename)),i.record(32,r.filename),u?n():o(new Error("Didn't receive define call in "+r.filename+"!")),s},g.prototype._getElectronRendererScriptPathOrUri=function(e){if(!this._env.isElectronRenderer)return e;var t=e.match(/^([a-z])\:(.*)/i);return t?"file:///"+(t[1].toUpperCase()+":"+t[2]).replace(/\\/g,"/"):"file://"+e},g.prototype._getCachedDataPath=function(e,t){var r=this._crypto.createHash("md5").update(t,"utf8").update(e.seed,"utf8").update(process.arch,"").digest("hex"),t=this._path.basename(t).replace(/\.js$/,"");return this._path.join(e.path,t+"-"+r+".code")},g.prototype._handleCachedData=function(t,r,n,e,o){var i=this;t.cachedDataRejected?this._fs.unlink(n,function(e){o.getRecorder().record(62,n),i._createAndWriteCachedData(t,r,n,o),e&&o.getConfig().onError(e)}):e&&this._createAndWriteCachedData(t,r,n,o)},g.prototype._createAndWriteCachedData=function(t,r,n,o){var i=this,e=Math.ceil(o.getConfig().getOptionsLiteral().nodeCachedData.writeDelay*(1+Math.random())),s=-1,a=0,d=void 0,u=function(){setTimeout(function(){d=d||i._crypto.createHash("md5").update(r,"utf8").digest();var e=t.createCachedData();0===e.length||e.length===s||5<=a||(e.length=o.length)a._onLoadError(n,e);else{var t=o[i],r=a.getRecorder();if(a._config.isBuild()&&"empty:"===t)return a._buildInfoPath[n]=t,a.defineModule(a._moduleIdProvider.getStrModuleId(n),[],null,null,null),void a._onLoad(n);r.record(10,t),a._scriptLoader.load(a,t,function(){a._config.isBuild()&&(a._buildInfoPath[n]=t),r.record(11,t),a._onLoad(n)},function(e){r.record(12,t),s(e)})}})(null))},l.prototype._loadPluginDependency=function(e,t){var r,n=this;this._modules2[t.id]||this._knownModules2[t.id]||(this._knownModules2[t.id]=!0,(r=function(e){n.defineModule(n._moduleIdProvider.getStrModuleId(t.id),[],e,null,null)}).error=function(e){n._config.onError(n._createLoadError(t.id,e))},e.load(t.pluginParam,this._createRequire(d.ROOT),r,this._config.getOptionsLiteral()))},l.prototype._resolve=function(e){var t=this,r=e.dependencies;if(r)for(var n=0,o=r.length;n 5 | `)),e.unresolvedDependenciesCount--):(this._inverseDependencies2[i.id]=this._inverseDependencies2[i.id]||[],this._inverseDependencies2[i.id].push(e.id),i instanceof u?(s=this._modules2[i.pluginId])&&s.isComplete()?this._loadPluginDependency(s.exports,i):((s=this._inversePluginDependencies2.get(i.pluginId))||this._inversePluginDependencies2.set(i.pluginId,s=[]),s.push(i),this._loadModule(i.pluginId)):this._loadModule(i.id))}else e.unresolvedDependenciesCount--;else e.unresolvedDependenciesCount--;else e.exportsPassedIn=!0,e.unresolvedDependenciesCount--}0===e.unresolvedDependenciesCount&&this._onModuleComplete(e)},l.prototype._onModuleComplete=function(e){var t=this,r=this.getRecorder();if(!e.isComplete()){var n=e.dependencies,o=[];if(n)for(var i=0,s=n.length;in[t]=e[t]?parseInt(e[t]):0),p=n.left *, 7 | [data-flex-splitter-vertical] > * { 8 | flex: none; 9 | /* overflow: auto; */ 10 | box-sizing: border-box; 11 | } 12 | [data-flex-splitter-horizontal] > [role="separator"], 13 | [data-flex-splitter-vertical] > [role="separator"] { 14 | touch-action: none; 15 | display: flex; 16 | align-items: center; 17 | justify-content: center; 18 | background-color: rgba(160, 160, 160, 0.15); 19 | z-index: 100; 20 | } 21 | [data-flex-splitter-horizontal] > [role="separator"]:hover, 22 | [data-flex-splitter-vertical] > [role="separator"]:hover { 23 | background-color: rgba(160, 160, 160, 0.45); 24 | } 25 | [data-flex-splitter-horizontal] > [role="separator"]::before, 26 | [data-flex-splitter-vertical] > [role="separator"]::before { 27 | content: ""; 28 | box-sizing: border-box; 29 | border: 4px rgba(160, 160, 160, 0.8); 30 | } 31 | [data-flex-splitter-horizontal] > [role="separator"] { 32 | cursor: ew-resize; 33 | width: 4px; 34 | } 35 | [data-flex-splitter-horizontal] > [role="separator"]::before { 36 | width: 8px; 37 | margin: -2px; 38 | height: 24px; 39 | border-style: double; 40 | } 41 | [data-flex-splitter-vertical] { 42 | flex-direction: column; 43 | } 44 | [data-flex-splitter-vertical] > [role="separator"] { 45 | cursor: ns-resize; 46 | height: 4px; 47 | } 48 | [data-flex-splitter-vertical] > [role="separator"]::before { 49 | width: 24px; 50 | height: 8px; 51 | margin: -2px; 52 | border-style: double; 53 | } 54 | -------------------------------------------------------------------------------- /dist/res/split.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | addEventListener("pointerdown", function(t) { 3 | var e = t.target, 4 | i = e.parentElement; 5 | if ( 6 | i && 7 | t.isPrimary && 8 | 0 === t.button && 9 | "separator" === e.getAttribute("role") 10 | ) { 11 | var n = i.hasAttribute("data-flex-splitter-vertical"), 12 | r = i.hasAttribute("data-flex-splitter-horizontal"); 13 | if (n || r) { 14 | t.preventDefault(); 15 | var a, 16 | o = t.pointerId, 17 | s = e.previousElementSibling, 18 | p = e.nextElementSibling; 19 | if (getComputedStyle(i).flexDirection.indexOf('reverse') > 0) { 20 | [s, p] = [p, s] 21 | } 22 | var h = getComputedStyle(s), 23 | l = getComputedStyle(p), 24 | d = s.getBoundingClientRect(); 25 | if (n) { 26 | var m = d.top + t.offsetY, 27 | f = s.offsetHeight + p.offsetHeight, 28 | v = Math.max( 29 | parseInt(h.minHeight, 10) || 0, 30 | f - (parseInt(l.maxHeight, 10) || f) 31 | ), 32 | u = Math.min( 33 | parseInt(h.maxHeight, 10) || f, 34 | f - (parseInt(l.minHeight, 10) || 0) 35 | ); 36 | a = function(t) { 37 | if (t.pointerId === o) { 38 | var e = Math.round( 39 | Math.min(Math.max(t.clientY - m, v), u) 40 | ); 41 | (s.style.height = e + "px"), 42 | (p.style.height = f - e + "px"); 43 | } 44 | }; 45 | } else { 46 | var x = d.left + t.offsetX, 47 | g = s.offsetWidth + p.clientWidth, 48 | c = Math.max( 49 | parseInt(h.minWidth, 10) || 0, 50 | g - (parseInt(l.maxWidth, 10) || g) 51 | ), 52 | I = Math.min( 53 | parseInt(h.maxWidth, 10) || g, 54 | g - (parseInt(l.minWidth, 10) || 0) 55 | ); 56 | a = function(t) { 57 | if (t.pointerId === o) { 58 | var e = Math.round( 59 | Math.min(Math.max(t.clientX - x, c), I) 60 | ); 61 | (s.style.width = e + "px"), 62 | (p.style.width = g - e + "px"); 63 | } 64 | }; 65 | } 66 | var E = function(t) { 67 | t.pointerId === o && 68 | (e.releasePointerCapture(o), 69 | e.removeEventListener("pointermove", a), 70 | e.removeEventListener("pointerup", E), 71 | e.removeEventListener("pointercancel", E)); 72 | }; 73 | a(t), 74 | (s.style.flexShrink = p.style.flexShrink = 1), 75 | e.addEventListener("pointercancel", E), 76 | e.addEventListener("pointerup", E), 77 | e.addEventListener("pointermove", a), 78 | e.setPointerCapture(o); 79 | } 80 | } 81 | }); 82 | -------------------------------------------------------------------------------- /dist/res/style.css: -------------------------------------------------------------------------------- 1 | * { 2 | box-sizing: border-box; 3 | } 4 | 5 | html, 6 | body { 7 | padding: 0; 8 | margin: 0; 9 | height: 100%; 10 | overflow: hidden; 11 | } 12 | 13 | /* @media screen and (min-width: 768px) { 14 | ::-webkit-scrollbar { 15 | width: 8px; 16 | height: 8px; 17 | } 18 | :hover::-webkit-scrollbar { 19 | background: #eee7; 20 | } 21 | :hover::-webkit-scrollbar-thumb { 22 | background: #cccc; 23 | } 24 | :hover::-webkit-scrollbar-button { 25 | height: 8px; 26 | width: 8px; 27 | background: #9999; 28 | } 29 | :hover::-webkit-scrollbar-track:hover { 30 | background: #fff; 31 | } 32 | :hover::-webkit-scrollbar-thumb:hover { 33 | background: #aaa; 34 | } 35 | :hover::-webkit-scrollbar-button:hover { 36 | background: #666; 37 | } 38 | } */ 39 | -------------------------------------------------------------------------------- /dist/z-data.min.all.js: -------------------------------------------------------------------------------- 1 | const ZData=(()=>{var i,a=0,U=0,h=0,u=0,e="Attribute",t="Element",r=t+"Sibling",s=t+"Child";const w="z-data",$="z-comp",x="z-none",f="init",k="args",G="use",S="_z_d",m=`[${w}]`,j="get"+e,z="set"+e,D="remove",K=D+e,O="first"+s,V="last"+s,X="previous"+r,Z="next",N=Z+r,v="create"+t,d="parent"+t,E="insertBefore",M="forEach",A="includes",L="length",y="startsWith",C=(e,t=/ +/)=>e.trim().split(t),_="replace",P="textContent",Y="input",Q="change",ee="class",F="style",b="querySelector",R=document,te=(e,t=R)=>t[b+"All"](e),l=(e,t=`[${x}]`)=>e.closest(t),re="addEventListener",T=Object.keys,n=Object.values||(t=>T(t).map(e=>t[e])),q=Object.assign,c="deleteProperty",J=(e,t="object")=>typeof e==t,o=e=>J(e,"function"),W=void 0,se=/^(?:camel|prevent|stop|debounce|(\d+)(?:(m?)s)|capture|once|passive|self|out|window|document|(shift|ctrl|alt|meta)|(cmd))$/,ae=/^(?:\s*(?:(\w+)\s*:\s*)?(\w*)(?:\s*,\s*(\w+))?\s+in\s+)?(.+)$/,ne=/^[:@.#!].|^z-d-/,oe=/^(?:(:)(:?)(!?)|(@)|([.#!])|(z-d-))?([^.]*)(?:[.]([^.].*))?$/,ie=e=>e&&0<=e.indexOf("${")&&e.indexOf("`")<0,le=/[-_ ]+/g,p=/-([a-z])/g,fe=new WeakMap,de=(t,r)=>{if(!t||!J(t)||o(t)||t.__ob__||t._isVue||!delete t[r.i])return t;{let e=fe.get(t);if(e||((e={s:{},set(e,t,r,s){for(var a in this.s)this.s[a].set(e,t,r,s);return!0},[c](e,t){let r,s=!0;for(r in this.s)s=this.s[r][c](e,t)&&s;return s}}).p=new Proxy(t,e),fe.set(t,e).set(e.p,e)),!e.s[r.i])for(var s in e.s[r.i]=r,t)try{t[s]=i(t[s],r)}catch(e){}return e.p}},ce=(e,t,r)=>e.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!0})),H=(t,r)=>{if(!t[S]||!(a<=t[S].age||t[S].ing)){(t[S]||(t[S]={})).age=a,t[S].ing=(t[S].ing||0)+1,r=r&&(t[S].env=r)||t[S].env||{ps:{$emit:ce},d:{}};var e=e=>{u++,De(R.body),ue({p:t[d],el:t},q({},r,{d:t[S].zd,r:t}),e||a),u--,Oe(R.body)};let o=g(e);var s=t[S].zd;if(!s){let n={i:S+Math.random(),set(e,t,r,s,a){o();try{a||(e[t]=i(r,n))}catch(e){}return!0},[c](e,t){return t!=this.i&&(o(),delete e[t])}};i=window.ZDataProxy||de,ZData.proxy=e=>i(e,n),s=B(t,t[j](w),r,W,t[k]||{})||{},t.$data=t[S].zd=s=i(s,n),t[z](w,""),t[k]&&(s[k]=t[k]),B(t,t[j](f),q({},r,{d:s}))}e(1),t[S].ing--}},pe={},ue=(t,s,d)=>{let{p:r,el:a,cp:n}=t,e;let o=(i=a[S]||(a[S]={})).as||(i.as=(e=pe[a[j]("z-d")])?(i.ps=e.ps,e.as):a.getAttributeNames());if(!o[A](x)){if(!n){let e;if(d===W&&o[A](w))return H(a,s);if(o[A]($)&&(e=a[j]($))){try{a[K]($),(/^([.\/]|https?:)/.test(e)?fetch(e).then(e=>e.text()):/^z:/.test(e)&&ZData.get?ZData.get(e):B(a,e,s)).then(e=>{var t=B(a,a[j](k),s);"-"==a.tagName[1]||o[A]("del")?ze(e,r,a,t,1):ze(e,a,W,t)}).catch(be)}catch(n){}return}if("template"==a.localName){if(a.content||(a.content=R.createDocumentFragment())[E](a[O],W),e=a[j]("for")){var f=t,c=(i=e,s);if(d=ae.exec(i)){var p,{p:u,el:m}=f;let e=B(m,d[4],c),t={k:d[1],v:d[2],i:d[3]},a=q({},c,{ps:q({},c.ps,{})}),r=m[j]("key"),s=r&&C(r,"."),n=m[S].ns||(m[S].ns={}),o=0,i=m,l=m[S].age=(m[S].age||0)+1;for(p in s=s&&2==s[L]&&s[0]==t.v&&s[1],t.k&&(a.ps[t.k]=W),t.v&&(a.ps[t.v]=W),t.i&&(a.ps[t.i]=W),e){var b=e[p];if(t.k&&(a.ps[t.k]=p),t.v&&(a.ps[t.v]=b),t.i&&(a.ps[t.i]=o++),(b=s?b[s]:r?B(m,r,a):t.k?p:b)!==W){t.k&&(a.ps[t.k]=b);let s=i[N],e=n[b];if(e){if(e.age==l)continue;let t=e.t[N],r=e.s!=s;r&&s&&!e.s[S].skip&&(s[S].skip=1,s=(f.el=s)[S].t[N],I(f,a,e=>e!=s,be),r=e.s!=(s=f[Z])),f.el=e.s,f.el[S].skip=0,I(q({},f,{}),a,e=>e!=t),I(f,a,e=>e!=t,({p:e,el:t})=>{r&&e[E](t,s)}),r?f[Z]=s:s=f[Z],e.age=l}else f.el=m,ge(f,a),f.el=i[N],e=n[b]={age:l,s:f.el},I(f,a,e=>e!=s);e.s[S].t=e.t=i=s?s[X]:u[V]}}T(n).filter(e=>n[e].age!=l)[M](e=>{ve({el:n[e].s},n[e].t[N],c),delete n[e]}),f[Z]=i[N]}}else{var i=t,d=e=a[j]("if"),l=s,{p:g,el:h}=i;if(!d||B(h,d,l)){let e,t=i[Z],r=be;h[S].fi?(t=h[S].fi[N],(e=(e=h[j](G))&&B(h,"`"+e+"`",l))&&h[S].u!=e&&(he(i,l),ge(q({},i,{el:h,next:t}),l))):(ge(i,l),r=he),i.el=h[N],I(i,l,e=>e!=t),I(i,l,me,r),h[S].fi=t?t[X]:g[V]}else he(i,l)}return}}{var v=t,y=s;d=o;let l=v.el,r=l[S],n=r.vs||(r.vs=[]),f=r.ps;if(!f){f=r.ps={ps:[]},v.cp&&(pe[++U]={as:d,ps:f},l[z]("z-d",U)),d[M](n=>{var o,i=l[j](n);if(ne.test(n)||ie(i)){let e=oe.exec(n),t=e[7],r=e[5],s=e[6],a=r?"."==r&&t?ee:(t=ZData.ss(t),F):t;(a=we[a]||a)&&(o=e[8]&&C(e[8],".")||[],(o={a:n,k:s?W:a!=ee&&o[A]("camel")?ye(a):a,b:(e[4]?3:e[2]&&2)||(e[1]||r||s?1:W),m:r&&t?[t,...o]:o,e:s?`${ye(a)}({e:this,v:${i||!0},m:{${o.map(e=>e+":1").join()}}})`:i,A:e[3]||o[A]("attr")}).b&&"!"!=r||(o.e="`"+o.e+"`"),f.ps.push(o),o.b)&&l[K](n)}else ZData.ss(n,i)});let e,t;(e=l.firstChild)&&e==l.lastChild&&3==e.nodeType&&ie(t=e.nodeValue)&&f.ps.push({k:P,e:"`"+t+"`",m:[]})}if(!v.cp){let a=0,t=r=>{if("*"==r.k)for(var e in r.K=B(l,r.e,y,r)||{})t(q({},r,{k:e,e:r.K[e],E:1,f:W}));else if(3==r.b)$e(v,r,y);else{let t=r.e;r.E||(t=B(l,t,y,r,r.k?W:1),r.k)||(r.e=W);var s=r.m[A]("number");if(r.k&&n[a]!==t&&(((r,e,s,a)=>{if(e.k==ee){if(e.m[L]){let t=""===e.e||s;s={},e.m[M](e=>{e.endsWith("-")?(s[e+t]=1,a&&(s[e+a]=0)):s[e]=t})}let t=r.classList;if(!Array.isArray(s)){if(J(s)){for(var n in s)s[n]?t.add(n):t[D](n);return}s=s?C(s):[]}s[M](e=>t.add(e))}else e.k==F&&(e.m[L]&&(s=1==e.m[L]?{[e.m[0]]:s}:{[e.m[0]]:s&&e.m[1]}),J(s))?T(s)[M](e=>{!1===s[e]?r[F].removeProperty(e):"-"==e[0]?r[F].setProperty(e,s[e]):r[F][e]=s[e]}):e.A?!1===s?r[K](e.k):r[z](e.k,s):r[e.k]=s})(l,r,s&&l.u&&J(t,"string")?t[_](/[^\d.-]/g,""):t===W?"":t,n[a]),n[a]=t),2==r.b){if(!r.b2){t="this."+r.k,r.k==F&&r.m[L]&&(t+="[`"+r.m[0]+"`]");let e="text"==l.type?Y:Q;r.m[A](Y)?e=Y:r.m[A](Q)&&(e=Q),r.m[A]("trim")&&(t+=".trim()"),s&&(t="this.u?this.u.replace(/1/,"+t+"):parseFloat("+t+")"),s="=this."+S+".vs["+a+"]=",t=/==/.test(r.e)?t+"&&("+r.e[_](/==+/,s)+")":r.e+s+t,r.b2=q({},r,{e:t,k:e,ev:e,f:W})}$e(v,r.b2,y)}a++}};f.ps[M](t)}}I({cp:n,p:a,el:a[O]},s)}},I=(e,t,r,s)=>{for(;e.el&&(!r||r(e.el));e.el=e[Z])e[Z]=e.el[N],s&&!s(e,t)||ue(e,t)},me=e=>e.hasAttribute("else"),be=()=>0,ge=({p:e,el:t,next:r,n:s},a,n)=>{(s=t[S].node)||(s=(s=t[j](G))&&(t[S].u=s=B(t,"`"+s+"`",a))&&(s=a.r[b](s)||(n=l(a.r[d],m))&&n[b](s))&&s.content||t.content,t[S].u||(t[S].node=s),I({cp:1,p:s,el:s[O]}));for(let o=s[O];o;o=o[N])s=o.cloneNode(!0),e[E](s,r)},he=(e,t)=>{var r;e.el[S]&&e.el[S].fi&&(r=e.el[S].fi[N],e.el[S].fi=W,e.el=e[Z],ve(e,r,t))},ve=(e,t,r)=>{I(e,r,e=>e!=t,({el:e})=>{e[D]()})},ye=e=>e[_](p,(e,t)=>t.toUpperCase()),we={css:F,text:P,html:"innerHTML"},g=(r,s)=>{let a;return(...e)=>{let t=this;a=(a=s?clearTimeout(a):a)||setTimeout(()=>{a=W,r.apply(t,e)},s)}},$e=({el:i},t,l)=>{let{a:f,k:d,e:c,ev:r,m:p}=t;if(!i[S][f]){let a=p[A]("window")?window:p[A]("document")||p[A]("out")?R:i,n=e=>{if(!(p[A]("self")&&i!=e.target||p[A]("out")&&i.contains(e.target))){if(d[y]("key")||d[y]("mouse")||d.endsWith("click")){for(var t of p)if((t=se.exec(t))&&(t[3]||t[4])&&(!(t=t[3]||t[4]&&"meta")||!e[t+"Key"]))return;var r=p.filter(e=>!se.test(e));if(1==r[L])if(d[y]("key")&&e.key){var s=r[0][_](le,"");if(({space:" ",slash:"/",gt:">",eq:"="}[s]||s)!=(e.key.toLowerCase()[_](le,"")||" "))return}else if(["left","mid","right"][e.button]!=r[0])return}return p[A]("prevent")&&e.preventDefault(),p[A]("stop")&&e.stopPropagation(),p[A]("once")&&a.removeEventListener(d,n,o),B(i,c,q({},l,{ps:q({},i[S][f],{$el:l.r})}))}},e=p.indexOf("debounce"),o=(0<=e&&(e=p[e+1],t=se.exec(e),e=t&&t[1]?t[2]?+t[1]:1e3*t[1]:250,n=g(n,e)),{capture:p[A]("capture"),passive:p[A]("passive")});a[re](d,n,o),r&&!i[e="fireChange"]&&(i[e]=()=>ce(i,r))}i[S][f]=q({},l.ps,{})},xe={},ke=(e,t,r,s)=>(r=s&&s.f||xe[r+=e]||(xe[r]=new Function(["$2D",...t],"var R3$;with($2D){R3$="+e+"};return R3$")),s&&!s.f&&(s.f=r),r),B=(e,t,r,s,a)=>t&&je(()=>o(t)?t.call(e,r.r):(t=ke(t,T(r.ps),T(r.ps).join(","),s).call(e,r.d,...n(r.ps)),a&&o(t)?t(a):t),{el:e,exp:t}),Se=(e,t,r)=>console.warn(`E ${w}: ${r} [${t}]`,e),je=(e,{el:t,exp:r})=>{try{var s=e();return s instanceof Promise?s.catch(e=>Se(t,r,e)):s}catch(e){Se(t,r,e)}},ze=(e,r,s,t,a,n)=>{r=r||R.body;let o,i=[],l,f="",d,c=R[v](w),p=((o=r[j]("z-i"))||r[z]("z-i",o=++h),g(()=>{--u<0&&(u=0),i[L]&&i.shift()()}));c[we.html]=e[_](//g,"")[_](/^z-data\s*/,()=>n=1)[_](/<(script)([^>]*)>([^]*?)<\/\1>/gi,(e,t,s,a)=>{var r=s.match(/src\s*=\s*(?:'([^']+)|"([^"]+)|(\S+))/);if((s=r&&(r[1]||r[2]||r[3]))&&!te(`script[src="${s}"]`)[L]||a){let r=R[v]("script"),t=(e,t)=>(l=()=>(R.body[E](r,W),e&&e()),t?l():i.push(l));r[z](x,""),s?ZData.get?i.push(()=>ZData.get(s).then(e=>(r[P]=e,t(p,1)))):(r.src=s,r.onload=r.onerror=p,t()):n&&!f?f=a:(r[P]=a,t(p))}return""})[_](/(@]*>)([^]*?)(?=<\/style>)/gi,(e,t,r)=>t+r[_](/\s*([^{}]+)(?=\{)/g,(e,t)=>/^[@\d]|^(from|to)\b/.test(t)?t:C(t,/\s*,\s*/).map(e=>e[_](/^(\[z-i=.*?\] )?(.*)/,(e,t,r)=>`[z-i="${o}"] `+r)).join(","))),d=c[b](m)||c[O],n&&f&&d[z](w,`args=>{${f[_](/\bexport\s+default(?=\s*\{)/,"return")}}`),d&&t&&(d[k]=t),i.push(()=>{for(let e=c[O],t=e&&e[N];e;t=(e=t)&&t[N])r[E](e,s);a&&s&&s[D](),p()}),i.push(()=>d&&H(d)),u+=i[L],p()},De=e=>e[S]&&e[S].ob&&e[S].ob.disconnect(),Oe=e=>{let t=(e[S]||(e[S]={})).ob||(e[S].ob=new MutationObserver(s=>{if(!u)if(e==R.body){if(s[L]<99){let e=1;for(let t=0,r;tt.observe(e,{childList:!0,subtree:!0}))},Ze=g(()=>Ne(W,1)),Ne=(e,t)=>{t||++a,++u,De(R.body),te(m)[M](e=>l(e)||H(e)),--u,Oe(R.body)},Ee={};return R[re]("DOMContentLoaded",Ne),{start:Ne,loadHTML:ze,on:(e,t)=>((Ee[e]=Ee[e]||[]).push(t),ZData),call:(e,t)=>(Ee[e]||[])[M](e=>e(t)),ss:e=>e,deb:g}})(),zJSON=(null==Element.prototype.getAttributeNames&&(Element.prototype.getAttributeNames=function(){for(var e=this.attributes,t=e.length,r=new Array(t),s=0;s{if(e&&"object"==typeof e&&!t.get(e)&&t.set(e,1))for(var r in e){var s=e[r];"function"==typeof s?e[r]={"@type":"function","@text":s.toString()}:zJSON.onStringify(s,t)}return e},onParse:obj=>{if(obj&&"object"==typeof obj)for(var i in obj){let o=obj[i];if(o&&"object"==typeof o)if("function"==o["@type"]&&"@text"in o){let s=zJSON.fn(o["@text"]);obj[i]=eval(s)}else zJSON.onParse(o)}return obj},fn:e=>e.replace(/^ *(function )? *(\w+) *(\([^]*$)/,(e,t,r,s)=>"(()=>"+(t||"function"!=r?"function ":"")+r+s+")()"),init(){let r=JSON.parse,s=JSON.stringify;JSON.parseEx=(e,t)=>zJSON.onParse(r(e,t)),JSON.stringifyEx=(e,t,r)=>s(zJSON.onStringify(e,new WeakMap),t,r)}});function yaqsmini(e,a){return a?1==a?e.replace(/^(?:(\d+)(?:\)|(])))?(.*)/gm,(e,t,r,s)=>(a=(t=(t=r?a.match(new RegExp(`^('[^']+' +|"[^"]+" +|[^ ]+ +){${t}}`))[0].length:t)?+t:0)?a.slice(0,t)+s:s," ".repeat(t)+s)):e.replace(/^( +)?(.*)$/gm,(e,t,r)=>{var s;return t?(s=(t=a.slice(0,t.length)).replace(/'[^']+' +|"[^"]+" +|[^ ]+ +/g,".").length,a=t+r,s+"]"+r):a=e}):e.replace(/^ +/gm,e=>e.length+")")}function yaqs(e){let s;return e.replace(/\\n[ \n]/g,"\n").replace(/^.*$/gm,e=>s=e.replace(/^ +|^(\d+)(?:\)|(]))/,(e,t,r)=>s.slice(0,r?s.match(new RegExp(`^('[^']+' +|"[^"]+" +|[^ ]+ +){${t}}`))[0].length:t?+t:e.length).replace(/^-(?=\s+)/,">")).replace(/([^ :=])( +([^ '"]*|'[^']*'|"[^"]*"))$/,"$1:$2")).replace(/\n/g,";")}function qs2json(e,o=".",i="",l=!1){let f=(e,t)=>"object"==typeof e&&/^[->]$/.test(t)?e.length-("-"!=t?1:0):t,d=/^\s*[-0]\s/.test(e)?[]:{};return e.replace(/^[#? ]+| +$/,"").split(/\s*[&;]\s*/).forEach(r=>{let[s,a]=r.split(/\s*[=:]\s*/,2);if(s){a=r.slice(s.length).replace(/^\s*[=:]\s*/,"")||i,a=/^-?(\d*\.)?\d+$/.test(a)?+a:a.replace(/^"([^"]+)"$|^'([^']+)'$/,(e,t,r)=>t||r||""),l&&/^\/.+\/$/.test(a)&&(a={$regex:a.slice(1,-1)});r=(s=(s=s.replace(/"([^"]+)"|'([^']+)'/g,(e,t,r)=>(t||r||"").replace(/ +/g,o).replace(new RegExp(`[${o}]`,"g"),'"'))).replace(/ +/g,o).split(o)).slice(-1)[0].replace(/"/g,o);let e=d;for(let t=0;t" "==n&&"string"==typeof e&&(t?/ /:/ |^-?(\d*\.)?\d+$/).test(e)?'"'+e+'"':e;let l=(t,r="")=>e&&Object.keys(t).map(e=>"object"!=typeof t[e]||o&&o(e,t[e],1)||!Object.keys(t[e]).length&&!o?(e?r+i(e,1).replace(/[A-Z]/g,e=>o?"-"+e.toLowerCase():e):r.slice(0,-1))+a+(o&&o(e,t[e])||(void 0===t[e]?"":Array.isArray(t[e])?"[]":"object"==typeof t[e]?"{}":i(t[e]))):l(t[e],r+i(e,1)+n)).join(s)||"";return l(e)}function json2yaqs(e,n){const o=e=>e.match(/"[^"]+"|'[^']+'|[^ ]+/g);return json2qs(e,"\n"," "," ").replace(/^.+$/gm,t=>{let r=t;if(n){var s=o(n),a=o(t);for(let e=0;e/(^transform|\bfilter)$/.test(e)&&t&&Object.keys(t).length&&(r||json2qs(t,") ","(")+")"))}function sig(e,t){const r="12345678qwertyuioplkjhgfdsazxcvbnmMNBVCXZASDFGHJKLPOIUYTREWQ";let s=0;for(let n=0;nsetTimeout(()=>(t()?e:s)(),r);s()}try{ZData.get=top.ZData&&top.ZData.get||(r=>{let s=top.__z_data_cache__||(top.__z_data_cache__={});return s[r]||(s[r]=new Promise(e=>{var t=/^z:/.test(r)?"/page?id="+r.replace(/^z:\/*/,""):r;fetch(t).then(e=>e.text()).then(t=>{s[r]=new Promise(e=>t&&e(t)),t&&e(t)})}))})}catch(e){console.warn(e.message)}const ZDataStyle={csss:{},cache:{},add(e){!function e(t,r){for(var s in t)r[s]&&"object"==typeof r[s]?e(t[s],r[s]):r[s]=t[s]}(e,this.csss),(this.updateLater||(this.updateLater=function(r){let s;return(...e)=>{let t=this;s=s||setTimeout(()=>{s=void 0,r.apply(t,e)})}}(function(t){var r=json2css(t.csss,1);if(r!=t.old){t.old=r;let e=document.querySelector("style#z-data-ss");e||((e=document.createElement("style")).id="z-data-ss",e.setAttribute("keep",""),document.head.insertBefore(e,null)),e.textContent=r}})))(this)},namedGroup(e,t){var r={};for(let s=0;se?r+(t[e]||e)+s:"",NUMS:(e,t)=>/^--/.test(e)?`var(${e})`:""+(t?e:e/4)+(t||"rem"),MINW:{sm:640,s:640,md:768,m:768,lg:1024,l:1024,xl:1280,"2xl":1536,xxl:1536}},pattern:/^(?:(sm?|md?|lg?|xl|[2x]xl|print):)?(?:((p|m)(l|t|r|b)?(-?(?:\d*\.)?\d+|--\w+)(\w+|%)?)|(([pm])x(\S*))|(([pm])y(\S*))|((x|n)?(h|w)(-?(?:\d*\.)?\d+|--\w+)(\w+|%)?)|((font|lh|gap|gapr|gapc|brad)(-?(?:\d*\.)?\d+|--\w+)(\w+|%)?)|((l|t|r|b)(-?(?:\d*\.)?\d+|--\w+)(\w+|%)?)|((op|ord|z)(-?(?:\d*\.)?\d+|--\w+))|((pos|d|cs|v|ws|us|pe)-([\w\-]+))|((o)(x|y)?-(\w+))|((content)(-\S+)?)|((b|c)(#[0-9a-fA-F]+|--\w+))|((brad)(l|t|r|b)(l|t|r|b)(-?(?:\d*\.)?\d+|--\w+)(\w+|%)?)|((brad)([tb])(\S*)))$/,patterns:["media","rule16","pm16","side16","num16","unit16","rule17","pm17","any17","rule18","pm18","any18","rule19","xn19","hw19","num19","unit19","rule20","fslh20","num20","unit20","rule21","side21","num21","unit21","rule22","ooz22","num22","rule23","pos23","value23","rule24","of24","xy24","value24","rule25","name25","value25","rule26","name26","color26","rule27","a27","side27","sidE27","num27","unit27","rule28","a28","side28","any28"],monaco:/\b(?:(?:sm?|md?|lg?|xl|[2x]xl|print):)?(?:(?:(?!not)\w+)(?:[-+~\^]))?(?:not-)?(?:hover|focus(?:-\w+)?|active|after|before|(?:first|last)(?:-\w+)*)=|\b(?:bd|bl|bt|br|bb|bg|a|al|font|flex|grid|mask)=(?:'[^']+'|"[^"]+"|[^\s>]+)?|\b(?:(?:sm?|md?|lg?|xl|[2x]xl|print):)?(?:(?:p|m)(?:l|t|r|b)?(?:-?(?:\d*\.)?\d+|--\w+)(?:\w+|%)?|(?:[pm])x(?:[^\s>]*)|(?:[pm])y(?:[^\s>]*)|(?:x|n)?(?:h|w)(?:-?(?:\d*\.)?\d+|--\w+)(?:\w+|%)?|(?:font|lh|gap|gapr|gapc|brad)(?:-?(?:\d*\.)?\d+|--\w+)(?:\w+|%)?|(?:l|t|r|b)(?:-?(?:\d*\.)?\d+|--\w+)(?:\w+|%)?|(?:op|ord|z)(?:-?(?:\d*\.)?\d+|--\w+)|(?:pos|d|cs|v|ws|us|pe)-(?:[\w\-]+)|(?:o)(?:x|y)?-(?:\w+)|(?:content)(?:-[^\s>]+)?|(?:b|c)(?:#[0-9a-fA-F]+|--\w+)|(?:brad)(?:l|t|r|b)(?:l|t|r|b)(?:-?(?:\d*\.)?\d+|--\w+)(?:\w+|%)?|(?:brad)(?:[tb])(?:[^\s>]*))|[!#][\w\-]+/,monacos:[],media:/^(?:(sm?|md?|lg?|xl|[2x]xl|print):)?(?:((?!not)\w+)([-+~\^]))?(not-)?(hover|focus(?:-\w+)?|active|after|before|(?:first|last)(?:-\w+)*)$|^(bd|bl|bt|br|bb|bg|a|al|font|flex|grid|mask)$/,medias:["media","before","to","not","after","group"],targets:{rule16:"${PM[pm]}${IF(side,LTRB,'-','')}:${NUMS(num,unit)}",rule17:"> ${pm}l${any} ${pm}r${any}",rule18:"> ${pm}t${any} ${pm}b${any}",rule19:"${IF(xn,XN,'','-')}${HW[hw]}:${NUMS(num,unit)}",rule20:"${FSLH[fslh]}:${NUMS(num,unit)}",rule21:"${LTRB[side]}:${NUMS(num,unit)}",rule22:"${OOZ[ooz]}:${/^--/.test(num) ? `var(${num})` : num > 1 && ooz == 'op' ? num / 100 : num}",rule23:"${POS[pos]}:${value}",rule24:"${OF[of]}${IF(xy,{},'-','')}:${value}",rule25:"${name}:'${value ? value.slice(1) : ''}'",rule26:"${COLOR[name]}:${/^--/.test(color) ? `var(${color})` : color}",rule27:"border-${LTRB[side]}-${LTRB[sidE]}-radius:${NUMS(num,unit)}",rule28:"> brad${side}l${any} brad${side}r${any}"}};function flowid(e){e=String(e||0);var t=(new Date).format("yymmddhhnnsszzzrr");let r=0,s=t+e;for(let a=0;a{let e=Date.now();e<=d&&(e=d+1),d=e,e-=l;var r,t=i<<2,s=63&t;let a="",n=0;for(r of[[t,2],[e,7]]){let e=r[0],t=r[1];for(;t--;){var o=63&e;e>>=6,a=f[o]+a,n=7*n%127+o}}return a=a.slice(0,-1)+f[s+n&3]},toTime:r=>{if(9==r.length){let e=0;for(let t=0;t<7;t++)e=(e<<6)+f.indexOf(r[t]);return new Date(e+l)}}}}ZData.ss=(s,v,args={})=>{let{after,before,attr,media,preview,ret}=args;if(after=after||"",before=before||"",attr=attr||"",void 0===v)return{pos:"position",z:"z-index",d:"display",o:"overflow",ox:"overflow-x",oy:"overflow-y",l:"left",t:"top",r:"right",b:"bottom",w:"width",h:"height",nw:"min-width",nh:"min-height",xh:"max-height",xw:"max-width",lh:"line-height",p:"padding",pl:"padding-left",pt:"padding-top",pr:"padding-right",pb:"padding-bottom",m:"margin",ml:"margin-left",mt:"margin-top",mr:"margin-right",mb:"margin-bottom",v:"visibility",c:"color",bg:"background",bv:"backface-visibility",op:"opacity",bd:"border",bl:"border-left",bt:"border-top",br:"border-right",bb:"border-bottom",bc:"border-color",bs:"border-style",bw:"border-width",blc:"border-left-color",bls:"border-left-style",blw:"border-left-width",btc:"border-top-color",bts:"border-top-style",brc:"border-right-color",brs:"border-right-style",brw:"border-right-width",btw:"border-top-width",bbc:"border-bottom-color",bbs:"border-bottom-style",bbw:"border-bottom-width",brad:"border-radius",btlr:"border-top-left-radius",btrr:"border-top-right-radius",bblr:"border-bottom-left-radius",bbrr:"border-bottom-right-radius",shadow:"box-shadow",g:"grid",f:"flex",fb:"flex-basis",fd:"flex-direction",fg:"flex-grow",fs:"flex-shrink",fw:"flex-wrap",ord:"order",ac:"align-content",ai:"align-items",as:"align-self",al:"align",jc:"justify-content",ta:"text-align",va:"vertical-align",ws:"white-space",td:"text-decoration",a:"animation",tf:"transform",pe:"pointer-events",us:"user-select"}[s]||s;{const key=[s,v,after,before,attr,media].join(",");if(ZDataStyle.cache[key])return ZDataStyle.cache[key];if(""===v){const{env,pattern,patterns,namedGroup,targets}=ZDataStyle;return s.split(/\s+/).forEach(s=>s.replace(pattern,(...args)=>{const names=namedGroup(args,patterns),name=Object.keys(names).find(e=>names[e]&&/^rule\d+$/.test(e)),target=targets[name];if(target){let vars={};for(var k in names){let nk=k.replace(/\d+$/,"");void 0===names[k]&&nk in vars||(vars[nk]=names[k])}vars=Object.assign({},vars,Object.assign({},env,{}));let css=eval("with(vars)`"+target+"`");if(ret)return ret.push(css);">"==css[0]&&(css=ZData.ss(css.replace(/^> */,""),v,{ret:[]})),attr=attr||`[${CSS.escape(s)}=""]`,css=css.split(":"),css={[""+before+attr+after]:{[css[0]]:css.slice(1).join(":")}},names.media&&(media=names.media),media&&(media=env.MINW[media]?`@media (min-width: ${env.MINW[media]}px)`:"@media "+media,css={[media]:css}),preview||ZDataStyle.add(css),ZDataStyle.cache[key]=json2css(css,1)}})),ret?ret.join(";"):ZDataStyle.cache[key]}{const{media:pattern,medias,namedGroup}=ZDataStyle;let after,before,media,group;return s.replace(pattern,(...e)=>{e=namedGroup(e,medias);e.group?(group={[`[${s}="${v}"]`]:{[ZData.ss(s)]:css2json(v)}},preview||ZDataStyle.add(group)):(e.after&&(after=":"+e.after,e.not)&&(after=":not("+after+")"),e.before&&(before="["+e.before+'=""]',after&&(before+=after,after=""),before+={"-":" ","^":">"}[e.to]||e.to),e.media&&(media=e.media))}),group?json2css(group,1):after||before||media?ZData.ss(v,"",{after:after,before:before,attr:`[${CSS.escape(s)}="${v}"]`,media:media,preview:preview}):""}}},Date.prototype.format=(()=>{let l=1;return function(e,t,r,s){if(!e)return"";let a=this,n=(t&&(a=new Date(a.setDate(a.getDate()+t))),{y:(a=r?new Date(a.setHours(a.getHours()+r)):a).getFullYear(),m:a.getMonth()+1,d:a.getDate(),w:a.getDay(),h:a.getHours(),n:a.getMinutes(),s:a.getSeconds(),z:a.getMilliseconds(),r:(l++,s?Math.random()+""+l:l),v:e=>{let t=0;for(let r=0;r{var n,i=0,B=0,g=0,u=0,e="Attribute",t="Element",s=t+"Sibling",r=t+"Child";const k="z-data",$="z-comp",x="z-none",p="init",w="args",U="key",G="use",z="_z_d",v=`[${k}]`,D="get"+e,Z="set"+e,m="remove",C=m+e,E="first"+r,I="last"+r,J="previous"+s,P="next",A=P+s,y="create"+t,f="parent"+t,L="insertBefore",_="forEach",O="includes",j="length",Q="startsWith",M=(e,t=/ +/)=>e.trim().split(t),T="replace",N="textContent",X="input",Y="change",ee="class",W="style",h="querySelector",F=document,te=(e,t=F)=>t[h+"All"](e),o=(e,t=`[${x}]`)=>e.closest(t),se="addEventListener",K=Object.keys,a=Object.values||(o=>K(o).map(k=>o[k])),Oa=Object.assign,dP="deleteProperty",R=(e,t="object")=>typeof e==t,l=e=>R(e,"function"),S=void 0,re=/^(?:camel|prevent|stop|debounce|(\d+)(?:(m?)s)|capture|once|passive|self|out|window|document|(shift|ctrl|alt|meta)|(cmd))$/,ie=/^(?:\s*(?:(\w+)\s*:\s*)?(\w*)(?:\s*,\s*(\w+))?\s+in\s+)?(.+)$/,ae=/^[:@.#!].|^z-d-/,le=/^(?:(:)(:?)(!?)|(@)|([.#!])|(z-d-))?([^.]*)(?:[.]([^.].*))?$/,ne=e=>e&&0<=e.indexOf("${")&&e.indexOf("`")<0,oe=/[-_ ]+/g,c=/-([a-z])/g,d=new WeakMap,pe=(t,s)=>{if(!t||!R(t)||l(t)||t.__ob__||t._isVue||!delete t[s.i])return t;{let e=d.get(t);if(e||((e={s:{},set(e,t,s,r){for(var i in this.s)this.s[i].set(e,t,s,r);return!0},[dP](e,t){let s,r=!0;for(s in this.s)r=this.s[s][dP](e,t)&&r;return r}}).p=new Proxy(t,e),d.set(t,e).set(e.p,e)),!e.s[s.i])for(var r in e.s[s.i]=s,t)try{t[r]=n(t[r],s)}catch(e){}return e.p}},fe=(e,t,s)=>e.dispatchEvent(new CustomEvent(t,{detail:s,bubbles:!0})),q=(t,s)=>{if(!t[z]||!(i<=t[z].age||t[z].ing)){(t[z]||(t[z]={})).age=i,t[z].ing=(t[z].ing||0)+1,s=s&&(t[z].env=s)||t[z].env||{ps:{$emit:fe},d:{}};var e=e=>{u++,Ce(F.body),de({p:t[f],el:t},Oa({},s,{d:t[z].zd,r:t}),e||i),u--,Ee(F.body)};let l=b(e);var r=t[z].zd;if(!r){let a={i:z+Math.random(),set(e,t,s,r,i){l();try{i||(e[t]=n(s,a))}catch(e){}return!0},[dP](e,t){return t!=this.i&&(l(),delete e[t])}};n=window.ZDataProxy||pe,ZData.proxy=e=>n(e,a),r=V(t,t[D](k),s,S,t[w]||{})||{},t.$data=t[z].zd=r=n(r,a),t[Z](k,""),t[w]&&(r[w]=t[w]),V(t,t[D](p),Oa({},s,{d:r}))}e(1),t[z].ing--}},ce={},de=(r,i,c)=>{let{p:s,el:a,cp:e}=r,t;var l=a[z]||(a[z]={});let n=l.as||(l.as=(t=ce[a[D]("z-d")])?(l.ps=t.ps,t.as):a.getAttributeNames());if(!n[O](x)){if(!e){let e,t;if(c===S&&n[O](k))return q(a,i);if(n[O]($)&&(e=a[D]($))){try{a[C]($),(t=/^([.\/]|https?:)/.test(e)?fetch(e).then(e=>e.text()):/^z:/.test(e)&&ZData.get?ZData.get(e):V(a,e,i)).then(e=>{var t=V(a,a[D](w),i);"-"==a.tagName[1]||n[O]("del")?Ze(e,s,a,t,1):Ze(e,a,S,t)}).catch(ve)}catch(e){}return}if("template"==a.localName){if(a.content||(a.content=F.createDocumentFragment())[L](a[E],S),e=a[D]("for")){var p=r;l=e;var f=i;c=ie.exec(l);if(c){var d,{p:u,el:v}=p;let e=V(v,c[4],f),t={k:c[1],v:c[2],i:c[3]},i=Oa({},f,{ps:Oa({},f.ps,{})}),s=v[D](U),r=s&&M(s,"."),a=v[z].ns||(v[z].ns={}),l=0,n=v,o=v[z].age=(v[z].age||0)+1;for(d in r=r&&2==r[j]&&r[0]==t.v&&r[1],t.k&&(i.ps[t.k]=S),t.v&&(i.ps[t.v]=S),t.i&&(i.ps[t.i]=S),e){var m=e[d],m=(t.k&&(i.ps[t.k]=d),t.v&&(i.ps[t.v]=m),t.i&&(i.ps[t.i]=l++),r?m[r]:s?V(v,s,i):t.k?d:m);if(m!==S){t.k&&(i.ps[t.k]=m);let r=n[A],e=a[m];if(e){if(e.age==o)continue;let t=e.t[A],s=e.s!=r;s&&r&&!e.s[z].skip&&(r[z].skip=1,r=(p.el=r)[z].t[A],H(p,i,e=>e!=r,ve),s=e.s!=(r=p[P])),p.el=e.s,p.el[z].skip=0,H(Oa({},p,{}),i,e=>e!=t),H(p,i,e=>e!=t,({p:e,el:t})=>{s&&e[L](t,r)}),s?p[P]=r:r=p[P],e.age=o}else p.el=v,me(p,i),p.el=n[A],e=a[m]={age:o,s:p.el},H(p,i,e=>e!=r);e.s[z].t=e.t=n=r?r[J]:u[I]}}K(a).filter(e=>a[e].age!=o)[_](e=>{be({el:a[e].s},a[e].t[A],f),delete a[e]}),p[P]=n[A]}}else{e=a[D]("if");var l=r,c=e,o=i,{p:h,el:b}=l;if(!c||V(b,c,o)){let e,t=l[P],s=ve;b[z].fi?(t=b[z].fi[A],(e=(e=b[D](G))&&V(b,"`"+e+"`",o))&&b[z].u!=e&&(he(l,o),me(Oa({},l,{el:b,next:t}),o))):(me(l,o),s=he),l.el=b[A],H(l,o,e=>e!=t),H(l,o,ue,s),b[z].fi=t?t[J]:h[I]}else he(l,o)}return}}{var g=r;var y=i;c=n;let p=g["el"],s=p[z],a=s.vs||(s.vs=[]),f=s.ps;if(!f){f=s.ps={ps:[]};if(g.cp){ce[++B]={as:c,ps:f};p[Z]("z-d",B)}c[_](n=>{let o=p[D](n);if(ae.test(n)||ne(o)){let s=le.exec(n),r=s[7],i=s[5],a=s[6],l=i?i!="."||!r?(r=ZData.ss(r),W):ee:r;l=ye[l]||l;if(l){let e=s[8]&&M(s[8],".")||[];let t={a:n,k:a?S:l==ee||!e[O]("camel")?l:ge(l),b:s[4]&&3||s[2]&&2||(s[1]||i||a)&&1||S,m:i&&r?[r,...e]:e,e:a?`${ge(l)}({e:this,v:${o||true},m:{${e.map(e=>e+":1").join()}}})`:o,A:s[3]||e[O]("attr")};if(!t.b||i=="!")t.e="`"+t.e+"`";f.ps.push(t);t.b&&p[C](n)}}else ZData.ss(n,o)});let e,t;if((e=p.firstChild)&&e==p.lastChild&&e.nodeType==3&&ne(t=e.nodeValue))f.ps.push({k:N,e:"`"+t+"`",m:[]})}if(!g.cp){let i=0,t=s=>{if("*"==s.k)for(var e in s.K=V(p,s.e,y,s)||{})t(Oa({},s,{k:e,e:s.K[e],E:1,f:S}));else if(3==s.b)$e(g,s,y);else{let t=s.e;s.E||(t=V(p,t,y,s,s.k?S:1),s.k)||(s.e=S);var r=s.m[O]("number");if(s.k&&a[i]!==t&&(ke(p,s,r&&p.u&&R(t,"string")?t[T](/[^\d.-]/g,""):t===S?"":t,a[i]),a[i]=t),2==s.b){if(!s.b2){t="this."+s.k,s.k==W&&s.m[j]&&(t+="[`"+s.m[0]+"`]");let e="text"==p.type?X:Y;s.m[O](X)?e=X:s.m[O](Y)&&(e=Y),s.m[O]("trim")&&(t+=".trim()"),r&&(t="this.u?this.u.replace(/1/,"+t+"):parseFloat("+t+")");r="=this."+z+".vs["+i+"]=";t=/==/.test(s.e)?t+"&&("+s.e[T](/==+/,r)+")":s.e+r+t,s.b2=Oa({},s,{e:t,k:e,ev:e,f:S})}$e(g,s.b2,y)}i++}};f.ps[_](t)}}H({cp:e,p:a,el:a[E]},i)}},H=(e,t,s,r)=>{for(;e.el&&(!s||s(e.el));e.el=e[P])e[P]=e.el[A],r&&!r(e,t)||de(e,t)},ue=e=>e.hasAttribute("else"),ve=()=>0,me=({p:e,el:t,next:s,n:r},i,a)=>{(r=t[z].node)||(r=(r=t[D](G))&&(t[z].u=r=V(t,"`"+r+"`",i))&&(r=i.r[h](r)||(a=o(i.r[f],v))&&a[h](r))&&r.content||t.content,t[z].u||(t[z].node=r),H({cp:1,p:r,el:r[E]}));for(let l=r[E];l;l=l[A])r=l.cloneNode(!0),e[L](r,s)},he=(e,t)=>{var s;e.el[z]&&e.el[z].fi&&(s=e.el[z].fi[A],e.el[z].fi=S,e.el=e[P],be(e,s,t))},be=(e,t,s)=>{H(e,s,e=>e!=t,({el:e})=>{e[m]()})},ge=e=>e[T](c,(e,t)=>t.toUpperCase()),ye={css:W,text:N,html:"innerHTML"},ke=(s,e,r,i)=>{if(e.k==ee){if(e.m[j]){let t=""===e.e||r;r={},e.m[_](e=>{e.endsWith("-")?(r[e+t]=1,i&&(r[e+i]=0)):r[e]=t})}let t=s.classList;if(!Array.isArray(r)){if(R(r)){for(var a in r)r[a]?t.add(a):t[m](a);return}r=r?M(r):[]}r[_](e=>t.add(e))}else e.k==W&&(e.m[j]&&(r=1==e.m[j]?{[e.m[0]]:r}:{[e.m[0]]:r&&e.m[1]}),R(r))?K(r)[_](e=>{!1===r[e]?s[W].removeProperty(e):"-"==e[0]?s[W].setProperty(e,r[e]):s[W][e]=r[e]}):e.A?!1===r?s[C](e.k):s[Z](e.k,r):s[e.k]=r},b=(s,r)=>{let i;return(...e)=>{let t=this;i=(i=r?clearTimeout(i):i)||setTimeout(()=>{i=S,s.apply(t,e)},r)}},$e=({el:n},t,o)=>{let{a:p,k:f,e:c,ev:s,m:d}=t;if(!n[z][p]){let i=d[O]("window")?window:d[O]("document")||d[O]("out")?F:n,a=e=>{if(!(d[O]("self")&&n!=e.target||d[O]("out")&&n.contains(e.target))){if(f[Q]("key")||f[Q]("mouse")||f.endsWith("click")){for(var t of d){t=re.exec(t);if(t&&(t[3]||t[4])){t=t[3]||t[4]&&"meta";if(!t||!e[t+"Key"])return}}var s=d.filter(e=>!re.test(e));if(1==s[j])if(f[Q]("key")&&e.key){var r=s[0][T](oe,"");if(({space:" ",slash:"/",gt:">",eq:"="}[r]||r)!=(e.key.toLowerCase()[T](oe,"")||" "))return}else if(["left","mid","right"][e.button]!=s[0])return}return d[O]("prevent")&&e.preventDefault(),d[O]("stop")&&e.stopPropagation(),d[O]("once")&&i.removeEventListener(f,a,l),V(n,c,Oa({},o,{ps:Oa({},n[z][p],{$el:o.r})}))}},e=d.indexOf("debounce");0<=e&&(e=d[e+1],t=re.exec(e),e=t&&t[1]?t[2]?+t[1]:1e3*t[1]:250,a=b(a,e));let l={capture:d[O]("capture"),passive:d[O]("passive")};i[se](f,a,l),s&&!n[e="fireChange"]&&(n[e]=()=>fe(n,s))}n[z][p]=Oa({},o.ps,{})},xe={},we=(e,t,s,r)=>{s=r&&r.f||xe[s+=e]||(xe[s]=new Function(["$2D",...t],"var R3$;with($2D){R3$="+e+"};return R3$"));return r&&!r.f&&(r.f=s),s},V=(e,t,s,r,i)=>t&&De(()=>l(t)?t.call(e,s.r):(t=we(t,K(s.ps),K(s.ps).join(","),r).call(e,s.d,...a(s.ps)),i&&l(t)?t(i):t),{el:e,exp:t}),ze=(e,t,s)=>console.warn(`E ${k}: ${s} [${t}]`,e),De=(e,{el:t,exp:s})=>{try{var r=e();return r instanceof Promise?r.catch(e=>ze(t,s,e)):r}catch(e){ze(t,s,e)}},Ze=(e,s,r,t,i,a)=>{s=s||F.body;let l,n=[],o,p="",f,c=F[y](k),d=((l=s[D]("z-i"))||s[Z]("z-i",l=++g),b(()=>{--u<0&&(u=0),n[j]&&n.shift()()}));c[ye.html]=e[T](//g,"")[T](/^z-data\s*/,()=>a=1)[T](/<(script)([^>]*)>([^]*?)<\/\1>/gi,(e,t,r,i)=>{var s=r.match(/src\s*=\s*(?:'([^']+)|"([^"]+)|(\S+))/);if((r=s&&(s[1]||s[2]||s[3]))&&!te(`script[src="${r}"]`)[j]||i){let s=F[y]("script"),t=(e,t)=>(o=()=>(F.body[L](s,S),e&&e()),t?o():n.push(o));s[Z](x,""),r?ZData.get?n.push(()=>ZData.get(r).then(e=>(s[N]=e,t(d,1)))):(s.src=r,s.onload=s.onerror=d,t()):a&&!p?p=i:(s[N]=i,t(d))}return""})[T](/(@]*>)([^]*?)(?=<\/style>)/gi,(e,t,s)=>t+s[T](/\s*([^{}]+)(?=\{)/g,(e,t)=>/^[@\d]|^(from|to)\b/.test(t)?t:M(t,/\s*,\s*/).map(e=>e[T](/^(\[z-i=.*?\] )?(.*)/,(e,t,s)=>`[z-i="${l}"] `+s)).join(","))),f=c[h](v)||c[E],a&&p&&f[Z](k,`args=>{${p[T](/\bexport\s+default(?=\s*\{)/,"return")}}`),f&&t&&(f[w]=t),n.push(()=>{for(let e=c[E],t=e&&e[A];e;t=(e=t)&&t[A])s[L](e,r);i&&r&&r[m](),d()}),n.push(()=>f&&q(f)),u+=n[j],d()},Ce=e=>e[z]&&e[z].ob&&e[z].ob.disconnect(),Ee=e=>{let t=(e[z]||(e[z]={})).ob||(e[z].ob=new MutationObserver(r=>{if(!u)if(e==F.body){if(r[j]<99){let e=1;for(let t=0,s;tt.observe(e,{childList:!0,subtree:!0}))},Pe=b(()=>Ae(S,1)),Ae=(e,t)=>{t||++i,++u,Ce(F.body),te(v)[_](e=>o(e)||q(e)),--u,Ee(F.body)},Le={};return F[se]("DOMContentLoaded",Ae),{start:Ae,loadHTML:Ze,on:(e,t)=>((Le[e]=Le[e]||[]).push(t),ZData),call:(e,t)=>(Le[e]||[])[_](e=>e(t)),ss:e=>e,deb:b}})();null==Element.prototype.getAttributeNames&&(Element.prototype.getAttributeNames=function(){for(var t=this.attributes,e=t.length,r=new Array(e),n=0;n{var n,i=0,B=0,g=0,u=0,e="Attribute",t="Element",s=t+"Sibling",r=t+"Child";const k="z-data",$="z-comp",x="z-none",p="init",w="args",U="key",G="use",z="_z_d",v=`[${k}]`,D="get"+e,Z="set"+e,m="remove",C=m+e,E="first"+r,I="last"+r,J="previous"+s,P="next",A=P+s,y="create"+t,f="parent"+t,L="insertBefore",_="forEach",O="includes",j="length",Q="startsWith",M=(e,t=/ +/)=>e.trim().split(t),T="replace",N="textContent",X="input",Y="change",ee="class",W="style",h="querySelector",F=document,te=(e,t=F)=>t[h+"All"](e),o=(e,t=`[${x}]`)=>e.closest(t),se="addEventListener",K=Object.keys,a=Object.values,dP="deleteProperty",R=(e,t="object")=>typeof e==t,l=e=>R(e,"function"),S=void 0,re=/^(?:camel|prevent|stop|debounce|(\d+)(?:(m?)s)|capture|once|passive|self|out|window|document|(shift|ctrl|alt|meta)|(cmd))$/,ie=/^(?:\s*(?:(\w+)\s*:\s*)?(\w*)(?:\s*,\s*(\w+))?\s+in\s+)?(.+)$/,ae=/^[:@.#!].|^z-d-/,le=/^(?:(:)(:?)(!?)|(@)|([.#!])|(z-d-))?([^.]*)(?:[.]([^.].*))?$/,ne=e=>e&&0<=e.indexOf("${")&&e.indexOf("`")<0,oe=/[-_ ]+/g,c=/-([a-z])/g,d=new WeakMap,pe=(t,s)=>{if(!t||!R(t)||l(t)||t.__ob__||t._isVue||!delete t[s.i])return t;{let e=d.get(t);if(e||((e={s:{},set(e,t,s,r){for(var i in this.s)this.s[i].set(e,t,s,r);return!0},[dP](e,t){let s,r=!0;for(s in this.s)r=this.s[s][dP](e,t)&&r;return r}}).p=new Proxy(t,e),d.set(t,e).set(e.p,e)),!e.s[s.i])for(var r in e.s[s.i]=s,t)try{t[r]=n(t[r],s)}catch(e){}return e.p}},fe=(e,t,s)=>e.dispatchEvent(new CustomEvent(t,{detail:s,bubbles:!0})),q=(t,s)=>{if(!t[z]||!(i<=t[z].age||t[z].ing)){(t[z]||(t[z]={})).age=i,t[z].ing=(t[z].ing||0)+1,s=s&&(t[z].env=s)||t[z].env||{ps:{$emit:fe},d:{}};var e=e=>{u++,Ce(F.body),de({p:t[f],el:t},{...s,d:t[z].zd,r:t},e||i),u--,Ee(F.body)};let l=b(e);var r=t[z].zd;if(!r){let a={i:z+Math.random(),set(e,t,s,r,i){l();try{i||(e[t]=n(s,a))}catch(e){}return!0},[dP](e,t){return t!=this.i&&(l(),delete e[t])}};n=window.ZDataProxy||pe,ZData.proxy=e=>n(e,a),r=V(t,t[D](k),s,S,t[w]||{})||{},t.$data=t[z].zd=r=n(r,a),t[Z](k,""),t[w]&&(r[w]=t[w]),V(t,t[D](p),{...s,d:r})}e(1),t[z].ing--}},ce={},de=(r,i,c)=>{let{p:s,el:a,cp:e}=r,t;var l=a[z]||(a[z]={});let n=l.as||(l.as=(t=ce[a[D]("z-d")])?(l.ps=t.ps,t.as):a.getAttributeNames());if(!n[O](x)){if(!e){let e,t;if(c===S&&n[O](k))return q(a,i);if(n[O]($)&&(e=a[D]($))){try{a[C]($),(t=/^([.\/]|https?:)/.test(e)?fetch(e).then(e=>e.text()):/^z:/.test(e)&&ZData.get?ZData.get(e):V(a,e,i)).then(e=>{var t=V(a,a[D](w),i);"-"==a.tagName[1]||n[O]("del")?Ze(e,s,a,t,1):Ze(e,a,S,t)}).catch(ve)}catch(e){}return}if("template"==a.localName){if(a.content||(a.content=F.createDocumentFragment())[L](a[E],S),e=a[D]("for")){var p=r;l=e;var f=i;c=ie.exec(l);if(c){var d,{p:u,el:v}=p;let e=V(v,c[4],f),t={k:c[1],v:c[2],i:c[3]},i={...f,ps:{...f.ps}},s=v[D](U),r=s&&M(s,"."),a=v[z].ns||(v[z].ns={}),l=0,n=v,o=v[z].age=(v[z].age||0)+1;for(d in r=r&&2==r[j]&&r[0]==t.v&&r[1],t.k&&(i.ps[t.k]=S),t.v&&(i.ps[t.v]=S),t.i&&(i.ps[t.i]=S),e){var m=e[d],m=(t.k&&(i.ps[t.k]=d),t.v&&(i.ps[t.v]=m),t.i&&(i.ps[t.i]=l++),r?m[r]:s?V(v,s,i):t.k?d:m);if(m!==S){t.k&&(i.ps[t.k]=m);let r=n[A],e=a[m];if(e){if(e.age==o)continue;let t=e.t[A],s=e.s!=r;s&&r&&!e.s[z].skip&&(r[z].skip=1,r=(p.el=r)[z].t[A],H(p,i,e=>e!=r,ve),s=e.s!=(r=p[P])),p.el=e.s,p.el[z].skip=0,H({...p},i,e=>e!=t),H(p,i,e=>e!=t,({p:e,el:t})=>{s&&e[L](t,r)}),s?p[P]=r:r=p[P],e.age=o}else p.el=v,me(p,i),p.el=n[A],e=a[m]={age:o,s:p.el},H(p,i,e=>e!=r);e.s[z].t=e.t=n=r?r[J]:u[I]}}K(a).filter(e=>a[e].age!=o)[_](e=>{be({el:a[e].s},a[e].t[A],f),delete a[e]}),p[P]=n[A]}}else{e=a[D]("if");var l=r,c=e,o=i,{p:h,el:b}=l;if(!c||V(b,c,o)){let e,t=l[P],s=ve;b[z].fi?(t=b[z].fi[A],(e=(e=b[D](G))&&V(b,"`"+e+"`",o))&&b[z].u!=e&&(he(l,o),me({...l,el:b,next:t},o))):(me(l,o),s=he),l.el=b[A],H(l,o,e=>e!=t),H(l,o,ue,s),b[z].fi=t?t[J]:h[I]}else he(l,o)}return}}{var g=r;var y=i;c=n;let p=g["el"],s=p[z],a=s.vs||(s.vs=[]),f=s.ps;if(!f){f=s.ps={ps:[]};if(g.cp){ce[++B]={as:c,ps:f};p[Z]("z-d",B)}c[_](n=>{let o=p[D](n);if(ae.test(n)||ne(o)){let s=le.exec(n),r=s[7],i=s[5],a=s[6],l=i?i!="."||!r?(r=ZData.ss(r),W):ee:r;l=ye[l]||l;if(l){let e=s[8]&&M(s[8],".")||[];let t={a:n,k:a?S:l==ee||!e[O]("camel")?l:ge(l),b:s[4]&&3||s[2]&&2||(s[1]||i||a)&&1||S,m:i&&r?[r,...e]:e,e:a?`${ge(l)}({e:this,v:${o||true},m:{${e.map(e=>e+":1").join()}}})`:o,A:s[3]||e[O]("attr")};if(!t.b||i=="!")t.e="`"+t.e+"`";f.ps.push(t);t.b&&p[C](n)}}else ZData.ss(n,o)});let e,t;if((e=p.firstChild)&&e==p.lastChild&&e.nodeType==3&&ne(t=e.nodeValue))f.ps.push({k:N,e:"`"+t+"`",m:[]})}if(!g.cp){let i=0,t=s=>{if("*"==s.k)for(var e in s.K=V(p,s.e,y,s)||{})t({...s,k:e,e:s.K[e],E:1,f:S});else if(3==s.b)$e(g,s,y);else{let t=s.e;s.E||(t=V(p,t,y,s,s.k?S:1),s.k)||(s.e=S);var r=s.m[O]("number");if(s.k&&a[i]!==t&&(ke(p,s,r&&p.u&&R(t,"string")?t[T](/[^\d.-]/g,""):t===S?"":t,a[i]),a[i]=t),2==s.b){if(!s.b2){t="this."+s.k,s.k==W&&s.m[j]&&(t+="[`"+s.m[0]+"`]");let e="text"==p.type?X:Y;s.m[O](X)?e=X:s.m[O](Y)&&(e=Y),s.m[O]("trim")&&(t+=".trim()"),r&&(t="this.u?this.u.replace(/1/,"+t+"):parseFloat("+t+")");r="=this."+z+".vs["+i+"]=";t=/==/.test(s.e)?t+"&&("+s.e[T](/==+/,r)+")":s.e+r+t,s.b2={...s,e:t,k:e,ev:e,f:S}}$e(g,s.b2,y)}i++}};f.ps[_](t)}}H({cp:e,p:a,el:a[E]},i)}},H=(e,t,s,r)=>{for(;e.el&&(!s||s(e.el));e.el=e[P])e[P]=e.el[A],r&&!r(e,t)||de(e,t)},ue=e=>e.hasAttribute("else"),ve=()=>0,me=({p:e,el:t,next:s,n:r},i,a)=>{(r=t[z].node)||(r=(r=t[D](G))&&(t[z].u=r=V(t,"`"+r+"`",i))&&(r=i.r[h](r)||(a=o(i.r[f],v))&&a[h](r))&&r.content||t.content,t[z].u||(t[z].node=r),H({cp:1,p:r,el:r[E]}));for(let l=r[E];l;l=l[A])r=l.cloneNode(!0),e[L](r,s)},he=(e,t)=>{var s;e.el[z]&&e.el[z].fi&&(s=e.el[z].fi[A],e.el[z].fi=S,e.el=e[P],be(e,s,t))},be=(e,t,s)=>{H(e,s,e=>e!=t,({el:e})=>{e[m]()})},ge=e=>e[T](c,(e,t)=>t.toUpperCase()),ye={css:W,text:N,html:"innerHTML"},ke=(s,e,r,i)=>{if(e.k==ee){if(e.m[j]){let t=""===e.e||r;r={},e.m[_](e=>{e.endsWith("-")?(r[e+t]=1,i&&(r[e+i]=0)):r[e]=t})}let t=s.classList;if(!Array.isArray(r)){if(R(r)){for(var a in r)r[a]?t.add(a):t[m](a);return}r=r?M(r):[]}r[_](e=>t.add(e))}else e.k==W&&(e.m[j]&&(r=1==e.m[j]?{[e.m[0]]:r}:{[e.m[0]]:r&&e.m[1]}),R(r))?K(r)[_](e=>{!1===r[e]?s[W].removeProperty(e):"-"==e[0]?s[W].setProperty(e,r[e]):s[W][e]=r[e]}):e.A?!1===r?s[C](e.k):s[Z](e.k,r):s[e.k]=r},b=(s,r)=>{let i;return(...e)=>{let t=this;i=(i=r?clearTimeout(i):i)||setTimeout(()=>{i=S,s.apply(t,e)},r)}},$e=({el:n},t,o)=>{let{a:p,k:f,e:c,ev:s,m:d}=t;if(!n[z][p]){let i=d[O]("window")?window:d[O]("document")||d[O]("out")?F:n,a=e=>{if(!(d[O]("self")&&n!=e.target||d[O]("out")&&n.contains(e.target))){if(f[Q]("key")||f[Q]("mouse")||f.endsWith("click")){for(var t of d){t=re.exec(t);if(t&&(t[3]||t[4])){t=t[3]||t[4]&&"meta";if(!t||!e[t+"Key"])return}}var s=d.filter(e=>!re.test(e));if(1==s[j])if(f[Q]("key")&&e.key){var r=s[0][T](oe,"");if(({space:" ",slash:"/",gt:">",eq:"="}[r]||r)!=(e.key.toLowerCase()[T](oe,"")||" "))return}else if(["left","mid","right"][e.button]!=s[0])return}return d[O]("prevent")&&e.preventDefault(),d[O]("stop")&&e.stopPropagation(),d[O]("once")&&i.removeEventListener(f,a,l),V(n,c,{...o,ps:{...n[z][p],$el:o.r}})}},e=d.indexOf("debounce");0<=e&&(e=d[e+1],t=re.exec(e),e=t&&t[1]?t[2]?+t[1]:1e3*t[1]:250,a=b(a,e));let l={capture:d[O]("capture"),passive:d[O]("passive")};i[se](f,a,l),s&&!n[e="fireChange"]&&(n[e]=()=>fe(n,s))}n[z][p]={...o.ps}},xe={},we=(e,t,s,r)=>{s=r&&r.f||xe[s+=e]||(xe[s]=new Function(["$2D",...t],"var R3$;with($2D){R3$="+e+"};return R3$"));return r&&!r.f&&(r.f=s),s},V=(e,t,s,r,i)=>t&&De(()=>l(t)?t.call(e,s.r):(t=we(t,K(s.ps),K(s.ps).join(","),r).call(e,s.d,...a(s.ps)),i&&l(t)?t(i):t),{el:e,exp:t}),ze=(e,t,s)=>console.warn(`E ${k}: ${s} [${t}]`,e),De=(e,{el:t,exp:s})=>{try{var r=e();return r instanceof Promise?r.catch(e=>ze(t,s,e)):r}catch(e){ze(t,s,e)}},Ze=(e,s,r,t,i,a)=>{s=s||F.body;let l,n=[],o,p="",f,c=F[y](k),d=((l=s[D]("z-i"))||s[Z]("z-i",l=++g),b(()=>{--u<0&&(u=0),n[j]&&n.shift()()}));c[ye.html]=e[T](//g,"")[T](/^z-data\s*/,()=>a=1)[T](/<(script)([^>]*)>([^]*?)<\/\1>/gi,(e,t,r,i)=>{var s=r.match(/src\s*=\s*(?:'([^']+)|"([^"]+)|(\S+))/);if((r=s&&(s[1]||s[2]||s[3]))&&!te(`script[src="${r}"]`)[j]||i){let s=F[y]("script"),t=(e,t)=>(o=()=>(F.body[L](s,S),e&&e()),t?o():n.push(o));s[Z](x,""),r?ZData.get?n.push(()=>ZData.get(r).then(e=>(s[N]=e,t(d,1)))):(s.src=r,s.onload=s.onerror=d,t()):a&&!p?p=i:(s[N]=i,t(d))}return""})[T](/(@]*>)([^]*?)(?=<\/style>)/gi,(e,t,s)=>t+s[T](/\s*([^{}]+)(?=\{)/g,(e,t)=>/^[@\d]|^(from|to)\b/.test(t)?t:M(t,/\s*,\s*/).map(e=>e[T](/^(\[z-i=.*?\] )?(.*)/,(e,t,s)=>`[z-i="${l}"] `+s)).join(","))),f=c[h](v)||c[E],a&&p&&f[Z](k,`args=>{${p[T](/\bexport\s+default(?=\s*\{)/,"return")}}`),f&&t&&(f[w]=t),n.push(()=>{for(let e=c[E],t=e&&e[A];e;t=(e=t)&&t[A])s[L](e,r);i&&r&&r[m](),d()}),n.push(()=>f&&q(f)),u+=n[j],d()},Ce=e=>e[z]&&e[z].ob&&e[z].ob.disconnect(),Ee=e=>{let t=(e[z]||(e[z]={})).ob||(e[z].ob=new MutationObserver(r=>{if(!u)if(e==F.body){if(r[j]<99){let e=1;for(let t=0,s;tt.observe(e,{childList:!0,subtree:!0}))},Pe=b(()=>Ae(S,1)),Ae=(e,t)=>{t||++i,++u,Ce(F.body),te(v)[_](e=>o(e)||q(e)),--u,Ee(F.body)},Le={};return F[se]("DOMContentLoaded",Ae),{start:Ae,loadHTML:Ze,on:(e,t)=>((Le[e]=Le[e]||[]).push(t),ZData),call:(e,t)=>(Le[e]||[])[_](e=>e(t)),ss:e=>e,deb:b}})(); -------------------------------------------------------------------------------- /dist/z-minifier.min.js: -------------------------------------------------------------------------------- 1 | function minify(t,a){const l="area, base, br, col, embed, hr, img, input, link, meta, param, source, track, wbr".split(/,\s*/),c=(e,t)=>{let s=UglifyJS.minify(t?"$_z_d="+e:e).code;return s?s.replace(/;$|^\$_z_d=/g,""):e},n=e=>e.replace(/^\s+|\s+$|\/\*[^]*?\*\//g,"").replace(/\s{2,}|\r?\n/g," ").replace(/('[^']*'|"[^"]*")|\s*([{};:,])\s*|([(\[])\s+|\s+([)\]])/g,(e,t,s,a,l)=>(t||"")+(s||"")+(a||"")+(l||"")).replace(/[-\w]+:\s*;/g,"").replace(/;+([;}]|$)/g,"$1"),r=(e,t)=>"style"==e?n(t):"class"==e?t.replace(/^\s+|\s+$|(\s)\s+/g,"$1"):/^(?:[@:.#]|on)\w+|^z-data$/.test(e)?c(t,!e.startsWith("on")):t;let i=[],s;if("string"==typeof t){let e=document.createElement("z-temp");e.innerHTML=t.replace(/<[^>]*? html>/,e=>(s=e,"")).replace(/<\/?(html|head|body)\b/g,e=>e+"-mini"),t=e}return p(t),i.join("").replace(/(<\/?(html|head|body))-mini\b/g,(e,t)=>t).replace(//,e=>s||e);function p(t){for(let e=(t.content||t).firstChild;e;e=e.nextSibling)!function(s){switch(s.nodeType){case 1:i.push("<",s.localName),s.getAttributeNames().forEach(e=>{i.push(" ",e);let t;(t=r(e,s.getAttribute(e)))&&(i.push("="),/[\s>'"]/.test(t)&&(t=t.includes('"')?"'"+t+"'":'"'+t+'"'),i.push(t))}),i.push(">"),"script"==s.localName?i.push(c(s.textContent)):"style"==s.localName?i.push(n(s.textContent)):p(s),l.includes(s.localName)||i.push("");break;case 3:/\S/.test(s.nodeValue)&&i.push(s.nodeValue.replace(/\s{2,}/g," "));break;case 8:let e;a&&(e=s.data.match(/^\s*@(\w+):\s*([^]+?)\s*\/?$/))&&(a[e[1]]=e[2])}}(e)}} -------------------------------------------------------------------------------- /hello-world.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
6 | 25 |
26 | 27 | 28 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "z-data", 3 | "author": { 4 | "name": "Wisdom ZHANG" 5 | }, 6 | "homepage": "https://github.com/Funlang/z-data", 7 | "license": "MIT", 8 | "repository": { 9 | "type": "git", 10 | "url": "git://github.com/Funlang/z-data.git" 11 | }, 12 | "type": "module", 13 | "main": "dist/z-data.min.js", 14 | "dependencies": { 15 | }, 16 | "devDependencies": { 17 | "uglify-js": "^3.13.5" 18 | }, 19 | "scripts": { 20 | "z-data": "uglifyjs -c -m webkit -o src/z-data.min.js src/z-data.js && z-pen\\to-es2015.fun && z-pen\\to-es2015.fun -src", 21 | "z-data-all": "z-pen\\to-es2015-z-json.fun && uglifyjs -c -m webkit -o src/z-data.min.all.js -- src/z-data.min.es2015.js src/z-json.es2015.js", 22 | "z-minifier": "uglifyjs -c -m -o z-pen/z-minifier.min.js z-pen/z-minifier.js", 23 | "z-template": "uglifyjs -c -m -o src/z-template.min.js src/z-template.js", 24 | "moloader": "uglifyjs -c -m -o z-pen/res/moloader.min.js z-pen/res/moloader.js", 25 | "monaco-html": "uglifyjs -c -m -o z-pen/res/html.min.js z-pen/res/html.js", 26 | "sdrag": "uglifyjs -c -m -o z-pen/res/sdrag.min.js z-pen/res/sdrag.js", 27 | "polyfill.js": "uglifyjs -c -m -o z-pen/res/polyfill.min.js z-pen/res/polyfill.js" 28 | }, 29 | "version": "2.2.0" 30 | } 31 | -------------------------------------------------------------------------------- /src/z-data.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021 zwd@funlang.org 2 | const ZData = (() => { 3 | var age = 0, cps = 0, ids = 0, updating = 0, proxy; 4 | 5 | const Attribute = "Attribute", Element = "Element", ElementSibling = Element + "Sibling", ElementChild = Element + "Child"; 6 | 7 | const zdata = "z-data", zcomp = "z-comp", znone = "z-none"; 8 | const zinit = "init", zargs = "args"; 9 | const zfor = "for", zkey = "key"; 10 | const zif = "if", zelse = "else"; 11 | const zuse = "use", _z_d = "_z_d", qdata = `[${zdata}]`; 12 | 13 | const getAttribute = "get" + Attribute; 14 | const setAttribute = "set" + Attribute, remoVe = "remove"; 15 | const removeAttribute = remoVe + Attribute; 16 | const firstEL = "first" + ElementChild; 17 | const lastEL = "last" + ElementChild; 18 | const prevEL = "previous" + ElementSibling, nexT = "next"; 19 | const nextEL = nexT + ElementSibling; 20 | const createEl = "create" + Element; 21 | const parentEL = "parent" + Element; 22 | 23 | const insert = "insertBefore"; 24 | const forEach = "forEach"; 25 | const includes = "includes"; 26 | const length = "length"; 27 | const startsWith = "startsWith"; 28 | const split = (s, d = / +/) => s.trim().split(d); 29 | const replace = "replace"; 30 | const textC = "textContent"; 31 | const input = "input"; 32 | const change = "change"; 33 | const c_lass = "class"; 34 | const s_tyle = "style"; 35 | const querySelector = "querySelector"; 36 | const $ocument = document; 37 | const $ = (selector, el = $ocument) => el[querySelector+"All"](selector); 38 | const closest = (el, selector = `[${znone}]`) => el.closest(selector); 39 | const addEventListener = "addEventListener"; 40 | const Obj_keys = Object.keys; 41 | const Obj_values = Object.values; 42 | const is_object = (obj, t = "object") => typeof obj == t; 43 | const is_function = (obj) => is_object(obj, "function"); 44 | const nil = undefined; 45 | 46 | const re_ms = /^(?:camel|prevent|stop|debounce|(\d+)(?:(m?)s)|capture|once|passive|self|out|window|document|(shift|ctrl|alt|meta)|(cmd))$/; 47 | const re_for = /^(?:\s*(?:(\w+)\s*:\s*)?(\w*)(?:\s*,\s*(\w+))?\s+in\s+)?(.+)$/; 48 | const re_bind = /^[:@.#!].|^z-d-/; 49 | const re_attr = /^(?:(:)(:?)(!?)|(@)|([.#!])|(z-d-))?([^.]*)(?:[.]([^.].*))?$/; 50 | const $e_text = (s) => s && s.indexOf("${") >= 0 && s.indexOf("`") < 0; 51 | const re_kebab = /[-_ ]+/g; 52 | const re_2camel = /-([a-z])/g; 53 | 54 | const proxies = new WeakMap(); 55 | const liteProxy = (obj, cb) => { 56 | if (obj && is_object(obj) && !is_function(obj) && !obj.__ob__ && !obj._isVue && (delete obj[cb.i])) { 57 | let cs = proxies.get(obj); //return new Proxy(obj, cb); 58 | if (!cs) { 59 | cs = { 60 | s: {}, 61 | set(obj, prop, value, rec) { 62 | for (let c in this.s) this.s[c].set(obj, prop, value, rec); 63 | return true; 64 | }, 65 | deleteProperty(obj, prop) { 66 | let c, ret = true; 67 | for (c in this.s) ret = this.s[c].deleteProperty(obj, prop) && ret; 68 | return ret; 69 | } 70 | } 71 | cs.p = new Proxy(obj, cs); 72 | proxies.set(obj, cs).set(cs.p, cs); 73 | } 74 | if (!cs.s[cb.i]) { 75 | cs.s[cb.i] = cb; 76 | for (let p in obj) try { 77 | obj[p] = proxy(obj[p], cb); 78 | } catch (e) {} 79 | } 80 | return cs.p; 81 | } 82 | return obj; 83 | }; 84 | const $emit = (el, name, detail) => el.dispatchEvent(new CustomEvent(name, {detail, bubbles: true})); 85 | const initComponent = (el, env) => { 86 | if (el[_z_d] && (age <= el[_z_d].age || el[_z_d].ing)) return; 87 | (el[_z_d] || (el[_z_d] = {})).age = age; 88 | el[_z_d].ing = (el[_z_d].ing || 0) + 1; 89 | env = (env && (el[_z_d].env = env)) || el[_z_d].env || { ps: {$emit}, d: {} }; 90 | let init = (self) => { 91 | updating++, stopObserve($ocument.body); 92 | goAnode({ p: el[parentEL], el }, { ...env, d: el[_z_d].zd, r: el }, self || age); 93 | updating--, observe($ocument.body); 94 | }; 95 | let initLater = debounce(init); 96 | let zd = el[_z_d].zd; 97 | if (!zd) { 98 | let cb = { 99 | i: _z_d + Math.random(), 100 | set(obj, prop, value, rec, zdataproxy) { 101 | initLater(); 102 | try { 103 | if (!zdataproxy) obj[prop] = proxy(value, cb); 104 | } catch (e) {} 105 | return true; 106 | }, 107 | deleteProperty(obj, prop) { 108 | return (prop != this.i) && (initLater(), delete obj[prop]); 109 | } 110 | }; 111 | proxy = window.ZDataProxy || liteProxy; 112 | ZData.proxy = (v) => proxy(v, cb); 113 | zd = tryEval(el, el[getAttribute](zdata), env, nil, el[zargs] || {}) || {}; 114 | el.$data = el[_z_d].zd = zd = proxy(zd, cb); 115 | el[setAttribute](zdata, ""); 116 | if (el[zargs]) zd[zargs] = el[zargs]; 117 | tryEval(el, el[getAttribute](zinit), { ...env, d: zd }); 118 | } 119 | init(1); 120 | el[_z_d].ing--; 121 | }; 122 | 123 | const nodeCache = {}; 124 | const goAnode = (args, env, self) => { 125 | let { p, el, cp } = args, nc; 126 | let zd = el[_z_d] || (el[_z_d] = {}); 127 | let attrs = zd.as || (zd.as = (nc = nodeCache[el[getAttribute]("z-d")]) ? (zd.ps = nc.ps, nc.as) : el.getAttributeNames()); 128 | if (attrs[includes](znone)) return; 129 | 130 | if (!cp) { 131 | let exp, res; 132 | if (self === nil && attrs[includes](zdata)) return initComponent(el, env); 133 | else if (attrs[includes](zcomp) && (exp = el[getAttribute](zcomp))) { 134 | try { 135 | el[removeAttribute](zcomp); 136 | if (/^([.\/]|https?:)/.test(exp)) res = fetch(exp).then((res) => res.text()); 137 | else if (/^z:/.test(exp) && ZData.get) res = ZData.get(exp); 138 | else res = tryEval(el, exp, env); 139 | res.then((html) => { 140 | let as = tryEval(el, el[getAttribute](zargs), env); 141 | if (el.tagName[1] == "-" || attrs[includes]("del")) loadHTML(html, p, el, as, 1); 142 | else loadHTML(html, el, nil, as); 143 | }).catch(nop); 144 | } catch (e) {} 145 | return; 146 | } else if ("template" == el.localName) { 147 | el.content || (el.content = $ocument.createDocumentFragment())[insert](el[firstEL], nil); 148 | if ((exp = el[getAttribute](zfor))) { 149 | goFor(args, exp, env); 150 | } else if ((exp = el[getAttribute](zif)) || 1 /*attrs[includes](zelse)*/) { 151 | goIf(args, exp, env); 152 | } 153 | return; 154 | } 155 | } 156 | setAttrs(args, env, attrs); 157 | goNodes({ cp, p: el, el: (/*cp && el.content ||*/ el)[firstEL] }, env); 158 | }; 159 | 160 | const goNodes = (args, env, cbIf, cbDo) => { 161 | for (; args.el && (!cbIf || cbIf(args.el)); args.el = args[nexT]) { 162 | args[nexT] = args.el[nextEL]; 163 | if (!cbDo || cbDo(args, env)) goAnode(args, env); 164 | } 165 | }; 166 | 167 | const isElse = (el) => el.hasAttribute(zelse); 168 | const nop = () => 0; 169 | const goIf = (args, exp, env) => { 170 | let { p, el } = args; 171 | if (!exp || tryEval(el, exp, env)) { 172 | let n, next = args[nexT], op = nop; 173 | if (el[_z_d].fi) { 174 | next = el[_z_d].fi[nextEL]; 175 | (n=el[getAttribute](zuse)) && (n=tryEval(el,'`'+n+'`',env)) && (el[_z_d].u!=n) 176 | && (fold(args, env), expand({...args, el, next},env)); 177 | } else { 178 | expand(args, env); 179 | op = fold; 180 | } 181 | args.el = el[nextEL]; 182 | goNodes(args, env, (el) => el != next); 183 | goNodes(args, env, isElse, op); 184 | el[_z_d].fi = next ? next[prevEL] : p[lastEL]; 185 | } else fold(args, env); 186 | }; 187 | 188 | const expand = ({ p, el, next, n }, env, r) => { 189 | if (!(n = el[_z_d].node)) { 190 | n = (n=el[getAttribute](zuse)) && (el[_z_d].u=n=tryEval(el,'`'+n+'`',env)) && ( 191 | n = env.r[querySelector](n) || (r=closest(env.r[parentEL], qdata))&&r[querySelector](n) ) && n.content || el.content; 192 | el[_z_d].u || (el[_z_d].node = n); 193 | goNodes({ cp: 1, p: n, el: n[firstEL] }); // compile 194 | } 195 | for (let c = n[firstEL]; c; c = c[nextEL]) { 196 | n = c.cloneNode(true); 197 | p[insert](n, next); 198 | } 199 | }; 200 | 201 | const fold = (args, env) => { 202 | if (args.el[_z_d] && args.el[_z_d].fi) { 203 | let next = args.el[_z_d].fi[nextEL]; 204 | args.el[_z_d].fi = nil; 205 | args.el = args[nexT]; 206 | remove(args, next, env); 207 | } 208 | }; 209 | 210 | const remove = (args, next, env) => { 211 | goNodes(args, env, (el) => el != next, ({el}) => { el[remoVe]() }); 212 | }; 213 | 214 | const goFor = (args, exp, env) => { 215 | let m = re_for.exec(exp); 216 | if (!m) return; 217 | let { p, el } = args; 218 | let items = tryEval(el, m[4], env), 219 | kvi = { k: m[1], v: m[2], i: m[3] }, 220 | env2 = { ...env, ps: { ...env.ps } }, 221 | akey = el[getAttribute](zkey), 222 | id = akey && split(akey, "."), 223 | keys = el[_z_d].ns || (el[_z_d].ns = {}), 224 | i = 0, 225 | cur = el, 226 | age = (el[_z_d].age = (el[_z_d].age || 0) + 1); 227 | id = id && id[length] == 2 && id[0] == kvi.v && id[1]; 228 | if (kvi.k) env2.ps[kvi.k] = nil; 229 | if (kvi.v) env2.ps[kvi.v] = nil; 230 | if (kvi.i) env2.ps[kvi.i] = nil; 231 | for (let k in items /*of Obj_keys(items)*/) { 232 | let v = items[k]; 233 | if (kvi.k) env2.ps[kvi.k] = k; 234 | if (kvi.v) env2.ps[kvi.v] = v; 235 | if (kvi.i) env2.ps[kvi.i] = i++; 236 | let key = id ? v[id] : akey ? tryEval(el, akey, env2) : kvi.k ? k : v; 237 | if (key === nil) continue; // key IS NIL !!! 238 | if (kvi.k) env2.ps[kvi.k] = key; 239 | 240 | let next = cur[nextEL]; 241 | let curNode = keys[key]; 242 | if (curNode) { 243 | if (curNode.age == age) continue; // key DUPLICATE !!! 244 | let lastNext = curNode.t[nextEL]; 245 | let moveable = curNode.s != next; 246 | if (moveable && next && !curNode.s[_z_d].skip) { 247 | next[_z_d].skip = 1; 248 | args.el = next; 249 | next = next[_z_d].t[nextEL]; 250 | goNodes(args, env2, (el) => el != next, nop); 251 | moveable = curNode.s != (next = args[nexT]); 252 | } 253 | args.el = curNode.s; 254 | args.el[_z_d].skip = 0; 255 | goNodes({...args}, env2, (el) => el != lastNext); 256 | goNodes(args, env2, (el) => el != lastNext, ({p, el}) => { moveable && p[insert](el, next) }); 257 | moveable ? (args[nexT] = next) : (next = args[nexT]); 258 | curNode.age = age; 259 | } else { 260 | args.el = el; 261 | expand(args, env2); 262 | args.el = cur[nextEL]; 263 | curNode = keys[key] = { age, s: args.el }; 264 | goNodes(args, env2, (el) => el != next); 265 | } 266 | curNode.s[_z_d].t = curNode.t = cur = next ? next[prevEL] : p[lastEL]; 267 | } 268 | // remove ... 269 | Obj_keys(keys) 270 | .filter((k) => keys[k].age != age) 271 | [forEach]((k) => { 272 | remove({ el: keys[k].s }, keys[k].t[nextEL], env); 273 | delete keys[k]; 274 | }); 275 | args[nexT] = cur[nextEL]; 276 | }; 277 | 278 | const toCamel = (name) => name[replace](re_2camel, (m, c) => c.toUpperCase()); 279 | const attrMaps = { css: s_tyle, text: textC, html: "innerHTML" }; 280 | const setAttrs = (args, env, attrNames) => { 281 | let { el } = args, 282 | zd = el[_z_d], 283 | vs = zd.vs || (zd.vs = []); 284 | let props = zd.ps; 285 | if (!props) { 286 | props = zd.ps = { ps: [] }; 287 | if (args.cp) { 288 | nodeCache[++cps] = { as: attrNames, ps: props }; 289 | el[setAttribute]("z-d", cps); 290 | } 291 | attrNames[forEach]((a) => { 292 | let v = el[getAttribute](a); 293 | if (re_bind.test(a) || $e_text(v)) { 294 | let ms = re_attr.exec(a), // 1-bind 2 3-attr 4-event 5-class/css 6-zd- 7-name 8-modifiers 295 | name = ms[7], m5 = ms[5], m6 = ms[6], 296 | k = m5 ? (m5 != "." || !name ? (name = ZData.ss(name), s_tyle) : c_lass) : name; // key/name 297 | k = attrMaps[k] || k; 298 | if (k) { 299 | let modifiers = ms[8] && split(ms[8], ".") || []; 300 | let ps = { 301 | a, 302 | k: m6 ? nil : k == c_lass || !modifiers[includes]("camel") ? k : toCamel(k), 303 | b: (ms[4] && 3) || (ms[2] && 2) || ((ms[1] || m5 || m6) && 1) || nil, // bind 1 2, event 4 304 | m: m5 && name ? [name, ...modifiers] : modifiers, // modifiers 305 | e: m6 ? `${toCamel(k)}({e:this,v:${v||true},m:{${modifiers.map(a=>a+':1').join()}}})` : v, // exp 306 | A: ms[3] || modifiers[includes]("attr"), 307 | }; 308 | if (!ps.b || m5 == "!") ps.e = "`" + ps.e + "`"; 309 | props.ps.push(ps); 310 | ps.b && el[removeAttribute](a); 311 | } 312 | } else ZData.ss(a, v); 313 | }); 314 | let f, t; 315 | if ((f = el.firstChild) && f == el.lastChild && f.nodeType == 3 && $e_text((t = f.nodeValue))) { 316 | props.ps.push({ 317 | k: textC, 318 | e: "`" + t + "`", 319 | m: [], 320 | }); 321 | } 322 | } 323 | if (args.cp) return; 324 | let i = 0; 325 | let fn = (ps) => { 326 | if (ps.k == "*") for (let k in (ps.K = tryEval(el, ps.e, env, ps) || {})) fn({...ps, k, e: ps.K[k], E: 1, f: nil}); 327 | else if (ps.b == 3) setEvent(args, ps, env); 328 | else { 329 | let v = ps.e; 330 | ps.E || (v = tryEval(el, v, env, ps, ps.k ? nil : 1), ps.k || (ps.e = nil)); 331 | let num = ps.m[includes]("number"); 332 | if (ps.k && vs[i] !== v) { 333 | setValue(el, ps, num && el.u && is_object(v, "string") ? v[replace](/[^\d.-]/g, "") : v === nil ? "" : v, vs[i]); 334 | vs[i] = v; 335 | } 336 | if (ps.b == 2) { 337 | if (!ps.b2) { 338 | v = "this." + ps.k; 339 | if (ps.k == s_tyle && ps.m[length]) v += "[`" + ps.m[0] + "`]"; 340 | let event = el.type == "text" ? input : change; 341 | if (ps.m[includes](input)) event = input; 342 | else if (ps.m[includes](change)) event = change; 343 | if (ps.m[includes]("trim")) v += ".trim()"; 344 | if (num) v = "this.u?this.u.replace(/1/," + v + "):parseFloat(" + v + ")"; 345 | let vi = "=this." + _z_d + ".vs[" + i + "]="; 346 | v = /==/.test(ps.e) ? v + "&&(" + ps.e[replace](/==+/, vi) + ")" : ps.e + vi + v 347 | ps.b2 = { ...ps, e: v, k: event, ev: event, f: nil }; 348 | } 349 | setEvent(args, ps.b2, env); 350 | } 351 | i++; 352 | } 353 | }; 354 | props.ps[forEach](fn); 355 | }; 356 | 357 | const setValue = (el, ps, value, old) => { 358 | if (ps.k == c_lass) { 359 | if (ps.m[length]) { 360 | let v = ps.e === "" ? true : value; 361 | value = {}; 362 | ps.m[forEach]((name) => { 363 | if (name.endsWith("-")) { 364 | value[name + v] = 1; 365 | old && (value[name + old] = 0); 366 | } else value[name] = v; 367 | }); 368 | } 369 | let cl = el.classList; 370 | if (Array.isArray(value)) { 371 | } else if (is_object(value)) { 372 | for (let name in value) value[name] ? cl.add(name) : cl[remoVe](name); 373 | return; 374 | } else value = value ? split(value) : []; 375 | value[forEach]((name) => cl.add(name)); 376 | } else { 377 | if (ps.k == s_tyle) { 378 | if (ps.m[length]) { 379 | if (ps.m[length] == 1) value = { [ps.m[0]]: value }; 380 | else value = { [ps.m[0]]: value && ps.m[1] }; 381 | } 382 | if (is_object(value)) { 383 | Obj_keys(value)[forEach]((name) => { 384 | if (value[name] === false) el[s_tyle].removeProperty(name); 385 | else name[0] == "-" ? el[s_tyle].setProperty(name, value[name]) : el[s_tyle][name] = value[name]; 386 | }); 387 | return; 388 | } 389 | } 390 | ps.A ? value === false ? el[removeAttribute](ps.k) : el[setAttribute](ps.k, value) : el[ps.k] = value; 391 | } 392 | }; 393 | 394 | const debounce = (fn, ms) => { 395 | let timer; 396 | return (...args) => { 397 | let me = this; 398 | let ifn = () => { 399 | timer = nil; 400 | fn.apply(me, args); 401 | }; 402 | ms && (timer = clearTimeout(timer)); 403 | timer || (timer = setTimeout(ifn, ms)); 404 | }; 405 | }; 406 | 407 | const setEvent = ({ el }, ps, env) => { 408 | let { a: key, k: name, e: exp, ev, m: ms } = ps; 409 | if (!el[_z_d][key]) { 410 | let target = ms[includes]("window") ? window : ms[includes]("document") || ms[includes]("out") ? $ocument : el; 411 | let fn = (e) => { 412 | if (ms[includes]("self") && el != e.target) return; 413 | if (ms[includes]("out") && el.contains(e.target)) return; 414 | // key and mouse (ctrl, alt, shift, meta, cmd) 415 | if (name[startsWith]("key") || name[startsWith]("mouse") || name.endsWith("click")) { 416 | for (let modifier of ms) { 417 | let m = re_ms.exec(modifier); 418 | if (m && (m[3] || m[4])) { 419 | let key = m[3] || (m[4] && "meta"); 420 | if (!key || !e[key + "Key"]) return; 421 | } 422 | } 423 | let keys = ms.filter((m) => !re_ms.test(m)); 424 | if (keys[length] == 1) { 425 | if (name[startsWith]("key") && e.key) { 426 | let key = keys[0][replace](re_kebab, ""); 427 | key = { space: " ", slash: "/", gt: ">", eq: "=" }[key] || key; 428 | if (key != (e.key.toLowerCase()[replace](re_kebab, "") || " ")) return; 429 | } else if (["left", "mid", "right"][e.button] != keys[0]) return; 430 | } 431 | } 432 | if (ms[includes]("prevent")) e.preventDefault(); 433 | if (ms[includes]("stop")) e.stopPropagation(); 434 | if (ms[includes]("once")) target.removeEventListener(name, fn, options); 435 | return tryEval(el, exp, {...env, ps: {...el[_z_d][key], $el: env.r}}); 436 | }; 437 | // debounce 438 | let i = ms.indexOf("debounce"); 439 | if (i >= 0) { 440 | i = ms[i + 1]; 441 | let m = re_ms.exec(i); 442 | i = m && m[1] ? (m[2] ? +m[1] : m[1] * 1000) : 250; 443 | fn = debounce(fn, i); 444 | } 445 | let options = { 446 | capture: ms[includes]("capture"), 447 | passive: ms[includes]("passive"), 448 | }; 449 | target[addEventListener](name, fn, options); 450 | ev && !el[i='fireChange'] && (el[i] = () => $emit(el, ev)); 451 | } 452 | el[_z_d][key] = {...env.ps}; 453 | }; 454 | 455 | const Functions = {}; 456 | const newFun = (exp, ks, k, ps) => { 457 | let f = (ps && ps.f) || Functions[(k += exp)] || 458 | (Functions[k] = new Function(["$2D", ...ks], "var R3$;with($2D){R3$=" + exp + "};return R3$")); 459 | ps && !ps.f && (ps.f = f); 460 | return f; 461 | }; 462 | const tryEval = (el, exp, env, ps, args) => { 463 | return exp && tryCatch( 464 | () => { 465 | if (is_function(exp)) return exp.call(el, env.r); 466 | exp = newFun(exp, Obj_keys(env.ps), Obj_keys(env.ps).join(','), ps).call(el, env.d, ...Obj_values(env.ps)); 467 | return args && is_function(exp) ? exp(args) : exp; 468 | }, 469 | { el, exp } 470 | ); 471 | }; 472 | 473 | const error = (el, exp, e) => console.warn(`E ${zdata}: ${e} [${exp}]`, el); 474 | const tryCatch = (cb, { el, exp }) => { 475 | try { 476 | let value = cb(); 477 | return value instanceof Promise ? value.catch((e) => error(el, exp, e)) : value; 478 | } catch (e) { 479 | error(el, exp, e); 480 | } 481 | }; 482 | 483 | const loadHTML = (html, p, before, args, del, zdatahtml) => { 484 | p || (p = $ocument.body); 485 | let id, fn = [], f1, script = '', $el, el = $ocument[createEl](zdata); 486 | if (!(id = p[getAttribute]("z-i"))) p[setAttribute]("z-i", (id = ++ids)); 487 | let fns = debounce(() => { 488 | --updating < 0 && (updating = 0); 489 | fn[length] && fn.shift()(); 490 | }); 491 | el[attrMaps["html"]] = html[replace](//g, "")[replace](/^z-data\s*/, ()=>zdatahtml=1) 492 | [replace](/<(script)([^>]*)>([^]*?)<\/\1>/gi, ($0, $1, src, s) => { 493 | let m = src.match(/src\s*=\s*(?:'([^']+)|"([^"]+)|(\S+))/); 494 | src = m && (m[1] || m[2] || m[3]); 495 | if ((!src || $(`script[src="${src}"]`)[length]) && !s) return ""; 496 | let e = $ocument[createEl]("script"); 497 | let fi = (f, run) => (f1 = () => ($ocument.body[insert](e, nil), f&&f()), run ? f1() : fn.push(f1)); 498 | e[setAttribute](znone, ""); 499 | if (src) { 500 | if (ZData.get) fn.push(() => ZData.get(src).then(s => (e[textC] = s, fi(fns, 1)))); 501 | else { 502 | e.src = src; 503 | e.onload = e.onerror = fns; 504 | fi(); 505 | } 506 | } else if (zdatahtml && !script) { 507 | script = s; 508 | } else { 509 | e[textC] = s; 510 | fi(fns); 511 | } 512 | return ""; 513 | })[replace](/(@]*>)([^]*?)(?=<\/style>)/gi, ($0, s1, s) => { 514 | return s1 + s[replace](/\s*([^{}]+)(?=\{)/g, ($0, names) => { 515 | if (/^[@\d]|^(from|to)\b/.test(names)) return names; // @keyframes or [z-i=... 516 | return split(names, /\s*,\s*/).map((n) => n[replace](/^(\[z-i=.*?\] )?(.*)/, ($0,$1,$2)=>`[z-i="${id}"] `+$2)).join(","); 517 | }); 518 | }); 519 | $el = el[querySelector](qdata) || el[firstEL]; 520 | if (zdatahtml && script) $el[setAttribute](zdata, `args=>{${script[replace](/\bexport\s+default(?=\s*\{)/, 'return')}}`); 521 | if ($el && args) $el[zargs] = args; 522 | fn.push(() => { 523 | for (let e = el[firstEL], n = e && e[nextEL]; e; e = n, n = n && n[nextEL]) p[insert](e, before); 524 | del && before && before[remoVe](); 525 | fns(); 526 | }); 527 | fn.push(()=>$el && initComponent($el)); // startLater, ()=>$el && initComponent($el) 528 | updating += fn[length]; 529 | fns(); 530 | }; 531 | 532 | const stopObserve = (el) => el[_z_d] && el[_z_d].ob && el[_z_d].ob.disconnect(); 533 | const observe = (el) => { 534 | let ob = (el[_z_d] || (el[_z_d] = {})).ob || 535 | (el[_z_d].ob = new MutationObserver((ms) => { 536 | if (updating) return; 537 | if (el == $ocument.body) { 538 | if (ms[length] < 99 /* How Many ??? */) { 539 | let ignore = 1; 540 | for (let i = 0, t; i < ms[length]; i++) { 541 | ignore = ignore && (closest(t = ms[i].target) || !closest(t, qdata) && !t[querySelector](qdata)); 542 | } 543 | if (ignore) return; 544 | } 545 | startLater(); 546 | } else initComponent(el); 547 | })); 548 | ZData.nobserve || debounce(() => ob.observe(el, { childList: true, subtree: true })); 549 | }; 550 | 551 | const startLater = debounce(() => start(nil, 1)); 552 | const start = (e, onlyObserve) => { 553 | onlyObserve || ++age, ++updating; 554 | stopObserve($ocument.body); 555 | $(qdata)[forEach]((el) => closest(el) || initComponent(el)); 556 | --updating; 557 | observe($ocument.body); 558 | }; 559 | 560 | const ons = {}; 561 | const on = (name, fn) => ((ons[name] = ons[name] || []).push(fn), ZData); 562 | const call = (name, args) => (ons[name] || [])[forEach]((fn) => fn(args)); 563 | 564 | $ocument[addEventListener]("DOMContentLoaded", start); 565 | return { start, loadHTML, on, call, ss:s=>s, deb: debounce }; 566 | })(); 567 | -------------------------------------------------------------------------------- /www/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Funlang/z-data/f139796b3a5fd7fe1bf66813f7faf78eb7c83df9/www/favicon.ico -------------------------------------------------------------------------------- /www/index.html: -------------------------------------------------------------------------------- 1 | z-data studio
|
--------------------------------------------------------------------------------