x4js 2.0.17 → 2.0.18

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/lib/cjs/x4.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var ut=Object.defineProperty;var vr=Object.getOwnPropertyDescriptor;var ln=Object.getOwnPropertyNames;var cn=Object.prototype.hasOwnProperty;var _r=a=>{throw TypeError(a)};var dn=(a,e,t)=>e in a?ut(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var s=(a,e)=>ut(a,"name",{value:e,configurable:!0});var hn=(a,e)=>{for(var t in e)ut(a,t,{get:e[t],enumerable:!0})},pn=(a,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of ln(e))!cn.call(a,r)&&r!==t&&ut(a,r,{get:()=>e[r],enumerable:!(o=vr(e,r))||o.enumerable});return a};var un=a=>pn(ut({},"__esModule",{value:!0}),a),u=(a,e,t,o)=>{for(var r=o>1?void 0:o?vr(e,t):e,n=a.length-1,i;n>=0;n--)(i=a[n])&&(r=(o?i(e,t,r):i(r))||r);return o&&r&&ut(e,t,r),r};var O=(a,e,t)=>dn(a,typeof e!="symbol"?e+"":e,t),wr=(a,e,t)=>e.has(a)||_r("Cannot "+t);var P=(a,e,t)=>(wr(a,e,"read from private field"),t?t.call(a):e.get(a)),ae=(a,e,t)=>e.has(a)?_r("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(a):e.set(a,t),le=(a,e,t,o)=>(wr(a,e,"write to private field"),o?o.call(a,t):e.set(a,t),t);var yi={};hn(yi,{Application:()=>Rt,AssistBox:()=>Re,Box:()=>C,Breadcrumbs:()=>ze,BtnGroup:()=>he,Button:()=>I,CMover:()=>Ht,CSizer:()=>F,Calendar:()=>Ve,Canvas:()=>He,Checkbox:()=>Ne,Color:()=>N,ColorInput:()=>_e,ColorPicker:()=>Ke,Combobox:()=>Ge,Component:()=>d,ComputedStyle:()=>ko,CoreElement:()=>re,DataModel:()=>Jt,DataProxy:()=>eo,DataRecord:()=>Ft,DataStore:()=>Bo,DataView:()=>xt,Dialog:()=>X,DropdownList:()=>ye,EventSource:()=>de,FileDialog:()=>Et,FileDrop:()=>We,Flex:()=>ne,Form:()=>K,GridBox:()=>Fe,Gridview:()=>je,HBox:()=>b,Header:()=>Ye,Icon:()=>E,Image:()=>ue,Input:()=>A,InputBox:()=>Ce,Keyboard:()=>Qe,Label:()=>_,Link:()=>$e,Listbox:()=>pe,MasonryBox:()=>Be,Menu:()=>W,MessageBox:()=>ke,Notification:()=>Ze,Panel:()=>Xe,Popup:()=>z,Progress:()=>Je,PromptBox:()=>Ee,PropertyGrid:()=>et,Radio:()=>tt,Rating:()=>ot,Rect:()=>Me,Router:()=>Yo,Saturation:()=>we,ScrollView:()=>Z,Select:()=>me,SimpleText:()=>H,Slider:()=>rt,Space:()=>St,StackBox:()=>ie,StateManager:()=>$o,Stylesheet:()=>yo,SvgBuilder:()=>zt,SvgComponent:()=>Ot,SvgGradient:()=>io,SvgGroup:()=>_t,SvgIcon:()=>no,SvgPath:()=>oo,SvgShape:()=>vt,SvgText:()=>ro,Switch:()=>nt,Tabs:()=>at,TextArea:()=>lt,TextEdit:()=>ct,TickLine:()=>pr,Timer:()=>De,Treeview:()=>ht,UnsafeHtml:()=>Ae,VBox:()=>k,Viewport:()=>se,_date_set_locale:()=>In,_tr:()=>y,addEvent:()=>Tt,addTranslation:()=>mo,asap:()=>te,beep:()=>Ln,calcAge:()=>Sn,camelCase:()=>Cn,centerRect:()=>wn,clamp:()=>G,class_ns:()=>p,componentFromDOM:()=>T,createLanguage:()=>po,data:()=>Fo,date_calc_weeknum:()=>go,date_clone:()=>Pe,date_diff:()=>Mn,date_format:()=>An,date_hash:()=>ge,date_sql_utc:()=>Pn,date_to_sql:()=>Dn,dispatchEvent:()=>Ar,dragManager:()=>Bt,formatIntlDate:()=>j,getAvailableLanguages:()=>xn,getCurrentLanguage:()=>gn,getFocusableElements:()=>Mt,getScrollbarSize:()=>Rn,initTooltips:()=>bi,isArray:()=>Y,isFeatureAvailable:()=>It,isFunction:()=>xo,isLanguage:()=>uo,isNumber:()=>V,isString:()=>M,isUnitLess:()=>Co,kbNav:()=>Dt,kbTreeNav:()=>nn,makeUniqueComponentId:()=>q,oneshot:()=>yn,pad:()=>ce,parseIntlDate:()=>Tn,parseRoute:()=>Tr,pascalCase:()=>kn,selectLanguage:()=>Er,setWaitCursor:()=>Yt,sprintf:()=>Wt,svgLoader:()=>wt,unbubbleEvents:()=>Ir,unitless:()=>Pt,unsafe:()=>_n,unsafeHtml:()=>ft,wrapDOM:()=>$t,x4_class_ns_sym:()=>At,x4_react:()=>Wo});module.exports=un(yi);var yr=Symbol("i18n"),mt={};function po(a,e){mt[a]={name:a,base:e,src_translations:{},translations:{}}}s(po,"createLanguage");function uo(a){return mt[a]!==void 0}s(uo,"isLanguage");function mo(a,...e){if(!uo(a))return;let t=mt[a];e.forEach(o=>{kr(t.src_translations,o)}),t.translations=Cr(t.src_translations,t.base,!0)}s(mo,"addTranslation");function kr(a,e){for(let t in e){let o=e[t];typeof o=="string"?a[t]=o:Array.isArray(o)&&(!a[t]||!Array.isArray(a[t]))?a[t]=[...o]:!a[t]||typeof a[t]!="object"?a[t]={...o}:kr(a[t],e[t])}}s(kr,"_patch");function Cr(a,e,t){let o={};for(let r in a)typeof a[r]!="string"&&!Array.isArray(a[r])?o[r]=Cr(a[r],e,!1):o[r]=a[r];return mn(o,e,t)}s(Cr,"_proxyfy");function mn(a,e,t){return new Proxy(a,{get:s((o,r)=>{t?Gt=[r]:Gt.push(r);let n=o[r];return n===void 0&&(e&&(n=fn(e)),n===void 0&&console.error("I18N error: unable to find","_tr."+Gt.join("."))),n},"get")})}s(mn,"_mk_proxy");var Gt;function fn(a){for(;a;){let e=mt[a],t=e.translations,o;for(let r of Gt){if(o=t[r],o===void 0)break;t=o}if(o!==void 0)return t;a=e.base}}s(fn,"_findBaseTrans");var y={};function Er(a){if(uo(a))return y=mt[a].translations,y[yr]=a,y}s(Er,"selectLanguage");function gn(){return y[yr]}s(gn,"getCurrentLanguage");function xn(){return Object.keys(mt)}s(xn,"getAvailableLanguages");var bn={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",filedrop:"Déposez un fichier",keyboard:{next:"Suivant",numeric:"123",alpha:"Abc"}}},vn={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",filedrop:"Drop a file",keyboard:{next:"Next",numeric:"123",alpha:"Abc"}}};po("fr",null);mo("fr",bn);po("en","fr");mo("en",vn);Er("fr");function M(a){return typeof a=="string"}s(M,"isString");function V(a){return typeof a=="number"&&isFinite(a)}s(V,"isNumber");function Y(a){return a instanceof Array}s(Y,"isArray");function xo(a){return a instanceof Function}s(xo,"isFunction");var bo=class bo extends String{constructor(e){super(e)}};s(bo,"UnsafeHtml");var Ae=bo;function ft(a){return new Ae(a)}s(ft,"unsafeHtml");function _n(a,...e){let t=a.reduce((o,r,n)=>o+r+(e[n]||""),"");return ft(t)}s(_n,"unsafe");function G(a,e,t){return a<e?e:a>t?t:a}s(G,"clamp");var jt=class jt{left;top;height;width;constructor(e,t,o,r){e!==void 0&&(V(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}contains(e){return e instanceof jt?e.left>=this.left&&e.right<=this.right&&e.top>=this.top&&e.bottom<=this.bottom:e.x>=this.left&&e.x<this.right&&e.y>=this.top&&e.y<this.bottom}touches(e){return!(this.left>e.right||this.right<e.left||this.top>e.bottom||this.bottom<e.top)}normalize(){let e=this.width,t=this.height;return e<0&&(this.left+=e,this.width=-e),t<0&&(this.top+=t,this.height=-t),this}};s(jt,"Rect");var Me=jt;function wn(a,e,t=0){let o=e.width-2*t,r=e.height-2*t,n=a.width/a.height,i=o,l=o/n;l>r&&(l=r,i=r*n);let c=e.left+(e.width-i)/2,h=e.top+(e.height-l)/2;return{left:c,top:h,width:i,height:l}}s(wn,"centerRect");function It(a){switch(a){case"eyedropper":return"EyeDropper"in window}return!1}s(It,"isFeatureAvailable");var vo=class vo{_timers;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}};s(vo,"Timer");var De=vo;function te(a){return requestAnimationFrame(a)}s(te,"asap");function yn(a,e=0){return setTimeout(a,e)}s(yn,"oneshot");function ce(a,e,t="0"){let o;return M(a)?o=a:o=""+a,e>0?o.padEnd(e,t):o.padStart(-e,t)}s(ce,"pad");function Wt(a,...e){return a.replace(/{(\d+)}/g,function(t,o){return typeof e[o]<"u"?e[o]:t})}s(Wt,"sprintf");function kn(a){let e=a;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,"-"))}s(kn,"pascalCase");function Cn(a){let e=a.toLowerCase();return e=e.replace(/[^a-zA-Z0-9]+(.)/g,(t,o)=>o.toUpperCase()),e}s(Cn,"camelCase");var En="fr-FR";function In(a){En=a}s(In,"_date_set_locale");function An(a,e){return j(a)}s(An,"date_format");function Mn(a,e,t){let r=(a.getTime()-e.getTime())/1e3;if(r<60)return Wt(y.global.diff_date_seconds,Math.round(r));let n=Math.floor(r/60);if(n<60)return Wt(y.global.diff_date_minutes,Math.round(n));let i=Math.floor(n/60);return Wt(y.global.diff_date_hours,i,n%60)}s(Mn,"date_diff");function Dn(a,e){return e?j(a,"Y-M-D H:I:S"):j(a,"Y-M-D")}s(Dn,"date_to_sql");function Pn(a){return new Date(a+" GMT")}s(Pn,"date_sql_utc");function ge(a){return a.getFullYear()<<16|a.getMonth()<<8|a.getDate()}s(ge,"date_hash");function Pe(a){return new Date(a.getTime())}s(Pe,"date_clone");function go(a){let e=new Date(a.getFullYear(),0,1),t=(a.valueOf()-e.valueOf())/864e5;return Math.floor((t+e.getDay()+1)/7)}s(go,"date_calc_weeknum");function Tn(a,e=y.global.date_input_formats){var o,r,n,i,l,c;let t=e.split("|");for(let h of t){let g="";for(let x=0;x<h.length;x++){let v=h[x];v=="d"?g+="(?<day>\\d{1,2})":v=="D"?g+="(?<day>\\d{2})":v=="m"?g+="(?<month>\\d{1,2})":v=="M"?g+="(?<month>\\d{2})":v=="y"?g+="(?<year>\\d{1,4})":v=="Y"?h[x+1]=="Y"?(g+="(?<year>\\d{4})",x++):g+="(?<year>\\d{2})":v=="h"?g+="(?<hour>\\d{1,2})":v=="H"?g+="(?<hour>\\d{2})":v=="i"?g+="(?<min>\\d{1,2})":v=="I"?g+="(?<min>\\d{2})":v=="s"?g+="(?<sec>\\d{1,2})":v=="S"?g+="(?<sec>\\d{2})":v==" "?g+="\\s+":g+="\\s*\\"+v+"\\s*"}let m=new RegExp("^"+g+"$","m").exec(a);if(m){let x=new Date,v=parseInt((o=m.groups.day)!=null?o:"1"),U=parseInt((r=m.groups.month)!=null?r:"1"),w=parseInt((n=m.groups.year)!=null?n:x.getFullYear()+""),S=parseInt((i=m.groups.hour)!=null?i:"0"),J=parseInt((l=m.groups.min)!=null?l:"0"),B=parseInt((c=m.groups.sec)!=null?c:"0");w>0&&w<100&&(w+=2e3);let L=new Date(w,U-1,v,S,J,B,0),fe=L.getFullYear(),pt=L.getMonth()+1,R=L.getDate();return fe!=w||pt!=U||R!=v?null:L}}return null}s(Tn,"parseIntlDate");function j(a,e=y.global.date_format){if(!a)return"";let t={year:a.getFullYear(),month:a.getMonth()+1,day:a.getDate(),wday:a.getDay(),hours:a.getHours(),minutes:a.getMinutes(),seconds:a.getSeconds(),milli:a.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+=ce(t.day,-2):n=="j"?o+=y.global.day_short[t.wday]:n=="J"?o+=y.global.day_long[t.wday]:n=="w"?o+=go(a):n=="W"?o+=ce(go(a),-2):n=="m"?o+=t.month:n=="M"?o+=ce(t.month,-2):n=="o"?o+=y.global.month_short[t.month-1]:n=="O"?o+=y.global.month_long[t.month-1]:n=="y"||n=="Y"?o+=ce(t.year,-4):n=="a"||n=="A"?o+=t.hours<12?"am":"pm":n=="h"?o+=t.hours:n=="H"?o+=ce(t.hours,-2):n=="i"?o+=t.minutes:n=="I"?o+=ce(t.minutes,-2):n=="s"?o+=t.seconds:n=="S"?o+=ce(t.seconds,-2):n=="l"?o+=t.milli:n=="L"?o+=ce(t.milli,-3):o+=n}return o}s(j,"formatIntlDate");function Sn(a,e){if(e===void 0&&(e=new Date),!a)return 0;let t=e.getFullYear()-a.getFullYear();return(e.getMonth()<a.getMonth()||e.getMonth()==a.getMonth()&&e.getDate()<a.getDate())&&t--,t}s(Sn,"calcAge");function Ln(){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()}s(Ln,"beep");var fo=-1;function Rn(){if(fo<0){let a=document.createElement("div");a.style.cssText="overflow:auto;position:absolute;top:0;width:100px;height:100px";let e=document.createElement("div");e.style.width="200px",e.style.height="200px",a.appendChild(e),document.body.appendChild(a),fo=a.offsetWidth-a.clientWidth,document.body.removeChild(a)}return fo}s(Rn,"getScrollbarSize");var At=Symbol("class-ns");function p(a){return function(e){e[At]=a}}s(p,"class_ns");function Yt(a){document.body.style.cursor=a?"wait":"default"}s(Yt,"setWaitCursor");function Mt(a){let e=['button:not([tabindex="-1"]):not([disabled])',"[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'];return Array.from(a.querySelectorAll(e.join(","))).filter(o=>o.offsetParent!=null)}s(Mt,"getFocusableElements");var Dt=(i=>(i[i.first=0]="first",i[i.prev=1]="prev",i[i.pgdn=2]="pgdn",i[i.pgup=3]="pgup",i[i.next=4]="next",i[i.last=5]="last",i))(Dt||{});var Fn=s(function(){this.propagationStopped=!0},"stopPropagation"),Bn=s(function(){this.defaultPrevented=!0},"preventDefault"),_o=class _o{_source;_registry;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;return r.indexOf(n)==-1&&(o?r.unshift(n):r.push(n)),()=>{this.removeListener(e,t)}}removeListener(e,t){if(!this._registry)return;let o=this._registry.get(e);if(!o)return;let r=t,n=o.indexOf(r);n!==-1&&o.splice(n,1)}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=Bn),n.stopPropagation||(n.stopPropagation=Fn),o.length==1)o[0](n);else{let i=o.slice();for(let l=0,c=i.length;l<c&&(i[l](n),!n.propagationStopped);l++);}}}};s(_o,"EventSource");var de=_o;var Q,oe,wo=class wo{constructor(){ae(this,Q);ae(this,oe)}__startTimer(e,t,o,r){P(this,oe)?this.__stopTimer(e):le(this,oe,new Map);let n=(o?setInterval:setTimeout)(r,t);P(this,oe).set(e,()=>{(o?clearInterval:clearTimeout)(n),P(this,oe).delete(e)})}__stopTimer(e){var o;let t=(o=P(this,oe))==null?void 0:o.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 P(this,oe))t();P(this,oe).clear()}on(e,t){return console.assert(t!=null),P(this,Q)||le(this,Q,new de(this)),P(this,Q).addListener(e,t),{off:s(()=>{P(this,Q).removeListener(e,t)},"off")}}off(e,t){console.assert(t!=null),P(this,Q)&&P(this,Q).removeListener(e,t)}fire(e,t){P(this,Q)&&P(this,Q).fire(e,t)}};Q=new WeakMap,oe=new WeakMap,s(wo,"CoreElement");var re=wo;var Pt={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 Co(a){return!!Pt[a]}s(Co,"isUnitLess");var xe=class xe{m_sheet;m_rules=new Map;constructor(){function e(t){for(let o=0;o<document.styleSheets.length;o++){let r=document.styleSheets[o];if(r.title===t)return r}}if(s(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(M(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+" { ",i=t[r];for(let l in i){let c=i[l];for(let h=0;h<c.length;h++)n+=l+": "+c[h]+"; "}n+="}",this.setRule(e+"--"+o,n),o++}}}static getVar(e){return xe.doc_style||(xe.doc_style=getComputedStyle(document.documentElement)),e.startsWith("--")||(e="--"+e),xe.doc_style.getPropertyValue(e)}};s(xe,"Stylesheet"),O(xe,"guid",1),O(xe,"doc_style");var yo=xe,Eo=class Eo{m_style;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}};s(Eo,"ComputedStyle");var ko=Eo;var Ir={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},Qt=new WeakMap,Io=null,zn=s((a,e)=>{let t=s((r,n)=>{let i=Qt.get(r);i&&i[n]&&r.dispatchEvent(new Event(n,{}))},"sendEvent"),o=s((r,n)=>{n&&t(r,"created");for(let i=r.firstChild;i;i=i.nextSibling)o(i,n);n||t(r,"removed")},"notify");for(let r of a)r.type=="childList"&&(r.addedNodes&&r.addedNodes.forEach(n=>{o(n,!0)}),r.removedNodes&&r.removedNodes.forEach(n=>{o(n,!1)}))},"observeMutation"),Ao=null;function On(a){a.forEach(e=>{let t=e.target;t.offsetParent!==null&&t.dispatchEvent(new Event("resized"))})}s(On,"observeSize");function Ar(a){let e=a.target,t=Ir[a.type]===2;for(;e;){let o=Qt.get(e);if(o){let r=o[a.type];if(r&&(Array.isArray(r)?r.some(n=>n(a)):r(a),a.stopPropagation||a.defaultPrevented||t))break}if(e=e.parentNode,e==document)break}}s(Ar,"dispatchEvent");function Tt(a,e,t,o=!1){e=="removed"||e=="created"?Io||(Io=new MutationObserver(zn),Io.observe(document.body,{childList:!0,subtree:!0})):e=="resized"&&(Ao||(Ao=new ResizeObserver(On)),Ao.observe(a));let r=Qt.get(a);if(r||(r={},Qt.set(a,r)),!r[e])r[e]=t,a.addEventListener(e,Ar);else{let n=r[e];Array.isArray(n)?n.push(t):r[e]=[n,t]}}s(Tt,"addEvent");var Mr=Symbol("fragment"),Dr=Symbol("component"),Vn=/^-?\d+(\.\d*)?$/;function Hn(a){let e=[],t=Object.getPrototypeOf(a);if(t.constructor==d)return["x4-comp"];for(;t&&t.constructor!==d;){let o=t.constructor.name,r=Object.prototype.hasOwnProperty.call(t.constructor,At)?t.constructor[At]:"";e.push(r+o.toLowerCase()),t=Object.getPrototypeOf(t)}return e}s(Hn,"genClassNames");var Nn=1e3,q=s(()=>`x4-${Nn++}`,"makeUniqueComponentId"),Te,d=class extends re{constructor(t){var o,r;super();O(this,"dom");O(this,"props");O(this,"clsprefix");ae(this,Te);if(this.props=t,t.existingDOM)this.dom=t.existingDOM;else{t.ns?this.dom=document.createElementNS(t.ns,(o=t.tag)!=null?o:"div"):this.dom=document.createElement((r=t.tag)!=null?r:"div"),t.attrs&&this.setAttributes(t.attrs),t.cls&&this.addClass(t.cls),t.hidden&&this.show(!1),t.flex===!0?this.addClass("x4flex"):t.flex!==void 0&&this.setStyle({flexGrow:t.flex+""}),t.id!==void 0&&this.setAttribute("id",t.id),t.width!==void 0&&this.setStyleValue("width",t.width),t.height!==void 0&&this.setStyleValue("height",t.height),t.tooltip&&this.setAttribute("tooltip",t.tooltip),t.style&&this.setStyle(t.style),t.content&&this.setContent(t.content),t.dom_events&&this.setDOMEvents(t.dom_events);let n=Hn(this);this.dom.classList.add(...n),t.disabled&&this.addDOMEvent("created",()=>{this.enable(!1)})}this.dom[Dr]=this}hasClass(t){return this.dom.classList.contains(t)}addClass(t){if(t)if(t.indexOf(" ")>=0){t=t.trim();let o=t.split(" ");this.dom.classList.add(...o)}else this.dom.classList.add(t)}removeClass(t){if(t){if(t=="*"){this.dom.classList.value="";return}if(t.indexOf(" ")>=0){let o=t.split(" ");this.dom.classList.remove(...o)}else this.dom.classList.remove(t)}}removeClassEx(t){Array.from(this.dom.classList).forEach(r=>{r.match(t)&&this.dom.classList.remove(r)})}toggleClass(t){if(!t)return;let o=s(r=>{this.dom.classList.toggle(r)},"toggle");t.indexOf(" ")>=0?t.split(" ").forEach(o):o(t)}setClass(t,o=!0){return o?this.addClass(t):this.removeClass(t),this}setAttributes(t){for(let o in t)this.setAttribute(o,t[o]);return this}setAttribute(t,o){o==null?this.dom.removeAttribute(t):this.dom.setAttribute(t,""+o)}getAttribute(t){return this.dom.getAttribute(t)}getData(t){return this.getAttribute("data-"+t)}getIntData(t){let o=parseInt(this.getAttribute("data-"+t));if(Number.isFinite(o))return o}setData(t,o){return this.setAttribute("data-"+t,o)}setInternalData(t,o){return P(this,Te)||le(this,Te,new Map),P(this,Te).set(t,o),this}getInternalData(t){var o;return(o=P(this,Te))==null?void 0:o.get(t)}addDOMEvent(t,o,r=!1){Tt(this.dom,t,o,r)}setDOMEvents(t){for(let o in t)this.addDOMEvent(o,t[o])}mapPropEvents(t,...o){let r=t;o.forEach(n=>{Object.prototype.hasOwnProperty.call(r,n)&&r[n]&&this.on(n,r[n])})}clearContent(){let t=this.dom;for(;t.firstChild;)t.removeChild(t.firstChild)}setContent(t){this.clearContent(),this.appendContent(t)}appendContent(t){let o=s((r,n)=>{if(n instanceof d)r.appendChild(n.dom);else if(n instanceof Ae)r.insertAdjacentHTML("beforeend",n.toString());else if(typeof n=="string"||typeof n=="number"){let i=document.createTextNode(n.toString());r.appendChild(i)}else n&&console.warn("Unknown type to append: ",n)},"set");if(!Y(t))o(this.dom,t);else if(t.length<=8)for(let r of t)o(this.dom,r);else{let r=document.createDocumentFragment();for(let n of t)o(r,n);this.dom.appendChild(r)}}prependContent(t){let o=this.dom,r=s(n=>{n instanceof d?o.insertAdjacentElement("afterbegin",n.dom):n instanceof Ae?o.insertAdjacentHTML("afterbegin",n.toString()):typeof n=="string"||typeof n=="number"?o.insertAdjacentText("afterbegin",n.toString()):console.warn("Unknown type to append: ",n)},"set");if(!Y(t))r(t);else{let n=document.createDocumentFragment();for(let i of t)r(i);o.insertBefore(o.firstChild,n)}}removeChild(t){this.dom.removeChild(t.dom)}queryAll(t){let o=this.dom.querySelectorAll(t),r=new Array(o.length);return o.forEach((n,i)=>r[i]=$t(n)),r}query(t){let o=this.dom.querySelector(t);return T(o)}setAria(t,o){return this.setAttribute(t,o),this}setStyle(t){let o=this.dom.style;for(let r in t){let n=t[r];!Pt[r]&&(V(n)||Vn.test(n))&&(n+="px"),o[r]=n}return this}setStyleValue(t,o){let r=this.dom.style;if(V(o)){let n=o+"";Pt[t]||(n+="px"),r[t]=n}else r[t]=o;return this}getStyleValue(t){return this.dom.style[t]}setWidth(t){this.setStyleValue("width",V(t)?t+"px":t)}setHeight(t){this.setStyleValue("height",V(t)?t+"px":t)}setStyleVariable(t,o){this.dom.style.setProperty(t,o)}getStyleVariable(t){return this.getComputedStyle().getPropertyValue(t)}getComputedStyle(){return getComputedStyle(this.dom)}setCapture(t){this.dom.setPointerCapture(t)}releaseCapture(t){this.dom.releasePointerCapture(t)}getBoundingRect(){let t=this.dom.getBoundingClientRect();return new Me(t.x,t.y,t.width,t.height)}focus(){return this.dom.focus(),this}hasFocus(){return document.activeElement==this.dom}scrollIntoView(t){this.dom.scrollIntoView(t)}isVisible(){return this.dom.offsetParent!==null}show(t=!0){return this.setClass("x4hidden",!t),this}hide(){return this.show(!1),this}enable(t=!0){return this.setAttribute("disabled",t?null:"true"),(this.dom instanceof HTMLInputElement||this.dom instanceof HTMLButtonElement)&&(this.dom.disabled=!t),this.enumChildNodes(!0).forEach(r=>{(r instanceof HTMLInputElement||r instanceof HTMLButtonElement)&&(r.disabled=!t)}),this}disable(){return this.enable(!1),this}isDisabled(){return this.getAttribute("disabled")}nextElement(){let t=this.dom.nextElementSibling;return T(t)}prevElement(){let t=this.dom.previousElementSibling;return T(t)}parentElement(t){return d.parentElement(this.dom,t)}static parentElement(t,o){for(;t.parentElement;){let r=T(t.parentElement);if(!o||r&&r instanceof o)return r;t=t.parentElement}return null}firstChild(){let t=this.dom.firstElementChild;return T(t)}lastChild(){let t=this.dom.lastElementChild;return T(t)}enumChildComponents(t){let o=[];return this.enumChildNodes(t).forEach(n=>{let i=T(n);i&&o.push(i)}),o}enumChildNodes(t){return Array.from(t?this.dom.querySelectorAll("*"):this.dom.children)}animate(t,o){this.dom.animate(t,o)}static createElement(t,o,...r){let n;return t==this.createFragment||t===Mr?r:(t instanceof Function?(o=o!=null?o:{},!o.children&&r&&r.length&&(o.content=r),n=new t(o!=null?o:{})):n=new d({tag:t,content:r,...o}),r&&r.length,n)}static createFragment(){return this.createElement(Mr,null)}queryInterface(t){return null}};Te=new WeakMap,s(d,"Component"),d=u([p("x4")],d);function T(a){return a?a[Dr]:null}s(T,"componentFromDOM");function $t(a){let e=T(a);return e||new d({existingDOM:a})}s($t,"wrapDOM");var Mo=class Mo extends d{constructor(){super({})}};s(Mo,"Flex");var ne=Mo,Do=class Do extends d{constructor(e,t){super({width:e,cls:t})}};s(Do,"Space");var St=Do;var Pr=Symbol("socket"),Po=null,So=class So{getMaxTouchPoints(){return navigator.maxTouchPoints}};s(So,"Process");var To=So,Lt=class Lt extends re{env=new Map;mainview;constructor(){super(),console.assert(Po==null,"Application must be a singleton."),Po=this}setMainView(e){this.mainview=e,document.body.appendChild(e.dom),this._setupKeyboard()}static instance(){return Po}getMainView(){return this.mainview}setEnv(e,t){this.env.set(e,t)}getEnv(e,t){var o;return(o=this.env.get(e))!=null?o:t}static fireGlobal(e,t){Lt.instance().fire("global",{msg:e,params:t})}_setupKeyboard(){document.addEventListener("keydown",e=>{(e.key=="Tab"||e.key=="Enter")&&this.focusNext(!e.shiftKey)&&e.preventDefault()})}focusNext(e){let t=document.activeElement,o;for(;t!=document.body;){let n=T(t).queryInterface("tab-handler");if(n)return n.focusNext(e);t.classList.contains("x4box")&&(o=t),t=t.parentElement}if(o){let r=Mt(o);if(r.length){let n=r[0],i=r[r.length-1],l;if(!e&&document.activeElement===n?l=i:e&&document.activeElement===i&&(l=n),l)return l.focus(),!0}else return!0}return!1}setupSocketMessaging(e,t){let o=window.location.protocol==="https:"?"wss://":"ws://",r=e?o+e:`${o}${window.location.hostname}:${window.location.port}/ws`,n=0,i=null;this.on("global",l=>{Object.prototype.hasOwnProperty.call(l,Pr)||i&&i.send(JSON.stringify({msg:l.msg,params:l.params}))}),i=new WebSocket(r,"messaging"),i.onopen=()=>{console.log("websocket opened"),n=1},i.onmessage=l=>{if(l.data!="ping"){let c=JSON.parse(l.data);c[Pr]=!0,this.fire("global",c)}},i.onclose=l=>{console.log("websocket closed:",l),i=null,n&&(t(),n=0)}}getStorage(e){return localStorage.getItem(e)}getStorageJSON(e){try{return JSON.parse(localStorage.getItem(e))}catch{return}}setStorage(e,t){localStorage.setItem(e,t+"")}setStorageJSON(e,t){localStorage.setItem(e,JSON.stringify(t))}};s(Lt,"Application"),O(Lt,"process",new To);var Rt=Lt;function Se(a){return a.toString(16).padStart(2,"0")}s(Se,"hx");function gt(a){return Math.round(a)}s(gt,"round");var Lo=class Lo{rgb=[0,0,0,1];invalid=!1;constructor(...e){M(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),i=parseInt(e[5],16),l=parseInt(e[6],16);return this.setRgb(t<<4|o,r<<4|n,i<<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),i=parseInt(e[5],16),l=parseInt(e[6],16),c=parseInt(e[7],16),h=parseInt(e[8],16);return this.setRgb(t<<4|o,r<<4|n,i<<4|l,(c<<4|h)/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(),i=getComputedStyle(document.documentElement).getPropertyValue(r);return this.setValue(i)}}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)),i=e*6-n,l=o*(1-t),c=o*(1-i*t),h=o*(1-(1-i)*t),g,f,m;switch(n){case 0:g=o,f=h,m=l;break;case 1:g=c,f=o,m=l;break;case 2:g=l,f=o,m=h;break;case 3:g=l,f=c,m=o;break;case 4:g=h,f=l,m=o;break;case 5:g=o,f=l,m=c;break}return this.setRgb(g*255,f*255,m*255,r)}setRgb(e,t,o,r){return this.rgb=[G(e|0,0,255),G(t|0,0,255),G(o|0,0,255),G(r,0,1)],this}toRgbString(e){let t=this.rgb;return e===!1||t[3]==1?`rgb(${gt(t[0])},${gt(t[1])},${gt(t[2])})`:`rgba(${gt(t[0])},${gt(t[1])},${gt(t[2])},${t[3].toFixed(3)})`}toHexString(){let e=this.rgb;return e[3]==1?`#${Se(e[0])}${Se(e[1])}${Se(e[2])}`:`#${Se(e[0])}${Se(e[1])}${Se(e[2])}${Se(e[3]*255|0)}`}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,i=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:i,alpha:e.alpha}}getAlpha(){return this.rgb[3]}setAlpha(e){return this.rgb[3]=G(e,0,1),this}isInvalid(){return this.invalid}};s(Lo,"Color");var N=Lo;var zo=class zo{name;id;fields;constructor(e){this.name=e,this.id=void 0,this.fields=[]}};s(zo,"MetaInfos");var Ro=zo,Zt=Symbol("metaField");function Xt(a,e=!0){let t=a.constructor,o=Object.prototype.hasOwnProperty.call(t,Zt)?t[Zt]:void 0;if(o===void 0){e||console.assert(o!==void 0),o=new Ro(t.name);let r=Object.getPrototypeOf(t);if(r!=Jt){let n=r[Zt];o.fields=[...n.fields,...o.fields],console.assert(o.id===void 0,"cannot define mutiple record id"),o.id||(o.id=n.id)}a.constructor[Zt]=o}return o}s(Xt,"_getMetas");var Fo;(g=>{function a(){return(f,m)=>{let x=Xt(f);x.fields.push({name:m,type:"any",required:!0}),x.id=m}}g.id=a,s(a,"id");function e(f){return(m,x)=>{Xt(m).fields.push({name:x,...f})}}g.field=e,s(e,"field");function t(f){return e({...f,type:"string"})}g.string=t,s(t,"string");function o(f){return e({...f,type:"int"})}g.int=o,s(o,"int");function r(f){return e({...f,type:"float"})}g.float=r,s(r,"float");function n(f){return e({...f,type:"bool"})}g.bool=n,s(n,"bool");function i(f){return e({...f,type:"date"})}g.date=i,s(i,"date");function l(f){return e({...f,type:"calc"})}g.calc=l,s(l,"calc");function c(f,m){return g.field({...m,type:"array",model:f?new f:null})}g.array=c,s(c,"array");function h(f){return e({...f,type:"any"})}g.any=h,s(h,"any")})(Fo||(Fo={}));var Oo=class Oo{getFields(){return Xt(this,!1).fields}validate(e){let t=null;return this.getFields().forEach(r=>{r.required&&!this.getField(r.name,e)&&(t&&(t=[]),t.push(new Error(`field ${r.name} is required.`)))}),t}getFieldIndex(e){return this.getFields().findIndex(o=>o.name==e)}serialize(e){let t={};return this.getFields().forEach(o=>{o.calc===void 0&&(t[o.name]=e[o.name])}),t}unSerialize(e,t){let o=this.getFields(),r=new Ft;return o.forEach(n=>{let i=e[n.name];i!==void 0&&(r[n.name]=this._convertField(n,i))}),t!==void 0?r[o[0].name]=t:console.assert(this.getID(r)!==void 0),r}_convertField(e,t){switch(e.type){case"float":{let o=typeof t=="number"?t:parseFloat(t);if(e.prec!==void 0){let r=Math.pow(10,e.prec);o=Math.round(o*r)/r}return o}case"int":return typeof t=="number"?t:parseInt(t);case"date":return M(t)?new Date(t):t;case"array":{debugger;break}}return t}getID(e){if(!e)return null;let t=Xt(this,!1);return e[t.id]}getRaw(e,t){let o,r=this.getFields();if(typeof e=="string"){if(o=r.findIndex(i=>i.name==e),o<0){console.assert(!1,"unknown field: "+e);return}}else if(e<r.length){if(e<0)return;o=e}else{console.assert(!1,"bad field name: "+e);return}let n=r[o];return n.calc!==void 0?n.calc(t):t[n.name]}getField(e,t){let o=this.getRaw(e,t);return o==null?"":""+o}};s(Oo,"DataModel");var Jt=Oo,Vo=class Vo{};s(Vo,"DataRecord");var Ft=Vo,Ho=class Ho extends re{m_props;constructor(e){super(),this.m_props=e}async load(e){e?this.m_props.url=e:e=this.m_props.url,this.m_props.params&&(e+="?"+this.m_props.params.join("&"));let t=await fetch(e);if(t.ok){let o=await t.json(),r=o;this.m_props.solver&&(r=this.m_props.solver(r)),this.fire("change",{value:r,context:o})}}};s(Ho,"DataProxy");var eo=Ho,No=class No extends de{m_model;m_fields;m_records;m_proxy;m_rec_index;constructor(e){super(),this.m_fields=void 0,this.m_records=[],this.m_rec_index=null,this.m_model=e.model,this.m_fields=e.model.getFields(),e.data?this.setRawData(e.data):e.url&&(this.m_proxy=new eo({url:e.url,solver:e.solver}),this.m_proxy.on("change",t=>{this.setData(t.value)}),e.autoload!=!1&&this.m_proxy.load())}async load(e){return this.m_proxy.load(e)}async reload(){return this.m_proxy.load()}setData(e){let t=new Array(e.length);e.forEach((o,r)=>{t[r]=this.m_model.unSerialize(o)}),this.setRawData(t)}setRawData(e){this.m_records=e,this._rebuildIndex(),this.fire("data_change",{change_type:"change"})}_rebuildIndex(){this.m_rec_index=null,this.m_rec_index=this.createIndex(null),this.m_rec_index=this.sortIndex(this.m_rec_index,null)}update(e){let t=this.m_model.getID(e),o=this.indexOfId(t);return o<0?!1:(this.m_records[this.m_rec_index[o]]=e,this.fire("data_change",{change_type:"update",id:t}),!0)}append(e){e instanceof Ft||(e=this.m_model.unSerialize(e));let t=this.m_model.getID(e);console.assert(t!==void 0),this.m_records.push(e),this._rebuildIndex(),this.fire("data_change",{change_type:"create",id:t})}getMaxId(){let e,t=this.m_model;return this.m_records.forEach(o=>{let r=t.getID(o);(e===void 0||e<r)&&(e=r)}),e}delete(e){let t=this.indexOfId(e);return t<0?!1:(t=this.m_rec_index[t],this.m_records.splice(t,1),this._rebuildIndex(),this.fire("data_change",{change_type:"delete",id:e}),!0)}get count(){return this.m_rec_index?this.m_rec_index.length:this.m_records.length}get fields(){return this.m_fields}indexOfId(e){let t=this.m_model;for(let o=this.count,r=0;o!=0;o>>=1){let n=r+(o>>1),i=this.m_rec_index[n],l=t.getID(this.m_records[i]);if(l==e)return n;l<e&&(r=n+1,o--)}return-1}getById(e){let t=this.indexOfId(e);return t<0?null:(t=this.m_rec_index[t],this.m_records[t])}getByIndex(e){let t=this.m_rec_index[e];return this._getRecord(t)}_getRecord(e){var t;return(t=this.m_records[e])!=null?t:null}moveTo(e){e.setRawData(this.m_records)}createView(e){let t={...e,store:this};return new xt(t)}createIndex(e){if(e&&e.op==="empty-result")return new Uint32Array(0);let t=new Uint32Array(this.m_records.length),o=0;if(!e)this.forEach((f,m)=>{t[o++]=m});else if(typeof e.op=="function"){let f=e.op;this.forEach((m,x)=>{m&&f(m)&&(t[o++]=x)})}else{let x=function(R){return R<m},v=function(R){return R<=m},U=function(R){return R==m},w=function(R){return R!=m},S=function(R){return R>=m},J=function(R){return R>m},B=function(R){return fe.lastIndex=-1,fe.test(R)};var r=x,n=v,i=U,l=w,c=S,h=J,g=B;s(x,"_lt"),s(v,"_le"),s(U,"_eq"),s(w,"_neq"),s(S,"_ge"),s(J,"_gt"),s(B,"_re");let f=this.m_model.getFieldIndex(e.field);if(f<0)return console.assert(!1,"unknown field name in filter"),new Uint32Array(0);let m=e.value;M(m)&&!e.caseSensitive&&(m=m.toUpperCase());let L,fe;if(m instanceof RegExp)fe=m,L=B;else switch(e.op){case"<":{L=x;break}case"<=":{L=v;break}case"=":{L=U;break}case">=":{L=S;break}case">":{L=J;break}case"<>":{L=w;break}}let pt=this.m_model;this.forEach((R,qt)=>{if(!R)return;let ee=pt.getRaw(f,R);ee==null?ee="":(ee=""+ee,e.caseSensitive||(ee=ee.toUpperCase())),L(ee)&&(t[o++]=qt)})}return t.slice(0,o)}sortIndex(e,t){let o=0,r=[];if(t===null?r.push({fidx:0,asc:!0}):r=t.map(i=>{let l=this.m_model.getFieldIndex(i.field);return l==-1&&(console.assert(!1,"unknown field name in sort"),o++),{fidx:l,asc:i.ascending}}),o||r.length==0)return e;let n=this.m_model;if(r.length==1){let i=r[0].fidx;e.sort((l,c)=>{var f,m;let h=(f=n.getRaw(i,this.getByIndex(l)))!=null?f:"",g=(m=n.getRaw(i,this.getByIndex(c)))!=null?m:"";return h>g?1:h<g?-1:0}),r[0].asc||e.reverse()}else e.sort((i,l)=>{var c,h;for(let g=0;g<r.length;g++){let f=r[g].fidx,m=r[g].asc?1:-1,x=(c=n.getRaw(f,this.getByIndex(i)))!=null?c:"",v=(h=n.getRaw(f,this.getByIndex(l)))!=null?h:"";if(x>v)return m;if(x<v)return-m}return 0});return e}forEach(e){this.m_rec_index?this.m_rec_index.some((t,o)=>{if(e(this.m_records[t],o))return o}):this.m_records.some((t,o)=>{if(t&&e(t,o))return o})}export(){return this.m_records}changed(){this.fire("data_change",{change_type:"change"})}getModel(){return this.m_model}};s(No,"DataStore");var Bo=No,Uo=class Uo extends re{m_index;m_store;m_model;m_sort;m_filter;m_props;constructor(e){super(),this.m_props=e,this.m_store=e.store,this.m_index=null,this.m_filter=null,this.m_sort=null,this.m_model=this.m_store.getModel(),this.filter(e.filter),e.order?M(e.order)?this.sort([{field:e.order,ascending:!0}]):Y(e.order)?this.sort(e.order):this.sort([e.order]):this.sort(null),this.m_store.addListener("data_change",t=>this._storeChange(t))}_storeChange(e){this._filter(this.m_filter,e.type!="change"),this._sort(this.m_sort,e.type!="change"),this.fire("view_change",{change_type:"change"})}filter(e){return this.m_index=null,this._filter(e,!0)}_filter(e,t){return this.m_index=this.m_store.createIndex(e),this.m_filter=e,this.m_sort&&this.sort(this.m_sort),t&&this.fire("view_change",{change_type:"filter"}),this.m_index.length}sort(e){this._sort(e,!0)}_sort(e,t){this.m_index=this.m_store.sortIndex(this.m_index,e),this.m_sort=e,t&&this.fire("view_change",{change_type:"sort"})}getStore(){return this.m_store}getCount(){return this.m_index.length}indexOfId(e){let t=this.m_store.indexOfId(e);return this.m_index.findIndex(o=>o===t)}getByIndex(e){if(e>=0&&e<this.m_index.length){let t=this.m_index[e];return this.m_store.getByIndex(t)}return null}getIdByIndex(e){let t=this.getByIndex(e);return this.m_model.getID(t)}getRecId(e){return this.m_model.getID(e)}getById(e){return this.m_store.getById(e)}getModel(){return this.m_model}changed(){this.fire("view_change",{change_type:"change"})}forEach(e){this.m_index.some(t=>{let o=this.m_store.getByIndex(t);if(o&&e(o,t))return t})}};s(Uo,"DataView");var xt=Uo;var qo=Symbol("x-drag-cb"),Go=class Go{dragSource;dragGhost;dropTarget;notified;timer;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=s(c=>{if(o&&!o(this.dragSource,c.dataTransfer)){console.log("reject ",e),c.dataTransfer.dropEffect="none";return}console.log("accepted ",e),c.preventDefault(),c.dataTransfer.dropEffect="copy"},"dragEnter"),n=s(c=>{if(o&&!o(this.dragSource,c.dataTransfer)){console.log("reject ",e),c.dataTransfer.dropEffect="none";return}if(c.preventDefault(),this.dropTarget!=e&&(this.dropTarget=e,this._startCheck()),this.dropTarget){let h={pt:{x:c.pageX,y:c.pageY},data:c.dataTransfer};t("drag",this.dragSource,h)}c.dataTransfer.dropEffect="copy"},"dragOver"),i=s(c=>{this.dropTarget=null,c.preventDefault()},"dragLeave"),l=s(c=>{let h={pt:{x:c.pageX,y:c.pageY},data:c.dataTransfer};t("drop",this.dragSource,h),this.dropTarget=null,e.removeClass("drop-over"),c.preventDefault()},"drop");e.addDOMEvent("dragenter",r),e.addDOMEvent("dragover",n),e.addDOMEvent("dragleave",i),e.addDOMEvent("drop",l),e.setInternalData(qo,t)}_startCheck(){this.timer&&(clearInterval(this.timer),this._check()),this.timer=setInterval(()=>this._check(),300)}_check(){let e=s(o=>{o.removeClass("drop-over"),o.getInternalData(qo)("leave",this.dragSource)},"leaving"),t=s(o=>{o.addClass("drop-over"),o.getInternalData(qo)("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))}};s(Go,"DragManager");var Ko=Go,Bt=new Ko;var jo=class jo{static create_element(e,t,...o){t=t||{};let r;return M(e)?(r=new d({tag:e}),Object.entries(t).forEach(([n,i])=>{n.startsWith("on")&&n.toLowerCase()in window?r.dom.addEventListener(n.toLowerCase().substring(2),i):r.setAttribute(n,i)})):r=new e(t),o&&o.length&&r.appendContent(o),r}};s(jo,"x4_react");var Wo=jo;function Tr(a,e=!1){if(a instanceof RegExp)return{keys:null,pattern:a};let t=a.split("/"),o=[],r="";t[0]==""&&t.shift();for(let n of t){let i=n[0];if(i==="*")o.push("wild"),r+="/(.*)";else if(i===":"){let l=n.indexOf("?",1),c=n.indexOf(".",1);o.push(n.substring(1,l>=0?l:c>=0?c:n.length)),r+=l>=0&&c<0?"(?:/([^/]+?))?":"/([^/]+?)",c>=0&&(r+=(l>=0?"?":"")+"\\"+n.substring(c))}else r+="/"+n}return{keys:o,pattern:new RegExp(`^${r}${e?"(?=$|/)":"/?$"}`,"i")}}s(Tr,"parseRoute");var Qo=class Qo extends de{m_routes;m_useHash;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)}),this.fire("change",{value:this._getLocation()})})}get(e,t){let{keys:o,pattern:r}=Tr(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)return console.log("route not found: "+e),this.fire("error",{code:404,message:"route not found"}),!1;if(this.m_useHash){for(;e.at(0)=="/";)e=e.substring(1);e="#"+e}return o?window.history.replaceState({},"",e):window.history.pushState({},"",e),t&&r.handlers[0](r.params,e),this.fire("change",{value:this._getLocation()}),!0}_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 i=0;i<n.keys.length;)o[n.keys[i]]=t[++i];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 i in t.groups)o[i]=t.groups[i];r=[...r,n.handler]}return{params:o,handlers:r}}};s(Qo,"Router");var Yo=Qo;var Zo=class Zo{_state;_subscribers;_currentTracking;constructor(e){this._state=e?{...e}:{},this._subscribers=new Map,this._currentTracking=new Set}getState(e,t=null){this._currentTracking&&this._currentTracking.add(e);let o=e.split("."),r=this._state;for(let n of o){if((r==null?void 0:r[n])===void 0)return t;r=r[n]}return r}setState(e,t,o={}){let r=e.split("."),n=this._state;for(let i=0;i<r.length-1;i++){let l=r[i];(!n[l]||typeof n[l]!="object")&&(n[l]={}),n=n[l]}n[r[r.length-1]]=t,this._notifySubscribers(e,t)}};s(Zo,"StateManager");var $o=Zo;var Sr="http://www.w3.org/2000/svg";function Un(a){return a*Math.PI/180}s(Un,"d2r");function Lr(a,e,t,o){let r=Un(o);return{x:a+t*Math.cos(r),y:e+t*Math.sin(r)}}s(Lr,"p2c");function D(a){return Math.round(a*1e3)/1e3}s(D,"num");function to(a,...e){return e=e.map(t=>typeof t=="number"&&isFinite(t)?D(t):t),String.raw(a,...e)}s(to,"clean");var Xo=class Xo{_dom;constructor(e){this._dom=document.createElementNS("http://www.w3.org/2000/svg",e)}getDom(){return this._dom}reset(){let e=this._dom.attributes;for(let t=e.length-1;t>=0;t--)this._dom.removeAttribute(e[t].name);return this}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}getAttr(e){return this._dom.getAttribute(e)}getNumAttr(e){return parseInt(this._dom.getAttribute(e))}setAttr(e,t){return this._dom.setAttribute(e,t),this}setStyle(e,t){let o=this._dom.style;if(V(t)){let r=t+"";Co(e)||(r+="px"),o[e]=r}else o[e]=t;return this}addClass(e){if(e){if(e=e.trim(),e.indexOf(" ")>=0){let t=e.split(" ");this._dom.classList.add(...t)}else this._dom.classList.add(e);return this}}removeClass(e){if(e){if(e.indexOf(" ")>=0){let t=e.split(" ");this._dom.classList.remove(...t)}else this._dom.classList.remove(e);return this}}clip(e){return this.setAttr("clip-path",`url(#${e})`),this}transform(e){var o;let t=(o=this.getAttr("transform"))!=null?o:"";return this.setAttr("transform",t+" "+e),this}clear_transform(){return this.setAttr("transform",null),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 Tt(this._dom,e,t,o),this}};s(Xo,"SvgItem");var be=Xo,Jo=class Jo extends be{_path;constructor(){super("path"),this._path=""}_update(){return this.setAttr("d",this._path),this}reset(){return this._path="",super.reset(),this}moveTo(e,t){return this._path+=to`M${e},${t}`,this._update()}lineTo(e,t){return this._path+=to`L${e},${t}`,this._update()}curveTo(e,t,o,r,n,i){return this._path+=to`C${e},${t} ${o},${r} ${n},${i}`,this._update()}closePath(){return this._path+="Z",this._update()}arc(e,t,o,r,n,i=!0){let l=Lr(e,t,o,r-90),c=Lr(e,t,o,n-90),h=n-r<=180?"0":"1";return this._path+=to`M${l.x},${l.y}A${o},${o} 0 ${h} ${i?"1":"0"} ${c.x},${c.y}`,this._update()}};s(Jo,"SvgPath");var oo=Jo,er=class er extends be{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)}};s(er,"SvgText");var ro=er,tr=class tr extends be{constructor(e){super("svg"),e.startsWith("data:image/svg+xml,")&&(e=e.substring(19));let o=new DOMParser().parseFromString(decodeURIComponent(e),"image/svg+xml"),r=o.querySelector("parsererror");r&&console.error(`error while parsing svg:
2
- `+r.textContent);let n=o.documentElement;for(let i=0;i<n.attributes.length;i++)this._dom.setAttribute(n.attributes[i].name,n.attributes[i].value);for(let i=0;i<n.childNodes.length;i++){let l=n.childNodes[i];l.nodeType===1&&this._dom.appendChild(l)}}};s(tr,"SvgIcon");var no=tr,or=class or extends be{constructor(e){super(e)}};s(or,"SvgShape");var vt=or,bt=class bt extends be{_id;_stops;constructor(e,t,o,r){super("linearGradient"),this._id="gx-"+bt.g_id,bt.g_id++,this.setAttr("id",this._id),this.setAttr("x1",M(e)?e:D(e)+""),this.setAttr("x2",M(o)?o:D(o)+""),this.setAttr("y1",M(t)?t:D(t)+""),this.setAttr("y2",M(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}};s(bt,"SvgGradient"),O(bt,"g_id",1);var io=bt,so=class so extends be{constructor(e="g"){super(e)}append(e){return this._dom.appendChild(e.getDom()),e}appendItems(e){e.forEach(t=>{this._dom.appendChild(t.getDom())})}path(){let e=new oo;return this.append(e)}text(e,t,o){let r=new ro(e,t,o);return this.append(r)}ellipse(e,t,o,r){let n=new vt("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)}circle(e,t,o){let r=new vt("ellipse");return r.setAttr("cx",D(e)+""),r.setAttr("cy",D(t)+""),r.setAttr("rx",D(o)+""),r.setAttr("ry",D(o)+""),this.append(r)}icon(e,t,o,r,n){let i=new no(e);return i.setAttr("x",D(t)+""),i.setAttr("y",D(o)+""),i.setAttr("width",D(r)+""),i.setAttr("height",D(n)+""),this.append(i)}rect(e,t,o,r){r<0&&(t=t+r,r=-r);let n=new vt("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(e){let t=new so;return e&&t.setAttr("id",e),this.append(t)}linear_gradient(e,t,o,r){let n=new io(e,t,o,r);return this.append(n)}clear(){let e=this._dom;for(;e.firstChild;)e.removeChild(e.firstChild)}};s(so,"SvgGroup");var _t=so,Le=class Le extends _t{constructor(){super()}addClip(e,t,o,r){let n="clip-"+Le.g_clip_id++,i=new _t("clipPath");return i.setAttr("id",n),i.rect(e,t,o,r),this.append(i),{id:n,clip:i}}addPattern(e,t,o,r){let n="pat-"+Le.g_pat_id++,i=new _t("pattern");return i.setAttr("id",n),i.setAttr("x",D(e)+""),i.setAttr("y",D(t)+""),i.setAttr("width",D(o)+""),i.setAttr("height",D(r)+""),i.setAttr("patternUnits","userSpaceOnUse"),this.append(i),{id:n,pat:i}}};s(Le,"SvgBuilder"),O(Le,"g_clip_id",1),O(Le,"g_pat_id",1);var zt=Le,rr=class rr extends d{constructor(e){super({...e,tag:"svg",ns:Sr}),this.setAttribute("xmlns",Sr),e.viewbox&&this.setAttribute("viewBox",e.viewbox),e.svg&&this.dom.appendChild(e.svg.getDom())}setSvg(e){this.clearContent(),this.dom.appendChild(e.getDom())}addItems(...e){e.forEach(t=>this.dom.appendChild(t.getDom()))}};s(rr,"SvgComponent");var Ot=rr;var C=class extends d{};s(C,"Box"),C=u([p("x4")],C);var b=class extends C{};s(b,"HBox"),b=u([p("x4")],b);var k=class extends C{constructor(e){super(e)}};s(k,"VBox"),k=u([p("x4")],k);var ie=class extends C{_items;_cur;constructor(e){var t;super(e),this.mapPropEvents(e,"pageChange"),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)}addItem(e){this._items.push({name:e.name,content:e.content,page:null})}select(e){var r;let t=this.query(":scope > .selected");t&&t.setClass("selected",!1),this._cur=this._items.findIndex(n=>n.name==e);let o=this._items[this._cur];return o&&(o.page||(o.page=this._createPage(o),this.appendContent(o.page)),t=o.page,t&&((r=t.activate)==null||r.call(t),t.setClass("selected",!0)),te(()=>this.fire("pageChange",{selection:o.name,empty:!t}))),o==null?void 0:o.page}_createPage(e){let t;return e.content instanceof Function?(t=e.content(),e.content=t):t=e.content,t==null||t.setData("stackname",e.name),t}getPage(e){let t=this._items.find(o=>o.name==e);return t?t.content:null}getItem(e){return this._items.find(o=>o.name==e)}getCurPage(){let e=this._items[this._cur];return e==null?void 0:e.name}};s(ie,"StackBox"),ie=u([p("x4")],ie);var Re=class extends ie{selectNextPage(e=!0){let t;e&&this._cur<this._items.length-1?t=this._items[this._cur+1]:!e&&this._cur>0&&(t=this._items[this._cur-1]),t&&this.select(t.name)}isFirstPage(){return this._cur==0}isLastPage(){return this._cur==this._items.length-1}};s(Re,"AssistBox"),Re=u([p("x4")],Re);var Fe=class extends C{constructor(e){super(e),e.rows!==void 0&&this.setRows(e.rows),e.columns!==void 0&&this.setCols(e.columns),e.items&&this.setItems(e.items)}setRows(e){Y(e)?e=e.join(" "):V(e)&&(e=`repeat( ${e}, 1fr )`),this.setStyleValue("gridTemplateRows",e)}setCols(e){Y(e)?e=e.join(" "):V(e)&&(e=`repeat( ${e}, 1fr )`),this.setStyleValue("gridTemplateColumns",e)}setRowCount(e){this.setStyleValue("gridTemplateRows",`repeat(${e})`)}setColCount(e){this.setStyleValue("gridTemplateColumns",`repeat(${e})`)}setTemplate(e){this.setAttribute("grid-template-area",e.map(t=>'"'+t+'"').join(" "))}setItems(e){e.forEach(t=>{t.item.setStyle({gridColumn:t.col+1+"",gridRow:t.row+1+""})}),this.setContent(e.map(t=>t.item))}};s(Fe,"GridBox"),Fe=u([p("x4")],Fe);var Be=class extends C{constructor(e){super(e),this.addDOMEvent("resized",()=>{this.resizeAllItems()}),e.items&&this.setItems(e.items)}resizeItem(e){let t=this.getComputedStyle(),o=parseInt(t.gridAutoRows),r=parseInt(t.rowGap),n=e.query(".content");if(n||(n=e),n&&o+r){let i=n.getBoundingRect(),l=Math.ceil((i.height+r)/(o+r));e.setStyleValue("gridRowEnd","span "+l)}}resizeAllItems(){this.queryAll(".item").forEach(t=>{this.resizeItem(t)})}setItems(e){let t=e.map(o=>new C({cls:"item",content:o}));this.setContent(t)}};s(Be,"MasonryBox"),Be=u([p("x4")],Be);var ze=class extends b{constructor(e){super(e),this.mapPropEvents(e,"click"),e.items&&this.setItems(e.items)}setItems(e){let t=e.map(o=>new I({label:o.label,icon:o.icon,click:s(()=>{o.click?o.click(o.name):this.fire("click",{context:o.name})},"click")}));this.setContent(t)}};s(ze,"Breadcrumbs"),ze=u([p("x4")],ze);var ir=class ir{cache;waiters;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=>{this.cache.set(e,r),this.waiters.get(e).forEach(i=>i(r))}))})}async _load(e){let t=await fetch(e);if(t.ok)return t.text()}};s(ir,"SvgLoader");var nr=ir,wt=new nr,E=class extends d{constructor(e){super(e),this.setIcon(e.iconId)}setIcon(e){if(this.clearContent(),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")?wt.load(e).then(t=>{this.clearContent(),this.dom.insertAdjacentHTML("beforeend",t)}):this.setContent(new d({tag:"img",attrs:{src:e}})),this.removeClass("empty")}else this.addClass("empty")}};s(E,"Icon"),E=u([p("x4")],E);var yt,I=class extends d{constructor(t){super({...t,tag:"button",content:null});ae(this,yt);this.mapPropEvents(t,"click"),t.autorepeat?(this.addDOMEvent("pointerdown",o=>this._on_mouse(o)),this.addDOMEvent("pointerup",o=>this._on_mouse(o))):this.addDOMEvent("click",o=>this._on_click(o)),this.addDOMEvent("keydown",o=>this._on_keydown(o)),this.setContent([new E({id:"icon",iconId:this.props.icon}),le(this,yt,new d({id:"label"}))]),this.setText(t.label),t.tabindex!==!1&&this.setAttribute("tabindex",t.tabindex)}_on_click(t){this.fire("click",{}),t.preventDefault(),t.stopPropagation()}_on_mouse(t){let o=0;if(t.type=="pointerdown"){this.dom.setPointerCapture(t.pointerId);let r=this.props.autorepeat===!0?200:this.props.autorepeat;this.setTimeout("repeat",500,()=>{o++,this.fire("click",{}),this.setInterval("repeat",r,()=>{this.fire("click",{})})})}else this.clearTimeout("repeat"),o||this.fire("click",{})}click(){this.dom.click()}_on_keydown(t){t.key=="Enter"&&(this.click(),t.preventDefault())}setText(t){P(this,yt).setContent(t),P(this,yt).setClass("empty",!t)}setIcon(t){this.query("#icon").setIcon(t)}};yt=new WeakMap,s(I,"Button"),I=u([p("x4")],I);var he=class extends C{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=[],o=s((r,n)=>{let i=r.indexOf(n);if(i>=0)return r.splice(i,1),!0},"hasOption");e==null||e.forEach(r=>{if(r==="-"||r===">>")r=new ne;else if(r=="~")r=new St("1em");else if(M(r)){let n,i=r,[l,...c]=i.split("."),h="";switch(l){case"ok":n=y.global.ok;break;case"cancel":n=y.global.cancel;break;case"abort":n=y.global.abort;break;case"no":n=y.global.no;break;case"yes":n=y.global.yes;break;case"retry":n=y.global.retry;break}r=new I({cls:h,id:l,label:n,click:s(()=>{this.fire("btnclick",{button:l})},"click")}),o(c,"default")&&r.addClass("default"),o(c,"autofocus")&&r.setAttribute("autofocus",!0),o(c,"disabled")&&r.enable(!1),r.addClass(c.join(" "))}t.push(r)}),super.setContent(t)}getButton(e){return this.query("#"+e)}};s(he,"BtnGroup"),he=u([p("x4")],he);var kt,_=class extends d{constructor(t){super({...t,content:null});ae(this,kt);this.setContent([new E({id:"icon",iconId:this.props.icon}),le(this,kt,new d({tag:"span",id:"text"}))]);let o=this.props.text;this.setText(o),t.labelFor&&this.setAttribute("for",t.labelFor)}setText(t){P(this,kt).setContent(t),P(this,kt).setClass("empty",!t)}setIcon(t){this.query("#icon").setIcon(t)}};kt=new WeakMap,s(_,"Label"),_=u([p("x4")],_);var H=class extends d{constructor(e){super({...e}),this.setContent(e.text),e.align&&this.addClass("al-"+e.align)}setText(e){this.setContent(e),this.setClass("empty",!e)}};s(H,"SimpleText"),H=u([p("x4")],H);var F=class extends d{_type;_ref;_delta;constructor(e,t){super({}),this._type=e,this.addClass(e),this.addDOMEvent("pointerdown",o=>{this.setCapture(o.pointerId),this._ref=t!=null?t:T(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.fire("start",{})}),this.addDOMEvent("pointerup",o=>{this.fire("stop",{}),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 i=this._ref.getBoundingRect();this.fire("resize",{size:n?i.width:i.height}),e.preventDefault(),e.stopPropagation()}};s(F,"CSizer"),F=u([p("x4")],F);var $=[],sr=[],Vt=[],Ct;function ao(){return document.body}s(ao,"getRoot");var z=class extends C{_isshown=!1;_ismodal=!1;constructor(e){super(e),this.props.sizable&&this._createSizers(),te(()=>{(this.props.movable===!0||this.props.sizable&&this.props.movable===void 0)&&(this.queryAll(".caption-element").forEach(o=>new Ht(o,this)),this.hasClass("popup-caption")&&new Ht(this,this))})}displayNear(e,t="top left",o="top left",r={x:0,y:0}){this.setStyle({left:"0px",top:"0px"}),this._do_show();let n=this.getBoundingRect(),i=e.left,l=e.top;o.indexOf("right")>=0?i=e.left+e.width:o.indexOf("center")>=0&&(i=e.left+e.width/2),o.indexOf("bottom")>=0?l=e.bottom:o.indexOf("middle")>=0&&(l=e.top+e.height/2),t.indexOf("right")>=0?i-=n.width:t.indexOf("center")>=0&&(i-=n.width/2),t.indexOf("bottom")>=0?l-=n.height:t.indexOf("middle")>=0&&(l-=n.height/2),r&&(i+=r.x,l+=r.y),i+=document.scrollingElement.scrollLeft,l+=document.scrollingElement.scrollTop,this.displayAt(i,l)}displayCenter(e=!0){this.setClass("center",e),this._do_show()}displayAt(e,t){this.setStyle({left:e+"px",top:t+"px"}),this._do_show();let o=this.getBoundingRect(),r=window.innerWidth-16,n=window.innerHeight-16;o.right>r&&this.setStyleValue("left",r-o.width),o.bottom>n&&this.setStyleValue("top",n-o.height)}isOpen(){return this._isshown}_do_hide(){if(!this._isshown)return;this.__hide(),this.__remove(),this._ismodal&&(Vt.pop(),this._hideModalMask());let e=sr.indexOf(this);if(console.assert(e>=0),sr.splice(e,1),this.props.autoClose){let t=$.indexOf(this);t>=0&&($.splice(t,1),$.length==0&&document.removeEventListener("pointerdown",this._dismiss))}this._isshown=!1,this.fire("closed",{})}_do_show(){this._isshown||(this._isshown=!0,this.__append(),this._ismodal&&(Vt.push(this),this._showModalMask()),this.__show(),this.props.autoClose&&($.length==0&&document.addEventListener("pointerdown",this._dismiss),$.push(this),this.setData("close",this.props.autoClose===!0?q():this.props.autoClose)),sr.push(this),this.fire("opened",{}))}__show(){super.show(!0)}__hide(){super.show(!1)}__append(){ao().appendChild(this.dom)}__remove(){ao().removeChild(this.dom)}show(e=!0){return e?this.displayCenter():this._do_hide(),this}close(){this._do_hide()}_dismiss=s(e=>{$.some(o=>o.dom.contains(e.target))||(e.preventDefault(),e.stopPropagation(),this.dismiss())},"_dismiss");dismiss(e=!1){if($.length==0)return;let t=this.getData("close"),o=[],r=[],n=-1;e&&(n=$.indexOf(this)),$.forEach((l,c)=>{l.getData("close")==t&&c>n?o.push(l):r.push(l)});let i=o.reverse();$=r,$.length==0&&document.removeEventListener("pointerdown",this._dismiss),i.forEach(l=>l.close())}_createSizers(){this.appendContent([new F("top"),new F("bottom"),new F("left"),new F("right"),new F("top-left"),new F("bottom-left"),new F("top-right"),new F("bottom-right")])}_showModalMask(){Ct||(Ct=new d({cls:"x4modal-mask"})),ao().insertBefore(Ct.dom,this.dom)}_hideModalMask(){if(Ct){let e=ao();if(Vt.length){let t=Vt[Vt.length-1];e.insertBefore(Ct.dom,t.dom)}else e.removeChild(Ct.dom)}}};s(z,"Popup"),z=u([p("x4")],z);var ar=class ar{ref;delta;self;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:T(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()}};s(ar,"CMover");var Ht=ar;var Rr=400,Oe=class extends d{constructor(){super({})}};s(Oe,"CMenuSep"),Oe=u([p("x4")],Oe);var lo=new De,ve=class extends d{menu;constructor(e){super({disabled:e.disabled,cls:e.cls}),e.menu&&this.addClass("popup"),this.setContent([new E({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",()=>{lo.setTimeout("open",Rr,()=>{this.dismiss(!0)})}),this.addDOMEvent("click",()=>{this.dismiss(!1),e.click&&e.click(new Event("click"))}))}dismiss(e){let t=this.parentElement(W);t&&t.dismiss(e)}openSub(e){let t=s(()=>{this.dismiss(!0);let o=this.getBoundingRect();this.menu.displayAt(o.right-4,o.top)},"open");e?lo.setTimeout("open",Rr,t):(lo.clearTimeout("open"),t())}closeSub(){lo.clearTimeout("open")}};s(ve,"CMenuItem"),ve=u([p("x4")],ve);var W=class extends z{constructor(e){var o;super({...e,autoClose:"menu"}),this.addClass("x4vbox");let t=(o=e.items)==null?void 0:o.map(r=>r==="-"?new Oe:M(r)?new ve({text:r,click:null,cls:"title"}):r instanceof d?r:new ve(r));this.setContent(t)}};s(W,"Menu"),W=u([p("x4")],W);var Fr='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 Br='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 zr='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 Ve=class extends k{m_date;constructor(e){super(e),this.mapPropEvents(e,"change"),this.m_date=e.date?Pe(e.date):new Date,this._update()}_update(){let e=Pe(this.m_date);e.setDate(1);let t=e.getDay();t==0&&(t=7),e.setDate(-t+1+1);let o=Pe(e),r=ge(this.m_date),n=ge(new Date),i=Pe(this.m_date);i.setDate(1),i.setMonth(i.getMonth()+1),i.setDate(0);let l=ge(i),c=[],h=new b({cls:"month-sel",content:[new _({cls:"month",text:j(this.m_date,"O"),dom_events:{click:s(()=>this._choose("month"),"click")}}),new _({cls:"year",text:j(this.m_date,"Y"),dom_events:{click:s(()=>this._choose("year"),"click")}}),new ne,new I({icon:Fr,click:s(()=>this._next(!1),"click")}),new I({icon:Br,click:s(()=>this.setDate(new Date),"click"),tooltip:y.global.today}),new I({icon:zr,click:s(()=>this._next(!0),"click")})]});c.push(h);let g=[];g.push(new b({cls:"weeknum cell"}));for(let x=0;x<7;x++)g.push(new _({cls:"cell",text:y.global.day_short[(x+1)%7]}));c.push(new b({cls:"week header",content:g}));let f=this.m_date.getMonth(),m=!0;for(;ge(o)<=l;){let x=[new b({cls:"weeknum cell",content:new d({tag:"span",content:j(o,"w")})})];for(let v=0;v<7;v++){let U="cell day";ge(o)==r&&(U+=" selection"),ge(o)==n&&(U+=" today"),o.getMonth()!=f&&(U+=" out");let w=s(S=>new b({cls:U,flex:1,content:new d({cls:"text",content:ft(`<span>${j(S,"d")}</span>`)}),dom_events:{click:s(()=>this.select(S),"click")}}),"mkItem");x.push(w(Pe(o))),o.setDate(o.getDate()+1),m=!1}c.push(new b({cls:"week",flex:1,content:x}))}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 n,i,l,c;let t=[];if(e=="month")for(let h=0;h<12;h++)t.push({text:y.global.month_long[h],click:s(()=>{this.m_date.setMonth(h),this._update()},"click")});else if(e=="year"){let h=(i=(n=this.props.minDate)==null?void 0:n.getFullYear())!=null?i:1900,g=(c=(l=this.props.maxDate)==null?void 0:l.getFullYear())!=null?c:2037;for(let f=g;f>=h;f--)t.push({text:""+f,click:s(()=>{this.m_date.setFullYear(f),this._update()},"click")})}let o=new W({items:t}),r=this.getBoundingRect();o.displayAt(r.left,r.top)}getDate(){return this.m_date}setDate(e){this.m_date=e,this._update()}};s(Ve,"Calendar"),Ve=u([p("x4")],Ve);function Or(a,e,t){let o=a;return o.width=e,o.height=t,o.smoothLine=Wn,o.smoothLineEx=jn,o.line=Yn,o.roundRect=Qn,o.calcTextSize=$n,o.setFontSize=Zn,o.circle=Xn,o}s(Or,"createPainter");function Wn(a,e=null,t=!0){if(a.length<2)return;if(e||(e=this),a.length==2){t!==!1?e.moveTo(a[0].x,a[0].y):e.lineTo(a[0].x,a[0].y),e.lineTo(a[1].x,a[1].y);return}function o(c,h){return{x:c.x+(h.x-c.x)/2,y:c.y+(h.y-c.y)/2}}s(o,"midPointBtw");function r(c,h,g,f,m,x,v){return{x:(1-c)*(1-c)*h+2*(1-c)*c*f+c*c*x,y:(1-c)*(1-c)*g+2*(1-c)*c*m+c*c*v}}s(r,"getQuadraticXY");let n=a[0],i=a[1],l=n;e.moveTo(n.x,n.y);for(let c=1,h=a.length;c<h;c++){let g=o(n,i);for(let f=0;f<8;f++){let{x:m,y:x}=r(f/8,l.x,l.y,n.x,n.y,g.x,g.y);e.lineTo(m,x)}n=a[c],i=a[c+1],l=g}e.lineTo(n.x,n.y)}s(Wn,"smoothLine");function jn(a,e=.5,t=10,o=null,r=!0,n=!1){let i=[];for(let w=0,S=a.length;w<S;w++)i.push(a[w].x),i.push(a[w].y);let l,c=1,h=i.length,g=0,f=(h-2)*t+2+(n?2*t:0),m=new Float32Array(f),x=new Float32Array((t+2)*4),v=4;for(l=i.slice(0),n?(l.unshift(i[h-1]),l.unshift(i[h-2]),l.push(i[0],i[1])):(l.unshift(i[1]),l.unshift(i[0]),l.push(i[h-2],i[h-1])),x[0]=1;c<t;c++){let w=c/t,S=w*w,J=S*w,B=J*2,L=S*3;x[v++]=B-L+1,x[v++]=L-B,x[v++]=J-2*S+w,x[v++]=J-S}x[v]=1,U(l,x,h),n&&(l=[],l.push(i[h-4],i[h-3],i[h-2],i[h-1]),l.push(i[0],i[1],i[2],i[3]),U(l,x,4));function U(w,S,J){for(let B=2,L;B<J;B+=2){let fe=w[B],pt=w[B+1],R=w[B+2],qt=w[B+3],ee=(R-w[B-2])*e,mr=(qt-w[B-1])*e,sn=(w[B+4]-fe)*e,an=(w[B+5]-pt)*e;for(L=0;L<t;L++){let Kt=L<<2,fr=S[Kt],gr=S[Kt+1],xr=S[Kt+2],br=S[Kt+3];m[g++]=fr*fe+gr*R+xr*ee+br*sn,m[g++]=fr*pt+gr*qt+xr*mr+br*an}}}s(U,"parse"),h=n?0:i.length-2,m[g++]=i[h],m[g]=i[h+1],o||(o=this);for(let w=0,S=m.length;w<S;w+=2)w==0&&r!==!1?o.moveTo(m[w],m[w+1]):o.lineTo(m[w],m[w+1])}s(jn,"smoothLineEx");function Yn(a,e,t,o,r,n=1){this.save(),this.beginPath(),this.moveTo(a,e),this.lineTo(t,o),this.lineWidth=n,this.strokeStyle=r,this.stroke(),this.restore()}s(Yn,"line");function Qn(a,e,t,o,r){this.moveTo(a+r,e),this.lineTo(a+t-r,e),this.quadraticCurveTo(a+t,e,a+t,e+r),this.lineTo(a+t,e+o-r),this.quadraticCurveTo(a+t,e+o,a+t-r,e+o),this.lineTo(a+r,e+o),this.quadraticCurveTo(a,e+o,a,e+o-r),this.lineTo(a,e+r),this.quadraticCurveTo(a,e,a+r,e),this.closePath()}s(Qn,"roundRect");function $n(a,e=!1){let t=this.measureText(a),o=t.fontBoundingBoxAscent+t.fontBoundingBoxDescent;return e?{width:Math.round(t.width),height:Math.round(o)}:{width:t.width,height:o}}s($n,"calcTextSize");function Zn(a){let e=Math.round(a)+"px";this.font=this.font.replace(/\d+px/,e)}s(Zn,"setFontSize");function Xn(a,e,t){this.moveTo(a+t,e),this.arc(a,e,t,0,Math.PI*2)}s(Xn,"circle");var He=class extends d{m_iwidth=-1;m_iheight=-1;m_scale=1;m_canvas;constructor(e){super(e),this.mapPropEvents(e,"paint"),this.addDOMEvent("resized",()=>{this._paint()}),this.m_iwidth=-1,this.m_iheight=-1,this.m_canvas=new d({tag:"canvas"}),this.setContent(this.m_canvas)}scale(e){this.m_scale=e,this.m_iwidth=-1,this.redraw()}get canvas(){return this.m_canvas}getContext(){return this.m_canvas.dom.getContext("2d")}$update_rep=0;redraw(e){e!==void 0?++this.$update_rep>=20?(this.clearTimeout("update"),this._paint()):this.setTimeout("update",e,()=>this._paint()):(this.clearTimeout("update"),this._paint())}_paint(){this.$update_rep=0;let e=this.dom;if(!this.isVisible())return;let t=e.clientWidth,o=e.clientHeight,r=this.getContext();if(t!=this.m_iwidth||o!=this.m_iheight){let n=window.devicePixelRatio||1,i=r.webkitBackingStorePixelRatio||r.mozBackingStorePixelRatio||r.msBackingStorePixelRatio||r.oBackingStorePixelRatio||r.backingStorePixelRatio||1,l=this.canvas;if(this.m_scale!=1){let c=1,h=t*c,g=o*c;l.setAttribute("width",""+h),l.setAttribute("height",""+g),l.setStyleValue("width",t),l.setStyleValue("height",o),c*=this.m_scale,r.scale(c,c)}else l.setAttribute("width",""+t),l.setAttribute("height",""+o),l.setStyleValue("width",t),l.setStyleValue("height",o),r.scale(1,1);this.m_iwidth=t,this.m_iheight=o}if(t&&o){let n=Or(r,t,o);this.props.clear&&n.clearRect(0,0,t/this.m_scale,o/this.m_scale),n.save(),n.translate(-.5,-.5),this.paint(n),n.restore()}}paint(e){try{this.fire("paint",{ctx:e})}catch(t){console.assert(!1,t)}}};s(He,"Canvas"),He=u([p("x4")],He);var A=class extends d{constructor(e){var t;switch(super({tag:"input",...e}),this.mapPropEvents(e,"focus","change"),this.setAttribute("type",(t=e.type)!=null?t:"text"),this.setAttribute("name",e.name),e.autofocus===!0&&this.setAttribute("autofocus",!0),e.type){case"checkbox":case"radio":{let o=this.dom;o.checked=e.checked,o.value=e.value===void 0?"":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":{let o=this.props;this.setAttribute("required",o.required),this.setAttribute("readonly",o.readonly),this.setAttribute("min",o.min),this.setAttribute("max",o.max),this.setAttribute("step",o.step),this.setNumValue(M(o.value)?parseFloat(o.value):o.value,-2),this.addDOMEvent("wheel",r=>{if(this.hasFocus()){r.preventDefault();let n=this.getNumValue(),i=r.deltaY<0?1:-1;n+=(o.step?o.step:1)*i,this.setNumValue(n,-2),this.dom.dispatchEvent(new Event("input"))}});break}case"date":{this.setAttribute("required",e.required);let o=e.value;o instanceof Date?this.setAttribute("value",j(o,"Y-M-D")):e.value!==null&&e.value!==void 0&&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}case"time":{this.setAttribute("required",e.required),e.value!==null&&e.value!==void 0&&this.setAttribute("value",e.value);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),e.minlength!==void 0&&this.setAttribute("minlength",e.minlength),e.maxlength!==void 0&&this.setAttribute("maxlength",e.maxlength);break}}this.addDOMEvent("blur",o=>{this.on_focus(o,!0)}),this.addDOMEvent("focus",o=>{this.on_focus(o,!1)}),this.addDOMEvent("input",o=>{this.on_change(o)})}on_focus(e,t){let o={focus_out:t};this.fire("focus",o),o.defaultPrevented&&e.preventDefault()}on_change(e){let t={value:this.getValue()};this.fire("change",t),t.defaultPrevented&&e.preventDefault()}getValue(){return this.dom.value}setValue(e){this.dom.value=e+""}getNumValue(e){let t=parseFloat(this.getValue());return isNaN(t)&&e!==void 0?e:t}setNumValue(e,t=-1){var o;if(t==-2&&this.props.type=="number"){let r=this.props;if(r.step<1){let n=-Math.floor(Math.log10((o=r.step)!=null?o:1));return this.setValue(e.toFixed(n))}else if(r.step>1)return this.setValue(e.toFixed())}else if(t>=0)return this.setValue(e.toFixed(t));this.setValue(e+"")}getCheck(){return this.dom.checked}setCheck(e){let t=this.dom;t.checked=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}}isValid(){return!(this.props.required&&this.getValue()==="")}queryInterface(e){return e=="form-element"?{getRawValue:s(()=>this.getValue(),"getRawValue"),setRawValue:s(o=>{this.setValue(o)},"setRawValue"),isValid:s(()=>this.isValid(),"isValid")}:super.queryInterface(e)}};s(A,"Input"),A=u([p("x4")],A);var co='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 Ne=class extends d{_input;constructor(e){super(e);let t=q();this.mapPropEvents(e,"change"),this.setContent([new d({cls:"inner",content:[this._input=new A({type:"checkbox",id:t,name:e.name,checked:e.checked,dom_events:{change:s(()=>this._on_change(),"change")}})]}),new _({tag:"label",text:e.label,labelFor:t,id:void 0})]),wt.load(co).then(o=>{this.query(".inner").dom.insertAdjacentHTML("beforeend",o)}),this.addDOMEvent("click",o=>this._on_click(o))}_on_click(e){e.target==this.dom&&(this._input.dom.click(),e.preventDefault(),e.stopPropagation())}_on_change(){this.fire("change",{value:this.getCheck()})}getCheck(){return this._input.getCheck()}setCheck(e){this._input.setCheck(e)}setLabel(e){this.query("label").setText(e)}toggle(){this.setCheck(!this.getCheck())}};s(Ne,"Checkbox"),Ne=u([p("x4")],Ne);var Vr='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 _e=class extends b{constructor(e){super(e);let t,o;this.setContent([t=new d({cls:"swatch"}),o=new A({type:"text",value:"",spellcheck:!1}),It("eyedropper")?new I({icon:Vr,click:s(()=>{new window.EyeDropper().open().then(l=>{n=new N(l.sRGBHex),r(n)})},"click")}):null]),o.addDOMEvent("input",()=>{let i=o.getValue(),l=new N(i);l.isInvalid()||(n=l,r(n))});let r=s(i=>{t.setStyleValue("backgroundColor",i.toRgbString(!1)),o.setValue(i.toRgbString(!1))},"updateColor"),n;e.color instanceof N?n=e.color:n=new N(e.color),r(n)}};s(_e,"ColorInput"),O(_e,"$cls-ns","x4"),_e=u([p("x4")],_e);var we=class extends C{mdown=!1;irect;hsv={hue:1,saturation:1,value:1,alpha:1};color;thumb;constructor(e,t){super(e),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:s(o=>this.mousedown(o),"pointerdown"),pointermove:s(o=>this.mousemove(o),"pointermove"),pointerup:s(o=>this.mouseup(o),"pointerup"),created:s(()=>this.updateThumbMarker(),"created")}),this.updateBaseColor(t)}mousedown(e){this.mdown=!0,this.irect=this.getBoundingRect(),this.setCapture(e.pointerId)}mousemove(e){if(this.mdown){let t=this.irect,r=G(e.clientX-t.left,0,t.width)/t.width,i=G(e.clientY-t.top,0,t.height)/t.height;this.hsv.saturation=r,this.hsv.value=1-i,this.updateThumbMarker(),this.fire("sat_change",{saturation:this.hsv.saturation,value:this.hsv.value})}}mouseup(e){this.mdown&&(this.releaseCapture(e.pointerId),this.mdown=!1)}updateThumbMarker(){let e=this.color.getBoundingRect();this.thumb.setStyle({left:this.hsv.saturation*e.width+"px",bottom:this.hsv.value*e.height+"px"})}updateBaseColor(e){let t=new N(0,0,0);t.setHsv(e.hue,1,1,1),this.color.setStyleValue("backgroundColor",t.toRgbString(!1))}move(e,t){switch(e){case"saturation":{this.hsv.saturation+=t,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+=t,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}}}};s(we,"Saturation"),we=u([p("x4")],we);var Ue=class extends C{thumb;hsv={hue:1,saturation:1,value:1,alpha:1};mdown=!1;irect;constructor(e,t){super(e),this.setContent([this.thumb=new d({cls:"thumb",left:"50%"})]),this.setDOMEvents({pointerdown:s(o=>this.mousedown(o),"pointerdown"),pointermove:s(o=>this.mousemove(o),"pointermove"),pointerup:s(o=>this.mouseup(o),"pointerup")}),this.updateHue(t)}mousedown(e){this.mdown=!0,this.irect=this.getBoundingRect(),this.setCapture(e.pointerId)}mousemove(e){if(this.mdown){let t=this.irect,r=G(e.clientX-t.left,0,t.width)/t.width;this.hsv.hue=r,this.updateHue(this.hsv),this.fire("hue_change",{hue:this.hsv.hue})}}mouseup(e){this.mdown&&(this.releaseCapture(e.pointerId),this.mdown=!1)}updateHue(e){this.hsv.hue=e.hue,this.thumb.setStyleValue("left",e.hue*100+"%")}move(e){this.hsv.hue+=e,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)}};s(Ue,"HueSlider"),Ue=u([p("x4")],Ue);var qe=class extends C{thumb;color;hsv={hue:1,saturation:1,value:1,alpha:1};mdown=!1;irect;constructor(e,t){super(e),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:s(o=>this._on_mousedown(o),"pointerdown"),pointermove:s(o=>this._on_mousemove(o),"pointermove"),pointerup:s(o=>this._on_mouseup(o),"pointerup")}),this.updateAlpha(),this.updateBaseColor(t)}_on_mousedown(e){this.mdown=!0,this.irect=this.getBoundingRect(),this.setCapture(e.pointerId)}_on_mousemove(e){if(this.mdown){let t=this.irect,r=G(e.clientX-t.left,0,t.width)/t.width;this.hsv.alpha=r,this.updateAlpha(),this.fire("alpha_change",{alpha:this.hsv.alpha})}}_on_mouseup(e){this.mdown&&(this.releaseCapture(e.pointerId),this.mdown=!1)}updateAlpha(){this.thumb.setStyleValue("left",this.hsv.alpha*100+"%")}updateBaseColor(e){let t=new N(0,0,0);t.setHsv(e.hue,e.saturation,e.value,1),this.color.setStyleValue("backgroundImage",`linear-gradient(90deg, transparent, ${t.toRgbString(!1)})`)}setColor(e){this.hsv=e,this.updateBaseColor(e),this.updateAlpha()}move(e){this.hsv.alpha+=e,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()}};s(qe,"AlphaSlider"),qe=u([p("x4")],qe);var Ke=class extends k{_base;_sat;_swatch;_hue;_alpha;constructor(e){super(e),e.color instanceof N?this._base=e.color:this._base=new N(e.color);let t=this._base.toHsv();this.setAttribute("tabindex",0),this.setContent([this._sat=new we({},t),new b({cls:"body",content:[new k({cls:"x4flex",content:[this._hue=new Ue({},t),this._alpha=new qe({},t)]}),new C({cls:"swatch",content:[new d({cls:"overlay checkers"}),this._swatch=new d({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=s(()=>{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");It("eyedropper")&&this._swatch.addDOMEvent("click",r=>{new window.EyeDropper().open().then(i=>{t=new N(i.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}}}};s(Ke,"ColorPicker"),Ke=u([p("x4")],Ke);var se=class extends d{constructor(e){super(e)}};s(se,"Viewport"),se=u([p("x4")],se);var Z=class extends d{constructor(e){super(e),this.setContent(new se({}))}getViewport(){return this.firstChild()}};s(Z,"ScrollView"),Z=u([p("x4")],Z);var pe=class extends d{_view;_lastsel;_multisel;_items;preventFocus=!1;constructor(e){super({...e}),this.setAttribute("tabindex",0),this.mapPropEvents(e,"dblClick","selectionChange","contextMenu");let t=new Z({cls:"body"});this._view=t.getViewport(),this._multisel=new Set,this._items=[],e.footer&&e.footer.setAttribute("id","footer"),this.setContent([t,e.footer]),this.setDOMEvents({click:s(o=>this._on_click(o),"click"),keydown:s(o=>this._on_key(o),"keydown"),dblclick:s(o=>this._on_click(o),"dblclick"),contextmenu:s(o=>this._on_ctx_menu(o),"contextmenu")}),e.items&&this.setItems(e.items)}_on_key(e){if(!this.isDisabled()){switch(e.key){case"ArrowDown":{this.navigate(4);break}case"ArrowUp":{this.navigate(1);break}case"Home":{this.navigate(0);break}case"End":{this.navigate(5);break}default:return}e.preventDefault(),e.stopPropagation()}}navigate(e){this._lastsel||(e==4?e=0:e=5);let t=s((o,r)=>{for(;o&&!o.isVisible();)o=r?o.nextElement():o.prevElement();return o},"next_visible");if(e==0||e==5){let o=e==0?this._view.firstChild():this._view.lastChild();if(o=t(o,e==0),o){let r=o.getInternalData("id");return this._selectItem(r,o,"single"),!0}}else{let o=this._itemWithID(this._lastsel),r=e==4?o.nextElement():o.prevElement();if(r=t(r,e==4),r){let n=r.getInternalData("id");return this._selectItem(n,r,"single"),!0}}return!1}_itemWithID(e){return this._view.enumChildComponents(!1).find(o=>o.getInternalData("id")===e)}_on_click(e){let t=e.target;for(;t&&t!=this.dom;){let o=T(t);if(o.dom.tagName==="INPUT")return;if(o&&o.hasClass("x4item")){let r=o.getInternalData("id"),n={context:r};e.type=="click"?this.fire("click",n):this.fire("dblClick",n),n.defaultPrevented||this._selectItem(r,o,e.ctrlKey?"toggle":"single");return}t=t.parentElement}this.clearSelection(),e.stopImmediatePropagation(),e.preventDefault()}_on_ctx_menu(e){e.preventDefault();let t=e.target;for(;t&&t!=this.dom;){let o=T(t);if(o&&o.hasClass("x4item")){let r=o.getInternalData("id");this._selectItem(r,o,"single"),this.fire("contextMenu",{uievent:e,context:r});return}t=t.parentElement}this.fire("contextMenu",{uievent:e,context:null})}_selectItem(e,t,o){if(this.props.multisel||(o="single"),this._lastsel=e,o=="single"){if(this._multisel.has(e))return;this._clearSelection(),t&&(this._multisel.add(e),t.addClass("selected"))}else t&&(this._multisel.has(e)?(t.removeClass("selected"),this._multisel.delete(e)):(this._multisel.add(e),t.addClass("selected")));t&&t.scrollIntoView({behavior:"smooth",block:"nearest"}),this.fire("selectionChange",{selection:this.getSelection(),empty:this._multisel.size==0})}getItem(e){return this._items.find(t=>t.id===e)}select(e,t=!0){if(Y(e)||(e=[e]),!e.length){this._multisel.size&&this.clearSelection();return}if(e.some(o=>!this._multisel.has(o))){this._clearSelection();let o=this._view.enumChildComponents(!1);e.forEach(r=>{let n=o.find(i=>i.getInternalData("id")===r);n&&(this._multisel.add(r),n.addClass("selected"))}),this.fire("selectionChange",{selection:this.getSelection(),empty:this._multisel.size==0})}}_findItemIndex(e){return this._items.findIndex(t=>t.id==e)}_clearSelection(){let e=this._view.enumChildComponents(!1);this._multisel.size&&Array.from(this._multisel).forEach(o=>{let r=e.find(n=>n.getInternalData("id")===o);r&&r.removeClass("selected")}),this._multisel.clear()}clearSelection(){this._multisel.size&&(this._clearSelection(),this.fire("selectionChange",{selection:[],empty:!0}))}setItems(e,t=!1){let o=this.getSelection();if(this.clearSelection(),this._view.clearContent(),this._items=e,e){let r=e.map(n=>this.renderItem(n));this._view.setContent(r),t&&this.select(o)}}renderItem(e){var r;let o=((r=this.props.renderer)!=null?r:this.defaultRenderer)(e);return o.addClass("x4item"),o.setInternalData("id",e.id),o}defaultRenderer(e){return new b({cls:e.cls,content:new _({icon:e.iconId,text:e.text})})}filter(e){let t=this._view.enumChildComponents(!1);if(!e)t.forEach(o=>o.show(!0));else{let o=this._items.filter(r=>r.text.includes(e)).map(r=>r.id+"");t.forEach(r=>{r.show(o.includes(r.getInternalData("id")))})}}appendItem(e,t=!1,o=!0){o&&this._clearSelection();let r=this.renderItem(e);t?(this._items.unshift(e),this._view.prependContent(r)):(this._items.push(e),this._view.appendContent(r)),o&&this._selectItem(e.id,r,"single")}updateItem(e,t){let o=this._findItemIndex(e);if(o<0)return;let r=!1;this._multisel.has(e)&&(r=!0),this._items[o]=t;let n=this._itemWithID(t.id);if(n!=null&&n.dom){let i=this.renderItem(t);r&&i.addClass("selected"),this._view.dom.replaceChild(i.dom,n.dom)}}getSelection(){return Array.from(this._multisel)}};s(pe,"Listbox"),pe=u([p("x4")],pe);var Hr='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 ye=class extends z{_list;constructor(e,t){super(e),this._list=new pe({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}};s(ye,"DropdownList"),ye=u([p("x4")],ye);var Ge=class extends d{_popup;_input;_button;_prevent_close=!1;_edit;constructor(e){super(e);let t=q();this.mapPropEvents(e,"selectionChange");let o=e.readonly!==!1;this.setContent([new b({id:"label",content:new _({tag:"label",text:e.label,labelFor:t,width:e.labelWidth})}),this._edit=new b({id:"edit",content:[this._input=new A({id:t,type:"text",value:"",readonly:o,required:e.required}),this._button=new I({icon:Hr,tabindex:-1})]})]),e.name&&this.setAttribute("name",e.name),e.required&&this.setAttribute("required",!0),this._popup=new ye({items:e.items});let r=this._popup.getList(),n=s(i=>{let l=r.getItem(i);this._input.setValue(l?l.text:""),this._prevent_close||this._popup.show(!1)},"_select");this._popup.on("selectionChange",i=>{let[l]=i.selection;l!==void 0&&(n(l),this.fire("selectionChange",i))}),e.value&&n(e.value),this._button.addDOMEvent("click",()=>this._on_click()),this._input.addDOMEvent("input",()=>this._on_input()),this._input.addDOMEvent("keydown",i=>this._on_key(i)),this.setDOMEvents({focusout:s(()=>this._on_focusout(),"focusout"),click:s(()=>this._on_click(),"click")})}_on_key(e){switch(e.key){case"Enter":case"Escape":{this._popup.show(!1);break}case"ArrowUp":this._prevent_close=!0,this._popup.isOpen()?this._popup.getList().navigate(1):this.showDropDown(),this._prevent_close=!1;break;case"ArrowDown":this._prevent_close=!0,this._popup.isOpen()?this._popup.getList().navigate(4):this.showDropDown(),this._prevent_close=!1;break;default:return}e.preventDefault(),e.stopPropagation()}_on_input(){this._popup.isOpen()||this.showDropDown(),this._popup.getList().filter(this._input.getValue())}_on_focusout(){this._popup.show(!1)}_on_click(){this.showDropDown()}showDropDown(){if(this.isDisabled())return;let e=this._edit.getBoundingRect();this._popup.setStyleValue("minWidth",e.width+"px"),this._popup.displayNear(e,"top left","bottom left",{x:0,y:6})}setItems(e){this._getList().setItems(e)}getValue(){return this._input.getValue()}setValue(e){this._input.setValue(e)}selectItem(e){this._getList().select(e)}getSelection(){let[e]=this._getList().getSelection();return e}_getList(){return this._popup.getList()}queryInterface(e){return e=="form-element"?{getRawValue:s(()=>this.getSelection(),"getRawValue"),setRawValue:s(o=>{this.selectItem(o)},"setRawValue"),isValid:s(()=>this._input.isValid(),"isValid")}:super.queryInterface(e)}};s(Ge,"Combobox"),Ge=u([p("x4")],Ge);var K=class extends C{validator;constructor(e){super({tag:"form",...e}),e.flex===!1&&this.addClass("no-flex"),e.autoComplete!==void 0&&this.setAutoComplete(e.autoComplete)}_get_inputs(){return this.queryAll("[name]")}setValues(e){this._get_inputs().forEach(o=>{let r=o.queryInterface("form-element");if(r){let n=o.getAttribute("name");Object.prototype.hasOwnProperty.call(e,n)&&r.setRawValue(e[n])}})}getValues(){let e={};return this._get_inputs().forEach(o=>{let r=o.queryInterface("form-element");if(r){let n=o.getAttribute("name");e[n]=r.getRawValue()}}),e}setAutoComplete(e=!0){this._get_inputs().forEach(o=>{o.setAttribute("autocomplete",e?"on":"off")})}setValidator(e){this.validator||(this.validator=e,this.addDOMEvent("focusout",()=>this.validate()))}validate(){let e=this._get_inputs(),t={},o=!0;for(let r of e){let n=r.queryInterface("form-element");if(n){let i=r.getAttribute("name");t[i]=n.getRawValue(),n.isValid()||(o=!1)}}if(this.validator){let r={...t};if(!this.validator(r,o))return null;for(let n in t)r[n]!=t[n]&&this.query(`input[${n}"]`).queryInterface("form-element").setRawValue(r[n]);t=r}else o||(t=null);return t}};s(K,"Form"),K=u([p("x4")],K);var Nr='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 X=class extends z{form;_title;constructor(e){super({tag:"dialog",modal:!0,...e}),this._ismodal=this.props.modal,this.mapPropEvents(e,"btnclick"),this.appendContent([new b({cls:"caption",content:[this._title=new _({id:"title",cls:"caption-element",icon:e.icon,text:e.title}),e.closable?new I({id:"closebox",icon:Nr,tabindex:-1,click:s(()=>{M(e.closable)?this.fire("btnclick",{button:e.closable}):this.close()},"click")}):null]}),this.form=e.form?e.form:new K({}),new he({id:"btnbar",reverse:!0,items:e.buttons,btnclick:s(t=>{this.fire("btnclick",t)},"btnclick")})]),this.addDOMEvent("keydown",t=>{if(t.key=="Escape")t.preventDefault(),t.stopPropagation();else if(t.key=="Enter"){let o=this.query("button.default");o&&(t.preventDefault(),t.stopPropagation(),o.click())}})}focusNext(e){let t=Mt(this.dom);if(t.length){let o=t[0],r=t[t.length-1],n=document.activeElement,i;if(!e&&n===o)i=r;else if(e&&n===r)i=o;else{let l=t.indexOf(n);e?i=t[l+1]:i=t[l-1]}return i?(i.focus(),!0):!1}else return!1}setContent(e){this.dom.replaceChild(this.form.dom,e.dom),this.form=e}getForm(){return this.form}getValues(){return this.form.getValues()}getButton(e){return this.getBtnBar().getButton(e)}queryInterface(e){return e=="tab-handler"?{focusNext:s(o=>this.focusNext(o),"focusNext")}:super.queryInterface(e)}setTitle(e){this._title.setText(e)}getBtnBar(){return this.query("#btnbar")}};s(X,"Dialog"),X=u([p("x4")],X);var Ur='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><!--!Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M144 480C64.5 480 0 415.5 0 336c0-62.8 40.2-116.2 96.2-135.9c-.1-2.7-.2-5.4-.2-8.1c0-88.4 71.6-160 160-160c59.3 0 111 32.2 138.7 80.2C409.9 102 428.3 96 448 96c53 0 96 43 96 96c0 12.2-2.3 23.8-6.4 34.6C596 238.4 640 290.1 640 352c0 70.7-57.3 128-128 128l-368 0zm79-217c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l39-39L296 392c0 13.3 10.7 24 24 24s24-10.7 24-24l0-134.1 39 39c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-80-80c-9.4-9.4-24.6-9.4-33.9 0l-80 80z"/></svg>';var lr=class lr extends d{constructor(e){var t;super({tag:"input",style:{display:"none"},attrs:{type:"file",multiple:(t=e.multiple)!=null?t:!1,accept:e.accept},dom_events:{change:s(()=>{let o=this.dom.files;e.callback(o)},"change")}})}showDialog(){this.dom.click()}};s(lr,"FileDialog");var Et=lr,We=class extends k{constructor(e){var o,r;super(e),this.mapPropEvents(e,"change");let t=new Et({accept:e.accept,multiple:e.multiple,callback:s(n=>{this.fire("change",{files:n})},"callback")});this.setContent([t,new E({iconId:(o=e.icon)!=null?o:Ur}),new H({text:(r=e.label)!=null?r:y.global.filedrop})]),this.setAttribute("tabIndex",0),this.addDOMEvent("click",()=>t.showDialog()),this.addDOMEvent("keydown",n=>{n.key==" "&&t.showDialog()}),Bt.registerDropTarget(this,async(n,i,l)=>{if(n=="enter")this.addClass("hit");else if(n=="leave")this.removeClass("hit");else if(n=="drop"&&l.data.files&&l.data.files.length>0){let c=l.data.files;this.fire("change",{files:c})}})}};s(We,"FileDrop"),We=u([p("x4")],We);var ue=class extends d{_img;constructor(e){var t;if(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),e.candrop){this.mapPropEvents(e,"change","clear");let o=new Et({accept:e.accept,multiple:!1,callback:s(n=>{this.fire("change",{files:n})},"callback")});this.appendContent(o),this.addDOMEvent("click",()=>o.showDialog());let r=s((n,i)=>{var l;if((l=i.items)!=null&&l.length){let c=i.items[0].type;if(/image\/.*/.test(c))return!0}return!1},"filterInput");Bt.registerDropTarget(this,async(n,i,l)=>{if(n=="enter")this.addClass("hit");else if(n=="leave")this.removeClass("hit");else if(n=="drop"&&l.data.files&&l.data.files.length>0){let c=l.data.files;this.fire("change",{files:c})}},r),this.addDOMEvent("contextmenu",n=>{new W({items:[{text:y.global.cut,click:s(()=>{this.fire("clear",{})},"click")}]}).displayAt(n.pageX,n.pageY),n.stopPropagation(),n.preventDefault()})}}setImage(e){e?this._img.setAttribute("src",e):this.clear()}setBase64(e,t){this.setImage("data:"+e+";base64,"+t)}clear(){this._img.setAttribute("src","data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==")}};s(ue,"Image"),ue=u([p("x4")],ue);var Nt=200,je=class extends d{_dataview;_datamodel;_columns;_lock;_dirty;_row_height;_left;_top;_body;_viewport;_fheader;_hheader;_vheader;_ffooter;_footer;_vis_rows;_start;_end;_selection;_num_fmt=new Intl.NumberFormat("fr-FR");_mny_fmt=new Intl.NumberFormat("fr-FR",{style:"currency",currency:"EUR"});_dte_fmt=new Intl.DateTimeFormat("fr-FR",{});_has_fixed;_has_footer;constructor(e){super(e),this._lock=0,this._dirty=0,this._row_height=32,this._left=0,this._top=0,this._vis_rows=new Map,this._selection=new Set,this._has_fixed=!1,this._has_footer=e.footer,this._columns=e.columns.map(t=>t),this.mapPropEvents(e,"click","dblClick","contextMenu","selectionChange"),this.lock(!0),this.setAttribute("tabindex",0),this.addDOMEvent("created",()=>{this._init(),this._dirty=1,this.lock(!1)}),this.addDOMEvent("resized",()=>{this._updateFlexs(),this._computeFullSize(),this._update(!0)}),this.addDOMEvent("keydown",t=>{this._on_key(t)}),e.store&&this.setStore(e.store)}_on_key(e){if(!this.isDisabled()){switch(e.key){case"ArrowDown":{this.navigate(4);break}case"ArrowUp":{this.navigate(1);break}case"Home":{this.navigate(0);break}case"End":{this.navigate(5);break}case"PageDown":{this.navigate(2);break}case"PageUp":{this.navigate(3);break}default:return}e.preventDefault(),e.stopPropagation()}}navigate(e){if(this._selection.size||(e==4||e==2?e=0:e=5),e==0||e==5){let t=e==0?0:this._dataview.getCount()-1;return this._clearSelection(),this._addSelection(t),this._scrollToIndex(t),!0}else if(e==1||e==4){let t=this._selection.values().next().value,o=e==4?t+1:t-1;if(o>=0&&o<this._dataview.getCount())return this._clearSelection(),this._addSelection(o),this._scrollToIndex(o),!0}else if(e==2||e==3){let t=this._vis_rows.size,o=this._selection.values().next().value,r=e==2?t:-t,n=o+r;if(n<0?n=0:n>=this._dataview.getCount()&&(n=this._dataview.getCount()-1),n!=o)return this._clearSelection(),this._addSelection(n),this._dataview.getCount()<Nt&&(r*=this._row_height),this._viewport.dom.scrollBy(0,r),!0}return!1}_scrollToIndex(e,t="nearest"){let o=this.queryAll(`.row[data-row="${e}"]`);if(o.length)o.forEach(r=>{r.scrollIntoView({block:t})});else{let r=e;this._dataview.getCount()<Nt&&(r*=this._row_height),this._viewport.dom.scrollTo(0,r)}}setStore(e){let t=s(o=>{this._viewport&&(o.change_type=="change"&&this._selection.clear(),this._updateFlexs(),this._computeFullSize(),this._update(!0))},"on_change");this._dataview&&this._dataview.off("view_change",t),e?(this._dataview=new xt({store:e}),this._datamodel=e.getModel(),this._dataview.on("view_change",t)):(this._dataview=null,this._datamodel=null)}getView(){return this._dataview}lock(e){e?this._lock++:--this._lock==0&&this._dirty&&this._update(!0)}_getColCount(){return this._columns.length}_getCol(e){return this._columns[e]}_buildColHeader(e){var n;let t=[],o=this._getColCount();for(let i=0;i<o;i++){let l=this._getCol(i);if(!!l.fixed!=e)continue;let c=new F("right");c.on("stop",()=>{this._updateFlexs()}),c.on("resize",g=>{l.width=g.size,l.flex=0,this.queryAll(`[data-col="${i}"]`).forEach(x=>{x.setStyleValue("width",g.size+"px")});let m=r.getBoundingRect();e?this.setStyleVariable("--fixed-width",m.width+"px"):this._body.setStyleValue("width",m.width+"px")});let h=new d({cls:"cell",attrs:{"data-col":i},style:{width:l.width?l.width+"px":void 0},content:[new H({text:l.title,align:(n=l.header_align)!=null?n:"left"}),new d({cls:"sorter"}),c]});h.addDOMEvent("touchend",()=>{let g=h.getInternalData("touchend"),f=Date.now(),m=g?f-g:0;m>30&&m<300?this._sortCol(i):h.setInternalData("touchend",f)}),h.addDOMEvent("dblclick",()=>{this._sortCol(i)}),t.push(h)}if(e&&t.length==0)return null;let r=new C({cls:"col-header",content:t});return r.setClass("fixed",e),r}_buildColFooter(e){let t=[],o=this._getColCount();for(let n=0;n<o;n++){let i=this._getCol(n);if(!!i.fixed!=e)continue;let l=new d({cls:"cell",attrs:{"data-col":n},style:{width:i.width?i.width+"px":void 0},content:[new H({text:i.footer_val})]});l.addDOMEvent("dblclick",()=>{this._sortCol(n)}),t.push(l)}if(e&&t.length==0)return null;let r=new C({cls:"col-footer",content:t});return r.setClass("fixed",e),r}_sortCol(e,t){Yt(!0),this.setTimeout("sort",50,()=>{let o=!0,r=this.query(`.col-header [data-col="${e}"`);t===void 0?r.hasClass("sorted")?r.hasClass("desc")?o=!0:o=!1:this.queryAll(".sorted").forEach(c=>c.removeClass("sorted asc desc")):o=t,r.setClass("sorted"),r.setClass("desc",!o);let n=this._getCol(e),i=!1;switch(n.type){case"checkbox":case"money":case"number":case"percent":i=!0}this._dataview.sort([{field:n.id,ascending:o,numeric:i}]),this._update(!0),Yt(!1)})}sortCol(e,t){let o=this._columns.findIndex(r=>r.id===e);o>=0&&this._sortCol(o,t)}_renderCell(e,t,o){let r=t.id,n=t.type,i=this._datamodel.getRaw(r,e);if(i==null)return null;let l="";if(t.classifier&&o.push(t.classifier(i,e,r)),i instanceof Function)return i(e,r);if(t.formatter)return t.formatter(i);switch(n){case"checkbox":return i?new E({cls:"cell-check"+l,iconId:co}):void 0;case"image":return M(i)?new ue({cls:l,src:i,fit:"scale-down"}):void 0;case"number":{if(!V(i))return"NaN";i=this._num_fmt.format(i);break}case"money":{if(!V(i))return"NaN";i=this._mny_fmt.format(i);break}case"percent":return new C({cls:"percent"+l,content:new d({cls:"bar",width:i+"%"})});case"icon":return new E({cls:l,iconId:i+""});case"date":{i=this._dte_fmt.format(i);break}default:{i=i+"";break}}return new d({tag:"span",cls:l,content:i})}_buildRow(e,t,o){let r=[],n=this._getColCount();for(let l=0;l<n;l++){let c=this._getCol(l);if(c.fixed)continue;let h=[],g=this._renderCell(t,c,h),f="start";switch(c.align){default:f="start";break;case"center":f="center";break;case"right":f="end";break}let m=new d({cls:"cell",style:{width:c!=null&&c.width?c.width+"px":void 0,justifyContent:f},content:g});h.length&&m.addClass(h.join(" ")),c.type&&m.addClass(c.type),m.setData("col",l+""),m.setData("row",e+""),r.push(m)}let i=new C({cls:"row",style:{top:o.toFixed(2)+"px"},content:r});return i.setData("row",e+""),this._selection.has(e)&&i.addClass("selected"),i}_buildRowHeader(e,t,o){let r=[],n=this._getColCount();for(let l=0;l<n;l++){let c=this._getCol(l);if(!(c!=null&&c.fixed))continue;let h=this._renderCell(t,c.id,[c.type]),g="start";switch(c.align){default:g="start";break;case"center":g="center";break;case"right":g="end";break}let f=new d({cls:"cell",style:{width:c!=null&&c.width?c.width+"px":void 0,justifyContent:g},content:h});c.type&&f.addClass(c.type),f.setData("col",l+""),f.setData("row",e+""),r.push(f)}let i=new C({cls:"row",style:{top:o+"px"},content:r});return i.setData("row",e+""),this._selection.has(e)&&i.addClass("selected"),i}_updateFlexs(){let e=0,t=0,o=this._getColCount();for(let r=0;r<o;r++){let n=this._getCol(r);!n.fixed&&n.flex?t+=n.flex:e+=n.width}if(t){let i=(this._viewport.dom.clientWidth-e)/t;for(let l=0;l<o;l++){let c=this._getCol(l);!c.fixed&&c.flex&&(c.width=Math.max(c.flex*i,32),this.queryAll(`[data-col="${l}"]`).forEach(g=>{g.setStyleValue("width",c.width+"px")}))}}}_computeFullSize(){let e=0,t=0,o=this._getColCount();for(let i=0;i<o;i++){let l=this._getCol(i),c=0;l.fixed&&(this._has_fixed=!0),l.width&&(c+=l.width),l.fixed?t+=c:e+=c}let r=this._dataview.getCount(),n=r;if(r<Nt)n*=this._row_height;else{let l=this._body.dom.parentElement.clientHeight/this._row_height;n=r-Math.floor(l)+l*this._row_height}this.setStyleVariable("--fixed-width",t+"px"),this._body.setStyleValue("height",n+"px"),this._body.setStyleValue("width",e+"px"),this._vheader.setStyleValue("height",n+"px")}_init(){this._body=new d({cls:"body"}),this._viewport=new se({content:this._body}),this._has_footer||this.setStyleVariable("--footer-height","0"),this._viewport.addDOMEvent("scroll",t=>{this._left=this._viewport.dom.scrollLeft,this.setStyleVariable("--left",-this._left+"px"),this._top=this._viewport.dom.scrollTop,this.setStyleVariable("--top",-this._top+"px"),this._update()}),this.addDOMEvent("wheel",t=>{if(t.deltaY&&this._dataview.getCount()>=Nt&&(this._viewport.dom.scrollBy(0,t.deltaY<0?-1:1),t.stopPropagation(),t.preventDefault()),this._has_fixed&&t.deltaY){let o=t.target;for(;o!=this.dom;){if(o==this._vheader.dom){this._viewport.dom.scrollBy(0,t.deltaY<0?-this._row_height:this._row_height),t.stopPropagation(),t.preventDefault();break}o=o.parentNode}}});let e=s(t=>{let o=d.parentElement(t.target,d);for(;o&&!o.hasClass("row");)o=o.parentElement();if(o)return o.getIntData("row")},"targetRow");this.addDOMEvent("click",t=>{let o=e(t);o!==void 0&&(this._selection.has(o)||(this._clearSelection(),this._addSelection(o)))}),this.addDOMEvent("dblclick",t=>{let o=e(t);if(o!==void 0){this._selection.has(o)||(this._clearSelection(),this._addSelection(o)),this._on_dblclk(t,o);let r=this._dataview.getByIndex(o);this.fire("dblClick",{context:r})}}),this.addDOMEvent("contextmenu",t=>{let o=e(t);if(o!==void 0){this._selection.has(o)||(this._clearSelection(),this._addSelection(o));let r=this._dataview.getByIndex(o);this.fire("contextMenu",{uievent:t,context:r})}t.preventDefault(),t.stopPropagation()}),this.addDOMEvent("mouseover",t=>{if(!this._has_fixed)return;let o=d.parentElement(t.target,d);for(;o&&!o.hasClass("row");)o=o.parentElement();if(o){let r=o.getData("row");this.queryAll(".hover").forEach(n=>n.removeClass("hover")),r&&this.queryAll(`.row[data-row="${r}"]`).forEach(i=>i.addClass("hover"))}}),this.addDOMEvent("mouseleave",t=>{this._has_fixed&&this.queryAll(".hover").forEach(o=>o.removeClass("hover"))}),this._updateFlexs(),this._fheader=this._buildColHeader(!0),this._hheader=this._buildColHeader(!1),this._vheader=new C({cls:"row-header"}),this._has_footer&&(this._ffooter=this._buildColFooter(!0),this._footer=this._buildColFooter(!1)),this.setContent([this._viewport,this._fheader,this._hheader,this._ffooter,this._footer,this._vheader]);{let t=this.getStyleVariable("--row-height");this._row_height=parseInt(t)}this._computeFullSize()}_on_dblclk(e,t){}_update(e=!1){if(!this._lock){let t=this.getBoundingRect(),o=this._dataview.getCount(),r=o<Nt?this._row_height:1,n=Math.floor(this._top/r),i=n+Math.ceil(t.height/this._row_height),l=this._has_fixed;if(this._start!=n||this._end!=i||e){let c=[],h=[];e&&this._vis_rows.clear();let g=new Map,f=n*r;for(let m=n;m<i&&m<o;m++,f+=this._row_height){let x=this._vis_rows.get(m),v=this._dataview.getByIndex(m);l?(x?(x.h.setStyleValue("top",f+"px"),x.r.setStyleValue("top",f+"px")):x={h:this._buildRowHeader(m,v,f),r:this._buildRow(m,v,f)},h.push(x.h)):x?x.r.setStyleValue("top",f+"px"):x={h:null,r:this._buildRow(m,v,f)},c.push(x.r),g.set(m,x)}l&&h.push(new d({cls:"cell-out",style:{top:f+"px"}})),this._vis_rows=g,this._start=n,this._end=i,this._body.setContent(c),l?(this._vheader.removeClass("@hidden"),this._vheader.setContent(h)):this._vheader.addClass("@hidden")}}}_clearSelection(){for(let e of this._selection.keys())this.queryAll(`.row[data-row="${e}"]`).forEach(o=>{o.removeClass("selected")});this._selection.clear()}_addSelection(e){this._selection.add(e),this.queryAll(`.row[data-row="${e}"]`).forEach(r=>{r.addClass("selected")});let o=this._dataview.getByIndex(e);this.fire("selectionChange",{selection:o,empty:!1})}getSelection(){return this._selection.size==0?null:[...this._selection.values()].map(t=>this._dataview.getByIndex(t))}getFirstSel(){if(this._selection.size==0)return null;let e=this._selection.values().next().value;return this._dataview.getByIndex(e)}selectItem(e){let t=this._dataview.indexOfId(e);t>=0&&this._addSelection(t)}};s(je,"Gridview"),je=u([p("x4")],je);var Ye=class extends b{_els;_vwp;constructor(e){var t;super(e),this._els=(t=e.items)==null?void 0:t.map(o=>{let r=new _({cls:"cell",text:o.title,icon:o.iconId}),n=new F("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",i=>{r.setInternalData("flex",1),this._calc_sizes()}),n.on("resize",i=>{r.setInternalData("flex",0),r.setInternalData("width",i.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 b({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 h=l.getInternalData("width");if(h==0){let g=l.getBoundingRect();h=Math.ceil(g.width)+2,l.setInternalData("width",h)}t+=h}});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 i=0;this._els.forEach(l=>{let c=0,h=l.getInternalData("flex");h?(c=Math.min(n*h,r),r-=c):c=l.getInternalData("width"),l.setWidth(c),i+=c}),this._vwp.setWidth(i)}_on_resize(){this._calc_sizes()}};s(Ye,"Header"),Ye=u([p("x4")],Ye);var qr='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512" fill="currentColor"><!--!Font Awesome Free 6.7.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M576 128c0-35.3-28.7-64-64-64L205.3 64c-17 0-33.3 6.7-45.3 18.7L9.4 233.4c-6 6-9.4 14.1-9.4 22.6s3.4 16.6 9.4 22.6L160 429.3c12 12 28.3 18.7 45.3 18.7L512 448c35.3 0 64-28.7 64-64l0-256zM271 175c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z"/></svg>';var Kr='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512" fill="currentColor"><!--!Font Awesome Free 6.7.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M214.6 41.4c-12.5-12.5-32.8-12.5-45.3 0l-160 160c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 141.2 160 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-306.7L329.4 246.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-160-160z"/></svg>';var Gr='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512" fill="currentColor"><!--!Font Awesome Free 6.7.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L525.6 386.7c39.6-40.6 66.4-86.1 79.9-118.4c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C465.5 68.8 400.8 32 320 32c-68.2 0-125 26.3-169.3 60.8L38.8 5.1zm151 118.3C226 97.7 269.5 80 320 80c65.2 0 118.8 29.6 159.9 67.7C518.4 183.5 545 226 558.6 256c-12.6 28-36.6 66.8-70.9 100.9l-53.8-42.2c9.1-17.6 14.2-37.5 14.2-58.7c0-70.7-57.3-128-128-128c-32.2 0-61.7 11.9-84.2 31.5l-46.1-36.1zM394.9 284.2l-81.5-63.9c4.2-8.5 6.6-18.2 6.6-28.3c0-5.5-.7-10.9-2-16c.7 0 1.3 0 2 0c44.2 0 80 35.8 80 80c0 9.9-1.8 19.4-5.1 28.2zm9.4 130.3C378.8 425.4 350.7 432 320 432c-65.2 0-118.8-29.6-159.9-67.7C121.6 328.5 95 286 81.4 256c8.3-18.4 21.5-41.5 39.4-64.8L83.1 161.5C60.3 191.2 44 220.8 34.5 243.7c-3.3 7.9-3.3 16.7 0 24.6c14.9 35.7 46.2 87.7 93 131.1C174.5 443.2 239.2 480 320 480c47.8 0 89.9-12.9 126.2-32.5l-41.9-33zM192 256c0 70.7 57.3 128 128 128c13.3 0 26.1-2 38.2-5.8L302 334c-23.5-5.4-43.1-21.2-53.7-42.3l-56.1-44.2c-.2 2.8-.3 5.6-.3 8.5z"/></svg>';var ai={"fr-FR":{lines:{lower:["1 2 3 4 5 6 7 8 9 0","a z e r t y u i o p {2}","q s d f g h j k l m {3}","{4} w x c v b n , . {4}","{5} {6} ' {7}"],upper:["! @ # $ % ^ & * ( ) _ +","A Z E R T Y U I O P {2}","Q S D F G H J K L M {3}","{4} W X C V B N ? : {4}","{5} {6} ' {7}"],number:["1 2 3 {2}","4 5 6 {8}","7 8 9 {9}","0 . {3} {9}"],date:["1 2 3 {2}","4 5 6 {8}","7 8 9 {9}","0 / {3} {9}"]}},"en-GB":{lines:{lower:["1 2 3 4 5 6 7 8 9 0","a z e r t y u i o p {2}","q s d f g h j k l m {3}","{4} w x c v b n , . {4}","{5} {6} ' {7}"],upper:["! @ # $ % ^ & * ( ) _ +","A Z E R T Y U I O P {2}","Q S D F G H J K L M {3}","{4} W X C V B N ? : {4}","{5} {6} ' {7}"],number:["1 2 3 {2}","4 5 6 {8}","7 8 9 {9}","0 . {3} {9}"],date:["1 2 3 {2}","4 5 6 {8}","7 8 9 {9}","0 / {3} {9}"]}},"en-US":"en-GB"},Wr=/text|password|search|tel|url/i,Qe=class extends b{mode;locale;keyboard;visible;input;constructor(e){super({...e,id:"v-keyboard"}),this.mode="lower",this.locale="fr-FR",this.visible=!1,document.addEventListener("focusin",t=>this.handleFocus(t.target,!0),!1),document.addEventListener("focusout",t=>this.handleFocus(t.target,!1),!1),this.hide(),this.addDOMEvent("mousedown",t=>{this.handleKey(t),t.preventDefault(),t.stopPropagation()}),this.addDOMEvent("dblclick",t=>{this.handleKey(t),t.preventDefault(),t.stopPropagation()}),this.addDOMEvent("contextmenu",t=>{t.preventDefault(),t.stopPropagation()})}handleKey(e){let t=e.target,o;for(;t!==this.dom;){if(t.hasAttribute("data-key")){o=parseInt(t.getAttribute("data-key"),10);break}t=t.parentNode}if(o)switch(o){case 2:{this.fireKey(0,this._backspace);break}case 3:{this._focusNext();break}case 4:{this.mode=="lower"?this.mode="upper":this.mode="lower",this._redraw();break}case 5:{this._switchMode("number");break}case 6:{this.fireKey(32,this._insertChar);break}case 7:{this.hide();break}case 8:{this._switchMode("lower");break}default:{this.fireKey(o,this._insertChar);break}}}_focusNext(){Rt.instance().focusNext(!0)}_switchMode(e){this.mode=e,this._redraw()}_redraw(){this.setContent([new ne,this.keyboard=new k({id:"kb",cls:this.mode,content:this._createContent()}),new ne])}_scrollIntoView(e){let t=e.parentElement;for(;t!=document.body;){if(t.style.overflowY!==""){let o=e.getBoundingClientRect(),r=t.getBoundingClientRect();o.top<r.top?e.scrollIntoView(!0):o.bottom>r.bottom&&e.scrollIntoView(!1);break}t=t.parentElement}}_updateVis=s(()=>{if(this.visible){if(this.input){let e=this.input.type;if(e=="check"||e=="radio")this.hide(),this.input=null;else{this.show(),this._scrollIntoView(this.input);let t=this.input.getAttribute("data-type");e==="number"||t==="number"?this._switchMode("number"):e==="date"||t==="date"?this._switchMode("date"):this._switchMode("lower")}}}else this.hide(),this.input=null},"_updateVis");showOn(e){this.handleFocus(e.dom,!0)}handleFocus(e,t){if(t&&e.tagName=="INPUT"&&!e.readOnly){this.input=e,this.visible=!0,this.setTimeout("vis",200,this._updateVis);return}this.visible=!1,this.setTimeout("vis",200,this._updateVis)}_insertChar(e,t,o){return t=t.substring(0,e.start)+o.toString()+t.substring(e.end),e.start+=o.length,e.end=e.start,t}_backspace(e,t){return t=t.substring(0,e.start-1)+t.substring(e.start),e.start-=1,e.end=e.start,t}_getCaret(){if(this.input&&Wr.test(this.input.type)){let e={start:this.input.selectionStart||0,end:this.input.selectionEnd||0};return e.end<e.start&&(e.end=e.start),e}else{let e=this.input.value.length;return{start:e,end:e}}}_restoreCaretPos(e){Wr.test(this.input.type)&&(this.input.selectionStart=e.start,this.input.selectionEnd=e.end)}fireKey(e,t){let o=this._getCaret(),r=this.input.value;r=t.call(this,o,r,String.fromCharCode(e)),this.input.value=r,this._restoreCaretPos(o)}_createContent(){let e=ai[this.locale].lines[this.mode],t=[];for(let o=0;o<e.length;o++){let r=e[o].split(" "),n=[];for(let i=0;i<r.length;i++){let l="tch c"+i,c=r[i],h,g=null;if(c.length>2&&c[0]=="{"&&c[c.length-1]=="}"){let m=parseInt(c.substring(1,c.length-1),10);switch(m){default:case 0:{c="",l+=" x4hidden";break}case 1:{c="";break}case 2:{c=void 0,g=qr,l+=" cdel";break}case 3:{c=y.global.keyboard.next,l+=" cret";break}case 4:{c=void 0,g=Kr,l+=" cshift";break}case 5:{c=y.global.keyboard.numeric,l+=" cnum";break}case 6:{c=" ",l+=" cspace";break}case 7:{c=void 0,g=Gr,l+=" chide";break}case 8:{c=y.global.keyboard.alpha,l+=" calpha";break}case 9:{c="",l+=" cplace";break}}h=m}else h=r[i].charCodeAt(0);let f=new I({cls:l,label:c,attrs:{"data-key":h},icon:g});n.push(f)}t.push(new b({cls:"line",content:n}))}return t}};s(Qe,"Keyboard"),Qe=u([p("x4")],Qe);var $e=class extends d{constructor(e){super({tag:"a",...e}),this.setAttribute("href",e.href),this.mapPropEvents(e,"click"),this.setContent(new _({text:e.text,icon:e.icon})),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())}};s($e,"Link"),$e=u([p("x4")],$e);var jr='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 cr='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><!--!Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path class="fa-secondary" opacity=".4" d="M0 128l32 0 224 0 32 0 0 64-32 0L64 192l0 256 448 0 0-128 0-32 64 0 0 32 0 160 0 32-32 0L32 512 0 512l0-32L0 160l0-32z"/><path class="fa-primary" d="M288 352l16-112L468.7 75.3l96 96L400 336 288 352zM587.3 148.7l-96-96L544 0l96 96-52.7 52.7zM96 288l64 0 0 64-64 0 0-64zm160 0l0 64-64 0 0-64 64 0z"/></svg>';var ke=class extends X{constructor(e){super(e)}static _create(e,t,o){return new ke({modal:!0,title:o!=null?o:y.global.error,movable:!0,form:new K({content:[new b({content:[new E({iconId:jr}),new _({text:e})]})]}),buttons:t!=null?t:["ok.outline","cancel.outline"]})}static show(e,t,o){let r=this._create(e,t,o);return r.on("btnclick",n=>{te(()=>{r.close()})}),r.show(),r}static async showAsync(e,t,o){return new Promise((r,n)=>{let i=this._create(e,t,o);i.on("btnclick",l=>{te(()=>{r(l.button),i.close()})}),i.show()})}};s(ke,"MessageBox"),ke=u([p("x4")],ke);var Ce=class extends X{constructor(e){super(e)}getValue(){return this.query("input").getValue()}static _create(e,t,o){return new Ce({modal:!0,title:o,movable:!0,form:new K({content:[new b({content:[new E({iconId:cr}),new k({flex:1,content:[new _({text:e}),new A({value:t,type:"text"})]})]})]}),buttons:["ok.outline.default","cancel.outline"]})}static async showAsync(e,t,o){return new Promise((r,n)=>{let i=this._create(e,t,o);i.on("btnclick",l=>{te(()=>{r(l.button=="ok"?i.getValue():null),i.close()})}),i.show()})}};s(Ce,"InputBox"),Ce=u([p("x4")],Ce);var Ee=class extends X{constructor(e){super(e)}static _create(e,t,o){return new Ee({modal:!0,title:o,movable:!0,form:new K({content:[new b({content:[new E({iconId:cr}),new k({flex:1,cls:"right",content:[new _({text:e}),t]})]})]}),buttons:["ok.outline.default","cancel.outline"]})}static async showAsync(e,t,o){return new Promise(r=>{let n=this._create(e,t,o);n.on("btnclick",i=>{te(()=>{r(i.button),n.close()})}),n.show()})}};s(Ee,"PromptBox"),Ee=u([p("x4")],Ee);var Yr='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 Qr='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 $r='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 Zr='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 Ze=class extends z{constructor(e){super({});let t=e.iconId;t||(e.loading?(t=$r,this.addClass("")):e.mode=="danger"?t=Qr:t=Yr),this.addClass(e.mode);let o=new E({iconId:t});e.loading&&(o.addClass("rotate"),this.props.modal=!0),this.setContent(new b({content:[o,new k({cls:"body",content:[e.title?new _({cls:"title",text:e.title}):null,new _({cls:"text",text:e.text})]}),e.closable?new I({cls:"outline",icon:Zr,click:s(()=>{this.close()},"click")}):null]}))}close(){this.clearTimeout("close"),super.close()}display(e=0){let t=new Me(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()})}};s(Ze,"Notification"),Ze=u([p("x4")],Ze);var Xe=class extends k{_title;_body;constructor(e){var o;super({...e,content:void 0});let t=(o=e.bodyModel)!=null?o:k;super.setContent([this._title=new _({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)}};s(Xe,"Panel"),Xe=u([p("x4")],Xe);var Je=class extends d{_bar;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+"%")}};s(Je,"Progress"),Je=u([p("x4")],Je);var me=class extends d{constructor(e){super({tag:"select",...e}),this.mapPropEvents(e,"focus","change"),e.name&&this.setAttribute("name",e.name),this.setItems(e.items),this.addDOMEvent("blur",t=>{this.on_focus(t,!0)}),this.addDOMEvent("focus",t=>{this.on_focus(t,!1)}),this.addDOMEvent("input",t=>{this.on_change(t)}),e.multiple&&this.setAttribute("multiple",!0),e.value&&this.setValue(e.value)}on_focus(e,t){let o={focus_out:t};this.fire("focus",o),o.defaultPrevented&&e.preventDefault()}on_change(e){let t={value:this.getValue()};this.fire("change",t),t.defaultPrevented&&e.preventDefault()}setItems(e){this.setContent(e.map(t=>new d({tag:"option",attrs:{value:t.id},content:t.text})))}getValue(){return this.dom.value}setValue(e){this.dom.value=e+""}};s(me,"Select"),me=u([p("x4")],me);var Xr='data:image/svg+xml,<svg viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg">%0D%0A%09<path class="fa-primary" 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 et=class extends k{root;groups;constructor(e){super(e),this.root=new d({cls:"root"}),this.setContent(this.root),e.groups&&this.setItems(e.groups)}setItems(e){this.groups=e;let t=[];for(let o of this.groups)t.push(this.makeGroupHeader(o)),o.items.forEach(r=>{t.push(this.makePropertyRow(r))});this.root.setContent(t)}makeGroupHeader(e){let t=s(r=>{let n;r.hasClass("collapsed")?(r.removeClass("collapsed"),n=!0):(r.addClass("collapsed"),n=!1);let i=r.nextElement();for(;i&&i.hasClass("row");)i.show(n),i=i.nextElement()},"toggle"),o=new b({cls:"group",content:[e.icon?new E({id:"icon",iconId:e.icon}):null,new k({content:[new H({cls:"title",text:e.title}),e.desc?new H({cls:"desc",text:e.desc}):null]}),e.collapsible?new I({icon:Xr,click:s(r=>t(o),"click")}):null]});return o.setClass("collapsible",e.collapsible),o}makePropertyRow(e){var n;let t=!0,o,r=xo(e.value)?e.value(e.name):e.value;return e.value=r,e.type==="boolean"?o=new A({type:"checkbox",id:e.name,name:e.name,checked:r,dom_events:{change:s(i=>{var l;(l=e.callback)==null||l.call(e,e.name,o.dom.checked)},"change")}}):e.type==="options"?o=new me({value:r,id:e.name,items:e.options,name:e.name,change:s(i=>{var l;(l=e.callback)==null||l.call(e,e.name,i.value)},"change")}):e.type==="password"?o=new A({type:"password",id:e.name,name:e.name,value:r,focus:s(i=>{var l;i.focus_out&&((l=e.callback)==null||l.call(e,e.name,o.getValue()))},"focus")}):e.type==="number"?o=new A({type:"number",id:e.name,name:e.name,value:r,step:e.step,focus:s(i=>{var l;i.focus_out&&((l=e.callback)==null||l.call(e,e.name,o.getNumValue()))},"focus"),change:s(()=>{var i;e.live&&((i=e.callback)==null||i.call(e,e.name,o.getNumValue()))},"change")}):e.type==="label"?o=new _({id:e.name,text:r}):e.type==="button"?(t=!1,o=new I({id:e.name,label:r,click:s(()=>{var i;(i=e.callback)==null||i.call(e,e.name,"")},"click")})):o=new A({type:"text",id:e.name,name:e.name,value:r,focus:s(i=>{var l;i.focus_out&&((l=e.callback)==null||l.call(e,e.name,o.getValue()))},"focus")}),new b({cls:"row",content:[t?new d({cls:"cell hdr",content:(n=e.title)!=null?n:e.name,tooltip:e.desc}):null,new d({cls:"cell",tag:"label",attrs:{labelFor:e.name},content:o})]})}setPropValue(e,t){let r=this.groups.flatMap(n=>[...n.items]).find(n=>n.name==e);if(r)if(r.type==="boolean"){let n=this.root.query("#"+r.name);n&&n.setCheck(t)}else if(r.type==="options"){let n=this.root.query("#"+r.name);n&&n.setValue(t)}else if(r.type==="number"){let n=this.root.query("#"+r.name);n&&n.setNumValue(t,-2)}else{let n=this.root.query("#"+r.name);n&&n.setValue(t)}}};s(et,"PropertyGrid"),et=u([p("x4")],et);var Jr='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 5 5" aria-hidden="true">%0D%0A%09<circle class="fa-primary" cx="2.5" cy="2.5" r="2.5" ></circle>%0D%0A%09<circle class="fa-secondary" cx="2.5" cy="2.5" r="1.25"></circle>%0D%0A</svg>';var tt=class extends d{_check;_input;_label;constructor(e){super(e),this.mapPropEvents(e,"change");let t=q();this.setContent([this._check=new b({cls:"inner",content:[this._input=new A({type:"radio",id:t,name:e.name,value:e.value,checked:e.checked,dom_events:{change:s(()=>this._on_change(),"change")}})]}),this._label=new _({tag:"label",text:e.label,id:void 0,labelFor:t,icon:e.icon})]),wt.load(Jr).then(o=>{this._check.dom.insertAdjacentHTML("beforeend",o)}),this.addDOMEvent("click",o=>this._on_click(o))}_on_click(e){e.target==this.dom&&(this._input.dom.click(),e.preventDefault(),e.stopPropagation())}_on_change(){this.fire("change",{value:this.getValue()})}setCheck(e){let t=this._input.dom;t.checked=e}setLabel(e){this._label.setText(e)}getValue(){return this._input.getValue()}};s(tt,"Radio"),tt=u([p("x4")],tt);var en='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 ot=class extends b{m_els;m_input;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:en,o=(n=e.value)!=null?n:0;this.m_input=new A({type:"text",hidden:!0,name:e.name,value:""+o}),this.addDOMEvent("click",i=>this._on_click(i)),this.m_els=[];for(let i=0;i<e.steps;i++){let l="item";i+1<=o&&(l+=" checked");let c=new E({cls:l,iconId:t});c.setInternalData("value",i),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=T(e.target);t=t.parentElement(E),t&&this.setValue(t.getInternalData("value")),this.fire("change",{value:this.props.value})}};s(ot,"Rating"),ot=u([p("x4")],ot);var rt=class extends d{_mdown=!1;_irect=null;_thumb=null;_bar=null;_range=null;constructor(e){super(e),this.mapPropEvents(e,"change"),e.vertical&&this.addClass("vertical"),this.setContent([new b({cls:"track",content:[this._bar=new d({cls:"bar"}),this._thumb=new d({cls:"thumb"})]}),this._range=new A({type:"range",hidden:!0,value:e.value,min:e.min,max:e.max,step:e.step})]),this.setAttribute("tabindex",0),this.setDOMEvents({pointerdown:s(t=>this._on_mousedown(t),"pointerdown"),pointermove:s(t=>this._on_mousemove(t),"pointermove"),pointerup:s(t=>this._on_mouseup(t),"pointerup"),keydown:s(t=>this._on_key(t),"keydown")}),this._update()}_on_mousedown(e){e.stopPropagation(),e.preventDefault(),this.focus(),this._mdown=!0,this._irect=this.getBoundingRect(),this.setCapture(e.pointerId)}_getMinMax(){let e=parseInt(this._range.getAttribute("min")),t=parseInt(this._range.getAttribute("max"));return[e,t]}_on_mousemove(e){if(this._mdown){let t,o;this.props.vertical?(t=e.offsetY,o=this._irect.height):(t=e.offsetX,o=this._irect.width);let r=t/o;this.props.vertical&&(r=1-r);let[n,i]=this._getMinMax();this._range.setNumValue(n+r*(i-n)),this._update()}}_update(){let e=this._range.getNumValue(),[t,o]=this._getMinMax(),r=o>t?e/Math.abs(o-t)*100:0;this.props.vertical?(r=100-r,this._thumb.setStyleValue("top",r+"%"),this._bar.setStyleValue("height",r+"%")):(this._thumb.setStyleValue("left",r+"%"),this._bar.setStyleValue("width",r+"%")),this.fire("change",{value:e})}_on_mouseup(e){this._mdown&&(this.releaseCapture(e.pointerId),this._mdown=!1)}_on_key(e){var r;console.log(e.key);let t=(r=this.props.step)!=null?r:1,o=0;switch(e.key){case"ArrowRight":case"ArrowUp":o=t;break;case"ArrowLeft":case"ArrowDown":o=-t;break}o&&(e.ctrlKey&&(o*=10),this._range.setNumValue(this._range.getNumValue()+o),this._update())}setMin(e){this._range.setAttribute("min",e+""),this._update()}setMax(e){this._range.setAttribute("max",e+""),this._update()}setValue(e){this._range.setNumValue(e),this._update()}};s(rt,"Slider"),rt=u([p("x4")],rt);var nt=class extends b{constructor(e){super(e);let t=q();this.setContent([new d({cls:"switch",content:[new A({type:"checkbox",id:t,checked:e.checked}),new d({cls:"track"}),new d({cls:"thumb"})]}),new _({tag:"label",text:e.label,labelFor:t})])}};s(nt,"Switch"),nt=u([p("x4")],nt);var it=class extends I{constructor(e,t){super(e),this.addClass("outline"),this.setIcon(t.icon),this.setText(t.title),this.setData("tabname",t.name)}};s(it,"CTab"),it=u([p("x4")],it);var st=class extends b{_selitem;constructor(e,t){super(e),this.setItems(t),this.mapPropEvents(e,"click")}_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._selitem&&this._selitem.setClass("selected",!0)}setItems(e){this.clearContent(),e.forEach(t=>{this.addItem(t)})}addItem(e){this.appendContent(new it({click:s(t=>this._on_click(t),"click")},e))}getTabCount(){return this.dom.children.length}};s(st,"CTabList"),st=u([p("x4")],st);var at=class extends k{_list;_stack;_current;constructor(e){var o;super(e);let t=(o=e.items)==null?void 0:o.map(r=>({name:r.name,content:r.content}));this.setContent([this._list=new st({click:s(r=>this._onclick(r),"click")},e.items),this._stack=new ie({cls:"body x4flex",default:e.default,items:t})]),e.default&&this.selectTab(e.default)}selectTab(e){this._list.select(e),this._stack.select(e),this._current=e}_onclick(e){this.selectTab(e.name)}getTab(e){return this._stack.getPage(e)}getCurTab(){return this._current}addTab(e){this._list.addItem(e),this._stack.addItem({name:e.name,content:e.content}),this._list.getTabCount()==1&&this.selectTab(e.name)}};s(at,"Tabs"),at=u([p("x4")],at);var hr=class hr extends d{constructor(e){super({...e,tag:"textarea"}),this.setAttribute("name",e.name),this.setAttribute("value",e.value+""),e.resize||this.setAttribute("resize",!1),e.readonly&&this.setAttribute("readonly",!0)}setText(e){this.dom.value=e}getText(){return this.dom.value}queryInterface(e){return e=="form-element"?{getRawValue:s(()=>this.getText(),"getRawValue"),setRawValue:s(o=>{this.setText(o)},"setRawValue"),isValid:s(()=>!0,"isValid")}:super.queryInterface(e)}};s(hr,"SimpleTextArea");var dr=hr,lt=class extends k{_input;constructor(e){super(e),this.setContent([new _({text:e.label}),this._input=new dr(e)])}setText(e){this._input.setText(e)}getText(){return this._input.getText()}queryInterface(e){return e=="form-element"?{getRawValue:s(()=>this.getText(),"getRawValue"),setRawValue:s(o=>{this.setText(o)},"setRawValue"),isValid:s(()=>!0,"isValid")}:super.queryInterface(e)}};s(lt,"TextArea"),lt=u([p("x4")],lt);var ct=class extends b{input;constructor(e){var r;super(e),e.inputId||(e.inputId=q()),e.required&&this.setAttribute("required",!0);let t=(r=e.inputGadgets)!=null?r:[],o={...e,id:e.inputId,attrs:e.inputAttrs,width:e.inputWidth};this.setContent([e.label?new b({id:"label",width:e.labelWidth,content:[new _({tag:"label",text:e.label,labelFor:e.inputId})]}):null,new b({id:"edit",content:[this.input=new A(o),...t]})])}getValue(){return this.input.getValue()}setValue(e){this.input.setValue(e)}getInput(){return this.input}};s(ct,"TextEdit"),ct=u([p("x4")],ct);var ur=class ur extends d{constructor(e){super(e),this.addDOMEvent("resized",()=>this.update())}update(){var h,g,f,m;let e=this.props,t=e.values;if(!t.length){this.clearContent();return}let o=this.getBoundingRect(),r=(h=e.min)!=null?h:0,n=(g=e.max)!=null?g:100,i=o.width/t.length,l=o.height/(n-r),c=new zt;if(e.background&&c.rect(0,0,o.width,o.height).fill(e.background.toHexString()),r!=0&&c.path().moveTo(0,0-r).lineTo(o.width,0-r).stroke("var(--tickline-axis-color)",1).antiAlias(!1),e.type=="line"){let x=c.path();for(let v=0;v<t.length;v++)v==0?x.moveTo(v*i,(t[v]-r)*l):x.lineTo(v*i,(t[v]-r)*l);x.stroke(e.color?e.color.toHexString():"var(--tickline-color)",1).no_fill()}else for(let x=0;x<t.length;x++)c.rect(x*i,(0-r)*l,i-1,t[x]*l).fill(e.color?e.color.toHexString():"var(--tickline-color)").antiAlias(!1);this.setContent(new Ot({width:"100%",height:"100%",svg:c,attrs:{viewport:`0 ${(f=e.min)!=null?f:0} ${t.length} ${(m=e.max)!=null?m:100}`}}))}};s(ur,"TickLine");var pr=ur;var tn='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><!--!Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path class="fa-secondary" opacity=".4" d="M0 176c0 37.5 13.9 72.3 37.6 100.9L0 352l108.1-21.6C137.7 344.2 171.8 352 208 352c114.9 0 208-78.8 208-176S322.9 0 208 0S0 78.8 0 176zm134.7-52c0-25.8 20.9-46.7 46.7-46.7l47.4 0c29.1 0 52.6 23.6 52.6 52.6c0 18.8-10.1 36.3-26.4 45.6L228 191l0 6.3 0 20-40 0 0-20 0-17.9 0-11.6 10-5.8L235 140.9c3.9-2.3 6.3-6.4 6.3-10.9c0-7-5.7-12.6-12.6-12.6l-47.4 0c-3.7 0-6.7 3-6.7 6.7l0 5.5-40 0 0-5.5zM188 250.7l40 0 0 40-40 0 0-40z"/><path class="fa-primary" d="M134.7 124c0-25.8 20.9-46.7 46.7-46.7l47.4 0c29.1 0 52.6 23.6 52.6 52.6c0 18.8-10.1 36.3-26.4 45.6L228 191l0 6.3 0 20-40 0 0-20 0-17.9 0-11.6 10-5.8L235 140.9c3.9-2.3 6.3-6.4 6.3-10.9c0-7-5.7-12.6-12.6-12.6l-47.4 0c-3.7 0-6.7 3-6.7 6.7l0 5.5-40 0 0-5.5zM188 250.7l40 0 0 40-40 0 0-40zM432 512c-95.6 0-176.2-54.6-200.5-129C348.9 372.9 448 288.3 448 176c0-5.2-.2-10.4-.6-15.5C555.1 167.1 640 243.2 640 336c0 37.5-13.9 72.3-37.6 100.9L640 512 531.9 490.4C502.3 504.2 468.2 512 432 512z"/></svg>';var ho=null,Ut=null,on=new De;function bi(){document.addEventListener("mouseenter",a=>{if(a.target===document)return;let e=$t(a.target),t=e.getAttribute("tooltip"),o=e.queryInterface("tip-handler");if(o&&(t=o.getTip()),t){ho=a.target;let r=e.getBoundingRect();vi(t,r,{x:a.pageX,y:a.pageY})}},!0),document.addEventListener("mouseleave",a=>{ho&&a.target==ho&&(ho=null,_i())},!0)}s(bi,"initTooltips");function vi(a,e,t){Ut||(Ut=new dt({})),on.setTimeout(null,300,()=>{Ut.setText(ft(a)),Ut.displayAt(t.x+17,t.y+17)})}s(vi,"showTT");function _i(){Ut.show(!1),on.clearTimeout(null)}s(_i,"closeTT");var dt=class extends z{constructor(e){super(e),this.setContent(new b({content:[new E({iconId:tn}),new d({id:"text"})]}))}setText(e){this.query("#text").setContent(e)}};s(dt,"Tooltip"),dt=u([p("x4")],dt);var rn='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 nn=(h=>(h[h.first=0]="first",h[h.prev=1]="prev",h[h.next=2]="next",h[h.last=3]="last",h[h.parent=4]="parent",h[h.child=5]="child",h[h.expand=6]="expand",h[h.collapse=7]="collapse",h[h.toggle=8]="toggle",h))(nn||{}),Ie=class extends C{_item;_label;_icon;_childs;constructor(e,t){super({...e}),this._item=t,t?(this._label=new b({cls:"label item",content:[this._icon=new E({iconId:t.children?rn:void 0}),new _({tag:"span",cls:"",text:t.text,icon:t.iconId})]}),this._label.setData("id",t.id+""),t.children&&(this._childs=new k({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 k({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 Ie({},o));this._childs.setContent(t)}else this._childs.clearContent()}};s(Ie,"CTreeViewItem"),Ie=u([p("x4")],Ie);var ht=class extends d{_view;_selection;_selitem;_items;constructor(e){super(e);let t=new Z({cls:"body"});this._view=t.getViewport(),this.setContent([t,e.footer]),e.footer&&e.footer.setAttribute("id","footer"),this.setAttribute("tabindex",0),this.setDOMEvents({click:s(o=>this._onclick(o),"click"),keydown:s(o=>this._onkey(o),"keydown")}),e.items&&this.setItems(e.items)}setItems(e){this.clearSelection(),this._view.clearContent(),this._items=e;let t=new Ie({cls:"root"},null);e&&(t.setItems(e),this._view.setContent(t))}_onclick(e){let t=e.target;for(;t&&t!=this.dom;){let o=T(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(),i=n.findIndex(c=>this._selection==c.id),l;if(e==0)l=n[0].id;else if(e==3)l=n[n.length-1].id;else if(i>=0){if(e==1)i>0&&(l=n[i-1].id);else if(e==2)i<n.length-1&&(l=n[i+1].id);else if(e==4){let c=n[i].level;for(;i>0;)if(i--,n[i].level<c){l=n[i].id;break}}}if(l){let c=this.query(`[data-id="${l}"]`);return this._selectItem(l,c),!0}}return!1}_flattenOpenItems(){let e=[],t=s((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=s(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("selectionChange",{selection:o,empty:!1})}_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("selectionChange",{selection:void 0,empty:!0})}getSelection(){return this._selection}};s(ht,"Treeview"),ht=u([p("x4")],ht);0&&(module.exports={Application,AssistBox,Box,Breadcrumbs,BtnGroup,Button,CMover,CSizer,Calendar,Canvas,Checkbox,Color,ColorInput,ColorPicker,Combobox,Component,ComputedStyle,CoreElement,DataModel,DataProxy,DataRecord,DataStore,DataView,Dialog,DropdownList,EventSource,FileDialog,FileDrop,Flex,Form,GridBox,Gridview,HBox,Header,Icon,Image,Input,InputBox,Keyboard,Label,Link,Listbox,MasonryBox,Menu,MessageBox,Notification,Panel,Popup,Progress,PromptBox,PropertyGrid,Radio,Rating,Rect,Router,Saturation,ScrollView,Select,SimpleText,Slider,Space,StackBox,StateManager,Stylesheet,SvgBuilder,SvgComponent,SvgGradient,SvgGroup,SvgIcon,SvgPath,SvgShape,SvgText,Switch,Tabs,TextArea,TextEdit,TickLine,Timer,Treeview,UnsafeHtml,VBox,Viewport,_date_set_locale,_tr,addEvent,addTranslation,asap,beep,calcAge,camelCase,centerRect,clamp,class_ns,componentFromDOM,createLanguage,data,date_calc_weeknum,date_clone,date_diff,date_format,date_hash,date_sql_utc,date_to_sql,dispatchEvent,dragManager,formatIntlDate,getAvailableLanguages,getCurrentLanguage,getFocusableElements,getScrollbarSize,initTooltips,isArray,isFeatureAvailable,isFunction,isLanguage,isNumber,isString,isUnitLess,kbNav,kbTreeNav,makeUniqueComponentId,oneshot,pad,parseIntlDate,parseRoute,pascalCase,selectLanguage,setWaitCursor,sprintf,svgLoader,unbubbleEvents,unitless,unsafe,unsafeHtml,wrapDOM,x4_class_ns_sym,x4_react});
1
+ "use strict";var ut=Object.defineProperty;var _r=Object.getOwnPropertyDescriptor;var ln=Object.getOwnPropertyNames;var cn=Object.prototype.hasOwnProperty;var wr=a=>{throw TypeError(a)};var dn=(a,e,t)=>e in a?ut(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var s=(a,e)=>ut(a,"name",{value:e,configurable:!0});var hn=(a,e)=>{for(var t in e)ut(a,t,{get:e[t],enumerable:!0})},pn=(a,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of ln(e))!cn.call(a,r)&&r!==t&&ut(a,r,{get:()=>e[r],enumerable:!(o=_r(e,r))||o.enumerable});return a};var un=a=>pn(ut({},"__esModule",{value:!0}),a),u=(a,e,t,o)=>{for(var r=o>1?void 0:o?_r(e,t):e,n=a.length-1,i;n>=0;n--)(i=a[n])&&(r=(o?i(e,t,r):i(r))||r);return o&&r&&ut(e,t,r),r};var O=(a,e,t)=>dn(a,typeof e!="symbol"?e+"":e,t),yr=(a,e,t)=>e.has(a)||wr("Cannot "+t);var P=(a,e,t)=>(yr(a,e,"read from private field"),t?t.call(a):e.get(a)),ae=(a,e,t)=>e.has(a)?wr("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(a):e.set(a,t),le=(a,e,t,o)=>(yr(a,e,"write to private field"),o?o.call(a,t):e.set(a,t),t);var yi={};hn(yi,{Application:()=>Rt,AssistBox:()=>Re,Box:()=>C,Breadcrumbs:()=>ze,BtnGroup:()=>he,Button:()=>I,CMover:()=>Ht,CSizer:()=>F,Calendar:()=>Ve,Canvas:()=>He,Checkbox:()=>Ne,Color:()=>N,ColorInput:()=>_e,ColorPicker:()=>Ke,Combobox:()=>Ge,Component:()=>d,ComputedStyle:()=>ko,CoreElement:()=>re,DataModel:()=>Jt,DataProxy:()=>eo,DataRecord:()=>Ft,DataStore:()=>Bo,DataView:()=>xt,Dialog:()=>X,DropdownList:()=>ye,EventSource:()=>de,FileDialog:()=>Et,FileDrop:()=>We,Flex:()=>ne,Form:()=>K,GridBox:()=>Fe,Gridview:()=>je,HBox:()=>b,Header:()=>Ye,Icon:()=>E,Image:()=>ue,Input:()=>A,InputBox:()=>Ce,Keyboard:()=>Qe,Label:()=>_,Link:()=>$e,Listbox:()=>pe,MasonryBox:()=>Be,Menu:()=>W,MessageBox:()=>ke,Notification:()=>Ze,Panel:()=>Xe,Popup:()=>z,Progress:()=>Je,PromptBox:()=>Ee,PropertyGrid:()=>et,Radio:()=>tt,Rating:()=>ot,Rect:()=>Me,Router:()=>Yo,Saturation:()=>we,ScrollView:()=>Z,Select:()=>me,SimpleText:()=>H,Slider:()=>rt,Space:()=>St,StackBox:()=>ie,StateManager:()=>$o,Stylesheet:()=>yo,SvgBuilder:()=>zt,SvgComponent:()=>Ot,SvgGradient:()=>io,SvgGroup:()=>_t,SvgIcon:()=>no,SvgPath:()=>oo,SvgShape:()=>vt,SvgText:()=>ro,Switch:()=>nt,Tabs:()=>at,TextArea:()=>lt,TextEdit:()=>ct,TickLine:()=>ur,Timer:()=>De,Treeview:()=>ht,UnsafeHtml:()=>Ae,VBox:()=>k,Viewport:()=>se,_date_set_locale:()=>In,_tr:()=>y,addEvent:()=>Tt,addTranslation:()=>mo,asap:()=>te,beep:()=>Ln,calcAge:()=>Sn,camelCase:()=>Cn,centerRect:()=>wn,clamp:()=>G,class_ns:()=>p,componentFromDOM:()=>T,createLanguage:()=>po,createPainter:()=>lr,data:()=>Fo,date_calc_weeknum:()=>go,date_clone:()=>Pe,date_diff:()=>Mn,date_format:()=>An,date_hash:()=>ge,date_sql_utc:()=>Pn,date_to_sql:()=>Dn,dispatchEvent:()=>Mr,dragManager:()=>Bt,formatIntlDate:()=>j,getAvailableLanguages:()=>xn,getCurrentLanguage:()=>gn,getFocusableElements:()=>Mt,getScrollbarSize:()=>Rn,initTooltips:()=>bi,isArray:()=>Y,isFeatureAvailable:()=>It,isFunction:()=>xo,isLanguage:()=>uo,isNumber:()=>V,isString:()=>M,isUnitLess:()=>Co,kbNav:()=>Dt,kbTreeNav:()=>nn,makeUniqueComponentId:()=>q,oneshot:()=>yn,pad:()=>ce,parseIntlDate:()=>Tn,parseRoute:()=>Sr,pascalCase:()=>kn,selectLanguage:()=>Ir,setWaitCursor:()=>Yt,sprintf:()=>Wt,svgLoader:()=>wt,unbubbleEvents:()=>Ar,unitless:()=>Pt,unsafe:()=>_n,unsafeHtml:()=>ft,wrapDOM:()=>$t,x4_class_ns_sym:()=>At,x4_react:()=>Wo});module.exports=un(yi);var kr=Symbol("i18n"),mt={};function po(a,e){mt[a]={name:a,base:e,src_translations:{},translations:{}}}s(po,"createLanguage");function uo(a){return mt[a]!==void 0}s(uo,"isLanguage");function mo(a,...e){if(!uo(a))return;let t=mt[a];e.forEach(o=>{Cr(t.src_translations,o)}),t.translations=Er(t.src_translations,t.base,!0)}s(mo,"addTranslation");function Cr(a,e){for(let t in e){let o=e[t];typeof o=="string"?a[t]=o:Array.isArray(o)&&(!a[t]||!Array.isArray(a[t]))?a[t]=[...o]:!a[t]||typeof a[t]!="object"?a[t]={...o}:Cr(a[t],e[t])}}s(Cr,"_patch");function Er(a,e,t){let o={};for(let r in a)typeof a[r]!="string"&&!Array.isArray(a[r])?o[r]=Er(a[r],e,!1):o[r]=a[r];return mn(o,e,t)}s(Er,"_proxyfy");function mn(a,e,t){return new Proxy(a,{get:s((o,r)=>{t?Gt=[r]:Gt.push(r);let n=o[r];return n===void 0&&(e&&(n=fn(e)),n===void 0&&console.error("I18N error: unable to find","_tr."+Gt.join("."))),n},"get")})}s(mn,"_mk_proxy");var Gt;function fn(a){for(;a;){let e=mt[a],t=e.translations,o;for(let r of Gt){if(o=t[r],o===void 0)break;t=o}if(o!==void 0)return t;a=e.base}}s(fn,"_findBaseTrans");var y={};function Ir(a){if(uo(a))return y=mt[a].translations,y[kr]=a,y}s(Ir,"selectLanguage");function gn(){return y[kr]}s(gn,"getCurrentLanguage");function xn(){return Object.keys(mt)}s(xn,"getAvailableLanguages");var bn={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",filedrop:"Déposez un fichier",keyboard:{next:"Suivant",numeric:"123",alpha:"Abc"}}},vn={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",filedrop:"Drop a file",keyboard:{next:"Next",numeric:"123",alpha:"Abc"}}};po("fr",null);mo("fr",bn);po("en","fr");mo("en",vn);Ir("fr");function M(a){return typeof a=="string"}s(M,"isString");function V(a){return typeof a=="number"&&isFinite(a)}s(V,"isNumber");function Y(a){return a instanceof Array}s(Y,"isArray");function xo(a){return a instanceof Function}s(xo,"isFunction");var bo=class bo extends String{constructor(e){super(e)}};s(bo,"UnsafeHtml");var Ae=bo;function ft(a){return new Ae(a)}s(ft,"unsafeHtml");function _n(a,...e){let t=a.reduce((o,r,n)=>o+r+(e[n]||""),"");return ft(t)}s(_n,"unsafe");function G(a,e,t){return a<e?e:a>t?t:a}s(G,"clamp");var jt=class jt{left;top;height;width;constructor(e,t,o,r){e!==void 0&&(V(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}contains(e){return e instanceof jt?e.left>=this.left&&e.right<=this.right&&e.top>=this.top&&e.bottom<=this.bottom:e.x>=this.left&&e.x<this.right&&e.y>=this.top&&e.y<this.bottom}touches(e){return!(this.left>e.right||this.right<e.left||this.top>e.bottom||this.bottom<e.top)}normalize(){let e=this.width,t=this.height;return e<0&&(this.left+=e,this.width=-e),t<0&&(this.top+=t,this.height=-t),this}};s(jt,"Rect");var Me=jt;function wn(a,e,t=0){let o=e.width-2*t,r=e.height-2*t,n=a.width/a.height,i=o,l=o/n;l>r&&(l=r,i=r*n);let c=e.left+(e.width-i)/2,h=e.top+(e.height-l)/2;return{left:c,top:h,width:i,height:l}}s(wn,"centerRect");function It(a){switch(a){case"eyedropper":return"EyeDropper"in window}return!1}s(It,"isFeatureAvailable");var vo=class vo{_timers;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}};s(vo,"Timer");var De=vo;function te(a){return requestAnimationFrame(a)}s(te,"asap");function yn(a,e=0){return setTimeout(a,e)}s(yn,"oneshot");function ce(a,e,t="0"){let o;return M(a)?o=a:o=""+a,e>0?o.padEnd(e,t):o.padStart(-e,t)}s(ce,"pad");function Wt(a,...e){return a.replace(/{(\d+)}/g,function(t,o){return typeof e[o]<"u"?e[o]:t})}s(Wt,"sprintf");function kn(a){let e=a;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,"-"))}s(kn,"pascalCase");function Cn(a){let e=a.toLowerCase();return e=e.replace(/[^a-zA-Z0-9]+(.)/g,(t,o)=>o.toUpperCase()),e}s(Cn,"camelCase");var En="fr-FR";function In(a){En=a}s(In,"_date_set_locale");function An(a,e){return j(a)}s(An,"date_format");function Mn(a,e,t){let r=(a.getTime()-e.getTime())/1e3;if(r<60)return Wt(y.global.diff_date_seconds,Math.round(r));let n=Math.floor(r/60);if(n<60)return Wt(y.global.diff_date_minutes,Math.round(n));let i=Math.floor(n/60);return Wt(y.global.diff_date_hours,i,n%60)}s(Mn,"date_diff");function Dn(a,e){return e?j(a,"Y-M-D H:I:S"):j(a,"Y-M-D")}s(Dn,"date_to_sql");function Pn(a){return new Date(a+" GMT")}s(Pn,"date_sql_utc");function ge(a){return a.getFullYear()<<16|a.getMonth()<<8|a.getDate()}s(ge,"date_hash");function Pe(a){return new Date(a.getTime())}s(Pe,"date_clone");function go(a){let e=new Date(a.getFullYear(),0,1),t=(a.valueOf()-e.valueOf())/864e5;return Math.floor((t+e.getDay()+1)/7)}s(go,"date_calc_weeknum");function Tn(a,e=y.global.date_input_formats){var o,r,n,i,l,c;let t=e.split("|");for(let h of t){let g="";for(let x=0;x<h.length;x++){let v=h[x];v=="d"?g+="(?<day>\\d{1,2})":v=="D"?g+="(?<day>\\d{2})":v=="m"?g+="(?<month>\\d{1,2})":v=="M"?g+="(?<month>\\d{2})":v=="y"?g+="(?<year>\\d{1,4})":v=="Y"?h[x+1]=="Y"?(g+="(?<year>\\d{4})",x++):g+="(?<year>\\d{2})":v=="h"?g+="(?<hour>\\d{1,2})":v=="H"?g+="(?<hour>\\d{2})":v=="i"?g+="(?<min>\\d{1,2})":v=="I"?g+="(?<min>\\d{2})":v=="s"?g+="(?<sec>\\d{1,2})":v=="S"?g+="(?<sec>\\d{2})":v==" "?g+="\\s+":g+="\\s*\\"+v+"\\s*"}let m=new RegExp("^"+g+"$","m").exec(a);if(m){let x=new Date,v=parseInt((o=m.groups.day)!=null?o:"1"),U=parseInt((r=m.groups.month)!=null?r:"1"),w=parseInt((n=m.groups.year)!=null?n:x.getFullYear()+""),S=parseInt((i=m.groups.hour)!=null?i:"0"),J=parseInt((l=m.groups.min)!=null?l:"0"),B=parseInt((c=m.groups.sec)!=null?c:"0");w>0&&w<100&&(w+=2e3);let L=new Date(w,U-1,v,S,J,B,0),fe=L.getFullYear(),pt=L.getMonth()+1,R=L.getDate();return fe!=w||pt!=U||R!=v?null:L}}return null}s(Tn,"parseIntlDate");function j(a,e=y.global.date_format){if(!a)return"";let t={year:a.getFullYear(),month:a.getMonth()+1,day:a.getDate(),wday:a.getDay(),hours:a.getHours(),minutes:a.getMinutes(),seconds:a.getSeconds(),milli:a.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+=ce(t.day,-2):n=="j"?o+=y.global.day_short[t.wday]:n=="J"?o+=y.global.day_long[t.wday]:n=="w"?o+=go(a):n=="W"?o+=ce(go(a),-2):n=="m"?o+=t.month:n=="M"?o+=ce(t.month,-2):n=="o"?o+=y.global.month_short[t.month-1]:n=="O"?o+=y.global.month_long[t.month-1]:n=="y"||n=="Y"?o+=ce(t.year,-4):n=="a"||n=="A"?o+=t.hours<12?"am":"pm":n=="h"?o+=t.hours:n=="H"?o+=ce(t.hours,-2):n=="i"?o+=t.minutes:n=="I"?o+=ce(t.minutes,-2):n=="s"?o+=t.seconds:n=="S"?o+=ce(t.seconds,-2):n=="l"?o+=t.milli:n=="L"?o+=ce(t.milli,-3):o+=n}return o}s(j,"formatIntlDate");function Sn(a,e){if(e===void 0&&(e=new Date),!a)return 0;let t=e.getFullYear()-a.getFullYear();return(e.getMonth()<a.getMonth()||e.getMonth()==a.getMonth()&&e.getDate()<a.getDate())&&t--,t}s(Sn,"calcAge");function Ln(){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()}s(Ln,"beep");var fo=-1;function Rn(){if(fo<0){let a=document.createElement("div");a.style.cssText="overflow:auto;position:absolute;top:0;width:100px;height:100px";let e=document.createElement("div");e.style.width="200px",e.style.height="200px",a.appendChild(e),document.body.appendChild(a),fo=a.offsetWidth-a.clientWidth,document.body.removeChild(a)}return fo}s(Rn,"getScrollbarSize");var At=Symbol("class-ns");function p(a){return function(e){e[At]=a}}s(p,"class_ns");function Yt(a){document.body.style.cursor=a?"wait":"default"}s(Yt,"setWaitCursor");function Mt(a){let e=['button:not([tabindex="-1"]):not([disabled])',"[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'];return Array.from(a.querySelectorAll(e.join(","))).filter(o=>o.offsetParent!=null)}s(Mt,"getFocusableElements");var Dt=(i=>(i[i.first=0]="first",i[i.prev=1]="prev",i[i.pgdn=2]="pgdn",i[i.pgup=3]="pgup",i[i.next=4]="next",i[i.last=5]="last",i))(Dt||{});var Fn=s(function(){this.propagationStopped=!0},"stopPropagation"),Bn=s(function(){this.defaultPrevented=!0},"preventDefault"),_o=class _o{_source;_registry;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;return r.indexOf(n)==-1&&(o?r.unshift(n):r.push(n)),()=>{this.removeListener(e,t)}}removeListener(e,t){if(!this._registry)return;let o=this._registry.get(e);if(!o)return;let r=t,n=o.indexOf(r);n!==-1&&o.splice(n,1)}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=Bn),n.stopPropagation||(n.stopPropagation=Fn),o.length==1)o[0](n);else{let i=o.slice();for(let l=0,c=i.length;l<c&&(i[l](n),!n.propagationStopped);l++);}}}};s(_o,"EventSource");var de=_o;var Q,oe,wo=class wo{constructor(){ae(this,Q);ae(this,oe)}__startTimer(e,t,o,r){P(this,oe)?this.__stopTimer(e):le(this,oe,new Map);let n=(o?setInterval:setTimeout)(r,t);P(this,oe).set(e,()=>{(o?clearInterval:clearTimeout)(n),P(this,oe).delete(e)})}__stopTimer(e){var o;let t=(o=P(this,oe))==null?void 0:o.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 P(this,oe))t();P(this,oe).clear()}on(e,t){return console.assert(t!=null),P(this,Q)||le(this,Q,new de(this)),P(this,Q).addListener(e,t),{off:s(()=>{P(this,Q).removeListener(e,t)},"off")}}off(e,t){console.assert(t!=null),P(this,Q)&&P(this,Q).removeListener(e,t)}fire(e,t){P(this,Q)&&P(this,Q).fire(e,t)}};Q=new WeakMap,oe=new WeakMap,s(wo,"CoreElement");var re=wo;var Pt={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 Co(a){return!!Pt[a]}s(Co,"isUnitLess");var xe=class xe{m_sheet;m_rules=new Map;constructor(){function e(t){for(let o=0;o<document.styleSheets.length;o++){let r=document.styleSheets[o];if(r.title===t)return r}}if(s(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(M(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+" { ",i=t[r];for(let l in i){let c=i[l];for(let h=0;h<c.length;h++)n+=l+": "+c[h]+"; "}n+="}",this.setRule(e+"--"+o,n),o++}}}static getVar(e){return xe.doc_style||(xe.doc_style=getComputedStyle(document.documentElement)),e.startsWith("--")||(e="--"+e),xe.doc_style.getPropertyValue(e)}};s(xe,"Stylesheet"),O(xe,"guid",1),O(xe,"doc_style");var yo=xe,Eo=class Eo{m_style;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}};s(Eo,"ComputedStyle");var ko=Eo;var Ar={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},Qt=new WeakMap,Io=null,zn=s((a,e)=>{let t=s((r,n)=>{let i=Qt.get(r);i&&i[n]&&r.dispatchEvent(new Event(n,{}))},"sendEvent"),o=s((r,n)=>{n&&t(r,"created");for(let i=r.firstChild;i;i=i.nextSibling)o(i,n);n||t(r,"removed")},"notify");for(let r of a)r.type=="childList"&&(r.addedNodes&&r.addedNodes.forEach(n=>{o(n,!0)}),r.removedNodes&&r.removedNodes.forEach(n=>{o(n,!1)}))},"observeMutation"),Ao=null;function On(a){a.forEach(e=>{let t=e.target;t.offsetParent!==null&&t.dispatchEvent(new Event("resized"))})}s(On,"observeSize");function Mr(a){let e=a.target,t=Ar[a.type]===2;for(;e;){let o=Qt.get(e);if(o){let r=o[a.type];if(r&&(Array.isArray(r)?r.some(n=>n(a)):r(a),a.stopPropagation||a.defaultPrevented||t))break}if(e=e.parentNode,e==document)break}}s(Mr,"dispatchEvent");function Tt(a,e,t,o=!1){e=="removed"||e=="created"?Io||(Io=new MutationObserver(zn),Io.observe(document.body,{childList:!0,subtree:!0})):e=="resized"&&(Ao||(Ao=new ResizeObserver(On)),Ao.observe(a));let r=Qt.get(a);if(r||(r={},Qt.set(a,r)),!r[e])r[e]=t,a.addEventListener(e,Mr);else{let n=r[e];Array.isArray(n)?n.push(t):r[e]=[n,t]}}s(Tt,"addEvent");var Dr=Symbol("fragment"),Pr=Symbol("component"),Vn=/^-?\d+(\.\d*)?$/;function Hn(a){let e=[],t=Object.getPrototypeOf(a);if(t.constructor==d)return["x4-comp"];for(;t&&t.constructor!==d;){let o=t.constructor.name,r=Object.prototype.hasOwnProperty.call(t.constructor,At)?t.constructor[At]:"";e.push(r+o.toLowerCase()),t=Object.getPrototypeOf(t)}return e}s(Hn,"genClassNames");var Nn=1e3,q=s(()=>`x4-${Nn++}`,"makeUniqueComponentId"),Te,d=class extends re{constructor(t){var o,r;super();O(this,"dom");O(this,"props");O(this,"clsprefix");ae(this,Te);if(this.props=t,t.existingDOM)this.dom=t.existingDOM;else{t.ns?this.dom=document.createElementNS(t.ns,(o=t.tag)!=null?o:"div"):this.dom=document.createElement((r=t.tag)!=null?r:"div"),t.attrs&&this.setAttributes(t.attrs),t.cls&&this.addClass(t.cls),t.hidden&&this.show(!1),t.flex===!0?this.addClass("x4flex"):t.flex!==void 0&&this.setStyle({flexGrow:t.flex+""}),t.id!==void 0&&this.setAttribute("id",t.id),t.width!==void 0&&this.setStyleValue("width",t.width),t.height!==void 0&&this.setStyleValue("height",t.height),t.tooltip&&this.setAttribute("tooltip",t.tooltip),t.style&&this.setStyle(t.style),t.content&&this.setContent(t.content),t.dom_events&&this.setDOMEvents(t.dom_events);let n=Hn(this);this.dom.classList.add(...n),t.disabled&&this.addDOMEvent("created",()=>{this.enable(!1)})}this.dom[Pr]=this}hasClass(t){return this.dom.classList.contains(t)}addClass(t){if(t)if(t.indexOf(" ")>=0){t=t.trim();let o=t.split(" ");this.dom.classList.add(...o)}else this.dom.classList.add(t)}removeClass(t){if(t){if(t=="*"){this.dom.classList.value="";return}if(t.indexOf(" ")>=0){let o=t.split(" ");this.dom.classList.remove(...o)}else this.dom.classList.remove(t)}}removeClassEx(t){Array.from(this.dom.classList).forEach(r=>{r.match(t)&&this.dom.classList.remove(r)})}toggleClass(t){if(!t)return;let o=s(r=>{this.dom.classList.toggle(r)},"toggle");t.indexOf(" ")>=0?t.split(" ").forEach(o):o(t)}setClass(t,o=!0){return o?this.addClass(t):this.removeClass(t),this}setAttributes(t){for(let o in t)this.setAttribute(o,t[o]);return this}setAttribute(t,o){o==null?this.dom.removeAttribute(t):this.dom.setAttribute(t,""+o)}getAttribute(t){return this.dom.getAttribute(t)}getData(t){return this.getAttribute("data-"+t)}getIntData(t){let o=parseInt(this.getAttribute("data-"+t));if(Number.isFinite(o))return o}setData(t,o){return this.setAttribute("data-"+t,o)}setInternalData(t,o){return P(this,Te)||le(this,Te,new Map),P(this,Te).set(t,o),this}getInternalData(t){var o;return(o=P(this,Te))==null?void 0:o.get(t)}addDOMEvent(t,o,r=!1){Tt(this.dom,t,o,r)}setDOMEvents(t){for(let o in t)this.addDOMEvent(o,t[o])}mapPropEvents(t,...o){let r=t;o.forEach(n=>{Object.prototype.hasOwnProperty.call(r,n)&&r[n]&&this.on(n,r[n])})}clearContent(){let t=this.dom;for(;t.firstChild;)t.removeChild(t.firstChild)}setContent(t){this.clearContent(),this.appendContent(t)}appendContent(t){let o=s((r,n)=>{if(n instanceof d)r.appendChild(n.dom);else if(n instanceof Ae)r.insertAdjacentHTML("beforeend",n.toString());else if(typeof n=="string"||typeof n=="number"){let i=document.createTextNode(n.toString());r.appendChild(i)}else n&&console.warn("Unknown type to append: ",n)},"set");if(!Y(t))o(this.dom,t);else if(t.length<=8)for(let r of t)o(this.dom,r);else{let r=document.createDocumentFragment();for(let n of t)o(r,n);this.dom.appendChild(r)}}prependContent(t){let o=this.dom,r=s(n=>{n instanceof d?o.insertAdjacentElement("afterbegin",n.dom):n instanceof Ae?o.insertAdjacentHTML("afterbegin",n.toString()):typeof n=="string"||typeof n=="number"?o.insertAdjacentText("afterbegin",n.toString()):console.warn("Unknown type to append: ",n)},"set");if(!Y(t))r(t);else{let n=document.createDocumentFragment();for(let i of t)r(i);o.insertBefore(o.firstChild,n)}}removeChild(t){this.dom.removeChild(t.dom)}queryAll(t){let o=this.dom.querySelectorAll(t),r=new Array(o.length);return o.forEach((n,i)=>r[i]=$t(n)),r}query(t){let o=this.dom.querySelector(t);return T(o)}setAria(t,o){return this.setAttribute(t,o),this}setStyle(t){let o=this.dom.style;for(let r in t){let n=t[r];!Pt[r]&&(V(n)||Vn.test(n))&&(n+="px"),o[r]=n}return this}setStyleValue(t,o){let r=this.dom.style;if(V(o)){let n=o+"";Pt[t]||(n+="px"),r[t]=n}else r[t]=o;return this}getStyleValue(t){return this.dom.style[t]}setWidth(t){this.setStyleValue("width",V(t)?t+"px":t)}setHeight(t){this.setStyleValue("height",V(t)?t+"px":t)}setStyleVariable(t,o){this.dom.style.setProperty(t,o)}getStyleVariable(t){return this.getComputedStyle().getPropertyValue(t)}getComputedStyle(){return getComputedStyle(this.dom)}setCapture(t){this.dom.setPointerCapture(t)}releaseCapture(t){this.dom.releasePointerCapture(t)}getBoundingRect(){let t=this.dom.getBoundingClientRect();return new Me(t.x,t.y,t.width,t.height)}focus(){return this.dom.focus(),this}hasFocus(){return document.activeElement==this.dom}scrollIntoView(t){this.dom.scrollIntoView(t)}isVisible(){return this.dom.offsetParent!==null}show(t=!0){return this.setClass("x4hidden",!t),this}hide(){return this.show(!1),this}enable(t=!0){return this.setAttribute("disabled",t?null:"true"),(this.dom instanceof HTMLInputElement||this.dom instanceof HTMLButtonElement)&&(this.dom.disabled=!t),this.enumChildNodes(!0).forEach(r=>{(r instanceof HTMLInputElement||r instanceof HTMLButtonElement)&&(r.disabled=!t)}),this}disable(){return this.enable(!1),this}isDisabled(){return this.getAttribute("disabled")}nextElement(){let t=this.dom.nextElementSibling;return T(t)}prevElement(){let t=this.dom.previousElementSibling;return T(t)}parentElement(t){return d.parentElement(this.dom,t)}static parentElement(t,o){for(;t.parentElement;){let r=T(t.parentElement);if(!o||r&&r instanceof o)return r;t=t.parentElement}return null}firstChild(){let t=this.dom.firstElementChild;return T(t)}lastChild(){let t=this.dom.lastElementChild;return T(t)}enumChildComponents(t){let o=[];return this.enumChildNodes(t).forEach(n=>{let i=T(n);i&&o.push(i)}),o}enumChildNodes(t){return Array.from(t?this.dom.querySelectorAll("*"):this.dom.children)}animate(t,o){this.dom.animate(t,o)}static createElement(t,o,...r){let n;return t==this.createFragment||t===Dr?r:(t instanceof Function?(o=o!=null?o:{},!o.children&&r&&r.length&&(o.content=r),n=new t(o!=null?o:{})):n=new d({tag:t,content:r,...o}),r&&r.length,n)}static createFragment(){return this.createElement(Dr,null)}queryInterface(t){return null}};Te=new WeakMap,s(d,"Component"),d=u([p("x4")],d);function T(a){return a?a[Pr]:null}s(T,"componentFromDOM");function $t(a){let e=T(a);return e||new d({existingDOM:a})}s($t,"wrapDOM");var Mo=class Mo extends d{constructor(){super({})}};s(Mo,"Flex");var ne=Mo,Do=class Do extends d{constructor(e,t){super({width:e,cls:t})}};s(Do,"Space");var St=Do;var Tr=Symbol("socket"),Po=null,So=class So{getMaxTouchPoints(){return navigator.maxTouchPoints}};s(So,"Process");var To=So,Lt=class Lt extends re{env=new Map;mainview;constructor(){super(),console.assert(Po==null,"Application must be a singleton."),Po=this}setMainView(e){this.mainview=e,document.body.appendChild(e.dom),this._setupKeyboard()}static instance(){return Po}getMainView(){return this.mainview}setEnv(e,t){this.env.set(e,t)}getEnv(e,t){var o;return(o=this.env.get(e))!=null?o:t}static fireGlobal(e,t){Lt.instance().fire("global",{msg:e,params:t})}_setupKeyboard(){document.addEventListener("keydown",e=>{(e.key=="Tab"||e.key=="Enter")&&this.focusNext(!e.shiftKey)&&e.preventDefault()})}focusNext(e){let t=document.activeElement,o;for(;t!=document.body;){let n=T(t).queryInterface("tab-handler");if(n)return n.focusNext(e);t.classList.contains("x4box")&&(o=t),t=t.parentElement}if(o){let r=Mt(o);if(r.length){let n=r[0],i=r[r.length-1],l;if(!e&&document.activeElement===n?l=i:e&&document.activeElement===i&&(l=n),l)return l.focus(),!0}else return!0}return!1}setupSocketMessaging(e,t){let o=window.location.protocol==="https:"?"wss://":"ws://",r=e?o+e:`${o}${window.location.hostname}:${window.location.port}/ws`,n=0,i=null;this.on("global",l=>{Object.prototype.hasOwnProperty.call(l,Tr)||i&&i.send(JSON.stringify({msg:l.msg,params:l.params}))}),i=new WebSocket(r,"messaging"),i.onopen=()=>{console.log("websocket opened"),n=1},i.onmessage=l=>{if(l.data!="ping"){let c=JSON.parse(l.data);c[Tr]=!0,this.fire("global",c)}},i.onclose=l=>{console.log("websocket closed:",l),i=null,n&&(t(),n=0)}}getStorage(e){return localStorage.getItem(e)}getStorageJSON(e){try{return JSON.parse(localStorage.getItem(e))}catch{return}}setStorage(e,t){localStorage.setItem(e,t+"")}setStorageJSON(e,t){localStorage.setItem(e,JSON.stringify(t))}};s(Lt,"Application"),O(Lt,"process",new To);var Rt=Lt;function Se(a){return a.toString(16).padStart(2,"0")}s(Se,"hx");function gt(a){return Math.round(a)}s(gt,"round");var Lo=class Lo{rgb=[0,0,0,1];invalid=!1;constructor(...e){M(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),i=parseInt(e[5],16),l=parseInt(e[6],16);return this.setRgb(t<<4|o,r<<4|n,i<<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),i=parseInt(e[5],16),l=parseInt(e[6],16),c=parseInt(e[7],16),h=parseInt(e[8],16);return this.setRgb(t<<4|o,r<<4|n,i<<4|l,(c<<4|h)/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(),i=getComputedStyle(document.documentElement).getPropertyValue(r);return this.setValue(i)}}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)),i=e*6-n,l=o*(1-t),c=o*(1-i*t),h=o*(1-(1-i)*t),g,f,m;switch(n){case 0:g=o,f=h,m=l;break;case 1:g=c,f=o,m=l;break;case 2:g=l,f=o,m=h;break;case 3:g=l,f=c,m=o;break;case 4:g=h,f=l,m=o;break;case 5:g=o,f=l,m=c;break}return this.setRgb(g*255,f*255,m*255,r)}setRgb(e,t,o,r){return this.rgb=[G(e|0,0,255),G(t|0,0,255),G(o|0,0,255),G(r,0,1)],this}toRgbString(e){let t=this.rgb;return e===!1||t[3]==1?`rgb(${gt(t[0])},${gt(t[1])},${gt(t[2])})`:`rgba(${gt(t[0])},${gt(t[1])},${gt(t[2])},${t[3].toFixed(3)})`}toHexString(){let e=this.rgb;return e[3]==1?`#${Se(e[0])}${Se(e[1])}${Se(e[2])}`:`#${Se(e[0])}${Se(e[1])}${Se(e[2])}${Se(e[3]*255|0)}`}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,i=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:i,alpha:e.alpha}}getAlpha(){return this.rgb[3]}setAlpha(e){return this.rgb[3]=G(e,0,1),this}isInvalid(){return this.invalid}};s(Lo,"Color");var N=Lo;var zo=class zo{name;id;fields;constructor(e){this.name=e,this.id=void 0,this.fields=[]}};s(zo,"MetaInfos");var Ro=zo,Zt=Symbol("metaField");function Xt(a,e=!0){let t=a.constructor,o=Object.prototype.hasOwnProperty.call(t,Zt)?t[Zt]:void 0;if(o===void 0){e||console.assert(o!==void 0),o=new Ro(t.name);let r=Object.getPrototypeOf(t);if(r!=Jt){let n=r[Zt];o.fields=[...n.fields,...o.fields],console.assert(o.id===void 0,"cannot define mutiple record id"),o.id||(o.id=n.id)}a.constructor[Zt]=o}return o}s(Xt,"_getMetas");var Fo;(g=>{function a(){return(f,m)=>{let x=Xt(f);x.fields.push({name:m,type:"any",required:!0}),x.id=m}}g.id=a,s(a,"id");function e(f){return(m,x)=>{Xt(m).fields.push({name:x,...f})}}g.field=e,s(e,"field");function t(f){return e({...f,type:"string"})}g.string=t,s(t,"string");function o(f){return e({...f,type:"int"})}g.int=o,s(o,"int");function r(f){return e({...f,type:"float"})}g.float=r,s(r,"float");function n(f){return e({...f,type:"bool"})}g.bool=n,s(n,"bool");function i(f){return e({...f,type:"date"})}g.date=i,s(i,"date");function l(f){return e({...f,type:"calc"})}g.calc=l,s(l,"calc");function c(f,m){return g.field({...m,type:"array",model:f?new f:null})}g.array=c,s(c,"array");function h(f){return e({...f,type:"any"})}g.any=h,s(h,"any")})(Fo||(Fo={}));var Oo=class Oo{getFields(){return Xt(this,!1).fields}validate(e){let t=null;return this.getFields().forEach(r=>{r.required&&!this.getField(r.name,e)&&(t&&(t=[]),t.push(new Error(`field ${r.name} is required.`)))}),t}getFieldIndex(e){return this.getFields().findIndex(o=>o.name==e)}serialize(e){let t={};return this.getFields().forEach(o=>{o.calc===void 0&&(t[o.name]=e[o.name])}),t}unSerialize(e,t){let o=this.getFields(),r=new Ft;return o.forEach(n=>{let i=e[n.name];i!==void 0&&(r[n.name]=this._convertField(n,i))}),t!==void 0?r[o[0].name]=t:console.assert(this.getID(r)!==void 0),r}_convertField(e,t){switch(e.type){case"float":{let o=typeof t=="number"?t:parseFloat(t);if(e.prec!==void 0){let r=Math.pow(10,e.prec);o=Math.round(o*r)/r}return o}case"int":return typeof t=="number"?t:parseInt(t);case"date":return M(t)?new Date(t):t;case"array":{debugger;break}}return t}getID(e){if(!e)return null;let t=Xt(this,!1);return e[t.id]}getRaw(e,t){let o,r=this.getFields();if(typeof e=="string"){if(o=r.findIndex(i=>i.name==e),o<0){console.assert(!1,"unknown field: "+e);return}}else if(e<r.length){if(e<0)return;o=e}else{console.assert(!1,"bad field name: "+e);return}let n=r[o];return n.calc!==void 0?n.calc(t):t[n.name]}getField(e,t){let o=this.getRaw(e,t);return o==null?"":""+o}};s(Oo,"DataModel");var Jt=Oo,Vo=class Vo{};s(Vo,"DataRecord");var Ft=Vo,Ho=class Ho extends re{m_props;constructor(e){super(),this.m_props=e}async load(e){e?this.m_props.url=e:e=this.m_props.url,this.m_props.params&&(e+="?"+this.m_props.params.join("&"));let t=await fetch(e);if(t.ok){let o=await t.json(),r=o;this.m_props.solver&&(r=this.m_props.solver(r)),this.fire("change",{value:r,context:o})}}};s(Ho,"DataProxy");var eo=Ho,No=class No extends de{m_model;m_fields;m_records;m_proxy;m_rec_index;constructor(e){super(),this.m_fields=void 0,this.m_records=[],this.m_rec_index=null,this.m_model=e.model,this.m_fields=e.model.getFields(),e.data?this.setRawData(e.data):e.url&&(this.m_proxy=new eo({url:e.url,solver:e.solver}),this.m_proxy.on("change",t=>{this.setData(t.value)}),e.autoload!=!1&&this.m_proxy.load())}async load(e){return this.m_proxy.load(e)}async reload(){return this.m_proxy.load()}setData(e){let t=new Array(e.length);e.forEach((o,r)=>{t[r]=this.m_model.unSerialize(o)}),this.setRawData(t)}setRawData(e){this.m_records=e,this._rebuildIndex(),this.fire("data_change",{change_type:"change"})}_rebuildIndex(){this.m_rec_index=null,this.m_rec_index=this.createIndex(null),this.m_rec_index=this.sortIndex(this.m_rec_index,null)}update(e){let t=this.m_model.getID(e),o=this.indexOfId(t);return o<0?!1:(this.m_records[this.m_rec_index[o]]=e,this.fire("data_change",{change_type:"update",id:t}),!0)}append(e){e instanceof Ft||(e=this.m_model.unSerialize(e));let t=this.m_model.getID(e);console.assert(t!==void 0),this.m_records.push(e),this._rebuildIndex(),this.fire("data_change",{change_type:"create",id:t})}getMaxId(){let e,t=this.m_model;return this.m_records.forEach(o=>{let r=t.getID(o);(e===void 0||e<r)&&(e=r)}),e}delete(e){let t=this.indexOfId(e);return t<0?!1:(t=this.m_rec_index[t],this.m_records.splice(t,1),this._rebuildIndex(),this.fire("data_change",{change_type:"delete",id:e}),!0)}get count(){return this.m_rec_index?this.m_rec_index.length:this.m_records.length}get fields(){return this.m_fields}indexOfId(e){let t=this.m_model;for(let o=this.count,r=0;o!=0;o>>=1){let n=r+(o>>1),i=this.m_rec_index[n],l=t.getID(this.m_records[i]);if(l==e)return n;l<e&&(r=n+1,o--)}return-1}getById(e){let t=this.indexOfId(e);return t<0?null:(t=this.m_rec_index[t],this.m_records[t])}getByIndex(e){let t=this.m_rec_index[e];return this._getRecord(t)}_getRecord(e){var t;return(t=this.m_records[e])!=null?t:null}moveTo(e){e.setRawData(this.m_records)}createView(e){let t={...e,store:this};return new xt(t)}createIndex(e){if(e&&e.op==="empty-result")return new Uint32Array(0);let t=new Uint32Array(this.m_records.length),o=0;if(!e)this.forEach((f,m)=>{t[o++]=m});else if(typeof e.op=="function"){let f=e.op;this.forEach((m,x)=>{m&&f(m)&&(t[o++]=x)})}else{let x=function(R){return R<m},v=function(R){return R<=m},U=function(R){return R==m},w=function(R){return R!=m},S=function(R){return R>=m},J=function(R){return R>m},B=function(R){return fe.lastIndex=-1,fe.test(R)};var r=x,n=v,i=U,l=w,c=S,h=J,g=B;s(x,"_lt"),s(v,"_le"),s(U,"_eq"),s(w,"_neq"),s(S,"_ge"),s(J,"_gt"),s(B,"_re");let f=this.m_model.getFieldIndex(e.field);if(f<0)return console.assert(!1,"unknown field name in filter"),new Uint32Array(0);let m=e.value;M(m)&&!e.caseSensitive&&(m=m.toUpperCase());let L,fe;if(m instanceof RegExp)fe=m,L=B;else switch(e.op){case"<":{L=x;break}case"<=":{L=v;break}case"=":{L=U;break}case">=":{L=S;break}case">":{L=J;break}case"<>":{L=w;break}}let pt=this.m_model;this.forEach((R,qt)=>{if(!R)return;let ee=pt.getRaw(f,R);ee==null?ee="":(ee=""+ee,e.caseSensitive||(ee=ee.toUpperCase())),L(ee)&&(t[o++]=qt)})}return t.slice(0,o)}sortIndex(e,t){let o=0,r=[];if(t===null?r.push({fidx:0,asc:!0}):r=t.map(i=>{let l=this.m_model.getFieldIndex(i.field);return l==-1&&(console.assert(!1,"unknown field name in sort"),o++),{fidx:l,asc:i.ascending}}),o||r.length==0)return e;let n=this.m_model;if(r.length==1){let i=r[0].fidx;e.sort((l,c)=>{var f,m;let h=(f=n.getRaw(i,this.getByIndex(l)))!=null?f:"",g=(m=n.getRaw(i,this.getByIndex(c)))!=null?m:"";return h>g?1:h<g?-1:0}),r[0].asc||e.reverse()}else e.sort((i,l)=>{var c,h;for(let g=0;g<r.length;g++){let f=r[g].fidx,m=r[g].asc?1:-1,x=(c=n.getRaw(f,this.getByIndex(i)))!=null?c:"",v=(h=n.getRaw(f,this.getByIndex(l)))!=null?h:"";if(x>v)return m;if(x<v)return-m}return 0});return e}forEach(e){this.m_rec_index?this.m_rec_index.some((t,o)=>{if(e(this.m_records[t],o))return o}):this.m_records.some((t,o)=>{if(t&&e(t,o))return o})}export(){return this.m_records}changed(){this.fire("data_change",{change_type:"change"})}getModel(){return this.m_model}};s(No,"DataStore");var Bo=No,Uo=class Uo extends re{m_index;m_store;m_model;m_sort;m_filter;m_props;constructor(e){super(),this.m_props=e,this.m_store=e.store,this.m_index=null,this.m_filter=null,this.m_sort=null,this.m_model=this.m_store.getModel(),this.filter(e.filter),e.order?M(e.order)?this.sort([{field:e.order,ascending:!0}]):Y(e.order)?this.sort(e.order):this.sort([e.order]):this.sort(null),this.m_store.addListener("data_change",t=>this._storeChange(t))}_storeChange(e){this._filter(this.m_filter,e.type!="change"),this._sort(this.m_sort,e.type!="change"),this.fire("view_change",{change_type:"change"})}filter(e){return this.m_index=null,this._filter(e,!0)}_filter(e,t){return this.m_index=this.m_store.createIndex(e),this.m_filter=e,this.m_sort&&this.sort(this.m_sort),t&&this.fire("view_change",{change_type:"filter"}),this.m_index.length}sort(e){this._sort(e,!0)}_sort(e,t){this.m_index=this.m_store.sortIndex(this.m_index,e),this.m_sort=e,t&&this.fire("view_change",{change_type:"sort"})}getStore(){return this.m_store}getCount(){return this.m_index.length}indexOfId(e){let t=this.m_store.indexOfId(e);return this.m_index.findIndex(o=>o===t)}getByIndex(e){if(e>=0&&e<this.m_index.length){let t=this.m_index[e];return this.m_store.getByIndex(t)}return null}getIdByIndex(e){let t=this.getByIndex(e);return this.m_model.getID(t)}getRecId(e){return this.m_model.getID(e)}getById(e){return this.m_store.getById(e)}getModel(){return this.m_model}changed(){this.fire("view_change",{change_type:"change"})}forEach(e){this.m_index.some(t=>{let o=this.m_store.getByIndex(t);if(o&&e(o,t))return t})}};s(Uo,"DataView");var xt=Uo;var qo=Symbol("x-drag-cb"),Go=class Go{dragSource;dragGhost;dropTarget;notified;timer;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=s(c=>{if(o&&!o(this.dragSource,c.dataTransfer)){console.log("reject ",e),c.dataTransfer.dropEffect="none";return}console.log("accepted ",e),c.preventDefault(),c.dataTransfer.dropEffect="copy"},"dragEnter"),n=s(c=>{if(o&&!o(this.dragSource,c.dataTransfer)){console.log("reject ",e),c.dataTransfer.dropEffect="none";return}if(c.preventDefault(),this.dropTarget!=e&&(this.dropTarget=e,this._startCheck()),this.dropTarget){let h={pt:{x:c.pageX,y:c.pageY},data:c.dataTransfer};t("drag",this.dragSource,h)}c.dataTransfer.dropEffect="copy"},"dragOver"),i=s(c=>{this.dropTarget=null,c.preventDefault()},"dragLeave"),l=s(c=>{let h={pt:{x:c.pageX,y:c.pageY},data:c.dataTransfer};t("drop",this.dragSource,h),this.dropTarget=null,e.removeClass("drop-over"),c.preventDefault()},"drop");e.addDOMEvent("dragenter",r),e.addDOMEvent("dragover",n),e.addDOMEvent("dragleave",i),e.addDOMEvent("drop",l),e.setInternalData(qo,t)}_startCheck(){this.timer&&(clearInterval(this.timer),this._check()),this.timer=setInterval(()=>this._check(),300)}_check(){let e=s(o=>{o.removeClass("drop-over"),o.getInternalData(qo)("leave",this.dragSource)},"leaving"),t=s(o=>{o.addClass("drop-over"),o.getInternalData(qo)("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))}};s(Go,"DragManager");var Ko=Go,Bt=new Ko;var jo=class jo{static create_element(e,t,...o){t=t||{};let r;return M(e)?(r=new d({tag:e}),Object.entries(t).forEach(([n,i])=>{n.startsWith("on")&&n.toLowerCase()in window?r.dom.addEventListener(n.toLowerCase().substring(2),i):r.setAttribute(n,i)})):r=new e(t),o&&o.length&&r.appendContent(o),r}};s(jo,"x4_react");var Wo=jo;function Sr(a,e=!1){if(a instanceof RegExp)return{keys:null,pattern:a};let t=a.split("/"),o=[],r="";t[0]==""&&t.shift();for(let n of t){let i=n[0];if(i==="*")o.push("wild"),r+="/(.*)";else if(i===":"){let l=n.indexOf("?",1),c=n.indexOf(".",1);o.push(n.substring(1,l>=0?l:c>=0?c:n.length)),r+=l>=0&&c<0?"(?:/([^/]+?))?":"/([^/]+?)",c>=0&&(r+=(l>=0?"?":"")+"\\"+n.substring(c))}else r+="/"+n}return{keys:o,pattern:new RegExp(`^${r}${e?"(?=$|/)":"/?$"}`,"i")}}s(Sr,"parseRoute");var Qo=class Qo extends de{m_routes;m_useHash;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)}),this.fire("change",{value:this._getLocation()})})}get(e,t){let{keys:o,pattern:r}=Sr(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)return console.log("route not found: "+e),this.fire("error",{code:404,message:"route not found"}),!1;if(this.m_useHash){for(;e.at(0)=="/";)e=e.substring(1);e="#"+e}return o?window.history.replaceState({},"",e):window.history.pushState({},"",e),t&&r.handlers[0](r.params,e),this.fire("change",{value:this._getLocation()}),!0}_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 i=0;i<n.keys.length;)o[n.keys[i]]=t[++i];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 i in t.groups)o[i]=t.groups[i];r=[...r,n.handler]}return{params:o,handlers:r}}};s(Qo,"Router");var Yo=Qo;var Zo=class Zo{_state;_subscribers;_currentTracking;constructor(e){this._state=e?{...e}:{},this._subscribers=new Map,this._currentTracking=new Set}getState(e,t=null){this._currentTracking&&this._currentTracking.add(e);let o=e.split("."),r=this._state;for(let n of o){if((r==null?void 0:r[n])===void 0)return t;r=r[n]}return r}setState(e,t,o={}){let r=e.split("."),n=this._state;for(let i=0;i<r.length-1;i++){let l=r[i];(!n[l]||typeof n[l]!="object")&&(n[l]={}),n=n[l]}n[r[r.length-1]]=t,this._notifySubscribers(e,t)}};s(Zo,"StateManager");var $o=Zo;var Lr="http://www.w3.org/2000/svg";function Un(a){return a*Math.PI/180}s(Un,"d2r");function Rr(a,e,t,o){let r=Un(o);return{x:a+t*Math.cos(r),y:e+t*Math.sin(r)}}s(Rr,"p2c");function D(a){return Math.round(a*1e3)/1e3}s(D,"num");function to(a,...e){return e=e.map(t=>typeof t=="number"&&isFinite(t)?D(t):t),String.raw(a,...e)}s(to,"clean");var Xo=class Xo{_dom;constructor(e){this._dom=document.createElementNS("http://www.w3.org/2000/svg",e)}getDom(){return this._dom}reset(){let e=this._dom.attributes;for(let t=e.length-1;t>=0;t--)this._dom.removeAttribute(e[t].name);return this}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}getAttr(e){return this._dom.getAttribute(e)}getNumAttr(e){return parseInt(this._dom.getAttribute(e))}setAttr(e,t){return this._dom.setAttribute(e,t),this}setStyle(e,t){let o=this._dom.style;if(V(t)){let r=t+"";Co(e)||(r+="px"),o[e]=r}else o[e]=t;return this}addClass(e){if(e){if(e=e.trim(),e.indexOf(" ")>=0){let t=e.split(" ");this._dom.classList.add(...t)}else this._dom.classList.add(e);return this}}removeClass(e){if(e){if(e.indexOf(" ")>=0){let t=e.split(" ");this._dom.classList.remove(...t)}else this._dom.classList.remove(e);return this}}clip(e){return this.setAttr("clip-path",`url(#${e})`),this}transform(e){var o;let t=(o=this.getAttr("transform"))!=null?o:"";return this.setAttr("transform",t+" "+e),this}clear_transform(){return this.setAttr("transform",null),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 Tt(this._dom,e,t,o),this}};s(Xo,"SvgItem");var be=Xo,Jo=class Jo extends be{_path;constructor(){super("path"),this._path=""}_update(){return this.setAttr("d",this._path),this}reset(){return this._path="",super.reset(),this}moveTo(e,t){return this._path+=to`M${e},${t}`,this._update()}lineTo(e,t){return this._path+=to`L${e},${t}`,this._update()}curveTo(e,t,o,r,n,i){return this._path+=to`C${e},${t} ${o},${r} ${n},${i}`,this._update()}closePath(){return this._path+="Z",this._update()}arc(e,t,o,r,n,i=!0){let l=Rr(e,t,o,r-90),c=Rr(e,t,o,n-90),h=n-r<=180?"0":"1";return this._path+=to`M${l.x},${l.y}A${o},${o} 0 ${h} ${i?"1":"0"} ${c.x},${c.y}`,this._update()}};s(Jo,"SvgPath");var oo=Jo,er=class er extends be{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)}};s(er,"SvgText");var ro=er,tr=class tr extends be{constructor(e){super("svg"),e.startsWith("data:image/svg+xml,")&&(e=e.substring(19));let o=new DOMParser().parseFromString(decodeURIComponent(e),"image/svg+xml"),r=o.querySelector("parsererror");r&&console.error(`error while parsing svg:
2
+ `+r.textContent);let n=o.documentElement;for(let i=0;i<n.attributes.length;i++)this._dom.setAttribute(n.attributes[i].name,n.attributes[i].value);for(let i=0;i<n.childNodes.length;i++){let l=n.childNodes[i];l.nodeType===1&&this._dom.appendChild(l)}}};s(tr,"SvgIcon");var no=tr,or=class or extends be{constructor(e){super(e)}};s(or,"SvgShape");var vt=or,bt=class bt extends be{_id;_stops;constructor(e,t,o,r){super("linearGradient"),this._id="gx-"+bt.g_id,bt.g_id++,this.setAttr("id",this._id),this.setAttr("x1",M(e)?e:D(e)+""),this.setAttr("x2",M(o)?o:D(o)+""),this.setAttr("y1",M(t)?t:D(t)+""),this.setAttr("y2",M(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}};s(bt,"SvgGradient"),O(bt,"g_id",1);var io=bt,so=class so extends be{constructor(e="g"){super(e)}append(e){return this._dom.appendChild(e.getDom()),e}appendItems(e){e.forEach(t=>{this._dom.appendChild(t.getDom())})}path(){let e=new oo;return this.append(e)}text(e,t,o){let r=new ro(e,t,o);return this.append(r)}ellipse(e,t,o,r){let n=new vt("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)}circle(e,t,o){let r=new vt("ellipse");return r.setAttr("cx",D(e)+""),r.setAttr("cy",D(t)+""),r.setAttr("rx",D(o)+""),r.setAttr("ry",D(o)+""),this.append(r)}icon(e,t,o,r,n){let i=new no(e);return i.setAttr("x",D(t)+""),i.setAttr("y",D(o)+""),i.setAttr("width",D(r)+""),i.setAttr("height",D(n)+""),this.append(i)}rect(e,t,o,r){r<0&&(t=t+r,r=-r);let n=new vt("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(e){let t=new so;return e&&t.setAttr("id",e),this.append(t)}linear_gradient(e,t,o,r){let n=new io(e,t,o,r);return this.append(n)}clear(){let e=this._dom;for(;e.firstChild;)e.removeChild(e.firstChild)}};s(so,"SvgGroup");var _t=so,Le=class Le extends _t{constructor(){super()}addClip(e,t,o,r){let n="clip-"+Le.g_clip_id++,i=new _t("clipPath");return i.setAttr("id",n),i.rect(e,t,o,r),this.append(i),{id:n,clip:i}}addPattern(e,t,o,r){let n="pat-"+Le.g_pat_id++,i=new _t("pattern");return i.setAttr("id",n),i.setAttr("x",D(e)+""),i.setAttr("y",D(t)+""),i.setAttr("width",D(o)+""),i.setAttr("height",D(r)+""),i.setAttr("patternUnits","userSpaceOnUse"),this.append(i),{id:n,pat:i}}};s(Le,"SvgBuilder"),O(Le,"g_clip_id",1),O(Le,"g_pat_id",1);var zt=Le,rr=class rr extends d{constructor(e){super({...e,tag:"svg",ns:Lr}),this.setAttribute("xmlns",Lr),e.viewbox&&this.setAttribute("viewBox",e.viewbox),e.svg&&this.dom.appendChild(e.svg.getDom())}setSvg(e){this.clearContent(),this.dom.appendChild(e.getDom())}addItems(...e){e.forEach(t=>this.dom.appendChild(t.getDom()))}};s(rr,"SvgComponent");var Ot=rr;var C=class extends d{};s(C,"Box"),C=u([p("x4")],C);var b=class extends C{};s(b,"HBox"),b=u([p("x4")],b);var k=class extends C{constructor(e){super(e)}};s(k,"VBox"),k=u([p("x4")],k);var ie=class extends C{_items;_cur;constructor(e){var t;super(e),this.mapPropEvents(e,"pageChange"),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)}addItem(e){this._items.push({name:e.name,content:e.content,page:null})}select(e){var r;let t=this.query(":scope > .selected");t&&t.setClass("selected",!1),this._cur=this._items.findIndex(n=>n.name==e);let o=this._items[this._cur];return o&&(o.page||(o.page=this._createPage(o),this.appendContent(o.page)),t=o.page,t&&((r=t.activate)==null||r.call(t),t.setClass("selected",!0)),te(()=>this.fire("pageChange",{selection:o.name,empty:!t}))),o==null?void 0:o.page}_createPage(e){let t;return e.content instanceof Function?(t=e.content(),e.content=t):t=e.content,t==null||t.setData("stackname",e.name),t}getPage(e){let t=this._items.find(o=>o.name==e);return t?t.content:null}getItem(e){return this._items.find(o=>o.name==e)}getCurPage(){let e=this._items[this._cur];return e==null?void 0:e.name}};s(ie,"StackBox"),ie=u([p("x4")],ie);var Re=class extends ie{selectNextPage(e=!0){let t;e&&this._cur<this._items.length-1?t=this._items[this._cur+1]:!e&&this._cur>0&&(t=this._items[this._cur-1]),t&&this.select(t.name)}isFirstPage(){return this._cur==0}isLastPage(){return this._cur==this._items.length-1}};s(Re,"AssistBox"),Re=u([p("x4")],Re);var Fe=class extends C{constructor(e){super(e),e.rows!==void 0&&this.setRows(e.rows),e.columns!==void 0&&this.setCols(e.columns),e.items&&this.setItems(e.items)}setRows(e){Y(e)?e=e.join(" "):V(e)&&(e=`repeat( ${e}, 1fr )`),this.setStyleValue("gridTemplateRows",e)}setCols(e){Y(e)?e=e.join(" "):V(e)&&(e=`repeat( ${e}, 1fr )`),this.setStyleValue("gridTemplateColumns",e)}setRowCount(e){this.setStyleValue("gridTemplateRows",`repeat(${e})`)}setColCount(e){this.setStyleValue("gridTemplateColumns",`repeat(${e})`)}setTemplate(e){this.setAttribute("grid-template-area",e.map(t=>'"'+t+'"').join(" "))}setItems(e){e.forEach(t=>{t.item.setStyle({gridColumn:t.col+1+"",gridRow:t.row+1+""})}),this.setContent(e.map(t=>t.item))}};s(Fe,"GridBox"),Fe=u([p("x4")],Fe);var Be=class extends C{constructor(e){super(e),this.addDOMEvent("resized",()=>{this.resizeAllItems()}),e.items&&this.setItems(e.items)}resizeItem(e){let t=this.getComputedStyle(),o=parseInt(t.gridAutoRows),r=parseInt(t.rowGap),n=e.query(".content");if(n||(n=e),n&&o+r){let i=n.getBoundingRect(),l=Math.ceil((i.height+r)/(o+r));e.setStyleValue("gridRowEnd","span "+l)}}resizeAllItems(){this.queryAll(".item").forEach(t=>{this.resizeItem(t)})}setItems(e){let t=e.map(o=>new C({cls:"item",content:o}));this.setContent(t)}};s(Be,"MasonryBox"),Be=u([p("x4")],Be);var ze=class extends b{constructor(e){super(e),this.mapPropEvents(e,"click"),e.items&&this.setItems(e.items)}setItems(e){let t=e.map(o=>new I({label:o.label,icon:o.icon,click:s(()=>{o.click?o.click(o.name):this.fire("click",{context:o.name})},"click")}));this.setContent(t)}};s(ze,"Breadcrumbs"),ze=u([p("x4")],ze);var ir=class ir{cache;waiters;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=>{this.cache.set(e,r),this.waiters.get(e).forEach(i=>i(r))}))})}async _load(e){let t=await fetch(e);if(t.ok)return t.text()}};s(ir,"SvgLoader");var nr=ir,wt=new nr,E=class extends d{constructor(e){super(e),this.setIcon(e.iconId)}setIcon(e){if(this.clearContent(),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")?wt.load(e).then(t=>{this.clearContent(),this.dom.insertAdjacentHTML("beforeend",t)}):this.setContent(new d({tag:"img",attrs:{src:e}})),this.removeClass("empty")}else this.addClass("empty")}};s(E,"Icon"),E=u([p("x4")],E);var yt,I=class extends d{constructor(t){super({...t,tag:"button",content:null});ae(this,yt);this.mapPropEvents(t,"click"),t.autorepeat?(this.addDOMEvent("pointerdown",o=>this._on_mouse(o)),this.addDOMEvent("pointerup",o=>this._on_mouse(o))):this.addDOMEvent("click",o=>this._on_click(o)),this.addDOMEvent("keydown",o=>this._on_keydown(o)),this.setContent([new E({id:"icon",iconId:this.props.icon}),le(this,yt,new d({id:"label"}))]),this.setText(t.label),t.tabindex!==!1&&this.setAttribute("tabindex",t.tabindex)}_on_click(t){this.fire("click",{}),t.preventDefault(),t.stopPropagation()}_on_mouse(t){let o=0;if(t.type=="pointerdown"){this.dom.setPointerCapture(t.pointerId);let r=this.props.autorepeat===!0?200:this.props.autorepeat;this.setTimeout("repeat",500,()=>{o++,this.fire("click",{}),this.setInterval("repeat",r,()=>{this.fire("click",{})})})}else this.clearTimeout("repeat"),o||this.fire("click",{})}click(){this.dom.click()}_on_keydown(t){t.key=="Enter"&&(this.click(),t.preventDefault())}setText(t){P(this,yt).setContent(t),P(this,yt).setClass("empty",!t)}setIcon(t){this.query("#icon").setIcon(t)}};yt=new WeakMap,s(I,"Button"),I=u([p("x4")],I);var he=class extends C{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=[],o=s((r,n)=>{let i=r.indexOf(n);if(i>=0)return r.splice(i,1),!0},"hasOption");e==null||e.forEach(r=>{if(r==="-"||r===">>")r=new ne;else if(r=="~")r=new St("1em");else if(M(r)){let n,i=r,[l,...c]=i.split("."),h="";switch(l){case"ok":n=y.global.ok;break;case"cancel":n=y.global.cancel;break;case"abort":n=y.global.abort;break;case"no":n=y.global.no;break;case"yes":n=y.global.yes;break;case"retry":n=y.global.retry;break}r=new I({cls:h,id:l,label:n,click:s(()=>{this.fire("btnclick",{button:l})},"click")}),o(c,"default")&&r.addClass("default"),o(c,"autofocus")&&r.setAttribute("autofocus",!0),o(c,"disabled")&&r.enable(!1),r.addClass(c.join(" "))}t.push(r)}),super.setContent(t)}getButton(e){return this.query("#"+e)}};s(he,"BtnGroup"),he=u([p("x4")],he);var kt,_=class extends d{constructor(t){super({...t,content:null});ae(this,kt);this.setContent([new E({id:"icon",iconId:this.props.icon}),le(this,kt,new d({tag:"span",id:"text"}))]);let o=this.props.text;this.setText(o),t.labelFor&&this.setAttribute("for",t.labelFor)}setText(t){P(this,kt).setContent(t),P(this,kt).setClass("empty",!t)}setIcon(t){this.query("#icon").setIcon(t)}};kt=new WeakMap,s(_,"Label"),_=u([p("x4")],_);var H=class extends d{constructor(e){super({...e}),this.setContent(e.text),e.align&&this.addClass("al-"+e.align)}setText(e){this.setContent(e),this.setClass("empty",!e)}};s(H,"SimpleText"),H=u([p("x4")],H);var F=class extends d{_type;_ref;_delta;constructor(e,t){super({}),this._type=e,this.addClass(e),this.addDOMEvent("pointerdown",o=>{this.setCapture(o.pointerId),this._ref=t!=null?t:T(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.fire("start",{})}),this.addDOMEvent("pointerup",o=>{this.fire("stop",{}),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 i=this._ref.getBoundingRect();this.fire("resize",{size:n?i.width:i.height}),e.preventDefault(),e.stopPropagation()}};s(F,"CSizer"),F=u([p("x4")],F);var $=[],sr=[],Vt=[],Ct;function ao(){return document.body}s(ao,"getRoot");var z=class extends C{_isshown=!1;_ismodal=!1;constructor(e){super(e),this.props.sizable&&this._createSizers(),te(()=>{(this.props.movable===!0||this.props.sizable&&this.props.movable===void 0)&&(this.queryAll(".caption-element").forEach(o=>new Ht(o,this)),this.hasClass("popup-caption")&&new Ht(this,this))})}displayNear(e,t="top left",o="top left",r={x:0,y:0}){this.setStyle({left:"0px",top:"0px"}),this._do_show();let n=this.getBoundingRect(),i=e.left,l=e.top;o.indexOf("right")>=0?i=e.left+e.width:o.indexOf("center")>=0&&(i=e.left+e.width/2),o.indexOf("bottom")>=0?l=e.bottom:o.indexOf("middle")>=0&&(l=e.top+e.height/2),t.indexOf("right")>=0?i-=n.width:t.indexOf("center")>=0&&(i-=n.width/2),t.indexOf("bottom")>=0?l-=n.height:t.indexOf("middle")>=0&&(l-=n.height/2),r&&(i+=r.x,l+=r.y),i+=document.scrollingElement.scrollLeft,l+=document.scrollingElement.scrollTop,this.displayAt(i,l)}displayCenter(e=!0){this.setClass("center",e),this._do_show()}displayAt(e,t){this.setStyle({left:e+"px",top:t+"px"}),this._do_show();let o=this.getBoundingRect(),r=window.innerWidth-16,n=window.innerHeight-16;o.right>r&&this.setStyleValue("left",r-o.width),o.bottom>n&&this.setStyleValue("top",n-o.height)}isOpen(){return this._isshown}_do_hide(){if(!this._isshown)return;this.__hide(),this.__remove(),this._ismodal&&(Vt.pop(),this._hideModalMask());let e=sr.indexOf(this);if(console.assert(e>=0),sr.splice(e,1),this.props.autoClose){let t=$.indexOf(this);t>=0&&($.splice(t,1),$.length==0&&document.removeEventListener("pointerdown",this._dismiss))}this._isshown=!1,this.fire("closed",{})}_do_show(){this._isshown||(this._isshown=!0,this.__append(),this._ismodal&&(Vt.push(this),this._showModalMask()),this.__show(),this.props.autoClose&&($.length==0&&document.addEventListener("pointerdown",this._dismiss),$.push(this),this.setData("close",this.props.autoClose===!0?q():this.props.autoClose)),sr.push(this),this.fire("opened",{}))}__show(){super.show(!0)}__hide(){super.show(!1)}__append(){ao().appendChild(this.dom)}__remove(){ao().removeChild(this.dom)}show(e=!0){return e?this.displayCenter():this._do_hide(),this}close(){this._do_hide()}_dismiss=s(e=>{$.some(o=>o.dom.contains(e.target))||(e.preventDefault(),e.stopPropagation(),this.dismiss())},"_dismiss");dismiss(e=!1){if($.length==0)return;let t=this.getData("close"),o=[],r=[],n=-1;e&&(n=$.indexOf(this)),$.forEach((l,c)=>{l.getData("close")==t&&c>n?o.push(l):r.push(l)});let i=o.reverse();$=r,$.length==0&&document.removeEventListener("pointerdown",this._dismiss),i.forEach(l=>l.close())}_createSizers(){this.appendContent([new F("top"),new F("bottom"),new F("left"),new F("right"),new F("top-left"),new F("bottom-left"),new F("top-right"),new F("bottom-right")])}_showModalMask(){Ct||(Ct=new d({cls:"x4modal-mask"})),ao().insertBefore(Ct.dom,this.dom)}_hideModalMask(){if(Ct){let e=ao();if(Vt.length){let t=Vt[Vt.length-1];e.insertBefore(Ct.dom,t.dom)}else e.removeChild(Ct.dom)}}};s(z,"Popup"),z=u([p("x4")],z);var ar=class ar{ref;delta;self;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:T(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()}};s(ar,"CMover");var Ht=ar;var Fr=400,Oe=class extends d{constructor(){super({})}};s(Oe,"CMenuSep"),Oe=u([p("x4")],Oe);var lo=new De,ve=class extends d{menu;constructor(e){super({disabled:e.disabled,cls:e.cls}),e.menu&&this.addClass("popup"),this.setContent([new E({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",()=>{lo.setTimeout("open",Fr,()=>{this.dismiss(!0)})}),this.addDOMEvent("click",()=>{this.dismiss(!1),e.click&&e.click(new Event("click"))}))}dismiss(e){let t=this.parentElement(W);t&&t.dismiss(e)}openSub(e){let t=s(()=>{this.dismiss(!0);let o=this.getBoundingRect();this.menu.displayAt(o.right-4,o.top)},"open");e?lo.setTimeout("open",Fr,t):(lo.clearTimeout("open"),t())}closeSub(){lo.clearTimeout("open")}};s(ve,"CMenuItem"),ve=u([p("x4")],ve);var W=class extends z{constructor(e){var o;super({...e,autoClose:"menu"}),this.addClass("x4vbox");let t=(o=e.items)==null?void 0:o.map(r=>r==="-"?new Oe:M(r)?new ve({text:r,click:null,cls:"title"}):r instanceof d?r:new ve(r));this.setContent(t)}};s(W,"Menu"),W=u([p("x4")],W);var Br='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 zr='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 Or='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 Ve=class extends k{m_date;constructor(e){super(e),this.mapPropEvents(e,"change"),this.m_date=e.date?Pe(e.date):new Date,this._update()}_update(){let e=Pe(this.m_date);e.setDate(1);let t=e.getDay();t==0&&(t=7),e.setDate(-t+1+1);let o=Pe(e),r=ge(this.m_date),n=ge(new Date),i=Pe(this.m_date);i.setDate(1),i.setMonth(i.getMonth()+1),i.setDate(0);let l=ge(i),c=[],h=new b({cls:"month-sel",content:[new _({cls:"month",text:j(this.m_date,"O"),dom_events:{click:s(()=>this._choose("month"),"click")}}),new _({cls:"year",text:j(this.m_date,"Y"),dom_events:{click:s(()=>this._choose("year"),"click")}}),new ne,new I({icon:Br,click:s(()=>this._next(!1),"click")}),new I({icon:zr,click:s(()=>this.setDate(new Date),"click"),tooltip:y.global.today}),new I({icon:Or,click:s(()=>this._next(!0),"click")})]});c.push(h);let g=[];g.push(new b({cls:"weeknum cell"}));for(let x=0;x<7;x++)g.push(new _({cls:"cell",text:y.global.day_short[(x+1)%7]}));c.push(new b({cls:"week header",content:g}));let f=this.m_date.getMonth(),m=!0;for(;ge(o)<=l;){let x=[new b({cls:"weeknum cell",content:new d({tag:"span",content:j(o,"w")})})];for(let v=0;v<7;v++){let U="cell day";ge(o)==r&&(U+=" selection"),ge(o)==n&&(U+=" today"),o.getMonth()!=f&&(U+=" out");let w=s(S=>new b({cls:U,flex:1,content:new d({cls:"text",content:ft(`<span>${j(S,"d")}</span>`)}),dom_events:{click:s(()=>this.select(S),"click")}}),"mkItem");x.push(w(Pe(o))),o.setDate(o.getDate()+1),m=!1}c.push(new b({cls:"week",flex:1,content:x}))}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 n,i,l,c;let t=[];if(e=="month")for(let h=0;h<12;h++)t.push({text:y.global.month_long[h],click:s(()=>{this.m_date.setMonth(h),this._update()},"click")});else if(e=="year"){let h=(i=(n=this.props.minDate)==null?void 0:n.getFullYear())!=null?i:1900,g=(c=(l=this.props.maxDate)==null?void 0:l.getFullYear())!=null?c:2037;for(let f=g;f>=h;f--)t.push({text:""+f,click:s(()=>{this.m_date.setFullYear(f),this._update()},"click")})}let o=new W({items:t}),r=this.getBoundingRect();o.displayAt(r.left,r.top)}getDate(){return this.m_date}setDate(e){this.m_date=e,this._update()}};s(Ve,"Calendar"),Ve=u([p("x4")],Ve);function lr(a,e,t){let o=a;return o.width=e,o.height=t,o.smoothLine=Wn,o.smoothLineEx=jn,o.line=Yn,o.roundRect=Qn,o.calcTextSize=$n,o.setFontSize=Zn,o.circle=Xn,o}s(lr,"createPainter");function Wn(a,e=null,t=!0){if(a.length<2)return;if(e||(e=this),a.length==2){t!==!1?e.moveTo(a[0].x,a[0].y):e.lineTo(a[0].x,a[0].y),e.lineTo(a[1].x,a[1].y);return}function o(c,h){return{x:c.x+(h.x-c.x)/2,y:c.y+(h.y-c.y)/2}}s(o,"midPointBtw");function r(c,h,g,f,m,x,v){return{x:(1-c)*(1-c)*h+2*(1-c)*c*f+c*c*x,y:(1-c)*(1-c)*g+2*(1-c)*c*m+c*c*v}}s(r,"getQuadraticXY");let n=a[0],i=a[1],l=n;e.moveTo(n.x,n.y);for(let c=1,h=a.length;c<h;c++){let g=o(n,i);for(let f=0;f<8;f++){let{x:m,y:x}=r(f/8,l.x,l.y,n.x,n.y,g.x,g.y);e.lineTo(m,x)}n=a[c],i=a[c+1],l=g}e.lineTo(n.x,n.y)}s(Wn,"smoothLine");function jn(a,e=.5,t=10,o=null,r=!0,n=!1){let i=[];for(let w=0,S=a.length;w<S;w++)i.push(a[w].x),i.push(a[w].y);let l,c=1,h=i.length,g=0,f=(h-2)*t+2+(n?2*t:0),m=new Float32Array(f),x=new Float32Array((t+2)*4),v=4;for(l=i.slice(0),n?(l.unshift(i[h-1]),l.unshift(i[h-2]),l.push(i[0],i[1])):(l.unshift(i[1]),l.unshift(i[0]),l.push(i[h-2],i[h-1])),x[0]=1;c<t;c++){let w=c/t,S=w*w,J=S*w,B=J*2,L=S*3;x[v++]=B-L+1,x[v++]=L-B,x[v++]=J-2*S+w,x[v++]=J-S}x[v]=1,U(l,x,h),n&&(l=[],l.push(i[h-4],i[h-3],i[h-2],i[h-1]),l.push(i[0],i[1],i[2],i[3]),U(l,x,4));function U(w,S,J){for(let B=2,L;B<J;B+=2){let fe=w[B],pt=w[B+1],R=w[B+2],qt=w[B+3],ee=(R-w[B-2])*e,fr=(qt-w[B-1])*e,sn=(w[B+4]-fe)*e,an=(w[B+5]-pt)*e;for(L=0;L<t;L++){let Kt=L<<2,gr=S[Kt],xr=S[Kt+1],br=S[Kt+2],vr=S[Kt+3];m[g++]=gr*fe+xr*R+br*ee+vr*sn,m[g++]=gr*pt+xr*qt+br*fr+vr*an}}}s(U,"parse"),h=n?0:i.length-2,m[g++]=i[h],m[g]=i[h+1],o||(o=this);for(let w=0,S=m.length;w<S;w+=2)w==0&&r!==!1?o.moveTo(m[w],m[w+1]):o.lineTo(m[w],m[w+1])}s(jn,"smoothLineEx");function Yn(a,e,t,o,r,n=1){this.save(),this.beginPath(),this.moveTo(a,e),this.lineTo(t,o),this.lineWidth=n,this.strokeStyle=r,this.stroke(),this.restore()}s(Yn,"line");function Qn(a,e,t,o,r){this.moveTo(a+r,e),this.lineTo(a+t-r,e),this.quadraticCurveTo(a+t,e,a+t,e+r),this.lineTo(a+t,e+o-r),this.quadraticCurveTo(a+t,e+o,a+t-r,e+o),this.lineTo(a+r,e+o),this.quadraticCurveTo(a,e+o,a,e+o-r),this.lineTo(a,e+r),this.quadraticCurveTo(a,e,a+r,e),this.closePath()}s(Qn,"roundRect");function $n(a,e=!1){let t=this.measureText(a),o=t.fontBoundingBoxAscent+t.fontBoundingBoxDescent;return e?{width:Math.round(t.width),height:Math.round(o)}:{width:t.width,height:o}}s($n,"calcTextSize");function Zn(a){let e=Math.round(a)+"px";this.font=this.font.replace(/\d+px/,e)}s(Zn,"setFontSize");function Xn(a,e,t){this.moveTo(a+t,e),this.arc(a,e,t,0,Math.PI*2)}s(Xn,"circle");var He=class extends d{m_iwidth=-1;m_iheight=-1;m_scale=1;m_canvas;constructor(e){super(e),this.mapPropEvents(e,"paint"),this.addDOMEvent("resized",()=>{this._paint()}),this.m_iwidth=-1,this.m_iheight=-1,this.m_canvas=new d({tag:"canvas"}),this.setContent(this.m_canvas)}scale(e){this.m_scale=e,this.m_iwidth=-1,this.redraw()}get canvas(){return this.m_canvas}getContext(){return this.m_canvas.dom.getContext("2d")}$update_rep=0;redraw(e){e!==void 0?++this.$update_rep>=20?(this.clearTimeout("update"),this._paint()):this.setTimeout("update",e,()=>this._paint()):(this.clearTimeout("update"),this._paint())}_paint(){this.$update_rep=0;let e=this.dom;if(!this.isVisible())return;let t=e.clientWidth,o=e.clientHeight,r=this.getContext();if(t!=this.m_iwidth||o!=this.m_iheight){let n=window.devicePixelRatio||1,i=r.webkitBackingStorePixelRatio||r.mozBackingStorePixelRatio||r.msBackingStorePixelRatio||r.oBackingStorePixelRatio||r.backingStorePixelRatio||1,l=this.canvas;if(this.m_scale!=1){let c=1,h=t*c,g=o*c;l.setAttribute("width",""+h),l.setAttribute("height",""+g),l.setStyleValue("width",t),l.setStyleValue("height",o),c*=this.m_scale,r.scale(c,c)}else l.setAttribute("width",""+t),l.setAttribute("height",""+o),l.setStyleValue("width",t),l.setStyleValue("height",o),r.scale(1,1);this.m_iwidth=t,this.m_iheight=o}if(t&&o){let n=lr(r,t,o);this.props.clear&&n.clearRect(0,0,t/this.m_scale,o/this.m_scale),n.save(),n.translate(-.5,-.5),this.paint(n),n.restore()}}paint(e){try{this.fire("paint",{ctx:e})}catch(t){console.assert(!1,t)}}};s(He,"Canvas"),He=u([p("x4")],He);var A=class extends d{constructor(e){var t;switch(super({tag:"input",...e}),this.mapPropEvents(e,"focus","change"),this.setAttribute("type",(t=e.type)!=null?t:"text"),this.setAttribute("name",e.name),e.autofocus===!0&&this.setAttribute("autofocus",!0),e.type){case"checkbox":case"radio":{let o=this.dom;o.checked=e.checked,o.value=e.value===void 0?"":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":{let o=this.props;this.setAttribute("required",o.required),this.setAttribute("readonly",o.readonly),this.setAttribute("min",o.min),this.setAttribute("max",o.max),this.setAttribute("step",o.step),this.setNumValue(M(o.value)?parseFloat(o.value):o.value,-2),this.addDOMEvent("wheel",r=>{if(this.hasFocus()){r.preventDefault();let n=this.getNumValue(),i=r.deltaY<0?1:-1;n+=(o.step?o.step:1)*i,this.setNumValue(n,-2),this.dom.dispatchEvent(new Event("input"))}});break}case"date":{this.setAttribute("required",e.required);let o=e.value;o instanceof Date?this.setAttribute("value",j(o,"Y-M-D")):e.value!==null&&e.value!==void 0&&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}case"time":{this.setAttribute("required",e.required),e.value!==null&&e.value!==void 0&&this.setAttribute("value",e.value);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),e.minlength!==void 0&&this.setAttribute("minlength",e.minlength),e.maxlength!==void 0&&this.setAttribute("maxlength",e.maxlength);break}}this.addDOMEvent("blur",o=>{this.on_focus(o,!0)}),this.addDOMEvent("focus",o=>{this.on_focus(o,!1)}),this.addDOMEvent("input",o=>{this.on_change(o)})}on_focus(e,t){let o={focus_out:t};this.fire("focus",o),o.defaultPrevented&&e.preventDefault()}on_change(e){let t={value:this.getValue()};this.fire("change",t),t.defaultPrevented&&e.preventDefault()}getValue(){return this.dom.value}setValue(e){this.dom.value=e+""}getNumValue(e){let t=parseFloat(this.getValue());return isNaN(t)&&e!==void 0?e:t}setNumValue(e,t=-1){var o;if(t==-2&&this.props.type=="number"){let r=this.props;if(r.step<1){let n=-Math.floor(Math.log10((o=r.step)!=null?o:1));return this.setValue(e.toFixed(n))}else if(r.step>1)return this.setValue(e.toFixed())}else if(t>=0)return this.setValue(e.toFixed(t));this.setValue(e+"")}getCheck(){return this.dom.checked}setCheck(e){let t=this.dom;t.checked=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}}isValid(){return!(this.props.required&&this.getValue()==="")}queryInterface(e){return e=="form-element"?{getRawValue:s(()=>this.getValue(),"getRawValue"),setRawValue:s(o=>{this.setValue(o)},"setRawValue"),isValid:s(()=>this.isValid(),"isValid")}:super.queryInterface(e)}};s(A,"Input"),A=u([p("x4")],A);var co='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 Ne=class extends d{_input;constructor(e){super(e);let t=q();this.mapPropEvents(e,"change"),this.setContent([new d({cls:"inner",content:[this._input=new A({type:"checkbox",id:t,name:e.name,checked:e.checked,dom_events:{change:s(()=>this._on_change(),"change")}})]}),new _({tag:"label",text:e.label,labelFor:t,id:void 0})]),wt.load(co).then(o=>{this.query(".inner").dom.insertAdjacentHTML("beforeend",o)}),this.addDOMEvent("click",o=>this._on_click(o))}_on_click(e){e.target==this.dom&&(this._input.dom.click(),e.preventDefault(),e.stopPropagation())}_on_change(){this.fire("change",{value:this.getCheck()})}getCheck(){return this._input.getCheck()}setCheck(e){this._input.setCheck(e)}setLabel(e){this.query("label").setText(e)}toggle(){this.setCheck(!this.getCheck())}};s(Ne,"Checkbox"),Ne=u([p("x4")],Ne);var Vr='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 _e=class extends b{constructor(e){super(e);let t,o;this.setContent([t=new d({cls:"swatch"}),o=new A({type:"text",value:"",spellcheck:!1}),It("eyedropper")?new I({icon:Vr,click:s(()=>{new window.EyeDropper().open().then(l=>{n=new N(l.sRGBHex),r(n)})},"click")}):null]),o.addDOMEvent("input",()=>{let i=o.getValue(),l=new N(i);l.isInvalid()||(n=l,r(n))});let r=s(i=>{t.setStyleValue("backgroundColor",i.toRgbString(!1)),o.setValue(i.toRgbString(!1))},"updateColor"),n;e.color instanceof N?n=e.color:n=new N(e.color),r(n)}};s(_e,"ColorInput"),O(_e,"$cls-ns","x4"),_e=u([p("x4")],_e);var we=class extends C{mdown=!1;irect;hsv={hue:1,saturation:1,value:1,alpha:1};color;thumb;constructor(e,t){super(e),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:s(o=>this.mousedown(o),"pointerdown"),pointermove:s(o=>this.mousemove(o),"pointermove"),pointerup:s(o=>this.mouseup(o),"pointerup"),created:s(()=>this.updateThumbMarker(),"created")}),this.updateBaseColor(t)}mousedown(e){this.mdown=!0,this.irect=this.getBoundingRect(),this.setCapture(e.pointerId)}mousemove(e){if(this.mdown){let t=this.irect,r=G(e.clientX-t.left,0,t.width)/t.width,i=G(e.clientY-t.top,0,t.height)/t.height;this.hsv.saturation=r,this.hsv.value=1-i,this.updateThumbMarker(),this.fire("sat_change",{saturation:this.hsv.saturation,value:this.hsv.value})}}mouseup(e){this.mdown&&(this.releaseCapture(e.pointerId),this.mdown=!1)}updateThumbMarker(){let e=this.color.getBoundingRect();this.thumb.setStyle({left:this.hsv.saturation*e.width+"px",bottom:this.hsv.value*e.height+"px"})}updateBaseColor(e){let t=new N(0,0,0);t.setHsv(e.hue,1,1,1),this.color.setStyleValue("backgroundColor",t.toRgbString(!1))}move(e,t){switch(e){case"saturation":{this.hsv.saturation+=t,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+=t,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}}}};s(we,"Saturation"),we=u([p("x4")],we);var Ue=class extends C{thumb;hsv={hue:1,saturation:1,value:1,alpha:1};mdown=!1;irect;constructor(e,t){super(e),this.setContent([this.thumb=new d({cls:"thumb",left:"50%"})]),this.setDOMEvents({pointerdown:s(o=>this.mousedown(o),"pointerdown"),pointermove:s(o=>this.mousemove(o),"pointermove"),pointerup:s(o=>this.mouseup(o),"pointerup")}),this.updateHue(t)}mousedown(e){this.mdown=!0,this.irect=this.getBoundingRect(),this.setCapture(e.pointerId)}mousemove(e){if(this.mdown){let t=this.irect,r=G(e.clientX-t.left,0,t.width)/t.width;this.hsv.hue=r,this.updateHue(this.hsv),this.fire("hue_change",{hue:this.hsv.hue})}}mouseup(e){this.mdown&&(this.releaseCapture(e.pointerId),this.mdown=!1)}updateHue(e){this.hsv.hue=e.hue,this.thumb.setStyleValue("left",e.hue*100+"%")}move(e){this.hsv.hue+=e,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)}};s(Ue,"HueSlider"),Ue=u([p("x4")],Ue);var qe=class extends C{thumb;color;hsv={hue:1,saturation:1,value:1,alpha:1};mdown=!1;irect;constructor(e,t){super(e),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:s(o=>this._on_mousedown(o),"pointerdown"),pointermove:s(o=>this._on_mousemove(o),"pointermove"),pointerup:s(o=>this._on_mouseup(o),"pointerup")}),this.updateAlpha(),this.updateBaseColor(t)}_on_mousedown(e){this.mdown=!0,this.irect=this.getBoundingRect(),this.setCapture(e.pointerId)}_on_mousemove(e){if(this.mdown){let t=this.irect,r=G(e.clientX-t.left,0,t.width)/t.width;this.hsv.alpha=r,this.updateAlpha(),this.fire("alpha_change",{alpha:this.hsv.alpha})}}_on_mouseup(e){this.mdown&&(this.releaseCapture(e.pointerId),this.mdown=!1)}updateAlpha(){this.thumb.setStyleValue("left",this.hsv.alpha*100+"%")}updateBaseColor(e){let t=new N(0,0,0);t.setHsv(e.hue,e.saturation,e.value,1),this.color.setStyleValue("backgroundImage",`linear-gradient(90deg, transparent, ${t.toRgbString(!1)})`)}setColor(e){this.hsv=e,this.updateBaseColor(e),this.updateAlpha()}move(e){this.hsv.alpha+=e,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()}};s(qe,"AlphaSlider"),qe=u([p("x4")],qe);var Ke=class extends k{_base;_sat;_swatch;_hue;_alpha;constructor(e){super(e),e.color instanceof N?this._base=e.color:this._base=new N(e.color);let t=this._base.toHsv();this.setAttribute("tabindex",0),this.setContent([this._sat=new we({},t),new b({cls:"body",content:[new k({cls:"x4flex",content:[this._hue=new Ue({},t),this._alpha=new qe({},t)]}),new C({cls:"swatch",content:[new d({cls:"overlay checkers"}),this._swatch=new d({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=s(()=>{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");It("eyedropper")&&this._swatch.addDOMEvent("click",r=>{new window.EyeDropper().open().then(i=>{t=new N(i.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}}}};s(Ke,"ColorPicker"),Ke=u([p("x4")],Ke);var se=class extends d{constructor(e){super(e)}};s(se,"Viewport"),se=u([p("x4")],se);var Z=class extends d{constructor(e){super(e),this.setContent(new se({}))}getViewport(){return this.firstChild()}};s(Z,"ScrollView"),Z=u([p("x4")],Z);var pe=class extends d{_view;_lastsel;_multisel;_items;preventFocus=!1;constructor(e){super({...e}),this.setAttribute("tabindex",0),this.mapPropEvents(e,"dblClick","selectionChange","contextMenu");let t=new Z({cls:"body"});this._view=t.getViewport(),this._multisel=new Set,this._items=[],e.footer&&e.footer.setAttribute("id","footer"),this.setContent([t,e.footer]),this.setDOMEvents({click:s(o=>this._on_click(o),"click"),keydown:s(o=>this._on_key(o),"keydown"),dblclick:s(o=>this._on_click(o),"dblclick"),contextmenu:s(o=>this._on_ctx_menu(o),"contextmenu")}),e.items&&this.setItems(e.items)}_on_key(e){if(!this.isDisabled()){switch(e.key){case"ArrowDown":{this.navigate(4);break}case"ArrowUp":{this.navigate(1);break}case"Home":{this.navigate(0);break}case"End":{this.navigate(5);break}default:return}e.preventDefault(),e.stopPropagation()}}navigate(e){this._lastsel||(e==4?e=0:e=5);let t=s((o,r)=>{for(;o&&!o.isVisible();)o=r?o.nextElement():o.prevElement();return o},"next_visible");if(e==0||e==5){let o=e==0?this._view.firstChild():this._view.lastChild();if(o=t(o,e==0),o){let r=o.getInternalData("id");return this._selectItem(r,o,"single"),!0}}else{let o=this._itemWithID(this._lastsel),r=e==4?o.nextElement():o.prevElement();if(r=t(r,e==4),r){let n=r.getInternalData("id");return this._selectItem(n,r,"single"),!0}}return!1}_itemWithID(e){return this._view.enumChildComponents(!1).find(o=>o.getInternalData("id")===e)}_on_click(e){let t=e.target;for(;t&&t!=this.dom;){let o=T(t);if(o.dom.tagName==="INPUT")return;if(o&&o.hasClass("x4item")){let r=o.getInternalData("id"),n={context:r};e.type=="click"?this.fire("click",n):this.fire("dblClick",n),n.defaultPrevented||this._selectItem(r,o,e.ctrlKey?"toggle":"single");return}t=t.parentElement}this.clearSelection(),e.stopImmediatePropagation(),e.preventDefault()}_on_ctx_menu(e){e.preventDefault();let t=e.target;for(;t&&t!=this.dom;){let o=T(t);if(o&&o.hasClass("x4item")){let r=o.getInternalData("id");this._selectItem(r,o,"single"),this.fire("contextMenu",{uievent:e,context:r});return}t=t.parentElement}this.fire("contextMenu",{uievent:e,context:null})}_selectItem(e,t,o){if(this.props.multisel||(o="single"),this._lastsel=e,o=="single"){if(this._multisel.has(e))return;this._clearSelection(),t&&(this._multisel.add(e),t.addClass("selected"))}else t&&(this._multisel.has(e)?(t.removeClass("selected"),this._multisel.delete(e)):(this._multisel.add(e),t.addClass("selected")));t&&t.scrollIntoView({behavior:"smooth",block:"nearest"}),this.fire("selectionChange",{selection:this.getSelection(),empty:this._multisel.size==0})}getItem(e){return this._items.find(t=>t.id===e)}select(e,t=!0){if(Y(e)||(e=[e]),!e.length){this._multisel.size&&this.clearSelection();return}if(e.some(o=>!this._multisel.has(o))){this._clearSelection();let o=this._view.enumChildComponents(!1);e.forEach(r=>{let n=o.find(i=>i.getInternalData("id")===r);n&&(this._multisel.add(r),n.addClass("selected"))}),this.fire("selectionChange",{selection:this.getSelection(),empty:this._multisel.size==0})}}_findItemIndex(e){return this._items.findIndex(t=>t.id==e)}_clearSelection(){let e=this._view.enumChildComponents(!1);this._multisel.size&&Array.from(this._multisel).forEach(o=>{let r=e.find(n=>n.getInternalData("id")===o);r&&r.removeClass("selected")}),this._multisel.clear()}clearSelection(){this._multisel.size&&(this._clearSelection(),this.fire("selectionChange",{selection:[],empty:!0}))}setItems(e,t=!1){let o=this.getSelection();if(this.clearSelection(),this._view.clearContent(),this._items=e,e){let r=e.map(n=>this.renderItem(n));this._view.setContent(r),t&&this.select(o)}}renderItem(e){var r;let o=((r=this.props.renderer)!=null?r:this.defaultRenderer)(e);return o.addClass("x4item"),o.setInternalData("id",e.id),o}defaultRenderer(e){return new b({cls:e.cls,content:new _({icon:e.iconId,text:e.text})})}filter(e){let t=this._view.enumChildComponents(!1);if(!e)t.forEach(o=>o.show(!0));else{let o=this._items.filter(r=>r.text.includes(e)).map(r=>r.id+"");t.forEach(r=>{r.show(o.includes(r.getInternalData("id")))})}}appendItem(e,t=!1,o=!0){o&&this._clearSelection();let r=this.renderItem(e);t?(this._items.unshift(e),this._view.prependContent(r)):(this._items.push(e),this._view.appendContent(r)),o&&this._selectItem(e.id,r,"single")}updateItem(e,t){let o=this._findItemIndex(e);if(o<0)return;let r=!1;this._multisel.has(e)&&(r=!0),this._items[o]=t;let n=this._itemWithID(t.id);if(n!=null&&n.dom){let i=this.renderItem(t);r&&i.addClass("selected"),this._view.dom.replaceChild(i.dom,n.dom)}}getSelection(){return Array.from(this._multisel)}};s(pe,"Listbox"),pe=u([p("x4")],pe);var Hr='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 ye=class extends z{_list;constructor(e,t){super(e),this._list=new pe({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}};s(ye,"DropdownList"),ye=u([p("x4")],ye);var Ge=class extends d{_popup;_input;_button;_prevent_close=!1;_edit;constructor(e){super(e);let t=q();this.mapPropEvents(e,"selectionChange");let o=e.readonly!==!1;this.setContent([new b({id:"label",content:new _({tag:"label",text:e.label,labelFor:t,width:e.labelWidth})}),this._edit=new b({id:"edit",content:[this._input=new A({id:t,type:"text",value:"",readonly:o,required:e.required}),this._button=new I({icon:Hr,tabindex:-1})]})]),e.name&&this.setAttribute("name",e.name),e.required&&this.setAttribute("required",!0),this._popup=new ye({items:e.items});let r=this._popup.getList(),n=s(i=>{let l=r.getItem(i);this._input.setValue(l?l.text:""),this._prevent_close||this._popup.show(!1)},"_select");this._popup.on("selectionChange",i=>{let[l]=i.selection;l!==void 0&&(n(l),this.fire("selectionChange",i))}),e.value&&n(e.value),this._button.addDOMEvent("click",()=>this._on_click()),this._input.addDOMEvent("input",()=>this._on_input()),this._input.addDOMEvent("keydown",i=>this._on_key(i)),this.setDOMEvents({focusout:s(()=>this._on_focusout(),"focusout"),click:s(()=>this._on_click(),"click")})}_on_key(e){switch(e.key){case"Enter":case"Escape":{this._popup.show(!1);break}case"ArrowUp":this._prevent_close=!0,this._popup.isOpen()?this._popup.getList().navigate(1):this.showDropDown(),this._prevent_close=!1;break;case"ArrowDown":this._prevent_close=!0,this._popup.isOpen()?this._popup.getList().navigate(4):this.showDropDown(),this._prevent_close=!1;break;default:return}e.preventDefault(),e.stopPropagation()}_on_input(){this._popup.isOpen()||this.showDropDown(),this._popup.getList().filter(this._input.getValue())}_on_focusout(){this._popup.show(!1)}_on_click(){this.showDropDown()}showDropDown(){if(this.isDisabled())return;let e=this._edit.getBoundingRect();this._popup.setStyleValue("minWidth",e.width+"px"),this._popup.displayNear(e,"top left","bottom left",{x:0,y:6})}setItems(e){this._getList().setItems(e)}getValue(){return this._input.getValue()}setValue(e){this._input.setValue(e)}selectItem(e){this._getList().select(e)}getSelection(){let[e]=this._getList().getSelection();return e}_getList(){return this._popup.getList()}queryInterface(e){return e=="form-element"?{getRawValue:s(()=>this.getSelection(),"getRawValue"),setRawValue:s(o=>{this.selectItem(o)},"setRawValue"),isValid:s(()=>this._input.isValid(),"isValid")}:super.queryInterface(e)}};s(Ge,"Combobox"),Ge=u([p("x4")],Ge);var K=class extends C{validator;constructor(e){super({tag:"form",...e}),e.flex===!1&&this.addClass("no-flex"),e.autoComplete!==void 0&&this.setAutoComplete(e.autoComplete)}_get_inputs(){return this.queryAll("[name]")}setValues(e){this._get_inputs().forEach(o=>{let r=o.queryInterface("form-element");if(r){let n=o.getAttribute("name");Object.prototype.hasOwnProperty.call(e,n)&&r.setRawValue(e[n])}})}getValues(){let e={};return this._get_inputs().forEach(o=>{let r=o.queryInterface("form-element");if(r){let n=o.getAttribute("name");e[n]=r.getRawValue()}}),e}setAutoComplete(e=!0){this._get_inputs().forEach(o=>{o.setAttribute("autocomplete",e?"on":"off")})}setValidator(e){this.validator||(this.validator=e,this.addDOMEvent("focusout",()=>this.validate()))}validate(){let e=this._get_inputs(),t={},o=!0;for(let r of e){let n=r.queryInterface("form-element");if(n){let i=r.getAttribute("name");t[i]=n.getRawValue(),n.isValid()||(o=!1)}}if(this.validator){let r={...t};if(!this.validator(r,o))return null;for(let n in t)r[n]!=t[n]&&this.query(`input[${n}"]`).queryInterface("form-element").setRawValue(r[n]);t=r}else o||(t=null);return t}};s(K,"Form"),K=u([p("x4")],K);var Nr='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 X=class extends z{form;_title;constructor(e){super({tag:"dialog",modal:!0,...e}),this._ismodal=this.props.modal,this.mapPropEvents(e,"btnclick"),this.appendContent([new b({cls:"caption",content:[this._title=new _({id:"title",cls:"caption-element",icon:e.icon,text:e.title}),e.closable?new I({id:"closebox",icon:Nr,tabindex:-1,click:s(()=>{M(e.closable)?this.fire("btnclick",{button:e.closable}):this.close()},"click")}):null]}),this.form=e.form?e.form:new K({}),new he({id:"btnbar",reverse:!0,items:e.buttons,btnclick:s(t=>{this.fire("btnclick",t)},"btnclick")})]),this.addDOMEvent("keydown",t=>{if(t.key=="Escape")t.preventDefault(),t.stopPropagation();else if(t.key=="Enter"){let o=this.query("button.default");o&&(t.preventDefault(),t.stopPropagation(),o.click())}})}focusNext(e){let t=Mt(this.dom);if(t.length){let o=t[0],r=t[t.length-1],n=document.activeElement,i;if(!e&&n===o)i=r;else if(e&&n===r)i=o;else{let l=t.indexOf(n);e?i=t[l+1]:i=t[l-1]}return i?(i.focus(),!0):!1}else return!1}setContent(e){this.dom.replaceChild(this.form.dom,e.dom),this.form=e}getForm(){return this.form}getValues(){return this.form.getValues()}getButton(e){return this.getBtnBar().getButton(e)}queryInterface(e){return e=="tab-handler"?{focusNext:s(o=>this.focusNext(o),"focusNext")}:super.queryInterface(e)}setTitle(e){this._title.setText(e)}getBtnBar(){return this.query("#btnbar")}};s(X,"Dialog"),X=u([p("x4")],X);var Ur='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><!--!Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M144 480C64.5 480 0 415.5 0 336c0-62.8 40.2-116.2 96.2-135.9c-.1-2.7-.2-5.4-.2-8.1c0-88.4 71.6-160 160-160c59.3 0 111 32.2 138.7 80.2C409.9 102 428.3 96 448 96c53 0 96 43 96 96c0 12.2-2.3 23.8-6.4 34.6C596 238.4 640 290.1 640 352c0 70.7-57.3 128-128 128l-368 0zm79-217c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l39-39L296 392c0 13.3 10.7 24 24 24s24-10.7 24-24l0-134.1 39 39c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-80-80c-9.4-9.4-24.6-9.4-33.9 0l-80 80z"/></svg>';var cr=class cr extends d{constructor(e){var t;super({tag:"input",style:{display:"none"},attrs:{type:"file",multiple:(t=e.multiple)!=null?t:!1,accept:e.accept},dom_events:{change:s(()=>{let o=this.dom.files;e.callback(o)},"change")}})}showDialog(){this.dom.click()}};s(cr,"FileDialog");var Et=cr,We=class extends k{constructor(e){var o,r;super(e),this.mapPropEvents(e,"change");let t=new Et({accept:e.accept,multiple:e.multiple,callback:s(n=>{this.fire("change",{files:n})},"callback")});this.setContent([t,new E({iconId:(o=e.icon)!=null?o:Ur}),new H({text:(r=e.label)!=null?r:y.global.filedrop})]),this.setAttribute("tabIndex",0),this.addDOMEvent("click",()=>t.showDialog()),this.addDOMEvent("keydown",n=>{n.key==" "&&t.showDialog()}),Bt.registerDropTarget(this,async(n,i,l)=>{if(n=="enter")this.addClass("hit");else if(n=="leave")this.removeClass("hit");else if(n=="drop"&&l.data.files&&l.data.files.length>0){let c=l.data.files;this.fire("change",{files:c})}})}};s(We,"FileDrop"),We=u([p("x4")],We);var ue=class extends d{_img;constructor(e){var t;if(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),e.candrop){this.mapPropEvents(e,"change","clear");let o=new Et({accept:e.accept,multiple:!1,callback:s(n=>{this.fire("change",{files:n})},"callback")});this.appendContent(o),this.addDOMEvent("click",()=>o.showDialog());let r=s((n,i)=>{var l;if((l=i.items)!=null&&l.length){let c=i.items[0].type;if(/image\/.*/.test(c))return!0}return!1},"filterInput");Bt.registerDropTarget(this,async(n,i,l)=>{if(n=="enter")this.addClass("hit");else if(n=="leave")this.removeClass("hit");else if(n=="drop"&&l.data.files&&l.data.files.length>0){let c=l.data.files;this.fire("change",{files:c})}},r),this.addDOMEvent("contextmenu",n=>{new W({items:[{text:y.global.cut,click:s(()=>{this.fire("clear",{})},"click")}]}).displayAt(n.pageX,n.pageY),n.stopPropagation(),n.preventDefault()})}}setImage(e){e?this._img.setAttribute("src",e):this.clear()}setBase64(e,t){this.setImage("data:"+e+";base64,"+t)}clear(){this._img.setAttribute("src","data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==")}};s(ue,"Image"),ue=u([p("x4")],ue);var Nt=200,je=class extends d{_dataview;_datamodel;_columns;_lock;_dirty;_row_height;_left;_top;_body;_viewport;_fheader;_hheader;_vheader;_ffooter;_footer;_vis_rows;_start;_end;_selection;_num_fmt=new Intl.NumberFormat("fr-FR");_mny_fmt=new Intl.NumberFormat("fr-FR",{style:"currency",currency:"EUR"});_dte_fmt=new Intl.DateTimeFormat("fr-FR",{});_has_fixed;_has_footer;constructor(e){super(e),this._lock=0,this._dirty=0,this._row_height=32,this._left=0,this._top=0,this._vis_rows=new Map,this._selection=new Set,this._has_fixed=!1,this._has_footer=e.footer,this._columns=e.columns.map(t=>t),this.mapPropEvents(e,"click","dblClick","contextMenu","selectionChange"),this.lock(!0),this.setAttribute("tabindex",0),this.addDOMEvent("created",()=>{this._init(),this._dirty=1,this.lock(!1)}),this.addDOMEvent("resized",()=>{this._updateFlexs(),this._computeFullSize(),this._update(!0)}),this.addDOMEvent("keydown",t=>{this._on_key(t)}),e.store&&this.setStore(e.store)}_on_key(e){if(!this.isDisabled()){switch(e.key){case"ArrowDown":{this.navigate(4);break}case"ArrowUp":{this.navigate(1);break}case"Home":{this.navigate(0);break}case"End":{this.navigate(5);break}case"PageDown":{this.navigate(2);break}case"PageUp":{this.navigate(3);break}default:return}e.preventDefault(),e.stopPropagation()}}navigate(e){if(this._selection.size||(e==4||e==2?e=0:e=5),e==0||e==5){let t=e==0?0:this._dataview.getCount()-1;return this._clearSelection(),this._addSelection(t),this._scrollToIndex(t),!0}else if(e==1||e==4){let t=this._selection.values().next().value,o=e==4?t+1:t-1;if(o>=0&&o<this._dataview.getCount())return this._clearSelection(),this._addSelection(o),this._scrollToIndex(o),!0}else if(e==2||e==3){let t=this._vis_rows.size,o=this._selection.values().next().value,r=e==2?t:-t,n=o+r;if(n<0?n=0:n>=this._dataview.getCount()&&(n=this._dataview.getCount()-1),n!=o)return this._clearSelection(),this._addSelection(n),this._dataview.getCount()<Nt&&(r*=this._row_height),this._viewport.dom.scrollBy(0,r),!0}return!1}_scrollToIndex(e,t="nearest"){let o=this.queryAll(`.row[data-row="${e}"]`);if(o.length)o.forEach(r=>{r.scrollIntoView({block:t})});else{let r=e;this._dataview.getCount()<Nt&&(r*=this._row_height),this._viewport.dom.scrollTo(0,r)}}setStore(e){let t=s(o=>{this._viewport&&(o.change_type=="change"&&this._selection.clear(),this._updateFlexs(),this._computeFullSize(),this._update(!0))},"on_change");this._dataview&&this._dataview.off("view_change",t),e?(this._dataview=new xt({store:e}),this._datamodel=e.getModel(),this._dataview.on("view_change",t)):(this._dataview=null,this._datamodel=null)}getView(){return this._dataview}lock(e){e?this._lock++:--this._lock==0&&this._dirty&&this._update(!0)}_getColCount(){return this._columns.length}_getCol(e){return this._columns[e]}_buildColHeader(e){var n;let t=[],o=this._getColCount();for(let i=0;i<o;i++){let l=this._getCol(i);if(!!l.fixed!=e)continue;let c=new F("right");c.on("stop",()=>{this._updateFlexs()}),c.on("resize",g=>{l.width=g.size,l.flex=0,this.queryAll(`[data-col="${i}"]`).forEach(x=>{x.setStyleValue("width",g.size+"px")});let m=r.getBoundingRect();e?this.setStyleVariable("--fixed-width",m.width+"px"):this._body.setStyleValue("width",m.width+"px")});let h=new d({cls:"cell",attrs:{"data-col":i},style:{width:l.width?l.width+"px":void 0},content:[new H({text:l.title,align:(n=l.header_align)!=null?n:"left"}),new d({cls:"sorter"}),c]});h.addDOMEvent("touchend",()=>{let g=h.getInternalData("touchend"),f=Date.now(),m=g?f-g:0;m>30&&m<300?this._sortCol(i):h.setInternalData("touchend",f)}),h.addDOMEvent("dblclick",()=>{this._sortCol(i)}),t.push(h)}if(e&&t.length==0)return null;let r=new C({cls:"col-header",content:t});return r.setClass("fixed",e),r}_buildColFooter(e){let t=[],o=this._getColCount();for(let n=0;n<o;n++){let i=this._getCol(n);if(!!i.fixed!=e)continue;let l=new d({cls:"cell",attrs:{"data-col":n},style:{width:i.width?i.width+"px":void 0},content:[new H({text:i.footer_val})]});l.addDOMEvent("dblclick",()=>{this._sortCol(n)}),t.push(l)}if(e&&t.length==0)return null;let r=new C({cls:"col-footer",content:t});return r.setClass("fixed",e),r}_sortCol(e,t){Yt(!0),this.setTimeout("sort",50,()=>{let o=!0,r=this.query(`.col-header [data-col="${e}"`);t===void 0?r.hasClass("sorted")?r.hasClass("desc")?o=!0:o=!1:this.queryAll(".sorted").forEach(c=>c.removeClass("sorted asc desc")):o=t,r.setClass("sorted"),r.setClass("desc",!o);let n=this._getCol(e),i=!1;switch(n.type){case"checkbox":case"money":case"number":case"percent":i=!0}this._dataview.sort([{field:n.id,ascending:o,numeric:i}]),this._update(!0),Yt(!1)})}sortCol(e,t){let o=this._columns.findIndex(r=>r.id===e);o>=0&&this._sortCol(o,t)}_renderCell(e,t,o){let r=t.id,n=t.type,i=this._datamodel.getRaw(r,e);if(i==null)return null;let l="";if(t.classifier&&o.push(t.classifier(i,e,r)),i instanceof Function)return i(e,r);if(t.formatter)return t.formatter(i);switch(n){case"checkbox":return i?new E({cls:"cell-check"+l,iconId:co}):void 0;case"image":return M(i)?new ue({cls:l,src:i,fit:"scale-down"}):void 0;case"number":{if(!V(i))return"NaN";i=this._num_fmt.format(i);break}case"money":{if(!V(i))return"NaN";i=this._mny_fmt.format(i);break}case"percent":return new C({cls:"percent"+l,content:new d({cls:"bar",width:i+"%"})});case"icon":return new E({cls:l,iconId:i+""});case"date":{i=this._dte_fmt.format(i);break}default:{i=i+"";break}}return new d({tag:"span",cls:l,content:i})}_buildRow(e,t,o){let r=[],n=this._getColCount();for(let l=0;l<n;l++){let c=this._getCol(l);if(c.fixed)continue;let h=[],g=this._renderCell(t,c,h),f="start";switch(c.align){default:f="start";break;case"center":f="center";break;case"right":f="end";break}let m=new d({cls:"cell",style:{width:c!=null&&c.width?c.width+"px":void 0,justifyContent:f},content:g});h.length&&m.addClass(h.join(" ")),c.type&&m.addClass(c.type),m.setData("col",l+""),m.setData("row",e+""),r.push(m)}let i=new C({cls:"row",style:{top:o.toFixed(2)+"px"},content:r});return i.setData("row",e+""),this._selection.has(e)&&i.addClass("selected"),i}_buildRowHeader(e,t,o){let r=[],n=this._getColCount();for(let l=0;l<n;l++){let c=this._getCol(l);if(!(c!=null&&c.fixed))continue;let h=this._renderCell(t,c.id,[c.type]),g="start";switch(c.align){default:g="start";break;case"center":g="center";break;case"right":g="end";break}let f=new d({cls:"cell",style:{width:c!=null&&c.width?c.width+"px":void 0,justifyContent:g},content:h});c.type&&f.addClass(c.type),f.setData("col",l+""),f.setData("row",e+""),r.push(f)}let i=new C({cls:"row",style:{top:o+"px"},content:r});return i.setData("row",e+""),this._selection.has(e)&&i.addClass("selected"),i}_updateFlexs(){let e=0,t=0,o=this._getColCount();for(let r=0;r<o;r++){let n=this._getCol(r);!n.fixed&&n.flex?t+=n.flex:e+=n.width}if(t){let i=(this._viewport.dom.clientWidth-e)/t;for(let l=0;l<o;l++){let c=this._getCol(l);!c.fixed&&c.flex&&(c.width=Math.max(c.flex*i,32),this.queryAll(`[data-col="${l}"]`).forEach(g=>{g.setStyleValue("width",c.width+"px")}))}}}_computeFullSize(){let e=0,t=0,o=this._getColCount();for(let i=0;i<o;i++){let l=this._getCol(i),c=0;l.fixed&&(this._has_fixed=!0),l.width&&(c+=l.width),l.fixed?t+=c:e+=c}let r=this._dataview.getCount(),n=r;if(r<Nt)n*=this._row_height;else{let l=this._body.dom.parentElement.clientHeight/this._row_height;n=r-Math.floor(l)+l*this._row_height}this.setStyleVariable("--fixed-width",t+"px"),this._body.setStyleValue("height",n+"px"),this._body.setStyleValue("width",e+"px"),this._vheader.setStyleValue("height",n+"px")}_init(){this._body=new d({cls:"body"}),this._viewport=new se({content:this._body}),this._has_footer||this.setStyleVariable("--footer-height","0"),this._viewport.addDOMEvent("scroll",t=>{this._left=this._viewport.dom.scrollLeft,this.setStyleVariable("--left",-this._left+"px"),this._top=this._viewport.dom.scrollTop,this.setStyleVariable("--top",-this._top+"px"),this._update()}),this.addDOMEvent("wheel",t=>{if(t.deltaY&&this._dataview.getCount()>=Nt&&(this._viewport.dom.scrollBy(0,t.deltaY<0?-1:1),t.stopPropagation(),t.preventDefault()),this._has_fixed&&t.deltaY){let o=t.target;for(;o!=this.dom;){if(o==this._vheader.dom){this._viewport.dom.scrollBy(0,t.deltaY<0?-this._row_height:this._row_height),t.stopPropagation(),t.preventDefault();break}o=o.parentNode}}});let e=s(t=>{let o=d.parentElement(t.target,d);for(;o&&!o.hasClass("row");)o=o.parentElement();if(o)return o.getIntData("row")},"targetRow");this.addDOMEvent("click",t=>{let o=e(t);o!==void 0&&(this._selection.has(o)||(this._clearSelection(),this._addSelection(o)))}),this.addDOMEvent("dblclick",t=>{let o=e(t);if(o!==void 0){this._selection.has(o)||(this._clearSelection(),this._addSelection(o)),this._on_dblclk(t,o);let r=this._dataview.getByIndex(o);this.fire("dblClick",{context:r})}}),this.addDOMEvent("contextmenu",t=>{let o=e(t);if(o!==void 0){this._selection.has(o)||(this._clearSelection(),this._addSelection(o));let r=this._dataview.getByIndex(o);this.fire("contextMenu",{uievent:t,context:r})}t.preventDefault(),t.stopPropagation()}),this.addDOMEvent("mouseover",t=>{if(!this._has_fixed)return;let o=d.parentElement(t.target,d);for(;o&&!o.hasClass("row");)o=o.parentElement();if(o){let r=o.getData("row");this.queryAll(".hover").forEach(n=>n.removeClass("hover")),r&&this.queryAll(`.row[data-row="${r}"]`).forEach(i=>i.addClass("hover"))}}),this.addDOMEvent("mouseleave",t=>{this._has_fixed&&this.queryAll(".hover").forEach(o=>o.removeClass("hover"))}),this._updateFlexs(),this._fheader=this._buildColHeader(!0),this._hheader=this._buildColHeader(!1),this._vheader=new C({cls:"row-header"}),this._has_footer&&(this._ffooter=this._buildColFooter(!0),this._footer=this._buildColFooter(!1)),this.setContent([this._viewport,this._fheader,this._hheader,this._ffooter,this._footer,this._vheader]);{let t=this.getStyleVariable("--row-height");this._row_height=parseInt(t)}this._computeFullSize()}_on_dblclk(e,t){}_update(e=!1){if(!this._lock){let t=this.getBoundingRect(),o=this._dataview.getCount(),r=o<Nt?this._row_height:1,n=Math.floor(this._top/r),i=n+Math.ceil(t.height/this._row_height),l=this._has_fixed;if(this._start!=n||this._end!=i||e){let c=[],h=[];e&&this._vis_rows.clear();let g=new Map,f=n*r;for(let m=n;m<i&&m<o;m++,f+=this._row_height){let x=this._vis_rows.get(m),v=this._dataview.getByIndex(m);l?(x?(x.h.setStyleValue("top",f+"px"),x.r.setStyleValue("top",f+"px")):x={h:this._buildRowHeader(m,v,f),r:this._buildRow(m,v,f)},h.push(x.h)):x?x.r.setStyleValue("top",f+"px"):x={h:null,r:this._buildRow(m,v,f)},c.push(x.r),g.set(m,x)}l&&h.push(new d({cls:"cell-out",style:{top:f+"px"}})),this._vis_rows=g,this._start=n,this._end=i,this._body.setContent(c),l?(this._vheader.removeClass("@hidden"),this._vheader.setContent(h)):this._vheader.addClass("@hidden")}}}_clearSelection(){for(let e of this._selection.keys())this.queryAll(`.row[data-row="${e}"]`).forEach(o=>{o.removeClass("selected")});this._selection.clear()}_addSelection(e){this._selection.add(e),this.queryAll(`.row[data-row="${e}"]`).forEach(r=>{r.addClass("selected")});let o=this._dataview.getByIndex(e);this.fire("selectionChange",{selection:o,empty:!1})}getSelection(){return this._selection.size==0?null:[...this._selection.values()].map(t=>this._dataview.getByIndex(t))}getFirstSel(){if(this._selection.size==0)return null;let e=this._selection.values().next().value;return this._dataview.getByIndex(e)}selectItem(e){let t=this._dataview.indexOfId(e);t>=0&&this._addSelection(t)}};s(je,"Gridview"),je=u([p("x4")],je);var Ye=class extends b{_els;_vwp;constructor(e){var t;super(e),this._els=(t=e.items)==null?void 0:t.map(o=>{let r=new _({cls:"cell",text:o.title,icon:o.iconId}),n=new F("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",i=>{r.setInternalData("flex",1),this._calc_sizes()}),n.on("resize",i=>{r.setInternalData("flex",0),r.setInternalData("width",i.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 b({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 h=l.getInternalData("width");if(h==0){let g=l.getBoundingRect();h=Math.ceil(g.width)+2,l.setInternalData("width",h)}t+=h}});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 i=0;this._els.forEach(l=>{let c=0,h=l.getInternalData("flex");h?(c=Math.min(n*h,r),r-=c):c=l.getInternalData("width"),l.setWidth(c),i+=c}),this._vwp.setWidth(i)}_on_resize(){this._calc_sizes()}};s(Ye,"Header"),Ye=u([p("x4")],Ye);var qr='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512" fill="currentColor"><!--!Font Awesome Free 6.7.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M576 128c0-35.3-28.7-64-64-64L205.3 64c-17 0-33.3 6.7-45.3 18.7L9.4 233.4c-6 6-9.4 14.1-9.4 22.6s3.4 16.6 9.4 22.6L160 429.3c12 12 28.3 18.7 45.3 18.7L512 448c35.3 0 64-28.7 64-64l0-256zM271 175c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z"/></svg>';var Kr='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512" fill="currentColor"><!--!Font Awesome Free 6.7.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M214.6 41.4c-12.5-12.5-32.8-12.5-45.3 0l-160 160c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 141.2 160 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-306.7L329.4 246.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-160-160z"/></svg>';var Gr='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512" fill="currentColor"><!--!Font Awesome Free 6.7.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L525.6 386.7c39.6-40.6 66.4-86.1 79.9-118.4c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C465.5 68.8 400.8 32 320 32c-68.2 0-125 26.3-169.3 60.8L38.8 5.1zm151 118.3C226 97.7 269.5 80 320 80c65.2 0 118.8 29.6 159.9 67.7C518.4 183.5 545 226 558.6 256c-12.6 28-36.6 66.8-70.9 100.9l-53.8-42.2c9.1-17.6 14.2-37.5 14.2-58.7c0-70.7-57.3-128-128-128c-32.2 0-61.7 11.9-84.2 31.5l-46.1-36.1zM394.9 284.2l-81.5-63.9c4.2-8.5 6.6-18.2 6.6-28.3c0-5.5-.7-10.9-2-16c.7 0 1.3 0 2 0c44.2 0 80 35.8 80 80c0 9.9-1.8 19.4-5.1 28.2zm9.4 130.3C378.8 425.4 350.7 432 320 432c-65.2 0-118.8-29.6-159.9-67.7C121.6 328.5 95 286 81.4 256c8.3-18.4 21.5-41.5 39.4-64.8L83.1 161.5C60.3 191.2 44 220.8 34.5 243.7c-3.3 7.9-3.3 16.7 0 24.6c14.9 35.7 46.2 87.7 93 131.1C174.5 443.2 239.2 480 320 480c47.8 0 89.9-12.9 126.2-32.5l-41.9-33zM192 256c0 70.7 57.3 128 128 128c13.3 0 26.1-2 38.2-5.8L302 334c-23.5-5.4-43.1-21.2-53.7-42.3l-56.1-44.2c-.2 2.8-.3 5.6-.3 8.5z"/></svg>';var ai={"fr-FR":{lines:{lower:["1 2 3 4 5 6 7 8 9 0","a z e r t y u i o p {2}","q s d f g h j k l m {3}","{4} w x c v b n , . {4}","{5} {6} ' {7}"],upper:["! @ # $ % ^ & * ( ) _ +","A Z E R T Y U I O P {2}","Q S D F G H J K L M {3}","{4} W X C V B N ? : {4}","{5} {6} ' {7}"],number:["1 2 3 {2}","4 5 6 {8}","7 8 9 {9}","0 . {3} {9}"],date:["1 2 3 {2}","4 5 6 {8}","7 8 9 {9}","0 / {3} {9}"]}},"en-GB":{lines:{lower:["1 2 3 4 5 6 7 8 9 0","a z e r t y u i o p {2}","q s d f g h j k l m {3}","{4} w x c v b n , . {4}","{5} {6} ' {7}"],upper:["! @ # $ % ^ & * ( ) _ +","A Z E R T Y U I O P {2}","Q S D F G H J K L M {3}","{4} W X C V B N ? : {4}","{5} {6} ' {7}"],number:["1 2 3 {2}","4 5 6 {8}","7 8 9 {9}","0 . {3} {9}"],date:["1 2 3 {2}","4 5 6 {8}","7 8 9 {9}","0 / {3} {9}"]}},"en-US":"en-GB"},Wr=/text|password|search|tel|url/i,Qe=class extends b{mode;locale;keyboard;visible;input;constructor(e){super({...e,id:"v-keyboard"}),this.mode="lower",this.locale="fr-FR",this.visible=!1,document.addEventListener("focusin",t=>this.handleFocus(t.target,!0),!1),document.addEventListener("focusout",t=>this.handleFocus(t.target,!1),!1),this.hide(),this.addDOMEvent("mousedown",t=>{this.handleKey(t),t.preventDefault(),t.stopPropagation()}),this.addDOMEvent("dblclick",t=>{this.handleKey(t),t.preventDefault(),t.stopPropagation()}),this.addDOMEvent("contextmenu",t=>{t.preventDefault(),t.stopPropagation()})}handleKey(e){let t=e.target,o;for(;t!==this.dom;){if(t.hasAttribute("data-key")){o=parseInt(t.getAttribute("data-key"),10);break}t=t.parentNode}if(o)switch(o){case 2:{this.fireKey(0,this._backspace);break}case 3:{this._focusNext();break}case 4:{this.mode=="lower"?this.mode="upper":this.mode="lower",this._redraw();break}case 5:{this._switchMode("number");break}case 6:{this.fireKey(32,this._insertChar);break}case 7:{this.hide();break}case 8:{this._switchMode("lower");break}default:{this.fireKey(o,this._insertChar);break}}}_focusNext(){Rt.instance().focusNext(!0)}_switchMode(e){this.mode=e,this._redraw()}_redraw(){this.setContent([new ne,this.keyboard=new k({id:"kb",cls:this.mode,content:this._createContent()}),new ne])}_scrollIntoView(e){let t=e.parentElement;for(;t!=document.body;){if(t.style.overflowY!==""){let o=e.getBoundingClientRect(),r=t.getBoundingClientRect();o.top<r.top?e.scrollIntoView(!0):o.bottom>r.bottom&&e.scrollIntoView(!1);break}t=t.parentElement}}_updateVis=s(()=>{if(this.visible){if(this.input){let e=this.input.type;if(e=="check"||e=="radio")this.hide(),this.input=null;else{this.show(),this._scrollIntoView(this.input);let t=this.input.getAttribute("data-type");e==="number"||t==="number"?this._switchMode("number"):e==="date"||t==="date"?this._switchMode("date"):this._switchMode("lower")}}}else this.hide(),this.input=null},"_updateVis");showOn(e){this.handleFocus(e.dom,!0)}handleFocus(e,t){if(t&&e.tagName=="INPUT"&&!e.readOnly){this.input=e,this.visible=!0,this.setTimeout("vis",200,this._updateVis);return}this.visible=!1,this.setTimeout("vis",200,this._updateVis)}_insertChar(e,t,o){return t=t.substring(0,e.start)+o.toString()+t.substring(e.end),e.start+=o.length,e.end=e.start,t}_backspace(e,t){return t=t.substring(0,e.start-1)+t.substring(e.start),e.start-=1,e.end=e.start,t}_getCaret(){if(this.input&&Wr.test(this.input.type)){let e={start:this.input.selectionStart||0,end:this.input.selectionEnd||0};return e.end<e.start&&(e.end=e.start),e}else{let e=this.input.value.length;return{start:e,end:e}}}_restoreCaretPos(e){Wr.test(this.input.type)&&(this.input.selectionStart=e.start,this.input.selectionEnd=e.end)}fireKey(e,t){let o=this._getCaret(),r=this.input.value;r=t.call(this,o,r,String.fromCharCode(e)),this.input.value=r,this._restoreCaretPos(o)}_createContent(){let e=ai[this.locale].lines[this.mode],t=[];for(let o=0;o<e.length;o++){let r=e[o].split(" "),n=[];for(let i=0;i<r.length;i++){let l="tch c"+i,c=r[i],h,g=null;if(c.length>2&&c[0]=="{"&&c[c.length-1]=="}"){let m=parseInt(c.substring(1,c.length-1),10);switch(m){default:case 0:{c="",l+=" x4hidden";break}case 1:{c="";break}case 2:{c=void 0,g=qr,l+=" cdel";break}case 3:{c=y.global.keyboard.next,l+=" cret";break}case 4:{c=void 0,g=Kr,l+=" cshift";break}case 5:{c=y.global.keyboard.numeric,l+=" cnum";break}case 6:{c=" ",l+=" cspace";break}case 7:{c=void 0,g=Gr,l+=" chide";break}case 8:{c=y.global.keyboard.alpha,l+=" calpha";break}case 9:{c="",l+=" cplace";break}}h=m}else h=r[i].charCodeAt(0);let f=new I({cls:l,label:c,attrs:{"data-key":h},icon:g});n.push(f)}t.push(new b({cls:"line",content:n}))}return t}};s(Qe,"Keyboard"),Qe=u([p("x4")],Qe);var $e=class extends d{constructor(e){super({tag:"a",...e}),this.setAttribute("href",e.href),this.mapPropEvents(e,"click"),this.setContent(new _({text:e.text,icon:e.icon})),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())}};s($e,"Link"),$e=u([p("x4")],$e);var jr='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 dr='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><!--!Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path class="fa-secondary" opacity=".4" d="M0 128l32 0 224 0 32 0 0 64-32 0L64 192l0 256 448 0 0-128 0-32 64 0 0 32 0 160 0 32-32 0L32 512 0 512l0-32L0 160l0-32z"/><path class="fa-primary" d="M288 352l16-112L468.7 75.3l96 96L400 336 288 352zM587.3 148.7l-96-96L544 0l96 96-52.7 52.7zM96 288l64 0 0 64-64 0 0-64zm160 0l0 64-64 0 0-64 64 0z"/></svg>';var ke=class extends X{constructor(e){super(e)}static _create(e,t,o){return new ke({modal:!0,title:o!=null?o:y.global.error,movable:!0,form:new K({content:[new b({content:[new E({iconId:jr}),new _({text:e})]})]}),buttons:t!=null?t:["ok.outline","cancel.outline"]})}static show(e,t,o){let r=this._create(e,t,o);return r.on("btnclick",n=>{te(()=>{r.close()})}),r.show(),r}static async showAsync(e,t,o){return new Promise((r,n)=>{let i=this._create(e,t,o);i.on("btnclick",l=>{te(()=>{r(l.button),i.close()})}),i.show()})}};s(ke,"MessageBox"),ke=u([p("x4")],ke);var Ce=class extends X{constructor(e){super(e)}getValue(){return this.query("input").getValue()}static _create(e,t,o){return new Ce({modal:!0,title:o,movable:!0,form:new K({content:[new b({content:[new E({iconId:dr}),new k({flex:1,content:[new _({text:e}),new A({value:t,type:"text"})]})]})]}),buttons:["ok.outline.default","cancel.outline"]})}static async showAsync(e,t,o){return new Promise((r,n)=>{let i=this._create(e,t,o);i.on("btnclick",l=>{te(()=>{r(l.button=="ok"?i.getValue():null),i.close()})}),i.show()})}};s(Ce,"InputBox"),Ce=u([p("x4")],Ce);var Ee=class extends X{constructor(e){super(e)}static _create(e,t,o){return new Ee({modal:!0,title:o,movable:!0,form:new K({content:[new b({content:[new E({iconId:dr}),new k({flex:1,cls:"right",content:[new _({text:e}),t]})]})]}),buttons:["ok.outline.default","cancel.outline"]})}static async showAsync(e,t,o){return new Promise(r=>{let n=this._create(e,t,o);n.on("btnclick",i=>{te(()=>{r(i.button),n.close()})}),n.show()})}};s(Ee,"PromptBox"),Ee=u([p("x4")],Ee);var Yr='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 Qr='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 $r='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 Zr='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 Ze=class extends z{constructor(e){super({});let t=e.iconId;t||(e.loading?(t=$r,this.addClass("")):e.mode=="danger"?t=Qr:t=Yr),this.addClass(e.mode);let o=new E({iconId:t});e.loading&&(o.addClass("rotate"),this.props.modal=!0),this.setContent(new b({content:[o,new k({cls:"body",content:[e.title?new _({cls:"title",text:e.title}):null,new _({cls:"text",text:e.text})]}),e.closable?new I({cls:"outline",icon:Zr,click:s(()=>{this.close()},"click")}):null]}))}close(){this.clearTimeout("close"),super.close()}display(e=0){let t=new Me(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()})}};s(Ze,"Notification"),Ze=u([p("x4")],Ze);var Xe=class extends k{_title;_body;constructor(e){var o;super({...e,content:void 0});let t=(o=e.bodyModel)!=null?o:k;super.setContent([this._title=new _({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)}};s(Xe,"Panel"),Xe=u([p("x4")],Xe);var Je=class extends d{_bar;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+"%")}};s(Je,"Progress"),Je=u([p("x4")],Je);var me=class extends d{constructor(e){super({tag:"select",...e}),this.mapPropEvents(e,"focus","change"),e.name&&this.setAttribute("name",e.name),this.setItems(e.items),this.addDOMEvent("blur",t=>{this.on_focus(t,!0)}),this.addDOMEvent("focus",t=>{this.on_focus(t,!1)}),this.addDOMEvent("input",t=>{this.on_change(t)}),e.multiple&&this.setAttribute("multiple",!0),e.value&&this.setValue(e.value)}on_focus(e,t){let o={focus_out:t};this.fire("focus",o),o.defaultPrevented&&e.preventDefault()}on_change(e){let t={value:this.getValue()};this.fire("change",t),t.defaultPrevented&&e.preventDefault()}setItems(e){this.setContent(e.map(t=>new d({tag:"option",attrs:{value:t.id},content:t.text})))}getValue(){return this.dom.value}setValue(e){this.dom.value=e+""}};s(me,"Select"),me=u([p("x4")],me);var Xr='data:image/svg+xml,<svg viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg">%0D%0A%09<path class="fa-primary" 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 et=class extends k{root;groups;constructor(e){super(e),this.root=new d({cls:"root"}),this.setContent(this.root),e.groups&&this.setItems(e.groups)}setItems(e){this.groups=e;let t=[];for(let o of this.groups)t.push(this.makeGroupHeader(o)),o.items.forEach(r=>{t.push(this.makePropertyRow(r))});this.root.setContent(t)}makeGroupHeader(e){let t=s(r=>{let n;r.hasClass("collapsed")?(r.removeClass("collapsed"),n=!0):(r.addClass("collapsed"),n=!1);let i=r.nextElement();for(;i&&i.hasClass("row");)i.show(n),i=i.nextElement()},"toggle"),o=new b({cls:"group",content:[e.icon?new E({id:"icon",iconId:e.icon}):null,new k({content:[new H({cls:"title",text:e.title}),e.desc?new H({cls:"desc",text:e.desc}):null]}),e.collapsible?new I({icon:Xr,click:s(r=>t(o),"click")}):null]});return o.setClass("collapsible",e.collapsible),o}makePropertyRow(e){var n;let t=!0,o,r=xo(e.value)?e.value(e.name):e.value;return e.value=r,e.type==="boolean"?o=new A({type:"checkbox",id:e.name,name:e.name,checked:r,dom_events:{change:s(i=>{var l;(l=e.callback)==null||l.call(e,e.name,o.dom.checked)},"change")}}):e.type==="options"?o=new me({value:r,id:e.name,items:e.options,name:e.name,change:s(i=>{var l;(l=e.callback)==null||l.call(e,e.name,i.value)},"change")}):e.type==="password"?o=new A({type:"password",id:e.name,name:e.name,value:r,focus:s(i=>{var l;i.focus_out&&((l=e.callback)==null||l.call(e,e.name,o.getValue()))},"focus")}):e.type==="number"?o=new A({type:"number",id:e.name,name:e.name,value:r,step:e.step,focus:s(i=>{var l;i.focus_out&&((l=e.callback)==null||l.call(e,e.name,o.getNumValue()))},"focus"),change:s(()=>{var i;e.live&&((i=e.callback)==null||i.call(e,e.name,o.getNumValue()))},"change")}):e.type==="label"?o=new _({id:e.name,text:r}):e.type==="button"?(t=!1,o=new I({id:e.name,label:r,click:s(()=>{var i;(i=e.callback)==null||i.call(e,e.name,"")},"click")})):o=new A({type:"text",id:e.name,name:e.name,value:r,focus:s(i=>{var l;i.focus_out&&((l=e.callback)==null||l.call(e,e.name,o.getValue()))},"focus")}),new b({cls:"row",content:[t?new d({cls:"cell hdr",content:(n=e.title)!=null?n:e.name,tooltip:e.desc}):null,new d({cls:"cell",tag:"label",attrs:{labelFor:e.name},content:o})]})}setPropValue(e,t){let r=this.groups.flatMap(n=>[...n.items]).find(n=>n.name==e);if(r)if(r.type==="boolean"){let n=this.root.query("#"+r.name);n&&n.setCheck(t)}else if(r.type==="options"){let n=this.root.query("#"+r.name);n&&n.setValue(t)}else if(r.type==="number"){let n=this.root.query("#"+r.name);n&&n.setNumValue(t,-2)}else{let n=this.root.query("#"+r.name);n&&n.setValue(t)}}};s(et,"PropertyGrid"),et=u([p("x4")],et);var Jr='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 5 5" aria-hidden="true">%0D%0A%09<circle class="fa-primary" cx="2.5" cy="2.5" r="2.5" ></circle>%0D%0A%09<circle class="fa-secondary" cx="2.5" cy="2.5" r="1.25"></circle>%0D%0A</svg>';var tt=class extends d{_check;_input;_label;constructor(e){super(e),this.mapPropEvents(e,"change");let t=q();this.setContent([this._check=new b({cls:"inner",content:[this._input=new A({type:"radio",id:t,name:e.name,value:e.value,checked:e.checked,dom_events:{change:s(()=>this._on_change(),"change")}})]}),this._label=new _({tag:"label",text:e.label,id:void 0,labelFor:t,icon:e.icon})]),wt.load(Jr).then(o=>{this._check.dom.insertAdjacentHTML("beforeend",o)}),this.addDOMEvent("click",o=>this._on_click(o))}_on_click(e){e.target==this.dom&&(this._input.dom.click(),e.preventDefault(),e.stopPropagation())}_on_change(){this.fire("change",{value:this.getValue()})}setCheck(e){let t=this._input.dom;t.checked=e}setLabel(e){this._label.setText(e)}getValue(){return this._input.getValue()}};s(tt,"Radio"),tt=u([p("x4")],tt);var en='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 ot=class extends b{m_els;m_input;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:en,o=(n=e.value)!=null?n:0;this.m_input=new A({type:"text",hidden:!0,name:e.name,value:""+o}),this.addDOMEvent("click",i=>this._on_click(i)),this.m_els=[];for(let i=0;i<e.steps;i++){let l="item";i+1<=o&&(l+=" checked");let c=new E({cls:l,iconId:t});c.setInternalData("value",i),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=T(e.target);t=t.parentElement(E),t&&this.setValue(t.getInternalData("value")),this.fire("change",{value:this.props.value})}};s(ot,"Rating"),ot=u([p("x4")],ot);var rt=class extends d{_mdown=!1;_irect=null;_thumb=null;_bar=null;_range=null;constructor(e){super(e),this.mapPropEvents(e,"change"),e.vertical&&this.addClass("vertical"),this.setContent([new b({cls:"track",content:[this._bar=new d({cls:"bar"}),this._thumb=new d({cls:"thumb"})]}),this._range=new A({type:"range",hidden:!0,value:e.value,min:e.min,max:e.max,step:e.step})]),this.setAttribute("tabindex",0),this.setDOMEvents({pointerdown:s(t=>this._on_mousedown(t),"pointerdown"),pointermove:s(t=>this._on_mousemove(t),"pointermove"),pointerup:s(t=>this._on_mouseup(t),"pointerup"),keydown:s(t=>this._on_key(t),"keydown")}),this._update()}_on_mousedown(e){e.stopPropagation(),e.preventDefault(),this.focus(),this._mdown=!0,this._irect=this.getBoundingRect(),this.setCapture(e.pointerId)}_getMinMax(){let e=parseInt(this._range.getAttribute("min")),t=parseInt(this._range.getAttribute("max"));return[e,t]}_on_mousemove(e){if(this._mdown){let t,o;this.props.vertical?(t=e.offsetY,o=this._irect.height):(t=e.offsetX,o=this._irect.width);let r=t/o;this.props.vertical&&(r=1-r);let[n,i]=this._getMinMax();this._range.setNumValue(n+r*(i-n)),this._update()}}_update(){let e=this._range.getNumValue(),[t,o]=this._getMinMax(),r=o>t?e/Math.abs(o-t)*100:0;this.props.vertical?(r=100-r,this._thumb.setStyleValue("top",r+"%"),this._bar.setStyleValue("height",r+"%")):(this._thumb.setStyleValue("left",r+"%"),this._bar.setStyleValue("width",r+"%")),this.fire("change",{value:e})}_on_mouseup(e){this._mdown&&(this.releaseCapture(e.pointerId),this._mdown=!1)}_on_key(e){var r;console.log(e.key);let t=(r=this.props.step)!=null?r:1,o=0;switch(e.key){case"ArrowRight":case"ArrowUp":o=t;break;case"ArrowLeft":case"ArrowDown":o=-t;break}o&&(e.ctrlKey&&(o*=10),this._range.setNumValue(this._range.getNumValue()+o),this._update())}setMin(e){this._range.setAttribute("min",e+""),this._update()}setMax(e){this._range.setAttribute("max",e+""),this._update()}setValue(e){this._range.setNumValue(e),this._update()}};s(rt,"Slider"),rt=u([p("x4")],rt);var nt=class extends b{constructor(e){super(e);let t=q();this.setContent([new d({cls:"switch",content:[new A({type:"checkbox",id:t,checked:e.checked}),new d({cls:"track"}),new d({cls:"thumb"})]}),new _({tag:"label",text:e.label,labelFor:t})])}};s(nt,"Switch"),nt=u([p("x4")],nt);var it=class extends I{constructor(e,t){super(e),this.addClass("outline"),this.setIcon(t.icon),this.setText(t.title),this.setData("tabname",t.name)}};s(it,"CTab"),it=u([p("x4")],it);var st=class extends b{_selitem;constructor(e,t){super(e),this.setItems(t),this.mapPropEvents(e,"click")}_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._selitem&&this._selitem.setClass("selected",!0)}setItems(e){this.clearContent(),e.forEach(t=>{this.addItem(t)})}addItem(e){this.appendContent(new it({click:s(t=>this._on_click(t),"click")},e))}getTabCount(){return this.dom.children.length}};s(st,"CTabList"),st=u([p("x4")],st);var at=class extends k{_list;_stack;_current;constructor(e){var o;super(e);let t=(o=e.items)==null?void 0:o.map(r=>({name:r.name,content:r.content}));this.setContent([this._list=new st({click:s(r=>this._onclick(r),"click")},e.items),this._stack=new ie({cls:"body x4flex",default:e.default,items:t})]),e.default&&this.selectTab(e.default)}selectTab(e){this._list.select(e),this._stack.select(e),this._current=e}_onclick(e){this.selectTab(e.name)}getTab(e){return this._stack.getPage(e)}getCurTab(){return this._current}addTab(e){this._list.addItem(e),this._stack.addItem({name:e.name,content:e.content}),this._list.getTabCount()==1&&this.selectTab(e.name)}};s(at,"Tabs"),at=u([p("x4")],at);var pr=class pr extends d{constructor(e){super({...e,tag:"textarea"}),this.setAttribute("name",e.name),this.setAttribute("value",e.value+""),e.resize||this.setAttribute("resize",!1),e.readonly&&this.setAttribute("readonly",!0)}setText(e){this.dom.value=e}getText(){return this.dom.value}queryInterface(e){return e=="form-element"?{getRawValue:s(()=>this.getText(),"getRawValue"),setRawValue:s(o=>{this.setText(o)},"setRawValue"),isValid:s(()=>!0,"isValid")}:super.queryInterface(e)}};s(pr,"SimpleTextArea");var hr=pr,lt=class extends k{_input;constructor(e){super(e),this.setContent([new _({text:e.label}),this._input=new hr(e)])}setText(e){this._input.setText(e)}getText(){return this._input.getText()}queryInterface(e){return e=="form-element"?{getRawValue:s(()=>this.getText(),"getRawValue"),setRawValue:s(o=>{this.setText(o)},"setRawValue"),isValid:s(()=>!0,"isValid")}:super.queryInterface(e)}};s(lt,"TextArea"),lt=u([p("x4")],lt);var ct=class extends b{input;constructor(e){var r;super(e),e.inputId||(e.inputId=q()),e.required&&this.setAttribute("required",!0);let t=(r=e.inputGadgets)!=null?r:[],o={...e,id:e.inputId,attrs:e.inputAttrs,width:e.inputWidth};this.setContent([e.label?new b({id:"label",width:e.labelWidth,content:[new _({tag:"label",text:e.label,labelFor:e.inputId})]}):null,new b({id:"edit",content:[this.input=new A(o),...t]})])}getValue(){return this.input.getValue()}setValue(e){this.input.setValue(e)}getInput(){return this.input}};s(ct,"TextEdit"),ct=u([p("x4")],ct);var mr=class mr extends d{constructor(e){super(e),this.addDOMEvent("resized",()=>this.update())}update(){var h,g,f,m;let e=this.props,t=e.values;if(!t.length){this.clearContent();return}let o=this.getBoundingRect(),r=(h=e.min)!=null?h:0,n=(g=e.max)!=null?g:100,i=o.width/t.length,l=o.height/(n-r),c=new zt;if(e.background&&c.rect(0,0,o.width,o.height).fill(e.background.toHexString()),r!=0&&c.path().moveTo(0,0-r).lineTo(o.width,0-r).stroke("var(--tickline-axis-color)",1).antiAlias(!1),e.type=="line"){let x=c.path();for(let v=0;v<t.length;v++)v==0?x.moveTo(v*i,(t[v]-r)*l):x.lineTo(v*i,(t[v]-r)*l);x.stroke(e.color?e.color.toHexString():"var(--tickline-color)",1).no_fill()}else for(let x=0;x<t.length;x++)c.rect(x*i,(0-r)*l,i-1,t[x]*l).fill(e.color?e.color.toHexString():"var(--tickline-color)").antiAlias(!1);this.setContent(new Ot({width:"100%",height:"100%",svg:c,attrs:{viewport:`0 ${(f=e.min)!=null?f:0} ${t.length} ${(m=e.max)!=null?m:100}`}}))}};s(mr,"TickLine");var ur=mr;var tn='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><!--!Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path class="fa-secondary" opacity=".4" d="M0 176c0 37.5 13.9 72.3 37.6 100.9L0 352l108.1-21.6C137.7 344.2 171.8 352 208 352c114.9 0 208-78.8 208-176S322.9 0 208 0S0 78.8 0 176zm134.7-52c0-25.8 20.9-46.7 46.7-46.7l47.4 0c29.1 0 52.6 23.6 52.6 52.6c0 18.8-10.1 36.3-26.4 45.6L228 191l0 6.3 0 20-40 0 0-20 0-17.9 0-11.6 10-5.8L235 140.9c3.9-2.3 6.3-6.4 6.3-10.9c0-7-5.7-12.6-12.6-12.6l-47.4 0c-3.7 0-6.7 3-6.7 6.7l0 5.5-40 0 0-5.5zM188 250.7l40 0 0 40-40 0 0-40z"/><path class="fa-primary" d="M134.7 124c0-25.8 20.9-46.7 46.7-46.7l47.4 0c29.1 0 52.6 23.6 52.6 52.6c0 18.8-10.1 36.3-26.4 45.6L228 191l0 6.3 0 20-40 0 0-20 0-17.9 0-11.6 10-5.8L235 140.9c3.9-2.3 6.3-6.4 6.3-10.9c0-7-5.7-12.6-12.6-12.6l-47.4 0c-3.7 0-6.7 3-6.7 6.7l0 5.5-40 0 0-5.5zM188 250.7l40 0 0 40-40 0 0-40zM432 512c-95.6 0-176.2-54.6-200.5-129C348.9 372.9 448 288.3 448 176c0-5.2-.2-10.4-.6-15.5C555.1 167.1 640 243.2 640 336c0 37.5-13.9 72.3-37.6 100.9L640 512 531.9 490.4C502.3 504.2 468.2 512 432 512z"/></svg>';var ho=null,Ut=null,on=new De;function bi(){document.addEventListener("mouseenter",a=>{if(a.target===document)return;let e=$t(a.target),t=e.getAttribute("tooltip"),o=e.queryInterface("tip-handler");if(o&&(t=o.getTip()),t){ho=a.target;let r=e.getBoundingRect();vi(t,r,{x:a.pageX,y:a.pageY})}},!0),document.addEventListener("mouseleave",a=>{ho&&a.target==ho&&(ho=null,_i())},!0)}s(bi,"initTooltips");function vi(a,e,t){Ut||(Ut=new dt({})),on.setTimeout(null,300,()=>{Ut.setText(ft(a)),Ut.displayAt(t.x+17,t.y+17)})}s(vi,"showTT");function _i(){Ut.show(!1),on.clearTimeout(null)}s(_i,"closeTT");var dt=class extends z{constructor(e){super(e),this.setContent(new b({content:[new E({iconId:tn}),new d({id:"text"})]}))}setText(e){this.query("#text").setContent(e)}};s(dt,"Tooltip"),dt=u([p("x4")],dt);var rn='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 nn=(h=>(h[h.first=0]="first",h[h.prev=1]="prev",h[h.next=2]="next",h[h.last=3]="last",h[h.parent=4]="parent",h[h.child=5]="child",h[h.expand=6]="expand",h[h.collapse=7]="collapse",h[h.toggle=8]="toggle",h))(nn||{}),Ie=class extends C{_item;_label;_icon;_childs;constructor(e,t){super({...e}),this._item=t,t?(this._label=new b({cls:"label item",content:[this._icon=new E({iconId:t.children?rn:void 0}),new _({tag:"span",cls:"",text:t.text,icon:t.iconId})]}),this._label.setData("id",t.id+""),t.children&&(this._childs=new k({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 k({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 Ie({},o));this._childs.setContent(t)}else this._childs.clearContent()}};s(Ie,"CTreeViewItem"),Ie=u([p("x4")],Ie);var ht=class extends d{_view;_selection;_selitem;_items;constructor(e){super(e);let t=new Z({cls:"body"});this._view=t.getViewport(),this.setContent([t,e.footer]),e.footer&&e.footer.setAttribute("id","footer"),this.setAttribute("tabindex",0),this.setDOMEvents({click:s(o=>this._onclick(o),"click"),keydown:s(o=>this._onkey(o),"keydown")}),e.items&&this.setItems(e.items)}setItems(e){this.clearSelection(),this._view.clearContent(),this._items=e;let t=new Ie({cls:"root"},null);e&&(t.setItems(e),this._view.setContent(t))}_onclick(e){let t=e.target;for(;t&&t!=this.dom;){let o=T(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(),i=n.findIndex(c=>this._selection==c.id),l;if(e==0)l=n[0].id;else if(e==3)l=n[n.length-1].id;else if(i>=0){if(e==1)i>0&&(l=n[i-1].id);else if(e==2)i<n.length-1&&(l=n[i+1].id);else if(e==4){let c=n[i].level;for(;i>0;)if(i--,n[i].level<c){l=n[i].id;break}}}if(l){let c=this.query(`[data-id="${l}"]`);return this._selectItem(l,c),!0}}return!1}_flattenOpenItems(){let e=[],t=s((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=s(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("selectionChange",{selection:o,empty:!1})}_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("selectionChange",{selection:void 0,empty:!0})}getSelection(){return this._selection}};s(ht,"Treeview"),ht=u([p("x4")],ht);0&&(module.exports={Application,AssistBox,Box,Breadcrumbs,BtnGroup,Button,CMover,CSizer,Calendar,Canvas,Checkbox,Color,ColorInput,ColorPicker,Combobox,Component,ComputedStyle,CoreElement,DataModel,DataProxy,DataRecord,DataStore,DataView,Dialog,DropdownList,EventSource,FileDialog,FileDrop,Flex,Form,GridBox,Gridview,HBox,Header,Icon,Image,Input,InputBox,Keyboard,Label,Link,Listbox,MasonryBox,Menu,MessageBox,Notification,Panel,Popup,Progress,PromptBox,PropertyGrid,Radio,Rating,Rect,Router,Saturation,ScrollView,Select,SimpleText,Slider,Space,StackBox,StateManager,Stylesheet,SvgBuilder,SvgComponent,SvgGradient,SvgGroup,SvgIcon,SvgPath,SvgShape,SvgText,Switch,Tabs,TextArea,TextEdit,TickLine,Timer,Treeview,UnsafeHtml,VBox,Viewport,_date_set_locale,_tr,addEvent,addTranslation,asap,beep,calcAge,camelCase,centerRect,clamp,class_ns,componentFromDOM,createLanguage,createPainter,data,date_calc_weeknum,date_clone,date_diff,date_format,date_hash,date_sql_utc,date_to_sql,dispatchEvent,dragManager,formatIntlDate,getAvailableLanguages,getCurrentLanguage,getFocusableElements,getScrollbarSize,initTooltips,isArray,isFeatureAvailable,isFunction,isLanguage,isNumber,isString,isUnitLess,kbNav,kbTreeNav,makeUniqueComponentId,oneshot,pad,parseIntlDate,parseRoute,pascalCase,selectLanguage,setWaitCursor,sprintf,svgLoader,unbubbleEvents,unitless,unsafe,unsafeHtml,wrapDOM,x4_class_ns_sym,x4_react});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "x4js",
3
- "version": "2.0.17",
3
+ "version": "2.0.18",
4
4
  "description": "X4 framework",
5
5
  "author": "etienne cochard",
6
6
  "license": "MIT",
@@ -4,6 +4,7 @@ export * from "./btngroup/btngroup"
4
4
  export * from "./button/button"
5
5
  export * from "./calendar/calendar"
6
6
  export * from "./canvas/canvas"
7
+ export * from "./canvas/canvas_ex"
7
8
  export * from "./checkbox/checkbox"
8
9
  export * from "./colorinput/colorinput"
9
10
  export * from "./colorpicker/colorpicker"