UNPKG

@lifeart/gxt

Version:

<img align="right" width="95" height="95" alt="Philosopher’s stone, logo of PostCSS" src="./public/logo.png">

2 lines (1 loc) • 31.3 kB
function t(){return Tt}function e(t){Tt=t}function n(t){return null!==At?At:t[Q]||(t[Q]=s(t,Nt))}function s(t,e,n=!0){if(e===Nt&&null!==At)return At;let s,r=t;for(;r;){if(s=xt.get(r),s?.has(e)){const t=s.get(e);return Z(t)?t():t}const t=J.get(r[tt]);if(null!=t){const n=et.get(t);if(void 0===n){r=void 0;continue}if(r=n,e===Nt&&r[Q])return r[Q]}else r=void 0}return e===Nt&&null!==Ft?Ft:null}function r(){At=null,Ft=null}function i(t,e,n){e===Nt&&("document"in t?(At=n,Ft=Z(n)?n():n,nt(t,()=>{At=null})):At=null,t[Q]=Z(n)?n():n),xt.has(t)||(xt.set(t,/* @__PURE__ */new Map),nt(t,()=>{xt.delete(t)})),xt.get(t).set(e,n)}function o(t){return new Ot(t)}function a(t,e="resolveRenderable"){const n=ot(()=>at(t));let s="";return st(n,t=>{s=t}),n.isConst?(n.destroy(),s):rt(s)||it(s)?n:s}function l(t,e,n,s,r=null,i=!1){if(Z(s)&&(s=a(s)),!it(s)&&""!==s){if(rt(s)){let o=t.text(s);return!0!==i&&e[lt].push(o),void t.insert(n,o,r)}if(t.isNode(s))return i||e[lt].push(s),void t.insert(n,s,r);if(lt in s){const e=s[lt],i=e.length;for(let o=0;o<i;o++){let i=e[o];if(Z(i)&&(i=a(i)),!it(i)&&""!==i)if(rt(i)){const s=t.text(i);e[o]=s,t.insert(n,s,r)}else t.isNode(i)?(e[o]=i,t.insert(n,i,r)):(ut(i),l(t,s,n,i,r,!0))}}else{if(dt(s)){const o=t.text("");return i||e[lt].push(o),t.insert(n,o,r),void nt(e,ft(s,e=>{t.textContent(o,(e??"")+"")}))}if(ut(s))for(let o=0;o<s.length;o++)l(t,e,n,s[o],r,i);else if(TRY_CATCH_ERROR_HANDLING&&null!=s)try{const o=s+"";if(o&&"[object Object]"!==o){const s=t.text(o);return i||e[lt].push(s),void t.insert(n,s,r)}}catch{}}}}function h(t,e){if(!e)return;const n=[e];for(;n.length>0;){const e=n.pop();if(ut(e))for(let t=e.length-1;t>=0;t--){const s=e[t];s&&n.push(s)}else{const s=e[lt];if(void 0!==s)n.push(s);else{const n=e;n.isConnected&&t.destroy(n)}}}}function c(t,e=!1,n){if(ut(t)){const s=t.slice(),r=s.length;for(let t=0;t<r;t++)c(s[t],e,n)}else if(t)if(void 0!==t[lt])try{!function(t,e=!1,n){const s=[t];for(;s.length>0;){const t=s.pop(),r=ct.get(t[tt]);if(pt(t),!0!==e&&h(n,t[lt]),r)for(const e of r){const t=et.get(e);t&&!mt(t)&&s.push(t)}}}(t,e,n)}catch(s){}else try{n.destroy(t)}catch(s){}}function u(t){if(WITH_CONTEXT_API)if(ut(t))t.forEach(u);else if(t&&lt in t){const e=t[tt];if(void 0===e)return;const n=J.get(e);if(void 0===n)return;const s=ct.get(n);void 0!==s&&s.delete(e)}}async function d(t,e=!1,n){if(ut(t)){const s=[],r=t.length;for(let i=0;i<r;i++)s.push(d(t[i],e,n));await Promise.all(s)}else if(void 0!==t[lt]){const s=[];f(t,s,e,n),await Promise.all(s)}else try{n.destroy(t)}catch(s){throw Error("unknown branch")}}function f(t,e=[],s=!1,r){const i=p(t,s,r||n(t));return i&&e.push(i),e}function p(t,e,n){const s=[],r=ct.get(t[tt]);if(yt(t,s),r){const t=Array.from(r);for(let r=0;r<t.length;r++){const i=et.get(t[r]);if(i&&!mt(i)){const t=p(i,e,n);t&&s.push(t)}}}return!0===e?0===s.length?null:1===s.length?s[0]:Promise.all(s).then(()=>{}):0===s.length?(h(n,t[lt]),null):1===s.length?s[0].then(()=>{h(n,t[lt])}):Promise.all(s).then(()=>{h(n,t[lt])})}function m(t){if(null==t||!1===t||""===t||0===t)return[];if(Array.isArray(t))return t;if("object"!=typeof t&&"function"!=typeof t)return[];if("object"==typeof t&&null!==t&&"content"in t){const e=t;if(e.isDestroyed||e.isDestroying)return[];try{const n=e.content;if(n===t);else if(void 0!==n)return m(n)}catch{return[]}}if(("object"==typeof t||"function"==typeof t)&&null!==t&&"function"==typeof t[Symbol.iterator])try{return Array.from(t)}catch{return[]}if("object"==typeof t&&null!==t&&"function"==typeof t.forEach&&"number"==typeof t.length)try{const e=[];return t.forEach(t=>{e.push(t)}),e}catch{return[]}return[]}function y(t){return Z(t)?a(t):t}function g(t){return"function"!=typeof t||t.prototype||(t=t()),null!=t&&dt(t)?t.value:t}function v(t,e){const n=g(t[0]);if("string"==typeof n){const t=function(t){const n=Object.keys(e);for(let s=0;s<n.length;s++){const r=n[s];t[r]=g(e[r])}return t};return t.__stringComponentName=n,t}return function(t){const s=Object.keys(e);for(let n=0;n<s.length;n++){const r=s[n];t[r]=g(e[r])}return new n(t)}}function _(t,e){const n=g(t[0]),s=t.slice(1);if("undefined"!=typeof EmberFunctionalModifiers&&EmberFunctionalModifiers.has(n)){let t=function(t,r,i){return be(n,t,[...s,...r],()=>({...e,...i}))};return EmberFunctionalModifiers.add(t),t}return function(t,r,i){const o=D([...s,...r]),a={...e,...i};return n(t,o,a)}}function I(t,e){const n=g(t[0]),s=t.slice(1);if(WITH_EMBER_INTEGRATION&&ee.helper.canHandle(n))return ee.helper.handle(n,s,e);if("undefined"!=typeof EmberFunctionalHelpers&&EmberFunctionalHelpers.has(n)){let t=function(t,r){return me(n,[...s,...t],{...e,...r})};return EmberFunctionalHelpers.add(t),t}return function(t,e){const r=D([...s,...t]);return n(...r)}}function b(t,e){if(Z(t)){const e=ot(()=>at(t));if(e.isConst){const t=e.value;return e.destroy(),{result:t,isReactive:!1}}return{result:e,isReactive:!0}}const n=y(t);return dt(n)?{result:n,isReactive:!0}:{result:n,isReactive:!1}}function C(e,n,s,r,i){const{result:o,isReactive:a}=b(r);if(!it(o))if(a){let t;i.push(ft(o,r=>{const i=null===r?"":r;i!==t&&(t=e.prop(n,s,i))}))}else{if(t())return;e.prop(n,s,o)}}function M(t,e,n,s,r){const{result:i,isReactive:o}=b(s);it(i)||(o?r.push(ft(i,s=>{t.attr(e,n,s)})):t.attr(e,n,i))}function w(t,e,n,s,r){if(n===ue){const n=y(s);if(it(n))return;rt(n)?t.textContent(e,n):r.push(ft(n,n=>{t.textContent(e,(n??"")+"")}))}else if(n===ce)if(REACTIVE_MODIFIERS){let t=()=>{},n=!1;const i=ot(()=>{if(!n)return t(),s(e)},e.tagName+".modifier"),o=ft(i,e=>{Z(e)&&(t=e)});i.isConst?(i.destroy(),o(),r.push(()=>t())):r.push(()=>{n=!0,i.destroy()},o,()=>t())}else{const t=s(e);Z(t)&&r.push(t)}else RUN_EVENT_DESTRUCTORS_FOR_SCOPED_NODES?r.push(t.addEventListener(e,n,s)):t.addEventListener(e,n,s)}function E(){de++}function S(){de=0}function T(){return de}function x(t,e="default"){return e in t&&void 0!==t[e]}function N(t,e="default"){return t[e+"_"]}function k(t,e,n,s,r){for(let i=0;i<e.length;i++){const o=e[i][0];if(null!==s){if(s.has(o))continue;s.add(o)}M(t,n,o,e[i][1],r)}}function R(t,e,n,s,r,i,o){for(let a=0;a<e.length;a++){const l=e[a][0],h=e[a][1];if(""!==l)if(SUPPORT_SHADOW_DOM&&"shadowrootmode"===l)o(h);else{if(null!==s){if(s.has(l))continue;s.add(l)}C(t,n,l,h,r)}else i.push(h)}}function A(t,e,s){const r=n(s);return P(function(){let n;if(K(this,arguments),WITH_DYNAMIC_EVAL&&s?.$_eval&&(this.$_eval=s.$_eval),Z(t)){let e=t();Z(e)&&(e=e()),n=dt(e)?e.value:e}else n=dt(t)?t.value:t;if(!n)return U([],this);const i=e(s);return l(r,s,n,i),nt(s,()=>{u(i),n.innerHTML=""}),U([],this)},{},s)}function F(t,e){return P(function(){if(K(this,arguments),WITH_DYNAMIC_EVAL&&e?.$_eval&&(this.$_eval=e.$_eval),!this[Q]&&e){const t=e[Q];if(t)this[Q]=t;else try{this[Q]=n(e)}catch{}}try{return Yt(this),U(t(this),this)}finally{Yt(null)}},{},e)}function O(t,e){if(e){const t=e[bt]?.[St.SCOPE_KEY];return"function"==typeof t?t()||[]:t?[t]:[]}return t[St.SCOPE_KEY]?.()||[]}function D(t){for(let e=0;e<t.length;e++)t[e]=g(t[e]);return t}function P(e,n,s){if(TRY_CATCH_ERROR_HANDLING)try{const t=n[ie];return Yt(s),H(e,n,t,s)}catch(r){if(t())throw r;return{[lt]:[new jt(document).text(r.message+"")]}}finally{Yt(null)}else{const t=n[ie];Vt(s);try{return H(e,n,t,s)}finally{Gt()}}}function H(t,e,n,s){let r=t;if(WITH_EMBER_INTEGRATION&&ee.component.canHandle(t)&&(r=ee.component.handle(t,e,n,s)),IS_GLIMMER_COMPAT_MODE){if("function"==typeof r&&r!==t&&void 0===r.prototype){const t=r();if(null!=t&&(t instanceof Node||Array.isArray(t)||"function"!=typeof t))return t}}else dt(r)&&(r=r.value);let i=void 0===r.prototype?r(e,n):new r(e,n);return Z(i)&&(i=new i(e,n)),Et in i?(vt(s,i),i[Et](e)):(i&&vt(s,i),i)}function B(t,e,n,s){const r={[bt]:{},[lt]:[],[tt]:ht(),[Q]:null};vt(s,r);const i=[],o=e().map((t,n)=>{const s=ot(()=>e()[n]),r=s.value;return s.isConst||"object"==typeof r?(s.destroy(),r):(i.push(s),s)});return i.length>0&&nt(r,()=>{for(const t of i)t.destroy()}),U(t?t(r,...o):[],r)}function L(e,n){const s=e.comment("");let r=t()&&e.parent(s)||e.fragment();return s.isConnected||e.insert(r,s),{placeholder:s,outlet:r}}function j(t,e){return U(Array.from(t.childNodes),e)}function $(t,e,s=null,r,i,o){const a=n(r),{outlet:l,placeholder:h}=L(a);return j(l,new Zt({tag:t,ItemComponent:e,ctx:r,key:s,inverseFn:i,hasIndex:o},l,h))}function W(t,e,s=null,r,i,o){const a=n(r),{outlet:l,placeholder:h}=L(a);return j(l,new Jt({tag:t,ItemComponent:e,key:s,ctx:r,inverseFn:i,hasIndex:o},l,h))}function K(t,e){t[bt]=t[bt]||e[0]||{},t[lt]=t[lt]??[],t[tt]=t[tt]??ht(),t[Ct]||vt(zt(),t)}function V(t,e){return(e[0]||{})[re]||t[bt]?.[re]||{}}function G(t,e){return(e[0]||{})[ie]||t[bt]?.[ie]||void 0}function Y(t,e,n){return IS_GLIMMER_COMPAT_MODE?(Object.defineProperty(t,re,{value:e??{},enumerable:!1}),Object.defineProperty(t,ie,{value:n??{},enumerable:!1}),new Proxy(t,ye)):(Object.defineProperty(t,ie,{value:n??{},enumerable:!1}),Object.defineProperty(t,re,{value:e??{},enumerable:!1}),t)}function z(t,e,s){const r=n(s),i=ot(t);let o=null,a=null;const h=ft(i,t=>{if("function"!=typeof t)return o=t,void vt(s,o);if(t!==a)if(a=t,o){const n=o[lt].pop(),i=r.comment(),a=r.parent(n);r.insert(a,i,n),u(o),c(o,!1,r),o=P(t,e,s),o[lt].push(i),l(r,s,a,o,i)}else o=P(t,e,s)});return i.isConst?(i.destroy(),h()):(o[lt].push(r.comment()),nt(s,h),nt(s,()=>{i.destroy()})),{get[Q](){return o[Q]},set[Q](t){o[Q]=t},get[tt](){return o[tt]},set[tt](t){o[tt]=t},get[lt](){return o[lt]},set[lt](t){o[lt]=t}}}function U(t,e){return e[lt]=t,e}function X(t){return"nodeType"in t?t:t[lt][0]}function q(t,e={}){const s=e.owner??o(),a=e.element??document.body,h=e.args??{};r();const c=X(a);n(s)||i(s,Nt,new jt(s.document));const u=P(t,h,s);return l(n(s),u,c,u,c.lastChild),u}import{c as Q,E as Z,P as J,C as tt,T as et,r as nt,L as st,N as rt,O as it,i as ot,Q as at,R as lt,K as ht,u as ct,v as ut,q as dt,D as ft,S as pt,U as mt,V as yt,W as gt,I as vt,A as _t,X as It,$ as bt,Y as Ct,Z as Mt,_ as wt,b as Et}from"./vm-CFZXVoe9.js";import{C as St}from"./symbols-CMiKXAxp.js";let Tt=!1;const xt=/* @__PURE__ */new WeakMap,Nt=/* @__PURE__ */Symbol(),kt=/* @__PURE__ */Symbol(),Rt=/* @__PURE__ */Symbol();let At=null,Ft=null;class Ot{[lt]=[];[tt]=ht();[Q]=void 0;constructor(t=globalThis.document){this.document=t,i(this,kt,this);const e=this[tt];ct.set(e,/* @__PURE__ */new Set),et.set(e,this),WITH_CONTEXT_API&&J.set(e,null),nt(this,()=>{ct.delete(e),et.delete(e),WITH_CONTEXT_API&&J.delete(e)})}}const Dt="http://www.w3.org/1999/xhtml",Pt="http://www.w3.org/1998/Math/MathML",Ht="http://www.w3.org/2000/svg",Bt="http://www.w3.org/1999/xlink",Lt="http://www.w3.org/2000/xmlns/";class jt{constructor(t){this.doc=t}parent(t){return t.parentNode}isNode(t){return"nodeType"in t}destroy(t){t&&t.remove()}clearChildren(t){t.innerHTML=""}toString(){return"html:dom-api"}addEventListener(t,e,n){if(t.addEventListener(e,n),RUN_EVENT_DESTRUCTORS_FOR_SCOPED_NODES)return()=>{t.removeEventListener(e,n)}}attr(t,e,n){t.setAttribute(e,null===n?"":n)}prop(t,e,n){return t[e]=n,n}comment(t=""){return gt?(E(),this.doc.createComment(`${t} $[${T()}]`)):this.doc.createComment("")}text(t=""){return this.doc.createTextNode(t)}textContent(t,e){t.textContent=e}fragment(){return this.doc.createDocumentFragment()}element(t=""){return this.doc.createElement(t)}insert(t,e,n){null!==t&&t.insertBefore(e,n||null)}}class $t{constructor(t){this.doc=t}isNode(t){return"nodeType"in t}destroy(t){t&&t.remove()}clearChildren(t){t.innerHTML=""}parent(t){return t.parentNode}comment(t=""){return this.doc.createComment(t)}fragment(){return this.doc.createDocumentFragment()}addEventListener(t,e,n){}toString(){return"svg:dom-api"}text(t){return this.doc.createTextNode(t)}textContent(t,e){t.textContent=e}element(t){return this.doc.createElementNS(Ht,t)}attr(t,e,n){e.includes(":")?e.startsWith("xmlns")?t.setAttributeNS(Lt,e,n):e.startsWith("xlink")?t.setAttributeNS(Bt,e,n):t.setAttributeNS(Ht,e,n):t.setAttribute(e,n)}prop(t,e,n){"className"===e?t.setAttribute("class",n):t.setAttribute(e,n)}insert(t,e){t.insertBefore(e,null)}}class Wt{constructor(t){this.doc=t}isNode(t){return"nodeType"in t}destroy(t){t&&t.remove()}clearChildren(t){t.innerHTML=""}parent(t){return t.parentNode}comment(t=""){return this.doc.createComment(t)}fragment(){return this.doc.createDocumentFragment()}addEventListener(t,e){}toString(){return"mathml:dom-api"}text(t){return this.doc.createTextNode(t)}textContent(t,e){t.textContent=e}element(t){return this.doc.createElementNS(Pt,t)}attr(t,e,n){e.includes(":")?t.setAttributeNS(Pt,e,n):t.setAttribute(e,n)}prop(t,e,n){t.setAttribute(e,n)}insert(t,e){t.insertBefore(e,null)}}const Kt=[],Vt=t=>{Kt.push(t[tt])},Gt=()=>{Kt.pop()},Yt=t=>{null===t?Kt.pop():Kt.push(t[tt])},zt=()=>et.get(Kt[Kt.length-1]),Ut=[],Xt=[],qt=[];class Qt{keyMap=/* @__PURE__ */new Map;indexMap=/* @__PURE__ */new Map;indexFormulaMap=null;itemMarkers=/* @__PURE__ */new Map;markerSet=/* @__PURE__ */new Set;_existKeys=[];_existNewIdx=[];_existOldIdx=[];_itemKeys=[];_lisResult=/* @__PURE__ */new Set;_updatingKeys=/* @__PURE__ */new Set;_moveSet=/* @__PURE__ */new Set;_freshMoveKeys=/* @__PURE__ */new Set;_processedKeys=/* @__PURE__ */new Set;_keysToRemove=[];_rowsToRemove=[];[lt]=[];[tt]=ht();ItemComponent;inverseFn=null;inverseContent=null;bottomMarker;topMarker;key="@identity";tag;isFirstRender=!0;get ctx(){return this}keysForItems(t,e){const n=this._updatingKeys;n.clear();for(let s=0;s<t.length;s++)n.add(e(t[s],s,t));return n}detachTreeChildren(){ct.delete(this[tt])}isAppendOnlySuperset(t,e,n){if(t.length<e)return!1;const{indexMap:s}=this;for(let r=0;r<e;r++){const e=n(t[r],r,t);if(s.get(e)!==r)return!1}return!0}_relocateFragment;hasIndex=!1;constructor({tag:t,ctx:e,key:s,ItemComponent:r,inverseFn:i,hasIndex:o},a,l){this.api=n(e),i&&(this.inverseFn=i),o&&(this.hasIndex=!0),this._relocateFragment=this.api.fragment(),this.ItemComponent=r,WITH_DYNAMIC_EVAL&&e?.$_eval&&(this.$_eval=e.$_eval);const h=zt()||e;vt(h,this),this[lt]=[],s&&(this.key=s),this.setupKeyForItem();const c=this[tt];nt(this,()=>{ct.delete(c),et.delete(c),J.delete(c),this.itemMarkers.clear(),this.markerSet.clear()}),this.bottomMarker=this.api.comment(),this.topMarker=l,this.api.insert(a,this.topMarker),this.api.insert(a,this.bottomMarker);const u=t;if(!dt(t))if(ut(t))console.warn("iterator for @each should be a cell"),t=new _t(t,"list tag");else if(Z(u))t=ot(()=>at(u)),nt(e,()=>{t.destroy()});else{const e=m(t);t=new _t(e,"list tag")}this.tag=t}relocateItem(t,e,n){if(t===e)return;const{markerSet:s,bottomMarker:r,_relocateFragment:i}=this;let o,a=r,l=t.nextSibling;for(;l&&l!==r;){if(8===l.nodeType&&s.has(l)){a=l;break}l=l.nextSibling}if(a!==e){for(l=t;l&&l!==a;)o=l.nextSibling,this.api.insert(i,l),l=o;this.api.insert(n,i,e)}}removeMarker(t){const e=this.itemMarkers.get(t);e&&(this.itemMarkers.delete(t),this.markerSet.delete(e),e.isConnected&&this.api.destroy(e))}_dupItemsRef=null;_dupHasDupes=!1;_dupDetectSet=/* @__PURE__ */new Set;_dupFirstIdxMap=/* @__PURE__ */new Map;detectDupes(t,e){if(this._dupItemsRef===t)return this._dupHasDupes;const n=this._dupDetectSet;n.clear();let s=!1,r=null;for(let i=0;i<t.length;i++){const o=e(t[i],i),a=n.size;if(n.add(o),n.size!==a+1){if(!s){s=!0,r=this._dupFirstIdxMap,r.clear();for(let n=0;n<i;n++){const s=e(t[n],n);r.has(s)||r.set(s,n)}}}else s&&(r.has(o)||r.set(o,i))}return this._dupItemsRef=t,this._dupHasDupes=s,s}setupKeyForItem(){if("@identity"===this.key){let t=0;const e=/* @__PURE__ */new WeakMap,n=(n,s)=>{if(rt(n)||it(n))return`${n+""}:${s}`;const r=e.get(n);if(void 0!==r)return r;const i=++t;return e.set(n,i),i};this.keyForItem=(t,e,s)=>{const r=n(t,e);if(rt(t)||it(t))return r;if(void 0!==s&&(this._dupItemsRef!==s&&this.detectDupes(s,n),this._dupHasDupes)){const t=this._dupFirstIdxMap.get(r);if(void 0!==t&&t<e)return`${r}:${e}`}return r}}else{const t=t=>t[this.key],e=(e,n)=>t(e);this.keyForItem=(n,s,r)=>{const i=t(n);if(void 0!==r&&(this._dupItemsRef!==r&&this.detectDupes(r,e),this._dupHasDupes)){const t=this._dupFirstIdxMap.get(i);if(void 0!==t&&t<s)return`${i}:${s}`}return i}}}renderInverse(){if(!this.inverseFn||null!==this.inverseContent)return;const t=this;Yt(t),this.inverseContent=this.inverseFn(t),Yt(null);const e=this.api.parent(this.bottomMarker);l(this.api,t,e,this.inverseContent,this.bottomMarker)}destroyInverseSync(){if(null===this.inverseContent)return;const t=this.inverseContent;this.inverseContent=null,c(t,!0,this.api),this.clearInverseNodes()}clearInverseNodes(){const{topMarker:t,bottomMarker:e,api:n}=this;let s=t.nextSibling;for(;s&&s!==e;){const t=s.nextSibling;n.destroy(s),s=t}}async destroyInverseAsync(){if(null===this.inverseContent)return;const t=this.inverseContent;this.inverseContent=null,await d(t,!0,this.api),this.clearInverseNodes()}keyForItem(t,e,n){}getTargetNode(e){if(e>0)return this.bottomMarker;{let e;const n=this.api.comment();return t()?e=this.api.parent(n):(e=this.api.fragment(),this.api.insert(e,n)),n}}updateItems(t,e,n){const{indexMap:s,keyMap:r,bottomMarker:i,keyForItem:o,ItemComponent:a,isFirstRender:h,api:c,itemMarkers:u,markerSet:d,_existKeys:f,_existNewIdx:p,_existOldIdx:m,_lisResult:y,_itemKeys:g,_moveSet:v,_freshMoveKeys:_}=this;f.length=0,p.length=0,m.length=0,g.length=t.length,v.clear(),_.clear();const I=e-n,b=this;let C=t.length?this.getTargetNode(I):i,M=0,w=h;Yt(b);for(let E=0;E<t.length;E++){const e=t[E];M===I&&(w=!0,C===i&&(C=this.getTargetNode(0)));const n=o(e,E,t);if(g[E]=n,r.has(n)){M++;const t=s.get(n);f.push(n),p.push(E),m.push(t),t!==E&&s.set(n,E)}else{let t=u.get(n);t||(t=c.comment(),u.set(n,t),d.add(t));let i=E;if(this.hasIndex){const t=ot(()=>{if(rt(e))return E;const t=this.tag.value,s=t.indexOf(e);if(-1===s)return t.findIndex((e,s)=>o(e,s,t)===n);if(o(e,s,t)===n)return s;for(let r=s+1;r<t.length;r++)if(t[r]===e&&o(t[r],r,t)===n)return r;return s});i=t,this.indexFormulaMap||(this.indexFormulaMap=/* @__PURE__ */new Map),this.indexFormulaMap.set(n,t)}const h=a(e,i,b);if(r.set(n,h),s.set(n,E),w){const e=c.parent(C);c.insert(e,t,C),null!=h&&l(c,b,e,h,C)}else v.add(n),_.add(n)}}if(f.length>1){const t=function(t,e){const n=t.length,s=e??/* @__PURE__ */new Set;if(e&&e.clear(),0===n)return s;const r=Ut,i=Xt,o=qt;r.length=0,i.length=0,o.length=n;for(let l=0;l<n;l++){let e=0,n=r.length;for(;e<n;){const s=e+n>>1;r[s]<t[l]?e=s+1:n=s}r[e]=t[l],i[e]=l,o[l]=e>0?i[e-1]:-1}let a=i[r.length-1];for(let l=r.length-1;l>=0;l--)s.add(a),a=o[a];return s}(m,y);for(let e=0;e<f.length;e++)t.has(e)||v.add(f[e])}else 1===f.length&&m[0]!==p[0]&&v.add(f[0]);if(Yt(null),C!==i){const t=c.parent(C),e=c.parent(i);gt||t&&c.destroy(C),t&&e!==t&&c.insert(e,t,i)}if(v.size>0){const e=c.parent(i);let n=i;const s=this._dupItemsRef===t&&this._dupHasDupes,o=this._processedKeys;s&&o.clear();for(let i=t.length-1;i>=0;i--){const t=g[i],a=s&&o.has(t);if(!v.has(t)||a){const e=u.get(t);e&&(n=e);continue}s&&o.add(t);const h=u.get(t);if(h){if(_.has(t)){const s=r.get(t);c.insert(e,h,n),null!=s&&l(c,b,e,s,n)}else this.relocateItem(h,n,e);n=h}}}h&&(this.isFirstRender=!1)}}class Zt extends Qt{_syncInProgress=!1;constructor(t,e,n){super(t,e,n),nt(this,()=>{this._syncInProgress||(this.inverseFn=null,this.destroyInverseSync(),this.syncList([]))},ft(this.tag,t=>{mt(this)||this._syncInProgress||this.syncList(m(t))}))}fastCleanup(){const{keyMap:t,bottomMarker:e,topMarker:n,indexMap:s,indexFormulaMap:r,api:i}=this,o=i.parent(e);if(o&&o.lastChild===e&&o.firstChild===n){this.detachTreeChildren();for(const e of t.values())c(e,!0,this.api);if(r){for(const t of r.values())t.destroy();r.clear()}return this.api.clearChildren(o),this.api.insert(o,n),this.api.insert(o,e),t.clear(),s.clear(),this.itemMarkers.clear(),this.markerSet.clear(),!0}return!1}syncList(t){if(Array.isArray(t)||(t=m(t)),!this._syncInProgress){this._syncInProgress=!0,this._dupItemsRef=null;try{const{keyMap:e,keyForItem:n}=this;if(t.length>0&&null!==this.inverseContent&&this.destroyInverseSync(),0===t.length&&!this.isFirstRender&&this.fastCleanup())return void(this.inverseFn&&this.renderInverse());let s=e.size,r=0;if(s>0&&!this.isAppendOnlySuperset(t,s,n)){const i=this.keysForItems(t,n),o=this._keysToRemove,a=this._rowsToRemove;o.length=0,a.length=0;for(const[t,n]of e.entries())i.has(t)||(o.push(t),a.push(n));if(o.length){o.length===s&&(this.fastCleanup()?(s=0,o.length=0):this.detachTreeChildren()),r=o.length;for(let t=0;t<o.length;t++)this.destroyItem(a[t],o[t])}a.length=0}this.updateItems(t,s,r),0===t.length&&this.inverseFn&&this.renderInverse()}finally{this._syncInProgress=!1}}}destroyItem(t,e){const{keyMap:n,indexMap:s,indexFormulaMap:r}=this;if(n.delete(e),s.delete(e),r){const t=r.get(e);t&&(t.destroy(),r.delete(e))}let i=Array.isArray(t);if(!i)if(null!==t&&"object"==typeof t){const e=t[tt];void 0!==e&&J.get(e)!==this[tt]||(i=!0)}else i=!0;if(i)c(t,!1,this.api);else{const e=t?.[lt];if(Array.isArray(e))for(let t=0;t<e.length;t++){const n=e[t];if(n&&"object"==typeof n&&"nodeType"in n){const t=n;if(t.isConnected)try{this.api.destroy(t)}catch{}}}}this.removeMarker(e)}}class Jt extends Qt{destroyPromise=null;constructor(t,e,n){super(t,e,n),nt(this,()=>{if(this.destroyPromise)return this.destroyPromise},async()=>{this.inverseFn=null,await this.destroyInverseAsync(),await this.syncList([])},ft(this.tag,async t=>{mt(this)||await this.syncList(m(t))}))}async fastCleanup(){const{bottomMarker:t,topMarker:e,keyMap:n,indexMap:s,indexFormulaMap:r,api:i}=this,o=i.parent(t);if(o&&o.lastChild===t&&o.firstChild===e){const i=mt(this);this.detachTreeChildren();const a=Array(n.size);let l=0;for(const t of n.values())a[l]=d(t,!0,this.api),l++;if(await Promise.all(a),a.length=0,r){for(const t of r.values())t.destroy();r.clear()}return i||(this.api.clearChildren(o),this.api.insert(o,e),this.api.insert(o,t)),n.clear(),s.clear(),this.itemMarkers.clear(),this.markerSet.clear(),!0}return!1}async syncList(t){if(Array.isArray(t)||(t=m(t)),this._dupItemsRef=null,t.length>0&&null!==this.inverseContent&&await this.destroyInverseAsync(),0===t.length&&!this.isFirstRender&&await this.fastCleanup())return void(this.inverseFn&&this.renderInverse());const{keyMap:e,keyForItem:n}=this;let s=e.size,r=0;if(s>0&&!this.isAppendOnlySuperset(t,s,n)){const i=this._keysToRemove,o=this._rowsToRemove;i.length=0,o.length=0;const a=[],l=this.keysForItems(t,n);for(const[t,n]of e.entries())l.has(t)||(i.push(t),o.push(n));if(i.length){i.length===s&&(await this.fastCleanup()?(s=0,i.length=0):this.detachTreeChildren()),r=i.length;for(let t=0;t<i.length;t++)a.push(this.destroyItem(o[t],i[t]))}o.length=0;const h=Promise.all(a);a.length&&(this.destroyPromise=h,h.then(()=>{this.destroyPromise=null}))}this.updateItems(t,s,r),0===t.length&&this.inverseFn&&this.renderInverse()}async destroyItem(t,e){const{keyMap:n,indexMap:s,indexFormulaMap:r}=this;if(n.delete(e),s.delete(e),r){const t=r.get(e);t&&(t.destroy(),r.delete(e))}await d(t,!1,this.api),this.removeMarker(e)}}class te{isDestructorRunning=!1;prevComponent=null;condition;destructors=[];runNumber=0;lastValue=!1;target;placeholder;throwedError=null;destroyPromise=null;[lt]=[];[tt]=ht();branchDomNodes=[];trueBranch;falseBranch;constructor(t,e,s,r,i,o){this.target=s,this.placeholder=r,this.setupCondition(e),this.trueBranch=i,this.falseBranch=o,WITH_DYNAMIC_EVAL&&null!=t&&"object"==typeof t&&"$_eval"in t&&(this.$_eval=t.$_eval),vt(t,this),this.api=n(this),this.destructors.push(ft(this.condition,this.syncState.bind(this))),0===this.runNumber&&this.syncState(this.condition.value),nt(t,this.destroy.bind(this))}checkStatement(t){if(this.runNumber++,!(this.runNumber>1&&this.lastValue===!!t||this.isDestructorRunning))return this.lastValue=!!t,!0}async reInit(){this.destructors.shift(),this.throwedError=null,this.runNumber=0,this.destructors.unshift(ft(this.condition,this.syncState.bind(this)))}syncState(t){if(this.throwedError)throw Promise.resolve().then(async()=>{await this.reInit()}),this.throwedError;if(!this.checkStatement(t))return;const e=t?this.trueBranch:this.falseBranch;this.renderBranch(e,this.runNumber)}renderBranch(t,e){if(this.destroyPromise)this.destroyPromise.then(()=>{this.destroyPromise=null,this.validateEpoch(e)&&this.renderBranch(t,e)}).catch(()=>{this.destroyPromise=null});else{if(this.prevComponent||this.branchDomNodes.length>0){const n=Array.isArray(this.prevComponent)&&0===this.prevComponent.length;if(globalThis.__GXT_MODE__){if(this.destroyBranchSync(),!this.validateEpoch(e))return;return void this.renderState(t)}if(n&&0===this.branchDomNodes.length){if(this.prevComponent=null,!this.validateEpoch(e))return;return void this.renderState(t)}return this.destroyPromise=this.destroyBranch(),void this.destroyPromise.then(()=>{this.destroyPromise=null,this.validateEpoch(e)&&this.renderBranch(t,e)}).catch(()=>{this.destroyPromise=null})}this.validateEpoch(e)&&this.renderState(t)}}validateEpoch(t){return!(this.isDestructorRunning||this.runNumber!==t&&(this.throwedError=Error("ERROR_0"),1))}removeOrphanBranchDom(){const t=this.branchDomNodes;if(0!==t.length){for(let e=0;e<t.length;e++){const n=t[e];if(n&&n.parentNode)try{n.parentNode.removeChild(n)}catch{}}this.branchDomNodes=[]}}destroyBranchSync(){const t=this.prevComponent;this.prevComponent=null,null!==t&&c(t,!1,this.api),this.removeOrphanBranchDom()}async destroyBranch(){const t=this.prevComponent;this.prevComponent=null,null!==t&&await d(t,!1,this.api),this.removeOrphanBranchDom()}renderState(t){const e=this.api.parent(this.placeholder)?this.placeholder.previousSibling:null;try{Yt(this),this.prevComponent=t(this)}finally{Yt(null)}l(this.api,this,this.api.parent(this.placeholder)||this.target,this.prevComponent,this.placeholder);const n=this.api.parent(this.placeholder);if(n){const t=[];let s=e?e.nextSibling:n.firstChild;for(;s&&s!==this.placeholder;)t.push(s),s=s.nextSibling;this.branchDomNodes=t}else this.branchDomNodes=[];null!==this.prevComponent&&u(this.prevComponent)}async destroy(){if(this.isDestructorRunning)throw Error("Already destroying");this.isDestructorRunning=!0,It(this),this.placeholder.isConnected,await this.destroyBranch();const t=[];yt(this,t),t.length&&await Promise.all(t),await Promise.all(this.destructors.map(t=>t()))}setupCondition(t){Z(t)?this.condition=ot(()=>{const e=t(),n=globalThis.__gxtToBool;return n?n(e):rt(e)||it(e)?!!e:dt(e)?!!e.value:!!e}):rt(t)?this.condition=ot(()=>t):this.condition=t}}const ee={component:{canHandle:t=>!1,handle(t,e,n,s){}},modifier:{canHandle:t=>!1,handle(t,e,n,s){}},helper:{canHandle:t=>!1,handle(t,e,n){}}},ne=[[],[],[]],se=Object.seal(Object.freeze({})),re=/* @__PURE__ */Symbol.for("gxt-slots"),ie=/* @__PURE__ */Symbol.for("gxt-props"),oe=function(){K(this,arguments);const t=s(this,kt),e=s(this,Rt,!1),n=e?.factory(Ht)??new $t(t.document);return i(this,Nt,n),(()=>{K(this,arguments);const t=V(this,arguments);return U([/* @__PURE__ */ve("default",()=>[],t,this)],this)})()},ae=function(){K(this,arguments);const t=s(this,kt),e=s(this,Rt,!1),n=e?.factory()??new jt(t.document);return i(this,Nt,n),(()=>{K(this,arguments);const t=V(this,arguments);return U([/* @__PURE__ */ve("default",()=>[],t,this)],this)})()},le=function(){K(this,arguments);const t=s(this,kt),e=s(this,Rt,!1),n=e?.factory(Pt)??new Wt(t.document);return i(this,Nt,n),(()=>{K(this,arguments);const t=V(this,arguments);return U([/* @__PURE__ */ve("default",()=>[],t,this)],this)})()},he="className",ce="0",ue="1";let de=0;const fe=/* @__PURE__ */new WeakSet,pe=/* @__PURE__ */new WeakSet,me=(t,e,n,s)=>{const r=!s&&n&&"object"==typeof n&&(n.hasOwnProperty("$_eval")||n.hasOwnProperty(bt)||void 0!==n[bt]),i=s??(r?n:void 0),o=s?n:r?{}:n??{};if("function"==typeof t){if("ember"===t.helperType){const e=Y(o,!1),n=new t;return(...t)=>n.compute.call(n,D(t),e)}if("undefined"!=typeof EmberFunctionalHelpers&&EmberFunctionalHelpers.has(t)){const e=Y(o,!1);return(...n)=>t(D(n),e)}if(WITH_EMBER_INTEGRATION&&!0===t.isHelperFactory&&ee.helper.canHandle(t))return ee.helper.handle(t,e,o);if(WITH_EMBER_INTEGRATION){let n;if(pe.has(t))n=!1;else if(fe.has(t))n=!0;else{const e=Function.prototype.toString.call(t);n=99===e.charCodeAt(0)&&e.startsWith("class "),(n?fe:pe).add(t)}if(n&&ee.helper.canHandle(t))return ee.helper.handle(t,e,o)}return t(...D(e))}if(WITH_EMBER_INTEGRATION&&ee.helper.canHandle(t))return ee.helper.handle(t,e,o);if("string"==typeof t){const n=Y(o,!1);if(WITH_DYNAMIC_EVAL){const n=i?.$_eval??globalThis.$_eval;if("function"==typeof n)try{const s=n(t);return"function"==typeof s?s(...D(e)):s}catch(a){return}}const s=O(n,i);for(let r=0;r<s.length;r++){const n=s[r];if(t in n){const s=n[t];return"function"==typeof s?s(...D(e)):s}}}return t},ye={get(t,e){if(e in t)return Z(t[e])?t[e]():t[e]},set:()=>!1},ge=function(t,e,s,r){const i=n(r),{outlet:o,placeholder:a}=L(i);return j(o,new te(r,t,o,a,e,s))},ve=function(t,e,s,r){if(!(t in s)){const i=n(r),o=i.comment("");let a=!1,h=()=>[];return Object.defineProperty(s,t,{set(t){a=!0,h=t;const n=B(h,e,0,r);l(i,r,i.parent(o),n,o)},get(){if(a)return h}}),o}return B(s[t],e,0,r)},_e=P,Ie=t=>t,be=(t,e,n,s)=>{if(WITH_EMBER_INTEGRATION&&ee.modifier.canHandle(t))return ee.modifier.handle(t,e,n,s);if(t&&"function"==typeof t&&"emberModifier"in t){const r=new t;r.modify=r.modify.bind(r);const i=[];return()=>(requestAnimationFrame(()=>{const t=ot(()=>{const t=D([...n]);r.modify(e,t,s())});i.push(ft(t,()=>{}))}),()=>{i.forEach(t=>t()),"willDestroy"in r&&r.willDestroy(),f(r)})}return"undefined"!=typeof EmberFunctionalModifiers&&EmberFunctionalModifiers.has(t)?e=>{const r=s(),i={},o=Object.keys(r);for(let t=0;t<o.length;t++){const e=o[t];Object.defineProperty(i,e,{enumerable:!0,get:()=>g(r[e])})}const a=D([...n]);return t(e,a,i)}:"function"==typeof t?e=>{const r=D([...n]),i=s(),o={},a=Object.keys(i);for(let t=0;t<a.length;t++){const e=a[t];o[e]=g(i[e])}return t(e,r,o)}:t},Ce=t=>t,Me=function(e,s,r,i=[]){de++;const o=n(r),a="function"==typeof e?e():e,h=o.element(a);gt&&o.attr(h,"data-node-id",de+"");const c=[],u=[];let d=null;const f=t=>{d=t};if(ne!==s){const t="object"==typeof s[3],e=t?/* @__PURE__ */new Set:null;if(!0===t)for(let n=0;n<s[3][2].length;n++)w(o,h,s[3][2][n][0],s[3][2][n][1],c);for(let n=0;n<s[2].length;n++)w(o,h,s[2][n][0],s[2][n][1],c);!0===t&&k(o,s[3][1],h,e,c),k(o,s[1],h,e,c),!0===t&&R(o,s[3][0],h,e,c,u,f),R(o,s[0],h,e,c,u,f)}if(function(t,e,n,s){if(0!==n.length)if(1===n.length)C(t,e,he,n[0],s);else{const r=[],i=n.map(t=>{if(Z(t)){const e=ot(()=>at(t));if(e.isConst){const t=e.value;return e.destroy(),t}return r.push(e),e}return t}),o=ot(()=>i.join(" "),e.tagName+".className");o.isConst||r.push(o),C(t,e,he,o,s),r.length>0&&s.push(()=>{for(const t of r)t.destroy()})}}(o,h,u,c),SUPPORT_SHADOW_DOM){let e=null!==d?t()?h.shadowRoot:h.attachShadow({mode:d})||h.shadowRoot:h;for(let t=0;t<i.length;t++)l(o,r,e,i[t],null,!0)}else for(let t=0;t<i.length;t++)l(o,r,h,i[t],null,!0);return c.length&&wt(r,c),h},we=t=>n(t);export{ie as $,A,me as B,be as C,_ as D,ve as E,Me as F,F as G,D as H,g as I,jt as J,kt as K,Ot as L,r as M,o as N,c as O,s as P,T as Q,Nt as R,zt as S,E as T,n as U,Gt as V,i as W,Vt as X,q as Y,S as Z,a as _,re as a,f as a0,Yt as a1,X as a2,te as a3,Dt as a4,Jt as a5,Zt as a6,t as a7,Ht as a8,Lt as a9,Bt as aa,Pt as ab,e as ac,Rt as ad,$t as ae,Wt as af,l as ag,K as b,G as c,O as d,V as e,ae as f,ee as g,le as h,oe as i,y as j,we as k,Y as l,_e as m,Ie as n,v as o,z as p,W as q,$ as r,ne as s,se as t,U as u,x as v,N as w,Ce as x,I as y,ge as z};