diff --git a/module/ai/config.php b/module/ai/config.php index 9aceb09429..c1c101a182 100644 --- a/module/ai/config.php +++ b/module/ai/config.php @@ -124,7 +124,7 @@ $config->ai->targetForm['productplan']['create'] = (object)array('m' => // $config->ai->targetForm['project']['issue/create'] = (object)array('m' => 'issue', 'f' => 'create'); // $config->ai->targetForm['project']['doc/create'] = (object)array('m' => 'doc', 'f' => 'create'); $config->ai->targetForm['project']['programplan/create'] = (object)array('m' => 'programplan', 'f' => 'create', 'for' => 'project'); -$config->ai->targetForm['execution']['batchcreatetask'] = (object)array('m' => 'task', 'f' => 'batchcreate'); +$config->ai->targetForm['execution']['batchcreatetask'] = (object)array('m' => 'task', 'f' => 'batchcreate', 'for' => 'execution'); // $config->ai->targetForm['execution']['createtestreport'] = (object)array('m' => 'execution', 'f' => 'testreport'); // $config->ai->targetForm['execution']['createqa'] = (object)array('m' => 'execution', 'f' => 'createQA'); // $config->ai->targetForm['execution']['createrisk'] = (object)array('m' => 'execution', 'f' => 'createRisk'); @@ -210,7 +210,7 @@ $config->ai->menuPrint->locations['execution']['storyView'] = $config->ai->men $config->ai->menuPrint->locations['execution']['view'] = (object)array( // TODO: fix this. 'module' => 'execution', 'injectMethod' => 'prepend', - 'targetContainer' => '#mainContent.main-row > .col-4.side-col .detail:first-child > .detail-title', + 'targetContainer' => '#mainContent .ai-menu-box', 'class' => 'pull-right' ); @@ -222,14 +222,14 @@ $config->ai->menuPrint->locations['project']['view']->module = 'project'; $config->ai->menuPrint->locations['product']['view'] = (object)array( // TODO: fix this. 'module' => 'product', 'injectMethod' => 'append', - 'targetContainer' => '#mainContent.main-row > .col-8.main-col .detail:first-child > .detail-title', + 'targetContainer' => '#mainContent .ai-menu-box', 'class' => 'pull-right' ); $config->ai->menuPrint->locations['productplan']['view'] = (object)array( 'module' => 'productplan', 'injectMethod' => 'prepend', - 'targetContainer' => '#mainContent .toolbar', + 'targetContainer' => '#mainContent .tab-actions', 'objectVarName' => 'plan' ); $config->ai->menuPrint->locations['projectplan']['view'] = $config->ai->menuPrint->locations['productplan']['view']; diff --git a/module/ai/ui/promptmenu.html.php b/module/ai/ui/promptmenu.html.php index 2635655942..3a84ab60d8 100644 --- a/module/ai/ui/promptmenu.html.php +++ b/module/ai/ui/promptmenu.html.php @@ -98,7 +98,9 @@ $promptMenuInject = function() container.classList.remove('no-delay'); } JAVASCRIPT; - $script .= "$(`$menuOptions->targetContainer`).first()." . (!empty($menuOptions->injectMethod) ? $menuOptions->injectMethod : 'append') . "(`$html`).css('z-index', 2);\n"; + $script .= 'let $aiMenu = $("' . $menuOptions->targetContainer . '").first();'; + $script .= 'if(!$aiMenu.length) $aiMenu = $("#mainContent .ai-menu-box").empty();'; + $script .= '$aiMenu.' . (!empty($menuOptions->injectMethod) ? $menuOptions->injectMethod : 'append') . "(`$html`).css('z-index', 2);\n"; $script .= <<< JAVASCRIPT $('[data-toggle="popover"]').popover({template: '

'}); JAVASCRIPT; diff --git a/module/execution/ui/view.html.php b/module/execution/ui/view.html.php index 16b05612fa..841c0d56f5 100644 --- a/module/execution/ui/view.html.php +++ b/module/execution/ui/view.html.php @@ -268,7 +268,8 @@ div set('data-class-name', 'text-gray border border-light'), setClass('ml-2 mt-2 text-gray') ) - ) + ), + div(setClass('ai-menu-box flex-auto')) ), div ( diff --git a/module/product/ui/view.html.php b/module/product/ui/view.html.php index 4894fd377c..4ff181e55c 100644 --- a/module/product/ui/view.html.php +++ b/module/product/ui/view.html.php @@ -160,9 +160,9 @@ div setClass($product->status == 'normal' ? 'text-success' : 'text-gray'), $this->processStatus('product', $product) ), - span + div ( - setClass('ml-2 flex-none'), + setClass('ml-2 flex-none row items-center gap-2'), $lang->product->abbr->aclList[$product->acl], icon ( @@ -171,9 +171,10 @@ div set('data-placement', 'right'), set('data-type', 'white'), set('data-class-name', 'text-gray border border-light'), - setClass('ml-2 mt-2 text-gray') + setClass('text-gray') ) - ) + ), + div(setClass('ai-menu-box flex-auto')) ), div ( diff --git a/module/project/ui/view.html.php b/module/project/ui/view.html.php index fb85352dd7..adb569c069 100644 --- a/module/project/ui/view.html.php +++ b/module/project/ui/view.html.php @@ -272,7 +272,8 @@ row setClass('ghost form-label-hint text-gray-300 ml-2'), toggle::tooltip(array('title' => $lang->project->subAclList[$project->acl], 'className' => 'text-gray border border-gray-300', 'type' => 'white', 'placement' => 'right')) ) - ) + ), + div(setClass('ai-menu-box flex-auto')) ), div ( diff --git a/www/js/zui3/ai.js b/www/js/zui3/ai.js index 5303e1ba0e..c811f4792e 100644 --- a/www/js/zui3/ai.js +++ b/www/js/zui3/ai.js @@ -20,9 +20,11 @@ window.openPageForm = function(url, data, callback) { return new Promise((resolve, reject) => { const openedApp = $.apps.openApp(url); - const handlePageLoad = () => + let updateTimer = 0; + const tryUpdateForm = () => { - setTimeout(() => + if(updateTimer) clearTimeout(updateTimer); + updateTimer = setTimeout(() => { try { @@ -36,8 +38,8 @@ window.openPageForm = function(url, data, callback) } catch (error) {reject(error)} }, 2000); }; - openedApp.$app.one('updateapp.apps updatepage.app', handlePageLoad); - setTimeout(() => openedApp.$app.off('updateapp.apps', handlePageLoad), 5000); + openedApp.$app.one('updateapp.apps updatepage.app', tryUpdateForm); + setTimeout(() => openedApp.$app.off('updateapp.apps', tryUpdateForm), 5000); }); } @@ -80,6 +82,7 @@ window.executeZentaoPrompt = async function(info, auto) } }, fn: (response) => { + console.log('> executeZentaoPrompt', info.name, {info, response}); const result = response.data; const targetForm = info.targetForm; if(!targetForm) return {result: result}; diff --git a/www/js/zui3/zui.zentao.js b/www/js/zui3/zui.zentao.js index 48c14d71fe..73d7c04773 100644 --- a/www/js/zui3/zui.zentao.js +++ b/www/js/zui3/zui.zentao.js @@ -1,7 +1,7 @@ var df=(M,ut,Ut)=>{if(!ut.has(M))throw TypeError("Cannot "+Ut)};var Ht=(M,ut,Ut)=>(df(M,ut,"read from private field"),Ut?Ut.call(M):ut.get(M)),nn=(M,ut,Ut)=>{if(ut.has(M))throw TypeError("Cannot add the same private member more than once");ut instanceof WeakSet?ut.add(M):ut.set(M,Ut)},cn=(M,ut,Ut,yc)=>(df(M,ut,"write to private field"),yc?yc.call(M,Ut):ut.set(M,Ut),Ut);var uf=(M,ut,Ut)=>(df(M,ut,"access private method"),Ut);(function(M,ut){typeof exports=="object"&&typeof module<"u"?ut(exports):typeof define=="function"&&define.amd?define(["exports"],ut):(M=typeof globalThis<"u"?globalThis:M||self,ut(M.zui={}))})(this,function(M){var Bl,Hl,lo,co,ho,uo,fo,po,Ul,v_,Vl,__,xs,Ss,Nv,Ev;"use strict";const ut="",Ut="",yc="",SS="",TS="",$S="",DS="",IS="",MS="",NS="",ES="",AS="",vc="3.0.0",D_="production",bf="f3c40ecb03e5cd2c88a31cc9380c7d53ceeda037",jn=document,Mo=window,wf=jn.documentElement,As=jn.createElement.bind(jn),Cf=As("div"),_c=As("table"),I_=As("tbody"),kf=As("tr"),{isArray:No,prototype:xf}=Array,{concat:M_,filter:bc,indexOf:Sf,map:Tf,push:N_,slice:$f,some:wc,splice:E_}=xf,A_=/^#(?:[\w-]|\\.|[^\x00-\xa0])*$/,P_=/^\.(?:[\w-]|\\.|[^\x00-\xa0])*$/,L_=/<.+>/,R_=/^\w+$/;function Cc(i,e){const t=z_(e);return!i||!t&&!Ps(e)&&!gt(e)?[]:!t&&P_.test(i)?e.getElementsByClassName(i.slice(1).replace(/\\/g,"")):!t&&R_.test(i)?e.getElementsByTagName(i):e.querySelectorAll(i)}class Eo{constructor(e,t){if(!e)return;if(kc(e))return e;let n=e;if(At(e)){const s=t||jn;if(n=A_.test(e)&&Ps(s)?s.getElementById(e.slice(1).replace(/\\/g,"")):L_.test(e)?Af(e):kc(s)?s.find(e):At(s)?y(s).find(e):Cc(e,s),!n)return}else if(Ls(e))return this.ready(e);(n.nodeType||n===Mo)&&(n=[n]),this.length=n.length;for(let s=0,r=this.length;s{for(;e.firstChild;)e.removeChild(e.firstChild)})};function Ao(...i){const e=O_(i[0])?i.shift():!1,t=i.shift(),n=i.length;if(!t)return{};if(!n)return Ao(e,y,t);for(let s=0;s{gt(r)&&Ct(t,(o,a)=>{n?e?r.classList.add(a):r.classList.remove(a):r.classList.toggle(a)})})},ae.addClass=function(i){return this.toggleClass(i,!0)},ae.removeAttr=function(i){const e=Po(i);return this.each((t,n)=>{gt(n)&&Ct(e,(s,r)=>{n.removeAttribute(r)})})};function B_(i,e){if(i){if(At(i)){if(arguments.length<2){if(!this[0]||!gt(this[0]))return;const t=this[0].getAttribute(i);return rr(t)?void 0:t}return Vt(e)?this:rr(e)?this.removeAttr(i):this.each((t,n)=>{gt(n)&&n.setAttribute(i,e)})}for(const t in i)this.attr(t,i[t]);return this}}ae.attr=B_,ae.removeClass=function(i){return arguments.length?this.toggleClass(i,!1):this.attr("class","")},ae.hasClass=function(i){return!!i&&wc.call(this,e=>gt(e)&&e.classList.contains(i))},ae.get=function(i){return Vt(i)?$f.call(this):(i=Number(i),this[i<0?i+this.length:i])},ae.eq=function(i){return y(this.get(i))},ae.first=function(){return this.eq(0)},ae.last=function(){return this.eq(-1)};function H_(i){return Vt(i)?this.get().map(e=>gt(e)||F_(e)?e.textContent:"").join(""):this.each((e,t)=>{gt(t)&&(t.textContent=i)})}ae.text=H_;function Bn(i,e,t){if(!gt(i))return;const n=Mo.getComputedStyle(i,null);return t?n.getPropertyValue(e)||void 0:n[e]||i.style[e]}function xn(i,e){return parseInt(Bn(i,e),10)||0}function If(i,e){return xn(i,`border${e?"Left":"Top"}Width`)+xn(i,`padding${e?"Left":"Top"}`)+xn(i,`padding${e?"Right":"Bottom"}`)+xn(i,`border${e?"Right":"Bottom"}Width`)}const Sc={};function U_(i){if(Sc[i])return Sc[i];const e=As(i);jn.body.insertBefore(e,null);const t=Bn(e,"display");return jn.body.removeChild(e),Sc[i]=t!=="none"?t:"block"}function Mf(i){return Bn(i,"display")==="none"}function Nf(i,e){const t=i&&(i.matches||i.webkitMatchesSelector||i.msMatchesSelector);return!!t&&!!e&&t.call(i,e)}function Lo(i){return At(i)?(e,t)=>Nf(t,i):Ls(i)?i:kc(i)?(e,t)=>i.is(t):i?(e,t)=>t===i:()=>!1}ae.filter=function(i){const e=Lo(i);return y(bc.call(this,(t,n)=>e.call(t,n,t)))};function ts(i,e){return e?i.filter(e):i}ae.detach=function(i){return ts(this,i).each((e,t)=>{t.parentNode&&t.parentNode.removeChild(t)}),this};const V_=/^\s*<(\w+)[^>]*>/,W_=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,Ef={"*":Cf,tr:I_,td:kf,th:kf,thead:_c,tbody:_c,tfoot:_c};function Af(i){if(!At(i))return[];if(W_.test(i))return[As(RegExp.$1)];const e=V_.test(i)&&RegExp.$1,t=Ef[e]||Ef["*"];return t.innerHTML=i,y(t.childNodes).detach().get()}y.parseHTML=Af,ae.has=function(i){const e=At(i)?(t,n)=>Cc(i,n).length:(t,n)=>n.contains(i);return this.filter(e)},ae.not=function(i){const e=Lo(i);return this.filter((t,n)=>(!At(i)||gt(n))&&!e.call(n,t,n))};function Hn(i,e,t,n){const s=[],r=Ls(e),o=n&&Lo(n);for(let a=0,l=i.length;ae.selected&&!e.disabled&&!e.parentNode.disabled),"value"):i.value||""}function K_(i){return arguments.length?this.each((e,t)=>{const n=t.multiple&&t.options;if(n||Wf.test(t.type)){const s=No(i)?Tf.call(i,String):rr(i)?[]:[String(i)];n?Ct(t.options,(r,o)=>{o.selected=s.indexOf(o.value)>=0},!0):t.checked=s.indexOf(t.value)>=0}else t.value=Vt(i)||rr(i)?"":i}):this[0]&&Pf(this[0])}ae.val=K_,ae.is=function(i){const e=Lo(i);return wc.call(this,(t,n)=>e.call(t,n,t))},y.guid=1;function Sn(i){return i.length>1?bc.call(i,(e,t,n)=>Sf.call(n,e)===t):i}y.unique=Sn,ae.add=function(i,e){return y(Sn(this.get().concat(y(i,e).get())))},ae.children=function(i){return ts(y(Sn(Hn(this,e=>e.children))),i)},ae.parent=function(i){return ts(y(Sn(Hn(this,"parentNode"))),i)},ae.index=function(i){const e=i?y(i)[0]:this[0],t=i?this:y(e).parent().children();return Sf.call(t,e)},ae.closest=function(i){const e=this.filter(i);if(e.length)return e;const t=this.parent();return t.length?t.closest(i):e},ae.siblings=function(i){return ts(y(Sn(Hn(this,e=>y(e).parent().children().not(e)))),i)},ae.find=function(i){return y(Sn(Hn(this,e=>Cc(i,e))))};const q_=/^\s*\s*$/g,G_=/^$|^module$|\/(java|ecma)script/i,Z_=["type","src","nonce","noModule"];function Y_(i,e){const t=y(i);t.filter("script").add(t.find("script")).each((n,s)=>{if(G_.test(s.type)&&wf.contains(s)){const r=As("script");r.text=s.textContent.replace(q_,""),Ct(Z_,(o,a)=>{s[a]&&(r[a]=s[a])}),e.head.insertBefore(r,null),e.head.removeChild(r)}})}function J_(i,e,t,n,s){n?i.insertBefore(e,t?i.firstChild:null):i.nodeName==="HTML"?i.parentNode.replaceChild(e,i):i.parentNode.insertBefore(e,t?i:i.nextSibling),s&&Y_(e,i.ownerDocument)}function ns(i,e,t,n,s,r,o,a){return Ct(i,(l,c)=>{Ct(y(c),(h,d)=>{Ct(y(e),(f,m)=>{const _=t?d:m,w=t?m:d,C=t?h:f;J_(_,C?w.cloneNode(!0):w,n,s,!C)},a)},o)},r),e}ae.after=function(){return ns(arguments,this,!1,!1,!1,!0,!0)},ae.append=function(){return ns(arguments,this,!1,!1,!0)};function X_(i){if(!arguments.length)return this[0]&&this[0].innerHTML;if(Vt(i))return this;const e=/]/.test(i);return this.each((t,n)=>{gt(n)&&(e?y(n).empty().append(i):n.innerHTML=i)})}ae.html=X_,ae.appendTo=function(i){return ns(arguments,this,!0,!1,!0)},ae.wrapInner=function(i){return this.each((e,t)=>{const n=y(t),s=n.contents();s.length?s.wrapAll(i):n.append(i)})},ae.before=function(){return ns(arguments,this,!1,!0)},ae.wrapAll=function(i){let e=y(i),t=e[0];for(;t.children.length;)t=t.firstElementChild;return this.first().before(e),this.appendTo(t)},ae.wrap=function(i){return this.each((e,t)=>{const n=y(i)[0];y(t).wrapAll(e?n.cloneNode(!0):n)})},ae.insertAfter=function(i){return ns(arguments,this,!0,!1,!1,!1,!1,!0)},ae.insertBefore=function(i){return ns(arguments,this,!0,!0)},ae.prepend=function(){return ns(arguments,this,!1,!0,!0,!0,!0)},ae.prependTo=function(i){return ns(arguments,this,!0,!0,!0,!1,!1,!0)},ae.contents=function(){return y(Sn(Hn(this,i=>i.tagName==="IFRAME"?[i.contentDocument]:i.tagName==="TEMPLATE"?i.content.childNodes:i.childNodes)))},ae.next=function(i,e,t){return ts(y(Sn(Hn(this,"nextElementSibling",e,t))),i)},ae.nextAll=function(i){return this.next(i,!0)},ae.nextUntil=function(i,e){return this.next(e,!0,i)},ae.parents=function(i,e){return ts(y(Sn(Hn(this,"parentElement",!0,e))),i)},ae.parentsUntil=function(i,e){return this.parents(e,i)},ae.prev=function(i,e,t){return ts(y(Sn(Hn(this,"previousElementSibling",e,t))),i)},ae.prevAll=function(i){return this.prev(i,!0)},ae.prevUntil=function(i,e){return this.prev(e,!0,i)},ae.map=function(i){return y(M_.apply([],Tf.call(this,(e,t)=>i.call(e,t,e))))},ae.clone=function(){return this.map((i,e)=>e.cloneNode(!0))},ae.offsetParent=function(){return this.map((i,e)=>{let t=e.offsetParent;for(;t&&Bn(t,"position")==="static";)t=t.offsetParent;return t||wf})},ae.slice=function(i,e){return y($f.call(this,i,e))};const Q_=/-([a-z])/g;function Tc(i){return i.replace(Q_,(e,t)=>t.toUpperCase())}ae.ready=function(i){const e=()=>setTimeout(i,0,y);return jn.readyState!=="loading"?e():jn.addEventListener("DOMContentLoaded",e),this},ae.unwrap=function(){return this.parent().each((i,e)=>{if(e.tagName==="BODY")return;const t=y(e);t.replaceWith(t.children())}),this},ae.offset=function(){const i=this[0];if(!i)return;const e=i.getBoundingClientRect();return{top:e.top+Mo.pageYOffset,left:e.left+Mo.pageXOffset}},ae.position=function(){const i=this[0];if(!i)return;const e=Bn(i,"position")==="fixed",t=e?i.getBoundingClientRect():this.offset();if(!e){const n=i.ownerDocument;let s=i.offsetParent||n.documentElement;for(;(s===n.body||s===n.documentElement)&&Bn(s,"position")==="static";)s=s.parentNode;if(s!==i&>(s)){const r=y(s).offset();t.top-=r.top+xn(s,"borderTopWidth"),t.left-=r.left+xn(s,"borderLeftWidth")}}return{top:t.top-xn(i,"marginTop"),left:t.left-xn(i,"marginLeft")}};const Lf={class:"className",contenteditable:"contentEditable",for:"htmlFor",readonly:"readOnly",maxlength:"maxLength",tabindex:"tabIndex",colspan:"colSpan",rowspan:"rowSpan",usemap:"useMap"};ae.prop=function(i,e){if(i){if(At(i))return i=Lf[i]||i,arguments.length<2?this[0]&&this[0][i]:this.each((t,n)=>{n[i]=e});for(const t in i)this.prop(t,i[t]);return this}},ae.removeProp=function(i){return this.each((e,t)=>{delete t[Lf[i]||i]})};const eb=/^--/;function $c(i){return eb.test(i)}const Dc={},{style:tb}=Cf,nb=["webkit","moz","ms"];function sb(i,e=$c(i)){if(e)return i;if(!Dc[i]){const t=Tc(i),n=`${t[0].toUpperCase()}${t.slice(1)}`,s=`${t} ${nb.join(`${n} `)}${n}`.split(" ");Ct(s,(r,o)=>{if(o in tb)return Dc[i]=o,!1})}return Dc[i]}const ib={animationIterationCount:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0};function Rf(i,e,t=$c(i)){return!t&&!ib[i]&&Df(e)?`${e}px`:e}function rb(i,e){if(At(i)){const t=$c(i);return i=sb(i,t),arguments.length<2?this[0]&&Bn(this[0],i,t):i?(e=Rf(i,e,t),this.each((n,s)=>{gt(s)&&(t?s.style.setProperty(i,e):s.style[i]=e)})):this}for(const t in i)this.css(t,i[t]);return this}ae.css=rb;function zf(i,e){try{return i(e)}catch{return e}}const ob=/^\s+|\s+$/;function Ff(i,e){const t=i.dataset[e]||i.dataset[Tc(e)];return ob.test(t)?t:zf(JSON.parse,t)}function ab(i,e,t){t=zf(JSON.stringify,t),i.dataset[Tc(e)]=t}function lb(i,e){if(!i){if(!this[0])return;const t={};for(const n in this[0].dataset)t[n]=Ff(this[0],n);return t}if(At(i))return arguments.length<2?this[0]&&Ff(this[0],i):Vt(e)?this:this.each((t,n)=>{ab(n,i,e)});for(const t in i)this.data(t,i[t]);return this}ae.data=lb;function Of(i,e){const t=i.documentElement;return Math.max(i.body[`scroll${e}`],t[`scroll${e}`],i.body[`offset${e}`],t[`offset${e}`],t[`client${e}`])}Ct([!0,!1],(i,e)=>{Ct(["Width","Height"],(t,n)=>{const s=`${e?"outer":"inner"}${n}`;ae[s]=function(r){if(this[0])return mi(this[0])?e?this[0][`inner${n}`]:this[0].document.documentElement[`client${n}`]:Ps(this[0])?Of(this[0],n):this[0][`${e?"offset":"client"}${n}`]+(r&&e?xn(this[0],`margin${t?"Top":"Left"}`)+xn(this[0],`margin${t?"Bottom":"Right"}`):0)}})}),Ct(["Width","Height"],(i,e)=>{const t=e.toLowerCase();ae[t]=function(n){if(!this[0])return Vt(n)?void 0:this;if(!arguments.length)return mi(this[0])?this[0].document.documentElement[`client${e}`]:Ps(this[0])?Of(this[0],e):this[0].getBoundingClientRect()[t]-If(this[0],!i);const s=parseInt(n,10);return this.each((r,o)=>{if(!gt(o))return;const a=Bn(o,"boxSizing");o.style[t]=Rf(t,s+(a==="border-box"?If(o,!i):0))})}});const jf="___cd";ae.toggle=function(i){return this.each((e,t)=>{if(!gt(t))return;const n=Mf(t);(Vt(i)?n:i)?(t.style.display=t[jf]||"",Mf(t)&&(t.style.display=U_(t.tagName))):n||(t[jf]=Bn(t,"display"),t.style.display="none")})},ae.hide=function(){return this.toggle(!1)},ae.show=function(){return this.toggle(!0)};const Bf="___ce",Ic=".",Mc={focus:"focusin",blur:"focusout"},Hf={mouseenter:"mouseover",mouseleave:"mouseout"},cb=/^(mouse|pointer|contextmenu|drag|drop|click|dblclick)/i;function Nc(i){return Hf[i]||Mc[i]||i}function Ec(i){const e=i.split(Ic);return[e[0],e.slice(1).sort()]}ae.trigger=function(i,e){if(At(i)){const[n,s]=Ec(i),r=Nc(n);if(!r)return this;const o=cb.test(r)?"MouseEvents":"HTMLEvents";i=jn.createEvent(o),i.initEvent(r,!0,!0),i.namespace=s.join(Ic),i.___ot=n}i.___td=e;const t=i.___ot in Mc;return this.each((n,s)=>{t&&Ls(s[i.___ot])&&(s[`___i${i.type}`]=!0,s[i.___ot](),s[`___i${i.type}`]=!1),s.dispatchEvent(i)})};function Uf(i){return i[Bf]=i[Bf]||{}}function hb(i,e,t,n,s){const r=Uf(i);r[e]=r[e]||[],r[e].push([t,n,s]),i.addEventListener(e,s)}function Vf(i,e){return!e||!wc.call(e,t=>i.indexOf(t)<0)}function Ro(i,e,t,n,s){const r=Uf(i);if(e)r[e]&&(r[e]=r[e].filter(([o,a,l])=>{if(s&&l.guid!==s.guid||!Vf(o,t)||n&&n!==a)return!0;i.removeEventListener(e,l)}));else for(e in r)Ro(i,e,t,n,s)}ae.off=function(i,e,t){if(Vt(i))this.each((n,s)=>{!gt(s)&&!Ps(s)&&!mi(s)||Ro(s)});else if(At(i))Ls(e)&&(t=e,e=""),Ct(Po(i),(n,s)=>{const[r,o]=Ec(s),a=Nc(r);this.each((l,c)=>{!gt(c)&&!Ps(c)&&!mi(c)||Ro(c,a,o,e,t)})});else for(const n in i)this.off(n,i[n]);return this},ae.remove=function(i){return ts(this,i).detach().off(),this},ae.replaceWith=function(i){return this.before(i).remove()},ae.replaceAll=function(i){return y(i).replaceWith(this),this};function db(i,e,t,n,s){if(!At(i)){for(const r in i)this.on(r,e,t,i[r],s);return this}return At(e)||(Vt(e)||rr(e)?e="":Vt(t)?(t=e,e=""):(n=t,t=e,e="")),Ls(n)||(n=t,t=void 0),n?(Ct(Po(i),(r,o)=>{const[a,l]=Ec(o),c=Nc(a),h=a in Hf,d=a in Mc;c&&this.each((f,m)=>{if(!gt(m)&&!Ps(m)&&!mi(m))return;const _=function(w){if(w.target[`___i${w.type}`])return w.stopImmediatePropagation();if(w.namespace&&!Vf(l,w.namespace.split(Ic))||!e&&(d&&(w.target!==m||w.___ot===c)||h&&w.relatedTarget&&m.contains(w.relatedTarget)))return;let C=m;if(e){let T=w.target;for(;!Nf(T,e);)if(T===m||(T=T.parentNode,!T))return;C=T}Object.defineProperty(w,"currentTarget",{configurable:!0,get(){return C}}),Object.defineProperty(w,"delegateTarget",{configurable:!0,get(){return m}}),Object.defineProperty(w,"data",{configurable:!0,get(){return t}});const k=n.call(C,w,w.___td);s&&Ro(m,c,l,e,_),k===!1&&(w.preventDefault(),w.stopPropagation())};_.guid=n.guid=n.guid||y.guid++,hb(m,c,l,e,_)})}),this):this}ae.on=db;function ub(i,e,t,n){return this.on(i,e,t,n,!0)}ae.one=ub;const fb=/\r?\n/g;function pb(i,e){return`&${encodeURIComponent(i)}=${encodeURIComponent(e.replace(fb,`\r `))}`}const mb=/file|reset|submit|button|image/i,Wf=/radio|checkbox/i;ae.serialize=function(){let i="";return this.each((e,t)=>{Ct(t.elements||[t],(n,s)=>{if(s.disabled||!s.name||s.tagName==="FIELDSET"||mb.test(s.type)||Wf.test(s.type)&&!s.checked)return;const r=Pf(s);if(!Vt(r)){const o=No(r)?r:[r];Ct(o,(a,l)=>{i+=pb(s.name,l)})}})}),i.slice(1)},window.$=y;function Kf(i,e){if(i==null)return[i,void 0];typeof e=="string"&&(e=e.split("."));const t=e.join(".");let n=i;const s=[n];for(;typeof n=="object"&&n!==null&&e.length;){let r=e.shift(),o;const a=r.indexOf("[");if(a>0&&a1?s[r-2]:i,e[e.length-1]),o===void 0?t:o}catch{return t}}function hn(i,e,t,n){let s;const r=or(i,e,void 0,o=>{s=o});return typeof r=="function"?r.apply(n??s,t):r}function gb(i){return typeof i=="string"&&i!==""}function $e(i,...e){if(e.length===0)return i;if(e.length===1&&typeof e[0]=="object"&&e[0]){const t=e[0];return Object.keys(t).forEach(n=>{const s=t[n]??"";i=i.replace(new RegExp(`\\{${n}\\}`,"g"),`${s}`)}),i}for(let t=0;t(i[i.B=1]="B",i[i.KB=1024]="KB",i[i.MB=1048576]="MB",i[i.GB=1073741824]="GB",i[i.TB=1099511627776]="TB",i))(Ac||{});function ft(i,e=2,t){return Number.isNaN(i)?"?KB":(t||(i<1024?t="B":i<1048576?t="KB":i<1073741824?t="MB":i<1099511627776?t="GB":t="TB"),(i/Ac[t]).toFixed(e)+t)}const Tn=i=>{const e=/^[0-9]*(B|KB|MB|GB|TB)$/;i=i.toUpperCase(),i.endsWith("B")||(i+="B");const t=i.match(e);if(!t)return 0;const n=t[1];return i=i.replace(n,""),Number.parseInt(i,10)*Ac[n]};let Pc=(document.documentElement.getAttribute("lang")||"zh_cn").toLowerCase().replace("-","_"),Un;function qf(){return Pc}function yb(i){Pc=i.toLowerCase().replace("-","_")}function Gf(i,e){Un||(Un={}),typeof i=="string"&&(i={[i]:e??{}}),y.extend(!0,Un,i)}function Re(i,e,t,n,s,r){Array.isArray(i)?Un&&i.unshift(Un):i=Un?[Un,i]:[i],typeof t=="string"&&(r=s,s=n,n=t,t=void 0);const o=s||Pc;let a;for(const l of i){if(!l)continue;const c=l[o]||l.default;if(!c)continue;const h=r&&l===Un?`${r}.${e}`:e;if(a=or(c,h),a!==void 0)break}return a===void 0?n:t?$e(a,...Array.isArray(t)?t:[t]):a}function vb(i,e,t,n){return Re(void 0,i,e,t,n)}Re.addLang=Gf,Re.getLang=vb,Re.getCode=qf,Re.setCode=yb,Re.map=Un,Gf({zh_cn:{confirm:"确定",save:"保存",cancel:"取消",delete:"删除",reset:"重置",add:"添加",copy:"复制",close:"关闭",edit:"编辑",open:"打开"},zh_tw:{confirm:"確定",save:"儲存",cancel:"取消",delete:"刪除",reset:"重置",add:"添加",Copy:"複製",close:"關閉",edit:"編輯",open:"打開"},en:{confirm:"Confirm",save:"Save",cancel:"Cancel",delete:"Delete",reset:"Reset",add:"Add",copy:"Copy",close:"Close",edit:"Edit",open:"Open"}});function Rs(i,e,t){t!=null&&(Array.isArray(t)?t.forEach(n=>Rs(i,e,n)):!(t instanceof Blob)&&y.isPlainObject(t)?Object.entries(t).forEach(([n,s])=>{Rs(i,`${e}[${n}]`,s)}):i.append(e,t instanceof Blob?t:String(t)))}function zo(i,e){const t=e||new FormData;return i&&(typeof i=="string"&&(i=new URLSearchParams(i)),i instanceof URLSearchParams?i.forEach((n,s)=>{Rs(t,s,n)}):Array.isArray(i)?i.forEach(([n,s])=>{Rs(t,n,s)}):i instanceof FormData?i.forEach((n,s)=>{Rs(t,s,n)}):typeof i=="object"&&i&&Object.entries(i).forEach(([n,s])=>{Rs(t,n,s)})),t}function Xe(){return y.guid++}function ar(i,e){if(i===e)return!1;if(i&&e){const t=typeof i,n=typeof e;if(t!==n)return!0;if(t==="object"&&n==="object"){const s=Array.isArray(i),r=Array.isArray(e);if(s!==r)return!0;if(s&&r){if(i.length!==e.length)return!0;for(let l=0;ln instanceof zs?n.value!==t[s]:ar(n,t[s])))&&(this._value=this._compute(),this._lastDependencies=e.map(n=>n instanceof zs?n.cache:n)),this._value}}function Lc(...i){const e=[],t=new Map,n=(s,r)=>{if(Array.isArray(s)&&(r=s[1],s=s[0]),!s.length)return;const o=t.get(s);typeof o=="number"?e[o][1]=!!r:(t.set(s,e.length),e.push([s,!!r]))};return i.forEach(s=>{typeof s=="function"&&(s=s()),Array.isArray(s)?Lc(...s).forEach(n):s&&typeof s=="object"?Object.entries(s).forEach(n):typeof s=="string"&&s.split(" ").forEach(r=>n(r,!0))}),e.sort((s,r)=>(t.get(s[0])||0)-(t.get(r[0])||0))}const W=(...i)=>Lc(...i).reduce((e,[t,n])=>(n&&e.push(t),e),[]).join(" ");y.classes=W,y.fn.setClass=function(i,...e){return this.each((t,n)=>{const s=y(n);i===!0?s.attr("class",W(s.attr("class"),...e)):s.addClass(W(i,...e))})};const gi=new WeakMap;function Fo(i,e,t){const n=gi.has(i),s=n?gi.get(i):{};typeof e=="string"?s[e]=t:e===null?Object.keys(s).forEach(r=>{delete s[r]}):Object.assign(s,e),Object.keys(s).forEach(r=>{s[r]===void 0&&delete s[r]}),Object.keys(s).length?(!n&&i instanceof Element&&Object.assign(s,y(i).dataset(),s),gi.set(i,s)):gi.delete(i)}function lr(i,e,t){let n=gi.get(i)||{};return t&&i instanceof Element&&(n=Object.assign({},y(i).dataset(),n)),e===void 0?n:n[e]}function _b(i){gi.delete(i)}y.fn.dataset=y.fn.data,y.fn.data=function(...i){const[e,t]=i;return!i.length||i.length===1&&typeof e=="string"?this.length?lr(this[0],e,!0):void 0:this.each((n,s)=>Fo(s,e,t))},y.fn.removeData=function(i=null){return this.each((e,t)=>Fo(t,i))};function ss(i,...e){return i.includes("RAWJS")&&(i=i.split('"RAWJS<').join("").split('>RAWJS"').join("").split("").join('"').split("").join(` `)),new Function(`return ${i}`)(...e)}function Oo(i,...e){return i.includes("RAWJS")?ss(i,...e):JSON.parse(i)}function bb(i){return JSON.stringify(i,(e,t)=>typeof t=="function"?`RAWJS<${t.toString().split('"').join("").split(` -`).join("")}>RAWJS`:t)}function yi(i,e){const t=y(i)[0];if(!t)return;const{prefix:n,getter:s,evalValue:r,json:o=!0,evalArgs:a=[]}={prefix:"z-",...typeof e=="string"?{prefix:e}:e},l=Array.isArray(r)?new Set(r):void 0;return Array.from(t.attributes).reduce((c,h)=>{let{name:d}=h;const{value:f}=h;let m=f;if(d.startsWith(n)){if(d=d.slice(n.length).replace(/-([a-z])/g,_=>_[1].toUpperCase()),s)m=s(d,f);else try{r&&(!l||l.has(d))||r===void 0&&f.includes("RAWJS")?m=ss(f,...a):o&&(m=JSON.parse(f))}catch{}c[d]=m}return c},{})}function Rc(i,e,t="z-"){const n=y(i);Object.keys(e).forEach(s=>{let r=e[s];typeof r=="function"&&(r=`RAWJS<${r}>RAWJS`),typeof r!="string"&&(r=JSON.stringify(r)),s=s.replace(/[A-Z]/g,o=>`-${o.toLowerCase()}`),n.attr(`${t}${s}`,r)})}function wb(...i){var t;const e=i.length;if(!e)return yi(this);if(e===1){const[n]=i;return typeof n=="string"?(t=yi(this))==null?void 0:t[n]:(y.isPlainObject(n)&&Rc(this,n),this)}return Rc(this,{[i[0]]:i[1]}),this}y.fn.z=wb,y.fn._attr=y.fn.attr,y.fn.extend({attr(...i){const[e,t]=i;return!i.length||i.length===1&&typeof e=="string"?this._attr.apply(this,i):typeof e=="object"?(e&&Object.keys(e).forEach(n=>{const s=e[n];s===null?this.removeAttr(n):this._attr(n,s)}),this):t===null?this.removeAttr(e):this._attr(e,t)}}),y.Event||(y.Event=(i,e)=>{const[t,...n]=i.split("."),s=new Event(t,{bubbles:!0,cancelable:!0});return s.namespace=n.join("."),s.___ot=t,s.___td=e,s});const $n=(i,e)=>new Promise(t=>{const n=window.setTimeout(t,i);e&&e(n)}),Zf={};y.share=Zf;var jo,Qe,Yf;M.isValidElement=void 0;var Fs,Jf,Xf,Qf,ep,zc,Fc,Oc,cr={},tp=[],Cb=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,hr=Array.isArray;function Vn(i,e){for(var t in e)i[t]=e[t];return i}function jc(i){i&&i.parentNode&&i.parentNode.removeChild(i)}function g(i,e,t){var n,s,r,o={};for(r in e)r=="key"?n=e[r]:r=="ref"?s=e[r]:o[r]=e[r];if(arguments.length>2&&(o.children=arguments.length>3?jo.call(arguments,2):t),typeof i=="function"&&i.defaultProps!=null)for(r in i.defaultProps)o[r]===void 0&&(o[r]=i.defaultProps[r]);return Bo(i,o,n,s,null)}function Bo(i,e,t,n,s){var r={type:i,props:e,key:t,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:s??++Yf,__i:-1,__u:0};return s==null&&Qe.vnode!=null&&Qe.vnode(r),r}function me(){return{current:null}}function is(i){return i.children}function de(i,e){this.props=i,this.context=e}function vi(i,e){if(e==null)return i.__?vi(i.__,i.__i+1):null;for(var t;ea&&Fs.sort(Qf),i=Fs.shift(),a=Fs.length,i.__d&&(t=void 0,n=void 0,s=(n=(e=i).__v).__e,r=[],o=[],e.__P&&((t=Vn({},n)).__v=n.__v+1,Qe.vnode&&Qe.vnode(t),Bc(e.__P,t,n,e.__n,e.__P.namespaceURI,32&n.__u?[s]:null,r,s??vi(n),!!(32&n.__u),o),t.__v=n.__v,t.__.__k[t.__i]=t,lp(r,t,o),n.__e=n.__=null,t.__e!=s&&np(t)));Ho.__r=0}function ip(i,e,t,n,s,r,o,a,l,c,h){var d,f,m,_,w,C,k,T=n&&n.__k||tp,D=e.length;for(l=kb(t,e,T,l,D),d=0;d0?Bo(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=i,o.__b=i.__b+1,a=null,(c=o.__i=xb(o,t,l,d))!=-1&&(d--,(a=t[c])&&(a.__u|=2)),a==null||a.__v==null?(c==-1&&(s>h?f--:sl?f--:f++,o.__u|=4))):i.__k[r]=null;if(d)for(r=0;r(h?1:0)){for(s=t-1,r=t+1;s>=0||r=0?s--:r++])!=null&&!(2&c.__u)&&a==c.key&&l==c.type)return o}return-1}function op(i,e,t){e[0]=="-"?i.setProperty(e,t??""):i[e]=t==null?"":typeof t!="number"||Cb.test(e)?t:t+"px"}function Vo(i,e,t,n,s){var r,o;e:if(e=="style")if(typeof t=="string")i.style.cssText=t;else{if(typeof n=="string"&&(i.style.cssText=n=""),n)for(e in n)t&&e in t||op(i.style,e,"");if(t)for(e in t)n&&t[e]==n[e]||op(i.style,e,t[e])}else if(e[0]=="o"&&e[1]=="n")r=e!=(e=e.replace(ep,"$1")),o=e.toLowerCase(),e=o in i||e=="onFocusOut"||e=="onFocusIn"?o.slice(2):e.slice(2),i.l||(i.l={}),i.l[e+r]=t,t?n?t.u=n.u:(t.u=zc,i.addEventListener(e,r?Oc:Fc,r)):i.removeEventListener(e,r?Oc:Fc,r);else{if(s=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in i)try{i[e]=t??"";break e}catch{}typeof t=="function"||(t==null||t===!1&&e[4]!="-"?i.removeAttribute(e):i.setAttribute(e,e=="popover"&&t==1?"":t))}}function ap(i){return function(e){if(this.l){var t=this.l[e.type+i];if(e.t==null)e.t=zc++;else if(e.t0?i:hr(i)?i.map(cp):Vn({},i)}function Sb(i,e,t,n,s,r,o,a,l){var c,h,d,f,m,_,w,C=t.props,k=e.props,T=e.type;if(T=="svg"?s="http://www.w3.org/2000/svg":T=="math"?s="http://www.w3.org/1998/Math/MathML":s||(s="http://www.w3.org/1999/xhtml"),r!=null){for(c=0;c{!t||typeof t!="object"||Object.keys(t).forEach(n=>{let s=t[n];const r=i[n];s!==r&&(r!==void 0&&(n==="className"||n.endsWith("Class")?s=[r,s]:n==="children"?s=[...Uo(r),...Uo(s)]:typeof r=="object"&&(n==="style"||n.endsWith("Style")||n==="attrs"||n.endsWith("Attrs")||n==="props")&&(s=y.extend(r,s))),i[n]=s)})}),i}function Vc(i){return Object.keys(i).forEach(e=>{i[e]===void 0&&delete i[e]}),i}function Wo(i,e=!0){const t=y(i),n=t[0],s="zui-disable-scroll";if(e){if(t.data(s))return;if((t.css("scrollbar-gutter")||"").includes("stable")){t.data(s,{overflow:t.css("overflow")}).css("overflow","hidden");return}const r=n===document.body||t.is("html")?window.innerWidth-document.body.clientWidth:n.offsetWidth-n.clientWidth;if(!r)return;const o=t.css("paddingRight")||"0";t.data(s,{paddingRight:o,overflow:t.css("overflow")}).css({paddingRight:`${r+Number.parseInt(o,10)}px`,overflow:"hidden"})}else{const r=t.data(s);if(!r)return;t.css(r).removeData(s)}}y.fn.disableScroll=function(i=!0){return this.each((e,t)=>{Wo(t,i)})},y.fn.enableScroll=function(i=!0){return this.disableScroll(!i)};function Wc(i,e,t){if(!(t.on||"click").split(" ").includes(e.type))return;const n=t.selector?y(e.target).closest(t.selector):i;if(!n.length)return;const s=c=>c===""?!0:c,r=c=>{if(typeof c=="string")try{c=JSON.parse(c)}catch{}return c};if(s(t.once)){if(t.onceCalled)return;i.dataset("once-called",!0)}if(s(t.prevent)&&e.preventDefault(),s(t.stop)&&e.stopPropagation(),s(t.self)&&e.currentTarget!==e.target)return;const o=[["$element",i],["event",e],["options",t],["$target",n]],a=c=>typeof c=="function"?c(...o):y.runJS(c,...o);if(t.if!==void 0&&!a(t.if))return;const l=t.call;if(l){let c;if(typeof l=="string"?c=/^[$A-Z_][0-9A-Z_$.]*$/i.test(l)?or(window,l):a(l):c=l,typeof c=="function"){const h=[],d=t.params;t.params=h,typeof d=="string"&&d.length?d[0]==="["?h.push(...r(d)):h.push(...d.split(", ").map(f=>(f=f.trim(),f==="$element"?i:f==="event"?e:f==="options"?t:f.startsWith("$element.")||f.startsWith("event.")||f.startsWith("options.")?a(f):r(f)))):Array.isArray(d)?h.push(...d):h.push(d),c(...h)}}t.do&&a(t.do)}function $b(i){const e=y(this),t=i.type,n=e.attr("zui-on");if(n){const[o,a]=n.split("~").map(l=>l.trim());o&&o.split(" ").includes(t)&&Wc(e,i,y.extend({on:o},a?a.startsWith("{")?ss(a):{do:a}:yi(e,{prefix:"data-",evalValue:["call","if","do"]})))}const s=e.attr(`zui-on-${t}`);s&&Wc(e,i,y.extend({on:t},s.startsWith("{")?ss(s):{do:s}));const r=e.attr("data-on");r&&r.split(" ").includes(t)&&Wc(e,i,yi(e,{prefix:"data-",evalValue:["call","if","do"]}))}function dp(i){y(document).off(".zui.global").on(i.map(e=>`${e}.zui.global`).join(" "),`[zui-on],${i.map(e=>`[zui-on-${e}]`)},[data-on]`,$b)}y(()=>{dp(["click","change","inited"])});function os(i,e){if(typeof i=="function")return os(i(...e||[]));if(typeof i=="number")return[i];let t=i.match(/(\d+)(%|px)?/);return t?[parseInt(t[1]),t[2]]:(t=i.match(/(\d+)\/(\d+)/),t?[100*parseInt(t[1])/parseInt(t[2]),"%"]:[NaN])}function Ue(i,e){if(i==null)return null;const[t,n="px"]=os(i,e);return Number.isNaN(t)?typeof i=="string"?i:null:`${t}${n}`}async function Os(i,e){var n,s,r;if(i instanceof Blob){const o=document.createElement("a");return o.href=window.URL.createObjectURL(i),e&&(o.download=decodeURIComponent(e)),o.click(),o.remove(),i}if(i instanceof Response){const o=await i.blob();return e=e||((r=(s=(n=i.headers.get("Content-Disposition"))==null?void 0:n.split(";")[1])==null?void 0:s.split("=")[1])==null?void 0:r.replace(/"/g,"")),Os(o,e)}const t=await fetch(i);return Os(t)}class up{constructor(e){this._$target=y(e)}on(...e){return this._$target.on(...e),this}one(...e){return this._$target.one(...e),this}off(...e){return this._$target.off(...e),this}trigger(...e){return this._$target.trigger(...e),this}}const Dn=new up(document);y.bus=Dn,y.on=Dn.on.bind(Dn),y.one=Dn.one.bind(Dn),y.off=Dn.off.bind(Dn),y.trigger=Dn.trigger.bind(Dn);var Db=["Shift","Meta","Alt","Control"],fp=typeof navigator=="object"?navigator.platform:"",pp=/Mac|iPod|iPhone|iPad/.test(fp),Ib=pp?"Meta":"Control",Mb=fp==="Win32"?["Control","Alt"]:pp?["Alt"]:[];function Kc(i,e){return typeof i.getModifierState=="function"&&(i.getModifierState(e)||Mb.includes(e)&&i.getModifierState("AltGraph"))}function Nb(i){return i.trim().split(" ").map(function(e){var t=e.split(/\b\+/),n=t.pop();return[t=t.map(function(s){return s==="$mod"?Ib:s}),n]})}function mp(i,e){var t;e===void 0&&(e={});var n=(t=e.timeout)!=null?t:1e3,s=Object.keys(i).map(function(a){return[Nb(a),i[a]]}),r=new Map,o=null;return function(a){a instanceof KeyboardEvent&&(s.forEach(function(l){var c=l[0],h=l[1],d=r.get(c)||c;(function(f,m){return!(m[1].toUpperCase()!==f.key.toUpperCase()&&m[1]!==f.code||m[0].find(function(_){return!Kc(f,_)})||Db.find(function(_){return!m[0].includes(_)&&m[1]!==_&&Kc(f,_)}))})(a,d[0])?d.length>1?r.set(c,d.slice(1)):(r.delete(c),h(a)):Kc(a,a.key)||r.delete(c)}),o&&clearTimeout(o),o=setTimeout(r.clear.bind(r),n))}}function Eb(i,e,t){var n;t===void 0&&(t={});var s=(n=t.event)!=null?n:"keydown",r=mp(e,t);return i.addEventListener(s,r),function(){i.removeEventListener(s,r)}}function qc(i,e={}){if(!i)return;const t=Object.keys(e).reduce((n,s)=>(e[s].optional||(n[s]={...e[s]}),n),{});return Object.keys(i).forEach(n=>{const s=i[n];s?s===!0?e[n]&&(t[n]={...e[n]}):t[n]=s:delete t[n]}),Object.keys(t).reduce((n,s)=>{const{keys:r,handler:o}=t[s];return typeof r=="string"?n[r]=o:r.forEach(a=>{n[a]=o}),n},{})}function Gc(i,e,t){const{timeout:n,event:s="keydown",scope:r,when:o}=t||{},a=mp(e,{timeout:n}),l=`.zui.hotkeys${r?`.${r}`:""}`,c="zui-hotkeys-composing";return y(i).on(`${s}${l}`,function(h){o&&o(h)===!1||y(h.target).data(c)||a(h)}).on(`compositionstart${l}`,h=>{y(h.target).data(c,!0)}).on(`compositionend${l}`,h=>{y(h.target).removeData(c)})}function Zc(i,e){return y(i).off(`.zui.hotkeys${e?`.${e}`:""}`)}const Ab=Eb;y.fn.hotkeys=function(i,e){return Gc(this,i,e)},y.fn.unbindHotkeys=function(i){return Zc(this,i)},y.hotkeys=function(i,e){Gc(window,i,e)},y.unbindHotkeys=function(i){Zc(window,i)};function Ko(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement}async function gp(i){(typeof i=="string"||i instanceof Element||i instanceof y)&&(i={target:i});const{target:e,onError:t,onSuccess:n,afterExit:s,afterEnter:r}=i,o=y(e),a=o[0];if(!a)return;const l=a.requestFullscreen||a.webkitRequestFullscreen||a.mozRequestFullScreen;if(!l){t==null||t.call(a,new Error("[ZUI] The browser does not support full screen feature."));return}try{await l.call(a),n==null||n.call(a),y(a).off(".zui.fullscreen"),s&&o.on("exitFullscreen.zui.fullscreen",s),r&&o.on("enterFullscreen.zui.fullscreen",r)}catch(c){t==null||t.call(a,c)}document.zuiBindFullscreenChange||(document.zuiBindFullscreenChange=!0,y(document).on("fullscreenchange.zui webkitfullscreenchange.zui mozfullscreenchange.zui",c=>{const h=Ko();let d=h;h?y(h).addClass("is-in-fullscreen"):(d=y(document).find(".is-in-fullscreen")[0]||document,y(d).removeClass("is-in-fullscreen")),y("body").toggleClass("has-in-fullscreen",!!h);const f={event:c,target:d,fullscreenElement:h};y(d).trigger(h?"enterFullscreen":"exitFullscreen",f).trigger("toggleFullscreen",f)}))}async function qo(i){const e=Ko();return i===!1&&!!e===i?i:e?(document.exitFullscreen(),!1):(await gp(i),!0)}y.fn.fullscreen=function(i){return qo({target:this,...i})},y.getFullscreenElement=Ko,y.toggleFullscreen=qo;function In(i){return!i||i.parentNode===document?!1:i.parentNode?In(i.parentNode):!0}y.isDetached=In,y.fn.isDetached=function(){const i=this[0];return!i||In(i)};const js=class u_{constructor(e,t){var _,w;this._inited=!1,this._autoDestory=0,this._destroyed=!1;const{KEY:n,DATA_KEY:s,MULTI_INSTANCE:r,NAME:o,ATTR_KEY:a,ALL:l,TYPED_ALL:c}=this.constructor;if(!o)throw new Error('[ZUI] The component must have a "NAME" static property.');const h=y(e);if(h.data(n)&&!r)throw new Error(`[ZUI] The component "${o}" has been initialized on element.`);const d=h[0];if(!d)throw new Error(`[ZUI] Invalid selector "${e}" for component "${o}", can not find the element matched.`);const f=Xe();this._gid=f,this._element=d,this.resetOptions(t),this._key=this.options.key??`__${f}`;let m=l.get(d);if(m?m.add(this):(m=new Set([this]),l.set(d,m)),c.has(o)?(_=c.get(o))==null||_.add(this):c.set(o,new Set([this])),h.data(n,this).attr(a,"").attr(s,`${f}`).attr("z-use",[...new Set([...m||[]].map(C=>C.constructor.NAME))].join(",")),r){const C=`${n}:ALL`;let k=h.data(C);k||(k=new Map,h.data(C,k)),k.set(this._key,this)}this.init(),(w=this.options.$onCreate)==null||w.call(this),requestAnimationFrame(async()=>{var k;const{$fetcher:C}=this.options;if(C){const T=await Ae(C,[],{dataType:"js"});if(this.destroyed)return;T&&this.setOptions(T)}this._inited=!0,await this.afterInit(),this.emit("inited",this.options),(k=this.options.$onInited)==null||k.call(this)})}static get ZUI(){return this.NAME.replace(/(^[A-Z]+)/,e=>e.toLowerCase())}static get KEY(){return`zui.${this.NAME}`}static get NAMESPACE(){return`.zui.${this.ZUI}`}static get DATA_KEY(){return`data-zui-${this.NAME}`}static get ATTR_KEY(){return`z-use-${this.NAME}`}static get SELECTOR(){return`[${this.DATA_KEY}]`}get inited(){return this._inited}get destroyed(){return this._destroyed}get element(){if(!this._element)throw new Error("[ZUI] Component element is not available.");return this._element}get key(){return this._key}get options(){if(!this._options)throw new Error("[ZUI] Component options are not available.");return this._options}get gid(){return this._gid}get $element(){return y(this.element)}get $emitter(){return this.$element}get i18nData(){return[this.options.i18n,this.constructor.i18n]}init(){}afterInit(){}render(e,t){this._options=this.setOptions(e,t);const{$class:n,$style:s}=this.options;n&&this.$element.setClass(n),s&&this.$element.css(s)}destroy(){var m;const{KEY:e,DATA_KEY:t,ALL:n,TYPED_ALL:s,NAME:r,MULTI_INSTANCE:o,ATTR_KEY:a}=this.constructor,{$element:l,element:c}=this;if(this.emit("destroyed"),this._destroyed=!0,l.off(this.namespace).removeData(e).removeAttr(a).removeAttr(t),o){const _=this.$element.data(`${e}:ALL`);if(_)if(_.delete(this._key),_.size===0)this.$element.removeData(`${e}:ALL`);else{const w=_.values().next().value;l.data(e,w).attr(t,String(w==null?void 0:w.gid))}}const h=n.get(c);h&&(h.delete(this),h.size===0&&n.delete(c));const d=s.get(r);d&&(d.delete(this),d.size===0&&s.delete(r));const f=n.get(c);f!=null&&f.size?l.attr("z-use",[...new Set([...f].map(_=>_.constructor.NAME))].join(",")):l.removeAttr("z-use"),(m=this.options.$onDestroy)==null||m.call(this)}autoDestroy(e=100){this._autoDestory&&clearTimeout(this._autoDestory),this._autoDestory=window.setTimeout(()=>{this._autoDestory=0,In(this.element)&&this.destroy()},e)}setOptions(e,t){if(t){const n={...this.constructor.DEFAULT,...(e==null?void 0:e.$optionsFromDataset)!==!1?this.$element.dataset():{},...e},{$options:s}=n;if(s){const r=typeof s=="function"?s.call(this,this.element,n):s;r&&y.extend(n,r),delete n.$options}this._options=n}else e&&y.extend(this._options,e);if(!this._options)throw new Error("[ZUI] Component options are not available.");return this._options}resetOptions(e){return this.setOptions(e,!0)}emit(e,...t){const n=y.Event(e);return n.__src=this,this.$emitter.trigger(n,[this,...t]),n}on(e,t,n){const s=this;this.$element[n!=null&&n.once?"one":"on"](this._wrapEvent(e),function(r,o){(!r.__src||r.__src===s)&&t.call(this,r,o)})}one(e,t){this.on(e,t,{once:!0})}off(e){this.$element.off(this._wrapEvent(e))}i18n(e,t,n){const{i18nData:s}=this;return Re(s,e,t,n,this.options.lang,this.constructor.NAME)??Re(s,e,t,n,this.options.lang)??`{i18n:${e}}`}get namespace(){return`${this.constructor.NAMESPACE}.${this._key}`}_wrapEvent(e){return e.split(" ").map(t=>t.includes(".")?t:`${t}${this.namespace}`).join(" ")}static get(e,t){const n=y(e);if(this.MULTI_INSTANCE&&t!==void 0){const s=n.data(`${this.KEY}:ALL`);return s?s.get(t):void 0}return n.data(this.KEY)}static isValid(e){return!0}static ensure(e,t){const n=this.get(e,t==null?void 0:t.key);if(n){if(this.isValid(n))return t&&n.setOptions(t),n;n.destroy()}return new this(e,t)}static getAll(e,t){var l;const{SELECTOR:n,ALL:s,TYPED_ALL:r}=this,o=[],a=c=>{c instanceof this&&(!t||t(c)!==!1)&&o.push(c)};return e?y(e).find(n).each((c,h)=>{var d;(d=s.get(h))==null||d.forEach(a)}):this!==u_?(l=r.get(this.NAME))==null||l.forEach(a):s.forEach(c=>{c.forEach(a)}),o.sort((c,h)=>c.gid-h.gid)}static query(e,t,n){return e===void 0?this.getAll(void 0,n).pop():this.get(y(e).closest(this.SELECTOR),t)}static defineFn(e){let t=e||this.ZUI;y.fn[t]&&(t=`zui${this.NAME}`);const n=this;y.fn.extend({[t](s,...r){const o=typeof s=="object"?s:void 0,a=typeof s=="string"?s:void 0;let l;return this.each((c,h)=>{let d=n.get(h);if(d)o&&d.render(o);else{if(a)return;d=new n(h,o)}if(a){let f=d[a],m=d;f===void 0&&(m=d.$,f=m[a]),typeof f=="function"?l=f.call(m,...r):l=f}}),l!==void 0?l:this}})}static register(e,t){var s,r;e=e||this,t=(t??e.NAME).toLowerCase(),this.map.set(t,e);const n=(r=(s=e.toggle)==null?void 0:s.name)==null?void 0:r.toLowerCase();n&&n!==t&&this.toggleMap.set(n,e)}};js.DEFAULT={},js.MULTI_INSTANCE=!1,js.ALL=new Map,js.TYPED_ALL=new Map,js.map=new Map,js.toggleMap=new Map;let Ge=js;function dr(i){return Ge.map.get(i.toLowerCase())}function Go(i,e,t={}){let n=typeof i=="function"?i:dr(i);if(n||(n=Yc(i)),!n)return null;const{$update:s,...r}=t;if(!n.MULTI_INSTANCE){const o=n.get(e);if(o)return s&&o.render(r,s==="reset"),o}return new n(e,r)}function yp(i,e,t={}){requestAnimationFrame(()=>Go(i,e,t))}function vp(i,e){Ge.register(i,e)}function Yc(i){const{zui:e}=window;if(e){i=i==null?void 0:i.toLowerCase();for(const t in e){const n=t.toLowerCase()===i;if(i&&!n)continue;const s=e[t];if(!(typeof s!="function"||!s.NAME||!s.ZUI)&&(Ge.map.has(t.toLowerCase())||vp(s),n))return s}}}function Pb(i){var e;i?(e=dr(i))==null||e.defineFn():window._zuiDefined||(Yc(),Ge.map.forEach(t=>{t.defineFn()}),Object.assign(window,{_zuiDefined:!0}))}function Lb(i,e={}){const t=y(i);let n=t.attr("zui-create");const{update:s,onCreate:r}=e,o=(a,l)=>{if(l={$update:s,$optionsFromDataset:!1,...l},r){const h=r(a,l);if(h===!1)return;h&&(l=h)}const c=l.$lib;if(c){delete l.$lib,y.getLib(c).then(()=>yp(a,i,l));return}yp(a,i,l)};if(typeof n=="string"){n=n.trim();const a=n.length?n.split(",").map(h=>h.trim()):[],l=yi(i,{prefix:"zui-create-",evalValue:!0})||{},c=Object.keys(l);if(!c.length&&a.length===1)o(a[0],t.dataset());else{const h=new Set;[...a,...c].forEach(d=>{if(h.has(d))return;const f=l[d];o(d,f),delete l[d],h.add(d)})}}else{const a=t.dataset(),l=a==null?void 0:a.zui;if(!l)return;console.warn("[ZUI] create component instance with [data-zui] is deprecated, use [zui-create] instead.",{element:i,options:e}),a==null||delete a.zui,o(l,a)}}function Rb(){y(document).on("click.zui.toggle mouseenter.zui.toggle","[data-toggle],[zui-toggle]",function(i){const e=y(this),t=e.dataset("toggle")||e.attr("zui-toggle");if(!t)return;const n=Ge.toggleMap.get(t)||dr(t),s=n==null?void 0:n.toggle;if(!s)return;const{trigger:r="click",skip:o="[disabled],.disabled",check:a}=s,l=i.type==="mouseover"?"hover":"click";if(!r.includes(l)||a&&!a.call(n,this,l,i)||o&&e.is(o))return;const{onGet:c,onCreate:h,setOptions:d=!0,getOptions:f,prevent:m=!0,handler:_,onToggle:w,convertHref:C}=s;let k=e.dataset();const T=e.attr(`zui-toggle-${t}`);if(T&&(k=y.extend(k,ss(T))),C&&e.is("a")){const N=e.attr("href");if(N){const P=C===!0?{selector:"target",url:"url"}:C;"#.".includes(N[0])?P.selector&&k[P.selector]===void 0&&(k[P.selector]=N):P.url&&k[P.url]===void 0&&(k[P.url]=N)}}if(f&&(k=f.call(n,this,k,i)),_){_.call(n,this,k,l,i),m&&i.preventDefault();return}let D=c?c.call(n,this):n.get(this);if(D)d&&D.setOptions(k);else{const N=h?h.call(n,this,i,k):new n(this,k);if(!N)return;D=N}if(w){if(w.call(n,D,this,i)===!1)return}else{const{shown:N,show:P,hide:B,toggle:V}=D;let Y;if(V?Y=V:P&&B?N?Y=B:Y=P:P&&(Y=P),Y)Y.call(D);else return}m&&i.preventDefault()})}function zb(i,e){const t=lr(i),n=[];return Object.keys(t).forEach(s=>{if(!s.startsWith("zui."))return;const r=t[s];(e==null?void 0:e(r,s))!==!1&&n.push(t[s])}),n}let Zo=0;function _p(i=100){if(Zo&&clearTimeout(Zo),i){Zo=window.setTimeout(()=>_p(0),i);return}Zo=0,Ge.ALL.forEach(e=>{e.forEach(t=>!t.options.$notDestroyOnDetach&&t.autoDestroy())})}function Fb(){if(!document.body||lr(document.body,"_autoDestoryMob"))return;const i=new MutationObserver(e=>{let t=!1;for(const n of e)if(n.removedNodes.length){t=!0;break}t&&_p()});i.observe(document.body,{childList:!0,subtree:!0}),Fo(document.body,"_autoDestoryMob",i)}function Jc(i,e){const t=y(i);t.find("[zui-create],[data-zui]").each(function(){var n;((n=e==null?void 0:e.beforeCreate)==null?void 0:n.call(e,this))!==!1&&Lb(this,e)}),t.find("[zui-init]").each(function(){if(this.hasAttribute("z-zui-inited"))return;this.setAttribute("z-zui-inited","");const n=this.getAttribute("zui-init");n&&y.runJS(n,["$element",y(this)])}),t.find(".hide-before-init").removeClass("invisible hidden opacity-0"),t.find(".scroll-into-view").scrollIntoView(),t.find('[data-on="inited"],[zui-on-inited]').each((n,s)=>{const r=y(s);r.zui()||r.trigger("inited")}),e!=null&&e.runJS&&t.runJS()}y.fn.zuiInit=function(i){return Jc(this,i),this},y.fn.zui=function(i,e){const t=this[0];if(!t)return;if(typeof i!="string"){const s={};let r;return zb(t,(o,a)=>{s[a]=o,(!r||r.gid1?t[0]:void 0,s=t[t.length>1?1:0],r=y(this).zui(n),o=r==null?void 0:r[s];typeof o=="function"&&o.apply(r,e)}),this},y(()=>{y("body").zuiInit({update:!0}),Rb(),Fb()});class Yo extends Ge{get $targets(){const{$element:e}=this,{targets:t}=this.options;return t?e.find(t):e}_handleScroll(e,t,n){const{offset:s=1}=this.options,r=this.$targets,o=e.getBoundingClientRect(),{scrollTop:a,scrollLeft:l}=e;r.each((c,h)=>{const d=h.getBoundingClientRect(),f=t==="top"&&a>0&&d.top<=o.top+s||t==="bottom"&&d.bottom>=o.bottom-s||t==="left"&&l>0&&d.left<=o.left+s||t==="right"&&l{this._raf&&cancelAnimationFrame(this._raf),this._raf=requestAnimationFrame(()=>{this._raf=0,this._handleScroll(l,t,s)})};this._scrollListener=c,l.addEventListener("scroll",c)}this._container=l,requestAnimationFrame(()=>{this._handleScroll(l,t,s)})}else this._ob=new IntersectionObserver(l=>{l.forEach(c=>{c.target.classList.toggle(s,c.intersectionRatiothis._ob.observe(c))}destroy(){var e;(e=this._ob)==null||e.disconnect(),this._container&&(this._container.removeEventListener("scroll",this._scrollListener),this._raf&&cancelAnimationFrame(this._raf))}}Yo.NAME="Sticky";const _i=24*60*60*1e3,et=i=>i===void 0?new Date:(i instanceof Date||(typeof i=="string"&&(i=i.trim(),/^\d+$/.test(i)&&(i=Number.parseInt(i,10))),typeof i=="number"&&i<1e10&&(i*=1e3),i=new Date(i)),i),bp=(i,e,t="day")=>{if(typeof e=="string"){const n=Number.parseInt(e,10);t=e.replace(n.toString(),""),e=n}return i=new Date(et(i).getTime()),t==="month"?i.setMonth(i.getMonth()+e):t==="year"?i.setFullYear(i.getFullYear()+e):t==="week"?i.setDate(i.getDate()+e*7):t==="hour"?i.setHours(i.getHours()+e):t==="minute"?i.setMinutes(i.getMinutes()+e):t==="second"?i.setSeconds(i.getSeconds()+e):i.setDate(i.getDate()+e),i},as=(i,e=new Date)=>et(i).toDateString()===et(e).toDateString(),ur=(i,e=new Date)=>et(i).getFullYear()===et(e).getFullYear(),Jo=(i,e=new Date)=>(i=et(i),e=et(e),i.getFullYear()===e.getFullYear()&&i.getMonth()===e.getMonth()),Ob=(i,e=new Date)=>{i=et(i),e=et(e);const t=1e3*60*60*24,n=Math.floor(i.getTime()/t),s=Math.floor(e.getTime()/t);return Math.floor((n+4)/7)===Math.floor((s+4)/7)},wp=(i,e)=>as(et(e),i),Cp=(i,e)=>as(et(e).getTime()-_i,i),jb=(i,e)=>as(et(e).getTime()+_i,i),Xc=i=>i!=null&&!isNaN(et(i).getTime()),nt=(i,e="yyyy-MM-dd hh:mm",t="")=>{if(i=et(i),!Xc(i))return t;if(typeof e=="function")return e(i);const n={"M+":i.getMonth()+1,"d+":i.getDate(),"h+":i.getHours(),"H+":i.getHours()%12,"m+":i.getMinutes(),"s+":i.getSeconds(),"S+":i.getMilliseconds()};return/(y+)/i.test(e)&&(e.includes("[yyyy-]")&&(e=e.replace("[yyyy-]",ur(i)?"":"yyyy-")),e=e.replace(RegExp.$1,`${i.getFullYear()}`.substring(4-RegExp.$1.length))),Object.keys(n).forEach(s=>{if(new RegExp(`(${s})`).test(e)){const r=`${n[s]}`;e=e.replace(RegExp.$1,RegExp.$1.length===1?r:`00${r}`.substring(r.length))}}),e},Bb=(i,e,t)=>{const n={full:"yyyy-M-d",month:"M-d",day:"d",str:"{0} ~ {1}",...t},s=nt(i,ur(i)?n.month:n.full);if(as(i,e))return s;const r=nt(e,ur(i,e)?Jo(i,e)?n.day:n.month:n.full);return n.str.replace("{0}",s).replace("{1}",r)};function Qc(i){let e=0;if(typeof i!="string"&&(i=String(i)),i&&i.length)for(let t=0;t{try{a.includes("%")&&(a=decodeURIComponent(a)),a=JSON.parse(a)}catch{}return[o,a]})),params:n.map(o=>{if(o!=="undefined"){if(o==="null")return null;try{return o.includes("%")&&(o=decodeURIComponent(o)),JSON.parse(o)}catch{return o}}})}}function kp(i){if(Array.isArray(i))return{commands:i.map(Xo).filter(Boolean)};if(typeof i=="object")return i;i=i.replace(/^#!?/,"");const e=i.includes(">"),t=i.split(e?">":"|").map(Xo);return{async:e,commands:t.filter(Boolean)}}function eh(i,e,t){if(typeof i=="string"&&(i=Xo(i)),!i)return;const{execute:n,event:s,scope:r}=e;if(!(r&&i.scope&&i.scope!==r))return n({name:i.name,options:{...e.options,...i.options},event:s,scope:i.scope,prevResult:t},i.params)}async function th(i,e){const{async:t,commands:n}=kp(i);if(!n.length)return[];const{signal:s}=e;if(t){const o=[];let a;for(const l of n){if(!(s!=null&&s.aborted))break;a=await eh(l,e,a),s!=null&&s.aborted&&(a=void 0),o.push(a)}return o}return await Promise.all(n.map(o=>{if(!(s!=null&&s.aborted))return eh(o,e)}))}const bi="zui.commands",wi="z-commands",nh="zui-commands-proxy",xp="zui-command",Qo={};function Sp(i,e){typeof i=="string"&&e?Qo[i]=e:typeof i=="object"&&Object.assign(Qo,i)}function Ci(i,e){typeof e=="string"?e={scope:e}:typeof e=="function"&&(e={onCommand:e});const{scope:t="",events:n="click"}=e??{},s=y(i),r=(s.attr(wi)||"").split(",");t&&!r.includes(t)&&r.push(t),s.attr(wi,r.join(",")).data(bi,{[t]:{...e,scope:t,events:n,gid:Xe()},...s.data(bi)})}function fr(i,e=!0){const t=y(i);if(e===!0)t.removeAttr(wi),t.removeData(bi);else if(e.length){const n=t.data(bi)||{};e.split(",").forEach(r=>{delete n[r]});const s=Object.keys(n);s.length?t.attr(wi,s.join(",")).data(bi,Ci):fr(t,!0)}}function Tp(i,e){let t=i.closest(`[${wi}],[${nh}]`).first();if(t.attr(nh)!==void 0&&(t=y(t.data("zui.commandProxy")||t.attr(nh)).closest(`[${wi}]`)),!t.length)return;const n=t.data(bi)||{},s=Object.values(n).sort((o,a)=>a.gid-o.gid);let r;return e!=null&&e.length?(r=s.find(o=>o.scope===e),r||(r=s.find(o=>{var a;return!((a=o.scope)!=null&&a.length)&&!o.scoped})),r):(r=s.find(o=>{var a;return!((a=o.scope)!=null&&a.length)&&!o.scoped}),r||(r=s.find(o=>!o.scoped)),r?r.element=t[0]:r=Tp(i.parent(),e),r)}function Hb(i){if(!i.currentTarget)return;const e=y(i.currentTarget);if(e.closest(".disabled,[disabled]").length)return;const t=e.attr(xp)||(e.is('a[href^="#!"]')?e.attr("href"):"");if(!t)return;const n=new AbortController,s=()=>n.abort();th(t,{signal:n.signal,execute:(r,o)=>{const{scope:a,name:l}=r,c={...r,abort:s};let h;const d=Tp(e,a);if(d){c.element=d.element;const m=(d.commands?d.commands[`${a}~${l}`]||d.commands[l]:null)||d.onCommand;if(m&&(h=m(c,o),i.commandHandled))return h}const f=[c,o];if(e.trigger("command",f).trigger(`command:${a?`${l}.${a}`:l}`,f),a&&e.trigger(`command:.${a}`,f),i.commandHandled)return h;if(a==="event"){l==="stop"?i.stopPropagation():l==="prevent"?i.preventDefault():hn(i,l,o);return}if(a!=null&&a.startsWith(".")){let m;if(a===".")m=e.closest("[z-use]").zui();else{const _=a.substring(1);m=e.closest(`[z-use-${_}]`).zui(_)}if(m)return hn(m,l,o);console.warn(`[ZUI] Command "${l}" not found in scope "${a}".`);return}return a==="window"?hn(window,l,o):a==="zui"?hn(window.zui,l,o):a==="target"?hn(e[0],l,o):a==="$target"?hn(e,l,o):a==="$"?hn(y,l,o):a===""&&Qo[l]!==void 0?Qo[l](c,o):h},event:i})}y.fn.command=function(i,e){return this.on(`command:${i}`,e)},y.fn.offCommand=function(i,e){return this.off(`command:${i}`,e)},y.fn.commands=function(i){return this.each((e,t)=>Ci(t,i)),this},y.fn.unbindCommands=function(i){return this.each((e,t)=>fr(t,i)),this},y(()=>{y(document).on("click.zui.command",`[${xp}],a[href^="#!"]`,Hb)});function pr(i,e,t=!1){var s;const n=y(i);if(e!==void 0){if(typeof e=="string"&&e.length){const r=`zui-runjs-${Xe()}`;n.append(`