x4js 2.0.11 → 2.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -15
- package/lib/README.txt +15 -15
- package/lib/cjs/x4.css +1 -1
- package/lib/cjs/x4.js +1 -1
- package/lib/esm/x4.css +1 -1
- package/lib/esm/x4.mjs +1 -1
- package/lib/src/components/base.scss +25 -26
- package/lib/src/components/boxes/boxes.module.scss +37 -37
- package/lib/src/components/boxes/boxes.ts +129 -125
- package/lib/src/components/breadcrumb/breadcrumb.scss +28 -0
- package/lib/src/components/breadcrumb/breadcrumb.ts +84 -0
- package/lib/src/components/breadcrumb/chevron-right.svg +1 -0
- package/lib/src/components/btngroup/btngroup.module.scss +28 -28
- package/lib/src/components/btngroup/btngroup.ts +119 -101
- package/lib/src/components/button/button.module.scss +154 -153
- package/lib/src/components/button/button.ts +117 -117
- package/lib/src/components/calendar/calendar.module.scss +162 -162
- package/lib/src/components/calendar/calendar.ts +326 -325
- package/lib/src/components/checkbox/check.svg +3 -3
- package/lib/src/components/checkbox/checkbox.module.scss +141 -141
- package/lib/src/components/checkbox/checkbox.ts +125 -124
- package/lib/src/components/colorinput/colorinput.module.scss +64 -64
- package/lib/src/components/colorinput/colorinput.ts +90 -87
- package/lib/src/components/colorpicker/colorpicker.module.scss +132 -132
- package/lib/src/components/colorpicker/colorpicker.ts +481 -476
- package/lib/src/components/combobox/combobox.module.scss +123 -120
- package/lib/src/components/combobox/combobox.ts +192 -190
- package/lib/src/components/combobox/updown.svg +3 -3
- package/lib/src/components/components.ts +34 -0
- package/lib/src/components/dialog/dialog.module.scss +71 -71
- package/lib/src/components/dialog/dialog.ts +94 -92
- package/lib/src/components/form/form.module.scss +34 -34
- package/lib/src/components/form/form.ts +41 -36
- package/lib/src/components/grid/datastore.ts +1298 -0
- package/lib/src/components/grid/gridview.ts +1108 -0
- package/lib/src/components/grid/memdb.ts +325 -0
- package/lib/src/components/header/header.module.scss +39 -39
- package/lib/src/components/header/header.ts +129 -123
- package/lib/src/components/icon/icon.module.scss +29 -29
- package/lib/src/components/icon/icon.ts +136 -134
- package/lib/src/components/image/image.module.scss +20 -20
- package/lib/src/components/image/image.ts +68 -66
- package/lib/src/components/input/input.module.scss +69 -69
- package/lib/src/components/input/input.ts +275 -274
- package/lib/src/components/label/label.module.scss +58 -52
- package/lib/src/components/label/label.ts +64 -55
- package/lib/src/components/link/link.ts +78 -0
- package/lib/src/components/listbox/listbox.module.scss +103 -103
- package/lib/src/components/listbox/listbox.ts +431 -427
- package/lib/src/components/menu/menu.module.scss +107 -107
- package/lib/src/components/menu/menu.ts +171 -168
- package/lib/src/components/messages/messages.module.scss +48 -47
- package/lib/src/components/messages/messages.ts +68 -63
- package/lib/src/components/normalize.scss +386 -386
- package/lib/src/components/notification/notification.module.scss +81 -81
- package/lib/src/components/notification/notification.ts +109 -108
- package/lib/src/components/panel/panel.module.scss +47 -47
- package/lib/src/components/panel/panel.ts +57 -56
- package/lib/src/components/popup/popup.module.scss +43 -43
- package/lib/src/components/popup/popup.ts +396 -395
- package/lib/src/components/progress/progress.module.scss +56 -56
- package/lib/src/components/progress/progress.ts +43 -42
- package/lib/src/components/rating/rating.module.scss +22 -22
- package/lib/src/components/rating/rating.ts +131 -125
- package/lib/src/components/shared.scss +90 -76
- package/lib/src/components/sizers/sizer.module.scss +89 -89
- package/lib/src/components/sizers/sizer.ts +123 -119
- package/lib/src/components/slider/slider.module.scss +70 -70
- package/lib/src/components/slider/slider.ts +147 -142
- package/lib/src/components/switch/switch.module.scss +126 -126
- package/lib/src/components/switch/switch.ts +61 -55
- package/lib/src/components/tabs/tabs.module.scss +46 -46
- package/lib/src/components/tabs/tabs.ts +168 -157
- package/lib/src/components/textarea/textarea.module.scss +59 -59
- package/lib/src/components/textarea/textarea.ts +60 -54
- package/lib/src/components/textedit/textedit.module.scss +113 -113
- package/lib/src/components/textedit/textedit.ts +83 -82
- package/lib/src/components/themes.scss +81 -77
- package/lib/src/components/tooltips/tooltips.scss +50 -50
- package/lib/src/components/tooltips/tooltips.ts +103 -102
- package/lib/src/components/treeview/treeview.module.scss +115 -115
- package/lib/src/components/treeview/treeview.ts +410 -403
- package/lib/src/components/viewport/viewport.module.scss +24 -24
- package/lib/src/components/viewport/viewport.ts +41 -38
- package/lib/src/core/component.ts +1002 -979
- package/lib/src/core/core_application.ts +44 -0
- package/lib/src/core/core_colors.ts +249 -249
- package/lib/src/core/core_dom.ts +471 -471
- package/lib/src/core/core_dragdrop.ts +200 -200
- package/lib/src/core/core_element.ts +97 -97
- package/lib/src/core/core_events.ts +149 -149
- package/lib/src/core/core_i18n.ts +377 -377
- package/lib/src/core/core_router.ts +221 -221
- package/lib/src/core/core_styles.ts +214 -214
- package/lib/src/core/core_svg.ts +550 -550
- package/lib/src/core/core_tools.ts +688 -673
- package/lib/src/demo/assets/radio.svg +3 -3
- package/lib/src/demo/index.html +11 -11
- package/lib/src/demo/main.scss +21 -21
- package/lib/src/demo/main.tsx +323 -323
- package/lib/src/types/scss.d.ts +4 -4
- package/lib/src/types/x4react.d.ts +8 -8
- package/lib/src/x4.scss +18 -18
- package/lib/src/x4.ts +31 -60
- package/lib/styles/x4.css +1 -1
- package/lib/types/x4js.d.ts +100 -49
- package/package.json +2 -3
- package/src/x4.ts +31 -60
- package/lib/output.d.ts +0 -1472
package/lib/cjs/x4.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var vn=Object.defineProperty;var ao=s=>{throw TypeError(s)};var i=(s,e)=>vn(s,"name",{value:e,configurable:!0});var lo=(s,e,t)=>e.has(s)||ao("Cannot "+t);var D=(s,e,t)=>(lo(s,e,"read from private field"),t?t.call(s):e.get(s)),De=(s,e,t)=>e.has(s)?ao("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(s):e.set(s,t),Le=(s,e,t,o)=>(lo(s,e,"write to private field"),o?o.call(s,t):e.set(s,t),t);var co=Symbol("i18n"),G={};function po(s,e){G[s]={name:s,base:e,src_translations:{},translations:{}}}i(po,"createLanguage");function ho(s){return G[s]!==void 0}i(ho,"isLanguage");function uo(s,...e){if(!ho(s))return;let t=G[s];e.forEach(o=>{mo(t.src_translations,o)}),t.translations=xo(t.src_translations,t.base,!0)}i(uo,"addTranslation");function mo(s,e){for(let t in e){let o=e[t];typeof o=="string"?s[t]=o:Array.isArray(o)&&(!s[t]||!Array.isArray(s[t]))?s[t]=[...o]:!s[t]||typeof s[t]!="object"?s[t]={...o}:mo(s[t],e[t])}}i(mo,"_patch");function xo(s,e,t){let o={};for(let n in s)typeof s[n]!="string"&&!Array.isArray(s[n])?o[n]=xo(s[n],e,!1):o[n]=s[n];return _n(o,e,t)}i(xo,"_proxyfy");function _n(s,e,t){return new Proxy(s,{get:i((o,n)=>{t?le=[n]:le.push(n);let r=o[n];return r===void 0&&(e&&(r=wn(e)),r===void 0&&console.error("I18N error: unable to find","_tr."+le.join("."))),r},"get")})}i(_n,"_mk_proxy");var le;function wn(s){for(;s;){let e=G[s],t=e.translations,o;for(let n of le){if(o=t[n],o===void 0)break;t=o}if(o!==void 0)return t;s=e.base}}i(wn,"_findBaseTrans");var x={};function yn(s){if(ho(s))return x=G[s].translations,x[co]=s,x}i(yn,"selectLanguage");function or(){return x[co]}i(or,"getCurrentLanguage");function nr(){return Object.keys(G)}i(nr,"getAvailableLanguages");var Cn={global:{ok:"OK",cancel:"Annuler",ignore:"Ignorer",yes:"Oui",no:"Non",abort:"Abandonner",retry:"Réessayer",error:"Erreur",today:"Aujourd'hui",open:"Ouvrir",new:"Nouveau",delete:"Supprimer",close:"Fermer",save:"Enregistrer",search:"Rechercher",search_tip:"Saisissez le texte à rechercher. <b>Enter</b> pour lancer la recherche. <b>Esc</b> pour annuler.",required_field:"information requise",invalid_format:"format invalide",invalid_email:"adresse mail invalide",invalid_number:"valeur numérique invalide",diff_date_seconds:"{0} secondes",diff_date_minutes:"{0} minutes",diff_date_hours:"{0} heures",invalid_date:"Date non reconnue ({0})",empty_list:"Liste vide",date_input_formats:"d/m/y|d.m.y|d m y|d-m-y|dmy",date_format:"D/M/Y",day_short:["dim","lun","mar","mer","jeu","ven","sam"],day_long:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],month_short:["jan","fév","mar","avr","mai","jun","jui","aoû","sep","oct","nov","déc"],month_long:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],property:"Propriété",value:"Valeur",err_403:"Vous n'avez pas les droits suffisants pour effectuer cette action",copy:"Copier",cut:"Couper",paste:"Coller"}},En={global:{ok:"OK",cancel:"Cancel",ignore:"Ignore",yes:"Yes",no:"No",abort:"Abort",retry:"Retry",error:"Error",today:"Today",open:"Open",new:"New",delete:"Delete",close:"Close",save:"Save",search:"Search",search_tip:"Type in the text to search. <b>Enter</b> to start the search. <b>Esc</b> to cancel.",required_field:"missing information",invalid_format:"invalid format",invalid_email:"invalid email address",invalid_number:"bad numeric value",diff_date_seconds:"{0} seconds",diff_date_minutes:"{0} minutes",diff_date_hours:"{0} hours",invalid_date:"Unrecognized date({0})",empty_list:"Empty list",date_input_formats:"m/d/y|m.d.y|m d y|m-d-y|mdy",date_format:"M/D/Y",day_short:["sun","mon","tue","wed","thu","fri","sat"],day_long:["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],month_short:["jan","feb","mar","apr","may","jun","jui","aug","sep","oct","nov","dec"],month_long:["january","february","march","april","mau","june","jully","august","september","october","november","december"],property:"Property",value:"Value",err_403:"You do not have sufficient rights to do that action",copy:"Copy",cut:"Cut",paste:"Paste"}};po("fr",null);uo("fr",Cn);po("en","fr");uo("en",En);yn("fr");function I(s){return typeof s=="string"}i(I,"isString");function N(s){return typeof s=="number"&&isFinite(s)}i(N,"isNumber");function Ae(s){return s instanceof Array}i(Ae,"isArray");function ar(s){return s instanceof Function}i(ar,"isFunction");var Re=class Re extends String{constructor(e){super(e)}};i(Re,"UnsafeHtml");var j=Re;function ce(s){return new j(s)}i(ce,"unsafeHtml");function L(s,e,t){return s<e?e:s>t?t:s}i(L,"clamp");var Oe=class Oe{constructor(e,t,o,n){e!==void 0&&(N(e)?(this.left=e,this.top=t,this.width=o,this.height=n):Object.assign(this,e))}get right(){return this.left+this.width}get bottom(){return this.top+this.height}};i(Oe,"Rect");var H=Oe;function de(s){switch(s){case"eyedropper":return"EyeDropper"in window}return!1}i(de,"isFeatureAvailable");var He=class He{setTimeout(e,t,o){this._timers?this.clearTimeout(e):this._timers=new Map;let n=setTimeout(o,t);return this._timers.set(e,n),n}clearTimeout(e){this._timers&&this._timers.has(e)&&(clearTimeout(this._timers.get(e)),this._timers.delete(e))}setInterval(e,t,o){this._timers?this.clearInterval(e):this._timers=new Map;let n=setInterval(o,t);return this._timers.set(e,n),n}clearInterval(e){this._timers&&this._timers.has(e)&&(clearInterval(this._timers.get(e)),this._timers.delete(e))}clearAllTimeouts(){var e;(e=this._timers)==null||e.forEach(t=>{clearTimeout(t)}),this._timers=null}};i(He,"Timer");var Y=He;function go(s){return requestAnimationFrame(s)}i(go,"asap");function O(s,e,t="0"){let o;return I(s)?o=s:o=""+s,e>0?o.padEnd(e,t):o.padStart(-e,t)}i(O,"pad");function Se(s,...e){return s.replace(/{(\d+)}/g,function(t,o){return typeof e[o]<"u"?e[o]:t})}i(Se,"sprintf");function lr(s){let e=s;return e=e.replace(/([a-z])([A-Z])/g,"$1 $2"),e=e.toLowerCase(),e=e.replace(/[^- a-z0-9]+/g," "),e.indexOf(" ")<0?e:(e=e.trim(),e.replace(/ /g,"-"))}i(lr,"pascalCase");function cr(s){let e=s.toLowerCase();return e=e.replace(/[^a-zA-Z0-9]+(.)/g,(t,o)=>o.toUpperCase()),e}i(cr,"camelCase");var kn="fr-FR";function dr(s){kn=s}i(dr,"_date_set_locale");function pr(s,e){return B(s)}i(pr,"date_format");function hr(s,e,t){var o=(s.getTime()-e.getTime())/1e3;let n=o;if(n<60)return Se(x.global.diff_date_seconds,Math.round(n));let r=Math.floor(n/60);if(r<60)return Se(x.global.diff_date_minutes,Math.round(r));let a=Math.floor(r/60);return Se(x.global.diff_date_hours,a,r%60)}i(hr,"date_diff");function ur(s,e){return e?B(s,"Y-M-D H:I:S"):B(s,"Y-M-D")}i(ur,"date_to_sql");function mr(s){return new Date(s+" GMT")}i(mr,"date_sql_utc");function V(s){return s.getFullYear()<<16|s.getMonth()<<8|s.getDate()}i(V,"date_hash");function W(s){return new Date(s.getTime())}i(W,"date_clone");function bo(s){let e=new Date(s.getFullYear(),0,1),t=(s.valueOf()-e.valueOf())/864e5;return Math.floor((t+e.getDay()+1)/7)}i(bo,"date_calc_weeknum");function xr(s,e=x.global.date_input_formats){var o,n,r,a,l,c;let t=e.split("|");for(let p of t){let m="";for(let b of p)b=="d"||b=="D"?m+="(?<day>\\d{1,2})":b=="m"||b=="M"?m+="(?<month>\\d{1,2})":b=="y"||b=="Y"?m+="(?<year>\\d{1,4})":b=="h"||b=="H"?m+="(?<hour>\\d{1,2})":b=="i"||b=="I"?m+="(?<min>\\d{1,2})":b=="s"||b=="S"?m+="(?<sec>\\d{1,2})":b==" "?m+="\\s+":m+="\\s*\\"+b+"\\s*";let w=new RegExp("^"+m+"$","m").exec(s);if(w){let b=new Date,oe=parseInt((o=w.groups.day)!=null?o:"1"),F=parseInt((n=w.groups.month)!=null?n:"1"),U=parseInt((r=w.groups.year)!=null?r:b.getFullYear()+""),se=parseInt((a=w.groups.hour)!=null?a:"0"),mn=parseInt((l=w.groups.min)!=null?l:"0"),xn=parseInt((c=w.groups.sec)!=null?c:"0");U>0&&U<100&&(U+=2e3);let ae=new Date(U,F-1,oe,se,mn,xn,0),bn=ae.getFullYear(),gn=ae.getMonth()+1,fn=ae.getDate();return bn!=U||gn!=F||fn!=oe?null:ae}}return null}i(xr,"parseIntlDate");function B(s,e=x.global.date_format){if(!s)return"";let t={year:s.getFullYear(),month:s.getMonth()+1,day:s.getDate(),wday:s.getDay(),hours:s.getHours(),minutes:s.getMinutes(),seconds:s.getSeconds(),milli:s.getMilliseconds()},o="",n=0;for(let r of e){if(r=="{"){if(++n==1)continue}else if(r=="}"&&--n==0)continue;if(n){o+=r;continue}r=="d"?o+=t.day:r=="D"?o+=O(t.day,-2):r=="j"?o+=x.global.day_short[t.wday]:r=="J"?o+=x.global.day_long[t.wday]:r=="w"?o+=bo(s):r=="W"?o+=O(bo(s),-2):r=="m"?o+=t.month:r=="M"?o+=O(t.month,-2):r=="o"?o+=x.global.month_short[t.month-1]:r=="O"?o+=x.global.month_long[t.month-1]:r=="y"||r=="Y"?o+=O(t.year,-4):r=="a"||r=="A"?o+=t.hours<12?"am":"pm":r=="h"?o+=t.hours:r=="H"?o+=O(t.hours,-2):r=="i"?o+=t.minutes:r=="I"?o+=O(t.minutes,-2):r=="s"?o+=t.seconds:r=="S"?o+=O(t.seconds,-2):r=="l"?o+=t.milli:r=="L"?o+=O(t.milli,-3):o+=r}return o}i(B,"formatIntlDate");function br(s,e){if(e===void 0&&(e=new Date),!s)return 0;let t=e.getFullYear()-s.getFullYear();return(e.getMonth()<s.getMonth()||e.getMonth()==s.getMonth()&&e.getDate()<s.getDate())&&t--,t}i(br,"calcAge");var In=i(function(){this.propagationStopped=!0},"stopPropagation"),Mn=i(function(){this.defaultPrevented=!0},"preventDefault"),Be=class Be{constructor(e=null){this._source=e!=null?e:this}addListener(e,t,o=!1){this._registry||(this._registry=new Map);let n=this._registry.get(e);n||(n=[],this._registry.set(e,n));let r=t;n.indexOf(r)==-1&&(o?n.unshift(r):n.push(r))}fire(e,t){var n;let o=(n=this._registry)==null?void 0:n.get(e);if(o&&o.length){let r=t;if(r||(r={}),r.source||(r.source=this._source),r.type||(r.type=e),r.preventDefault||(r.preventDefault=Mn),r.stopPropagation||(r.stopPropagation=In),o.length==1)o[0](r);else{let a=o.slice();for(let l=0,c=a.length;l<c&&(a[l](r),!r.propagationStopped);l++);}}}};i(Be,"EventSource");var X=Be;var z,A,Ne=class Ne{constructor(){De(this,z);De(this,A)}__startTimer(e,t,o,n){D(this,A)?this.__stopTimer(e):Le(this,A,new Map);let r=(o?setInterval:setTimeout)(n,t);D(this,A).set(e,()=>{(o?clearInterval:clearTimeout)(r),D(this,A).delete(e)})}__stopTimer(e){let t=D(this,A).get(e);t&&t()}setTimeout(e,t,o){this.__startTimer(e,t,!1,o)}clearTimeout(e){this.__stopTimer(e)}setInterval(e,t,o){this.__startTimer(e,t,!0,o)}clearInterval(e){this.__stopTimer(e)}clearTimeouts(){for(let[e,t]of D(this,A))t();D(this,A).clear()}on(e,t){console.assert(t!=null),D(this,z)||Le(this,z,new X(this)),D(this,z).addListener(e,t)}fire(e,t){D(this,z)&&D(this,z).fire(e,t)}};z=new WeakMap,A=new WeakMap,i(Ne,"CoreElement");var pe=Ne;var he={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function _o(s){return!!he[s]}i(_o,"isUnitLess");var q=class q{constructor(){this.m_rules=new Map;function e(t){for(let o=0;o<document.styleSheets.length;o++){let n=document.styleSheets[o];if(n.title===t)return n}}if(i(e,"getStyleSheet"),this.m_sheet=e("x4-dynamic-css"),!this.m_sheet){let t=document.createElement("style");t.setAttribute("id","x4-dynamic-css"),document.head.appendChild(t),this.m_sheet=t.sheet}}setRule(e,t){if(I(t)){let o=this.m_rules.get(e);o!==void 0?this.m_sheet.deleteRule(o):o=this.m_sheet.cssRules.length,this.m_rules.set(e,this.m_sheet.insertRule(t,o))}else{let o=1;for(let n in t){let r=n+" { ",a=t[n];for(let l in a){let c=a[l];for(let p=0;p<c.length;p++)r+=l+": "+c[p]+"; "}r+="}",this.setRule(e+"--"+o,r),o++}}}static getVar(e){return q.doc_style||(q.doc_style=getComputedStyle(document.documentElement)),e.startsWith("--")||(e="--"+e),q.doc_style.getPropertyValue(e)}};i(q,"Stylesheet"),q.guid=1;var fo=q,ze=class ze{constructor(e){this.m_style=e}value(e){return this.m_style[e]}parse(e){return parseInt(this.m_style[e])}get style(){return this.m_style}};i(ze,"ComputedStyle");var vo=ze;var Pn={mouseleave:1,mouseenter:1,load:1,unload:1,scroll:1,focus:1,blur:1,rowexit:1,beforeunload:1,stop:1,dragdrop:1,dragenter:1,dragexit:1,draggesture:1,dragover:1,contextmenu:1,created:2,removed:2,sizechange:2},ue=new WeakMap,Fe=null,Tn=i((s,e)=>{let t=i((n,r)=>{let a=ue.get(n);a&&a[r]&&n.dispatchEvent(new Event(r,{}))},"sendEvent"),o=i((n,r)=>{r&&t(n,"created");for(let a=n.firstChild;a;a=a.nextSibling)o(a,r);r||t(n,"removed")},"notify");for(let n of s)n.type=="childList"&&(n.addedNodes&&n.addedNodes.forEach(r=>{o(r,!0)}),n.removedNodes&&n.removedNodes.forEach(r=>{o(r,!1)}))},"observeMutation"),Ue=null;function Dn(s){s.forEach(e=>{let t=e.target;t.offsetParent!==null&&t.dispatchEvent(new Event("resized"))})}i(Dn,"observeSize");function Ln(s){let e=s.target,t=Pn[s.type]===2;for(;e;){let o=ue.get(e);if(o){let n=o[s.type];if(n&&(Array.isArray(n)?n.some(r=>r(s)):n(s),s.stopPropagation||s.defaultPrevented||t))break}if(e=e.parentNode,e==document)break}}i(Ln,"dispatchEvent");function me(s,e,t,o=!1){e=="removed"||e=="created"?Fe||(Fe=new MutationObserver(Tn),Fe.observe(document.body,{childList:!0,subtree:!0})):e=="resized"&&(Ue||(Ue=new ResizeObserver(Dn)),Ue.observe(s));let n=ue.get(s);if(n||(n={},ue.set(s,n)),!n[e])n[e]=t,s.addEventListener(e,Ln);else{let r=n[e];Array.isArray(r)?r.push(t):n[e]=[r,t]}}i(me,"addEvent");var wo=Symbol("fragment"),yo=Symbol("component"),Sn=/^-?\d+(\.\d*)?$/;function An(s){let e=[],t=Object.getPrototypeOf(s);for(;t&&t.constructor!==d;){let o=t.constructor.name;e.push("x4"+o.toLowerCase()),t=Object.getPrototypeOf(t)}return e}i(An,"genClassNames");var Rn=1e3,R=i(()=>`x4-${Rn++}`,"makeUniqueComponentId"),Z=class Z extends pe{constructor(e){var t,o;if(super(),this.props=e,e.existingDOM)this.dom=e.existingDOM;else{e.ns?this.dom=document.createElementNS(e.ns,(t=e.tag)!=null?t:"div"):this.dom=document.createElement((o=e.tag)!=null?o:"div"),e.attrs&&this.setAttributes(e.attrs),e.cls&&this.addClass(e.cls),e.hidden&&this.show(!1),e.id!==void 0&&this.setAttribute("id",e.id),e.width!==void 0&&this.setStyleValue("width",e.width),e.height!==void 0&&this.setStyleValue("height",e.height),e.tooltip&&this.setAttribute("tooltip",e.tooltip),e.style&&this.setStyle(e.style),e.content&&this.setContent(e.content),e.dom_events&&this.setDOMEvents(e.dom_events);let n=An(this);this.dom.classList.add(...n),e.disabled&&this.addDOMEvent("created",()=>{this.enable(!1)})}this.dom[yo]=this}hasClass(e){return this.dom.classList.contains(e)}addClass(e){if(e)if(e.indexOf(" ")>=0){let t=e.split(" ");this.dom.classList.add(...t)}else this.dom.classList.add(e)}removeClass(e){if(e)if(e.indexOf(" ")>=0){let t=e.split(" ");this.dom.classList.remove(...t)}else this.dom.classList.remove(e)}toggleClass(e){if(!e)return;let t=i(o=>{this.dom.classList.toggle(o)},"toggle");e.indexOf(" ")>=0?e.split(" ").forEach(t):t(e)}setClass(e,t=!0){t?this.addClass(e):this.removeClass(e)}setAttributes(e){for(let t in e){let o=e[t];this.setAttribute(t,o)}}setAttribute(e,t){t==null?this.dom.removeAttribute(e):this.dom.setAttribute(e,""+t)}getAttribute(e){return this.dom.getAttribute(e)}getData(e){return this.getAttribute("data-"+e)}setData(e,t){return this.setAttribute("data-"+e,t)}setInternalData(e,t){return this.store||(this.store=new Map),this.store.set(e,t),this}getInternalData(e){var t;return(t=this.store)==null?void 0:t.get(e)}addDOMEvent(e,t,o=!1){me(this.dom,e,t,o)}setDOMEvents(e){for(let t in e)this.addDOMEvent(t,e[t])}mapPropEvents(e,...t){let o=e;t.forEach(n=>{o.hasOwnProperty(n)&&this.on(n,o[n])})}clearContent(){let e=this.dom;for(;e.firstChild;)e.removeChild(e.firstChild)}setContent(e){this.clearContent(),this.appendContent(e)}appendContent(e){let t=i((o,n)=>{if(n instanceof Z)o.appendChild(n.dom);else if(n instanceof j)o.insertAdjacentHTML("beforeend",n.toString());else if(typeof n=="string"||typeof n=="number"){let r=document.createTextNode(n.toString());o.appendChild(r)}else n&&console.warn("Unknown type to append: ",n)},"set");if(!Ae(e))t(this.dom,e);else if(e.length<=8)for(let o of e)t(this.dom,o);else{let o=document.createDocumentFragment();for(let n of e)t(o,n);this.dom.appendChild(o)}}prependContent(e){let t=this.dom,o=i(n=>{if(n instanceof Z)t.insertBefore(t.firstChild,n.dom);else if(n instanceof j)t.insertAdjacentHTML("beforebegin",n.toString());else if(typeof n=="string"||typeof n=="number"){let r=document.createTextNode(n.toString());t.insertBefore(t.firstChild,r)}else console.warn("Unknown type to append: ",n)},"set");if(!Ae(e))o(e);else{let n=document.createDocumentFragment();for(let r of e)o(r);t.insertBefore(t.firstChild,n)}}removeChild(e){this.dom.removeChild(e.dom)}queryAll(e){let t=this.dom.querySelectorAll(e),o=new Array(t.length);return t.forEach((n,r)=>o[r]=g(n)),o}query(e){let t=this.dom.querySelector(e);return g(t)}setAria(e,t){return this.setAttribute(e,t),this}setStyle(e){let t=this.dom.style;for(let o in e){let n=e[o];!he[o]&&(N(n)||Sn.test(n))&&(n+="px"),t[o]=n}return this}setStyleValue(e,t){let o=this.dom.style;if(N(t)){let n=t+"";he[e]||(n+="px"),o[e]=n}else o[e]=t;return this}getStyleValue(e){return this.dom.style[e]}setWidth(e){this.setStyleValue("width",N(e)?e+"px":e)}setHeight(e){this.setStyleValue("height",N(e)?e+"px":e)}setStyleVariable(e,t){this.dom.style.setProperty(e,t)}getStyleVariable(e){return this.getComputedStyle().getPropertyValue(e)}getComputedStyle(){return getComputedStyle(this.dom)}setCapture(e){this.dom.setPointerCapture(e)}releaseCapture(e){this.dom.releasePointerCapture(e)}getBoundingRect(){let e=this.dom.getBoundingClientRect();return new H(e.x,e.y,e.width,e.height)}focus(){this.dom.focus()}scrollIntoView(e){this.dom.scrollIntoView(e)}isVisible(){return this.dom.offsetParent!==null}show(e=!0){this.setClass("x4hidden",!e)}hide(){this.show(!1)}enable(e=!0){this.setAttribute("disabled",!e),this.enumChildNodes(!0).forEach(o=>{o instanceof HTMLInputElement&&(o.disabled=!e)})}disable(){this.enable(!1)}isDisabled(){return this.getAttribute("disabled")}nextElement(){let e=this.dom.nextElementSibling;return g(e)}prevElement(){let e=this.dom.previousElementSibling;return g(e)}parentElement(e){let t=this.dom;for(;t.parentElement;){let o=g(t.parentElement);if(!e||o&&o instanceof e)return o;t=t.parentElement}return null}firstChild(){let e=this.dom.firstElementChild;return g(e)}lastChild(){let e=this.dom.lastElementChild;return g(e)}enumChildComponents(e){let t=[];return this.enumChildNodes(e).forEach(n=>{let r=g(n);r&&t.push(r)}),t}enumChildNodes(e){return Array.from(e?this.dom.querySelectorAll("*"):this.dom.children)}animate(e,t){this.dom.animate(e,t)}static createElement(e,t,...o){let n;return e==this.createFragment||e===wo?o:(e instanceof Function?(t=t!=null?t:{},!t.children&&o&&o.length&&(t.content=o),n=new e(t!=null?t:{})):n=new Z({tag:e,content:o,...t}),o&&o.length,n)}static createFragment(){return this.createElement(wo,null)}queryInterface(e){return null}};i(Z,"Component");var d=Z;function g(s){return s?s[yo]:null}i(g,"componentFromDOM");function Co(s){let e=g(s);return e||new d({existingDOM:s})}i(Co,"wrapDOM");var Ve=class Ve extends d{constructor(){super({})}};i(Ve,"Flex");var J=Ve;function $(s){return s.toString(16).padStart(2,"0")}i($,"hx");function Q(s){return Math.round(s)}i(Q,"round");var qe=class qe{constructor(...e){this.rgb=[0,0,0,1];this.invalid=!1;I(e[0])?this.setValue(e[0]):this.setRgb(e[0],e[1],e[2],e[3])}setValue(e){if(this.invalid=!1,e.length==4&&/#[0-9a-fA-F]{3}/.test(e)){let t=parseInt(e[1],16),o=parseInt(e[2],16),n=parseInt(e[3],16);return this.setRgb(t<<4|t,o<<4|o,n<<4|n,1)}if(e.length==7&&/#[0-9a-fA-F]{6}/.test(e)){let t=parseInt(e[1],16),o=parseInt(e[2],16),n=parseInt(e[3],16),r=parseInt(e[4],16),a=parseInt(e[5],16),l=parseInt(e[6],16);return this.setRgb(t<<4|o,n<<4|r,a<<4|l,1)}if(e.length==9&&/#[0-9a-fA-F]{8}/.test(e)){let t=parseInt(e[1],16),o=parseInt(e[2],16),n=parseInt(e[3],16),r=parseInt(e[4],16),a=parseInt(e[5],16),l=parseInt(e[6],16),c=parseInt(e[7],16),p=parseInt(e[8],16);return this.setRgb(t<<4|o,n<<4|r,a<<4|l,(c<<4|p)/255)}if(e.startsWith("rgba")){let o=/rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*((\d+)|(\d*\.\d+)|(\.\d+))\s*\)/.exec(e);if(o)return this.setRgb(parseInt(o[1]),parseInt(o[2]),parseInt(o[3]),parseFloat(o[4]))}else if(e.startsWith("rgb")){let o=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(e);if(o)return this.setRgb(parseInt(o[1]),parseInt(o[2]),parseInt(o[3]),1)}else if(e.startsWith("var")){let o=/var\s*\(([^)]*)\)/.exec(e);if(o){let n=o[1].trim(),a=getComputedStyle(document.documentElement).getPropertyValue(n);return this.setValue(a)}}return this.invalid=!0,this.setRgb(255,0,0,1)}setHsv(e,t,o,n=1){let r=Math.min(5,Math.floor(e*6)),a=e*6-r,l=o*(1-t),c=o*(1-a*t),p=o*(1-(1-a)*t),m,E,w;switch(r){case 0:m=o,E=p,w=l;break;case 1:m=c,E=o,w=l;break;case 2:m=l,E=o,w=p;break;case 3:m=l,E=c,w=o;break;case 4:m=p,E=l,w=o;break;case 5:m=o,E=l,w=c;break}return this.setRgb(m*255,E*255,w*255,n)}setRgb(e,t,o,n){return this.rgb=[L(e,0,255),L(t,0,255),L(o,0,255),L(n,0,1)],this}toRgbString(e){let t=this.rgb;return e===!1||t[3]==1?`rgb(${Q(t[0])},${Q(t[1])},${Q(t[2])})`:`rgba(${Q(t[0])},${Q(t[1])},${Q(t[2])},${t[3].toFixed(3)})`}toHexString(){let e=this.rgb;return e[3]==1?`#(${$(e[0])},${$(e[1])},${$(e[2])})`:`rgba(${$(e[0])},${$(e[1])},${$(e[2])},${$(e[3]*255)})`}toRgb(){let e=this.rgb;return{red:e[0],green:e[1],blue:e[2],alpha:e[3]}}toHsv(){let e=this.toRgb();e.red/=255,e.green/=255,e.blue/=255;let t=Math.max(e.red,e.green,e.blue),o=Math.min(e.red,e.green,e.blue),n=t-o,r=t===0?0:n/t,a=t,l;if(n===0)l=0;else switch(t){case e.red:l=(e.green-e.blue)/n/6+(e.green<e.blue?1:0);break;case e.green:l=(e.blue-e.red)/n/6+1/3;break;case e.blue:l=(e.red-e.green)/n/6+2/3;break}return{hue:l,saturation:r,value:a,alpha:e.alpha}}getAlpha(){return this.rgb[3]}setAlpha(e){return this.rgb[3]=L(e,0,1),this}isInvalid(){return this.invalid}};i(qe,"Color");var M=qe;var $e=Symbol("x-drag-cb"),Ge=class Ge{registerDraggableElement(e){e.addDOMEvent("dragstart",t=>{this.dragSource=e,this.dragGhost=e.dom.cloneNode(!0),this.dragGhost.classList.add("dragged"),document.body.appendChild(this.dragGhost),e.addClass("dragging"),t.dataTransfer.setData("text/string","1"),t.dataTransfer.setDragImage(new Image,0,0),t.stopPropagation()}),e.addDOMEvent("drag",t=>{this.dragGhost.style.left=t.pageX+"px",this.dragGhost.style.top=t.pageY+"px"}),e.addDOMEvent("dragend",t=>{e.removeClass("dragging"),this.dragGhost.remove()}),e.setAttribute("draggable","true")}registerDropTarget(e,t,o){let n=i(c=>{if(o&&!o(this.dragSource)){console.log("reject ",e),c.dataTransfer.dropEffect="none";return}console.log("accepted ",e),c.preventDefault(),c.dataTransfer.dropEffect="copy"},"dragEnter"),r=i(c=>{if(o&&!o(this.dragSource)){console.log("reject ",e),c.dataTransfer.dropEffect="none";return}if(c.preventDefault(),this.dropTarget!=e&&(this.dropTarget=e,this._startCheck()),this.dropTarget){let p={pt:{x:c.pageX,y:c.pageY},data:c.dataTransfer};t("drag",this.dragSource,p)}c.dataTransfer.dropEffect="copy"},"dragOver"),a=i(c=>{this.dropTarget=null,c.preventDefault()},"dragLeave"),l=i(c=>{let p={pt:{x:c.pageX,y:c.pageY},data:c.dataTransfer};t("drop",this.dragSource,p),this.dropTarget=null,e.removeClass("drop-over"),c.preventDefault()},"drop");e.addDOMEvent("dragenter",n),e.addDOMEvent("dragover",r),e.addDOMEvent("dragleave",a),e.addDOMEvent("drop",l),e.setInternalData($e,t)}_startCheck(){this.timer&&(clearInterval(this.timer),this._check()),this.timer=setInterval(()=>this._check(),300)}_check(){let e=i(o=>{o.removeClass("drop-over"),o.getInternalData($e)("leave",this.dragSource)},"leaving"),t=i(o=>{o.addClass("drop-over"),o.getInternalData($e)("enter",this.dragSource)},"entering");this.dropTarget?(!this.notified||this.notified!=this.dropTarget)&&(this.notified&&e(this.notified),this.notified=this.dropTarget,t(this.notified)):this.notified&&(e(this.notified),this.notified=null,clearInterval(this.timer))}};i(Ge,"DragManager");var Ke=Ge,$r=new Ke;function On(s,e=!1){if(s instanceof RegExp)return{keys:null,pattern:s};let t=s.split("/"),o=[],n="";t[0]==""&&t.shift();for(let r of t){let a=r[0];if(a==="*")o.push("wild"),n+="/(.*)";else if(a===":"){let l=r.indexOf("?",1),c=r.indexOf(".",1);o.push(r.substring(1,l>=0?l:c>=0?c:r.length)),n+=l>=0&&c<0?"(?:/([^/]+?))?":"/([^/]+?)",c>=0&&(n+=(l>=0?"?":"")+"\\"+r.substring(c))}else n+="/"+r}return{keys:o,pattern:new RegExp(`^${n}${e?"(?=$|/)":"/?$"}`,"i")}}i(On,"parseRoute");var je=class je extends X{constructor(e=!0){super(),this.m_routes=[],this.m_useHash=e,window.addEventListener("popstate",t=>{let o=this._getLocation(),n=this._find(o);n.handlers.forEach(r=>{r(n.params,o)})})}get(e,t){let{keys:o,pattern:n}=On(e);this.m_routes.push({keys:o,pattern:n,handler:t})}init(){this.navigate(this._getLocation())}_getLocation(){return this.m_useHash?"/"+document.location.hash.substring(1):document.location.pathname}navigate(e,t=!0,o=!1){e.startsWith("/")||(e="/"+e);let n=this._find(e);if(!n||n.handlers.length==0){console.log("route not found: "+e),this.fire("error",{code:404,message:"route not found"});return}if(this.m_useHash){for(;e.at(0)=="/";)e=e.substring(1);e="#"+e}o?window.history.replaceState({},"",e):window.history.pushState({},"",e),t&&n.handlers.forEach(r=>{r(n.params,e)})}_find(e){let t=[],o={},n=[];for(let r of this.m_routes)if(r.keys)if(r.keys.length>0){if(t=r.pattern.exec(e),t===null)continue;for(let a=0;a<r.keys.length;)o[r.keys[a]]=t[++a];n=[...n,r.handler]}else r.pattern.test(e)&&(n=[...n,r.handler]);else{if(t=r.pattern.exec(e),!t)continue;if(t.groups)for(let a in t.groups)o[a]=t.groups[a];n=[...n,r.handler]}return{params:o,handlers:n}}};i(je,"Router");var Eo=je;var ko="http://www.w3.org/2000/svg";function Hn(s){return s*Math.PI/180}i(Hn,"d2r");function Io(s,e,t,o){let n=Hn(o);return{x:s+t*Math.cos(n),y:e+t*Math.sin(n)}}i(Io,"p2c");function k(s){return Math.round(s*1e3)/1e3}i(k,"num");function Ye(s,...e){return e=e.map(t=>typeof t=="number"&&isFinite(t)?k(t):t),String.raw(s,...e)}i(Ye,"clean");var Je=class Je{constructor(e){this._dom=document.createElementNS("http://www.w3.org/2000/svg",e)}getDom(){return this._dom}stroke(e,t){return this.setAttr("stroke",e),t!==void 0&&this.setAttr("stroke-width",t+"px"),this}strokeWidth(e){return this.setAttr("stroke-width",e+"px"),this}strokeCap(e){return this.setAttr("stroke-linecap",e)}strokeOpacity(e){return this.setAttr("stroke-opacity",e+"")}antiAlias(e){return this.setAttr("shape-rendering",e?"auto":"crispEdges")}fill(e){return this.setAttr("fill",e),this}no_fill(){return this.setAttr("fill","transparent"),this}setAttr(e,t){return this._dom.setAttribute(e,t),this}setStyle(e,t){let o=this._dom.style;if(N(t)){let n=t+"";_o(e)||(n+="px"),o[e]=n}else o[e]=t;return this}addClass(e){if(e)if(e.indexOf(" ")>=0){let t=e.split(" ");this._dom.classList.add(...t)}else this._dom.classList.add(e)}clip(e){return this.setAttr("clip-path",`url(#${e})`),this}transform(e){return this.setAttr("transform",e),this}rotate(e,t,o){return this.transform(`rotate( ${e} ${t} ${o} )`),this}translate(e,t){return this.transform(`translate( ${e} ${t} )`),this}scale(e){return this.transform(`scale( ${e} )`),this}addDOMEvent(e,t,o=!1){return me(this._dom,e,t,o),this}};i(Je,"SvgItem");var K=Je,Qe=class Qe extends K{constructor(){super("path"),this._path=""}_update(){return this.setAttr("d",this._path),this}moveTo(e,t){return this._path+=Ye`M${e},${t}`,this._update()}lineTo(e,t){return this._path+=Ye`L${e},${t}`,this._update()}closePath(){return this._path+="Z",this._update()}arc(e,t,o,n,r){let a=Io(e,t,o,n-90),l=Io(e,t,o,r-90),c=r-n<=180?"0":"1";return this._path+=Ye`M${a.x},${a.y}A${o},${o} 0 ${c} 1 ${l.x},${l.y}`,this._update()}};i(Qe,"SvgPath");var We=Qe,et=class et extends K{constructor(e,t,o){super("text"),this.setAttr("x",k(e)+""),this.setAttr("y",k(t)+""),this._dom.innerHTML=o}font(e){return this.setAttr("font-family",e)}fontSize(e){return this.setAttr("font-size",e+"")}fontWeight(e){return this.setAttr("font-weight",e)}textAlign(e){let t;switch(e){case"left":t="start";break;case"center":t="middle";break;case"right":t="end";break;default:return this}return this.setAttr("text-anchor",t)}verticalAlign(e){let t;switch(e){case"top":t="hanging";break;case"center":t="middle";break;case"bottom":t="baseline";break;case"baseline":t="mathematical";break;default:return}return this.setAttr("alignment-baseline",t)}};i(et,"SvgText");var Xe=et,tt=class tt extends K{constructor(e){super(e)}};i(tt,"SvgShape");var xe=tt,ee=class ee extends K{constructor(e,t,o,n){super("linearGradient"),this._id="gx-"+ee.g_id,ee.g_id++,this.setAttr("id",this._id),this.setAttr("x1",I(e)?e:k(e)+""),this.setAttr("x2",I(o)?o:k(o)+""),this.setAttr("y1",I(t)?t:k(t)+""),this.setAttr("y2",I(n)?n:k(n)+""),this._stops=[]}get id(){return"url(#"+this._id+")"}addStop(e,t){return this._dom.insertAdjacentHTML("beforeend",`<stop offset="${e}%" stop-color="${t}"></stop>`),this}};i(ee,"SvgGradient"),ee.g_id=1;var Ze=ee,ge=class ge extends K{constructor(e="g"){super(e)}append(e){return this._dom.appendChild(e.getDom()),e}path(){let e=new We;return this.append(e)}text(e,t,o){let n=new Xe(e,t,o);return this.append(n)}ellipse(e,t,o,n=o){let r=new xe("ellipse");return r.setAttr("cx",k(e)+""),r.setAttr("cy",k(t)+""),r.setAttr("rx",k(o)+""),r.setAttr("ry",k(n)+""),this.append(r)}rect(e,t,o,n){n<0&&(t=t+n,n=-n);let r=new xe("rect");return r.setAttr("x",k(e)+""),r.setAttr("y",k(t)+""),r.setAttr("width",k(o)+""),r.setAttr("height",k(n)+""),this.append(r)}group(){let e=new ge;return this.append(e)}linear_gradient(e,t,o,n){let r=new Ze(e,t,o,n);return this.append(r)}clear(){let e=this._dom;for(;e.firstChild;)e.removeChild(e.firstChild)}};i(ge,"SvgGroup");var be=ge,ne=class ne extends be{constructor(){super()}addClip(e,t,o,n){let r="c-"+ne.g_clip_id++,a=new be("clipPath");return a.setAttr("id",r),a.rect(e,t,o,n),this.append(a),r}};i(ne,"SvgBuilder"),ne.g_clip_id=1;var Mo=ne,ot=class ot extends d{constructor(e){super({...e,tag:"svg",ns:ko}),this.setAttribute("xmlns",ko),e.viewbox&&this.setAttribute("viewbox",e.viewbox),e.svg&&this.dom.appendChild(e.svg.getDom())}};i(ot,"SvgComponent");var Po=ot;var nt=class nt extends d{};i(nt,"Box");var y=nt,rt=class rt extends y{};i(rt,"HBox");var h=rt,it=class it extends y{constructor(e){super(e)}};i(it,"VBox");var f=it,st=class st extends y{constructor(e){var t;super(e),this._items=(t=e.items)==null?void 0:t.map(o=>({...o,page:null})),e.default?this.select(e.default):this._items.length&&this.select(this._items[0].name)}select(e){let t=this.query(".selected");t&&t.setClass("selected",!1);let o=this._items.find(n=>n.name==e);o&&(o.page||(o.page=this._createPage(o),this.appendContent(o.page)),t=o.page,t&&t.setClass("selected",!0))}_createPage(e){let t;return t=e.content,t==null||t.setData("stackname",e.name),t}};i(st,"StackBox");var fe=st;var ct=class ct{constructor(){this.cache=new Map,this.waiters=new Map}async load(e){return this.cache.has(e)?Promise.resolve(this.cache.get(e)):new Promise((t,o)=>{this.waiters.has(e)?this.waiters.get(e).push(t):(this.waiters.set(e,[t]),this._load(e).then(n=>{console.timeEnd(e),this.cache.set(e,n),this.waiters.get(e).forEach(a=>a(n))}))})}async _load(e){console.time(e);let t=await fetch(e);if(t.ok)return t.text()}};i(ct,"SvgLoader");var at=ct,lt=new at,dt=class dt extends d{constructor(e){super(e),this.setIcon(e.iconId)}setIcon(e){if(e){if(e.startsWith("var:"))do{let t=e.substring(4);e=document.documentElement.style.getPropertyValue(t)}while(e.startsWith("var:"));e.startsWith("data:image/svg+xml,<svg")?this.dom.insertAdjacentHTML("beforeend",e.substring(19)):e.endsWith(".svg")?lt.load(e).then(t=>{this.clearContent(),this.dom.insertAdjacentHTML("beforeend",t)}):this.setContent(new d({tag:"img",attrs:{src:e}}))}else this.clearContent(),this.addClass("empty")}};i(dt,"Icon");var v=dt;var pt=class pt extends d{constructor(e){super({...e,tag:"button",content:null}),this.mapPropEvents(e,"click"),this.addDOMEvent("click",t=>this._on_click(t)),this.setContent([new v({id:"icon",iconId:this.props.icon}),new d({id:"label",content:this.props.label})])}_on_click(e){this.fire("click",{}),e.preventDefault(),e.stopPropagation()}setText(e){this.query("#label").setContent(e)}setIcon(e){this.query("#icon").setIcon(e)}};i(pt,"Button");var _=pt;var ht=class ht extends y{constructor(e){super(e),e.align&&this.addClass("align-"+e.align),this.addClass(e.vertical?"x4vbox":"x4hbox"),e.items&&this.setButtons(e.items),this.mapPropEvents(e,"btnclick")}setButtons(e){this.clearContent();let t=[];e==null||e.forEach(o=>{if(o==="-")o=new J;else if(I(o)){let n,r=o;switch(o){case"ok":n=x.global.ok;break;case"cancel":n=x.global.cancel;break;case"abort":n=x.global.abort;break;case"no":n=x.global.no;break;case"yes":n=x.global.yes;break;case"retry":n=x.global.retry;break}o=new _({label:n,click:i(()=>{this.fire("btnclick",{button:r})},"click")})}t.push(o)}),super.setContent(t)}};i(ht,"BtnGroup");var ve=ht;var ut=class ut extends d{constructor(e){var t;super({...e,content:null}),this.setContent([new v({id:"icon",iconId:this.props.icon}),new d({tag:"span",id:"text",content:(t=this.props.text)!=null?t:e.content})]),e.labelFor&&this.setAttribute("for",e.labelFor)}setText(e){this.query("#text").setContent(e)}setIcon(e){this.query("#icon").setIcon(e)}};i(ut,"Label");var u=ut;var mt=class mt extends d{constructor(e,t){super({}),this._type=e,this.addClass(e),this.addDOMEvent("pointerdown",o=>{this.setCapture(o.pointerId),this._ref=t!=null?t:g(this.dom.parentElement),this._delta={x:0,y:0};let n=this._ref.getBoundingRect();this._type.includes("left")?this._delta.x=o.pageX-n.left:this._delta.x=o.pageX-(n.left+n.width),this._type.includes("top")?this._delta.y=o.pageY-n.top:this._delta.y=o.pageY-(n.top+n.height)}),this.addDOMEvent("pointerup",o=>{this.releaseCapture(o.pointerId),this._ref=null}),this.addDOMEvent("pointermove",o=>{this._onMouseMove(o)})}_onMouseMove(e){if(!this._ref)return;let t={x:e.pageX-this._delta.x,y:e.pageY-this._delta.y},o=this._ref.getBoundingRect(),n={},r=!0;this._type.includes("top")&&(n.top=t.y,n.height=o.top+o.height-t.y,r=!1),this._type.includes("bottom")&&(n.height=t.y-o.top,r=!1),this._type.includes("left")&&(n.left=t.x,n.width=o.left+o.width-t.x),this._type.includes("right")&&(n.width=t.x-o.left),this._ref.setStyle(n);let a=this._ref.getBoundingRect();this.fire("resize",{size:r?a.width:a.height}),e.preventDefault(),e.stopPropagation()}};i(mt,"CSizer");var P=mt;var te,To=0,Do=[],S=[],xt=[],bt=class bt extends d{constructor(t){super(t);this._isopen=!1;this._isshown=!1;this._dismiss=i(t=>{S.some(n=>n.dom.contains(t.target))||(t.preventDefault(),t.stopPropagation(),this.dismiss())},"_dismiss");this.props.sizable&&this._createSizers()}displayNear(t,o="top left",n="top left",r={x:0,y:0}){this.setStyle({left:"0px",top:"0px"}),this._show();let a=this.getBoundingRect(),l=t.left,c=t.top;n.indexOf("right")>=0?l=t.left+t.width:n.indexOf("center")>=0&&(l=t.left+t.width/2),n.indexOf("bottom")>=0?c=t.bottom:n.indexOf("middle")>=0&&(c=t.top+t.height/2);let p="l";o.indexOf("right")>=0?l-=a.width:o.indexOf("center")>=0&&(l-=a.width/2);let m="t";o.indexOf("bottom")>=0?c-=a.height:o.indexOf("middle")>=0&&(c-=a.height/2),r&&(l+=r.x,c+=r.y),l+=document.scrollingElement.scrollLeft,c+=document.scrollingElement.scrollTop,this.displayAt(l,c)}displayCenter(){this.displayNear(new H(window.innerWidth/2,window.innerHeight/2,0,0),"center middle")}displayAt(t,o){this.setStyle({left:t+"px",top:o+"px"}),this._show();let n=this.getBoundingRect(),r=window.innerWidth-16,a=window.innerHeight-16;n.right>r&&this.setStyleValue("left",r-n.width),n.bottom>a&&this.setStyleValue("top",a-n.height),this.props.movable&&(this.queryAll(".caption-element").forEach(c=>new _e(c,this)),this.hasClass("popup-caption")&&new _e(this,this)),this.fire("opened",{})}_show(){this.props.modal&&!this._isshown&&(this._showModalMask(),Do.push(this),To++),this._isshown=!0,this.props.autoClose&&(S.length==0&&document.addEventListener("pointerdown",this._dismiss),S.push(this),this.setData("close",this.props.autoClose===!0?R():this.props.autoClose)),xt.push(this),document.body.appendChild(this.dom),this.show()}show(t=!0){this._isopen=t,super.show(t)}isOpen(){return this._isopen}close(){document.body.removeChild(this.dom);let t=xt.indexOf(this);if(console.assert(t>=0),xt.splice(t,1),this.props.autoClose){let o=S.indexOf(this);o>=0&&(S.splice(o,1),S.length==0&&document.removeEventListener("pointerdown",this._dismiss))}if(this.props.modal){let o=Do.pop();console.assert(o==this),this._updateModalMask()}this._isshown=!1,this.fire("closed",{})}dismiss(t=!1){if(S.length==0)return;let o=this.getData("close"),n=[],r=[],a=-1;t&&(a=S.indexOf(this)),S.forEach((c,p)=>{c.getData("close")==o&&p>a?n.push(c):r.push(c)});let l=n.reverse();S=r,S.length==0&&document.removeEventListener("pointerdown",this._dismiss),l.forEach(c=>c.close())}_showModalMask(){te||(te=new d({cls:"x4modal-mask",domEvents:{click:this._dismiss}})),te.show(!0),document.body.insertAdjacentElement("beforeend",te.dom)}_updateModalMask(){--To==0?te.show(!1):this.dom.insertAdjacentElement("beforebegin",te.dom)}_createSizers(){this.appendContent([new P("top"),new P("bottom"),new P("left"),new P("right"),new P("top-left"),new P("bottom-left"),new P("top-right"),new P("bottom-right")])}};i(bt,"Popup");var T=bt,gt=class gt{constructor(e,t){this.self=!!t,e.addDOMEvent("pointerdown",o=>{if(this.self&&o.target!=e.dom)return;e.setCapture(o.pointerId),this.ref=t!=null?t:g(e.dom.parentElement),this.delta={x:0,y:0};let n=this.ref.getBoundingRect();this.delta.x=o.pageX-n.left,this.delta.y=o.pageY-n.top}),e.addDOMEvent("pointerup",o=>{e.releaseCapture(o.pointerId),this.ref=null}),e.addDOMEvent("pointermove",o=>{this._onMouseMove(o)})}_onMouseMove(e){if(!this.ref)return;let t={x:e.pageX-this.delta.x,y:e.pageY-this.delta.y},o=this.ref.getBoundingRect(),n={};this.ref.setStyle({top:t.y+"",left:t.x+""}),e.preventDefault(),e.stopPropagation()}};i(gt,"CMover");var _e=gt;var Lo=400,vt=class vt extends d{constructor(){super({})}};i(vt,"CMenuSep");var ft=vt,we=new Y,_t=class _t extends d{constructor(e){super({disabled:e.disabled,cls:e.cls}),e.menu&&this.addClass("popup"),this.setContent([new v({id:"icon",iconId:e.icon}),new d({id:"text",content:e.text})]),e.menu?(this.menu=e.menu,this.addDOMEvent("mouseenter",()=>this.openSub(!0)),this.addDOMEvent("click",()=>this.openSub(!1)),this.addDOMEvent("mouseleave",()=>this.closeSub()),this.menu.on("opened",()=>this.addClass("opened")),this.menu.on("closed",()=>this.removeClass("opened"))):(this.addDOMEvent("mouseenter",()=>{we.setTimeout("open",Lo,()=>{this.dismiss(!0)})}),this.addDOMEvent("click",()=>{this.dismiss(!1),e.click&&e.click(new Event("click"))}))}dismiss(e){let t=this.parentElement(re);t&&t.dismiss(e)}openSub(e){let t=i(()=>{this.dismiss(!0);let o=this.getBoundingRect();this.menu.displayAt(o.right-4,o.top)},"open");e?we.setTimeout("open",Lo,t):(we.clearTimeout("open"),t())}closeSub(){we.clearTimeout("open")}};i(_t,"CMenuItem");var ye=_t,wt=class wt extends T{constructor(e){var o;super({...e,autoClose:"menu",modal:!1}),this.addClass("x4vbox");let t=(o=e.items)==null?void 0:o.map(n=>n==="-"?new ft:I(n)?new ye({text:n,click:null,cls:"title"}):n instanceof d?n:new ye(n));this.setContent(t)}};i(wt,"Menu");var re=wt;var So='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512" fill="currentColor"><!--!Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M9.4 256l11.3-11.3 192-192L224 41.4 246.6 64 235.3 75.3 54.6 256 235.3 436.7 246.6 448 224 470.6l-11.3-11.3-192-192L9.4 256z"/></svg>';var Ao='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" fill="currentColor"><!--!Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M128 16l0-16L96 0l0 16 0 48L32 64 0 64 0 96l0 64 0 32L0 480l0 32 32 0 384 0 32 0 0-32 0-288 0-32 0-64 0-32-32 0-64 0 0-48 0-16L320 0l0 16 0 48L128 64l0-48zM32 192l384 0 0 288L32 480l0-288zm0-96l384 0 0 64L32 160l0-64zM331.3 283.3L342.6 272 320 249.4l-11.3 11.3L208 361.4l-52.7-52.7L144 297.4 121.4 320l11.3 11.3 64 64L208 406.6l11.3-11.3 112-112z"/></svg>';var Ro='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512" fill="currentColor"><!--!Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M310.6 256l-11.3 11.3-192 192L96 470.6 73.4 448l11.3-11.3L265.4 256 84.7 75.3 73.4 64 96 41.4l11.3 11.3 192 192L310.6 256z"/></svg>';var yt=class yt extends f{constructor(e){super(e),this.mapPropEvents(e,"change"),this.m_date=e.date?W(e.date):new Date,this._update()}_update(){let e=W(this.m_date);e.setDate(1);let t=e.getDay();t==0&&(t=7),e.setDate(-t+1+1);let o=W(e),n=V(this.m_date),r=V(new Date),a=W(this.m_date);a.setDate(1),a.setMonth(a.getMonth()+1),a.setDate(0);let l=V(a),c=[],p=new h({cls:"month-sel",content:[new u({cls:"month",text:B(this.m_date,"O"),dom_events:{click:i(()=>this._choose("month"),"click")}}),new u({cls:"year",text:B(this.m_date,"Y"),dom_events:{click:i(()=>this._choose("year"),"click")}}),new J,new _({icon:So,click:i(()=>this._next(!1),"click")}),new _({icon:Ao,click:i(()=>this.setDate(new Date),"click"),tooltip:x.global.today}),new _({icon:Ro,click:i(()=>this._next(!0),"click")})]});c.push(p);let m=[];m.push(new h({cls:"weeknum cell"}));for(let b=0;b<7;b++)m.push(new u({cls:"cell",text:x.global.day_short[(b+1)%7]}));c.push(new h({cls:"week header",content:m}));let E=this.m_date.getMonth(),w=!0;for(;V(o)<=l;){let b=[new h({cls:"weeknum cell",content:new d({tag:"span",content:B(o,"w")})})];for(let oe=0;oe<7;oe++){let F="cell day";V(o)==n&&(F+=" selection"),V(o)==r&&(F+=" today"),o.getMonth()!=E&&(F+=" out");let U=i(se=>new h({cls:F,flex:1,content:new d({cls:"text",content:ce(`<span>${B(se,"d")}</span>`)}),dom_events:{click:i(()=>this.select(se),"click")}}),"mkItem");b.push(U(W(o))),o.setDate(o.getDate()+1),w=!1}c.push(new h({cls:"week",flex:1,content:b}))}this.setContent(c)}select(e){this.m_date=e,this.fire("change",{value:e}),this._update()}_next(e){this.m_date.setMonth(this.m_date.getMonth()+(e?1:-1)),this._update()}_choose(e){var r,a,l,c;let t=[];if(e=="month")for(let p=0;p<12;p++)t.push({text:x.global.month_long[p],click:i(()=>{this.m_date.setMonth(p),this._update()},"click")});else if(e=="year"){let p=(a=(r=this.props.minDate)==null?void 0:r.getFullYear())!=null?a:1900,m=(c=(l=this.props.maxDate)==null?void 0:l.getFullYear())!=null?c:2037;for(let E=m;E>=p;E--)t.push({text:""+E,click:i(()=>{this.m_date.setFullYear(E),this._update()},"click")})}let o=new re({items:t}),n=this.getBoundingRect();o.displayAt(n.left,n.top)}getDate(){return this.m_date}setDate(e){this.m_date=e,this._update()}};i(yt,"Calendar");var Oo=yt;var Ct=class Ct extends d{constructor(e){var t;switch(super({tag:"input",...e}),this.setAttribute("type",(t=e.type)!=null?t:"text"),this.setAttribute("name",e.name),e.type){case"checkbox":case"radio":{let o=this.dom;o.checked=e.checked,o.value=e.value+"";break}case"range":{this.setAttribute("min",e.min),this.setAttribute("max",e.max),this.setAttribute("step",e.step),this.setAttribute("value",e.value);break}case"number":{this.setAttribute("required",e.required),this.setAttribute("readonly",e.readonly),this.setAttribute("min",e.min),this.setAttribute("max",e.max),this.setAttribute("step",e.step),this.setAttribute("value",e.value+"");break}case"date":{this.setAttribute("required",e.required);let o=e.value;o instanceof Date||this.setAttribute("value",o);break}case"file":{let o;Array.isArray(e.accept)?o=e.accept.join(","):o=e.accept,this.setAttribute("accept",o);break}default:{this.setAttribute("required",e.required),this.setAttribute("readonly",e.readonly),e.value!==null&&e.value!==void 0&&this.setAttribute("value",e.value),e.pattern!==null&&e.pattern!==void 0&&this.setAttribute("pattern",e.pattern),e.placeholder!==null&&e.placeholder!==void 0&&this.setAttribute("placeholder",e.placeholder),e.spellcheck===!1&&this.setAttribute("spellcheck",!1);break}}}getValue(){return this.dom.value}setValue(e){this.dom.value=e+""}getNumValue(){return parseFloat(this.getValue())}setNumValue(e){this.setValue(e+"")}setReadOnly(e){let t=this.dom;t.readOnly=e}selectAll(){this.dom.select()}select(e,t=9999){this.dom.setSelectionRange(e,e+t)}getSelection(){let e=this.dom;return{start:e.selectionStart,length:e.selectionEnd-e.selectionStart}}queryInterface(e){return e=="form-element"?{getRawValue:i(()=>this.getValue(),"getRawValue"),setRawValue:i(o=>{this.setValue(o)},"setRawValue")}:super.queryInterface(e)}};i(Ct,"Input");var C=Ct;var Ho='data:image/svg+xml,<svg viewBox="0 0 10 7" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">%0A%09<path d="M4 4.586L1.707 2.293A1 1 0 1 0 .293 3.707l3 3a.997.997 0 0 0 1.414 0l5-5A1 1 0 1 0 8.293.293L4 4.586z" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd">%0A%09</path>%0A</svg>';var Et=class Et extends d{constructor(e){super(e);let t=R();this.mapPropEvents(e,"change"),this.setContent([new d({cls:"inner",content:[this._input=new C({type:"checkbox",id:t,checked:e.checked,dom_events:{change:i(()=>this._on_change(),"change")}})]}),new u({tag:"label",text:e.label,labelFor:t,id:void 0})]),lt.load(Ho).then(o=>{this.query(".inner").dom.insertAdjacentHTML("beforeend",o)})}_on_change(){this.fire("change",{value:this.getCheck()})}getCheck(){return this._input.dom.checked}setCheck(e){let t=this._input.dom;t.checked=e}setLabel(e){this.query("label").setText(e)}toggle(){this.setCheck(!this.getCheck())}};i(Et,"Checkbox");var Bo=Et;var No='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"><!--!Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M479.4 240L384 240l-16 0 0 32 16 0 95.4 0C471.6 383 383 471.6 272 479.4l0-95.4 0-16-32 0 0 16 0 95.4C129 471.6 40.4 383 32.6 272l95.4 0 16 0 0-32-16 0-95.4 0C40.4 129 129 40.4 240 32.6l0 95.4 0 16 32 0 0-16 0-95.4C383 40.4 471.6 129 479.4 240zM256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512z"/></svg>';var kt=class kt extends h{constructor(e){super(e);let t,o;this.setContent([t=new d({cls:"swatch"}),o=new C({type:"text",value:"",spellcheck:!1}),de("eyedropper")?new _({icon:No,click:i(()=>{new window.EyeDropper().open().then(l=>{r=new M(l.sRGBHex),n(r)})},"click")}):null]),o.addDOMEvent("input",()=>{let a=o.getValue(),l=new M(a);l.isInvalid()||(r=l,n(r))});let n=i(a=>{t.setStyleValue("backgroundColor",a.toRgbString(!1)),o.setValue(a.toRgbString(!1))},"updateColor"),r;e.color instanceof M?r=e.color:r=new M(e.color),n(r)}};i(kt,"ColorInput");var zo=kt;var Tt=class Tt extends y{constructor(t,o){super(t);this.mdown=!1;this.hsv={hue:1,saturation:1,value:1,alpha:1};this.setContent([this.color=new d({cls:"overlay"}),new d({cls:"overlay",style:{backgroundImage:"linear-gradient(90deg, rgb(255, 255, 255), transparent)"}}),new d({cls:"overlay",style:{backgroundImage:"linear-gradient(0deg, rgb(0, 0, 0), transparent)"}}),this.thumb=new d({cls:"thumb"})]),this.setDOMEvents({pointerdown:i(n=>this.mousedown(n),"pointerdown"),pointermove:i(n=>this.mousemove(n),"pointermove"),pointerup:i(n=>this.mouseup(n),"pointerup"),created:i(()=>this.updateThumbMarker(),"created")}),this.updateBaseColor(o)}mousedown(t){this.mdown=!0,this.irect=this.getBoundingRect(),this.setCapture(t.pointerId)}mousemove(t){if(this.mdown){let o=this.irect,r=L(t.clientX-o.left,0,o.width)/o.width,l=L(t.clientY-o.top,0,o.height)/o.height;this.hsv.saturation=r,this.hsv.value=1-l,this.updateThumbMarker(),this.fire("sat_change",{saturation:this.hsv.saturation,value:this.hsv.value})}}mouseup(t){this.mdown&&(this.releaseCapture(t.pointerId),this.mdown=!1)}updateThumbMarker(){let t=this.color.getBoundingRect();this.thumb.setStyle({left:this.hsv.saturation*t.width+"px",bottom:this.hsv.value*t.height+"px"})}updateBaseColor(t){let o=new M(0,0,0);o.setHsv(t.hue,1,1,1),this.color.setStyleValue("backgroundColor",o.toRgbString(!1))}move(t,o){switch(t){case"saturation":{this.hsv.saturation+=o,this.hsv.saturation<0?this.hsv.saturation=0:this.hsv.saturation>1&&(this.hsv.saturation=1),this.fire("sat_change",{saturation:this.hsv.saturation,value:this.hsv.value}),this.updateThumbMarker();break}case"value":{this.hsv.value+=o,this.hsv.value<0?this.hsv.value=0:this.hsv.value>1&&(this.hsv.value=1),this.fire("sat_change",{saturation:this.hsv.saturation,value:this.hsv.value}),this.updateThumbMarker();break}}}};i(Tt,"Saturation");var It=Tt,Dt=class Dt extends y{constructor(t,o){super(t);this.hsv={hue:1,saturation:1,value:1,alpha:1};this.mdown=!1;this.setContent([this.thumb=new d({cls:"thumb",left:"50%"})]),this.setDOMEvents({pointerdown:i(n=>this.mousedown(n),"pointerdown"),pointermove:i(n=>this.mousemove(n),"pointermove"),pointerup:i(n=>this.mouseup(n),"pointerup")}),this.updateHue(o)}mousedown(t){this.mdown=!0,this.irect=this.getBoundingRect(),this.setCapture(t.pointerId)}mousemove(t){if(this.mdown){let o=this.irect,r=L(t.clientX-o.left,0,o.width)/o.width;this.hsv.hue=r,this.updateHue(this.hsv),this.fire("hue_change",{hue:this.hsv.hue})}}mouseup(t){this.mdown&&(this.releaseCapture(t.pointerId),this.mdown=!1)}updateHue(t){this.hsv.hue=t.hue,this.thumb.setStyleValue("left",t.hue*100+"%")}move(t){this.hsv.hue+=t,this.hsv.hue<0?this.hsv.hue=0:this.hsv.hue>1&&(this.hsv.hue=1),this.fire("hue_change",{hue:this.hsv.hue}),this.updateHue(this.hsv)}};i(Dt,"HueSlider");var Mt=Dt,Lt=class Lt extends y{constructor(t,o){super(t);this.hsv={hue:1,saturation:1,value:1,alpha:1};this.mdown=!1;this.setContent([new d({cls:"overlay checkers"}),this.color=new d({cls:"overlay color"}),this.thumb=new d({cls:"thumb",left:"50%"})]),this.setDOMEvents({pointerdown:i(n=>this._on_mousedown(n),"pointerdown"),pointermove:i(n=>this._on_mousemove(n),"pointermove"),pointerup:i(n=>this._on_mouseup(n),"pointerup")}),this.updateAlpha(),this.updateBaseColor(o)}_on_mousedown(t){this.mdown=!0,this.irect=this.getBoundingRect(),this.setCapture(t.pointerId)}_on_mousemove(t){if(this.mdown){let o=this.irect,r=L(t.clientX-o.left,0,o.width)/o.width;this.hsv.alpha=r,this.updateAlpha(),this.fire("alpha_change",{alpha:this.hsv.alpha})}}_on_mouseup(t){this.mdown&&(this.releaseCapture(t.pointerId),this.mdown=!1)}updateAlpha(){this.thumb.setStyleValue("left",this.hsv.alpha*100+"%")}updateBaseColor(t){let o=new M(0,0,0);o.setHsv(t.hue,t.saturation,t.value,1),this.color.setStyleValue("backgroundImage",`linear-gradient(90deg, transparent, ${o.toRgbString(!1)})`)}setColor(t){this.hsv=t,this.updateBaseColor(t),this.updateAlpha()}move(t){this.hsv.alpha+=t,this.hsv.alpha<0?this.hsv.alpha=0:this.hsv.alpha>1&&(this.hsv.alpha=1),this.fire("alpha_change",{alpha:this.hsv.alpha}),this.updateAlpha()}};i(Lt,"AlphaSlider");var Pt=Lt,St=class St extends f{constructor(e){super(e),e.color instanceof M?this._base=e.color:this._base=new M(e.color);let t=this._base.toHsv();this.setAttribute("tabindex",0),this.setContent([this._sat=new It({},t),new h({cls:"body",content:[new f({cls:"x4flex",content:[this._hue=new Mt({},t),this._alpha=new Pt({},t)]}),new y({cls:"swatch",content:[new d({cls:"overlay checkers"}),this._swatch=new d({cls:"overlay"})]})]})]),this._sat.on("sat_change",n=>{t.saturation=n.saturation,t.value=n.value,o(),this._alpha.updateBaseColor(t)}),this._hue.on("hue_change",n=>{t.hue=n.hue,this._sat.updateBaseColor(t),this._alpha.updateBaseColor(t),o()}),this._alpha.on("alpha_change",n=>{t.alpha=n.alpha,o()});let o=i(()=>{this._base.setHsv(t.hue,t.saturation,t.value,t.alpha),this._swatch.setStyleValue("backgroundColor",this._base.toRgbString()),this._swatch.setAttribute("tooltip",this._base.toRgbString()),this.fire("change",{color:this._base})},"updateColor");de("eyedropper")&&this._swatch.addDOMEvent("click",n=>{new window.EyeDropper().open().then(a=>{t=new M(a.sRGBHex).toHsv(),this._alpha.setColor(t),this._sat.updateBaseColor(t),this._hue.updateHue(t),o()})}),this.addDOMEvent("keydown",n=>this._onkey(n)),o()}_onkey(e){switch(e.key){case"ArrowLeft":{e.ctrlKey?this._hue.move(-.01):this._sat.move("saturation",-.01);break}case"ArrowRight":{e.ctrlKey?this._hue.move(.01):this._sat.move("saturation",.01);break}case"ArrowUp":{e.ctrlKey?this._alpha.move(.01):this._sat.move("value",.01);break}case"ArrowDown":{e.ctrlKey?this._alpha.move(-.01):this._sat.move("value",-.01);break}}}};i(St,"ColorPicker");var Fo=St;var Rt=class Rt extends d{constructor(e){super(e)}};i(Rt,"Viewport");var At=Rt,Ot=class Ot extends d{constructor(e){super(e),this.setContent(new At({}))}getViewport(){return this.firstChild()}};i(Ot,"ScrollView");var Ce=Ot;var Uo=(n=>(n[n.first=0]="first",n[n.prev=1]="prev",n[n.next=2]="next",n[n.last=3]="last",n))(Uo||{}),Ht=class Ht extends d{constructor(t){super({...t});this.preventFocus=!1;this.setAttribute("tabindex",0);let o=new Ce({cls:"body"});this._view=o.getViewport(),this.setContent([o]),this.setDOMEvents({click:i(n=>this._on_click(n),"click"),keydown:i(n=>this._on_key(n),"keydown"),dblclick:i(n=>this._on_click(n),"dblclick"),contextmenu:i(n=>this._on_ctx_menu(n),"contextmenu")}),t.items&&this.setItems(t.items)}_on_key(t){if(!this.isDisabled()){switch(t.key){case"ArrowDown":{this.navigate(2);break}case"ArrowUp":{this.navigate(1);break}case"Home":{this.navigate(0);break}case"End":{this.navigate(3);break}default:return}t.preventDefault(),t.stopPropagation()}}navigate(t){this._selitem||(t==2?t=0:t=3);let o=i((n,r)=>{for(;n&&!n.isVisible();)n=r?n.nextElement():n.prevElement();return n},"next_visible");if(t==0||t==3){let n=t==0?this._view.firstChild():this._view.lastChild();if(n=o(n,t==0),n){let r=n.getData("id");return this._selectItem(r,n),!0}}else{let n=t==2?this._selitem.nextElement():this._selitem.prevElement();if(n=o(n,t==2),n){let r=n.getData("id");return this._selectItem(r,n),!0}}return!1}_on_click(t){t.stopImmediatePropagation(),t.preventDefault();let o=t.target;for(;o&&o!=this.dom;){let n=g(o);if(n&&n.hasClass("x4item")){let r=n.getData("id"),a={context:r};t.type=="click"?this.fire("click",a):this.fire("dblClick",a),a.defaultPrevented||this._selectItem(r,n);return}o=o.parentElement}this.clearSelection()}_on_ctx_menu(t){t.preventDefault();let o=t.target;for(;o&&o!=this.dom;){let n=g(o);if(n&&n.hasClass("x4item")){let r=n.getData("id");this._selectItem(r,n),this.fire("contextMenu",{uievent:t,context:r});return}o=o.parentElement}this.fire("contextMenu",{uievent:t,context:null})}_selectItem(t,o){this._selitem&&(this._selitem.removeClass("selected"),this._selitem=void 0),this._selitem=o,this._selection=t,o&&(o.addClass("selected"),o.scrollIntoView({behavior:"smooth",block:"nearest"}));let n=this._findItem(t);this.fire("selectionChange",{selection:n})}_findItem(t){return this._items.find(o=>o.id==t)}_findItemIndex(t){return this._items.findIndex(o=>o.id==t)}clearSelection(){this._selitem&&(this._selitem.removeClass("selected"),this._selitem=void 0),this._selection=void 0,this.fire("selectionChange",{selection:void 0})}setItems(t){if(this.clearSelection(),this._view.clearContent(),this._items=t,t){let o=t.map(n=>this.renderItem(n));this._view.setContent(o)}}renderItem(t){var r;let n=((r=this.props.renderer)!=null?r:this.defaultRenderer)(t);return n.addClass("x4item"),n.setData("id",t.id+""),n}defaultRenderer(t){return new h({cls:t.cls,content:new u({icon:t.iconId,text:t.text})})}filter(t){let o=this._view.enumChildComponents(!1);if(!t)o.forEach(n=>n.show(!0));else{let n=this._items.filter(r=>r.text.includes(t)).map(r=>r.id+"");o.forEach(r=>{r.show(n.includes(r.getData("id")))})}}appendItem(t,o=!1,n=!0){n&&this.clearSelection();let r=this.renderItem(t);o?(this._items.unshift(t),this._view.prependContent(r)):(this._items.push(t),this._view.appendContent(r)),n&&this._selectItem(t.id,r)}updateItem(t,o){var l;let n=this._findItemIndex(t);if(n<0)return;let r=!1;this._selection&&this._selection===t&&(r=!0),this._items[n]=o;let a=(l=this.query(`[data-id="${o.id}"]`))==null?void 0:l.dom;if(a){let c=this.renderItem(o);this._view.dom.replaceChild(c.dom,a),r&&this._selectItem(o.id,c)}}};i(Ht,"Listbox");var Ee=Ht;var Vo='data:image/svg+xml,<svg viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg">%0A%09<path d="M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd">%0A%09</path>%0A</svg>';var Nt=class Nt extends T{constructor(e,t){super(e),this._list=new Ee({items:e.items}),this.setContent(this._list),this.addDOMEvent("mousedown",o=>{console.log("trap"),o.stopImmediatePropagation(),o.stopPropagation(),o.preventDefault()},!0),this._list.on("selectionChange",o=>{this.fire("selectionChange",o)})}getList(){return this._list}};i(Nt,"Dropdown");var Bt=Nt,zt=class zt extends d{constructor(t){super(t);this._prevent_close=!1;let o=R();this.setContent([new h({id:"label",content:new u({tag:"label",text:t.label,labelFor:o,width:t.labelWidth})}),this._edit=new h({id:"edit",content:[this._input=new C({type:"text",value:"",readonly:t.readonly}),this._button=new _({icon:Vo})]})]),this._dropdown=new Bt({items:t.items}),this._dropdown.on("selectionChange",n=>{let r=n.selection;this._input.setValue(r?r.text:""),this._prevent_close||this._dropdown.show(!1)}),this._button.addDOMEvent("click",()=>this._on_click()),this._input.addDOMEvent("input",()=>this._on_input()),this._input.addDOMEvent("keydown",n=>this._on_key(n)),this.setDOMEvents({focusout:i(()=>this._on_focusout(),"focusout"),click:i(()=>this._on_click(),"click")})}_on_key(t){switch(t.key){case"Enter":case"Escape":{this._dropdown.show(!1);break}case"ArrowUp":this._prevent_close=!0,this._dropdown.isOpen()?this._dropdown.getList().navigate(1):this.showDropDown(),this._prevent_close=!1;break;case"ArrowDown":this._prevent_close=!0,this._dropdown.isOpen()?this._dropdown.getList().navigate(2):this.showDropDown(),this._prevent_close=!1;break;default:return}t.preventDefault(),t.stopPropagation()}_on_input(){this._dropdown.isOpen()||this.showDropDown(),this._dropdown.getList().filter(this._input.getValue())}_on_focusout(){this._dropdown.show(!1)}_on_click(){this.showDropDown()}showDropDown(){if(this.isDisabled())return;let t=this._edit.getBoundingRect();this._dropdown.setStyleValue("width",t.width+"px"),this._dropdown.displayNear(t,"top left","bottom left",{x:0,y:6})}};i(zt,"Combobox");var qo=zt;var $o='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512" fill="currentColor"><!--!Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M192 233.4L59.5 100.9 36.9 123.5 169.4 256 36.9 388.5l22.6 22.6L192 278.6 324.5 411.1l22.6-22.6L214.6 256 347.1 123.5l-22.6-22.6L192 233.4z"/></svg>';var Ft=class Ft extends T{constructor(e){super(e),this.appendContent([new h({cls:"caption",content:[new u({id:"title",cls:"caption-element",icon:e.icon,text:e.title}),e.closable?new _({id:"closebox",icon:$o,click:i(()=>{this.close()},"click")}):null]}),e.form,new ve({id:"btnbar",reverse:!0,items:e.buttons,btnclick:i(t=>{this.fire("btnclick",t)},"btnclick")})])}display(){super.displayCenter()}close(){this.fire("close",{}),super.close()}};i(Ft,"Dialog");var ke=Ft;var Ut=class Ut extends y{setValues(e){let t=this.queryAll("input[name]");console.log(t)}getValues(){return{}}};i(Ut,"Form");var Ie=Ut;var Vt=class Vt extends h{constructor(e){var t;super(e),this._els=(t=e.items)==null?void 0:t.map(o=>{let n=new u({cls:"cell",text:o.title,icon:o.iconId}),r=new P("right");return o.width>0?(n.setStyleValue("width",o.width+"px"),n.setInternalData("width",o.width)):o.width<0?n.setInternalData("flex",-o.width):n.setInternalData("width",0),r.addDOMEvent("dblclick",a=>{n.setInternalData("flex",1),this._calc_sizes()}),r.on("resize",a=>{n.setInternalData("flex",0),n.setInternalData("width",a.size),this._calc_sizes()}),n.appendContent(r),n.setInternalData("data",o),n}),this.addDOMEvent("resized",()=>this._on_resize()),this.addDOMEvent("created",()=>this._calc_sizes()),this._vwp=new h({content:this._els}),this.setContent(this._vwp)}_calc_sizes(){let e=0,t=0;this._els.forEach(l=>{let c=l.getInternalData("flex");if(c)e+=c;else{let p=l.getInternalData("width");if(p==0){let m=l.getBoundingRect();p=Math.ceil(m.width)+2,l.setInternalData("width",p)}t+=p}});let n=this.getBoundingRect().width-t,r=Math.ceil(n/e);console.log("filled",t),console.log("count",e),console.log("rest",n),console.log("unit",r);let a=0;this._els.forEach(l=>{let c=0,p=l.getInternalData("flex");p?(c=Math.min(r*p,n),n-=c):c=l.getInternalData("width"),l.setWidth(c),a+=c}),this._vwp.setWidth(a)}_on_resize(){this._calc_sizes()}};i(Vt,"Header");var Ko=Vt;var qt=class qt extends d{constructor(e){var t;super(e),this._img=new d({tag:"img",attrs:{loading:e.lazy,alt:e.alt,draggable:(t=e.draggable)!=null?t:!1},style:{width:"100%",height:"100%",objectFit:e.fit,objectPosition:e.position}}),this.setContent(this._img),this.setImage(e.src)}setImage(e){this._img.setAttribute("src",e)}};i(qt,"Image");var Go=qt;var jo='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"><!--!Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24l0 112c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-112c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"/></svg>';var Me=class Me extends ke{constructor(e){super(e)}setText(e){this.m_label.setText(e)}static show(e){let t=new Me({modal:!0,title:x.global.error,movable:!0,form:new Ie({content:[new h({content:[new v({iconId:jo}),new u({text:e})]})]}),buttons:["ok","cancel"]});return t.on("btnclick",o=>{go(()=>t.close())}),t.display(),t}};i(Me,"MessageBox");var Yo=Me;var Wo='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"><!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"/></svg>';var Xo='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"><!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24V264c0 13.3-10.7 24-24 24s-24-10.7-24-24V152c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"/></svg>';var Zo='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"><!--!Font Awesome Pro 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M207.4 20.4c2.4 8.5-2.6 17.3-11.2 19.7C101.5 66.2 32 153 32 256c0 123.7 100.3 224 224 224s224-100.3 224-224c0-103-69.5-189.8-164.3-215.9c-8.5-2.4-13.5-11.2-11.2-19.7s11.2-13.5 19.7-11.2C432.5 39.1 512 138.2 512 256c0 141.4-114.6 256-256 256S0 397.4 0 256C0 138.2 79.5 39.1 187.7 9.2c8.5-2.4 17.3 2.6 19.7 11.2z"/></svg>';var Jo='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512" fill="currentColor"><!--!Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M192 233.4L59.5 100.9 36.9 123.5 169.4 256 36.9 388.5l22.6 22.6L192 278.6 324.5 411.1l22.6-22.6L214.6 256 347.1 123.5l-22.6-22.6L192 233.4z"/></svg>';var $t=class $t extends T{constructor(e){super({});let t=e.iconId;t||(e.loading?(t=Zo,this.addClass("")):e.mode=="danger"?t=Xo:t=Wo),this.addClass(e.mode);let o=new v({iconId:t});e.loading&&(o.addClass("rotate"),this.props.modal=!0),this.setContent(new h({content:[o,new f({cls:"body",content:[new u({cls:"title",text:e.title}),new u({cls:"text",text:e.text})]}),new _({cls:"outline",icon:Jo,click:i(()=>{this.close()},"click")})]}))}close(){this.clearTimeout("close"),super.close()}display(e=0){let t=new H(0,0,window.innerWidth,window.innerHeight);this.displayNear(t,"bottom right","bottom right",{x:-20,y:-10}),e&&this.setTimeout("close",e*1e3,()=>{this.close()})}};i($t,"Notification");var Qo=$t;var Kt=class Kt extends f{constructor(e){var o;super({...e,content:void 0});let t=(o=e.bodyModel)!=null?o:f;super.setContent([this._title=new u({tag:"legend",text:e.title,icon:e.icon}),this._body=new t({cls:"body",content:e.content})])}setContent(e){this._body.setContent(e)}setTitle(e){this._title.setContent(e)}};i(Kt,"Panel");var en=Kt;var Gt=class Gt extends d{constructor(e){super(e),this.setContent(this._bar=new d({cls:"bar"})),this.setValue(e.value)}setValue(e){let t=e/(this.props.max-this.props.min)*100;this._bar.setStyleValue("width",t+"%")}};i(Gt,"Progress");var tn=Gt;var on='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512" fill="currentColor"><!--!Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M288.1 0l86.5 164 182.7 31.6L428 328.5 454.4 512 288.1 430.2 121.7 512l26.4-183.5L18.9 195.6 201.5 164 288.1 0z"/></svg>';var jt=class jt extends h{constructor(e){var t;super(e),e.steps=(t=e.steps)!=null?t:5,this._update()}_update(){var n,r;let e=this.props,t=(n=e.icon)!=null?n:on,o=(r=e.value)!=null?r:0;this.m_input=new C({type:"text",hidden:!0,name:e.name,value:""+o}),this.addDOMEvent("click",a=>this._on_click(a)),this.m_els=[];for(let a=0;a<e.steps;a++){let l="item";a+1<=o&&(l+=" checked");let c=new v({cls:l,iconId:t});c.setInternalData("value",a),this.m_els.push(c)}this.m_els.push(this.m_input),this.setContent(this.m_els)}getValue(){var e;return(e=this.props.value)!=null?e:0}setValue(e){this.props.value=e;for(let t=0;t<this.props.steps;t++)this.m_els[t].setClass("checked",this.m_els[t].getInternalData("value")<=e);this.m_input.setValue(""+this.props.value)}setSteps(e){this.props.steps=e,this._update()}setShape(e){this.removeClass(this.props.icon),this.props.icon=e}_on_click(e){let t=g(e.target);t=t.parentElement(v),t&&this.setValue(t.getInternalData("value")),this.fire("change",{value:this.props.value})}};i(jt,"Rating");var nn=jt;var Yt=class Yt extends d{constructor(t){super(t);this._mdown=!1;this._irect=null;this._thumb=null;this._bar=null;this._range=null;this.setContent([new h({cls:"track",content:[this._bar=new d({cls:"bar"}),this._thumb=new d({cls:"thumb"})]}),this._range=new C({type:"range",hidden:!0,value:t.value,min:t.min,max:t.max,step:t.step})]),this.setAttribute("tabindex",0),this.setDOMEvents({pointerdown:i(o=>this._on_mousedown(o),"pointerdown"),pointermove:i(o=>this._on_mousemove(o),"pointermove"),pointerup:i(o=>this._on_mouseup(o),"pointerup"),keydown:i(o=>this._on_key(o),"keydown")}),this._range.addDOMEvent("change",o=>{})}_on_mousedown(t){t.stopPropagation(),t.preventDefault(),this.focus(),this._mdown=!0,this._irect=this.getBoundingRect(),this.setCapture(t.pointerId)}_on_mousemove(t){if(this._mdown){let o=t.pageX-this._irect.left;o<0?o=0:o>this._irect.width&&(o=this._irect.width);let n=o/this._irect.width*100;this._range.setNumValue(n),this._update()}}_update(){let t=this._range.getNumValue(),o=t/(this.props.max-this.props.min)*100;this._thumb.setStyleValue("left",o+"%"),this._bar.setStyleValue("width",o+"%"),this.fire("change",{value:t})}_on_mouseup(t){this._mdown&&(this.releaseCapture(t.pointerId),this._mdown=!1)}_on_key(t){var r;console.log(t.key);let o=(r=this.props.step)!=null?r:1,n=0;switch(t.key){case"ArrowRight":case"ArrowUp":n=o;break;case"ArrowLeft":case"ArrowDown":n=-o;break}n&&(t.ctrlKey&&(n*=10),this._range.setNumValue(this._range.getNumValue()+n),this._update())}};i(Yt,"Slider");var rn=Yt;var Wt=class Wt extends h{constructor(e){super(e);let t=R();this.setContent([new d({cls:"switch",content:[new C({type:"checkbox",id:t,checked:e.checked}),new d({cls:"track"}),new d({cls:"thumb"})]}),new u({tag:"label",text:e.label,labelFor:t})])}};i(Wt,"Switch");var sn=Wt;var Jt=class Jt extends _{constructor(e,t){super(e),this.addClass("outline"),this.setIcon(t.icon),this.setText(t.title),this.setData("tabname",t.name)}};i(Jt,"CTab");var Xt=Jt,Qt=class Qt extends h{constructor(e,t){super(e);let o=t.map(n=>new Xt({click:i(r=>this._on_click(r),"click")},n));this.mapPropEvents(e,"click"),this.setContent(o)}_on_click(e){let t=e.source.getData("tabname");this.fire("click",{name:t})}select(e){let t=this.query(`[data-tabname="${e}"]`);this._selitem&&this._selitem.setClass("selected",!1),this._selitem=t,this._selection=e,this._selitem&&this._selitem.setClass("selected",!0)}};i(Qt,"CTabList");var Zt=Qt,eo=class eo extends f{constructor(e){var o;super(e);let t=(o=e.items)==null?void 0:o.map(n=>({name:n.name,content:n.tab}));this.setContent([this._list=new Zt({click:i(n=>this._onclick(n),"click")},e.items),this._stack=new fe({cls:"body x4flex",default:e.default,items:t})]),e.default&&this.selectTab(e.default)}selectTab(e){this._list.select(e),this._stack.select(e)}_onclick(e){this.selectTab(e.name)}};i(eo,"Tabs");var an=eo;var to=class to extends f{constructor(e){super(e),this.setContent([new u({text:e.label}),this._input=new d({tag:"textarea"})]),this._input.setAttribute("name",e.name),this._input.setAttribute("value",e.value+""),e.resize||this._input.setAttribute("resize",!1)}};i(to,"TextArea");var ln=to;var oo=class oo extends h{constructor(e){var o,n;super(e),e.inputId||(e.inputId=R()),e.required&&this.setAttribute("required",!0);let t=(o=e.inputGadgets)!=null?o:[];this.setContent([new h({id:"label",width:e.labelWidth,content:[new u({tag:"label",text:e.label,labelFor:e.inputId})]}),new h({id:"edit",content:[new C({type:(n=e.type)!=null?n:"text",readonly:e.readonly,value:e.value,id:e.inputId,required:e.required,disabled:e.disabled,placeholder:e.placeholder}),...t]})])}};i(oo,"TextEdit");var cn=oo;var dn='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"> <!--!Font Awesome Pro 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M256 32a224 224 0 1 1 0 448 224 224 0 1 1 0-448zm0 480A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM192 352v32h16 96 16V352H304 272V240 224H256 216 200v32h16 24v96H208 192zm88-168V136H232v48h48z"/></svg>';var Pe=null,ie=null,pn=new Y;function Kp(){document.addEventListener("mouseenter",s=>{if(s.target===document)return;let e=Co(s.target),t=e.getAttribute("tooltip");if(t){Pe=s.target;let o=e.getBoundingRect();Zn(t,o,{x:s.pageX,y:s.pageY})}},!0),document.addEventListener("mouseleave",s=>{Pe&&s.target==Pe&&(Pe=null,Jn())},!0)}i(Kp,"initTooltips");function Zn(s,e,t){ie||(ie=new no({})),pn.setTimeout(null,300,()=>{ie.setText(ce(s)),ie.displayAt(t.x,t.y)})}i(Zn,"showTT");function Jn(){ie.show(!1),pn.clearTimeout(null)}i(Jn,"closeTT");var ro=class ro extends T{constructor(e){super(e),this.setContent(new h({content:[new v({iconId:dn}),new d({id:"text"})]}))}setText(e){this.query("#text").setContent(e)}};i(ro,"Tooltip");var no=ro;var hn='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"><!--!Font Awesome Pro 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M267.3 395.3c-6.2 6.2-16.4 6.2-22.6 0l-192-192c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L256 361.4 436.7 180.7c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6l-192 192z"/></svg>';var er=(p=>(p[p.first=0]="first",p[p.prev=1]="prev",p[p.next=2]="next",p[p.last=3]="last",p[p.parent=4]="parent",p[p.child=5]="child",p[p.expand=6]="expand",p[p.collapse=7]="collapse",p[p.toggle=8]="toggle",p))(er||{}),Te=class Te extends y{constructor(e,t){super({...e}),this._item=t,t?(this._label=new h({cls:"label item",content:[this._icon=new v({iconId:t.children?hn:t.iconId}),new u({tag:"span",cls:"",text:t.text})]}),this._label.setData("id",t.id+""),t.children&&(this._childs=new f({cls:"body"}),t.open===void 0&&(t.open=!1),this.addClass("folder"),this.setClass("open",t.open),this.setItems(t.children),this._icon.addDOMEvent("click",o=>this.toggle(o)))):this._childs=new f({cls:"body"}),this.setContent([this._label,this._childs])}toggle(e){let t=this.hasClass("open");this.open(!t),e&&e.stopPropagation()}open(e=!0){this.setClass("open",e),this._item.open=e}setItems(e){if(e){let t=e.map(o=>new Te({},o));this._childs.setContent(t)}else this._childs.clearContent()}};i(Te,"CTreeViewItem");var io=Te,so=class so extends d{constructor(e){super(e),e.items&&this.setItems(e.items),this.setAttribute("tabindex",0),this.setDOMEvents({click:i(t=>this._onclick(t),"click"),keydown:i(t=>this._onkey(t),"keydown")})}setItems(e){this._items=e;let t=new io({cls:"root"},null);t.setItems(e),this.setContent(t)}_onclick(e){let t=e.target;for(;t&&t!=this.dom;){let o=g(t);if(o&&o.hasClass("item")){let n=o.getData("id");this._selectItem(n,o);return}t=t.parentElement}this.clearSelection()}_onkey(e){switch(e.key){case"ArrowDown":{this.navigate(2);break}case"ArrowUp":{this.navigate(1);break}case"Home":{this.navigate(0);break}case"End":{this.navigate(3);break}case"ArrowRight":{this.navigate(5);break}case"+":{this.navigate(6);break}case"ArrowLeft":{this.navigate(4);break}case"-":{this.navigate(7);break}case" ":{this.navigate(8);break}default:console.log(e.key);return}e.preventDefault(),e.stopPropagation()}navigate(e){var n;if(!this._items||this._items.length==0)return;if(!this._selitem)if(e==2||e==4)e=0;else if(e==1)e=3;else return;let t=(n=this._selitem)==null?void 0:n.parentElement(),o=t==null?void 0:t.hasClass("folder");if(t&&e==4&&o&&t.hasClass("open")?e=7:e==5&&(o?t.hasClass("open")?e=2:e=6:e=2),e==6||e==7||e==8){if(o)return e==8?(t.toggle(),!0):(t.open(e==6),!0)}else{let r=this._flattenOpenItems(),a=r.findIndex(c=>this._selection==c.id),l;if(e==0)l=r[0].id;else if(e==3)l=r[r.length-1].id;else if(a>=0){if(e==1)a>0&&(l=r[a-1].id);else if(e==2)a<r.length-1&&(l=r[a+1].id);else if(e==4){let c=r[a].level;for(;a>0;)if(a--,r[a].level<c){l=r[a].id;break}}}if(l){let c=this.query(`[data-id="${l}"]`);return this._selectItem(l,c),!0}}return!1}_flattenOpenItems(){let e=[],t=i((o,n)=>{e.push({id:o.id+"",level:n}),o.children&&o.open&&o.children.forEach(r=>t(r,n+1))},"build");return this._items.forEach(o=>t(o,0)),e}_flattenItems(){let e=[],t=i(o=>{e.push(o),o.children&&o.children.forEach(n=>t(n))},"build");return this._items.forEach(o=>t(o)),e}_selectItem(e,t){this._selitem&&(this._selitem.removeClass("selected"),this._selitem=void 0),this._selitem=t,this._selection=e,t&&(t.addClass("selected"),t.scrollIntoView({behavior:"smooth",block:"nearest"}));let o=this._findItem(e);this.fire("change",{selection:o})}_findItem(e){return this._flattenItems().find(o=>o.id==e)}clearSelection(){this._selitem&&(this._selitem.removeClass("selected"),this._selitem=void 0),this._selection=void 0,this.fire("change",{selection:void 0})}};i(so,"Treeview");var un=so;export{y as Box,ve as BtnGroup,_ as Button,P as CSizer,Oo as Calendar,Bo as Checkbox,M as Color,zo as ColorInput,Fo as ColorPicker,qo as Combobox,d as Component,vo as ComputedStyle,pe as CoreElement,ke as Dialog,X as EventSource,J as Flex,Ie as Form,h as HBox,Ko as Header,v as Icon,Go as Image,C as Input,u as Label,Ee as Listbox,re as Menu,Yo as MessageBox,Qo as Notification,en as Panel,T as Popup,tn as Progress,nn as Rating,H as Rect,Eo as Router,It as Saturation,Ce as ScrollView,rn as Slider,fe as StackBox,fo as Stylesheet,Mo as SvgBuilder,Po as SvgComponent,Ze as SvgGradient,be as SvgGroup,We as SvgPath,xe as SvgShape,Xe as SvgText,sn as Switch,an as Tabs,ln as TextArea,cn as TextEdit,Y as Timer,un as Treeview,j as UnsafeHtml,f as VBox,At as Viewport,dr as _date_set_locale,x as _tr,me as addEvent,uo as addTranslation,go as asap,br as calcAge,cr as camelCase,L as clamp,g as componentFromDOM,po as createLanguage,bo as date_calc_weeknum,W as date_clone,hr as date_diff,pr as date_format,V as date_hash,mr as date_sql_utc,ur as date_to_sql,Ln as dispatchEvent,$r as dragManager,B as formatIntlDate,nr as getAvailableLanguages,or as getCurrentLanguage,Kp as initTooltips,Ae as isArray,de as isFeatureAvailable,ar as isFunction,ho as isLanguage,N as isNumber,I as isString,_o as isUnitLess,Uo as kbNav,er as kbTreeNav,R as makeUniqueComponentId,O as pad,xr as parseIntlDate,lr as pascalCase,yn as selectLanguage,Se as sprintf,lt as svgLoader,Pn as unbubbleEvents,he as unitless,ce as unsafeHtml,Co as wrapDOM};
|
|
1
|
+
"use strict";var Ke=Object.defineProperty;var Jt=Object.getOwnPropertyDescriptor;var No=Object.getOwnPropertyNames;var Fo=Object.prototype.hasOwnProperty;var eo=s=>{throw TypeError(s)};var i=(s,e)=>Ke(s,"name",{value:e,configurable:!0});var Uo=(s,e)=>{for(var t in e)Ke(s,t,{get:e[t],enumerable:!0})},Vo=(s,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of No(e))!Fo.call(s,r)&&r!==t&&Ke(s,r,{get:()=>e[r],enumerable:!(o=Jt(e,r))||o.enumerable});return s};var Ko=s=>Vo(Ke({},"__esModule",{value:!0}),s),h=(s,e,t,o)=>{for(var r=o>1?void 0:o?Jt(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(r=(o?a(e,t,r):a(r))||r);return o&&r&&Ke(e,t,r),r};var to=(s,e,t)=>e.has(s)||eo("Cannot "+t);var T=(s,e,t)=>(to(s,e,"read from private field"),t?t.call(s):e.get(s)),qe=(s,e,t)=>e.has(s)?eo("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(s):e.set(s,t),Ge=(s,e,t,o)=>(to(s,e,"write to private field"),o?o.call(s,t):e.set(s,t),t);var zr={};Uo(zr,{Box:()=>E,Breadcrumbs:()=>he,BtnGroup:()=>K,Button:()=>v,CSizer:()=>C,Calendar:()=>ue,Checkbox:()=>xe,Color:()=>L,ColorInput:()=>$,ColorPicker:()=>fe,Combobox:()=>_e,Component:()=>c,ComputedStyle:()=>It,CoreElement:()=>je,Dialog:()=>Q,EventSource:()=>ae,Flex:()=>ce,Form:()=>W,HBox:()=>u,Header:()=>we,Icon:()=>f,Image:()=>ye,Input:()=>k,Label:()=>x,Link:()=>Ee,Listbox:()=>G,Menu:()=>z,MessageBox:()=>ee,Notification:()=>ke,Panel:()=>Ce,Popup:()=>I,Progress:()=>Ae,Rating:()=>Ie,Rect:()=>N,Router:()=>Ht,Saturation:()=>X,ScrollView:()=>q,Slider:()=>Me,StackBox:()=>V,Stylesheet:()=>At,SvgBuilder:()=>Ut,SvgComponent:()=>Vt,SvgGradient:()=>dt,SvgGroup:()=>et,SvgPath:()=>lt,SvgShape:()=>Je,SvgText:()=>ct,Switch:()=>Pe,Tabs:()=>Le,TextArea:()=>Se,TextEdit:()=>Re,Timer:()=>ie,Treeview:()=>Be,UnsafeHtml:()=>ne,VBox:()=>_,Viewport:()=>J,_date_set_locale:()=>er,_tr:()=>b,addEvent:()=>$e,addTranslation:()=>ft,asap:()=>_t,beep:()=>ar,calcAge:()=>sr,camelCase:()=>Xo,clamp:()=>S,class_ns:()=>p,componentFromDOM:()=>y,createLanguage:()=>bt,date_calc_weeknum:()=>vt,date_clone:()=>se,date_diff:()=>or,date_format:()=>tr,date_hash:()=>Y,date_sql_utc:()=>nr,date_to_sql:()=>rr,dispatchEvent:()=>ao,dragManager:()=>xr,formatIntlDate:()=>F,getAvailableLanguages:()=>Wo,getCurrentLanguage:()=>Qo,initTooltips:()=>Sr,isArray:()=>st,isFeatureAvailable:()=>We,isFunction:()=>Zo,isLanguage:()=>gt,isNumber:()=>U,isString:()=>P,isUnitLess:()=>Mt,kbNav:()=>Xt,kbTreeNav:()=>So,makeUniqueComponentId:()=>R,pad:()=>H,parseIntlDate:()=>ir,pascalCase:()=>$o,selectLanguage:()=>io,sprintf:()=>it,svgLoader:()=>ht,unbubbleEvents:()=>so,unitless:()=>Ze,unsafeHtml:()=>Qe,wrapDOM:()=>Lt,x4_class_ns_sym:()=>Ye});module.exports=Ko(zr);var oo=Symbol("i18n"),ze={};function bt(s,e){ze[s]={name:s,base:e,src_translations:{},translations:{}}}i(bt,"createLanguage");function gt(s){return ze[s]!==void 0}i(gt,"isLanguage");function ft(s,...e){if(!gt(s))return;let t=ze[s];e.forEach(o=>{ro(t.src_translations,o)}),t.translations=no(t.src_translations,t.base,!0)}i(ft,"addTranslation");function ro(s,e){for(let t in e){let o=e[t];typeof o=="string"?s[t]=o:Array.isArray(o)&&(!s[t]||!Array.isArray(s[t]))?s[t]=[...o]:!s[t]||typeof s[t]!="object"?s[t]={...o}:ro(s[t],e[t])}}i(ro,"_patch");function no(s,e,t){let o={};for(let r in s)typeof s[r]!="string"&&!Array.isArray(s[r])?o[r]=no(s[r],e,!1):o[r]=s[r];return qo(o,e,t)}i(no,"_proxyfy");function qo(s,e,t){return new Proxy(s,{get:i((o,r)=>{t?nt=[r]:nt.push(r);let n=o[r];return n===void 0&&(e&&(n=Go(e)),n===void 0&&console.error("I18N error: unable to find","_tr."+nt.join("."))),n},"get")})}i(qo,"_mk_proxy");var nt;function Go(s){for(;s;){let e=ze[s],t=e.translations,o;for(let r of nt){if(o=t[r],o===void 0)break;t=o}if(o!==void 0)return t;s=e.base}}i(Go,"_findBaseTrans");var b={};function io(s){if(gt(s))return b=ze[s].translations,b[oo]=s,b}i(io,"selectLanguage");function Qo(){return b[oo]}i(Qo,"getCurrentLanguage");function Wo(){return Object.keys(ze)}i(Wo,"getAvailableLanguages");var Yo={global:{ok:"OK",cancel:"Annuler",ignore:"Ignorer",yes:"Oui",no:"Non",abort:"Abandonner",retry:"Réessayer",error:"Erreur",today:"Aujourd'hui",open:"Ouvrir",new:"Nouveau",delete:"Supprimer",close:"Fermer",save:"Enregistrer",search:"Rechercher",search_tip:"Saisissez le texte à rechercher. <b>Enter</b> pour lancer la recherche. <b>Esc</b> pour annuler.",required_field:"information requise",invalid_format:"format invalide",invalid_email:"adresse mail invalide",invalid_number:"valeur numérique invalide",diff_date_seconds:"{0} secondes",diff_date_minutes:"{0} minutes",diff_date_hours:"{0} heures",invalid_date:"Date non reconnue ({0})",empty_list:"Liste vide",date_input_formats:"d/m/y|d.m.y|d m y|d-m-y|dmy",date_format:"D/M/Y",day_short:["dim","lun","mar","mer","jeu","ven","sam"],day_long:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],month_short:["jan","fév","mar","avr","mai","jun","jui","aoû","sep","oct","nov","déc"],month_long:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],property:"Propriété",value:"Valeur",err_403:"Vous n'avez pas les droits suffisants pour effectuer cette action",copy:"Copier",cut:"Couper",paste:"Coller"}},jo={global:{ok:"OK",cancel:"Cancel",ignore:"Ignore",yes:"Yes",no:"No",abort:"Abort",retry:"Retry",error:"Error",today:"Today",open:"Open",new:"New",delete:"Delete",close:"Close",save:"Save",search:"Search",search_tip:"Type in the text to search. <b>Enter</b> to start the search. <b>Esc</b> to cancel.",required_field:"missing information",invalid_format:"invalid format",invalid_email:"invalid email address",invalid_number:"bad numeric value",diff_date_seconds:"{0} seconds",diff_date_minutes:"{0} minutes",diff_date_hours:"{0} hours",invalid_date:"Unrecognized date({0})",empty_list:"Empty list",date_input_formats:"m/d/y|m.d.y|m d y|m-d-y|mdy",date_format:"M/D/Y",day_short:["sun","mon","tue","wed","thu","fri","sat"],day_long:["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],month_short:["jan","feb","mar","apr","may","jun","jui","aug","sep","oct","nov","dec"],month_long:["january","february","march","april","mau","june","jully","august","september","october","november","december"],property:"Property",value:"Value",err_403:"You do not have sufficient rights to do that action",copy:"Copy",cut:"Cut",paste:"Paste"}};bt("fr",null);ft("fr",Yo);bt("en","fr");ft("en",jo);io("fr");function P(s){return typeof s=="string"}i(P,"isString");function U(s){return typeof s=="number"&&isFinite(s)}i(U,"isNumber");function st(s){return s instanceof Array}i(st,"isArray");function Zo(s){return s instanceof Function}i(Zo,"isFunction");var wt=class wt extends String{constructor(e){super(e)}};i(wt,"UnsafeHtml");var ne=wt;function Qe(s){return new ne(s)}i(Qe,"unsafeHtml");function S(s,e,t){return s<e?e:s>t?t:s}i(S,"clamp");var yt=class yt{constructor(e,t,o,r){e!==void 0&&(U(e)?(this.left=e,this.top=t,this.width=o,this.height=r):Object.assign(this,e))}get right(){return this.left+this.width}get bottom(){return this.top+this.height}};i(yt,"Rect");var N=yt;function We(s){switch(s){case"eyedropper":return"EyeDropper"in window}return!1}i(We,"isFeatureAvailable");var Et=class Et{setTimeout(e,t,o){this._timers?this.clearTimeout(e):this._timers=new Map;let r=setTimeout(o,t);return this._timers.set(e,r),r}clearTimeout(e){this._timers&&this._timers.has(e)&&(clearTimeout(this._timers.get(e)),this._timers.delete(e))}setInterval(e,t,o){this._timers?this.clearInterval(e):this._timers=new Map;let r=setInterval(o,t);return this._timers.set(e,r),r}clearInterval(e){this._timers&&this._timers.has(e)&&(clearInterval(this._timers.get(e)),this._timers.delete(e))}clearAllTimeouts(){var e;(e=this._timers)==null||e.forEach(t=>{clearTimeout(t)}),this._timers=null}};i(Et,"Timer");var ie=Et;function _t(s){return requestAnimationFrame(s)}i(_t,"asap");function H(s,e,t="0"){let o;return P(s)?o=s:o=""+s,e>0?o.padEnd(e,t):o.padStart(-e,t)}i(H,"pad");function it(s,...e){return s.replace(/{(\d+)}/g,function(t,o){return typeof e[o]<"u"?e[o]:t})}i(it,"sprintf");function $o(s){let e=s;return e=e.replace(/([a-z])([A-Z])/g,"$1 $2"),e=e.toLowerCase(),e=e.replace(/[^- a-z0-9]+/g," "),e.indexOf(" ")<0?e:(e=e.trim(),e.replace(/ /g,"-"))}i($o,"pascalCase");function Xo(s){let e=s.toLowerCase();return e=e.replace(/[^a-zA-Z0-9]+(.)/g,(t,o)=>o.toUpperCase()),e}i(Xo,"camelCase");var Jo="fr-FR";function er(s){Jo=s}i(er,"_date_set_locale");function tr(s,e){return F(s)}i(tr,"date_format");function or(s,e,t){var o=(s.getTime()-e.getTime())/1e3;let r=o;if(r<60)return it(b.global.diff_date_seconds,Math.round(r));let n=Math.floor(r/60);if(n<60)return it(b.global.diff_date_minutes,Math.round(n));let a=Math.floor(n/60);return it(b.global.diff_date_hours,a,n%60)}i(or,"date_diff");function rr(s,e){return e?F(s,"Y-M-D H:I:S"):F(s,"Y-M-D")}i(rr,"date_to_sql");function nr(s){return new Date(s+" GMT")}i(nr,"date_sql_utc");function Y(s){return s.getFullYear()<<16|s.getMonth()<<8|s.getDate()}i(Y,"date_hash");function se(s){return new Date(s.getTime())}i(se,"date_clone");function vt(s){let e=new Date(s.getFullYear(),0,1),t=(s.valueOf()-e.valueOf())/864e5;return Math.floor((t+e.getDay()+1)/7)}i(vt,"date_calc_weeknum");function ir(s,e=b.global.date_input_formats){var o,r,n,a,l,d;let t=e.split("|");for(let m of t){let g="";for(let w of m)w=="d"||w=="D"?g+="(?<day>\\d{1,2})":w=="m"||w=="M"?g+="(?<month>\\d{1,2})":w=="y"||w=="Y"?g+="(?<year>\\d{1,4})":w=="h"||w=="H"?g+="(?<hour>\\d{1,2})":w=="i"||w=="I"?g+="(?<min>\\d{1,2})":w=="s"||w=="S"?g+="(?<sec>\\d{1,2})":w==" "?g+="\\s+":g+="\\s*\\"+w+"\\s*";let A=new RegExp("^"+g+"$","m").exec(s);if(A){let w=new Date,Ve=parseInt((o=A.groups.day)!=null?o:"1"),oe=parseInt((r=A.groups.month)!=null?r:"1"),re=parseInt((n=A.groups.year)!=null?n:w.getFullYear()+""),ot=parseInt((a=A.groups.hour)!=null?a:"0"),Ro=parseInt((l=A.groups.min)!=null?l:"0"),Oo=parseInt((d=A.groups.sec)!=null?d:"0");re>0&&re<100&&(re+=2e3);let rt=new Date(re,oe-1,Ve,ot,Ro,Oo,0),Bo=rt.getFullYear(),zo=rt.getMonth()+1,Ho=rt.getDate();return Bo!=re||zo!=oe||Ho!=Ve?null:rt}}return null}i(ir,"parseIntlDate");function F(s,e=b.global.date_format){if(!s)return"";let t={year:s.getFullYear(),month:s.getMonth()+1,day:s.getDate(),wday:s.getDay(),hours:s.getHours(),minutes:s.getMinutes(),seconds:s.getSeconds(),milli:s.getMilliseconds()},o="",r=0;for(let n of e){if(n=="{"){if(++r==1)continue}else if(n=="}"&&--r==0)continue;if(r){o+=n;continue}n=="d"?o+=t.day:n=="D"?o+=H(t.day,-2):n=="j"?o+=b.global.day_short[t.wday]:n=="J"?o+=b.global.day_long[t.wday]:n=="w"?o+=vt(s):n=="W"?o+=H(vt(s),-2):n=="m"?o+=t.month:n=="M"?o+=H(t.month,-2):n=="o"?o+=b.global.month_short[t.month-1]:n=="O"?o+=b.global.month_long[t.month-1]:n=="y"||n=="Y"?o+=H(t.year,-4):n=="a"||n=="A"?o+=t.hours<12?"am":"pm":n=="h"?o+=t.hours:n=="H"?o+=H(t.hours,-2):n=="i"?o+=t.minutes:n=="I"?o+=H(t.minutes,-2):n=="s"?o+=t.seconds:n=="S"?o+=H(t.seconds,-2):n=="l"?o+=t.milli:n=="L"?o+=H(t.milli,-3):o+=n}return o}i(F,"formatIntlDate");function sr(s,e){if(e===void 0&&(e=new Date),!s)return 0;let t=e.getFullYear()-s.getFullYear();return(e.getMonth()<s.getMonth()||e.getMonth()==s.getMonth()&&e.getDate()<s.getDate())&&t--,t}i(sr,"calcAge");function ar(){new Audio("data:audio/wav;base64,//uQRAAAAWMSLwUIYAAsYkXgoQwAEaYLWfkWgAI0wWs/ItAAAGDgYtAgAyN+QWaAAihwMWm4G8QQRDiMcCBcH3Cc+CDv/7xA4Tvh9Rz/y8QADBwMWgQAZG/ILNAARQ4GLTcDeIIIhxGOBAuD7hOfBB3/94gcJ3w+o5/5eIAIAAAVwWgQAVQ2ORaIQwEMAJiDg95G4nQL7mQVWI6GwRcfsZAcsKkJvxgxEjzFUgfHoSQ9Qq7KNwqHwuB13MA4a1q/DmBrHgPcmjiGoh//EwC5nGPEmS4RcfkVKOhJf+WOgoxJclFz3kgn//dBA+ya1GhurNn8zb//9NNutNuhz31f////9vt///z+IdAEAAAK4LQIAKobHItEIYCGAExBwe8jcToF9zIKrEdDYIuP2MgOWFSE34wYiR5iqQPj0JIeoVdlG4VD4XA67mAcNa1fhzA1jwHuTRxDUQ//iYBczjHiTJcIuPyKlHQkv/LHQUYkuSi57yQT//uggfZNajQ3Vmz+Zt//+mm3Wm3Q576v////+32///5/EOgAAADVghQAAAAA//uQZAUAB1WI0PZugAAAAAoQwAAAEk3nRd2qAAAAACiDgAAAAAAABCqEEQRLCgwpBGMlJkIz8jKhGvj4k6jzRnqasNKIeoh5gI7BJaC1A1AoNBjJgbyApVS4IDlZgDU5WUAxEKDNmmALHzZp0Fkz1FMTmGFl1FMEyodIavcCAUHDWrKAIA4aa2oCgILEBupZgHvAhEBcZ6joQBxS76AgccrFlczBvKLC0QI2cBoCFvfTDAo7eoOQInqDPBtvrDEZBNYN5xwNwxQRfw8ZQ5wQVLvO8OYU+mHvFLlDh05Mdg7BT6YrRPpCBznMB2r//xKJjyyOh+cImr2/4doscwD6neZjuZR4AgAABYAAAABy1xcdQtxYBYYZdifkUDgzzXaXn98Z0oi9ILU5mBjFANmRwlVJ3/6jYDAmxaiDG3/6xjQQCCKkRb/6kg/wW+kSJ5//rLobkLSiKmqP/0ikJuDaSaSf/6JiLYLEYnW/+kXg1WRVJL/9EmQ1YZIsv/6Qzwy5qk7/+tEU0nkls3/zIUMPKNX/6yZLf+kFgAfgGyLFAUwY//uQZAUABcd5UiNPVXAAAApAAAAAE0VZQKw9ISAAACgAAAAAVQIygIElVrFkBS+Jhi+EAuu+lKAkYUEIsmEAEoMeDmCETMvfSHTGkF5RWH7kz/ESHWPAq/kcCRhqBtMdokPdM7vil7RG98A2sc7zO6ZvTdM7pmOUAZTnJW+NXxqmd41dqJ6mLTXxrPpnV8avaIf5SvL7pndPvPpndJR9Kuu8fePvuiuhorgWjp7Mf/PRjxcFCPDkW31srioCExivv9lcwKEaHsf/7ow2Fl1T/9RkXgEhYElAoCLFtMArxwivDJJ+bR1HTKJdlEoTELCIqgEwVGSQ+hIm0NbK8WXcTEI0UPoa2NbG4y2K00JEWbZavJXkYaqo9CRHS55FcZTjKEk3NKoCYUnSQ0rWxrZbFKbKIhOKPZe1cJKzZSaQrIyULHDZmV5K4xySsDRKWOruanGtjLJXFEmwaIbDLX0hIPBUQPVFVkQkDoUNfSoDgQGKPekoxeGzA4DUvnn4bxzcZrtJyipKfPNy5w+9lnXwgqsiyHNeSVpemw4bWb9psYeq//uQZBoABQt4yMVxYAIAAAkQoAAAHvYpL5m6AAgAACXDAAAAD59jblTirQe9upFsmZbpMudy7Lz1X1DYsxOOSWpfPqNX2WqktK0DMvuGwlbNj44TleLPQ+Gsfb+GOWOKJoIrWb3cIMeeON6lz2umTqMXV8Mj30yWPpjoSa9ujK8SyeJP5y5mOW1D6hvLepeveEAEDo0mgCRClOEgANv3B9a6fikgUSu/DmAMATrGx7nng5p5iimPNZsfQLYB2sDLIkzRKZOHGAaUyDcpFBSLG9MCQALgAIgQs2YunOszLSAyQYPVC2YdGGeHD2dTdJk1pAHGAWDjnkcLKFymS3RQZTInzySoBwMG0QueC3gMsCEYxUqlrcxK6k1LQQcsmyYeQPdC2YfuGPASCBkcVMQQqpVJshui1tkXQJQV0OXGAZMXSOEEBRirXbVRQW7ugq7IM7rPWSZyDlM3IuNEkxzCOJ0ny2ThNkyRai1b6ev//3dzNGzNb//4uAvHT5sURcZCFcuKLhOFs8mLAAEAt4UWAAIABAAAAAB4qbHo0tIjVkUU//uQZAwABfSFz3ZqQAAAAAngwAAAE1HjMp2qAAAAACZDgAAAD5UkTE1UgZEUExqYynN1qZvqIOREEFmBcJQkwdxiFtw0qEOkGYfRDifBui9MQg4QAHAqWtAWHoCxu1Yf4VfWLPIM2mHDFsbQEVGwyqQoQcwnfHeIkNt9YnkiaS1oizycqJrx4KOQjahZxWbcZgztj2c49nKmkId44S71j0c8eV9yDK6uPRzx5X18eDvjvQ6yKo9ZSS6l//8elePK/Lf//IInrOF/FvDoADYAGBMGb7FtErm5MXMlmPAJQVgWta7Zx2go+8xJ0UiCb8LHHdftWyLJE0QIAIsI+UbXu67dZMjmgDGCGl1H+vpF4NSDckSIkk7Vd+sxEhBQMRU8j/12UIRhzSaUdQ+rQU5kGeFxm+hb1oh6pWWmv3uvmReDl0UnvtapVaIzo1jZbf/pD6ElLqSX+rUmOQNpJFa/r+sa4e/pBlAABoAAAAA3CUgShLdGIxsY7AUABPRrgCABdDuQ5GC7DqPQCgbbJUAoRSUj+NIEig0YfyWUho1VBBBA//uQZB4ABZx5zfMakeAAAAmwAAAAF5F3P0w9GtAAACfAAAAAwLhMDmAYWMgVEG1U0FIGCBgXBXAtfMH10000EEEEEECUBYln03TTTdNBDZopopYvrTTdNa325mImNg3TTPV9q3pmY0xoO6bv3r00y+IDGid/9aaaZTGMuj9mpu9Mpio1dXrr5HERTZSmqU36A3CumzN/9Robv/Xx4v9ijkSRSNLQhAWumap82WRSBUqXStV/YcS+XVLnSS+WLDroqArFkMEsAS+eWmrUzrO0oEmE40RlMZ5+ODIkAyKAGUwZ3mVKmcamcJnMW26MRPgUw6j+LkhyHGVGYjSUUKNpuJUQoOIAyDvEyG8S5yfK6dhZc0Tx1KI/gviKL6qvvFs1+bWtaz58uUNnryq6kt5RzOCkPWlVqVX2a/EEBUdU1KrXLf40GoiiFXK///qpoiDXrOgqDR38JB0bw7SoL+ZB9o1RCkQjQ2CBYZKd/+VJxZRRZlqSkKiws0WFxUyCwsKiMy7hUVFhIaCrNQsKkTIsLivwKKigsj8XYlwt/WKi2N4d//uQRCSAAjURNIHpMZBGYiaQPSYyAAABLAAAAAAAACWAAAAApUF/Mg+0aohSIRobBAsMlO//Kk4soosy1JSFRYWaLC4qZBYWFRGZdwqKiwkNBVmoWFSJkWFxX4FFRQWR+LsS4W/rFRb/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////VEFHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAU291bmRib3kuZGUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMjAwNGh0dHA6Ly93d3cuc291bmRib3kuZGUAAAAAAAAAACU=").play()}i(ar,"beep");var Ye=Symbol("class-ns");function p(s){return function(e){e[Ye]=s}}i(p,"class_ns");var lr=i(function(){this.propagationStopped=!0},"stopPropagation"),cr=i(function(){this.defaultPrevented=!0},"preventDefault"),kt=class kt{constructor(e=null){this._source=e!=null?e:this}addListener(e,t,o=!1){this._registry||(this._registry=new Map);let r=this._registry.get(e);r||(r=[],this._registry.set(e,r));let n=t;r.indexOf(n)==-1&&(o?r.unshift(n):r.push(n))}fire(e,t){var r;let o=(r=this._registry)==null?void 0:r.get(e);if(o&&o.length){let n=t;if(n||(n={}),n.source||(n.source=this._source),n.type||(n.type=e),n.preventDefault||(n.preventDefault=cr),n.stopPropagation||(n.stopPropagation=lr),o.length==1)o[0](n);else{let a=o.slice();for(let l=0,d=a.length;l<d&&(a[l](n),!n.propagationStopped);l++);}}}};i(kt,"EventSource");var ae=kt;var j,B,Ct=class Ct{constructor(){qe(this,j);qe(this,B)}__startTimer(e,t,o,r){T(this,B)?this.__stopTimer(e):Ge(this,B,new Map);let n=(o?setInterval:setTimeout)(r,t);T(this,B).set(e,()=>{(o?clearInterval:clearTimeout)(n),T(this,B).delete(e)})}__stopTimer(e){let t=T(this,B).get(e);t&&t()}setTimeout(e,t,o){this.__startTimer(e,t,!1,o)}clearTimeout(e){this.__stopTimer(e)}setInterval(e,t,o){this.__startTimer(e,t,!0,o)}clearInterval(e){this.__stopTimer(e)}clearTimeouts(){for(let[e,t]of T(this,B))t();T(this,B).clear()}on(e,t){console.assert(t!=null),T(this,j)||Ge(this,j,new ae(this)),T(this,j).addListener(e,t)}fire(e,t){T(this,j)&&T(this,j).fire(e,t)}};j=new WeakMap,B=new WeakMap,i(Ct,"CoreElement");var je=Ct;var Ze={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function Mt(s){return!!Ze[s]}i(Mt,"isUnitLess");var le=class le{constructor(){this.m_rules=new Map;function e(t){for(let o=0;o<document.styleSheets.length;o++){let r=document.styleSheets[o];if(r.title===t)return r}}if(i(e,"getStyleSheet"),this.m_sheet=e("x4-dynamic-css"),!this.m_sheet){let t=document.createElement("style");t.setAttribute("id","x4-dynamic-css"),document.head.appendChild(t),this.m_sheet=t.sheet}}setRule(e,t){if(P(t)){let o=this.m_rules.get(e);o!==void 0?this.m_sheet.deleteRule(o):o=this.m_sheet.cssRules.length,this.m_rules.set(e,this.m_sheet.insertRule(t,o))}else{let o=1;for(let r in t){let n=r+" { ",a=t[r];for(let l in a){let d=a[l];for(let m=0;m<d.length;m++)n+=l+": "+d[m]+"; "}n+="}",this.setRule(e+"--"+o,n),o++}}}static getVar(e){return le.doc_style||(le.doc_style=getComputedStyle(document.documentElement)),e.startsWith("--")||(e="--"+e),le.doc_style.getPropertyValue(e)}};i(le,"Stylesheet"),le.guid=1;var At=le,Pt=class Pt{constructor(e){this.m_style=e}value(e){return this.m_style[e]}parse(e){return parseInt(this.m_style[e])}get style(){return this.m_style}};i(Pt,"ComputedStyle");var It=Pt;var so={mouseleave:1,mouseenter:1,load:1,unload:1,scroll:1,focus:1,blur:1,rowexit:1,beforeunload:1,stop:1,dragdrop:1,dragenter:1,dragexit:1,draggesture:1,dragover:1,contextmenu:1,created:2,removed:2,sizechange:2},at=new WeakMap,Dt=null,dr=i((s,e)=>{let t=i((r,n)=>{let a=at.get(r);a&&a[n]&&r.dispatchEvent(new Event(n,{}))},"sendEvent"),o=i((r,n)=>{n&&t(r,"created");for(let a=r.firstChild;a;a=a.nextSibling)o(a,n);n||t(r,"removed")},"notify");for(let r of s)r.type=="childList"&&(r.addedNodes&&r.addedNodes.forEach(n=>{o(n,!0)}),r.removedNodes&&r.removedNodes.forEach(n=>{o(n,!1)}))},"observeMutation"),Tt=null;function pr(s){s.forEach(e=>{let t=e.target;t.offsetParent!==null&&t.dispatchEvent(new Event("resized"))})}i(pr,"observeSize");function ao(s){let e=s.target,t=so[s.type]===2;for(;e;){let o=at.get(e);if(o){let r=o[s.type];if(r&&(Array.isArray(r)?r.some(n=>n(s)):r(s),s.stopPropagation||s.defaultPrevented||t))break}if(e=e.parentNode,e==document)break}}i(ao,"dispatchEvent");function $e(s,e,t,o=!1){e=="removed"||e=="created"?Dt||(Dt=new MutationObserver(dr),Dt.observe(document.body,{childList:!0,subtree:!0})):e=="resized"&&(Tt||(Tt=new ResizeObserver(pr)),Tt.observe(s));let r=at.get(s);if(r||(r={},at.set(s,r)),!r[e])r[e]=t,s.addEventListener(e,ao);else{let n=r[e];Array.isArray(n)?n.push(t):r[e]=[n,t]}}i($e,"addEvent");var lo=Symbol("fragment"),co=Symbol("component"),hr=/^-?\d+(\.\d*)?$/;function mr(s){let e=[],t=Object.getPrototypeOf(s);for(;t&&t.constructor!==c;){let o=t.constructor.name,r=t.constructor.hasOwnProperty(Ye)?t.constructor[Ye]:"";e.push(r+o.toLowerCase()),t=Object.getPrototypeOf(t)}return e}i(mr,"genClassNames");var ur=1e3,R=i(()=>`x4-${ur++}`,"makeUniqueComponentId"),c=class extends je{constructor(e){var t,o;if(super(),this.props=e,e.existingDOM)this.dom=e.existingDOM;else{e.ns?this.dom=document.createElementNS(e.ns,(t=e.tag)!=null?t:"div"):this.dom=document.createElement((o=e.tag)!=null?o:"div"),e.attrs&&this.setAttributes(e.attrs),e.cls&&this.addClass(e.cls),e.hidden&&this.show(!1),e.id!==void 0&&this.setAttribute("id",e.id),e.width!==void 0&&this.setStyleValue("width",e.width),e.height!==void 0&&this.setStyleValue("height",e.height),e.tooltip&&this.setAttribute("tooltip",e.tooltip),e.style&&this.setStyle(e.style),e.content&&this.setContent(e.content),e.dom_events&&this.setDOMEvents(e.dom_events);let r=mr(this);this.dom.classList.add(...r),e.disabled&&this.addDOMEvent("created",()=>{this.enable(!1)})}this.dom[co]=this}hasClass(e){return this.dom.classList.contains(e)}addClass(e){if(e)if(e.indexOf(" ")>=0){let t=e.split(" ");this.dom.classList.add(...t)}else this.dom.classList.add(e)}removeClass(e){if(e)if(e.indexOf(" ")>=0){let t=e.split(" ");this.dom.classList.remove(...t)}else this.dom.classList.remove(e)}removeClassEx(e){Array.from(this.dom.classList).forEach(o=>{o.match(e)&&this.dom.classList.remove(o)})}toggleClass(e){if(!e)return;let t=i(o=>{this.dom.classList.toggle(o)},"toggle");e.indexOf(" ")>=0?e.split(" ").forEach(t):t(e)}setClass(e,t=!0){t?this.addClass(e):this.removeClass(e)}setAttributes(e){for(let t in e){let o=e[t];this.setAttribute(t,o)}}setAttribute(e,t){t==null?this.dom.removeAttribute(e):this.dom.setAttribute(e,""+t)}getAttribute(e){return this.dom.getAttribute(e)}getData(e){return this.getAttribute("data-"+e)}setData(e,t){return this.setAttribute("data-"+e,t)}setInternalData(e,t){return this.store||(this.store=new Map),this.store.set(e,t),this}getInternalData(e){var t;return(t=this.store)==null?void 0:t.get(e)}addDOMEvent(e,t,o=!1){$e(this.dom,e,t,o)}setDOMEvents(e){for(let t in e)this.addDOMEvent(t,e[t])}mapPropEvents(e,...t){let o=e;t.forEach(r=>{o.hasOwnProperty(r)&&this.on(r,o[r])})}clearContent(){let e=this.dom;for(;e.firstChild;)e.removeChild(e.firstChild)}setContent(e){this.clearContent(),this.appendContent(e)}appendContent(e){let t=i((o,r)=>{if(r instanceof c)o.appendChild(r.dom);else if(r instanceof ne)o.insertAdjacentHTML("beforeend",r.toString());else if(typeof r=="string"||typeof r=="number"){let n=document.createTextNode(r.toString());o.appendChild(n)}else r&&console.warn("Unknown type to append: ",r)},"set");if(!st(e))t(this.dom,e);else if(e.length<=8)for(let o of e)t(this.dom,o);else{let o=document.createDocumentFragment();for(let r of e)t(o,r);this.dom.appendChild(o)}}prependContent(e){let t=this.dom,o=i(r=>{if(r instanceof c)t.insertBefore(t.firstChild,r.dom);else if(r instanceof ne)t.insertAdjacentHTML("beforebegin",r.toString());else if(typeof r=="string"||typeof r=="number"){let n=document.createTextNode(r.toString());t.insertBefore(t.firstChild,n)}else console.warn("Unknown type to append: ",r)},"set");if(!st(e))o(e);else{let r=document.createDocumentFragment();for(let n of e)o(n);t.insertBefore(t.firstChild,r)}}removeChild(e){this.dom.removeChild(e.dom)}queryAll(e){let t=this.dom.querySelectorAll(e),o=new Array(t.length);return t.forEach((r,n)=>o[n]=y(r)),o}query(e){let t=this.dom.querySelector(e);return y(t)}setAria(e,t){return this.setAttribute(e,t),this}setStyle(e){let t=this.dom.style;for(let o in e){let r=e[o];!Ze[o]&&(U(r)||hr.test(r))&&(r+="px"),t[o]=r}return this}setStyleValue(e,t){let o=this.dom.style;if(U(t)){let r=t+"";Ze[e]||(r+="px"),o[e]=r}else o[e]=t;return this}getStyleValue(e){return this.dom.style[e]}setWidth(e){this.setStyleValue("width",U(e)?e+"px":e)}setHeight(e){this.setStyleValue("height",U(e)?e+"px":e)}setStyleVariable(e,t){this.dom.style.setProperty(e,t)}getStyleVariable(e){return this.getComputedStyle().getPropertyValue(e)}getComputedStyle(){return getComputedStyle(this.dom)}setCapture(e){this.dom.setPointerCapture(e)}releaseCapture(e){this.dom.releasePointerCapture(e)}getBoundingRect(){let e=this.dom.getBoundingClientRect();return new N(e.x,e.y,e.width,e.height)}focus(){this.dom.focus()}scrollIntoView(e){this.dom.scrollIntoView(e)}isVisible(){return this.dom.offsetParent!==null}show(e=!0){this.setClass("x4hidden",!e)}hide(){this.show(!1)}enable(e=!0){this.setAttribute("disabled",!e),this.enumChildNodes(!0).forEach(o=>{o instanceof HTMLInputElement&&(o.disabled=!e)})}disable(){this.enable(!1)}isDisabled(){return this.getAttribute("disabled")}nextElement(){let e=this.dom.nextElementSibling;return y(e)}prevElement(){let e=this.dom.previousElementSibling;return y(e)}parentElement(e){let t=this.dom;for(;t.parentElement;){let o=y(t.parentElement);if(!e||o&&o instanceof e)return o;t=t.parentElement}return null}firstChild(){let e=this.dom.firstElementChild;return y(e)}lastChild(){let e=this.dom.lastElementChild;return y(e)}enumChildComponents(e){let t=[];return this.enumChildNodes(e).forEach(r=>{let n=y(r);n&&t.push(n)}),t}enumChildNodes(e){return Array.from(e?this.dom.querySelectorAll("*"):this.dom.children)}animate(e,t){this.dom.animate(e,t)}static createElement(e,t,...o){let r;return e==this.createFragment||e===lo?o:(e instanceof Function?(t=t!=null?t:{},!t.children&&o&&o.length&&(t.content=o),r=new e(t!=null?t:{})):r=new c({tag:e,content:o,...t}),o&&o.length,r)}static createFragment(){return this.createElement(lo,null)}queryInterface(e){return null}};i(c,"Component"),c=h([p("x4")],c);function y(s){return s?s[co]:null}i(y,"componentFromDOM");function Lt(s){let e=y(s);return e||new c({existingDOM:s})}i(Lt,"wrapDOM");var St=class St extends c{constructor(){super({})}};i(St,"Flex");var ce=St;function de(s){return s.toString(16).padStart(2,"0")}i(de,"hx");function He(s){return Math.round(s)}i(He,"round");var Rt=class Rt{constructor(...e){this.rgb=[0,0,0,1];this.invalid=!1;P(e[0])?this.setValue(e[0]):this.setRgb(e[0],e[1],e[2],e[3])}setValue(e){if(this.invalid=!1,e.length==4&&/#[0-9a-fA-F]{3}/.test(e)){let t=parseInt(e[1],16),o=parseInt(e[2],16),r=parseInt(e[3],16);return this.setRgb(t<<4|t,o<<4|o,r<<4|r,1)}if(e.length==7&&/#[0-9a-fA-F]{6}/.test(e)){let t=parseInt(e[1],16),o=parseInt(e[2],16),r=parseInt(e[3],16),n=parseInt(e[4],16),a=parseInt(e[5],16),l=parseInt(e[6],16);return this.setRgb(t<<4|o,r<<4|n,a<<4|l,1)}if(e.length==9&&/#[0-9a-fA-F]{8}/.test(e)){let t=parseInt(e[1],16),o=parseInt(e[2],16),r=parseInt(e[3],16),n=parseInt(e[4],16),a=parseInt(e[5],16),l=parseInt(e[6],16),d=parseInt(e[7],16),m=parseInt(e[8],16);return this.setRgb(t<<4|o,r<<4|n,a<<4|l,(d<<4|m)/255)}if(e.startsWith("rgba")){let o=/rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*((\d+)|(\d*\.\d+)|(\.\d+))\s*\)/.exec(e);if(o)return this.setRgb(parseInt(o[1]),parseInt(o[2]),parseInt(o[3]),parseFloat(o[4]))}else if(e.startsWith("rgb")){let o=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(e);if(o)return this.setRgb(parseInt(o[1]),parseInt(o[2]),parseInt(o[3]),1)}else if(e.startsWith("var")){let o=/var\s*\(([^)]*)\)/.exec(e);if(o){let r=o[1].trim(),a=getComputedStyle(document.documentElement).getPropertyValue(r);return this.setValue(a)}}return this.invalid=!0,this.setRgb(255,0,0,1)}setHsv(e,t,o,r=1){let n=Math.min(5,Math.floor(e*6)),a=e*6-n,l=o*(1-t),d=o*(1-a*t),m=o*(1-(1-a)*t),g,M,A;switch(n){case 0:g=o,M=m,A=l;break;case 1:g=d,M=o,A=l;break;case 2:g=l,M=o,A=m;break;case 3:g=l,M=d,A=o;break;case 4:g=m,M=l,A=o;break;case 5:g=o,M=l,A=d;break}return this.setRgb(g*255,M*255,A*255,r)}setRgb(e,t,o,r){return this.rgb=[S(e,0,255),S(t,0,255),S(o,0,255),S(r,0,1)],this}toRgbString(e){let t=this.rgb;return e===!1||t[3]==1?`rgb(${He(t[0])},${He(t[1])},${He(t[2])})`:`rgba(${He(t[0])},${He(t[1])},${He(t[2])},${t[3].toFixed(3)})`}toHexString(){let e=this.rgb;return e[3]==1?`#(${de(e[0])},${de(e[1])},${de(e[2])})`:`rgba(${de(e[0])},${de(e[1])},${de(e[2])},${de(e[3]*255)})`}toRgb(){let e=this.rgb;return{red:e[0],green:e[1],blue:e[2],alpha:e[3]}}toHsv(){let e=this.toRgb();e.red/=255,e.green/=255,e.blue/=255;let t=Math.max(e.red,e.green,e.blue),o=Math.min(e.red,e.green,e.blue),r=t-o,n=t===0?0:r/t,a=t,l;if(r===0)l=0;else switch(t){case e.red:l=(e.green-e.blue)/r/6+(e.green<e.blue?1:0);break;case e.green:l=(e.blue-e.red)/r/6+1/3;break;case e.blue:l=(e.red-e.green)/r/6+2/3;break}return{hue:l,saturation:n,value:a,alpha:e.alpha}}getAlpha(){return this.rgb[3]}setAlpha(e){return this.rgb[3]=S(e,0,1),this}isInvalid(){return this.invalid}};i(Rt,"Color");var L=Rt;var Ot=Symbol("x-drag-cb"),zt=class zt{registerDraggableElement(e){e.addDOMEvent("dragstart",t=>{this.dragSource=e,this.dragGhost=e.dom.cloneNode(!0),this.dragGhost.classList.add("dragged"),document.body.appendChild(this.dragGhost),e.addClass("dragging"),t.dataTransfer.setData("text/string","1"),t.dataTransfer.setDragImage(new Image,0,0),t.stopPropagation()}),e.addDOMEvent("drag",t=>{this.dragGhost.style.left=t.pageX+"px",this.dragGhost.style.top=t.pageY+"px"}),e.addDOMEvent("dragend",t=>{e.removeClass("dragging"),this.dragGhost.remove()}),e.setAttribute("draggable","true")}registerDropTarget(e,t,o){let r=i(d=>{if(o&&!o(this.dragSource)){console.log("reject ",e),d.dataTransfer.dropEffect="none";return}console.log("accepted ",e),d.preventDefault(),d.dataTransfer.dropEffect="copy"},"dragEnter"),n=i(d=>{if(o&&!o(this.dragSource)){console.log("reject ",e),d.dataTransfer.dropEffect="none";return}if(d.preventDefault(),this.dropTarget!=e&&(this.dropTarget=e,this._startCheck()),this.dropTarget){let m={pt:{x:d.pageX,y:d.pageY},data:d.dataTransfer};t("drag",this.dragSource,m)}d.dataTransfer.dropEffect="copy"},"dragOver"),a=i(d=>{this.dropTarget=null,d.preventDefault()},"dragLeave"),l=i(d=>{let m={pt:{x:d.pageX,y:d.pageY},data:d.dataTransfer};t("drop",this.dragSource,m),this.dropTarget=null,e.removeClass("drop-over"),d.preventDefault()},"drop");e.addDOMEvent("dragenter",r),e.addDOMEvent("dragover",n),e.addDOMEvent("dragleave",a),e.addDOMEvent("drop",l),e.setInternalData(Ot,t)}_startCheck(){this.timer&&(clearInterval(this.timer),this._check()),this.timer=setInterval(()=>this._check(),300)}_check(){let e=i(o=>{o.removeClass("drop-over"),o.getInternalData(Ot)("leave",this.dragSource)},"leaving"),t=i(o=>{o.addClass("drop-over"),o.getInternalData(Ot)("enter",this.dragSource)},"entering");this.dropTarget?(!this.notified||this.notified!=this.dropTarget)&&(this.notified&&e(this.notified),this.notified=this.dropTarget,t(this.notified)):this.notified&&(e(this.notified),this.notified=null,clearInterval(this.timer))}};i(zt,"DragManager");var Bt=zt,xr=new Bt;function br(s,e=!1){if(s instanceof RegExp)return{keys:null,pattern:s};let t=s.split("/"),o=[],r="";t[0]==""&&t.shift();for(let n of t){let a=n[0];if(a==="*")o.push("wild"),r+="/(.*)";else if(a===":"){let l=n.indexOf("?",1),d=n.indexOf(".",1);o.push(n.substring(1,l>=0?l:d>=0?d:n.length)),r+=l>=0&&d<0?"(?:/([^/]+?))?":"/([^/]+?)",d>=0&&(r+=(l>=0?"?":"")+"\\"+n.substring(d))}else r+="/"+n}return{keys:o,pattern:new RegExp(`^${r}${e?"(?=$|/)":"/?$"}`,"i")}}i(br,"parseRoute");var Nt=class Nt extends ae{constructor(e=!0){super(),this.m_routes=[],this.m_useHash=e,window.addEventListener("popstate",t=>{let o=this._getLocation(),r=this._find(o);r.handlers.forEach(n=>{n(r.params,o)})})}get(e,t){let{keys:o,pattern:r}=br(e);this.m_routes.push({keys:o,pattern:r,handler:t})}init(){this.navigate(this._getLocation())}_getLocation(){return this.m_useHash?"/"+document.location.hash.substring(1):document.location.pathname}navigate(e,t=!0,o=!1){e.startsWith("/")||(e="/"+e);let r=this._find(e);if(!r||r.handlers.length==0){console.log("route not found: "+e),this.fire("error",{code:404,message:"route not found"});return}if(this.m_useHash){for(;e.at(0)=="/";)e=e.substring(1);e="#"+e}o?window.history.replaceState({},"",e):window.history.pushState({},"",e),t&&r.handlers.forEach(n=>{n(r.params,e)})}_find(e){let t=[],o={},r=[];for(let n of this.m_routes)if(n.keys)if(n.keys.length>0){if(t=n.pattern.exec(e),t===null)continue;for(let a=0;a<n.keys.length;)o[n.keys[a]]=t[++a];r=[...r,n.handler]}else n.pattern.test(e)&&(r=[...r,n.handler]);else{if(t=n.pattern.exec(e),!t)continue;if(t.groups)for(let a in t.groups)o[a]=t.groups[a];r=[...r,n.handler]}return{params:o,handlers:r}}};i(Nt,"Router");var Ht=Nt;var po="http://www.w3.org/2000/svg";function gr(s){return s*Math.PI/180}i(gr,"d2r");function ho(s,e,t,o){let r=gr(o);return{x:s+t*Math.cos(r),y:e+t*Math.sin(r)}}i(ho,"p2c");function D(s){return Math.round(s*1e3)/1e3}i(D,"num");function Ft(s,...e){return e=e.map(t=>typeof t=="number"&&isFinite(t)?D(t):t),String.raw(s,...e)}i(Ft,"clean");var Kt=class Kt{constructor(e){this._dom=document.createElementNS("http://www.w3.org/2000/svg",e)}getDom(){return this._dom}stroke(e,t){return this.setAttr("stroke",e),t!==void 0&&this.setAttr("stroke-width",t+"px"),this}strokeWidth(e){return this.setAttr("stroke-width",e+"px"),this}strokeCap(e){return this.setAttr("stroke-linecap",e)}strokeOpacity(e){return this.setAttr("stroke-opacity",e+"")}antiAlias(e){return this.setAttr("shape-rendering",e?"auto":"crispEdges")}fill(e){return this.setAttr("fill",e),this}no_fill(){return this.setAttr("fill","transparent"),this}setAttr(e,t){return this._dom.setAttribute(e,t),this}setStyle(e,t){let o=this._dom.style;if(U(t)){let r=t+"";Mt(e)||(r+="px"),o[e]=r}else o[e]=t;return this}addClass(e){if(e)if(e.indexOf(" ")>=0){let t=e.split(" ");this._dom.classList.add(...t)}else this._dom.classList.add(e)}clip(e){return this.setAttr("clip-path",`url(#${e})`),this}transform(e){return this.setAttr("transform",e),this}rotate(e,t,o){return this.transform(`rotate( ${e} ${t} ${o} )`),this}translate(e,t){return this.transform(`translate( ${e} ${t} )`),this}scale(e){return this.transform(`scale( ${e} )`),this}addDOMEvent(e,t,o=!1){return $e(this._dom,e,t,o),this}};i(Kt,"SvgItem");var pe=Kt,qt=class qt extends pe{constructor(){super("path"),this._path=""}_update(){return this.setAttr("d",this._path),this}moveTo(e,t){return this._path+=Ft`M${e},${t}`,this._update()}lineTo(e,t){return this._path+=Ft`L${e},${t}`,this._update()}closePath(){return this._path+="Z",this._update()}arc(e,t,o,r,n){let a=ho(e,t,o,r-90),l=ho(e,t,o,n-90),d=n-r<=180?"0":"1";return this._path+=Ft`M${a.x},${a.y}A${o},${o} 0 ${d} 1 ${l.x},${l.y}`,this._update()}};i(qt,"SvgPath");var lt=qt,Gt=class Gt extends pe{constructor(e,t,o){super("text"),this.setAttr("x",D(e)+""),this.setAttr("y",D(t)+""),this._dom.innerHTML=o}font(e){return this.setAttr("font-family",e)}fontSize(e){return this.setAttr("font-size",e+"")}fontWeight(e){return this.setAttr("font-weight",e)}textAlign(e){let t;switch(e){case"left":t="start";break;case"center":t="middle";break;case"right":t="end";break;default:return this}return this.setAttr("text-anchor",t)}verticalAlign(e){let t;switch(e){case"top":t="hanging";break;case"center":t="middle";break;case"bottom":t="baseline";break;case"baseline":t="mathematical";break;default:return}return this.setAttr("alignment-baseline",t)}};i(Gt,"SvgText");var ct=Gt,Qt=class Qt extends pe{constructor(e){super(e)}};i(Qt,"SvgShape");var Je=Qt,Ne=class Ne extends pe{constructor(e,t,o,r){super("linearGradient"),this._id="gx-"+Ne.g_id,Ne.g_id++,this.setAttr("id",this._id),this.setAttr("x1",P(e)?e:D(e)+""),this.setAttr("x2",P(o)?o:D(o)+""),this.setAttr("y1",P(t)?t:D(t)+""),this.setAttr("y2",P(r)?r:D(r)+""),this._stops=[]}get id(){return"url(#"+this._id+")"}addStop(e,t){return this._dom.insertAdjacentHTML("beforeend",`<stop offset="${e}%" stop-color="${t}"></stop>`),this}};i(Ne,"SvgGradient"),Ne.g_id=1;var dt=Ne,pt=class pt extends pe{constructor(e="g"){super(e)}append(e){return this._dom.appendChild(e.getDom()),e}path(){let e=new lt;return this.append(e)}text(e,t,o){let r=new ct(e,t,o);return this.append(r)}ellipse(e,t,o,r=o){let n=new Je("ellipse");return n.setAttr("cx",D(e)+""),n.setAttr("cy",D(t)+""),n.setAttr("rx",D(o)+""),n.setAttr("ry",D(r)+""),this.append(n)}rect(e,t,o,r){r<0&&(t=t+r,r=-r);let n=new Je("rect");return n.setAttr("x",D(e)+""),n.setAttr("y",D(t)+""),n.setAttr("width",D(o)+""),n.setAttr("height",D(r)+""),this.append(n)}group(){let e=new pt;return this.append(e)}linear_gradient(e,t,o,r){let n=new dt(e,t,o,r);return this.append(n)}clear(){let e=this._dom;for(;e.firstChild;)e.removeChild(e.firstChild)}};i(pt,"SvgGroup");var et=pt,Xe=class Xe extends et{constructor(){super()}addClip(e,t,o,r){let n="c-"+Xe.g_clip_id++,a=new et("clipPath");return a.setAttr("id",n),a.rect(e,t,o,r),this.append(a),n}};i(Xe,"SvgBuilder"),Xe.g_clip_id=1;var Ut=Xe,Wt=class Wt extends c{constructor(e){super({...e,tag:"svg",ns:po}),this.setAttribute("xmlns",po),e.viewbox&&this.setAttribute("viewbox",e.viewbox),e.svg&&this.dom.appendChild(e.svg.getDom())}};i(Wt,"SvgComponent");var Vt=Wt;var E=class extends c{};i(E,"Box"),E=h([p("x4")],E);var u=class extends E{};i(u,"HBox"),u=h([p("x4")],u);var _=class extends E{constructor(e){super(e)}};i(_,"VBox"),_=h([p("x4")],_);var V=class extends E{constructor(e){var t;super(e),this._items=(t=e.items)==null?void 0:t.map(o=>({...o,page:null})),e.default?this.select(e.default):this._items.length&&this.select(this._items[0].name)}select(e){let t=this.query(".selected");t&&t.setClass("selected",!1);let o=this._items.find(r=>r.name==e);o&&(o.page||(o.page=this._createPage(o),this.appendContent(o.page)),t=o.page,t&&t.setClass("selected",!0))}_createPage(e){let t;return t=e.content,t==null||t.setData("stackname",e.name),t}};i(V,"StackBox"),V=h([p("x4")],V);var mo='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--!Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M299.3 244.7c6.2 6.2 6.2 16.4 0 22.6l-192 192c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6L265.4 256 84.7 75.3c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0l192 192z"/></svg>';var he=class extends u{constructor(e){var o;super(e),this.mapPropEvents(e,"click");let t=[];(o=e.items)==null||o.map((r,n)=>{t.push(new v({label:r.label,icon:r.icon,click:i(()=>{this.fire("click",{context:r.name})},"click")})),n!=e.items.length-1&&t.push(new f({iconId:mo}))}),this.setContent(t)}};i(he,"Breadcrumbs"),he=h([p("x4")],he);var jt=class jt{constructor(){this.cache=new Map,this.waiters=new Map}async load(e){return this.cache.has(e)?Promise.resolve(this.cache.get(e)):new Promise((t,o)=>{this.waiters.has(e)?this.waiters.get(e).push(t):(this.waiters.set(e,[t]),this._load(e).then(r=>{console.timeEnd(e),this.cache.set(e,r),this.waiters.get(e).forEach(a=>a(r))}))})}async _load(e){console.time(e);let t=await fetch(e);if(t.ok)return t.text()}};i(jt,"SvgLoader");var Yt=jt,ht=new Yt,f=class extends c{constructor(e){super(e),this.setIcon(e.iconId)}setIcon(e){if(e){if(e.startsWith("var:"))do{let t=e.substring(4);e=document.documentElement.style.getPropertyValue(t)}while(e.startsWith("var:"));e.startsWith("data:image/svg+xml,<svg")?this.dom.insertAdjacentHTML("beforeend",e.substring(19)):e.endsWith(".svg")?ht.load(e).then(t=>{this.clearContent(),this.dom.insertAdjacentHTML("beforeend",t)}):this.setContent(new c({tag:"img",attrs:{src:e}}))}else this.clearContent(),this.addClass("empty")}};i(f,"Icon"),f=h([p("x4")],f);var v=class extends c{constructor(e){super({...e,tag:"button",content:null}),this.mapPropEvents(e,"click"),this.addDOMEvent("click",t=>this._on_click(t)),this.setContent([new f({id:"icon",iconId:this.props.icon}),new c({id:"label",content:this.props.label})])}_on_click(e){this.fire("click",{}),e.preventDefault(),e.stopPropagation()}setText(e){this.query("#label").setContent(e)}setIcon(e){this.query("#icon").setIcon(e)}};i(v,"Button"),v=h([p("x4")],v);var K=class extends E{constructor(e){super(e),e.align&&this.addClass("align-"+e.align),this.addClass(e.vertical?"x4vbox":"x4hbox"),e.items&&this.setButtons(e.items),this.mapPropEvents(e,"btnclick")}setButtons(e){this.clearContent();let t=[];e==null||e.forEach(o=>{if(o==="-")o=new ce;else if(P(o)){let r,n=o,[a,l]=n.split(".");switch(a){case"ok":r=b.global.ok;break;case"cancel":r=b.global.cancel;break;case"abort":r=b.global.abort;break;case"no":r=b.global.no;break;case"yes":r=b.global.yes;break;case"retry":r=b.global.retry;break}o=new v({cls:l,label:r,click:i(()=>{this.fire("btnclick",{button:n})},"click")})}t.push(o)}),super.setContent(t)}};i(K,"BtnGroup"),K=h([p("x4")],K);var Fe,x=class extends c{constructor(t){super({...t,content:null});qe(this,Fe);this.setContent([new f({id:"icon",iconId:this.props.icon}),Ge(this,Fe,new c({tag:"span",id:"text"}))]);let o=this.props.text;this.setText(o),t.labelFor&&this.setAttribute("for",t.labelFor)}setText(t){T(this,Fe).setContent(t),T(this,Fe).setClass("empty",!t)}setIcon(t){this.query("#icon").setIcon(t)}};Fe=new WeakMap,i(x,"Label"),x=h([p("x4")],x);var C=class extends c{constructor(e,t){super({}),this._type=e,this.addClass(e),this.addDOMEvent("pointerdown",o=>{this.setCapture(o.pointerId),this._ref=t!=null?t:y(this.dom.parentElement),this._delta={x:0,y:0};let r=this._ref.getBoundingRect();this._type.includes("left")?this._delta.x=o.pageX-r.left:this._delta.x=o.pageX-(r.left+r.width),this._type.includes("top")?this._delta.y=o.pageY-r.top:this._delta.y=o.pageY-(r.top+r.height)}),this.addDOMEvent("pointerup",o=>{this.releaseCapture(o.pointerId),this._ref=null}),this.addDOMEvent("pointermove",o=>{this._onMouseMove(o)})}_onMouseMove(e){if(!this._ref)return;let t={x:e.pageX-this._delta.x,y:e.pageY-this._delta.y},o=this._ref.getBoundingRect(),r={},n=!0;this._type.includes("top")&&(r.top=t.y,r.height=o.top+o.height-t.y,n=!1),this._type.includes("bottom")&&(r.height=t.y-o.top,n=!1),this._type.includes("left")&&(r.left=t.x,r.width=o.left+o.width-t.x),this._type.includes("right")&&(r.width=t.x-o.left),this._ref.setStyle(r);let a=this._ref.getBoundingRect();this.fire("resize",{size:n?a.width:a.height}),e.preventDefault(),e.stopPropagation()}};i(C,"CSizer"),C=h([p("x4")],C);var Ue,uo=0,xo=[],O=[],Zt=[],I=class extends c{constructor(t){super(t);this._isopen=!1;this._isshown=!1;this._dismiss=i(t=>{O.some(r=>r.dom.contains(t.target))||(t.preventDefault(),t.stopPropagation(),this.dismiss())},"_dismiss");this.props.sizable&&this._createSizers()}displayNear(t,o="top left",r="top left",n={x:0,y:0}){this.setStyle({left:"0px",top:"0px"}),this._show();let a=this.getBoundingRect(),l=t.left,d=t.top;r.indexOf("right")>=0?l=t.left+t.width:r.indexOf("center")>=0&&(l=t.left+t.width/2),r.indexOf("bottom")>=0?d=t.bottom:r.indexOf("middle")>=0&&(d=t.top+t.height/2);let m="l";o.indexOf("right")>=0?l-=a.width:o.indexOf("center")>=0&&(l-=a.width/2);let g="t";o.indexOf("bottom")>=0?d-=a.height:o.indexOf("middle")>=0&&(d-=a.height/2),n&&(l+=n.x,d+=n.y),l+=document.scrollingElement.scrollLeft,d+=document.scrollingElement.scrollTop,this.displayAt(l,d)}displayCenter(){this.displayNear(new N(window.innerWidth/2,window.innerHeight/2,0,0),"center middle")}displayAt(t,o){this.setStyle({left:t+"px",top:o+"px"}),this._show();let r=this.getBoundingRect(),n=window.innerWidth-16,a=window.innerHeight-16;r.right>n&&this.setStyleValue("left",n-r.width),r.bottom>a&&this.setStyleValue("top",a-r.height),this.props.movable&&(this.queryAll(".caption-element").forEach(d=>new mt(d,this)),this.hasClass("popup-caption")&&new mt(this,this)),this.fire("opened",{})}_show(){this.props.modal&&!this._isshown&&(this._showModalMask(),xo.push(this),uo++),this._isshown=!0,this.props.autoClose&&(O.length==0&&document.addEventListener("pointerdown",this._dismiss),O.push(this),this.setData("close",this.props.autoClose===!0?R():this.props.autoClose)),Zt.push(this),document.body.appendChild(this.dom),this.show()}show(t=!0){this._isopen=t,super.show(t)}isOpen(){return this._isopen}close(){document.body.removeChild(this.dom);let t=Zt.indexOf(this);if(console.assert(t>=0),Zt.splice(t,1),this.props.autoClose){let o=O.indexOf(this);o>=0&&(O.splice(o,1),O.length==0&&document.removeEventListener("pointerdown",this._dismiss))}if(this.props.modal){let o=xo.pop();console.assert(o==this),this._updateModalMask()}this._isshown=!1,this.fire("closed",{})}dismiss(t=!1){if(O.length==0)return;let o=this.getData("close"),r=[],n=[],a=-1;t&&(a=O.indexOf(this)),O.forEach((d,m)=>{d.getData("close")==o&&m>a?r.push(d):n.push(d)});let l=r.reverse();O=n,O.length==0&&document.removeEventListener("pointerdown",this._dismiss),l.forEach(d=>d.close())}_showModalMask(){Ue||(Ue=new c({cls:"x4modal-mask",domEvents:{click:this._dismiss}})),Ue.show(!0),document.body.insertAdjacentElement("beforeend",Ue.dom)}_updateModalMask(){--uo==0?Ue.show(!1):this.dom.insertAdjacentElement("beforebegin",Ue.dom)}_createSizers(){this.appendContent([new C("top"),new C("bottom"),new C("left"),new C("right"),new C("top-left"),new C("bottom-left"),new C("top-right"),new C("bottom-right")])}};i(I,"Popup"),I=h([p("x4")],I);var $t=class $t{constructor(e,t){this.self=!!t,e.addDOMEvent("pointerdown",o=>{if(this.self&&o.target!=e.dom)return;e.setCapture(o.pointerId),this.ref=t!=null?t:y(e.dom.parentElement),this.delta={x:0,y:0};let r=this.ref.getBoundingRect();this.delta.x=o.pageX-r.left,this.delta.y=o.pageY-r.top}),e.addDOMEvent("pointerup",o=>{e.releaseCapture(o.pointerId),this.ref=null}),e.addDOMEvent("pointermove",o=>{this._onMouseMove(o)})}_onMouseMove(e){if(!this.ref)return;let t={x:e.pageX-this.delta.x,y:e.pageY-this.delta.y},o=this.ref.getBoundingRect(),r={};this.ref.setStyle({top:t.y+"",left:t.x+""}),e.preventDefault(),e.stopPropagation()}};i($t,"CMover");var mt=$t;var bo=400,me=class extends c{constructor(){super({})}};i(me,"CMenuSep"),me=h([p("x4")],me);var ut=new ie,Z=class extends c{constructor(e){super({disabled:e.disabled,cls:e.cls}),e.menu&&this.addClass("popup"),this.setContent([new f({id:"icon",iconId:e.icon}),new c({id:"text",content:e.text})]),e.menu?(this.menu=e.menu,this.addDOMEvent("mouseenter",()=>this.openSub(!0)),this.addDOMEvent("click",()=>this.openSub(!1)),this.addDOMEvent("mouseleave",()=>this.closeSub()),this.menu.on("opened",()=>this.addClass("opened")),this.menu.on("closed",()=>this.removeClass("opened"))):(this.addDOMEvent("mouseenter",()=>{ut.setTimeout("open",bo,()=>{this.dismiss(!0)})}),this.addDOMEvent("click",()=>{this.dismiss(!1),e.click&&e.click(new Event("click"))}))}dismiss(e){let t=this.parentElement(z);t&&t.dismiss(e)}openSub(e){let t=i(()=>{this.dismiss(!0);let o=this.getBoundingRect();this.menu.displayAt(o.right-4,o.top)},"open");e?ut.setTimeout("open",bo,t):(ut.clearTimeout("open"),t())}closeSub(){ut.clearTimeout("open")}};i(Z,"CMenuItem"),Z=h([p("x4")],Z);var z=class extends I{constructor(e){var o;super({...e,autoClose:"menu",modal:!1}),this.addClass("x4vbox");let t=(o=e.items)==null?void 0:o.map(r=>r==="-"?new me:P(r)?new Z({text:r,click:null,cls:"title"}):r instanceof c?r:new Z(r));this.setContent(t)}};i(z,"Menu"),z=h([p("x4")],z);var go='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512" fill="currentColor"><!--!Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M9.4 256l11.3-11.3 192-192L224 41.4 246.6 64 235.3 75.3 54.6 256 235.3 436.7 246.6 448 224 470.6l-11.3-11.3-192-192L9.4 256z"/></svg>';var fo='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" fill="currentColor"><!--!Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M128 16l0-16L96 0l0 16 0 48L32 64 0 64 0 96l0 64 0 32L0 480l0 32 32 0 384 0 32 0 0-32 0-288 0-32 0-64 0-32-32 0-64 0 0-48 0-16L320 0l0 16 0 48L128 64l0-48zM32 192l384 0 0 288L32 480l0-288zm0-96l384 0 0 64L32 160l0-64zM331.3 283.3L342.6 272 320 249.4l-11.3 11.3L208 361.4l-52.7-52.7L144 297.4 121.4 320l11.3 11.3 64 64L208 406.6l11.3-11.3 112-112z"/></svg>';var vo='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512" fill="currentColor"><!--!Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M310.6 256l-11.3 11.3-192 192L96 470.6 73.4 448l11.3-11.3L265.4 256 84.7 75.3 73.4 64 96 41.4l11.3 11.3 192 192L310.6 256z"/></svg>';var ue=class extends _{constructor(e){super(e),this.mapPropEvents(e,"change"),this.m_date=e.date?se(e.date):new Date,this._update()}_update(){let e=se(this.m_date);e.setDate(1);let t=e.getDay();t==0&&(t=7),e.setDate(-t+1+1);let o=se(e),r=Y(this.m_date),n=Y(new Date),a=se(this.m_date);a.setDate(1),a.setMonth(a.getMonth()+1),a.setDate(0);let l=Y(a),d=[],m=new u({cls:"month-sel",content:[new x({cls:"month",text:F(this.m_date,"O"),dom_events:{click:i(()=>this._choose("month"),"click")}}),new x({cls:"year",text:F(this.m_date,"Y"),dom_events:{click:i(()=>this._choose("year"),"click")}}),new ce,new v({icon:go,click:i(()=>this._next(!1),"click")}),new v({icon:fo,click:i(()=>this.setDate(new Date),"click"),tooltip:b.global.today}),new v({icon:vo,click:i(()=>this._next(!0),"click")})]});d.push(m);let g=[];g.push(new u({cls:"weeknum cell"}));for(let w=0;w<7;w++)g.push(new x({cls:"cell",text:b.global.day_short[(w+1)%7]}));d.push(new u({cls:"week header",content:g}));let M=this.m_date.getMonth(),A=!0;for(;Y(o)<=l;){let w=[new u({cls:"weeknum cell",content:new c({tag:"span",content:F(o,"w")})})];for(let Ve=0;Ve<7;Ve++){let oe="cell day";Y(o)==r&&(oe+=" selection"),Y(o)==n&&(oe+=" today"),o.getMonth()!=M&&(oe+=" out");let re=i(ot=>new u({cls:oe,flex:1,content:new c({cls:"text",content:Qe(`<span>${F(ot,"d")}</span>`)}),dom_events:{click:i(()=>this.select(ot),"click")}}),"mkItem");w.push(re(se(o))),o.setDate(o.getDate()+1),A=!1}d.push(new u({cls:"week",flex:1,content:w}))}this.setContent(d)}select(e){this.m_date=e,this.fire("change",{value:e}),this._update()}_next(e){this.m_date.setMonth(this.m_date.getMonth()+(e?1:-1)),this._update()}_choose(e){var n,a,l,d;let t=[];if(e=="month")for(let m=0;m<12;m++)t.push({text:b.global.month_long[m],click:i(()=>{this.m_date.setMonth(m),this._update()},"click")});else if(e=="year"){let m=(a=(n=this.props.minDate)==null?void 0:n.getFullYear())!=null?a:1900,g=(d=(l=this.props.maxDate)==null?void 0:l.getFullYear())!=null?d:2037;for(let M=g;M>=m;M--)t.push({text:""+M,click:i(()=>{this.m_date.setFullYear(M),this._update()},"click")})}let o=new z({items:t}),r=this.getBoundingRect();o.displayAt(r.left,r.top)}getDate(){return this.m_date}setDate(e){this.m_date=e,this._update()}};i(ue,"Calendar"),ue=h([p("x4")],ue);var k=class extends c{constructor(e){var t;switch(super({tag:"input",...e}),this.setAttribute("type",(t=e.type)!=null?t:"text"),this.setAttribute("name",e.name),e.type){case"checkbox":case"radio":{let o=this.dom;o.checked=e.checked,o.value=e.value+"";break}case"range":{this.setAttribute("min",e.min),this.setAttribute("max",e.max),this.setAttribute("step",e.step),this.setAttribute("value",e.value);break}case"number":{this.setAttribute("required",e.required),this.setAttribute("readonly",e.readonly),this.setAttribute("min",e.min),this.setAttribute("max",e.max),this.setAttribute("step",e.step),this.setAttribute("value",e.value+"");break}case"date":{this.setAttribute("required",e.required);let o=e.value;o instanceof Date||this.setAttribute("value",o);break}case"file":{let o;Array.isArray(e.accept)?o=e.accept.join(","):o=e.accept,this.setAttribute("accept",o);break}default:{this.setAttribute("required",e.required),this.setAttribute("readonly",e.readonly),e.value!==null&&e.value!==void 0&&this.setAttribute("value",e.value),e.pattern!==null&&e.pattern!==void 0&&this.setAttribute("pattern",e.pattern),e.placeholder!==null&&e.placeholder!==void 0&&this.setAttribute("placeholder",e.placeholder),e.spellcheck===!1&&this.setAttribute("spellcheck",!1);break}}}getValue(){return this.dom.value}setValue(e){this.dom.value=e+""}getNumValue(){return parseFloat(this.getValue())}setNumValue(e){this.setValue(e+"")}setReadOnly(e){let t=this.dom;t.readOnly=e}selectAll(){this.dom.select()}select(e,t=9999){this.dom.setSelectionRange(e,e+t)}getSelection(){let e=this.dom;return{start:e.selectionStart,length:e.selectionEnd-e.selectionStart}}queryInterface(e){return e=="form-element"?{getRawValue:i(()=>this.getValue(),"getRawValue"),setRawValue:i(o=>{this.setValue(o)},"setRawValue")}:super.queryInterface(e)}};i(k,"Input"),k=h([p("x4")],k);var _o='data:image/svg+xml,<svg viewBox="0 0 10 7" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">%0D%0A%09<path d="M4 4.586L1.707 2.293A1 1 0 1 0 .293 3.707l3 3a.997.997 0 0 0 1.414 0l5-5A1 1 0 1 0 8.293.293L4 4.586z" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd">%0D%0A%09</path>%0D%0A</svg>';var xe=class extends c{constructor(e){super(e);let t=R();this.mapPropEvents(e,"change"),this.setContent([new c({cls:"inner",content:[this._input=new k({type:"checkbox",id:t,checked:e.checked,dom_events:{change:i(()=>this._on_change(),"change")}})]}),new x({tag:"label",text:e.label,labelFor:t,id:void 0})]),ht.load(_o).then(o=>{this.query(".inner").dom.insertAdjacentHTML("beforeend",o)})}_on_change(){this.fire("change",{value:this.getCheck()})}getCheck(){return this._input.dom.checked}setCheck(e){let t=this._input.dom;t.checked=e}setLabel(e){this.query("label").setText(e)}toggle(){this.setCheck(!this.getCheck())}};i(xe,"Checkbox"),xe=h([p("x4")],xe);var wo='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"><!--!Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M479.4 240L384 240l-16 0 0 32 16 0 95.4 0C471.6 383 383 471.6 272 479.4l0-95.4 0-16-32 0 0 16 0 95.4C129 471.6 40.4 383 32.6 272l95.4 0 16 0 0-32-16 0-95.4 0C40.4 129 129 40.4 240 32.6l0 95.4 0 16 32 0 0-16 0-95.4C383 40.4 471.6 129 479.4 240zM256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512z"/></svg>';var $=class extends u{constructor(e){super(e);let t,o;this.setContent([t=new c({cls:"swatch"}),o=new k({type:"text",value:"",spellcheck:!1}),We("eyedropper")?new v({icon:wo,click:i(()=>{new window.EyeDropper().open().then(l=>{n=new L(l.sRGBHex),r(n)})},"click")}):null]),o.addDOMEvent("input",()=>{let a=o.getValue(),l=new L(a);l.isInvalid()||(n=l,r(n))});let r=i(a=>{t.setStyleValue("backgroundColor",a.toRgbString(!1)),o.setValue(a.toRgbString(!1))},"updateColor"),n;e.color instanceof L?n=e.color:n=new L(e.color),r(n)}};i($,"ColorInput"),$["$cls-ns"]="x4",$=h([p("x4")],$);var X=class extends E{constructor(t,o){super(t);this.mdown=!1;this.hsv={hue:1,saturation:1,value:1,alpha:1};this.setContent([this.color=new c({cls:"overlay"}),new c({cls:"overlay",style:{backgroundImage:"linear-gradient(90deg, rgb(255, 255, 255), transparent)"}}),new c({cls:"overlay",style:{backgroundImage:"linear-gradient(0deg, rgb(0, 0, 0), transparent)"}}),this.thumb=new c({cls:"thumb"})]),this.setDOMEvents({pointerdown:i(r=>this.mousedown(r),"pointerdown"),pointermove:i(r=>this.mousemove(r),"pointermove"),pointerup:i(r=>this.mouseup(r),"pointerup"),created:i(()=>this.updateThumbMarker(),"created")}),this.updateBaseColor(o)}mousedown(t){this.mdown=!0,this.irect=this.getBoundingRect(),this.setCapture(t.pointerId)}mousemove(t){if(this.mdown){let o=this.irect,n=S(t.clientX-o.left,0,o.width)/o.width,l=S(t.clientY-o.top,0,o.height)/o.height;this.hsv.saturation=n,this.hsv.value=1-l,this.updateThumbMarker(),this.fire("sat_change",{saturation:this.hsv.saturation,value:this.hsv.value})}}mouseup(t){this.mdown&&(this.releaseCapture(t.pointerId),this.mdown=!1)}updateThumbMarker(){let t=this.color.getBoundingRect();this.thumb.setStyle({left:this.hsv.saturation*t.width+"px",bottom:this.hsv.value*t.height+"px"})}updateBaseColor(t){let o=new L(0,0,0);o.setHsv(t.hue,1,1,1),this.color.setStyleValue("backgroundColor",o.toRgbString(!1))}move(t,o){switch(t){case"saturation":{this.hsv.saturation+=o,this.hsv.saturation<0?this.hsv.saturation=0:this.hsv.saturation>1&&(this.hsv.saturation=1),this.fire("sat_change",{saturation:this.hsv.saturation,value:this.hsv.value}),this.updateThumbMarker();break}case"value":{this.hsv.value+=o,this.hsv.value<0?this.hsv.value=0:this.hsv.value>1&&(this.hsv.value=1),this.fire("sat_change",{saturation:this.hsv.saturation,value:this.hsv.value}),this.updateThumbMarker();break}}}};i(X,"Saturation"),X=h([p("x4")],X);var be=class extends E{constructor(t,o){super(t);this.hsv={hue:1,saturation:1,value:1,alpha:1};this.mdown=!1;this.setContent([this.thumb=new c({cls:"thumb",left:"50%"})]),this.setDOMEvents({pointerdown:i(r=>this.mousedown(r),"pointerdown"),pointermove:i(r=>this.mousemove(r),"pointermove"),pointerup:i(r=>this.mouseup(r),"pointerup")}),this.updateHue(o)}mousedown(t){this.mdown=!0,this.irect=this.getBoundingRect(),this.setCapture(t.pointerId)}mousemove(t){if(this.mdown){let o=this.irect,n=S(t.clientX-o.left,0,o.width)/o.width;this.hsv.hue=n,this.updateHue(this.hsv),this.fire("hue_change",{hue:this.hsv.hue})}}mouseup(t){this.mdown&&(this.releaseCapture(t.pointerId),this.mdown=!1)}updateHue(t){this.hsv.hue=t.hue,this.thumb.setStyleValue("left",t.hue*100+"%")}move(t){this.hsv.hue+=t,this.hsv.hue<0?this.hsv.hue=0:this.hsv.hue>1&&(this.hsv.hue=1),this.fire("hue_change",{hue:this.hsv.hue}),this.updateHue(this.hsv)}};i(be,"HueSlider"),be=h([p("x4")],be);var ge=class extends E{constructor(t,o){super(t);this.hsv={hue:1,saturation:1,value:1,alpha:1};this.mdown=!1;this.setContent([new c({cls:"overlay checkers"}),this.color=new c({cls:"overlay color"}),this.thumb=new c({cls:"thumb",left:"50%"})]),this.setDOMEvents({pointerdown:i(r=>this._on_mousedown(r),"pointerdown"),pointermove:i(r=>this._on_mousemove(r),"pointermove"),pointerup:i(r=>this._on_mouseup(r),"pointerup")}),this.updateAlpha(),this.updateBaseColor(o)}_on_mousedown(t){this.mdown=!0,this.irect=this.getBoundingRect(),this.setCapture(t.pointerId)}_on_mousemove(t){if(this.mdown){let o=this.irect,n=S(t.clientX-o.left,0,o.width)/o.width;this.hsv.alpha=n,this.updateAlpha(),this.fire("alpha_change",{alpha:this.hsv.alpha})}}_on_mouseup(t){this.mdown&&(this.releaseCapture(t.pointerId),this.mdown=!1)}updateAlpha(){this.thumb.setStyleValue("left",this.hsv.alpha*100+"%")}updateBaseColor(t){let o=new L(0,0,0);o.setHsv(t.hue,t.saturation,t.value,1),this.color.setStyleValue("backgroundImage",`linear-gradient(90deg, transparent, ${o.toRgbString(!1)})`)}setColor(t){this.hsv=t,this.updateBaseColor(t),this.updateAlpha()}move(t){this.hsv.alpha+=t,this.hsv.alpha<0?this.hsv.alpha=0:this.hsv.alpha>1&&(this.hsv.alpha=1),this.fire("alpha_change",{alpha:this.hsv.alpha}),this.updateAlpha()}};i(ge,"AlphaSlider"),ge=h([p("x4")],ge);var fe=class extends _{constructor(e){super(e),e.color instanceof L?this._base=e.color:this._base=new L(e.color);let t=this._base.toHsv();this.setAttribute("tabindex",0),this.setContent([this._sat=new X({},t),new u({cls:"body",content:[new _({cls:"x4flex",content:[this._hue=new be({},t),this._alpha=new ge({},t)]}),new E({cls:"swatch",content:[new c({cls:"overlay checkers"}),this._swatch=new c({cls:"overlay"})]})]})]),this._sat.on("sat_change",r=>{t.saturation=r.saturation,t.value=r.value,o(),this._alpha.updateBaseColor(t)}),this._hue.on("hue_change",r=>{t.hue=r.hue,this._sat.updateBaseColor(t),this._alpha.updateBaseColor(t),o()}),this._alpha.on("alpha_change",r=>{t.alpha=r.alpha,o()});let o=i(()=>{this._base.setHsv(t.hue,t.saturation,t.value,t.alpha),this._swatch.setStyleValue("backgroundColor",this._base.toRgbString()),this._swatch.setAttribute("tooltip",this._base.toRgbString()),this.fire("change",{color:this._base})},"updateColor");We("eyedropper")&&this._swatch.addDOMEvent("click",r=>{new window.EyeDropper().open().then(a=>{t=new L(a.sRGBHex).toHsv(),this._alpha.setColor(t),this._sat.updateBaseColor(t),this._hue.updateHue(t),o()})}),this.addDOMEvent("keydown",r=>this._onkey(r)),o()}_onkey(e){switch(e.key){case"ArrowLeft":{e.ctrlKey?this._hue.move(-.01):this._sat.move("saturation",-.01);break}case"ArrowRight":{e.ctrlKey?this._hue.move(.01):this._sat.move("saturation",.01);break}case"ArrowUp":{e.ctrlKey?this._alpha.move(.01):this._sat.move("value",.01);break}case"ArrowDown":{e.ctrlKey?this._alpha.move(-.01):this._sat.move("value",-.01);break}}}};i(fe,"ColorPicker"),fe=h([p("x4")],fe);var J=class extends c{constructor(e){super(e)}};i(J,"Viewport"),J=h([p("x4")],J);var q=class extends c{constructor(e){super(e),this.setContent(new J({}))}getViewport(){return this.firstChild()}};i(q,"ScrollView"),q=h([p("x4")],q);var Xt=(r=>(r[r.first=0]="first",r[r.prev=1]="prev",r[r.next=2]="next",r[r.last=3]="last",r))(Xt||{}),G=class extends c{constructor(t){super({...t});this.preventFocus=!1;this.setAttribute("tabindex",0);let o=new q({cls:"body"});this._view=o.getViewport(),this.setContent([o]),this.setDOMEvents({click:i(r=>this._on_click(r),"click"),keydown:i(r=>this._on_key(r),"keydown"),dblclick:i(r=>this._on_click(r),"dblclick"),contextmenu:i(r=>this._on_ctx_menu(r),"contextmenu")}),t.items&&this.setItems(t.items)}_on_key(t){if(!this.isDisabled()){switch(t.key){case"ArrowDown":{this.navigate(2);break}case"ArrowUp":{this.navigate(1);break}case"Home":{this.navigate(0);break}case"End":{this.navigate(3);break}default:return}t.preventDefault(),t.stopPropagation()}}navigate(t){this._selitem||(t==2?t=0:t=3);let o=i((r,n)=>{for(;r&&!r.isVisible();)r=n?r.nextElement():r.prevElement();return r},"next_visible");if(t==0||t==3){let r=t==0?this._view.firstChild():this._view.lastChild();if(r=o(r,t==0),r){let n=r.getData("id");return this._selectItem(n,r),!0}}else{let r=t==2?this._selitem.nextElement():this._selitem.prevElement();if(r=o(r,t==2),r){let n=r.getData("id");return this._selectItem(n,r),!0}}return!1}_on_click(t){t.stopImmediatePropagation(),t.preventDefault();let o=t.target;for(;o&&o!=this.dom;){let r=y(o);if(r&&r.hasClass("x4item")){let n=r.getData("id"),a={context:n};t.type=="click"?this.fire("click",a):this.fire("dblClick",a),a.defaultPrevented||this._selectItem(n,r);return}o=o.parentElement}this.clearSelection()}_on_ctx_menu(t){t.preventDefault();let o=t.target;for(;o&&o!=this.dom;){let r=y(o);if(r&&r.hasClass("x4item")){let n=r.getData("id");this._selectItem(n,r),this.fire("contextMenu",{uievent:t,context:n});return}o=o.parentElement}this.fire("contextMenu",{uievent:t,context:null})}_selectItem(t,o){this._selitem&&(this._selitem.removeClass("selected"),this._selitem=void 0),this._selitem=o,this._selection=t,o&&(o.addClass("selected"),o.scrollIntoView({behavior:"smooth",block:"nearest"}));let r=this._findItem(t);this.fire("selectionChange",{selection:r})}_findItem(t){return this._items.find(o=>o.id==t)}_findItemIndex(t){return this._items.findIndex(o=>o.id==t)}clearSelection(){this._selitem&&(this._selitem.removeClass("selected"),this._selitem=void 0),this._selection=void 0,this.fire("selectionChange",{selection:void 0})}setItems(t){if(this.clearSelection(),this._view.clearContent(),this._items=t,t){let o=t.map(r=>this.renderItem(r));this._view.setContent(o)}}renderItem(t){var n;let r=((n=this.props.renderer)!=null?n:this.defaultRenderer)(t);return r.addClass("x4item"),r.setData("id",t.id+""),r}defaultRenderer(t){return new u({cls:t.cls,content:new x({icon:t.iconId,text:t.text})})}filter(t){let o=this._view.enumChildComponents(!1);if(!t)o.forEach(r=>r.show(!0));else{let r=this._items.filter(n=>n.text.includes(t)).map(n=>n.id+"");o.forEach(n=>{n.show(r.includes(n.getData("id")))})}}appendItem(t,o=!1,r=!0){r&&this.clearSelection();let n=this.renderItem(t);o?(this._items.unshift(t),this._view.prependContent(n)):(this._items.push(t),this._view.appendContent(n)),r&&this._selectItem(t.id,n)}updateItem(t,o){var l;let r=this._findItemIndex(t);if(r<0)return;let n=!1;this._selection&&this._selection===t&&(n=!0),this._items[r]=o;let a=(l=this.query(`[data-id="${o.id}"]`))==null?void 0:l.dom;if(a){let d=this.renderItem(o);this._view.dom.replaceChild(d.dom,a),n&&this._selectItem(o.id,d)}}};i(G,"Listbox"),G=h([p("x4")],G);var yo='data:image/svg+xml,<svg viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg">%0D%0A%09<path d="M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd">%0D%0A%09</path>%0D%0A</svg>';var ve=class extends I{constructor(e,t){super(e),this._list=new G({items:e.items}),this.setContent(this._list),this.addDOMEvent("mousedown",o=>{console.log("trap"),o.stopImmediatePropagation(),o.stopPropagation(),o.preventDefault()},!0),this._list.on("selectionChange",o=>{this.fire("selectionChange",o)})}getList(){return this._list}};i(ve,"Dropdown"),ve=h([p("x4")],ve);var _e=class extends c{constructor(t){super(t);this._prevent_close=!1;let o=R();this.setContent([new u({id:"label",content:new x({tag:"label",text:t.label,labelFor:o,width:t.labelWidth})}),this._edit=new u({id:"edit",content:[this._input=new k({type:"text",value:"",readonly:t.readonly}),this._button=new v({icon:yo})]})]),this._dropdown=new ve({items:t.items}),this._dropdown.on("selectionChange",r=>{let n=r.selection;this._input.setValue(n?n.text:""),this._prevent_close||this._dropdown.show(!1)}),this._button.addDOMEvent("click",()=>this._on_click()),this._input.addDOMEvent("input",()=>this._on_input()),this._input.addDOMEvent("keydown",r=>this._on_key(r)),this.setDOMEvents({focusout:i(()=>this._on_focusout(),"focusout"),click:i(()=>this._on_click(),"click")})}_on_key(t){switch(t.key){case"Enter":case"Escape":{this._dropdown.show(!1);break}case"ArrowUp":this._prevent_close=!0,this._dropdown.isOpen()?this._dropdown.getList().navigate(1):this.showDropDown(),this._prevent_close=!1;break;case"ArrowDown":this._prevent_close=!0,this._dropdown.isOpen()?this._dropdown.getList().navigate(2):this.showDropDown(),this._prevent_close=!1;break;default:return}t.preventDefault(),t.stopPropagation()}_on_input(){this._dropdown.isOpen()||this.showDropDown(),this._dropdown.getList().filter(this._input.getValue())}_on_focusout(){this._dropdown.show(!1)}_on_click(){this.showDropDown()}showDropDown(){if(this.isDisabled())return;let t=this._edit.getBoundingRect();this._dropdown.setStyleValue("width",t.width+"px"),this._dropdown.displayNear(t,"top left","bottom left",{x:0,y:6})}};i(_e,"Combobox"),_e=h([p("x4")],_e);var Eo='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512" fill="currentColor"><!--!Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M192 233.4L59.5 100.9 36.9 123.5 169.4 256 36.9 388.5l22.6 22.6L192 278.6 324.5 411.1l22.6-22.6L214.6 256 347.1 123.5l-22.6-22.6L192 233.4z"/></svg>';var Q=class extends I{constructor(e){super(e),this.appendContent([new u({cls:"caption",content:[new x({id:"title",cls:"caption-element",icon:e.icon,text:e.title}),e.closable?new v({id:"closebox",icon:Eo,click:i(()=>{this.close()},"click")}):null]}),e.form,new K({id:"btnbar",reverse:!0,items:e.buttons,btnclick:i(t=>{this.fire("btnclick",t)},"btnclick")})])}display(){super.displayCenter()}close(){this.fire("close",{}),super.close()}};i(Q,"Dialog"),Q=h([p("x4")],Q);var W=class extends E{setValues(e){let t=this.queryAll("input[name]");console.log(t)}getValues(){return{}}};i(W,"Form"),W=h([p("x4")],W);var we=class extends u{constructor(e){var t;super(e),this._els=(t=e.items)==null?void 0:t.map(o=>{let r=new x({cls:"cell",text:o.title,icon:o.iconId}),n=new C("right");return o.width>0?(r.setStyleValue("width",o.width+"px"),r.setInternalData("width",o.width)):o.width<0?r.setInternalData("flex",-o.width):r.setInternalData("width",0),n.addDOMEvent("dblclick",a=>{r.setInternalData("flex",1),this._calc_sizes()}),n.on("resize",a=>{r.setInternalData("flex",0),r.setInternalData("width",a.size),this._calc_sizes()}),r.appendContent(n),r.setInternalData("data",o),r}),this.addDOMEvent("resized",()=>this._on_resize()),this.addDOMEvent("created",()=>this._calc_sizes()),this._vwp=new u({content:this._els}),this.setContent(this._vwp)}_calc_sizes(){let e=0,t=0;this._els.forEach(l=>{let d=l.getInternalData("flex");if(d)e+=d;else{let m=l.getInternalData("width");if(m==0){let g=l.getBoundingRect();m=Math.ceil(g.width)+2,l.setInternalData("width",m)}t+=m}});let r=this.getBoundingRect().width-t,n=Math.ceil(r/e);console.log("filled",t),console.log("count",e),console.log("rest",r),console.log("unit",n);let a=0;this._els.forEach(l=>{let d=0,m=l.getInternalData("flex");m?(d=Math.min(n*m,r),r-=d):d=l.getInternalData("width"),l.setWidth(d),a+=d}),this._vwp.setWidth(a)}_on_resize(){this._calc_sizes()}};i(we,"Header"),we=h([p("x4")],we);var ye=class extends c{constructor(e){var t;super(e),this._img=new c({tag:"img",attrs:{loading:e.lazy,alt:e.alt,draggable:(t=e.draggable)!=null?t:!1},style:{width:"100%",height:"100%",objectFit:e.fit,objectPosition:e.position}}),this.setContent(this._img),this.setImage(e.src)}setImage(e){this._img.setAttribute("src",e)}};i(ye,"Image"),ye=h([p("x4")],ye);var Ee=class extends c{constructor(e){super({tag:"a",...e}),this.setAttribute("href",e.href),this.mapPropEvents(e,"click"),e.text&&this.setContent(e.text),this.addDOMEvent("click",t=>this._on_click(t))}setText(e){this.setContent(e)}_on_click(e){let t={context:this.props.href};this.fire("click",t),t.preventDefault&&(e.preventDefault(),e.stopPropagation())}};i(Ee,"Link"),Ee=h([p("x4")],Ee);var ko='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"><!--!Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24l0 112c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-112c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"/></svg>';var ee=class extends Q{constructor(e){super(e)}setText(e){this.m_label.setText(e)}static show(e){let t=new ee({modal:!0,title:b.global.error,movable:!0,form:new W({content:[new u({content:[new f({iconId:ko}),new x({text:e})]})]}),buttons:["ok.outline","cancel.outline"]});return t.on("btnclick",o=>{_t(()=>t.close())}),t.display(),t}};i(ee,"MessageBox"),ee=h([p("x4")],ee);var Co='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"><!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"/></svg>';var Ao='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"><!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24V264c0 13.3-10.7 24-24 24s-24-10.7-24-24V152c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"/></svg>';var Io='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"><!--!Font Awesome Pro 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M207.4 20.4c2.4 8.5-2.6 17.3-11.2 19.7C101.5 66.2 32 153 32 256c0 123.7 100.3 224 224 224s224-100.3 224-224c0-103-69.5-189.8-164.3-215.9c-8.5-2.4-13.5-11.2-11.2-19.7s11.2-13.5 19.7-11.2C432.5 39.1 512 138.2 512 256c0 141.4-114.6 256-256 256S0 397.4 0 256C0 138.2 79.5 39.1 187.7 9.2c8.5-2.4 17.3 2.6 19.7 11.2z"/></svg>';var Mo='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512" fill="currentColor"><!--!Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M192 233.4L59.5 100.9 36.9 123.5 169.4 256 36.9 388.5l22.6 22.6L192 278.6 324.5 411.1l22.6-22.6L214.6 256 347.1 123.5l-22.6-22.6L192 233.4z"/></svg>';var ke=class extends I{constructor(e){super({});let t=e.iconId;t||(e.loading?(t=Io,this.addClass("")):e.mode=="danger"?t=Ao:t=Co),this.addClass(e.mode);let o=new f({iconId:t});e.loading&&(o.addClass("rotate"),this.props.modal=!0),this.setContent(new u({content:[o,new _({cls:"body",content:[new x({cls:"title",text:e.title}),new x({cls:"text",text:e.text})]}),new v({cls:"outline",icon:Mo,click:i(()=>{this.close()},"click")})]}))}close(){this.clearTimeout("close"),super.close()}display(e=0){let t=new N(0,0,window.innerWidth,window.innerHeight);this.displayNear(t,"bottom right","bottom right",{x:-20,y:-10}),e&&this.setTimeout("close",e*1e3,()=>{this.close()})}};i(ke,"Notification"),ke=h([p("x4")],ke);var Ce=class extends _{constructor(e){var o;super({...e,content:void 0});let t=(o=e.bodyModel)!=null?o:_;super.setContent([this._title=new x({tag:"legend",text:e.title,icon:e.icon}),this._body=new t({cls:"body",content:e.content})])}setContent(e){this._body.setContent(e)}setTitle(e){this._title.setContent(e)}};i(Ce,"Panel"),Ce=h([p("x4")],Ce);var Ae=class extends c{constructor(e){super(e),this.setContent(this._bar=new c({cls:"bar"})),this.setValue(e.value)}setValue(e){let t=e/(this.props.max-this.props.min)*100;this._bar.setStyleValue("width",t+"%")}};i(Ae,"Progress"),Ae=h([p("x4")],Ae);var Po='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512" fill="currentColor"><!--!Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M288.1 0l86.5 164 182.7 31.6L428 328.5 454.4 512 288.1 430.2 121.7 512l26.4-183.5L18.9 195.6 201.5 164 288.1 0z"/></svg>';var Ie=class extends u{constructor(e){var t;super(e),e.steps=(t=e.steps)!=null?t:5,this._update()}_update(){var r,n;let e=this.props,t=(r=e.icon)!=null?r:Po,o=(n=e.value)!=null?n:0;this.m_input=new k({type:"text",hidden:!0,name:e.name,value:""+o}),this.addDOMEvent("click",a=>this._on_click(a)),this.m_els=[];for(let a=0;a<e.steps;a++){let l="item";a+1<=o&&(l+=" checked");let d=new f({cls:l,iconId:t});d.setInternalData("value",a),this.m_els.push(d)}this.m_els.push(this.m_input),this.setContent(this.m_els)}getValue(){var e;return(e=this.props.value)!=null?e:0}setValue(e){this.props.value=e;for(let t=0;t<this.props.steps;t++)this.m_els[t].setClass("checked",this.m_els[t].getInternalData("value")<=e);this.m_input.setValue(""+this.props.value)}setSteps(e){this.props.steps=e,this._update()}setShape(e){this.removeClass(this.props.icon),this.props.icon=e}_on_click(e){let t=y(e.target);t=t.parentElement(f),t&&this.setValue(t.getInternalData("value")),this.fire("change",{value:this.props.value})}};i(Ie,"Rating"),Ie=h([p("x4")],Ie);var Me=class extends c{constructor(t){super(t);this._mdown=!1;this._irect=null;this._thumb=null;this._bar=null;this._range=null;this.setContent([new u({cls:"track",content:[this._bar=new c({cls:"bar"}),this._thumb=new c({cls:"thumb"})]}),this._range=new k({type:"range",hidden:!0,value:t.value,min:t.min,max:t.max,step:t.step})]),this.setAttribute("tabindex",0),this.setDOMEvents({pointerdown:i(o=>this._on_mousedown(o),"pointerdown"),pointermove:i(o=>this._on_mousemove(o),"pointermove"),pointerup:i(o=>this._on_mouseup(o),"pointerup"),keydown:i(o=>this._on_key(o),"keydown")}),this._range.addDOMEvent("change",o=>{})}_on_mousedown(t){t.stopPropagation(),t.preventDefault(),this.focus(),this._mdown=!0,this._irect=this.getBoundingRect(),this.setCapture(t.pointerId)}_on_mousemove(t){if(this._mdown){let o=t.pageX-this._irect.left;o<0?o=0:o>this._irect.width&&(o=this._irect.width);let r=o/this._irect.width*100;this._range.setNumValue(r),this._update()}}_update(){let t=this._range.getNumValue(),o=t/(this.props.max-this.props.min)*100;this._thumb.setStyleValue("left",o+"%"),this._bar.setStyleValue("width",o+"%"),this.fire("change",{value:t})}_on_mouseup(t){this._mdown&&(this.releaseCapture(t.pointerId),this._mdown=!1)}_on_key(t){var n;console.log(t.key);let o=(n=this.props.step)!=null?n:1,r=0;switch(t.key){case"ArrowRight":case"ArrowUp":r=o;break;case"ArrowLeft":case"ArrowDown":r=-o;break}r&&(t.ctrlKey&&(r*=10),this._range.setNumValue(this._range.getNumValue()+r),this._update())}};i(Me,"Slider"),Me=h([p("x4")],Me);var Pe=class extends u{constructor(e){super(e);let t=R();this.setContent([new c({cls:"switch",content:[new k({type:"checkbox",id:t,checked:e.checked}),new c({cls:"track"}),new c({cls:"thumb"})]}),new x({tag:"label",text:e.label,labelFor:t})])}};i(Pe,"Switch"),Pe=h([p("x4")],Pe);var De=class extends v{constructor(e,t){super(e),this.addClass("outline"),this.setIcon(t.icon),this.setText(t.title),this.setData("tabname",t.name)}};i(De,"CTab"),De=h([p("x4")],De);var Te=class extends u{constructor(e,t){super(e);let o=t.map(r=>new De({click:i(n=>this._on_click(n),"click")},r));this.mapPropEvents(e,"click"),this.setContent(o)}_on_click(e){let t=e.source.getData("tabname");this.fire("click",{name:t})}select(e){let t=this.query(`[data-tabname="${e}"]`);this._selitem&&this._selitem.setClass("selected",!1),this._selitem=t,this._selection=e,this._selitem&&this._selitem.setClass("selected",!0)}};i(Te,"CTabList"),Te=h([p("x4")],Te);var Le=class extends _{constructor(e){var o;super(e);let t=(o=e.items)==null?void 0:o.map(r=>({name:r.name,content:r.tab}));this.setContent([this._list=new Te({click:i(r=>this._onclick(r),"click")},e.items),this._stack=new V({cls:"body x4flex",default:e.default,items:t})]),e.default&&this.selectTab(e.default)}selectTab(e){this._list.select(e),this._stack.select(e)}_onclick(e){this.selectTab(e.name)}};i(Le,"Tabs"),Le=h([p("x4")],Le);var Se=class extends _{constructor(e){super(e),this.setContent([new x({text:e.label}),this._input=new c({tag:"textarea"})]),this._input.setAttribute("name",e.name),this._input.setAttribute("value",e.value+""),e.resize||this._input.setAttribute("resize",!1)}};i(Se,"TextArea"),Se=h([p("x4")],Se);var Re=class extends u{constructor(e){var o,r;super(e),e.inputId||(e.inputId=R()),e.required&&this.setAttribute("required",!0);let t=(o=e.inputGadgets)!=null?o:[];this.setContent([new u({id:"label",width:e.labelWidth,content:[new x({tag:"label",text:e.label,labelFor:e.inputId})]}),new u({id:"edit",content:[new k({type:(r=e.type)!=null?r:"text",readonly:e.readonly,value:e.value,id:e.inputId,required:e.required,disabled:e.disabled,placeholder:e.placeholder}),...t]})])}};i(Re,"TextEdit"),Re=h([p("x4")],Re);var Do='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"> <!--!Font Awesome Pro 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M256 32a224 224 0 1 1 0 448 224 224 0 1 1 0-448zm0 480A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM192 352v32h16 96 16V352H304 272V240 224H256 216 200v32h16 24v96H208 192zm88-168V136H232v48h48z"/></svg>';var xt=null,tt=null,To=new ie;function Sr(){document.addEventListener("mouseenter",s=>{if(s.target===document)return;let e=Lt(s.target),t=e.getAttribute("tooltip");if(t){xt=s.target;let o=e.getBoundingRect();Rr(t,o,{x:s.pageX,y:s.pageY})}},!0),document.addEventListener("mouseleave",s=>{xt&&s.target==xt&&(xt=null,Or())},!0)}i(Sr,"initTooltips");function Rr(s,e,t){tt||(tt=new Oe({})),To.setTimeout(null,300,()=>{tt.setText(Qe(s)),tt.displayAt(t.x,t.y)})}i(Rr,"showTT");function Or(){tt.show(!1),To.clearTimeout(null)}i(Or,"closeTT");var Oe=class extends I{constructor(e){super(e),this.setContent(new u({content:[new f({iconId:Do}),new c({id:"text"})]}))}setText(e){this.query("#text").setContent(e)}};i(Oe,"Tooltip"),Oe=h([p("x4")],Oe);var Lo='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"><!--!Font Awesome Pro 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M267.3 395.3c-6.2 6.2-16.4 6.2-22.6 0l-192-192c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L256 361.4 436.7 180.7c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6l-192 192z"/></svg>';var So=(m=>(m[m.first=0]="first",m[m.prev=1]="prev",m[m.next=2]="next",m[m.last=3]="last",m[m.parent=4]="parent",m[m.child=5]="child",m[m.expand=6]="expand",m[m.collapse=7]="collapse",m[m.toggle=8]="toggle",m))(So||{}),te=class extends E{constructor(e,t){super({...e}),this._item=t,t?(this._label=new u({cls:"label item",content:[this._icon=new f({iconId:t.children?Lo:t.iconId}),new x({tag:"span",cls:"",text:t.text})]}),this._label.setData("id",t.id+""),t.children&&(this._childs=new _({cls:"body"}),t.open===void 0&&(t.open=!1),this.addClass("folder"),this.setClass("open",t.open),this.setItems(t.children),this._icon.addDOMEvent("click",o=>this.toggle(o)))):this._childs=new _({cls:"body"}),this.setContent([this._label,this._childs])}toggle(e){let t=this.hasClass("open");this.open(!t),e&&e.stopPropagation()}open(e=!0){this.setClass("open",e),this._item.open=e}setItems(e){if(e){let t=e.map(o=>new te({},o));this._childs.setContent(t)}else this._childs.clearContent()}};i(te,"CTreeViewItem"),te=h([p("x4")],te);var Be=class extends c{constructor(e){super(e),e.items&&this.setItems(e.items),this.setAttribute("tabindex",0),this.setDOMEvents({click:i(t=>this._onclick(t),"click"),keydown:i(t=>this._onkey(t),"keydown")})}setItems(e){this._items=e;let t=new te({cls:"root"},null);t.setItems(e),this.setContent(t)}_onclick(e){let t=e.target;for(;t&&t!=this.dom;){let o=y(t);if(o&&o.hasClass("item")){let r=o.getData("id");this._selectItem(r,o);return}t=t.parentElement}this.clearSelection()}_onkey(e){switch(e.key){case"ArrowDown":{this.navigate(2);break}case"ArrowUp":{this.navigate(1);break}case"Home":{this.navigate(0);break}case"End":{this.navigate(3);break}case"ArrowRight":{this.navigate(5);break}case"+":{this.navigate(6);break}case"ArrowLeft":{this.navigate(4);break}case"-":{this.navigate(7);break}case" ":{this.navigate(8);break}default:console.log(e.key);return}e.preventDefault(),e.stopPropagation()}navigate(e){var r;if(!this._items||this._items.length==0)return;if(!this._selitem)if(e==2||e==4)e=0;else if(e==1)e=3;else return;let t=(r=this._selitem)==null?void 0:r.parentElement(),o=t==null?void 0:t.hasClass("folder");if(t&&e==4&&o&&t.hasClass("open")?e=7:e==5&&(o?t.hasClass("open")?e=2:e=6:e=2),e==6||e==7||e==8){if(o)return e==8?(t.toggle(),!0):(t.open(e==6),!0)}else{let n=this._flattenOpenItems(),a=n.findIndex(d=>this._selection==d.id),l;if(e==0)l=n[0].id;else if(e==3)l=n[n.length-1].id;else if(a>=0){if(e==1)a>0&&(l=n[a-1].id);else if(e==2)a<n.length-1&&(l=n[a+1].id);else if(e==4){let d=n[a].level;for(;a>0;)if(a--,n[a].level<d){l=n[a].id;break}}}if(l){let d=this.query(`[data-id="${l}"]`);return this._selectItem(l,d),!0}}return!1}_flattenOpenItems(){let e=[],t=i((o,r)=>{e.push({id:o.id+"",level:r}),o.children&&o.open&&o.children.forEach(n=>t(n,r+1))},"build");return this._items.forEach(o=>t(o,0)),e}_flattenItems(){let e=[],t=i(o=>{e.push(o),o.children&&o.children.forEach(r=>t(r))},"build");return this._items.forEach(o=>t(o)),e}_selectItem(e,t){this._selitem&&(this._selitem.removeClass("selected"),this._selitem=void 0),this._selitem=t,this._selection=e,t&&(t.addClass("selected"),t.scrollIntoView({behavior:"smooth",block:"nearest"}));let o=this._findItem(e);this.fire("change",{selection:o})}_findItem(e){return this._flattenItems().find(o=>o.id==e)}clearSelection(){this._selitem&&(this._selitem.removeClass("selected"),this._selitem=void 0),this._selection=void 0,this.fire("change",{selection:void 0})}};i(Be,"Treeview"),Be=h([p("x4")],Be);
|