jqx-es 1.1.0 → 1.1.1
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/Bundle/jqx.browser.min.js +15 -15
- package/Bundle/jqx.min.js +15 -15
- package/package.json +1 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
var JQx=(()=>{var se=Object.defineProperty;var tt=Object.getOwnPropertyDescriptor;var rt=Object.getOwnPropertyNames;var nt=Object.prototype.hasOwnProperty;var ot=(e,t)=>{for(var r in t)se(e,r,{get:t[r],enumerable:!0})},it=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of rt(t))!nt.call(e,i)&&i!==r&&se(e,i,{get:()=>t[i],enumerable:!(n=tt(t,i))||n.enumerable});return e};var lt=e=>it(se({},"__esModule",{value:!0}),e);var yr={};ot(yr,{default:()=>b});var ae=ct(),Le=ut(),J=st(),Z=at();function st(){return{html:Object.freeze("accept,action,align,alt,autocapitalize,autocomplete,autopictureinpicture,autoplay,background,bgcolor,border,capture,cellpadding,cellspacing,checked,cite,class,clear,contenteditable,color,cols,colspan,controls,controlslist,coords,crossorigin,datetime,decoding,default,dir,disabled,disablepictureinpicture,disableremoteplayback,download,draggable,enctype,enterkeyhint,face,for,headers,height,hidden,high,href,hreflang,id,inputmode,integrity,is,ismap,kind,label,lang,list,loading,loop,low,max,maxlength,media,method,min,minlength,multiple,muted,name,nonce,noshade,novalidate,nowrap,open,optimum,pattern,placeholder,playsinline,poster,preload,pubdate,radiogroup,readonly,rel,required,rev,reversed,role,rows,rowspan,spellcheck,scope,selected,shape,size,sizes,span,srclang,start,src,srcset,step,style,summary,tabindex,target,title,translate,type,usemap,valign,value,width,xmlns,slot".split(",")),svg:Object.freeze("accent-height,accumulate,additive,alignment-baseline,ascent,attributename,attributetype,azimuth,basefrequency,baseline-shift,begin,bias,by,class,clip,clippathunits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,cx,cy,d,dx,dy,diffuseconstant,direction,display,divisor,dur,edgemode,elevation,end,fill,fill-opacity,fill-rule,filter,filterunits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,fx,fy,g1,g2,glyph-name,glyphref,gradientunits,gradienttransform,height,href,id,image-rendering,in,in2,k,k1,k2,k3,k4,kerning,keypoints,keysplines,keytimes,lang,lengthadjust,letter-spacing,kernelmatrix,kernelunitlength,lighting-color,local,marker-end,marker-mid,marker-start,markerheight,markerunits,markerwidth,maskcontentunits,maskunits,max,mask,media,method,mode,min,name,numoctaves,offset,operator,opacity,order,orient,orientation,origin,overflow,paint-order,path,pathlength,patterncontentunits,patterntransform,patternunits,points,preservealpha,preserveaspectratio,primitiveunits,r,rx,ry,radius,refx,refy,repeatcount,repeatdur,restart,result,rotate,scale,seed,shape-rendering,specularconstant,specularexponent,spreadmethod,startoffset,stddeviation,stitchtiles,stop-color,stop-opacity,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke,stroke-width,style,surfacescale,systemlanguage,tabindex,targetx,targety,transform,text-anchor,text-decoration,text-rendering,textlength,type,u1,u2,unicode,values,viewbox,visibility,version,vert-adv-y,vert-origin-x,vert-origin-y,width,word-spacing,wrap,writing-mode,xchannelselector,ychannelselector,x,x1,x2,xmlns,y,y1,y2,z,zoomandpan".split(","))}}function at(){return{a:!0,area:!0,audio:!1,br:!0,base:!0,body:!0,button:!0,canvas:!0,comment:!0,dl:!0,data:!0,datalist:!0,div:!0,em:!0,embed:!1,fieldset:!0,font:!0,footer:!0,form:!1,hr:!0,head:!0,header:!0,output:!0,iframe:!1,frameset:!1,img:!0,input:!0,li:!0,label:!0,legend:!0,link:!0,map:!0,mark:!0,menu:!0,media:!0,meta:!0,nav:!0,meter:!0,ol:!0,object:!1,optgroup:!0,option:!0,p:!0,param:!0,picture:!0,pre:!0,progress:!1,quote:!0,script:!1,select:!0,source:!0,span:!0,style:!0,caption:!0,td:!0,col:!0,table:!0,tr:!0,template:!1,textarea:!0,time:!0,title:!0,track:!0,details:!0,ul:!0,video:!0,del:!0,ins:!0,slot:!0,blockquote:!0,svg:!0,dialog:!0,summary:!0,main:!0,address:!0,colgroup:!0,tbody:!0,tfoot:!0,thead:!0,th:!0,dd:!0,dt:!0,figcaption:!0,figure:!0,i:!0,b:!0,code:!0,h1:!0,h2:!0,h3:!0,h4:!0,abbr:!0,bdo:!0,dfn:!0,kbd:!0,q:!0,rb:!0,rp:!0,rt:!0,ruby:!0,s:!0,strike:!0,samp:!0,small:!0,strong:!0,sup:!0,sub:!0,u:!0,var:!0,wbr:!0,nobr:!0,tt:!0,noscript:!0}}function ct(){return["#logBox{min-width:0px;max-width:0px;min-height:0px;max-height:0px;width:0;height:0;z-index:-1;border:none;padding:0px;overflow:hidden;transition:all 0.3s ease;margin-top:-100px;}","#logBox.visible{background-color:rgb(255, 255, 224);z-index:1;position:static;border:1px dotted rgb(153, 153, 153);max-width:50vw;min-width:30vw;min-height:10vh;max-height:90vh;overflow:auto;width:50vw;height:20vh;margin:1rem 0px;padding:0px 8px 19px;resize:both;}","#logBox.visible .legend{position:absolute;}","#logBox .legend{text-align:center;margin-top:-1em;width:inherit;max-width:inherit;}","#logBox .legend div{text-align:center;display:inline-block;max-width:inherit;height:1.2rem;background-color:rgb(119, 119, 119);padding:2px 10px;color:rgb(255, 255, 255);box-shadow:rgb(119 119 119) 2px 1px 10px;border-radius:4px;}","#logBox .legend div:before{content:'JQx Logging (chronological)';}","#logBox .legend.reversed div:before{content:'JQx Logging (reversed)';}","#logBox #jqx_logger{marginTop:0.7rem;lineHeight:1.4em;font-family:consolas,monospace;whiteSpace:pre-wrap;maxWidth:inherit;padding-left:100px;}","#logBox #jqx_logger div.entry{text-indent:-100px;whiteSpace:normal;}"]}function ut(){return["::backdrop{background-color:grey;opacity:0.2;}",`#jqxPopup{overflow:hidden;background-color:transparent;outline:none;border:none;inset:0;animation:fade-out 0.5s ease-out;&[open]{display:flex;align-items:center;justify-content:center;animation:fade-in 0.5s ease;}#jqxPopupContent{background-color:white;border:solid 1px #eee;box-shadow:1px 2px 8px #999;border-radius:4px;padding:12px;vertical-align:middle;max-height:40vh;max-width:50vw;overflow:auto;margin:0 auto;div:not(#closeHandleIcon){clear:both;}@media (width <= 640px){max-width:80vw;max-height:60vh;}#closeHandleIcon{cursor:pointer;width:24px;height:24px;display:inline;position:absolute;top:4px;right:4px;justify-content:right;background-image:url("data:image/svg+xml;utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20version%3D%221.1%22%20id%3D%22Layer_1%22%20x%3D%220px%22%20y%3D%220px%22%20viewBox%3D%220%200%20128%20128%22%20style%3D%22enable-background%3Anew%200%200%20128%20128%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Crect%20x%3D%22-368%22%20y%3D%226%22%20style%3D%22display%3Anone%3Bfill%3A%23E0E0E0%3B%22%20width%3D%22866%22%20height%3D%221018%22%2F%3E%3Ccircle%20style%3D%22fill%3A%23FFFFFF%3B%22%20cx%3D%2264%22%20cy%3D%2264%22%20r%3D%2248%22%2F%3E%3Ccircle%20style%3D%22fill%3A%238CCFB9%3B%22%20cx%3D%2264%22%20cy%3D%2264%22%20r%3D%2239%22%2F%3E%3Ccircle%20style%3D%22fill%3Anone%3Bstroke%3A%23444B54%3Bstroke-width%3A6%3Bstroke-miterlimit%3A10%3B%22%20cx%3D%2264%22%20cy%3D%2264%22%20r%3D%2248%22%2F%3E%3Cpolyline%20style%3D%22fill%3Anone%3Bstroke%3A%23FFFFFF%3Bstroke-width%3A6%3Bstroke-linecap%3Around%3Bstroke-miterlimit%3A10%3B%22%20points%3D%2242%2C69%2055.55%2C81%20%20%2086%2C46%20%22%2F%3E%3C%2Fsvg%3E");@media (width <= 640px){background-image:none;position:relative;margin:-15px -15px 4px 0;float:right;vertical-align:middle;border:1px solid #AAA;padding:2px;border-radius:50%;width:12px;height:12px;font-size:12px;line-height:12px;font-weight:bold;text-align:center;&:after{content:'\\2714';color:green;}}}.warn{display:none;text-align:center;color:red;border-top:1px solid #999;margin-top:1em;padding-top:3px;animation:warn-fade-out 0.2s ease-out;}.warn.active{opacity:1;display:block;animation:warn-fade-in 0.2s ease-in;}}}`,"@keyframes fade-in{0%{opacity:0;transform:scale(0, 0);display:none;}100%{opacity:1;transform:scale(1, 1);display:flex;}}","@keyframes fade-out{0%{opacity:1;transform:scale(1, 1);display:flex;}100%{opacity:0;transform:scale(0, 0);display:none;}}","@keyframes warn-fade-in{0%{opacity:0;transform:scale(0, 0);display:none;}100%{opacity:1;transform:scale(1,1 );display:block;}}","@keyframes warn-fade-out{0%{opacity:1;transform:scale(1, 1);display:block;}100%{opacity:0;transform:scale(0, 0);display:none;}}"]}var ce=!1,ft={on:()=>ce=!0,off:()=>ce=!1},M={tagsRaw:Z,allowUnknownHtmlTags:ft,isAllowed(e){if(ce)return!0;let t=a(e,String)?e.toLowerCase():e?.nodeName.toLowerCase()||"none";return t==="#text"||!!Z[t]},allowTag:e=>Z[e.toLowerCase()]=!0,prohibitTag:e=>Z[e.toLowerCase()]=!1};var de=!1,X=!1,W=!0,me=!1,dt=!0,$e,Q=()=>b("#logBox"),Te="#jqx_logger",mt=e=>{ae?.forEach(t=>e(t))},gt=()=>{ae&&mt($e);let e=dt?"div":"pre",t=`<div id="logBox"><div class="legend"><div></div></div><${e} id="jqx_logger"></${e}></div>`;return ge(H(t),void 0,F.AfterBegin),b.node(Te)},Ce=e=>a(e,String)&&Object.assign(document.createElement("textarea"),{innerHTML:e}).textContent||e,D=(...e)=>{let t=e[0]==="fromStatic";if(e=t?e.slice(1):e,t&&!X)return e.forEach(n=>console.info(`${q()} \u2714 ${Ce(n)}`));if(!X)return;!W&&!b.node("#logBox")&&($e=b.createStyle("JQxLogCSS"),gt());let r=n=>`${a(n,Object)?JSON.stringify(n,null,2):n}
|
|
2
|
-
`;e.forEach(n=>W?console.info(`${q()} \u2714 ${Ce(n)}`):b.node("#jqx_logger").insertAdjacentHTML(me?"afterbegin":"beforeend",`<div class="entry">${q()} ${r(n.replace(/\n/g,"<br>"))}</div>`))},ue={on(){X=!0,D("Logging activated")},off(){X=!1,console.log("Logging deactivated")}},fe={on(){de=!0},off(){de=!1}},N=(...e)=>de&&D(...e),$={get isConsole(){return W===!0},get isOn(){return X},isVisible:function(){return b("#jqx_logger").is("visible")},on(){return ue.on(),fe.on(),W||Q()?.addClass("visible"),D("Debug logging started. Every call to [jqx instance] is logged"),$},off(){return Q().isEmpty||(fe.off(),D("Debug logging stopped"),Q()?.removeClass("visible")),ue.off(),$},toConsole:{on(){return W=!0,D("Started logging to console"),$},off(){return D("Stopped logging to console (except error messages)"),W=!1,$}},remove(){return ue.off(),fe.off(),Q()?.remove(),console.clear(),console.log(`${q()} logging completely disabled and all entries removed`),$},log:function(...e){return D(...e),$},hide(){return Q()?.removeClass("visible"),$},show:()=>(Q()?.addClass("visible"),$),get reversed(){return{on:()=>(me=!0,D("Reverse logging set: now logging bottom to top (latest first)"),b("#logBox .legend").addClass("reversed"),$),off:()=>(me=!1,b("#logBox .legend").removeClass("reversed"),D("Reverse logging reset: now logging chronological (latest last)"),$)}},clear(){return b(Te).text(""),console.clear(),D("Logging cleared"),$}};var pt=yt(),Fe={html:"innerHTML",text:"textContent",class:"className"},pe=pt;function yt(){let e={get(t,r){let n=String(r)?.toLowerCase();switch(!0){case n in t:return t[n];case Ct(n):return Ae(t,n,r);default:return Ae(t,n,r,!0)}},enumerable:!1,configurable:!1};return new Proxy({},e)}function Ae(e,t,r,n=!1){return Object.defineProperty(e,t,{get(){return n?i=>wt(r):$t(t)}}),e[t]}function bt(e,t,r){return t=t?.isJQx&&t.first()||t,be({trial:n=>Lt(t)?e.append(t):He(t)?e.insertAdjacentHTML("beforeend",t):e.append(t),whenError:n=>console.info(`${r} (for root ${e}) not created, reason
|
|
3
|
-
`,n)})}function ht(e,t,...r){let n=xt(t,e);return r?.forEach(i=>bt(n,i,e)),n}function xt(e,t){switch(e=ye(t)?Et(e):e?.isJQx?e.first():e,!0){case a(e,String):return Y(t,He(e,t)?{html:e}:{text:e});case a(e,Node):return vt(t,e);default:return Y(t,e)}}function St(e){return delete e.data,Object.keys(e).length<1||Object.keys(e).forEach(t=>{let r=t.toLowerCase();r in Fe&&(e[Fe[r]]=e[t],delete e[t])}),e}function vt(e,t){let r=Y(e);return r.append(t),r}function Y(e,t={}){t=De(t,{});let r=Object.entries(t.data??{}),n=Object.assign(ye(e)?new Comment(t?.text):document.createElement(e),St(t));return r.length&&r.forEach(([i,s])=>n.dataset[i]=String(s)),n}function De(e,t){return t?a(e,{isTypes:Object,notTypes:[Array,null,NaN,Proxy],defaultValue:t}):a(e,{isTypes:Object,notTypes:[Array,null,NaN,Proxy]})}function Et(e){return De(e)?e?.text??e?.textContent??"":String(e)}function wt(e){return Y("b",{style:"color:red",text:`'${e}' is not a valid HTML-tag`})}function He(e,t){return!ye(t)&&a(e,String)&&/<.*>|&[#|0-9a-z]+[^;];/i.test(e)}function Lt(e){return e?.constructor===Comment||e?.constructor===CharacterData}function ye(e){return e?.constructor===Comment||/comment/i.test(e)}function Ct(e){return!a(Y(e),HTMLUnknownElement)}function $t(e){return(t,...r)=>ht(e,t,...r)}var{IS:a,maybe:be,$Wrap:Ar,xProxy:Dr,isNothing:Hr}=Tt();function Tt(){Symbol.proxy=Symbol.for("toa.proxy"),Symbol.is=Symbol.for("toa.is"),Symbol.type=Symbol.for("toa.type"),Symbol.isSymbol=Symbol.for("toa.isASymbol"),y();let e=T(),[t,r]=[d(),C()];return r.custom(),{IS:n,maybe:e,$Wrap:t,isNothing:E,xProxy:r};function n(o,...l){if(e({trial:u=>"isTypes"in(l?.[0]??{})})){let u=l[0];return"defaultValue"in u?g(o,u):"notTypes"in u?m(o,u):n(o,...[u.isTypes].flat())}let c=typeof o=="symbol"?Symbol.isSymbol:o;return l.length>1?x(c,...l):s(o,...l)}function i(o){return o?.[Symbol.proxy]??n(o)}function s(o,...l){let{noInput:c,noShouldbe:u,compareTo:S,inputCTOR:A,isNaN:P,isInfinity:I,shouldBeFirstElementIsNothing:R}=v(o,...l);switch(l=l.length&&l[0],!0){case R:return String(o)===String(S);case(o?.[Symbol.proxy]&&u):return o[Symbol.proxy];case P:return u?"NaN":e({trial:B=>String(S)})===String(o);case I:return u?"Infinity":e({trial:B=>String(S)})===String(o);case c:return u?String(o):String(S)===String(o);case A===Boolean:return l?A===l:"Boolean";default:return L(o,l,u,p(o,A))}}function p(o,l){return o===0?Number:o===""?String:o?l:{name:String(o)}}function v(o,...l){let c=l.length<1,u=!c&&l[0],S=!c&&E(l[0]),A=o==null,P=!A&&Object.getPrototypeOf(o)?.constructor,I=e({trial:B=>String(o)})==="NaN",R=e({trial:B=>String(o)})==="Infinity";return{noInput:A,noShouldbe:c,compareTo:u,inputCTOR:P,isNaN:I,isInfinity:R,shouldBeFirstElementIsNothing:S}}function L(o,l,c,u){switch(!0){case(!c&&l===o||o?.[Symbol.proxy]&&l===Proxy):return!0;case e({trial:S=>String(l)})==="NaN":return String(o)==="NaN";case(o?.[Symbol.toStringTag]&&n(l,String)):return String(l)===o[Symbol.toStringTag];default:return l?e({trial:S=>o instanceof l})||l===u||l===Object.getPrototypeOf(u)||`${l?.name}`===u?.name:o?.[Symbol.toStringTag]&&`[object ${o?.[Symbol.toStringTag]}]`||u?.name||String(u)}}function x(o,...l){return l.some(c=>n(o,c))}function E(o,l=!1){let c=o==null;return c=l?c||n(o,1/0)||n(o,NaN):c,c}function T(){let o=(l,c)=>l?.constructor===Function?l(c):void 0;return function({trial:l,whenError:c=()=>{}}={}){try{return o(l)}catch(u){return o(c,u)}}}function d(){return function(o){return Object.freeze({get value(){return o},get[Symbol.type](){return i(o)},get type(){return i(o)},[Symbol.is](...l){return n(o,...l)},is(...l){return n(o,...l)}})}}function g(o,{defaultValue:l,isTypes:c=[void 0],notTypes:u}={}){return c=c?.constructor!==Array?[c]:c,u=u&&u?.constructor!==Array?[u]:[],u.length<1?n(o,...c)?o:l:m(o,{isTypes:c,notTypes:u})?o:l}function m(o,{isTypes:l=[void 0],notTypes:c=[void 0]}={}){return l=l?.constructor!==Array?[l]:l,c=c?.constructor!==Array?[c]:c,n(o,...l)&&!n(o,...c)}function y(){Object.getOwnPropertyDescriptors(Object.prototype)[Symbol.is]||(Object.defineProperties(Object.prototype,{[Symbol.type]:{get(){return i(this)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(...o){return n(this,...o)},enumerable:!1,configurable:!1}}),Object.defineProperties(Object,{[Symbol.type]:{value(o){return i(o)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(o,...l){return n(o,...l)},enumerable:!1,configurable:!1}}))}function f(o){let l=String(Object.getPrototypeOf(o)?.constructor);return l.slice(l.indexOf("ion")+3,l.indexOf("(")).trim()}function h(o){let l=o.set;return o.set=(c,u,S)=>u===Symbol.proxy?c[u]=S:l(c,u,S),o}function C(){let o=Proxy;return{native(){Proxy=o},custom(){Proxy=new o(o,{construct(l,c){for(let S of c)S.set&&(S=h(S));let u=new l(...c);return u[Symbol.proxy]=`Proxy (${f(c[0])})`,u}})}}}}var{IS:ne,maybe:Or,$Wrap:Mr,xProxy:Nr,isNothing:Pr}=Ft();function Ft(){Symbol.proxy=Symbol.for("toa.proxy"),Symbol.is=Symbol.for("toa.is"),Symbol.type=Symbol.for("toa.type"),Symbol.isSymbol=Symbol.for("toa.isASymbol"),y();let e=T(),[t,r]=[d(),C()];return r.custom(),{IS:n,maybe:e,$Wrap:t,isNothing:E,xProxy:r};function n(o,...l){if(e({trial:u=>"isTypes"in(l?.[0]??{})})){let u=l[0];return"defaultValue"in u?g(o,u):"notTypes"in u?m(o,u):n(o,...[u.isTypes].flat())}let c=typeof o=="symbol"?Symbol.isSymbol:o;return l.length>1?x(c,...l):s(o,...l)}function i(o){return o?.[Symbol.proxy]??n(o)}function s(o,...l){let{noInput:c,noShouldbe:u,compareTo:S,inputCTOR:A,isNaN:P,isInfinity:I,shouldBeFirstElementIsNothing:R}=v(o,...l);switch(l=l.length&&l[0],!0){case R:return String(o)===String(S);case(o?.[Symbol.proxy]&&u):return o[Symbol.proxy];case P:return u?"NaN":e({trial:B=>String(S)})===String(o);case I:return u?"Infinity":e({trial:B=>String(S)})===String(o);case c:return u?String(o):String(S)===String(o);case A===Boolean:return l?A===l:"Boolean";default:return L(o,l,u,p(o,A))}}function p(o,l){return o===0?Number:o===""?String:o?l:{name:String(o)}}function v(o,...l){let c=l.length<1,u=!c&&l[0],S=!c&&E(l[0]),A=o==null,P=!A&&Object.getPrototypeOf(o)?.constructor,I=e({trial:B=>String(o)})==="NaN",R=e({trial:B=>String(o)})==="Infinity";return{noInput:A,noShouldbe:c,compareTo:u,inputCTOR:P,isNaN:I,isInfinity:R,shouldBeFirstElementIsNothing:S}}function L(o,l,c,u){switch(!0){case(!c&&l===o||o?.[Symbol.proxy]&&l===Proxy):return!0;case e({trial:S=>String(l)})==="NaN":return String(o)==="NaN";case(o?.[Symbol.toStringTag]&&n(l,String)):return String(l)===o[Symbol.toStringTag];default:return l?e({trial:S=>o instanceof l})||l===u||l===Object.getPrototypeOf(u)||`${l?.name}`===u?.name:o?.[Symbol.toStringTag]&&`[object ${o?.[Symbol.toStringTag]}]`||u?.name||String(u)}}function x(o,...l){return l.some(c=>n(o,c))}function E(o,l=!1){let c=o==null;return c=l?c||n(o,1/0)||n(o,NaN):c,c}function T(){let o=(l,c)=>l?.constructor===Function?l(c):void 0;return function({trial:l,whenError:c=()=>{}}={}){try{return o(l)}catch(u){return o(c,u)}}}function d(){return function(o){return Object.freeze({get value(){return o},get[Symbol.type](){return i(o)},get type(){return i(o)},[Symbol.is](...l){return n(o,...l)},is(...l){return n(o,...l)}})}}function g(o,{defaultValue:l,isTypes:c=[void 0],notTypes:u}={}){return c=c?.constructor!==Array?[c]:c,u=u&&u?.constructor!==Array?[u]:[],u.length<1?n(o,...c)?o:l:m(o,{isTypes:c,notTypes:u})?o:l}function m(o,{isTypes:l=[void 0],notTypes:c=[void 0]}={}){return l=l?.constructor!==Array?[l]:l,c=c?.constructor!==Array?[c]:c,n(o,...l)&&!n(o,...c)}function y(){Object.getOwnPropertyDescriptors(Object.prototype)[Symbol.is]||(Object.defineProperties(Object.prototype,{[Symbol.type]:{get(){return i(this)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(...o){return n(this,...o)},enumerable:!1,configurable:!1}}),Object.defineProperties(Object,{[Symbol.type]:{value(o){return i(o)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(o,...l){return n(o,...l)},enumerable:!1,configurable:!1}}))}function f(o){let l=String(Object.getPrototypeOf(o)?.constructor);return l.slice(l.indexOf("ion")+3,l.indexOf("(")).trim()}function h(o){let l=o.set;return o.set=(c,u,S)=>u===Symbol.proxy?c[u]=S:l(c,u,S),o}function C(){let o=Proxy;return{native(){Proxy=o},custom(){Proxy=new o(o,{construct(l,c){for(let S of c)S.set&&(S=h(S));let u=new l(...c);return u[Symbol.proxy]=`Proxy (${f(c[0])})`,u}})}}}}var K=At;function At({styleSheet:e,createWithId:t}={}){let{tryParseAtOrNestedRules:r,ruleExists:n,checkParams:i,sheet:s,removeRules:p,consider:v,currentSheetID:L}=Dt({styleSheet:e,createWithId:t});function x(m,y){if(m&&y.removeProperties){Object.keys(y.removeProperties).forEach(f=>m.style.removeProperty(je(f)));return}Object.entries(y).forEach(([f,h])=>{f=je(f.trim()),h=h.trim();let C;if(/!important/.test(h)&&(h=h.slice(0,h.indexOf("!important")).trim(),C="important"),!CSS.supports(f,h))return console.error(`StylingFactory ${L} error: '${f}' with value '${h}' not supported (yet)`);Oe(()=>m.style.setProperty(f,h,C),`StylingFactory ${L} (setRule4Selector) failed`)})}function E(m,y,f=s){if(m=m?.trim?.(),!ne(m,String)||!m.length||/[;,]$/g.test(m))return console.error(`StylingFactory ${L} (setRules): [${m||"[no selector given]"}] is not a valid selector`);if(y.removeRule)return p(m);let h=n(m,!0),C=h||f.cssRules[f.insertRule(`${m} {}`,f.cssRules.length||0)];return v(()=>x(C,y),m,h)}function T(m){let y=m.trim().split(/{/,2),f=y.shift().trim();if(!ne(f,String)||!f?.trim()?.length)return console.error(`StylingFactory ${L} (doParse): no (valid) selector could be extracted from rule ${he(m)}`);let h=It(y.shift());return Oe(()=>E(f,h),`StylingFactory ${L} (setRules) failed`)}function d(m){let y=r(m);return y.done?y.existing:T(m)}function g(m,y){return m.trim().startsWith("@media")?d(Ht(m,y)):E(m,y)}return function(m,y={}){return i(m,y)&&(Object.keys(y).length?g(m,y):d(m))}}function Dt({styleSheet:e,createWithId:t}){let r="Note: The rule or some of its properties may not be supported by your browser (yet)",n=`for style#${t}`;e=t?i(t):e;function i(d){let g=document.querySelector(`#${d}`)?.sheet;if(g)return g;let m=Object.assign(document.createElement("style"),{id:d});return document.head.insertAdjacentElement("beforeend",m),m.sheet}function s(d){return console.error(`StylingFactory ${n} [rule: ${d}]
|
|
4
|
-
=> @charset, @namespace and @import are not supported here`),{done:!0}}function p(d,g){return[...e.rules].find(m=>g?Me(m.selectorText||"",d):Mt`${Ot(d)}${[..."gim"]}`.test(m.cssText))}function v(d){return/^@charset|@import|namespace/i.test(d.trim())?s(d):d.match(/}/g)?.length>1?{existing:E(d,1),done:!0}:{done:!1}}function L(d){let g=[...e.cssRules].reduce((y,f,h)=>Me(f.selectorText||"",d)&&y.concat(h)||y,[]),m=g.length;return g.forEach(y=>e.deleteRule(y)),m>0?console.info(`\u2714 Removed ${m} instance${m>1?"s":""} of selector ${d} from ${n.slice(4)}`):console.info(`\u2714 Remove rule: selector ${d} does not exist in ${n.slice(4)}`)}function x(d,g){return d&&ne(d,String)&&d.trim().length>0&&ne(g,Object)||(console.error(`StylingFactory ${n} called with invalid parameters`),!1)}function E(d){d=d.trim();let g=d.slice(0,d.indexOf("{")).trim(),m=!!p(g);try{return e.insertRule(`${d}`,e.cssRules.length),m}catch(y){return console.error(`StylingFactory ${n} (tryParse) ${y.name} Error:
|
|
5
|
-
${y.message}
|
|
6
|
-
Rule: ${he(d)}
|
|
7
|
-
${r}`),m}}function T(d,g,m){try{return d(),m}catch(y){return console.error(`StylingFactory ${n} (tryAddOrModify) ${y.name} Error:
|
|
8
|
-
${y.message}
|
|
9
|
-
Rule: ${he(g)}
|
|
10
|
-
${r}`),m}}return{sheet:e,removeRules:L,tryParseAtOrNestedRules:v,ruleExists:p,checkParams:x,tryParse:E,consider:T,currentSheetID:n}}function Ht(e,t){return`${e.trim()} ${Object.entries(t).map(([r,n])=>`${r}: { ${jt(n)}`)}`}function he(e){let t=(e||"NO RULE").trim().slice(0,50).replace(/\n/g,"\\n").replace(/\s{2,}/g," ");return e.length>t.length?`${t.trim()}...truncated`:t}function jt(e){return Object.entries(e).map(([t,r])=>`${t}: ${r.trim()}`).join(`;
|
|
11
|
-
`)}function Ot(e){return e.replace(/([*\[\]()-+{}.$?\\])/g,t=>`\\${t}`)}function Mt(e,...t){let r=t.length&&Array.isArray(t.slice(-1))?t.pop().join(""):"";return new RegExp((t.length&&e.raw.reduce((n,i,s)=>n.concat(t[s-1]||"").concat(i),"")||e.raw.join("")).split(`
|
|
12
|
-
`).map(n=>n.replace(/\s|\/\/.*$/g,"").trim().replace(/(@s!)/g," ")).join(""),r)}function je(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`).replace(/[^--]^-|-$/,"")}function Oe(e,t){try{return e()}catch(r){console.error(`${t||"an error occured"}: ${r.message}`)}}function Nt(e){return e.replace(/\/\*.+?\*\//gm,"").replace(/[}{\r\n]/g,"").replace(/(data:.+?);/g,(t,r)=>`${r}\\3b`).split(";").map(t=>t.trim()).join(`;
|
|
13
|
-
`).replaceAll("\\3b",";").split(`
|
|
14
|
-
`)}function Pt(e){return e.reduce((t,r)=>{let[n,i]=[r.slice(0,r.indexOf(":")).trim(),r.slice(r.indexOf(":")+1).trim().replace(/;$|;.+(?=\/*).+\/$/,"")];return n&&i?{...t,[n]:i}:t},{})}function It(e){return Pt(Nt(e))}function Me(e,t){return e?.replace("::",":")===t?.replace("::",":")}var Rt=[...Array(26)].map((e,t)=>String.fromCharCode(t+65)).concat([...Array(26)].map((e,t)=>String.fromCharCode(t+97))).concat([...Array(10)].map((e,t)=>`${t}`)),oe=(e,t=2)=>`${e}`.padStart(t,"0"),Bt=(e,t=0)=>([e,t]=[Math.floor(e),Math.ceil(t)],Math.floor([...crypto.getRandomValues(new Uint32Array(1))].shift()/2**32*(e-t+1)+t)),kt=e=>{let t=e.length;for(;t--;){let r=Bt(t);[e[t],e[r]]=[e[r],e[t]]}return e};var j=(e,t=120)=>`${e}`.trim().slice(0,t).replace(/>\s+</g,"><").replace(/</g,"<").replace(/\s{2,}/g," ").replace(/\n/g,"\\n")+(e.length>t?" …":"").trim(),O=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`).replace(/^-|-$/,""),Jt=([e,...t])=>`${e.toUpperCase()}${t.join("")}`,ee=e=>a(e,String)?e.toLowerCase().split("-").map((t,r)=>r&&`${Jt(t)}`||t).join(""):e,z=()=>`_${kt(Rt).slice(0,8).join("")}`,ie=(e,t=120)=>j(e,t).replace(/</g,"<"),q=()=>(e=>`[${oe(e.getHours())}:${oe(e.getMinutes())}:${oe(e.getSeconds())}.${oe(e.getMilliseconds(),3)}]`)(new Date);var _=e=>e.replace(/</g,"<");function Ne(){let e=function(s){if(!s)return;let p=s.style,v=getComputedStyle(s),L=[p.visibility,v.visibility].includes("hidden"),x=[p.display,v.display].includes("none"),E=s.offsetTop<0||s.offsetLeft+s.offsetWidth<0||s.offsetLeft>document.body.offsetWidth,T=+v.opacity==0||+(p.opacity||1)==0;return!(E||T||x||L)},t="n/a",r=function(s){return s.parentNode?!!b.nodes(":is(:read-write)",s?.parentNode)?.find(p=>p===s):!1},n=function(s){return s.parentNode?!!b.nodes(":is(:modal)",s?.parentNode)?.find(p=>p===s):!1},i={notInDOM:!0,writable:t,modal:t,empty:!0,open:t,visible:t};return s=>{let p=s.node;return p?{get writable(){return r(p)},get modal(){return n(p)},get inDOM(){return p.isConnected},get open(){return p.open??!1},get visible(){return e(p)},get disabled(){return p.hasAttribute("readonly")||p.hasAttribute("disabled")},get empty(){return s.collection.length<1},get virtual(){return s.isVirtual}}:i}}var Qt=!0,le={data:/data-[\-\w.\p{L}]/ui,validURL:/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,whiteSpace:/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g,notAllowedValues:/javascript|injected|noreferrer|alert|DataURL/gi},Wt=e=>{if(Qt&&Object.keys(e.removed).length){let t=Object.entries(e.removed).reduce((r,[n,i])=>[...r,`${_(n)} => ${i}`],[]).join("\\000A");$.log(`JQx HTML creation errors: ${$.isConsole?t:_(t)}`)}},qt=function(e){let t=e.nodeName.toLowerCase(),r=["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"];return/-/.test(t)&&!r.find(n=>n===t)||M.isAllowed(t)},te=e=>{let t={rawHTML:e?.parentElement?.getHTML()??"no html",removed:{}};return a(e,HTMLElement)&&[...e.childNodes].forEach(r=>{if(r?.children?.length&&te(r),r?.attributes){let i=a(r,SVGElement)?J.svg:J.html;[...(r??{attributes:[]}).attributes].forEach(s=>{let p=s.name.trim().toLowerCase(),v=s.value.trim().toLowerCase().replace(le.whiteSpace,""),L=p==="href"?!le.validURL.test(v):le.notAllowedValues.test(v),x=p.startsWith("data")?!le.data.test(p):!!i[p];if(L||x){let E=ie(s.value||"none",60);E+=E.length===60?"...":"",t.removed[`${s.name}`]=`attribute/property (-value) not allowed, removed. Value: ${E}`,r.removeAttribute(s.name)}})}if(!(qt(r)||r.constructor===CharacterData||r.constructor===Comment)){let i=(r?.outerHTML||r?.textContent).trim(),s=ie(i,60)??"EMPTY";s+=s.length===60?"...":"",t.removed[`<${r.nodeName?.toLowerCase()}>`]=`not allowed, not rendered. Value: ${s}`,r.remove()}}),Wt(t),e};var F=new Proxy({start:"afterbegin",afterbegin:"afterbegin",end:"beforeend",beforeend:"beforeend",before:"beforebegin",beforebegin:"beforebegin",after:"afterend",afterend:"afterend"},{get(e,t){return e[String(t).toLowerCase()]??e[t]}}),zt=e=>{let t=document.createElement("div");return t.insertAdjacentHTML(F.end,e),t.childNodes.length?te(t):void 0},_t=(e,t,r)=>a(e,Comment)?t.insertAdjacentHTML(r,`<!--${e.data}-->`):t.insertAdjacentText(r,e.data),U=(e=[],t=document.body,r=F.BeforeEnd)=>e.reduce((n,i)=>{let s=re(i)&&ge(i,t,r);return s?[...n,s]:n},[]),ge=(e,t=document.body,r=F.BeforeEnd)=>(t=t?.isJQx?t?.[0]:t,a(e,Comment,Text)?_t(e,t,r):t.insertAdjacentElement(r,e)),H=e=>{if(a(e,Text,Comment))return e;let t=e?.trim(),r=t?.split(/<text>|<\/text>/i)??[];if(r?.length&&(r=r.length>1?r.filter(i=>i.length).shift():void 0),t.startsWith("<!--")&&t.endsWith("-->"))return document.createComment(e.replace(/<!--|-->$/g,""));if(r||!/^<(.+)[^>]+>/m.test(t))return document.createTextNode(r);let n=zt(e);return n.childNodes.length<1?H(`<span data-jqxcreationerror="1">${j(e,60)}</span>`):n.children[0]};var w=(e,t)=>{let r=e.collection.filter(n=>!Je(n));for(let n=0;n<r.length;n+=1)t(r[n],n);return e},Ut=Ne(),Pe=e=>e&&(e.textContent="");var V=e=>{let t=e.cloneNode(!0);return t.removeAttribute&&t.removeAttribute("id"),e.isConnected?e.remove():e=null,t},Be=(e,t)=>{e&&a(t,Object)&&Object.entries(t).forEach(([r,n])=>e.setAttribute(`data-${O(r)}`,n))},Ie=(e,t)=>e.andThen(t,!0),Re=(e,t)=>e.andThen(t),ke=e=>e.startsWith("data")||J.html.find(t=>e.toLowerCase()===t),Vt=(e,t,r)=>{r&&a(t,String)&&(t={[t]:r==="-"?"":r});let n;t.className&&(n=t.className,delete t.className),n=[...e.classList].find(s=>s.startsWith("JQxClass-")||n&&s===n)||n||`JQxClass-${z().slice(1)}`,b.editCssRule(`.${n}`,t),e.classList.add(n)},Gt=(e,t)=>{e&&Object.entries(t).forEach(([r,n])=>{if(r=O(r),r.startsWith("data"))return Be(e,n);a(n,String)&&ke(r)&&e.setAttribute(r,n.split(/[, ]/)?.join(" "))})},xe=(e,t)=>{a(t,Object)&&Object.entries(t).forEach(([r,n])=>{let i;/!important/i.test(n)&&(n=n.slice(0,n.indexOf("!")).trim(),i="important"),e.style.setProperty(O(r),n,i)})},Zt={get(e,t){return e[ee(t)]||e[t]},enumerable:!1,configurable:!1},Xt=(...e)=>{$.log("\u2757"+e.map(t=>String(t)).join(", "))},Se=(e,t=0,r=!0)=>(e=e?.parentElement,t+=e?e[r?"scrollTop":"scrollLeft"]:0,e?Se(e,t,r):t),ve={factoryExtensions:{data:e=>({get all(){return new Proxy(e[0]?.dataset??{},Zt)},set:(t={})=>(!e.is.empty&&a(t,Object)&&Object.entries(t).forEach(([r,n])=>e.setData({[r]:n})),e),get:(t,r)=>e.data.all[t]??r,add:(t={})=>(!e.is.empty&&a(t,Object)&&Object.entries(t).forEach(([r,n])=>e.setData({[r]:n})),e),remove:t=>(e[0]?.removeAttribute(`data-${O(t)}`),e)}),dimensions:e=>{if(e.is.empty)return{error:"[instance].dimensions: NO ELEMENTS"};let t=e[0],r=e.first()?.getBoundingClientRect().toJSON();return r.scrollTopDistance=Se(t,0),r.scrollLeftDistance=Se(t,0,!1),r},node:e=>e[0],HTML:e=>({get:(t,r)=>{if(e.is.empty)return"NO ELEMENTS IN COLLECTION";let n=t?e.outerHtml:e.html();return r?_(n):n},set:(t,r=!1,n=!1)=>{t=t.isJQx?t.HTML.get(1):t;let i=a(t,String);return t=i&&n?_(t):t,i&&(t||"").trim().length&&e.html(t,r),e},replace:(t,r=!1)=>e.HTML.set(t,!1,r),append:(t,r=!1)=>(t=a(t,HTMLElement)?b(t).HTML.get(1):t.isJQx?t.HTML.get(1):t,e.HTML.set(t,!0,r)),insert:(t,r=!1)=>(t=a(t,HTMLElement)?b(t).HTML.get(1):t.isJQx?t.HTML.get(1):t,e.HTML.set(t+e.HTML.get(),!1,r))}),is:e=>Ut(e),length:e=>e.collection.length,outerHtml:e=>(e.first()||{outerHTML:void 0}).outerHTML,parent:e=>{let t=b(e[0]?.parentNode);return t.is.empty?e:t},render:e=>(!e.is.empty&&e.toDOM()||b.log("[JQx.render]: empty collection"),e),Style:e=>({get computed(){return e.is.empty?{}:getComputedStyle(e[0])},inline:t=>e.style(t),inSheet:t=>e.css(t),valueOf:t=>e.is.empty?void 0:getComputedStyle(e[0])[O(t)],nwRule:t=>e.Style.byRule({rules:t}),byRule:({classes2Apply:t=[],rules:r=[]}={})=>{let i=a(r,String)&&!t.length?r.split("{")[0].trim():"";return r=r&&a(r,String)?[r]:r,t=t&&a(t,String)?[t]:t,(r?.length||t?.length)&&(r?.length&&b.editCssRules(...r),t?.forEach(s=>e.addClass(s))),i?.startsWith(".")&&e.addClass(i.slice(1)),i?.startsWith("#")&&!e.attr("id")&&e.prop({id:i.slice(1)}),e}})},instanceExtensions:{addClass:(e,...t)=>w(e,r=>r&&t.forEach(n=>r.classList.add(n))),after:Re,afterMe:Re,andThen:(e,t,r=!1)=>{if(!t||!a(t,String,Node,Proxy))return Xt(`[JQx instance].[beforeMe | afterMe | andThen]: insufficient input [${t}]`),e;t=t?.isJQx?t.collection:a(t,Node)?b.virtual(t).collection:b.virtual(H(t)).collection;let[n,i,s]=r?[0,"before",t.concat(e.collection)]:[e.collection.length-1,"after",e.collection.concat(t)];return e[n][i](...t),e.collection=s,e},append:(e,...t)=>{if(!e.is.empty&&t.length){let r=e.length===1;for(let n of t){if(!n.isJQx&&a(n,String)){let i=n.trim(),p=!/^<(.+)[^>]+>$/m.test(i)?b.text(n):H(n);w(e,v=>v.append(r?p:V(p)))}re(n)&&w(e,i=>i.append(r?n:V(n))),n.isJQx&&!n.is.empty&&w(e,i=>n.collection.forEach(s=>i.append(r?s:V(s))))}}return e},appendTo:(e,t)=>(t.isJQx||(t=b(t)),t.append(e),e),attr:(e,t,r)=>{let n=e[0];if(!n)return e;if(!r&&a(t,String))return t=O(t),t==="class"?[...n?.classList].join(" "):n?.getAttribute(t);if(a(t,String)&&r)switch(t=O(t),!0){case t.startsWith("data-"):t={data:{[t.replace("data-","")]:r}};break;default:t={[t]:r}}return a(t,Object)&&!e.is.empty&&Gt(n,t),e},before:Ie,beforeMe:Ie,clear:e=>w(e,Pe),closest:(e,t)=>{let r=a(t,String)?e[0].closest(t):null;return r?b(r):e},computedStyle:(e,t)=>e.first()&&getComputedStyle(e.first())[t],css:(e,t,r)=>w(e,n=>Vt(n,t,r)),duplicate:(e,t=!1,r=document.body)=>{let n=e.toNodeList().map(s=>s.removeAttribute&&s.removeAttribute("id")||s),i=b.virtual(n);return t?i.toDOM(r):i},each:(e,t)=>w(e,t),empty:e=>w(e,Pe),find:(e,t)=>e.collection.length>0?[...e.first()?.querySelectorAll(t)]:[],find$:(e,t)=>e.collection.length>0?b(t,e):e,first:(e,t=!1)=>{if(e.collection.length>0)return t?e.single():e.collection[0]},first$:(e,t)=>e.single(t),getData:(e,t,r)=>e.first()&&e.first().dataset?.[t]||r,hasClass:(e,...t)=>{let r=e[0];return!r||!r.classList.length?!1:t.find(n=>r.classList.contains(n))&&!0||!1},hide:e=>w(e,t=>xe(t,{display:"none !important"})),html:(e,t,r)=>{if(t===void 0)return e[0]?.getHTML();if(!e.isEmpty()){let n=H(`<div>${t.isJQx?t.HTML.get(!0):t}</div>`);if(!a(n,Comment))return w(e,s=>(r||(s.textContent=""),s.insertAdjacentHTML(b.at.end,n.getHTML())))}return e},htmlFor:(e,t,r="",n=!1)=>{if(t&&e.collection.length){if(!t||!a(r,String))return e;let i=e.find$(t);if(i.length<1)return e;let s=H(`<span>${r}</span>`);i.each(p=>{n||(p.textContent=""),p.insertAdjacentHTML(b.at.end,s.getHTML())})}return e},isEmpty:e=>e.collection.length<1,nth$:(e,t)=>e.single(t),on:(e,t,...r)=>(e.collection.length&&r?.forEach(n=>{let i=Qe(e);b.delegate(t,i,n)}),e),prepend:(e,...t)=>{if(!e.is.empty&&t){let r=e.length===1;for(let n of t){if(a(n,String)){n=n.trim();let s=!/^<(.+)[^>]+>$/m.test(n)?b.text(n):H(n);s=r?s:V(s),w(e,p=>p.prepend(s.cloneNode(!0)))}re(n)&&w(e,i=>i.prepend(r?n:V(n))),n.isJQx&&!n.is.empty&&(n.collection.length>1&&n.collection.reverse(),w(e,i=>w(n,s=>i.prepend(r?s:V(s)))),n.collection.reverse())}}return e},prependTo:(e,t)=>(t.isJQx||(t=b.virtual(t)),t.prepend(e),e),prop:(e,t,r)=>{if(a(t,String)&&!r)return t.startsWith("data")?e[0]?.dataset[t.slice(t.indexOf("-")+1)]:e[0]?.[t];let n=a(t,Object)?t:{[t]:r};return Object.entries(n).forEach(([i,s])=>{if(i=i.trim(),s&&!ke(i)||!s)return!1;if(i.toLowerCase()==="id")return e[0].id=s;w(e,v=>{if(i.startsWith("data"))return v.dataset[i.slice(i.indexOf("-")+1)]=s;v[i]=s})}),e},remove:(e,t)=>{N(`remove ${j(e.HTML.get(1),40)}${t?` /w selector ${t}`:""}`);let r=i=>i.remove(),n=()=>e.collection=e.collection.filter(i=>document.documentElement.contains(i));if(t){let i=e.find$(t);return i.is.empty||(w(i,r),n()),e}return w(e,r),n(),e},rmAttr:(e,...t)=>(t.forEach(r=>e.node.removeAttribute(r)),e),removeClass:(e,...t)=>w(e,r=>r&&t.forEach(n=>r.classList.remove(n))),renderTo:(e,t=document.body,r=b.insertPositions.end)=>(e.toDOM(t,r),e),replace:(e,t,r)=>{let n=e[0];return!t||!r||!a(r,HTMLElement)&&!r.isJQx?(console.error("JQx replace: invalid replacement value"),e):(r.isJQx&&(r=r[0]),a(r,NodeList)&&(r=r[0]),n&&t&&(t=a(t,String)?n.querySelectorAll(t):t.isJQx?t.collection:t,a(t,HTMLElement,NodeList,Array)&&a(r,HTMLElement)&&(a(t,HTMLElement)?[t]:[...t]).forEach(i=>i.replaceWith(r.cloneNode(!0)))),e)},replaceClass:(e,t,...r)=>w(e,n=>{n.classList.remove(t),r.forEach(i=>n.classList.add(i))}),replaceMe:(e,t)=>e.replaceWith(t),replaceWith:(e,t)=>(t=a(t,Element)?t:t.isJQx?t[0]:void 0,t&&(e[0].replaceWith(t),e=b.virtual(t)),e),setData:(e,t)=>w(e,r=>Be(r,t)),show:e=>w(e,t=>xe(t,{display:"revert-layer !important"})),single:(e,t)=>e.collection.length>0?a(t,String)?e.find$(t):a(t,Number)?b(e.collection[t]):b(e.collection[0]):e,style:(e,t,r)=>w(e,i=>{r&&a(t,String)&&(t={[t]:r||"none"}),xe(i,t)}),text:(e,t,r=!1)=>e.isEmpty()?e:a(t,String)?w(e,i=>i.textContent=r?i.textContent+t:t):e.first().textContent,toDOM:(e,t=document.body,r=F.BeforeEnd)=>(e.isVirtual&&(e.isVirtual=!1),e.collection=U(e.collection,t,r),e),toggleClass:(e,t)=>w(e,r=>r.classList.toggle(t)),toNodeList:e=>[...e.collection].map(t=>document.importNode(t,!0)),trigger:(e,t,r=Event,n={})=>{if(e.collection.length){let i=new r(t,{...n,bubbles:n.bubbles??!0});for(let s of e.collection)s.dispatchEvent(i)}return e},val:(e,t)=>{let r=e[0];return!r||!a(r,HTMLInputElement,HTMLSelectElement,HTMLTextAreaElement)?e:t===void 0?r.value:(r.value=a(t,String)?t:"",e)}}};function We(e){if(!e("#jqxPopup").isEmpty())return;e.dialog({id:"jqxPopup"},e.div({id:"jqxPopupContent"})).render,e.editCssRules(...Le);let[t,r]=[e("#jqxPopupContent"),e.node("#jqxPopup")],n={};return["click","keydown"].forEach(d=>document.addEventListener(d,x,!0)),Object.freeze({show:i,removeModal:L});function i(d){if(r.open)return;n={...d};let{content:g}=n;return e.IS(g,String,HTMLElement)||g?.isJQx?p():!0}function s(){return n.modal?T(n.warnMessage):v()}function p(){t.clear();let{content:d,modal:g,closeAfter:m}=n;g=e.IS(g,Boolean)?g:!1;let y=g?"":e.div({id:"closeHandleIcon"});t.append(y,e.IS(d,String)?e.div(d):d),r.showModal(),!g&&e.IS(m,Number)&&E(s,m)}function v(){return r.close(n.returnValue),e.IS(n.callback,Function)?n.callback(n.returnValue):!0}function L({callback:d,value:g}={}){n.returnValue=g,n.modal=!1,n.callback=d||n.callback,s()}function x(d){n.activeTimer&&clearTimeout(n.activeTimer);let g=d.key==="Escape";return g&&d.preventDefault(),(g||d.target.closest("#closeHandleIcon")||d.type!=="keydown"&&!d.target.closest("#jqxPopupContent"))&&s(),document.activeElement.blur()}function E(d,g){e.IS(d,Function)&&e.IS(g,Number)&&g>0&&(n.activeTimer=setTimeout(d,g*1e3))}function T(d){if(!e.IS(d,String,HTMLElement,Proxy))return;let g=t.find$(".warn");switch(!0){case g.is.empty:g=e.div({class:"warn"},d);default:t.append(g.addClass("active")),E(()=>t.find$(".warn").removeClass("active"),2)}}}var k={},Yt=["load","unload","scroll","focus","blur","DOMNodeRemovedFromDocument","DOMNodeInsertedIntoDocument","loadstart","progress","error","abort","load","loadend","pointerenter","pointerleave","readystatechange"],Kt=e=>!!Yt.find(t=>t===e),qe=()=>{let e=n=>k[n.type].forEach(i=>i(n)),t=(n,i)=>s=>{let p=s.target?.closest?.(n);return p&&i(s,b(p))},r=(n,i)=>{k[n]||addEventListener(n,e,Kt(n))};return(n,i,s,p=!1)=>{r(n,p);let v=i?t(i,s):s;k=k[n]?{...k,[n]:k[n].concat(v)}:{...k,[n]:[v]}}};var er={},{instanceMethods:ze,instanceGetters:_e,isCommentOrTextNode:Je,isNode:re,isHtmlString:Ve,isArrayOfHtmlElements:Ge,isArrayOfHtmlStrings:Ze,ElemArray2HtmlString:Xe,input2Collection:Ye,setCollectionFromCssSelector:Ke,addHandlerId:Qe,cssRuleEdit:Ee,addFn:tr,elems4Docs:Sn}=rr();function rr(){let e=K({createWithId:"JQxStylesheet"}),t=(f,h)=>r[f]=(C,...o)=>h(C,...o),r=ve.instanceExtensions,n=ve.factoryExtensions,i=f=>a(f,Comment,Text),s=f=>a(f,Text,HTMLElement,Comment),p=f=>a(f,Comment),v=f=>a(f,Text),L=f=>a(f,String)&&/^<|>$/.test(`${f}`.trim()),x=f=>a(f,Array)&&!f?.find(h=>!L(h)),E=f=>a(f,Array)&&!f?.find(h=>!s(h)),T=f=>f?.filter(h=>h).reduce((h,C)=>h.concat(p(C)?`<!--${C.data}-->`:i(C)?C.textContent:C.outerHTML),""),d=f=>f?a(f,Proxy)?[f.EL]:a(f,NodeList)?[...f]:s(f)?[f]:E(f)?f:f.isJQx?f.collection:void 0:[],g=(f,h,C)=>{let o=h!==document.body&&a(f,String)&&f.toLowerCase()!=="body"?h:document,l;try{C.collection=[...o.querySelectorAll(f)]}catch{l=`Invalid CSS querySelector. [${a(f,String)?f:"Nothing valid given!"}]`}return l??`CSS querySelector "${f}", output ${C.collection.length} element(s)`},m=f=>{let h=f.data.get("hid")||`HID${z()}`;return f.data.add({hid:h}),`[data-hid="${h}"]`},y=Object.entries(M.tagsRaw).filter(([,f])=>f).map(([f])=>f).sort((f,h)=>f.localeCompare(h));return{instanceMethods:r,instanceGetters:n,isCommentOrTextNode:i,isNode:s,isComment:p,isText:v,isHtmlString:L,isArrayOfHtmlElements:E,isArrayOfHtmlStrings:x,ElemArray2HtmlString:T,input2Collection:d,setCollectionFromCssSelector:g,addHandlerId:m,cssRuleEdit:e,addFn:t,elems4Docs:y}}function G(e){return new Proxy(e,{get:(t,r)=>ir(t,r,e)})}function nr(e,t){return(...r)=>a(e,Function)&&e(G(t),...r)}function or(e,t){return(...r)=>a(e,Function)&&e(G(t),...r)}function ir(e,t,r){switch(!0){case a(t,Symbol):return e;case a(+t,Number):return e.collection?.[t]||`ELEMENT WITH INDEX ${t} NOT FOUND`;case t in _e:return or(_e[t],r)();case t in ze:return nr(ze[t],r);default:return e[t]}}function et(e){let t=dr(e);return Object.entries(Object.getOwnPropertyDescriptors(t)).forEach(([r,n])=>{Object.defineProperty(e,r,n),Object.defineProperty(er,r,n)}),e}function lr(e){return{allow:t=>{let r=/-/.test(t),n=r&&t;t=r?ee(t):t.toLowerCase(),M.allowTag(t),a(e[t],Function)||Object.defineProperties(e,we(t,!0,e,n))},prohibit:t=>{t=t.toLowerCase(),M.prohibitTag(t),a(e[t],Function)&&Object.defineProperties(e,we(t,!1,e))}}}function Ue(...e){if(e.length===1){let t=String(e.shift().trim());e=t.startsWith("!")?[t.slice(1,-1)]:t.split(",").map(r=>r.trim())}e.map(t=>t.startsWith("!")?t.slice(1,-1):t).forEach(t=>Ee(t,{removeRule:1}))}function sr(e){return function(t,r,...n){return a(r,Function)&&(n.push(r),r=void 0),n.forEach(i=>e(t,r,i))}}function ar(e){return function(t,r,n){r=r?.isJQx?r?.[0]:r,n=n&&Object.values(F).find(s=>n===s)?n:void 0;let i=e(t,document.createElement("br"));return r&&!a(r,HTMLBRElement)&&i.collection.forEach(s=>n?r.insertAdjacentElement(n,s):r.append(s)),i}}function cr(...e){let t={};for(let r of e){let n=Object.getOwnPropertyDescriptors(r);Object.entries(n).forEach(([i,s])=>!(i in t)&&Object.defineProperty(t,i,s))}return t}function ur(e){console.error(`JQx: "${e}" not allowed, not rendered`)}function fr(e,t,r,n){return e=O(n||e.toLowerCase()),{get(){return(...i)=>t?r.virtual(te(pe[e](...i))):ur(e)},enumerable:!1,configurable:!0}}function we(e,t,r,n){e=e.toLowerCase();let i=fr(e,t,r,n);return n?{[n]:i,[ee(n)]:i}:{[e]:i,[e.toUpperCase()]:i}}function dr(e){return cr(Object.entries(M.tagsRaw).reduce(mr(e),{}),gr(e))}function mr(e){return function(t,[r,n]){return n&&Object.defineProperties(t,we(r,n,e)),t}}function gr(e){let t=(n,i)=>Ee(n,i),r=lr(e);return{debugLog:$,log:(...n)=>D("fromStatic",...n),insertPositions:F,get at(){return F},editCssRules:(...n)=>n.forEach(i=>Ee(i)),editCssRule:t,get setStyle(){return t},delegate:sr(qe()),virtual:ar(e),get fn(){return tr},allowTag:r.allow,prohibitTag:r.prohibit,get lenient(){return M.allowUnknownHtmlTags},get IS(){return a},get Popup(){return e.activePopup||Object.defineProperty(e,"activePopup",{value:We(e),enumerable:!1}),e.activePopup},popup:()=>e.Popup,createStyle:n=>K({createWithId:n||`jqx${z()}`}),editStylesheet:n=>K({createWithId:n||`jqx${z()}`}),removeCssRule:Ue,removeCssRules:Ue,text:(n,i=!1)=>i?e.comment(n):document.createTextNode(n),node:(n,i=document)=>i.querySelector(n,i),nodes:(n,i=document)=>[...i.querySelectorAll(n,i)]}}var b=et(pr());function pr(){return function(r,n,i=F.BeforeEnd){if(r?.isJQx)return r;let s=a(n,HTMLBRElement);n=(!s&&n&&n.isJQx?n[0]:n)||document.body,i=i&&Object.values(F).find(g=>i===g)?i:void 0;let p=Ve(r),v=!p&&Ze(r),L=v||p,x={collection:Ye(r)??[],isVirtual:s,isJQx:!0},E=Ge(x.collection),T=`input => ${v?`"${j(r.join(", "),70)}"`:!L&&E?`element collection [${j(x.collection.map(g=>`${a(g,Comment,Text)?"Comment|Text @":""} ${g?.outerHTML||g?.textContent}`).join(", "),70)}]`:`"${j(r,70)}"`}`;if(x.collection.length&&E)return N(T),s||x.collection.forEach(g=>{n.contains(g)||U([g],n,i)}),G(x);if(L){if([r].flat().forEach(g=>x.collection.push(H(g))),x.collection.length>0){let g=x.collection.filter(m=>m?.dataset?.jqxcreationerror);x.collection=x.collection.filter(m=>!m?.dataset?.jqxcreationerror),N(`${T}`),N(`*Created ${x.isVirtual?"VIRTUAL ":""}[${j(Xe(x.collection)||"sanitized: no elements remaining",70)}]`),g.length&&console.error(`JQx: illegal html, not rendered: "${g.reduce((m,y)=>m.concat(`${y.textContent}
|
|
15
|
-
`),"").trim()}"`),x.isVirtual||U(x.collection,n,i)}return G(x)}let d=Ke(r,n,x);return N(`input => ${d}`),G(x)}}return lt(yr);})();
|
|
1
|
+
var JQx=(()=>{var se=Object.defineProperty;var tt=Object.getOwnPropertyDescriptor;var rt=Object.getOwnPropertyNames;var nt=Object.prototype.hasOwnProperty;var ot=(e,t)=>{for(var r in t)se(e,r,{get:t[r],enumerable:!0})},it=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of rt(t))!nt.call(e,i)&&i!==r&&se(e,i,{get:()=>t[i],enumerable:!(n=tt(t,i))||n.enumerable});return e};var lt=e=>it(se({},"__esModule",{value:!0}),e);var yr={};ot(yr,{default:()=>b});var ae=ct(),Le=ut(),J=st(),Z=at();function st(){return{html:Object.freeze("accept,action,align,alt,autocapitalize,autocomplete,autopictureinpicture,autoplay,background,bgcolor,border,capture,cellpadding,cellspacing,checked,cite,class,clear,contenteditable,color,cols,colspan,controls,controlslist,coords,crossorigin,datetime,decoding,default,dir,disabled,disablepictureinpicture,disableremoteplayback,download,draggable,enctype,enterkeyhint,face,for,headers,height,hidden,high,href,hreflang,id,inputmode,integrity,is,ismap,kind,label,lang,list,loading,loop,low,max,maxlength,media,method,min,minlength,multiple,muted,name,nonce,noshade,novalidate,nowrap,open,optimum,pattern,placeholder,playsinline,poster,preload,pubdate,radiogroup,readonly,rel,required,rev,reversed,role,rows,rowspan,spellcheck,scope,selected,shape,size,sizes,span,srclang,start,src,srcset,step,style,summary,tabindex,target,title,translate,type,usemap,valign,value,width,xmlns,slot".split(",")),svg:Object.freeze("accent-height,accumulate,additive,alignment-baseline,ascent,attributename,attributetype,azimuth,basefrequency,baseline-shift,begin,bias,by,class,clip,clippathunits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,cx,cy,d,dx,dy,diffuseconstant,direction,display,divisor,dur,edgemode,elevation,end,fill,fill-opacity,fill-rule,filter,filterunits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,fx,fy,g1,g2,glyph-name,glyphref,gradientunits,gradienttransform,height,href,id,image-rendering,in,in2,k,k1,k2,k3,k4,kerning,keypoints,keysplines,keytimes,lang,lengthadjust,letter-spacing,kernelmatrix,kernelunitlength,lighting-color,local,marker-end,marker-mid,marker-start,markerheight,markerunits,markerwidth,maskcontentunits,maskunits,max,mask,media,method,mode,min,name,numoctaves,offset,operator,opacity,order,orient,orientation,origin,overflow,paint-order,path,pathlength,patterncontentunits,patterntransform,patternunits,points,preservealpha,preserveaspectratio,primitiveunits,r,rx,ry,radius,refx,refy,repeatcount,repeatdur,restart,result,rotate,scale,seed,shape-rendering,specularconstant,specularexponent,spreadmethod,startoffset,stddeviation,stitchtiles,stop-color,stop-opacity,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke,stroke-width,style,surfacescale,systemlanguage,tabindex,targetx,targety,transform,text-anchor,text-decoration,text-rendering,textlength,type,u1,u2,unicode,values,viewbox,visibility,version,vert-adv-y,vert-origin-x,vert-origin-y,width,word-spacing,wrap,writing-mode,xchannelselector,ychannelselector,x,x1,x2,xmlns,y,y1,y2,z,zoomandpan".split(","))}}function at(){return{a:!0,area:!0,audio:!1,br:!0,base:!0,body:!0,button:!0,canvas:!0,comment:!0,dl:!0,data:!0,datalist:!0,div:!0,em:!0,embed:!1,fieldset:!0,font:!0,footer:!0,form:!1,hr:!0,head:!0,header:!0,output:!0,iframe:!1,frameset:!1,img:!0,input:!0,li:!0,label:!0,legend:!0,link:!0,map:!0,mark:!0,menu:!0,media:!0,meta:!0,nav:!0,meter:!0,ol:!0,object:!1,optgroup:!0,option:!0,p:!0,param:!0,picture:!0,pre:!0,progress:!1,quote:!0,script:!1,select:!0,source:!0,span:!0,style:!0,caption:!0,td:!0,col:!0,table:!0,tr:!0,template:!1,textarea:!0,time:!0,title:!0,track:!0,details:!0,ul:!0,video:!0,del:!0,ins:!0,slot:!0,blockquote:!0,svg:!0,dialog:!0,summary:!0,main:!0,address:!0,colgroup:!0,tbody:!0,tfoot:!0,thead:!0,th:!0,dd:!0,dt:!0,figcaption:!0,figure:!0,i:!0,b:!0,code:!0,h1:!0,h2:!0,h3:!0,h4:!0,abbr:!0,bdo:!0,dfn:!0,kbd:!0,q:!0,rb:!0,rp:!0,rt:!0,ruby:!0,s:!0,strike:!0,samp:!0,small:!0,strong:!0,sup:!0,sub:!0,u:!0,var:!0,wbr:!0,nobr:!0,tt:!0,noscript:!0}}function ct(){return["#logBox{min-width:0px;max-width:0px;min-height:0px;max-height:0px;width:0;height:0;z-index:-1;border:none;padding:0px;overflow:hidden;transition:all 0.3s ease;margin-top:-100px;}","#logBox.visible{background-color:rgb(255, 255, 224);z-index:1;position:static;border:1px dotted rgb(153, 153, 153);max-width:50vw;min-width:30vw;min-height:10vh;max-height:90vh;overflow:auto;width:50vw;height:20vh;margin:1rem 0px;padding:0px 8px 19px;resize:both;}","#logBox.visible .legend{position:absolute;}","#logBox .legend{text-align:center;margin-top:-1em;width:inherit;max-width:inherit;}","#logBox .legend div{text-align:center;display:inline-block;max-width:inherit;height:1.2rem;background-color:rgb(119, 119, 119);padding:2px 10px;color:rgb(255, 255, 255);box-shadow:rgb(119 119 119) 2px 1px 10px;border-radius:4px;}","#logBox .legend div:before{content:'JQx Logging (chronological)';}","#logBox .legend.reversed div:before{content:'JQx Logging (reversed)';}","#logBox #jqx_logger{marginTop:0.7rem;lineHeight:1.4em;font-family:consolas,monospace;whiteSpace:pre-wrap;maxWidth:inherit;padding-left:100px;}","#logBox #jqx_logger div.entry{text-indent:-100px;whiteSpace:normal;}"]}function ut(){return["::backdrop{background-color:grey;opacity:0.2;}",`#jqxPopup{overflow:hidden;background-color:transparent;outline:none;border:none;inset:0;animation:fade-out 0.5s ease-out;&[open]{display:flex;align-items:center;justify-content:center;animation:fade-in 0.5s ease;}#jqxPopupContent{background-color:white;border:solid 1px #eee;box-shadow:1px 2px 8px #999;border-radius:4px;padding:12px;vertical-align:middle;max-height:40vh;max-width:50vw;overflow:auto;margin:0 auto;div:not(#closeHandleIcon){clear:both;}@media (width <= 640px){max-width:80vw;max-height:60vh;}#closeHandleIcon{cursor:pointer;width:24px;height:24px;display:inline;position:absolute;top:4px;right:4px;justify-content:right;background-image:url("data:image/svg+xml;utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20version%3D%221.1%22%20id%3D%22Layer_1%22%20x%3D%220px%22%20y%3D%220px%22%20viewBox%3D%220%200%20128%20128%22%20style%3D%22enable-background%3Anew%200%200%20128%20128%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Crect%20x%3D%22-368%22%20y%3D%226%22%20style%3D%22display%3Anone%3Bfill%3A%23E0E0E0%3B%22%20width%3D%22866%22%20height%3D%221018%22%2F%3E%3Ccircle%20style%3D%22fill%3A%23FFFFFF%3B%22%20cx%3D%2264%22%20cy%3D%2264%22%20r%3D%2248%22%2F%3E%3Ccircle%20style%3D%22fill%3A%238CCFB9%3B%22%20cx%3D%2264%22%20cy%3D%2264%22%20r%3D%2239%22%2F%3E%3Ccircle%20style%3D%22fill%3Anone%3Bstroke%3A%23444B54%3Bstroke-width%3A6%3Bstroke-miterlimit%3A10%3B%22%20cx%3D%2264%22%20cy%3D%2264%22%20r%3D%2248%22%2F%3E%3Cpolyline%20style%3D%22fill%3Anone%3Bstroke%3A%23FFFFFF%3Bstroke-width%3A6%3Bstroke-linecap%3Around%3Bstroke-miterlimit%3A10%3B%22%20points%3D%2242%2C69%2055.55%2C81%20%20%2086%2C46%20%22%2F%3E%3C%2Fsvg%3E");@media (width <= 640px){background-image:none;position:relative;margin:-15px -15px 4px 0;float:right;vertical-align:middle;border:1px solid #AAA;padding:2px;border-radius:50%;width:12px;height:12px;font-size:12px;line-height:12px;font-weight:bold;text-align:center;&:after{content:'\\2714';color:green;}}}.warn{display:none;text-align:center;color:red;border-top:1px solid #999;margin-top:1em;padding-top:3px;animation:warn-fade-out 0.2s ease-out;}.warn.active{opacity:1;display:block;animation:warn-fade-in 0.2s ease-in;}}}`,"@keyframes fade-in{0%{opacity:0;transform:scale(0, 0);display:none;}100%{opacity:1;transform:scale(1, 1);display:flex;}}","@keyframes fade-out{0%{opacity:1;transform:scale(1, 1);display:flex;}100%{opacity:0;transform:scale(0, 0);display:none;}}","@keyframes warn-fade-in{0%{opacity:0;transform:scale(0, 0);display:none;}100%{opacity:1;transform:scale(1,1 );display:block;}}","@keyframes warn-fade-out{0%{opacity:1;transform:scale(1, 1);display:block;}100%{opacity:0;transform:scale(0, 0);display:none;}}"]}var ce=!1,ft={on:()=>ce=!0,off:()=>ce=!1},M={tagsRaw:Z,allowUnknownHtmlTags:ft,isAllowed(e){if(ce)return!0;let t=a(e,String)?e.toLowerCase():e?.nodeName.toLowerCase()||"none";return t==="#text"||!!Z[t]},allowTag:e=>Z[e.toLowerCase()]=!0,prohibitTag:e=>Z[e.toLowerCase()]=!1};var de=!1,X=!1,W=!0,me=!1,dt=!0,$e,Q=()=>b("#logBox"),Te="#jqx_logger",mt=e=>{ae?.forEach(t=>e(t))},gt=()=>{ae&&mt($e);let e=dt?"div":"pre",t=`<div id="logBox"><div class="legend"><div></div></div><${e} id="jqx_logger"></${e}></div>`;return ge(H(t),void 0,F.AfterBegin),b.node(Te)},Ce=e=>a(e,String)&&Object.assign(document.createElement("textarea"),{innerHTML:e}).textContent||e,D=(...e)=>{let t=e[0]==="fromStatic";if(e=t?e.slice(1):e,t&&!X)return e.forEach(n=>console.info(`${q()} \u2714 ${Ce(n)}`));if(!X)return;!W&&!b.node("#logBox")&&($e=b.createStyle("JQxLogCSS"),gt());let r=n=>`${a(n,Object)?JSON.stringify(n,null,2):n}
|
|
2
|
+
`;e.forEach(n=>W?console.info(`${q()} \u2714 ${Ce(n)}`):b.node("#jqx_logger").insertAdjacentHTML(me?"afterbegin":"beforeend",`<div class="entry">${q()} ${r(n.replace(/\n/g,"<br>"))}</div>`))},ue={on(){X=!0,D("Logging activated")},off(){X=!1,console.log("Logging deactivated")}},fe={on(){de=!0},off(){de=!1}},N=(...e)=>de&&D(...e),$={get isConsole(){return W===!0},get isOn(){return X},isVisible:function(){return b("#jqx_logger").is("visible")},on(){return ue.on(),fe.on(),W||Q()?.addClass("visible"),D("Debug logging started. Every call to [jqx instance] is logged"),$},off(){return Q().isEmpty||(fe.off(),D("Debug logging stopped"),Q()?.removeClass("visible")),ue.off(),$},toConsole:{on(){return W=!0,D("Started logging to console"),$},off(){return D("Stopped logging to console (except error messages)"),W=!1,$}},remove(){return ue.off(),fe.off(),Q()?.remove(),console.clear(),console.log(`${q()} logging completely disabled and all entries removed`),$},log:function(...e){return D(...e),$},hide(){return Q()?.removeClass("visible"),$},show:()=>(Q()?.addClass("visible"),$),get reversed(){return{on:()=>(me=!0,D("Reverse logging set: now logging bottom to top (latest first)"),b("#logBox .legend").addClass("reversed"),$),off:()=>(me=!1,b("#logBox .legend").removeClass("reversed"),D("Reverse logging reset: now logging chronological (latest last)"),$)}},clear(){return b(Te).text(""),console.clear(),D("Logging cleared"),$}};var pt=yt(),Fe={html:"innerHTML",text:"textContent",class:"className"},pe=pt;function yt(){let e={get(t,r){let n=String(r)?.toLowerCase();switch(!0){case n in t:return t[n];case Ct(n):return Ae(t,n,r);default:return Ae(t,n,r,!0)}},enumerable:!1,configurable:!1};return new Proxy({},e)}function Ae(e,t,r,n=!1){return Object.defineProperty(e,t,{get(){return n?i=>wt(r):$t(t)}}),e[t]}function bt(e,t,r){return t=t?.isJQx&&t.first()||t,be({trial:n=>Lt(t)?e.append(t):He(t)?e.insertAdjacentHTML("beforeend",t):e.append(t),whenError:n=>console.info(`${r} (for root ${e}) not created, reason
|
|
3
|
+
`,n)})}function ht(e,t,...r){let n=xt(t,e);return r?.forEach(i=>bt(n,i,e)),n}function xt(e,t){switch(e=ye(t)?Et(e):e?.isJQx?e.first():e,!0){case a(e,String):return Y(t,He(e,t)?{html:e}:{text:e});case a(e,Node):return vt(t,e);default:return Y(t,e)}}function St(e){return delete e.data,Object.keys(e).length<1||Object.keys(e).forEach(t=>{let r=t.toLowerCase();r in Fe&&(e[Fe[r]]=e[t],delete e[t])}),e}function vt(e,t){let r=Y(e);return r.append(t),r}function Y(e,t={}){t=De(t,{});let r=Object.entries(t.data??{}),n=Object.assign(ye(e)?new Comment(t?.text):document.createElement(e),St(t));return r.length&&r.forEach(([i,s])=>n.dataset[i]=String(s)),n}function De(e,t){return t?a(e,{isTypes:Object,notTypes:[Array,null,NaN,Proxy],defaultValue:t}):a(e,{isTypes:Object,notTypes:[Array,null,NaN,Proxy]})}function Et(e){return De(e)?e?.text??e?.textContent??"":String(e)}function wt(e){return Y("b",{style:"color:red",text:`'${e}' is not a valid HTML-tag`})}function He(e,t){return!ye(t)&&a(e,String)&&/<.*>|&[#|0-9a-z]+[^;];/i.test(e)}function Lt(e){return e?.constructor===Comment||e?.constructor===CharacterData}function ye(e){return e?.constructor===Comment||/comment/i.test(e)}function Ct(e){return!a(Y(e),HTMLUnknownElement)}function $t(e){return(t,...r)=>ht(e,t,...r)}var{IS:a,maybe:be,$Wrap:Ar,xProxy:Dr,isNothing:Hr}=Tt();function Tt(){Symbol.proxy=Symbol.for("toa.proxy"),Symbol.is=Symbol.for("toa.is"),Symbol.type=Symbol.for("toa.type"),Symbol.isSymbol=Symbol.for("toa.isASymbol"),y();let e=T(),[t,r]=[d(),C()];return r.custom(),{IS:n,maybe:e,$Wrap:t,isNothing:E,xProxy:r};function n(o,...l){if(e({trial:u=>"isTypes"in(l?.[0]??{})})){let u=l[0];return"defaultValue"in u?g(o,u):"notTypes"in u?m(o,u):n(o,...[u.isTypes].flat())}let c=typeof o=="symbol"?Symbol.isSymbol:o;return l.length>1?x(c,...l):s(o,...l)}function i(o){return o?.[Symbol.proxy]??n(o)}function s(o,...l){let{noInput:c,noShouldbe:u,compareTo:S,inputCTOR:A,isNaN:P,isInfinity:I,shouldBeFirstElementIsNothing:R}=v(o,...l);switch(l=l.length&&l[0],!0){case R:return String(o)===String(S);case(o?.[Symbol.proxy]&&u):return o[Symbol.proxy];case P:return u?"NaN":e({trial:B=>String(S)})===String(o);case I:return u?"Infinity":e({trial:B=>String(S)})===String(o);case c:return u?String(o):String(S)===String(o);case A===Boolean:return l?A===l:"Boolean";default:return L(o,l,u,p(o,A))}}function p(o,l){return o===0?Number:o===""?String:o?l:{name:String(o)}}function v(o,...l){let c=l.length<1,u=!c&&l[0],S=!c&&E(l[0]),A=o==null,P=!A&&Object.getPrototypeOf(o)?.constructor,I=e({trial:B=>String(o)})==="NaN",R=e({trial:B=>String(o)})==="Infinity";return{noInput:A,noShouldbe:c,compareTo:u,inputCTOR:P,isNaN:I,isInfinity:R,shouldBeFirstElementIsNothing:S}}function L(o,l,c,u){switch(!0){case(!c&&l===o||o?.[Symbol.proxy]&&l===Proxy):return!0;case e({trial:S=>String(l)})==="NaN":return String(o)==="NaN";case(o?.[Symbol.toStringTag]&&n(l,String)):return String(l)===o[Symbol.toStringTag];default:return l?e({trial:S=>o instanceof l})||l===u||l===Object.getPrototypeOf(u)||`${l?.name}`===u?.name:o?.[Symbol.toStringTag]&&`[object ${o?.[Symbol.toStringTag]}]`||u?.name||String(u)}}function x(o,...l){return l.some(c=>n(o,c))}function E(o,l=!1){let c=o==null;return c=l?c||n(o,1/0)||n(o,NaN):c,c}function T(){let o=(l,c)=>l?.constructor===Function?l(c):void 0;return function({trial:l,whenError:c=()=>{}}={}){try{return o(l)}catch(u){return o(c,u)}}}function d(){return function(o){return Object.freeze({get value(){return o},get[Symbol.type](){return i(o)},get type(){return i(o)},[Symbol.is](...l){return n(o,...l)},is(...l){return n(o,...l)}})}}function g(o,{defaultValue:l,isTypes:c=[void 0],notTypes:u}={}){return c=c?.constructor!==Array?[c]:c,u=u&&u?.constructor!==Array?[u]:[],u.length<1?n(o,...c)?o:l:m(o,{isTypes:c,notTypes:u})?o:l}function m(o,{isTypes:l=[void 0],notTypes:c=[void 0]}={}){return l=l?.constructor!==Array?[l]:l,c=c?.constructor!==Array?[c]:c,n(o,...l)&&!n(o,...c)}function y(){Object.getOwnPropertyDescriptors(Object.prototype)[Symbol.is]||(Object.defineProperties(Object.prototype,{[Symbol.type]:{get(){return i(this)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(...o){return n(this,...o)},enumerable:!1,configurable:!1}}),Object.defineProperties(Object,{[Symbol.type]:{value(o){return i(o)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(o,...l){return n(o,...l)},enumerable:!1,configurable:!1}}))}function f(o){let l=String(Object.getPrototypeOf(o)?.constructor);return l.slice(l.indexOf("ion")+3,l.indexOf("(")).trim()}function h(o){let l=o.set;return o.set=(c,u,S)=>u===Symbol.proxy?c[u]=S:l(c,u,S),o}function C(){let o=Proxy;return{native(){Proxy=o},custom(){Proxy=new o(o,{construct(l,c){for(let S of c)S.set&&(S=h(S));let u=new l(...c);return u[Symbol.proxy]=`Proxy (${f(c[0])})`,u}})}}}}var{IS:ne,maybe:Or,$Wrap:Mr,xProxy:Nr,isNothing:Pr}=Ft();function Ft(){Symbol.proxy=Symbol.for("toa.proxy"),Symbol.is=Symbol.for("toa.is"),Symbol.type=Symbol.for("toa.type"),Symbol.isSymbol=Symbol.for("toa.isASymbol"),y();let e=T(),[t,r]=[d(),C()];return r.custom(),{IS:n,maybe:e,$Wrap:t,isNothing:E,xProxy:r};function n(o,...l){if(e({trial:u=>"isTypes"in(l?.[0]??{})})){let u=l[0];return"defaultValue"in u?g(o,u):"notTypes"in u?m(o,u):n(o,...[u.isTypes].flat())}let c=typeof o=="symbol"?Symbol.isSymbol:o;return l.length>1?x(c,...l):s(o,...l)}function i(o){return o?.[Symbol.proxy]??n(o)}function s(o,...l){let{noInput:c,noShouldbe:u,compareTo:S,inputCTOR:A,isNaN:P,isInfinity:I,shouldBeFirstElementIsNothing:R}=v(o,...l);switch(l=l.length&&l[0],!0){case R:return String(o)===String(S);case(o?.[Symbol.proxy]&&u):return o[Symbol.proxy];case P:return u?"NaN":e({trial:B=>String(S)})===String(o);case I:return u?"Infinity":e({trial:B=>String(S)})===String(o);case c:return u?String(o):String(S)===String(o);case A===Boolean:return l?A===l:"Boolean";default:return L(o,l,u,p(o,A))}}function p(o,l){return o===0?Number:o===""?String:o?l:{name:String(o)}}function v(o,...l){let c=l.length<1,u=!c&&l[0],S=!c&&E(l[0]),A=o==null,P=!A&&Object.getPrototypeOf(o)?.constructor,I=e({trial:B=>String(o)})==="NaN",R=e({trial:B=>String(o)})==="Infinity";return{noInput:A,noShouldbe:c,compareTo:u,inputCTOR:P,isNaN:I,isInfinity:R,shouldBeFirstElementIsNothing:S}}function L(o,l,c,u){switch(!0){case(!c&&l===o||o?.[Symbol.proxy]&&l===Proxy):return!0;case e({trial:S=>String(l)})==="NaN":return String(o)==="NaN";case(o?.[Symbol.toStringTag]&&n(l,String)):return String(l)===o[Symbol.toStringTag];default:return l?e({trial:S=>o instanceof l})||l===u||l===Object.getPrototypeOf(u)||`${l?.name}`===u?.name:o?.[Symbol.toStringTag]&&`[object ${o?.[Symbol.toStringTag]}]`||u?.name||String(u)}}function x(o,...l){return l.some(c=>n(o,c))}function E(o,l=!1){let c=o==null;return c=l?c||n(o,1/0)||n(o,NaN):c,c}function T(){let o=(l,c)=>l?.constructor===Function?l(c):void 0;return function({trial:l,whenError:c=()=>{}}={}){try{return o(l)}catch(u){return o(c,u)}}}function d(){return function(o){return Object.freeze({get value(){return o},get[Symbol.type](){return i(o)},get type(){return i(o)},[Symbol.is](...l){return n(o,...l)},is(...l){return n(o,...l)}})}}function g(o,{defaultValue:l,isTypes:c=[void 0],notTypes:u}={}){return c=c?.constructor!==Array?[c]:c,u=u&&u?.constructor!==Array?[u]:[],u.length<1?n(o,...c)?o:l:m(o,{isTypes:c,notTypes:u})?o:l}function m(o,{isTypes:l=[void 0],notTypes:c=[void 0]}={}){return l=l?.constructor!==Array?[l]:l,c=c?.constructor!==Array?[c]:c,n(o,...l)&&!n(o,...c)}function y(){Object.getOwnPropertyDescriptors(Object.prototype)[Symbol.is]||(Object.defineProperties(Object.prototype,{[Symbol.type]:{get(){return i(this)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(...o){return n(this,...o)},enumerable:!1,configurable:!1}}),Object.defineProperties(Object,{[Symbol.type]:{value(o){return i(o)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(o,...l){return n(o,...l)},enumerable:!1,configurable:!1}}))}function f(o){let l=String(Object.getPrototypeOf(o)?.constructor);return l.slice(l.indexOf("ion")+3,l.indexOf("(")).trim()}function h(o){let l=o.set;return o.set=(c,u,S)=>u===Symbol.proxy?c[u]=S:l(c,u,S),o}function C(){let o=Proxy;return{native(){Proxy=o},custom(){Proxy=new o(o,{construct(l,c){for(let S of c)S.set&&(S=h(S));let u=new l(...c);return u[Symbol.proxy]=`Proxy (${f(c[0])})`,u}})}}}}var K=At;function At({styleSheet:e,createWithId:t}={}){let{tryParseAtOrNestedRules:r,ruleExists:n,checkParams:i,sheet:s,removeRules:p,consider:v,currentSheetID:L}=Dt({styleSheet:e,createWithId:t});function x(m,y){if(m&&y.removeProperties){Object.keys(y.removeProperties).forEach(f=>m.style.removeProperty(je(f)));return}Object.entries(y).forEach(([f,h])=>{f=je(f.trim()),h=h.trim();let C;if(/!important/.test(h)&&(h=h.slice(0,h.indexOf("!important")).trim(),C="important"),!CSS.supports(f,h))return console.error(`StylingFactory ${L} error: '${f}' with value '${h}' not supported (yet)`);Oe(()=>m.style.setProperty(f,h,C),`StylingFactory ${L} (setRule4Selector) failed`)})}function E(m,y,f=s){if(m=m?.trim?.(),!ne(m,String)||!m.length||/[;,]$/g.test(m))return console.error(`StylingFactory ${L} (setRules): [${m||"[no selector given]"}] is not a valid selector`);if(y.removeRule)return p(m);let h=n(m,!0),C=h||f.cssRules[f.insertRule(`${m} {}`,f.cssRules.length||0)];return v(()=>x(C,y),m,h)}function T(m){let y=m.trim().split(/{/,2),f=y.shift().trim();if(!ne(f,String)||!f?.trim()?.length)return console.error(`StylingFactory ${L} (doParse): no (valid) selector could be extracted from rule ${he(m)}`);let h=It(y.shift());return Oe(()=>E(f,h),`StylingFactory ${L} (setRules) failed`)}function d(m){let y=r(m);return y.done?y.existing:T(m)}function g(m,y){return m.trim().startsWith("@media")?d(Ht(m,y)):E(m,y)}return function(m,y={}){return i(m,y)&&(Object.keys(y).length?g(m,y):d(m))}}function Dt({styleSheet:e,createWithId:t}){let r="Note: The rule or some of its properties may not be supported by your browser (yet)",n=`for style#${t}`;e=t?i(t):e;function i(d){let g=document.querySelector(`#${d}`)?.sheet;if(g)return g;let m=Object.assign(document.createElement("style"),{id:d});return document.head.insertAdjacentElement("beforeend",m),m.sheet}function s(d){return console.error(`StylingFactory ${n} [rule: ${d}]
|
|
4
|
+
=> @charset, @namespace and @import are not supported here`),{done:!0}}function p(d,g){return[...e.rules].find(m=>g?Me(m.selectorText||"",d):Mt`${Ot(d)}${[..."gim"]}`.test(m.cssText))}function v(d){return/^@charset|@import|namespace/i.test(d.trim())?s(d):d.match(/}/g)?.length>1?{existing:E(d,1),done:!0}:{done:!1}}function L(d){let g=[...e.cssRules].reduce((y,f,h)=>Me(f.selectorText||"",d)&&y.concat(h)||y,[]),m=g.length;return g.forEach(y=>e.deleteRule(y)),m>0?console.info(`\u2714 Removed ${m} instance${m>1?"s":""} of selector ${d} from ${n.slice(4)}`):console.info(`\u2714 Remove rule: selector ${d} does not exist in ${n.slice(4)}`)}function x(d,g){return d&&ne(d,String)&&d.trim().length>0&&ne(g,Object)||(console.error(`StylingFactory ${n} called with invalid parameters`),!1)}function E(d){d=d.trim();let g=d.slice(0,d.indexOf("{")).trim(),m=!!p(g);try{return e.insertRule(`${d}`,e.cssRules.length),m}catch(y){return console.error(`StylingFactory ${n} (tryParse) ${y.name} Error:
|
|
5
|
+
${y.message}
|
|
6
|
+
Rule: ${he(d)}
|
|
7
|
+
${r}`),m}}function T(d,g,m){try{return d(),m}catch(y){return console.error(`StylingFactory ${n} (tryAddOrModify) ${y.name} Error:
|
|
8
|
+
${y.message}
|
|
9
|
+
Rule: ${he(g)}
|
|
10
|
+
${r}`),m}}return{sheet:e,removeRules:L,tryParseAtOrNestedRules:v,ruleExists:p,checkParams:x,tryParse:E,consider:T,currentSheetID:n}}function Ht(e,t){return`${e.trim()} ${Object.entries(t).map(([r,n])=>`${r}: { ${jt(n)}`)}`}function he(e){let t=(e||"NO RULE").trim().slice(0,50).replace(/\n/g,"\\n").replace(/\s{2,}/g," ");return e.length>t.length?`${t.trim()}...truncated`:t}function jt(e){return Object.entries(e).map(([t,r])=>`${t}: ${r.trim()}`).join(`;
|
|
11
|
+
`)}function Ot(e){return e.replace(/([*\[\]()-+{}.$?\\])/g,t=>`\\${t}`)}function Mt(e,...t){let r=t.length&&Array.isArray(t.slice(-1))?t.pop().join(""):"";return new RegExp((t.length&&e.raw.reduce((n,i,s)=>n.concat(t[s-1]||"").concat(i),"")||e.raw.join("")).split(`
|
|
12
|
+
`).map(n=>n.replace(/\s|\/\/.*$/g,"").trim().replace(/(@s!)/g," ")).join(""),r)}function je(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`).replace(/[^--]^-|-$/,"")}function Oe(e,t){try{return e()}catch(r){console.error(`${t||"an error occured"}: ${r.message}`)}}function Nt(e){return e.replace(/\/\*.+?\*\//gm,"").replace(/[}{\r\n]/g,"").replace(/(data:.+?);/g,(t,r)=>`${r}\\3b`).split(";").map(t=>t.trim()).join(`;
|
|
13
|
+
`).replaceAll("\\3b",";").split(`
|
|
14
|
+
`)}function Pt(e){return e.reduce((t,r)=>{let[n,i]=[r.slice(0,r.indexOf(":")).trim(),r.slice(r.indexOf(":")+1).trim().replace(/;$|;.+(?=\/*).+\/$/,"")];return n&&i?{...t,[n]:i}:t},{})}function It(e){return Pt(Nt(e))}function Me(e,t){return e?.replace("::",":")===t?.replace("::",":")}var Rt=[...Array(26)].map((e,t)=>String.fromCharCode(t+65)).concat([...Array(26)].map((e,t)=>String.fromCharCode(t+97))).concat([...Array(10)].map((e,t)=>`${t}`)),oe=(e,t=2)=>`${e}`.padStart(t,"0"),Bt=(e,t=0)=>([e,t]=[Math.floor(e),Math.ceil(t)],Math.floor([...crypto.getRandomValues(new Uint32Array(1))].shift()/2**32*(e-t+1)+t)),kt=e=>{let t=e.length;for(;t--;){let r=Bt(t);[e[t],e[r]]=[e[r],e[t]]}return e};var j=(e,t=120)=>`${e}`.trim().slice(0,t).replace(/>\s+</g,"><").replace(/</g,"<").replace(/\s{2,}/g," ").replace(/\n/g,"\\n")+(e.length>t?" …":"").trim(),O=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`).replace(/^-|-$/,""),Jt=([e,...t])=>`${e.toUpperCase()}${t.join("")}`,ee=e=>a(e,String)?e.toLowerCase().split("-").map((t,r)=>r&&`${Jt(t)}`||t).join(""):e,z=()=>`_${kt(Rt).slice(0,8).join("")}`,ie=(e,t=120)=>j(e,t).replace(/</g,"<"),q=()=>(e=>`[${oe(e.getHours())}:${oe(e.getMinutes())}:${oe(e.getSeconds())}.${oe(e.getMilliseconds(),3)}]`)(new Date);var _=e=>e.replace(/</g,"<");function Ne(){let e=function(s){if(!s)return;let p=s.style,v=getComputedStyle(s),L=[p.visibility,v.visibility].includes("hidden"),x=[p.display,v.display].includes("none"),E=s.offsetTop<0||s.offsetLeft+s.offsetWidth<0||s.offsetLeft>document.body.offsetWidth,T=+v.opacity==0||+(p.opacity||1)==0;return!(E||T||x||L)},t="n/a",r=function(s){return s.parentNode?!!b.nodes(":is(:read-write)",s?.parentNode)?.find(p=>p===s):!1},n=function(s){return s.parentNode?!!b.nodes(":is(:modal)",s?.parentNode)?.find(p=>p===s):!1},i={notInDOM:!0,writable:t,modal:t,empty:!0,open:t,visible:t};return s=>{let p=s.node;return p?{get writable(){return r(p)},get modal(){return n(p)},get inDOM(){return p.isConnected},get open(){return p.open??!1},get visible(){return e(p)},get disabled(){return p.hasAttribute("readonly")||p.hasAttribute("disabled")},get empty(){return s.collection.length<1},get virtual(){return s.isVirtual}}:i}}var Qt=!0,le={data:/data-[\-\w.\p{L}]/ui,validURL:/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,whiteSpace:/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g,notAllowedValues:/javascript|injected|noreferrer|alert|DataURL/gi},Wt=e=>{if(Qt&&Object.keys(e.removed).length){let t=Object.entries(e.removed).reduce((r,[n,i])=>[...r,`${_(n)} => ${i}`],[]).join("\\000A");$.log(`JQx HTML creation errors: ${$.isConsole?t:_(t)}`)}},qt=function(e){let t=e.nodeName.toLowerCase(),r=["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"];return/-/.test(t)&&!r.find(n=>n===t)||M.isAllowed(t)},te=e=>{let t={rawHTML:e?.parentElement?.getHTML()??"no html",removed:{}};return a(e,HTMLElement)&&[...e.childNodes].forEach(r=>{if(r?.children?.length&&te(r),r?.attributes){let i=a(r,SVGElement)?J.svg:J.html;[...(r??{attributes:[]}).attributes].forEach(s=>{let p=s.name.trim().toLowerCase(),v=s.value.trim().toLowerCase().replace(le.whiteSpace,""),L=p==="href"?!le.validURL.test(v):le.notAllowedValues.test(v),x=p.startsWith("data")?!le.data.test(p):!!i[p];if(L||x){let E=ie(s.value||"none",60);E+=E.length===60?"...":"",t.removed[`${s.name}`]=`attribute/property (-value) not allowed, removed. Value: ${E}`,r.removeAttribute(s.name)}})}if(!(qt(r)||r.constructor===CharacterData||r.constructor===Comment)){let i=(r?.outerHTML||r?.textContent).trim(),s=ie(i,60)??"EMPTY";s+=s.length===60?"...":"",t.removed[`<${r.nodeName?.toLowerCase()}>`]=`not allowed, not rendered. Value: ${s}`,r.remove()}}),Wt(t),e};var F=new Proxy({start:"afterbegin",afterbegin:"afterbegin",end:"beforeend",beforeend:"beforeend",before:"beforebegin",beforebegin:"beforebegin",after:"afterend",afterend:"afterend"},{get(e,t){return e[String(t).toLowerCase()]??e[t]}}),zt=e=>{let t=document.createElement("div");return t.insertAdjacentHTML(F.end,e),t.childNodes.length?te(t):void 0},_t=(e,t,r)=>a(e,Comment)?t.insertAdjacentHTML(r,`<!--${e.data}-->`):t.insertAdjacentText(r,e.data),U=(e=[],t=document.body,r=F.BeforeEnd)=>e.reduce((n,i)=>{let s=re(i)&&ge(i,t,r);return s?[...n,s]:n},[]),ge=(e,t=document.body,r=F.BeforeEnd)=>(t=t?.isJQx?t?.[0]:t,a(e,Comment,Text)?_t(e,t,r):t.insertAdjacentElement(r,e)),H=e=>{if(a(e,Text,Comment))return e;let t=e?.trim(),r=t?.split(/<text>|<\/text>/i)??[];if(r?.length&&(r=r.length>1?r.filter(i=>i.length).shift():void 0),t.startsWith("<!--")&&t.endsWith("-->"))return document.createComment(e.replace(/<!--|-->$/g,""));if(r||!/^<(.+)[^>]+>/m.test(t))return document.createTextNode(r);let n=zt(e);return n.childNodes.length<1?H(`<span data-jqxcreationerror="1">${j(e,60)}</span>`):n.children[0]};var w=(e,t)=>{let r=e.collection.filter(n=>!Je(n));for(let n=0;n<r.length;n+=1)t(r[n],n);return e},Ut=Ne(),Pe=e=>e&&(e.textContent="");var V=e=>{let t=e.cloneNode(!0);return t.removeAttribute&&t.removeAttribute("id"),e.isConnected?e.remove():e=null,t},Be=(e,t)=>{e&&a(t,Object)&&Object.entries(t).forEach(([r,n])=>e.setAttribute(`data-${O(r)}`,n))},Ie=(e,t)=>e.andThen(t,!0),Re=(e,t)=>e.andThen(t),ke=e=>e.startsWith("data")||J.html.find(t=>e.toLowerCase()===t),Vt=(e,t,r)=>{r&&a(t,String)&&(t={[t]:r==="-"?"":r});let n;t.className&&(n=t.className,delete t.className),n=[...e.classList].find(s=>s.startsWith("JQxClass-")||n&&s===n)||n||`JQxClass-${z().slice(1)}`,b.editCssRule(`.${n}`,t),e.classList.add(n)},Gt=(e,t)=>{e&&Object.entries(t).forEach(([r,n])=>{if(r=O(r),r.startsWith("data"))return Be(e,n);a(n,String)&&ke(r)&&e.setAttribute(r,n.split(/[, ]/)?.join(" "))})},xe=(e,t)=>{a(t,Object)&&Object.entries(t).forEach(([r,n])=>{let i;/!important/i.test(n)&&(n=n.slice(0,n.indexOf("!")).trim(),i="important"),e.style.setProperty(O(r),n,i)})},Zt={get(e,t){return e[ee(t)]||e[t]},enumerable:!1,configurable:!1},Xt=(...e)=>{$.log("\u2757"+e.map(t=>String(t)).join(", "))},Se=(e,t=0,r=!0)=>(e=e?.parentElement,t+=e?e[r?"scrollTop":"scrollLeft"]:0,e?Se(e,t,r):t),ve={factoryExtensions:{data:e=>({get all(){return new Proxy(e[0]?.dataset??{},Zt)},set:(t={})=>(!e.is.empty&&a(t,Object)&&Object.entries(t).forEach(([r,n])=>e.setData({[r]:n})),e),get:(t,r)=>e.data.all[t]??r,add:(t={})=>(!e.is.empty&&a(t,Object)&&Object.entries(t).forEach(([r,n])=>e.setData({[r]:n})),e),remove:t=>(e[0]?.removeAttribute(`data-${O(t)}`),e)}),dimensions:e=>{if(e.is.empty)return{error:"[instance].dimensions: NO ELEMENTS"};let t=e[0],r=e.first()?.getBoundingClientRect().toJSON();return r.scrollTopDistance=Se(t,0),r.scrollLeftDistance=Se(t,0,!1),r},node:e=>e[0],HTML:e=>({get:(t,r)=>{if(e.is.empty)return"NO ELEMENTS IN COLLECTION";let n=t?e.outerHtml:e.html();return r?_(n):n},set:(t,r=!1,n=!1)=>{t=t.isJQx?t.HTML.get(1):t;let i=a(t,String);return t=i&&n?_(t):t,i&&(t||"").trim().length&&e.html(t,r),e},replace:(t,r=!1)=>e.HTML.set(t,!1,r),append:(t,r=!1)=>(t=a(t,HTMLElement)?b(t).HTML.get(1):t.isJQx?t.HTML.get(1):t,e.HTML.set(t,!0,r)),insert:(t,r=!1)=>(t=a(t,HTMLElement)?b(t).HTML.get(1):t.isJQx?t.HTML.get(1):t,e.HTML.set(t+e.HTML.get(),!1,r))}),is:e=>Ut(e),length:e=>e.collection.length,outerHtml:e=>(e.first()||{outerHTML:void 0}).outerHTML,parent:e=>{let t=b(e[0]?.parentNode);return t.is.empty?e:t},render:e=>(!e.is.empty&&e.toDOM()||b.log("[JQx.render]: empty collection"),e),Style:e=>({get computed(){return e.is.empty?{}:getComputedStyle(e[0])},inline:t=>e.style(t),inSheet:t=>e.css(t),valueOf:t=>e.is.empty?void 0:getComputedStyle(e[0])[O(t)],nwRule:t=>e.Style.byRule({rules:t}),byRule:({classes2Apply:t=[],rules:r=[]}={})=>{let i=a(r,String)&&!t.length?r.split("{")[0].trim():"";return r=r&&a(r,String)?[r]:r,t=t&&a(t,String)?[t]:t,(r?.length||t?.length)&&(r?.length&&b.editCssRules(...r),t?.forEach(s=>e.addClass(s))),i?.startsWith(".")&&e.addClass(i.slice(1)),i?.startsWith("#")&&!e.attr("id")&&e.prop({id:i.slice(1)}),e}})},instanceExtensions:{addClass:(e,...t)=>w(e,r=>r&&t.forEach(n=>r.classList.add(n))),after:Re,afterMe:Re,andThen:(e,t,r=!1)=>{if(!t||!a(t,String,Node,Proxy))return Xt(`[JQx instance].[beforeMe | afterMe | andThen]: insufficient input [${t}]`),e;t=t?.isJQx?t.collection:a(t,Node)?b.virtual(t).collection:b.virtual(H(t)).collection;let[n,i,s]=r?[0,"before",t.concat(e.collection)]:[e.collection.length-1,"after",e.collection.concat(t)];return e[n][i](...t),e.collection=s,e},append:(e,...t)=>{if(!e.is.empty&&t.length){let r=e.length===1;for(let n of t){if(!n.isJQx&&a(n,String)){let i=n.trim(),p=!/^<(.+)[^>]+>$/m.test(i)?b.text(n):H(n);w(e,v=>v.append(r?p:V(p)))}re(n)&&w(e,i=>i.append(r?n:V(n))),n.isJQx&&!n.is.empty&&w(e,i=>n.collection.forEach(s=>i.append(r?s:V(s))))}}return e},appendTo:(e,t)=>(t.isJQx||(t=b(t)),t.append(e),e),attr:(e,t,r)=>{let n=e[0];if(!n)return e;if(!r&&a(t,String))return t=O(t),t==="class"?[...n?.classList].join(" "):n?.getAttribute(t);if(a(t,String)&&r)switch(t=O(t),!0){case t.startsWith("data-"):t={data:{[t.replace("data-","")]:r}};break;default:t={[t]:r}}return a(t,Object)&&!e.is.empty&&Gt(n,t),e},before:Ie,beforeMe:Ie,clear:e=>w(e,Pe),closest:(e,t)=>{let r=a(t,String)?e[0].closest(t):null;return r?b(r):e},computedStyle:(e,t)=>e.first()&&getComputedStyle(e.first())[t],css:(e,t,r)=>w(e,n=>Vt(n,t,r)),duplicate:(e,t=!1,r=document.body)=>{let n=e.toNodeList().map(s=>s.removeAttribute&&s.removeAttribute("id")||s),i=b.virtual(n);return t?i.toDOM(r):i},each:(e,t)=>w(e,t),empty:e=>w(e,Pe),find:(e,t)=>e.collection.length>0?[...e.first()?.querySelectorAll(t)]:[],find$:(e,t)=>e.collection.length>0?b(t,e):e,first:(e,t=!1)=>{if(e.collection.length>0)return t?e.single():e.collection[0]},first$:(e,t)=>e.single(t),getData:(e,t,r)=>e.first()&&e.first().dataset?.[t]||r,hasClass:(e,...t)=>{let r=e[0];return!r||!r.classList.length?!1:t.find(n=>r.classList.contains(n))&&!0||!1},hide:e=>w(e,t=>xe(t,{display:"none !important"})),html:(e,t,r)=>{if(t===void 0)return e[0]?.getHTML();if(!e.isEmpty()){let n=H(`<div>${t.isJQx?t.HTML.get(!0):t}</div>`);if(!a(n,Comment))return w(e,s=>(r||(s.textContent=""),s.insertAdjacentHTML(b.at.end,n.getHTML())))}return e},htmlFor:(e,t,r="",n=!1)=>{if(t&&e.collection.length){if(!t||!a(r,String))return e;let i=e.find$(t);if(i.length<1)return e;let s=H(`<span>${r}</span>`);i.each(p=>{n||(p.textContent=""),p.insertAdjacentHTML(b.at.end,s.getHTML())})}return e},isEmpty:e=>e.collection.length<1,nth$:(e,t)=>e.single(t),on:(e,t,...r)=>(e.collection.length&&r?.forEach(n=>{let i=Qe(e);b.delegate(t,i,n)}),e),prepend:(e,...t)=>{if(!e.is.empty&&t){let r=e.length===1;for(let n of t){if(a(n,String)){n=n.trim();let s=!/^<(.+)[^>]+>$/m.test(n)?b.text(n):H(n);s=r?s:V(s),w(e,p=>p.prepend(s.cloneNode(!0)))}re(n)&&w(e,i=>i.prepend(r?n:V(n))),n.isJQx&&!n.is.empty&&(n.collection.length>1&&n.collection.reverse(),w(e,i=>w(n,s=>i.prepend(r?s:V(s)))),n.collection.reverse())}}return e},prependTo:(e,t)=>(t.isJQx||(t=b.virtual(t)),t.prepend(e),e),prop:(e,t,r)=>{if(a(t,String)&&!r)return t.startsWith("data")?e[0]?.dataset[t.slice(t.indexOf("-")+1)]:e[0]?.[t];let n=a(t,Object)?t:{[t]:r};return Object.entries(n).forEach(([i,s])=>{if(i=i.trim(),s&&!ke(i)||!s)return!1;if(i.toLowerCase()==="id")return e[0].id=s;w(e,v=>{if(i.startsWith("data"))return v.dataset[i.slice(i.indexOf("-")+1)]=s;v[i]=s})}),e},remove:(e,t)=>{N(`remove ${j(e.HTML.get(1),40)}${t?` /w selector ${t}`:""}`);let r=i=>i.remove(),n=()=>e.collection=e.collection.filter(i=>document.documentElement.contains(i));if(t){let i=e.find$(t);return i.is.empty||(w(i,r),n()),e}return w(e,r),n(),e},rmAttr:(e,...t)=>(t.forEach(r=>e.node.removeAttribute(r)),e),removeClass:(e,...t)=>w(e,r=>r&&t.forEach(n=>r.classList.remove(n))),renderTo:(e,t=document.body,r=b.insertPositions.end)=>(e.toDOM(t,r),e),replace:(e,t,r)=>{let n=e[0];return!t||!r||!a(r,HTMLElement)&&!r.isJQx?(console.error("JQx replace: invalid replacement value"),e):(r.isJQx&&(r=r[0]),a(r,NodeList)&&(r=r[0]),n&&t&&(t=a(t,String)?n.querySelectorAll(t):t.isJQx?t.collection:t,a(t,HTMLElement,NodeList,Array)&&a(r,HTMLElement)&&(a(t,HTMLElement)?[t]:[...t]).forEach(i=>i.replaceWith(r.cloneNode(!0)))),e)},replaceClass:(e,t,...r)=>w(e,n=>{n.classList.remove(t),r.forEach(i=>n.classList.add(i))}),replaceMe:(e,t)=>e.replaceWith(t),replaceWith:(e,t)=>(t=a(t,Element)?t:t.isJQx?t[0]:void 0,t&&(e[0].replaceWith(t),e=b.virtual(t)),e),setData:(e,t)=>w(e,r=>Be(r,t)),show:e=>w(e,t=>xe(t,{display:"revert-layer !important"})),single:(e,t)=>e.collection.length>0?a(t,String)?e.find$(t):a(t,Number)?b(e.collection[t]):b(e.collection[0]):e,style:(e,t,r)=>w(e,i=>{r&&a(t,String)&&(t={[t]:r||"none"}),xe(i,t)}),text:(e,t,r=!1)=>e.isEmpty()?e:a(t,String)?w(e,i=>i.textContent=r?i.textContent+t:t):e.first().textContent,toDOM:(e,t=document.body,r=F.BeforeEnd)=>(e.isVirtual&&(e.isVirtual=!1),e.collection=U(e.collection,t,r),e),toggleClass:(e,t)=>w(e,r=>r.classList.toggle(t)),toNodeList:e=>[...e.collection].map(t=>document.importNode(t,!0)),trigger:(e,t,r=Event,n={})=>{if(e.collection.length){let i=new r(t,{...n,bubbles:n.bubbles??!0});for(let s of e.collection)s.dispatchEvent(i)}return e},val:(e,t)=>{let r=e[0];return!r||!a(r,HTMLInputElement,HTMLSelectElement,HTMLTextAreaElement)?e:t===void 0?r.value:(r.value=a(t,String)?t:"",e)}}};function We(e){if(!e("#jqxPopup").isEmpty())return;e.dialog({id:"jqxPopup"},e.div({id:"jqxPopupContent"})).render,e.editCssRules(...Le);let[t,r]=[e("#jqxPopupContent"),e.node("#jqxPopup")],n={};return["click","keydown"].forEach(d=>document.addEventListener(d,x,!0)),Object.freeze({show:i,removeModal:L});function i(d){if(r.open)return;n={...d};let{content:g}=n;return e.IS(g,String,HTMLElement)||g?.isJQx?p():!0}function s(){return n.modal?T(n.warnMessage):v()}function p(){t.clear();let{content:d,modal:g,closeAfter:m}=n;g=e.IS(g,Boolean)?g:!1;let y=g?"":e.div({id:"closeHandleIcon"});t.append(y,e.IS(d,String)?e.div(d):d),r.showModal(),!g&&e.IS(m,Number)&&E(s,m)}function v(){return r.close(n.returnValue),e.IS(n.callback,Function)?n.callback(n.returnValue):!0}function L({callback:d,value:g}={}){n.returnValue=g,n.modal=!1,n.callback=d||n.callback,s()}function x(d){n.activeTimer&&clearTimeout(n.activeTimer);let g=d.key==="Escape";return g&&d.preventDefault(),(g||d.target.closest("#closeHandleIcon")||d.type!=="keydown"&&!d.target.closest("#jqxPopupContent"))&&s(),document.activeElement.blur()}function E(d,g){e.IS(d,Function)&&e.IS(g,Number)&&g>0&&(n.activeTimer=setTimeout(d,g*1e3))}function T(d){if(!e.IS(d,String,HTMLElement,Proxy))return;let g=t.find$(".warn");switch(!0){case g.is.empty:g=e.div({class:"warn"},d);default:t.append(g.addClass("active")),E(()=>t.find$(".warn").removeClass("active"),2)}}}var k={},Yt=["load","unload","scroll","focus","blur","DOMNodeRemovedFromDocument","DOMNodeInsertedIntoDocument","loadstart","progress","error","abort","load","loadend","pointerenter","pointerleave","readystatechange"],Kt=e=>!!Yt.find(t=>t===e),qe=()=>{let e=n=>k[n.type].forEach(i=>i(n)),t=(n,i)=>s=>{let p=s.target?.closest?.(n);return p&&i(s,b(p))},r=(n,i)=>{k[n]||addEventListener(n,e,Kt(n))};return(n,i,s,p=!1)=>{r(n,p);let v=i?t(i,s):s;k=k[n]?{...k,[n]:k[n].concat(v)}:{...k,[n]:[v]}}};var er={},{instanceMethods:ze,instanceGetters:_e,isCommentOrTextNode:Je,isNode:re,isHtmlString:Ve,isArrayOfHtmlElements:Ge,isArrayOfHtmlStrings:Ze,ElemArray2HtmlString:Xe,input2Collection:Ye,setCollectionFromCssSelector:Ke,addHandlerId:Qe,cssRuleEdit:Ee,addFn:tr,elems4Docs:Sn}=rr();function rr(){let e=K({createWithId:"JQxStylesheet"}),t=(f,h)=>r[f]=(C,...o)=>h(C,...o),r=ve.instanceExtensions,n=ve.factoryExtensions,i=f=>a(f,Comment,Text),s=f=>a(f,Text,HTMLElement,Comment),p=f=>a(f,Comment),v=f=>a(f,Text),L=f=>a(f,String)&&/^<|>$/.test(`${f}`.trim()),x=f=>a(f,Array)&&!f?.find(h=>!L(h)),E=f=>a(f,Array)&&!f?.find(h=>!s(h)),T=f=>f?.filter(h=>h).reduce((h,C)=>h.concat(p(C)?`<!--${C.data}-->`:i(C)?C.textContent:C.outerHTML),""),d=f=>f?a(f,Proxy)?[f.EL]:a(f,NodeList)?[...f]:s(f)?[f]:E(f)?f:f.isJQx?f.collection:void 0:[],g=(f,h,C)=>{let o=h!==document.body&&a(f,String)&&f.toLowerCase()!=="body"?h:document,l;try{C.collection=[...o.querySelectorAll(f)]}catch{l=`Invalid CSS querySelector. [${a(f,String)?f:"Nothing valid given!"}]`}return l??`CSS querySelector "${f}", output ${C.collection.length} element(s)`},m=f=>{let h=f.data.get("hid")||`HID${z()}`;return f.data.add({hid:h}),`[data-hid="${h}"]`},y=Object.entries(M.tagsRaw).filter(([,f])=>f).map(([f])=>f).sort((f,h)=>f.localeCompare(h));return{instanceMethods:r,instanceGetters:n,isCommentOrTextNode:i,isNode:s,isComment:p,isText:v,isHtmlString:L,isArrayOfHtmlElements:E,isArrayOfHtmlStrings:x,ElemArray2HtmlString:T,input2Collection:d,setCollectionFromCssSelector:g,addHandlerId:m,cssRuleEdit:e,addFn:t,elems4Docs:y}}function G(e){return new Proxy(e,{get:(t,r)=>ir(t,r,e)})}function nr(e,t){return(...r)=>a(e,Function)&&e(G(t),...r)}function or(e,t){return(...r)=>a(e,Function)&&e(G(t),...r)}function ir(e,t,r){switch(!0){case a(t,Symbol):return e;case a(+t,Number):return e.collection?.[t]||`ELEMENT WITH INDEX ${t} NOT FOUND`;case t in _e:return or(_e[t],r)();case t in ze:return nr(ze[t],r);default:return e[t]}}function et(e){let t=dr(e);return Object.entries(Object.getOwnPropertyDescriptors(t)).forEach(([r,n])=>{Object.defineProperty(e,r,n),Object.defineProperty(er,r,n)}),e}function lr(e){return{allow:t=>{let r=/-/.test(t),n=r&&t;t=r?ee(t):t.toLowerCase(),M.allowTag(t),a(e[t],Function)||Object.defineProperties(e,we(t,!0,e,n))},prohibit:t=>{t=t.toLowerCase(),M.prohibitTag(t),a(e[t],Function)&&Object.defineProperties(e,we(t,!1,e))}}}function Ue(...e){if(e.length===1){let t=String(e.shift().trim());e=t.startsWith("!")?[t.slice(1,-1)]:t.split(",").map(r=>r.trim())}e.map(t=>t.startsWith("!")?t.slice(1,-1):t).forEach(t=>Ee(t,{removeRule:1}))}function sr(e){return function(t,r,...n){return a(r,Function)&&(n.push(r),r=void 0),n.forEach(i=>e(t,r,i))}}function ar(e){return function(t,r,n){r=r?.isJQx?r?.[0]:r,n=n&&Object.values(F).find(s=>n===s)?n:void 0;let i=e(t,document.createElement("br"));return r&&!a(r,HTMLBRElement)&&i.collection.forEach(s=>n?r.insertAdjacentElement(n,s):r.append(s)),i}}function cr(...e){let t={};for(let r of e){let n=Object.getOwnPropertyDescriptors(r);Object.entries(n).forEach(([i,s])=>!(i in t)&&Object.defineProperty(t,i,s))}return t}function ur(e){console.error(`JQx: "${e}" not allowed, not rendered`)}function fr(e,t,r,n){return e=O(n||e.toLowerCase()),{get(){return(...i)=>t?r.virtual(te(pe[e](...i))):ur(e)},enumerable:!1,configurable:!0}}function we(e,t,r,n){e=e.toLowerCase();let i=fr(e,t,r,n);return n?{[n]:i,[ee(n)]:i}:{[e]:i,[e.toUpperCase()]:i}}function dr(e){return cr(Object.entries(M.tagsRaw).reduce(mr(e),{}),gr(e))}function mr(e){return function(t,[r,n]){return n&&Object.defineProperties(t,we(r,n,e)),t}}function gr(e){let t=(n,i)=>Ee(n,i),r=lr(e);return{debugLog:$,log:(...n)=>D("fromStatic",...n),insertPositions:F,get at(){return F},editCssRules:(...n)=>n.forEach(i=>Ee(i)),editCssRule:t,get setStyle(){return t},delegate:sr(qe()),virtual:ar(e),get fn(){return tr},allowTag:r.allow,prohibitTag:r.prohibit,get lenient(){return M.allowUnknownHtmlTags},get IS(){return a},get Popup(){return e.activePopup||Object.defineProperty(e,"activePopup",{value:We(e),enumerable:!1}),e.activePopup},popup:()=>e.Popup,createStyle:n=>K({createWithId:n||`jqx${z()}`}),editStylesheet:n=>K({createWithId:n||`jqx${z()}`}),removeCssRule:Ue,removeCssRules:Ue,text:(n,i=!1)=>i?e.comment(n):document.createTextNode(n),node:(n,i=document)=>i.querySelector(n,i),nodes:(n,i=document)=>[...i.querySelectorAll(n,i)]}}var b=et(pr());function pr(){return function(r,n,i=F.BeforeEnd){if(r?.isJQx)return r;let s=a(n,HTMLBRElement);n=(!s&&n&&n.isJQx?n[0]:n)||document.body,i=i&&Object.values(F).find(g=>i===g)?i:void 0;let p=Ve(r),v=!p&&Ze(r),L=v||p,x={collection:Ye(r)??[],isVirtual:s,isJQx:!0},E=Ge(x.collection),T=`input => ${v?`"${j(r.join(", "),70)}"`:!L&&E?`element collection [${j(x.collection.map(g=>`${a(g,Comment,Text)?"Comment|Text @":""} ${g?.outerHTML||g?.textContent}`).join(", "),70)}]`:`"${j(r,70)}"`}`;if(x.collection.length&&E)return N(T),s||x.collection.forEach(g=>{n.contains(g)||U([g],n,i)}),G(x);if(L){if([r].flat().forEach(g=>x.collection.push(H(g))),x.collection.length>0){let g=x.collection.filter(m=>m?.dataset?.jqxcreationerror);x.collection=x.collection.filter(m=>!m?.dataset?.jqxcreationerror),N(`${T}`),N(`*Created ${x.isVirtual?"VIRTUAL ":""}[${j(Xe(x.collection)||"sanitized: no elements remaining",70)}]`),g.length&&console.error(`JQx: illegal html, not rendered: "${g.reduce((m,y)=>m.concat(`${y.textContent}
|
|
15
|
+
`),"").trim()}"`),x.isVirtual||U(x.collection,n,i)}return G(x)}let d=Ke(r,n,x);return N(`input => ${d}`),G(x)}}return lt(yr);})();
|
package/Bundle/jqx.min.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
var se=rt(),we=nt(),J=et(),Z=tt();function et(){return{html:Object.freeze("accept,action,align,alt,autocapitalize,autocomplete,autopictureinpicture,autoplay,background,bgcolor,border,capture,cellpadding,cellspacing,checked,cite,class,clear,contenteditable,color,cols,colspan,controls,controlslist,coords,crossorigin,datetime,decoding,default,dir,disabled,disablepictureinpicture,disableremoteplayback,download,draggable,enctype,enterkeyhint,face,for,headers,height,hidden,high,href,hreflang,id,inputmode,integrity,is,ismap,kind,label,lang,list,loading,loop,low,max,maxlength,media,method,min,minlength,multiple,muted,name,nonce,noshade,novalidate,nowrap,open,optimum,pattern,placeholder,playsinline,poster,preload,pubdate,radiogroup,readonly,rel,required,rev,reversed,role,rows,rowspan,spellcheck,scope,selected,shape,size,sizes,span,srclang,start,src,srcset,step,style,summary,tabindex,target,title,translate,type,usemap,valign,value,width,xmlns,slot".split(",")),svg:Object.freeze("accent-height,accumulate,additive,alignment-baseline,ascent,attributename,attributetype,azimuth,basefrequency,baseline-shift,begin,bias,by,class,clip,clippathunits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,cx,cy,d,dx,dy,diffuseconstant,direction,display,divisor,dur,edgemode,elevation,end,fill,fill-opacity,fill-rule,filter,filterunits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,fx,fy,g1,g2,glyph-name,glyphref,gradientunits,gradienttransform,height,href,id,image-rendering,in,in2,k,k1,k2,k3,k4,kerning,keypoints,keysplines,keytimes,lang,lengthadjust,letter-spacing,kernelmatrix,kernelunitlength,lighting-color,local,marker-end,marker-mid,marker-start,markerheight,markerunits,markerwidth,maskcontentunits,maskunits,max,mask,media,method,mode,min,name,numoctaves,offset,operator,opacity,order,orient,orientation,origin,overflow,paint-order,path,pathlength,patterncontentunits,patterntransform,patternunits,points,preservealpha,preserveaspectratio,primitiveunits,r,rx,ry,radius,refx,refy,repeatcount,repeatdur,restart,result,rotate,scale,seed,shape-rendering,specularconstant,specularexponent,spreadmethod,startoffset,stddeviation,stitchtiles,stop-color,stop-opacity,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke,stroke-width,style,surfacescale,systemlanguage,tabindex,targetx,targety,transform,text-anchor,text-decoration,text-rendering,textlength,type,u1,u2,unicode,values,viewbox,visibility,version,vert-adv-y,vert-origin-x,vert-origin-y,width,word-spacing,wrap,writing-mode,xchannelselector,ychannelselector,x,x1,x2,xmlns,y,y1,y2,z,zoomandpan".split(","))}}function tt(){return{a:!0,area:!0,audio:!1,br:!0,base:!0,body:!0,button:!0,canvas:!0,comment:!0,dl:!0,data:!0,datalist:!0,div:!0,em:!0,embed:!1,fieldset:!0,font:!0,footer:!0,form:!1,hr:!0,head:!0,header:!0,output:!0,iframe:!1,frameset:!1,img:!0,input:!0,li:!0,label:!0,legend:!0,link:!0,map:!0,mark:!0,menu:!0,media:!0,meta:!0,nav:!0,meter:!0,ol:!0,object:!1,optgroup:!0,option:!0,p:!0,param:!0,picture:!0,pre:!0,progress:!1,quote:!0,script:!1,select:!0,source:!0,span:!0,style:!0,caption:!0,td:!0,col:!0,table:!0,tr:!0,template:!1,textarea:!0,time:!0,title:!0,track:!0,details:!0,ul:!0,video:!0,del:!0,ins:!0,slot:!0,blockquote:!0,svg:!0,dialog:!0,summary:!0,main:!0,address:!0,colgroup:!0,tbody:!0,tfoot:!0,thead:!0,th:!0,dd:!0,dt:!0,figcaption:!0,figure:!0,i:!0,b:!0,code:!0,h1:!0,h2:!0,h3:!0,h4:!0,abbr:!0,bdo:!0,dfn:!0,kbd:!0,q:!0,rb:!0,rp:!0,rt:!0,ruby:!0,s:!0,strike:!0,samp:!0,small:!0,strong:!0,sup:!0,sub:!0,u:!0,var:!0,wbr:!0,nobr:!0,tt:!0,noscript:!0}}function rt(){return["#logBox{min-width:0px;max-width:0px;min-height:0px;max-height:0px;width:0;height:0;z-index:-1;border:none;padding:0px;overflow:hidden;transition:all 0.3s ease;margin-top:-100px;}","#logBox.visible{background-color:rgb(255, 255, 224);z-index:1;position:static;border:1px dotted rgb(153, 153, 153);max-width:50vw;min-width:30vw;min-height:10vh;max-height:90vh;overflow:auto;width:50vw;height:20vh;margin:1rem 0px;padding:0px 8px 19px;resize:both;}","#logBox.visible .legend{position:absolute;}","#logBox .legend{text-align:center;margin-top:-1em;width:inherit;max-width:inherit;}","#logBox .legend div{text-align:center;display:inline-block;max-width:inherit;height:1.2rem;background-color:rgb(119, 119, 119);padding:2px 10px;color:rgb(255, 255, 255);box-shadow:rgb(119 119 119) 2px 1px 10px;border-radius:4px;}","#logBox .legend div:before{content:'JQx Logging (chronological)';}","#logBox .legend.reversed div:before{content:'JQx Logging (reversed)';}","#logBox #jqx_logger{marginTop:0.7rem;lineHeight:1.4em;font-family:consolas,monospace;whiteSpace:pre-wrap;maxWidth:inherit;padding-left:100px;}","#logBox #jqx_logger div.entry{text-indent:-100px;whiteSpace:normal;}"]}function nt(){return["::backdrop{background-color:grey;opacity:0.2;}",`#jqxPopup{overflow:hidden;background-color:transparent;outline:none;border:none;inset:0;animation:fade-out 0.5s ease-out;&[open]{display:flex;align-items:center;justify-content:center;animation:fade-in 0.5s ease;}#jqxPopupContent{background-color:white;border:solid 1px #eee;box-shadow:1px 2px 8px #999;border-radius:4px;padding:12px;vertical-align:middle;max-height:40vh;max-width:50vw;overflow:auto;margin:0 auto;div:not(#closeHandleIcon){clear:both;}@media (width <= 640px){max-width:80vw;max-height:60vh;}#closeHandleIcon{cursor:pointer;width:24px;height:24px;display:inline;position:absolute;top:4px;right:4px;justify-content:right;background-image:url("data:image/svg+xml;utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20version%3D%221.1%22%20id%3D%22Layer_1%22%20x%3D%220px%22%20y%3D%220px%22%20viewBox%3D%220%200%20128%20128%22%20style%3D%22enable-background%3Anew%200%200%20128%20128%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Crect%20x%3D%22-368%22%20y%3D%226%22%20style%3D%22display%3Anone%3Bfill%3A%23E0E0E0%3B%22%20width%3D%22866%22%20height%3D%221018%22%2F%3E%3Ccircle%20style%3D%22fill%3A%23FFFFFF%3B%22%20cx%3D%2264%22%20cy%3D%2264%22%20r%3D%2248%22%2F%3E%3Ccircle%20style%3D%22fill%3A%238CCFB9%3B%22%20cx%3D%2264%22%20cy%3D%2264%22%20r%3D%2239%22%2F%3E%3Ccircle%20style%3D%22fill%3Anone%3Bstroke%3A%23444B54%3Bstroke-width%3A6%3Bstroke-miterlimit%3A10%3B%22%20cx%3D%2264%22%20cy%3D%2264%22%20r%3D%2248%22%2F%3E%3Cpolyline%20style%3D%22fill%3Anone%3Bstroke%3A%23FFFFFF%3Bstroke-width%3A6%3Bstroke-linecap%3Around%3Bstroke-miterlimit%3A10%3B%22%20points%3D%2242%2C69%2055.55%2C81%20%20%2086%2C46%20%22%2F%3E%3C%2Fsvg%3E");@media (width <= 640px){background-image:none;position:relative;margin:-15px -15px 4px 0;float:right;vertical-align:middle;border:1px solid #AAA;padding:2px;border-radius:50%;width:12px;height:12px;font-size:12px;line-height:12px;font-weight:bold;text-align:center;&:after{content:'\\2714';color:green;}}}.warn{display:none;text-align:center;color:red;border-top:1px solid #999;margin-top:1em;padding-top:3px;animation:warn-fade-out 0.2s ease-out;}.warn.active{opacity:1;display:block;animation:warn-fade-in 0.2s ease-in;}}}`,"@keyframes fade-in{0%{opacity:0;transform:scale(0, 0);display:none;}100%{opacity:1;transform:scale(1, 1);display:flex;}}","@keyframes fade-out{0%{opacity:1;transform:scale(1, 1);display:flex;}100%{opacity:0;transform:scale(0, 0);display:none;}}","@keyframes warn-fade-in{0%{opacity:0;transform:scale(0, 0);display:none;}100%{opacity:1;transform:scale(1,1 );display:block;}}","@keyframes warn-fade-out{0%{opacity:1;transform:scale(1, 1);display:block;}100%{opacity:0;transform:scale(0, 0);display:none;}}"]}var ae=!1,ot={on:()=>ae=!0,off:()=>ae=!1},M={tagsRaw:Z,allowUnknownHtmlTags:ot,isAllowed(e){if(ae)return!0;let t=a(e,String)?e.toLowerCase():e?.nodeName.toLowerCase()||"none";return t==="#text"||!!Z[t]},allowTag:e=>Z[e.toLowerCase()]=!0,prohibitTag:e=>Z[e.toLowerCase()]=!1};var fe=!1,X=!1,W=!0,de=!1,it=!0,Ce,Q=()=>h("#logBox"),$e="#jqx_logger",lt=e=>{se?.forEach(t=>e(t))},st=()=>{se&<(Ce);let e=it?"div":"pre",t=`<div id="logBox"><div class="legend"><div></div></div><${e} id="jqx_logger"></${e}></div>`;return me(H(t),void 0,F.AfterBegin),h.node($e)},Le=e=>a(e,String)&&Object.assign(document.createElement("textarea"),{innerHTML:e}).textContent||e,D=(...e)=>{let t=e[0]==="fromStatic";if(e=t?e.slice(1):e,t&&!X)return e.forEach(n=>console.info(`${q()} \u2714 ${Le(n)}`));if(!X)return;!W&&!h.node("#logBox")&&(Ce=h.createStyle("JQxLogCSS"),st());let r=n=>`${a(n,Object)?JSON.stringify(n,null,2):n}
|
|
2
|
-
`;e.forEach(n=>W?console.info(`${q()} \u2714 ${Le(n)}`):h.node("#jqx_logger").insertAdjacentHTML(de?"afterbegin":"beforeend",`<div class="entry">${q()} ${r(n.replace(/\n/g,"<br>"))}</div>`))},ce={on(){X=!0,D("Logging activated")},off(){X=!1,console.log("Logging deactivated")}},ue={on(){fe=!0},off(){fe=!1}},N=(...e)=>fe&&D(...e),$={get isConsole(){return W===!0},get isOn(){return X},isVisible:function(){return h("#jqx_logger").is("visible")},on(){return ce.on(),ue.on(),W||Q()?.addClass("visible"),D("Debug logging started. Every call to [jqx instance] is logged"),$},off(){return Q().isEmpty||(ue.off(),D("Debug logging stopped"),Q()?.removeClass("visible")),ce.off(),$},toConsole:{on(){return W=!0,D("Started logging to console"),$},off(){return D("Stopped logging to console (except error messages)"),W=!1,$}},remove(){return ce.off(),ue.off(),Q()?.remove(),console.clear(),console.log(`${q()} logging completely disabled and all entries removed`),$},log:function(...e){return D(...e),$},hide(){return Q()?.removeClass("visible"),$},show:()=>(Q()?.addClass("visible"),$),get reversed(){return{on:()=>(de=!0,D("Reverse logging set: now logging bottom to top (latest first)"),h("#logBox .legend").addClass("reversed"),$),off:()=>(de=!1,h("#logBox .legend").removeClass("reversed"),D("Reverse logging reset: now logging chronological (latest last)"),$)}},clear(){return h($e).text(""),console.clear(),D("Logging cleared"),$}};var at=ct(),Te={html:"innerHTML",text:"textContent",class:"className"},ge=at;function ct(){let e={get(t,r){let n=String(r)?.toLowerCase();switch(!0){case n in t:return t[n];case ht(n):return Fe(t,n,r);default:return Fe(t,n,r,!0)}},enumerable:!1,configurable:!1};return new Proxy({},e)}function Fe(e,t,r,n=!1){return Object.defineProperty(e,t,{get(){return n?i=>yt(r):xt(t)}}),e[t]}function ut(e,t,r){return t=t?.isJQx&&t.first()||t,ye({trial:n=>bt(t)?e.append(t):De(t)?e.insertAdjacentHTML("beforeend",t):e.append(t),whenError:n=>console.info(`${r} (for root ${e}) not created, reason
|
|
3
|
-
`,n)})}function ft(e,t,...r){let n=dt(t,e);return r?.forEach(i=>ut(n,i,e)),n}function dt(e,t){switch(e=pe(t)?pt(e):e?.isJQx?e.first():e,!0){case a(e,String):return Y(t,De(e,t)?{html:e}:{text:e});case a(e,Node):return gt(t,e);default:return Y(t,e)}}function mt(e){return delete e.data,Object.keys(e).length<1||Object.keys(e).forEach(t=>{let r=t.toLowerCase();r in Te&&(e[Te[r]]=e[t],delete e[t])}),e}function gt(e,t){let r=Y(e);return r.append(t),r}function Y(e,t={}){t=Ae(t,{});let r=Object.entries(t.data??{}),n=Object.assign(pe(e)?new Comment(t?.text):document.createElement(e),mt(t));return r.length&&r.forEach(([i,s])=>n.dataset[i]=String(s)),n}function Ae(e,t){return t?a(e,{isTypes:Object,notTypes:[Array,null,NaN,Proxy],defaultValue:t}):a(e,{isTypes:Object,notTypes:[Array,null,NaN,Proxy]})}function pt(e){return Ae(e)?e?.text??e?.textContent??"":String(e)}function yt(e){return Y("b",{style:"color:red",text:`'${e}' is not a valid HTML-tag`})}function De(e,t){return!pe(t)&&a(e,String)&&/<.*>|&[#|0-9a-z]+[^;];/i.test(e)}function bt(e){return e?.constructor===Comment||e?.constructor===CharacterData}function pe(e){return e?.constructor===Comment||/comment/i.test(e)}function ht(e){return!a(Y(e),HTMLUnknownElement)}function xt(e){return(t,...r)=>ft(e,t,...r)}var{IS:a,maybe:ye,$Wrap:Sr,xProxy:vr,isNothing:Er}=St();function St(){Symbol.proxy=Symbol.for("toa.proxy"),Symbol.is=Symbol.for("toa.is"),Symbol.type=Symbol.for("toa.type"),Symbol.isSymbol=Symbol.for("toa.isASymbol"),y();let e=T(),[t,r]=[d(),C()];return r.custom(),{IS:n,maybe:e,$Wrap:t,isNothing:E,xProxy:r};function n(o,...l){if(e({trial:u=>"isTypes"in(l?.[0]??{})})){let u=l[0];return"defaultValue"in u?g(o,u):"notTypes"in u?m(o,u):n(o,...[u.isTypes].flat())}let c=typeof o=="symbol"?Symbol.isSymbol:o;return l.length>1?x(c,...l):s(o,...l)}function i(o){return o?.[Symbol.proxy]??n(o)}function s(o,...l){let{noInput:c,noShouldbe:u,compareTo:S,inputCTOR:A,isNaN:P,isInfinity:I,shouldBeFirstElementIsNothing:R}=v(o,...l);switch(l=l.length&&l[0],!0){case R:return String(o)===String(S);case(o?.[Symbol.proxy]&&u):return o[Symbol.proxy];case P:return u?"NaN":e({trial:B=>String(S)})===String(o);case I:return u?"Infinity":e({trial:B=>String(S)})===String(o);case c:return u?String(o):String(S)===String(o);case A===Boolean:return l?A===l:"Boolean";default:return L(o,l,u,p(o,A))}}function p(o,l){return o===0?Number:o===""?String:o?l:{name:String(o)}}function v(o,...l){let c=l.length<1,u=!c&&l[0],S=!c&&E(l[0]),A=o==null,P=!A&&Object.getPrototypeOf(o)?.constructor,I=e({trial:B=>String(o)})==="NaN",R=e({trial:B=>String(o)})==="Infinity";return{noInput:A,noShouldbe:c,compareTo:u,inputCTOR:P,isNaN:I,isInfinity:R,shouldBeFirstElementIsNothing:S}}function L(o,l,c,u){switch(!0){case(!c&&l===o||o?.[Symbol.proxy]&&l===Proxy):return!0;case e({trial:S=>String(l)})==="NaN":return String(o)==="NaN";case(o?.[Symbol.toStringTag]&&n(l,String)):return String(l)===o[Symbol.toStringTag];default:return l?e({trial:S=>o instanceof l})||l===u||l===Object.getPrototypeOf(u)||`${l?.name}`===u?.name:o?.[Symbol.toStringTag]&&`[object ${o?.[Symbol.toStringTag]}]`||u?.name||String(u)}}function x(o,...l){return l.some(c=>n(o,c))}function E(o,l=!1){let c=o==null;return c=l?c||n(o,1/0)||n(o,NaN):c,c}function T(){let o=(l,c)=>l?.constructor===Function?l(c):void 0;return function({trial:l,whenError:c=()=>{}}={}){try{return o(l)}catch(u){return o(c,u)}}}function d(){return function(o){return Object.freeze({get value(){return o},get[Symbol.type](){return i(o)},get type(){return i(o)},[Symbol.is](...l){return n(o,...l)},is(...l){return n(o,...l)}})}}function g(o,{defaultValue:l,isTypes:c=[void 0],notTypes:u}={}){return c=c?.constructor!==Array?[c]:c,u=u&&u?.constructor!==Array?[u]:[],u.length<1?n(o,...c)?o:l:m(o,{isTypes:c,notTypes:u})?o:l}function m(o,{isTypes:l=[void 0],notTypes:c=[void 0]}={}){return l=l?.constructor!==Array?[l]:l,c=c?.constructor!==Array?[c]:c,n(o,...l)&&!n(o,...c)}function y(){Object.getOwnPropertyDescriptors(Object.prototype)[Symbol.is]||(Object.defineProperties(Object.prototype,{[Symbol.type]:{get(){return i(this)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(...o){return n(this,...o)},enumerable:!1,configurable:!1}}),Object.defineProperties(Object,{[Symbol.type]:{value(o){return i(o)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(o,...l){return n(o,...l)},enumerable:!1,configurable:!1}}))}function f(o){let l=String(Object.getPrototypeOf(o)?.constructor);return l.slice(l.indexOf("ion")+3,l.indexOf("(")).trim()}function b(o){let l=o.set;return o.set=(c,u,S)=>u===Symbol.proxy?c[u]=S:l(c,u,S),o}function C(){let o=Proxy;return{native(){Proxy=o},custom(){Proxy=new o(o,{construct(l,c){for(let S of c)S.set&&(S=b(S));let u=new l(...c);return u[Symbol.proxy]=`Proxy (${f(c[0])})`,u}})}}}}var{IS:ne,maybe:Lr,$Wrap:Cr,xProxy:$r,isNothing:Tr}=vt();function vt(){Symbol.proxy=Symbol.for("toa.proxy"),Symbol.is=Symbol.for("toa.is"),Symbol.type=Symbol.for("toa.type"),Symbol.isSymbol=Symbol.for("toa.isASymbol"),y();let e=T(),[t,r]=[d(),C()];return r.custom(),{IS:n,maybe:e,$Wrap:t,isNothing:E,xProxy:r};function n(o,...l){if(e({trial:u=>"isTypes"in(l?.[0]??{})})){let u=l[0];return"defaultValue"in u?g(o,u):"notTypes"in u?m(o,u):n(o,...[u.isTypes].flat())}let c=typeof o=="symbol"?Symbol.isSymbol:o;return l.length>1?x(c,...l):s(o,...l)}function i(o){return o?.[Symbol.proxy]??n(o)}function s(o,...l){let{noInput:c,noShouldbe:u,compareTo:S,inputCTOR:A,isNaN:P,isInfinity:I,shouldBeFirstElementIsNothing:R}=v(o,...l);switch(l=l.length&&l[0],!0){case R:return String(o)===String(S);case(o?.[Symbol.proxy]&&u):return o[Symbol.proxy];case P:return u?"NaN":e({trial:B=>String(S)})===String(o);case I:return u?"Infinity":e({trial:B=>String(S)})===String(o);case c:return u?String(o):String(S)===String(o);case A===Boolean:return l?A===l:"Boolean";default:return L(o,l,u,p(o,A))}}function p(o,l){return o===0?Number:o===""?String:o?l:{name:String(o)}}function v(o,...l){let c=l.length<1,u=!c&&l[0],S=!c&&E(l[0]),A=o==null,P=!A&&Object.getPrototypeOf(o)?.constructor,I=e({trial:B=>String(o)})==="NaN",R=e({trial:B=>String(o)})==="Infinity";return{noInput:A,noShouldbe:c,compareTo:u,inputCTOR:P,isNaN:I,isInfinity:R,shouldBeFirstElementIsNothing:S}}function L(o,l,c,u){switch(!0){case(!c&&l===o||o?.[Symbol.proxy]&&l===Proxy):return!0;case e({trial:S=>String(l)})==="NaN":return String(o)==="NaN";case(o?.[Symbol.toStringTag]&&n(l,String)):return String(l)===o[Symbol.toStringTag];default:return l?e({trial:S=>o instanceof l})||l===u||l===Object.getPrototypeOf(u)||`${l?.name}`===u?.name:o?.[Symbol.toStringTag]&&`[object ${o?.[Symbol.toStringTag]}]`||u?.name||String(u)}}function x(o,...l){return l.some(c=>n(o,c))}function E(o,l=!1){let c=o==null;return c=l?c||n(o,1/0)||n(o,NaN):c,c}function T(){let o=(l,c)=>l?.constructor===Function?l(c):void 0;return function({trial:l,whenError:c=()=>{}}={}){try{return o(l)}catch(u){return o(c,u)}}}function d(){return function(o){return Object.freeze({get value(){return o},get[Symbol.type](){return i(o)},get type(){return i(o)},[Symbol.is](...l){return n(o,...l)},is(...l){return n(o,...l)}})}}function g(o,{defaultValue:l,isTypes:c=[void 0],notTypes:u}={}){return c=c?.constructor!==Array?[c]:c,u=u&&u?.constructor!==Array?[u]:[],u.length<1?n(o,...c)?o:l:m(o,{isTypes:c,notTypes:u})?o:l}function m(o,{isTypes:l=[void 0],notTypes:c=[void 0]}={}){return l=l?.constructor!==Array?[l]:l,c=c?.constructor!==Array?[c]:c,n(o,...l)&&!n(o,...c)}function y(){Object.getOwnPropertyDescriptors(Object.prototype)[Symbol.is]||(Object.defineProperties(Object.prototype,{[Symbol.type]:{get(){return i(this)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(...o){return n(this,...o)},enumerable:!1,configurable:!1}}),Object.defineProperties(Object,{[Symbol.type]:{value(o){return i(o)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(o,...l){return n(o,...l)},enumerable:!1,configurable:!1}}))}function f(o){let l=String(Object.getPrototypeOf(o)?.constructor);return l.slice(l.indexOf("ion")+3,l.indexOf("(")).trim()}function b(o){let l=o.set;return o.set=(c,u,S)=>u===Symbol.proxy?c[u]=S:l(c,u,S),o}function C(){let o=Proxy;return{native(){Proxy=o},custom(){Proxy=new o(o,{construct(l,c){for(let S of c)S.set&&(S=b(S));let u=new l(...c);return u[Symbol.proxy]=`Proxy (${f(c[0])})`,u}})}}}}var K=Et;function Et({styleSheet:e,createWithId:t}={}){let{tryParseAtOrNestedRules:r,ruleExists:n,checkParams:i,sheet:s,removeRules:p,consider:v,currentSheetID:L}=wt({styleSheet:e,createWithId:t});function x(m,y){if(m&&y.removeProperties){Object.keys(y.removeProperties).forEach(f=>m.style.removeProperty(He(f)));return}Object.entries(y).forEach(([f,b])=>{f=He(f.trim()),b=b.trim();let C;if(/!important/.test(b)&&(b=b.slice(0,b.indexOf("!important")).trim(),C="important"),!CSS.supports(f,b))return console.error(`StylingFactory ${L} error: '${f}' with value '${b}' not supported (yet)`);je(()=>m.style.setProperty(f,b,C),`StylingFactory ${L} (setRule4Selector) failed`)})}function E(m,y,f=s){if(m=m?.trim?.(),!ne(m,String)||!m.length||/[;,]$/g.test(m))return console.error(`StylingFactory ${L} (setRules): [${m||"[no selector given]"}] is not a valid selector`);if(y.removeRule)return p(m);let b=n(m,!0),C=b||f.cssRules[f.insertRule(`${m} {}`,f.cssRules.length||0)];return v(()=>x(C,y),m,b)}function T(m){let y=m.trim().split(/{/,2),f=y.shift().trim();if(!ne(f,String)||!f?.trim()?.length)return console.error(`StylingFactory ${L} (doParse): no (valid) selector could be extracted from rule ${be(m)}`);let b=Dt(y.shift());return je(()=>E(f,b),`StylingFactory ${L} (setRules) failed`)}function d(m){let y=r(m);return y.done?y.existing:T(m)}function g(m,y){return m.trim().startsWith("@media")?d(Lt(m,y)):E(m,y)}return function(m,y={}){return i(m,y)&&(Object.keys(y).length?g(m,y):d(m))}}function wt({styleSheet:e,createWithId:t}){let r="Note: The rule or some of its properties may not be supported by your browser (yet)",n=`for style#${t}`;e=t?i(t):e;function i(d){let g=document.querySelector(`#${d}`)?.sheet;if(g)return g;let m=Object.assign(document.createElement("style"),{id:d});return document.head.insertAdjacentElement("beforeend",m),m.sheet}function s(d){return console.error(`StylingFactory ${n} [rule: ${d}]
|
|
4
|
-
=> @charset, @namespace and @import are not supported here`),{done:!0}}function p(d,g){return[...e.rules].find(m=>g?Oe(m.selectorText||"",d):Tt`${$t(d)}${[..."gim"]}`.test(m.cssText))}function v(d){return/^@charset|@import|namespace/i.test(d.trim())?s(d):d.match(/}/g)?.length>1?{existing:E(d,1),done:!0}:{done:!1}}function L(d){let g=[...e.cssRules].reduce((y,f,b)=>Oe(f.selectorText||"",d)&&y.concat(b)||y,[]),m=g.length;return g.forEach(y=>e.deleteRule(y)),m>0?console.info(`\u2714 Removed ${m} instance${m>1?"s":""} of selector ${d} from ${n.slice(4)}`):console.info(`\u2714 Remove rule: selector ${d} does not exist in ${n.slice(4)}`)}function x(d,g){return d&&ne(d,String)&&d.trim().length>0&&ne(g,Object)||(console.error(`StylingFactory ${n} called with invalid parameters`),!1)}function E(d){d=d.trim();let g=d.slice(0,d.indexOf("{")).trim(),m=!!p(g);try{return e.insertRule(`${d}`,e.cssRules.length),m}catch(y){return console.error(`StylingFactory ${n} (tryParse) ${y.name} Error:
|
|
5
|
-
${y.message}
|
|
6
|
-
Rule: ${be(d)}
|
|
7
|
-
${r}`),m}}function T(d,g,m){try{return d(),m}catch(y){return console.error(`StylingFactory ${n} (tryAddOrModify) ${y.name} Error:
|
|
8
|
-
${y.message}
|
|
9
|
-
Rule: ${be(g)}
|
|
10
|
-
${r}`),m}}return{sheet:e,removeRules:L,tryParseAtOrNestedRules:v,ruleExists:p,checkParams:x,tryParse:E,consider:T,currentSheetID:n}}function Lt(e,t){return`${e.trim()} ${Object.entries(t).map(([r,n])=>`${r}: { ${Ct(n)}`)}`}function be(e){let t=(e||"NO RULE").trim().slice(0,50).replace(/\n/g,"\\n").replace(/\s{2,}/g," ");return e.length>t.length?`${t.trim()}...truncated`:t}function Ct(e){return Object.entries(e).map(([t,r])=>`${t}: ${r.trim()}`).join(`;
|
|
11
|
-
`)}function $t(e){return e.replace(/([*\[\]()-+{}.$?\\])/g,t=>`\\${t}`)}function Tt(e,...t){let r=t.length&&Array.isArray(t.slice(-1))?t.pop().join(""):"";return new RegExp((t.length&&e.raw.reduce((n,i,s)=>n.concat(t[s-1]||"").concat(i),"")||e.raw.join("")).split(`
|
|
12
|
-
`).map(n=>n.replace(/\s|\/\/.*$/g,"").trim().replace(/(@s!)/g," ")).join(""),r)}function He(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`).replace(/[^--]^-|-$/,"")}function je(e,t){try{return e()}catch(r){console.error(`${t||"an error occured"}: ${r.message}`)}}function Ft(e){return e.replace(/\/\*.+?\*\//gm,"").replace(/[}{\r\n]/g,"").replace(/(data:.+?);/g,(t,r)=>`${r}\\3b`).split(";").map(t=>t.trim()).join(`;
|
|
13
|
-
`).replaceAll("\\3b",";").split(`
|
|
14
|
-
`)}function At(e){return e.reduce((t,r)=>{let[n,i]=[r.slice(0,r.indexOf(":")).trim(),r.slice(r.indexOf(":")+1).trim().replace(/;$|;.+(?=\/*).+\/$/,"")];return n&&i?{...t,[n]:i}:t},{})}function Dt(e){return At(Ft(e))}function Oe(e,t){return e?.replace("::",":")===t?.replace("::",":")}var Ht=[...Array(26)].map((e,t)=>String.fromCharCode(t+65)).concat([...Array(26)].map((e,t)=>String.fromCharCode(t+97))).concat([...Array(10)].map((e,t)=>`${t}`)),oe=(e,t=2)=>`${e}`.padStart(t,"0"),jt=(e,t=0)=>([e,t]=[Math.floor(e),Math.ceil(t)],Math.floor([...crypto.getRandomValues(new Uint32Array(1))].shift()/2**32*(e-t+1)+t)),Ot=e=>{let t=e.length;for(;t--;){let r=jt(t);[e[t],e[r]]=[e[r],e[t]]}return e};var j=(e,t=120)=>`${e}`.trim().slice(0,t).replace(/>\s+</g,"><").replace(/</g,"<").replace(/\s{2,}/g," ").replace(/\n/g,"\\n")+(e.length>t?" …":"").trim(),O=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`).replace(/^-|-$/,""),Mt=([e,...t])=>`${e.toUpperCase()}${t.join("")}`,ee=e=>a(e,String)?e.toLowerCase().split("-").map((t,r)=>r&&`${Mt(t)}`||t).join(""):e,z=()=>`_${Ot(Ht).slice(0,8).join("")}`,ie=(e,t=120)=>j(e,t).replace(/</g,"<"),q=()=>(e=>`[${oe(e.getHours())}:${oe(e.getMinutes())}:${oe(e.getSeconds())}.${oe(e.getMilliseconds(),3)}]`)(new Date);var _=e=>e.replace(/</g,"<");function Me(){let e=function(s){if(!s)return;let p=s.style,v=getComputedStyle(s),L=[p.visibility,v.visibility].includes("hidden"),x=[p.display,v.display].includes("none"),E=s.offsetTop<0||s.offsetLeft+s.offsetWidth<0||s.offsetLeft>document.body.offsetWidth,T=+v.opacity==0||+(p.opacity||1)==0;return!(E||T||x||L)},t="n/a",r=function(s){return s.parentNode?!!h.nodes(":is(:read-write)",s?.parentNode)?.find(p=>p===s):!1},n=function(s){return s.parentNode?!!h.nodes(":is(:modal)",s?.parentNode)?.find(p=>p===s):!1},i={notInDOM:!0,writable:t,modal:t,empty:!0,open:t,visible:t};return s=>{let p=s.node;return p?{get writable(){return r(p)},get modal(){return n(p)},get inDOM(){return p.isConnected},get open(){return p.open??!1},get visible(){return e(p)},get disabled(){return p.hasAttribute("readonly")||p.hasAttribute("disabled")},get empty(){return s.collection.length<1},get virtual(){return s.isVirtual}}:i}}var Nt=!0,le={data:/data-[\-\w.\p{L}]/ui,validURL:/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,whiteSpace:/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g,notAllowedValues:/javascript|injected|noreferrer|alert|DataURL/gi},Pt=e=>{if(Nt&&Object.keys(e.removed).length){let t=Object.entries(e.removed).reduce((r,[n,i])=>[...r,`${_(n)} => ${i}`],[]).join("\\000A");$.log(`JQx HTML creation errors: ${$.isConsole?t:_(t)}`)}},It=function(e){let t=e.nodeName.toLowerCase(),r=["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"];return/-/.test(t)&&!r.find(n=>n===t)||M.isAllowed(t)},te=e=>{let t={rawHTML:e?.parentElement?.getHTML()??"no html",removed:{}};return a(e,HTMLElement)&&[...e.childNodes].forEach(r=>{if(r?.children?.length&&te(r),r?.attributes){let i=a(r,SVGElement)?J.svg:J.html;[...(r??{attributes:[]}).attributes].forEach(s=>{let p=s.name.trim().toLowerCase(),v=s.value.trim().toLowerCase().replace(le.whiteSpace,""),L=p==="href"?!le.validURL.test(v):le.notAllowedValues.test(v),x=p.startsWith("data")?!le.data.test(p):!!i[p];if(L||x){let E=ie(s.value||"none",60);E+=E.length===60?"...":"",t.removed[`${s.name}`]=`attribute/property (-value) not allowed, removed. Value: ${E}`,r.removeAttribute(s.name)}})}if(!(It(r)||r.constructor===CharacterData||r.constructor===Comment)){let i=(r?.outerHTML||r?.textContent).trim(),s=ie(i,60)??"EMPTY";s+=s.length===60?"...":"",t.removed[`<${r.nodeName?.toLowerCase()}>`]=`not allowed, not rendered. Value: ${s}`,r.remove()}}),Pt(t),e};var F=new Proxy({start:"afterbegin",afterbegin:"afterbegin",end:"beforeend",beforeend:"beforeend",before:"beforebegin",beforebegin:"beforebegin",after:"afterend",afterend:"afterend"},{get(e,t){return e[String(t).toLowerCase()]??e[t]}}),Rt=e=>{let t=document.createElement("div");return t.insertAdjacentHTML(F.end,e),t.childNodes.length?te(t):void 0},Bt=(e,t,r)=>a(e,Comment)?t.insertAdjacentHTML(r,`<!--${e.data}-->`):t.insertAdjacentText(r,e.data),U=(e=[],t=document.body,r=F.BeforeEnd)=>e.reduce((n,i)=>{let s=re(i)&&me(i,t,r);return s?[...n,s]:n},[]),me=(e,t=document.body,r=F.BeforeEnd)=>(t=t?.isJQx?t?.[0]:t,a(e,Comment,Text)?Bt(e,t,r):t.insertAdjacentElement(r,e)),H=e=>{if(a(e,Text,Comment))return e;let t=e?.trim(),r=t?.split(/<text>|<\/text>/i)??[];if(r?.length&&(r=r.length>1?r.filter(i=>i.length).shift():void 0),t.startsWith("<!--")&&t.endsWith("-->"))return document.createComment(e.replace(/<!--|-->$/g,""));if(r||!/^<(.+)[^>]+>/m.test(t))return document.createTextNode(r);let n=Rt(e);return n.childNodes.length<1?H(`<span data-jqxcreationerror="1">${j(e,60)}</span>`):n.children[0]};var w=(e,t)=>{let r=e.collection.filter(n=>!ke(n));for(let n=0;n<r.length;n+=1)t(r[n],n);return e},kt=Me(),Ne=e=>e&&(e.textContent="");var V=e=>{let t=e.cloneNode(!0);return t.removeAttribute&&t.removeAttribute("id"),e.isConnected?e.remove():e=null,t},Re=(e,t)=>{e&&a(t,Object)&&Object.entries(t).forEach(([r,n])=>e.setAttribute(`data-${O(r)}`,n))},Pe=(e,t)=>e.andThen(t,!0),Ie=(e,t)=>e.andThen(t),Be=e=>e.startsWith("data")||J.html.find(t=>e.toLowerCase()===t),Jt=(e,t,r)=>{r&&a(t,String)&&(t={[t]:r==="-"?"":r});let n;t.className&&(n=t.className,delete t.className),n=[...e.classList].find(s=>s.startsWith("JQxClass-")||n&&s===n)||n||`JQxClass-${z().slice(1)}`,h.editCssRule(`.${n}`,t),e.classList.add(n)},Qt=(e,t)=>{e&&Object.entries(t).forEach(([r,n])=>{if(r=O(r),r.startsWith("data"))return Re(e,n);a(n,String)&&Be(r)&&e.setAttribute(r,n.split(/[, ]/)?.join(" "))})},he=(e,t)=>{a(t,Object)&&Object.entries(t).forEach(([r,n])=>{let i;/!important/i.test(n)&&(n=n.slice(0,n.indexOf("!")).trim(),i="important"),e.style.setProperty(O(r),n,i)})},Wt={get(e,t){return e[ee(t)]||e[t]},enumerable:!1,configurable:!1},qt=(...e)=>{$.log("\u2757"+e.map(t=>String(t)).join(", "))},xe=(e,t=0,r=!0)=>(e=e?.parentElement,t+=e?e[r?"scrollTop":"scrollLeft"]:0,e?xe(e,t,r):t),Se={factoryExtensions:{data:e=>({get all(){return new Proxy(e[0]?.dataset??{},Wt)},set:(t={})=>(!e.is.empty&&a(t,Object)&&Object.entries(t).forEach(([r,n])=>e.setData({[r]:n})),e),get:(t,r)=>e.data.all[t]??r,add:(t={})=>(!e.is.empty&&a(t,Object)&&Object.entries(t).forEach(([r,n])=>e.setData({[r]:n})),e),remove:t=>(e[0]?.removeAttribute(`data-${O(t)}`),e)}),dimensions:e=>{if(e.is.empty)return{error:"[instance].dimensions: NO ELEMENTS"};let t=e[0],r=e.first()?.getBoundingClientRect().toJSON();return r.scrollTopDistance=xe(t,0),r.scrollLeftDistance=xe(t,0,!1),r},node:e=>e[0],HTML:e=>({get:(t,r)=>{if(e.is.empty)return"NO ELEMENTS IN COLLECTION";let n=t?e.outerHtml:e.html();return r?_(n):n},set:(t,r=!1,n=!1)=>{t=t.isJQx?t.HTML.get(1):t;let i=a(t,String);return t=i&&n?_(t):t,i&&(t||"").trim().length&&e.html(t,r),e},replace:(t,r=!1)=>e.HTML.set(t,!1,r),append:(t,r=!1)=>(t=a(t,HTMLElement)?h(t).HTML.get(1):t.isJQx?t.HTML.get(1):t,e.HTML.set(t,!0,r)),insert:(t,r=!1)=>(t=a(t,HTMLElement)?h(t).HTML.get(1):t.isJQx?t.HTML.get(1):t,e.HTML.set(t+e.HTML.get(),!1,r))}),is:e=>kt(e),length:e=>e.collection.length,outerHtml:e=>(e.first()||{outerHTML:void 0}).outerHTML,parent:e=>{let t=h(e[0]?.parentNode);return t.is.empty?e:t},render:e=>(!e.is.empty&&e.toDOM()||h.log("[JQx.render]: empty collection"),e),Style:e=>({get computed(){return e.is.empty?{}:getComputedStyle(e[0])},inline:t=>e.style(t),inSheet:t=>e.css(t),valueOf:t=>e.is.empty?void 0:getComputedStyle(e[0])[O(t)],nwRule:t=>e.Style.byRule({rules:t}),byRule:({classes2Apply:t=[],rules:r=[]}={})=>{let i=a(r,String)&&!t.length?r.split("{")[0].trim():"";return r=r&&a(r,String)?[r]:r,t=t&&a(t,String)?[t]:t,(r?.length||t?.length)&&(r?.length&&h.editCssRules(...r),t?.forEach(s=>e.addClass(s))),i?.startsWith(".")&&e.addClass(i.slice(1)),i?.startsWith("#")&&!e.attr("id")&&e.prop({id:i.slice(1)}),e}})},instanceExtensions:{addClass:(e,...t)=>w(e,r=>r&&t.forEach(n=>r.classList.add(n))),after:Ie,afterMe:Ie,andThen:(e,t,r=!1)=>{if(!t||!a(t,String,Node,Proxy))return qt(`[JQx instance].[beforeMe | afterMe | andThen]: insufficient input [${t}]`),e;t=t?.isJQx?t.collection:a(t,Node)?h.virtual(t).collection:h.virtual(H(t)).collection;let[n,i,s]=r?[0,"before",t.concat(e.collection)]:[e.collection.length-1,"after",e.collection.concat(t)];return e[n][i](...t),e.collection=s,e},append:(e,...t)=>{if(!e.is.empty&&t.length){let r=e.length===1;for(let n of t){if(!n.isJQx&&a(n,String)){let i=n.trim(),p=!/^<(.+)[^>]+>$/m.test(i)?h.text(n):H(n);w(e,v=>v.append(r?p:V(p)))}re(n)&&w(e,i=>i.append(r?n:V(n))),n.isJQx&&!n.is.empty&&w(e,i=>n.collection.forEach(s=>i.append(r?s:V(s))))}}return e},appendTo:(e,t)=>(t.isJQx||(t=h(t)),t.append(e),e),attr:(e,t,r)=>{let n=e[0];if(!n)return e;if(!r&&a(t,String))return t=O(t),t==="class"?[...n?.classList].join(" "):n?.getAttribute(t);if(a(t,String)&&r)switch(t=O(t),!0){case t.startsWith("data-"):t={data:{[t.replace("data-","")]:r}};break;default:t={[t]:r}}return a(t,Object)&&!e.is.empty&&Qt(n,t),e},before:Pe,beforeMe:Pe,clear:e=>w(e,Ne),closest:(e,t)=>{let r=a(t,String)?e[0].closest(t):null;return r?h(r):e},computedStyle:(e,t)=>e.first()&&getComputedStyle(e.first())[t],css:(e,t,r)=>w(e,n=>Jt(n,t,r)),duplicate:(e,t=!1,r=document.body)=>{let n=e.toNodeList().map(s=>s.removeAttribute&&s.removeAttribute("id")||s),i=h.virtual(n);return t?i.toDOM(r):i},each:(e,t)=>w(e,t),empty:e=>w(e,Ne),find:(e,t)=>e.collection.length>0?[...e.first()?.querySelectorAll(t)]:[],find$:(e,t)=>e.collection.length>0?h(t,e):e,first:(e,t=!1)=>{if(e.collection.length>0)return t?e.single():e.collection[0]},first$:(e,t)=>e.single(t),getData:(e,t,r)=>e.first()&&e.first().dataset?.[t]||r,hasClass:(e,...t)=>{let r=e[0];return!r||!r.classList.length?!1:t.find(n=>r.classList.contains(n))&&!0||!1},hide:e=>w(e,t=>he(t,{display:"none !important"})),html:(e,t,r)=>{if(t===void 0)return e[0]?.getHTML();if(!e.isEmpty()){let n=H(`<div>${t.isJQx?t.HTML.get(!0):t}</div>`);if(!a(n,Comment))return w(e,s=>(r||(s.textContent=""),s.insertAdjacentHTML(h.at.end,n.getHTML())))}return e},htmlFor:(e,t,r="",n=!1)=>{if(t&&e.collection.length){if(!t||!a(r,String))return e;let i=e.find$(t);if(i.length<1)return e;let s=H(`<span>${r}</span>`);i.each(p=>{n||(p.textContent=""),p.insertAdjacentHTML(h.at.end,s.getHTML())})}return e},isEmpty:e=>e.collection.length<1,nth$:(e,t)=>e.single(t),on:(e,t,...r)=>(e.collection.length&&r?.forEach(n=>{let i=Je(e);h.delegate(t,i,n)}),e),prepend:(e,...t)=>{if(!e.is.empty&&t){let r=e.length===1;for(let n of t){if(a(n,String)){n=n.trim();let s=!/^<(.+)[^>]+>$/m.test(n)?h.text(n):H(n);s=r?s:V(s),w(e,p=>p.prepend(s.cloneNode(!0)))}re(n)&&w(e,i=>i.prepend(r?n:V(n))),n.isJQx&&!n.is.empty&&(n.collection.length>1&&n.collection.reverse(),w(e,i=>w(n,s=>i.prepend(r?s:V(s)))),n.collection.reverse())}}return e},prependTo:(e,t)=>(t.isJQx||(t=h.virtual(t)),t.prepend(e),e),prop:(e,t,r)=>{if(a(t,String)&&!r)return t.startsWith("data")?e[0]?.dataset[t.slice(t.indexOf("-")+1)]:e[0]?.[t];let n=a(t,Object)?t:{[t]:r};return Object.entries(n).forEach(([i,s])=>{if(i=i.trim(),s&&!Be(i)||!s)return!1;if(i.toLowerCase()==="id")return e[0].id=s;w(e,v=>{if(i.startsWith("data"))return v.dataset[i.slice(i.indexOf("-")+1)]=s;v[i]=s})}),e},remove:(e,t)=>{N(`remove ${j(e.HTML.get(1),40)}${t?` /w selector ${t}`:""}`);let r=i=>i.remove(),n=()=>e.collection=e.collection.filter(i=>document.documentElement.contains(i));if(t){let i=e.find$(t);return i.is.empty||(w(i,r),n()),e}return w(e,r),n(),e},rmAttr:(e,...t)=>(t.forEach(r=>e.node.removeAttribute(r)),e),removeClass:(e,...t)=>w(e,r=>r&&t.forEach(n=>r.classList.remove(n))),renderTo:(e,t=document.body,r=h.insertPositions.end)=>(e.toDOM(t,r),e),replace:(e,t,r)=>{let n=e[0];return!t||!r||!a(r,HTMLElement)&&!r.isJQx?(console.error("JQx replace: invalid replacement value"),e):(r.isJQx&&(r=r[0]),a(r,NodeList)&&(r=r[0]),n&&t&&(t=a(t,String)?n.querySelectorAll(t):t.isJQx?t.collection:t,a(t,HTMLElement,NodeList,Array)&&a(r,HTMLElement)&&(a(t,HTMLElement)?[t]:[...t]).forEach(i=>i.replaceWith(r.cloneNode(!0)))),e)},replaceClass:(e,t,...r)=>w(e,n=>{n.classList.remove(t),r.forEach(i=>n.classList.add(i))}),replaceMe:(e,t)=>e.replaceWith(t),replaceWith:(e,t)=>(t=a(t,Element)?t:t.isJQx?t[0]:void 0,t&&(e[0].replaceWith(t),e=h.virtual(t)),e),setData:(e,t)=>w(e,r=>Re(r,t)),show:e=>w(e,t=>he(t,{display:"revert-layer !important"})),single:(e,t)=>e.collection.length>0?a(t,String)?e.find$(t):a(t,Number)?h(e.collection[t]):h(e.collection[0]):e,style:(e,t,r)=>w(e,i=>{r&&a(t,String)&&(t={[t]:r||"none"}),he(i,t)}),text:(e,t,r=!1)=>e.isEmpty()?e:a(t,String)?w(e,i=>i.textContent=r?i.textContent+t:t):e.first().textContent,toDOM:(e,t=document.body,r=F.BeforeEnd)=>(e.isVirtual&&(e.isVirtual=!1),e.collection=U(e.collection,t,r),e),toggleClass:(e,t)=>w(e,r=>r.classList.toggle(t)),toNodeList:e=>[...e.collection].map(t=>document.importNode(t,!0)),trigger:(e,t,r=Event,n={})=>{if(e.collection.length){let i=new r(t,{...n,bubbles:n.bubbles??!0});for(let s of e.collection)s.dispatchEvent(i)}return e},val:(e,t)=>{let r=e[0];return!r||!a(r,HTMLInputElement,HTMLSelectElement,HTMLTextAreaElement)?e:t===void 0?r.value:(r.value=a(t,String)?t:"",e)}}};function Qe(e){if(!e("#jqxPopup").isEmpty())return;e.dialog({id:"jqxPopup"},e.div({id:"jqxPopupContent"})).render,e.editCssRules(...we);let[t,r]=[e("#jqxPopupContent"),e.node("#jqxPopup")],n={};return["click","keydown"].forEach(d=>document.addEventListener(d,x,!0)),Object.freeze({show:i,removeModal:L});function i(d){if(r.open)return;n={...d};let{content:g}=n;return e.IS(g,String,HTMLElement)||g?.isJQx?p():!0}function s(){return n.modal?T(n.warnMessage):v()}function p(){t.clear();let{content:d,modal:g,closeAfter:m}=n;g=e.IS(g,Boolean)?g:!1;let y=g?"":e.div({id:"closeHandleIcon"});t.append(y,e.IS(d,String)?e.div(d):d),r.showModal(),!g&&e.IS(m,Number)&&E(s,m)}function v(){return r.close(n.returnValue),e.IS(n.callback,Function)?n.callback(n.returnValue):!0}function L({callback:d,value:g}={}){n.returnValue=g,n.modal=!1,n.callback=d||n.callback,s()}function x(d){n.activeTimer&&clearTimeout(n.activeTimer);let g=d.key==="Escape";return g&&d.preventDefault(),(g||d.target.closest("#closeHandleIcon")||d.type!=="keydown"&&!d.target.closest("#jqxPopupContent"))&&s(),document.activeElement.blur()}function E(d,g){e.IS(d,Function)&&e.IS(g,Number)&&g>0&&(n.activeTimer=setTimeout(d,g*1e3))}function T(d){if(!e.IS(d,String,HTMLElement,Proxy))return;let g=t.find$(".warn");switch(!0){case g.is.empty:g=e.div({class:"warn"},d);default:t.append(g.addClass("active")),E(()=>t.find$(".warn").removeClass("active"),2)}}}var k={},zt=["load","unload","scroll","focus","blur","DOMNodeRemovedFromDocument","DOMNodeInsertedIntoDocument","loadstart","progress","error","abort","load","loadend","pointerenter","pointerleave","readystatechange"],_t=e=>!!zt.find(t=>t===e),We=()=>{let e=n=>k[n.type].forEach(i=>i(n)),t=(n,i)=>s=>{let p=s.target?.closest?.(n);return p&&i(s,h(p))},r=(n,i)=>{k[n]||addEventListener(n,e,_t(n))};return(n,i,s,p=!1)=>{r(n,p);let v=i?t(i,s):s;k=k[n]?{...k,[n]:k[n].concat(v)}:{...k,[n]:[v]}}};var Ut={},{instanceMethods:qe,instanceGetters:ze,isCommentOrTextNode:ke,isNode:re,isHtmlString:Ue,isArrayOfHtmlElements:Ve,isArrayOfHtmlStrings:Ge,ElemArray2HtmlString:Ze,input2Collection:Xe,setCollectionFromCssSelector:Ye,addHandlerId:Je,cssRuleEdit:ve,addFn:Vt,elems4Docs:fn}=Gt();function Gt(){let e=K({createWithId:"JQxStylesheet"}),t=(f,b)=>r[f]=(C,...o)=>b(C,...o),r=Se.instanceExtensions,n=Se.factoryExtensions,i=f=>a(f,Comment,Text),s=f=>a(f,Text,HTMLElement,Comment),p=f=>a(f,Comment),v=f=>a(f,Text),L=f=>a(f,String)&&/^<|>$/.test(`${f}`.trim()),x=f=>a(f,Array)&&!f?.find(b=>!L(b)),E=f=>a(f,Array)&&!f?.find(b=>!s(b)),T=f=>f?.filter(b=>b).reduce((b,C)=>b.concat(p(C)?`<!--${C.data}-->`:i(C)?C.textContent:C.outerHTML),""),d=f=>f?a(f,Proxy)?[f.EL]:a(f,NodeList)?[...f]:s(f)?[f]:E(f)?f:f.isJQx?f.collection:void 0:[],g=(f,b,C)=>{let o=b!==document.body&&a(f,String)&&f.toLowerCase()!=="body"?b:document,l;try{C.collection=[...o.querySelectorAll(f)]}catch{l=`Invalid CSS querySelector. [${a(f,String)?f:"Nothing valid given!"}]`}return l??`CSS querySelector "${f}", output ${C.collection.length} element(s)`},m=f=>{let b=f.data.get("hid")||`HID${z()}`;return f.data.add({hid:b}),`[data-hid="${b}"]`},y=Object.entries(M.tagsRaw).filter(([,f])=>f).map(([f])=>f).sort((f,b)=>f.localeCompare(b));return{instanceMethods:r,instanceGetters:n,isCommentOrTextNode:i,isNode:s,isComment:p,isText:v,isHtmlString:L,isArrayOfHtmlElements:E,isArrayOfHtmlStrings:x,ElemArray2HtmlString:T,input2Collection:d,setCollectionFromCssSelector:g,addHandlerId:m,cssRuleEdit:e,addFn:t,elems4Docs:y}}function G(e){return new Proxy(e,{get:(t,r)=>Yt(t,r,e)})}function Zt(e,t){return(...r)=>a(e,Function)&&e(G(t),...r)}function Xt(e,t){return(...r)=>a(e,Function)&&e(G(t),...r)}function Yt(e,t,r){switch(!0){case a(t,Symbol):return e;case a(+t,Number):return e.collection?.[t]||`ELEMENT WITH INDEX ${t} NOT FOUND`;case t in ze:return Xt(ze[t],r)();case t in qe:return Zt(qe[t],r);default:return e[t]}}function Ke(e){let t=ir(e);return Object.entries(Object.getOwnPropertyDescriptors(t)).forEach(([r,n])=>{Object.defineProperty(e,r,n),Object.defineProperty(Ut,r,n)}),e}function Kt(e){return{allow:t=>{let r=/-/.test(t),n=r&&t;t=r?ee(t):t.toLowerCase(),M.allowTag(t),a(e[t],Function)||Object.defineProperties(e,Ee(t,!0,e,n))},prohibit:t=>{t=t.toLowerCase(),M.prohibitTag(t),a(e[t],Function)&&Object.defineProperties(e,Ee(t,!1,e))}}}function _e(...e){if(e.length===1){let t=String(e.shift().trim());e=t.startsWith("!")?[t.slice(1,-1)]:t.split(",").map(r=>r.trim())}e.map(t=>t.startsWith("!")?t.slice(1,-1):t).forEach(t=>ve(t,{removeRule:1}))}function er(e){return function(t,r,...n){return a(r,Function)&&(n.push(r),r=void 0),n.forEach(i=>e(t,r,i))}}function tr(e){return function(t,r,n){r=r?.isJQx?r?.[0]:r,n=n&&Object.values(F).find(s=>n===s)?n:void 0;let i=e(t,document.createElement("br"));return r&&!a(r,HTMLBRElement)&&i.collection.forEach(s=>n?r.insertAdjacentElement(n,s):r.append(s)),i}}function rr(...e){let t={};for(let r of e){let n=Object.getOwnPropertyDescriptors(r);Object.entries(n).forEach(([i,s])=>!(i in t)&&Object.defineProperty(t,i,s))}return t}function nr(e){console.error(`JQx: "${e}" not allowed, not rendered`)}function or(e,t,r,n){return e=O(n||e.toLowerCase()),{get(){return(...i)=>t?r.virtual(te(ge[e](...i))):nr(e)},enumerable:!1,configurable:!0}}function Ee(e,t,r,n){e=e.toLowerCase();let i=or(e,t,r,n);return n?{[n]:i,[ee(n)]:i}:{[e]:i,[e.toUpperCase()]:i}}function ir(e){return rr(Object.entries(M.tagsRaw).reduce(lr(e),{}),sr(e))}function lr(e){return function(t,[r,n]){return n&&Object.defineProperties(t,Ee(r,n,e)),t}}function sr(e){let t=(n,i)=>ve(n,i),r=Kt(e);return{debugLog:$,log:(...n)=>D("fromStatic",...n),insertPositions:F,get at(){return F},editCssRules:(...n)=>n.forEach(i=>ve(i)),editCssRule:t,get setStyle(){return t},delegate:er(We()),virtual:tr(e),get fn(){return Vt},allowTag:r.allow,prohibitTag:r.prohibit,get lenient(){return M.allowUnknownHtmlTags},get IS(){return a},get Popup(){return e.activePopup||Object.defineProperty(e,"activePopup",{value:Qe(e),enumerable:!1}),e.activePopup},popup:()=>e.Popup,createStyle:n=>K({createWithId:n||`jqx${z()}`}),editStylesheet:n=>K({createWithId:n||`jqx${z()}`}),removeCssRule:_e,removeCssRules:_e,text:(n,i=!1)=>i?e.comment(n):document.createTextNode(n),node:(n,i=document)=>i.querySelector(n,i),nodes:(n,i=document)=>[...i.querySelectorAll(n,i)]}}var h=Ke(ar());function ar(){return function(r,n,i=F.BeforeEnd){if(r?.isJQx)return r;let s=a(n,HTMLBRElement);n=(!s&&n&&n.isJQx?n[0]:n)||document.body,i=i&&Object.values(F).find(g=>i===g)?i:void 0;let p=Ue(r),v=!p&&Ge(r),L=v||p,x={collection:Xe(r)??[],isVirtual:s,isJQx:!0},E=Ve(x.collection),T=`input => ${v?`"${j(r.join(", "),70)}"`:!L&&E?`element collection [${j(x.collection.map(g=>`${a(g,Comment,Text)?"Comment|Text @":""} ${g?.outerHTML||g?.textContent}`).join(", "),70)}]`:`"${j(r,70)}"`}`;if(x.collection.length&&E)return N(T),s||x.collection.forEach(g=>{n.contains(g)||U([g],n,i)}),G(x);if(L){if([r].flat().forEach(g=>x.collection.push(H(g))),x.collection.length>0){let g=x.collection.filter(m=>m?.dataset?.jqxcreationerror);x.collection=x.collection.filter(m=>!m?.dataset?.jqxcreationerror),N(`${T}`),N(`*Created ${x.isVirtual?"VIRTUAL ":""}[${j(Ze(x.collection)||"sanitized: no elements remaining",70)}]`),g.length&&console.error(`JQx: illegal html, not rendered: "${g.reduce((m,y)=>m.concat(`${y.textContent}
|
|
15
|
-
`),"").trim()}"`),x.isVirtual||U(x.collection,n,i)}return G(x)}let d=Ye(r,n,x);return N(`input => ${d}`),G(x)}}export{h as default};
|
|
1
|
+
var se=rt(),we=nt(),J=et(),Z=tt();function et(){return{html:Object.freeze("accept,action,align,alt,autocapitalize,autocomplete,autopictureinpicture,autoplay,background,bgcolor,border,capture,cellpadding,cellspacing,checked,cite,class,clear,contenteditable,color,cols,colspan,controls,controlslist,coords,crossorigin,datetime,decoding,default,dir,disabled,disablepictureinpicture,disableremoteplayback,download,draggable,enctype,enterkeyhint,face,for,headers,height,hidden,high,href,hreflang,id,inputmode,integrity,is,ismap,kind,label,lang,list,loading,loop,low,max,maxlength,media,method,min,minlength,multiple,muted,name,nonce,noshade,novalidate,nowrap,open,optimum,pattern,placeholder,playsinline,poster,preload,pubdate,radiogroup,readonly,rel,required,rev,reversed,role,rows,rowspan,spellcheck,scope,selected,shape,size,sizes,span,srclang,start,src,srcset,step,style,summary,tabindex,target,title,translate,type,usemap,valign,value,width,xmlns,slot".split(",")),svg:Object.freeze("accent-height,accumulate,additive,alignment-baseline,ascent,attributename,attributetype,azimuth,basefrequency,baseline-shift,begin,bias,by,class,clip,clippathunits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,cx,cy,d,dx,dy,diffuseconstant,direction,display,divisor,dur,edgemode,elevation,end,fill,fill-opacity,fill-rule,filter,filterunits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,fx,fy,g1,g2,glyph-name,glyphref,gradientunits,gradienttransform,height,href,id,image-rendering,in,in2,k,k1,k2,k3,k4,kerning,keypoints,keysplines,keytimes,lang,lengthadjust,letter-spacing,kernelmatrix,kernelunitlength,lighting-color,local,marker-end,marker-mid,marker-start,markerheight,markerunits,markerwidth,maskcontentunits,maskunits,max,mask,media,method,mode,min,name,numoctaves,offset,operator,opacity,order,orient,orientation,origin,overflow,paint-order,path,pathlength,patterncontentunits,patterntransform,patternunits,points,preservealpha,preserveaspectratio,primitiveunits,r,rx,ry,radius,refx,refy,repeatcount,repeatdur,restart,result,rotate,scale,seed,shape-rendering,specularconstant,specularexponent,spreadmethod,startoffset,stddeviation,stitchtiles,stop-color,stop-opacity,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke,stroke-width,style,surfacescale,systemlanguage,tabindex,targetx,targety,transform,text-anchor,text-decoration,text-rendering,textlength,type,u1,u2,unicode,values,viewbox,visibility,version,vert-adv-y,vert-origin-x,vert-origin-y,width,word-spacing,wrap,writing-mode,xchannelselector,ychannelselector,x,x1,x2,xmlns,y,y1,y2,z,zoomandpan".split(","))}}function tt(){return{a:!0,area:!0,audio:!1,br:!0,base:!0,body:!0,button:!0,canvas:!0,comment:!0,dl:!0,data:!0,datalist:!0,div:!0,em:!0,embed:!1,fieldset:!0,font:!0,footer:!0,form:!1,hr:!0,head:!0,header:!0,output:!0,iframe:!1,frameset:!1,img:!0,input:!0,li:!0,label:!0,legend:!0,link:!0,map:!0,mark:!0,menu:!0,media:!0,meta:!0,nav:!0,meter:!0,ol:!0,object:!1,optgroup:!0,option:!0,p:!0,param:!0,picture:!0,pre:!0,progress:!1,quote:!0,script:!1,select:!0,source:!0,span:!0,style:!0,caption:!0,td:!0,col:!0,table:!0,tr:!0,template:!1,textarea:!0,time:!0,title:!0,track:!0,details:!0,ul:!0,video:!0,del:!0,ins:!0,slot:!0,blockquote:!0,svg:!0,dialog:!0,summary:!0,main:!0,address:!0,colgroup:!0,tbody:!0,tfoot:!0,thead:!0,th:!0,dd:!0,dt:!0,figcaption:!0,figure:!0,i:!0,b:!0,code:!0,h1:!0,h2:!0,h3:!0,h4:!0,abbr:!0,bdo:!0,dfn:!0,kbd:!0,q:!0,rb:!0,rp:!0,rt:!0,ruby:!0,s:!0,strike:!0,samp:!0,small:!0,strong:!0,sup:!0,sub:!0,u:!0,var:!0,wbr:!0,nobr:!0,tt:!0,noscript:!0}}function rt(){return["#logBox{min-width:0px;max-width:0px;min-height:0px;max-height:0px;width:0;height:0;z-index:-1;border:none;padding:0px;overflow:hidden;transition:all 0.3s ease;margin-top:-100px;}","#logBox.visible{background-color:rgb(255, 255, 224);z-index:1;position:static;border:1px dotted rgb(153, 153, 153);max-width:50vw;min-width:30vw;min-height:10vh;max-height:90vh;overflow:auto;width:50vw;height:20vh;margin:1rem 0px;padding:0px 8px 19px;resize:both;}","#logBox.visible .legend{position:absolute;}","#logBox .legend{text-align:center;margin-top:-1em;width:inherit;max-width:inherit;}","#logBox .legend div{text-align:center;display:inline-block;max-width:inherit;height:1.2rem;background-color:rgb(119, 119, 119);padding:2px 10px;color:rgb(255, 255, 255);box-shadow:rgb(119 119 119) 2px 1px 10px;border-radius:4px;}","#logBox .legend div:before{content:'JQx Logging (chronological)';}","#logBox .legend.reversed div:before{content:'JQx Logging (reversed)';}","#logBox #jqx_logger{marginTop:0.7rem;lineHeight:1.4em;font-family:consolas,monospace;whiteSpace:pre-wrap;maxWidth:inherit;padding-left:100px;}","#logBox #jqx_logger div.entry{text-indent:-100px;whiteSpace:normal;}"]}function nt(){return["::backdrop{background-color:grey;opacity:0.2;}",`#jqxPopup{overflow:hidden;background-color:transparent;outline:none;border:none;inset:0;animation:fade-out 0.5s ease-out;&[open]{display:flex;align-items:center;justify-content:center;animation:fade-in 0.5s ease;}#jqxPopupContent{background-color:white;border:solid 1px #eee;box-shadow:1px 2px 8px #999;border-radius:4px;padding:12px;vertical-align:middle;max-height:40vh;max-width:50vw;overflow:auto;margin:0 auto;div:not(#closeHandleIcon){clear:both;}@media (width <= 640px){max-width:80vw;max-height:60vh;}#closeHandleIcon{cursor:pointer;width:24px;height:24px;display:inline;position:absolute;top:4px;right:4px;justify-content:right;background-image:url("data:image/svg+xml;utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20version%3D%221.1%22%20id%3D%22Layer_1%22%20x%3D%220px%22%20y%3D%220px%22%20viewBox%3D%220%200%20128%20128%22%20style%3D%22enable-background%3Anew%200%200%20128%20128%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Crect%20x%3D%22-368%22%20y%3D%226%22%20style%3D%22display%3Anone%3Bfill%3A%23E0E0E0%3B%22%20width%3D%22866%22%20height%3D%221018%22%2F%3E%3Ccircle%20style%3D%22fill%3A%23FFFFFF%3B%22%20cx%3D%2264%22%20cy%3D%2264%22%20r%3D%2248%22%2F%3E%3Ccircle%20style%3D%22fill%3A%238CCFB9%3B%22%20cx%3D%2264%22%20cy%3D%2264%22%20r%3D%2239%22%2F%3E%3Ccircle%20style%3D%22fill%3Anone%3Bstroke%3A%23444B54%3Bstroke-width%3A6%3Bstroke-miterlimit%3A10%3B%22%20cx%3D%2264%22%20cy%3D%2264%22%20r%3D%2248%22%2F%3E%3Cpolyline%20style%3D%22fill%3Anone%3Bstroke%3A%23FFFFFF%3Bstroke-width%3A6%3Bstroke-linecap%3Around%3Bstroke-miterlimit%3A10%3B%22%20points%3D%2242%2C69%2055.55%2C81%20%20%2086%2C46%20%22%2F%3E%3C%2Fsvg%3E");@media (width <= 640px){background-image:none;position:relative;margin:-15px -15px 4px 0;float:right;vertical-align:middle;border:1px solid #AAA;padding:2px;border-radius:50%;width:12px;height:12px;font-size:12px;line-height:12px;font-weight:bold;text-align:center;&:after{content:'\\2714';color:green;}}}.warn{display:none;text-align:center;color:red;border-top:1px solid #999;margin-top:1em;padding-top:3px;animation:warn-fade-out 0.2s ease-out;}.warn.active{opacity:1;display:block;animation:warn-fade-in 0.2s ease-in;}}}`,"@keyframes fade-in{0%{opacity:0;transform:scale(0, 0);display:none;}100%{opacity:1;transform:scale(1, 1);display:flex;}}","@keyframes fade-out{0%{opacity:1;transform:scale(1, 1);display:flex;}100%{opacity:0;transform:scale(0, 0);display:none;}}","@keyframes warn-fade-in{0%{opacity:0;transform:scale(0, 0);display:none;}100%{opacity:1;transform:scale(1,1 );display:block;}}","@keyframes warn-fade-out{0%{opacity:1;transform:scale(1, 1);display:block;}100%{opacity:0;transform:scale(0, 0);display:none;}}"]}var ae=!1,ot={on:()=>ae=!0,off:()=>ae=!1},M={tagsRaw:Z,allowUnknownHtmlTags:ot,isAllowed(e){if(ae)return!0;let t=a(e,String)?e.toLowerCase():e?.nodeName.toLowerCase()||"none";return t==="#text"||!!Z[t]},allowTag:e=>Z[e.toLowerCase()]=!0,prohibitTag:e=>Z[e.toLowerCase()]=!1};var fe=!1,X=!1,W=!0,de=!1,it=!0,Ce,Q=()=>h("#logBox"),$e="#jqx_logger",lt=e=>{se?.forEach(t=>e(t))},st=()=>{se&<(Ce);let e=it?"div":"pre",t=`<div id="logBox"><div class="legend"><div></div></div><${e} id="jqx_logger"></${e}></div>`;return me(H(t),void 0,F.AfterBegin),h.node($e)},Le=e=>a(e,String)&&Object.assign(document.createElement("textarea"),{innerHTML:e}).textContent||e,D=(...e)=>{let t=e[0]==="fromStatic";if(e=t?e.slice(1):e,t&&!X)return e.forEach(n=>console.info(`${q()} \u2714 ${Le(n)}`));if(!X)return;!W&&!h.node("#logBox")&&(Ce=h.createStyle("JQxLogCSS"),st());let r=n=>`${a(n,Object)?JSON.stringify(n,null,2):n}
|
|
2
|
+
`;e.forEach(n=>W?console.info(`${q()} \u2714 ${Le(n)}`):h.node("#jqx_logger").insertAdjacentHTML(de?"afterbegin":"beforeend",`<div class="entry">${q()} ${r(n.replace(/\n/g,"<br>"))}</div>`))},ce={on(){X=!0,D("Logging activated")},off(){X=!1,console.log("Logging deactivated")}},ue={on(){fe=!0},off(){fe=!1}},N=(...e)=>fe&&D(...e),$={get isConsole(){return W===!0},get isOn(){return X},isVisible:function(){return h("#jqx_logger").is("visible")},on(){return ce.on(),ue.on(),W||Q()?.addClass("visible"),D("Debug logging started. Every call to [jqx instance] is logged"),$},off(){return Q().isEmpty||(ue.off(),D("Debug logging stopped"),Q()?.removeClass("visible")),ce.off(),$},toConsole:{on(){return W=!0,D("Started logging to console"),$},off(){return D("Stopped logging to console (except error messages)"),W=!1,$}},remove(){return ce.off(),ue.off(),Q()?.remove(),console.clear(),console.log(`${q()} logging completely disabled and all entries removed`),$},log:function(...e){return D(...e),$},hide(){return Q()?.removeClass("visible"),$},show:()=>(Q()?.addClass("visible"),$),get reversed(){return{on:()=>(de=!0,D("Reverse logging set: now logging bottom to top (latest first)"),h("#logBox .legend").addClass("reversed"),$),off:()=>(de=!1,h("#logBox .legend").removeClass("reversed"),D("Reverse logging reset: now logging chronological (latest last)"),$)}},clear(){return h($e).text(""),console.clear(),D("Logging cleared"),$}};var at=ct(),Te={html:"innerHTML",text:"textContent",class:"className"},ge=at;function ct(){let e={get(t,r){let n=String(r)?.toLowerCase();switch(!0){case n in t:return t[n];case ht(n):return Fe(t,n,r);default:return Fe(t,n,r,!0)}},enumerable:!1,configurable:!1};return new Proxy({},e)}function Fe(e,t,r,n=!1){return Object.defineProperty(e,t,{get(){return n?i=>yt(r):xt(t)}}),e[t]}function ut(e,t,r){return t=t?.isJQx&&t.first()||t,ye({trial:n=>bt(t)?e.append(t):De(t)?e.insertAdjacentHTML("beforeend",t):e.append(t),whenError:n=>console.info(`${r} (for root ${e}) not created, reason
|
|
3
|
+
`,n)})}function ft(e,t,...r){let n=dt(t,e);return r?.forEach(i=>ut(n,i,e)),n}function dt(e,t){switch(e=pe(t)?pt(e):e?.isJQx?e.first():e,!0){case a(e,String):return Y(t,De(e,t)?{html:e}:{text:e});case a(e,Node):return gt(t,e);default:return Y(t,e)}}function mt(e){return delete e.data,Object.keys(e).length<1||Object.keys(e).forEach(t=>{let r=t.toLowerCase();r in Te&&(e[Te[r]]=e[t],delete e[t])}),e}function gt(e,t){let r=Y(e);return r.append(t),r}function Y(e,t={}){t=Ae(t,{});let r=Object.entries(t.data??{}),n=Object.assign(pe(e)?new Comment(t?.text):document.createElement(e),mt(t));return r.length&&r.forEach(([i,s])=>n.dataset[i]=String(s)),n}function Ae(e,t){return t?a(e,{isTypes:Object,notTypes:[Array,null,NaN,Proxy],defaultValue:t}):a(e,{isTypes:Object,notTypes:[Array,null,NaN,Proxy]})}function pt(e){return Ae(e)?e?.text??e?.textContent??"":String(e)}function yt(e){return Y("b",{style:"color:red",text:`'${e}' is not a valid HTML-tag`})}function De(e,t){return!pe(t)&&a(e,String)&&/<.*>|&[#|0-9a-z]+[^;];/i.test(e)}function bt(e){return e?.constructor===Comment||e?.constructor===CharacterData}function pe(e){return e?.constructor===Comment||/comment/i.test(e)}function ht(e){return!a(Y(e),HTMLUnknownElement)}function xt(e){return(t,...r)=>ft(e,t,...r)}var{IS:a,maybe:ye,$Wrap:Sr,xProxy:vr,isNothing:Er}=St();function St(){Symbol.proxy=Symbol.for("toa.proxy"),Symbol.is=Symbol.for("toa.is"),Symbol.type=Symbol.for("toa.type"),Symbol.isSymbol=Symbol.for("toa.isASymbol"),y();let e=T(),[t,r]=[d(),C()];return r.custom(),{IS:n,maybe:e,$Wrap:t,isNothing:E,xProxy:r};function n(o,...l){if(e({trial:u=>"isTypes"in(l?.[0]??{})})){let u=l[0];return"defaultValue"in u?g(o,u):"notTypes"in u?m(o,u):n(o,...[u.isTypes].flat())}let c=typeof o=="symbol"?Symbol.isSymbol:o;return l.length>1?x(c,...l):s(o,...l)}function i(o){return o?.[Symbol.proxy]??n(o)}function s(o,...l){let{noInput:c,noShouldbe:u,compareTo:S,inputCTOR:A,isNaN:P,isInfinity:I,shouldBeFirstElementIsNothing:R}=v(o,...l);switch(l=l.length&&l[0],!0){case R:return String(o)===String(S);case(o?.[Symbol.proxy]&&u):return o[Symbol.proxy];case P:return u?"NaN":e({trial:B=>String(S)})===String(o);case I:return u?"Infinity":e({trial:B=>String(S)})===String(o);case c:return u?String(o):String(S)===String(o);case A===Boolean:return l?A===l:"Boolean";default:return L(o,l,u,p(o,A))}}function p(o,l){return o===0?Number:o===""?String:o?l:{name:String(o)}}function v(o,...l){let c=l.length<1,u=!c&&l[0],S=!c&&E(l[0]),A=o==null,P=!A&&Object.getPrototypeOf(o)?.constructor,I=e({trial:B=>String(o)})==="NaN",R=e({trial:B=>String(o)})==="Infinity";return{noInput:A,noShouldbe:c,compareTo:u,inputCTOR:P,isNaN:I,isInfinity:R,shouldBeFirstElementIsNothing:S}}function L(o,l,c,u){switch(!0){case(!c&&l===o||o?.[Symbol.proxy]&&l===Proxy):return!0;case e({trial:S=>String(l)})==="NaN":return String(o)==="NaN";case(o?.[Symbol.toStringTag]&&n(l,String)):return String(l)===o[Symbol.toStringTag];default:return l?e({trial:S=>o instanceof l})||l===u||l===Object.getPrototypeOf(u)||`${l?.name}`===u?.name:o?.[Symbol.toStringTag]&&`[object ${o?.[Symbol.toStringTag]}]`||u?.name||String(u)}}function x(o,...l){return l.some(c=>n(o,c))}function E(o,l=!1){let c=o==null;return c=l?c||n(o,1/0)||n(o,NaN):c,c}function T(){let o=(l,c)=>l?.constructor===Function?l(c):void 0;return function({trial:l,whenError:c=()=>{}}={}){try{return o(l)}catch(u){return o(c,u)}}}function d(){return function(o){return Object.freeze({get value(){return o},get[Symbol.type](){return i(o)},get type(){return i(o)},[Symbol.is](...l){return n(o,...l)},is(...l){return n(o,...l)}})}}function g(o,{defaultValue:l,isTypes:c=[void 0],notTypes:u}={}){return c=c?.constructor!==Array?[c]:c,u=u&&u?.constructor!==Array?[u]:[],u.length<1?n(o,...c)?o:l:m(o,{isTypes:c,notTypes:u})?o:l}function m(o,{isTypes:l=[void 0],notTypes:c=[void 0]}={}){return l=l?.constructor!==Array?[l]:l,c=c?.constructor!==Array?[c]:c,n(o,...l)&&!n(o,...c)}function y(){Object.getOwnPropertyDescriptors(Object.prototype)[Symbol.is]||(Object.defineProperties(Object.prototype,{[Symbol.type]:{get(){return i(this)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(...o){return n(this,...o)},enumerable:!1,configurable:!1}}),Object.defineProperties(Object,{[Symbol.type]:{value(o){return i(o)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(o,...l){return n(o,...l)},enumerable:!1,configurable:!1}}))}function f(o){let l=String(Object.getPrototypeOf(o)?.constructor);return l.slice(l.indexOf("ion")+3,l.indexOf("(")).trim()}function b(o){let l=o.set;return o.set=(c,u,S)=>u===Symbol.proxy?c[u]=S:l(c,u,S),o}function C(){let o=Proxy;return{native(){Proxy=o},custom(){Proxy=new o(o,{construct(l,c){for(let S of c)S.set&&(S=b(S));let u=new l(...c);return u[Symbol.proxy]=`Proxy (${f(c[0])})`,u}})}}}}var{IS:ne,maybe:Lr,$Wrap:Cr,xProxy:$r,isNothing:Tr}=vt();function vt(){Symbol.proxy=Symbol.for("toa.proxy"),Symbol.is=Symbol.for("toa.is"),Symbol.type=Symbol.for("toa.type"),Symbol.isSymbol=Symbol.for("toa.isASymbol"),y();let e=T(),[t,r]=[d(),C()];return r.custom(),{IS:n,maybe:e,$Wrap:t,isNothing:E,xProxy:r};function n(o,...l){if(e({trial:u=>"isTypes"in(l?.[0]??{})})){let u=l[0];return"defaultValue"in u?g(o,u):"notTypes"in u?m(o,u):n(o,...[u.isTypes].flat())}let c=typeof o=="symbol"?Symbol.isSymbol:o;return l.length>1?x(c,...l):s(o,...l)}function i(o){return o?.[Symbol.proxy]??n(o)}function s(o,...l){let{noInput:c,noShouldbe:u,compareTo:S,inputCTOR:A,isNaN:P,isInfinity:I,shouldBeFirstElementIsNothing:R}=v(o,...l);switch(l=l.length&&l[0],!0){case R:return String(o)===String(S);case(o?.[Symbol.proxy]&&u):return o[Symbol.proxy];case P:return u?"NaN":e({trial:B=>String(S)})===String(o);case I:return u?"Infinity":e({trial:B=>String(S)})===String(o);case c:return u?String(o):String(S)===String(o);case A===Boolean:return l?A===l:"Boolean";default:return L(o,l,u,p(o,A))}}function p(o,l){return o===0?Number:o===""?String:o?l:{name:String(o)}}function v(o,...l){let c=l.length<1,u=!c&&l[0],S=!c&&E(l[0]),A=o==null,P=!A&&Object.getPrototypeOf(o)?.constructor,I=e({trial:B=>String(o)})==="NaN",R=e({trial:B=>String(o)})==="Infinity";return{noInput:A,noShouldbe:c,compareTo:u,inputCTOR:P,isNaN:I,isInfinity:R,shouldBeFirstElementIsNothing:S}}function L(o,l,c,u){switch(!0){case(!c&&l===o||o?.[Symbol.proxy]&&l===Proxy):return!0;case e({trial:S=>String(l)})==="NaN":return String(o)==="NaN";case(o?.[Symbol.toStringTag]&&n(l,String)):return String(l)===o[Symbol.toStringTag];default:return l?e({trial:S=>o instanceof l})||l===u||l===Object.getPrototypeOf(u)||`${l?.name}`===u?.name:o?.[Symbol.toStringTag]&&`[object ${o?.[Symbol.toStringTag]}]`||u?.name||String(u)}}function x(o,...l){return l.some(c=>n(o,c))}function E(o,l=!1){let c=o==null;return c=l?c||n(o,1/0)||n(o,NaN):c,c}function T(){let o=(l,c)=>l?.constructor===Function?l(c):void 0;return function({trial:l,whenError:c=()=>{}}={}){try{return o(l)}catch(u){return o(c,u)}}}function d(){return function(o){return Object.freeze({get value(){return o},get[Symbol.type](){return i(o)},get type(){return i(o)},[Symbol.is](...l){return n(o,...l)},is(...l){return n(o,...l)}})}}function g(o,{defaultValue:l,isTypes:c=[void 0],notTypes:u}={}){return c=c?.constructor!==Array?[c]:c,u=u&&u?.constructor!==Array?[u]:[],u.length<1?n(o,...c)?o:l:m(o,{isTypes:c,notTypes:u})?o:l}function m(o,{isTypes:l=[void 0],notTypes:c=[void 0]}={}){return l=l?.constructor!==Array?[l]:l,c=c?.constructor!==Array?[c]:c,n(o,...l)&&!n(o,...c)}function y(){Object.getOwnPropertyDescriptors(Object.prototype)[Symbol.is]||(Object.defineProperties(Object.prototype,{[Symbol.type]:{get(){return i(this)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(...o){return n(this,...o)},enumerable:!1,configurable:!1}}),Object.defineProperties(Object,{[Symbol.type]:{value(o){return i(o)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(o,...l){return n(o,...l)},enumerable:!1,configurable:!1}}))}function f(o){let l=String(Object.getPrototypeOf(o)?.constructor);return l.slice(l.indexOf("ion")+3,l.indexOf("(")).trim()}function b(o){let l=o.set;return o.set=(c,u,S)=>u===Symbol.proxy?c[u]=S:l(c,u,S),o}function C(){let o=Proxy;return{native(){Proxy=o},custom(){Proxy=new o(o,{construct(l,c){for(let S of c)S.set&&(S=b(S));let u=new l(...c);return u[Symbol.proxy]=`Proxy (${f(c[0])})`,u}})}}}}var K=Et;function Et({styleSheet:e,createWithId:t}={}){let{tryParseAtOrNestedRules:r,ruleExists:n,checkParams:i,sheet:s,removeRules:p,consider:v,currentSheetID:L}=wt({styleSheet:e,createWithId:t});function x(m,y){if(m&&y.removeProperties){Object.keys(y.removeProperties).forEach(f=>m.style.removeProperty(He(f)));return}Object.entries(y).forEach(([f,b])=>{f=He(f.trim()),b=b.trim();let C;if(/!important/.test(b)&&(b=b.slice(0,b.indexOf("!important")).trim(),C="important"),!CSS.supports(f,b))return console.error(`StylingFactory ${L} error: '${f}' with value '${b}' not supported (yet)`);je(()=>m.style.setProperty(f,b,C),`StylingFactory ${L} (setRule4Selector) failed`)})}function E(m,y,f=s){if(m=m?.trim?.(),!ne(m,String)||!m.length||/[;,]$/g.test(m))return console.error(`StylingFactory ${L} (setRules): [${m||"[no selector given]"}] is not a valid selector`);if(y.removeRule)return p(m);let b=n(m,!0),C=b||f.cssRules[f.insertRule(`${m} {}`,f.cssRules.length||0)];return v(()=>x(C,y),m,b)}function T(m){let y=m.trim().split(/{/,2),f=y.shift().trim();if(!ne(f,String)||!f?.trim()?.length)return console.error(`StylingFactory ${L} (doParse): no (valid) selector could be extracted from rule ${be(m)}`);let b=Dt(y.shift());return je(()=>E(f,b),`StylingFactory ${L} (setRules) failed`)}function d(m){let y=r(m);return y.done?y.existing:T(m)}function g(m,y){return m.trim().startsWith("@media")?d(Lt(m,y)):E(m,y)}return function(m,y={}){return i(m,y)&&(Object.keys(y).length?g(m,y):d(m))}}function wt({styleSheet:e,createWithId:t}){let r="Note: The rule or some of its properties may not be supported by your browser (yet)",n=`for style#${t}`;e=t?i(t):e;function i(d){let g=document.querySelector(`#${d}`)?.sheet;if(g)return g;let m=Object.assign(document.createElement("style"),{id:d});return document.head.insertAdjacentElement("beforeend",m),m.sheet}function s(d){return console.error(`StylingFactory ${n} [rule: ${d}]
|
|
4
|
+
=> @charset, @namespace and @import are not supported here`),{done:!0}}function p(d,g){return[...e.rules].find(m=>g?Oe(m.selectorText||"",d):Tt`${$t(d)}${[..."gim"]}`.test(m.cssText))}function v(d){return/^@charset|@import|namespace/i.test(d.trim())?s(d):d.match(/}/g)?.length>1?{existing:E(d,1),done:!0}:{done:!1}}function L(d){let g=[...e.cssRules].reduce((y,f,b)=>Oe(f.selectorText||"",d)&&y.concat(b)||y,[]),m=g.length;return g.forEach(y=>e.deleteRule(y)),m>0?console.info(`\u2714 Removed ${m} instance${m>1?"s":""} of selector ${d} from ${n.slice(4)}`):console.info(`\u2714 Remove rule: selector ${d} does not exist in ${n.slice(4)}`)}function x(d,g){return d&&ne(d,String)&&d.trim().length>0&&ne(g,Object)||(console.error(`StylingFactory ${n} called with invalid parameters`),!1)}function E(d){d=d.trim();let g=d.slice(0,d.indexOf("{")).trim(),m=!!p(g);try{return e.insertRule(`${d}`,e.cssRules.length),m}catch(y){return console.error(`StylingFactory ${n} (tryParse) ${y.name} Error:
|
|
5
|
+
${y.message}
|
|
6
|
+
Rule: ${be(d)}
|
|
7
|
+
${r}`),m}}function T(d,g,m){try{return d(),m}catch(y){return console.error(`StylingFactory ${n} (tryAddOrModify) ${y.name} Error:
|
|
8
|
+
${y.message}
|
|
9
|
+
Rule: ${be(g)}
|
|
10
|
+
${r}`),m}}return{sheet:e,removeRules:L,tryParseAtOrNestedRules:v,ruleExists:p,checkParams:x,tryParse:E,consider:T,currentSheetID:n}}function Lt(e,t){return`${e.trim()} ${Object.entries(t).map(([r,n])=>`${r}: { ${Ct(n)}`)}`}function be(e){let t=(e||"NO RULE").trim().slice(0,50).replace(/\n/g,"\\n").replace(/\s{2,}/g," ");return e.length>t.length?`${t.trim()}...truncated`:t}function Ct(e){return Object.entries(e).map(([t,r])=>`${t}: ${r.trim()}`).join(`;
|
|
11
|
+
`)}function $t(e){return e.replace(/([*\[\]()-+{}.$?\\])/g,t=>`\\${t}`)}function Tt(e,...t){let r=t.length&&Array.isArray(t.slice(-1))?t.pop().join(""):"";return new RegExp((t.length&&e.raw.reduce((n,i,s)=>n.concat(t[s-1]||"").concat(i),"")||e.raw.join("")).split(`
|
|
12
|
+
`).map(n=>n.replace(/\s|\/\/.*$/g,"").trim().replace(/(@s!)/g," ")).join(""),r)}function He(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`).replace(/[^--]^-|-$/,"")}function je(e,t){try{return e()}catch(r){console.error(`${t||"an error occured"}: ${r.message}`)}}function Ft(e){return e.replace(/\/\*.+?\*\//gm,"").replace(/[}{\r\n]/g,"").replace(/(data:.+?);/g,(t,r)=>`${r}\\3b`).split(";").map(t=>t.trim()).join(`;
|
|
13
|
+
`).replaceAll("\\3b",";").split(`
|
|
14
|
+
`)}function At(e){return e.reduce((t,r)=>{let[n,i]=[r.slice(0,r.indexOf(":")).trim(),r.slice(r.indexOf(":")+1).trim().replace(/;$|;.+(?=\/*).+\/$/,"")];return n&&i?{...t,[n]:i}:t},{})}function Dt(e){return At(Ft(e))}function Oe(e,t){return e?.replace("::",":")===t?.replace("::",":")}var Ht=[...Array(26)].map((e,t)=>String.fromCharCode(t+65)).concat([...Array(26)].map((e,t)=>String.fromCharCode(t+97))).concat([...Array(10)].map((e,t)=>`${t}`)),oe=(e,t=2)=>`${e}`.padStart(t,"0"),jt=(e,t=0)=>([e,t]=[Math.floor(e),Math.ceil(t)],Math.floor([...crypto.getRandomValues(new Uint32Array(1))].shift()/2**32*(e-t+1)+t)),Ot=e=>{let t=e.length;for(;t--;){let r=jt(t);[e[t],e[r]]=[e[r],e[t]]}return e};var j=(e,t=120)=>`${e}`.trim().slice(0,t).replace(/>\s+</g,"><").replace(/</g,"<").replace(/\s{2,}/g," ").replace(/\n/g,"\\n")+(e.length>t?" …":"").trim(),O=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`).replace(/^-|-$/,""),Mt=([e,...t])=>`${e.toUpperCase()}${t.join("")}`,ee=e=>a(e,String)?e.toLowerCase().split("-").map((t,r)=>r&&`${Mt(t)}`||t).join(""):e,z=()=>`_${Ot(Ht).slice(0,8).join("")}`,ie=(e,t=120)=>j(e,t).replace(/</g,"<"),q=()=>(e=>`[${oe(e.getHours())}:${oe(e.getMinutes())}:${oe(e.getSeconds())}.${oe(e.getMilliseconds(),3)}]`)(new Date);var _=e=>e.replace(/</g,"<");function Me(){let e=function(s){if(!s)return;let p=s.style,v=getComputedStyle(s),L=[p.visibility,v.visibility].includes("hidden"),x=[p.display,v.display].includes("none"),E=s.offsetTop<0||s.offsetLeft+s.offsetWidth<0||s.offsetLeft>document.body.offsetWidth,T=+v.opacity==0||+(p.opacity||1)==0;return!(E||T||x||L)},t="n/a",r=function(s){return s.parentNode?!!h.nodes(":is(:read-write)",s?.parentNode)?.find(p=>p===s):!1},n=function(s){return s.parentNode?!!h.nodes(":is(:modal)",s?.parentNode)?.find(p=>p===s):!1},i={notInDOM:!0,writable:t,modal:t,empty:!0,open:t,visible:t};return s=>{let p=s.node;return p?{get writable(){return r(p)},get modal(){return n(p)},get inDOM(){return p.isConnected},get open(){return p.open??!1},get visible(){return e(p)},get disabled(){return p.hasAttribute("readonly")||p.hasAttribute("disabled")},get empty(){return s.collection.length<1},get virtual(){return s.isVirtual}}:i}}var Nt=!0,le={data:/data-[\-\w.\p{L}]/ui,validURL:/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,whiteSpace:/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g,notAllowedValues:/javascript|injected|noreferrer|alert|DataURL/gi},Pt=e=>{if(Nt&&Object.keys(e.removed).length){let t=Object.entries(e.removed).reduce((r,[n,i])=>[...r,`${_(n)} => ${i}`],[]).join("\\000A");$.log(`JQx HTML creation errors: ${$.isConsole?t:_(t)}`)}},It=function(e){let t=e.nodeName.toLowerCase(),r=["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"];return/-/.test(t)&&!r.find(n=>n===t)||M.isAllowed(t)},te=e=>{let t={rawHTML:e?.parentElement?.getHTML()??"no html",removed:{}};return a(e,HTMLElement)&&[...e.childNodes].forEach(r=>{if(r?.children?.length&&te(r),r?.attributes){let i=a(r,SVGElement)?J.svg:J.html;[...(r??{attributes:[]}).attributes].forEach(s=>{let p=s.name.trim().toLowerCase(),v=s.value.trim().toLowerCase().replace(le.whiteSpace,""),L=p==="href"?!le.validURL.test(v):le.notAllowedValues.test(v),x=p.startsWith("data")?!le.data.test(p):!!i[p];if(L||x){let E=ie(s.value||"none",60);E+=E.length===60?"...":"",t.removed[`${s.name}`]=`attribute/property (-value) not allowed, removed. Value: ${E}`,r.removeAttribute(s.name)}})}if(!(It(r)||r.constructor===CharacterData||r.constructor===Comment)){let i=(r?.outerHTML||r?.textContent).trim(),s=ie(i,60)??"EMPTY";s+=s.length===60?"...":"",t.removed[`<${r.nodeName?.toLowerCase()}>`]=`not allowed, not rendered. Value: ${s}`,r.remove()}}),Pt(t),e};var F=new Proxy({start:"afterbegin",afterbegin:"afterbegin",end:"beforeend",beforeend:"beforeend",before:"beforebegin",beforebegin:"beforebegin",after:"afterend",afterend:"afterend"},{get(e,t){return e[String(t).toLowerCase()]??e[t]}}),Rt=e=>{let t=document.createElement("div");return t.insertAdjacentHTML(F.end,e),t.childNodes.length?te(t):void 0},Bt=(e,t,r)=>a(e,Comment)?t.insertAdjacentHTML(r,`<!--${e.data}-->`):t.insertAdjacentText(r,e.data),U=(e=[],t=document.body,r=F.BeforeEnd)=>e.reduce((n,i)=>{let s=re(i)&&me(i,t,r);return s?[...n,s]:n},[]),me=(e,t=document.body,r=F.BeforeEnd)=>(t=t?.isJQx?t?.[0]:t,a(e,Comment,Text)?Bt(e,t,r):t.insertAdjacentElement(r,e)),H=e=>{if(a(e,Text,Comment))return e;let t=e?.trim(),r=t?.split(/<text>|<\/text>/i)??[];if(r?.length&&(r=r.length>1?r.filter(i=>i.length).shift():void 0),t.startsWith("<!--")&&t.endsWith("-->"))return document.createComment(e.replace(/<!--|-->$/g,""));if(r||!/^<(.+)[^>]+>/m.test(t))return document.createTextNode(r);let n=Rt(e);return n.childNodes.length<1?H(`<span data-jqxcreationerror="1">${j(e,60)}</span>`):n.children[0]};var w=(e,t)=>{let r=e.collection.filter(n=>!ke(n));for(let n=0;n<r.length;n+=1)t(r[n],n);return e},kt=Me(),Ne=e=>e&&(e.textContent="");var V=e=>{let t=e.cloneNode(!0);return t.removeAttribute&&t.removeAttribute("id"),e.isConnected?e.remove():e=null,t},Re=(e,t)=>{e&&a(t,Object)&&Object.entries(t).forEach(([r,n])=>e.setAttribute(`data-${O(r)}`,n))},Pe=(e,t)=>e.andThen(t,!0),Ie=(e,t)=>e.andThen(t),Be=e=>e.startsWith("data")||J.html.find(t=>e.toLowerCase()===t),Jt=(e,t,r)=>{r&&a(t,String)&&(t={[t]:r==="-"?"":r});let n;t.className&&(n=t.className,delete t.className),n=[...e.classList].find(s=>s.startsWith("JQxClass-")||n&&s===n)||n||`JQxClass-${z().slice(1)}`,h.editCssRule(`.${n}`,t),e.classList.add(n)},Qt=(e,t)=>{e&&Object.entries(t).forEach(([r,n])=>{if(r=O(r),r.startsWith("data"))return Re(e,n);a(n,String)&&Be(r)&&e.setAttribute(r,n.split(/[, ]/)?.join(" "))})},he=(e,t)=>{a(t,Object)&&Object.entries(t).forEach(([r,n])=>{let i;/!important/i.test(n)&&(n=n.slice(0,n.indexOf("!")).trim(),i="important"),e.style.setProperty(O(r),n,i)})},Wt={get(e,t){return e[ee(t)]||e[t]},enumerable:!1,configurable:!1},qt=(...e)=>{$.log("\u2757"+e.map(t=>String(t)).join(", "))},xe=(e,t=0,r=!0)=>(e=e?.parentElement,t+=e?e[r?"scrollTop":"scrollLeft"]:0,e?xe(e,t,r):t),Se={factoryExtensions:{data:e=>({get all(){return new Proxy(e[0]?.dataset??{},Wt)},set:(t={})=>(!e.is.empty&&a(t,Object)&&Object.entries(t).forEach(([r,n])=>e.setData({[r]:n})),e),get:(t,r)=>e.data.all[t]??r,add:(t={})=>(!e.is.empty&&a(t,Object)&&Object.entries(t).forEach(([r,n])=>e.setData({[r]:n})),e),remove:t=>(e[0]?.removeAttribute(`data-${O(t)}`),e)}),dimensions:e=>{if(e.is.empty)return{error:"[instance].dimensions: NO ELEMENTS"};let t=e[0],r=e.first()?.getBoundingClientRect().toJSON();return r.scrollTopDistance=xe(t,0),r.scrollLeftDistance=xe(t,0,!1),r},node:e=>e[0],HTML:e=>({get:(t,r)=>{if(e.is.empty)return"NO ELEMENTS IN COLLECTION";let n=t?e.outerHtml:e.html();return r?_(n):n},set:(t,r=!1,n=!1)=>{t=t.isJQx?t.HTML.get(1):t;let i=a(t,String);return t=i&&n?_(t):t,i&&(t||"").trim().length&&e.html(t,r),e},replace:(t,r=!1)=>e.HTML.set(t,!1,r),append:(t,r=!1)=>(t=a(t,HTMLElement)?h(t).HTML.get(1):t.isJQx?t.HTML.get(1):t,e.HTML.set(t,!0,r)),insert:(t,r=!1)=>(t=a(t,HTMLElement)?h(t).HTML.get(1):t.isJQx?t.HTML.get(1):t,e.HTML.set(t+e.HTML.get(),!1,r))}),is:e=>kt(e),length:e=>e.collection.length,outerHtml:e=>(e.first()||{outerHTML:void 0}).outerHTML,parent:e=>{let t=h(e[0]?.parentNode);return t.is.empty?e:t},render:e=>(!e.is.empty&&e.toDOM()||h.log("[JQx.render]: empty collection"),e),Style:e=>({get computed(){return e.is.empty?{}:getComputedStyle(e[0])},inline:t=>e.style(t),inSheet:t=>e.css(t),valueOf:t=>e.is.empty?void 0:getComputedStyle(e[0])[O(t)],nwRule:t=>e.Style.byRule({rules:t}),byRule:({classes2Apply:t=[],rules:r=[]}={})=>{let i=a(r,String)&&!t.length?r.split("{")[0].trim():"";return r=r&&a(r,String)?[r]:r,t=t&&a(t,String)?[t]:t,(r?.length||t?.length)&&(r?.length&&h.editCssRules(...r),t?.forEach(s=>e.addClass(s))),i?.startsWith(".")&&e.addClass(i.slice(1)),i?.startsWith("#")&&!e.attr("id")&&e.prop({id:i.slice(1)}),e}})},instanceExtensions:{addClass:(e,...t)=>w(e,r=>r&&t.forEach(n=>r.classList.add(n))),after:Ie,afterMe:Ie,andThen:(e,t,r=!1)=>{if(!t||!a(t,String,Node,Proxy))return qt(`[JQx instance].[beforeMe | afterMe | andThen]: insufficient input [${t}]`),e;t=t?.isJQx?t.collection:a(t,Node)?h.virtual(t).collection:h.virtual(H(t)).collection;let[n,i,s]=r?[0,"before",t.concat(e.collection)]:[e.collection.length-1,"after",e.collection.concat(t)];return e[n][i](...t),e.collection=s,e},append:(e,...t)=>{if(!e.is.empty&&t.length){let r=e.length===1;for(let n of t){if(!n.isJQx&&a(n,String)){let i=n.trim(),p=!/^<(.+)[^>]+>$/m.test(i)?h.text(n):H(n);w(e,v=>v.append(r?p:V(p)))}re(n)&&w(e,i=>i.append(r?n:V(n))),n.isJQx&&!n.is.empty&&w(e,i=>n.collection.forEach(s=>i.append(r?s:V(s))))}}return e},appendTo:(e,t)=>(t.isJQx||(t=h(t)),t.append(e),e),attr:(e,t,r)=>{let n=e[0];if(!n)return e;if(!r&&a(t,String))return t=O(t),t==="class"?[...n?.classList].join(" "):n?.getAttribute(t);if(a(t,String)&&r)switch(t=O(t),!0){case t.startsWith("data-"):t={data:{[t.replace("data-","")]:r}};break;default:t={[t]:r}}return a(t,Object)&&!e.is.empty&&Qt(n,t),e},before:Pe,beforeMe:Pe,clear:e=>w(e,Ne),closest:(e,t)=>{let r=a(t,String)?e[0].closest(t):null;return r?h(r):e},computedStyle:(e,t)=>e.first()&&getComputedStyle(e.first())[t],css:(e,t,r)=>w(e,n=>Jt(n,t,r)),duplicate:(e,t=!1,r=document.body)=>{let n=e.toNodeList().map(s=>s.removeAttribute&&s.removeAttribute("id")||s),i=h.virtual(n);return t?i.toDOM(r):i},each:(e,t)=>w(e,t),empty:e=>w(e,Ne),find:(e,t)=>e.collection.length>0?[...e.first()?.querySelectorAll(t)]:[],find$:(e,t)=>e.collection.length>0?h(t,e):e,first:(e,t=!1)=>{if(e.collection.length>0)return t?e.single():e.collection[0]},first$:(e,t)=>e.single(t),getData:(e,t,r)=>e.first()&&e.first().dataset?.[t]||r,hasClass:(e,...t)=>{let r=e[0];return!r||!r.classList.length?!1:t.find(n=>r.classList.contains(n))&&!0||!1},hide:e=>w(e,t=>he(t,{display:"none !important"})),html:(e,t,r)=>{if(t===void 0)return e[0]?.getHTML();if(!e.isEmpty()){let n=H(`<div>${t.isJQx?t.HTML.get(!0):t}</div>`);if(!a(n,Comment))return w(e,s=>(r||(s.textContent=""),s.insertAdjacentHTML(h.at.end,n.getHTML())))}return e},htmlFor:(e,t,r="",n=!1)=>{if(t&&e.collection.length){if(!t||!a(r,String))return e;let i=e.find$(t);if(i.length<1)return e;let s=H(`<span>${r}</span>`);i.each(p=>{n||(p.textContent=""),p.insertAdjacentHTML(h.at.end,s.getHTML())})}return e},isEmpty:e=>e.collection.length<1,nth$:(e,t)=>e.single(t),on:(e,t,...r)=>(e.collection.length&&r?.forEach(n=>{let i=Je(e);h.delegate(t,i,n)}),e),prepend:(e,...t)=>{if(!e.is.empty&&t){let r=e.length===1;for(let n of t){if(a(n,String)){n=n.trim();let s=!/^<(.+)[^>]+>$/m.test(n)?h.text(n):H(n);s=r?s:V(s),w(e,p=>p.prepend(s.cloneNode(!0)))}re(n)&&w(e,i=>i.prepend(r?n:V(n))),n.isJQx&&!n.is.empty&&(n.collection.length>1&&n.collection.reverse(),w(e,i=>w(n,s=>i.prepend(r?s:V(s)))),n.collection.reverse())}}return e},prependTo:(e,t)=>(t.isJQx||(t=h.virtual(t)),t.prepend(e),e),prop:(e,t,r)=>{if(a(t,String)&&!r)return t.startsWith("data")?e[0]?.dataset[t.slice(t.indexOf("-")+1)]:e[0]?.[t];let n=a(t,Object)?t:{[t]:r};return Object.entries(n).forEach(([i,s])=>{if(i=i.trim(),s&&!Be(i)||!s)return!1;if(i.toLowerCase()==="id")return e[0].id=s;w(e,v=>{if(i.startsWith("data"))return v.dataset[i.slice(i.indexOf("-")+1)]=s;v[i]=s})}),e},remove:(e,t)=>{N(`remove ${j(e.HTML.get(1),40)}${t?` /w selector ${t}`:""}`);let r=i=>i.remove(),n=()=>e.collection=e.collection.filter(i=>document.documentElement.contains(i));if(t){let i=e.find$(t);return i.is.empty||(w(i,r),n()),e}return w(e,r),n(),e},rmAttr:(e,...t)=>(t.forEach(r=>e.node.removeAttribute(r)),e),removeClass:(e,...t)=>w(e,r=>r&&t.forEach(n=>r.classList.remove(n))),renderTo:(e,t=document.body,r=h.insertPositions.end)=>(e.toDOM(t,r),e),replace:(e,t,r)=>{let n=e[0];return!t||!r||!a(r,HTMLElement)&&!r.isJQx?(console.error("JQx replace: invalid replacement value"),e):(r.isJQx&&(r=r[0]),a(r,NodeList)&&(r=r[0]),n&&t&&(t=a(t,String)?n.querySelectorAll(t):t.isJQx?t.collection:t,a(t,HTMLElement,NodeList,Array)&&a(r,HTMLElement)&&(a(t,HTMLElement)?[t]:[...t]).forEach(i=>i.replaceWith(r.cloneNode(!0)))),e)},replaceClass:(e,t,...r)=>w(e,n=>{n.classList.remove(t),r.forEach(i=>n.classList.add(i))}),replaceMe:(e,t)=>e.replaceWith(t),replaceWith:(e,t)=>(t=a(t,Element)?t:t.isJQx?t[0]:void 0,t&&(e[0].replaceWith(t),e=h.virtual(t)),e),setData:(e,t)=>w(e,r=>Re(r,t)),show:e=>w(e,t=>he(t,{display:"revert-layer !important"})),single:(e,t)=>e.collection.length>0?a(t,String)?e.find$(t):a(t,Number)?h(e.collection[t]):h(e.collection[0]):e,style:(e,t,r)=>w(e,i=>{r&&a(t,String)&&(t={[t]:r||"none"}),he(i,t)}),text:(e,t,r=!1)=>e.isEmpty()?e:a(t,String)?w(e,i=>i.textContent=r?i.textContent+t:t):e.first().textContent,toDOM:(e,t=document.body,r=F.BeforeEnd)=>(e.isVirtual&&(e.isVirtual=!1),e.collection=U(e.collection,t,r),e),toggleClass:(e,t)=>w(e,r=>r.classList.toggle(t)),toNodeList:e=>[...e.collection].map(t=>document.importNode(t,!0)),trigger:(e,t,r=Event,n={})=>{if(e.collection.length){let i=new r(t,{...n,bubbles:n.bubbles??!0});for(let s of e.collection)s.dispatchEvent(i)}return e},val:(e,t)=>{let r=e[0];return!r||!a(r,HTMLInputElement,HTMLSelectElement,HTMLTextAreaElement)?e:t===void 0?r.value:(r.value=a(t,String)?t:"",e)}}};function Qe(e){if(!e("#jqxPopup").isEmpty())return;e.dialog({id:"jqxPopup"},e.div({id:"jqxPopupContent"})).render,e.editCssRules(...we);let[t,r]=[e("#jqxPopupContent"),e.node("#jqxPopup")],n={};return["click","keydown"].forEach(d=>document.addEventListener(d,x,!0)),Object.freeze({show:i,removeModal:L});function i(d){if(r.open)return;n={...d};let{content:g}=n;return e.IS(g,String,HTMLElement)||g?.isJQx?p():!0}function s(){return n.modal?T(n.warnMessage):v()}function p(){t.clear();let{content:d,modal:g,closeAfter:m}=n;g=e.IS(g,Boolean)?g:!1;let y=g?"":e.div({id:"closeHandleIcon"});t.append(y,e.IS(d,String)?e.div(d):d),r.showModal(),!g&&e.IS(m,Number)&&E(s,m)}function v(){return r.close(n.returnValue),e.IS(n.callback,Function)?n.callback(n.returnValue):!0}function L({callback:d,value:g}={}){n.returnValue=g,n.modal=!1,n.callback=d||n.callback,s()}function x(d){n.activeTimer&&clearTimeout(n.activeTimer);let g=d.key==="Escape";return g&&d.preventDefault(),(g||d.target.closest("#closeHandleIcon")||d.type!=="keydown"&&!d.target.closest("#jqxPopupContent"))&&s(),document.activeElement.blur()}function E(d,g){e.IS(d,Function)&&e.IS(g,Number)&&g>0&&(n.activeTimer=setTimeout(d,g*1e3))}function T(d){if(!e.IS(d,String,HTMLElement,Proxy))return;let g=t.find$(".warn");switch(!0){case g.is.empty:g=e.div({class:"warn"},d);default:t.append(g.addClass("active")),E(()=>t.find$(".warn").removeClass("active"),2)}}}var k={},zt=["load","unload","scroll","focus","blur","DOMNodeRemovedFromDocument","DOMNodeInsertedIntoDocument","loadstart","progress","error","abort","load","loadend","pointerenter","pointerleave","readystatechange"],_t=e=>!!zt.find(t=>t===e),We=()=>{let e=n=>k[n.type].forEach(i=>i(n)),t=(n,i)=>s=>{let p=s.target?.closest?.(n);return p&&i(s,h(p))},r=(n,i)=>{k[n]||addEventListener(n,e,_t(n))};return(n,i,s,p=!1)=>{r(n,p);let v=i?t(i,s):s;k=k[n]?{...k,[n]:k[n].concat(v)}:{...k,[n]:[v]}}};var Ut={},{instanceMethods:qe,instanceGetters:ze,isCommentOrTextNode:ke,isNode:re,isHtmlString:Ue,isArrayOfHtmlElements:Ve,isArrayOfHtmlStrings:Ge,ElemArray2HtmlString:Ze,input2Collection:Xe,setCollectionFromCssSelector:Ye,addHandlerId:Je,cssRuleEdit:ve,addFn:Vt,elems4Docs:fn}=Gt();function Gt(){let e=K({createWithId:"JQxStylesheet"}),t=(f,b)=>r[f]=(C,...o)=>b(C,...o),r=Se.instanceExtensions,n=Se.factoryExtensions,i=f=>a(f,Comment,Text),s=f=>a(f,Text,HTMLElement,Comment),p=f=>a(f,Comment),v=f=>a(f,Text),L=f=>a(f,String)&&/^<|>$/.test(`${f}`.trim()),x=f=>a(f,Array)&&!f?.find(b=>!L(b)),E=f=>a(f,Array)&&!f?.find(b=>!s(b)),T=f=>f?.filter(b=>b).reduce((b,C)=>b.concat(p(C)?`<!--${C.data}-->`:i(C)?C.textContent:C.outerHTML),""),d=f=>f?a(f,Proxy)?[f.EL]:a(f,NodeList)?[...f]:s(f)?[f]:E(f)?f:f.isJQx?f.collection:void 0:[],g=(f,b,C)=>{let o=b!==document.body&&a(f,String)&&f.toLowerCase()!=="body"?b:document,l;try{C.collection=[...o.querySelectorAll(f)]}catch{l=`Invalid CSS querySelector. [${a(f,String)?f:"Nothing valid given!"}]`}return l??`CSS querySelector "${f}", output ${C.collection.length} element(s)`},m=f=>{let b=f.data.get("hid")||`HID${z()}`;return f.data.add({hid:b}),`[data-hid="${b}"]`},y=Object.entries(M.tagsRaw).filter(([,f])=>f).map(([f])=>f).sort((f,b)=>f.localeCompare(b));return{instanceMethods:r,instanceGetters:n,isCommentOrTextNode:i,isNode:s,isComment:p,isText:v,isHtmlString:L,isArrayOfHtmlElements:E,isArrayOfHtmlStrings:x,ElemArray2HtmlString:T,input2Collection:d,setCollectionFromCssSelector:g,addHandlerId:m,cssRuleEdit:e,addFn:t,elems4Docs:y}}function G(e){return new Proxy(e,{get:(t,r)=>Yt(t,r,e)})}function Zt(e,t){return(...r)=>a(e,Function)&&e(G(t),...r)}function Xt(e,t){return(...r)=>a(e,Function)&&e(G(t),...r)}function Yt(e,t,r){switch(!0){case a(t,Symbol):return e;case a(+t,Number):return e.collection?.[t]||`ELEMENT WITH INDEX ${t} NOT FOUND`;case t in ze:return Xt(ze[t],r)();case t in qe:return Zt(qe[t],r);default:return e[t]}}function Ke(e){let t=ir(e);return Object.entries(Object.getOwnPropertyDescriptors(t)).forEach(([r,n])=>{Object.defineProperty(e,r,n),Object.defineProperty(Ut,r,n)}),e}function Kt(e){return{allow:t=>{let r=/-/.test(t),n=r&&t;t=r?ee(t):t.toLowerCase(),M.allowTag(t),a(e[t],Function)||Object.defineProperties(e,Ee(t,!0,e,n))},prohibit:t=>{t=t.toLowerCase(),M.prohibitTag(t),a(e[t],Function)&&Object.defineProperties(e,Ee(t,!1,e))}}}function _e(...e){if(e.length===1){let t=String(e.shift().trim());e=t.startsWith("!")?[t.slice(1,-1)]:t.split(",").map(r=>r.trim())}e.map(t=>t.startsWith("!")?t.slice(1,-1):t).forEach(t=>ve(t,{removeRule:1}))}function er(e){return function(t,r,...n){return a(r,Function)&&(n.push(r),r=void 0),n.forEach(i=>e(t,r,i))}}function tr(e){return function(t,r,n){r=r?.isJQx?r?.[0]:r,n=n&&Object.values(F).find(s=>n===s)?n:void 0;let i=e(t,document.createElement("br"));return r&&!a(r,HTMLBRElement)&&i.collection.forEach(s=>n?r.insertAdjacentElement(n,s):r.append(s)),i}}function rr(...e){let t={};for(let r of e){let n=Object.getOwnPropertyDescriptors(r);Object.entries(n).forEach(([i,s])=>!(i in t)&&Object.defineProperty(t,i,s))}return t}function nr(e){console.error(`JQx: "${e}" not allowed, not rendered`)}function or(e,t,r,n){return e=O(n||e.toLowerCase()),{get(){return(...i)=>t?r.virtual(te(ge[e](...i))):nr(e)},enumerable:!1,configurable:!0}}function Ee(e,t,r,n){e=e.toLowerCase();let i=or(e,t,r,n);return n?{[n]:i,[ee(n)]:i}:{[e]:i,[e.toUpperCase()]:i}}function ir(e){return rr(Object.entries(M.tagsRaw).reduce(lr(e),{}),sr(e))}function lr(e){return function(t,[r,n]){return n&&Object.defineProperties(t,Ee(r,n,e)),t}}function sr(e){let t=(n,i)=>ve(n,i),r=Kt(e);return{debugLog:$,log:(...n)=>D("fromStatic",...n),insertPositions:F,get at(){return F},editCssRules:(...n)=>n.forEach(i=>ve(i)),editCssRule:t,get setStyle(){return t},delegate:er(We()),virtual:tr(e),get fn(){return Vt},allowTag:r.allow,prohibitTag:r.prohibit,get lenient(){return M.allowUnknownHtmlTags},get IS(){return a},get Popup(){return e.activePopup||Object.defineProperty(e,"activePopup",{value:Qe(e),enumerable:!1}),e.activePopup},popup:()=>e.Popup,createStyle:n=>K({createWithId:n||`jqx${z()}`}),editStylesheet:n=>K({createWithId:n||`jqx${z()}`}),removeCssRule:_e,removeCssRules:_e,text:(n,i=!1)=>i?e.comment(n):document.createTextNode(n),node:(n,i=document)=>i.querySelector(n,i),nodes:(n,i=document)=>[...i.querySelectorAll(n,i)]}}var h=Ke(ar());function ar(){return function(r,n,i=F.BeforeEnd){if(r?.isJQx)return r;let s=a(n,HTMLBRElement);n=(!s&&n&&n.isJQx?n[0]:n)||document.body,i=i&&Object.values(F).find(g=>i===g)?i:void 0;let p=Ue(r),v=!p&&Ge(r),L=v||p,x={collection:Xe(r)??[],isVirtual:s,isJQx:!0},E=Ve(x.collection),T=`input => ${v?`"${j(r.join(", "),70)}"`:!L&&E?`element collection [${j(x.collection.map(g=>`${a(g,Comment,Text)?"Comment|Text @":""} ${g?.outerHTML||g?.textContent}`).join(", "),70)}]`:`"${j(r,70)}"`}`;if(x.collection.length&&E)return N(T),s||x.collection.forEach(g=>{n.contains(g)||U([g],n,i)}),G(x);if(L){if([r].flat().forEach(g=>x.collection.push(H(g))),x.collection.length>0){let g=x.collection.filter(m=>m?.dataset?.jqxcreationerror);x.collection=x.collection.filter(m=>!m?.dataset?.jqxcreationerror),N(`${T}`),N(`*Created ${x.isVirtual?"VIRTUAL ":""}[${j(Ze(x.collection)||"sanitized: no elements remaining",70)}]`),g.length&&console.error(`JQx: illegal html, not rendered: "${g.reduce((m,y)=>m.concat(`${y.textContent}
|
|
15
|
+
`),"").trim()}"`),x.isVirtual||U(x.collection,n,i)}return G(x)}let d=Ye(r,n,x);return N(`input => ${d}`),G(x)}}export{h as default};
|