zk.copy(zk,function(){var d={zk:!0},i=[],u=[],l=[],c=[],h={},o={},n={},s={},p=[],a=zk.copy({"zul.lang":!0},d);function f(t){a[t]=!0,i.push(t),1==g()&&zk.disableESC()}function k(t,e){for(var n;n=t.shift();){if(g()||e&&u.length)return void t.unshift(n);n()}}function g(){return zk.loading=i.length}return{setLoaded:_zkf=function(t,e){if(i.$remove(t),a[t]=!0,e)d[t]||u.push(t);else{u.$remove(t),d[t]=!0;e=h[t];e&&(delete h[t],l.$addAll(e));var n,r=o[t];if(r){delete o[t];for(;n=r.unshift();)zk.load(n)}}if(!g()){try{zk.enableESC()}catch(t){zk.debugLog(t.message||t)}k(l),k(c,1)}},setScriptLoaded:_zkf,isLoaded:function(t,e){return e&&a[t]||d[t]},load:function(t,e,n){if("function"==typeof e){if(n)throw"At most one function allowed";n=e,e=null}var r;n&&zk.afterLoad(t,n,!0);for(var i=t.split(","),o=i.length;o--;)t=i[o].trim(),zk._load(t,e)||(r=!0);return!r},_load:function(t,e){if(!t||a[t])return!zk.loading&&!u.length;f(t);var n=document.createElement("script"),r=t+".wpd",i=zk.getHost(t,!0);return n.type="text/javascript",n.charset="UTF-8","/"!=r.charAt(0)&&(r="/"+r),r=i?i+"/web/js"+r:zk.ajaxResourceURI("/js"+r,zk.getVersion(t),{desktop:e}),n.src=r,null!==(r=jq.head())&&void 0!==r&&r.appendChild(n),!1},loadScript:function(t,e,n,r){if(e){if(!r&&zk.isLoaded(e,!0))return;f(e)}e=document.createElement("script");return e.type="text/javascript",e.charset=n||"UTF-8",e.src=t,null!==(t=jq.head())&&void 0!==t&&t.appendChild(e),this},loadCSS:function(t,e,n){var r=document.createElement("link");return e&&(r.id=e),r.rel="stylesheet",r.type="text/css",r.href=t,n&&(r.media=n),null!==(n=jq.head())&&void 0!==n&&n.appendChild(r),this},getVersion:function(t){for(var e;t;t=t.substring(0,t.lastIndexOf(".")))if(e=n[t])return e},setVersion:function(t,e){n[t]=e},depends:function(t,e){t&&e&&(d[t]?zk.load(e):o[t]?o[t].push(e):o[t]=[e])},afterLoad:function(t,e,n){if("string"==typeof t){if(!e)return!0;for(var r=t.split(","),i=r.length;i--;){var o=r[i].trim();if(o&&!d[o]){for(;i--;){var a=r[i].trim();if(a&&!d[a]){var f=t,s=e;e=function(){zk.afterLoad(f,s,n)};break}}return h[o]?h[o].push(e):h[o]=[e],!1}}t=e}if(t)return zk.loading||u.length?((n?l:c).push(t),!1):(t(),!0)},getHost:function(t,e){for(var n in s)if(t.startsWith(n))return s[n][e?1:0];return p[e?1:0]},setHost:function(t,e,n){var r=t+e;if(!p.length)for(var i=document.getElementsByTagName("script"),o=0,a=i.length;o<a;++o){var f=i[o].src;if(f){if(f.startsWith(t)){p=[t,r];break}if(0<=f.indexOf("/zk.wpd"))break}}for(o=0;o<n.length;++o)s[n[o]]=[t,r]}}}());