From 011cedea70bd780949005d376f360acb421c1b84 Mon Sep 17 00:00:00 2001 From: Gene Date: Tue, 7 Jun 2022 12:22:54 +0200 Subject: [PATCH] Updated zuix-dist. --- .eleventy-zuix.js | 52 +- docs/content/docs/index.html | 2 +- .../docs/material-design-tags/index.html | 2 +- docs/content/docs/page-options/index.html | 2 +- .../docs/zkit-components-tags/index.html | 2 +- docs/feed/rss.xml | 12 +- docs/home/index.html | 2 +- docs/js/zuix/zuix-bundler.js | 2 +- docs/js/zuix/zuix-bundler.min.js | 2 +- docs/js/zuix/zuix-bundler.module.js | 2 +- docs/js/zuix/zuix-bundler.module.min.js | 2 +- docs/js/zuix/zuix.js | 957 +++++++++--------- docs/js/zuix/zuix.min.js | 4 +- docs/js/zuix/zuix.module.js | 957 +++++++++--------- docs/js/zuix/zuix.module.min.js | 4 +- docs/search/index.html | 2 +- docs/service-worker.js | 2 +- docs/service-worker.js.map | 2 +- package-lock.json | 14 +- package.json | 2 +- source/_inc/layouts/side_drawer/style.css | 2 +- 21 files changed, 1066 insertions(+), 962 deletions(-) diff --git a/.eleventy-zuix.js b/.eleventy-zuix.js index 05bc7a9..40415ab 100644 --- a/.eleventy-zuix.js +++ b/.eleventy-zuix.js @@ -26,6 +26,7 @@ const fs = require('fs'); const chokidar = require('chokidar'); const moment = require('moment'); const nunjucks = require('nunjucks'); +const pkg = require('./package.json'); const { compilePage, @@ -95,7 +96,7 @@ function startWatcher(eleventyConfig, browserSync) { f = path.resolve(path.join(sourceFolder, f)); watchFiles.push(f); }); - const templateExtensions = ['.js', '.mjs', '.html', '.css', '.less', '.scss', '.njk']; + const templateExtensions = ['.html', '.js', '.css', '.less', '.scss', '.njk']; const templateFolders = componentsFolders.map(f => path.resolve(path.join(sourceFolder, f))); const copyFilesWatcher = chokidar.watch(watchFiles).on('all', (event, file, stats) => { if (watchEvents[event] && fs.existsSync(file) && file.indexOf('/_inc/') === -1) { @@ -111,7 +112,7 @@ function startWatcher(eleventyConfig, browserSync) { path.dirname(file), ...templateFolders ], {})); - njk.render(file, zuixConfig, function(err, res) { + njk.render(file, { pkg, app: zuixConfig.app }, function(err, res) { if (err != null) { console.error( chalk.red.bold(err) @@ -369,12 +370,57 @@ function initEleventyZuix(eleventyConfig) { }); componentsFolders.map(f => { f = path.join(sourceFolder, f); - eleventyConfig.addPassthroughCopy(f); + postProcessRecursiveSync(f, buildFolder) }); } eleventyConfig.setDataDeepMerge(true); } +function postProcessRecursiveSync( source, target ) { + let files = []; + // Check if folder needs to be created or integrated + const targetFolder = path.join( target, path.basename( source ) ); + if ( !fs.existsSync( targetFolder ) ) { + fs.mkdirSync( targetFolder ); + } + // Copy + if ( fs.lstatSync( source ).isDirectory() ) { + files = fs.readdirSync( source ); + files.forEach( function ( file ) { + const curSource = path.join( source, file ); + if ( fs.lstatSync( curSource ).isDirectory() ) { + postProcessRecursiveSync( curSource, targetFolder ); + } else { + const templateExtensions = ['.html', '.js', '.css', '.less', '.scss', '.njk']; + const templateFolders = componentsFolders.map(f => path.resolve(path.join(sourceFolder, f))); + const postProcess = templateExtensions.filter(cn => curSource.endsWith(cn)); + const outputFile = path.resolve(path.join(buildFolder, curSource.substring(sourceFolder.length))); + if (postProcess.length === 1) { + // Post-process file with Nunjucks + const njk = new nunjucks.Environment(new nunjucks.FileSystemLoader([ + path.dirname(curSource), + ...templateFolders + ], {})); + njk.render(path.resolve(curSource), {pkg, app: zuixConfig.app}, function(err, res) { + if (err != null) { + console.error( + chalk.red.bold(err) + ); + } else { + // fs.readFileSync(curSource) + fs.writeFile(outputFile, res, function() { + // TODO: ... + }); + } + }); + } else { + fs.writeFileSync(outputFile, fs.readFileSync(curSource)); + } + } + }); + } +} + function copyDependencies(dependencyList) { const nodeFolder = `${process.cwd()}/node_modules`; Object.keys(dependencyList).forEach((sourcePath) => { diff --git a/docs/content/docs/index.html b/docs/content/docs/index.html index d6209de..5887c61 100644 --- a/docs/content/docs/index.html +++ b/docs/content/docs/index.html @@ -293,7 +293,7 @@ height: 256px; } [z-include][z-ready=true].visible-on-ready, [z-load][z-ready=true].visible-on-ready { - transition: opacity 50ms ease-in-out; + transition: opacity 150ms ease-in-out; } .drawer-header { color:white; diff --git a/docs/content/docs/material-design-tags/index.html b/docs/content/docs/material-design-tags/index.html index 6572c5f..2872560 100644 --- a/docs/content/docs/material-design-tags/index.html +++ b/docs/content/docs/material-design-tags/index.html @@ -295,7 +295,7 @@ height: 256px; } [z-include][z-ready=true].visible-on-ready, [z-load][z-ready=true].visible-on-ready { - transition: opacity 50ms ease-in-out; + transition: opacity 150ms ease-in-out; } .drawer-header { color:white; diff --git a/docs/content/docs/page-options/index.html b/docs/content/docs/page-options/index.html index 1480c08..2db69bf 100644 --- a/docs/content/docs/page-options/index.html +++ b/docs/content/docs/page-options/index.html @@ -295,7 +295,7 @@ height: 256px; } [z-include][z-ready=true].visible-on-ready, [z-load][z-ready=true].visible-on-ready { - transition: opacity 50ms ease-in-out; + transition: opacity 150ms ease-in-out; } .drawer-header { color:white; diff --git a/docs/content/docs/zkit-components-tags/index.html b/docs/content/docs/zkit-components-tags/index.html index d725357..46ca263 100644 --- a/docs/content/docs/zkit-components-tags/index.html +++ b/docs/content/docs/zkit-components-tags/index.html @@ -295,7 +295,7 @@ height: 256px; } [z-include][z-ready=true].visible-on-ready, [z-load][z-ready=true].visible-on-ready { - transition: opacity 50ms ease-in-out; + transition: opacity 150ms ease-in-out; } .drawer-header { color:white; diff --git a/docs/feed/rss.xml b/docs/feed/rss.xml index 0a2f787..76f3736 100644 --- a/docs/feed/rss.xml +++ b/docs/feed/rss.xml @@ -7,8 +7,8 @@ en - Thu, 26 May 2022 22:09:28 +0200 - Thu, 26 May 2022 22:09:28 +0200 + Tue, 07 Jun 2022 12:22:19 +0200 + Tue, 07 Jun 2022 12:22:19 +0200 Web App Template https://zuixjs.github.io/web-app//images/icons/icon-152x152.png @@ -19,7 +19,7 @@ https://zuixjs.github.io/web-app//search/ https://zuixjs.github.io/web-app//search/ Search this website - Thu, 26 May 2022 22:09:28 +0200 + Tue, 07 Jun 2022 12:22:19 +0200 @@ -28,7 +28,7 @@ https://zuixjs.github.io/web-app//content/docs/ https://zuixjs.github.io/web-app//content/docs/ Documentation section - Thu, 26 May 2022 22:09:28 +0200 + Tue, 07 Jun 2022 12:22:19 +0200 @@ -50,7 +50,7 @@ https://zuixjs.github.io/web-app//content/docs/material-design-tags/ https://zuixjs.github.io/web-app//content/docs/material-design-tags/ Rendering Material Design components using <code>zx</code> short code - Thu, 26 May 2022 22:09:28 +0200 + Tue, 07 Jun 2022 12:22:19 +0200 https://zuixjs.github.io/web-app//home/ https://zuixjs.github.io/web-app//home/ zuix.js web app home page - Thu, 26 May 2022 22:09:28 +0200 + Tue, 07 Jun 2022 12:22:19 +0200 diff --git a/docs/home/index.html b/docs/home/index.html index a4a041f..84f2d14 100644 --- a/docs/home/index.html +++ b/docs/home/index.html @@ -295,7 +295,7 @@ height: 256px; } [z-include][z-ready=true].visible-on-ready, [z-load][z-ready=true].visible-on-ready { - transition: opacity 50ms ease-in-out; + transition: opacity 150ms ease-in-out; } .drawer-header { color:white; diff --git a/docs/js/zuix/zuix-bundler.js b/docs/js/zuix/zuix-bundler.js index 0e5aa9d..e96c5be 100644 --- a/docs/js/zuix/zuix-bundler.js +++ b/docs/js/zuix/zuix-bundler.js @@ -1,4 +1,4 @@ -/* zuix.js v1.1.6 22.05.26 17:50:11 */ +/* zuix.js v1.1.7 22.06.06 23:17:57 */ var zuix; /******/ (function() { // webpackBootstrap diff --git a/docs/js/zuix/zuix-bundler.min.js b/docs/js/zuix/zuix-bundler.min.js index 76e894b..36de785 100644 --- a/docs/js/zuix/zuix-bundler.min.js +++ b/docs/js/zuix/zuix-bundler.min.js @@ -1,4 +1,4 @@ -/* zuix.js v1.1.6 22.05.26 17:50:11 */ +/* zuix.js v1.1.7 22.06.06 23:17:57 */ /*! For license information please see zuix-bundler.min.js.LICENSE.txt */ var zuix;!function(){var e={460:function(e,t,n){"use strict";e.exports=n(94)()},35:function(e,t,n){var o,r=r||function(e){"use strict";if(!(void 0===e||"undefined"!=typeof navigator&&/MSIE [1-9]\./.test(navigator.userAgent))){var t=e.document,n=function(){return e.URL||e.webkitURL||e},o=t.createElementNS("http://www.w3.org/1999/xhtml","a"),r="download"in o,i=/constructor/i.test(e.HTMLElement)||e.safari,a=/CriOS\/[\d]+/.test(navigator.userAgent),u=function(t){(e.setImmediate||e.setTimeout)((function(){throw t}),0)},l=function(e){setTimeout((function(){"string"==typeof e?n().revokeObjectURL(e):e.remove()}),4e4)},c=function(e){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob([String.fromCharCode(65279),e],{type:e.type}):e},s=function(t,s,d){d||(t=c(t));var f,p=this,z="application/octet-stream"===t.type,v=function(){!function(e,t,n){for(var o=(t=[].concat(t)).length;o--;){var r=e["on"+t[o]];if("function"==typeof r)try{r.call(e,e)}catch(e){u(e)}}}(p,"writestart progress write writeend".split(" "))};if(p.readyState=p.INIT,r)return f=n().createObjectURL(t),void setTimeout((function(){var e,t;o.href=f,o.download=s,e=o,t=new MouseEvent("click"),e.dispatchEvent(t),v(),l(f),p.readyState=p.DONE}));!function(){if((a||z&&i)&&e.FileReader){var o=new FileReader;return o.onloadend=function(){var t=a?o.result:o.result.replace(/^data:[^;]*;/,"data:attachment/file;");e.open(t,"_blank")||(e.location.href=t),t=void 0,p.readyState=p.DONE,v()},o.readAsDataURL(t),void(p.readyState=p.INIT)}f||(f=n().createObjectURL(t)),z?e.location.href=f:e.open(f,"_blank")||(e.location.href=f),p.readyState=p.DONE,v(),l(f)}()},d=s.prototype;return"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob?function(e,t,n){return t=t||e.name||"download",n||(e=c(e)),navigator.msSaveOrOpenBlob(e,t)}:(d.abort=function(){},d.readyState=d.INIT=0,d.WRITING=1,d.DONE=2,d.error=d.onwritestart=d.onprogress=d.onwrite=d.onabort=d.onerror=d.onwriteend=null,function(e,t,n){return new s(e,t||e.name||"download",n)})}}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this.content);e.exports?e.exports.saveAs=r:null!==n.amdD&&null!==n.amdO&&(void 0===(o=function(){return r}.call(t,n,t,e))||(e.exports=o))},458:function(e){const t=Math.floor(1099511627776*Math.random()).toString(16),n=new RegExp('"@__(F|R)-'+t+'-(\\d+)__@"',"g"),o=/\{\s*\[native code\]\s*\}/g,r=/[<>\/\u2028\u2029]/g,i={"<":"\\u003C",">":"\\u003E","/":"\\u002F","\u2028":"\\u2028","\u2029":"\\u2029"};function a(e){return i[e]}e.exports=function(e,i){i||(i={}),"number"!=typeof i&&"string"!=typeof i||(i={space:i});const u=[],l=[];let c;return c=i.isJSON&&!i.space?JSON.stringify(e):JSON.stringify(e,i.isJSON?null:function(e,n){if(!n)return n;const o=typeof n;return"object"===o?(r=n,"[object RegExp]"===Object.prototype.toString.call(r)?"@__R-"+t+"-"+(l.push(n)-1)+"__@":n):"function"===o?"@__F-"+t+"-"+(u.push(n)-1)+"__@":n;var r},i.space),"string"!=typeof c?String(c):(c=c.replace(r,a),0===u.length&&0===l.length?c:c.replace(n,(function(e,t,n){if("R"===t)return l[n].toString();const r=u[n],i=r.toString();if(o.test(i))throw new TypeError("Serializing native function: "+r.name);return i})))}},94:function(e,t,n){"use strict";const o=n(35),r=n(458),i=n(541);function a(){const e=zuix.bundle();let t="\n/*";t+="\n * zUIx Application Bundle",t+="\n * ",t+="\n * app.bundle.js generated by *zuix-bundler*",t+="\n * on "+(new Date).toISOString(),t+="\n * ",t+="\n * Resource list ("+e.length+"):",t+="\n * ";for(let n=0;n\/\u2028\u2029]/g,i={"<":"\\u003C",">":"\\u003E","/":"\\u002F","\u2028":"\\u2028","\u2029":"\\u2029"};function a(e){return i[e]}e.exports=function(e,i){i||(i={}),"number"!=typeof i&&"string"!=typeof i||(i={space:i});const u=[],l=[];let c;return c=i.isJSON&&!i.space?JSON.stringify(e):JSON.stringify(e,i.isJSON?null:function(e,n){if(!n)return n;const o=typeof n;return"object"===o?(r=n,"[object RegExp]"===Object.prototype.toString.call(r)?"@__R-"+t+"-"+(l.push(n)-1)+"__@":n):"function"===o?"@__F-"+t+"-"+(u.push(n)-1)+"__@":n;var r},i.space),"string"!=typeof c?String(c):(c=c.replace(r,a),0===u.length&&0===l.length?c:c.replace(n,(function(e,t,n){if("R"===t)return l[n].toString();const r=u[n],i=r.toString();if(o.test(i))throw new TypeError("Serializing native function: "+r.name);return i})))}},94:function(e,t,n){const o=n(35),r=n(458),i=n(541);function a(){const e=zuix.bundle();let t="\n/*";t+="\n * zUIx Application Bundle",t+="\n * ",t+="\n * app.bundle.js generated by *zuix-bundler*",t+="\n * on "+(new Date).toISOString(),t+="\n * ",t+="\n * Resource list ("+e.length+"):",t+="\n * ";for(let n=0;n { return p.indexOf(i) !== -1; - }) && - p.every(function(i) { - return util.objectEquals(x[i], y[i]); - }); + }) && p.every( (i) => { + return this.objectEquals(x[i], y[i]); + }); }, propertyFromPath: function(o, s) { @@ -500,7 +472,7 @@ module.exports = { if (obj === null || typeof obj !== 'object') { return obj; } - // Give temp the original obj's constructor + // Give temp the original object's constructor // var temp = obj.constructor(); // for (var key in obj) // temp[key] = cloneObject(obj[key]); @@ -533,10 +505,10 @@ module.exports = { }, hyphensToCamelCase: function(s) { - return s.replace(/-([a-z0-9_$-])/g, function(g) { + return s.replace(/--/g, ':').replace(/-([a-z0-9_$-])/g, function(g) { return '_$-'.indexOf(g[1]) > -1 || (+g[1]).toString() === g[1] ? '_' + g[1].replace('-', '_') : g[1].toUpperCase(); - }); + }).replace(/:/g, '-'); }, camelCaseToHyphens: function(s) { @@ -569,7 +541,7 @@ module.exports = { dom: { queryAttribute: function(name, value, appendValue) { - const fields = name.split(','); + const fields = name.split(/[\s|,]+/g); let selector = ''; fields.forEach(function(v, i) { if (value != null) { @@ -587,7 +559,7 @@ module.exports = { getAttribute: function(element, name) { let value; if (typeof name === 'string' && name.indexOf(',') !== -1) { - const fields = name.split(','); + const fields = name.split(/[\s|,]+/g); for (let i = 0; i < fields.length; i++) { const f = fields[i]; const a = element.getAttribute(f); @@ -601,7 +573,7 @@ module.exports = { }, setAttribute: function(element, name, value) { if (typeof name === 'string' && name.indexOf(',') !== -1) { - const fields = name.split(','); + const fields = name.split(/[\s|,]+/g); const _t = this; fields.forEach(function(f) { _t.setAttribute(element, f, value); @@ -784,10 +756,10 @@ const util = __webpack_require__(826); * @property {'transition'|'animation'} type The type of effect to play. * @property {Element|ZxQuery} target Target element. * @property {Array|string} classes List of transition or animation classes to play. - * @property {object} options Transition/animation options ('delay', 'duration', etc..). - * @property {boolean} holdState Hold last transition/animation class. - * @property {PlayFxCallback} onStep Since class list can contain more than just two classes, this callback will be called after each pair of transition/animation ended. - * @property {PlayFxCallback} onEnd Called when all transitions/animations ended. + * @property {object} [options] Transition/animation options ('delay', 'duration', etc..). + * @property {boolean} [holdState] Hold last transition/animation class. + * @property {PlayFxCallback} [onStep] Since class list can contain more than just two classes, this callback will be called after each pair of transition/animation ended. + * @property {PlayFxCallback} [onEnd] Called when all transitions/animations ended. */ /** @@ -854,6 +826,21 @@ function removeAllEventHandlers(el) { } }); } +function getPlayFxConfig(type, target, options) { + let classes = options.classes; + if (typeof options === 'string') { + classes = options.split(/[\s|,]+/g); + options = {}; + } else if (Array.isArray(options)) { + classes = options; + options = {}; + } + return Object.assign({ + type, + classes, + target + }, options); +} /** * The constructor takes one optional argument that can be @@ -888,8 +875,9 @@ function ZxQuery(element) { } else if (typeof element === 'string') { this._selection = document.documentElement.querySelectorAll(element); } else if (element !== null) { // if (typeof element === 'string') { - _log.e('ZxQuery cannot wrap object of this type.', (typeof element), element); - throw new Error('ZxQuery cannot wrap object of this type.'); + const msg = 'ZxQuery cannot wrap object of this type.'; + _log.e(msg, (typeof element), element); + throw new Error(msg); } return this; } @@ -1126,16 +1114,14 @@ ZxQuery.prototype.on = function(eventPath, eventHandler) { }); return this; } - const events = eventPath.match(/\S+/g) || []; + const events = eventPath.split(/[\s|,]+/g) || []; let options; if (typeof eventHandler !== 'function') { options = eventHandler; eventHandler = options.handler; } this.each(function(k, el) { - z$.each(events, function(k, ev) { - addEventHandler(el, ev, eventHandler, options); - }); + events.map((ev) => addEventHandler(el, ev, eventHandler, options)); }); return this; }; @@ -1154,11 +1140,9 @@ ZxQuery.prototype.off = function(eventPath, eventHandler) { }); return this; } - const events = eventPath.match(/\S+/g) || []; + const events = eventPath.split(/[\s|,]+/g) || []; this.each(function(k, el) { - z$.each(events, function(k, ev) { - removeEventHandler(el, ev, eventHandler); - }); + events.map((ev) => removeEventHandler(el, ev, eventHandler)); }); return this; }; @@ -1227,13 +1211,9 @@ ZxQuery.prototype.css = function(prop, val) { * @return {ZxQuery} The *ZxQuery* object itself. */ ZxQuery.prototype.addClass = function(className) { - const classes = className.match(/\S+/g) || []; + const classes = className.split(/[\s|,]+/g) || []; z$.each(this._selection, function(k, el) { - if (el.classList) { - z$.each(classes, function(k, cl) { - el.classList.add(cl); - }); - } else el.className += ' ' + className; + classes.map((cl) => el.classList.add(cl)); }); return this; }; @@ -1253,13 +1233,9 @@ ZxQuery.prototype.hasClass = function(className) { * @return {ZxQuery} The *ZxQuery* object itself. */ ZxQuery.prototype.removeClass = function(className) { - const classes = className.match(/\S+/g) || []; + const classes = className.split(/[\s|,]+/g) || []; z$.each(this._selection, function(k, el) { - if (el.classList) { - z$.each(classes, function(k, cl) { - el.classList.remove(cl); - }); - } else el.className = el.className.replace(new RegExp('(^|\\b)' + className.split(' ').join('|') + '(\\b|$)', 'gi'), ' '); + classes.map((cl) => el.classList.remove(cl)); }); return this; }; @@ -1449,20 +1425,7 @@ ZxQuery.prototype.hide = function() { * @return {ZxQuery} */ ZxQuery.prototype.playTransition = function(options) { - let classes = options.classes; - if (typeof options === 'string') { - classes = options.split(' '); - options = {}; - } else if (Array.isArray(options)) { - classes = options; - options = {}; - } - const config = Object.assign({ - classes, - target: this, - type: 'transition' - }, options); - z$.playFx(config); + z$.playFx(getPlayFxConfig('transition', this, options)); return this; }; /** @@ -1473,20 +1436,7 @@ ZxQuery.prototype.playTransition = function(options) { * @return {ZxQuery} */ ZxQuery.prototype.playAnimation = function(options) { - let classes = options.classes; - if (typeof options === 'string') { - classes = options.split(' '); - options = {}; - } else if (Array.isArray(options)) { - classes = options; - options = {}; - } - const config = Object.assign({ - classes, - target: this, - type: 'animation' - }, options); - z$.playFx(config); + z$.playFx(getPlayFxConfig('animation', this, options)); return this; }; /** @@ -1582,14 +1532,14 @@ ZxQueryStatic.ajax = const xhr = new XMLHttpRequest(); xhr.onload = function() { if (xhr.status === 200) { - if (util.isFunction(options.success)) options.success(xhr.responseText); + if (options.success) options.success(xhr.responseText); } else { - if (util.isFunction(options.error)) options.error(xhr, xhr.statusText, xhr.status); + if (options.error) options.error(xhr, xhr.statusText, xhr.status); } - if (util.isFunction(options.then)) options.then(xhr); + if (options.then) options.then(xhr); }; xhr.onerror = function(xhr, textStatus, errorThrown) { - if (util.isFunction(options.error)) options.error(xhr, textStatus, errorThrown); + if (options.error) options.error(xhr, textStatus, errorThrown); }; if (typeof options.beforeSend == 'function') { options.beforeSend(xhr); @@ -1598,7 +1548,7 @@ ZxQueryStatic.ajax = xhr.open('GET', url); xhr.send(); } catch (e) { - if (util.isFunction(options.error)) options.error(xhr, xhr.statusText, xhr.status, e); + if (options.error) options.error(xhr, xhr.statusText, xhr.status, e); } return this; }; @@ -1613,15 +1563,11 @@ ZxQueryStatic.ajax = * @return {boolean} */ ZxQueryStatic.hasClass = function(el, className) { - const classes = className.match(/\S+/g) || []; + const classes = className.split(/[\s|,]+/g) || []; let success = false; z$.each(classes, function(k, cl) { - if (el.classList) { - success = el.classList.contains(cl); - } else { - success = (new RegExp('(^| )' + cl + '( |$)', 'gi').test(el.className)); - } - if (success) return false; + success = el.classList.contains(cl); + if (success) return false; // break loop }); return success; }; @@ -1635,7 +1581,7 @@ ZxQueryStatic.hasClass = function(el, className) { * @return {boolean} */ ZxQueryStatic.classExists = function(className) { - const classes = className.match(/\S+/g) || []; + const classes = className.split(/[\s|,]+/g) || []; let success = false; z$.each(classes, function(k, cl) { // Perform global style check @@ -1800,54 +1746,6 @@ ZxQueryStatic.appendCss = function(css, target, cssId, container) { } return style; }; -/** - * Replaces CSS variables with provided values. - * - * @method replaceCssVars - * @memberOf ZxQueryStatic - * @alias zuix.$.replaceCssVars - * @param {string} css Stylesheet text - * @param {object} model Object containing variables fields and values. - * @return {string} The new stylesheet text with variables replaced with values - */ -ZxQueryStatic.replaceCssVars = function(css, model) { - const vars = new RegExp(/\B\$var\[(.*[^\[\]])]/g); - let outCss = ''; - let matched = 0; - let currentIndex = 0; - let result; - while (result = vars.exec(css)) { - let value = result[0]; - if (result.length > 1) { - const name = result[1]; - // resolve dotted field path - let cur = model; - if (name.indexOf('.') > 0) { - const path = name.split('.'); - for (let p = 0; p < path.length - 1; p++) { - cur = cur[path[p]]; - if (typeof cur === 'undefined') { - break; - } - } - if (typeof cur !== 'undefined') { - value = cur[path[path.length - 1]]; - matched++; - } - } else if (typeof cur[name] !== 'undefined') { - value = cur[name]; - matched++; - } - } - outCss += css.substring(currentIndex, result.index)+value; - currentIndex = result.index+result[0].length; - } - if (matched > 0) { - outCss += css.substring(currentIndex); - css = outCss; - } - return css; -}; /** * Parses variables enclosed in single or double braces and calls the given callback for each parsed variable name. * If the callback returns a value, then the variable will be replaced with the given value. @@ -1874,7 +1772,7 @@ ZxQueryStatic.replaceBraces = function(html, callback) { continue; } let value = result[0]; - if (typeof callback === 'function') { + if (callback) { const r = callback(result[0]); if (!util.isNoU(r)) { value = r; @@ -2069,7 +1967,7 @@ ZxQueryStatic.playFx = function(config) { if (config.classes == null) { config.classes = []; } else if (typeof config.classes === 'string') { - config.classes = config.classes.split(' '); + config.classes = config.classes.split(/[\s|,]+/g); } const classOut = config.classes.length > 1 && config.classes.shift(); if (!$el.hasClass('--z-playing')) { @@ -2085,7 +1983,7 @@ ZxQueryStatic.playFx = function(config) { if (expired) return; expired = true; if (config.classes.length > 1) { - if (typeof config.onStep === 'function') { + if (config.onStep) { config.onStep.call($el, $el, config.classes.slice(1)); } _t.playFx(config); @@ -2094,7 +1992,7 @@ ZxQueryStatic.playFx = function(config) { $el.removeClass(config.classes.shift()); } $el.removeClass('--z-playing'); - if (typeof config.onEnd === 'function') { + if (config.onEnd) { config.onEnd.call($el, $el); } } @@ -2859,6 +2757,31 @@ function dataBind(el, boundData) { z$(el).html('').append(v); } } +/** + * Query binding adapter for resolving `boundField`->$el mapping + * @param {ComponentContext} _t + * @param {ZxQuery} $view + * @param {ZxQuery} $el + * @param {BindingAdapterCallback} fn The binding adapter callback + * @param {string} field Bound field name + */ +function queryAdapter(_t, $view, $el, fn, field) { + if (fn && !_t._disposed) { + (fn).call($view, $el, field, $view, /** @type {BindingAdapterRefreshCallback} */ function(retryMs) { + // data adapter is not ready, retry after 1s + if (!_t._disposed) { + const timeoutId = $el.get().dataset.__zuix_refreshTimeout; + if (timeoutId && _queryAdapterRefreshTimeout[timeoutId]) { + clearTimeout(_queryAdapterRefreshTimeout[timeoutId]); + } + $el.get().dataset.__zuix_refreshTimeout = + setTimeout(function() { + queryAdapter(_t, $view, $el, fn, field); + }, retryMs ? retryMs : 500); + } + }); + } +} /** * The component context object represents the component instance itself, and it holds @@ -2884,7 +2807,7 @@ function ComponentContext(zuixInstance, options, eventCallback) { this.componentId = null; this.handlers = {refresh: function($view, $el, contextData, refreshCallback) {}}; this.trigger = function(context, eventPath, eventValue) { - if (typeof eventCallback === 'function') { + if (eventCallback) { eventCallback(context, eventPath, eventValue); } }; @@ -2943,29 +2866,34 @@ function ComponentContext(zuixInstance, options, eventCallback) { // TODO: maybe implement a {ContextController} callback for this too }, set: function(target, key, value, path, old) { + const view = this.context.$; if (target instanceof Element) { // use the first part of the "path" as field name (eg. 'text.innerHTML' --> 'text') // for binding data to view element path = path.split('.')[0]; value = target; } - // update bound field if found in the view - const view = z$(this.context.view()); - if (view.get()) { - let fld = view.find(util.dom.queryAttribute(_optionAttributes.zBind, path)); - if (fld.get() != null) { - fld.each(function(i, f) { - dataBind(f, value); - }); + if (typeof value === 'function') { + let field = view.find(util.dom.queryAttribute(_optionAttributes.zBind, path)); + if (field.get() == null) { + field = view.find(util.dom.queryAttribute(_optionAttributes.zField, path)); } - fld = view.find(util.dom.queryAttribute(_optionAttributes.zField, path)); + queryAdapter(this.context, view, field, value, key) + return; + } + // update bound field if found in the view + const bindFields = function(fld) { if (fld.get() != null) { fld.each(function(i, f) { dataBind(f, value); }); } + }; + if (view.get()) { + bindFields(view.find(util.dom.queryAttribute(_optionAttributes.zBind, path))); + bindFields(view.find(util.dom.queryAttribute(_optionAttributes.zField, path))); // call controller's 'update' method - if (this.context._c && typeof this.context._c.update === 'function') { + if (this.context._c && this.context._c.update) { this.context._c.update(target, key, value, path, old); } } @@ -3021,7 +2949,7 @@ ComponentContext.prototype.dispose = function() { }); } } - if (util.isFunction(this._c.dispose)) { + if (this._c.dispose) { this._c.dispose.call(this, this); } } @@ -3109,13 +3037,14 @@ ComponentContext.prototype.view = function(view) { // add `z-field` from '#' attributes for (let j = 0; j < el.attributes.length; j++) { const a = el.attributes.item(j); - const attributeName = a.name; - if (attributeName.length > 1 && attributeName.startsWith('#')) { + const v = a.value; + if (a.name.length > 1 && a.name.startsWith('#')) { + const attributeName = util.hyphensToCamelCase(a.name.substring(1)); if ($el.attr(_optionAttributes.zField) == null) { - $el.attr(_optionAttributes.zField, attributeName.substring(1)); + $el.attr(_optionAttributes.zField, attributeName); } - if ($el.attr(_optionAttributes.zBind) == null && a.value != null && a.value.length > 0) { - $el.attr(_optionAttributes.zBind, a.value); + if ($el.attr(_optionAttributes.zBind) == null && v != null && v.length > 0) { + $el.attr(_optionAttributes.zBind, v); } } } @@ -3312,7 +3241,7 @@ ComponentContext.prototype.style = function(css) { _log.t(this.componentId, 'view:style', 'timer:view:start', cssId); if (css == null || css instanceof Element) { this._css = (css instanceof Element) ? css.innerText : css; - this._style = z$.appendCss(css, this._style, this.componentId + '@' + cssId, util.dom.getShadowRoot(this._container)); + this._style = z$.appendCss(css, this._style, this.componentId + '@' + cssId, util.dom.getShadowRoot(this._view)); } else if (typeof css === 'string') { // store original unparsed css (might be useful for debugging) this._css = css; @@ -3338,7 +3267,7 @@ ComponentContext.prototype.style = function(css) { ); // output css - this._style = z$.appendCss(css, this._style, this.componentId + '@' + cssId, util.dom.getShadowRoot(this._container)); + this._style = z$.appendCss(css, this._style, this.componentId + '@' + cssId, util.dom.getShadowRoot(this._view)); } this.checkEncapsulation(); // TODO: should throw error if ```css``` is not a valid type @@ -3422,7 +3351,7 @@ ComponentContext.prototype.model = function(model) { } this.modelToView(); // call controller `update` method when whole model is updated - if (this._c != null && util.isFunction(this._c.update)) { + if (this._c != null && this._c.update) { this._c.update.call(this._c, null, null, null, null, this._c); } } @@ -3526,10 +3455,10 @@ ComponentContext.prototype.loadCss = function(options, enableCaching) { } if (inlineStyles[cssPath] != null) { context.style(inlineStyles[cssPath]); - if (util.isFunction(options.success)) { + if (options.success) { (options.success).call(context, inlineStyles[cssPath], context); } - if (util.isFunction(options.then)) { + if (options.then) { (options.then).call(context, context); } } else { @@ -3540,10 +3469,10 @@ ComponentContext.prototype.loadCss = function(options, enableCaching) { context.style(viewCss); inlineStyle.detach(); inlineStyles[cssPath] = viewCss; - if (util.isFunction(options.success)) { + if (options.success) { (options.success).call(context, viewCss, context); } - if (util.isFunction(options.then)) { + if (options.then) { (options.then).call(context, context); } } else { @@ -3554,18 +3483,18 @@ ComponentContext.prototype.loadCss = function(options, enableCaching) { url: zuix.getResourcePath(cssPath), success: function(viewCss) { context.style(viewCss); - if (util.isFunction(options.success)) { + if (options.success) { (options.success).call(context, viewCss, context); } }, error: function(err) { _log.e(err, context); - if (util.isFunction(options.error)) { + if (options.error) { (options.error).call(context, err, context); } }, then: function() { - if (util.isFunction(options.then)) { + if (options.then) { (options.then).call(context, context); } } @@ -3617,10 +3546,10 @@ ComponentContext.prototype.loadHtml = function(options, enableCaching) { } if (inlineViews[htmlPath] != null) { context.view(inlineViews[htmlPath]); - if (util.isFunction(options.success)) { + if (options.success) { (options.success).call(context, inlineViews[htmlPath], context); } - if (util.isFunction(options.then)) { + if (options.then) { (options.then).call(context, context); } } else { @@ -3631,21 +3560,17 @@ ComponentContext.prototype.loadHtml = function(options, enableCaching) { util.dom.cssNot(_optionAttributes.zComponent) )); if (inlineView.length() > 0) { + let styles; let inlineElement = inlineView.get(0); if (inlineElement.tagName.toLowerCase() === 'template') { inlineElement = inlineElement.cloneNode(true); - const styles = inlineElement.content.querySelectorAll('style'); - if (styles) { - for (const s of styles) { - s.setAttribute('media', '#' + context.componentId); - } - } + styles = inlineElement.content.querySelectorAll('style'); } else { - const styles = inlineElement.querySelectorAll('style[media="#"]'); - if (styles) { - for (const s of styles) { - s.setAttribute('media', '#' + context.componentId); - } + styles = inlineElement.querySelectorAll('style[media="#"]'); + } + if (styles) { + for (const s of styles) { + s.setAttribute('media', '#' + context.componentId); } } inlineViews[htmlPath] = inlineElement.innerHTML; @@ -3659,10 +3584,10 @@ ComponentContext.prototype.loadHtml = function(options, enableCaching) { } else { context.view(inlineElement.innerHTML); } - if (util.isFunction(options.success)) { + if (options.success) { (options.success).call(context, inlineElement.innerHTML, context); } - if (util.isFunction(options.then)) { + if (options.then) { (options.then).call(context, context); } } else { @@ -3674,18 +3599,18 @@ ComponentContext.prototype.loadHtml = function(options, enableCaching) { url: zuix.getResourcePath(htmlPath), success: function(viewHtml) { context.view(viewHtml); - if (util.isFunction(options.success)) { + if (options.success) { (options.success).call(context, viewHtml, context); } }, error: function(err) { _log.e(err, context); - if (util.isFunction(options.error)) { + if (options.error) { (options.error).call(context, err, context); } }, then: function() { - if (util.isFunction(options.then)) { + if (options.then) { (options.then).call(context, context); } } @@ -3755,42 +3680,10 @@ ComponentContext.prototype.modelToView = function() { if (boundField == null) { boundField = $el.attr(_optionAttributes.zField); } - const v = z$(_t._view); - // map `z-field`s as properties of the context's member '#' if the variable name is valid - try { - const f = util.hyphensToCamelCase(boundField); - Function('function testName(){ const ' + f + ' = "test"; }'); - _t['#'][f] = _t.field(boundField); - } catch (e) { - // TODO: should at least log a 'Warning: unscriptable field name' - //console.log('ERROR', e); - } - /** - * Query binding adapter for resolving `boundField`->$el mapping - * @param {BindingAdapterCallback} fn The binding adapter callback - * @param {string} field Bound field name - */ - const queryAdapter = function(fn, field) { - if (fn && !_t._disposed) { - (fn).call(v, $el, field, v, /** @type {BindingAdapterRefreshCallback} */ function(retryMs) { - // data adapter is not ready, retry after 1s - if (!_t._disposed) { - const timeoutId = $el.get().dataset.__zuix_refreshTimeout; - if (timeoutId && _queryAdapterRefreshTimeout[timeoutId]) { - clearTimeout(_queryAdapterRefreshTimeout[timeoutId]); - } - $el.get().dataset.__zuix_refreshTimeout = - setTimeout(function() { - queryAdapter(fn, field); - }, retryMs ? retryMs : 500); - } - }); - } - }; if (typeof _t._model === 'function') { // use a data model binding adapter // to resolve all model fields' values - queryAdapter(_t._model, boundField); + queryAdapter(_t, $view, $el, _t._model, boundField); } else { let boundData = util.propertyFromPath(_t._model, boundField); const altField = util.hyphensToCamelCase(boundField); @@ -3802,7 +3695,7 @@ ComponentContext.prototype.modelToView = function() { if (typeof boundData === 'function') { // use data model's field binding adapter // to resolve boundField's value - queryAdapter(boundData, boundField); + queryAdapter(_t, $view, $el, boundData, boundField); } else if (boundData != null) { // use default binding method // to resolve boundField's value @@ -3810,6 +3703,25 @@ ComponentContext.prototype.modelToView = function() { } } }); + // new fields might been have added after data-binding + $view.find(util.dom.queryAttribute(_optionAttributes.zField)).each(function(i, el, $el) { + if (!zuix.isDirectComponentElement($view, $el) && $el.attr('inherits') !== 'true') { + return true; + } + let boundField = $el.attr(_optionAttributes.zBind); + if (boundField == null) { + boundField = $el.attr(_optionAttributes.zField); + } + // map `z-field`s as properties of the context's member '#' if the variable name is valid + try { + const f = util.hyphensToCamelCase(boundField); + Function('function testName(){ const ' + f + ' = "test"; }'); + _t['#'][f] = _t.field(boundField); + } catch (e) { + // TODO: should at least log a 'Warning: unscriptable field name' + //console.log('ERROR', e); + } + }); } _log.t(this.componentId, 'model:view', 'timer:mv:stop'); return this; @@ -4171,16 +4083,17 @@ function getNextLoadable() { let job = null; let item = _componentizeQueue.length > 0 ? _componentizeQueue.shift() : null; while (item != null && item.element != null) { + const el = item.element; // defer element loading if lazy loading is enabled and the element is not in view - const isLazy = lazyElementCheck(item.element); + const isLazy = lazyElementCheck(el); if (lazyLoad() && isLazy) { item.lazy = true; - item.visible = z$.getPosition(item.element, _lazyLoadingThreshold).visible; + item.visible = z$.getPosition(el, _lazyLoadingThreshold).visible; } else { item.lazy = false; item.visible = true; } - if (item.element != null && item.visible) { + if (el != null && item.visible) { job = { item: item, cancelable: item.lazy @@ -4199,10 +4112,11 @@ function loadNext(element) { queueLoadables(element); const job = getNextLoadable(); if (job != null && job.item != null && job.item.element != null) { - z$(job.item.element).one('component:loaded', function() { - zuix.componentize(job.item.element); + const el = job.item.element; + z$(el).one('component:loaded', function() { + zuix.componentize(el); }); - loadInline(job.item.element); + loadInline(el); } } @@ -4249,17 +4163,20 @@ function loadInline(element, opts) { options.container = element; } + const setAsTemplate = function() { + v.attr(_optionAttributes.zComponent, null); + // View-only templates have no controller + if (util.isNoU(options.controller)) { + options.controller = function() {}; + } + }; let componentId = v.attr(_optionAttributes.zLoad); if (util.isNoU(componentId)) { const include = v.attr(_optionAttributes.zInclude); if (include != null) { componentId = resolvePath(include); v.attr(_optionAttributes.zInclude, componentId); - v.attr(_optionAttributes.zComponent, null); - // Static include hove no controller - if (util.isNoU(options.controller)) { - options.controller = function() {}; - } + setAsTemplate(); } else { return false; } @@ -4268,11 +4185,7 @@ function loadInline(element, opts) { v.attr(_optionAttributes.zLoad, componentId); // check for `view` and `ctrl` type attributes if (componentId !== 'default' && v.attr(_optionAttributes.resourceType.view) !== null) { - v.attr(_optionAttributes.zComponent, null); - // Static includes have no controller - if (util.isNoU(options.controller)) { - options.controller = function() {}; - } + setAsTemplate(); } else if (componentId === 'default' || v.attr(_optionAttributes.resourceType.controller) !== null) { options.view = options.view || element; options.viewDeferred = true; @@ -4296,9 +4209,31 @@ function loadInline(element, opts) { // inline attributes have precedence over ```options``` - const model = v.attr(_optionAttributes.zModel); - if (!util.isNoU(model) && model.length > 0) { - options.model = parseOptions(element, model); + const exclusionList = [':on', ':model', ':behavior', ':ready']; // these are evaluated after component is created + const optionAttributes = Array.from(v.get().attributes) + .filter((a) => a.nodeName.startsWith(':') && !exclusionList.find((t) => a.nodeName.startsWith(t))); + optionAttributes.forEach((attribute) => { + const attr = attribute.nodeName; + const path = attr.match(/[^:]+/g); + let co = options; + path.forEach((p, i) => { + p = util.hyphensToCamelCase(p); + if (i === path.length - 1) { + let val; + try { + val = Function('return ' + attribute.nodeValue + ';')(); + } catch (e) { + _log.warn(path.join(':'), p, attribute.nodeValue, e); + } + return co[p] = val; + } + co = co[p] = co[p] || {}; + }); + }); + + const on = v.attr(_optionAttributes.zOn); + if (!util.isNoU(on) && on.length > 0) { + options.on = parseOptions(element, on); } const behavior = v.attr(_optionAttributes.zBehavior); @@ -4306,9 +4241,9 @@ function loadInline(element, opts) { options.behavior = parseOptions(element, behavior); } - const on = v.attr(_optionAttributes.zOn); - if (!util.isNoU(on) && on.length > 0) { - options.on = parseOptions(element, on); + const model = v.attr(_optionAttributes.zModel); + if (!util.isNoU(model) && model.length > 0) { + options.model = parseOptions(element, model); } const priority = v.attr(_optionAttributes.zPriority); @@ -4353,7 +4288,7 @@ function resolvePath(path) { /** @private */ function parseOptions(element, attributeValue) { if (typeof attributeValue === 'string') { - const parentComponent = z$(element).parent(util.dom.queryAttribute(_optionAttributes.zLoad)); + const parentComponent = z$(element).parent(util.dom.queryAttribute(_optionAttributes.zLoad) + ',' + util.dom.queryAttribute(_optionAttributes.zInclude)); if (parentComponent.get()) { // parent component context should be already loaded const context = zuix.context(parentComponent); @@ -4376,14 +4311,14 @@ function applyOptions(element, options) { options = parseOptions(element, options); // TODO: should check if options object is valid if (element != null && options != null) { - if (options.lazyLoad != null) { - util.dom.setAttribute(element, _optionAttributes.zLazy, options.lazyLoad.toString().toLowerCase()); + if (options.componentId != null) { + util.dom.setAttribute(element, _optionAttributes.zLoad, options.componentId.toString().toLowerCase()); } if (options.contextId != null) { util.dom.setAttribute(element, _optionAttributes.zContext, options.contextId.toString().toLowerCase()); } - if (options.componentId != null) { - util.dom.setAttribute(element, _optionAttributes.zLoad, options.componentId.toString().toLowerCase()); + if (options.lazyLoad != null) { + util.dom.setAttribute(element, _optionAttributes.zLazy, options.lazyLoad.toString().toLowerCase()); } // TODO: eventually map other attributes from options } @@ -4626,7 +4561,7 @@ function ContextController(context) { this.eventRouter = function(e) { const v = _t.view(); context._behaviorMap.concat(context._eventMap).forEach(function(em) { - if (em.eventPath === e.type && typeof em.handler === 'function') { + if (em.eventPath === e.type && em.handler) { em.handler.call(v, e, e.detail, v); } }); @@ -4637,7 +4572,7 @@ function ContextController(context) { let handler = null; if (options.on != null) { z$.each(options.on, function(ep, handler) { - _t.addEvent(ep, handler); + ep.split(/[\s|,]+/g).map((evt) => _t.addEvent(evt, handler)); }); } // create behavior map from context options @@ -4645,7 +4580,7 @@ function ContextController(context) { for (const bp in options.behavior) { if (options.behavior.hasOwnProperty(bp)) { handler = options.behavior[bp]; - _t.addBehavior(bp, handler); + bp.split(/[\s|,]+/g).map((evt) => _t.addEvent(evt, handler)); } } } @@ -4704,7 +4639,7 @@ ContextController.prototype.addTransition = function(className, properties, opti className, properties, options, - util.dom.getShadowRoot(this.context.container()) + util.dom.getShadowRoot(this.context.view()) ); return this; }; @@ -4814,8 +4749,7 @@ ContextController.prototype.trigger = function(eventPath, eventData, isHook) { let target = this.context.container(); if (target == null) target = this.context.view(); if (target != null) { - z$(target) - .trigger(eventPath, eventData); + z$(target).trigger(eventPath, eventData); } this.context.trigger(this.context, eventPath, eventData); } else { @@ -5153,6 +5087,13 @@ function ViewObserver(context) { // eslint-disable-next-line no-unused-vars function(mutationsList, observer) { const zc = util.dom.queryAttribute(_optionAttributes.zComponent); + const findNode = function(node) { + for (let i = 0; i < node.attributes.length; i++) { + if (node.attributes[i].name.startsWith(_optionAttributes.cssIdPrefix)) { + return true; + } + } + }; for (const mutation of mutationsList) { if (mutation.type === 'childList') { mutation.addedNodes.forEach(function(node) { @@ -5161,14 +5102,7 @@ function ViewObserver(context) { if (parent.get() == null) return; if (_t.options().css !== false && parent.attr(_optionAttributes.resourceType.controller) == null) { if ((parent.get() === _t._container || parent.get() === _t._view)) { - let found = false; - for (let i = 0; i < node.attributes.length; i++) { - if (node.attributes[i].name.startsWith(_optionAttributes.cssIdPrefix)) { - found = true; - break; - } - } - if (!found) { + if (!findNode(node)) { util.dom.setAttribute(node, _t.getCssId(), ''); } } @@ -5180,14 +5114,7 @@ function ViewObserver(context) { } while (c < 10 && parent.get() != null && parent.attr(_optionAttributes.resourceType.controller) != null); if (parent.get()) { parent = zuix.context(parent); - let found = false; - for (let i = 0; i < node.attributes.length; i++) { - if (node.attributes[i].name.startsWith(_optionAttributes.cssIdPrefix)) { - found = true; - break; - } - } - if (!found) { + if (!findNode(node)) { util.dom.setAttribute(node, parent.getCssId(), ''); zuix.$(node).find('*').each(function() { this.attr(parent.getCssId(), ''); @@ -5288,20 +5215,20 @@ __webpack_require__(854); * of the component's host element. * * @typedef {object} ContextOptions - * @property {Object|undefined} contextId The context id. HTML attribute equivalent: *z-context*. If not specified it will be randomly generated. + * @property {Object|undefined} contextId The context id. HTML attribute equivalent: *z-context*. If not specified it will be randomly generated. HTML attribute equivalent: *z-context*. * @property {Element|undefined} container The container element. - * @property {JSON|undefined} model The data model. HTML attribute equivalent: *z-model*. - * @property {Element|undefined} view The view element. HTML attribute equivalent: *z-view*. + * @property {JSON|undefined} model The data model. HTML attribute equivalent: *z-model*. + * @property {Element|undefined} view The view element. * @property {ContextControllerHandler|undefined} controller The controller handler. - * @property {Object.|Object.|undefined} on The map of event handlers for standard and component's events. An event can also be simply routed to another component's event by specifying the mapped event name string. - * @property {Object.|Object.|undefined} behavior The map of event handlers for behaviors. An event can also be simply routed to another component's event by specifying the mapped event name string. + * @property {Object.|Object.|undefined} on The map of event handlers for standard and component's events. An event can also be simply routed to another component's event by specifying the mapped event name string. HTML attribute equivalent: *z-on*. + * @property {Object.|Object.|undefined} behavior The map of event handlers for behaviors. An event can also be simply routed to another component's event by specifying the mapped event name string. HTML attribute equivalent: *z-behavior*. * @property {HTMLStyleElement|string|boolean|undefined} css Custom stylesheet to apply to the component's view. * @property {boolean|undefined} encapsulation Whether to use style encapsulation or not (**default:** false). * @property {boolean|undefined} resetCss Whether to reset view style to prevent inheriting from parent containers (**default:** false). * @property {string|undefined} cext When loading content of the view, appends the specified extension instead of *.html*. - * @property {boolean|undefined} html Enables or disables HTML template loading (**default:** true). - * @property {boolean|undefined} lazyLoad Enables or disables lazy-loading (**default:** false). - * @property {number|undefined} priority Loading priority (**default:** 0). + * @property {boolean|string|undefined} html It can be set to `false`, to disable HTML template loading, or it can be set to a string containing the inline HTML template code. + * @property {boolean|undefined} lazyLoad Enables or disables lazy-loading (**default:** false). HTML attribute equivalent: *z-lazy*. + * @property {number|undefined} priority Loading priority (**default:** 0). HTML attribute equivalent: *z-priority*. * @property {ContextLoadedCallback|undefined} ready The loaded callback, triggered once the component is successfully loaded. * @property {ContextReadyCallback|undefined} ready The ready callback, triggered once all component's dependencies have been loaded. * @property {ContextErrorCallback|undefined} error The error callback, triggered when an error occurs. @@ -5382,6 +5309,8 @@ let _contextSeqNum = 0; let _disableComponentize = false; /** @private */ const _objectObserver = new ObjectObserver(); +/** @private */ +const _componentReadyCallbackDelay = 10; /** @private */ const _implicitLoadDefaultList = [ @@ -5418,7 +5347,7 @@ function Zuix() { 'baseUrl': '/', 'resourcePath': '/app/', 'libraryPath': { - '@lib': 'https://zuixjs.github.io/zkit/lib/1.1/', + '@lib': 'https://zuixjs.github.io/zkit/lib/1.2/', '@hgui': 'https://genielabs.github.io/homegenie-web-ui/app/', '@cdnjs': 'https://cdnjs.cloudflare.com/ajax/libs/' }, @@ -5426,7 +5355,7 @@ function Zuix() { 'zuixjs.github.io': { 'resourcePath': '/zuixjs/app', 'libraryPath': { - '@lib': 'https://zuixjs.github.io/zkit/lib/1.1/', + '@lib': 'https://zuixjs.github.io/zkit/lib/1.2/', '@hgui': 'https://genielabs.github.io/homegenie-web-ui/app/', '@cdnjs': 'https://cdnjs.cloudflare.com/ajax/libs/' } @@ -5450,10 +5379,10 @@ function Zuix() { }); contextData[field] = $el.value(); }, + // TODO: deprecate '@on` handler, use `()=""` instead 'on': function($view, $el, lastResult, refreshCallback, attributeName) { - const handlerArgs = zuix.parseAttributeArgs(attributeName, $el, $view, lastResult); const code = $el.attr(attributeName); - const eventName = handlerArgs.slice(1).join(':'); + const eventName = attributeName.split(':').slice(1).join(':'); $el.on(eventName, function(e) { const eventHandler = zuix.runScriptlet(code, $el, $view); if (typeof eventHandler === 'function') { @@ -5633,13 +5562,13 @@ function load(componentId, options) { }*/ } - if (util.isFunction(options.ready)) { + if (options.ready) { ctx.ready = options.ready; } - if (util.isFunction(options.loaded)) { + if (options.loaded) { ctx.loaded = options.loaded; } - if (util.isFunction(options.error)) { + if (options.error) { ctx.error = options.error; } @@ -5707,9 +5636,6 @@ function loadResources(ctx, options) { ctx.view(cachedComponent.view); _log.t(ctx.componentId+':html', 'component:cached:html'); } - /* - TODO: CSS caching, to be tested. - */ if (options.css !== false && typeof options.css !== 'string') { options.css = false; if (!cachedComponent.css_applied) { @@ -5739,7 +5665,7 @@ function loadResources(ctx, options) { }, error: function(err) { _log.e(err, ctx); - if (util.isFunction(options.error)) { + if (options.error) { (ctx.error).call(ctx, err, ctx); } } @@ -5801,21 +5727,6 @@ function loadComponent(elements, componentId, type, options) { * @param {ZxQuery} el */ const load = function(el) { - let sr = el.get().shadowRoot; - if (sr == null && options && options.container instanceof ShadowRoot) { - sr = options.container; - } - if (sr) { - const shadowView = document.createElement('div'); - sr.appendChild(shadowView); - Array.from(el.get().childNodes).map(function(el) { - shadowView.appendChild(el); - }); - if (options && options.container) { - options.container = shadowView; - } - el = z$(shadowView); - } el.attr(_optionAttributes.zLoad, componentId); if (type) { el.attr(type, ''); @@ -5826,7 +5737,37 @@ function loadComponent(elements, componentId, type, options) { } return false; } - return _componentizer.loadInline(el, options); + // Shadow root check + let sr = el.get().shadowRoot; + if (sr == null && options && options.container instanceof ShadowRoot) { + sr = options.container; + delete options.container; + } else if (sr && options) { // mode = 'open' + delete options.container; + } + if (sr) { + const shadowView = document.createElement('div'); + // move attributes to shadow view + Array.from(el.get().attributes).forEach((attribute) => { + if (!attribute.nodeName.match(/^[(#@)]/)) { + shadowView.setAttribute(attribute.nodeName, attribute.nodeValue); + el.attr(attribute.nodeName, null); + } + }); + setTimeout(function() { + // move childNodes to shadow view + while (el.get().firstChild) { + shadowView.appendChild(el.get().firstChild); + } + sr.appendChild(shadowView); + zuix.context(shadowView, (ctx) => { + el.attr('shadow', ctx.contextId); + }); + _componentizer.loadInline(shadowView, options); + }); + } else { + _componentizer.loadInline(el, options); + } }; elements.each(function(i, el, $el) { load($el); @@ -5862,13 +5803,20 @@ function context(contextId, callback) { return false; } }); - if (typeof callback === 'function' && (contextId instanceof Element || contextId instanceof z$.ZxQuery)) { + if (callback && (contextId instanceof Element || contextId instanceof z$.ZxQuery)) { if (context == null || !context.isReady) { - z$(contextId).one('component:loaded', function() { + if (contextId instanceof Element && contextId.getAttribute('shadow')) { + context = zuix.context(contextId.getAttribute('shadow')); + setTimeout(function() { + callback.call(context, context); + }, _componentReadyCallbackDelay); + return context; + } + z$(contextId).one('component:ready', function() { context = zuix.context(this); setTimeout(function() { callback.call(context, context); - }, 10); + }, _componentReadyCallbackDelay); }); } else callback.call(context, context); } @@ -5886,7 +5834,7 @@ function hook(path, handler) { delete _hooksCallbacks[path]; } else { if (_hooksCallbacks[path]) { - _log.w('Overwritten an already registered hook for', '"' + path + '"', 'OLD HANDLER', _hooksCallbacks[path], 'REPLACED BY', handler); + _log.w('Hook override', '"' + path + '"', 'OLD', _hooksCallbacks[path], 'NEW', handler); } _hooksCallbacks[path] = handler; } @@ -5901,7 +5849,7 @@ function hook(path, handler) { * @param {object|undefined} [data] */ function trigger(context, path, data) { - if (util.isFunction(_hooksCallbacks[path])) { + if (_hooksCallbacks[path]) { _hooksCallbacks[path].call(context, data, context); } } @@ -5913,11 +5861,11 @@ function setComponentCache(cache) { _componentCache = cache; } -/** @private */ -function removeCachedComponent(componentId) { - // TODO: removeCachedComponent - // TODO: should this be called when last instance of a component type is disposed? -} +///** @private */ +//function removeCachedComponent(componentId) { +// TODO: removeCachedComponent +// TODO: should this be called when last instance of a component type is disposed? +//} /** * @private @@ -5947,7 +5895,7 @@ function loadController(context, task) { if (!util.isNoU(task)) { task.step(context.componentId+':js'); } - if (util.isFunction(_globalControllerHandlers[context.componentId])) { + if (_globalControllerHandlers[context.componentId]) { context.controller(_globalControllerHandlers[context.componentId]); createComponent(context, task); } else { @@ -5969,14 +5917,14 @@ function loadController(context, task) { } } catch (e) { _log.e(new Error(), e, ctrlJs, context); - if (util.isFunction(context.error)) { + if (context.error) { (context.error).call(context, e, context); } } }, error: function(err) { _log.e(err, new Error(), context); - if (util.isFunction(context.error)) { + if (context.error) { (context.error).call(context, err, context); } }, @@ -6038,12 +5986,12 @@ function createComponent(context, task) { } _log.d(context.componentId, 'component:initializing'); - if (util.isFunction(context.controller())) { + if (context.controller()) { // TODO: should use 'require' instead of 'new Controller' ... ? /** @type {ContextController} */ const c = context._c = new ContextController(context); c.log = __webpack_require__(381)(context.contextId); - if (typeof c.init === 'function') { + if (c.init) { c.init(); } const endTask = function() { @@ -6081,6 +6029,9 @@ function createComponent(context, task) { const loadViewTask = function() { if (context.options().html !== false) { + if (typeof context.options().html === 'string') { + cached.view = context.options().html; + } if (cached.view == null) { context.loadHtml({ cext: context.options().cext, @@ -6090,7 +6041,7 @@ function createComponent(context, task) { }, error: function(err) { _log.e(err, context); - if (util.isFunction(context.options().error)) { + if (context.options().error) { (context.options().error).call(context, err, context); } }, @@ -6168,14 +6119,14 @@ function initController(ctrl) { // tender lifecycle moments const $view = ctrl.view(); - if (util.isFunction(ctrl.create)) { + if (ctrl.create) { ctrl.create(); } ctrl.trigger('view:create', $view); const contextLoaded = function() { // set component loaded - if (util.isFunction(ctx.loaded)) { + if (ctx.loaded) { (ctx.loaded).call(ctx, ctx); } @@ -6205,8 +6156,86 @@ function initController(ctrl) { ctrl.trigger('component:loaded', $view, true); const contextReady = function() { + // parse option attributes + const attributesList = [':on', ':model', ':behavior', ':ready']; // these are evaluated after component is created + const optionAttributes = Array.from($view.get().attributes) + .filter((a) => attributesList.find((t) => a.nodeName.startsWith(t))); + optionAttributes.forEach((attribute) => { + const attr = attribute.nodeName; + const isRootOption = attr.lastIndexOf(':') < 2; + let val; + let scriptlet = attribute.nodeValue; + if (!scriptlet.match(/^[^<>()\[\]\-+\s!?/&£"=^#@:;,.*|]+$/g)) { + scriptlet = `(event, args) => \{ ${attribute.nodeValue} \}`; + } + if (attr.startsWith(':model') || isRootOption) { + scriptlet = `(${attribute.nodeValue})`; + } + try { + val = zuix.runScriptlet(scriptlet, $view, $view, null); + } catch (e) { + _log.warn(attr, attribute.nodeValue, e); + } + if (val == null) return; // TODO: should report a warning? + if (attr === ':ready') { + ctx.ready = val; + return; + } + if (attr.startsWith(':on') || attr.startsWith(':behavior')) { + if (isRootOption) { + ctrl.on(val); + return; + } + const eventName = attr.substring(attr.indexOf(':', 1) + 1); + if (attr.startsWith(':behavior')) { + ctrl.addBehavior(eventName, val); + } else { + ctrl.addEvent(eventName, val); + } + } else if (attr.startsWith(':model')) { + if (isRootOption) { + ctx.model(val); + return; + } + const path = attr.match(/[^:]+/g).splice(1); + let co = ctx.model(); + path.forEach((p, i) => { + p = util.hyphensToCamelCase(p); + if (i === path.length - 1) { + return co[p] = val; + } + co = co[p] = co[p] || {}; + }); + } + }); + // parse and allocate inline event handlers + const allocateEventHandlers = function(ctx, $el) { + Array.from($el.get().attributes).forEach((attribute) => { + const attr = attribute.nodeName; + if (attr.startsWith('(') && attr.endsWith(')')) { + let scriptlet = attribute.nodeValue; + if (!scriptlet.match(/^[^<>()\[\]\-+\s!?/&£"=^#@:;,.*|]+$/g)) { + scriptlet = `(event, args) => \{ ${attribute.nodeValue} \}`; + } + const eventName = attr.substring(1, attr.length - 1); + const handler = zuix.runScriptlet(scriptlet, $el, $view, null); + if ($el === $view) { + ctx.on(eventName, handler); + } else { + $el.on(eventName, handler); + } + } + }); + }; + if (zuix.context($view) === ctx) { + $view.find('*').each(function(i, el, $el) { + if (isDirectComponentElement($view, $el)) { + allocateEventHandlers(ctx, $el); + } + }); + } // set component ready - if (util.isFunction(ctx.ready)) { + if (ctx.ready) { (ctx.ready).call(ctx, ctx); } ctrl.trigger('component:ready', $view, true); @@ -6229,7 +6258,7 @@ function initController(ctrl) { if (!activeTagHandler) { activeTagHandler = globalHandlers[handlerName]; } - if (typeof activeTagHandler === 'function') { + if (activeTagHandler) { const h = zuix.activeRefresh($view, $el, ctrl.model(), function($v, $element, data, refreshCallback) { // TODO: should `$v` and/or `$element` be passed here? const runActiveTagHandler = function() { @@ -6285,17 +6314,19 @@ function initController(ctrl) { code += 'let _' + f + ' = null; zuix.context(' + f + ', function(c) { _' + f + ' = c; });'; }); } - code += 'function runScriptlet($el, s, args) { let result; try { result = eval("const $this = $el; const _this = zuix.context(this); " + s) } catch (e) { console.error(\'SCRIPTLET ERROR\', e, s); }; return result };'; + code += 'function runScriptlet($el, s, args) { let result; try { result = eval("const $this = $el; let _this = null; zuix.context(this, (ctx) => _this = ctx); " + s) } catch (e) { console.error(\'SCRIPTLET ERROR\', e, s); }; return result };'; // add custom "jscript" code / collects "using" components const usingComponents = []; let userCode = ''; usingComponents.push(contextId); // map contextId to a local variable viewRefreshScript.each(function(i, el, $el) { - if ($el.attr('using') != null) { - usingComponents.push(...$el.attr('using').split(',')); - } - if ($el.parent().get() === $view.get() || $el.attr('for') === contextId) { - userCode += $el.html() + ';'; + if (zuix.context($view) === ctx) { + if ($el.attr('using') != null) { + usingComponents.push(...$el.attr('using').split(/[\s|,]+/g)); + } + if ($el.parent().get() === $view.get() || $el.attr('for') === contextId) { + userCode += $el.html() + ';'; + } } }); @@ -6304,10 +6335,11 @@ function initController(ctrl) { let waitingComponents = ''; usingComponents.forEach(function(cid) { const ctxVarName = util.hyphensToCamelCase(cid); + const varDeclarations = 'let ' + ctxVarName + ' = window["' + ctxVarName + '"]; if (' + ctxVarName + ' == null) { ' + ctxVarName + ' = zuix.context("' + cid + '"'; if (ctx._dependencyResolver !== false) { - componentsResolve += 'let ' + ctxVarName + ' = window["' + ctxVarName + '"]; if (' + ctxVarName + ' == null) { ' + ctxVarName + ' = zuix.context("' + cid + '", function(ctx) { ' + ctxVarName + ' = ctx; }); }'; + componentsResolve += varDeclarations + ', function(ctx) { ' + ctxVarName + ' = ctx; }); }'; } else { - componentsResolve += 'let ' + ctxVarName + ' = window["' + ctxVarName + '"]; if (' + ctxVarName + ' == null) { ' + ctxVarName + ' = zuix.context("' + cid + '"); }'; + componentsResolve += varDeclarations + '); }'; } waitingComponents += ctxVarName + ' && '; }); @@ -6337,11 +6369,11 @@ function initController(ctrl) { } } // call refresh method for the first time, if found - if (refreshHandler.refresh) { - refreshHandler.refresh(); + if (!ctx._dependencyResolver && refreshHandler.refresh) { + ctx._refreshHandler.refresh(); } // Active-Refresh callback to request a new refresh in 100ms - if (typeof refreshCallback === 'function') { + if (refreshCallback) { refreshCallback(contextData); } } @@ -6351,15 +6383,18 @@ function initController(ctrl) { // Allocate refresh handlers const allocated = []; $view.find('*').each(function(i, el, $el) { - if (!isDirectComponentElement($view, $el)) return; + if ( + !isDirectComponentElement($view, $el) || + (zuix.context($view) !== ctx) + ) return; allocated.push(...allocateRefreshHandlers($view, $el)); }); // Allocate main component's 'refresh' handler // if there is the JScript or any '@' handler if (allocated.length > 0 || viewRefreshScript.length() > 0) { - const refreshDelay = viewRefreshScript.length() > 0 ? viewRefreshScript.attr('refreshDelay') : null; - const handlersDelay = viewRefreshScript.length() > 0 ? viewRefreshScript.attr('handlersDelay') : null; + const refreshDelay = viewRefreshScript.length() > 0 ? viewRefreshScript.attr('refreshdelay') : null; + const handlersDelay = viewRefreshScript.length() > 0 ? viewRefreshScript.attr('handlersdelay') : null; // init refresh handler / first paint ctx.handlers.refresh.call($view.get(), $view, $view, ctrl.model(), function(contextData, delay) { zuix.activeRefresh($view, $view, contextData, function($v, $element, data, refreshCallback) { @@ -6371,7 +6406,7 @@ function initController(ctrl) { return loadedNested; } }); - const canStart = ctx._refreshHandler.ready() && ctx.isReady === true && loadedNested; + const canStart = loadedNested && ctx.isReady === true && ctx._refreshHandler.ready(); if (canStart) { ctx._refreshHandler.initialized = true; // start '@' handlers @@ -6383,7 +6418,7 @@ function initController(ctrl) { } else if (!ctx.$.hasClass('not-ready')) { ctx.$.addClass('not-ready'); } - refreshCallback(data); + refreshCallback(data, refreshDelay, true); } else { ctx.handlers.refresh.call($view.get(), $view, $view, data, refreshCallback); } @@ -6640,7 +6675,7 @@ Zuix.prototype.createComponent = function(componentId, options) { options.contextId = 'zuix-ctx-' + (++_contextSeqNum); } if (context(options.contextId) != null) { - throw new Error('Context arelady exists.'); + throw new Error('Context already exists.'); } else { options.container = document.createElement('div'); options.componentId = componentId; @@ -6758,101 +6793,113 @@ Zuix.prototype.using = function(resourceType, resourcePath, callback, ctx) { resourceType = resourceType.toLowerCase(); const hashId = resourceType + '-' + resourcePath.hashCode(); - if (resourceType === 'component') { - const c = context(hashId); - if (c == null) { - zuix.load(resourcePath, { - contextId: hashId, - view: '', - priority: -10, - ready: function(ctx) { - if (typeof callback === 'function') { - callback(resourcePath, ctx); - } - }, - error: function() { - if (typeof callback === 'function') { - callback(resourcePath, null); + taskQueue('resource-loader').queue(hashId, function() { + const task = resourceLoadTask[hashId] = this; + if (resourceType === 'component') { + const c = context(hashId); + if (c == null) { + zuix.load(resourcePath, { + contextId: hashId, + view: '', + priority: -10, + ready: function(componentContext) { + task.end(); + if (callback) { + callback(resourcePath, componentContext); + } + }, + error: function() { + task.end(); + if (callback) { + callback(resourcePath, null); + } } - } - }); - } else if (typeof callback === 'function') { - // already loaded - callback(resourcePath, c); - } - } else { - const isCss = (resourceType === 'style'); - if (z$.find(resourceType + '[id="' + hashId + '"]').length() === 0) { - const container = ctx ? util.dom.getShadowRoot(ctx.container()) : null; - const head = container || document.head || document.getElementsByTagName('head')[0]; - const resource = document.createElement(resourceType); - if (isCss) { - resource.type = 'text/css'; - resource.id = hashId; + }); } else { - resource.type = 'text/javascript'; - resource.id = hashId; + // already loaded + task.end(); + if (callback) { + callback(resourcePath, c); + } } - head.appendChild(resource); + } else { + const isCss = (resourceType === 'style'); + if (z$.find(resourceType + '[id="' + hashId + '"]').length() === 0) { + const container = isCss && ctx ? util.dom.getShadowRoot(ctx.view()) : null; + const head = container || document.head || document.getElementsByTagName('head')[0]; + const resource = document.createElement(resourceType); + if (isCss) { + resource.type = 'text/css'; + resource.id = hashId; + } else { + resource.type = 'text/javascript'; + resource.id = hashId; + } + head.appendChild(resource); - // TODO: add logging - const addResource = function(text) { // TODO: add logging - if (isCss) { - if (resource.styleSheet) { - resource.styleSheet.cssText = text; + const addResource = function(text) { + // TODO: add logging + if (isCss) { + if (resource.styleSheet) { + resource.styleSheet.cssText = text; + } else { + resource.appendChild(document.createTextNode(text)); + } } else { - resource.appendChild(document.createTextNode(text)); + if (resource.innerText) { + resource.innerText = text; + } else { + resource.appendChild(document.createTextNode(text)); + } } - } else { - if (resource.innerText) { - resource.innerText = text; - } else { - resource.appendChild(document.createTextNode(text)); + task.end(); + if (callback) { + callback(resourcePath, hashId); } + }; + + const cid = '_res/' + resourceType + '/' + hashId; + const cached = getCachedComponent(cid); + if (cached != null) { + addResource(isCss ? cached.css : cached.controller); + } else { + z$.ajax({ + url: resourcePath, + success: function(resText) { + // TODO: add logging + /** @type {ComponentCache} */ + const cached = { + componentId: cid, + view: null, + css: isCss ? resText : null, + controller: !isCss ? resText : null, + using: resourcePath + }; + _componentCache.push(cached); + addResource(resText); + }, + error: function() { + // TODO: add logging + head.removeChild(resource); + task.end(); + if (callback) { + callback(resourcePath); + } + } + }); } + } else { + // TODO: add logging + // console.log('Resource already added ' + hashId + '(' + resourcePath + ')'); + task.end(); if (callback) { callback(resourcePath, hashId); } - }; - - const cid = '_res/' + resourceType + '/' + hashId; - const cached = getCachedComponent(cid); - if (cached != null) { - addResource(isCss ? cached.css : cached.controller); - } else { - z$.ajax({ - url: resourcePath, - success: function(resText) { - // TODO: add logging - /** @type {ComponentCache} */ - const cached = { - componentId: cid, - view: null, - css: isCss ? resText : null, - controller: !isCss ? resText : null, - using: resourcePath - }; - _componentCache.push(cached); - addResource(resText); - }, - error: function() { - // TODO: add logging - head.removeChild(resource); - if (callback) { - callback(resourcePath); - } - } - }); - } - } else { - // TODO: add logging - // console.log('Resource already added ' + hashId + '(' + resourcePath + ')'); - if (callback) { - callback(resourcePath, hashId); } } - } + }); + return this; }; /** @@ -6969,7 +7016,7 @@ Zuix.prototype.bundle = function(bundleData, callback) { const ll = _componentizer.lazyLoad(); _componentizer.lazyLoad(false); _componentizer.componentize(); - if (typeof callback === 'function') { + if (callback) { const waitLoop = function(w) { setTimeout(function() { if (_componentizer.willLoadMore()) { @@ -7042,8 +7089,7 @@ Zuix.prototype.resolveImplicitLoad = function(element) { // Resolve implicit loadable component const notLoad = util.dom.cssNot(_optionAttributes.zLoad).get(); const notReady = util.dom.cssNot(_optionAttributes.zReady).get(); - const implicitDefault = _implicitLoadDefaultList.join(',') - .split(',') + const implicitDefault = _implicitLoadDefaultList .map(function(a) { return a + notLoad + notReady; }).join(','); @@ -7071,23 +7117,6 @@ Zuix.prototype.runScriptlet = function(scriptCode, $el, $view, data) { return ctx._refreshHandler.runScriptlet.call($el.get(), $el, scriptCode, data); } }; -/** - * // TODO: document method - * - * @param attributeName - * @param $el - * @param $view - * @param contextData - * @return {unknown[]} - */ -Zuix.prototype.parseAttributeArgs = function(attributeName, $el, $view, contextData) { - return attributeName.split(':').map(function(a) { - if (a.startsWith('{') && a.endsWith('}')) { - return zuix.runScriptlet(util.hyphensToCamelCase(a), $el, $view, contextData); - } - return a; - }); -}; // member to expose utility class // TODO: document this with JSDocs @@ -7122,7 +7151,7 @@ module.exports = function() { } // log messages monitor (one global listener) _log.monitor(function(level, args) { - if (util.isFunction(zuix.monitor)) { + if (zuix.monitor) { zuix.monitor(level, Array.prototype.slice.call(args)); } }); diff --git a/docs/js/zuix/zuix.min.js b/docs/js/zuix/zuix.min.js index d3e4210..5434646 100644 --- a/docs/js/zuix/zuix.min.js +++ b/docs/js/zuix/zuix.min.js @@ -1,4 +1,4 @@ -/* zuix.js v1.1.6 22.05.26 17:50:11 */ +/* zuix.js v1.1.7 22.06.06 23:17:57 */ /*! For license information please see zuix.min.js.LICENSE.txt */ -var zuix;!function(){var t={381:function(t){"use strict";const e=["log","info","warn","error","debug","trace","dir","group","groupCollapsed","groupEnd","time","timeEnd","profile","profileEnd","dirxml","assert","count","markTimeline","timeStamp","clear"],n="background-color:rgba(200,200,200,0.2);";let o=null,i=null,s=null;function r(t){o=window?window.console:{},i=window||{},this._timers={},this.args=function(t,e,o){let i="%c "+e+" %c"+(new Date).toISOString()+" %c"+t;const s=[n+"color:#8a53ff;",n+"color:#777777",n+"color:#888888;"];for(let t=0;t200?s.push(n+"color:#ff0000;"):t>100?s.push(n+"color:#ff7700;"):s.push(n+"color:#00aa00;")}}}i+=" \n%c ",s.push("background-color:transparent;color:inherit;");for(let t=s.length-1;t>=0;t--)Array.prototype.unshift.call(o,s[t]);Array.prototype.unshift.call(o,i),Array.prototype.push.call(o,"\n\n")},this.log=function(e,n){"function"==typeof s&&s.call(t,e,n),(i.__zuix__debug||"ERROR"===e||"WARN"===e)&&(this.args(t,e,n),o.log(...n))}}r.prototype.monitor=function(t){s=t},r.prototype.console=function(t){if(t)window.console=o;else{window.console={};for(let t=0;te.priority?1:e.priority>t.priority?-1:0})),e.taskCheck()},e.taskCheck=function(){for(let n=0;n"}return n},cloneObject:function t(e){if(null===e||"object"!=typeof e)return e;let n=e;try{n=e.constructor();for(const o in e)e.hasOwnProperty(o)&&(n[o]=t(e[o]))}catch(t){}return n},hasPassiveEvents:function(){let t=!1;try{const e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassive",null,e),window.removeEventListener("testPassive",null,e)}catch(t){}return t},hyphensToCamelCase:function(t){return t.replace(/-([a-z0-9_$-])/g,(function(t){return"_$-".indexOf(t[1])>-1||(+t[1]).toString()===t[1]?"_"+t[1].replace("-","_"):t[1].toUpperCase()}))},camelCaseToHyphens:function(t){return(t=t.replace(/(^\w)|(\s+\w)/g,(function(t){return t.toUpperCase()})).replace(/\s/g,"")).split(/(?=[A-Z])/).join("-").toLowerCase()},normalizeControllerCode:function(t){if(t.indexOf("module.exports")>=0)return"'use strict'; let module = {}; "+t+";\nreturn module.exports;";{let e=t;const n=t.indexOf("function "),o=t.indexOf("zuix.controller"),i=t.indexOf("class ");return i>=0&&(i=0&&(n=e.length||null==t?e[0]:e[t]},getAll:function(t){return i.split(",").join("")}};var i},getShadowRoot:function(t){for(;t;t=t.parentNode)if(t instanceof ShadowRoot)return t;return!1}}}},917:function(t,e,n){"use strict";const o=n(381)("TaskQueue.js"),i=n(826),s=i.hasPassiveEvents(),r=[];function c(t){!function(t,e,n){const o=h(t);h.each(r,(function(){this.element===t&&this.path===e&&this.handler.call(o,n,o)}))}(this,t.type,t)}function l(t,e,n){let o=1,i=-1;h.each(r,(function(s){this.element===t&&this.path===e&&(o--,this.handler===n&&(i=s))})),-1!==i&&r.splice(i,1),0===o&&t.removeEventListener(e,c)}function u(t){if(this._selection=[],void 0===t&&(t=document.documentElement),t instanceof u)return t;if(t instanceof HTMLCollection||t instanceof NodeList){const e=this._selection=[];h.each(t,(function(t,n){e.push(n)}))}else if(Array.isArray(t))this._selection=t;else if(t===window||t instanceof HTMLElement||t instanceof Node)this._selection=[t];else if("string"==typeof t)this._selection=document.documentElement.querySelectorAll(t);else if(null!==t)throw o.e("ZxQuery cannot wrap object of this type.",typeof t,t),new Error("ZxQuery cannot wrap object of this type.");return this}function a(t){return new u(t)}u.prototype.length=function(){return this._selection.length},u.prototype.parent=function(t){return i.isNoU(t)?new u(this._selection[0].parentNode):new u(h.getClosest(this._selection[0],t))},u.prototype.children=function(t){return i.isNoU(t)?new u(this._selection[0].children):new u(this._selection[0].querySelectorAll(t))},u.prototype.reverse=function(){const t=Array.prototype.slice.call(this._selection,0);return this._selection=t.reverse(),this},u.prototype.get=function(t){return i.isNoU(t)&&(t=0),this._selection[t]},u.prototype.eq=function(t){const e=this._selection;let n=e[t];return arguments.length>1&&(n=[],h.each(arguments,(function(t,o){null!=e[o]&&n.push(e[o])}))),new u(n)},u.prototype.prev=function(){return new u(this._selection[0].previousElementSibling)},u.prototype.next=function(){return new u(this._selection[0].nextElementSibling)},u.prototype.index=function(t){const e=this._selection[0];return 1===this.length()&&null==t?Array.from(this.parent().children()._selection).indexOf(e):this.length()>0&&null!=t?this._selection.indexOf(t.get()):-1},u.prototype.find=function(t){return this._selection[0]?new u(this._selection[0].querySelectorAll(t)):new u},u.prototype.each=function(t){return h.each(this._selection,t),this},u.prototype.attr=function(t,e){const n=this;if("object"==typeof t)h.each(t,(function(t,e){n.each((function(n,o){i.dom.setAttribute(o,t,e)}))}));else{if(void 0===e)return i.dom.getAttribute(this._selection[0],t);this.each((function(n,o){i.dom.setAttribute(this.get(),t,e)}))}return this},u.prototype.trigger=function(t,e){let n;return window.CustomEvent?n=new CustomEvent(t,{detail:e}):(n=document.createEvent("CustomEvent"),n.initCustomEvent(t,!0,!0,e)),this.each((function(t,e){e.dispatchEvent(n)})),this},u.prototype.one=function(t,e){const n=this;return"object"==typeof t&&null==e?(h.each(t,(function(t,e){n.one(t,e)})),this):(this.on(t,new function(t,e){let o=!1;return function(i,s){o||(o=!0,h(n).off(t,this),e.call(n,i,s,n))}}(t,e)),this)},u.prototype.on=function(t,e){if("object"==typeof t&&null==e){const e=this;return h.each(t,(function(t,n){e.on(t,n)})),this}const n=t.match(/\S+/g)||[];let i;return"function"!=typeof e&&(i=e,e=i.handler),this.each((function(t,l){h.each(n,(function(t,n){!function(t,e,n,i){let l=!1;h.each(r,(function(){if(this.element===t&&this.path===e&&this.handler===n)return o.w("Handler already registered",t,e,n),l=!0,!1})),l||(r.push({element:t,path:e,handler:n,options:i}),t.addEventListener(e,c,!(!s||null!=i&&!1===i.passive)&&{passive:!0}))}(l,n,e,i)}))})),this},u.prototype.off=function(t,e){if("object"==typeof t&&null==e){const e=this;return h.each(t,(function(t,n){e.off(t,n)})),this}const n=t.match(/\S+/g)||[];return this.each((function(t,o){h.each(n,(function(t,n){l(o,n,e)}))})),this},u.prototype.reset=function(){return this.each((function(t,e){!function(t){h.each(r.slice(),(function(){this.element===t&&(o.t("Removing event handler",this.element,this.path,this.handler),l(this.element,this.path,this.handler))}))}(e)})),this},u.prototype.isEmpty=function(){return 0===this._selection[0].innerHTML.replace(/\s/g,"").length},u.prototype.position=function(){return null!=this._selection[0]?h.getPosition(this._selection[0]):{x:-1,y:-1,visible:!1}},u.prototype.css=function(t,e){const n=this;if("object"==typeof t)h.each(t,(function(t,e){n.each((function(n,o){o.style[t]=e}))}));else{if(i.isNoU(e))return this._selection[0].style[t];n.each((function(n,o){o.style[t]=e}))}return this},u.prototype.addClass=function(t){const e=t.match(/\S+/g)||[];return h.each(this._selection,(function(n,o){o.classList?h.each(e,(function(t,e){o.classList.add(e)})):o.className+=" "+t})),this},u.prototype.hasClass=function(t){return h.hasClass(this._selection[0],t)},u.prototype.removeClass=function(t){const e=t.match(/\S+/g)||[];return h.each(this._selection,(function(n,o){o.classList?h.each(e,(function(t,e){o.classList.remove(e)})):o.className=o.className.replace(new RegExp("(^|\\b)"+t.split(" ").join("|")+"(\\b|$)","gi")," ")})),this},u.prototype.html=function(t){return i.isNoU(t)?this._selection[0].innerHTML:(this.each((function(e,n){n.innerHTML=t})),this)},u.prototype.checked=function(t){if(i.isNoU(t)){const t=this._selection[0].checked;return null!=t&&"false"!=t&&(t||"checked"==t)}return this.each((function(e,n){n.checked=t})),this},u.prototype.value=function(t){return i.isNoU(t)?this._selection[0].value:(this.each((function(e,n){n.value=t})),this)},u.prototype.append=function(t){return"string"==typeof t?this._selection[0].innerHTML+=t:this._selection[0].appendChild(t instanceof u?t.get():t),this},u.prototype.insert=function(t,e){e=e instanceof u?e.get():e;const n=this.children().get(t);return null!==n?this._selection[0].insertBefore(e,n):this._selection[0].appendChild(e),this},u.prototype.prepend=function(t){return"string"==typeof t?this._selection[0].innerHTML=t+this._selection[0].innerHTML:this._selection[0].insertBefore(t instanceof u?t.get():t,this._selection[0].firstElementChild),this},u.prototype.detach=function(){const t=this._selection[0],e=t.parentNode;return null!=e&&(t.__zuix_oldParent=e,t.__zuix_oldIndex=Array.prototype.indexOf.call(e.children,t),e.removeChild(t),o.t("Detached from parent",e,t)),this},u.prototype.attach=function(){const t=this._selection[0];return null!=t.parentNode&&null!=t.__zuix_oldParent&&t.parentNode.removeChild(t),null==t.parentNode&&null!=t.__zuix_oldParent&&(h(t.__zuix_oldParent).insert(t.__zuix_oldIndex,t),t.__zuix_oldParent=null,delete t.__zuix_oldParent,delete t.__zuix_oldIndex),this},u.prototype.display=function(t){return i.isNoU(t)?this._selection[0].style.display:(h.each(this._selection,(function(e,n){n.style.display=t})),this)},u.prototype.visibility=function(t){return i.isNoU(t)?this._selection[0].style.visibility:(h.each(this._selection,(function(e,n){n.style.visibility=t})),this)},u.prototype.show=function(t){return this.display(null==t?"":t)},u.prototype.hide=function(){return this.display("none")},u.prototype.playTransition=function(t){let e=t.classes;"string"==typeof t?(e=t.split(" "),t={}):Array.isArray(t)&&(e=t,t={});const n=Object.assign({classes:e,target:this,type:"transition"},t);return h.playFx(n),this},u.prototype.playAnimation=function(t){let e=t.classes;"string"==typeof t?(e=t.split(" "),t={}):Array.isArray(t)&&(e=t,t={});const n=Object.assign({classes:e,target:this,type:"animation"},t);return h.playFx(n),this},u.prototype.isPlaying=function(){return this.hasClass("--z-playing")};const h=a;a.find=function(t){return h().find(t)},a.each=function(t,e){const n=null==t?0:Object.keys(t).length;if(n>0){let o=0;for(const i in t)if(t.hasOwnProperty(i)){let s=t[i];if(s instanceof Element&&(s=h(s)),!1===e.call(s,i,t[i],s))break;if(o++,o>=n)break}}return this},a.ajax=a.http=function(t){let e;e=i.isNoU(t)||i.isNoU(t.url)?t:t.url;const n=new XMLHttpRequest;n.onload=function(){200===n.status?i.isFunction(t.success)&&t.success(n.responseText):i.isFunction(t.error)&&t.error(n,n.statusText,n.status),i.isFunction(t.then)&&t.then(n)},n.onerror=function(e,n,o){i.isFunction(t.error)&&t.error(e,n,o)},"function"==typeof t.beforeSend&&t.beforeSend(n);try{n.open("GET",e),n.send()}catch(e){i.isFunction(t.error)&&t.error(n,n.statusText,n.status,e)}return this},a.hasClass=function(t,e){const n=e.match(/\S+/g)||[];let o=!1;return h.each(n,(function(e,n){if(o=t.classList?t.classList.contains(n):new RegExp("(^| )"+n+"( |$)","gi").test(t.className),o)return!1})),o},a.classExists=function(t){const e=t.match(/\S+/g)||[];let n=!1;return h.each(e,(function(t,e){const o=document.styleSheets;if(null!=o)for(let t=0;t1){let e=s[2];if(null!=e&&e.length>0){e=e.replace(/\n/g,"");const o=e.split(",");let i=!1;if(h.each(o,(function(e,s){if("."===s.trim()||":host"===s.trim())r+="\n[z-component]"+t+" ";else if("@"===s.trim()[0])r+=s+" ",(s.trim().toLowerCase().startsWith("@media")||s.trim().toLowerCase().startsWith("@supports"))&&(i=!0);else if(n)s.split(/\s+/).forEach((function(e){(e=e.trim()).lastIndexOf(".")>0?e.replace(/(?=\.)(?![^\[\]()]*(?:\[[^\[\]()]*([\])]))?([\])]))/gi,",").split(",").forEach((function(e){r+=""!==e?e+t:"\n"})):r+=""!==e&&">"!==e&&"*"!==e?"\n"+e+t+" ":e+" "}));else{let e=s.trim();e=e.startsWith(":host")?e.substring(5):"\n"+e,r+="\n[z-component]"+t+e+" "}e1){const t=o[1];let i=e;if(t.indexOf(".")>0){const e=t.split(".");for(let t=0;t0&&(i+=t.substring(r),t=i),t},a.replaceBraces=function(t,e){const n=new RegExp(/{?{.*?}?}/g);let o,s="",r=0,c=0;for(;o=n.exec(t);){if("string"==typeof o[0]&&(0===o[0].trim().length||o[0].indexOf("\n")>=0)){const e=t.substring(c,o.index)+o[0];s+=e,c+=e.length;continue}let n=o[0];if("function"==typeof e){const t=e(o[0]);i.isNoU(t)||(n=t,r++)}s+=t.substring(c,o.index)+n,c=o.index+o[0].length}return r>0?(s+=t.substring(c),s):null},a.getClosest=function(t,e){for(t=t.parentNode;t&&t!==document;t=t.parentNode)if(t.matches&&t.matches(e))return t;return null},a.getPosition=function(t,e){const n="--ui--visible",o=function(){let e=0,n=0;const o=t.getBoundingClientRect();let i=t;for(;i;){if("body"===i.tagName.toLowerCase()){const t=i.scrollLeft||document.documentElement.scrollLeft,o=i.scrollTop||document.documentElement.scrollTop;e+=i.offsetLeft-t+i.clientLeft,n+=i.offsetTop-o+i.clientTop}else e+=i.offsetLeft-i.scrollLeft+i.clientLeft,n+=i.offsetTop-i.scrollTop+i.clientTop;i=i.offsetParent}return{x:e,y:n,rect:o}}();o.visible=!1;let i=t.offsetParent;if(null!=i||"fixed"!==getComputedStyle(t).position&&"absolute"!==getComputedStyle(t).position||(i=document.body),null!=i){if(i!==document.body){let t=i.offsetParent;for(;null!=t&&null!==t.offsetParent&&t.offsetHeight===t.scrollHeight;)t=t.offsetParent;null!=t&&(i=t)}let s=i.getBoundingClientRect();i===document.body&&(s={x:s.x,y:s.y,width:document.documentElement.offsetWidth||document.documentElement.clientWidth,height:document.documentElement.offsetHeight||document.documentElement.clientHeight,top:0,left:0,right:document.documentElement.clientWidth||document.documentElement.offsetWidth,bottom:document.documentElement.clientHeight||document.documentElement.offsetHeight}),null==e&&(e=0);const r=t.getBoundingClientRect();let c=!(r.left-1>s.right-e||r.right+1s.bottom-e||r.bottom+11&&t.classes.shift();n.hasClass("--z-playing")||(n.addClass("--z-playing"),i&&n.addClass(i).css(t.type,"none"));const s=getComputedStyle(n.get()),r=1e3*parseFloat(s[t.type+"-delay"])||i?10:0;let c=!1;const l=function(){c||(c=!0,t.classes.length>1?("function"==typeof t.onStep&&t.onStep.call(n,n,t.classes.slice(1)),e.playFx(t)):(!t.holdState&&t.classes.length>0&&n.removeClass(t.classes.shift()),n.removeClass("--z-playing"),"function"==typeof t.onEnd&&t.onEnd.call(n,n)))},u=function(){i&&n.css(t.type,"").removeClass(i);const e=t.classes[0];e&&n.addClass(e),t.options&&h.each(t.options,(function(e,o){n.css(t.type+"-"+e,o)}));const o=1+(parseFloat(s[t.type+"-iteration-count"])||0),r=1e3*parseFloat(s[t.type+"-duration"])*o;setTimeout(l,r)};n.on(t.type+"end",(function(e){e.target===t.target.get()&&(n.off(t.type+"end",this),l())})),r>0?setTimeout(u,r):u()},a.ZxQuery=u,String.prototype.hashCode=function(){let t=0;if(0===this.length)return t;for(let e=0;e0?(setTimeout((function(){i.requestRefresh(t,e,i.contextData)}),c?i.refreshMs:500),s=!0):null==l&&i.stop()};c?(e._refreshActive||(e._refreshActive=!0,e.trigger("refresh:active")),o(t,e,n,(function(t,e,n){l(t,e,n)}))):(e._refreshActive&&(e._refreshActive=!1,e.trigger("refresh:inactive")),l(i.contextData))}}e.prototype.stop=function(){this.pause(),this.refreshMs=0,this.stopped=!0},e.prototype.start=function(t){if(this.refreshMs=t||this.refreshMs,this.started)return this.resume();this.started=!0,this.requestRefresh(this.$view,this.$element,this.contextData)},e.prototype.pause=function(){this.paused=!0},e.prototype.resume=function(){this.paused=!1},t.exports=e},854:function(t){t.exports=function(){}},622:function(t,e,n){"use strict";const o=n(381)("ComponentContext.js"),i=n(541),s=n(917),r=n(826),c=n(643);let l=null;const u=[],a=[];function h(t,e){e=e.observableTarget||e;const n=r.isNoU(e.value)?r.isNoU(e.innerHTML)?e:e.innerHTML:e.value;switch(t.tagName.toLowerCase()){case"img":t.src=r.isNoU(e.src)?r.isNoU(e.innerHTML)?e:e.innerHTML:e.src;break;case"a":t.href=r.isNoU(e.href)?r.isNoU(e.innerHTML)?e:e.innerHTML:e.getAttribute("href"),r.isNoU(e.href)||r.isNoU(e.innerHTML)||""===e.innerHTML.trim()||0===s(e).find(r.dom.queryAttribute(i.zField)).length()&&s(t).html("").append(document.createTextNode(e.innerHTML));break;case"input":switch(t.type){case"checkbox":case"radio":t.value==n&&(t.checked=!0);break;default:t.value=n}break;case"select":s.each(t.options,(function(e,o){if(o.value==n)return t.selectedIndex=e,!1}));break;default:const o=r.isNoU(e.innerHTML)?document.createTextNode(e):e.innerHTML;s(t).html("").append(o)}}function d(t,e,n){return l=t,this._options=null,this.contextId=null==e||null==e.contextId?null:e.contextId,this.componentId=null,this.handlers={refresh:function(t,e,n,o){}},this.trigger=function(t,e,o){"function"==typeof n&&n(t,e,o)},this._container=null,this._model=null,this._view=null,this._css=null,this._style=null,this._controller=null,this.behavior=null,this._eventMap=[],this._behaviorMap=[],this._fieldCache=[],this._c=null,this._modelListener=Object.assign({context:null,get:function(t,e,n,o){},set:function(t,e,n,o,c){t instanceof Element&&(o=o.split(".")[0],n=t);const l=s(this.context.view());if(l.get()){let s=l.find(r.dom.queryAttribute(i.zBind,o));null!=s.get()&&s.each((function(t,e){h(e,n)})),s=l.find(r.dom.queryAttribute(i.zField,o)),null!=s.get()&&s.each((function(t,e){h(e,n)})),this.context._c&&"function"==typeof this.context._c.update&&this.context._c.update(t,e,n,o,c)}}},{context:this}),this._viewObserver=new c(this),this._disposed=!1,this.options(e),this}d.prototype.dispose=function(){if(this._disposed)return;this._disposed=!0,this._viewObserver.stop(),r.isNoU(this._c)||(r.isNoU(this._c.view())||(this._c.trigger("component:dispose",this._c.view(),!0),this._c.view().attr(i.zComponent,null).attr(i.zContext,null).attr(i.zLoad,null).attr(i.zLoaded,null).attr(i.zReady,null).attr(i.resourceType.view,null).attr(i.resourceType.controller,null).attr(i.resourceType.file,null).attr(this.getCssId(),null),this._c.view().reset(),r.isNoU(this._c._fieldCache)||s.each(this._c._fieldCache,(function(t,e){e.reset()}))),r.isFunction(this._c.dispose)&&this._c.dispose.call(this,this)),this.model(null),!r.isNoU(this._c)&&this._c._childNodes.length>0&&(this._c.view().html(""),this._c.restoreView());const t=l.dumpContexts(),e=t.indexOf(this);t.splice(e,1)},d.prototype.container=function(t){return null==t?this._container:(t instanceof s.ZxQuery&&(t=t.get()),this._container=t,this)},d.prototype.view=function(t){if(void 0===t)return this._view;if(null===t)throw new Error("View cannot be set to null.");if(t instanceof s.ZxQuery&&(t=t.get()),t===this._view)return this;this._viewObserver.stop();const e=this.getCssId();if(null!=this._view){const t="*"+r.dom.cssNot(i.zLoad).getAll()+r.dom.cssNot(i.zInclude).getAll();s(this._view).attr(e,null).find(t).each((function(t,n){this.attr(e,null)}))}const n=function(t){t.find("*").each((function(t,e,n){for(let t=0;t1&&s.startsWith("#")&&(null==n.attr(i.zField)&&n.attr(i.zField,s.substring(1)),null==n.attr(i.zBind)&&null!=o.value&&o.value.length>0&&n.attr(i.zBind,o.value))}}))};if(o.t(this.componentId,"view:attach","timer:view:start"),"string"==typeof t){const e={content:t};this.trigger(this,"html:parse",e),t=e.content;const o=s.wrapElement("div",t);null!=o.firstElementChild&&(null!=r.dom.getAttribute(o.firstElementChild,i.zView)?1===o.children.length&&(t=o.firstElementChild.innerHTML):t=o.innerHTML),null!=this._container?(this._view=this._container,this._view.innerHTML+=t):null!=this._view?this._view.innerHTML=t:this._view=o;const c=s(this._view);c.find("script:not([type=jscript])").each((function(t,e){"true"!==this.attr(i.zuixLoaded)&&(this.attr(i.zuixLoaded,"true"),Function(e.innerHTML).call(window))})),n(c),this.trigger(this,"view:process",c)}else null!=this._container&&"default"!==this.componentId?(this._view=s.wrapElement("div",t.outerHTML).firstElementChild,r.dom.setAttribute(this._view,i.zView,null),this._container.appendChild(this._view),this._view=this._container):this._view=t;const c=s(this._view);return n(c),c.find(r.dom.queryAttribute(i.zLoad,null,r.dom.cssNot(i.zLoaded))).each((function(t,e){this.attr(i.zLoaded,"false")})),this.checkEncapsulation(),this.modelToView(),o.t(this.componentId,"view:attach","timer:view:stop"),this},d.prototype.field=function(t){const e=this,n=l.field(t,this._view,this);return n.on=function(t,n,o,i){if("string"==typeof n){const t=n;n=function(){e._c&&e._c.trigger(t,o,i)}}return s.ZxQuery.prototype.on.call(this,t,n)},n},d.prototype.checkEncapsulation=function(){const t=s(this._view),e=this.getCssId();if(t.length()>0&&!1!==this._options.css)if(t.attr(e,""),null!=this._container||null!=this._style){const n="*"+r.dom.cssNot(i.zLoad).getAll()+r.dom.cssNot(i.zInclude).getAll();t.find(n).each((function(t,n){this.attr(e,"")})),this._viewObserver.start(),t.attr(i.resourceType.controller,null)}else t.attr(i.resourceType.controller,"")},d.prototype.style=function(t){if(void 0===t)return this._style;const e=this.getCssId();if(o.t(this.componentId,"view:style","timer:view:start",e),null==t||t instanceof Element)this._css=t instanceof Element?t.innerText:t,this._style=s.appendCss(t,this._style,this.componentId+"@"+e,r.dom.getShadowRoot(this._container));else if("string"==typeof t){this._css=t;const n={content:t};this.trigger(this,"css:parse",n),t=n.content;let o="";!0===this.options().resetCss&&(o=":host { all: initial; }");const i="["+e+"]";t=s.wrapCss(i,o+"\n"+t,!0===this.options().encapsulation),this._style=s.appendCss(t,this._style,this.componentId+"@"+e,r.dom.getShadowRoot(this._container))}return this.checkEncapsulation(),o.t(this.componentId,"view:style","timer:view:stop",e),this},d.prototype.model=function(t){return void 0===t||this._model===t||(null!==this._model&&"function"!=typeof this._model&&l.observable(this._model).unsubscribe(this._modelListener),this._model=t,null!=t&&("function"!=typeof t&&(this._model=l.observable(t).subscribe(this._modelListener).proxy),this.modelToView(),null!=this._c&&r.isFunction(this._c.update)&&this._c.update.call(this._c,null,null,null,null,this._c))),this._model},d.prototype.controller=function(t){return void 0===t?this._controller:(this._controller=t,this)},d.prototype.options=function(t){if(null==t)return this._options;const e=this._options=this._options||{};return Object.assign(e,t),this.componentId=e.componentId||this.componentId,null==u[this.componentId]&&(u[this.componentId]=u.length,u.length++),this.container(e.container),this.view(e.view),"string"==typeof e.css&&this.style(e.css),this.controller(e.controller),this.model(e.model),this},d.prototype.on=function(t,e){return this._c.on(t,e),this},d.prototype.loadCss=function(t,e){const n=this;r.isNoU(t)&&(t={}),r.isNoU(t.caching)||t.caching;let i=n.componentId;r.isNoU(t.path)||(i=t.path);let c=l.store("zuix.inlineStyles");if(null==c&&(c=[],l.store("zuix.inlineStyles",c)),null!=c[i])n.style(c[i]),r.isFunction(t.success)&&t.success.call(n,c[i],n),r.isFunction(t.then)&&t.then.call(n,n);else{const e=s().find('style[media="#'+i+'"],style[media="'+i+'"]');if(e.length()>0){const o=e.get(0).innerText;n.style(o),e.detach(),c[i]=o,r.isFunction(t.success)&&t.success.call(n,o,n),r.isFunction(t.then)&&t.then.call(n,n)}else i==n.componentId&&(i+=".css"),s.ajax({url:l.getResourcePath(i),success:function(e){n.style(e),r.isFunction(t.success)&&t.success.call(n,e,n)},error:function(e){o.e(e,n),r.isFunction(t.error)&&t.error.call(n,e,n)},then:function(){r.isFunction(t.then)&&t.then.call(n,n)}})}return this},d.prototype.loadHtml=function(t,e){const n=this;let c=n.componentId;r.isNoU(t)&&(t={}),r.isNoU(t.caching)||t.caching,r.isNoU(t.path)||(c=t.path);let u=l.store("zuix.inlineViews");if(null==u&&(u=[],l.store("zuix.inlineViews",u)),null!=u[c])n.view(u[c]),r.isFunction(t.success)&&t.success.call(n,u[c],n),r.isFunction(t.then)&&t.then.call(n,n);else{const e=s().find(r.dom.queryAttribute(i.zView,c,r.dom.cssNot(i.zComponent)));if(e.length()>0){let o=e.get(0);if("template"===o.tagName.toLowerCase()){o=o.cloneNode(!0);const t=o.content.querySelectorAll("style");if(t)for(const e of t)e.setAttribute("media","#"+n.componentId)}else{const t=o.querySelectorAll('style[media="#"]');if(t)for(const e of t)e.setAttribute("media","#"+n.componentId)}u[c]=o.innerHTML,n.view()===o||null!=n.container()&&n.container().contains(o)?(e.attr(i.zView,null),n._view=o,this.trigger(this,"view:process",s(n.view()))):n.view(o.innerHTML),r.isFunction(t.success)&&t.success.call(n,o.innerHTML,n),r.isFunction(t.then)&&t.then.call(n,n)}else{const e=r.isNoU(t.cext)?".html":t.cext;c==n.componentId&&(c+=e),s.ajax({url:l.getResourcePath(c),success:function(e){n.view(e),r.isFunction(t.success)&&t.success.call(n,e,n)},error:function(e){o.e(e,n),r.isFunction(t.error)&&t.error.call(n,e,n)},then:function(){r.isFunction(t.then)&&t.then.call(n,n)}})}}return this},d.prototype.viewToModel=function(){o.t(this.componentId,"view:model","timer:vm:start");const t={},e=s(this._view);return e.find(r.dom.queryAttribute(i.zField)).each((function(n,o,s){if(!l.isDirectComponentElement(e,s))return!0;const r=this.attr(i.zField);t[r]=o})),this._model=l.observable(t).subscribe(this._modelListener).proxy,o.t(this.componentId,"view:model","timer:vm:stop"),this},d.prototype.modelToView=function(){if(o.t(this.componentId,"model:view","timer:mv:start"),null!=this._view){const t=this;t["#"]={};const e=s(this._view);e.find(r.dom.queryAttribute(i.zField)).each((function(n,o,c){if(!l.isDirectComponentElement(e,c)&&"true"!==c.attr("inherits"))return!0;let u=c.attr(i.zBind);null==u&&(u=c.attr(i.zField));const d=s(t._view);try{const e=r.hyphensToCamelCase(u);Function("function testName(){ const "+e+' = "test"; }'),t["#"][e]=t.field(u)}catch(t){}const p=function(e,n){e&&!t._disposed&&e.call(d,c,n,d,(function(o){if(!t._disposed){const t=c.get().dataset.__zuix_refreshTimeout;t&&a[t]&&clearTimeout(a[t]),c.get().dataset.__zuix_refreshTimeout=setTimeout((function(){p(e,n)}),o||500)}}))};if("function"==typeof t._model)p(t._model,u);else{let e=r.propertyFromPath(t._model,u);const n=r.hyphensToCamelCase(u),i=r.propertyFromPath(t._model,n);null==e&&null!=i&&(u=n,e=r.propertyFromPath(t._model,e)),"function"==typeof e?p(e,u):null!=e&&h(o,e)}}))}return o.t(this.componentId,"model:view","timer:mv:stop"),this},d.prototype.getCssId=function(){let t="";return"string"==typeof this._options.css&&(t="_"+this.contextId),i.cssIdPrefix+u[this.componentId]+t},Object.defineProperty(d.prototype,"path",{get:function(){const t=this.componentId,e=t.lastIndexOf("/");return e<0?t:t.substring(0,e+1)}}),Object.defineProperty(d.prototype,"name",{get:function(){const t=this.componentId,e=t.lastIndexOf("/");return e<0?t:t.substring(e+1)}}),Object.defineProperty(d.prototype,"$",{get:function(){return this._c&&this._c.view()}}),t.exports=d},211:function(t,e,n){"use strict";const o=n(541);_.prototype.componentize=function(t){return g?(r().one("componentize:step",(function(){requestAnimationFrame((function(){g=!1,m.componentize(t)}))})),this):(g=!0,m.trigger(this,"componentize:begin"),m.$().trigger("componentize:begin"),m.resolveImplicitLoad(t),function(t){null==t&&(t=document),c.indexOf(t)||c.push(t)}(t),b(t),this)},_.prototype.applyOptions=function(t,e){return C(t,e),this},_.prototype.loadInline=function(t,e){x(t,e)},_.prototype.resolvePath=function(t){return w(t)},_.prototype.willLoadMore=function(){return l.length>0||c.length>0},_.prototype.lazyLoad=function(t,e){return v(t,e)},_.prototype.dequeue=function(t){for(let e=0;e0&&(t=c.unshift()),t instanceof r.ZxQuery&&(t=t.get());const e=s.dom.queryAttribute(o.zLoad,null,s.dom.cssNot(o.zLoaded))+","+s.dom.queryAttribute(o.zInclude,null,s.dom.cssNot(o.zLoaded));let n=r(t).find(e);n=Array.prototype.slice.call(n._selection);const a=[];for(let t=0;t0?l.shift():null;for(;null!=e&&null!=e.element;){const n=I(e.element);if(v()&&n?(e.lazy=!0,e.visible=r.getPosition(e.element,f).visible):(e.lazy=!1,e.visible=!0),null!=e.element&&e.visible){t={item:e,cancelable:e.lazy};break}if(!(l.length>0))break;e=l.shift()}return t}();null!=e&&null!=e.item&&null!=e.item.element&&(r(e.item.element).one("component:loaded",(function(){m.componentize(e.item.element)})),x(e.item.element))}function x(t,e){const n=r(t);if(null!=n.attr(o.zLoaded)||n.parent("pre,code").length()>0)return!1;n.attr(o.zLoaded,"true");let i=n.attr(o.zOptions);s.isNoU(i)?i=null!=n.get().__zuix_loadOptions?n.get().__zuix_loadOptions:{}:(i=z(t,i),i=s.cloneObject(i)||{}),e&&Object.assign(i,e);const c=n.attr(o.zContext);if(!s.isNoU(c)){const t=m.context(c);null!==t&&(i=t.options()),i.contextId=c}s.isNoU(i.view)&&!n.isEmpty()?(i.view=t,i.viewDeferred=!0):s.isNoU(i.view)&&s.isNoU(i.container)&&n.isEmpty()&&null==n.attr(o.resourceType.controller)&&(i.container=t);let l=n.attr(o.zLoad);if(s.isNoU(l)){const t=n.attr(o.zInclude);if(null==t)return!1;l=w(t),n.attr(o.zInclude,l),n.attr(o.zComponent,null),s.isNoU(i.controller)&&(i.controller=function(){})}else if(l=w(l),n.attr(o.zLoad,l),"default"!==l&&null!==n.attr(o.resourceType.view))n.attr(o.zComponent,null),s.isNoU(i.controller)&&(i.controller=function(){});else if("default"===l||null!==n.attr(o.resourceType.controller)){i.view=i.view||t,i.viewDeferred=!0,i.html=i.html||!1,i.css=i.css||!1;const e=n.children('[media="#"]');e.length()>0&&e.parent().get()===n.get()&&(!1===i.css&&(i.css=""),e.each((function(t,e,n){i.css+="\n"+i.css+n.html()}))),"default"===l&&(i.controller=i.controller||function(){})}const u=n.attr(o.zModel);!s.isNoU(u)&&u.length>0&&(i.model=z(t,u));const a=n.attr(o.zBehavior);!s.isNoU(a)&&a.length>0&&(i.behavior=z(t,a));const h=n.attr(o.zOn);!s.isNoU(h)&&h.length>0&&(i.on=z(t,h));const d=n.attr(o.zPriority);return s.isNoU(d)||(i.priority=+d),m.load(l,i),!0}function w(t){if("@"===t[0]){let e=m.store("config"),n="https://zuixjs.github.io/zkit/lib/";if(null!=e&&null!=e[location.host]&&(e=e[location.host]),null!=e)switch(typeof e.libraryPath){case"object":r.each(e.libraryPath,(function(e,o){return!t.startsWith(e+"/")||(n=o,!1)}));break;case"string":n=e.libraryPath}t=n+t.substring(t.indexOf("/")+1)}return t}function z(t,e){if("string"==typeof e){const n=r(t).parent(s.dom.queryAttribute(o.zLoad));if(n.get()){const o=m.context(n);try{return o._refreshHandler.runScriptlet(t,`[${e}][0]`)}catch(t){}}e=e.trim().startsWith("{")&&e.trim().endsWith("}")?Function("return "+e)():s.propertyFromPath(window,e)}return e}function C(t,e){e=z(t,e),null!=t&&null!=e&&(null!=e.lazyLoad&&s.dom.setAttribute(t,o.zLazy,e.lazyLoad.toString().toLowerCase()),null!=e.contextId&&s.dom.setAttribute(t,o.zContext,e.contextId.toString().toLowerCase()),null!=e.componentId&&s.dom.setAttribute(t,o.zLoad,e.componentId.toString().toLowerCase()))}function L(t){const e={element:t};return a.push(e),e}function I(t){if("false"===s.dom.getAttribute(t,o.zLazy))return!1;let e=function(t){for(let e=0;e100?(o=t,b(e)):(clearTimeout(n),n=setTimeout((function(){b(e)}),150))}))}(0,i)),!0}if("true"===s.dom.getAttribute(t,o.zLazy))return e=L(t),!0}return!1}},561:function(t,e,n){"use strict";const o=n(917),i=n(826);function s(t){const e=this;this._view=null,this.context=t,this._childNodes=[],this.saveView=function(){this.restoreView(),this.view().children().each((function(t,n){e._childNodes.push(n)}))},this.restoreView=function(){this._childNodes.length>0&&(e.view().html(""),o.each(e._childNodes,(function(t,n){e.view().append(n)})),this._childNodes.length=0)},this.on=function(t,n){return"object"==typeof t&&null==n?(o.each(t,(function(t,n){e.on(t,n)})),this):(this.addEvent(t,n),this)},this.mapEvent=function(t,e,n,o){null!=e&&(e.off(n,this.eventRouter),t.push({target:e,eventPath:n,handler:o}),e.on(n,this.eventRouter))},this.eventRouter=function(n){const o=e.view();t._behaviorMap.concat(t._eventMap).forEach((function(t){t.eventPath===n.type&&"function"==typeof t.handler&&t.handler.call(o,n,n.detail,o)}))};const n=t.options();let i=null;if(null!=n.on&&o.each(n.on,(function(t,n){e.addEvent(t,n)})),null!=n.behavior)for(const t in n.behavior)n.behavior.hasOwnProperty(t)&&(i=n.behavior[t],e.addBehavior(t,i));if("function"==typeof(s=t.controller())&&/^\s*class\s+/.test(s.toString())){const e=new(t.controller().bind(this,this));t.controller(e)}else t.controller().call(this,this);var s;return this}s.prototype.addEvent=function(t,e){return this.mapEvent(this.context._eventMap,this.view(),t,e),this},s.prototype.addBehavior=function(t,e){return this.mapEvent(this.context._behaviorMap,this.view(),t,e),this},s.prototype.addTransition=function(t,e,n){const s=this.context.getCssId();this.context.$.attr(s,"");const r="[z-component]["+s+"]";return o.addTransition(this.context.componentId+"@"+s,r,t,e,n,i.dom.getShadowRoot(this.context.container())),this},s.prototype.field=function(t){return this.context.field(t)},s.prototype.clearCache=function(){this.context._fieldCache={}},s.prototype.view=function(t){const e=this;if(null==this.context.view()&&this._view===this.context.view()||(this.clearCache(),this._view=o(this.context.view()),this._view.field=function(t){return e.context.field(t)}),null!=t)return this._view.find(t);if(null!==this._view)return this._view;throw new Error("Not attached to a view yet.")},s.prototype.model=function(t){return null==t?this.context.model():(this.context.model(t),this)},s.prototype.options=function(){return this.context.options()},s.prototype.trigger=function(t,e,n){if(!0===n){let n=this.context.container();null==n&&(n=this.context.view()),null!=n&&o(n).trigger(t,e),this.context.trigger(this.context,t,e)}else this.view().trigger(t,e);return this},s.prototype.expose=function(t,e){const n=this,i=function(t,e){e&&(e.get||e.set)?Object.defineProperty(n.context,t,e):n.context[t]=e};return"object"==typeof t?o.each(t,(function(t,e){i(t,e)})):i(t,e),this},s.prototype.loadCss=function(t){return this.context.loadCss(t),this},s.prototype.loadHtml=function(t){return this.saveView(),this.context.loadHtml(t),this},s.prototype.log={},s.prototype.for=function(t){return this},t.exports=s},871:function(t){"use strict";function e(t){const e=this;t.init=this.onInit.bind(this),t.create=this.onCreate.bind(this),t.dispose=this.onDispose.bind(this),t.update=function(t,n,o,i,s){return e.onUpdate.call(e,t,n,o,i,s)},Object.assign(this,t),Object.assign(this,Object.getPrototypeOf(t))}e.prototype.onInit=function(){},e.prototype.onCreate=function(){},e.prototype.onDispose=function(){},e.prototype.onUpdate=function(t,e,n,o,i){},t.exports=e},541:function(t){const e=Object.freeze({zModel:"z-model",zBind:"z-bind",zBehavior:"z-behavior",zOn:"z-on",zComponent:"z-component",zContext:"z-context",zField:"z-field",zInclude:"z-include",zLazy:"z-lazy",zLoad:"z-load",zLoaded:"z-loaded",zOptions:"z-options",zPriority:"z-priority",zView:"z-view",zuixLoaded:"zuix-loaded",zReady:"z-ready",resourceType:{view:"view",controller:"ctrl",file:"file"},cssIdPrefix:"z-css-"});t.exports=e},643:function(t,e,n){"use strict";const o=n(541),i=n(826);function s(t){const e=this._context=t;this._mutationObserver=null,this._mutationCallback=function(t,n){const s=i.dom.queryAttribute(o.zComponent);for(const n of t)"childList"===n.type&&n.addedNodes.forEach((function(t){if(t instanceof Element){let n=zuix.$(t).parent(s);if(null==n.get())return;if(!1!==e.options().css&&null==n.attr(o.resourceType.controller)){if(n.get()===e._container||n.get()===e._view){let n=!1;for(let e=0;e0){const t=i.split(" as ");i=t[0],s=t[1]}const r=zuix.runScriptlet(i,e,t);r!==n&&(i="const "+s+" = args; "+e.attr("@set"),zuix.runScriptlet(i,e,t,r),n=r),o(n)},set:function(t,e,n,o){e.attr("@get")||(zuix.runScriptlet(e.attr("@set"),e,t),o(n))},"disable-if":function(t,e,n,o){const i=e.attr("@disable-if"),s=zuix.runScriptlet(i,e,t);s!==n&&(e.attr({disabled:s?"":null}),n=s),o(n)},"hide-if":function(t,e,n,o){const i=e.attr("@hide-if"),s=zuix.runScriptlet(i,e,t);s!==n&&(s?e.css({visibility:"hidden"}):e.css({visibility:"visible"}),n=s),o(n)},if:function(t,e,n,o){const i=e.attr("@if"),s=zuix.runScriptlet(i,e,t);s!==n&&(s?zuix.runScriptlet(e.attr("@then"),e,t):zuix.runScriptlet(e.attr("@else"),e,t),n=s),o(n)}}},this._fieldCache=[],this}function E(t){return"function"!=typeof t.for&&(t.for=function(e){return y[e]=t,t}),t}function N(t,e,n){i.isNoU(n)&&(n=this),null==n._fieldCache&&(n._fieldCache={});let o=null;return void 0===n._fieldCache[t]?(o=s(e).find(i.dom.queryAttribute(p.zField,t)+",["+CSS.escape("#"+t)+"]"),null!=o&&o.length()>0&&(n._fieldCache[t]=o,1===o.length()&&i.isNoU(o.field)&&(o.field=function(t){return N(t,o,o)}))):o=n._fieldCache[t],o}function T(t,e){t=d.resolvePath(t);let n=null;return i.isNoU(e)?n=new l(zuix,e={},U):(e.componentId=t,i.isNoU(e.contextId)?(!1===e&&(e={}),e.contextId="zuix-ctx-"+ ++w,n=k(e)):(n=S(e.contextId),null!==n?n.options(e):n=k(e))),n.componentId!=t&&(n.componentId=t),i.isFunction(e.ready)&&(n.ready=e.ready),i.isFunction(e.loaded)&&(n.loaded=e.loaded),i.isFunction(e.error)&&(n.error=e.error),null==v[t]?(v[t]=!0,O(n,e)):(null==_[t]&&(_[t]=[]),_[t].push({c:n,o:e}),n)}function A(t){let e=zuix.store("config");return null!=e&&null!=e[location.host]&&(e=e[location.host]),!(t=d.resolvePath(t)).startsWith("/")&&t.indexOf("://")<0&&(t=(null!=e&&null!=e.resourcePath?e.resourcePath:"")+t),t}function O(t,e){let n=F(t.componentId);null!==n&&null==e.controller&&null==t.controller()&&(t.controller(n.controller),o.t(t.componentId+":js","component:cached:js"));const s=function(i){!1!==e.css&&"string"!=typeof e.css?(i[t.componentId].step(t.componentId+":css"),t.loadCss({success:function(t){n.css=t},error:function(e){o.e(e,t)},then:function(){R(t,i[t.componentId])}})):R(t,i[t.componentId])};return i.isNoU(e.view)?(null!==n&&(null!=n.view&&(t.view(n.view),o.t(t.componentId+":html","component:cached:html")),!1!==e.css&&"string"!=typeof e.css&&(e.css=!1,n.css_applied||(n.css_applied=!0,t.style(n.css),o.t(t.componentId+":css","component:cached:css")))),i.isNoU(t.view())?b("resource-loader").queue(t.componentId+":html",(function(){v[t.componentId]=this,t.loadHtml({cext:e.cext,success:function(e){null==n&&(n=P(t)),n.view=e,delete n.controller,s(v)},error:function(n){o.e(n,t),i.isFunction(e.error)&&t.error.call(t,n,t)}})}),e.priority):b("resource-loader").queue(t.componentId+":css",(function(){v[t.componentId]=this,s(v)}),e.priority),t):(t.view(e.view),null==t.controller()?b("resource-loader").queue(t.componentId+":js",(function(){v[t.componentId]=this,R(t,v[t.componentId])}),f.length):R(t),t)}function j(t){const e=function(t){if(t instanceof Element){const e=t;t=zuix.context(e),d.dequeue(e)}!i.isNoU(t)&&t.dispose&&t.dispose()};t&&t.each?t.each((function(t,n){e(n)})):e(t)}function k(t){const e=new l(zuix,t,U);return f.push(e),e}function S(t,e){let n=null;if(t instanceof s.ZxQuery)t=t.get();else if("string"==typeof t){const e=s.find(i.dom.queryAttribute(p.zContext,t));e.length()>0&&(t=e.get())}return s.each(f,(function(e,o){if(t instanceof Element&&(o.view()===t||o.container()===t)||i.objectEquals(o.contextId,t))return n=o,!1})),"function"==typeof e&&(t instanceof Element||t instanceof s.ZxQuery)&&(null!=n&&n.isReady?e.call(n,n):s(t).one("component:loaded",(function(){n=zuix.context(this),setTimeout((function(){e.call(n,n)}),10)}))),n}function U(t,e,n){i.isFunction(m[e])&&m[e].call(t,n,t)}function F(t){let e=null;return s.each(x,(function(n,o){if(i.objectEquals(o.componentId,t))return e=o,!1})),e}function R(t,e){if(void 0===t.options().controller&&null===t.controller())if(o.d(t.componentId,"controller:load"),i.isNoU(e)||e.step(t.componentId+":js"),i.isFunction(y[t.componentId]))t.controller(y[t.componentId]),H(t,e);else{const n=function(e){const n=t.componentId+".js";s.ajax({url:A(n),success:function(e){e+='\n//# sourceURL="'+t.componentId+'.js"\n';try{t.controller(q(e));let n=F(t.componentId);null==n&&(n={componentId:t.componentId,controller:t.controller()},x.push(n))}catch(n){o.e(new Error,n,e,t),i.isFunction(t.error)&&t.error.call(t,n,t)}},error:function(e){o.e(e,new Error,t),i.isFunction(t.error)&&t.error.call(t,e,t)},then:function(){H(t,e)}})};i.isNoU(e)?b("resource-loader").queue(t.componentId+":js",(function(){n(v[t.componentId]=this)}),t.options().priority):n(e)}else H(t,e)}function P(t){const e=t.view().innerHTML,n=s.wrapElement("div",e),i={componentId:t.componentId,view:n.innerHTML,css:"string"==typeof t.options().css?null:t._css,controller:t.controller()};return x.push(i),o.t(t.componentId,"bundle:added"),i}function H(t,e){if(v[t.componentId]=null,i.isNoU(t.view()))o.e(t.componentId,"component:view:undefined");else{let r=F(t.componentId);t.options().viewDeferred?o.d(t.componentId,"component:deferred:load"):null===r?r=P(t):null==r.controller&&(r.controller=t.controller());const c=s(t.view());if(null==c.attr(p.zContext)&&c.attr(p.zContext,t.contextId),o.d(t.componentId,"component:initializing"),i.isFunction(t.controller())){const l=t._c=new u(t);l.log=n(381)(t.contextId),"function"==typeof l.init&&l.init();const a=function(){e&&o.d(t.componentId,"controller:create:deferred"),function(t){const e=t.context;o.t(e.componentId,"controller:init","timer:init:start"),e.isReady=!0;const n=t.view();i.isFunction(t.create)&&t.create(),t.trigger("view:create",n);(function(){if(i.isFunction(e.loaded)&&e.loaded.call(e,e),null!=_[e.componentId]){const t=_[e.componentId];let n;for(_[e.componentId]=null;null!=t&&null!=(n=t.shift());)O(n.c,n.o)}s().one("componentize:end",(function(){setTimeout((function(){n.find(i.dom.queryAttribute(p.zLoaded,"false",i.dom.cssNot(p.zComponent))).each((function(t,e){this.attr(p.zLoaded,null)})),zuix.componentize(n)}))}))})(),t.trigger("component:loaded",n,!0);const r=function(){i.isFunction(e.ready)&&e.ready.call(e,e),t.trigger("component:ready",n,!0)},c=zuix.store("handlers"),l=e.contextId,u=n.find(':scope > [type="jscript"]');u._selection=u._selection.concat(s(document).find('[type="jscript"][for="'+l+'"]')._selection),e.handlers.refresh=function(t,n,o,r){if(!e._disposed){if(e._dependencyResolver&&!e._dependencyResolver.resolved())return e.$.hasClass("not-ready")||e.$.addClass("not-ready"),r(o);null!=e._dependencyResolver&&!1!==e._dependencyResolver&&(e.$.removeClass("not-ready"),e._dependencyResolver=!1);let c=e._refreshHandler;if(!c){const a="return (function($this, context, args){const $ = context.$; const model = context.model(); ";let h='"use strict"; expose = {}; function refresh() {}; function ready() { return true; }; ';e["#"]&&s.each(e["#"],(function(t,e){const n=i.hyphensToCamelCase(t);h+="const $"+n+' = context["#"].'+n+";",h+="const "+n+" = $"+n+".get();",h+="let _"+n+" = null; zuix.context("+n+", function(c) { _"+n+" = c; });"})),h+="function runScriptlet($el, s, args) { let result; try { result = eval(\"const $this = $el; const _this = zuix.context(this); \" + s) } catch (e) { console.error('SCRIPTLET ERROR', e, s); }; return result };";const d=[];let p="";d.push(l),u.each((function(e,n,o){null!=o.attr("using")&&d.push(...o.attr("using").split(",")),o.parent().get()!==t.get()&&o.attr("for")!==l||(p+=o.html()+";")}));let f="";if(d.length>0){let t="";if(d.forEach((function(n){const o=i.hyphensToCamelCase(n);!1!==e._dependencyResolver?f+="let "+o+' = window["'+o+'"]; if ('+o+" == null) { "+o+' = zuix.context("'+n+'", function(ctx) { '+o+" = ctx; }); }":f+="let "+o+' = window["'+o+'"]; if ('+o+" == null) { "+o+' = zuix.context("'+n+'"); }',t+=o+" && "})),!1!==e._dependencyResolver&&f.length>0&&(f+="const resolved = function() { return "+t+"true; };",e._dependencyResolver=Function(a+f+"; return { resolved }; }).call(this.$el.get(), this.$el, this.ctx, this.args);").call({$el:n,ctx:e,args:null}),!e._dependencyResolver.resolved()))return r(o)}h+=f+p;const m=h+"; return { refresh, runScriptlet, ready, expose }; }).call(this.$el.get(), this.$el, this.ctx, this.args);";c=e._refreshHandler=Function(a+";"+m).call({$el:n,ctx:e,args:null}),c.expose&&Object.assign(e,c.expose)}c.refresh&&c.refresh(),"function"==typeof r&&r(o)}};const a=[];if(n.find("*").each((function(o,i,s){M(n,s)&&a.push(...function(n,o){const i=o.get(),s=[];for(let r=0;r1&&l.startsWith("@")){const r=l.substring(1).split(":")[0];let u=e.handlers?e.handlers[r]:null;if(u||(u=c[r]),"function"==typeof u){const e=zuix.activeRefresh(n,o,t.model(),(function(t,e,s,r){o.attr(p.zLoad)&&"true"!==o.attr(p.zReady)?null==zuix.context(o)&&r(s):u.call(i,n,o,s,r,l)}));s.push(e)}}}return s}(n,s))})),a.length>0||u.length()>0){const o=u.length()>0?u.attr("refreshDelay"):null,i=u.length()>0?u.attr("handlersDelay"):null;e.handlers.refresh.call(n.get(),n,n,t.model(),(function(t,s){zuix.activeRefresh(n,n,t,(function(t,o,s,c){if(e._refreshHandler&&!e._refreshHandler.initialized){let t=!0;a.forEach((function(e){if(null!=e.$element.attr(p.zLoad)||null!=e.$element.attr(p.zInclude))return t=null!=zuix.context(e.$element)&&zuix.context(e.$element).isReady,t})),e._refreshHandler.ready()&&!0===e.isReady&&t?(e._refreshHandler.initialized=!0,a.forEach((function(t){t.start(i)})),e.$.removeClass("not-ready"),r()):e.$.hasClass("not-ready")||e.$.addClass("not-ready"),c(s)}else e.handlers.refresh.call(n.get(),n,n,s,c)})).start(o)}))}else e.handlers.refresh.call(n.get(),n,n),r();o.t(e.componentId,"controller:init","timer:init:stop"),o.i(e.componentId,"component:loaded",l)}(l),e&&e.end(),c.attr(p.zReady,"true")};if(i.isNoU(l.view())||null!=l.view().attr(p.zComponent)||l.view().attr(p.zComponent,""),i.isNoU(t.model())&&!i.isNoU(t.view())&&t.viewToModel(),t.options().viewDeferred){t.options().viewDeferred=!1,l.saveView(),null===r&&"default"!==t.componentId&&(r={componentId:t.componentId,controller:t.controller()},x.push(r),o.t(t.componentId,"bundle:added"),o.d(t.componentId,"component:deferred:load"));const e=function(){!1!==t.options().html?null==r.view?t.loadHtml({cext:t.options().cext,success:function(e){r.view=e,o.d(t.componentId,"component:deferred:html")},error:function(e){o.e(e,t),i.isFunction(t.options().error)&&t.options().error.call(t,e,t)},then:function(){o.d(t.componentId,"controller:create:2"),a()}}):(t.view(r.view),a()):(o.d(t.componentId,"controller:create:3"),a())};!1!==t.options().css&&"string"!=typeof t.options().css?null==r.css?t.loadCss({success:function(e){r.css=e,o.d(t.componentId,"component:deferred:css")},then:function(){e()}}):(t.style(r.css),e()):("string"==typeof t.options().css&&t.style(t.options().css),e())}else o.d(t.componentId,"controller:create:1"),a()}else o.w(t.componentId,"component:controller:undefined")}}function M(t,e){const n=[...L,i.dom.queryAttribute(p.zLoad),i.dom.queryAttribute(p.zInclude)].join(",");return e.parent("pre,code,"+n).get()===t.get()}function q(t){let e=function(t){};if("string"==typeof t)try{const n=Function(i.normalizeControllerCode(t))();if("function"!=typeof n)throw new Error('Unexpected module type: "'+typeof n+'"');e=n}catch(e){o.e(this,e,t)}return e}I.prototype.field=function(t,e,n){return N.call(this,t,e,n)},I.prototype.load=function(t,e){return T.call(this,t,e)},I.prototype.unload=function(t){return j(t),this},I.prototype.loadComponent=function(t,e,n,o){return function(t,e,n,o){j(t=s(t)),t.each((function(t,i,r){!function(t){let i=t.get().shadowRoot;if(null==i&&o&&o.container instanceof ShadowRoot&&(i=o.container),i){const e=document.createElement("div");i.appendChild(e),Array.from(t.get().childNodes).map((function(t){e.appendChild(t)})),o&&o.container&&(o.container=e),t=s(e)}t.attr(p.zLoad,e),n&&t.attr(n,""),o&&o.lazyLoad&&"true"===o.lazyLoad.toString()||"true"===t.attr(p.zLazy)?o&&(t.get().__zuix_loadOptions=o):d.loadInline(t,o)}(r)}))}(t,e,n,o),this},I.prototype.controller=function(t){return E.call(this,t)},I.prototype.context=function(t,e){return S.call(this,t,e)},I.prototype.createComponent=function(t,e){if(null==e&&(e={}),i.isNoU(e.contextId)&&(e.contextId="zuix-ctx-"+ ++w),null!=S(e.contextId))throw new Error("Context arelady exists.");return e.container=document.createElement("div"),e.componentId=t,d.applyOptions(e.container,e),k(e)},I.prototype.trigger=function(t,e,n){return U(t,e,n),this},I.prototype.hook=function(t,e){var n,s;return n=t,s=e,i.isNoU(s)?delete m[n]:(m[n]&&o.w("Overwritten an already registered hook for",'"'+n+'"',"OLD HANDLER",m[n],"REPLACED BY",s),m[n]=s),this},I.prototype.using=function(t,e,n,o){e=d.resolvePath(e);const r=(t=t.toLowerCase())+"-"+e.hashCode();if("component"===t){const t=S(r);null==t?zuix.load(e,{contextId:r,view:"",priority:-10,ready:function(t){"function"==typeof n&&n(e,t)},error:function(){"function"==typeof n&&n(e,null)}}):"function"==typeof n&&n(e,t)}else{const c="style"===t;if(0===s.find(t+'[id="'+r+'"]').length()){const l=(o?i.dom.getShadowRoot(o.container()):null)||document.head||document.getElementsByTagName("head")[0],u=document.createElement(t);c?(u.type="text/css",u.id=r):(u.type="text/javascript",u.id=r),l.appendChild(u);const a=function(t){c?u.styleSheet?u.styleSheet.cssText=t:u.appendChild(document.createTextNode(t)):u.innerText?u.innerText=t:u.appendChild(document.createTextNode(t)),n&&n(e,r)},h="_res/"+t+"/"+r,d=F(h);null!=d?a(c?d.css:d.controller):s.ajax({url:e,success:function(t){const n={componentId:h,view:null,css:c?t:null,controller:c?null:t,using:e};x.push(n),a(t)},error:function(){l.removeChild(u),n&&n(e)}})}else n&&n(e,r)}return this},I.prototype.lazyLoad=function(t,e){return null==t?d.lazyLoad():(d.lazyLoad(t,e),this)},I.prototype.componentize=function(t){return!1===t?z=!0:!0===t&&(z=!1,t=null),z||d.componentize(t),this},I.prototype.store=function(t,e){return null!=e&&(this._store[t]=e),this._store[t]},I.prototype.getResourcePath=function(t){return A(t)},I.prototype.observable=function(t){return C.observable(t)},I.prototype.activeRefresh=function(t,e,n,o){return new h(t,e,n,o)},I.prototype.bundle=function(t,e){if(i.isNoU(t))return x;if(t&&"boolean"==typeof t){o.t("bundle:start");const t=d.lazyLoad();if(d.lazyLoad(!1),d.componentize(),"function"==typeof e){const n=function(n){setTimeout((function(){d.willLoadMore()?(o.t("bundle:wait"),n(n)):(o.t("bundle:end"),d.lazyLoad(t),e())}),1e3)};n(n)}}else{for(let e=0;e200?s.push(e+"color:#ff0000;"):t>100?s.push(e+"color:#ff7700;"):s.push(e+"color:#00aa00;")}}}i+=" \n%c ",s.push("background-color:transparent;color:inherit;");for(let t=s.length-1;t>=0;t--)Array.prototype.unshift.call(o,s[t]);Array.prototype.unshift.call(o,i),Array.prototype.push.call(o,"\n\n")},this.log=function(e,s){i&&i.call(t,e,s),(o.__zuix__debug||"ERROR"===e||"WARN"===e)&&(this.args(t,e,s),n.log(...s))}}s.prototype.monitor=function(t){i=t},s.prototype.info=function(...t){return this.log("INFO",t),this},s.prototype.i=s.prototype.l=s.prototype.log=s.prototype.info,s.prototype.warn=function(...t){return this.log("WARN",t),this},s.prototype.w=s.prototype.warn,s.prototype.error=function(...t){return this.log("ERROR",t),this},s.prototype.e=s.prototype.error,s.prototype.debug=function(...t){return this.log("DEBUG",t),this},s.prototype.d=s.prototype.debug,s.prototype.trace=function(...t){return this.log("TRACE",t),this},s.prototype.t=s.prototype.trace,t.exports=function(t){return new s(t)}},65:function(t,e,n){"use strict";const o=n(381)("TaskQueue.js");function i(t){const e=this;e._worker=null,e._taskList=[],e._requests=[],null==t&&(t=function(){}),e.taskQueue=function(n,i,s){e._taskList.push({tid:n,fn:i,status:0,priority:s,step:function(n){o.t(n,"load:step"),t(e,"load:step",{task:n})},end:function(){this.status=2,o.t(this.tid,"load:next","timer:task:stop"),t(e,"load:next",{task:this.tid}),e._taskList.splice(this.index,1),e.taskCheck(),null!=this._callback&&this._callback.call(this)},callback:function(t){this._callback=t}}),o.t(n,"task added",s,"priority"),e._taskList.sort((function(t,e){return t.priority>e.priority?1:e.priority>t.priority?-1:0})),e.taskCheck()},e.taskCheck=function(){for(let n=0;n-1!==n.indexOf(t)))&&n.every((n=>this.objectEquals(t[n],e[n])))},propertyFromPath:function(t,e){if("string"!=typeof e||null==t)return;try{if(void 0!==t[e])return t[e]}catch(t){console.log(t)}let n=t,o="";const i=e.match(/\[(".*?"|'.*?'|(.*?))\]|".*?"|'.*?'|[0-9a-zA-Z_$]+/g);for(let t=0;t"}return n},cloneObject:function t(e){if(null===e||"object"!=typeof e)return e;let n=e;try{n=e.constructor();for(const o in e)e.hasOwnProperty(o)&&(n[o]=t(e[o]))}catch(t){}return n},hasPassiveEvents:function(){let t=!1;try{const e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassive",null,e),window.removeEventListener("testPassive",null,e)}catch(t){}return t},hyphensToCamelCase:function(t){return t.replace(/--/g,":").replace(/-([a-z0-9_$-])/g,(function(t){return"_$-".indexOf(t[1])>-1||(+t[1]).toString()===t[1]?"_"+t[1].replace("-","_"):t[1].toUpperCase()})).replace(/:/g,"-")},camelCaseToHyphens:function(t){return(t=t.replace(/(^\w)|(\s+\w)/g,(function(t){return t.toUpperCase()})).replace(/\s/g,"")).split(/(?=[A-Z])/).join("-").toLowerCase()},normalizeControllerCode:function(t){if(t.indexOf("module.exports")>=0)return"'use strict'; let module = {}; "+t+";\nreturn module.exports;";{let e=t;const n=t.indexOf("function "),o=t.indexOf("zuix.controller"),i=t.indexOf("class ");return i>=0&&(i=0&&(n=e.length||null==t?e[0]:e[t]},getAll:function(t){return i.split(",").join("")}};var i},getShadowRoot:function(t){for(;t;t=t.parentNode)if(t instanceof ShadowRoot)return t;return!1}}}},917:function(t,e,n){"use strict";const o=n(381)("TaskQueue.js"),i=n(826),s=i.hasPassiveEvents(),r=[];function l(t){!function(t,e,n){const o=d(t);d.each(r,(function(){this.element===t&&this.path===e&&this.handler.call(o,n,o)}))}(this,t.type,t)}function c(t,e,n){let o=1,i=-1;d.each(r,(function(s){this.element===t&&this.path===e&&(o--,this.handler===n&&(i=s))})),-1!==i&&r.splice(i,1),0===o&&t.removeEventListener(e,l)}function u(t,e,n){let o=n.classes;return"string"==typeof n?(o=n.split(/[\s|,]+/g),n={}):Array.isArray(n)&&(o=n,n={}),Object.assign({type:t,classes:o,target:e},n)}function a(t){if(this._selection=[],void 0===t&&(t=document.documentElement),t instanceof a)return t;if(t instanceof HTMLCollection||t instanceof NodeList){const e=this._selection=[];d.each(t,(function(t,n){e.push(n)}))}else if(Array.isArray(t))this._selection=t;else if(t===window||t instanceof HTMLElement||t instanceof Node)this._selection=[t];else if("string"==typeof t)this._selection=document.documentElement.querySelectorAll(t);else if(null!==t){const e="ZxQuery cannot wrap object of this type.";throw o.e(e,typeof t,t),new Error(e)}return this}function h(t){return new a(t)}a.prototype.length=function(){return this._selection.length},a.prototype.parent=function(t){return i.isNoU(t)?new a(this._selection[0].parentNode):new a(d.getClosest(this._selection[0],t))},a.prototype.children=function(t){return i.isNoU(t)?new a(this._selection[0].children):new a(this._selection[0].querySelectorAll(t))},a.prototype.reverse=function(){const t=Array.prototype.slice.call(this._selection,0);return this._selection=t.reverse(),this},a.prototype.get=function(t){return i.isNoU(t)&&(t=0),this._selection[t]},a.prototype.eq=function(t){const e=this._selection;let n=e[t];return arguments.length>1&&(n=[],d.each(arguments,(function(t,o){null!=e[o]&&n.push(e[o])}))),new a(n)},a.prototype.prev=function(){return new a(this._selection[0].previousElementSibling)},a.prototype.next=function(){return new a(this._selection[0].nextElementSibling)},a.prototype.index=function(t){const e=this._selection[0];return 1===this.length()&&null==t?Array.from(this.parent().children()._selection).indexOf(e):this.length()>0&&null!=t?this._selection.indexOf(t.get()):-1},a.prototype.find=function(t){return this._selection[0]?new a(this._selection[0].querySelectorAll(t)):new a},a.prototype.each=function(t){return d.each(this._selection,t),this},a.prototype.attr=function(t,e){const n=this;if("object"==typeof t)d.each(t,(function(t,e){n.each((function(n,o){i.dom.setAttribute(o,t,e)}))}));else{if(void 0===e)return i.dom.getAttribute(this._selection[0],t);this.each((function(n,o){i.dom.setAttribute(this.get(),t,e)}))}return this},a.prototype.trigger=function(t,e){let n;return window.CustomEvent?n=new CustomEvent(t,{detail:e}):(n=document.createEvent("CustomEvent"),n.initCustomEvent(t,!0,!0,e)),this.each((function(t,e){e.dispatchEvent(n)})),this},a.prototype.one=function(t,e){const n=this;return"object"==typeof t&&null==e?(d.each(t,(function(t,e){n.one(t,e)})),this):(this.on(t,new function(t,e){let o=!1;return function(i,s){o||(o=!0,d(n).off(t,this),e.call(n,i,s,n))}}(t,e)),this)},a.prototype.on=function(t,e){if("object"==typeof t&&null==e){const e=this;return d.each(t,(function(t,n){e.on(t,n)})),this}const n=t.split(/[\s|,]+/g)||[];let i;return"function"!=typeof e&&(i=e,e=i.handler),this.each((function(t,c){n.map((t=>function(t,e,n,i){let c=!1;d.each(r,(function(){if(this.element===t&&this.path===e&&this.handler===n)return o.w("Handler already registered",t,e,n),c=!0,!1})),c||(r.push({element:t,path:e,handler:n,options:i}),t.addEventListener(e,l,!(!s||null!=i&&!1===i.passive)&&{passive:!0}))}(c,t,e,i)))})),this},a.prototype.off=function(t,e){if("object"==typeof t&&null==e){const e=this;return d.each(t,(function(t,n){e.off(t,n)})),this}const n=t.split(/[\s|,]+/g)||[];return this.each((function(t,o){n.map((t=>c(o,t,e)))})),this},a.prototype.reset=function(){return this.each((function(t,e){!function(t){d.each(r.slice(),(function(){this.element===t&&(o.t("Removing event handler",this.element,this.path,this.handler),c(this.element,this.path,this.handler))}))}(e)})),this},a.prototype.isEmpty=function(){return 0===this._selection[0].innerHTML.replace(/\s/g,"").length},a.prototype.position=function(){return null!=this._selection[0]?d.getPosition(this._selection[0]):{x:-1,y:-1,visible:!1}},a.prototype.css=function(t,e){const n=this;if("object"==typeof t)d.each(t,(function(t,e){n.each((function(n,o){o.style[t]=e}))}));else{if(i.isNoU(e))return this._selection[0].style[t];n.each((function(n,o){o.style[t]=e}))}return this},a.prototype.addClass=function(t){const e=t.split(/[\s|,]+/g)||[];return d.each(this._selection,(function(t,n){e.map((t=>n.classList.add(t)))})),this},a.prototype.hasClass=function(t){return d.hasClass(this._selection[0],t)},a.prototype.removeClass=function(t){const e=t.split(/[\s|,]+/g)||[];return d.each(this._selection,(function(t,n){e.map((t=>n.classList.remove(t)))})),this},a.prototype.html=function(t){return i.isNoU(t)?this._selection[0].innerHTML:(this.each((function(e,n){n.innerHTML=t})),this)},a.prototype.checked=function(t){if(i.isNoU(t)){const t=this._selection[0].checked;return null!=t&&"false"!=t&&(t||"checked"==t)}return this.each((function(e,n){n.checked=t})),this},a.prototype.value=function(t){return i.isNoU(t)?this._selection[0].value:(this.each((function(e,n){n.value=t})),this)},a.prototype.append=function(t){return"string"==typeof t?this._selection[0].innerHTML+=t:this._selection[0].appendChild(t instanceof a?t.get():t),this},a.prototype.insert=function(t,e){e=e instanceof a?e.get():e;const n=this.children().get(t);return null!==n?this._selection[0].insertBefore(e,n):this._selection[0].appendChild(e),this},a.prototype.prepend=function(t){return"string"==typeof t?this._selection[0].innerHTML=t+this._selection[0].innerHTML:this._selection[0].insertBefore(t instanceof a?t.get():t,this._selection[0].firstElementChild),this},a.prototype.detach=function(){const t=this._selection[0],e=t.parentNode;return null!=e&&(t.__zuix_oldParent=e,t.__zuix_oldIndex=Array.prototype.indexOf.call(e.children,t),e.removeChild(t),o.t("Detached from parent",e,t)),this},a.prototype.attach=function(){const t=this._selection[0];return null!=t.parentNode&&null!=t.__zuix_oldParent&&t.parentNode.removeChild(t),null==t.parentNode&&null!=t.__zuix_oldParent&&(d(t.__zuix_oldParent).insert(t.__zuix_oldIndex,t),t.__zuix_oldParent=null,delete t.__zuix_oldParent,delete t.__zuix_oldIndex),this},a.prototype.display=function(t){return i.isNoU(t)?this._selection[0].style.display:(d.each(this._selection,(function(e,n){n.style.display=t})),this)},a.prototype.visibility=function(t){return i.isNoU(t)?this._selection[0].style.visibility:(d.each(this._selection,(function(e,n){n.style.visibility=t})),this)},a.prototype.show=function(t){return this.display(null==t?"":t)},a.prototype.hide=function(){return this.display("none")},a.prototype.playTransition=function(t){return d.playFx(u("transition",this,t)),this},a.prototype.playAnimation=function(t){return d.playFx(u("animation",this,t)),this},a.prototype.isPlaying=function(){return this.hasClass("--z-playing")};const d=h;h.find=function(t){return d().find(t)},h.each=function(t,e){const n=null==t?0:Object.keys(t).length;if(n>0){let o=0;for(const i in t)if(t.hasOwnProperty(i)){let s=t[i];if(s instanceof Element&&(s=d(s)),!1===e.call(s,i,t[i],s))break;if(o++,o>=n)break}}return this},h.ajax=h.http=function(t){let e;e=i.isNoU(t)||i.isNoU(t.url)?t:t.url;const n=new XMLHttpRequest;n.onload=function(){200===n.status?t.success&&t.success(n.responseText):t.error&&t.error(n,n.statusText,n.status),t.then&&t.then(n)},n.onerror=function(e,n,o){t.error&&t.error(e,n,o)},"function"==typeof t.beforeSend&&t.beforeSend(n);try{n.open("GET",e),n.send()}catch(e){t.error&&t.error(n,n.statusText,n.status,e)}return this},h.hasClass=function(t,e){const n=e.split(/[\s|,]+/g)||[];let o=!1;return d.each(n,(function(e,n){if(o=t.classList.contains(n),o)return!1})),o},h.classExists=function(t){const e=t.split(/[\s|,]+/g)||[];let n=!1;return d.each(e,(function(t,e){const o=document.styleSheets;if(null!=o)for(let t=0;t1){let e=s[2];if(null!=e&&e.length>0){e=e.replace(/\n/g,"");const o=e.split(",");let i=!1;if(d.each(o,(function(e,s){if("."===s.trim()||":host"===s.trim())r+="\n[z-component]"+t+" ";else if("@"===s.trim()[0])r+=s+" ",(s.trim().toLowerCase().startsWith("@media")||s.trim().toLowerCase().startsWith("@supports"))&&(i=!0);else if(n)s.split(/\s+/).forEach((function(e){(e=e.trim()).lastIndexOf(".")>0?e.replace(/(?=\.)(?![^\[\]()]*(?:\[[^\[\]()]*([\])]))?([\])]))/gi,",").split(",").forEach((function(e){r+=""!==e?e+t:"\n"})):r+=""!==e&&">"!==e&&"*"!==e?"\n"+e+t+" ":e+" "}));else{let e=s.trim();e=e.startsWith(":host")?e.substring(5):"\n"+e,r+="\n[z-component]"+t+e+" "}e=0)){const e=t.substring(l,o.index)+o[0];s+=e,l+=e.length;continue}let n=o[0];if(e){const t=e(o[0]);i.isNoU(t)||(n=t,r++)}s+=t.substring(l,o.index)+n,l=o.index+o[0].length}return r>0?(s+=t.substring(l),s):null},h.getClosest=function(t,e){for(t=t.parentNode;t&&t!==document;t=t.parentNode)if(t.matches&&t.matches(e))return t;return null},h.getPosition=function(t,e){const n="--ui--visible",o=function(){let e=0,n=0;const o=t.getBoundingClientRect();let i=t;for(;i;){if("body"===i.tagName.toLowerCase()){const t=i.scrollLeft||document.documentElement.scrollLeft,o=i.scrollTop||document.documentElement.scrollTop;e+=i.offsetLeft-t+i.clientLeft,n+=i.offsetTop-o+i.clientTop}else e+=i.offsetLeft-i.scrollLeft+i.clientLeft,n+=i.offsetTop-i.scrollTop+i.clientTop;i=i.offsetParent}return{x:e,y:n,rect:o}}();o.visible=!1;let i=t.offsetParent;if(null!=i||"fixed"!==getComputedStyle(t).position&&"absolute"!==getComputedStyle(t).position||(i=document.body),null!=i){if(i!==document.body){let t=i.offsetParent;for(;null!=t&&null!==t.offsetParent&&t.offsetHeight===t.scrollHeight;)t=t.offsetParent;null!=t&&(i=t)}let s=i.getBoundingClientRect();i===document.body&&(s={x:s.x,y:s.y,width:document.documentElement.offsetWidth||document.documentElement.clientWidth,height:document.documentElement.offsetHeight||document.documentElement.clientHeight,top:0,left:0,right:document.documentElement.clientWidth||document.documentElement.offsetWidth,bottom:document.documentElement.clientHeight||document.documentElement.offsetHeight}),null==e&&(e=0);const r=t.getBoundingClientRect();let l=!(r.left-1>s.right-e||r.right+1s.bottom-e||r.bottom+11&&t.classes.shift();n.hasClass("--z-playing")||(n.addClass("--z-playing"),i&&n.addClass(i).css(t.type,"none"));const s=getComputedStyle(n.get()),r=1e3*parseFloat(s[t.type+"-delay"])||i?10:0;let l=!1;const c=function(){l||(l=!0,t.classes.length>1?(t.onStep&&t.onStep.call(n,n,t.classes.slice(1)),e.playFx(t)):(!t.holdState&&t.classes.length>0&&n.removeClass(t.classes.shift()),n.removeClass("--z-playing"),t.onEnd&&t.onEnd.call(n,n)))},u=function(){i&&n.css(t.type,"").removeClass(i);const e=t.classes[0];e&&n.addClass(e),t.options&&d.each(t.options,(function(e,o){n.css(t.type+"-"+e,o)}));const o=1+(parseFloat(s[t.type+"-iteration-count"])||0),r=1e3*parseFloat(s[t.type+"-duration"])*o;setTimeout(c,r)};n.on(t.type+"end",(function(e){e.target===t.target.get()&&(n.off(t.type+"end",this),c())})),r>0?setTimeout(u,r):u()},h.ZxQuery=a,String.prototype.hashCode=function(){let t=0;if(0===this.length)return t;for(let e=0;e0?(setTimeout((function(){i.requestRefresh(t,e,i.contextData)}),l?i.refreshMs:500),s=!0):null==c&&i.stop()};l?(e._refreshActive||(e._refreshActive=!0,e.trigger("refresh:active")),o(t,e,n,(function(t,e,n){c(t,e,n)}))):(e._refreshActive&&(e._refreshActive=!1,e.trigger("refresh:inactive")),c(i.contextData))}}e.prototype.stop=function(){this.pause(),this.refreshMs=0,this.stopped=!0},e.prototype.start=function(t){if(this.refreshMs=t||this.refreshMs,this.started)return this.resume();this.started=!0,this.requestRefresh(this.$view,this.$element,this.contextData)},e.prototype.pause=function(){this.paused=!0},e.prototype.resume=function(){this.paused=!1},t.exports=e},854:function(t){t.exports=function(){}},622:function(t,e,n){"use strict";const o=n(381)("ComponentContext.js"),i=n(541),s=n(917),r=n(826),l=n(643);let c=null;const u=[],a=[];function h(t,e){e=e.observableTarget||e;const n=r.isNoU(e.value)?r.isNoU(e.innerHTML)?e:e.innerHTML:e.value;switch(t.tagName.toLowerCase()){case"img":t.src=r.isNoU(e.src)?r.isNoU(e.innerHTML)?e:e.innerHTML:e.src;break;case"a":t.href=r.isNoU(e.href)?r.isNoU(e.innerHTML)?e:e.innerHTML:e.getAttribute("href"),r.isNoU(e.href)||r.isNoU(e.innerHTML)||""===e.innerHTML.trim()||0===s(e).find(r.dom.queryAttribute(i.zField)).length()&&s(t).html("").append(document.createTextNode(e.innerHTML));break;case"input":switch(t.type){case"checkbox":case"radio":t.value==n&&(t.checked=!0);break;default:t.value=n}break;case"select":s.each(t.options,(function(e,o){if(o.value==n)return t.selectedIndex=e,!1}));break;default:const o=r.isNoU(e.innerHTML)?document.createTextNode(e):e.innerHTML;s(t).html("").append(o)}}function d(t,e,n,o,i){o&&!t._disposed&&o.call(e,n,i,e,(function(s){if(!t._disposed){const r=n.get().dataset.__zuix_refreshTimeout;r&&a[r]&&clearTimeout(a[r]),n.get().dataset.__zuix_refreshTimeout=setTimeout((function(){d(t,e,n,o,i)}),s||500)}}))}function p(t,e,n){return c=t,this._options=null,this.contextId=null==e||null==e.contextId?null:e.contextId,this.componentId=null,this.handlers={refresh:function(t,e,n,o){}},this.trigger=function(t,e,o){n&&n(t,e,o)},this._container=null,this._model=null,this._view=null,this._css=null,this._style=null,this._controller=null,this.behavior=null,this._eventMap=[],this._behaviorMap=[],this._fieldCache=[],this._c=null,this._modelListener=Object.assign({context:null,get:function(t,e,n,o){},set:function(t,e,n,o,s){const l=this.context.$;if(t instanceof Element&&(o=o.split(".")[0],n=t),"function"==typeof n){let t=l.find(r.dom.queryAttribute(i.zBind,o));return null==t.get()&&(t=l.find(r.dom.queryAttribute(i.zField,o))),void d(this.context,l,t,n,e)}const c=function(t){null!=t.get()&&t.each((function(t,e){h(e,n)}))};l.get()&&(c(l.find(r.dom.queryAttribute(i.zBind,o))),c(l.find(r.dom.queryAttribute(i.zField,o))),this.context._c&&this.context._c.update&&this.context._c.update(t,e,n,o,s))}},{context:this}),this._viewObserver=new l(this),this._disposed=!1,this.options(e),this}p.prototype.dispose=function(){if(this._disposed)return;this._disposed=!0,this._viewObserver.stop(),r.isNoU(this._c)||(r.isNoU(this._c.view())||(this._c.trigger("component:dispose",this._c.view(),!0),this._c.view().attr(i.zComponent,null).attr(i.zContext,null).attr(i.zLoad,null).attr(i.zLoaded,null).attr(i.zReady,null).attr(i.resourceType.view,null).attr(i.resourceType.controller,null).attr(i.resourceType.file,null).attr(this.getCssId(),null),this._c.view().reset(),r.isNoU(this._c._fieldCache)||s.each(this._c._fieldCache,(function(t,e){e.reset()}))),this._c.dispose&&this._c.dispose.call(this,this)),this.model(null),!r.isNoU(this._c)&&this._c._childNodes.length>0&&(this._c.view().html(""),this._c.restoreView());const t=c.dumpContexts(),e=t.indexOf(this);t.splice(e,1)},p.prototype.container=function(t){return null==t?this._container:(t instanceof s.ZxQuery&&(t=t.get()),this._container=t,this)},p.prototype.view=function(t){if(void 0===t)return this._view;if(null===t)throw new Error("View cannot be set to null.");if(t instanceof s.ZxQuery&&(t=t.get()),t===this._view)return this;this._viewObserver.stop();const e=this.getCssId();if(null!=this._view){const t="*"+r.dom.cssNot(i.zLoad).getAll()+r.dom.cssNot(i.zInclude).getAll();s(this._view).attr(e,null).find(t).each((function(t,n){this.attr(e,null)}))}const n=function(t){t.find("*").each((function(t,e,n){for(let t=0;t1&&o.name.startsWith("#")){const t=r.hyphensToCamelCase(o.name.substring(1));null==n.attr(i.zField)&&n.attr(i.zField,t),null==n.attr(i.zBind)&&null!=s&&s.length>0&&n.attr(i.zBind,s)}}}))};if(o.t(this.componentId,"view:attach","timer:view:start"),"string"==typeof t){const e={content:t};this.trigger(this,"html:parse",e),t=e.content;const o=s.wrapElement("div",t);null!=o.firstElementChild&&(null!=r.dom.getAttribute(o.firstElementChild,i.zView)?1===o.children.length&&(t=o.firstElementChild.innerHTML):t=o.innerHTML),null!=this._container?(this._view=this._container,this._view.innerHTML+=t):null!=this._view?this._view.innerHTML=t:this._view=o;const l=s(this._view);l.find("script:not([type=jscript])").each((function(t,e){"true"!==this.attr(i.zuixLoaded)&&(this.attr(i.zuixLoaded,"true"),Function(e.innerHTML).call(window))})),n(l),this.trigger(this,"view:process",l)}else null!=this._container&&"default"!==this.componentId?(this._view=s.wrapElement("div",t.outerHTML).firstElementChild,r.dom.setAttribute(this._view,i.zView,null),this._container.appendChild(this._view),this._view=this._container):this._view=t;const l=s(this._view);return n(l),l.find(r.dom.queryAttribute(i.zLoad,null,r.dom.cssNot(i.zLoaded))).each((function(t,e){this.attr(i.zLoaded,"false")})),this.checkEncapsulation(),this.modelToView(),o.t(this.componentId,"view:attach","timer:view:stop"),this},p.prototype.field=function(t){const e=this,n=c.field(t,this._view,this);return n.on=function(t,n,o,i){if("string"==typeof n){const t=n;n=function(){e._c&&e._c.trigger(t,o,i)}}return s.ZxQuery.prototype.on.call(this,t,n)},n},p.prototype.checkEncapsulation=function(){const t=s(this._view),e=this.getCssId();if(t.length()>0&&!1!==this._options.css)if(t.attr(e,""),null!=this._container||null!=this._style){const n="*"+r.dom.cssNot(i.zLoad).getAll()+r.dom.cssNot(i.zInclude).getAll();t.find(n).each((function(t,n){this.attr(e,"")})),this._viewObserver.start(),t.attr(i.resourceType.controller,null)}else t.attr(i.resourceType.controller,"")},p.prototype.style=function(t){if(void 0===t)return this._style;const e=this.getCssId();if(o.t(this.componentId,"view:style","timer:view:start",e),null==t||t instanceof Element)this._css=t instanceof Element?t.innerText:t,this._style=s.appendCss(t,this._style,this.componentId+"@"+e,r.dom.getShadowRoot(this._view));else if("string"==typeof t){this._css=t;const n={content:t};this.trigger(this,"css:parse",n),t=n.content;let o="";!0===this.options().resetCss&&(o=":host { all: initial; }");const i="["+e+"]";t=s.wrapCss(i,o+"\n"+t,!0===this.options().encapsulation),this._style=s.appendCss(t,this._style,this.componentId+"@"+e,r.dom.getShadowRoot(this._view))}return this.checkEncapsulation(),o.t(this.componentId,"view:style","timer:view:stop",e),this},p.prototype.model=function(t){return void 0===t||this._model===t||(null!==this._model&&"function"!=typeof this._model&&c.observable(this._model).unsubscribe(this._modelListener),this._model=t,null!=t&&("function"!=typeof t&&(this._model=c.observable(t).subscribe(this._modelListener).proxy),this.modelToView(),null!=this._c&&this._c.update&&this._c.update.call(this._c,null,null,null,null,this._c))),this._model},p.prototype.controller=function(t){return void 0===t?this._controller:(this._controller=t,this)},p.prototype.options=function(t){if(null==t)return this._options;const e=this._options=this._options||{};return Object.assign(e,t),this.componentId=e.componentId||this.componentId,null==u[this.componentId]&&(u[this.componentId]=u.length,u.length++),this.container(e.container),this.view(e.view),"string"==typeof e.css&&this.style(e.css),this.controller(e.controller),this.model(e.model),this},p.prototype.on=function(t,e){return this._c.on(t,e),this},p.prototype.loadCss=function(t,e){const n=this;r.isNoU(t)&&(t={}),r.isNoU(t.caching)||t.caching;let i=n.componentId;r.isNoU(t.path)||(i=t.path);let l=c.store("zuix.inlineStyles");if(null==l&&(l=[],c.store("zuix.inlineStyles",l)),null!=l[i])n.style(l[i]),t.success&&t.success.call(n,l[i],n),t.then&&t.then.call(n,n);else{const e=s().find('style[media="#'+i+'"],style[media="'+i+'"]');if(e.length()>0){const o=e.get(0).innerText;n.style(o),e.detach(),l[i]=o,t.success&&t.success.call(n,o,n),t.then&&t.then.call(n,n)}else i==n.componentId&&(i+=".css"),s.ajax({url:c.getResourcePath(i),success:function(e){n.style(e),t.success&&t.success.call(n,e,n)},error:function(e){o.e(e,n),t.error&&t.error.call(n,e,n)},then:function(){t.then&&t.then.call(n,n)}})}return this},p.prototype.loadHtml=function(t,e){const n=this;let l=n.componentId;r.isNoU(t)&&(t={}),r.isNoU(t.caching)||t.caching,r.isNoU(t.path)||(l=t.path);let u=c.store("zuix.inlineViews");if(null==u&&(u=[],c.store("zuix.inlineViews",u)),null!=u[l])n.view(u[l]),t.success&&t.success.call(n,u[l],n),t.then&&t.then.call(n,n);else{const e=s().find(r.dom.queryAttribute(i.zView,l,r.dom.cssNot(i.zComponent)));if(e.length()>0){let o,r=e.get(0);if("template"===r.tagName.toLowerCase()?(r=r.cloneNode(!0),o=r.content.querySelectorAll("style")):o=r.querySelectorAll('style[media="#"]'),o)for(const t of o)t.setAttribute("media","#"+n.componentId);u[l]=r.innerHTML,n.view()===r||null!=n.container()&&n.container().contains(r)?(e.attr(i.zView,null),n._view=r,this.trigger(this,"view:process",s(n.view()))):n.view(r.innerHTML),t.success&&t.success.call(n,r.innerHTML,n),t.then&&t.then.call(n,n)}else{const e=r.isNoU(t.cext)?".html":t.cext;l==n.componentId&&(l+=e),s.ajax({url:c.getResourcePath(l),success:function(e){n.view(e),t.success&&t.success.call(n,e,n)},error:function(e){o.e(e,n),t.error&&t.error.call(n,e,n)},then:function(){t.then&&t.then.call(n,n)}})}}return this},p.prototype.viewToModel=function(){o.t(this.componentId,"view:model","timer:vm:start");const t={},e=s(this._view);return e.find(r.dom.queryAttribute(i.zField)).each((function(n,o,s){if(!c.isDirectComponentElement(e,s))return!0;const r=this.attr(i.zField);t[r]=o})),this._model=c.observable(t).subscribe(this._modelListener).proxy,o.t(this.componentId,"view:model","timer:vm:stop"),this},p.prototype.modelToView=function(){if(o.t(this.componentId,"model:view","timer:mv:start"),null!=this._view){const t=this;t["#"]={};const e=s(this._view);e.find(r.dom.queryAttribute(i.zField)).each((function(n,o,s){if(!c.isDirectComponentElement(e,s)&&"true"!==s.attr("inherits"))return!0;let l=s.attr(i.zBind);if(null==l&&(l=s.attr(i.zField)),"function"==typeof t._model)d(t,e,s,t._model,l);else{let n=r.propertyFromPath(t._model,l);const i=r.hyphensToCamelCase(l),c=r.propertyFromPath(t._model,i);null==n&&null!=c&&(l=i,n=r.propertyFromPath(t._model,n)),"function"==typeof n?d(t,e,s,n,l):null!=n&&h(o,n)}})),e.find(r.dom.queryAttribute(i.zField)).each((function(n,o,s){if(!c.isDirectComponentElement(e,s)&&"true"!==s.attr("inherits"))return!0;let l=s.attr(i.zBind);null==l&&(l=s.attr(i.zField));try{const e=r.hyphensToCamelCase(l);Function("function testName(){ const "+e+' = "test"; }'),t["#"][e]=t.field(l)}catch(t){}}))}return o.t(this.componentId,"model:view","timer:mv:stop"),this},p.prototype.getCssId=function(){let t="";return"string"==typeof this._options.css&&(t="_"+this.contextId),i.cssIdPrefix+u[this.componentId]+t},Object.defineProperty(p.prototype,"path",{get:function(){const t=this.componentId,e=t.lastIndexOf("/");return e<0?t:t.substring(0,e+1)}}),Object.defineProperty(p.prototype,"name",{get:function(){const t=this.componentId,e=t.lastIndexOf("/");return e<0?t:t.substring(e+1)}}),Object.defineProperty(p.prototype,"$",{get:function(){return this._c&&this._c.view()}}),t.exports=p},211:function(t,e,n){"use strict";const o=n(541);_.prototype.componentize=function(t){return g?(r().one("componentize:step",(function(){requestAnimationFrame((function(){g=!1,m.componentize(t)}))})),this):(g=!0,m.trigger(this,"componentize:begin"),m.$().trigger("componentize:begin"),m.resolveImplicitLoad(t),function(t){null==t&&(t=document),l.indexOf(t)||l.push(t)}(t),x(t),this)},_.prototype.applyOptions=function(t,e){return C(t,e),this},_.prototype.loadInline=function(t,e){b(t,e)},_.prototype.resolvePath=function(t){return w(t)},_.prototype.willLoadMore=function(){return c.length>0||l.length>0},_.prototype.lazyLoad=function(t,e){return v(t,e)},_.prototype.dequeue=function(t){for(let e=0;e0&&(t=l.unshift()),t instanceof r.ZxQuery&&(t=t.get());const e=s.dom.queryAttribute(o.zLoad,null,s.dom.cssNot(o.zLoaded))+","+s.dom.queryAttribute(o.zInclude,null,s.dom.cssNot(o.zLoaded));let n=r(t).find(e);n=Array.prototype.slice.call(n._selection);const a=[];for(let t=0;t0?c.shift():null;for(;null!=e&&null!=e.element;){const n=e.element,o=L(n);if(v()&&o?(e.lazy=!0,e.visible=r.getPosition(n,f).visible):(e.lazy=!1,e.visible=!0),null!=n&&e.visible){t={item:e,cancelable:e.lazy};break}if(!(c.length>0))break;e=c.shift()}return t}();if(null!=e&&null!=e.item&&null!=e.item.element){const t=e.item.element;r(t).one("component:loaded",(function(){m.componentize(t)})),b(t)}}function b(t,e){const n=r(t);if(null!=n.attr(o.zLoaded)||n.parent("pre,code").length()>0)return!1;n.attr(o.zLoaded,"true");let l=n.attr(o.zOptions);s.isNoU(l)?l=null!=n.get().__zuix_loadOptions?n.get().__zuix_loadOptions:{}:(l=z(t,l),l=s.cloneObject(l)||{}),e&&Object.assign(l,e);const c=n.attr(o.zContext);if(!s.isNoU(c)){const t=m.context(c);null!==t&&(l=t.options()),l.contextId=c}s.isNoU(l.view)&&!n.isEmpty()?(l.view=t,l.viewDeferred=!0):s.isNoU(l.view)&&s.isNoU(l.container)&&n.isEmpty()&&null==n.attr(o.resourceType.controller)&&(l.container=t);const u=function(){n.attr(o.zComponent,null),s.isNoU(l.controller)&&(l.controller=function(){})};let a=n.attr(o.zLoad);if(s.isNoU(a)){const t=n.attr(o.zInclude);if(null==t)return!1;a=w(t),n.attr(o.zInclude,a),u()}else if(a=w(a),n.attr(o.zLoad,a),"default"!==a&&null!==n.attr(o.resourceType.view))u();else if("default"===a||null!==n.attr(o.resourceType.controller)){l.view=l.view||t,l.viewDeferred=!0,l.html=l.html||!1,l.css=l.css||!1;const e=n.children('[media="#"]');e.length()>0&&e.parent().get()===n.get()&&(!1===l.css&&(l.css=""),e.each((function(t,e,n){l.css+="\n"+l.css+n.html()}))),"default"===a&&(l.controller=l.controller||function(){})}const h=[":on",":model",":behavior",":ready"];Array.from(n.get().attributes).filter((t=>t.nodeName.startsWith(":")&&!h.find((e=>t.nodeName.startsWith(e))))).forEach((t=>{const e=t.nodeName.match(/[^:]+/g);let n=l;e.forEach(((o,r)=>{if(o=s.hyphensToCamelCase(o),r===e.length-1){let s;try{s=Function("return "+t.nodeValue+";")()}catch(n){i.warn(e.join(":"),o,t.nodeValue,n)}return n[o]=s}n=n[o]=n[o]||{}}))}));const d=n.attr(o.zOn);!s.isNoU(d)&&d.length>0&&(l.on=z(t,d));const p=n.attr(o.zBehavior);!s.isNoU(p)&&p.length>0&&(l.behavior=z(t,p));const f=n.attr(o.zModel);!s.isNoU(f)&&f.length>0&&(l.model=z(t,f));const y=n.attr(o.zPriority);return s.isNoU(y)||(l.priority=+y),m.load(a,l),!0}function w(t){if("@"===t[0]){let e=m.store("config"),n="https://zuixjs.github.io/zkit/lib/";if(null!=e&&null!=e[location.host]&&(e=e[location.host]),null!=e)switch(typeof e.libraryPath){case"object":r.each(e.libraryPath,(function(e,o){return!t.startsWith(e+"/")||(n=o,!1)}));break;case"string":n=e.libraryPath}t=n+t.substring(t.indexOf("/")+1)}return t}function z(t,e){if("string"==typeof e){const n=r(t).parent(s.dom.queryAttribute(o.zLoad)+","+s.dom.queryAttribute(o.zInclude));if(n.get()){const o=m.context(n);try{return o._refreshHandler.runScriptlet(t,`[${e}][0]`)}catch(t){}}e=e.trim().startsWith("{")&&e.trim().endsWith("}")?Function("return "+e)():s.propertyFromPath(window,e)}return e}function C(t,e){e=z(t,e),null!=t&&null!=e&&(null!=e.componentId&&s.dom.setAttribute(t,o.zLoad,e.componentId.toString().toLowerCase()),null!=e.contextId&&s.dom.setAttribute(t,o.zContext,e.contextId.toString().toLowerCase()),null!=e.lazyLoad&&s.dom.setAttribute(t,o.zLazy,e.lazyLoad.toString().toLowerCase()))}function I(t){const e={element:t};return a.push(e),e}function L(t){if("false"===s.dom.getAttribute(t,o.zLazy))return!1;let e=function(t){for(let e=0;e100?(o=t,x(e)):(clearTimeout(n),n=setTimeout((function(){x(e)}),150))}))}(0,i)),!0}if("true"===s.dom.getAttribute(t,o.zLazy))return e=I(t),!0}return!1}},561:function(t,e,n){"use strict";const o=n(917),i=n(826);function s(t){const e=this;this._view=null,this.context=t,this._childNodes=[],this.saveView=function(){this.restoreView(),this.view().children().each((function(t,n){e._childNodes.push(n)}))},this.restoreView=function(){this._childNodes.length>0&&(e.view().html(""),o.each(e._childNodes,(function(t,n){e.view().append(n)})),this._childNodes.length=0)},this.on=function(t,n){return"object"==typeof t&&null==n?(o.each(t,(function(t,n){e.on(t,n)})),this):(this.addEvent(t,n),this)},this.mapEvent=function(t,e,n,o){null!=e&&(e.off(n,this.eventRouter),t.push({target:e,eventPath:n,handler:o}),e.on(n,this.eventRouter))},this.eventRouter=function(n){const o=e.view();t._behaviorMap.concat(t._eventMap).forEach((function(t){t.eventPath===n.type&&t.handler&&t.handler.call(o,n,n.detail,o)}))};const n=t.options();let i=null;if(null!=n.on&&o.each(n.on,(function(t,n){t.split(/[\s|,]+/g).map((t=>e.addEvent(t,n)))})),null!=n.behavior)for(const t in n.behavior)n.behavior.hasOwnProperty(t)&&(i=n.behavior[t],t.split(/[\s|,]+/g).map((t=>e.addEvent(t,i))));if("function"==typeof(s=t.controller())&&/^\s*class\s+/.test(s.toString())){const e=new(t.controller().bind(this,this));t.controller(e)}else t.controller().call(this,this);var s;return this}s.prototype.addEvent=function(t,e){return this.mapEvent(this.context._eventMap,this.view(),t,e),this},s.prototype.addBehavior=function(t,e){return this.mapEvent(this.context._behaviorMap,this.view(),t,e),this},s.prototype.addTransition=function(t,e,n){const s=this.context.getCssId();this.context.$.attr(s,"");const r="[z-component]["+s+"]";return o.addTransition(this.context.componentId+"@"+s,r,t,e,n,i.dom.getShadowRoot(this.context.view())),this},s.prototype.field=function(t){return this.context.field(t)},s.prototype.clearCache=function(){this.context._fieldCache={}},s.prototype.view=function(t){const e=this;if(null==this.context.view()&&this._view===this.context.view()||(this.clearCache(),this._view=o(this.context.view()),this._view.field=function(t){return e.context.field(t)}),null!=t)return this._view.find(t);if(null!==this._view)return this._view;throw new Error("Not attached to a view yet.")},s.prototype.model=function(t){return null==t?this.context.model():(this.context.model(t),this)},s.prototype.options=function(){return this.context.options()},s.prototype.trigger=function(t,e,n){if(!0===n){let n=this.context.container();null==n&&(n=this.context.view()),null!=n&&o(n).trigger(t,e),this.context.trigger(this.context,t,e)}else this.view().trigger(t,e);return this},s.prototype.expose=function(t,e){const n=this,i=function(t,e){e&&(e.get||e.set)?Object.defineProperty(n.context,t,e):n.context[t]=e};return"object"==typeof t?o.each(t,(function(t,e){i(t,e)})):i(t,e),this},s.prototype.loadCss=function(t){return this.context.loadCss(t),this},s.prototype.loadHtml=function(t){return this.saveView(),this.context.loadHtml(t),this},s.prototype.log={},s.prototype.for=function(t){return this},t.exports=s},871:function(t){"use strict";function e(t){const e=this;t.init=this.onInit.bind(this),t.create=this.onCreate.bind(this),t.dispose=this.onDispose.bind(this),t.update=function(t,n,o,i,s){return e.onUpdate.call(e,t,n,o,i,s)},Object.assign(this,t),Object.assign(this,Object.getPrototypeOf(t))}e.prototype.onInit=function(){},e.prototype.onCreate=function(){},e.prototype.onDispose=function(){},e.prototype.onUpdate=function(t,e,n,o,i){},t.exports=e},541:function(t){const e=Object.freeze({zModel:"z-model",zBind:"z-bind",zBehavior:"z-behavior",zOn:"z-on",zComponent:"z-component",zContext:"z-context",zField:"z-field",zInclude:"z-include",zLazy:"z-lazy",zLoad:"z-load",zLoaded:"z-loaded",zOptions:"z-options",zPriority:"z-priority",zView:"z-view",zuixLoaded:"zuix-loaded",zReady:"z-ready",resourceType:{view:"view",controller:"ctrl",file:"file"},cssIdPrefix:"z-css-"});t.exports=e},643:function(t,e,n){"use strict";const o=n(541),i=n(826);function s(t){const e=this._context=t;this._mutationObserver=null,this._mutationCallback=function(t,n){const s=i.dom.queryAttribute(o.zComponent),r=function(t){for(let e=0;e0){const t=i.split(" as ");i=t[0],s=t[1]}const r=zuix.runScriptlet(i,e,t);r!==n&&(i="const "+s+" = args; "+e.attr("@set"),zuix.runScriptlet(i,e,t,r),n=r),o(n)},set:function(t,e,n,o){e.attr("@get")||(zuix.runScriptlet(e.attr("@set"),e,t),o(n))},"disable-if":function(t,e,n,o){const i=e.attr("@disable-if"),s=zuix.runScriptlet(i,e,t);s!==n&&(e.attr({disabled:s?"":null}),n=s),o(n)},"hide-if":function(t,e,n,o){const i=e.attr("@hide-if"),s=zuix.runScriptlet(i,e,t);s!==n&&(s?e.css({visibility:"hidden"}):e.css({visibility:"visible"}),n=s),o(n)},if:function(t,e,n,o){const i=e.attr("@if"),s=zuix.runScriptlet(i,e,t);s!==n&&(s?zuix.runScriptlet(e.attr("@then"),e,t):zuix.runScriptlet(e.attr("@else"),e,t),n=s),o(n)}}},this._fieldCache=[],this}function N(t){return"function"!=typeof t.for&&(t.for=function(e){return y[e]=t,t}),t}function E(t,e,n){i.isNoU(n)&&(n=this),null==n._fieldCache&&(n._fieldCache={});let o=null;return void 0===n._fieldCache[t]?(o=s(e).find(i.dom.queryAttribute(p.zField,t)+",["+CSS.escape("#"+t)+"]"),null!=o&&o.length()>0&&(n._fieldCache[t]=o,1===o.length()&&i.isNoU(o.field)&&(o.field=function(t){return E(t,o,o)}))):o=n._fieldCache[t],o}function T(t,e){t=d.resolvePath(t);let n=null;return i.isNoU(e)?n=new c(zuix,e={},S):(e.componentId=t,i.isNoU(e.contextId)?(!1===e&&(e={}),e.contextId="zuix-ctx-"+ ++w,n=k(e)):(n=U(e.contextId),null!==n?n.options(e):n=k(e))),n.componentId!=t&&(n.componentId=t),e.ready&&(n.ready=e.ready),e.loaded&&(n.loaded=e.loaded),e.error&&(n.error=e.error),null==v[t]?(v[t]=!0,O(n,e)):(null==_[t]&&(_[t]=[]),_[t].push({c:n,o:e}),n)}function A(t){let e=zuix.store("config");return null!=e&&null!=e[location.host]&&(e=e[location.host]),!(t=d.resolvePath(t)).startsWith("/")&&t.indexOf("://")<0&&(t=(null!=e&&null!=e.resourcePath?e.resourcePath:"")+t),t}function O(t,e){let n=R(t.componentId);null!==n&&null==e.controller&&null==t.controller()&&(t.controller(n.controller),o.t(t.componentId+":js","component:cached:js"));const s=function(i){!1!==e.css&&"string"!=typeof e.css?(i[t.componentId].step(t.componentId+":css"),t.loadCss({success:function(t){n.css=t},error:function(e){o.e(e,t)},then:function(){H(t,i[t.componentId])}})):H(t,i[t.componentId])};return i.isNoU(e.view)?(null!==n&&(null!=n.view&&(t.view(n.view),o.t(t.componentId+":html","component:cached:html")),!1!==e.css&&"string"!=typeof e.css&&(e.css=!1,n.css_applied||(n.css_applied=!0,t.style(n.css),o.t(t.componentId+":css","component:cached:css")))),i.isNoU(t.view())?x("resource-loader").queue(t.componentId+":html",(function(){v[t.componentId]=this,t.loadHtml({cext:e.cext,success:function(e){null==n&&(n=P(t)),n.view=e,delete n.controller,s(v)},error:function(n){o.e(n,t),e.error&&t.error.call(t,n,t)}})}),e.priority):x("resource-loader").queue(t.componentId+":css",(function(){v[t.componentId]=this,s(v)}),e.priority),t):(t.view(e.view),null==t.controller()?x("resource-loader").queue(t.componentId+":js",(function(){v[t.componentId]=this,H(t,v[t.componentId])}),f.length):H(t),t)}function j(t){const e=function(t){if(t instanceof Element){const e=t;t=zuix.context(e),d.dequeue(e)}!i.isNoU(t)&&t.dispose&&t.dispose()};t&&t.each?t.each((function(t,n){e(n)})):e(t)}function k(t){const e=new c(zuix,t,S);return f.push(e),e}function U(t,e){let n=null;if(t instanceof s.ZxQuery)t=t.get();else if("string"==typeof t){const e=s.find(i.dom.queryAttribute(p.zContext,t));e.length()>0&&(t=e.get())}if(s.each(f,(function(e,o){if(t instanceof Element&&(o.view()===t||o.container()===t)||i.objectEquals(o.contextId,t))return n=o,!1})),e&&(t instanceof Element||t instanceof s.ZxQuery))if(null!=n&&n.isReady)e.call(n,n);else{if(t instanceof Element&&t.getAttribute("shadow"))return n=zuix.context(t.getAttribute("shadow")),setTimeout((function(){e.call(n,n)}),10),n;s(t).one("component:ready",(function(){n=zuix.context(this),setTimeout((function(){e.call(n,n)}),10)}))}return n}function S(t,e,n){m[e]&&m[e].call(t,n,t)}function R(t){let e=null;return s.each(b,(function(n,o){if(i.objectEquals(o.componentId,t))return e=o,!1})),e}function H(t,e){if(void 0===t.options().controller&&null===t.controller())if(o.d(t.componentId,"controller:load"),i.isNoU(e)||e.step(t.componentId+":js"),y[t.componentId])t.controller(y[t.componentId]),q(t,e);else{const n=function(e){const n=t.componentId+".js";s.ajax({url:A(n),success:function(e){e+='\n//# sourceURL="'+t.componentId+'.js"\n';try{t.controller($(e));let n=R(t.componentId);null==n&&(n={componentId:t.componentId,controller:t.controller()},b.push(n))}catch(n){o.e(new Error,n,e,t),t.error&&t.error.call(t,n,t)}},error:function(e){o.e(e,new Error,t),t.error&&t.error.call(t,e,t)},then:function(){q(t,e)}})};i.isNoU(e)?x("resource-loader").queue(t.componentId+":js",(function(){n(v[t.componentId]=this)}),t.options().priority):n(e)}else q(t,e)}function P(t){const e=t.view().innerHTML,n=s.wrapElement("div",e),i={componentId:t.componentId,view:n.innerHTML,css:"string"==typeof t.options().css?null:t._css,controller:t.controller()};return b.push(i),o.t(t.componentId,"bundle:added"),i}function q(t,e){if(v[t.componentId]=null,i.isNoU(t.view()))o.e(t.componentId,"component:view:undefined");else{let r=R(t.componentId);t.options().viewDeferred?o.d(t.componentId,"component:deferred:load"):null===r?r=P(t):null==r.controller&&(r.controller=t.controller());const l=s(t.view());if(null==l.attr(p.zContext)&&l.attr(p.zContext,t.contextId),o.d(t.componentId,"component:initializing"),t.controller()){const c=t._c=new u(t);c.log=n(381)(t.contextId),c.init&&c.init();const a=function(){e&&o.d(t.componentId,"controller:create:deferred"),function(t){const e=t.context;o.t(e.componentId,"controller:init","timer:init:start"),e.isReady=!0;const n=t.view();t.create&&t.create(),t.trigger("view:create",n);(function(){if(e.loaded&&e.loaded.call(e,e),null!=_[e.componentId]){const t=_[e.componentId];let n;for(_[e.componentId]=null;null!=t&&null!=(n=t.shift());)O(n.c,n.o)}s().one("componentize:end",(function(){setTimeout((function(){n.find(i.dom.queryAttribute(p.zLoaded,"false",i.dom.cssNot(p.zComponent))).each((function(t,e){this.attr(p.zLoaded,null)})),zuix.componentize(n)}))}))})(),t.trigger("component:loaded",n,!0);const r=function(){const s=[":on",":model",":behavior",":ready"];Array.from(n.get().attributes).filter((t=>s.find((e=>t.nodeName.startsWith(e))))).forEach((s=>{const r=s.nodeName,l=r.lastIndexOf(":")<2;let c,u=s.nodeValue;u.match(/^[^<>()\[\]\-+\s!?/&£"=^#@:;,.*|]+$/g)||(u=`(event, args) => { ${s.nodeValue} }`),(r.startsWith(":model")||l)&&(u=`(${s.nodeValue})`);try{c=zuix.runScriptlet(u,n,n,null)}catch(t){o.warn(r,s.nodeValue,t)}if(null!=c)if(":ready"!==r){if(r.startsWith(":on")||r.startsWith(":behavior")){if(l)return void t.on(c);const e=r.substring(r.indexOf(":",1)+1);r.startsWith(":behavior")?t.addBehavior(e,c):t.addEvent(e,c)}else if(r.startsWith(":model")){if(l)return void e.model(c);const t=r.match(/[^:]+/g).splice(1);let n=e.model();t.forEach(((e,o)=>{if(e=i.hyphensToCamelCase(e),o===t.length-1)return n[e]=c;n=n[e]=n[e]||{}}))}}else e.ready=c}));zuix.context(n)===e&&n.find("*").each((function(t,o,i){M(n,i)&&function(t,e){Array.from(e.get().attributes).forEach((o=>{const i=o.nodeName;if(i.startsWith("(")&&i.endsWith(")")){let s=o.nodeValue;s.match(/^[^<>()\[\]\-+\s!?/&£"=^#@:;,.*|]+$/g)||(s=`(event, args) => { ${o.nodeValue} }`);const r=i.substring(1,i.length-1),l=zuix.runScriptlet(s,e,n,null);e===n?t.on(r,l):e.on(r,l)}}))}(e,i)})),e.ready&&e.ready.call(e,e),t.trigger("component:ready",n,!0)},l=zuix.store("handlers"),c=e.contextId,u=n.find(':scope > [type="jscript"]');u._selection=u._selection.concat(s(document).find('[type="jscript"][for="'+c+'"]')._selection),e.handlers.refresh=function(t,n,o,r){if(!e._disposed){if(e._dependencyResolver&&!e._dependencyResolver.resolved())return e.$.hasClass("not-ready")||e.$.addClass("not-ready"),r(o);null!=e._dependencyResolver&&!1!==e._dependencyResolver&&(e.$.removeClass("not-ready"),e._dependencyResolver=!1);let l=e._refreshHandler;if(!l){const a="return (function($this, context, args){const $ = context.$; const model = context.model(); ";let h='"use strict"; expose = {}; function refresh() {}; function ready() { return true; }; ';e["#"]&&s.each(e["#"],(function(t,e){const n=i.hyphensToCamelCase(t);h+="const $"+n+' = context["#"].'+n+";",h+="const "+n+" = $"+n+".get();",h+="let _"+n+" = null; zuix.context("+n+", function(c) { _"+n+" = c; });"})),h+="function runScriptlet($el, s, args) { let result; try { result = eval(\"const $this = $el; let _this = null; zuix.context(this, (ctx) => _this = ctx); \" + s) } catch (e) { console.error('SCRIPTLET ERROR', e, s); }; return result };";const d=[];let p="";d.push(c),u.each((function(n,o,i){zuix.context(t)===e&&(null!=i.attr("using")&&d.push(...i.attr("using").split(/[\s|,]+/g)),i.parent().get()!==t.get()&&i.attr("for")!==c||(p+=i.html()+";"))}));let f="";if(d.length>0){let t="";if(d.forEach((function(n){const o=i.hyphensToCamelCase(n),s="let "+o+' = window["'+o+'"]; if ('+o+" == null) { "+o+' = zuix.context("'+n+'"';!1!==e._dependencyResolver?f+=s+", function(ctx) { "+o+" = ctx; }); }":f+=s+"); }",t+=o+" && "})),!1!==e._dependencyResolver&&f.length>0&&(f+="const resolved = function() { return "+t+"true; };",e._dependencyResolver=Function(a+f+"; return { resolved }; }).call(this.$el.get(), this.$el, this.ctx, this.args);").call({$el:n,ctx:e,args:null}),!e._dependencyResolver.resolved()))return r(o)}h+=f+p;const m=h+"; return { refresh, runScriptlet, ready, expose }; }).call(this.$el.get(), this.$el, this.ctx, this.args);";l=e._refreshHandler=Function(a+";"+m).call({$el:n,ctx:e,args:null}),l.expose&&Object.assign(e,l.expose)}!e._dependencyResolver&&l.refresh&&e._refreshHandler.refresh(),r&&r(o)}};const a=[];if(n.find("*").each((function(o,i,s){M(n,s)&&zuix.context(n)===e&&a.push(...function(n,o){const i=o.get(),s=[];for(let r=0;r1&&c.startsWith("@")){const r=c.substring(1).split(":")[0];let u=e.handlers?e.handlers[r]:null;if(u||(u=l[r]),u){const e=zuix.activeRefresh(n,o,t.model(),(function(t,e,s,r){o.attr(p.zLoad)&&"true"!==o.attr(p.zReady)?null==zuix.context(o)&&r(s):u.call(i,n,o,s,r,c)}));s.push(e)}}}return s}(n,s))})),a.length>0||u.length()>0){const o=u.length()>0?u.attr("refreshdelay"):null,i=u.length()>0?u.attr("handlersdelay"):null;e.handlers.refresh.call(n.get(),n,n,t.model(),(function(t,s){zuix.activeRefresh(n,n,t,(function(t,s,l,c){if(e._refreshHandler&&!e._refreshHandler.initialized){let t=!0;a.forEach((function(e){if(null!=e.$element.attr(p.zLoad)||null!=e.$element.attr(p.zInclude))return t=null!=zuix.context(e.$element)&&zuix.context(e.$element).isReady,t})),t&&!0===e.isReady&&e._refreshHandler.ready()?(e._refreshHandler.initialized=!0,a.forEach((function(t){t.start(i)})),e.$.removeClass("not-ready"),r()):e.$.hasClass("not-ready")||e.$.addClass("not-ready"),c(l,o,!0)}else e.handlers.refresh.call(n.get(),n,n,l,c)})).start(o)}))}else e.handlers.refresh.call(n.get(),n,n),r();o.t(e.componentId,"controller:init","timer:init:stop"),o.i(e.componentId,"component:loaded",c)}(c),e&&e.end(),l.attr(p.zReady,"true")};if(i.isNoU(c.view())||null!=c.view().attr(p.zComponent)||c.view().attr(p.zComponent,""),i.isNoU(t.model())&&!i.isNoU(t.view())&&t.viewToModel(),t.options().viewDeferred){t.options().viewDeferred=!1,c.saveView(),null===r&&"default"!==t.componentId&&(r={componentId:t.componentId,controller:t.controller()},b.push(r),o.t(t.componentId,"bundle:added"),o.d(t.componentId,"component:deferred:load"));const e=function(){!1!==t.options().html?("string"==typeof t.options().html&&(r.view=t.options().html),null==r.view?t.loadHtml({cext:t.options().cext,success:function(e){r.view=e,o.d(t.componentId,"component:deferred:html")},error:function(e){o.e(e,t),t.options().error&&t.options().error.call(t,e,t)},then:function(){o.d(t.componentId,"controller:create:2"),a()}}):(t.view(r.view),a())):(o.d(t.componentId,"controller:create:3"),a())};!1!==t.options().css&&"string"!=typeof t.options().css?null==r.css?t.loadCss({success:function(e){r.css=e,o.d(t.componentId,"component:deferred:css")},then:function(){e()}}):(t.style(r.css),e()):("string"==typeof t.options().css&&t.style(t.options().css),e())}else o.d(t.componentId,"controller:create:1"),a()}else o.w(t.componentId,"component:controller:undefined")}}function M(t,e){const n=[...I,i.dom.queryAttribute(p.zLoad),i.dom.queryAttribute(p.zInclude)].join(",");return e.parent("pre,code,"+n).get()===t.get()}function $(t){let e=function(t){};if("string"==typeof t)try{const n=Function(i.normalizeControllerCode(t))();if("function"!=typeof n)throw new Error('Unexpected module type: "'+typeof n+'"');e=n}catch(e){o.e(this,e,t)}return e}L.prototype.field=function(t,e,n){return E.call(this,t,e,n)},L.prototype.load=function(t,e){return T.call(this,t,e)},L.prototype.unload=function(t){return j(t),this},L.prototype.loadComponent=function(t,e,n,o){return function(t,e,n,o){j(t=s(t)),t.each((function(t,i,s){!function(t){if(t.attr(p.zLoad,e),n&&t.attr(n,""),o&&o.lazyLoad&&"true"===o.lazyLoad.toString()||"true"===t.attr(p.zLazy))return o&&(t.get().__zuix_loadOptions=o),!1;let i=t.get().shadowRoot;if(null==i&&o&&o.container instanceof ShadowRoot?(i=o.container,delete o.container):i&&o&&delete o.container,i){const e=document.createElement("div");Array.from(t.get().attributes).forEach((n=>{n.nodeName.match(/^[(#@)]/)||(e.setAttribute(n.nodeName,n.nodeValue),t.attr(n.nodeName,null))})),setTimeout((function(){for(;t.get().firstChild;)e.appendChild(t.get().firstChild);i.appendChild(e),zuix.context(e,(e=>{t.attr("shadow",e.contextId)})),d.loadInline(e,o)}))}else d.loadInline(t,o)}(s)}))}(t,e,n,o),this},L.prototype.controller=function(t){return N.call(this,t)},L.prototype.context=function(t,e){return U.call(this,t,e)},L.prototype.createComponent=function(t,e){if(null==e&&(e={}),i.isNoU(e.contextId)&&(e.contextId="zuix-ctx-"+ ++w),null!=U(e.contextId))throw new Error("Context already exists.");return e.container=document.createElement("div"),e.componentId=t,d.applyOptions(e.container,e),k(e)},L.prototype.trigger=function(t,e,n){return S(t,e,n),this},L.prototype.hook=function(t,e){var n,s;return n=t,s=e,i.isNoU(s)?delete m[n]:(m[n]&&o.w("Hook override",'"'+n+'"',"OLD",m[n],"NEW",s),m[n]=s),this},L.prototype.using=function(t,e,n,o){e=d.resolvePath(e);const r=(t=t.toLowerCase())+"-"+e.hashCode();return x("resource-loader").queue(r,(function(){const l=v[r]=this;if("component"===t){const t=U(r);null==t?zuix.load(e,{contextId:r,view:"",priority:-10,ready:function(t){l.end(),n&&n(e,t)},error:function(){l.end(),n&&n(e,null)}}):(l.end(),n&&n(e,t))}else{const c="style"===t;if(0===s.find(t+'[id="'+r+'"]').length()){const u=(c&&o?i.dom.getShadowRoot(o.view()):null)||document.head||document.getElementsByTagName("head")[0],a=document.createElement(t);c?(a.type="text/css",a.id=r):(a.type="text/javascript",a.id=r),u.appendChild(a);const h=function(t){c?a.styleSheet?a.styleSheet.cssText=t:a.appendChild(document.createTextNode(t)):a.innerText?a.innerText=t:a.appendChild(document.createTextNode(t)),l.end(),n&&n(e,r)},d="_res/"+t+"/"+r,p=R(d);null!=p?h(c?p.css:p.controller):s.ajax({url:e,success:function(t){const n={componentId:d,view:null,css:c?t:null,controller:c?null:t,using:e};b.push(n),h(t)},error:function(){u.removeChild(a),l.end(),n&&n(e)}})}else l.end(),n&&n(e,r)}})),this},L.prototype.lazyLoad=function(t,e){return null==t?d.lazyLoad():(d.lazyLoad(t,e),this)},L.prototype.componentize=function(t){return!1===t?z=!0:!0===t&&(z=!1,t=null),z||d.componentize(t),this},L.prototype.store=function(t,e){return null!=e&&(this._store[t]=e),this._store[t]},L.prototype.getResourcePath=function(t){return A(t)},L.prototype.observable=function(t){return C.observable(t)},L.prototype.activeRefresh=function(t,e,n,o){return new h(t,e,n,o)},L.prototype.bundle=function(t,e){if(i.isNoU(t))return b;if(t&&"boolean"==typeof t){o.t("bundle:start");const t=d.lazyLoad();if(d.lazyLoad(!1),d.componentize(),e){const n=function(n){setTimeout((function(){d.willLoadMore()?(o.t("bundle:wait"),n(n)):(o.t("bundle:end"),d.lazyLoad(t),e())}),1e3)};n(n)}}else{for(let e=0;e { return p.indexOf(i) !== -1; - }) && - p.every(function(i) { - return util.objectEquals(x[i], y[i]); - }); + }) && p.every( (i) => { + return this.objectEquals(x[i], y[i]); + }); }, propertyFromPath: function(o, s) { @@ -495,7 +467,7 @@ module.exports = { if (obj === null || typeof obj !== 'object') { return obj; } - // Give temp the original obj's constructor + // Give temp the original object's constructor // var temp = obj.constructor(); // for (var key in obj) // temp[key] = cloneObject(obj[key]); @@ -528,10 +500,10 @@ module.exports = { }, hyphensToCamelCase: function(s) { - return s.replace(/-([a-z0-9_$-])/g, function(g) { + return s.replace(/--/g, ':').replace(/-([a-z0-9_$-])/g, function(g) { return '_$-'.indexOf(g[1]) > -1 || (+g[1]).toString() === g[1] ? '_' + g[1].replace('-', '_') : g[1].toUpperCase(); - }); + }).replace(/:/g, '-'); }, camelCaseToHyphens: function(s) { @@ -564,7 +536,7 @@ module.exports = { dom: { queryAttribute: function(name, value, appendValue) { - const fields = name.split(','); + const fields = name.split(/[\s|,]+/g); let selector = ''; fields.forEach(function(v, i) { if (value != null) { @@ -582,7 +554,7 @@ module.exports = { getAttribute: function(element, name) { let value; if (typeof name === 'string' && name.indexOf(',') !== -1) { - const fields = name.split(','); + const fields = name.split(/[\s|,]+/g); for (let i = 0; i < fields.length; i++) { const f = fields[i]; const a = element.getAttribute(f); @@ -596,7 +568,7 @@ module.exports = { }, setAttribute: function(element, name, value) { if (typeof name === 'string' && name.indexOf(',') !== -1) { - const fields = name.split(','); + const fields = name.split(/[\s|,]+/g); const _t = this; fields.forEach(function(f) { _t.setAttribute(element, f, value); @@ -778,10 +750,10 @@ const util = __webpack_require__(826); * @property {'transition'|'animation'} type The type of effect to play. * @property {Element|ZxQuery} target Target element. * @property {Array|string} classes List of transition or animation classes to play. - * @property {object} options Transition/animation options ('delay', 'duration', etc..). - * @property {boolean} holdState Hold last transition/animation class. - * @property {PlayFxCallback} onStep Since class list can contain more than just two classes, this callback will be called after each pair of transition/animation ended. - * @property {PlayFxCallback} onEnd Called when all transitions/animations ended. + * @property {object} [options] Transition/animation options ('delay', 'duration', etc..). + * @property {boolean} [holdState] Hold last transition/animation class. + * @property {PlayFxCallback} [onStep] Since class list can contain more than just two classes, this callback will be called after each pair of transition/animation ended. + * @property {PlayFxCallback} [onEnd] Called when all transitions/animations ended. */ /** @@ -848,6 +820,21 @@ function removeAllEventHandlers(el) { } }); } +function getPlayFxConfig(type, target, options) { + let classes = options.classes; + if (typeof options === 'string') { + classes = options.split(/[\s|,]+/g); + options = {}; + } else if (Array.isArray(options)) { + classes = options; + options = {}; + } + return Object.assign({ + type, + classes, + target + }, options); +} /** * The constructor takes one optional argument that can be @@ -882,8 +869,9 @@ function ZxQuery(element) { } else if (typeof element === 'string') { this._selection = document.documentElement.querySelectorAll(element); } else if (element !== null) { // if (typeof element === 'string') { - _log.e('ZxQuery cannot wrap object of this type.', (typeof element), element); - throw new Error('ZxQuery cannot wrap object of this type.'); + const msg = 'ZxQuery cannot wrap object of this type.'; + _log.e(msg, (typeof element), element); + throw new Error(msg); } return this; } @@ -1120,16 +1108,14 @@ ZxQuery.prototype.on = function(eventPath, eventHandler) { }); return this; } - const events = eventPath.match(/\S+/g) || []; + const events = eventPath.split(/[\s|,]+/g) || []; let options; if (typeof eventHandler !== 'function') { options = eventHandler; eventHandler = options.handler; } this.each(function(k, el) { - z$.each(events, function(k, ev) { - addEventHandler(el, ev, eventHandler, options); - }); + events.map((ev) => addEventHandler(el, ev, eventHandler, options)); }); return this; }; @@ -1148,11 +1134,9 @@ ZxQuery.prototype.off = function(eventPath, eventHandler) { }); return this; } - const events = eventPath.match(/\S+/g) || []; + const events = eventPath.split(/[\s|,]+/g) || []; this.each(function(k, el) { - z$.each(events, function(k, ev) { - removeEventHandler(el, ev, eventHandler); - }); + events.map((ev) => removeEventHandler(el, ev, eventHandler)); }); return this; }; @@ -1221,13 +1205,9 @@ ZxQuery.prototype.css = function(prop, val) { * @return {ZxQuery} The *ZxQuery* object itself. */ ZxQuery.prototype.addClass = function(className) { - const classes = className.match(/\S+/g) || []; + const classes = className.split(/[\s|,]+/g) || []; z$.each(this._selection, function(k, el) { - if (el.classList) { - z$.each(classes, function(k, cl) { - el.classList.add(cl); - }); - } else el.className += ' ' + className; + classes.map((cl) => el.classList.add(cl)); }); return this; }; @@ -1247,13 +1227,9 @@ ZxQuery.prototype.hasClass = function(className) { * @return {ZxQuery} The *ZxQuery* object itself. */ ZxQuery.prototype.removeClass = function(className) { - const classes = className.match(/\S+/g) || []; + const classes = className.split(/[\s|,]+/g) || []; z$.each(this._selection, function(k, el) { - if (el.classList) { - z$.each(classes, function(k, cl) { - el.classList.remove(cl); - }); - } else el.className = el.className.replace(new RegExp('(^|\\b)' + className.split(' ').join('|') + '(\\b|$)', 'gi'), ' '); + classes.map((cl) => el.classList.remove(cl)); }); return this; }; @@ -1443,20 +1419,7 @@ ZxQuery.prototype.hide = function() { * @return {ZxQuery} */ ZxQuery.prototype.playTransition = function(options) { - let classes = options.classes; - if (typeof options === 'string') { - classes = options.split(' '); - options = {}; - } else if (Array.isArray(options)) { - classes = options; - options = {}; - } - const config = Object.assign({ - classes, - target: this, - type: 'transition' - }, options); - z$.playFx(config); + z$.playFx(getPlayFxConfig('transition', this, options)); return this; }; /** @@ -1467,20 +1430,7 @@ ZxQuery.prototype.playTransition = function(options) { * @return {ZxQuery} */ ZxQuery.prototype.playAnimation = function(options) { - let classes = options.classes; - if (typeof options === 'string') { - classes = options.split(' '); - options = {}; - } else if (Array.isArray(options)) { - classes = options; - options = {}; - } - const config = Object.assign({ - classes, - target: this, - type: 'animation' - }, options); - z$.playFx(config); + z$.playFx(getPlayFxConfig('animation', this, options)); return this; }; /** @@ -1576,14 +1526,14 @@ ZxQueryStatic.ajax = const xhr = new XMLHttpRequest(); xhr.onload = function() { if (xhr.status === 200) { - if (util.isFunction(options.success)) options.success(xhr.responseText); + if (options.success) options.success(xhr.responseText); } else { - if (util.isFunction(options.error)) options.error(xhr, xhr.statusText, xhr.status); + if (options.error) options.error(xhr, xhr.statusText, xhr.status); } - if (util.isFunction(options.then)) options.then(xhr); + if (options.then) options.then(xhr); }; xhr.onerror = function(xhr, textStatus, errorThrown) { - if (util.isFunction(options.error)) options.error(xhr, textStatus, errorThrown); + if (options.error) options.error(xhr, textStatus, errorThrown); }; if (typeof options.beforeSend == 'function') { options.beforeSend(xhr); @@ -1592,7 +1542,7 @@ ZxQueryStatic.ajax = xhr.open('GET', url); xhr.send(); } catch (e) { - if (util.isFunction(options.error)) options.error(xhr, xhr.statusText, xhr.status, e); + if (options.error) options.error(xhr, xhr.statusText, xhr.status, e); } return this; }; @@ -1607,15 +1557,11 @@ ZxQueryStatic.ajax = * @return {boolean} */ ZxQueryStatic.hasClass = function(el, className) { - const classes = className.match(/\S+/g) || []; + const classes = className.split(/[\s|,]+/g) || []; let success = false; z$.each(classes, function(k, cl) { - if (el.classList) { - success = el.classList.contains(cl); - } else { - success = (new RegExp('(^| )' + cl + '( |$)', 'gi').test(el.className)); - } - if (success) return false; + success = el.classList.contains(cl); + if (success) return false; // break loop }); return success; }; @@ -1629,7 +1575,7 @@ ZxQueryStatic.hasClass = function(el, className) { * @return {boolean} */ ZxQueryStatic.classExists = function(className) { - const classes = className.match(/\S+/g) || []; + const classes = className.split(/[\s|,]+/g) || []; let success = false; z$.each(classes, function(k, cl) { // Perform global style check @@ -1794,54 +1740,6 @@ ZxQueryStatic.appendCss = function(css, target, cssId, container) { } return style; }; -/** - * Replaces CSS variables with provided values. - * - * @method replaceCssVars - * @memberOf ZxQueryStatic - * @alias zuix.$.replaceCssVars - * @param {string} css Stylesheet text - * @param {object} model Object containing variables fields and values. - * @return {string} The new stylesheet text with variables replaced with values - */ -ZxQueryStatic.replaceCssVars = function(css, model) { - const vars = new RegExp(/\B\$var\[(.*[^\[\]])]/g); - let outCss = ''; - let matched = 0; - let currentIndex = 0; - let result; - while (result = vars.exec(css)) { - let value = result[0]; - if (result.length > 1) { - const name = result[1]; - // resolve dotted field path - let cur = model; - if (name.indexOf('.') > 0) { - const path = name.split('.'); - for (let p = 0; p < path.length - 1; p++) { - cur = cur[path[p]]; - if (typeof cur === 'undefined') { - break; - } - } - if (typeof cur !== 'undefined') { - value = cur[path[path.length - 1]]; - matched++; - } - } else if (typeof cur[name] !== 'undefined') { - value = cur[name]; - matched++; - } - } - outCss += css.substring(currentIndex, result.index)+value; - currentIndex = result.index+result[0].length; - } - if (matched > 0) { - outCss += css.substring(currentIndex); - css = outCss; - } - return css; -}; /** * Parses variables enclosed in single or double braces and calls the given callback for each parsed variable name. * If the callback returns a value, then the variable will be replaced with the given value. @@ -1868,7 +1766,7 @@ ZxQueryStatic.replaceBraces = function(html, callback) { continue; } let value = result[0]; - if (typeof callback === 'function') { + if (callback) { const r = callback(result[0]); if (!util.isNoU(r)) { value = r; @@ -2063,7 +1961,7 @@ ZxQueryStatic.playFx = function(config) { if (config.classes == null) { config.classes = []; } else if (typeof config.classes === 'string') { - config.classes = config.classes.split(' '); + config.classes = config.classes.split(/[\s|,]+/g); } const classOut = config.classes.length > 1 && config.classes.shift(); if (!$el.hasClass('--z-playing')) { @@ -2079,7 +1977,7 @@ ZxQueryStatic.playFx = function(config) { if (expired) return; expired = true; if (config.classes.length > 1) { - if (typeof config.onStep === 'function') { + if (config.onStep) { config.onStep.call($el, $el, config.classes.slice(1)); } _t.playFx(config); @@ -2088,7 +1986,7 @@ ZxQueryStatic.playFx = function(config) { $el.removeClass(config.classes.shift()); } $el.removeClass('--z-playing'); - if (typeof config.onEnd === 'function') { + if (config.onEnd) { config.onEnd.call($el, $el); } } @@ -2848,6 +2746,31 @@ function dataBind(el, boundData) { z$(el).html('').append(v); } } +/** + * Query binding adapter for resolving `boundField`->$el mapping + * @param {ComponentContext} _t + * @param {ZxQuery} $view + * @param {ZxQuery} $el + * @param {BindingAdapterCallback} fn The binding adapter callback + * @param {string} field Bound field name + */ +function queryAdapter(_t, $view, $el, fn, field) { + if (fn && !_t._disposed) { + (fn).call($view, $el, field, $view, /** @type {BindingAdapterRefreshCallback} */ function(retryMs) { + // data adapter is not ready, retry after 1s + if (!_t._disposed) { + const timeoutId = $el.get().dataset.__zuix_refreshTimeout; + if (timeoutId && _queryAdapterRefreshTimeout[timeoutId]) { + clearTimeout(_queryAdapterRefreshTimeout[timeoutId]); + } + $el.get().dataset.__zuix_refreshTimeout = + setTimeout(function() { + queryAdapter(_t, $view, $el, fn, field); + }, retryMs ? retryMs : 500); + } + }); + } +} /** * The component context object represents the component instance itself, and it holds @@ -2873,7 +2796,7 @@ function ComponentContext(zuixInstance, options, eventCallback) { this.componentId = null; this.handlers = {refresh: function($view, $el, contextData, refreshCallback) {}}; this.trigger = function(context, eventPath, eventValue) { - if (typeof eventCallback === 'function') { + if (eventCallback) { eventCallback(context, eventPath, eventValue); } }; @@ -2932,29 +2855,34 @@ function ComponentContext(zuixInstance, options, eventCallback) { // TODO: maybe implement a {ContextController} callback for this too }, set: function(target, key, value, path, old) { + const view = this.context.$; if (target instanceof Element) { // use the first part of the "path" as field name (eg. 'text.innerHTML' --> 'text') // for binding data to view element path = path.split('.')[0]; value = target; } - // update bound field if found in the view - const view = z$(this.context.view()); - if (view.get()) { - let fld = view.find(util.dom.queryAttribute(_optionAttributes.zBind, path)); - if (fld.get() != null) { - fld.each(function(i, f) { - dataBind(f, value); - }); + if (typeof value === 'function') { + let field = view.find(util.dom.queryAttribute(_optionAttributes.zBind, path)); + if (field.get() == null) { + field = view.find(util.dom.queryAttribute(_optionAttributes.zField, path)); } - fld = view.find(util.dom.queryAttribute(_optionAttributes.zField, path)); + queryAdapter(this.context, view, field, value, key) + return; + } + // update bound field if found in the view + const bindFields = function(fld) { if (fld.get() != null) { fld.each(function(i, f) { dataBind(f, value); }); } + }; + if (view.get()) { + bindFields(view.find(util.dom.queryAttribute(_optionAttributes.zBind, path))); + bindFields(view.find(util.dom.queryAttribute(_optionAttributes.zField, path))); // call controller's 'update' method - if (this.context._c && typeof this.context._c.update === 'function') { + if (this.context._c && this.context._c.update) { this.context._c.update(target, key, value, path, old); } } @@ -3010,7 +2938,7 @@ ComponentContext.prototype.dispose = function() { }); } } - if (util.isFunction(this._c.dispose)) { + if (this._c.dispose) { this._c.dispose.call(this, this); } } @@ -3098,13 +3026,14 @@ ComponentContext.prototype.view = function(view) { // add `z-field` from '#' attributes for (let j = 0; j < el.attributes.length; j++) { const a = el.attributes.item(j); - const attributeName = a.name; - if (attributeName.length > 1 && attributeName.startsWith('#')) { + const v = a.value; + if (a.name.length > 1 && a.name.startsWith('#')) { + const attributeName = util.hyphensToCamelCase(a.name.substring(1)); if ($el.attr(_optionAttributes.zField) == null) { - $el.attr(_optionAttributes.zField, attributeName.substring(1)); + $el.attr(_optionAttributes.zField, attributeName); } - if ($el.attr(_optionAttributes.zBind) == null && a.value != null && a.value.length > 0) { - $el.attr(_optionAttributes.zBind, a.value); + if ($el.attr(_optionAttributes.zBind) == null && v != null && v.length > 0) { + $el.attr(_optionAttributes.zBind, v); } } } @@ -3301,7 +3230,7 @@ ComponentContext.prototype.style = function(css) { _log.t(this.componentId, 'view:style', 'timer:view:start', cssId); if (css == null || css instanceof Element) { this._css = (css instanceof Element) ? css.innerText : css; - this._style = z$.appendCss(css, this._style, this.componentId + '@' + cssId, util.dom.getShadowRoot(this._container)); + this._style = z$.appendCss(css, this._style, this.componentId + '@' + cssId, util.dom.getShadowRoot(this._view)); } else if (typeof css === 'string') { // store original unparsed css (might be useful for debugging) this._css = css; @@ -3327,7 +3256,7 @@ ComponentContext.prototype.style = function(css) { ); // output css - this._style = z$.appendCss(css, this._style, this.componentId + '@' + cssId, util.dom.getShadowRoot(this._container)); + this._style = z$.appendCss(css, this._style, this.componentId + '@' + cssId, util.dom.getShadowRoot(this._view)); } this.checkEncapsulation(); // TODO: should throw error if ```css``` is not a valid type @@ -3411,7 +3340,7 @@ ComponentContext.prototype.model = function(model) { } this.modelToView(); // call controller `update` method when whole model is updated - if (this._c != null && util.isFunction(this._c.update)) { + if (this._c != null && this._c.update) { this._c.update.call(this._c, null, null, null, null, this._c); } } @@ -3515,10 +3444,10 @@ ComponentContext.prototype.loadCss = function(options, enableCaching) { } if (inlineStyles[cssPath] != null) { context.style(inlineStyles[cssPath]); - if (util.isFunction(options.success)) { + if (options.success) { (options.success).call(context, inlineStyles[cssPath], context); } - if (util.isFunction(options.then)) { + if (options.then) { (options.then).call(context, context); } } else { @@ -3529,10 +3458,10 @@ ComponentContext.prototype.loadCss = function(options, enableCaching) { context.style(viewCss); inlineStyle.detach(); inlineStyles[cssPath] = viewCss; - if (util.isFunction(options.success)) { + if (options.success) { (options.success).call(context, viewCss, context); } - if (util.isFunction(options.then)) { + if (options.then) { (options.then).call(context, context); } } else { @@ -3543,18 +3472,18 @@ ComponentContext.prototype.loadCss = function(options, enableCaching) { url: zuix.getResourcePath(cssPath), success: function(viewCss) { context.style(viewCss); - if (util.isFunction(options.success)) { + if (options.success) { (options.success).call(context, viewCss, context); } }, error: function(err) { _log.e(err, context); - if (util.isFunction(options.error)) { + if (options.error) { (options.error).call(context, err, context); } }, then: function() { - if (util.isFunction(options.then)) { + if (options.then) { (options.then).call(context, context); } } @@ -3606,10 +3535,10 @@ ComponentContext.prototype.loadHtml = function(options, enableCaching) { } if (inlineViews[htmlPath] != null) { context.view(inlineViews[htmlPath]); - if (util.isFunction(options.success)) { + if (options.success) { (options.success).call(context, inlineViews[htmlPath], context); } - if (util.isFunction(options.then)) { + if (options.then) { (options.then).call(context, context); } } else { @@ -3620,21 +3549,17 @@ ComponentContext.prototype.loadHtml = function(options, enableCaching) { util.dom.cssNot(_optionAttributes.zComponent) )); if (inlineView.length() > 0) { + let styles; let inlineElement = inlineView.get(0); if (inlineElement.tagName.toLowerCase() === 'template') { inlineElement = inlineElement.cloneNode(true); - const styles = inlineElement.content.querySelectorAll('style'); - if (styles) { - for (const s of styles) { - s.setAttribute('media', '#' + context.componentId); - } - } + styles = inlineElement.content.querySelectorAll('style'); } else { - const styles = inlineElement.querySelectorAll('style[media="#"]'); - if (styles) { - for (const s of styles) { - s.setAttribute('media', '#' + context.componentId); - } + styles = inlineElement.querySelectorAll('style[media="#"]'); + } + if (styles) { + for (const s of styles) { + s.setAttribute('media', '#' + context.componentId); } } inlineViews[htmlPath] = inlineElement.innerHTML; @@ -3648,10 +3573,10 @@ ComponentContext.prototype.loadHtml = function(options, enableCaching) { } else { context.view(inlineElement.innerHTML); } - if (util.isFunction(options.success)) { + if (options.success) { (options.success).call(context, inlineElement.innerHTML, context); } - if (util.isFunction(options.then)) { + if (options.then) { (options.then).call(context, context); } } else { @@ -3663,18 +3588,18 @@ ComponentContext.prototype.loadHtml = function(options, enableCaching) { url: zuix.getResourcePath(htmlPath), success: function(viewHtml) { context.view(viewHtml); - if (util.isFunction(options.success)) { + if (options.success) { (options.success).call(context, viewHtml, context); } }, error: function(err) { _log.e(err, context); - if (util.isFunction(options.error)) { + if (options.error) { (options.error).call(context, err, context); } }, then: function() { - if (util.isFunction(options.then)) { + if (options.then) { (options.then).call(context, context); } } @@ -3744,42 +3669,10 @@ ComponentContext.prototype.modelToView = function() { if (boundField == null) { boundField = $el.attr(_optionAttributes.zField); } - const v = z$(_t._view); - // map `z-field`s as properties of the context's member '#' if the variable name is valid - try { - const f = util.hyphensToCamelCase(boundField); - Function('function testName(){ const ' + f + ' = "test"; }'); - _t['#'][f] = _t.field(boundField); - } catch (e) { - // TODO: should at least log a 'Warning: unscriptable field name' - //console.log('ERROR', e); - } - /** - * Query binding adapter for resolving `boundField`->$el mapping - * @param {BindingAdapterCallback} fn The binding adapter callback - * @param {string} field Bound field name - */ - const queryAdapter = function(fn, field) { - if (fn && !_t._disposed) { - (fn).call(v, $el, field, v, /** @type {BindingAdapterRefreshCallback} */ function(retryMs) { - // data adapter is not ready, retry after 1s - if (!_t._disposed) { - const timeoutId = $el.get().dataset.__zuix_refreshTimeout; - if (timeoutId && _queryAdapterRefreshTimeout[timeoutId]) { - clearTimeout(_queryAdapterRefreshTimeout[timeoutId]); - } - $el.get().dataset.__zuix_refreshTimeout = - setTimeout(function() { - queryAdapter(fn, field); - }, retryMs ? retryMs : 500); - } - }); - } - }; if (typeof _t._model === 'function') { // use a data model binding adapter // to resolve all model fields' values - queryAdapter(_t._model, boundField); + queryAdapter(_t, $view, $el, _t._model, boundField); } else { let boundData = util.propertyFromPath(_t._model, boundField); const altField = util.hyphensToCamelCase(boundField); @@ -3791,7 +3684,7 @@ ComponentContext.prototype.modelToView = function() { if (typeof boundData === 'function') { // use data model's field binding adapter // to resolve boundField's value - queryAdapter(boundData, boundField); + queryAdapter(_t, $view, $el, boundData, boundField); } else if (boundData != null) { // use default binding method // to resolve boundField's value @@ -3799,6 +3692,25 @@ ComponentContext.prototype.modelToView = function() { } } }); + // new fields might been have added after data-binding + $view.find(util.dom.queryAttribute(_optionAttributes.zField)).each(function(i, el, $el) { + if (!zuix.isDirectComponentElement($view, $el) && $el.attr('inherits') !== 'true') { + return true; + } + let boundField = $el.attr(_optionAttributes.zBind); + if (boundField == null) { + boundField = $el.attr(_optionAttributes.zField); + } + // map `z-field`s as properties of the context's member '#' if the variable name is valid + try { + const f = util.hyphensToCamelCase(boundField); + Function('function testName(){ const ' + f + ' = "test"; }'); + _t['#'][f] = _t.field(boundField); + } catch (e) { + // TODO: should at least log a 'Warning: unscriptable field name' + //console.log('ERROR', e); + } + }); } _log.t(this.componentId, 'model:view', 'timer:mv:stop'); return this; @@ -4159,16 +4071,17 @@ function getNextLoadable() { let job = null; let item = _componentizeQueue.length > 0 ? _componentizeQueue.shift() : null; while (item != null && item.element != null) { + const el = item.element; // defer element loading if lazy loading is enabled and the element is not in view - const isLazy = lazyElementCheck(item.element); + const isLazy = lazyElementCheck(el); if (lazyLoad() && isLazy) { item.lazy = true; - item.visible = z$.getPosition(item.element, _lazyLoadingThreshold).visible; + item.visible = z$.getPosition(el, _lazyLoadingThreshold).visible; } else { item.lazy = false; item.visible = true; } - if (item.element != null && item.visible) { + if (el != null && item.visible) { job = { item: item, cancelable: item.lazy @@ -4187,10 +4100,11 @@ function loadNext(element) { queueLoadables(element); const job = getNextLoadable(); if (job != null && job.item != null && job.item.element != null) { - z$(job.item.element).one('component:loaded', function() { - zuix.componentize(job.item.element); + const el = job.item.element; + z$(el).one('component:loaded', function() { + zuix.componentize(el); }); - loadInline(job.item.element); + loadInline(el); } } @@ -4237,17 +4151,20 @@ function loadInline(element, opts) { options.container = element; } + const setAsTemplate = function() { + v.attr(_optionAttributes.zComponent, null); + // View-only templates have no controller + if (util.isNoU(options.controller)) { + options.controller = function() {}; + } + }; let componentId = v.attr(_optionAttributes.zLoad); if (util.isNoU(componentId)) { const include = v.attr(_optionAttributes.zInclude); if (include != null) { componentId = resolvePath(include); v.attr(_optionAttributes.zInclude, componentId); - v.attr(_optionAttributes.zComponent, null); - // Static include hove no controller - if (util.isNoU(options.controller)) { - options.controller = function() {}; - } + setAsTemplate(); } else { return false; } @@ -4256,11 +4173,7 @@ function loadInline(element, opts) { v.attr(_optionAttributes.zLoad, componentId); // check for `view` and `ctrl` type attributes if (componentId !== 'default' && v.attr(_optionAttributes.resourceType.view) !== null) { - v.attr(_optionAttributes.zComponent, null); - // Static includes have no controller - if (util.isNoU(options.controller)) { - options.controller = function() {}; - } + setAsTemplate(); } else if (componentId === 'default' || v.attr(_optionAttributes.resourceType.controller) !== null) { options.view = options.view || element; options.viewDeferred = true; @@ -4284,9 +4197,31 @@ function loadInline(element, opts) { // inline attributes have precedence over ```options``` - const model = v.attr(_optionAttributes.zModel); - if (!util.isNoU(model) && model.length > 0) { - options.model = parseOptions(element, model); + const exclusionList = [':on', ':model', ':behavior', ':ready']; // these are evaluated after component is created + const optionAttributes = Array.from(v.get().attributes) + .filter((a) => a.nodeName.startsWith(':') && !exclusionList.find((t) => a.nodeName.startsWith(t))); + optionAttributes.forEach((attribute) => { + const attr = attribute.nodeName; + const path = attr.match(/[^:]+/g); + let co = options; + path.forEach((p, i) => { + p = util.hyphensToCamelCase(p); + if (i === path.length - 1) { + let val; + try { + val = Function('return ' + attribute.nodeValue + ';')(); + } catch (e) { + _log.warn(path.join(':'), p, attribute.nodeValue, e); + } + return co[p] = val; + } + co = co[p] = co[p] || {}; + }); + }); + + const on = v.attr(_optionAttributes.zOn); + if (!util.isNoU(on) && on.length > 0) { + options.on = parseOptions(element, on); } const behavior = v.attr(_optionAttributes.zBehavior); @@ -4294,9 +4229,9 @@ function loadInline(element, opts) { options.behavior = parseOptions(element, behavior); } - const on = v.attr(_optionAttributes.zOn); - if (!util.isNoU(on) && on.length > 0) { - options.on = parseOptions(element, on); + const model = v.attr(_optionAttributes.zModel); + if (!util.isNoU(model) && model.length > 0) { + options.model = parseOptions(element, model); } const priority = v.attr(_optionAttributes.zPriority); @@ -4341,7 +4276,7 @@ function resolvePath(path) { /** @private */ function parseOptions(element, attributeValue) { if (typeof attributeValue === 'string') { - const parentComponent = z$(element).parent(util.dom.queryAttribute(_optionAttributes.zLoad)); + const parentComponent = z$(element).parent(util.dom.queryAttribute(_optionAttributes.zLoad) + ',' + util.dom.queryAttribute(_optionAttributes.zInclude)); if (parentComponent.get()) { // parent component context should be already loaded const context = zuix.context(parentComponent); @@ -4364,14 +4299,14 @@ function applyOptions(element, options) { options = parseOptions(element, options); // TODO: should check if options object is valid if (element != null && options != null) { - if (options.lazyLoad != null) { - util.dom.setAttribute(element, _optionAttributes.zLazy, options.lazyLoad.toString().toLowerCase()); + if (options.componentId != null) { + util.dom.setAttribute(element, _optionAttributes.zLoad, options.componentId.toString().toLowerCase()); } if (options.contextId != null) { util.dom.setAttribute(element, _optionAttributes.zContext, options.contextId.toString().toLowerCase()); } - if (options.componentId != null) { - util.dom.setAttribute(element, _optionAttributes.zLoad, options.componentId.toString().toLowerCase()); + if (options.lazyLoad != null) { + util.dom.setAttribute(element, _optionAttributes.zLazy, options.lazyLoad.toString().toLowerCase()); } // TODO: eventually map other attributes from options } @@ -4613,7 +4548,7 @@ function ContextController(context) { this.eventRouter = function(e) { const v = _t.view(); context._behaviorMap.concat(context._eventMap).forEach(function(em) { - if (em.eventPath === e.type && typeof em.handler === 'function') { + if (em.eventPath === e.type && em.handler) { em.handler.call(v, e, e.detail, v); } }); @@ -4624,7 +4559,7 @@ function ContextController(context) { let handler = null; if (options.on != null) { z$.each(options.on, function(ep, handler) { - _t.addEvent(ep, handler); + ep.split(/[\s|,]+/g).map((evt) => _t.addEvent(evt, handler)); }); } // create behavior map from context options @@ -4632,7 +4567,7 @@ function ContextController(context) { for (const bp in options.behavior) { if (options.behavior.hasOwnProperty(bp)) { handler = options.behavior[bp]; - _t.addBehavior(bp, handler); + bp.split(/[\s|,]+/g).map((evt) => _t.addEvent(evt, handler)); } } } @@ -4691,7 +4626,7 @@ ContextController.prototype.addTransition = function(className, properties, opti className, properties, options, - util.dom.getShadowRoot(this.context.container()) + util.dom.getShadowRoot(this.context.view()) ); return this; }; @@ -4801,8 +4736,7 @@ ContextController.prototype.trigger = function(eventPath, eventData, isHook) { let target = this.context.container(); if (target == null) target = this.context.view(); if (target != null) { - z$(target) - .trigger(eventPath, eventData); + z$(target).trigger(eventPath, eventData); } this.context.trigger(this.context, eventPath, eventData); } else { @@ -5138,6 +5072,13 @@ function ViewObserver(context) { // eslint-disable-next-line no-unused-vars function(mutationsList, observer) { const zc = util.dom.queryAttribute(_optionAttributes.zComponent); + const findNode = function(node) { + for (let i = 0; i < node.attributes.length; i++) { + if (node.attributes[i].name.startsWith(_optionAttributes.cssIdPrefix)) { + return true; + } + } + }; for (const mutation of mutationsList) { if (mutation.type === 'childList') { mutation.addedNodes.forEach(function(node) { @@ -5146,14 +5087,7 @@ function ViewObserver(context) { if (parent.get() == null) return; if (_t.options().css !== false && parent.attr(_optionAttributes.resourceType.controller) == null) { if ((parent.get() === _t._container || parent.get() === _t._view)) { - let found = false; - for (let i = 0; i < node.attributes.length; i++) { - if (node.attributes[i].name.startsWith(_optionAttributes.cssIdPrefix)) { - found = true; - break; - } - } - if (!found) { + if (!findNode(node)) { util.dom.setAttribute(node, _t.getCssId(), ''); } } @@ -5165,14 +5099,7 @@ function ViewObserver(context) { } while (c < 10 && parent.get() != null && parent.attr(_optionAttributes.resourceType.controller) != null); if (parent.get()) { parent = zuix.context(parent); - let found = false; - for (let i = 0; i < node.attributes.length; i++) { - if (node.attributes[i].name.startsWith(_optionAttributes.cssIdPrefix)) { - found = true; - break; - } - } - if (!found) { + if (!findNode(node)) { util.dom.setAttribute(node, parent.getCssId(), ''); zuix.$(node).find('*').each(function() { this.attr(parent.getCssId(), ''); @@ -5272,20 +5199,20 @@ __webpack_require__(854); * of the component's host element. * * @typedef {object} ContextOptions - * @property {Object|undefined} contextId The context id. HTML attribute equivalent: *z-context*. If not specified it will be randomly generated. + * @property {Object|undefined} contextId The context id. HTML attribute equivalent: *z-context*. If not specified it will be randomly generated. HTML attribute equivalent: *z-context*. * @property {Element|undefined} container The container element. - * @property {JSON|undefined} model The data model. HTML attribute equivalent: *z-model*. - * @property {Element|undefined} view The view element. HTML attribute equivalent: *z-view*. + * @property {JSON|undefined} model The data model. HTML attribute equivalent: *z-model*. + * @property {Element|undefined} view The view element. * @property {ContextControllerHandler|undefined} controller The controller handler. - * @property {Object.|Object.|undefined} on The map of event handlers for standard and component's events. An event can also be simply routed to another component's event by specifying the mapped event name string. - * @property {Object.|Object.|undefined} behavior The map of event handlers for behaviors. An event can also be simply routed to another component's event by specifying the mapped event name string. + * @property {Object.|Object.|undefined} on The map of event handlers for standard and component's events. An event can also be simply routed to another component's event by specifying the mapped event name string. HTML attribute equivalent: *z-on*. + * @property {Object.|Object.|undefined} behavior The map of event handlers for behaviors. An event can also be simply routed to another component's event by specifying the mapped event name string. HTML attribute equivalent: *z-behavior*. * @property {HTMLStyleElement|string|boolean|undefined} css Custom stylesheet to apply to the component's view. * @property {boolean|undefined} encapsulation Whether to use style encapsulation or not (**default:** false). * @property {boolean|undefined} resetCss Whether to reset view style to prevent inheriting from parent containers (**default:** false). * @property {string|undefined} cext When loading content of the view, appends the specified extension instead of *.html*. - * @property {boolean|undefined} html Enables or disables HTML template loading (**default:** true). - * @property {boolean|undefined} lazyLoad Enables or disables lazy-loading (**default:** false). - * @property {number|undefined} priority Loading priority (**default:** 0). + * @property {boolean|string|undefined} html It can be set to `false`, to disable HTML template loading, or it can be set to a string containing the inline HTML template code. + * @property {boolean|undefined} lazyLoad Enables or disables lazy-loading (**default:** false). HTML attribute equivalent: *z-lazy*. + * @property {number|undefined} priority Loading priority (**default:** 0). HTML attribute equivalent: *z-priority*. * @property {ContextLoadedCallback|undefined} ready The loaded callback, triggered once the component is successfully loaded. * @property {ContextReadyCallback|undefined} ready The ready callback, triggered once all component's dependencies have been loaded. * @property {ContextErrorCallback|undefined} error The error callback, triggered when an error occurs. @@ -5366,6 +5293,8 @@ let _contextSeqNum = 0; let _disableComponentize = false; /** @private */ const _objectObserver = new ObjectObserver(); +/** @private */ +const _componentReadyCallbackDelay = 10; /** @private */ const _implicitLoadDefaultList = [ @@ -5402,7 +5331,7 @@ function Zuix() { 'baseUrl': '/', 'resourcePath': '/app/', 'libraryPath': { - '@lib': 'https://zuixjs.github.io/zkit/lib/1.1/', + '@lib': 'https://zuixjs.github.io/zkit/lib/1.2/', '@hgui': 'https://genielabs.github.io/homegenie-web-ui/app/', '@cdnjs': 'https://cdnjs.cloudflare.com/ajax/libs/' }, @@ -5410,7 +5339,7 @@ function Zuix() { 'zuixjs.github.io': { 'resourcePath': '/zuixjs/app', 'libraryPath': { - '@lib': 'https://zuixjs.github.io/zkit/lib/1.1/', + '@lib': 'https://zuixjs.github.io/zkit/lib/1.2/', '@hgui': 'https://genielabs.github.io/homegenie-web-ui/app/', '@cdnjs': 'https://cdnjs.cloudflare.com/ajax/libs/' } @@ -5434,10 +5363,10 @@ function Zuix() { }); contextData[field] = $el.value(); }, + // TODO: deprecate '@on` handler, use `()=""` instead 'on': function($view, $el, lastResult, refreshCallback, attributeName) { - const handlerArgs = zuix.parseAttributeArgs(attributeName, $el, $view, lastResult); const code = $el.attr(attributeName); - const eventName = handlerArgs.slice(1).join(':'); + const eventName = attributeName.split(':').slice(1).join(':'); $el.on(eventName, function(e) { const eventHandler = zuix.runScriptlet(code, $el, $view); if (typeof eventHandler === 'function') { @@ -5617,13 +5546,13 @@ function load(componentId, options) { }*/ } - if (util.isFunction(options.ready)) { + if (options.ready) { ctx.ready = options.ready; } - if (util.isFunction(options.loaded)) { + if (options.loaded) { ctx.loaded = options.loaded; } - if (util.isFunction(options.error)) { + if (options.error) { ctx.error = options.error; } @@ -5691,9 +5620,6 @@ function loadResources(ctx, options) { ctx.view(cachedComponent.view); _log.t(ctx.componentId+':html', 'component:cached:html'); } - /* - TODO: CSS caching, to be tested. - */ if (options.css !== false && typeof options.css !== 'string') { options.css = false; if (!cachedComponent.css_applied) { @@ -5723,7 +5649,7 @@ function loadResources(ctx, options) { }, error: function(err) { _log.e(err, ctx); - if (util.isFunction(options.error)) { + if (options.error) { (ctx.error).call(ctx, err, ctx); } } @@ -5785,21 +5711,6 @@ function loadComponent(elements, componentId, type, options) { * @param {ZxQuery} el */ const load = function(el) { - let sr = el.get().shadowRoot; - if (sr == null && options && options.container instanceof ShadowRoot) { - sr = options.container; - } - if (sr) { - const shadowView = document.createElement('div'); - sr.appendChild(shadowView); - Array.from(el.get().childNodes).map(function(el) { - shadowView.appendChild(el); - }); - if (options && options.container) { - options.container = shadowView; - } - el = z$(shadowView); - } el.attr(_optionAttributes.zLoad, componentId); if (type) { el.attr(type, ''); @@ -5810,7 +5721,37 @@ function loadComponent(elements, componentId, type, options) { } return false; } - return _componentizer.loadInline(el, options); + // Shadow root check + let sr = el.get().shadowRoot; + if (sr == null && options && options.container instanceof ShadowRoot) { + sr = options.container; + delete options.container; + } else if (sr && options) { // mode = 'open' + delete options.container; + } + if (sr) { + const shadowView = document.createElement('div'); + // move attributes to shadow view + Array.from(el.get().attributes).forEach((attribute) => { + if (!attribute.nodeName.match(/^[(#@)]/)) { + shadowView.setAttribute(attribute.nodeName, attribute.nodeValue); + el.attr(attribute.nodeName, null); + } + }); + setTimeout(function() { + // move childNodes to shadow view + while (el.get().firstChild) { + shadowView.appendChild(el.get().firstChild); + } + sr.appendChild(shadowView); + zuix.context(shadowView, (ctx) => { + el.attr('shadow', ctx.contextId); + }); + _componentizer.loadInline(shadowView, options); + }); + } else { + _componentizer.loadInline(el, options); + } }; elements.each(function(i, el, $el) { load($el); @@ -5846,13 +5787,20 @@ function context(contextId, callback) { return false; } }); - if (typeof callback === 'function' && (contextId instanceof Element || contextId instanceof z$.ZxQuery)) { + if (callback && (contextId instanceof Element || contextId instanceof z$.ZxQuery)) { if (context == null || !context.isReady) { - z$(contextId).one('component:loaded', function() { + if (contextId instanceof Element && contextId.getAttribute('shadow')) { + context = zuix.context(contextId.getAttribute('shadow')); + setTimeout(function() { + callback.call(context, context); + }, _componentReadyCallbackDelay); + return context; + } + z$(contextId).one('component:ready', function() { context = zuix.context(this); setTimeout(function() { callback.call(context, context); - }, 10); + }, _componentReadyCallbackDelay); }); } else callback.call(context, context); } @@ -5870,7 +5818,7 @@ function hook(path, handler) { delete _hooksCallbacks[path]; } else { if (_hooksCallbacks[path]) { - _log.w('Overwritten an already registered hook for', '"' + path + '"', 'OLD HANDLER', _hooksCallbacks[path], 'REPLACED BY', handler); + _log.w('Hook override', '"' + path + '"', 'OLD', _hooksCallbacks[path], 'NEW', handler); } _hooksCallbacks[path] = handler; } @@ -5885,7 +5833,7 @@ function hook(path, handler) { * @param {object|undefined} [data] */ function trigger(context, path, data) { - if (util.isFunction(_hooksCallbacks[path])) { + if (_hooksCallbacks[path]) { _hooksCallbacks[path].call(context, data, context); } } @@ -5897,11 +5845,11 @@ function setComponentCache(cache) { _componentCache = cache; } -/** @private */ -function removeCachedComponent(componentId) { - // TODO: removeCachedComponent - // TODO: should this be called when last instance of a component type is disposed? -} +///** @private */ +//function removeCachedComponent(componentId) { +// TODO: removeCachedComponent +// TODO: should this be called when last instance of a component type is disposed? +//} /** * @private @@ -5931,7 +5879,7 @@ function loadController(context, task) { if (!util.isNoU(task)) { task.step(context.componentId+':js'); } - if (util.isFunction(_globalControllerHandlers[context.componentId])) { + if (_globalControllerHandlers[context.componentId]) { context.controller(_globalControllerHandlers[context.componentId]); createComponent(context, task); } else { @@ -5953,14 +5901,14 @@ function loadController(context, task) { } } catch (e) { _log.e(new Error(), e, ctrlJs, context); - if (util.isFunction(context.error)) { + if (context.error) { (context.error).call(context, e, context); } } }, error: function(err) { _log.e(err, new Error(), context); - if (util.isFunction(context.error)) { + if (context.error) { (context.error).call(context, err, context); } }, @@ -6022,12 +5970,12 @@ function createComponent(context, task) { } _log.d(context.componentId, 'component:initializing'); - if (util.isFunction(context.controller())) { + if (context.controller()) { // TODO: should use 'require' instead of 'new Controller' ... ? /** @type {ContextController} */ const c = context._c = new ContextController(context); c.log = __webpack_require__(381)(context.contextId); - if (typeof c.init === 'function') { + if (c.init) { c.init(); } const endTask = function() { @@ -6065,6 +6013,9 @@ function createComponent(context, task) { const loadViewTask = function() { if (context.options().html !== false) { + if (typeof context.options().html === 'string') { + cached.view = context.options().html; + } if (cached.view == null) { context.loadHtml({ cext: context.options().cext, @@ -6074,7 +6025,7 @@ function createComponent(context, task) { }, error: function(err) { _log.e(err, context); - if (util.isFunction(context.options().error)) { + if (context.options().error) { (context.options().error).call(context, err, context); } }, @@ -6152,14 +6103,14 @@ function initController(ctrl) { // tender lifecycle moments const $view = ctrl.view(); - if (util.isFunction(ctrl.create)) { + if (ctrl.create) { ctrl.create(); } ctrl.trigger('view:create', $view); const contextLoaded = function() { // set component loaded - if (util.isFunction(ctx.loaded)) { + if (ctx.loaded) { (ctx.loaded).call(ctx, ctx); } @@ -6189,8 +6140,86 @@ function initController(ctrl) { ctrl.trigger('component:loaded', $view, true); const contextReady = function() { + // parse option attributes + const attributesList = [':on', ':model', ':behavior', ':ready']; // these are evaluated after component is created + const optionAttributes = Array.from($view.get().attributes) + .filter((a) => attributesList.find((t) => a.nodeName.startsWith(t))); + optionAttributes.forEach((attribute) => { + const attr = attribute.nodeName; + const isRootOption = attr.lastIndexOf(':') < 2; + let val; + let scriptlet = attribute.nodeValue; + if (!scriptlet.match(/^[^<>()\[\]\-+\s!?/&£"=^#@:;,.*|]+$/g)) { + scriptlet = `(event, args) => \{ ${attribute.nodeValue} \}`; + } + if (attr.startsWith(':model') || isRootOption) { + scriptlet = `(${attribute.nodeValue})`; + } + try { + val = zuix.runScriptlet(scriptlet, $view, $view, null); + } catch (e) { + _log.warn(attr, attribute.nodeValue, e); + } + if (val == null) return; // TODO: should report a warning? + if (attr === ':ready') { + ctx.ready = val; + return; + } + if (attr.startsWith(':on') || attr.startsWith(':behavior')) { + if (isRootOption) { + ctrl.on(val); + return; + } + const eventName = attr.substring(attr.indexOf(':', 1) + 1); + if (attr.startsWith(':behavior')) { + ctrl.addBehavior(eventName, val); + } else { + ctrl.addEvent(eventName, val); + } + } else if (attr.startsWith(':model')) { + if (isRootOption) { + ctx.model(val); + return; + } + const path = attr.match(/[^:]+/g).splice(1); + let co = ctx.model(); + path.forEach((p, i) => { + p = util.hyphensToCamelCase(p); + if (i === path.length - 1) { + return co[p] = val; + } + co = co[p] = co[p] || {}; + }); + } + }); + // parse and allocate inline event handlers + const allocateEventHandlers = function(ctx, $el) { + Array.from($el.get().attributes).forEach((attribute) => { + const attr = attribute.nodeName; + if (attr.startsWith('(') && attr.endsWith(')')) { + let scriptlet = attribute.nodeValue; + if (!scriptlet.match(/^[^<>()\[\]\-+\s!?/&£"=^#@:;,.*|]+$/g)) { + scriptlet = `(event, args) => \{ ${attribute.nodeValue} \}`; + } + const eventName = attr.substring(1, attr.length - 1); + const handler = zuix.runScriptlet(scriptlet, $el, $view, null); + if ($el === $view) { + ctx.on(eventName, handler); + } else { + $el.on(eventName, handler); + } + } + }); + }; + if (zuix.context($view) === ctx) { + $view.find('*').each(function(i, el, $el) { + if (isDirectComponentElement($view, $el)) { + allocateEventHandlers(ctx, $el); + } + }); + } // set component ready - if (util.isFunction(ctx.ready)) { + if (ctx.ready) { (ctx.ready).call(ctx, ctx); } ctrl.trigger('component:ready', $view, true); @@ -6213,7 +6242,7 @@ function initController(ctrl) { if (!activeTagHandler) { activeTagHandler = globalHandlers[handlerName]; } - if (typeof activeTagHandler === 'function') { + if (activeTagHandler) { const h = zuix.activeRefresh($view, $el, ctrl.model(), function($v, $element, data, refreshCallback) { // TODO: should `$v` and/or `$element` be passed here? const runActiveTagHandler = function() { @@ -6269,17 +6298,19 @@ function initController(ctrl) { code += 'let _' + f + ' = null; zuix.context(' + f + ', function(c) { _' + f + ' = c; });'; }); } - code += 'function runScriptlet($el, s, args) { let result; try { result = eval("const $this = $el; const _this = zuix.context(this); " + s) } catch (e) { console.error(\'SCRIPTLET ERROR\', e, s); }; return result };'; + code += 'function runScriptlet($el, s, args) { let result; try { result = eval("const $this = $el; let _this = null; zuix.context(this, (ctx) => _this = ctx); " + s) } catch (e) { console.error(\'SCRIPTLET ERROR\', e, s); }; return result };'; // add custom "jscript" code / collects "using" components const usingComponents = []; let userCode = ''; usingComponents.push(contextId); // map contextId to a local variable viewRefreshScript.each(function(i, el, $el) { - if ($el.attr('using') != null) { - usingComponents.push(...$el.attr('using').split(',')); - } - if ($el.parent().get() === $view.get() || $el.attr('for') === contextId) { - userCode += $el.html() + ';'; + if (zuix.context($view) === ctx) { + if ($el.attr('using') != null) { + usingComponents.push(...$el.attr('using').split(/[\s|,]+/g)); + } + if ($el.parent().get() === $view.get() || $el.attr('for') === contextId) { + userCode += $el.html() + ';'; + } } }); @@ -6288,10 +6319,11 @@ function initController(ctrl) { let waitingComponents = ''; usingComponents.forEach(function(cid) { const ctxVarName = util.hyphensToCamelCase(cid); + const varDeclarations = 'let ' + ctxVarName + ' = window["' + ctxVarName + '"]; if (' + ctxVarName + ' == null) { ' + ctxVarName + ' = zuix.context("' + cid + '"'; if (ctx._dependencyResolver !== false) { - componentsResolve += 'let ' + ctxVarName + ' = window["' + ctxVarName + '"]; if (' + ctxVarName + ' == null) { ' + ctxVarName + ' = zuix.context("' + cid + '", function(ctx) { ' + ctxVarName + ' = ctx; }); }'; + componentsResolve += varDeclarations + ', function(ctx) { ' + ctxVarName + ' = ctx; }); }'; } else { - componentsResolve += 'let ' + ctxVarName + ' = window["' + ctxVarName + '"]; if (' + ctxVarName + ' == null) { ' + ctxVarName + ' = zuix.context("' + cid + '"); }'; + componentsResolve += varDeclarations + '); }'; } waitingComponents += ctxVarName + ' && '; }); @@ -6321,11 +6353,11 @@ function initController(ctrl) { } } // call refresh method for the first time, if found - if (refreshHandler.refresh) { - refreshHandler.refresh(); + if (!ctx._dependencyResolver && refreshHandler.refresh) { + ctx._refreshHandler.refresh(); } // Active-Refresh callback to request a new refresh in 100ms - if (typeof refreshCallback === 'function') { + if (refreshCallback) { refreshCallback(contextData); } } @@ -6335,15 +6367,18 @@ function initController(ctrl) { // Allocate refresh handlers const allocated = []; $view.find('*').each(function(i, el, $el) { - if (!isDirectComponentElement($view, $el)) return; + if ( + !isDirectComponentElement($view, $el) || + (zuix.context($view) !== ctx) + ) return; allocated.push(...allocateRefreshHandlers($view, $el)); }); // Allocate main component's 'refresh' handler // if there is the JScript or any '@' handler if (allocated.length > 0 || viewRefreshScript.length() > 0) { - const refreshDelay = viewRefreshScript.length() > 0 ? viewRefreshScript.attr('refreshDelay') : null; - const handlersDelay = viewRefreshScript.length() > 0 ? viewRefreshScript.attr('handlersDelay') : null; + const refreshDelay = viewRefreshScript.length() > 0 ? viewRefreshScript.attr('refreshdelay') : null; + const handlersDelay = viewRefreshScript.length() > 0 ? viewRefreshScript.attr('handlersdelay') : null; // init refresh handler / first paint ctx.handlers.refresh.call($view.get(), $view, $view, ctrl.model(), function(contextData, delay) { zuix.activeRefresh($view, $view, contextData, function($v, $element, data, refreshCallback) { @@ -6355,7 +6390,7 @@ function initController(ctrl) { return loadedNested; } }); - const canStart = ctx._refreshHandler.ready() && ctx.isReady === true && loadedNested; + const canStart = loadedNested && ctx.isReady === true && ctx._refreshHandler.ready(); if (canStart) { ctx._refreshHandler.initialized = true; // start '@' handlers @@ -6367,7 +6402,7 @@ function initController(ctrl) { } else if (!ctx.$.hasClass('not-ready')) { ctx.$.addClass('not-ready'); } - refreshCallback(data); + refreshCallback(data, refreshDelay, true); } else { ctx.handlers.refresh.call($view.get(), $view, $view, data, refreshCallback); } @@ -6624,7 +6659,7 @@ Zuix.prototype.createComponent = function(componentId, options) { options.contextId = 'zuix-ctx-' + (++_contextSeqNum); } if (context(options.contextId) != null) { - throw new Error('Context arelady exists.'); + throw new Error('Context already exists.'); } else { options.container = document.createElement('div'); options.componentId = componentId; @@ -6742,101 +6777,113 @@ Zuix.prototype.using = function(resourceType, resourcePath, callback, ctx) { resourceType = resourceType.toLowerCase(); const hashId = resourceType + '-' + resourcePath.hashCode(); - if (resourceType === 'component') { - const c = context(hashId); - if (c == null) { - zuix.load(resourcePath, { - contextId: hashId, - view: '', - priority: -10, - ready: function(ctx) { - if (typeof callback === 'function') { - callback(resourcePath, ctx); - } - }, - error: function() { - if (typeof callback === 'function') { - callback(resourcePath, null); + taskQueue('resource-loader').queue(hashId, function() { + const task = resourceLoadTask[hashId] = this; + if (resourceType === 'component') { + const c = context(hashId); + if (c == null) { + zuix.load(resourcePath, { + contextId: hashId, + view: '', + priority: -10, + ready: function(componentContext) { + task.end(); + if (callback) { + callback(resourcePath, componentContext); + } + }, + error: function() { + task.end(); + if (callback) { + callback(resourcePath, null); + } } - } - }); - } else if (typeof callback === 'function') { - // already loaded - callback(resourcePath, c); - } - } else { - const isCss = (resourceType === 'style'); - if (z$.find(resourceType + '[id="' + hashId + '"]').length() === 0) { - const container = ctx ? util.dom.getShadowRoot(ctx.container()) : null; - const head = container || document.head || document.getElementsByTagName('head')[0]; - const resource = document.createElement(resourceType); - if (isCss) { - resource.type = 'text/css'; - resource.id = hashId; + }); } else { - resource.type = 'text/javascript'; - resource.id = hashId; + // already loaded + task.end(); + if (callback) { + callback(resourcePath, c); + } } - head.appendChild(resource); + } else { + const isCss = (resourceType === 'style'); + if (z$.find(resourceType + '[id="' + hashId + '"]').length() === 0) { + const container = isCss && ctx ? util.dom.getShadowRoot(ctx.view()) : null; + const head = container || document.head || document.getElementsByTagName('head')[0]; + const resource = document.createElement(resourceType); + if (isCss) { + resource.type = 'text/css'; + resource.id = hashId; + } else { + resource.type = 'text/javascript'; + resource.id = hashId; + } + head.appendChild(resource); - // TODO: add logging - const addResource = function(text) { // TODO: add logging - if (isCss) { - if (resource.styleSheet) { - resource.styleSheet.cssText = text; + const addResource = function(text) { + // TODO: add logging + if (isCss) { + if (resource.styleSheet) { + resource.styleSheet.cssText = text; + } else { + resource.appendChild(document.createTextNode(text)); + } } else { - resource.appendChild(document.createTextNode(text)); + if (resource.innerText) { + resource.innerText = text; + } else { + resource.appendChild(document.createTextNode(text)); + } } - } else { - if (resource.innerText) { - resource.innerText = text; - } else { - resource.appendChild(document.createTextNode(text)); + task.end(); + if (callback) { + callback(resourcePath, hashId); } + }; + + const cid = '_res/' + resourceType + '/' + hashId; + const cached = getCachedComponent(cid); + if (cached != null) { + addResource(isCss ? cached.css : cached.controller); + } else { + z$.ajax({ + url: resourcePath, + success: function(resText) { + // TODO: add logging + /** @type {ComponentCache} */ + const cached = { + componentId: cid, + view: null, + css: isCss ? resText : null, + controller: !isCss ? resText : null, + using: resourcePath + }; + _componentCache.push(cached); + addResource(resText); + }, + error: function() { + // TODO: add logging + head.removeChild(resource); + task.end(); + if (callback) { + callback(resourcePath); + } + } + }); } + } else { + // TODO: add logging + // console.log('Resource already added ' + hashId + '(' + resourcePath + ')'); + task.end(); if (callback) { callback(resourcePath, hashId); } - }; - - const cid = '_res/' + resourceType + '/' + hashId; - const cached = getCachedComponent(cid); - if (cached != null) { - addResource(isCss ? cached.css : cached.controller); - } else { - z$.ajax({ - url: resourcePath, - success: function(resText) { - // TODO: add logging - /** @type {ComponentCache} */ - const cached = { - componentId: cid, - view: null, - css: isCss ? resText : null, - controller: !isCss ? resText : null, - using: resourcePath - }; - _componentCache.push(cached); - addResource(resText); - }, - error: function() { - // TODO: add logging - head.removeChild(resource); - if (callback) { - callback(resourcePath); - } - } - }); - } - } else { - // TODO: add logging - // console.log('Resource already added ' + hashId + '(' + resourcePath + ')'); - if (callback) { - callback(resourcePath, hashId); } } - } + }); + return this; }; /** @@ -6953,7 +7000,7 @@ Zuix.prototype.bundle = function(bundleData, callback) { const ll = _componentizer.lazyLoad(); _componentizer.lazyLoad(false); _componentizer.componentize(); - if (typeof callback === 'function') { + if (callback) { const waitLoop = function(w) { setTimeout(function() { if (_componentizer.willLoadMore()) { @@ -7026,8 +7073,7 @@ Zuix.prototype.resolveImplicitLoad = function(element) { // Resolve implicit loadable component const notLoad = util.dom.cssNot(_optionAttributes.zLoad).get(); const notReady = util.dom.cssNot(_optionAttributes.zReady).get(); - const implicitDefault = _implicitLoadDefaultList.join(',') - .split(',') + const implicitDefault = _implicitLoadDefaultList .map(function(a) { return a + notLoad + notReady; }).join(','); @@ -7055,23 +7101,6 @@ Zuix.prototype.runScriptlet = function(scriptCode, $el, $view, data) { return ctx._refreshHandler.runScriptlet.call($el.get(), $el, scriptCode, data); } }; -/** - * // TODO: document method - * - * @param attributeName - * @param $el - * @param $view - * @param contextData - * @return {unknown[]} - */ -Zuix.prototype.parseAttributeArgs = function(attributeName, $el, $view, contextData) { - return attributeName.split(':').map(function(a) { - if (a.startsWith('{') && a.endsWith('}')) { - return zuix.runScriptlet(util.hyphensToCamelCase(a), $el, $view, contextData); - } - return a; - }); -}; // member to expose utility class // TODO: document this with JSDocs @@ -7106,7 +7135,7 @@ module.exports = function() { } // log messages monitor (one global listener) _log.monitor(function(level, args) { - if (util.isFunction(zuix.monitor)) { + if (zuix.monitor) { zuix.monitor(level, Array.prototype.slice.call(args)); } }); diff --git a/docs/js/zuix/zuix.module.min.js b/docs/js/zuix/zuix.module.min.js index 1130957..6e4e773 100644 --- a/docs/js/zuix/zuix.module.min.js +++ b/docs/js/zuix/zuix.module.min.js @@ -1,4 +1,4 @@ -/* zuix.js v1.1.6 22.05.26 17:50:11 */ +/* zuix.js v1.1.7 22.06.06 23:17:57 */ /*! For license information please see zuix.module.min.js.LICENSE.txt */ -var t={381:function(t){const e=["log","info","warn","error","debug","trace","dir","group","groupCollapsed","groupEnd","time","timeEnd","profile","profileEnd","dirxml","assert","count","markTimeline","timeStamp","clear"],n="background-color:rgba(200,200,200,0.2);";let o=null,i=null,s=null;function r(t){o=window?window.console:{},i=window||{},this._timers={},this.args=function(t,e,o){let i="%c "+e+" %c"+(new Date).toISOString()+" %c"+t;const s=[n+"color:#8a53ff;",n+"color:#777777",n+"color:#888888;"];for(let t=0;t200?s.push(n+"color:#ff0000;"):t>100?s.push(n+"color:#ff7700;"):s.push(n+"color:#00aa00;")}}}i+=" \n%c ",s.push("background-color:transparent;color:inherit;");for(let t=s.length-1;t>=0;t--)Array.prototype.unshift.call(o,s[t]);Array.prototype.unshift.call(o,i),Array.prototype.push.call(o,"\n\n")},this.log=function(e,n){"function"==typeof s&&s.call(t,e,n),(i.__zuix__debug||"ERROR"===e||"WARN"===e)&&(this.args(t,e,n),o.log(...n))}}r.prototype.monitor=function(t){s=t},r.prototype.console=function(t){if(t)window.console=o;else{window.console={};for(let t=0;te.priority?1:e.priority>t.priority?-1:0})),e.taskCheck()},e.taskCheck=function(){for(let n=0;n"}return n},cloneObject:function t(e){if(null===e||"object"!=typeof e)return e;let n=e;try{n=e.constructor();for(const o in e)e.hasOwnProperty(o)&&(n[o]=t(e[o]))}catch(t){}return n},hasPassiveEvents:function(){let t=!1;try{const e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassive",null,e),window.removeEventListener("testPassive",null,e)}catch(t){}return t},hyphensToCamelCase:function(t){return t.replace(/-([a-z0-9_$-])/g,(function(t){return"_$-".indexOf(t[1])>-1||(+t[1]).toString()===t[1]?"_"+t[1].replace("-","_"):t[1].toUpperCase()}))},camelCaseToHyphens:function(t){return(t=t.replace(/(^\w)|(\s+\w)/g,(function(t){return t.toUpperCase()})).replace(/\s/g,"")).split(/(?=[A-Z])/).join("-").toLowerCase()},normalizeControllerCode:function(t){if(t.indexOf("module.exports")>=0)return"'use strict'; let module = {}; "+t+";\nreturn module.exports;";{let e=t;const n=t.indexOf("function "),o=t.indexOf("zuix.controller"),i=t.indexOf("class ");return i>=0&&(i=0&&(n=e.length||null==t?e[0]:e[t]},getAll:function(t){return i.split(",").join("")}};var i},getShadowRoot:function(t){for(;t;t=t.parentNode)if(t instanceof ShadowRoot)return t;return!1}}}},917:function(t,e,n){const o=n(381)("TaskQueue.js"),i=n(826),s=i.hasPassiveEvents(),r=[];function c(t){!function(t,e,n){const o=h(t);h.each(r,(function(){this.element===t&&this.path===e&&this.handler.call(o,n,o)}))}(this,t.type,t)}function l(t,e,n){let o=1,i=-1;h.each(r,(function(s){this.element===t&&this.path===e&&(o--,this.handler===n&&(i=s))})),-1!==i&&r.splice(i,1),0===o&&t.removeEventListener(e,c)}function u(t){if(this._selection=[],void 0===t&&(t=document.documentElement),t instanceof u)return t;if(t instanceof HTMLCollection||t instanceof NodeList){const e=this._selection=[];h.each(t,(function(t,n){e.push(n)}))}else if(Array.isArray(t))this._selection=t;else if(t===window||t instanceof HTMLElement||t instanceof Node)this._selection=[t];else if("string"==typeof t)this._selection=document.documentElement.querySelectorAll(t);else if(null!==t)throw o.e("ZxQuery cannot wrap object of this type.",typeof t,t),new Error("ZxQuery cannot wrap object of this type.");return this}function a(t){return new u(t)}u.prototype.length=function(){return this._selection.length},u.prototype.parent=function(t){return i.isNoU(t)?new u(this._selection[0].parentNode):new u(h.getClosest(this._selection[0],t))},u.prototype.children=function(t){return i.isNoU(t)?new u(this._selection[0].children):new u(this._selection[0].querySelectorAll(t))},u.prototype.reverse=function(){const t=Array.prototype.slice.call(this._selection,0);return this._selection=t.reverse(),this},u.prototype.get=function(t){return i.isNoU(t)&&(t=0),this._selection[t]},u.prototype.eq=function(t){const e=this._selection;let n=e[t];return arguments.length>1&&(n=[],h.each(arguments,(function(t,o){null!=e[o]&&n.push(e[o])}))),new u(n)},u.prototype.prev=function(){return new u(this._selection[0].previousElementSibling)},u.prototype.next=function(){return new u(this._selection[0].nextElementSibling)},u.prototype.index=function(t){const e=this._selection[0];return 1===this.length()&&null==t?Array.from(this.parent().children()._selection).indexOf(e):this.length()>0&&null!=t?this._selection.indexOf(t.get()):-1},u.prototype.find=function(t){return this._selection[0]?new u(this._selection[0].querySelectorAll(t)):new u},u.prototype.each=function(t){return h.each(this._selection,t),this},u.prototype.attr=function(t,e){const n=this;if("object"==typeof t)h.each(t,(function(t,e){n.each((function(n,o){i.dom.setAttribute(o,t,e)}))}));else{if(void 0===e)return i.dom.getAttribute(this._selection[0],t);this.each((function(n,o){i.dom.setAttribute(this.get(),t,e)}))}return this},u.prototype.trigger=function(t,e){let n;return window.CustomEvent?n=new CustomEvent(t,{detail:e}):(n=document.createEvent("CustomEvent"),n.initCustomEvent(t,!0,!0,e)),this.each((function(t,e){e.dispatchEvent(n)})),this},u.prototype.one=function(t,e){const n=this;return"object"==typeof t&&null==e?(h.each(t,(function(t,e){n.one(t,e)})),this):(this.on(t,new function(t,e){let o=!1;return function(i,s){o||(o=!0,h(n).off(t,this),e.call(n,i,s,n))}}(t,e)),this)},u.prototype.on=function(t,e){if("object"==typeof t&&null==e){const e=this;return h.each(t,(function(t,n){e.on(t,n)})),this}const n=t.match(/\S+/g)||[];let i;return"function"!=typeof e&&(i=e,e=i.handler),this.each((function(t,l){h.each(n,(function(t,n){!function(t,e,n,i){let l=!1;h.each(r,(function(){if(this.element===t&&this.path===e&&this.handler===n)return o.w("Handler already registered",t,e,n),l=!0,!1})),l||(r.push({element:t,path:e,handler:n,options:i}),t.addEventListener(e,c,!(!s||null!=i&&!1===i.passive)&&{passive:!0}))}(l,n,e,i)}))})),this},u.prototype.off=function(t,e){if("object"==typeof t&&null==e){const e=this;return h.each(t,(function(t,n){e.off(t,n)})),this}const n=t.match(/\S+/g)||[];return this.each((function(t,o){h.each(n,(function(t,n){l(o,n,e)}))})),this},u.prototype.reset=function(){return this.each((function(t,e){!function(t){h.each(r.slice(),(function(){this.element===t&&(o.t("Removing event handler",this.element,this.path,this.handler),l(this.element,this.path,this.handler))}))}(e)})),this},u.prototype.isEmpty=function(){return 0===this._selection[0].innerHTML.replace(/\s/g,"").length},u.prototype.position=function(){return null!=this._selection[0]?h.getPosition(this._selection[0]):{x:-1,y:-1,visible:!1}},u.prototype.css=function(t,e){const n=this;if("object"==typeof t)h.each(t,(function(t,e){n.each((function(n,o){o.style[t]=e}))}));else{if(i.isNoU(e))return this._selection[0].style[t];n.each((function(n,o){o.style[t]=e}))}return this},u.prototype.addClass=function(t){const e=t.match(/\S+/g)||[];return h.each(this._selection,(function(n,o){o.classList?h.each(e,(function(t,e){o.classList.add(e)})):o.className+=" "+t})),this},u.prototype.hasClass=function(t){return h.hasClass(this._selection[0],t)},u.prototype.removeClass=function(t){const e=t.match(/\S+/g)||[];return h.each(this._selection,(function(n,o){o.classList?h.each(e,(function(t,e){o.classList.remove(e)})):o.className=o.className.replace(new RegExp("(^|\\b)"+t.split(" ").join("|")+"(\\b|$)","gi")," ")})),this},u.prototype.html=function(t){return i.isNoU(t)?this._selection[0].innerHTML:(this.each((function(e,n){n.innerHTML=t})),this)},u.prototype.checked=function(t){if(i.isNoU(t)){const t=this._selection[0].checked;return null!=t&&"false"!=t&&(t||"checked"==t)}return this.each((function(e,n){n.checked=t})),this},u.prototype.value=function(t){return i.isNoU(t)?this._selection[0].value:(this.each((function(e,n){n.value=t})),this)},u.prototype.append=function(t){return"string"==typeof t?this._selection[0].innerHTML+=t:this._selection[0].appendChild(t instanceof u?t.get():t),this},u.prototype.insert=function(t,e){e=e instanceof u?e.get():e;const n=this.children().get(t);return null!==n?this._selection[0].insertBefore(e,n):this._selection[0].appendChild(e),this},u.prototype.prepend=function(t){return"string"==typeof t?this._selection[0].innerHTML=t+this._selection[0].innerHTML:this._selection[0].insertBefore(t instanceof u?t.get():t,this._selection[0].firstElementChild),this},u.prototype.detach=function(){const t=this._selection[0],e=t.parentNode;return null!=e&&(t.__zuix_oldParent=e,t.__zuix_oldIndex=Array.prototype.indexOf.call(e.children,t),e.removeChild(t),o.t("Detached from parent",e,t)),this},u.prototype.attach=function(){const t=this._selection[0];return null!=t.parentNode&&null!=t.__zuix_oldParent&&t.parentNode.removeChild(t),null==t.parentNode&&null!=t.__zuix_oldParent&&(h(t.__zuix_oldParent).insert(t.__zuix_oldIndex,t),t.__zuix_oldParent=null,delete t.__zuix_oldParent,delete t.__zuix_oldIndex),this},u.prototype.display=function(t){return i.isNoU(t)?this._selection[0].style.display:(h.each(this._selection,(function(e,n){n.style.display=t})),this)},u.prototype.visibility=function(t){return i.isNoU(t)?this._selection[0].style.visibility:(h.each(this._selection,(function(e,n){n.style.visibility=t})),this)},u.prototype.show=function(t){return this.display(null==t?"":t)},u.prototype.hide=function(){return this.display("none")},u.prototype.playTransition=function(t){let e=t.classes;"string"==typeof t?(e=t.split(" "),t={}):Array.isArray(t)&&(e=t,t={});const n=Object.assign({classes:e,target:this,type:"transition"},t);return h.playFx(n),this},u.prototype.playAnimation=function(t){let e=t.classes;"string"==typeof t?(e=t.split(" "),t={}):Array.isArray(t)&&(e=t,t={});const n=Object.assign({classes:e,target:this,type:"animation"},t);return h.playFx(n),this},u.prototype.isPlaying=function(){return this.hasClass("--z-playing")};const h=a;a.find=function(t){return h().find(t)},a.each=function(t,e){const n=null==t?0:Object.keys(t).length;if(n>0){let o=0;for(const i in t)if(t.hasOwnProperty(i)){let s=t[i];if(s instanceof Element&&(s=h(s)),!1===e.call(s,i,t[i],s))break;if(o++,o>=n)break}}return this},a.ajax=a.http=function(t){let e;e=i.isNoU(t)||i.isNoU(t.url)?t:t.url;const n=new XMLHttpRequest;n.onload=function(){200===n.status?i.isFunction(t.success)&&t.success(n.responseText):i.isFunction(t.error)&&t.error(n,n.statusText,n.status),i.isFunction(t.then)&&t.then(n)},n.onerror=function(e,n,o){i.isFunction(t.error)&&t.error(e,n,o)},"function"==typeof t.beforeSend&&t.beforeSend(n);try{n.open("GET",e),n.send()}catch(e){i.isFunction(t.error)&&t.error(n,n.statusText,n.status,e)}return this},a.hasClass=function(t,e){const n=e.match(/\S+/g)||[];let o=!1;return h.each(n,(function(e,n){if(o=t.classList?t.classList.contains(n):new RegExp("(^| )"+n+"( |$)","gi").test(t.className),o)return!1})),o},a.classExists=function(t){const e=t.match(/\S+/g)||[];let n=!1;return h.each(e,(function(t,e){const o=document.styleSheets;if(null!=o)for(let t=0;t1){let e=s[2];if(null!=e&&e.length>0){e=e.replace(/\n/g,"");const o=e.split(",");let i=!1;if(h.each(o,(function(e,s){if("."===s.trim()||":host"===s.trim())r+="\n[z-component]"+t+" ";else if("@"===s.trim()[0])r+=s+" ",(s.trim().toLowerCase().startsWith("@media")||s.trim().toLowerCase().startsWith("@supports"))&&(i=!0);else if(n)s.split(/\s+/).forEach((function(e){(e=e.trim()).lastIndexOf(".")>0?e.replace(/(?=\.)(?![^\[\]()]*(?:\[[^\[\]()]*([\])]))?([\])]))/gi,",").split(",").forEach((function(e){r+=""!==e?e+t:"\n"})):r+=""!==e&&">"!==e&&"*"!==e?"\n"+e+t+" ":e+" "}));else{let e=s.trim();e=e.startsWith(":host")?e.substring(5):"\n"+e,r+="\n[z-component]"+t+e+" "}e1){const t=o[1];let i=e;if(t.indexOf(".")>0){const e=t.split(".");for(let t=0;t0&&(i+=t.substring(r),t=i),t},a.replaceBraces=function(t,e){const n=new RegExp(/{?{.*?}?}/g);let o,s="",r=0,c=0;for(;o=n.exec(t);){if("string"==typeof o[0]&&(0===o[0].trim().length||o[0].indexOf("\n")>=0)){const e=t.substring(c,o.index)+o[0];s+=e,c+=e.length;continue}let n=o[0];if("function"==typeof e){const t=e(o[0]);i.isNoU(t)||(n=t,r++)}s+=t.substring(c,o.index)+n,c=o.index+o[0].length}return r>0?(s+=t.substring(c),s):null},a.getClosest=function(t,e){for(t=t.parentNode;t&&t!==document;t=t.parentNode)if(t.matches&&t.matches(e))return t;return null},a.getPosition=function(t,e){const n="--ui--visible",o=function(){let e=0,n=0;const o=t.getBoundingClientRect();let i=t;for(;i;){if("body"===i.tagName.toLowerCase()){const t=i.scrollLeft||document.documentElement.scrollLeft,o=i.scrollTop||document.documentElement.scrollTop;e+=i.offsetLeft-t+i.clientLeft,n+=i.offsetTop-o+i.clientTop}else e+=i.offsetLeft-i.scrollLeft+i.clientLeft,n+=i.offsetTop-i.scrollTop+i.clientTop;i=i.offsetParent}return{x:e,y:n,rect:o}}();o.visible=!1;let i=t.offsetParent;if(null!=i||"fixed"!==getComputedStyle(t).position&&"absolute"!==getComputedStyle(t).position||(i=document.body),null!=i){if(i!==document.body){let t=i.offsetParent;for(;null!=t&&null!==t.offsetParent&&t.offsetHeight===t.scrollHeight;)t=t.offsetParent;null!=t&&(i=t)}let s=i.getBoundingClientRect();i===document.body&&(s={x:s.x,y:s.y,width:document.documentElement.offsetWidth||document.documentElement.clientWidth,height:document.documentElement.offsetHeight||document.documentElement.clientHeight,top:0,left:0,right:document.documentElement.clientWidth||document.documentElement.offsetWidth,bottom:document.documentElement.clientHeight||document.documentElement.offsetHeight}),null==e&&(e=0);const r=t.getBoundingClientRect();let c=!(r.left-1>s.right-e||r.right+1s.bottom-e||r.bottom+11&&t.classes.shift();n.hasClass("--z-playing")||(n.addClass("--z-playing"),i&&n.addClass(i).css(t.type,"none"));const s=getComputedStyle(n.get()),r=1e3*parseFloat(s[t.type+"-delay"])||i?10:0;let c=!1;const l=function(){c||(c=!0,t.classes.length>1?("function"==typeof t.onStep&&t.onStep.call(n,n,t.classes.slice(1)),e.playFx(t)):(!t.holdState&&t.classes.length>0&&n.removeClass(t.classes.shift()),n.removeClass("--z-playing"),"function"==typeof t.onEnd&&t.onEnd.call(n,n)))},u=function(){i&&n.css(t.type,"").removeClass(i);const e=t.classes[0];e&&n.addClass(e),t.options&&h.each(t.options,(function(e,o){n.css(t.type+"-"+e,o)}));const o=1+(parseFloat(s[t.type+"-iteration-count"])||0),r=1e3*parseFloat(s[t.type+"-duration"])*o;setTimeout(l,r)};n.on(t.type+"end",(function(e){e.target===t.target.get()&&(n.off(t.type+"end",this),l())})),r>0?setTimeout(u,r):u()},a.ZxQuery=u,String.prototype.hashCode=function(){let t=0;if(0===this.length)return t;for(let e=0;e0?(setTimeout((function(){i.requestRefresh(t,e,i.contextData)}),c?i.refreshMs:500),s=!0):null==l&&i.stop()};c?(e._refreshActive||(e._refreshActive=!0,e.trigger("refresh:active")),o(t,e,n,(function(t,e,n){l(t,e,n)}))):(e._refreshActive&&(e._refreshActive=!1,e.trigger("refresh:inactive")),l(i.contextData))}}e.prototype.stop=function(){this.pause(),this.refreshMs=0,this.stopped=!0},e.prototype.start=function(t){if(this.refreshMs=t||this.refreshMs,this.started)return this.resume();this.started=!0,this.requestRefresh(this.$view,this.$element,this.contextData)},e.prototype.pause=function(){this.paused=!0},e.prototype.resume=function(){this.paused=!1},t.exports=e},854:function(t){t.exports=function(){}},622:function(t,e,n){const o=n(381)("ComponentContext.js"),i=n(541),s=n(917),r=n(826),c=n(643);let l=null;const u=[],a=[];function h(t,e){e=e.observableTarget||e;const n=r.isNoU(e.value)?r.isNoU(e.innerHTML)?e:e.innerHTML:e.value;switch(t.tagName.toLowerCase()){case"img":t.src=r.isNoU(e.src)?r.isNoU(e.innerHTML)?e:e.innerHTML:e.src;break;case"a":t.href=r.isNoU(e.href)?r.isNoU(e.innerHTML)?e:e.innerHTML:e.getAttribute("href"),r.isNoU(e.href)||r.isNoU(e.innerHTML)||""===e.innerHTML.trim()||0===s(e).find(r.dom.queryAttribute(i.zField)).length()&&s(t).html("").append(document.createTextNode(e.innerHTML));break;case"input":switch(t.type){case"checkbox":case"radio":t.value==n&&(t.checked=!0);break;default:t.value=n}break;case"select":s.each(t.options,(function(e,o){if(o.value==n)return t.selectedIndex=e,!1}));break;default:const o=r.isNoU(e.innerHTML)?document.createTextNode(e):e.innerHTML;s(t).html("").append(o)}}function d(t,e,n){return l=t,this._options=null,this.contextId=null==e||null==e.contextId?null:e.contextId,this.componentId=null,this.handlers={refresh:function(t,e,n,o){}},this.trigger=function(t,e,o){"function"==typeof n&&n(t,e,o)},this._container=null,this._model=null,this._view=null,this._css=null,this._style=null,this._controller=null,this.behavior=null,this._eventMap=[],this._behaviorMap=[],this._fieldCache=[],this._c=null,this._modelListener=Object.assign({context:null,get:function(t,e,n,o){},set:function(t,e,n,o,c){t instanceof Element&&(o=o.split(".")[0],n=t);const l=s(this.context.view());if(l.get()){let s=l.find(r.dom.queryAttribute(i.zBind,o));null!=s.get()&&s.each((function(t,e){h(e,n)})),s=l.find(r.dom.queryAttribute(i.zField,o)),null!=s.get()&&s.each((function(t,e){h(e,n)})),this.context._c&&"function"==typeof this.context._c.update&&this.context._c.update(t,e,n,o,c)}}},{context:this}),this._viewObserver=new c(this),this._disposed=!1,this.options(e),this}d.prototype.dispose=function(){if(this._disposed)return;this._disposed=!0,this._viewObserver.stop(),r.isNoU(this._c)||(r.isNoU(this._c.view())||(this._c.trigger("component:dispose",this._c.view(),!0),this._c.view().attr(i.zComponent,null).attr(i.zContext,null).attr(i.zLoad,null).attr(i.zLoaded,null).attr(i.zReady,null).attr(i.resourceType.view,null).attr(i.resourceType.controller,null).attr(i.resourceType.file,null).attr(this.getCssId(),null),this._c.view().reset(),r.isNoU(this._c._fieldCache)||s.each(this._c._fieldCache,(function(t,e){e.reset()}))),r.isFunction(this._c.dispose)&&this._c.dispose.call(this,this)),this.model(null),!r.isNoU(this._c)&&this._c._childNodes.length>0&&(this._c.view().html(""),this._c.restoreView());const t=l.dumpContexts(),e=t.indexOf(this);t.splice(e,1)},d.prototype.container=function(t){return null==t?this._container:(t instanceof s.ZxQuery&&(t=t.get()),this._container=t,this)},d.prototype.view=function(t){if(void 0===t)return this._view;if(null===t)throw new Error("View cannot be set to null.");if(t instanceof s.ZxQuery&&(t=t.get()),t===this._view)return this;this._viewObserver.stop();const e=this.getCssId();if(null!=this._view){const t="*"+r.dom.cssNot(i.zLoad).getAll()+r.dom.cssNot(i.zInclude).getAll();s(this._view).attr(e,null).find(t).each((function(t,n){this.attr(e,null)}))}const n=function(t){t.find("*").each((function(t,e,n){for(let t=0;t1&&s.startsWith("#")&&(null==n.attr(i.zField)&&n.attr(i.zField,s.substring(1)),null==n.attr(i.zBind)&&null!=o.value&&o.value.length>0&&n.attr(i.zBind,o.value))}}))};if(o.t(this.componentId,"view:attach","timer:view:start"),"string"==typeof t){const e={content:t};this.trigger(this,"html:parse",e),t=e.content;const o=s.wrapElement("div",t);null!=o.firstElementChild&&(null!=r.dom.getAttribute(o.firstElementChild,i.zView)?1===o.children.length&&(t=o.firstElementChild.innerHTML):t=o.innerHTML),null!=this._container?(this._view=this._container,this._view.innerHTML+=t):null!=this._view?this._view.innerHTML=t:this._view=o;const c=s(this._view);c.find("script:not([type=jscript])").each((function(t,e){"true"!==this.attr(i.zuixLoaded)&&(this.attr(i.zuixLoaded,"true"),Function(e.innerHTML).call(window))})),n(c),this.trigger(this,"view:process",c)}else null!=this._container&&"default"!==this.componentId?(this._view=s.wrapElement("div",t.outerHTML).firstElementChild,r.dom.setAttribute(this._view,i.zView,null),this._container.appendChild(this._view),this._view=this._container):this._view=t;const c=s(this._view);return n(c),c.find(r.dom.queryAttribute(i.zLoad,null,r.dom.cssNot(i.zLoaded))).each((function(t,e){this.attr(i.zLoaded,"false")})),this.checkEncapsulation(),this.modelToView(),o.t(this.componentId,"view:attach","timer:view:stop"),this},d.prototype.field=function(t){const e=this,n=l.field(t,this._view,this);return n.on=function(t,n,o,i){if("string"==typeof n){const t=n;n=function(){e._c&&e._c.trigger(t,o,i)}}return s.ZxQuery.prototype.on.call(this,t,n)},n},d.prototype.checkEncapsulation=function(){const t=s(this._view),e=this.getCssId();if(t.length()>0&&!1!==this._options.css)if(t.attr(e,""),null!=this._container||null!=this._style){const n="*"+r.dom.cssNot(i.zLoad).getAll()+r.dom.cssNot(i.zInclude).getAll();t.find(n).each((function(t,n){this.attr(e,"")})),this._viewObserver.start(),t.attr(i.resourceType.controller,null)}else t.attr(i.resourceType.controller,"")},d.prototype.style=function(t){if(void 0===t)return this._style;const e=this.getCssId();if(o.t(this.componentId,"view:style","timer:view:start",e),null==t||t instanceof Element)this._css=t instanceof Element?t.innerText:t,this._style=s.appendCss(t,this._style,this.componentId+"@"+e,r.dom.getShadowRoot(this._container));else if("string"==typeof t){this._css=t;const n={content:t};this.trigger(this,"css:parse",n),t=n.content;let o="";!0===this.options().resetCss&&(o=":host { all: initial; }");const i="["+e+"]";t=s.wrapCss(i,o+"\n"+t,!0===this.options().encapsulation),this._style=s.appendCss(t,this._style,this.componentId+"@"+e,r.dom.getShadowRoot(this._container))}return this.checkEncapsulation(),o.t(this.componentId,"view:style","timer:view:stop",e),this},d.prototype.model=function(t){return void 0===t||this._model===t||(null!==this._model&&"function"!=typeof this._model&&l.observable(this._model).unsubscribe(this._modelListener),this._model=t,null!=t&&("function"!=typeof t&&(this._model=l.observable(t).subscribe(this._modelListener).proxy),this.modelToView(),null!=this._c&&r.isFunction(this._c.update)&&this._c.update.call(this._c,null,null,null,null,this._c))),this._model},d.prototype.controller=function(t){return void 0===t?this._controller:(this._controller=t,this)},d.prototype.options=function(t){if(null==t)return this._options;const e=this._options=this._options||{};return Object.assign(e,t),this.componentId=e.componentId||this.componentId,null==u[this.componentId]&&(u[this.componentId]=u.length,u.length++),this.container(e.container),this.view(e.view),"string"==typeof e.css&&this.style(e.css),this.controller(e.controller),this.model(e.model),this},d.prototype.on=function(t,e){return this._c.on(t,e),this},d.prototype.loadCss=function(t,e){const n=this;r.isNoU(t)&&(t={}),r.isNoU(t.caching)||t.caching;let i=n.componentId;r.isNoU(t.path)||(i=t.path);let c=l.store("zuix.inlineStyles");if(null==c&&(c=[],l.store("zuix.inlineStyles",c)),null!=c[i])n.style(c[i]),r.isFunction(t.success)&&t.success.call(n,c[i],n),r.isFunction(t.then)&&t.then.call(n,n);else{const e=s().find('style[media="#'+i+'"],style[media="'+i+'"]');if(e.length()>0){const o=e.get(0).innerText;n.style(o),e.detach(),c[i]=o,r.isFunction(t.success)&&t.success.call(n,o,n),r.isFunction(t.then)&&t.then.call(n,n)}else i==n.componentId&&(i+=".css"),s.ajax({url:l.getResourcePath(i),success:function(e){n.style(e),r.isFunction(t.success)&&t.success.call(n,e,n)},error:function(e){o.e(e,n),r.isFunction(t.error)&&t.error.call(n,e,n)},then:function(){r.isFunction(t.then)&&t.then.call(n,n)}})}return this},d.prototype.loadHtml=function(t,e){const n=this;let c=n.componentId;r.isNoU(t)&&(t={}),r.isNoU(t.caching)||t.caching,r.isNoU(t.path)||(c=t.path);let u=l.store("zuix.inlineViews");if(null==u&&(u=[],l.store("zuix.inlineViews",u)),null!=u[c])n.view(u[c]),r.isFunction(t.success)&&t.success.call(n,u[c],n),r.isFunction(t.then)&&t.then.call(n,n);else{const e=s().find(r.dom.queryAttribute(i.zView,c,r.dom.cssNot(i.zComponent)));if(e.length()>0){let o=e.get(0);if("template"===o.tagName.toLowerCase()){o=o.cloneNode(!0);const t=o.content.querySelectorAll("style");if(t)for(const e of t)e.setAttribute("media","#"+n.componentId)}else{const t=o.querySelectorAll('style[media="#"]');if(t)for(const e of t)e.setAttribute("media","#"+n.componentId)}u[c]=o.innerHTML,n.view()===o||null!=n.container()&&n.container().contains(o)?(e.attr(i.zView,null),n._view=o,this.trigger(this,"view:process",s(n.view()))):n.view(o.innerHTML),r.isFunction(t.success)&&t.success.call(n,o.innerHTML,n),r.isFunction(t.then)&&t.then.call(n,n)}else{const e=r.isNoU(t.cext)?".html":t.cext;c==n.componentId&&(c+=e),s.ajax({url:l.getResourcePath(c),success:function(e){n.view(e),r.isFunction(t.success)&&t.success.call(n,e,n)},error:function(e){o.e(e,n),r.isFunction(t.error)&&t.error.call(n,e,n)},then:function(){r.isFunction(t.then)&&t.then.call(n,n)}})}}return this},d.prototype.viewToModel=function(){o.t(this.componentId,"view:model","timer:vm:start");const t={},e=s(this._view);return e.find(r.dom.queryAttribute(i.zField)).each((function(n,o,s){if(!l.isDirectComponentElement(e,s))return!0;const r=this.attr(i.zField);t[r]=o})),this._model=l.observable(t).subscribe(this._modelListener).proxy,o.t(this.componentId,"view:model","timer:vm:stop"),this},d.prototype.modelToView=function(){if(o.t(this.componentId,"model:view","timer:mv:start"),null!=this._view){const t=this;t["#"]={};const e=s(this._view);e.find(r.dom.queryAttribute(i.zField)).each((function(n,o,c){if(!l.isDirectComponentElement(e,c)&&"true"!==c.attr("inherits"))return!0;let u=c.attr(i.zBind);null==u&&(u=c.attr(i.zField));const d=s(t._view);try{const e=r.hyphensToCamelCase(u);Function("function testName(){ const "+e+' = "test"; }'),t["#"][e]=t.field(u)}catch(t){}const p=function(e,n){e&&!t._disposed&&e.call(d,c,n,d,(function(o){if(!t._disposed){const t=c.get().dataset.__zuix_refreshTimeout;t&&a[t]&&clearTimeout(a[t]),c.get().dataset.__zuix_refreshTimeout=setTimeout((function(){p(e,n)}),o||500)}}))};if("function"==typeof t._model)p(t._model,u);else{let e=r.propertyFromPath(t._model,u);const n=r.hyphensToCamelCase(u),i=r.propertyFromPath(t._model,n);null==e&&null!=i&&(u=n,e=r.propertyFromPath(t._model,e)),"function"==typeof e?p(e,u):null!=e&&h(o,e)}}))}return o.t(this.componentId,"model:view","timer:mv:stop"),this},d.prototype.getCssId=function(){let t="";return"string"==typeof this._options.css&&(t="_"+this.contextId),i.cssIdPrefix+u[this.componentId]+t},Object.defineProperty(d.prototype,"path",{get:function(){const t=this.componentId,e=t.lastIndexOf("/");return e<0?t:t.substring(0,e+1)}}),Object.defineProperty(d.prototype,"name",{get:function(){const t=this.componentId,e=t.lastIndexOf("/");return e<0?t:t.substring(e+1)}}),Object.defineProperty(d.prototype,"$",{get:function(){return this._c&&this._c.view()}}),t.exports=d},211:function(t,e,n){const o=n(541);_.prototype.componentize=function(t){return g?(r().one("componentize:step",(function(){requestAnimationFrame((function(){g=!1,m.componentize(t)}))})),this):(g=!0,m.trigger(this,"componentize:begin"),m.$().trigger("componentize:begin"),m.resolveImplicitLoad(t),function(t){null==t&&(t=document),c.indexOf(t)||c.push(t)}(t),b(t),this)},_.prototype.applyOptions=function(t,e){return C(t,e),this},_.prototype.loadInline=function(t,e){x(t,e)},_.prototype.resolvePath=function(t){return w(t)},_.prototype.willLoadMore=function(){return l.length>0||c.length>0},_.prototype.lazyLoad=function(t,e){return v(t,e)},_.prototype.dequeue=function(t){for(let e=0;e0&&(t=c.unshift()),t instanceof r.ZxQuery&&(t=t.get());const e=s.dom.queryAttribute(o.zLoad,null,s.dom.cssNot(o.zLoaded))+","+s.dom.queryAttribute(o.zInclude,null,s.dom.cssNot(o.zLoaded));let n=r(t).find(e);n=Array.prototype.slice.call(n._selection);const a=[];for(let t=0;t0?l.shift():null;for(;null!=e&&null!=e.element;){const n=I(e.element);if(v()&&n?(e.lazy=!0,e.visible=r.getPosition(e.element,f).visible):(e.lazy=!1,e.visible=!0),null!=e.element&&e.visible){t={item:e,cancelable:e.lazy};break}if(!(l.length>0))break;e=l.shift()}return t}();null!=e&&null!=e.item&&null!=e.item.element&&(r(e.item.element).one("component:loaded",(function(){m.componentize(e.item.element)})),x(e.item.element))}function x(t,e){const n=r(t);if(null!=n.attr(o.zLoaded)||n.parent("pre,code").length()>0)return!1;n.attr(o.zLoaded,"true");let i=n.attr(o.zOptions);s.isNoU(i)?i=null!=n.get().__zuix_loadOptions?n.get().__zuix_loadOptions:{}:(i=z(t,i),i=s.cloneObject(i)||{}),e&&Object.assign(i,e);const c=n.attr(o.zContext);if(!s.isNoU(c)){const t=m.context(c);null!==t&&(i=t.options()),i.contextId=c}s.isNoU(i.view)&&!n.isEmpty()?(i.view=t,i.viewDeferred=!0):s.isNoU(i.view)&&s.isNoU(i.container)&&n.isEmpty()&&null==n.attr(o.resourceType.controller)&&(i.container=t);let l=n.attr(o.zLoad);if(s.isNoU(l)){const t=n.attr(o.zInclude);if(null==t)return!1;l=w(t),n.attr(o.zInclude,l),n.attr(o.zComponent,null),s.isNoU(i.controller)&&(i.controller=function(){})}else if(l=w(l),n.attr(o.zLoad,l),"default"!==l&&null!==n.attr(o.resourceType.view))n.attr(o.zComponent,null),s.isNoU(i.controller)&&(i.controller=function(){});else if("default"===l||null!==n.attr(o.resourceType.controller)){i.view=i.view||t,i.viewDeferred=!0,i.html=i.html||!1,i.css=i.css||!1;const e=n.children('[media="#"]');e.length()>0&&e.parent().get()===n.get()&&(!1===i.css&&(i.css=""),e.each((function(t,e,n){i.css+="\n"+i.css+n.html()}))),"default"===l&&(i.controller=i.controller||function(){})}const u=n.attr(o.zModel);!s.isNoU(u)&&u.length>0&&(i.model=z(t,u));const a=n.attr(o.zBehavior);!s.isNoU(a)&&a.length>0&&(i.behavior=z(t,a));const h=n.attr(o.zOn);!s.isNoU(h)&&h.length>0&&(i.on=z(t,h));const d=n.attr(o.zPriority);return s.isNoU(d)||(i.priority=+d),m.load(l,i),!0}function w(t){if("@"===t[0]){let e=m.store("config"),n="https://zuixjs.github.io/zkit/lib/";if(null!=e&&null!=e[location.host]&&(e=e[location.host]),null!=e)switch(typeof e.libraryPath){case"object":r.each(e.libraryPath,(function(e,o){return!t.startsWith(e+"/")||(n=o,!1)}));break;case"string":n=e.libraryPath}t=n+t.substring(t.indexOf("/")+1)}return t}function z(t,e){if("string"==typeof e){const n=r(t).parent(s.dom.queryAttribute(o.zLoad));if(n.get()){const o=m.context(n);try{return o._refreshHandler.runScriptlet(t,`[${e}][0]`)}catch(t){}}e=e.trim().startsWith("{")&&e.trim().endsWith("}")?Function("return "+e)():s.propertyFromPath(window,e)}return e}function C(t,e){e=z(t,e),null!=t&&null!=e&&(null!=e.lazyLoad&&s.dom.setAttribute(t,o.zLazy,e.lazyLoad.toString().toLowerCase()),null!=e.contextId&&s.dom.setAttribute(t,o.zContext,e.contextId.toString().toLowerCase()),null!=e.componentId&&s.dom.setAttribute(t,o.zLoad,e.componentId.toString().toLowerCase()))}function L(t){const e={element:t};return a.push(e),e}function I(t){if("false"===s.dom.getAttribute(t,o.zLazy))return!1;let e=function(t){for(let e=0;e100?(o=t,b(e)):(clearTimeout(n),n=setTimeout((function(){b(e)}),150))}))}(0,i)),!0}if("true"===s.dom.getAttribute(t,o.zLazy))return e=L(t),!0}return!1}},561:function(t,e,n){const o=n(917),i=n(826);function s(t){const e=this;this._view=null,this.context=t,this._childNodes=[],this.saveView=function(){this.restoreView(),this.view().children().each((function(t,n){e._childNodes.push(n)}))},this.restoreView=function(){this._childNodes.length>0&&(e.view().html(""),o.each(e._childNodes,(function(t,n){e.view().append(n)})),this._childNodes.length=0)},this.on=function(t,n){return"object"==typeof t&&null==n?(o.each(t,(function(t,n){e.on(t,n)})),this):(this.addEvent(t,n),this)},this.mapEvent=function(t,e,n,o){null!=e&&(e.off(n,this.eventRouter),t.push({target:e,eventPath:n,handler:o}),e.on(n,this.eventRouter))},this.eventRouter=function(n){const o=e.view();t._behaviorMap.concat(t._eventMap).forEach((function(t){t.eventPath===n.type&&"function"==typeof t.handler&&t.handler.call(o,n,n.detail,o)}))};const n=t.options();let i=null;if(null!=n.on&&o.each(n.on,(function(t,n){e.addEvent(t,n)})),null!=n.behavior)for(const t in n.behavior)n.behavior.hasOwnProperty(t)&&(i=n.behavior[t],e.addBehavior(t,i));if("function"==typeof(s=t.controller())&&/^\s*class\s+/.test(s.toString())){const e=new(t.controller().bind(this,this));t.controller(e)}else t.controller().call(this,this);var s;return this}s.prototype.addEvent=function(t,e){return this.mapEvent(this.context._eventMap,this.view(),t,e),this},s.prototype.addBehavior=function(t,e){return this.mapEvent(this.context._behaviorMap,this.view(),t,e),this},s.prototype.addTransition=function(t,e,n){const s=this.context.getCssId();this.context.$.attr(s,"");const r="[z-component]["+s+"]";return o.addTransition(this.context.componentId+"@"+s,r,t,e,n,i.dom.getShadowRoot(this.context.container())),this},s.prototype.field=function(t){return this.context.field(t)},s.prototype.clearCache=function(){this.context._fieldCache={}},s.prototype.view=function(t){const e=this;if(null==this.context.view()&&this._view===this.context.view()||(this.clearCache(),this._view=o(this.context.view()),this._view.field=function(t){return e.context.field(t)}),null!=t)return this._view.find(t);if(null!==this._view)return this._view;throw new Error("Not attached to a view yet.")},s.prototype.model=function(t){return null==t?this.context.model():(this.context.model(t),this)},s.prototype.options=function(){return this.context.options()},s.prototype.trigger=function(t,e,n){if(!0===n){let n=this.context.container();null==n&&(n=this.context.view()),null!=n&&o(n).trigger(t,e),this.context.trigger(this.context,t,e)}else this.view().trigger(t,e);return this},s.prototype.expose=function(t,e){const n=this,i=function(t,e){e&&(e.get||e.set)?Object.defineProperty(n.context,t,e):n.context[t]=e};return"object"==typeof t?o.each(t,(function(t,e){i(t,e)})):i(t,e),this},s.prototype.loadCss=function(t){return this.context.loadCss(t),this},s.prototype.loadHtml=function(t){return this.saveView(),this.context.loadHtml(t),this},s.prototype.log={},s.prototype.for=function(t){return this},t.exports=s},871:function(t){function e(t){const e=this;t.init=this.onInit.bind(this),t.create=this.onCreate.bind(this),t.dispose=this.onDispose.bind(this),t.update=function(t,n,o,i,s){return e.onUpdate.call(e,t,n,o,i,s)},Object.assign(this,t),Object.assign(this,Object.getPrototypeOf(t))}e.prototype.onInit=function(){},e.prototype.onCreate=function(){},e.prototype.onDispose=function(){},e.prototype.onUpdate=function(t,e,n,o,i){},t.exports=e},541:function(t){const e=Object.freeze({zModel:"z-model",zBind:"z-bind",zBehavior:"z-behavior",zOn:"z-on",zComponent:"z-component",zContext:"z-context",zField:"z-field",zInclude:"z-include",zLazy:"z-lazy",zLoad:"z-load",zLoaded:"z-loaded",zOptions:"z-options",zPriority:"z-priority",zView:"z-view",zuixLoaded:"zuix-loaded",zReady:"z-ready",resourceType:{view:"view",controller:"ctrl",file:"file"},cssIdPrefix:"z-css-"});t.exports=e},643:function(t,e,n){const o=n(541),i=n(826);function s(t){const e=this._context=t;this._mutationObserver=null,this._mutationCallback=function(t,n){const s=i.dom.queryAttribute(o.zComponent);for(const n of t)"childList"===n.type&&n.addedNodes.forEach((function(t){if(t instanceof Element){let n=zuix.$(t).parent(s);if(null==n.get())return;if(!1!==e.options().css&&null==n.attr(o.resourceType.controller)){if(n.get()===e._container||n.get()===e._view){let n=!1;for(let e=0;e0){const t=i.split(" as ");i=t[0],s=t[1]}const r=zuix.runScriptlet(i,e,t);r!==n&&(i="const "+s+" = args; "+e.attr("@set"),zuix.runScriptlet(i,e,t,r),n=r),o(n)},set:function(t,e,n,o){e.attr("@get")||(zuix.runScriptlet(e.attr("@set"),e,t),o(n))},"disable-if":function(t,e,n,o){const i=e.attr("@disable-if"),s=zuix.runScriptlet(i,e,t);s!==n&&(e.attr({disabled:s?"":null}),n=s),o(n)},"hide-if":function(t,e,n,o){const i=e.attr("@hide-if"),s=zuix.runScriptlet(i,e,t);s!==n&&(s?e.css({visibility:"hidden"}):e.css({visibility:"visible"}),n=s),o(n)},if:function(t,e,n,o){const i=e.attr("@if"),s=zuix.runScriptlet(i,e,t);s!==n&&(s?zuix.runScriptlet(e.attr("@then"),e,t):zuix.runScriptlet(e.attr("@else"),e,t),n=s),o(n)}}},this._fieldCache=[],this}function E(t){return"function"!=typeof t.for&&(t.for=function(e){return y[e]=t,t}),t}function N(t,e,n){i.isNoU(n)&&(n=this),null==n._fieldCache&&(n._fieldCache={});let o=null;return void 0===n._fieldCache[t]?(o=s(e).find(i.dom.queryAttribute(p.zField,t)+",["+CSS.escape("#"+t)+"]"),null!=o&&o.length()>0&&(n._fieldCache[t]=o,1===o.length()&&i.isNoU(o.field)&&(o.field=function(t){return N(t,o,o)}))):o=n._fieldCache[t],o}function T(t,e){t=d.resolvePath(t);let n=null;return i.isNoU(e)?(e={},n=new l(zuix,e,U)):(e.componentId=t,i.isNoU(e.contextId)?(!1===e&&(e={}),e.contextId="zuix-ctx-"+ ++w,n=k(e)):(n=S(e.contextId),null!==n?n.options(e):n=k(e))),n.componentId!=t&&(n.componentId=t),i.isFunction(e.ready)&&(n.ready=e.ready),i.isFunction(e.loaded)&&(n.loaded=e.loaded),i.isFunction(e.error)&&(n.error=e.error),null==v[t]?(v[t]=!0,O(n,e)):(null==_[t]&&(_[t]=[]),_[t].push({c:n,o:e}),n)}function A(t){let e=zuix.store("config");return null!=e&&null!=e[location.host]&&(e=e[location.host]),!(t=d.resolvePath(t)).startsWith("/")&&t.indexOf("://")<0&&(t=(null!=e&&null!=e.resourcePath?e.resourcePath:"")+t),t}function O(t,e){let n=F(t.componentId);null!==n&&null==e.controller&&null==t.controller()&&(t.controller(n.controller),o.t(t.componentId+":js","component:cached:js"));const s=function(i){!1!==e.css&&"string"!=typeof e.css?(i[t.componentId].step(t.componentId+":css"),t.loadCss({success:function(t){n.css=t},error:function(e){o.e(e,t)},then:function(){R(t,i[t.componentId])}})):R(t,i[t.componentId])};return i.isNoU(e.view)?(null!==n&&(null!=n.view&&(t.view(n.view),o.t(t.componentId+":html","component:cached:html")),!1!==e.css&&"string"!=typeof e.css&&(e.css=!1,n.css_applied||(n.css_applied=!0,t.style(n.css),o.t(t.componentId+":css","component:cached:css")))),i.isNoU(t.view())?b("resource-loader").queue(t.componentId+":html",(function(){v[t.componentId]=this,t.loadHtml({cext:e.cext,success:function(e){null==n&&(n=P(t)),n.view=e,delete n.controller,s(v)},error:function(n){o.e(n,t),i.isFunction(e.error)&&t.error.call(t,n,t)}})}),e.priority):b("resource-loader").queue(t.componentId+":css",(function(){v[t.componentId]=this,s(v)}),e.priority),t):(t.view(e.view),null==t.controller()?b("resource-loader").queue(t.componentId+":js",(function(){v[t.componentId]=this,R(t,v[t.componentId])}),f.length):R(t),t)}function j(t){const e=function(t){if(t instanceof Element){const e=t;t=zuix.context(e),d.dequeue(e)}!i.isNoU(t)&&t.dispose&&t.dispose()};t&&t.each?t.each((function(t,n){e(n)})):e(t)}function k(t){const e=new l(zuix,t,U);return f.push(e),e}function S(t,e){let n=null;if(t instanceof s.ZxQuery)t=t.get();else if("string"==typeof t){const e=s.find(i.dom.queryAttribute(p.zContext,t));e.length()>0&&(t=e.get())}return s.each(f,(function(e,o){if(t instanceof Element&&(o.view()===t||o.container()===t)||i.objectEquals(o.contextId,t))return n=o,!1})),"function"==typeof e&&(t instanceof Element||t instanceof s.ZxQuery)&&(null!=n&&n.isReady?e.call(n,n):s(t).one("component:loaded",(function(){n=zuix.context(this),setTimeout((function(){e.call(n,n)}),10)}))),n}function U(t,e,n){i.isFunction(m[e])&&m[e].call(t,n,t)}function F(t){let e=null;return s.each(x,(function(n,o){if(i.objectEquals(o.componentId,t))return e=o,!1})),e}function R(t,e){if(void 0===t.options().controller&&null===t.controller())if(o.d(t.componentId,"controller:load"),i.isNoU(e)||e.step(t.componentId+":js"),i.isFunction(y[t.componentId]))t.controller(y[t.componentId]),H(t,e);else{const n=function(e){const n=t.componentId+".js";s.ajax({url:A(n),success:function(e){e+='\n//# sourceURL="'+t.componentId+'.js"\n';try{t.controller(q(e));let n=F(t.componentId);null==n&&(n={componentId:t.componentId,controller:t.controller()},x.push(n))}catch(n){o.e(new Error,n,e,t),i.isFunction(t.error)&&t.error.call(t,n,t)}},error:function(e){o.e(e,new Error,t),i.isFunction(t.error)&&t.error.call(t,e,t)},then:function(){H(t,e)}})};i.isNoU(e)?b("resource-loader").queue(t.componentId+":js",(function(){n(v[t.componentId]=this)}),t.options().priority):n(e)}else H(t,e)}function P(t){const e=t.view().innerHTML,n=s.wrapElement("div",e),i={componentId:t.componentId,view:n.innerHTML,css:"string"==typeof t.options().css?null:t._css,controller:t.controller()};return x.push(i),o.t(t.componentId,"bundle:added"),i}function H(t,e){if(v[t.componentId]=null,i.isNoU(t.view()))o.e(t.componentId,"component:view:undefined");else{let r=F(t.componentId);t.options().viewDeferred?o.d(t.componentId,"component:deferred:load"):null===r?r=P(t):null==r.controller&&(r.controller=t.controller());const c=s(t.view());if(null==c.attr(p.zContext)&&c.attr(p.zContext,t.contextId),o.d(t.componentId,"component:initializing"),i.isFunction(t.controller())){const l=t._c=new u(t);l.log=n(381)(t.contextId),"function"==typeof l.init&&l.init();const a=function(){e&&o.d(t.componentId,"controller:create:deferred"),function(t){const e=t.context;o.t(e.componentId,"controller:init","timer:init:start"),e.isReady=!0;const n=t.view();i.isFunction(t.create)&&t.create(),t.trigger("view:create",n);(function(){if(i.isFunction(e.loaded)&&e.loaded.call(e,e),null!=_[e.componentId]){const t=_[e.componentId];let n;for(_[e.componentId]=null;null!=t&&null!=(n=t.shift());)O(n.c,n.o)}s().one("componentize:end",(function(){setTimeout((function(){n.find(i.dom.queryAttribute(p.zLoaded,"false",i.dom.cssNot(p.zComponent))).each((function(t,e){this.attr(p.zLoaded,null)})),zuix.componentize(n)}))}))})(),t.trigger("component:loaded",n,!0);const r=function(){i.isFunction(e.ready)&&e.ready.call(e,e),t.trigger("component:ready",n,!0)},c=zuix.store("handlers"),l=e.contextId,u=n.find(':scope > [type="jscript"]');u._selection=u._selection.concat(s(document).find('[type="jscript"][for="'+l+'"]')._selection),e.handlers.refresh=function(t,n,o,r){if(!e._disposed){if(e._dependencyResolver&&!e._dependencyResolver.resolved())return e.$.hasClass("not-ready")||e.$.addClass("not-ready"),r(o);null!=e._dependencyResolver&&!1!==e._dependencyResolver&&(e.$.removeClass("not-ready"),e._dependencyResolver=!1);let c=e._refreshHandler;if(!c){const a="return (function($this, context, args){const $ = context.$; const model = context.model(); ";let h='"use strict"; expose = {}; function refresh() {}; function ready() { return true; }; ';e["#"]&&s.each(e["#"],(function(t,e){const n=i.hyphensToCamelCase(t);h+="const $"+n+' = context["#"].'+n+";",h+="const "+n+" = $"+n+".get();",h+="let _"+n+" = null; zuix.context("+n+", function(c) { _"+n+" = c; });"})),h+="function runScriptlet($el, s, args) { let result; try { result = eval(\"const $this = $el; const _this = zuix.context(this); \" + s) } catch (e) { console.error('SCRIPTLET ERROR', e, s); }; return result };";const d=[];let p="";d.push(l),u.each((function(e,n,o){null!=o.attr("using")&&d.push(...o.attr("using").split(",")),o.parent().get()!==t.get()&&o.attr("for")!==l||(p+=o.html()+";")}));let f="";if(d.length>0){let t="";if(d.forEach((function(n){const o=i.hyphensToCamelCase(n);!1!==e._dependencyResolver?f+="let "+o+' = window["'+o+'"]; if ('+o+" == null) { "+o+' = zuix.context("'+n+'", function(ctx) { '+o+" = ctx; }); }":f+="let "+o+' = window["'+o+'"]; if ('+o+" == null) { "+o+' = zuix.context("'+n+'"); }',t+=o+" && "})),!1!==e._dependencyResolver&&f.length>0&&(f+="const resolved = function() { return "+t+"true; };",e._dependencyResolver=Function(a+f+"; return { resolved }; }).call(this.$el.get(), this.$el, this.ctx, this.args);").call({$el:n,ctx:e,args:null}),!e._dependencyResolver.resolved()))return r(o)}h+=f+p;const m=h+"; return { refresh, runScriptlet, ready, expose }; }).call(this.$el.get(), this.$el, this.ctx, this.args);";c=e._refreshHandler=Function(a+";"+m).call({$el:n,ctx:e,args:null}),c.expose&&Object.assign(e,c.expose)}c.refresh&&c.refresh(),"function"==typeof r&&r(o)}};const a=[];if(n.find("*").each((function(o,i,s){M(n,s)&&a.push(...function(n,o){const i=o.get(),s=[];for(let r=0;r1&&l.startsWith("@")){const r=l.substring(1).split(":")[0];let u=e.handlers?e.handlers[r]:null;if(u||(u=c[r]),"function"==typeof u){const e=zuix.activeRefresh(n,o,t.model(),(function(t,e,s,r){o.attr(p.zLoad)&&"true"!==o.attr(p.zReady)?null==zuix.context(o)&&r(s):u.call(i,n,o,s,r,l)}));s.push(e)}}}return s}(n,s))})),a.length>0||u.length()>0){const o=u.length()>0?u.attr("refreshDelay"):null,i=u.length()>0?u.attr("handlersDelay"):null;e.handlers.refresh.call(n.get(),n,n,t.model(),(function(t,s){zuix.activeRefresh(n,n,t,(function(t,o,s,c){if(e._refreshHandler&&!e._refreshHandler.initialized){let t=!0;a.forEach((function(e){if(null!=e.$element.attr(p.zLoad)||null!=e.$element.attr(p.zInclude))return t=null!=zuix.context(e.$element)&&zuix.context(e.$element).isReady,t})),e._refreshHandler.ready()&&!0===e.isReady&&t?(e._refreshHandler.initialized=!0,a.forEach((function(t){t.start(i)})),e.$.removeClass("not-ready"),r()):e.$.hasClass("not-ready")||e.$.addClass("not-ready"),c(s)}else e.handlers.refresh.call(n.get(),n,n,s,c)})).start(o)}))}else e.handlers.refresh.call(n.get(),n,n),r();o.t(e.componentId,"controller:init","timer:init:stop"),o.i(e.componentId,"component:loaded",l)}(l),e&&e.end(),c.attr(p.zReady,"true")};if(i.isNoU(l.view())||null!=l.view().attr(p.zComponent)||l.view().attr(p.zComponent,""),i.isNoU(t.model())&&!i.isNoU(t.view())&&t.viewToModel(),t.options().viewDeferred){t.options().viewDeferred=!1,l.saveView(),null===r&&"default"!==t.componentId&&(r={componentId:t.componentId,controller:t.controller()},x.push(r),o.t(t.componentId,"bundle:added"),o.d(t.componentId,"component:deferred:load"));const e=function(){!1!==t.options().html?null==r.view?t.loadHtml({cext:t.options().cext,success:function(e){r.view=e,o.d(t.componentId,"component:deferred:html")},error:function(e){o.e(e,t),i.isFunction(t.options().error)&&t.options().error.call(t,e,t)},then:function(){o.d(t.componentId,"controller:create:2"),a()}}):(t.view(r.view),a()):(o.d(t.componentId,"controller:create:3"),a())};!1!==t.options().css&&"string"!=typeof t.options().css?null==r.css?t.loadCss({success:function(e){r.css=e,o.d(t.componentId,"component:deferred:css")},then:function(){e()}}):(t.style(r.css),e()):("string"==typeof t.options().css&&t.style(t.options().css),e())}else o.d(t.componentId,"controller:create:1"),a()}else o.w(t.componentId,"component:controller:undefined")}}function M(t,e){const n=[...L,i.dom.queryAttribute(p.zLoad),i.dom.queryAttribute(p.zInclude)].join(",");return e.parent("pre,code,"+n).get()===t.get()}function q(t){let e=function(t){};if("string"==typeof t)try{const n=Function(i.normalizeControllerCode(t))();if("function"!=typeof n)throw new Error('Unexpected module type: "'+typeof n+'"');e=n}catch(e){o.e(this,e,t)}return e}I.prototype.field=function(t,e,n){return N.call(this,t,e,n)},I.prototype.load=function(t,e){return T.call(this,t,e)},I.prototype.unload=function(t){return j(t),this},I.prototype.loadComponent=function(t,e,n,o){return function(t,e,n,o){j(t=s(t)),t.each((function(t,i,r){!function(t){let i=t.get().shadowRoot;if(null==i&&o&&o.container instanceof ShadowRoot&&(i=o.container),i){const e=document.createElement("div");i.appendChild(e),Array.from(t.get().childNodes).map((function(t){e.appendChild(t)})),o&&o.container&&(o.container=e),t=s(e)}t.attr(p.zLoad,e),n&&t.attr(n,""),o&&o.lazyLoad&&"true"===o.lazyLoad.toString()||"true"===t.attr(p.zLazy)?o&&(t.get().__zuix_loadOptions=o):d.loadInline(t,o)}(r)}))}(t,e,n,o),this},I.prototype.controller=function(t){return E.call(this,t)},I.prototype.context=function(t,e){return S.call(this,t,e)},I.prototype.createComponent=function(t,e){if(null==e&&(e={}),i.isNoU(e.contextId)&&(e.contextId="zuix-ctx-"+ ++w),null!=S(e.contextId))throw new Error("Context arelady exists.");return e.container=document.createElement("div"),e.componentId=t,d.applyOptions(e.container,e),k(e)},I.prototype.trigger=function(t,e,n){return U(t,e,n),this},I.prototype.hook=function(t,e){var n,s;return n=t,s=e,i.isNoU(s)?delete m[n]:(m[n]&&o.w("Overwritten an already registered hook for",'"'+n+'"',"OLD HANDLER",m[n],"REPLACED BY",s),m[n]=s),this},I.prototype.using=function(t,e,n,o){e=d.resolvePath(e);const r=(t=t.toLowerCase())+"-"+e.hashCode();if("component"===t){const t=S(r);null==t?zuix.load(e,{contextId:r,view:"",priority:-10,ready:function(t){"function"==typeof n&&n(e,t)},error:function(){"function"==typeof n&&n(e,null)}}):"function"==typeof n&&n(e,t)}else{const c="style"===t;if(0===s.find(t+'[id="'+r+'"]').length()){const l=(o?i.dom.getShadowRoot(o.container()):null)||document.head||document.getElementsByTagName("head")[0],u=document.createElement(t);c?(u.type="text/css",u.id=r):(u.type="text/javascript",u.id=r),l.appendChild(u);const a=function(t){c?u.styleSheet?u.styleSheet.cssText=t:u.appendChild(document.createTextNode(t)):u.innerText?u.innerText=t:u.appendChild(document.createTextNode(t)),n&&n(e,r)},h="_res/"+t+"/"+r,d=F(h);null!=d?a(c?d.css:d.controller):s.ajax({url:e,success:function(t){const n={componentId:h,view:null,css:c?t:null,controller:c?null:t,using:e};x.push(n),a(t)},error:function(){l.removeChild(u),n&&n(e)}})}else n&&n(e,r)}return this},I.prototype.lazyLoad=function(t,e){return null==t?d.lazyLoad():(d.lazyLoad(t,e),this)},I.prototype.componentize=function(t){return!1===t?z=!0:!0===t&&(z=!1,t=null),z||d.componentize(t),this},I.prototype.store=function(t,e){return null!=e&&(this._store[t]=e),this._store[t]},I.prototype.getResourcePath=function(t){return A(t)},I.prototype.observable=function(t){return C.observable(t)},I.prototype.activeRefresh=function(t,e,n,o){return new h(t,e,n,o)},I.prototype.bundle=function(t,e){if(i.isNoU(t))return x;if(t&&"boolean"==typeof t){o.t("bundle:start");const t=d.lazyLoad();if(d.lazyLoad(!1),d.componentize(),"function"==typeof e){const n=function(n){setTimeout((function(){d.willLoadMore()?(o.t("bundle:wait"),n(n)):(o.t("bundle:end"),d.lazyLoad(t),e())}),1e3)};n(n)}}else{for(let e=0;e200?s.push(e+"color:#ff0000;"):t>100?s.push(e+"color:#ff7700;"):s.push(e+"color:#00aa00;")}}}i+=" \n%c ",s.push("background-color:transparent;color:inherit;");for(let t=s.length-1;t>=0;t--)Array.prototype.unshift.call(o,s[t]);Array.prototype.unshift.call(o,i),Array.prototype.push.call(o,"\n\n")},this.log=function(e,s){i&&i.call(t,e,s),(o.__zuix__debug||"ERROR"===e||"WARN"===e)&&(this.args(t,e,s),n.log(...s))}}s.prototype.monitor=function(t){i=t},s.prototype.info=function(...t){return this.log("INFO",t),this},s.prototype.i=s.prototype.l=s.prototype.log=s.prototype.info,s.prototype.warn=function(...t){return this.log("WARN",t),this},s.prototype.w=s.prototype.warn,s.prototype.error=function(...t){return this.log("ERROR",t),this},s.prototype.e=s.prototype.error,s.prototype.debug=function(...t){return this.log("DEBUG",t),this},s.prototype.d=s.prototype.debug,s.prototype.trace=function(...t){return this.log("TRACE",t),this},s.prototype.t=s.prototype.trace,t.exports=function(t){return new s(t)}},65:function(t,e,n){const o=n(381)("TaskQueue.js");function i(t){const e=this;e._worker=null,e._taskList=[],e._requests=[],null==t&&(t=function(){}),e.taskQueue=function(n,i,s){e._taskList.push({tid:n,fn:i,status:0,priority:s,step:function(n){o.t(n,"load:step"),t(e,"load:step",{task:n})},end:function(){this.status=2,o.t(this.tid,"load:next","timer:task:stop"),t(e,"load:next",{task:this.tid}),e._taskList.splice(this.index,1),e.taskCheck(),null!=this._callback&&this._callback.call(this)},callback:function(t){this._callback=t}}),o.t(n,"task added",s,"priority"),e._taskList.sort((function(t,e){return t.priority>e.priority?1:e.priority>t.priority?-1:0})),e.taskCheck()},e.taskCheck=function(){for(let n=0;n-1!==n.indexOf(t)))&&n.every((n=>this.objectEquals(t[n],e[n])))},propertyFromPath:function(t,e){if("string"!=typeof e||null==t)return;try{if(void 0!==t[e])return t[e]}catch(t){console.log(t)}let n=t,o="";const i=e.match(/\[(".*?"|'.*?'|(.*?))\]|".*?"|'.*?'|[0-9a-zA-Z_$]+/g);for(let t=0;t"}return n},cloneObject:function t(e){if(null===e||"object"!=typeof e)return e;let n=e;try{n=e.constructor();for(const o in e)e.hasOwnProperty(o)&&(n[o]=t(e[o]))}catch(t){}return n},hasPassiveEvents:function(){let t=!1;try{const e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassive",null,e),window.removeEventListener("testPassive",null,e)}catch(t){}return t},hyphensToCamelCase:function(t){return t.replace(/--/g,":").replace(/-([a-z0-9_$-])/g,(function(t){return"_$-".indexOf(t[1])>-1||(+t[1]).toString()===t[1]?"_"+t[1].replace("-","_"):t[1].toUpperCase()})).replace(/:/g,"-")},camelCaseToHyphens:function(t){return(t=t.replace(/(^\w)|(\s+\w)/g,(function(t){return t.toUpperCase()})).replace(/\s/g,"")).split(/(?=[A-Z])/).join("-").toLowerCase()},normalizeControllerCode:function(t){if(t.indexOf("module.exports")>=0)return"'use strict'; let module = {}; "+t+";\nreturn module.exports;";{let e=t;const n=t.indexOf("function "),o=t.indexOf("zuix.controller"),i=t.indexOf("class ");return i>=0&&(i=0&&(n=e.length||null==t?e[0]:e[t]},getAll:function(t){return i.split(",").join("")}};var i},getShadowRoot:function(t){for(;t;t=t.parentNode)if(t instanceof ShadowRoot)return t;return!1}}}},917:function(t,e,n){const o=n(381)("TaskQueue.js"),i=n(826),s=i.hasPassiveEvents(),r=[];function l(t){!function(t,e,n){const o=d(t);d.each(r,(function(){this.element===t&&this.path===e&&this.handler.call(o,n,o)}))}(this,t.type,t)}function c(t,e,n){let o=1,i=-1;d.each(r,(function(s){this.element===t&&this.path===e&&(o--,this.handler===n&&(i=s))})),-1!==i&&r.splice(i,1),0===o&&t.removeEventListener(e,l)}function u(t,e,n){let o=n.classes;return"string"==typeof n?(o=n.split(/[\s|,]+/g),n={}):Array.isArray(n)&&(o=n,n={}),Object.assign({type:t,classes:o,target:e},n)}function a(t){if(this._selection=[],void 0===t&&(t=document.documentElement),t instanceof a)return t;if(t instanceof HTMLCollection||t instanceof NodeList){const e=this._selection=[];d.each(t,(function(t,n){e.push(n)}))}else if(Array.isArray(t))this._selection=t;else if(t===window||t instanceof HTMLElement||t instanceof Node)this._selection=[t];else if("string"==typeof t)this._selection=document.documentElement.querySelectorAll(t);else if(null!==t){const e="ZxQuery cannot wrap object of this type.";throw o.e(e,typeof t,t),new Error(e)}return this}function h(t){return new a(t)}a.prototype.length=function(){return this._selection.length},a.prototype.parent=function(t){return i.isNoU(t)?new a(this._selection[0].parentNode):new a(d.getClosest(this._selection[0],t))},a.prototype.children=function(t){return i.isNoU(t)?new a(this._selection[0].children):new a(this._selection[0].querySelectorAll(t))},a.prototype.reverse=function(){const t=Array.prototype.slice.call(this._selection,0);return this._selection=t.reverse(),this},a.prototype.get=function(t){return i.isNoU(t)&&(t=0),this._selection[t]},a.prototype.eq=function(t){const e=this._selection;let n=e[t];return arguments.length>1&&(n=[],d.each(arguments,(function(t,o){null!=e[o]&&n.push(e[o])}))),new a(n)},a.prototype.prev=function(){return new a(this._selection[0].previousElementSibling)},a.prototype.next=function(){return new a(this._selection[0].nextElementSibling)},a.prototype.index=function(t){const e=this._selection[0];return 1===this.length()&&null==t?Array.from(this.parent().children()._selection).indexOf(e):this.length()>0&&null!=t?this._selection.indexOf(t.get()):-1},a.prototype.find=function(t){return this._selection[0]?new a(this._selection[0].querySelectorAll(t)):new a},a.prototype.each=function(t){return d.each(this._selection,t),this},a.prototype.attr=function(t,e){const n=this;if("object"==typeof t)d.each(t,(function(t,e){n.each((function(n,o){i.dom.setAttribute(o,t,e)}))}));else{if(void 0===e)return i.dom.getAttribute(this._selection[0],t);this.each((function(n,o){i.dom.setAttribute(this.get(),t,e)}))}return this},a.prototype.trigger=function(t,e){let n;return window.CustomEvent?n=new CustomEvent(t,{detail:e}):(n=document.createEvent("CustomEvent"),n.initCustomEvent(t,!0,!0,e)),this.each((function(t,e){e.dispatchEvent(n)})),this},a.prototype.one=function(t,e){const n=this;return"object"==typeof t&&null==e?(d.each(t,(function(t,e){n.one(t,e)})),this):(this.on(t,new function(t,e){let o=!1;return function(i,s){o||(o=!0,d(n).off(t,this),e.call(n,i,s,n))}}(t,e)),this)},a.prototype.on=function(t,e){if("object"==typeof t&&null==e){const e=this;return d.each(t,(function(t,n){e.on(t,n)})),this}const n=t.split(/[\s|,]+/g)||[];let i;return"function"!=typeof e&&(i=e,e=i.handler),this.each((function(t,c){n.map((t=>function(t,e,n,i){let c=!1;d.each(r,(function(){if(this.element===t&&this.path===e&&this.handler===n)return o.w("Handler already registered",t,e,n),c=!0,!1})),c||(r.push({element:t,path:e,handler:n,options:i}),t.addEventListener(e,l,!(!s||null!=i&&!1===i.passive)&&{passive:!0}))}(c,t,e,i)))})),this},a.prototype.off=function(t,e){if("object"==typeof t&&null==e){const e=this;return d.each(t,(function(t,n){e.off(t,n)})),this}const n=t.split(/[\s|,]+/g)||[];return this.each((function(t,o){n.map((t=>c(o,t,e)))})),this},a.prototype.reset=function(){return this.each((function(t,e){!function(t){d.each(r.slice(),(function(){this.element===t&&(o.t("Removing event handler",this.element,this.path,this.handler),c(this.element,this.path,this.handler))}))}(e)})),this},a.prototype.isEmpty=function(){return 0===this._selection[0].innerHTML.replace(/\s/g,"").length},a.prototype.position=function(){return null!=this._selection[0]?d.getPosition(this._selection[0]):{x:-1,y:-1,visible:!1}},a.prototype.css=function(t,e){const n=this;if("object"==typeof t)d.each(t,(function(t,e){n.each((function(n,o){o.style[t]=e}))}));else{if(i.isNoU(e))return this._selection[0].style[t];n.each((function(n,o){o.style[t]=e}))}return this},a.prototype.addClass=function(t){const e=t.split(/[\s|,]+/g)||[];return d.each(this._selection,(function(t,n){e.map((t=>n.classList.add(t)))})),this},a.prototype.hasClass=function(t){return d.hasClass(this._selection[0],t)},a.prototype.removeClass=function(t){const e=t.split(/[\s|,]+/g)||[];return d.each(this._selection,(function(t,n){e.map((t=>n.classList.remove(t)))})),this},a.prototype.html=function(t){return i.isNoU(t)?this._selection[0].innerHTML:(this.each((function(e,n){n.innerHTML=t})),this)},a.prototype.checked=function(t){if(i.isNoU(t)){const t=this._selection[0].checked;return null!=t&&"false"!=t&&(t||"checked"==t)}return this.each((function(e,n){n.checked=t})),this},a.prototype.value=function(t){return i.isNoU(t)?this._selection[0].value:(this.each((function(e,n){n.value=t})),this)},a.prototype.append=function(t){return"string"==typeof t?this._selection[0].innerHTML+=t:this._selection[0].appendChild(t instanceof a?t.get():t),this},a.prototype.insert=function(t,e){e=e instanceof a?e.get():e;const n=this.children().get(t);return null!==n?this._selection[0].insertBefore(e,n):this._selection[0].appendChild(e),this},a.prototype.prepend=function(t){return"string"==typeof t?this._selection[0].innerHTML=t+this._selection[0].innerHTML:this._selection[0].insertBefore(t instanceof a?t.get():t,this._selection[0].firstElementChild),this},a.prototype.detach=function(){const t=this._selection[0],e=t.parentNode;return null!=e&&(t.__zuix_oldParent=e,t.__zuix_oldIndex=Array.prototype.indexOf.call(e.children,t),e.removeChild(t),o.t("Detached from parent",e,t)),this},a.prototype.attach=function(){const t=this._selection[0];return null!=t.parentNode&&null!=t.__zuix_oldParent&&t.parentNode.removeChild(t),null==t.parentNode&&null!=t.__zuix_oldParent&&(d(t.__zuix_oldParent).insert(t.__zuix_oldIndex,t),t.__zuix_oldParent=null,delete t.__zuix_oldParent,delete t.__zuix_oldIndex),this},a.prototype.display=function(t){return i.isNoU(t)?this._selection[0].style.display:(d.each(this._selection,(function(e,n){n.style.display=t})),this)},a.prototype.visibility=function(t){return i.isNoU(t)?this._selection[0].style.visibility:(d.each(this._selection,(function(e,n){n.style.visibility=t})),this)},a.prototype.show=function(t){return this.display(null==t?"":t)},a.prototype.hide=function(){return this.display("none")},a.prototype.playTransition=function(t){return d.playFx(u("transition",this,t)),this},a.prototype.playAnimation=function(t){return d.playFx(u("animation",this,t)),this},a.prototype.isPlaying=function(){return this.hasClass("--z-playing")};const d=h;h.find=function(t){return d().find(t)},h.each=function(t,e){const n=null==t?0:Object.keys(t).length;if(n>0){let o=0;for(const i in t)if(t.hasOwnProperty(i)){let s=t[i];if(s instanceof Element&&(s=d(s)),!1===e.call(s,i,t[i],s))break;if(o++,o>=n)break}}return this},h.ajax=h.http=function(t){let e;e=i.isNoU(t)||i.isNoU(t.url)?t:t.url;const n=new XMLHttpRequest;n.onload=function(){200===n.status?t.success&&t.success(n.responseText):t.error&&t.error(n,n.statusText,n.status),t.then&&t.then(n)},n.onerror=function(e,n,o){t.error&&t.error(e,n,o)},"function"==typeof t.beforeSend&&t.beforeSend(n);try{n.open("GET",e),n.send()}catch(e){t.error&&t.error(n,n.statusText,n.status,e)}return this},h.hasClass=function(t,e){const n=e.split(/[\s|,]+/g)||[];let o=!1;return d.each(n,(function(e,n){if(o=t.classList.contains(n),o)return!1})),o},h.classExists=function(t){const e=t.split(/[\s|,]+/g)||[];let n=!1;return d.each(e,(function(t,e){const o=document.styleSheets;if(null!=o)for(let t=0;t1){let e=s[2];if(null!=e&&e.length>0){e=e.replace(/\n/g,"");const o=e.split(",");let i=!1;if(d.each(o,(function(e,s){if("."===s.trim()||":host"===s.trim())r+="\n[z-component]"+t+" ";else if("@"===s.trim()[0])r+=s+" ",(s.trim().toLowerCase().startsWith("@media")||s.trim().toLowerCase().startsWith("@supports"))&&(i=!0);else if(n)s.split(/\s+/).forEach((function(e){(e=e.trim()).lastIndexOf(".")>0?e.replace(/(?=\.)(?![^\[\]()]*(?:\[[^\[\]()]*([\])]))?([\])]))/gi,",").split(",").forEach((function(e){r+=""!==e?e+t:"\n"})):r+=""!==e&&">"!==e&&"*"!==e?"\n"+e+t+" ":e+" "}));else{let e=s.trim();e=e.startsWith(":host")?e.substring(5):"\n"+e,r+="\n[z-component]"+t+e+" "}e=0)){const e=t.substring(l,o.index)+o[0];s+=e,l+=e.length;continue}let n=o[0];if(e){const t=e(o[0]);i.isNoU(t)||(n=t,r++)}s+=t.substring(l,o.index)+n,l=o.index+o[0].length}return r>0?(s+=t.substring(l),s):null},h.getClosest=function(t,e){for(t=t.parentNode;t&&t!==document;t=t.parentNode)if(t.matches&&t.matches(e))return t;return null},h.getPosition=function(t,e){const n="--ui--visible",o=function(){let e=0,n=0;const o=t.getBoundingClientRect();let i=t;for(;i;){if("body"===i.tagName.toLowerCase()){const t=i.scrollLeft||document.documentElement.scrollLeft,o=i.scrollTop||document.documentElement.scrollTop;e+=i.offsetLeft-t+i.clientLeft,n+=i.offsetTop-o+i.clientTop}else e+=i.offsetLeft-i.scrollLeft+i.clientLeft,n+=i.offsetTop-i.scrollTop+i.clientTop;i=i.offsetParent}return{x:e,y:n,rect:o}}();o.visible=!1;let i=t.offsetParent;if(null!=i||"fixed"!==getComputedStyle(t).position&&"absolute"!==getComputedStyle(t).position||(i=document.body),null!=i){if(i!==document.body){let t=i.offsetParent;for(;null!=t&&null!==t.offsetParent&&t.offsetHeight===t.scrollHeight;)t=t.offsetParent;null!=t&&(i=t)}let s=i.getBoundingClientRect();i===document.body&&(s={x:s.x,y:s.y,width:document.documentElement.offsetWidth||document.documentElement.clientWidth,height:document.documentElement.offsetHeight||document.documentElement.clientHeight,top:0,left:0,right:document.documentElement.clientWidth||document.documentElement.offsetWidth,bottom:document.documentElement.clientHeight||document.documentElement.offsetHeight}),null==e&&(e=0);const r=t.getBoundingClientRect();let l=!(r.left-1>s.right-e||r.right+1s.bottom-e||r.bottom+11&&t.classes.shift();n.hasClass("--z-playing")||(n.addClass("--z-playing"),i&&n.addClass(i).css(t.type,"none"));const s=getComputedStyle(n.get()),r=1e3*parseFloat(s[t.type+"-delay"])||i?10:0;let l=!1;const c=function(){l||(l=!0,t.classes.length>1?(t.onStep&&t.onStep.call(n,n,t.classes.slice(1)),e.playFx(t)):(!t.holdState&&t.classes.length>0&&n.removeClass(t.classes.shift()),n.removeClass("--z-playing"),t.onEnd&&t.onEnd.call(n,n)))},u=function(){i&&n.css(t.type,"").removeClass(i);const e=t.classes[0];e&&n.addClass(e),t.options&&d.each(t.options,(function(e,o){n.css(t.type+"-"+e,o)}));const o=1+(parseFloat(s[t.type+"-iteration-count"])||0),r=1e3*parseFloat(s[t.type+"-duration"])*o;setTimeout(c,r)};n.on(t.type+"end",(function(e){e.target===t.target.get()&&(n.off(t.type+"end",this),c())})),r>0?setTimeout(u,r):u()},h.ZxQuery=a,String.prototype.hashCode=function(){let t=0;if(0===this.length)return t;for(let e=0;e0?(setTimeout((function(){i.requestRefresh(t,e,i.contextData)}),l?i.refreshMs:500),s=!0):null==c&&i.stop()};l?(e._refreshActive||(e._refreshActive=!0,e.trigger("refresh:active")),o(t,e,n,(function(t,e,n){c(t,e,n)}))):(e._refreshActive&&(e._refreshActive=!1,e.trigger("refresh:inactive")),c(i.contextData))}}e.prototype.stop=function(){this.pause(),this.refreshMs=0,this.stopped=!0},e.prototype.start=function(t){if(this.refreshMs=t||this.refreshMs,this.started)return this.resume();this.started=!0,this.requestRefresh(this.$view,this.$element,this.contextData)},e.prototype.pause=function(){this.paused=!0},e.prototype.resume=function(){this.paused=!1},t.exports=e},854:function(t){t.exports=function(){}},622:function(t,e,n){const o=n(381)("ComponentContext.js"),i=n(541),s=n(917),r=n(826),l=n(643);let c=null;const u=[],a=[];function h(t,e){e=e.observableTarget||e;const n=r.isNoU(e.value)?r.isNoU(e.innerHTML)?e:e.innerHTML:e.value;switch(t.tagName.toLowerCase()){case"img":t.src=r.isNoU(e.src)?r.isNoU(e.innerHTML)?e:e.innerHTML:e.src;break;case"a":t.href=r.isNoU(e.href)?r.isNoU(e.innerHTML)?e:e.innerHTML:e.getAttribute("href"),r.isNoU(e.href)||r.isNoU(e.innerHTML)||""===e.innerHTML.trim()||0===s(e).find(r.dom.queryAttribute(i.zField)).length()&&s(t).html("").append(document.createTextNode(e.innerHTML));break;case"input":switch(t.type){case"checkbox":case"radio":t.value==n&&(t.checked=!0);break;default:t.value=n}break;case"select":s.each(t.options,(function(e,o){if(o.value==n)return t.selectedIndex=e,!1}));break;default:const o=r.isNoU(e.innerHTML)?document.createTextNode(e):e.innerHTML;s(t).html("").append(o)}}function d(t,e,n,o,i){o&&!t._disposed&&o.call(e,n,i,e,(function(s){if(!t._disposed){const r=n.get().dataset.__zuix_refreshTimeout;r&&a[r]&&clearTimeout(a[r]),n.get().dataset.__zuix_refreshTimeout=setTimeout((function(){d(t,e,n,o,i)}),s||500)}}))}function p(t,e,n){return c=t,this._options=null,this.contextId=null==e||null==e.contextId?null:e.contextId,this.componentId=null,this.handlers={refresh:function(t,e,n,o){}},this.trigger=function(t,e,o){n&&n(t,e,o)},this._container=null,this._model=null,this._view=null,this._css=null,this._style=null,this._controller=null,this.behavior=null,this._eventMap=[],this._behaviorMap=[],this._fieldCache=[],this._c=null,this._modelListener=Object.assign({context:null,get:function(t,e,n,o){},set:function(t,e,n,o,s){const l=this.context.$;if(t instanceof Element&&(o=o.split(".")[0],n=t),"function"==typeof n){let t=l.find(r.dom.queryAttribute(i.zBind,o));return null==t.get()&&(t=l.find(r.dom.queryAttribute(i.zField,o))),void d(this.context,l,t,n,e)}const c=function(t){null!=t.get()&&t.each((function(t,e){h(e,n)}))};l.get()&&(c(l.find(r.dom.queryAttribute(i.zBind,o))),c(l.find(r.dom.queryAttribute(i.zField,o))),this.context._c&&this.context._c.update&&this.context._c.update(t,e,n,o,s))}},{context:this}),this._viewObserver=new l(this),this._disposed=!1,this.options(e),this}p.prototype.dispose=function(){if(this._disposed)return;this._disposed=!0,this._viewObserver.stop(),r.isNoU(this._c)||(r.isNoU(this._c.view())||(this._c.trigger("component:dispose",this._c.view(),!0),this._c.view().attr(i.zComponent,null).attr(i.zContext,null).attr(i.zLoad,null).attr(i.zLoaded,null).attr(i.zReady,null).attr(i.resourceType.view,null).attr(i.resourceType.controller,null).attr(i.resourceType.file,null).attr(this.getCssId(),null),this._c.view().reset(),r.isNoU(this._c._fieldCache)||s.each(this._c._fieldCache,(function(t,e){e.reset()}))),this._c.dispose&&this._c.dispose.call(this,this)),this.model(null),!r.isNoU(this._c)&&this._c._childNodes.length>0&&(this._c.view().html(""),this._c.restoreView());const t=c.dumpContexts(),e=t.indexOf(this);t.splice(e,1)},p.prototype.container=function(t){return null==t?this._container:(t instanceof s.ZxQuery&&(t=t.get()),this._container=t,this)},p.prototype.view=function(t){if(void 0===t)return this._view;if(null===t)throw new Error("View cannot be set to null.");if(t instanceof s.ZxQuery&&(t=t.get()),t===this._view)return this;this._viewObserver.stop();const e=this.getCssId();if(null!=this._view){const t="*"+r.dom.cssNot(i.zLoad).getAll()+r.dom.cssNot(i.zInclude).getAll();s(this._view).attr(e,null).find(t).each((function(t,n){this.attr(e,null)}))}const n=function(t){t.find("*").each((function(t,e,n){for(let t=0;t1&&o.name.startsWith("#")){const t=r.hyphensToCamelCase(o.name.substring(1));null==n.attr(i.zField)&&n.attr(i.zField,t),null==n.attr(i.zBind)&&null!=s&&s.length>0&&n.attr(i.zBind,s)}}}))};if(o.t(this.componentId,"view:attach","timer:view:start"),"string"==typeof t){const e={content:t};this.trigger(this,"html:parse",e),t=e.content;const o=s.wrapElement("div",t);null!=o.firstElementChild&&(null!=r.dom.getAttribute(o.firstElementChild,i.zView)?1===o.children.length&&(t=o.firstElementChild.innerHTML):t=o.innerHTML),null!=this._container?(this._view=this._container,this._view.innerHTML+=t):null!=this._view?this._view.innerHTML=t:this._view=o;const l=s(this._view);l.find("script:not([type=jscript])").each((function(t,e){"true"!==this.attr(i.zuixLoaded)&&(this.attr(i.zuixLoaded,"true"),Function(e.innerHTML).call(window))})),n(l),this.trigger(this,"view:process",l)}else null!=this._container&&"default"!==this.componentId?(this._view=s.wrapElement("div",t.outerHTML).firstElementChild,r.dom.setAttribute(this._view,i.zView,null),this._container.appendChild(this._view),this._view=this._container):this._view=t;const l=s(this._view);return n(l),l.find(r.dom.queryAttribute(i.zLoad,null,r.dom.cssNot(i.zLoaded))).each((function(t,e){this.attr(i.zLoaded,"false")})),this.checkEncapsulation(),this.modelToView(),o.t(this.componentId,"view:attach","timer:view:stop"),this},p.prototype.field=function(t){const e=this,n=c.field(t,this._view,this);return n.on=function(t,n,o,i){if("string"==typeof n){const t=n;n=function(){e._c&&e._c.trigger(t,o,i)}}return s.ZxQuery.prototype.on.call(this,t,n)},n},p.prototype.checkEncapsulation=function(){const t=s(this._view),e=this.getCssId();if(t.length()>0&&!1!==this._options.css)if(t.attr(e,""),null!=this._container||null!=this._style){const n="*"+r.dom.cssNot(i.zLoad).getAll()+r.dom.cssNot(i.zInclude).getAll();t.find(n).each((function(t,n){this.attr(e,"")})),this._viewObserver.start(),t.attr(i.resourceType.controller,null)}else t.attr(i.resourceType.controller,"")},p.prototype.style=function(t){if(void 0===t)return this._style;const e=this.getCssId();if(o.t(this.componentId,"view:style","timer:view:start",e),null==t||t instanceof Element)this._css=t instanceof Element?t.innerText:t,this._style=s.appendCss(t,this._style,this.componentId+"@"+e,r.dom.getShadowRoot(this._view));else if("string"==typeof t){this._css=t;const n={content:t};this.trigger(this,"css:parse",n),t=n.content;let o="";!0===this.options().resetCss&&(o=":host { all: initial; }");const i="["+e+"]";t=s.wrapCss(i,o+"\n"+t,!0===this.options().encapsulation),this._style=s.appendCss(t,this._style,this.componentId+"@"+e,r.dom.getShadowRoot(this._view))}return this.checkEncapsulation(),o.t(this.componentId,"view:style","timer:view:stop",e),this},p.prototype.model=function(t){return void 0===t||this._model===t||(null!==this._model&&"function"!=typeof this._model&&c.observable(this._model).unsubscribe(this._modelListener),this._model=t,null!=t&&("function"!=typeof t&&(this._model=c.observable(t).subscribe(this._modelListener).proxy),this.modelToView(),null!=this._c&&this._c.update&&this._c.update.call(this._c,null,null,null,null,this._c))),this._model},p.prototype.controller=function(t){return void 0===t?this._controller:(this._controller=t,this)},p.prototype.options=function(t){if(null==t)return this._options;const e=this._options=this._options||{};return Object.assign(e,t),this.componentId=e.componentId||this.componentId,null==u[this.componentId]&&(u[this.componentId]=u.length,u.length++),this.container(e.container),this.view(e.view),"string"==typeof e.css&&this.style(e.css),this.controller(e.controller),this.model(e.model),this},p.prototype.on=function(t,e){return this._c.on(t,e),this},p.prototype.loadCss=function(t,e){const n=this;r.isNoU(t)&&(t={}),r.isNoU(t.caching)||t.caching;let i=n.componentId;r.isNoU(t.path)||(i=t.path);let l=c.store("zuix.inlineStyles");if(null==l&&(l=[],c.store("zuix.inlineStyles",l)),null!=l[i])n.style(l[i]),t.success&&t.success.call(n,l[i],n),t.then&&t.then.call(n,n);else{const e=s().find('style[media="#'+i+'"],style[media="'+i+'"]');if(e.length()>0){const o=e.get(0).innerText;n.style(o),e.detach(),l[i]=o,t.success&&t.success.call(n,o,n),t.then&&t.then.call(n,n)}else i==n.componentId&&(i+=".css"),s.ajax({url:c.getResourcePath(i),success:function(e){n.style(e),t.success&&t.success.call(n,e,n)},error:function(e){o.e(e,n),t.error&&t.error.call(n,e,n)},then:function(){t.then&&t.then.call(n,n)}})}return this},p.prototype.loadHtml=function(t,e){const n=this;let l=n.componentId;r.isNoU(t)&&(t={}),r.isNoU(t.caching)||t.caching,r.isNoU(t.path)||(l=t.path);let u=c.store("zuix.inlineViews");if(null==u&&(u=[],c.store("zuix.inlineViews",u)),null!=u[l])n.view(u[l]),t.success&&t.success.call(n,u[l],n),t.then&&t.then.call(n,n);else{const e=s().find(r.dom.queryAttribute(i.zView,l,r.dom.cssNot(i.zComponent)));if(e.length()>0){let o,r=e.get(0);if("template"===r.tagName.toLowerCase()?(r=r.cloneNode(!0),o=r.content.querySelectorAll("style")):o=r.querySelectorAll('style[media="#"]'),o)for(const t of o)t.setAttribute("media","#"+n.componentId);u[l]=r.innerHTML,n.view()===r||null!=n.container()&&n.container().contains(r)?(e.attr(i.zView,null),n._view=r,this.trigger(this,"view:process",s(n.view()))):n.view(r.innerHTML),t.success&&t.success.call(n,r.innerHTML,n),t.then&&t.then.call(n,n)}else{const e=r.isNoU(t.cext)?".html":t.cext;l==n.componentId&&(l+=e),s.ajax({url:c.getResourcePath(l),success:function(e){n.view(e),t.success&&t.success.call(n,e,n)},error:function(e){o.e(e,n),t.error&&t.error.call(n,e,n)},then:function(){t.then&&t.then.call(n,n)}})}}return this},p.prototype.viewToModel=function(){o.t(this.componentId,"view:model","timer:vm:start");const t={},e=s(this._view);return e.find(r.dom.queryAttribute(i.zField)).each((function(n,o,s){if(!c.isDirectComponentElement(e,s))return!0;const r=this.attr(i.zField);t[r]=o})),this._model=c.observable(t).subscribe(this._modelListener).proxy,o.t(this.componentId,"view:model","timer:vm:stop"),this},p.prototype.modelToView=function(){if(o.t(this.componentId,"model:view","timer:mv:start"),null!=this._view){const t=this;t["#"]={};const e=s(this._view);e.find(r.dom.queryAttribute(i.zField)).each((function(n,o,s){if(!c.isDirectComponentElement(e,s)&&"true"!==s.attr("inherits"))return!0;let l=s.attr(i.zBind);if(null==l&&(l=s.attr(i.zField)),"function"==typeof t._model)d(t,e,s,t._model,l);else{let n=r.propertyFromPath(t._model,l);const i=r.hyphensToCamelCase(l),c=r.propertyFromPath(t._model,i);null==n&&null!=c&&(l=i,n=r.propertyFromPath(t._model,n)),"function"==typeof n?d(t,e,s,n,l):null!=n&&h(o,n)}})),e.find(r.dom.queryAttribute(i.zField)).each((function(n,o,s){if(!c.isDirectComponentElement(e,s)&&"true"!==s.attr("inherits"))return!0;let l=s.attr(i.zBind);null==l&&(l=s.attr(i.zField));try{const e=r.hyphensToCamelCase(l);Function("function testName(){ const "+e+' = "test"; }'),t["#"][e]=t.field(l)}catch(t){}}))}return o.t(this.componentId,"model:view","timer:mv:stop"),this},p.prototype.getCssId=function(){let t="";return"string"==typeof this._options.css&&(t="_"+this.contextId),i.cssIdPrefix+u[this.componentId]+t},Object.defineProperty(p.prototype,"path",{get:function(){const t=this.componentId,e=t.lastIndexOf("/");return e<0?t:t.substring(0,e+1)}}),Object.defineProperty(p.prototype,"name",{get:function(){const t=this.componentId,e=t.lastIndexOf("/");return e<0?t:t.substring(e+1)}}),Object.defineProperty(p.prototype,"$",{get:function(){return this._c&&this._c.view()}}),t.exports=p},211:function(t,e,n){const o=n(541);_.prototype.componentize=function(t){return g?(r().one("componentize:step",(function(){requestAnimationFrame((function(){g=!1,m.componentize(t)}))})),this):(g=!0,m.trigger(this,"componentize:begin"),m.$().trigger("componentize:begin"),m.resolveImplicitLoad(t),function(t){null==t&&(t=document),l.indexOf(t)||l.push(t)}(t),b(t),this)},_.prototype.applyOptions=function(t,e){return C(t,e),this},_.prototype.loadInline=function(t,e){x(t,e)},_.prototype.resolvePath=function(t){return w(t)},_.prototype.willLoadMore=function(){return c.length>0||l.length>0},_.prototype.lazyLoad=function(t,e){return v(t,e)},_.prototype.dequeue=function(t){for(let e=0;e0&&(t=l.unshift()),t instanceof r.ZxQuery&&(t=t.get());const e=s.dom.queryAttribute(o.zLoad,null,s.dom.cssNot(o.zLoaded))+","+s.dom.queryAttribute(o.zInclude,null,s.dom.cssNot(o.zLoaded));let n=r(t).find(e);n=Array.prototype.slice.call(n._selection);const a=[];for(let t=0;t0?c.shift():null;for(;null!=e&&null!=e.element;){const n=e.element,o=L(n);if(v()&&o?(e.lazy=!0,e.visible=r.getPosition(n,f).visible):(e.lazy=!1,e.visible=!0),null!=n&&e.visible){t={item:e,cancelable:e.lazy};break}if(!(c.length>0))break;e=c.shift()}return t}();if(null!=e&&null!=e.item&&null!=e.item.element){const t=e.item.element;r(t).one("component:loaded",(function(){m.componentize(t)})),x(t)}}function x(t,e){const n=r(t);if(null!=n.attr(o.zLoaded)||n.parent("pre,code").length()>0)return!1;n.attr(o.zLoaded,"true");let l=n.attr(o.zOptions);s.isNoU(l)?l=null!=n.get().__zuix_loadOptions?n.get().__zuix_loadOptions:{}:(l=z(t,l),l=s.cloneObject(l)||{}),e&&Object.assign(l,e);const c=n.attr(o.zContext);if(!s.isNoU(c)){const t=m.context(c);null!==t&&(l=t.options()),l.contextId=c}s.isNoU(l.view)&&!n.isEmpty()?(l.view=t,l.viewDeferred=!0):s.isNoU(l.view)&&s.isNoU(l.container)&&n.isEmpty()&&null==n.attr(o.resourceType.controller)&&(l.container=t);const u=function(){n.attr(o.zComponent,null),s.isNoU(l.controller)&&(l.controller=function(){})};let a=n.attr(o.zLoad);if(s.isNoU(a)){const t=n.attr(o.zInclude);if(null==t)return!1;a=w(t),n.attr(o.zInclude,a),u()}else if(a=w(a),n.attr(o.zLoad,a),"default"!==a&&null!==n.attr(o.resourceType.view))u();else if("default"===a||null!==n.attr(o.resourceType.controller)){l.view=l.view||t,l.viewDeferred=!0,l.html=l.html||!1,l.css=l.css||!1;const e=n.children('[media="#"]');e.length()>0&&e.parent().get()===n.get()&&(!1===l.css&&(l.css=""),e.each((function(t,e,n){l.css+="\n"+l.css+n.html()}))),"default"===a&&(l.controller=l.controller||function(){})}const h=[":on",":model",":behavior",":ready"];Array.from(n.get().attributes).filter((t=>t.nodeName.startsWith(":")&&!h.find((e=>t.nodeName.startsWith(e))))).forEach((t=>{const e=t.nodeName.match(/[^:]+/g);let n=l;e.forEach(((o,r)=>{if(o=s.hyphensToCamelCase(o),r===e.length-1){let s;try{s=Function("return "+t.nodeValue+";")()}catch(n){i.warn(e.join(":"),o,t.nodeValue,n)}return n[o]=s}n=n[o]=n[o]||{}}))}));const d=n.attr(o.zOn);!s.isNoU(d)&&d.length>0&&(l.on=z(t,d));const p=n.attr(o.zBehavior);!s.isNoU(p)&&p.length>0&&(l.behavior=z(t,p));const f=n.attr(o.zModel);!s.isNoU(f)&&f.length>0&&(l.model=z(t,f));const y=n.attr(o.zPriority);return s.isNoU(y)||(l.priority=+y),m.load(a,l),!0}function w(t){if("@"===t[0]){let e=m.store("config"),n="https://zuixjs.github.io/zkit/lib/";if(null!=e&&null!=e[location.host]&&(e=e[location.host]),null!=e)switch(typeof e.libraryPath){case"object":r.each(e.libraryPath,(function(e,o){return!t.startsWith(e+"/")||(n=o,!1)}));break;case"string":n=e.libraryPath}t=n+t.substring(t.indexOf("/")+1)}return t}function z(t,e){if("string"==typeof e){const n=r(t).parent(s.dom.queryAttribute(o.zLoad)+","+s.dom.queryAttribute(o.zInclude));if(n.get()){const o=m.context(n);try{return o._refreshHandler.runScriptlet(t,`[${e}][0]`)}catch(t){}}e=e.trim().startsWith("{")&&e.trim().endsWith("}")?Function("return "+e)():s.propertyFromPath(window,e)}return e}function C(t,e){e=z(t,e),null!=t&&null!=e&&(null!=e.componentId&&s.dom.setAttribute(t,o.zLoad,e.componentId.toString().toLowerCase()),null!=e.contextId&&s.dom.setAttribute(t,o.zContext,e.contextId.toString().toLowerCase()),null!=e.lazyLoad&&s.dom.setAttribute(t,o.zLazy,e.lazyLoad.toString().toLowerCase()))}function I(t){const e={element:t};return a.push(e),e}function L(t){if("false"===s.dom.getAttribute(t,o.zLazy))return!1;let e=function(t){for(let e=0;e100?(o=t,b(e)):(clearTimeout(n),n=setTimeout((function(){b(e)}),150))}))}(0,i)),!0}if("true"===s.dom.getAttribute(t,o.zLazy))return e=I(t),!0}return!1}},561:function(t,e,n){const o=n(917),i=n(826);function s(t){const e=this;this._view=null,this.context=t,this._childNodes=[],this.saveView=function(){this.restoreView(),this.view().children().each((function(t,n){e._childNodes.push(n)}))},this.restoreView=function(){this._childNodes.length>0&&(e.view().html(""),o.each(e._childNodes,(function(t,n){e.view().append(n)})),this._childNodes.length=0)},this.on=function(t,n){return"object"==typeof t&&null==n?(o.each(t,(function(t,n){e.on(t,n)})),this):(this.addEvent(t,n),this)},this.mapEvent=function(t,e,n,o){null!=e&&(e.off(n,this.eventRouter),t.push({target:e,eventPath:n,handler:o}),e.on(n,this.eventRouter))},this.eventRouter=function(n){const o=e.view();t._behaviorMap.concat(t._eventMap).forEach((function(t){t.eventPath===n.type&&t.handler&&t.handler.call(o,n,n.detail,o)}))};const n=t.options();let i=null;if(null!=n.on&&o.each(n.on,(function(t,n){t.split(/[\s|,]+/g).map((t=>e.addEvent(t,n)))})),null!=n.behavior)for(const t in n.behavior)n.behavior.hasOwnProperty(t)&&(i=n.behavior[t],t.split(/[\s|,]+/g).map((t=>e.addEvent(t,i))));if("function"==typeof(s=t.controller())&&/^\s*class\s+/.test(s.toString())){const e=new(t.controller().bind(this,this));t.controller(e)}else t.controller().call(this,this);var s;return this}s.prototype.addEvent=function(t,e){return this.mapEvent(this.context._eventMap,this.view(),t,e),this},s.prototype.addBehavior=function(t,e){return this.mapEvent(this.context._behaviorMap,this.view(),t,e),this},s.prototype.addTransition=function(t,e,n){const s=this.context.getCssId();this.context.$.attr(s,"");const r="[z-component]["+s+"]";return o.addTransition(this.context.componentId+"@"+s,r,t,e,n,i.dom.getShadowRoot(this.context.view())),this},s.prototype.field=function(t){return this.context.field(t)},s.prototype.clearCache=function(){this.context._fieldCache={}},s.prototype.view=function(t){const e=this;if(null==this.context.view()&&this._view===this.context.view()||(this.clearCache(),this._view=o(this.context.view()),this._view.field=function(t){return e.context.field(t)}),null!=t)return this._view.find(t);if(null!==this._view)return this._view;throw new Error("Not attached to a view yet.")},s.prototype.model=function(t){return null==t?this.context.model():(this.context.model(t),this)},s.prototype.options=function(){return this.context.options()},s.prototype.trigger=function(t,e,n){if(!0===n){let n=this.context.container();null==n&&(n=this.context.view()),null!=n&&o(n).trigger(t,e),this.context.trigger(this.context,t,e)}else this.view().trigger(t,e);return this},s.prototype.expose=function(t,e){const n=this,i=function(t,e){e&&(e.get||e.set)?Object.defineProperty(n.context,t,e):n.context[t]=e};return"object"==typeof t?o.each(t,(function(t,e){i(t,e)})):i(t,e),this},s.prototype.loadCss=function(t){return this.context.loadCss(t),this},s.prototype.loadHtml=function(t){return this.saveView(),this.context.loadHtml(t),this},s.prototype.log={},s.prototype.for=function(t){return this},t.exports=s},871:function(t){function e(t){const e=this;t.init=this.onInit.bind(this),t.create=this.onCreate.bind(this),t.dispose=this.onDispose.bind(this),t.update=function(t,n,o,i,s){return e.onUpdate.call(e,t,n,o,i,s)},Object.assign(this,t),Object.assign(this,Object.getPrototypeOf(t))}e.prototype.onInit=function(){},e.prototype.onCreate=function(){},e.prototype.onDispose=function(){},e.prototype.onUpdate=function(t,e,n,o,i){},t.exports=e},541:function(t){const e=Object.freeze({zModel:"z-model",zBind:"z-bind",zBehavior:"z-behavior",zOn:"z-on",zComponent:"z-component",zContext:"z-context",zField:"z-field",zInclude:"z-include",zLazy:"z-lazy",zLoad:"z-load",zLoaded:"z-loaded",zOptions:"z-options",zPriority:"z-priority",zView:"z-view",zuixLoaded:"zuix-loaded",zReady:"z-ready",resourceType:{view:"view",controller:"ctrl",file:"file"},cssIdPrefix:"z-css-"});t.exports=e},643:function(t,e,n){const o=n(541),i=n(826);function s(t){const e=this._context=t;this._mutationObserver=null,this._mutationCallback=function(t,n){const s=i.dom.queryAttribute(o.zComponent),r=function(t){for(let e=0;e0){const t=i.split(" as ");i=t[0],s=t[1]}const r=zuix.runScriptlet(i,e,t);r!==n&&(i="const "+s+" = args; "+e.attr("@set"),zuix.runScriptlet(i,e,t,r),n=r),o(n)},set:function(t,e,n,o){e.attr("@get")||(zuix.runScriptlet(e.attr("@set"),e,t),o(n))},"disable-if":function(t,e,n,o){const i=e.attr("@disable-if"),s=zuix.runScriptlet(i,e,t);s!==n&&(e.attr({disabled:s?"":null}),n=s),o(n)},"hide-if":function(t,e,n,o){const i=e.attr("@hide-if"),s=zuix.runScriptlet(i,e,t);s!==n&&(s?e.css({visibility:"hidden"}):e.css({visibility:"visible"}),n=s),o(n)},if:function(t,e,n,o){const i=e.attr("@if"),s=zuix.runScriptlet(i,e,t);s!==n&&(s?zuix.runScriptlet(e.attr("@then"),e,t):zuix.runScriptlet(e.attr("@else"),e,t),n=s),o(n)}}},this._fieldCache=[],this}function N(t){return"function"!=typeof t.for&&(t.for=function(e){return y[e]=t,t}),t}function E(t,e,n){i.isNoU(n)&&(n=this),null==n._fieldCache&&(n._fieldCache={});let o=null;return void 0===n._fieldCache[t]?(o=s(e).find(i.dom.queryAttribute(p.zField,t)+",["+CSS.escape("#"+t)+"]"),null!=o&&o.length()>0&&(n._fieldCache[t]=o,1===o.length()&&i.isNoU(o.field)&&(o.field=function(t){return E(t,o,o)}))):o=n._fieldCache[t],o}function T(t,e){t=d.resolvePath(t);let n=null;return i.isNoU(e)?(e={},n=new c(zuix,e,S)):(e.componentId=t,i.isNoU(e.contextId)?(!1===e&&(e={}),e.contextId="zuix-ctx-"+ ++w,n=k(e)):(n=U(e.contextId),null!==n?n.options(e):n=k(e))),n.componentId!=t&&(n.componentId=t),e.ready&&(n.ready=e.ready),e.loaded&&(n.loaded=e.loaded),e.error&&(n.error=e.error),null==v[t]?(v[t]=!0,O(n,e)):(null==_[t]&&(_[t]=[]),_[t].push({c:n,o:e}),n)}function A(t){let e=zuix.store("config");return null!=e&&null!=e[location.host]&&(e=e[location.host]),!(t=d.resolvePath(t)).startsWith("/")&&t.indexOf("://")<0&&(t=(null!=e&&null!=e.resourcePath?e.resourcePath:"")+t),t}function O(t,e){let n=R(t.componentId);null!==n&&null==e.controller&&null==t.controller()&&(t.controller(n.controller),o.t(t.componentId+":js","component:cached:js"));const s=function(i){!1!==e.css&&"string"!=typeof e.css?(i[t.componentId].step(t.componentId+":css"),t.loadCss({success:function(t){n.css=t},error:function(e){o.e(e,t)},then:function(){H(t,i[t.componentId])}})):H(t,i[t.componentId])};return i.isNoU(e.view)?(null!==n&&(null!=n.view&&(t.view(n.view),o.t(t.componentId+":html","component:cached:html")),!1!==e.css&&"string"!=typeof e.css&&(e.css=!1,n.css_applied||(n.css_applied=!0,t.style(n.css),o.t(t.componentId+":css","component:cached:css")))),i.isNoU(t.view())?b("resource-loader").queue(t.componentId+":html",(function(){v[t.componentId]=this,t.loadHtml({cext:e.cext,success:function(e){null==n&&(n=P(t)),n.view=e,delete n.controller,s(v)},error:function(n){o.e(n,t),e.error&&t.error.call(t,n,t)}})}),e.priority):b("resource-loader").queue(t.componentId+":css",(function(){v[t.componentId]=this,s(v)}),e.priority),t):(t.view(e.view),null==t.controller()?b("resource-loader").queue(t.componentId+":js",(function(){v[t.componentId]=this,H(t,v[t.componentId])}),f.length):H(t),t)}function j(t){const e=function(t){if(t instanceof Element){const e=t;t=zuix.context(e),d.dequeue(e)}!i.isNoU(t)&&t.dispose&&t.dispose()};t&&t.each?t.each((function(t,n){e(n)})):e(t)}function k(t){const e=new c(zuix,t,S);return f.push(e),e}function U(t,e){let n=null;if(t instanceof s.ZxQuery)t=t.get();else if("string"==typeof t){const e=s.find(i.dom.queryAttribute(p.zContext,t));e.length()>0&&(t=e.get())}if(s.each(f,(function(e,o){if(t instanceof Element&&(o.view()===t||o.container()===t)||i.objectEquals(o.contextId,t))return n=o,!1})),e&&(t instanceof Element||t instanceof s.ZxQuery))if(null!=n&&n.isReady)e.call(n,n);else{if(t instanceof Element&&t.getAttribute("shadow"))return n=zuix.context(t.getAttribute("shadow")),setTimeout((function(){e.call(n,n)}),10),n;s(t).one("component:ready",(function(){n=zuix.context(this),setTimeout((function(){e.call(n,n)}),10)}))}return n}function S(t,e,n){m[e]&&m[e].call(t,n,t)}function R(t){let e=null;return s.each(x,(function(n,o){if(i.objectEquals(o.componentId,t))return e=o,!1})),e}function H(t,e){if(void 0===t.options().controller&&null===t.controller())if(o.d(t.componentId,"controller:load"),i.isNoU(e)||e.step(t.componentId+":js"),y[t.componentId])t.controller(y[t.componentId]),q(t,e);else{const n=function(e){const n=t.componentId+".js";s.ajax({url:A(n),success:function(e){e+='\n//# sourceURL="'+t.componentId+'.js"\n';try{t.controller($(e));let n=R(t.componentId);null==n&&(n={componentId:t.componentId,controller:t.controller()},x.push(n))}catch(n){o.e(new Error,n,e,t),t.error&&t.error.call(t,n,t)}},error:function(e){o.e(e,new Error,t),t.error&&t.error.call(t,e,t)},then:function(){q(t,e)}})};i.isNoU(e)?b("resource-loader").queue(t.componentId+":js",(function(){n(v[t.componentId]=this)}),t.options().priority):n(e)}else q(t,e)}function P(t){const e=t.view().innerHTML,n=s.wrapElement("div",e),i={componentId:t.componentId,view:n.innerHTML,css:"string"==typeof t.options().css?null:t._css,controller:t.controller()};return x.push(i),o.t(t.componentId,"bundle:added"),i}function q(t,e){if(v[t.componentId]=null,i.isNoU(t.view()))o.e(t.componentId,"component:view:undefined");else{let r=R(t.componentId);t.options().viewDeferred?o.d(t.componentId,"component:deferred:load"):null===r?r=P(t):null==r.controller&&(r.controller=t.controller());const l=s(t.view());if(null==l.attr(p.zContext)&&l.attr(p.zContext,t.contextId),o.d(t.componentId,"component:initializing"),t.controller()){const c=t._c=new u(t);c.log=n(381)(t.contextId),c.init&&c.init();const a=function(){e&&o.d(t.componentId,"controller:create:deferred"),function(t){const e=t.context;o.t(e.componentId,"controller:init","timer:init:start"),e.isReady=!0;const n=t.view();t.create&&t.create(),t.trigger("view:create",n);(function(){if(e.loaded&&e.loaded.call(e,e),null!=_[e.componentId]){const t=_[e.componentId];let n;for(_[e.componentId]=null;null!=t&&null!=(n=t.shift());)O(n.c,n.o)}s().one("componentize:end",(function(){setTimeout((function(){n.find(i.dom.queryAttribute(p.zLoaded,"false",i.dom.cssNot(p.zComponent))).each((function(t,e){this.attr(p.zLoaded,null)})),zuix.componentize(n)}))}))})(),t.trigger("component:loaded",n,!0);const r=function(){const s=[":on",":model",":behavior",":ready"];Array.from(n.get().attributes).filter((t=>s.find((e=>t.nodeName.startsWith(e))))).forEach((s=>{const r=s.nodeName,l=r.lastIndexOf(":")<2;let c,u=s.nodeValue;u.match(/^[^<>()\[\]\-+\s!?/&£"=^#@:;,.*|]+$/g)||(u=`(event, args) => { ${s.nodeValue} }`),(r.startsWith(":model")||l)&&(u=`(${s.nodeValue})`);try{c=zuix.runScriptlet(u,n,n,null)}catch(t){o.warn(r,s.nodeValue,t)}if(null!=c)if(":ready"!==r){if(r.startsWith(":on")||r.startsWith(":behavior")){if(l)return void t.on(c);const e=r.substring(r.indexOf(":",1)+1);r.startsWith(":behavior")?t.addBehavior(e,c):t.addEvent(e,c)}else if(r.startsWith(":model")){if(l)return void e.model(c);const t=r.match(/[^:]+/g).splice(1);let n=e.model();t.forEach(((e,o)=>{if(e=i.hyphensToCamelCase(e),o===t.length-1)return n[e]=c;n=n[e]=n[e]||{}}))}}else e.ready=c}));zuix.context(n)===e&&n.find("*").each((function(t,o,i){M(n,i)&&function(t,e){Array.from(e.get().attributes).forEach((o=>{const i=o.nodeName;if(i.startsWith("(")&&i.endsWith(")")){let s=o.nodeValue;s.match(/^[^<>()\[\]\-+\s!?/&£"=^#@:;,.*|]+$/g)||(s=`(event, args) => { ${o.nodeValue} }`);const r=i.substring(1,i.length-1),l=zuix.runScriptlet(s,e,n,null);e===n?t.on(r,l):e.on(r,l)}}))}(e,i)})),e.ready&&e.ready.call(e,e),t.trigger("component:ready",n,!0)},l=zuix.store("handlers"),c=e.contextId,u=n.find(':scope > [type="jscript"]');u._selection=u._selection.concat(s(document).find('[type="jscript"][for="'+c+'"]')._selection),e.handlers.refresh=function(t,n,o,r){if(!e._disposed){if(e._dependencyResolver&&!e._dependencyResolver.resolved())return e.$.hasClass("not-ready")||e.$.addClass("not-ready"),r(o);null!=e._dependencyResolver&&!1!==e._dependencyResolver&&(e.$.removeClass("not-ready"),e._dependencyResolver=!1);let l=e._refreshHandler;if(!l){const a="return (function($this, context, args){const $ = context.$; const model = context.model(); ";let h='"use strict"; expose = {}; function refresh() {}; function ready() { return true; }; ';e["#"]&&s.each(e["#"],(function(t,e){const n=i.hyphensToCamelCase(t);h+="const $"+n+' = context["#"].'+n+";",h+="const "+n+" = $"+n+".get();",h+="let _"+n+" = null; zuix.context("+n+", function(c) { _"+n+" = c; });"})),h+="function runScriptlet($el, s, args) { let result; try { result = eval(\"const $this = $el; let _this = null; zuix.context(this, (ctx) => _this = ctx); \" + s) } catch (e) { console.error('SCRIPTLET ERROR', e, s); }; return result };";const d=[];let p="";d.push(c),u.each((function(n,o,i){zuix.context(t)===e&&(null!=i.attr("using")&&d.push(...i.attr("using").split(/[\s|,]+/g)),i.parent().get()!==t.get()&&i.attr("for")!==c||(p+=i.html()+";"))}));let f="";if(d.length>0){let t="";if(d.forEach((function(n){const o=i.hyphensToCamelCase(n),s="let "+o+' = window["'+o+'"]; if ('+o+" == null) { "+o+' = zuix.context("'+n+'"';!1!==e._dependencyResolver?f+=s+", function(ctx) { "+o+" = ctx; }); }":f+=s+"); }",t+=o+" && "})),!1!==e._dependencyResolver&&f.length>0&&(f+="const resolved = function() { return "+t+"true; };",e._dependencyResolver=Function(a+f+"; return { resolved }; }).call(this.$el.get(), this.$el, this.ctx, this.args);").call({$el:n,ctx:e,args:null}),!e._dependencyResolver.resolved()))return r(o)}h+=f+p;const m=h+"; return { refresh, runScriptlet, ready, expose }; }).call(this.$el.get(), this.$el, this.ctx, this.args);";l=e._refreshHandler=Function(a+";"+m).call({$el:n,ctx:e,args:null}),l.expose&&Object.assign(e,l.expose)}!e._dependencyResolver&&l.refresh&&e._refreshHandler.refresh(),r&&r(o)}};const a=[];if(n.find("*").each((function(o,i,s){M(n,s)&&zuix.context(n)===e&&a.push(...function(n,o){const i=o.get(),s=[];for(let r=0;r1&&c.startsWith("@")){const r=c.substring(1).split(":")[0];let u=e.handlers?e.handlers[r]:null;if(u||(u=l[r]),u){const e=zuix.activeRefresh(n,o,t.model(),(function(t,e,s,r){o.attr(p.zLoad)&&"true"!==o.attr(p.zReady)?null==zuix.context(o)&&r(s):u.call(i,n,o,s,r,c)}));s.push(e)}}}return s}(n,s))})),a.length>0||u.length()>0){const o=u.length()>0?u.attr("refreshdelay"):null,i=u.length()>0?u.attr("handlersdelay"):null;e.handlers.refresh.call(n.get(),n,n,t.model(),(function(t,s){zuix.activeRefresh(n,n,t,(function(t,s,l,c){if(e._refreshHandler&&!e._refreshHandler.initialized){let t=!0;a.forEach((function(e){if(null!=e.$element.attr(p.zLoad)||null!=e.$element.attr(p.zInclude))return t=null!=zuix.context(e.$element)&&zuix.context(e.$element).isReady,t})),t&&!0===e.isReady&&e._refreshHandler.ready()?(e._refreshHandler.initialized=!0,a.forEach((function(t){t.start(i)})),e.$.removeClass("not-ready"),r()):e.$.hasClass("not-ready")||e.$.addClass("not-ready"),c(l,o,!0)}else e.handlers.refresh.call(n.get(),n,n,l,c)})).start(o)}))}else e.handlers.refresh.call(n.get(),n,n),r();o.t(e.componentId,"controller:init","timer:init:stop"),o.i(e.componentId,"component:loaded",c)}(c),e&&e.end(),l.attr(p.zReady,"true")};if(i.isNoU(c.view())||null!=c.view().attr(p.zComponent)||c.view().attr(p.zComponent,""),i.isNoU(t.model())&&!i.isNoU(t.view())&&t.viewToModel(),t.options().viewDeferred){t.options().viewDeferred=!1,c.saveView(),null===r&&"default"!==t.componentId&&(r={componentId:t.componentId,controller:t.controller()},x.push(r),o.t(t.componentId,"bundle:added"),o.d(t.componentId,"component:deferred:load"));const e=function(){!1!==t.options().html?("string"==typeof t.options().html&&(r.view=t.options().html),null==r.view?t.loadHtml({cext:t.options().cext,success:function(e){r.view=e,o.d(t.componentId,"component:deferred:html")},error:function(e){o.e(e,t),t.options().error&&t.options().error.call(t,e,t)},then:function(){o.d(t.componentId,"controller:create:2"),a()}}):(t.view(r.view),a())):(o.d(t.componentId,"controller:create:3"),a())};!1!==t.options().css&&"string"!=typeof t.options().css?null==r.css?t.loadCss({success:function(e){r.css=e,o.d(t.componentId,"component:deferred:css")},then:function(){e()}}):(t.style(r.css),e()):("string"==typeof t.options().css&&t.style(t.options().css),e())}else o.d(t.componentId,"controller:create:1"),a()}else o.w(t.componentId,"component:controller:undefined")}}function M(t,e){const n=[...I,i.dom.queryAttribute(p.zLoad),i.dom.queryAttribute(p.zInclude)].join(",");return e.parent("pre,code,"+n).get()===t.get()}function $(t){let e=function(t){};if("string"==typeof t)try{const n=Function(i.normalizeControllerCode(t))();if("function"!=typeof n)throw new Error('Unexpected module type: "'+typeof n+'"');e=n}catch(e){o.e(this,e,t)}return e}L.prototype.field=function(t,e,n){return E.call(this,t,e,n)},L.prototype.load=function(t,e){return T.call(this,t,e)},L.prototype.unload=function(t){return j(t),this},L.prototype.loadComponent=function(t,e,n,o){return function(t,e,n,o){j(t=s(t)),t.each((function(t,i,s){!function(t){if(t.attr(p.zLoad,e),n&&t.attr(n,""),o&&o.lazyLoad&&"true"===o.lazyLoad.toString()||"true"===t.attr(p.zLazy))return o&&(t.get().__zuix_loadOptions=o),!1;let i=t.get().shadowRoot;if(null==i&&o&&o.container instanceof ShadowRoot?(i=o.container,delete o.container):i&&o&&delete o.container,i){const e=document.createElement("div");Array.from(t.get().attributes).forEach((n=>{n.nodeName.match(/^[(#@)]/)||(e.setAttribute(n.nodeName,n.nodeValue),t.attr(n.nodeName,null))})),setTimeout((function(){for(;t.get().firstChild;)e.appendChild(t.get().firstChild);i.appendChild(e),zuix.context(e,(e=>{t.attr("shadow",e.contextId)})),d.loadInline(e,o)}))}else d.loadInline(t,o)}(s)}))}(t,e,n,o),this},L.prototype.controller=function(t){return N.call(this,t)},L.prototype.context=function(t,e){return U.call(this,t,e)},L.prototype.createComponent=function(t,e){if(null==e&&(e={}),i.isNoU(e.contextId)&&(e.contextId="zuix-ctx-"+ ++w),null!=U(e.contextId))throw new Error("Context already exists.");return e.container=document.createElement("div"),e.componentId=t,d.applyOptions(e.container,e),k(e)},L.prototype.trigger=function(t,e,n){return S(t,e,n),this},L.prototype.hook=function(t,e){var n,s;return n=t,s=e,i.isNoU(s)?delete m[n]:(m[n]&&o.w("Hook override",'"'+n+'"',"OLD",m[n],"NEW",s),m[n]=s),this},L.prototype.using=function(t,e,n,o){e=d.resolvePath(e);const r=(t=t.toLowerCase())+"-"+e.hashCode();return b("resource-loader").queue(r,(function(){const l=v[r]=this;if("component"===t){const t=U(r);null==t?zuix.load(e,{contextId:r,view:"",priority:-10,ready:function(t){l.end(),n&&n(e,t)},error:function(){l.end(),n&&n(e,null)}}):(l.end(),n&&n(e,t))}else{const c="style"===t;if(0===s.find(t+'[id="'+r+'"]').length()){const u=(c&&o?i.dom.getShadowRoot(o.view()):null)||document.head||document.getElementsByTagName("head")[0],a=document.createElement(t);c?(a.type="text/css",a.id=r):(a.type="text/javascript",a.id=r),u.appendChild(a);const h=function(t){c?a.styleSheet?a.styleSheet.cssText=t:a.appendChild(document.createTextNode(t)):a.innerText?a.innerText=t:a.appendChild(document.createTextNode(t)),l.end(),n&&n(e,r)},d="_res/"+t+"/"+r,p=R(d);null!=p?h(c?p.css:p.controller):s.ajax({url:e,success:function(t){const n={componentId:d,view:null,css:c?t:null,controller:c?null:t,using:e};x.push(n),h(t)},error:function(){u.removeChild(a),l.end(),n&&n(e)}})}else l.end(),n&&n(e,r)}})),this},L.prototype.lazyLoad=function(t,e){return null==t?d.lazyLoad():(d.lazyLoad(t,e),this)},L.prototype.componentize=function(t){return!1===t?z=!0:!0===t&&(z=!1,t=null),z||d.componentize(t),this},L.prototype.store=function(t,e){return null!=e&&(this._store[t]=e),this._store[t]},L.prototype.getResourcePath=function(t){return A(t)},L.prototype.observable=function(t){return C.observable(t)},L.prototype.activeRefresh=function(t,e,n,o){return new h(t,e,n,o)},L.prototype.bundle=function(t,e){if(i.isNoU(t))return x;if(t&&"boolean"==typeof t){o.t("bundle:start");const t=d.lazyLoad();if(d.lazyLoad(!1),d.componentize(),e){const n=function(n){setTimeout((function(){d.willLoadMore()?(o.t("bundle:wait"),n(n)):(o.t("bundle:end"),d.lazyLoad(t),e())}),1e3)};n(n)}}else{for(let e=0;e(s=new URL(s+".js",c).href,i[s]||new Promise((i=>{if("document"in self){const e=document.createElement("script");e.src=s,e.onload=i,document.head.appendChild(e)}else e=s,importScripts(s),i()})).then((()=>{let e=i[s];if(!e)throw new Error(`Module ${s} didn’t register its module`);return e})));self.define=(c,d)=>{const a=e||("document"in self?document.currentScript.src:"")||location.href;if(i[a])return;let n={};const r=e=>s(e,a),o={module:{uri:a},exports:n,require:r};i[a]=Promise.all(c.map((e=>o[e]||r(e)))).then((e=>(d(...e),n)))}}define(["./workbox-90aa7b36"],(function(e){"use strict";self.addEventListener("message",(e=>{e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()})),e.precacheAndRoute([{url:"app/cms/zuix-editor.css",revision:"20bfdd79067e9ebdc3d619aafb170291"},{url:"app/cms/zuix-editor.html",revision:"29e9e66c0551e5713c02e4f86d1494b7"},{url:"app/cms/zuix-editor.js",revision:"40e7cdf4d16c625617ec84be52417f8a"},{url:"app/cms/zuix-editor/dialogs/add-page.css",revision:"fa9d55e0e6227e3e412259f11e0bbdb2"},{url:"app/cms/zuix-editor/dialogs/add-page.html",revision:"635447ae5013d8d592f0d3150aa6b907"},{url:"app/cms/zuix-editor/dialogs/add-page.js",revision:"cd78758e09ad8babf8f55ce56f49ecb6"},{url:"app/cms/zuix-editor/dialogs/create-component.css",revision:"980e51a89d8801392dd457459f10d8bf"},{url:"app/cms/zuix-editor/dialogs/create-component.html",revision:"beb030d44e9cd47de7da79e9b8e6c5a8"},{url:"app/cms/zuix-editor/dialogs/create-component.js",revision:"efb4228addddc9b4ba7e65b79611e4ff"},{url:"app/cms/zuix-editor/dialogs/delete-page.css",revision:"2d83029a4ce61bf4c799868f4da7be12"},{url:"app/cms/zuix-editor/dialogs/delete-page.html",revision:"b86caa847060bde014b7c740e7d919ce"},{url:"app/cms/zuix-editor/dialogs/delete-page.js",revision:"36d0d71ef5e39ccb7df0fdcc67006599"},{url:"config.js",revision:"24be7718612e5e3de4e105ba7ea035bc"},{url:"content/content.11tydata.js",revision:"04fb4b5a734c21c8a824d50e6df3b3d0"},{url:"content/docs/index.bundle.ext.js",revision:"ca96760d9f29fbbf9029e116cc749b2d"},{url:"content/docs/index.bundle.js",revision:"8265c2d9d1d5a471d03ffbdae5d9082d"},{url:"content/docs/index.html",revision:"833b94b479f52a8944f9bf95ec40b41c"},{url:"content/docs/material-design-tags/index.bundle.ext.js",revision:"ca96760d9f29fbbf9029e116cc749b2d"},{url:"content/docs/material-design-tags/index.bundle.js",revision:"79bf4bfaf29cce5ce6512ea52ca24cf9"},{url:"content/docs/material-design-tags/index.html",revision:"cd2c2581a99659cb5426cecf5b73aa28"},{url:"content/docs/page-options/index.bundle.ext.js",revision:"ca96760d9f29fbbf9029e116cc749b2d"},{url:"content/docs/page-options/index.bundle.js",revision:"b766b5aa367a44f35884513d1575439f"},{url:"content/docs/page-options/index.html",revision:"ad7e707c895a6fa4815533e7515c2acc"},{url:"content/docs/zkit-components-tags/index.bundle.ext.js",revision:"ca96760d9f29fbbf9029e116cc749b2d"},{url:"content/docs/zkit-components-tags/index.bundle.js",revision:"cb67da996afd79ee218000a260291aa4"},{url:"content/docs/zkit-components-tags/index.html",revision:"b89c5da67463e2794cdc36b42ef9b969"},{url:"css/animate.min.css",revision:"c0be8e53226ac34833fd9b5dbc01ebc5"},{url:"css/fla/flex-layout-attribute.css",revision:"c9bc58fccb5b4c9d1d7a6e76edddffa7"},{url:"css/fla/flex-layout-attribute.min.css",revision:"c55488315343d9afb4d13ebf9cc8f97b"},{url:"css/prism.css",revision:"343ab6c1b213d253d82d6c7afad86079"},{url:"home/index.bundle.ext.js",revision:"ca96760d9f29fbbf9029e116cc749b2d"},{url:"home/index.bundle.js",revision:"efe973bbbd712690961393a9e7afae99"},{url:"home/index.html",revision:"b07b9e5094d5527e6d26ee99b457dcbf"},{url:"index.bundle.ext.js",revision:"cbcb083634a174b51782035df12863fa"},{url:"index.html",revision:"adf68446f0e159e420d09153982443b3"},{url:"js/fuse/fuse.basic.common.js",revision:"ab3ef0028c8992d0098b5b836874291a"},{url:"js/fuse/fuse.basic.esm.js",revision:"0cd240af452625e49deed3ee2445aba6"},{url:"js/fuse/fuse.basic.esm.min.js",revision:"f79f602fa4572cd580786923ce942b6c"},{url:"js/fuse/fuse.basic.js",revision:"6c4923a67225dd64e42600c578d8ff0f"},{url:"js/fuse/fuse.basic.min.js",revision:"62465d50492b6d1bfbbd0e5f9a09b222"},{url:"js/fuse/fuse.common.js",revision:"ddbe097989e19bf1872f533cbc363f1b"},{url:"js/fuse/fuse.esm.js",revision:"82bbf2ed8ece715c58afe6c75977795f"},{url:"js/fuse/fuse.esm.min.js",revision:"589223b029350d512db61a8f323ce0fe"},{url:"js/fuse/fuse.js",revision:"7e19f88c4b2a7c038943bf3b4a17986f"},{url:"js/fuse/fuse.min.js",revision:"de7d60e4a6881074275feca14b84a49d"},{url:"js/mdl/material.indigo-deep_purple.min.css",revision:"1c401a0e084db91cdd5d196b08b0795e"},{url:"js/mdl/material.min.css",revision:"9ab85b48144d24908b4e455c2afb648c"},{url:"js/mdl/material.min.js",revision:"8dbb84e1d015cd5c2f5be1064eb924b3"},{url:"js/zuix/zuix-bundler.js",revision:"34faeb1b1cf274e7b980dbd496d728c9"},{url:"js/zuix/zuix-bundler.min.js",revision:"c836a053d0b78abe802ed832ddcb8ac5"},{url:"js/zuix/zuix-bundler.module.js",revision:"4b1a833a3391bcdd8fba384b72fd7f70"},{url:"js/zuix/zuix-bundler.module.min.js",revision:"e475873997f70b9738f62b190c16fddb"},{url:"js/zuix/zuix.js",revision:"5e19a04d4f05f511a3d2c1956ea99e8f"},{url:"js/zuix/zuix.min.js",revision:"29599e4e0f7c465c206d7d0fe0526d3b"},{url:"js/zuix/zuix.module.js",revision:"882870098e9fc01d85dbf030639aa7fb"},{url:"js/zuix/zuix.module.min.js",revision:"b4ff18b8eb77cdae1ba11c9e25b74c95"},{url:"lib/1.1/components/context-menu.css",revision:"92dd2fa2c80af9b5464b3912c1fcdf2b"},{url:"lib/1.1/components/context-menu.html",revision:"74daf4054d7613ede5f88007a94bdc43"},{url:"lib/1.1/components/context-menu.js",revision:"c431c45cd1c042f2e9d5b2fc51b6d09f"},{url:"lib/1.1/components/hamburger-icon.css",revision:"dd81a60d1bfa7bd4463bb551eae81e35"},{url:"lib/1.1/components/hamburger-icon.html",revision:"14b9b9c25ea92bd9660a2e6ea53c1b0d"},{url:"lib/1.1/components/hamburger-icon.js",revision:"44cf41b6ac1d2dd49f7bf004a5d628a4"},{url:"lib/1.1/components/media-browser.css",revision:"e889174b42c1b4abd01bcd04e4cdaa0f"},{url:"lib/1.1/components/media-browser.html",revision:"d82b328652c89f40f6d81f84771a30ab"},{url:"lib/1.1/components/media-browser.js",revision:"78e4e863a758ac040ccfec3bd5dd23f7"},{url:"lib/1.1/components/media-browser/article.css",revision:"e7f0f5dbe26e76dcd13f7973dc768308"},{url:"lib/1.1/components/media-browser/article.html",revision:"ee5d2f689e747b5320fefd361af7fcfd"},{url:"lib/1.1/components/media-browser/image.css",revision:"ae49f05922ab6be7e09a8bebf1f32f00"},{url:"lib/1.1/components/media-browser/image.html",revision:"87a9be2b82f0388a7d3aaa16c2003422"},{url:"lib/1.1/components/media-browser/image.js",revision:"4aeeac0bd702d717fceb59f1abcd924e"},{url:"lib/1.1/components/media-browser/video-yt.css",revision:"594d8771c9b011eaebcd957daf74d17e"},{url:"lib/1.1/components/media-browser/video-yt.html",revision:"a85ff95f97a31b1d890dfc55a2b91538"},{url:"lib/1.1/components/media-browser/video-yt.js",revision:"87ae9156a9dec2427ffbe5439e5c3f4f"},{url:"lib/1.1/components/media-browser/video.css",revision:"c62d91469a6c8d17aad13581469f7d1c"},{url:"lib/1.1/components/media-browser/video.html",revision:"4128300adb3a2e6cd8d68bba9ffb00ee"},{url:"lib/1.1/components/media-browser/video.js",revision:"eb337fc0d0adb6840d077de7888a8f8c"},{url:"lib/1.1/components/menu-overlay.css",revision:"736446a0ce463ad6664c5f8066376189"},{url:"lib/1.1/components/menu-overlay.html",revision:"220c3005881852f0387e61ea8ac2a6c5"},{url:"lib/1.1/components/menu-overlay.js",revision:"15dc6cd532c7c4af1ee4f525c2f3aff2"},{url:"lib/1.1/controllers/drawer-layout.js",revision:"efd643eb309cafec496b8f5b60dacf4a"},{url:"lib/1.1/controllers/gesture-helper.js",revision:"1776574c57c1a6115edfbcb3887ed147"},{url:"lib/1.1/controllers/header-auto-hide.js",revision:"dfafe8a0780d7759b16afa63673cbecb"},{url:"lib/1.1/controllers/list-view.js",revision:"fc2930407b29c707ab8bfca33685e9be"},{url:"lib/1.1/controllers/mdl-button.js",revision:"c2a4ac575ee439b1e19beb42ea7d016f"},{url:"lib/1.1/controllers/mdl-checkbox.js",revision:"20911a2c2aec81f9ab42615987b21364"},{url:"lib/1.1/controllers/mdl-menu.js",revision:"8f620c9a13b8c47720b24b46205fc906"},{url:"lib/1.1/controllers/scroll-helper.js",revision:"d35210ea8c416fdad067aedad98c9063"},{url:"lib/1.1/controllers/view-pager.js",revision:"d7e48fa1226efe9fb2e1a53730203d82"},{url:"lib/1.1/templates/mdl-card-image.css",revision:"394c8f6d4efb3ac8546f2199579d50fc"},{url:"lib/1.1/templates/mdl-card-image.html",revision:"7983de36c031e5049e7cfe024bb56be3"},{url:"lib/1.1/templates/mdl-card-square.css",revision:"0cd25031cce1ceb63fb6660f9249ebe3"},{url:"lib/1.1/templates/mdl-card-square.html",revision:"6a0884fea45748a54e0d6c4936f145c9"},{url:"lib/1.1/templates/mdl-card.css",revision:"d8c8685be5e6fc793835eddec3acd241"},{url:"lib/1.1/templates/mdl-card.html",revision:"8f4162c548d4eb34d2e592c499f31aa0"},{url:"manifest.json",revision:"29978efcaebfab6fbd65116d50cd99c2"},{url:"search-index.json",revision:"efe54bded18adf2d329642fafad07368"},{url:"search-list.json",revision:"5b11a8ced2c52f091ecd735afd4b6823"},{url:"search/index.bundle.ext.js",revision:"ca96760d9f29fbbf9029e116cc749b2d"},{url:"search/index.bundle.js",revision:"d07424b2af8b45079fab844335ef956b"},{url:"search/index.html",revision:"7edee693408762102efa2cae02228ccd"},{url:"content/docs/page-options/images/side_drawer_section.png",revision:"16d006e9b73a2fb01f6c873002d1c600"},{url:"content/docs/page-options/images/side_drawer.png",revision:"24f12235166597471ae367978a75987f"},{url:"images/github-mark.png",revision:"add1026fb07009c6879400cbcf145301"},{url:"images/icons/desktop/android-chrome-192x192.png",revision:"93d5e77e9ee1e9c6975f3c0bd1a21574"},{url:"images/icons/desktop/android-chrome-512x512.png",revision:"6df83c6c13be17a2ea70d29e340c5ddb"},{url:"images/icons/desktop/apple-touch-icon.png",revision:"2b78ed332644d19d9779c069c5842538"},{url:"images/icons/desktop/favicon-16x16.png",revision:"6c047cdbd3d5c4c962a3a692a5025d27"},{url:"images/icons/desktop/favicon-32x32.png",revision:"7413528d5e59c22af1ccf38187bc950b"},{url:"images/icons/desktop/mstile-150x150.png",revision:"540caa78f56655281b2d4b17ad52f2ce"},{url:"images/icons/desktop/safari-pinned-tab.svg",revision:"a0ab2c612c6a5019b3e4ae7c38043b98"},{url:"images/icons/icon-128x128.png",revision:"69f3f1f3f956bb71f35ce66b7717e1a0"},{url:"images/icons/icon-144x144.png",revision:"45e24db8671c41ca95c440df0cadf2a3"},{url:"images/icons/icon-152x152.png",revision:"e0867fd6e9bc25afd831b1eabdd83f8d"},{url:"images/icons/icon-192x192.png",revision:"cf383c3d4500d31884326cc9d53a8c3a"},{url:"images/icons/icon-384x384.png",revision:"31fd304cf6c5ff72928b7a91fbd68343"},{url:"images/icons/icon-512x512.png",revision:"47d9af0508ab29138dcb8ca6a4664cf2"},{url:"images/icons/icon-72x72.png",revision:"919cb6b3e8a1b5d0c963921dba0e4388"},{url:"images/icons/icon-96x96.png",revision:"5547ad1a33334c0f5c04f6de1f6d2c52"},{url:"images/lighthouse.png",revision:"79aa0c430e8ee960cbe654bbc0718631"},{url:"images/page-speed-insight-icon.png",revision:"8806237a2557fb748e7eaae4158899fb"},{url:"images/patreon.png",revision:"138534b06fe107c864e576d63273cf75"},{url:"images/profile-icon.png",revision:"b4e6fa3d09388123298958c47aeb13ca"},{url:"images/rss-feed.png",revision:"fa5663a3878814bb9820de6b29005169"},{url:"images/zuix-logo.svg",revision:"48e6defd57440a6d0f0d12241ff9d6c5"}],{}),e.registerRoute(/\.(?:png|jpg|jpeg|svg)$/,new e.CacheFirst({cacheName:"images",plugins:[new e.ExpirationPlugin({maxEntries:50})]}),"GET"),e.registerRoute(/\.(?:html|json|js|css)$/,new e.CacheFirst({cacheName:"default",plugins:[new e.ExpirationPlugin({maxEntries:50})]}),"GET")})); +if(!self.define){let e,i={};const s=(s,c)=>(s=new URL(s+".js",c).href,i[s]||new Promise((i=>{if("document"in self){const e=document.createElement("script");e.src=s,e.onload=i,document.head.appendChild(e)}else e=s,importScripts(s),i()})).then((()=>{let e=i[s];if(!e)throw new Error(`Module ${s} didn’t register its module`);return e})));self.define=(c,d)=>{const a=e||("document"in self?document.currentScript.src:"")||location.href;if(i[a])return;let n={};const r=e=>s(e,a),o={module:{uri:a},exports:n,require:r};i[a]=Promise.all(c.map((e=>o[e]||r(e)))).then((e=>(d(...e),n)))}}define(["./workbox-90aa7b36"],(function(e){"use strict";self.addEventListener("message",(e=>{e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()})),e.precacheAndRoute([{url:"app/cms/zuix-editor.css",revision:"20bfdd79067e9ebdc3d619aafb170291"},{url:"app/cms/zuix-editor.html",revision:"29e9e66c0551e5713c02e4f86d1494b7"},{url:"app/cms/zuix-editor.js",revision:"40e7cdf4d16c625617ec84be52417f8a"},{url:"app/cms/zuix-editor/dialogs/add-page.css",revision:"fa9d55e0e6227e3e412259f11e0bbdb2"},{url:"app/cms/zuix-editor/dialogs/add-page.html",revision:"635447ae5013d8d592f0d3150aa6b907"},{url:"app/cms/zuix-editor/dialogs/add-page.js",revision:"cd78758e09ad8babf8f55ce56f49ecb6"},{url:"app/cms/zuix-editor/dialogs/create-component.css",revision:"980e51a89d8801392dd457459f10d8bf"},{url:"app/cms/zuix-editor/dialogs/create-component.html",revision:"beb030d44e9cd47de7da79e9b8e6c5a8"},{url:"app/cms/zuix-editor/dialogs/create-component.js",revision:"efb4228addddc9b4ba7e65b79611e4ff"},{url:"app/cms/zuix-editor/dialogs/delete-page.css",revision:"2d83029a4ce61bf4c799868f4da7be12"},{url:"app/cms/zuix-editor/dialogs/delete-page.html",revision:"b86caa847060bde014b7c740e7d919ce"},{url:"app/cms/zuix-editor/dialogs/delete-page.js",revision:"36d0d71ef5e39ccb7df0fdcc67006599"},{url:"config.js",revision:"24be7718612e5e3de4e105ba7ea035bc"},{url:"content/content.11tydata.js",revision:"04fb4b5a734c21c8a824d50e6df3b3d0"},{url:"content/docs/index.bundle.ext.js",revision:"ca96760d9f29fbbf9029e116cc749b2d"},{url:"content/docs/index.bundle.js",revision:"8265c2d9d1d5a471d03ffbdae5d9082d"},{url:"content/docs/index.html",revision:"1752cfdd794fe07af57cf41f870fdd7a"},{url:"content/docs/material-design-tags/index.bundle.ext.js",revision:"ca96760d9f29fbbf9029e116cc749b2d"},{url:"content/docs/material-design-tags/index.bundle.js",revision:"79bf4bfaf29cce5ce6512ea52ca24cf9"},{url:"content/docs/material-design-tags/index.html",revision:"b42c093ce31861a8ea8ff03854816740"},{url:"content/docs/page-options/index.bundle.ext.js",revision:"ca96760d9f29fbbf9029e116cc749b2d"},{url:"content/docs/page-options/index.bundle.js",revision:"b766b5aa367a44f35884513d1575439f"},{url:"content/docs/page-options/index.html",revision:"aec4500b2de7a742a03fa997ceedf332"},{url:"content/docs/zkit-components-tags/index.bundle.ext.js",revision:"ca96760d9f29fbbf9029e116cc749b2d"},{url:"content/docs/zkit-components-tags/index.bundle.js",revision:"cb67da996afd79ee218000a260291aa4"},{url:"content/docs/zkit-components-tags/index.html",revision:"bf125810fbffa931871fa8205389fccd"},{url:"css/animate.min.css",revision:"c0be8e53226ac34833fd9b5dbc01ebc5"},{url:"css/fla/flex-layout-attribute.css",revision:"c9bc58fccb5b4c9d1d7a6e76edddffa7"},{url:"css/fla/flex-layout-attribute.min.css",revision:"c55488315343d9afb4d13ebf9cc8f97b"},{url:"css/prism.css",revision:"343ab6c1b213d253d82d6c7afad86079"},{url:"home/index.bundle.ext.js",revision:"ca96760d9f29fbbf9029e116cc749b2d"},{url:"home/index.bundle.js",revision:"efe973bbbd712690961393a9e7afae99"},{url:"home/index.html",revision:"e132323217099917588e68b753ba0857"},{url:"index.bundle.ext.js",revision:"cbcb083634a174b51782035df12863fa"},{url:"index.html",revision:"adf68446f0e159e420d09153982443b3"},{url:"js/fuse/fuse.basic.common.js",revision:"ab3ef0028c8992d0098b5b836874291a"},{url:"js/fuse/fuse.basic.esm.js",revision:"0cd240af452625e49deed3ee2445aba6"},{url:"js/fuse/fuse.basic.esm.min.js",revision:"f79f602fa4572cd580786923ce942b6c"},{url:"js/fuse/fuse.basic.js",revision:"6c4923a67225dd64e42600c578d8ff0f"},{url:"js/fuse/fuse.basic.min.js",revision:"62465d50492b6d1bfbbd0e5f9a09b222"},{url:"js/fuse/fuse.common.js",revision:"ddbe097989e19bf1872f533cbc363f1b"},{url:"js/fuse/fuse.esm.js",revision:"82bbf2ed8ece715c58afe6c75977795f"},{url:"js/fuse/fuse.esm.min.js",revision:"589223b029350d512db61a8f323ce0fe"},{url:"js/fuse/fuse.js",revision:"7e19f88c4b2a7c038943bf3b4a17986f"},{url:"js/fuse/fuse.min.js",revision:"de7d60e4a6881074275feca14b84a49d"},{url:"js/mdl/material.indigo-deep_purple.min.css",revision:"1c401a0e084db91cdd5d196b08b0795e"},{url:"js/mdl/material.min.css",revision:"9ab85b48144d24908b4e455c2afb648c"},{url:"js/mdl/material.min.js",revision:"8dbb84e1d015cd5c2f5be1064eb924b3"},{url:"js/zuix/zuix-bundler.js",revision:"516a82b235448e71e55b30aadfade897"},{url:"js/zuix/zuix-bundler.min.js",revision:"875257fc52c85f65bb6cdbbc935832b3"},{url:"js/zuix/zuix-bundler.module.js",revision:"7beafeac4d160d6dbe5b01529d426237"},{url:"js/zuix/zuix-bundler.module.min.js",revision:"7234a54bd137d84db9c3fd328784ef1e"},{url:"js/zuix/zuix.js",revision:"1ba6336ee11276110126c9a274dc8829"},{url:"js/zuix/zuix.min.js",revision:"12967cca41b42c11e9ab8eb1472a08f7"},{url:"js/zuix/zuix.module.js",revision:"09c720efad6247b8b2112dfff49efe58"},{url:"js/zuix/zuix.module.min.js",revision:"155aeb71d2886b297fcee2c90cbd88ba"},{url:"lib/1.1/components/context-menu.css",revision:"92dd2fa2c80af9b5464b3912c1fcdf2b"},{url:"lib/1.1/components/context-menu.html",revision:"74daf4054d7613ede5f88007a94bdc43"},{url:"lib/1.1/components/context-menu.js",revision:"c431c45cd1c042f2e9d5b2fc51b6d09f"},{url:"lib/1.1/components/hamburger-icon.css",revision:"dd81a60d1bfa7bd4463bb551eae81e35"},{url:"lib/1.1/components/hamburger-icon.html",revision:"14b9b9c25ea92bd9660a2e6ea53c1b0d"},{url:"lib/1.1/components/hamburger-icon.js",revision:"44cf41b6ac1d2dd49f7bf004a5d628a4"},{url:"lib/1.1/components/media-browser.css",revision:"e889174b42c1b4abd01bcd04e4cdaa0f"},{url:"lib/1.1/components/media-browser.html",revision:"d82b328652c89f40f6d81f84771a30ab"},{url:"lib/1.1/components/media-browser.js",revision:"78e4e863a758ac040ccfec3bd5dd23f7"},{url:"lib/1.1/components/media-browser/article.css",revision:"e7f0f5dbe26e76dcd13f7973dc768308"},{url:"lib/1.1/components/media-browser/article.html",revision:"ee5d2f689e747b5320fefd361af7fcfd"},{url:"lib/1.1/components/media-browser/image.css",revision:"ae49f05922ab6be7e09a8bebf1f32f00"},{url:"lib/1.1/components/media-browser/image.html",revision:"87a9be2b82f0388a7d3aaa16c2003422"},{url:"lib/1.1/components/media-browser/image.js",revision:"4aeeac0bd702d717fceb59f1abcd924e"},{url:"lib/1.1/components/media-browser/video-yt.css",revision:"594d8771c9b011eaebcd957daf74d17e"},{url:"lib/1.1/components/media-browser/video-yt.html",revision:"a85ff95f97a31b1d890dfc55a2b91538"},{url:"lib/1.1/components/media-browser/video-yt.js",revision:"87ae9156a9dec2427ffbe5439e5c3f4f"},{url:"lib/1.1/components/media-browser/video.css",revision:"c62d91469a6c8d17aad13581469f7d1c"},{url:"lib/1.1/components/media-browser/video.html",revision:"4128300adb3a2e6cd8d68bba9ffb00ee"},{url:"lib/1.1/components/media-browser/video.js",revision:"eb337fc0d0adb6840d077de7888a8f8c"},{url:"lib/1.1/components/menu-overlay.css",revision:"736446a0ce463ad6664c5f8066376189"},{url:"lib/1.1/components/menu-overlay.html",revision:"220c3005881852f0387e61ea8ac2a6c5"},{url:"lib/1.1/components/menu-overlay.js",revision:"15dc6cd532c7c4af1ee4f525c2f3aff2"},{url:"lib/1.1/controllers/drawer-layout.js",revision:"efd643eb309cafec496b8f5b60dacf4a"},{url:"lib/1.1/controllers/gesture-helper.js",revision:"1776574c57c1a6115edfbcb3887ed147"},{url:"lib/1.1/controllers/header-auto-hide.js",revision:"dfafe8a0780d7759b16afa63673cbecb"},{url:"lib/1.1/controllers/list-view.js",revision:"fc2930407b29c707ab8bfca33685e9be"},{url:"lib/1.1/controllers/mdl-button.js",revision:"c2a4ac575ee439b1e19beb42ea7d016f"},{url:"lib/1.1/controllers/mdl-checkbox.js",revision:"20911a2c2aec81f9ab42615987b21364"},{url:"lib/1.1/controllers/mdl-menu.js",revision:"8f620c9a13b8c47720b24b46205fc906"},{url:"lib/1.1/controllers/scroll-helper.js",revision:"d35210ea8c416fdad067aedad98c9063"},{url:"lib/1.1/controllers/view-pager.js",revision:"d7e48fa1226efe9fb2e1a53730203d82"},{url:"lib/1.1/templates/mdl-card-image.css",revision:"394c8f6d4efb3ac8546f2199579d50fc"},{url:"lib/1.1/templates/mdl-card-image.html",revision:"7983de36c031e5049e7cfe024bb56be3"},{url:"lib/1.1/templates/mdl-card-square.css",revision:"0cd25031cce1ceb63fb6660f9249ebe3"},{url:"lib/1.1/templates/mdl-card-square.html",revision:"6a0884fea45748a54e0d6c4936f145c9"},{url:"lib/1.1/templates/mdl-card.css",revision:"d8c8685be5e6fc793835eddec3acd241"},{url:"lib/1.1/templates/mdl-card.html",revision:"8f4162c548d4eb34d2e592c499f31aa0"},{url:"manifest.json",revision:"29978efcaebfab6fbd65116d50cd99c2"},{url:"search-index.json",revision:"efe54bded18adf2d329642fafad07368"},{url:"search-list.json",revision:"5b11a8ced2c52f091ecd735afd4b6823"},{url:"search/index.bundle.ext.js",revision:"ca96760d9f29fbbf9029e116cc749b2d"},{url:"search/index.bundle.js",revision:"d07424b2af8b45079fab844335ef956b"},{url:"search/index.html",revision:"ff4d6aa4c260084ffc58cd52ed275b01"},{url:"content/docs/page-options/images/side_drawer_section.png",revision:"16d006e9b73a2fb01f6c873002d1c600"},{url:"content/docs/page-options/images/side_drawer.png",revision:"24f12235166597471ae367978a75987f"},{url:"images/github-mark.png",revision:"add1026fb07009c6879400cbcf145301"},{url:"images/icons/desktop/android-chrome-192x192.png",revision:"93d5e77e9ee1e9c6975f3c0bd1a21574"},{url:"images/icons/desktop/android-chrome-512x512.png",revision:"6df83c6c13be17a2ea70d29e340c5ddb"},{url:"images/icons/desktop/apple-touch-icon.png",revision:"2b78ed332644d19d9779c069c5842538"},{url:"images/icons/desktop/favicon-16x16.png",revision:"6c047cdbd3d5c4c962a3a692a5025d27"},{url:"images/icons/desktop/favicon-32x32.png",revision:"7413528d5e59c22af1ccf38187bc950b"},{url:"images/icons/desktop/mstile-150x150.png",revision:"540caa78f56655281b2d4b17ad52f2ce"},{url:"images/icons/desktop/safari-pinned-tab.svg",revision:"a0ab2c612c6a5019b3e4ae7c38043b98"},{url:"images/icons/icon-128x128.png",revision:"69f3f1f3f956bb71f35ce66b7717e1a0"},{url:"images/icons/icon-144x144.png",revision:"45e24db8671c41ca95c440df0cadf2a3"},{url:"images/icons/icon-152x152.png",revision:"e0867fd6e9bc25afd831b1eabdd83f8d"},{url:"images/icons/icon-192x192.png",revision:"cf383c3d4500d31884326cc9d53a8c3a"},{url:"images/icons/icon-384x384.png",revision:"31fd304cf6c5ff72928b7a91fbd68343"},{url:"images/icons/icon-512x512.png",revision:"47d9af0508ab29138dcb8ca6a4664cf2"},{url:"images/icons/icon-72x72.png",revision:"919cb6b3e8a1b5d0c963921dba0e4388"},{url:"images/icons/icon-96x96.png",revision:"5547ad1a33334c0f5c04f6de1f6d2c52"},{url:"images/lighthouse.png",revision:"79aa0c430e8ee960cbe654bbc0718631"},{url:"images/page-speed-insight-icon.png",revision:"8806237a2557fb748e7eaae4158899fb"},{url:"images/patreon.png",revision:"138534b06fe107c864e576d63273cf75"},{url:"images/profile-icon.png",revision:"b4e6fa3d09388123298958c47aeb13ca"},{url:"images/rss-feed.png",revision:"fa5663a3878814bb9820de6b29005169"},{url:"images/zuix-logo.svg",revision:"48e6defd57440a6d0f0d12241ff9d6c5"}],{}),e.registerRoute(/\.(?:png|jpg|jpeg|svg)$/,new e.CacheFirst({cacheName:"images",plugins:[new e.ExpirationPlugin({maxEntries:50})]}),"GET"),e.registerRoute(/\.(?:html|json|js|css)$/,new e.CacheFirst({cacheName:"default",plugins:[new e.ExpirationPlugin({maxEntries:50})]}),"GET")})); //# sourceMappingURL=service-worker.js.map diff --git a/docs/service-worker.js.map b/docs/service-worker.js.map index 4c23a34..f5c695d 100644 --- a/docs/service-worker.js.map +++ b/docs/service-worker.js.map @@ -1 +1 @@ -{"version":3,"file":"service-worker.js","sources":["../../../../../tmp/9aaed7ff3ab2043008128df36744af8f/service-worker.js"],"sourcesContent":["import {registerRoute as workbox_routing_registerRoute} from '/home/gene/Scrivania/work/web-app/node_modules/workbox-routing/registerRoute.mjs';\nimport {ExpirationPlugin as workbox_expiration_ExpirationPlugin} from '/home/gene/Scrivania/work/web-app/node_modules/workbox-expiration/ExpirationPlugin.mjs';\nimport {CacheFirst as workbox_strategies_CacheFirst} from '/home/gene/Scrivania/work/web-app/node_modules/workbox-strategies/CacheFirst.mjs';\nimport {precacheAndRoute as workbox_precaching_precacheAndRoute} from '/home/gene/Scrivania/work/web-app/node_modules/workbox-precaching/precacheAndRoute.mjs';/**\n * Welcome to your Workbox-powered service worker!\n *\n * You'll need to register this file in your web app.\n * See https://goo.gl/nhQhGp\n *\n * The rest of the code is auto-generated. Please don't update this file\n * directly; instead, make changes to your Workbox build configuration\n * and re-run your build process.\n * See https://goo.gl/2aRDsh\n */\n\n\n\n\n\n\n\n\nself.addEventListener('message', (event) => {\n if (event.data && event.data.type === 'SKIP_WAITING') {\n self.skipWaiting();\n }\n});\n\n\n\n\n/**\n * The precacheAndRoute() method efficiently caches and responds to\n * requests for URLs in the manifest.\n * See https://goo.gl/S9QRab\n */\nworkbox_precaching_precacheAndRoute([\n {\n \"url\": \"app/cms/zuix-editor.css\",\n \"revision\": \"20bfdd79067e9ebdc3d619aafb170291\"\n },\n {\n \"url\": \"app/cms/zuix-editor.html\",\n \"revision\": \"29e9e66c0551e5713c02e4f86d1494b7\"\n },\n {\n \"url\": \"app/cms/zuix-editor.js\",\n \"revision\": \"40e7cdf4d16c625617ec84be52417f8a\"\n },\n {\n \"url\": \"app/cms/zuix-editor/dialogs/add-page.css\",\n \"revision\": \"fa9d55e0e6227e3e412259f11e0bbdb2\"\n },\n {\n \"url\": \"app/cms/zuix-editor/dialogs/add-page.html\",\n \"revision\": \"635447ae5013d8d592f0d3150aa6b907\"\n },\n {\n \"url\": \"app/cms/zuix-editor/dialogs/add-page.js\",\n \"revision\": \"cd78758e09ad8babf8f55ce56f49ecb6\"\n },\n {\n \"url\": \"app/cms/zuix-editor/dialogs/create-component.css\",\n \"revision\": \"980e51a89d8801392dd457459f10d8bf\"\n },\n {\n \"url\": \"app/cms/zuix-editor/dialogs/create-component.html\",\n \"revision\": \"beb030d44e9cd47de7da79e9b8e6c5a8\"\n },\n {\n \"url\": \"app/cms/zuix-editor/dialogs/create-component.js\",\n \"revision\": \"efb4228addddc9b4ba7e65b79611e4ff\"\n },\n {\n \"url\": \"app/cms/zuix-editor/dialogs/delete-page.css\",\n \"revision\": \"2d83029a4ce61bf4c799868f4da7be12\"\n },\n {\n \"url\": \"app/cms/zuix-editor/dialogs/delete-page.html\",\n \"revision\": \"b86caa847060bde014b7c740e7d919ce\"\n },\n {\n \"url\": \"app/cms/zuix-editor/dialogs/delete-page.js\",\n \"revision\": \"36d0d71ef5e39ccb7df0fdcc67006599\"\n },\n {\n \"url\": \"config.js\",\n \"revision\": \"24be7718612e5e3de4e105ba7ea035bc\"\n },\n {\n \"url\": \"content/content.11tydata.js\",\n \"revision\": \"04fb4b5a734c21c8a824d50e6df3b3d0\"\n },\n {\n \"url\": \"content/docs/index.bundle.ext.js\",\n \"revision\": \"ca96760d9f29fbbf9029e116cc749b2d\"\n },\n {\n \"url\": \"content/docs/index.bundle.js\",\n \"revision\": \"8265c2d9d1d5a471d03ffbdae5d9082d\"\n },\n {\n \"url\": \"content/docs/index.html\",\n \"revision\": \"833b94b479f52a8944f9bf95ec40b41c\"\n },\n {\n \"url\": \"content/docs/material-design-tags/index.bundle.ext.js\",\n \"revision\": \"ca96760d9f29fbbf9029e116cc749b2d\"\n },\n {\n \"url\": \"content/docs/material-design-tags/index.bundle.js\",\n \"revision\": \"79bf4bfaf29cce5ce6512ea52ca24cf9\"\n },\n {\n \"url\": \"content/docs/material-design-tags/index.html\",\n \"revision\": \"cd2c2581a99659cb5426cecf5b73aa28\"\n },\n {\n \"url\": \"content/docs/page-options/index.bundle.ext.js\",\n \"revision\": \"ca96760d9f29fbbf9029e116cc749b2d\"\n },\n {\n \"url\": \"content/docs/page-options/index.bundle.js\",\n \"revision\": \"b766b5aa367a44f35884513d1575439f\"\n },\n {\n \"url\": \"content/docs/page-options/index.html\",\n \"revision\": \"ad7e707c895a6fa4815533e7515c2acc\"\n },\n {\n \"url\": \"content/docs/zkit-components-tags/index.bundle.ext.js\",\n \"revision\": \"ca96760d9f29fbbf9029e116cc749b2d\"\n },\n {\n \"url\": \"content/docs/zkit-components-tags/index.bundle.js\",\n \"revision\": \"cb67da996afd79ee218000a260291aa4\"\n },\n {\n \"url\": \"content/docs/zkit-components-tags/index.html\",\n \"revision\": \"b89c5da67463e2794cdc36b42ef9b969\"\n },\n {\n \"url\": \"css/animate.min.css\",\n \"revision\": \"c0be8e53226ac34833fd9b5dbc01ebc5\"\n },\n {\n \"url\": \"css/fla/flex-layout-attribute.css\",\n \"revision\": \"c9bc58fccb5b4c9d1d7a6e76edddffa7\"\n },\n {\n \"url\": \"css/fla/flex-layout-attribute.min.css\",\n \"revision\": \"c55488315343d9afb4d13ebf9cc8f97b\"\n },\n {\n \"url\": \"css/prism.css\",\n \"revision\": \"343ab6c1b213d253d82d6c7afad86079\"\n },\n {\n \"url\": \"home/index.bundle.ext.js\",\n \"revision\": \"ca96760d9f29fbbf9029e116cc749b2d\"\n },\n {\n \"url\": \"home/index.bundle.js\",\n \"revision\": \"efe973bbbd712690961393a9e7afae99\"\n },\n {\n \"url\": \"home/index.html\",\n \"revision\": \"b07b9e5094d5527e6d26ee99b457dcbf\"\n },\n {\n \"url\": \"index.bundle.ext.js\",\n \"revision\": \"cbcb083634a174b51782035df12863fa\"\n },\n {\n \"url\": \"index.html\",\n \"revision\": \"adf68446f0e159e420d09153982443b3\"\n },\n {\n \"url\": \"js/fuse/fuse.basic.common.js\",\n \"revision\": \"ab3ef0028c8992d0098b5b836874291a\"\n },\n {\n \"url\": \"js/fuse/fuse.basic.esm.js\",\n \"revision\": \"0cd240af452625e49deed3ee2445aba6\"\n },\n {\n \"url\": \"js/fuse/fuse.basic.esm.min.js\",\n \"revision\": \"f79f602fa4572cd580786923ce942b6c\"\n },\n {\n \"url\": \"js/fuse/fuse.basic.js\",\n \"revision\": \"6c4923a67225dd64e42600c578d8ff0f\"\n },\n {\n \"url\": \"js/fuse/fuse.basic.min.js\",\n \"revision\": \"62465d50492b6d1bfbbd0e5f9a09b222\"\n },\n {\n \"url\": \"js/fuse/fuse.common.js\",\n \"revision\": \"ddbe097989e19bf1872f533cbc363f1b\"\n },\n {\n \"url\": \"js/fuse/fuse.esm.js\",\n \"revision\": \"82bbf2ed8ece715c58afe6c75977795f\"\n },\n {\n \"url\": \"js/fuse/fuse.esm.min.js\",\n \"revision\": \"589223b029350d512db61a8f323ce0fe\"\n },\n {\n \"url\": \"js/fuse/fuse.js\",\n \"revision\": \"7e19f88c4b2a7c038943bf3b4a17986f\"\n },\n {\n \"url\": \"js/fuse/fuse.min.js\",\n \"revision\": \"de7d60e4a6881074275feca14b84a49d\"\n },\n {\n \"url\": \"js/mdl/material.indigo-deep_purple.min.css\",\n \"revision\": \"1c401a0e084db91cdd5d196b08b0795e\"\n },\n {\n \"url\": \"js/mdl/material.min.css\",\n \"revision\": \"9ab85b48144d24908b4e455c2afb648c\"\n },\n {\n \"url\": \"js/mdl/material.min.js\",\n \"revision\": \"8dbb84e1d015cd5c2f5be1064eb924b3\"\n },\n {\n \"url\": \"js/zuix/zuix-bundler.js\",\n \"revision\": \"34faeb1b1cf274e7b980dbd496d728c9\"\n },\n {\n \"url\": \"js/zuix/zuix-bundler.min.js\",\n \"revision\": \"c836a053d0b78abe802ed832ddcb8ac5\"\n },\n {\n \"url\": \"js/zuix/zuix-bundler.module.js\",\n \"revision\": \"4b1a833a3391bcdd8fba384b72fd7f70\"\n },\n {\n \"url\": \"js/zuix/zuix-bundler.module.min.js\",\n \"revision\": \"e475873997f70b9738f62b190c16fddb\"\n },\n {\n \"url\": \"js/zuix/zuix.js\",\n \"revision\": \"5e19a04d4f05f511a3d2c1956ea99e8f\"\n },\n {\n \"url\": \"js/zuix/zuix.min.js\",\n \"revision\": \"29599e4e0f7c465c206d7d0fe0526d3b\"\n },\n {\n \"url\": \"js/zuix/zuix.module.js\",\n \"revision\": \"882870098e9fc01d85dbf030639aa7fb\"\n },\n {\n \"url\": \"js/zuix/zuix.module.min.js\",\n \"revision\": \"b4ff18b8eb77cdae1ba11c9e25b74c95\"\n },\n {\n \"url\": \"lib/1.1/components/context-menu.css\",\n \"revision\": \"92dd2fa2c80af9b5464b3912c1fcdf2b\"\n },\n {\n \"url\": \"lib/1.1/components/context-menu.html\",\n \"revision\": \"74daf4054d7613ede5f88007a94bdc43\"\n },\n {\n \"url\": \"lib/1.1/components/context-menu.js\",\n \"revision\": \"c431c45cd1c042f2e9d5b2fc51b6d09f\"\n },\n {\n \"url\": \"lib/1.1/components/hamburger-icon.css\",\n \"revision\": \"dd81a60d1bfa7bd4463bb551eae81e35\"\n },\n {\n \"url\": \"lib/1.1/components/hamburger-icon.html\",\n \"revision\": \"14b9b9c25ea92bd9660a2e6ea53c1b0d\"\n },\n {\n \"url\": \"lib/1.1/components/hamburger-icon.js\",\n \"revision\": \"44cf41b6ac1d2dd49f7bf004a5d628a4\"\n },\n {\n \"url\": \"lib/1.1/components/media-browser.css\",\n \"revision\": \"e889174b42c1b4abd01bcd04e4cdaa0f\"\n },\n {\n \"url\": \"lib/1.1/components/media-browser.html\",\n \"revision\": \"d82b328652c89f40f6d81f84771a30ab\"\n },\n {\n \"url\": \"lib/1.1/components/media-browser.js\",\n \"revision\": \"78e4e863a758ac040ccfec3bd5dd23f7\"\n },\n {\n \"url\": \"lib/1.1/components/media-browser/article.css\",\n \"revision\": \"e7f0f5dbe26e76dcd13f7973dc768308\"\n },\n {\n \"url\": \"lib/1.1/components/media-browser/article.html\",\n \"revision\": \"ee5d2f689e747b5320fefd361af7fcfd\"\n },\n {\n \"url\": \"lib/1.1/components/media-browser/image.css\",\n \"revision\": \"ae49f05922ab6be7e09a8bebf1f32f00\"\n },\n {\n \"url\": \"lib/1.1/components/media-browser/image.html\",\n \"revision\": \"87a9be2b82f0388a7d3aaa16c2003422\"\n },\n {\n \"url\": \"lib/1.1/components/media-browser/image.js\",\n \"revision\": \"4aeeac0bd702d717fceb59f1abcd924e\"\n },\n {\n \"url\": \"lib/1.1/components/media-browser/video-yt.css\",\n \"revision\": \"594d8771c9b011eaebcd957daf74d17e\"\n },\n {\n \"url\": \"lib/1.1/components/media-browser/video-yt.html\",\n \"revision\": \"a85ff95f97a31b1d890dfc55a2b91538\"\n },\n {\n \"url\": \"lib/1.1/components/media-browser/video-yt.js\",\n \"revision\": \"87ae9156a9dec2427ffbe5439e5c3f4f\"\n },\n {\n \"url\": \"lib/1.1/components/media-browser/video.css\",\n \"revision\": \"c62d91469a6c8d17aad13581469f7d1c\"\n },\n {\n \"url\": \"lib/1.1/components/media-browser/video.html\",\n \"revision\": \"4128300adb3a2e6cd8d68bba9ffb00ee\"\n },\n {\n \"url\": \"lib/1.1/components/media-browser/video.js\",\n \"revision\": \"eb337fc0d0adb6840d077de7888a8f8c\"\n },\n {\n \"url\": \"lib/1.1/components/menu-overlay.css\",\n \"revision\": \"736446a0ce463ad6664c5f8066376189\"\n },\n {\n \"url\": \"lib/1.1/components/menu-overlay.html\",\n \"revision\": \"220c3005881852f0387e61ea8ac2a6c5\"\n },\n {\n \"url\": \"lib/1.1/components/menu-overlay.js\",\n \"revision\": \"15dc6cd532c7c4af1ee4f525c2f3aff2\"\n },\n {\n \"url\": \"lib/1.1/controllers/drawer-layout.js\",\n \"revision\": \"efd643eb309cafec496b8f5b60dacf4a\"\n },\n {\n \"url\": \"lib/1.1/controllers/gesture-helper.js\",\n \"revision\": \"1776574c57c1a6115edfbcb3887ed147\"\n },\n {\n \"url\": \"lib/1.1/controllers/header-auto-hide.js\",\n \"revision\": \"dfafe8a0780d7759b16afa63673cbecb\"\n },\n {\n \"url\": \"lib/1.1/controllers/list-view.js\",\n \"revision\": \"fc2930407b29c707ab8bfca33685e9be\"\n },\n {\n \"url\": \"lib/1.1/controllers/mdl-button.js\",\n \"revision\": \"c2a4ac575ee439b1e19beb42ea7d016f\"\n },\n {\n \"url\": \"lib/1.1/controllers/mdl-checkbox.js\",\n \"revision\": \"20911a2c2aec81f9ab42615987b21364\"\n },\n {\n \"url\": \"lib/1.1/controllers/mdl-menu.js\",\n \"revision\": \"8f620c9a13b8c47720b24b46205fc906\"\n },\n {\n \"url\": \"lib/1.1/controllers/scroll-helper.js\",\n \"revision\": \"d35210ea8c416fdad067aedad98c9063\"\n },\n {\n \"url\": \"lib/1.1/controllers/view-pager.js\",\n \"revision\": \"d7e48fa1226efe9fb2e1a53730203d82\"\n },\n {\n \"url\": \"lib/1.1/templates/mdl-card-image.css\",\n \"revision\": \"394c8f6d4efb3ac8546f2199579d50fc\"\n },\n {\n \"url\": \"lib/1.1/templates/mdl-card-image.html\",\n \"revision\": \"7983de36c031e5049e7cfe024bb56be3\"\n },\n {\n \"url\": \"lib/1.1/templates/mdl-card-square.css\",\n \"revision\": \"0cd25031cce1ceb63fb6660f9249ebe3\"\n },\n {\n \"url\": \"lib/1.1/templates/mdl-card-square.html\",\n \"revision\": \"6a0884fea45748a54e0d6c4936f145c9\"\n },\n {\n \"url\": \"lib/1.1/templates/mdl-card.css\",\n \"revision\": \"d8c8685be5e6fc793835eddec3acd241\"\n },\n {\n \"url\": \"lib/1.1/templates/mdl-card.html\",\n \"revision\": \"8f4162c548d4eb34d2e592c499f31aa0\"\n },\n {\n \"url\": \"manifest.json\",\n \"revision\": \"29978efcaebfab6fbd65116d50cd99c2\"\n },\n {\n \"url\": \"search-index.json\",\n \"revision\": \"efe54bded18adf2d329642fafad07368\"\n },\n {\n \"url\": \"search-list.json\",\n \"revision\": \"5b11a8ced2c52f091ecd735afd4b6823\"\n },\n {\n \"url\": \"search/index.bundle.ext.js\",\n \"revision\": \"ca96760d9f29fbbf9029e116cc749b2d\"\n },\n {\n \"url\": \"search/index.bundle.js\",\n \"revision\": \"d07424b2af8b45079fab844335ef956b\"\n },\n {\n \"url\": \"search/index.html\",\n \"revision\": \"7edee693408762102efa2cae02228ccd\"\n },\n {\n \"url\": \"content/docs/page-options/images/side_drawer_section.png\",\n \"revision\": \"16d006e9b73a2fb01f6c873002d1c600\"\n },\n {\n \"url\": \"content/docs/page-options/images/side_drawer.png\",\n \"revision\": \"24f12235166597471ae367978a75987f\"\n },\n {\n \"url\": \"images/github-mark.png\",\n \"revision\": \"add1026fb07009c6879400cbcf145301\"\n },\n {\n \"url\": \"images/icons/desktop/android-chrome-192x192.png\",\n \"revision\": \"93d5e77e9ee1e9c6975f3c0bd1a21574\"\n },\n {\n \"url\": \"images/icons/desktop/android-chrome-512x512.png\",\n \"revision\": \"6df83c6c13be17a2ea70d29e340c5ddb\"\n },\n {\n \"url\": \"images/icons/desktop/apple-touch-icon.png\",\n \"revision\": \"2b78ed332644d19d9779c069c5842538\"\n },\n {\n \"url\": \"images/icons/desktop/favicon-16x16.png\",\n \"revision\": \"6c047cdbd3d5c4c962a3a692a5025d27\"\n },\n {\n \"url\": \"images/icons/desktop/favicon-32x32.png\",\n \"revision\": \"7413528d5e59c22af1ccf38187bc950b\"\n },\n {\n \"url\": \"images/icons/desktop/mstile-150x150.png\",\n \"revision\": \"540caa78f56655281b2d4b17ad52f2ce\"\n },\n {\n \"url\": \"images/icons/desktop/safari-pinned-tab.svg\",\n \"revision\": \"a0ab2c612c6a5019b3e4ae7c38043b98\"\n },\n {\n \"url\": \"images/icons/icon-128x128.png\",\n \"revision\": \"69f3f1f3f956bb71f35ce66b7717e1a0\"\n },\n {\n \"url\": \"images/icons/icon-144x144.png\",\n \"revision\": \"45e24db8671c41ca95c440df0cadf2a3\"\n },\n {\n \"url\": \"images/icons/icon-152x152.png\",\n \"revision\": \"e0867fd6e9bc25afd831b1eabdd83f8d\"\n },\n {\n \"url\": \"images/icons/icon-192x192.png\",\n \"revision\": \"cf383c3d4500d31884326cc9d53a8c3a\"\n },\n {\n \"url\": \"images/icons/icon-384x384.png\",\n \"revision\": \"31fd304cf6c5ff72928b7a91fbd68343\"\n },\n {\n \"url\": \"images/icons/icon-512x512.png\",\n \"revision\": \"47d9af0508ab29138dcb8ca6a4664cf2\"\n },\n {\n \"url\": \"images/icons/icon-72x72.png\",\n \"revision\": \"919cb6b3e8a1b5d0c963921dba0e4388\"\n },\n {\n \"url\": \"images/icons/icon-96x96.png\",\n \"revision\": \"5547ad1a33334c0f5c04f6de1f6d2c52\"\n },\n {\n \"url\": \"images/lighthouse.png\",\n \"revision\": \"79aa0c430e8ee960cbe654bbc0718631\"\n },\n {\n \"url\": \"images/page-speed-insight-icon.png\",\n \"revision\": \"8806237a2557fb748e7eaae4158899fb\"\n },\n {\n \"url\": \"images/patreon.png\",\n \"revision\": \"138534b06fe107c864e576d63273cf75\"\n },\n {\n \"url\": \"images/profile-icon.png\",\n \"revision\": \"b4e6fa3d09388123298958c47aeb13ca\"\n },\n {\n \"url\": \"images/rss-feed.png\",\n \"revision\": \"fa5663a3878814bb9820de6b29005169\"\n },\n {\n \"url\": \"images/zuix-logo.svg\",\n \"revision\": \"48e6defd57440a6d0f0d12241ff9d6c5\"\n }\n], {});\n\n\n\n\nworkbox_routing_registerRoute(/\\.(?:png|jpg|jpeg|svg)$/, new workbox_strategies_CacheFirst({ \"cacheName\":\"images\", plugins: [new workbox_expiration_ExpirationPlugin({ maxEntries: 50 })] }), 'GET');\nworkbox_routing_registerRoute(/\\.(?:html|json|js|css)$/, new workbox_strategies_CacheFirst({ \"cacheName\":\"default\", plugins: [new workbox_expiration_ExpirationPlugin({ maxEntries: 50 })] }), 'GET');\n\n\n\n\n"],"names":["self","addEventListener","event","data","type","skipWaiting","workbox_precaching_precacheAndRoute","url","revision","workbox_routing_registerRoute","workbox_strategies_CacheFirst","cacheName","plugins","workbox_expiration_ExpirationPlugin","maxEntries"],"mappings":"0nBAsBAA,KAAKC,iBAAiB,WAAYC,IAC5BA,EAAMC,MAA4B,iBAApBD,EAAMC,KAAKC,MAC3BJ,KAAKK,iBAYTC,EAAAA,iBAAoC,CAClC,CACEC,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,2BACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,2CACPC,SAAY,oCAEd,CACED,IAAO,4CACPC,SAAY,oCAEd,CACED,IAAO,0CACPC,SAAY,oCAEd,CACED,IAAO,mDACPC,SAAY,oCAEd,CACED,IAAO,oDACPC,SAAY,oCAEd,CACED,IAAO,kDACPC,SAAY,oCAEd,CACED,IAAO,8CACPC,SAAY,oCAEd,CACED,IAAO,+CACPC,SAAY,oCAEd,CACED,IAAO,6CACPC,SAAY,oCAEd,CACED,IAAO,YACPC,SAAY,oCAEd,CACED,IAAO,8BACPC,SAAY,oCAEd,CACED,IAAO,mCACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,wDACPC,SAAY,oCAEd,CACED,IAAO,oDACPC,SAAY,oCAEd,CACED,IAAO,+CACPC,SAAY,oCAEd,CACED,IAAO,gDACPC,SAAY,oCAEd,CACED,IAAO,4CACPC,SAAY,oCAEd,CACED,IAAO,uCACPC,SAAY,oCAEd,CACED,IAAO,wDACPC,SAAY,oCAEd,CACED,IAAO,oDACPC,SAAY,oCAEd,CACED,IAAO,+CACPC,SAAY,oCAEd,CACED,IAAO,sBACPC,SAAY,oCAEd,CACED,IAAO,oCACPC,SAAY,oCAEd,CACED,IAAO,wCACPC,SAAY,oCAEd,CACED,IAAO,gBACPC,SAAY,oCAEd,CACED,IAAO,2BACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,kBACPC,SAAY,oCAEd,CACED,IAAO,sBACPC,SAAY,oCAEd,CACED,IAAO,aACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,4BACPC,SAAY,oCAEd,CACED,IAAO,gCACPC,SAAY,oCAEd,CACED,IAAO,wBACPC,SAAY,oCAEd,CACED,IAAO,4BACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,sBACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,kBACPC,SAAY,oCAEd,CACED,IAAO,sBACPC,SAAY,oCAEd,CACED,IAAO,6CACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,8BACPC,SAAY,oCAEd,CACED,IAAO,iCACPC,SAAY,oCAEd,CACED,IAAO,qCACPC,SAAY,oCAEd,CACED,IAAO,kBACPC,SAAY,oCAEd,CACED,IAAO,sBACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,sCACPC,SAAY,oCAEd,CACED,IAAO,uCACPC,SAAY,oCAEd,CACED,IAAO,qCACPC,SAAY,oCAEd,CACED,IAAO,wCACPC,SAAY,oCAEd,CACED,IAAO,yCACPC,SAAY,oCAEd,CACED,IAAO,uCACPC,SAAY,oCAEd,CACED,IAAO,uCACPC,SAAY,oCAEd,CACED,IAAO,wCACPC,SAAY,oCAEd,CACED,IAAO,sCACPC,SAAY,oCAEd,CACED,IAAO,+CACPC,SAAY,oCAEd,CACED,IAAO,gDACPC,SAAY,oCAEd,CACED,IAAO,6CACPC,SAAY,oCAEd,CACED,IAAO,8CACPC,SAAY,oCAEd,CACED,IAAO,4CACPC,SAAY,oCAEd,CACED,IAAO,gDACPC,SAAY,oCAEd,CACED,IAAO,iDACPC,SAAY,oCAEd,CACED,IAAO,+CACPC,SAAY,oCAEd,CACED,IAAO,6CACPC,SAAY,oCAEd,CACED,IAAO,8CACPC,SAAY,oCAEd,CACED,IAAO,4CACPC,SAAY,oCAEd,CACED,IAAO,sCACPC,SAAY,oCAEd,CACED,IAAO,uCACPC,SAAY,oCAEd,CACED,IAAO,qCACPC,SAAY,oCAEd,CACED,IAAO,uCACPC,SAAY,oCAEd,CACED,IAAO,wCACPC,SAAY,oCAEd,CACED,IAAO,0CACPC,SAAY,oCAEd,CACED,IAAO,mCACPC,SAAY,oCAEd,CACED,IAAO,oCACPC,SAAY,oCAEd,CACED,IAAO,sCACPC,SAAY,oCAEd,CACED,IAAO,kCACPC,SAAY,oCAEd,CACED,IAAO,uCACPC,SAAY,oCAEd,CACED,IAAO,oCACPC,SAAY,oCAEd,CACED,IAAO,uCACPC,SAAY,oCAEd,CACED,IAAO,wCACPC,SAAY,oCAEd,CACED,IAAO,wCACPC,SAAY,oCAEd,CACED,IAAO,yCACPC,SAAY,oCAEd,CACED,IAAO,iCACPC,SAAY,oCAEd,CACED,IAAO,kCACPC,SAAY,oCAEd,CACED,IAAO,gBACPC,SAAY,oCAEd,CACED,IAAO,oBACPC,SAAY,oCAEd,CACED,IAAO,mBACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,oBACPC,SAAY,oCAEd,CACED,IAAO,2DACPC,SAAY,oCAEd,CACED,IAAO,mDACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,kDACPC,SAAY,oCAEd,CACED,IAAO,kDACPC,SAAY,oCAEd,CACED,IAAO,4CACPC,SAAY,oCAEd,CACED,IAAO,yCACPC,SAAY,oCAEd,CACED,IAAO,yCACPC,SAAY,oCAEd,CACED,IAAO,0CACPC,SAAY,oCAEd,CACED,IAAO,6CACPC,SAAY,oCAEd,CACED,IAAO,gCACPC,SAAY,oCAEd,CACED,IAAO,gCACPC,SAAY,oCAEd,CACED,IAAO,gCACPC,SAAY,oCAEd,CACED,IAAO,gCACPC,SAAY,oCAEd,CACED,IAAO,gCACPC,SAAY,oCAEd,CACED,IAAO,gCACPC,SAAY,oCAEd,CACED,IAAO,8BACPC,SAAY,oCAEd,CACED,IAAO,8BACPC,SAAY,oCAEd,CACED,IAAO,wBACPC,SAAY,oCAEd,CACED,IAAO,qCACPC,SAAY,oCAEd,CACED,IAAO,qBACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,sBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,qCAEb,IAKHC,EAAAA,cAA8B,0BAA2B,IAAIC,aAA8B,CAAEC,UAAY,SAAUC,QAAS,CAAC,IAAIC,mBAAoC,CAAEC,WAAY,QAAW,OAC9LL,EAAAA,cAA8B,0BAA2B,IAAIC,aAA8B,CAAEC,UAAY,UAAWC,QAAS,CAAC,IAAIC,mBAAoC,CAAEC,WAAY,QAAW"} \ No newline at end of file +{"version":3,"file":"service-worker.js","sources":["../../../../../tmp/7c44f8b08d464ac778be27b3dda5cd23/service-worker.js"],"sourcesContent":["import {registerRoute as workbox_routing_registerRoute} from '/home/gene/Scrivania/work/web-app/node_modules/workbox-routing/registerRoute.mjs';\nimport {ExpirationPlugin as workbox_expiration_ExpirationPlugin} from '/home/gene/Scrivania/work/web-app/node_modules/workbox-expiration/ExpirationPlugin.mjs';\nimport {CacheFirst as workbox_strategies_CacheFirst} from '/home/gene/Scrivania/work/web-app/node_modules/workbox-strategies/CacheFirst.mjs';\nimport {precacheAndRoute as workbox_precaching_precacheAndRoute} from '/home/gene/Scrivania/work/web-app/node_modules/workbox-precaching/precacheAndRoute.mjs';/**\n * Welcome to your Workbox-powered service worker!\n *\n * You'll need to register this file in your web app.\n * See https://goo.gl/nhQhGp\n *\n * The rest of the code is auto-generated. Please don't update this file\n * directly; instead, make changes to your Workbox build configuration\n * and re-run your build process.\n * See https://goo.gl/2aRDsh\n */\n\n\n\n\n\n\n\n\nself.addEventListener('message', (event) => {\n if (event.data && event.data.type === 'SKIP_WAITING') {\n self.skipWaiting();\n }\n});\n\n\n\n\n/**\n * The precacheAndRoute() method efficiently caches and responds to\n * requests for URLs in the manifest.\n * See https://goo.gl/S9QRab\n */\nworkbox_precaching_precacheAndRoute([\n {\n \"url\": \"app/cms/zuix-editor.css\",\n \"revision\": \"20bfdd79067e9ebdc3d619aafb170291\"\n },\n {\n \"url\": \"app/cms/zuix-editor.html\",\n \"revision\": \"29e9e66c0551e5713c02e4f86d1494b7\"\n },\n {\n \"url\": \"app/cms/zuix-editor.js\",\n \"revision\": \"40e7cdf4d16c625617ec84be52417f8a\"\n },\n {\n \"url\": \"app/cms/zuix-editor/dialogs/add-page.css\",\n \"revision\": \"fa9d55e0e6227e3e412259f11e0bbdb2\"\n },\n {\n \"url\": \"app/cms/zuix-editor/dialogs/add-page.html\",\n \"revision\": \"635447ae5013d8d592f0d3150aa6b907\"\n },\n {\n \"url\": \"app/cms/zuix-editor/dialogs/add-page.js\",\n \"revision\": \"cd78758e09ad8babf8f55ce56f49ecb6\"\n },\n {\n \"url\": \"app/cms/zuix-editor/dialogs/create-component.css\",\n \"revision\": \"980e51a89d8801392dd457459f10d8bf\"\n },\n {\n \"url\": \"app/cms/zuix-editor/dialogs/create-component.html\",\n \"revision\": \"beb030d44e9cd47de7da79e9b8e6c5a8\"\n },\n {\n \"url\": \"app/cms/zuix-editor/dialogs/create-component.js\",\n \"revision\": \"efb4228addddc9b4ba7e65b79611e4ff\"\n },\n {\n \"url\": \"app/cms/zuix-editor/dialogs/delete-page.css\",\n \"revision\": \"2d83029a4ce61bf4c799868f4da7be12\"\n },\n {\n \"url\": \"app/cms/zuix-editor/dialogs/delete-page.html\",\n \"revision\": \"b86caa847060bde014b7c740e7d919ce\"\n },\n {\n \"url\": \"app/cms/zuix-editor/dialogs/delete-page.js\",\n \"revision\": \"36d0d71ef5e39ccb7df0fdcc67006599\"\n },\n {\n \"url\": \"config.js\",\n \"revision\": \"24be7718612e5e3de4e105ba7ea035bc\"\n },\n {\n \"url\": \"content/content.11tydata.js\",\n \"revision\": \"04fb4b5a734c21c8a824d50e6df3b3d0\"\n },\n {\n \"url\": \"content/docs/index.bundle.ext.js\",\n \"revision\": \"ca96760d9f29fbbf9029e116cc749b2d\"\n },\n {\n \"url\": \"content/docs/index.bundle.js\",\n \"revision\": \"8265c2d9d1d5a471d03ffbdae5d9082d\"\n },\n {\n \"url\": \"content/docs/index.html\",\n \"revision\": \"1752cfdd794fe07af57cf41f870fdd7a\"\n },\n {\n \"url\": \"content/docs/material-design-tags/index.bundle.ext.js\",\n \"revision\": \"ca96760d9f29fbbf9029e116cc749b2d\"\n },\n {\n \"url\": \"content/docs/material-design-tags/index.bundle.js\",\n \"revision\": \"79bf4bfaf29cce5ce6512ea52ca24cf9\"\n },\n {\n \"url\": \"content/docs/material-design-tags/index.html\",\n \"revision\": \"b42c093ce31861a8ea8ff03854816740\"\n },\n {\n \"url\": \"content/docs/page-options/index.bundle.ext.js\",\n \"revision\": \"ca96760d9f29fbbf9029e116cc749b2d\"\n },\n {\n \"url\": \"content/docs/page-options/index.bundle.js\",\n \"revision\": \"b766b5aa367a44f35884513d1575439f\"\n },\n {\n \"url\": \"content/docs/page-options/index.html\",\n \"revision\": \"aec4500b2de7a742a03fa997ceedf332\"\n },\n {\n \"url\": \"content/docs/zkit-components-tags/index.bundle.ext.js\",\n \"revision\": \"ca96760d9f29fbbf9029e116cc749b2d\"\n },\n {\n \"url\": \"content/docs/zkit-components-tags/index.bundle.js\",\n \"revision\": \"cb67da996afd79ee218000a260291aa4\"\n },\n {\n \"url\": \"content/docs/zkit-components-tags/index.html\",\n \"revision\": \"bf125810fbffa931871fa8205389fccd\"\n },\n {\n \"url\": \"css/animate.min.css\",\n \"revision\": \"c0be8e53226ac34833fd9b5dbc01ebc5\"\n },\n {\n \"url\": \"css/fla/flex-layout-attribute.css\",\n \"revision\": \"c9bc58fccb5b4c9d1d7a6e76edddffa7\"\n },\n {\n \"url\": \"css/fla/flex-layout-attribute.min.css\",\n \"revision\": \"c55488315343d9afb4d13ebf9cc8f97b\"\n },\n {\n \"url\": \"css/prism.css\",\n \"revision\": \"343ab6c1b213d253d82d6c7afad86079\"\n },\n {\n \"url\": \"home/index.bundle.ext.js\",\n \"revision\": \"ca96760d9f29fbbf9029e116cc749b2d\"\n },\n {\n \"url\": \"home/index.bundle.js\",\n \"revision\": \"efe973bbbd712690961393a9e7afae99\"\n },\n {\n \"url\": \"home/index.html\",\n \"revision\": \"e132323217099917588e68b753ba0857\"\n },\n {\n \"url\": \"index.bundle.ext.js\",\n \"revision\": \"cbcb083634a174b51782035df12863fa\"\n },\n {\n \"url\": \"index.html\",\n \"revision\": \"adf68446f0e159e420d09153982443b3\"\n },\n {\n \"url\": \"js/fuse/fuse.basic.common.js\",\n \"revision\": \"ab3ef0028c8992d0098b5b836874291a\"\n },\n {\n \"url\": \"js/fuse/fuse.basic.esm.js\",\n \"revision\": \"0cd240af452625e49deed3ee2445aba6\"\n },\n {\n \"url\": \"js/fuse/fuse.basic.esm.min.js\",\n \"revision\": \"f79f602fa4572cd580786923ce942b6c\"\n },\n {\n \"url\": \"js/fuse/fuse.basic.js\",\n \"revision\": \"6c4923a67225dd64e42600c578d8ff0f\"\n },\n {\n \"url\": \"js/fuse/fuse.basic.min.js\",\n \"revision\": \"62465d50492b6d1bfbbd0e5f9a09b222\"\n },\n {\n \"url\": \"js/fuse/fuse.common.js\",\n \"revision\": \"ddbe097989e19bf1872f533cbc363f1b\"\n },\n {\n \"url\": \"js/fuse/fuse.esm.js\",\n \"revision\": \"82bbf2ed8ece715c58afe6c75977795f\"\n },\n {\n \"url\": \"js/fuse/fuse.esm.min.js\",\n \"revision\": \"589223b029350d512db61a8f323ce0fe\"\n },\n {\n \"url\": \"js/fuse/fuse.js\",\n \"revision\": \"7e19f88c4b2a7c038943bf3b4a17986f\"\n },\n {\n \"url\": \"js/fuse/fuse.min.js\",\n \"revision\": \"de7d60e4a6881074275feca14b84a49d\"\n },\n {\n \"url\": \"js/mdl/material.indigo-deep_purple.min.css\",\n \"revision\": \"1c401a0e084db91cdd5d196b08b0795e\"\n },\n {\n \"url\": \"js/mdl/material.min.css\",\n \"revision\": \"9ab85b48144d24908b4e455c2afb648c\"\n },\n {\n \"url\": \"js/mdl/material.min.js\",\n \"revision\": \"8dbb84e1d015cd5c2f5be1064eb924b3\"\n },\n {\n \"url\": \"js/zuix/zuix-bundler.js\",\n \"revision\": \"516a82b235448e71e55b30aadfade897\"\n },\n {\n \"url\": \"js/zuix/zuix-bundler.min.js\",\n \"revision\": \"875257fc52c85f65bb6cdbbc935832b3\"\n },\n {\n \"url\": \"js/zuix/zuix-bundler.module.js\",\n \"revision\": \"7beafeac4d160d6dbe5b01529d426237\"\n },\n {\n \"url\": \"js/zuix/zuix-bundler.module.min.js\",\n \"revision\": \"7234a54bd137d84db9c3fd328784ef1e\"\n },\n {\n \"url\": \"js/zuix/zuix.js\",\n \"revision\": \"1ba6336ee11276110126c9a274dc8829\"\n },\n {\n \"url\": \"js/zuix/zuix.min.js\",\n \"revision\": \"12967cca41b42c11e9ab8eb1472a08f7\"\n },\n {\n \"url\": \"js/zuix/zuix.module.js\",\n \"revision\": \"09c720efad6247b8b2112dfff49efe58\"\n },\n {\n \"url\": \"js/zuix/zuix.module.min.js\",\n \"revision\": \"155aeb71d2886b297fcee2c90cbd88ba\"\n },\n {\n \"url\": \"lib/1.1/components/context-menu.css\",\n \"revision\": \"92dd2fa2c80af9b5464b3912c1fcdf2b\"\n },\n {\n \"url\": \"lib/1.1/components/context-menu.html\",\n \"revision\": \"74daf4054d7613ede5f88007a94bdc43\"\n },\n {\n \"url\": \"lib/1.1/components/context-menu.js\",\n \"revision\": \"c431c45cd1c042f2e9d5b2fc51b6d09f\"\n },\n {\n \"url\": \"lib/1.1/components/hamburger-icon.css\",\n \"revision\": \"dd81a60d1bfa7bd4463bb551eae81e35\"\n },\n {\n \"url\": \"lib/1.1/components/hamburger-icon.html\",\n \"revision\": \"14b9b9c25ea92bd9660a2e6ea53c1b0d\"\n },\n {\n \"url\": \"lib/1.1/components/hamburger-icon.js\",\n \"revision\": \"44cf41b6ac1d2dd49f7bf004a5d628a4\"\n },\n {\n \"url\": \"lib/1.1/components/media-browser.css\",\n \"revision\": \"e889174b42c1b4abd01bcd04e4cdaa0f\"\n },\n {\n \"url\": \"lib/1.1/components/media-browser.html\",\n \"revision\": \"d82b328652c89f40f6d81f84771a30ab\"\n },\n {\n \"url\": \"lib/1.1/components/media-browser.js\",\n \"revision\": \"78e4e863a758ac040ccfec3bd5dd23f7\"\n },\n {\n \"url\": \"lib/1.1/components/media-browser/article.css\",\n \"revision\": \"e7f0f5dbe26e76dcd13f7973dc768308\"\n },\n {\n \"url\": \"lib/1.1/components/media-browser/article.html\",\n \"revision\": \"ee5d2f689e747b5320fefd361af7fcfd\"\n },\n {\n \"url\": \"lib/1.1/components/media-browser/image.css\",\n \"revision\": \"ae49f05922ab6be7e09a8bebf1f32f00\"\n },\n {\n \"url\": \"lib/1.1/components/media-browser/image.html\",\n \"revision\": \"87a9be2b82f0388a7d3aaa16c2003422\"\n },\n {\n \"url\": \"lib/1.1/components/media-browser/image.js\",\n \"revision\": \"4aeeac0bd702d717fceb59f1abcd924e\"\n },\n {\n \"url\": \"lib/1.1/components/media-browser/video-yt.css\",\n \"revision\": \"594d8771c9b011eaebcd957daf74d17e\"\n },\n {\n \"url\": \"lib/1.1/components/media-browser/video-yt.html\",\n \"revision\": \"a85ff95f97a31b1d890dfc55a2b91538\"\n },\n {\n \"url\": \"lib/1.1/components/media-browser/video-yt.js\",\n \"revision\": \"87ae9156a9dec2427ffbe5439e5c3f4f\"\n },\n {\n \"url\": \"lib/1.1/components/media-browser/video.css\",\n \"revision\": \"c62d91469a6c8d17aad13581469f7d1c\"\n },\n {\n \"url\": \"lib/1.1/components/media-browser/video.html\",\n \"revision\": \"4128300adb3a2e6cd8d68bba9ffb00ee\"\n },\n {\n \"url\": \"lib/1.1/components/media-browser/video.js\",\n \"revision\": \"eb337fc0d0adb6840d077de7888a8f8c\"\n },\n {\n \"url\": \"lib/1.1/components/menu-overlay.css\",\n \"revision\": \"736446a0ce463ad6664c5f8066376189\"\n },\n {\n \"url\": \"lib/1.1/components/menu-overlay.html\",\n \"revision\": \"220c3005881852f0387e61ea8ac2a6c5\"\n },\n {\n \"url\": \"lib/1.1/components/menu-overlay.js\",\n \"revision\": \"15dc6cd532c7c4af1ee4f525c2f3aff2\"\n },\n {\n \"url\": \"lib/1.1/controllers/drawer-layout.js\",\n \"revision\": \"efd643eb309cafec496b8f5b60dacf4a\"\n },\n {\n \"url\": \"lib/1.1/controllers/gesture-helper.js\",\n \"revision\": \"1776574c57c1a6115edfbcb3887ed147\"\n },\n {\n \"url\": \"lib/1.1/controllers/header-auto-hide.js\",\n \"revision\": \"dfafe8a0780d7759b16afa63673cbecb\"\n },\n {\n \"url\": \"lib/1.1/controllers/list-view.js\",\n \"revision\": \"fc2930407b29c707ab8bfca33685e9be\"\n },\n {\n \"url\": \"lib/1.1/controllers/mdl-button.js\",\n \"revision\": \"c2a4ac575ee439b1e19beb42ea7d016f\"\n },\n {\n \"url\": \"lib/1.1/controllers/mdl-checkbox.js\",\n \"revision\": \"20911a2c2aec81f9ab42615987b21364\"\n },\n {\n \"url\": \"lib/1.1/controllers/mdl-menu.js\",\n \"revision\": \"8f620c9a13b8c47720b24b46205fc906\"\n },\n {\n \"url\": \"lib/1.1/controllers/scroll-helper.js\",\n \"revision\": \"d35210ea8c416fdad067aedad98c9063\"\n },\n {\n \"url\": \"lib/1.1/controllers/view-pager.js\",\n \"revision\": \"d7e48fa1226efe9fb2e1a53730203d82\"\n },\n {\n \"url\": \"lib/1.1/templates/mdl-card-image.css\",\n \"revision\": \"394c8f6d4efb3ac8546f2199579d50fc\"\n },\n {\n \"url\": \"lib/1.1/templates/mdl-card-image.html\",\n \"revision\": \"7983de36c031e5049e7cfe024bb56be3\"\n },\n {\n \"url\": \"lib/1.1/templates/mdl-card-square.css\",\n \"revision\": \"0cd25031cce1ceb63fb6660f9249ebe3\"\n },\n {\n \"url\": \"lib/1.1/templates/mdl-card-square.html\",\n \"revision\": \"6a0884fea45748a54e0d6c4936f145c9\"\n },\n {\n \"url\": \"lib/1.1/templates/mdl-card.css\",\n \"revision\": \"d8c8685be5e6fc793835eddec3acd241\"\n },\n {\n \"url\": \"lib/1.1/templates/mdl-card.html\",\n \"revision\": \"8f4162c548d4eb34d2e592c499f31aa0\"\n },\n {\n \"url\": \"manifest.json\",\n \"revision\": \"29978efcaebfab6fbd65116d50cd99c2\"\n },\n {\n \"url\": \"search-index.json\",\n \"revision\": \"efe54bded18adf2d329642fafad07368\"\n },\n {\n \"url\": \"search-list.json\",\n \"revision\": \"5b11a8ced2c52f091ecd735afd4b6823\"\n },\n {\n \"url\": \"search/index.bundle.ext.js\",\n \"revision\": \"ca96760d9f29fbbf9029e116cc749b2d\"\n },\n {\n \"url\": \"search/index.bundle.js\",\n \"revision\": \"d07424b2af8b45079fab844335ef956b\"\n },\n {\n \"url\": \"search/index.html\",\n \"revision\": \"ff4d6aa4c260084ffc58cd52ed275b01\"\n },\n {\n \"url\": \"content/docs/page-options/images/side_drawer_section.png\",\n \"revision\": \"16d006e9b73a2fb01f6c873002d1c600\"\n },\n {\n \"url\": \"content/docs/page-options/images/side_drawer.png\",\n \"revision\": \"24f12235166597471ae367978a75987f\"\n },\n {\n \"url\": \"images/github-mark.png\",\n \"revision\": \"add1026fb07009c6879400cbcf145301\"\n },\n {\n \"url\": \"images/icons/desktop/android-chrome-192x192.png\",\n \"revision\": \"93d5e77e9ee1e9c6975f3c0bd1a21574\"\n },\n {\n \"url\": \"images/icons/desktop/android-chrome-512x512.png\",\n \"revision\": \"6df83c6c13be17a2ea70d29e340c5ddb\"\n },\n {\n \"url\": \"images/icons/desktop/apple-touch-icon.png\",\n \"revision\": \"2b78ed332644d19d9779c069c5842538\"\n },\n {\n \"url\": \"images/icons/desktop/favicon-16x16.png\",\n \"revision\": \"6c047cdbd3d5c4c962a3a692a5025d27\"\n },\n {\n \"url\": \"images/icons/desktop/favicon-32x32.png\",\n \"revision\": \"7413528d5e59c22af1ccf38187bc950b\"\n },\n {\n \"url\": \"images/icons/desktop/mstile-150x150.png\",\n \"revision\": \"540caa78f56655281b2d4b17ad52f2ce\"\n },\n {\n \"url\": \"images/icons/desktop/safari-pinned-tab.svg\",\n \"revision\": \"a0ab2c612c6a5019b3e4ae7c38043b98\"\n },\n {\n \"url\": \"images/icons/icon-128x128.png\",\n \"revision\": \"69f3f1f3f956bb71f35ce66b7717e1a0\"\n },\n {\n \"url\": \"images/icons/icon-144x144.png\",\n \"revision\": \"45e24db8671c41ca95c440df0cadf2a3\"\n },\n {\n \"url\": \"images/icons/icon-152x152.png\",\n \"revision\": \"e0867fd6e9bc25afd831b1eabdd83f8d\"\n },\n {\n \"url\": \"images/icons/icon-192x192.png\",\n \"revision\": \"cf383c3d4500d31884326cc9d53a8c3a\"\n },\n {\n \"url\": \"images/icons/icon-384x384.png\",\n \"revision\": \"31fd304cf6c5ff72928b7a91fbd68343\"\n },\n {\n \"url\": \"images/icons/icon-512x512.png\",\n \"revision\": \"47d9af0508ab29138dcb8ca6a4664cf2\"\n },\n {\n \"url\": \"images/icons/icon-72x72.png\",\n \"revision\": \"919cb6b3e8a1b5d0c963921dba0e4388\"\n },\n {\n \"url\": \"images/icons/icon-96x96.png\",\n \"revision\": \"5547ad1a33334c0f5c04f6de1f6d2c52\"\n },\n {\n \"url\": \"images/lighthouse.png\",\n \"revision\": \"79aa0c430e8ee960cbe654bbc0718631\"\n },\n {\n \"url\": \"images/page-speed-insight-icon.png\",\n \"revision\": \"8806237a2557fb748e7eaae4158899fb\"\n },\n {\n \"url\": \"images/patreon.png\",\n \"revision\": \"138534b06fe107c864e576d63273cf75\"\n },\n {\n \"url\": \"images/profile-icon.png\",\n \"revision\": \"b4e6fa3d09388123298958c47aeb13ca\"\n },\n {\n \"url\": \"images/rss-feed.png\",\n \"revision\": \"fa5663a3878814bb9820de6b29005169\"\n },\n {\n \"url\": \"images/zuix-logo.svg\",\n \"revision\": \"48e6defd57440a6d0f0d12241ff9d6c5\"\n }\n], {});\n\n\n\n\nworkbox_routing_registerRoute(/\\.(?:png|jpg|jpeg|svg)$/, new workbox_strategies_CacheFirst({ \"cacheName\":\"images\", plugins: [new workbox_expiration_ExpirationPlugin({ maxEntries: 50 })] }), 'GET');\nworkbox_routing_registerRoute(/\\.(?:html|json|js|css)$/, new workbox_strategies_CacheFirst({ \"cacheName\":\"default\", plugins: [new workbox_expiration_ExpirationPlugin({ maxEntries: 50 })] }), 'GET');\n\n\n\n\n"],"names":["self","addEventListener","event","data","type","skipWaiting","workbox_precaching_precacheAndRoute","url","revision","workbox_routing_registerRoute","workbox_strategies_CacheFirst","cacheName","plugins","workbox_expiration_ExpirationPlugin","maxEntries"],"mappings":"0nBAsBAA,KAAKC,iBAAiB,WAAYC,IAC5BA,EAAMC,MAA4B,iBAApBD,EAAMC,KAAKC,MAC3BJ,KAAKK,iBAYTC,EAAAA,iBAAoC,CAClC,CACEC,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,2BACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,2CACPC,SAAY,oCAEd,CACED,IAAO,4CACPC,SAAY,oCAEd,CACED,IAAO,0CACPC,SAAY,oCAEd,CACED,IAAO,mDACPC,SAAY,oCAEd,CACED,IAAO,oDACPC,SAAY,oCAEd,CACED,IAAO,kDACPC,SAAY,oCAEd,CACED,IAAO,8CACPC,SAAY,oCAEd,CACED,IAAO,+CACPC,SAAY,oCAEd,CACED,IAAO,6CACPC,SAAY,oCAEd,CACED,IAAO,YACPC,SAAY,oCAEd,CACED,IAAO,8BACPC,SAAY,oCAEd,CACED,IAAO,mCACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,wDACPC,SAAY,oCAEd,CACED,IAAO,oDACPC,SAAY,oCAEd,CACED,IAAO,+CACPC,SAAY,oCAEd,CACED,IAAO,gDACPC,SAAY,oCAEd,CACED,IAAO,4CACPC,SAAY,oCAEd,CACED,IAAO,uCACPC,SAAY,oCAEd,CACED,IAAO,wDACPC,SAAY,oCAEd,CACED,IAAO,oDACPC,SAAY,oCAEd,CACED,IAAO,+CACPC,SAAY,oCAEd,CACED,IAAO,sBACPC,SAAY,oCAEd,CACED,IAAO,oCACPC,SAAY,oCAEd,CACED,IAAO,wCACPC,SAAY,oCAEd,CACED,IAAO,gBACPC,SAAY,oCAEd,CACED,IAAO,2BACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,kBACPC,SAAY,oCAEd,CACED,IAAO,sBACPC,SAAY,oCAEd,CACED,IAAO,aACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,4BACPC,SAAY,oCAEd,CACED,IAAO,gCACPC,SAAY,oCAEd,CACED,IAAO,wBACPC,SAAY,oCAEd,CACED,IAAO,4BACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,sBACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,kBACPC,SAAY,oCAEd,CACED,IAAO,sBACPC,SAAY,oCAEd,CACED,IAAO,6CACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,8BACPC,SAAY,oCAEd,CACED,IAAO,iCACPC,SAAY,oCAEd,CACED,IAAO,qCACPC,SAAY,oCAEd,CACED,IAAO,kBACPC,SAAY,oCAEd,CACED,IAAO,sBACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,sCACPC,SAAY,oCAEd,CACED,IAAO,uCACPC,SAAY,oCAEd,CACED,IAAO,qCACPC,SAAY,oCAEd,CACED,IAAO,wCACPC,SAAY,oCAEd,CACED,IAAO,yCACPC,SAAY,oCAEd,CACED,IAAO,uCACPC,SAAY,oCAEd,CACED,IAAO,uCACPC,SAAY,oCAEd,CACED,IAAO,wCACPC,SAAY,oCAEd,CACED,IAAO,sCACPC,SAAY,oCAEd,CACED,IAAO,+CACPC,SAAY,oCAEd,CACED,IAAO,gDACPC,SAAY,oCAEd,CACED,IAAO,6CACPC,SAAY,oCAEd,CACED,IAAO,8CACPC,SAAY,oCAEd,CACED,IAAO,4CACPC,SAAY,oCAEd,CACED,IAAO,gDACPC,SAAY,oCAEd,CACED,IAAO,iDACPC,SAAY,oCAEd,CACED,IAAO,+CACPC,SAAY,oCAEd,CACED,IAAO,6CACPC,SAAY,oCAEd,CACED,IAAO,8CACPC,SAAY,oCAEd,CACED,IAAO,4CACPC,SAAY,oCAEd,CACED,IAAO,sCACPC,SAAY,oCAEd,CACED,IAAO,uCACPC,SAAY,oCAEd,CACED,IAAO,qCACPC,SAAY,oCAEd,CACED,IAAO,uCACPC,SAAY,oCAEd,CACED,IAAO,wCACPC,SAAY,oCAEd,CACED,IAAO,0CACPC,SAAY,oCAEd,CACED,IAAO,mCACPC,SAAY,oCAEd,CACED,IAAO,oCACPC,SAAY,oCAEd,CACED,IAAO,sCACPC,SAAY,oCAEd,CACED,IAAO,kCACPC,SAAY,oCAEd,CACED,IAAO,uCACPC,SAAY,oCAEd,CACED,IAAO,oCACPC,SAAY,oCAEd,CACED,IAAO,uCACPC,SAAY,oCAEd,CACED,IAAO,wCACPC,SAAY,oCAEd,CACED,IAAO,wCACPC,SAAY,oCAEd,CACED,IAAO,yCACPC,SAAY,oCAEd,CACED,IAAO,iCACPC,SAAY,oCAEd,CACED,IAAO,kCACPC,SAAY,oCAEd,CACED,IAAO,gBACPC,SAAY,oCAEd,CACED,IAAO,oBACPC,SAAY,oCAEd,CACED,IAAO,mBACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,oBACPC,SAAY,oCAEd,CACED,IAAO,2DACPC,SAAY,oCAEd,CACED,IAAO,mDACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,kDACPC,SAAY,oCAEd,CACED,IAAO,kDACPC,SAAY,oCAEd,CACED,IAAO,4CACPC,SAAY,oCAEd,CACED,IAAO,yCACPC,SAAY,oCAEd,CACED,IAAO,yCACPC,SAAY,oCAEd,CACED,IAAO,0CACPC,SAAY,oCAEd,CACED,IAAO,6CACPC,SAAY,oCAEd,CACED,IAAO,gCACPC,SAAY,oCAEd,CACED,IAAO,gCACPC,SAAY,oCAEd,CACED,IAAO,gCACPC,SAAY,oCAEd,CACED,IAAO,gCACPC,SAAY,oCAEd,CACED,IAAO,gCACPC,SAAY,oCAEd,CACED,IAAO,gCACPC,SAAY,oCAEd,CACED,IAAO,8BACPC,SAAY,oCAEd,CACED,IAAO,8BACPC,SAAY,oCAEd,CACED,IAAO,wBACPC,SAAY,oCAEd,CACED,IAAO,qCACPC,SAAY,oCAEd,CACED,IAAO,qBACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,sBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,qCAEb,IAKHC,EAAAA,cAA8B,0BAA2B,IAAIC,aAA8B,CAAEC,UAAY,SAAUC,QAAS,CAAC,IAAIC,mBAAoC,CAAEC,WAAY,QAAW,OAC9LL,EAAAA,cAA8B,0BAA2B,IAAIC,aAA8B,CAAEC,UAAY,UAAWC,QAAS,CAAC,IAAIC,mBAAoC,CAAEC,WAAY,QAAW"} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 7a8c24a..a53ad76 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "animate.css": "^4.1.1", "flex-layout-attribute": "^1.0.3", "fuse.js": "^6.6.2", - "zuix-dist": "^1.1.6" + "zuix-dist": "^1.1.7" }, "devDependencies": { "@11ty/eleventy": "^2.0.0-canary.11", @@ -8868,9 +8868,9 @@ } }, "node_modules/zuix-dist": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/zuix-dist/-/zuix-dist-1.1.6.tgz", - "integrity": "sha512-hP28a7iCb2soNCygSvGUEFLoAqT7aMYb6GwVGE2S5IbcsOOP1BgP7VslvPGhMQLOhTmYZwfBj9aGZSS1ETGgsw==" + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/zuix-dist/-/zuix-dist-1.1.7.tgz", + "integrity": "sha512-B0hCKA9ORqpb8yEn5nlRJUdtgJ0Krsp/6ZWtEGcjQa+IcD5u459+WLPAIzMxLP5XSHCMbHES/aQUH+/43U8Gqw==" }, "node_modules/zuix/node_modules/commander": { "version": "9.0.0", @@ -15598,9 +15598,9 @@ } }, "zuix-dist": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/zuix-dist/-/zuix-dist-1.1.6.tgz", - "integrity": "sha512-hP28a7iCb2soNCygSvGUEFLoAqT7aMYb6GwVGE2S5IbcsOOP1BgP7VslvPGhMQLOhTmYZwfBj9aGZSS1ETGgsw==" + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/zuix-dist/-/zuix-dist-1.1.7.tgz", + "integrity": "sha512-B0hCKA9ORqpb8yEn5nlRJUdtgJ0Krsp/6ZWtEGcjQa+IcD5u459+WLPAIzMxLP5XSHCMbHES/aQUH+/43U8Gqw==" } } } diff --git a/package.json b/package.json index 715fba3..1421589 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "animate.css": "^4.1.1", "flex-layout-attribute": "^1.0.3", "fuse.js": "^6.6.2", - "zuix-dist": "^1.1.6" + "zuix-dist": "^1.1.7" }, "devDependencies": { "@11ty/eleventy": "^2.0.0-canary.11", diff --git a/source/_inc/layouts/side_drawer/style.css b/source/_inc/layouts/side_drawer/style.css index 09b247a..624504f 100644 --- a/source/_inc/layouts/side_drawer/style.css +++ b/source/_inc/layouts/side_drawer/style.css @@ -246,6 +246,6 @@ height: 256px; } [z-include][z-ready=true].visible-on-ready, [z-load][z-ready=true].visible-on-ready { - transition: opacity 50ms ease-in-out; + transition: opacity 150ms ease-in-out; } {% include 'layouts/side_drawer/drawer.css' %}