jqx-es 1.6.0 → 1.6.2
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/Resource/Common/LifeCSS.js +11 -11
- package/Resource/Common/TypeofAnything.js +156 -137
- package/package.json +1 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
var JQx=(()=>{var xe=Object.defineProperty;var ft=Object.getOwnPropertyDescriptor;var dt=Object.getOwnPropertyNames;var mt=Object.prototype.hasOwnProperty;var gt=(t,e)=>{for(var r in e)xe(t,r,{get:e[r],enumerable:!0})},pt=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of dt(e))!mt.call(t,o)&&o!==r&&xe(t,o,{get:()=>e[o],enumerable:!(n=ft(e,o))||n.enumerable});return t};var yt=t=>pt(xe({},"__esModule",{value:!0}),t);var Er={};gt(Er,{default:()=>wr});var{IS:s,maybe:W,$Wrap:Lr,isNothing:Tr,xProxy:Fr,addSymbolicExtensions:$r}=bt({useSymbolicExtensions:!1});function bt(t={}){let{useSymbolicExtensions:e}=t,{xProxy:r,addSymbolicExtensions:n}=ht(a,f,e),o=C(),[i]=[N()];return r.custom(),e&&n(),{IS:a,maybe:o,$Wrap:i,isNothing:b,xProxy:r,addSymbolicExtensions:n};function a(l,...d){let v=typeof l=="symbol"?Symbol.isSymbol:l;switch(!0){case!!o({trial:L=>"isTypes"in(d?.[0]??{})}):return w(l,d[0]);default:return d.length>1?m(v,...d):E(l,...d)}}function w(l,d){switch(!0){case"defaultValue"in d:return u(l,d);case"notTypes"in d:return y(l,d);default:return a(l,...[d.isTypes].flat())}}function f(l){return l?.[Symbol.proxy]??a(l)}function E(l,...d){let{noInput:v,noShouldbe:L,compareTo:O,inputCTOR:J,isNaN:B,isInfinity:ut,shouldBeFirstElementIsNothing:ct}=c(l,...d);switch(d=d.length&&d[0],!0){case ct:return String(l)===String(O);case(l?.[Symbol.proxy]&&L):return l[Symbol.proxy];case B:return L?"NaN":String(O)===String(l);case ut:return L?"Infinity":String(O)===String(l);case v:return L?String(l):String(O)===String(l);case J===Boolean:return d?J===d:"Boolean";default:return g(l,d,L,h(l,J))}}function c(l,...d){let v=d.length<1,L=l==null;return{noInput:L,noShouldbe:v,compareTo:!v&&d[0],inputCTOR:!L&&Object.getPrototypeOf(l)?.constructor,isNaN:Number.isNaN(l)||o({trial:O=>String(l)==="NaN"}),isInfinity:o({trial:O=>String(l)})==="Infinity",shouldBeFirstElementIsNothing:!v&&b(d[0])}}function h(l,d){switch(!0){case l===0:return Number;case l==="":return String;case!l:return{name:String(l)};default:return d}}function g(l,d,v,L){switch(!0){case(!v&&d===l||l?.[Symbol.proxy]&&d===Proxy):return!0;case String(d)==="NaN":return String(l)==="NaN";case(l?.[Symbol.toStringTag]&&typeof d=="string"):return String(d)===l[Symbol.toStringTag];default:return d?p(l,d,L):S(l,L)}}function S(l,d){return(l?.[Symbol.toStringTag]??l?.prototype?.[Symbol.toStringTag])||d?.name||String(d)}function p(l,d,v){return o({trial:L=>l instanceof d})||d===v||d===Object.getPrototypeOf(v)||`${d?.name}`===v?.name}function m(l,...d){return d.some(v=>a(l,v))}function b(l,d=!1){let v=l==null;return v=d?v||a(l,1/0)||a(l,NaN):v,v}function C(){let l=d=>{};return function({trial:d,whenError:v=l}={}){try{return d()}catch(L){return v(L)}}}function N(){return function(l){return Object.freeze({get value(){return l},get[Symbol.type](){return f(l)},get type(){return f(l)},[Symbol.is](...d){return a(l,...d)},is(...d){return a(l,...d)}})}}function u(l,{defaultValue:d,isTypes:v=[void 0],notTypes:L}={}){return v=v?.constructor!==Array?[v]:v,L=L&&L?.constructor!==Array?[L]:[],L.length<1?a(l,...v)?l:d:y(l,{isTypes:v,notTypes:L})?l:d}function y(l,{isTypes:d=[void 0],notTypes:v=[void 0]}={}){return d=d?.constructor!==Array?[d]:d,v=v?.constructor!==Array?[v]:v,a(l,...d)&&!a(l,...v)}function x(){Object.getOwnPropertyDescriptors(Object.prototype)[Symbol.is]||(Object.defineProperties(Object.prototype,{[Symbol.type]:{get(){return f(this)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(...l){return a(this,...l)},enumerable:!1,configurable:!1}}),Object.defineProperties(Object,{[Symbol.type]:{value(l){return f(l)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(l,...d){return a(l,...d)},enumerable:!1,configurable:!1}}))}}function ht(t,e,r){return Symbol.isSymbol||(Symbol.isSymbol=Symbol.for("toa.isASymbol")),{xProxy:w(),addSymbolicExtensions:n};function n(){Symbol.is||(Symbol.is=Symbol.for("toa.is"),Symbol.type=Symbol.for("toa.type")),Object.getOwnPropertyDescriptors(Object.prototype)[Symbol.is]||(Object.defineProperties(Object.prototype,{[Symbol.type]:{get(){return e(this)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(...f){return t(this,...f)},enumerable:!1,configurable:!1}}),Object.defineProperties(Object,{[Symbol.type]:{value(f){return e(f)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(f,...E){return t(f,...E)},enumerable:!1,configurable:!1}}))}function o(f){let E=f.set;return f.set=(c,h,g)=>h===Symbol.proxy?c[h]=g:E(c,h,g),f}function i(f){return Object.getPrototypeOf(f)?.constructor?.name||"Object"}function a(f){return Proxy=new f(f,{construct(E,c){for(let g of c)g.set&&(g=o(g));let h=new E(...c);return h[Symbol.proxy]=`Proxy (${i(c[0])})`,h}}),Proxy}function w(){Symbol.proxy||(Symbol.proxy=Symbol.for("toa.proxy"));let f=Proxy;return{native(){Proxy=f},custom(){Proxy=a(f)}}}}var je=vt(),z=St(),V=xt();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 xt(){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 vt(){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 Re={html:"innerHTML",text:"textContent",class:"className"},ee=wt();function wt(){let t={get(e,r){let n=String(r)?.toLowerCase();switch(!0){case n in e:return e[n];case Nt(n):return Je(e,n,r);default:return Je(e,n,r,!0)}},enumerable:!1,configurable:!1};return new Proxy({},t)}function Je(t,e,r,n=!1){return Object.defineProperty(t,e,{get(){return n?o=>At(r):Pt(e)}}),t[e]}function Et(t,e,r){return e=e?.isJQx&&e.first()||e,W({trial:n=>Ht(e)?t.append(e):ke(e)?t.insertAdjacentHTML("beforeend",e):t.append(e),whenError:n=>console.info(`${r} (for root ${t}) not created, reason
|
|
2
|
-
`,n)})}function
|
|
3
|
-
=> @charset, @namespace and @import are not supported here`),{done:!0}}function
|
|
4
|
-
${
|
|
5
|
-
Rule: ${
|
|
6
|
-
${r}`),
|
|
7
|
-
${
|
|
8
|
-
Rule: ${
|
|
9
|
-
${r}`),
|
|
10
|
-
`)}function
|
|
11
|
-
`).map(n=>n.replace(/\s|\/\/.*$/g,"").trim().replace(/(@s!)/g," ")).join(""),r)}function
|
|
1
|
+
var JQx=(()=>{var ye=Object.defineProperty;var st=Object.getOwnPropertyDescriptor;var at=Object.getOwnPropertyNames;var lt=Object.prototype.hasOwnProperty;var ut=(t,e)=>{for(var r in e)ye(t,r,{get:e[r],enumerable:!0})},ct=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of at(e))!lt.call(t,i)&&i!==r&&ye(t,i,{get:()=>e[i],enumerable:!(n=st(e,i))||n.enumerable});return t};var ft=t=>ct(ye({},"__esModule",{value:!0}),t);var Er={};ut(Er,{default:()=>xr});var{IS:u,maybe:A,$Wrap:wr,isNothing:Tr,xProxy:Lr,addSymbolicExtensions:Cr}=dt({useSymbolicExtensions:!1});function dt(t={}){let{useSymbolicExtensions:e}=t,{shouldbeIsSingleObject:r,ISOneOf:n,isExcept:i,verifyNothingness:a,xProxy:f,determineType:S,addSymbolicExtensions:y,maybe:x,$Wrap:d}=mt(b,e);return f.custom(),e&&y(),{IS:b,maybe:x,$Wrap:d,isNothing:a,xProxy:f,addSymbolicExtensions:y};function b(m,...h){let g=typeof m=="symbol"?Symbol.isSymbol:m;switch(!0){case!!x({trial:c=>"isTypes"in(h?.[0]??{})}):return r(m,h[0]);default:return h.length>1?n(g,...h):S(m,...h)}}}function mt(t,e){let{SymbolAndCustomProxyFactory:r,maybeFactory:n,WrapAnyFactory:i,verifyNothingness:a,determineType:f}=gt(t,b),{xProxy:S,addSymbolicExtensions:y}=r(t,b,e),[x,d]=[n(),i(t,b)];return Object.freeze({shouldbeIsSingleObject:m,ISOneOf:h,isExcept:c,verifyNothingness:a,xProxy:S,determineType:f,addSymbolicExtensions:y,maybe:x,$Wrap:d});function b(o){return o?.[Symbol.proxy]??t(o)}function m(o,s){switch(!0){case"defaultValue"in s:return g(o,s);case"notTypes"in s:return c(o,s);default:return t(o,...[s.isTypes].flat())}}function h(o,...s){return s.some(l=>t(o,l))}function g(o,{defaultValue:s,isTypes:l=[void 0],notTypes:p}={}){return l=l?.constructor!==Array?[l]:l,p=p&&p?.constructor!==Array?[p]:[],p.length<1?t(o,...l)?o:s:c(o,{isTypes:l,notTypes:p})?o:s}function c(o,{isTypes:s=[void 0],notTypes:l=[void 0]}={}){return s=s?.constructor!==Array?[s]:s,l=l?.constructor!==Array?[l]:l,t(o,...s)&&!t(o,...l)}}function gt(){let t={IS:"toa.is",TYPE:"toa.type",IS_SYMBOL:"toa.isASymbol",PROXY:"toa.proxy"},e={NAN:"NaN",INFINITY:"Infinity",BOOLEAN:"Boolean",OBJECT:"Object",PROXY_PREFIX:"Proxy ("};return Object.freeze({SymbolAndCustomProxyFactory:n,maybeFactory:g,WrapAnyFactory:h,verifyNothingness:c,determineType:y});function r(o,s){Symbol.is||(Symbol.is=Symbol.for(t.IS),Symbol.type=Symbol.for(t.TYPE),Object.defineProperties(Object.prototype,{[Symbol.type]:{get(){return s(this)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(...l){return o(this,...l)},enumerable:!1,configurable:!1}}),Object.defineProperties(Object,{[Symbol.type]:{value(l){return s(l)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(l,...p){return o(l,...p)},enumerable:!1,configurable:!1}}))}function n(o,s,l){return Symbol.isSymbol||(Symbol.isSymbol=Symbol.for(t.IS_SYMBOL)),{xProxy:f(),addSymbolicExtensions:()=>r(o,s)}}function i(o){return Object.getPrototypeOf(o)?.constructor?.name||e.OBJECT}function a(o){return Proxy=new o(o,{construct(s,l){let p=new s(...l);return p[Symbol.proxy]=`${e.PROXY_PREFIX}${i(l[0])})`,p}}),Proxy}function f(){Symbol.proxy||(Symbol.proxy=Symbol.for(t.PROXY));let o=Proxy;return{native(){Proxy=o},custom(){Proxy=a(o)}}}function S(o,...s){let l=s.length<1,p=o==null;return{noInput:p,noShouldbe:l,compareTo:!l&&s[0],inputCTOR:!p&&(o?.constructor||Object.getPrototypeOf(o)?.constructor),isNaN:Number.isNaN(o)||A({trial:v=>String(o)===e.NAN}),isInfinity:A({trial:v=>String(o)})===e.INFINITY,shouldBeFirstElementIsNothing:!l&&c(s[0])}}function y(o,...s){let{noInput:l,noShouldbe:p,compareTo:v,inputCTOR:F,isNaN:me,isInfinity:ge,shouldBeFirstElementIsNothing:pe}=S(o,...s);switch(s=s.length&&s[0],!0){case pe:return String(o)===String(v);case(o?.[Symbol.proxy]&&p):return o[Symbol.proxy];case me:return p?e.NAN:String(v)===String(o);case ge:return p?e.INFINITY:String(v)===String(o);case l:return p?String(o):String(v)===String(o);case F===Boolean:return p?e.BOOLEAN:F===s;default:return d(o,s,p,x(o,F))}}function x(o,s){switch(!0){case o===0:return Number;case o==="":return String;case!o:return{name:String(o)};default:return s}}function d(o,s,l,p){switch(!0){case(!l&&s===o||o?.[Symbol.proxy]&&s===Proxy):return!0;case String(s)===e.NAN:return String(o)===e.NAN;case(o?.[Symbol.toStringTag]&&typeof s=="string"):return String(s)===o[Symbol.toStringTag];default:return s?m(o,s,p):b(o,p)}}function b(o,s){return(o?.[Symbol.toStringTag]??o?.prototype?.[Symbol.toStringTag])||s?.name||String(s)}function m(o,s,l){return A({trial:p=>o instanceof s})||s===l||s===Object.getPrototypeOf(l)||`${s?.name}`===l?.name}function h(o,s){return function(l){let p={get value(){return l},is(...v){return o(l,...v)},get type(){return s(l)}};return Object[Symbol.type]&&Object.defineProperties(p,{[Symbol.type]:{get(){return s(l)}},[Symbol.is]:{value(...v){return o(l,...v)}}}),Object.freeze(p)}}function g(){let o=s=>{};return function({trial:s,whenError:l=o}={}){try{return s()}catch(p){return l(p)}}}function c(o,s=!1){let l=o==null;return l=s?l||u(o,1/0)||u(o,NaN):l,l}}var Me=bt(),R=pt(),J=yt();function pt(){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 yt(){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 bt(){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 Ie={html:"innerHTML",text:"textContent",class:"className"},U=ht();function ht(){let t={get(e,r){let n=String(r)?.toLowerCase();switch(!0){case n in e:return e[n];case Nt(n):return De(e,n,r);default:return De(e,n,r,!0)}},enumerable:!1,configurable:!1};return new Proxy({},t)}function De(t,e,r,n=!1){return Object.defineProperty(t,e,{get(){return n?i=>Lt(r):Ft(e)}}),t[e]}function St(t,e,r){return e=e?.isJQx&&e.first()||e,A({trial:n=>Ct(e)?t.append(e):je(e)?t.insertAdjacentHTML("beforeend",e):t.append(e),whenError:n=>console.info(`${r} (for root ${t}) not created, reason
|
|
2
|
+
`,n)})}function xt(t,e,...r){let n=Et(e,t);return r?.forEach(i=>St(n,i,t)),n}function Et(t,e){switch(t=be(e)?Tt(t):t?.isJQx?t.first():t,!0){case u(t,String):return Q(e,je(t,e)?{html:t}:{text:t});case u(t,Node):return wt(e,t);default:return Q(e,t)}}function vt(t){return delete t.data,Object.keys(t).length<1||Object.keys(t).forEach(e=>{let r=e.toLowerCase();r in Ie&&(t[Ie[r]]=t[e],delete t[e])}),t}function wt(t,e){let r=Q(t);return r.append(e),r}function Q(t,e={}){e=Re(e,{});let r=Object.entries(e.data??{}),n=Object.assign(be(t)?new Comment(e?.text):document.createElement(t),vt(e));return r.length&&r.forEach(([i,a])=>n.dataset[i]=String(a)),n}function Re(t,e){return e?u(t,{isTypes:Object,notTypes:[Array,null,NaN,Proxy],defaultValue:e}):u(t,{isTypes:Object,notTypes:[Array,null,NaN,Proxy]})}function Tt(t){return Re(t)?t?.text??t?.textContent??"":String(t)}function Lt(t){return Q("b",{style:"color:red",text:`'${t}' is not a valid HTML-tag`})}function je(t,e){return!be(e)&&u(t,String)&&/<.*>|&[#|0-9a-z]+[^;];/i.test(t)}function Ct(t){return t?.constructor===Comment||t?.constructor===CharacterData}function be(t){return t?.constructor===Comment||/comment/i.test(t)}function Nt(t){return!u(Q(t),HTMLUnknownElement)}function Ft(t){return(e,...r)=>xt(t,e,...r)}var{IS:j,maybe:he,$Wrap:Pr,isNothing:Or,xProxy:Hr,addSymbolicExtensions:Mr}=At({useSymbolicExtensions:!1});function At(t={}){let{useSymbolicExtensions:e}=t,{shouldbeIsSingleObject:r,ISOneOf:n,isExcept:i,verifyNothingness:a,xProxy:f,determineType:S,addSymbolicExtensions:y,maybe:x,$Wrap:d}=$t(b,e);return f.custom(),e&&y(),{IS:b,maybe:x,$Wrap:d,isNothing:a,xProxy:f,addSymbolicExtensions:y};function b(m,...h){let g=typeof m=="symbol"?Symbol.isSymbol:m;switch(!0){case!!x({trial:c=>"isTypes"in(h?.[0]??{})}):return r(m,h[0]);default:return h.length>1?n(g,...h):S(m,...h)}}}function $t(t,e){let{SymbolAndCustomProxyFactory:r,maybeFactory:n,WrapAnyFactory:i,verifyNothingness:a,determineType:f}=Pt(t,b),{xProxy:S,addSymbolicExtensions:y}=r(t,b,e),[x,d]=[n(),i(t,b)];return Object.freeze({shouldbeIsSingleObject:m,ISOneOf:h,isExcept:c,verifyNothingness:a,xProxy:S,determineType:f,addSymbolicExtensions:y,maybe:x,$Wrap:d});function b(o){return o?.[Symbol.proxy]??t(o)}function m(o,s){switch(!0){case"defaultValue"in s:return g(o,s);case"notTypes"in s:return c(o,s);default:return t(o,...[s.isTypes].flat())}}function h(o,...s){return s.some(l=>t(o,l))}function g(o,{defaultValue:s,isTypes:l=[void 0],notTypes:p}={}){return l=l?.constructor!==Array?[l]:l,p=p&&p?.constructor!==Array?[p]:[],p.length<1?t(o,...l)?o:s:c(o,{isTypes:l,notTypes:p})?o:s}function c(o,{isTypes:s=[void 0],notTypes:l=[void 0]}={}){return s=s?.constructor!==Array?[s]:s,l=l?.constructor!==Array?[l]:l,t(o,...s)&&!t(o,...l)}}function Pt(){let t={IS:"toa.is",TYPE:"toa.type",IS_SYMBOL:"toa.isASymbol",PROXY:"toa.proxy"},e={NAN:"NaN",INFINITY:"Infinity",BOOLEAN:"Boolean",OBJECT:"Object",PROXY_PREFIX:"Proxy ("};return Object.freeze({SymbolAndCustomProxyFactory:n,maybeFactory:g,WrapAnyFactory:h,verifyNothingness:c,determineType:y});function r(o,s){Symbol.is||(Symbol.is=Symbol.for(t.IS),Symbol.type=Symbol.for(t.TYPE),Object.defineProperties(Object.prototype,{[Symbol.type]:{get(){return s(this)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(...l){return o(this,...l)},enumerable:!1,configurable:!1}}),Object.defineProperties(Object,{[Symbol.type]:{value(l){return s(l)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(l,...p){return o(l,...p)},enumerable:!1,configurable:!1}}))}function n(o,s,l){return Symbol.isSymbol||(Symbol.isSymbol=Symbol.for(t.IS_SYMBOL)),{xProxy:f(),addSymbolicExtensions:()=>r(o,s)}}function i(o){return Object.getPrototypeOf(o)?.constructor?.name||e.OBJECT}function a(o){return Proxy=new o(o,{construct(s,l){let p=new s(...l);return p[Symbol.proxy]=`${e.PROXY_PREFIX}${i(l[0])})`,p}}),Proxy}function f(){Symbol.proxy||(Symbol.proxy=Symbol.for(t.PROXY));let o=Proxy;return{native(){Proxy=o},custom(){Proxy=a(o)}}}function S(o,...s){let l=s.length<1,p=o==null;return{noInput:p,noShouldbe:l,compareTo:!l&&s[0],inputCTOR:!p&&(o?.constructor||Object.getPrototypeOf(o)?.constructor),isNaN:Number.isNaN(o)||he({trial:v=>String(o)===e.NAN}),isInfinity:he({trial:v=>String(o)})===e.INFINITY,shouldBeFirstElementIsNothing:!l&&c(s[0])}}function y(o,...s){let{noInput:l,noShouldbe:p,compareTo:v,inputCTOR:F,isNaN:me,isInfinity:ge,shouldBeFirstElementIsNothing:pe}=S(o,...s);switch(s=s.length&&s[0],!0){case pe:return String(o)===String(v);case(o?.[Symbol.proxy]&&p):return o[Symbol.proxy];case me:return p?e.NAN:String(v)===String(o);case ge:return p?e.INFINITY:String(v)===String(o);case l:return p?String(o):String(v)===String(o);case F===Boolean:return p?e.BOOLEAN:F===s;default:return d(o,s,p,x(o,F))}}function x(o,s){switch(!0){case o===0:return Number;case o==="":return String;case!o:return{name:String(o)};default:return s}}function d(o,s,l,p){switch(!0){case(!l&&s===o||o?.[Symbol.proxy]&&s===Proxy):return!0;case String(s)===e.NAN:return String(o)===e.NAN;case(o?.[Symbol.toStringTag]&&typeof s=="string"):return String(s)===o[Symbol.toStringTag];default:return s?m(o,s,p):b(o,p)}}function b(o,s){return(o?.[Symbol.toStringTag]??o?.prototype?.[Symbol.toStringTag])||s?.name||String(s)}function m(o,s,l){return he({trial:p=>o instanceof s})||s===l||s===Object.getPrototypeOf(l)||`${s?.name}`===l?.name}function h(o,s){return function(l){let p={get value(){return l},is(...v){return o(l,...v)},get type(){return s(l)}};return Object[Symbol.type]&&Object.defineProperties(p,{[Symbol.type]:{get(){return s(l)}},[Symbol.is]:{value(...v){return o(l,...v)}}}),Object.freeze(p)}}function g(){let o=s=>{};return function({trial:s,whenError:l=o}={}){try{return s()}catch(p){return l(p)}}}function c(o,s=!1){let l=o==null;return l=s?l||j(o,1/0)||j(o,NaN):l,l}}var k=Ot;function Ot({styleSheet:t,createWithId:e}={}){let{tryParseAtOrNestedRules:r,ruleExists:n,checkParams:i,sheet:a,removeRules:f,consider:S,currentSheetID:y}=Ht({styleSheet:t,createWithId:e});function x(g,c){if(g&&c.removeProperties){Object.keys(c.removeProperties).forEach(o=>g.style.removeProperty(Je(o)));return}Object.entries(c).forEach(([o,s])=>{o=Je(o.trim()),s=s.trim();let l;if(/!important/.test(s)&&(s=s.slice(0,s.indexOf("!important")).trim(),l="important"),!CSS.supports(o,s))return console.error(`StylingFactory ${y} error: '${o}' with value '${s}' not supported (yet)`);Qe(()=>g.style.setProperty(o,s,l),`StylingFactory ${y} (setRule4Selector) failed`)})}function d(g,c,o=a){if(g=g?.trim?.(),!j(g,String)||!g.length||/[;,]$/g.test(g))return console.error(`StylingFactory ${y} (setRules): [${g||"[no selector given]"}] is not a valid selector`);if(c.removeRule)return f(g);let s=n(g,!0),l=s||o.cssRules[o.insertRule(`${g} {}`,o.cssRules.length||0)];return S(()=>x(l,c),g,s)}function b(g){let c=g.trim().split(/{/,2),o=c.shift().trim();if(!j(o,String)||!o?.trim()?.length)return console.error(`StylingFactory ${y} (doParse): no (valid) selector could be extracted from rule ${Se(g)}`);let s=Qt(c.shift());return Qe(()=>d(o,s),`StylingFactory ${y} (setRules) failed`)}function m(g){let c=r(g);return c.done?c.existing:b(g)}function h(g,c){return g.trim().startsWith("@media")?m(Mt(g,c)):d(g,c)}return function(g,c={}){return i(g,c)&&(Object.keys(c).length?h(g,c):m(g))}}function Ht({styleSheet:t,createWithId:e}){let r="Note: The rule or some of its properties may not be supported by your browser (yet)",n=`for style#${e}`;t=e?i(e):t;function i(m){let h=document.querySelector(`#${m}`)?.sheet;if(h)return h;let g=Object.assign(document.createElement("style"),{id:m});return document.head.insertAdjacentElement("beforeend",g),g.sheet}function a(m){return console.error(`StylingFactory ${n} [rule: ${m}]
|
|
3
|
+
=> @charset, @namespace and @import are not supported here`),{done:!0}}function f(m,h){return[...t.rules].find(g=>h?ke(g.selectorText||"",m):Rt`${Dt(m)}${[..."gim"]}`.test(g.cssText))}function S(m){return/^@charset|@import|namespace/i.test(m.trim())?a(m):m.match(/}/g)?.length>1?{existing:d(m,1),done:!0}:{done:!1}}function y(m){let h=[...t.cssRules].reduce((c,o,s)=>ke(o.selectorText||"",m)&&c.concat(s)||c,[]),g=h.length;return h.forEach(c=>t.deleteRule(c)),g>0?console.info(`\u2714 Removed ${g} instance${g>1?"s":""} of selector ${m} from ${n.slice(4)}`):console.info(`\u2714 Remove rule: selector ${m} does not exist in ${n.slice(4)}`)}function x(m,h){return m&&j(m,String)&&m.trim().length>0&&j(h,Object)||(console.error(`StylingFactory ${n} called with invalid parameters`),!1)}function d(m){m=m.trim();let h=m.slice(0,m.indexOf("{")).trim(),g=!!f(h);try{return t.insertRule(`${m}`,t.cssRules.length),g}catch(c){return console.error(`StylingFactory ${n} (tryParse) ${c.name} Error:
|
|
4
|
+
${c.message}
|
|
5
|
+
Rule: ${Se(m)}
|
|
6
|
+
${r}`),g}}function b(m,h,g){try{return m(),g}catch(c){return console.error(`StylingFactory ${n} (tryAddOrModify) ${c.name} Error:
|
|
7
|
+
${c.message}
|
|
8
|
+
Rule: ${Se(h)}
|
|
9
|
+
${r}`),g}}return{sheet:t,removeRules:y,tryParseAtOrNestedRules:S,ruleExists:f,checkParams:x,tryParse:d,consider:b,currentSheetID:n}}function Mt(t,e){return`${t.trim()} ${Object.entries(e).map(([r,n])=>`${r}: { ${It(n)}`)}`}function Se(t){let e=(t||"NO RULE").trim().slice(0,50).replace(/\n/g,"\\n").replace(/\s{2,}/g," ");return t.length>e.length?`${e.trim()}...truncated`:e}function It(t){return Object.entries(t).map(([e,r])=>`${e}: ${r.trim()}`).join(`;
|
|
10
|
+
`)}function Dt(t){return t.replace(/([*\[\]()-+{}.$?\\])/g,e=>`\\${e}`)}function Rt(t,...e){let r=e.length&&Array.isArray(e.slice(-1))?e.pop().join(""):"";return new RegExp((e.length&&t.raw.reduce((n,i,a)=>n.concat(e[a-1]||"").concat(i),"")||t.raw.join("")).split(`
|
|
11
|
+
`).map(n=>n.replace(/\s|\/\/.*$/g,"").trim().replace(/(@s!)/g," ")).join(""),r)}function Je(t){return t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`).replace(/[^--]^-|-$/,"")}function Qe(t,e){try{return t()}catch(r){console.error(`${e||"an error occured"}: ${r.message}`)}}function jt(t){return t.replace(/\/\*.+?\*\//gm,"").replace(/[}{\r\n]/g,"").replace(/(data:.+?);/g,(e,r)=>`${r}\\3b`).split(";").map(e=>e.trim()).join(`;
|
|
12
12
|
`).replaceAll("\\3b",";").split(`
|
|
13
|
-
`)}function
|
|
14
|
-
`)),n}function
|
|
15
|
-
`)),n}function
|
|
16
|
-
`));default:return n}}return Object.defineProperties(n,{log:{value:f,enumerable:!1},error:{value:a,enumerable:!1},warn:{value:w,enumerable:!1}}),Object.freeze(n)}function ue(){return(t=>`[${ae(t.getHours())}:${ae(t.getMinutes())}:${ae(t.getSeconds())}.${ae(t.getMilliseconds(),3)}]`)(new Date)}function Ae(t,e){if(t)for(let[r,n]of Object.entries(e)){if(r=M(r),r.startsWith("data"))return de(t,n);s(n,String)&&ce(r)&&t.setAttribute(r,n.split(/[, ]/)?.join(" "))}}function de(t,e){if(t&&s(e,Object))for(let[r,n]of Object.entries(e))t.setAttribute(`data-${M(r)}`,n)}function me(t){return t?s(t,Proxy)?[t.EL]:s(t,NodeList)?[...t]:I(t)?[t]:K(t)?t:t.isJQx?t.collection:void 0:[]}function ge(t,e){return t.andThen(e)}function pe(t,e){return t.andThen(e,!0)}function I(t){return s(t,Text,HTMLElement,Comment)}function Z(t,e){if(s(e,Object))for(let[r,n]of Object.entries(e)){let o;/!important/i.test(n)&&(n=n.slice(0,n.indexOf("!")).trim(),o="important"),t.style.setProperty(M(r),n,o)}}function R(t){let e=t.cloneNode(!0);return e.removeAttribute&&e.removeAttribute("id"),t.isConnected?t.remove():t=null,e}function _e(t){if(!s(t,HTMLElement))return;let e=t.style,r=getComputedStyle(t),n=!![e.visibility,r.visibility].includes("hidden"),o=!![e.display,r.display].includes("none"),i=!!t.hidden,a=parseInt(r.height)<1||parseInt(r.width)<1,w=t.offsetTop<0||t.offsetLeft+t.offsetWidth<0||t.offsetLeft>document.body.offsetWidth,f=+r.opacity==0||+(e.opacity||1)==0;return!(i||w||f||o||n||a)}function Ge(t){return t?.isConnected?!![...document.querySelectorAll(":is(:read-write)")].find(e=>e===t):!1}function Ze(t){return t?.filter(e=>e).reduce((e,r)=>e.concat(Pe(r)?`<!--${r.data}-->`:be(r)?r.textContent:r.outerHTML),"")}function ae(t,e=2){return`${t}`.padStart(e,"0")}function Ye(t,e=0){return[t,e]=[Math.floor(t),Math.ceil(e)],Math.floor([...crypto.getRandomValues(new Uint32Array(1))].shift()/2**32*(t-e+1)+e)}function ye(){return`_${qt(Xt).slice(0,8).join("")}`}function He(t){return t=s(t,String)&&/,/.test(t)?t.split(",").map(e=>e.trim().toLowerCase()).filter(e=>e.length>0):t,s(t,Array)?t:s(t,String)&&t?.trim().toLowerCase()||""}function Xe(t){return t?.isConnected?!![...document.querySelectorAll(":is(:modal)")].find(e=>e===t):!1}function Ne(t,e){switch(t=String(t).trim(),!0){case/^(0|false|f)$/i.test(t):return!1;case/^(1|true|t)$/i.test(t):return!0;default:return e}}function qt(t){let e=t.length;for(;e--;){let r=Ye(e);[t[e],t[r]]=[t[r],t[e]]}return t}function Y(t){return s(t,String)?t.toLowerCase().split("-").map((e,r)=>r&&`${er(e)}`||e).join(""):t}function M(t){return t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`).replace(/^-|-$/,"")}function er([t,...e]){return`${t.toUpperCase()}${e.join("")}`}function be(t){return s(t,Comment,Text)}function Pe(t){s(t,Comment)}function Ke(t){return s(t,Text)}function X(t){return s(t,String)&&/^<|>$/.test(`${t}`.trim())}function K(t){return s(t,Array)&&!t?.find(e=>!I(e))}function he(t){return s(t,Array)&&!t?.find(e=>!X(e))}function T(t,e){let r=t.collection.filter(n=>!be(n));for(let n=0;n<r.length;n+=1)e(r[n],n);return t}function qe(t){return t.node?s(t.node,Comment)?`<!--${t.node.textContent}-->`:t.HTML.get(1).split(">")[0]+">...":""}function Me(t,e,r){let n=e!==document.body&&s(t,String)&&t.toLowerCase()!=="body"?e:document;try{r.collection=[...n.querySelectorAll(t)]}catch{F.warn(`JQx: Invalid CSS querySelector. [${s(t,String)?t:"Not a string!"}]`)}}function et(){return{isCommentOrTextNode:be,isNode:I,isComment:Pe,isText:Ke,isHtmlString:X,isArrayOfHtmlElements:K,isArrayOfHtmlStrings:he,ElemArray2HtmlString:Ze,input2Collection:me,setCollectionFromCssSelector:Me,cssRuleEdit:_({createWithId:"JQxStylesheet"})}}function tt(){let e=Object.freeze({notInDOM:"n/a",writable:"n/a",modal:"n/a",empty:!0,open:"n/a",visible:"n/a"});return r=>{let n=r.node;return s(n,Node)?Object.freeze({get writable(){return Ge(n)},get modal(){return Xe(n)},get inDOM(){return n.isConnected},get open(){return n.open??!1},get visible(){return _e(n)},get disabled(){return n.hasAttribute("readonly")||n.hasAttribute("disabled")},get empty(){return r.collection.length<1},get virtual(){return r.isVirtual}}):e}}function rt(t,e,r,n){r&&s(e,String)&&(e={[e]:r==="-"?"":r});let o;e.className&&(o=e.className,delete e.className),o=[...t.classList].find(a=>a.startsWith("JQxClass-")||o&&a===o)||o||`JQxClass-${ye().slice(1)}`,n.editCssRule(`.${o}`,e),t.classList.add(o)}var tr=tt();function nt(t){return{factoryExtensions:rr(t),instanceExtensions:nr(t)}}function rr(t){return{data(e){return{get all(){return new Proxy(e[0]?.dataset??{},Te)},set(r={}){if(!e.is.empty&&s(r,Object))for(let[n,o]of Object.entries(r))e.setData({[n]:o});return e},get(r,n){return e.data.all[r]??n},add(r={}){if(!e.is.empty&&s(r,Object))for(let[n,o]of Object.entries(r))e.setData({[n]:o});return e},remove(r){return e[0]?.removeAttribute(`data-${M(r)}`),e}}},dimensions(e){if(e.is.empty)return F.error("[JQx instance].dimensions called on empty instance"),{error:"[JQx instance].dimensions: NO ELEMENTS"};let{node:r}=e,n=r.getBoundingClientRect().toJSON();return n.scrollTopDistance=G(r,0),n.scrollLeftDistance=G(r,0,!1),n},node(e){return e[0]},HTML(e){return{get(r,n){if(e.is.empty)return"NO ELEMENTS IN COLLECTION";let o=r?e.outerHtml:e.html();return n?j(o):o},set(r,n=!1,o=!1){r=r.isJQx?r.HTML.get(1):r;let i=s(r,String);return r=i&&o?j(r):r,i&&(r||"").trim().length&&e.html(r,n),e},replace(r,n=!1){return e.HTML.set(r,!1,n)},append(r,n=!1){return r=s(r,HTMLElement)?t(r).HTML.get(1):r.isJQx?r.HTML.get(1):r,e.HTML.set(r,!0,n)},insert(r,n=!1){return r=s(r,HTMLElement)?t(r).HTML.get(1):r.isJQx?r.HTML.get(1):r,e.HTML.set(r+e.HTML.get(),!1,n)}}},is(e){return tr(e)},length(e){return e.collection.length},outerHtml(e){return(e.first()||{outerHTML:void 0}).outerHTML},parent(e){let r=t(e[0]?.parentNode);return r.is.empty?e:r},render(e){switch(!0){case!e.is.empty:return e.toDOM();default:return t.logger.warn("[JQx.render]: empty collection"),e}},Style(e){return{get computed(){return e.is.empty?{}:getComputedStyle(e[0])},inline(r){return e.style(r)},inSheet(r){return e.css(r)},valueOf(r){return e.is.empty?void 0:getComputedStyle(e[0])[M(r)]},nwRule(r){return e.Style.byRule({rules:r})},byRule({classes2Apply:r=[],rules:n=[]}={}){let i=s(n,String)&&!r.length?n.split("{")[0].trim():"";if(n=n&&s(n,String)?[n]:n,r=r&&s(r,String)?[r]:r,(n?.length||r?.length)&&(n?.length&&t.editCssRules(...n),r))for(let a of r)e.addClass(a);return i?.startsWith(".")&&e.addClass(i.slice(1)),i?.startsWith("#")&&!e.attr("id")&&e.prop({id:i.slice(1)}),e}}}}}function nr(t){return{addClass(e,...r){return T(e,n=>n&&r.forEach(o=>n.classList.add(o)))},after:ge,afterMe:ge,andThen(e,r,n=!1){if(!r||!s(r,String,Node,Proxy))return F.log("[JQx instance].[before(Me) | after(Me) | andThen]: invalid/-sufficient input."),e;r=r?.isJQx?r:s(r,Node)?t.virtual(r):t.virtual(P(r));let[o,i,a]=n?[0,"before",r.collection.concat(e.collection)]:[e.collection.length-1,"after",e.collection.concat(r.collection)];return e[o][i](...r.collection),e.collection=a,e},append(e,...r){if(e.is.empty||r.length<1)return e;let n=e.length===1;for(let o of r){if(!o.isJQx&&A(o)){let i=o.trim(),w=!/^<(.+)[^>]+>$/m.test(i)?t.text(o):P(o);T(e,f=>f.append(n?w:R(w)))}I(o)&&T(e,i=>i.append(n?o:R(o))),o.isJQx&&!o.is.empty&&T(e,i=>o.collection.forEach(a=>i.append(n?a:R(a))))}return e},appendTo(e,r){switch(!0){case(!r.isJQx&&!s(r,HTMLElement)):return $.warn("[JQx instance].appendTo: invalid input"),e;default:return(r.isJQx?r:t(r)).append(e),e}},attr(e,r,n){if(!e.node||s(e.node,Text,Comment))return e;if(!n&&A(r))return r=M(r),r==="class"?[...e.node.classList].join(" "):e.node.getAttribute(r);if(A(r)&&n)switch(r=M(r),!0){case r.startsWith("data-"):r={data:{[r.replace("data-","")]:n}};break;default:r={[r]:n}}return s(r,Object)&&!e.is.empty&&Ae(e.node,r),e},before:pe,beforeMe:pe,clear(e){return T(e,fe)},closest(e,r){let n=A(r)?e.node?.closest(r):void 0;return n?t(n):e},computedStyle(e,r){let{node:n}=e;return n&&getComputedStyle(n)[r]},css(e,r,n){return T(e,o=>rt(o,r,n,t))},duplicate(e,r=!1,n=document.body){switch(!0){case e.is.empty:return F.error("Duplicating an empty JQx instance is not possible"),e;default:let o=e.collection[0].cloneNode(!0);return o.childNodes.forEach(i=>{i.removeAttribute&&i?.removeAttribute("id")}),r?t(o).toDOM(n):t.virtual(o)}},each(e,r){return T(e,r)},empty(e){return T(e,fe)},find(e,r){return e.collection.length>0?[...e.first()?.querySelectorAll(r)]:[]},find$(e,r){return e.collection.length>0?t(r,e):e},first(e,r=!1){return e.collection.length>0?r?e.single():e.collection[0]:void 0},first$(e,r){return e.single(r)},getData(e,r,n){return e.node?.dataset?.[r]||n},hasClass(e,...r){return e.is.empty||!e.node.classList.length?!1:r.find(n=>e.node.classList.contains(n))&&!0||!1},hide(e){return T(e,r=>Z(r,{display:"none !important"}))},html(e,r,n){switch(!0){case(e.is.empty&&!A(r)):return"";case!A(r):return e.node?.getHTML()??"";default:let o=P(`<div>${r.isJQx?r.HTML.get(!0):r}</div>`);return T(e,a=>(a.textContent=n?a.textContent:"",a.insertAdjacentHTML(t.at.end,o.getHTML())))}},htmlFor(e,r,n="",o=!1){if(e.is.empty||!A(r)||!A(n))return e;let i=e.find$(r);if(i.length<1)return e;let a=P(`<span>${n}</span>`);return i.each(w=>{o||(w.textContent=""),w.insertAdjacentHTML(t.at.end,a?.getHTML())}),e},isEmpty(e){return!e.node},nth$(e,r){return e.single(r)},on(e,r,...n){switch(!0){case(e.is.empty||!s(r,String,Array)||!A(r)||n.length<1):return e;default:return t.handle({type:r,node:e.node,handler:n}),e}},once(e,r,...n){switch(!0){case(e.is.empty||!s(r,String,Array)||!A(r)||n.length<1):return e;default:return t.handle({type:r,once:!0,node:e.node,handler:n}),e}},prepend(e,...r){if(e.is.empty||!r)return;let n=e.length===1;for(let o of r){if(A(o)){o=o.trim();let a=!/^<(.+)[^>]+>$/m.test(o)?t.text(o):P(o);a=n?a:R(a),T(e,w=>w.prepend(a.cloneNode(!0)))}I(o)&&T(e,i=>i.prepend(n?o:R(o))),o.isJQx&&!o.is.empty&&(o.collection.length>1&&o.collection.reverse(),T(e,i=>T(o,a=>i.prepend(n?a:R(a)))),o.collection.reverse())}return e},prependTo(e,r){return r.isJQx||(r=t.virtual(r)),r.prepend(e),e},prop(e,r,n){if(s(r,String)&&!n)return r.startsWith("data")?e[0]?.dataset[r.slice(r.indexOf("-")+1)]:e[0]?.[r];let o=s(r,Object)?r:{[r]:n};for(let[i,a]of Object.entries(o)){if(i=i.trim(),a&&!ce(i)||!a)return!1;if(i.toLowerCase()==="id")return e[0].id=a;T(e,f=>{if(i.startsWith("data"))return f.dataset[i.slice(i.indexOf("-")+1)]=a;f[i]=a})}return e},remove(e,r){let n=i=>i.remove(),o=()=>e.collection=e.collection.filter(i=>document.documentElement.contains(i));if(r){let i=e.find$(r);return i.is.empty||(T(i,n),o()),e}return T(e,n),o(),e},rmAttr(e,...r){for(let n of r)e.node.removeAttribute(n);return e},removeClass(e,...r){return T(e,n=>{if(n)for(let o of r)n.classList.remove(o)})},renderTo(e,r,n){return r=s(r,HTMLElement)||r.isJQx?r:document.body,n=s(n,String)&&t.at[n]?n:t.at.end,e.first$().toDOM(r,n),e},replace(e,r,n){let o=e.node;return!r||!s(n,HTMLElement)&&!n?.isJQx?(t.logger.error("JQx replace: invalid replacement value"),e):((n.isJQx||s(n,NodeList))&&(n=n[0]),o&&r&&(r=s(r,String)?o.querySelectorAll(r):r.isJQx?r.collection:r,s(r,HTMLElement,NodeList,Array)&&s(n,HTMLElement)&&(s(r,HTMLElement)?[r]:[...r]).forEach(i=>i.replaceWith(n.cloneNode(!0)))),e)},replaceClass(e,r,...n){return T(e,o=>{o.classList.remove(r);for(let i of n)o.classList.add(i)})},replaceMe(e,r){return e.replaceWith(r)},replaceWith(e,r){return r=s(r,Element)?r:r.isJQx?r[0]:void 0,r&&(e[0].replaceWith(r),e=t.virtual(r)),e},setData(e,r){return T(e,n=>de(n,r))},show(e){return T(e,r=>Z(r,{display:"revert-layer !important"}))},single(e,r){let n=e.collection.length>0;switch(r=r??0,!0){case(n&&s(r,String)):return e.find$(r);case(n&&s(r,Number)):return t(e.collection[r]);case n:return e.collection[0];default:return e}},style(e,r,n){return T(e,i=>{n&&s(r,String)&&(r={[r]:n||"none"}),Z(i,r)})},text(e,r,n=!1){switch(!0){case e.isEmpty():return e;case!s(r,String):return e.node.textContent;default:return T(e,o=>o.textContent=n?o.textContent+r:r)}},toDOM(e,r=document.body,n=H.BeforeEnd){return e.isVirtual=!1,k(e.collection,r,n),e},toggleClass(e,r){return T(e,n=>n.classList.toggle(r))},toNodeList(e){return[...e.collection].map(r=>document.importNode(r,!0))},trigger(e,r,n,o){n=s(n,Function)?n:Event,o=s(o,Object)?{...o,bubbles:o.bubbles??!0}:{bubbles:!0};let i=new n(r,o);return e.is.empty||e.each(a=>a.dispatchEvent(i)),e},val(e,r){switch(!0){case(e.is.empty||!s(e.node,HTMLInputElement,HTMLSelectElement,HTMLTextAreaElement)):return e;case!s(r,String):return e.node.value;default:return e.node.value=s(r,String)?r:"",e}}}}var Oe,Se,{isComment:gn,isText:pn,isHtmlString:yn,isArrayOfHtmlElements:bn,isArrayOfHtmlStrings:hn,ElemArray2HtmlString:Sn,cssRuleEdit:De,addFn:or}=ir();function ir(){return{...et(),addFn:lr}}function lr(t,e){return t=t?.trim(),!A(t)||!s(e,Function)?F.error("JQx.fn: method invalid parameter(s)"):Se[t]=(r,...n)=>e(r,...n)}function sr(t){return function(e,r,n){if(e=e?.trim(),!A(e)||!s(r,Function))return t.error("JQx.staticFn: invalid parameter(s)");let o=n?{get(){return r()}}:{value(...i){return r(...i)}};try{Object.defineProperty(t,e,o)}catch{return t.warn(`JQx.staticFn: extension [${e}] already exists`)}return F.log(`JQx: added static extension function [${e}]`)}}function q(t){return new Proxy(t,Object.freeze({get:(e,r)=>ar(e,r,t)}))}function ot(t,e){return(...r)=>s(t,Function)&&t(q(e),...r)}function ar(t,e,r){switch(!0){case s(e,Symbol):return W({trial:()=>t[e],whenError:()=>t});case s(+e,Number):return t.collection?.[e]||void 0;case e in Oe:return ot(Oe[e],r)();case e in Se:return ot(Se[e],r);default:return t[e]}}function st(t){let e=mr(t);for(let[r,n]of Object.entries(Object.getOwnPropertyDescriptors(e)))Object.defineProperty(t,r,n);return t}function ur(t){return{allow(e){let r=/-/.test(e),n=r&&e;e=r?Y(e):e.toLowerCase(),D.allowTag(e),Object.defineProperties(t,Ie(e,!0,t,n))},prohibit(e){e=e.toLowerCase(),D.prohibitTag(e),Object.defineProperties(t,Ie(e,!1,t))}}}function it(...t){if(t.length===1){let e=String(t.shift().trim());t=e.startsWith("!")?[e.slice(1,-1)]:e.split(",").map(r=>r.trim())}for(let e of t.map(r=>r.startsWith("!")?r.slice(1,-1):r))De(e,{removeRule:1})}function cr(t){return function(e,r,n){r=r?.isJQx?r?.[0]:r,n=n&&Object.values(H).find(i=>n===i);let o=t(e,document.createElement("br"));if(r&&!s(r,HTMLBRElement))for(let i of o.collection)n?r.insertAdjacentElement(n,i):r.append(i);return o}}function fr(...t){let e={};for(let r of t){let n=Object.getOwnPropertyDescriptors(r);for(let[o,i]of Object.entries(n))!(o in e)&&Object.defineProperty(e,o,{...i,enumerable:!1})}return e}function dr(t,e,r,n){return t=M(n||t.toLowerCase()),{get(){return(...o)=>{let i=e&&r.virtual(Q(ee[t](...o)))||void 0,w=!s(i?.node,Comment,Text,void 0)?$e(i):"";return F.log(e?`JQx: created (virtual) instance from [JQx].${t} ${w}`:`JQx: ${t.toUpperCase()} is prohibited. Use [JQx].allowTag if necessary.`),i}},enumerable:!1,configurable:!0}}function Ie(t,e,r,n){t=t.toLowerCase();let o=dr(t,e,r,n);return n?{[n]:o,[Y(n)]:o}:{[t]:o,[t.toUpperCase()]:o}}function mr(t){return fr(Object.entries(D.tagsRaw).reduce(gr(t),{}),xr(t))}function gr(t){return function(e,[r,n]){return Object.defineProperties(e,Ie(r,n,t)),e}}function pr(t){return function(e,r,...n){s(r,Function)&&(n.push(r),r=void 0),t({type:e,selector:r,handlers:n})}}function yr(t){return function(e){let{type:r,types:n,origin:o,selector:i,handler:a,handlers:w,node:f,name:E,capture:c,once:h,about:g}=e;a=w||a,r=n||r,i=o||i;let S=He(r),p=E;a=s(a,Function)?[a]:a;let m={type:S,selector:i||o,capture:c,name:p,once:h,node:f,about:g};switch(!0){case(s(S,Array)&&S.length>0):for(let b of S)m.type=b,lt(a,m,t);break;default:return lt(a,m,t)}}}function lt(t,e,r){for(let n of t)r.listen({...e,handler:n})}function br(t){return function(e,r){return r=A(r)&&r,e=A(e)&&e,r&&e&&t.listenerStore[e][r]}}function hr(t){return t.activePopup||Object.defineProperty(t,"activePopup",{value:ie(t),enumerable:!1}),t.activePopup}function Sr(t){let e=(c,h)=>De(c,h),r=function(c){return _({createWithId:c||`jqx${ye()}`})},n=function(...c){for(let h of c)De(h)},o=ur(t),i=le(t),a=yr(i);return{editCssRule:e,createStyle:r,editCssRules:n,allowProhibit:o,handle:a,capturedHandling:a,log:(...c)=>F.on.log(...c).off,warn:(...c)=>F.on.warn(...c).off,error:(...c)=>F.on.error(...c).off,handlerWrapper:i}}function xr(t){let{factoryExtensions:e,instanceExtensions:r}=nt(t);Oe=e,Se=r;let{editCssRule:n,createStyle:o,editCssRules:i,allowProhibit:a,handle:w,capturedHandling:f,log:E,warn:c,error:h,handlerWrapper:g}=Sr(t),S=br(t),p=sr(t);return{log:E,warn:c,error:h,editCssRules:i,createStyle:o,editStylesheet:o,editCssRule:n,escHtml:j,logger:F,text(m,b=!1){return b?t.comment(m):document.createTextNode(m)},node(m,b=document){return b.querySelector(m,b)},nodes(m,b=document){return[...b.querySelectorAll(m,b)]},clearAllTimers:Fe,get staticFn(){return function(m,b,C){return p(m,b,C)}},get toBool(){return Ne},get getNamedListener(){return S},get virtual(){return cr(t)},get allowTag(){return a.allow},get prohibitTag(){return a.prohibit},get removeCssRule(){return it},get removeCssRules(){return it},get delegate(){return pr(f)},get delegateCaptured(){return f},get handle(){return f},get listen(){return g.listen},get at(){return H},get setStyle(){return n},get fn(){return or},get lenient(){return D.allowUnknownHtmlTags},get IS(){return s},get Popup(){return hr(t)},get listenerStore(){return g.ListenerStore}}}var at=st(vr());function vr(){return function(e,r,n=H.BeforeEnd){if(e?.isJQx)return e;let o=s(r,HTMLBRElement);r=(!o&&r&&r.isJQx?r[0]:r)||document.body,n=n&&Object.values(H).find(c=>n===c)?n:void 0;let i=X(e),w=!i&&he(e)||i,f={collection:me(e)??[],isVirtual:o,isJQx:!0},E=K(f.collection);if(f.collection.length&&E)return o||f.collection.forEach(c=>{r.contains(c)||k([c],r,n)}),q(f);if(w){if([e].flat().forEach(c=>f.collection.push(P(c))),f.collection.length>0){let c=f.collection.filter(p=>p?.dataset?.jqxcreationerror);f.collection=f.collection.filter(p=>!p?.dataset?.jqxcreationerror);let g=f.collection.map(p=>`${String(p.constructor).split(/function|\(/)[1].trim()}`).length>1;f=q(f);let S=f.collection.length>0?qe(f):"sanitized: no elements remaining";F.log(`JQx: created ${f.isVirtual?"(virtual)":""} instance from ${g?"array of ":""}HTML string${g?"s":""} ${S}`),f.isVirtual||k(f.collection,r,n)}return f}return Me(e,r,f),q(f)}}var wr=at;return yt(Er);})();
|
|
13
|
+
`)}function Jt(t){return t.reduce((e,r)=>{let[n,i]=[r.slice(0,r.indexOf(":")).trim(),r.slice(r.indexOf(":")+1).trim().replace(/;$|;.+(?=\/*).+\/$/,"")];return n&&i?{...e,[n]:i}:e},{})}function Qt(t){return Jt(jt(t))}function ke(t,e){return t?.replace("::",":")===e?.replace("::",":")}var xe=!1,kt={on:()=>xe=!0,off:()=>xe=!1},P={tagsRaw:J,allowUnknownHtmlTags:kt,isAllowed(t){if(xe)return!0;let e=u(t,String)?t.toLowerCase():t?.nodeName.toLowerCase()||"none";return e==="#text"||!!J[e]},allowTag:t=>J[t.toLowerCase()]=!0,prohibitTag:t=>J[t.toLowerCase()]=!1};var Bt=!0,X={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};function Wt(t){if(Bt&&Object.keys(t.removed).length){let e=Object.entries(t.removed).reduce((r,[n,i])=>[...r,`${H(n)} => ${i}`],[]).join("\\000A");w.error(`JQx: HTML creation error(s): ${e}`)}}function zt(t){let e=t.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(e)&&!r.find(n=>n===e)||P.isAllowed(e)}function I(t){let e={rawHTML:t?.parentElement?.getHTML()??"no html",removed:{}};return u(t,HTMLElement)&&[...t.childNodes].forEach(r=>{if(r?.children?.length&&I(r),r?.attributes){let i=u(r,SVGElement)?R.svg:R.html;[...(r??{attributes:[]}).attributes].forEach(a=>{let f=a.name.trim().toLowerCase(),S=a.value.trim().toLowerCase().replace(X.whiteSpace,""),y=f==="href"?!X.validURL.test(S):X.notAllowedValues.test(S),x=f.startsWith("data")?!X.data.test(f):!!i[f];if(y||x){let d=G(a.value||"none",60);d+=d.length===60?"...":"",e.removed[`${a.name}`]=`attribute/property/value not allowed, removed. Value: ${d}`,r.removeAttribute(a.name)}})}if(!(zt(r)||r.constructor===CharacterData||r.constructor===Comment)){let i=(r?.outerHTML||r?.textContent).trim(),a=G(i,60)??"EMPTY";a+=a.length===60?"...":"",e.removed[`<${r.nodeName?.toLowerCase()}>`]=`not allowed, not rendered. Value: ${a}`,r.remove()}}),Wt(e),t}function Yt(t){let e=document.createElement("div");return e.insertAdjacentHTML(L.end,t),e.childNodes.length?I(e):void 0}function _t(t,e,r){switch(!0){case u(t,Comment):return e.insertAdjacentHTML(r,`<!--${t.data}-->`);case u(t,Text):return e.insertAdjacentText(r,t.data||t.textContent);default:return}}function D(t=[],e=document.body,r=L.BeforeEnd){return r=r||L.BeforeEnd,e=e?.isJQx?e.node:e||document.body,t.reduce((n,i)=>{let a=O(i)&&Vt(i,e,r);return a?[...n,a]:n},[])}function Vt(t,e=document.body,r=L.BeforeEnd){return r=r||L.BeforeEnd,e=e?.isJQx?e?.[0]:e,u(t,Comment,Text)?_t(t,e,r):u(t,HTMLElement)?e.insertAdjacentElement(r,t):void 0}function C(t){if(u(t,Text,Comment))return t;let e=t?.trim(),r=e?.split(/<text>|<\/text>/i)??[];if(r?.length&&(r=r.length>1?r.filter(i=>i.length).shift():void 0),e.startsWith("<!--")&&e.endsWith("-->"))return document.createComment(t.replace(/<!--|-->$/g,""));if(r||u(e,String)&&!/^<(.+)[^>]+>/m.test(e))return document.createTextNode(r??e);let n=Yt(t);return n.childNodes.length<1?C(`<span data-jqxcreationerror="1">${Z(t,60)}</span>`):n.children[0]}function K(t){if(t.node("#jqxPopup"))return;t.logger.log("JQx: [JQx].Popup first call. Dialog element created."),t.dialog({id:"jqxPopup"},t.div({id:"jqxPopupContent"})).render,t.editCssRules(...Me);let e=[],[r,n]=[t("#jqxPopupContent"),t.node("#jqxPopup")],i={};return t.handle({type:"click, cancel",handlers:m,name:"genericPopupCloseHandler",capture:!0,about:"A generic handler for JQx popups"}),Object.freeze({show:a,remove:f,removeModal:b});function a(c){if(n.open)switch(!0){case S(c):return;default:return f(),setTimeout(()=>a(c),200)}i={...c};let{content:o}=i;return t.IS(o,String,HTMLElement)||o?.isJQx?y():!0}function f(){return i.modal?g(i.warnMessage):x()}function S(c){for(let[o,s]of Object.entries(i))if(s!==c[o])return!1;return!0}function y(){r.clear();let{content:c,modal:o,closeAfter:s}=i;o=t.IS(o,Boolean)?o:!1;let l=o?"":t.div({id:"closeHandleIcon"});r.append(l,t.IS(c,String)?t.div(c):c),n.showModal(),!o&&t.IS(s,Number)&&h(f,s)}function x(){if(n.close(i.returnValue),d(),t.IS(i.callback,Function))return e.push(setTimeout(()=>i.callback(i.returnValue),200));i={}}function d(){e.forEach(c=>clearTimeout(c)),e=[]}function b({callback:c,value:o}={}){i.returnValue=o,i.modal=!1,i.callback=c||i.callback,f()}function m({evt:c}){if(!(Object.keys(i).length<1||!n.open)&&(c.type==="cancel"&&i.modal&&c.preventDefault(),c.target.closest("#closeHandleIcon")||!c.target.closest("#jqxPopupContent")))return i.activeTimer&&clearTimeout(i.activeTimer),f()}function h(c,o){t.IS(c,Function)&&t.IS(o,Number)&&o>0&&(d(),e.push(setTimeout(c,o*1e3)))}function g(c){if(!t.IS(c,String,HTMLElement,Proxy))return;let o=r.find$(".warn");switch(!0){case o.is.empty:o=t.div({class:"warn"},c);default:r.append(o.addClass("active")),h(()=>r.find$(".warn").removeClass("active"),2)}}}function q(t){let e={},r="anonymous_";function n(d){if(d){let{handler:b,capture:m,type:h}=d;document.addEventListener(h,b,{capture:m})}}function i(d){if(d){let{type:b,handler:m,capture:h}=d;document.removeEventListener(b,m,{capture:h})}}function a(d,b,m,h){return function(g){if(!T(b))return d({evt:g});let c=g.target.closest(b);if(c){let o=t(c);d({self:o,me:o,evt:g}),m&&y(g.type,h)}return!0}}function f(d){return e[d]=e[d]||{},e[d]}function S(d,b){return Object.entries(f(d)).find(([m])=>m===b)}function y(d,b){let m=S(d,b);m&&(i(m[1]),delete e[d][b],delete ee[b],w.warn(`Removed listener [${b}] for event type [${d}].`))}function x(d){let{type:b,handler:m,name:h,capture:g,once:c,selector:o,node:s,about:l}=d;e[b]=e[b]||{};let p=Ee(h||m.name),v=m;if(s instanceof HTMLElement){let F=s.dataset.hid||p;s.dataset.hid=F,o=`[data-hid=${F}]`}switch(!0){case!e[b][p]:return w.log(`JQx: created listener for event type ${b}, with handler name ${p}`),e[b][p]={name:p,handler:a(m,o,c,p),capture:Be(b,g),once:!!c,type:b,initialHandler:v,selector:!!o&&o||!1,about:!!l&&l||!1,unListen(){y(b,p)}},e[b][p];default:return console.warn(`The listener [${p}] for [${b}] exists, it is not re-assigned.`)}}return{remove(...d){return y(...d)},listen:function(d){let{type:b,handler:m}=d;if(!T(b)||!u(m,Function))return;let h=x(d);if(h)return n(h),{type:b,name:h.name,unListen(){y(b,h.name)}}},get ListenerStore(){return Object.freeze({...e})}}}var w=Gt(),Ut=["load","unload","scroll","focus","blur","DOMNodeRemovedFromDocument","DOMNodeInsertedIntoDocument","loadstart","progress","error","abort","load","loadend","pointerenter","pointerleave","readystatechange"],L=Object.freeze(new Proxy({start:"afterbegin",afterbegin:"afterbegin",end:"beforeend",beforeend:"beforeend",before:"beforebegin",beforebegin:"beforebegin",after:"afterend",afterend:"afterend"},{get(t,e){return t[String(e).toLowerCase()]??t[e]}})),Xt=[...Array(26)].map((t,e)=>String.fromCharCode(e+65)).concat([...Array(26)].map((t,e)=>String.fromCharCode(e+97))).concat([...Array(10)].map((t,e)=>`${e}`)),we=Object.freeze({get(t,e){return t[z(e)]||t[e]},enumerable:!1,configurable:!1}),ee={};function Te(){let t=setTimeout(()=>{});for(;t>=0;)clearTimeout(t--)}function Ee(t){return T(t)&&!/^handler|handlers$/gi.test(t.trim())?t.trim():We()}function Le(t){let e=!!t.node&&!u(t,Text,Comment);switch(!0){case e:let r=t.node.dataset?Object.keys(t.node.dataset).map(a=>`[data-${a}]`):[],i=[t.attr("id")&&`#${t?.attr("id")}`||void 0,t.attr("class")&&t?.attr("class").split(" ").map(a=>`.${a}`).join(", ")||void 0,r.length>0&&r.join(", ")||void 0].filter(a=>!!a).join(", ")||[];return i.length?`(${i})`:"";default:return""}}function We(t){let e=`anonymous_${Math.random().toString(36).slice(2)}`;return ee[e]?We():(ee[e]=e,e)}function Be(t,e){return!!Ut.find(r=>r===t)||!!e}function ne(t){return t.startsWith("data")||R.html.find(e=>t.toLowerCase()===e)}function oe(t){return t&&(t.textContent="")}function B(t,e=0,r=!0){return t=t?.parentElement,e+=t?t[r?"scrollTop":"scrollLeft"]:0,t?B(t,e,r):e}function T(t,e=1){return e=u(e,Number)&&e||1,u(t,String)&&t.length>=e}function G(t,e=120){return Z(t,e).replace(/</g,"<")}function Z(t,e=120){return`${t}`.trim().slice(0,e).replace(/>\s+</g,"><").replace(/</g,"<").replace(/\s{2,}/g," ").replace(/\n/g,"\\n")+(t.length>e?" …":"").trim()}function H(t){switch(!0){case u(t,String):let e=document.createElement("div");return e.append(t),e.innerHTML;default:return t}}function ve(t){return u(t,String)&&Object.assign(document.createElement("textarea"),{innerHTML:t}).textContent||t}function Gt(){let[t,e]=[!1,!0],r=[],n={get on(){return t=!0,n},get off(){return t=!1,n},get disable(){return e=!0,n},get enable(){return e=!1,n},get backLog(){return r}};function i(){e=!0}function a(){e=!1}function f(...x){return r.unshift(...x.map(d=>`${re()} \u2A3B ${ve(d)}`)),console.error(r.slice(0,x.length).join(`
|
|
14
|
+
`)),n}function S(...x){return r.unshift(...x.map(d=>`${re()} \u26A0 ${ve(d)}`)),console.warn(r.slice(0,x.length).join(`
|
|
15
|
+
`)),n}function y(...x){let d=x.map(b=>`${re()} \u2714 ${ve(b)}`);switch(!e&&r.unshift(...d),t){case!0:console.log(d.join(`
|
|
16
|
+
`));default:return n}}return Object.defineProperties(n,{log:{value:y,enumerable:!1},error:{value:f,enumerable:!1},warn:{value:S,enumerable:!1}}),Object.freeze(n)}function re(){return(t=>`[${te(t.getHours())}:${te(t.getMinutes())}:${te(t.getSeconds())}.${te(t.getMilliseconds(),3)}]`)(new Date)}function Ce(t,e){if(t)for(let[r,n]of Object.entries(e)){if(r=N(r),r.startsWith("data"))return ie(t,n);u(n,String)&&ne(r)&&t.setAttribute(r,n.split(/[, ]/)?.join(" "))}}function ie(t,e){if(t&&u(e,Object))for(let[r,n]of Object.entries(e))t.setAttribute(`data-${N(r)}`,n)}function se(t){return t?u(t,Proxy)?[t.EL]:u(t,NodeList)?[...t]:O(t)?[t]:_(t)?t:t.isJQx?t.collection:void 0:[]}function ae(t,e){return t.andThen(e)}function le(t,e){return t.andThen(e,!0)}function O(t){return u(t,Text,HTMLElement,Comment)}function W(t,e){if(u(e,Object))for(let[r,n]of Object.entries(e)){let i;/!important/i.test(n)&&(n=n.slice(0,n.indexOf("!")).trim(),i="important"),t.style.setProperty(N(r),n,i)}}function M(t){let e=t.cloneNode(!0);return e.removeAttribute&&e.removeAttribute("id"),t.isConnected?t.remove():t=null,e}function ze(t){if(!u(t,HTMLElement))return;let e=t.style,r=getComputedStyle(t),n=!![e.visibility,r.visibility].includes("hidden"),i=!![e.display,r.display].includes("none"),a=!!t.hidden,f=parseInt(r.height)<1||parseInt(r.width)<1,S=t.offsetTop<0||t.offsetLeft+t.offsetWidth<0||t.offsetLeft>document.body.offsetWidth,y=+r.opacity==0||+(e.opacity||1)==0;return!(a||S||y||i||n||f)}function Ye(t){return t?.isConnected?!![...document.querySelectorAll(":is(:read-write)")].find(e=>e===t):!1}function _e(t){return t?.filter(e=>e).reduce((e,r)=>e.concat(Ae(r)?`<!--${r.data}-->`:ce(r)?r.textContent:r.outerHTML),"")}function te(t,e=2){return`${t}`.padStart(e,"0")}function Ve(t,e=0){return[t,e]=[Math.floor(t),Math.ceil(e)],Math.floor([...crypto.getRandomValues(new Uint32Array(1))].shift()/2**32*(t-e+1)+e)}function ue(){return`_${Zt(Xt).slice(0,8).join("")}`}function Ne(t){return t=u(t,String)&&/,/.test(t)?t.split(",").map(e=>e.trim().toLowerCase()).filter(e=>e.length>0):t,u(t,Array)?t:u(t,String)&&t?.trim().toLowerCase()||""}function Ue(t){return t?.isConnected?!![...document.querySelectorAll(":is(:modal)")].find(e=>e===t):!1}function Fe(t,e){switch(t=String(t).trim(),!0){case/^(0|false|f)$/i.test(t):return!1;case/^(1|true|t)$/i.test(t):return!0;default:return e}}function Zt(t){let e=t.length;for(;e--;){let r=Ve(e);[t[e],t[r]]=[t[r],t[e]]}return t}function z(t){return u(t,String)?t.toLowerCase().split("-").map((e,r)=>r&&`${Kt(e)}`||e).join(""):t}function N(t){return t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`).replace(/^-|-$/,"")}function Kt([t,...e]){return`${t.toUpperCase()}${e.join("")}`}function ce(t){return u(t,Comment,Text)}function Ae(t){u(t,Comment)}function Xe(t){return u(t,Text)}function Y(t){return u(t,String)&&/^<|>$/.test(`${t}`.trim())}function _(t){return u(t,Array)&&!t?.find(e=>!O(e))}function fe(t){return u(t,Array)&&!t?.find(e=>!Y(e))}function E(t,e){let r=t.collection.filter(n=>!ce(n));for(let n=0;n<r.length;n+=1)e(r[n],n);return t}function Ge(t){return t.node?u(t.node,Comment)?`<!--${t.node.textContent}-->`:t.HTML.get(1).split(">")[0]+">...":""}function $e(t,e,r){let n=e!==document.body&&u(t,String)&&t.toLowerCase()!=="body"?e:document;try{r.collection=[...n.querySelectorAll(t)]}catch{w.warn(`JQx: Invalid CSS querySelector. [${u(t,String)?t:"Not a string!"}]`)}}function Ze(){return{isCommentOrTextNode:ce,isNode:O,isComment:Ae,isText:Xe,isHtmlString:Y,isArrayOfHtmlElements:_,isArrayOfHtmlStrings:fe,ElemArray2HtmlString:_e,input2Collection:se,setCollectionFromCssSelector:$e,cssRuleEdit:k({createWithId:"JQxStylesheet"})}}function Ke(){let e=Object.freeze({notInDOM:"n/a",writable:"n/a",modal:"n/a",empty:!0,open:"n/a",visible:"n/a"});return r=>{let n=r.node;return u(n,Node)?Object.freeze({get writable(){return Ye(n)},get modal(){return Ue(n)},get inDOM(){return n.isConnected},get open(){return n.open??!1},get visible(){return ze(n)},get disabled(){return n.hasAttribute("readonly")||n.hasAttribute("disabled")},get empty(){return r.collection.length<1},get virtual(){return r.isVirtual}}):e}}function qe(t,e,r,n){r&&u(e,String)&&(e={[e]:r==="-"?"":r});let i;e.className&&(i=e.className,delete e.className),i=[...t.classList].find(f=>f.startsWith("JQxClass-")||i&&f===i)||i||`JQxClass-${ue().slice(1)}`,n.editCssRule(`.${i}`,e),t.classList.add(i)}var qt=Ke();function et(t){return{factoryExtensions:er(t),instanceExtensions:tr(t)}}function er(t){return{data(e){return{get all(){return new Proxy(e[0]?.dataset??{},we)},set(r={}){if(!e.is.empty&&u(r,Object))for(let[n,i]of Object.entries(r))e.setData({[n]:i});return e},get(r,n){return e.data.all[r]??n},add(r={}){if(!e.is.empty&&u(r,Object))for(let[n,i]of Object.entries(r))e.setData({[n]:i});return e},remove(r){return e[0]?.removeAttribute(`data-${N(r)}`),e}}},dimensions(e){if(e.is.empty)return w.error("[JQx instance].dimensions called on empty instance"),{error:"[JQx instance].dimensions: NO ELEMENTS"};let{node:r}=e,n=r.getBoundingClientRect().toJSON();return n.scrollTopDistance=B(r,0),n.scrollLeftDistance=B(r,0,!1),n},node(e){return e[0]},HTML(e){return{get(r,n){if(e.is.empty)return"NO ELEMENTS IN COLLECTION";let i=r?e.outerHtml:e.html();return n?H(i):i},set(r,n=!1,i=!1){r=r.isJQx?r.HTML.get(1):r;let a=u(r,String);return r=a&&i?H(r):r,a&&(r||"").trim().length&&e.html(r,n),e},replace(r,n=!1){return e.HTML.set(r,!1,n)},append(r,n=!1){return r=u(r,HTMLElement)?t(r).HTML.get(1):r.isJQx?r.HTML.get(1):r,e.HTML.set(r,!0,n)},insert(r,n=!1){return r=u(r,HTMLElement)?t(r).HTML.get(1):r.isJQx?r.HTML.get(1):r,e.HTML.set(r+e.HTML.get(),!1,n)}}},is(e){return qt(e)},length(e){return e.collection.length},outerHtml(e){return(e.first()||{outerHTML:void 0}).outerHTML},parent(e){let r=t(e[0]?.parentNode);return r.is.empty?e:r},render(e){switch(!0){case!e.is.empty:return e.toDOM();default:return t.logger.warn("[JQx.render]: empty collection"),e}},Style(e){return{get computed(){return e.is.empty?{}:getComputedStyle(e[0])},inline(r){return e.style(r)},inSheet(r){return e.css(r)},valueOf(r){return e.is.empty?void 0:getComputedStyle(e[0])[N(r)]},nwRule(r){return e.Style.byRule({rules:r})},byRule({classes2Apply:r=[],rules:n=[]}={}){let a=u(n,String)&&!r.length?n.split("{")[0].trim():"";if(n=n&&u(n,String)?[n]:n,r=r&&u(r,String)?[r]:r,(n?.length||r?.length)&&(n?.length&&t.editCssRules(...n),r))for(let f of r)e.addClass(f);return a?.startsWith(".")&&e.addClass(a.slice(1)),a?.startsWith("#")&&!e.attr("id")&&e.prop({id:a.slice(1)}),e}}}}}function tr(t){return{addClass(e,...r){return E(e,n=>n&&r.forEach(i=>n.classList.add(i)))},after:ae,afterMe:ae,andThen(e,r,n=!1){if(!r||!u(r,String,Node,Proxy))return w.log("[JQx instance].[before(Me) | after(Me) | andThen]: invalid/-sufficient input."),e;r=r?.isJQx?r:u(r,Node)?t.virtual(r):t.virtual(C(r));let[i,a,f]=n?[0,"before",r.collection.concat(e.collection)]:[e.collection.length-1,"after",e.collection.concat(r.collection)];return e[i][a](...r.collection),e.collection=f,e},append(e,...r){if(e.is.empty||r.length<1)return e;let n=e.length===1;for(let i of r){if(!i.isJQx&&T(i)){let a=i.trim(),S=!/^<(.+)[^>]+>$/m.test(a)?t.text(i):C(i);E(e,y=>y.append(n?S:M(S)))}O(i)&&E(e,a=>a.append(n?i:M(i))),i.isJQx&&!i.is.empty&&E(e,a=>i.collection.forEach(f=>a.append(n?f:M(f))))}return e},appendTo(e,r){switch(!0){case(!r.isJQx&&!u(r,HTMLElement)):return $.warn("[JQx instance].appendTo: invalid input"),e;default:return(r.isJQx?r:t(r)).append(e),e}},attr(e,r,n){if(!e.node||u(e.node,Text,Comment))return e;if(!n&&T(r))return r=N(r),r==="class"?[...e.node.classList].join(" "):e.node.getAttribute(r);if(T(r)&&n)switch(r=N(r),!0){case r.startsWith("data-"):r={data:{[r.replace("data-","")]:n}};break;default:r={[r]:n}}return u(r,Object)&&!e.is.empty&&Ce(e.node,r),e},before:le,beforeMe:le,clear(e){return E(e,oe)},closest(e,r){let n=T(r)?e.node?.closest(r):void 0;return n?t(n):e},computedStyle(e,r){let{node:n}=e;return n&&getComputedStyle(n)[r]},css(e,r,n){return E(e,i=>qe(i,r,n,t))},duplicate(e,r=!1,n=document.body){switch(!0){case e.is.empty:return w.error("Duplicating an empty JQx instance is not possible"),e;default:let i=e.collection[0].cloneNode(!0);return i.childNodes.forEach(a=>{a.removeAttribute&&a?.removeAttribute("id")}),r?t(i).toDOM(n):t.virtual(i)}},each(e,r){return E(e,r)},empty(e){return E(e,oe)},find(e,r){return e.collection.length>0?[...e.first()?.querySelectorAll(r)]:[]},find$(e,r){return e.collection.length>0?t(r,e):e},first(e,r=!1){return e.collection.length>0?r?e.single():e.collection[0]:void 0},first$(e,r){return e.single(r)},getData(e,r,n){return e.node?.dataset?.[r]||n},hasClass(e,...r){return e.is.empty||!e.node.classList.length?!1:r.find(n=>e.node.classList.contains(n))&&!0||!1},hide(e){return E(e,r=>W(r,{display:"none !important"}))},html(e,r,n){switch(!0){case(e.is.empty&&!T(r)):return"";case!T(r):return e.node?.getHTML()??"";default:let i=C(`<div>${r.isJQx?r.HTML.get(!0):r}</div>`);return E(e,f=>(f.textContent=n?f.textContent:"",f.insertAdjacentHTML(t.at.end,i.getHTML())))}},htmlFor(e,r,n="",i=!1){if(e.is.empty||!T(r)||!T(n))return e;let a=e.find$(r);if(a.length<1)return e;let f=C(`<span>${n}</span>`);return a.each(S=>{i||(S.textContent=""),S.insertAdjacentHTML(t.at.end,f?.getHTML())}),e},isEmpty(e){return!e.node},nth$(e,r){return e.single(r)},on(e,r,...n){switch(!0){case(e.is.empty||!u(r,String,Array)||!T(r)||n.length<1):return e;default:return t.handle({type:r,node:e.node,handler:n}),e}},once(e,r,...n){switch(!0){case(e.is.empty||!u(r,String,Array)||!T(r)||n.length<1):return e;default:return t.handle({type:r,once:!0,node:e.node,handler:n}),e}},prepend(e,...r){if(e.is.empty||!r)return;let n=e.length===1;for(let i of r){if(T(i)){i=i.trim();let f=!/^<(.+)[^>]+>$/m.test(i)?t.text(i):C(i);f=n?f:M(f),E(e,S=>S.prepend(f.cloneNode(!0)))}O(i)&&E(e,a=>a.prepend(n?i:M(i))),i.isJQx&&!i.is.empty&&(i.collection.length>1&&i.collection.reverse(),E(e,a=>E(i,f=>a.prepend(n?f:M(f)))),i.collection.reverse())}return e},prependTo(e,r){return r.isJQx||(r=t.virtual(r)),r.prepend(e),e},prop(e,r,n){if(u(r,String)&&!n)return r.startsWith("data")?e[0]?.dataset[r.slice(r.indexOf("-")+1)]:e[0]?.[r];let i=u(r,Object)?r:{[r]:n};for(let[a,f]of Object.entries(i)){if(a=a.trim(),f&&!ne(a)||!f)return!1;if(a.toLowerCase()==="id")return e[0].id=f;E(e,y=>{if(a.startsWith("data"))return y.dataset[a.slice(a.indexOf("-")+1)]=f;y[a]=f})}return e},remove(e,r){let n=a=>a.remove(),i=()=>e.collection=e.collection.filter(a=>document.documentElement.contains(a));if(r){let a=e.find$(r);return a.is.empty||(E(a,n),i()),e}return E(e,n),i(),e},rmAttr(e,...r){for(let n of r)e.node.removeAttribute(n);return e},removeClass(e,...r){return E(e,n=>{if(n)for(let i of r)n.classList.remove(i)})},renderTo(e,r,n){return r=u(r,HTMLElement)||r.isJQx?r:document.body,n=u(n,String)&&t.at[n]?n:t.at.end,e.first$().toDOM(r,n),e},replace(e,r,n){let i=e.node;return!r||!u(n,HTMLElement)&&!n?.isJQx?(t.logger.error("JQx replace: invalid replacement value"),e):((n.isJQx||u(n,NodeList))&&(n=n[0]),i&&r&&(r=u(r,String)?i.querySelectorAll(r):r.isJQx?r.collection:r,u(r,HTMLElement,NodeList,Array)&&u(n,HTMLElement)&&(u(r,HTMLElement)?[r]:[...r]).forEach(a=>a.replaceWith(n.cloneNode(!0)))),e)},replaceClass(e,r,...n){return E(e,i=>{i.classList.remove(r);for(let a of n)i.classList.add(a)})},replaceMe(e,r){return e.replaceWith(r)},replaceWith(e,r){return r=u(r,Element)?r:r.isJQx?r[0]:void 0,r&&(e[0].replaceWith(r),e=t.virtual(r)),e},setData(e,r){return E(e,n=>ie(n,r))},show(e){return E(e,r=>W(r,{display:"revert-layer !important"}))},single(e,r){let n=e.collection.length>0;switch(r=r??0,!0){case(n&&u(r,String)):return e.find$(r);case(n&&u(r,Number)):return t(e.collection[r]);case n:return e.collection[0];default:return e}},style(e,r,n){return E(e,a=>{n&&u(r,String)&&(r={[r]:n||"none"}),W(a,r)})},text(e,r,n=!1){switch(!0){case e.isEmpty():return e;case!u(r,String):return e.node.textContent;default:return E(e,i=>i.textContent=n?i.textContent+r:r)}},toDOM(e,r=document.body,n=L.BeforeEnd){return e.isVirtual=!1,D(e.collection,r,n),e},toggleClass(e,r){return E(e,n=>n.classList.toggle(r))},toNodeList(e){return[...e.collection].map(r=>document.importNode(r,!0))},trigger(e,r,n,i){n=u(n,Function)?n:Event,i=u(i,Object)?{...i,bubbles:i.bubbles??!0}:{bubbles:!0};let a=new n(r,i);return e.is.empty||e.each(f=>f.dispatchEvent(a)),e},val(e,r){switch(!0){case(e.is.empty||!u(e.node,HTMLInputElement,HTMLSelectElement,HTMLTextAreaElement)):return e;case!u(r,String):return e.node.value;default:return e.node.value=u(r,String)?r:"",e}}}}var Pe,de,{isComment:dn,isText:mn,isHtmlString:gn,isArrayOfHtmlElements:pn,isArrayOfHtmlStrings:yn,ElemArray2HtmlString:bn,cssRuleEdit:Oe,addFn:rr}=nr();function nr(){return{...Ze(),addFn:or}}function or(t,e){return t=t?.trim(),!T(t)||!u(e,Function)?w.error("JQx.fn: method invalid parameter(s)"):de[t]=(r,...n)=>e(r,...n)}function ir(t){return function(e,r,n){if(e=e?.trim(),!T(e)||!u(r,Function))return t.error("JQx.staticFn: invalid parameter(s)");let i=n?{get(){return r()}}:{value(...a){return r(...a)}};try{Object.defineProperty(t,e,i)}catch{return t.warn(`JQx.staticFn: extension [${e}] already exists`)}return w.log(`JQx: added static extension function [${e}]`)}}function V(t){return new Proxy(t,Object.freeze({get:(e,r)=>sr(e,r,t)}))}function tt(t,e){return(...r)=>u(t,Function)&&t(V(e),...r)}function sr(t,e,r){switch(!0){case u(e,Symbol):return A({trial:()=>t[e],whenError:()=>t});case u(+e,Number):return t.collection?.[e]||void 0;case e in Pe:return tt(Pe[e],r)();case e in de:return tt(de[e],r);default:return t[e]}}function ot(t){let e=fr(t);for(let[r,n]of Object.entries(Object.getOwnPropertyDescriptors(e)))Object.defineProperty(t,r,n);return t}function ar(t){return{allow(e){let r=/-/.test(e),n=r&&e;e=r?z(e):e.toLowerCase(),P.allowTag(e),Object.defineProperties(t,He(e,!0,t,n))},prohibit(e){e=e.toLowerCase(),P.prohibitTag(e),Object.defineProperties(t,He(e,!1,t))}}}function rt(...t){if(t.length===1){let e=String(t.shift().trim());t=e.startsWith("!")?[e.slice(1,-1)]:e.split(",").map(r=>r.trim())}for(let e of t.map(r=>r.startsWith("!")?r.slice(1,-1):r))Oe(e,{removeRule:1})}function lr(t){return function(e,r,n){r=r?.isJQx?r?.[0]:r,n=n&&Object.values(L).find(a=>n===a);let i=t(e,document.createElement("br"));if(r&&!u(r,HTMLBRElement))for(let a of i.collection)n?r.insertAdjacentElement(n,a):r.append(a);return i}}function ur(...t){let e={};for(let r of t){let n=Object.getOwnPropertyDescriptors(r);for(let[i,a]of Object.entries(n))!(i in e)&&Object.defineProperty(e,i,{...a,enumerable:!1})}return e}function cr(t,e,r,n){return t=N(n||t.toLowerCase()),{get(){return(...i)=>{let a=e&&r.virtual(I(U[t](...i)))||void 0,S=!u(a?.node,Comment,Text,void 0)?Le(a):"";return w.log(e?`JQx: created (virtual) instance from [JQx].${t} ${S}`:`JQx: ${t.toUpperCase()} is prohibited. Use [JQx].allowTag if necessary.`),a}},enumerable:!1,configurable:!0}}function He(t,e,r,n){t=t.toLowerCase();let i=cr(t,e,r,n);return n?{[n]:i,[z(n)]:i}:{[t]:i,[t.toUpperCase()]:i}}function fr(t){return ur(Object.entries(P.tagsRaw).reduce(dr(t),{}),hr(t))}function dr(t){return function(e,[r,n]){return Object.defineProperties(e,He(r,n,t)),e}}function mr(t){return function(e,r,...n){u(r,Function)&&(n.push(r),r=void 0),t({type:e,selector:r,handlers:n})}}function gr(t){return function(e){let{type:r,types:n,origin:i,selector:a,handler:f,handlers:S,node:y,name:x,capture:d,once:b,about:m}=e;f=S||f,r=n||r,a=i||a;let h=Ne(r),g=x;f=u(f,Function)?[f]:f;let c={type:h,selector:a||i,capture:d,name:g,once:b,node:y,about:m};switch(!0){case(u(h,Array)&&h.length>0):for(let o of h)c.type=o,nt(f,c,t);break;default:return nt(f,c,t)}}}function nt(t,e,r){for(let n of t)r.listen({...e,handler:n})}function pr(t){return function(e,r){return r=T(r)&&r,e=T(e)&&e,r&&e&&t.listenerStore[e][r]}}function yr(t){return t.activePopup||Object.defineProperty(t,"activePopup",{value:K(t),enumerable:!1}),t.activePopup}function br(t){let e=(d,b)=>Oe(d,b),r=function(d){return k({createWithId:d||`jqx${ue()}`})},n=function(...d){for(let b of d)Oe(b)},i=ar(t),a=q(t),f=gr(a);return{editCssRule:e,createStyle:r,editCssRules:n,allowProhibit:i,handle:f,capturedHandling:f,log:(...d)=>w.on.log(...d).off,warn:(...d)=>w.on.warn(...d).off,error:(...d)=>w.on.error(...d).off,handlerWrapper:a}}function hr(t){let{factoryExtensions:e,instanceExtensions:r}=et(t);Pe=e,de=r;let{editCssRule:n,createStyle:i,editCssRules:a,allowProhibit:f,handle:S,capturedHandling:y,log:x,warn:d,error:b,handlerWrapper:m}=br(t),h=pr(t),g=ir(t);return{log:x,warn:d,error:b,editCssRules:a,createStyle:i,editStylesheet:i,editCssRule:n,escHtml:H,logger:w,text(c,o=!1){return o?t.comment(c):document.createTextNode(c)},node(c,o=document){return o.querySelector(c,o)},nodes(c,o=document){return[...o.querySelectorAll(c,o)]},clearAllTimers:Te,get staticFn(){return function(c,o,s){return g(c,o,s)}},get toBool(){return Fe},get getNamedListener(){return h},get virtual(){return lr(t)},get allowTag(){return f.allow},get prohibitTag(){return f.prohibit},get removeCssRule(){return rt},get removeCssRules(){return rt},get delegate(){return mr(y)},get delegateCaptured(){return y},get handle(){return y},get listen(){return m.listen},get at(){return L},get setStyle(){return n},get fn(){return rr},get lenient(){return P.allowUnknownHtmlTags},get IS(){return u},get Popup(){return yr(t)},get listenerStore(){return m.ListenerStore}}}var it=ot(Sr());function Sr(){return function(e,r,n=L.BeforeEnd){if(e?.isJQx)return e;let i=u(r,HTMLBRElement);r=(!i&&r&&r.isJQx?r[0]:r)||document.body,n=n&&Object.values(L).find(d=>n===d)?n:void 0;let a=Y(e),S=!a&&fe(e)||a,y={collection:se(e)??[],isVirtual:i,isJQx:!0},x=_(y.collection);if(y.collection.length&&x)return i||y.collection.forEach(d=>{r.contains(d)||D([d],r,n)}),V(y);if(S){if([e].flat().forEach(d=>y.collection.push(C(d))),y.collection.length>0){let d=y.collection.filter(g=>g?.dataset?.jqxcreationerror);y.collection=y.collection.filter(g=>!g?.dataset?.jqxcreationerror);let m=y.collection.map(g=>`${String(g.constructor).split(/function|\(/)[1].trim()}`).length>1;y=V(y);let h=y.collection.length>0?Ge(y):"sanitized: no elements remaining";w.log(`JQx: created ${y.isVirtual?"(virtual)":""} instance from ${m?"array of ":""}HTML string${m?"s":""} ${h}`),y.isVirtual||D(y.collection,r,n)}return y}return $e(e,r,y),V(y)}}var xr=it;return ft(Er);})();
|
package/Bundle/jqx.min.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
var{IS:s,maybe:W,$Wrap:pr,isNothing:yr,xProxy:br,addSymbolicExtensions:hr}=ct({useSymbolicExtensions:!1});function ct(t={}){let{useSymbolicExtensions:e}=t,{xProxy:r,addSymbolicExtensions:n}=ft(a,f,e),o=C(),[i]=[N()];return r.custom(),e&&n(),{IS:a,maybe:o,$Wrap:i,isNothing:b,xProxy:r,addSymbolicExtensions:n};function a(l,...d){let v=typeof l=="symbol"?Symbol.isSymbol:l;switch(!0){case!!o({trial:L=>"isTypes"in(d?.[0]??{})}):return w(l,d[0]);default:return d.length>1?m(v,...d):E(l,...d)}}function w(l,d){switch(!0){case"defaultValue"in d:return u(l,d);case"notTypes"in d:return y(l,d);default:return a(l,...[d.isTypes].flat())}}function f(l){return l?.[Symbol.proxy]??a(l)}function E(l,...d){let{noInput:v,noShouldbe:L,compareTo:O,inputCTOR:J,isNaN:B,isInfinity:at,shouldBeFirstElementIsNothing:ut}=c(l,...d);switch(d=d.length&&d[0],!0){case ut:return String(l)===String(O);case(l?.[Symbol.proxy]&&L):return l[Symbol.proxy];case B:return L?"NaN":String(O)===String(l);case at:return L?"Infinity":String(O)===String(l);case v:return L?String(l):String(O)===String(l);case J===Boolean:return d?J===d:"Boolean";default:return g(l,d,L,h(l,J))}}function c(l,...d){let v=d.length<1,L=l==null;return{noInput:L,noShouldbe:v,compareTo:!v&&d[0],inputCTOR:!L&&Object.getPrototypeOf(l)?.constructor,isNaN:Number.isNaN(l)||o({trial:O=>String(l)==="NaN"}),isInfinity:o({trial:O=>String(l)})==="Infinity",shouldBeFirstElementIsNothing:!v&&b(d[0])}}function h(l,d){switch(!0){case l===0:return Number;case l==="":return String;case!l:return{name:String(l)};default:return d}}function g(l,d,v,L){switch(!0){case(!v&&d===l||l?.[Symbol.proxy]&&d===Proxy):return!0;case String(d)==="NaN":return String(l)==="NaN";case(l?.[Symbol.toStringTag]&&typeof d=="string"):return String(d)===l[Symbol.toStringTag];default:return d?p(l,d,L):S(l,L)}}function S(l,d){return(l?.[Symbol.toStringTag]??l?.prototype?.[Symbol.toStringTag])||d?.name||String(d)}function p(l,d,v){return o({trial:L=>l instanceof d})||d===v||d===Object.getPrototypeOf(v)||`${d?.name}`===v?.name}function m(l,...d){return d.some(v=>a(l,v))}function b(l,d=!1){let v=l==null;return v=d?v||a(l,1/0)||a(l,NaN):v,v}function C(){let l=d=>{};return function({trial:d,whenError:v=l}={}){try{return d()}catch(L){return v(L)}}}function N(){return function(l){return Object.freeze({get value(){return l},get[Symbol.type](){return f(l)},get type(){return f(l)},[Symbol.is](...d){return a(l,...d)},is(...d){return a(l,...d)}})}}function u(l,{defaultValue:d,isTypes:v=[void 0],notTypes:L}={}){return v=v?.constructor!==Array?[v]:v,L=L&&L?.constructor!==Array?[L]:[],L.length<1?a(l,...v)?l:d:y(l,{isTypes:v,notTypes:L})?l:d}function y(l,{isTypes:d=[void 0],notTypes:v=[void 0]}={}){return d=d?.constructor!==Array?[d]:d,v=v?.constructor!==Array?[v]:v,a(l,...d)&&!a(l,...v)}function x(){Object.getOwnPropertyDescriptors(Object.prototype)[Symbol.is]||(Object.defineProperties(Object.prototype,{[Symbol.type]:{get(){return f(this)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(...l){return a(this,...l)},enumerable:!1,configurable:!1}}),Object.defineProperties(Object,{[Symbol.type]:{value(l){return f(l)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(l,...d){return a(l,...d)},enumerable:!1,configurable:!1}}))}}function ft(t,e,r){return Symbol.isSymbol||(Symbol.isSymbol=Symbol.for("toa.isASymbol")),{xProxy:w(),addSymbolicExtensions:n};function n(){Symbol.is||(Symbol.is=Symbol.for("toa.is"),Symbol.type=Symbol.for("toa.type")),Object.getOwnPropertyDescriptors(Object.prototype)[Symbol.is]||(Object.defineProperties(Object.prototype,{[Symbol.type]:{get(){return e(this)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(...f){return t(this,...f)},enumerable:!1,configurable:!1}}),Object.defineProperties(Object,{[Symbol.type]:{value(f){return e(f)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(f,...E){return t(f,...E)},enumerable:!1,configurable:!1}}))}function o(f){let E=f.set;return f.set=(c,h,g)=>h===Symbol.proxy?c[h]=g:E(c,h,g),f}function i(f){return Object.getPrototypeOf(f)?.constructor?.name||"Object"}function a(f){return Proxy=new f(f,{construct(E,c){for(let g of c)g.set&&(g=o(g));let h=new E(...c);return h[Symbol.proxy]=`Proxy (${i(c[0])})`,h}}),Proxy}function w(){Symbol.proxy||(Symbol.proxy=Symbol.for("toa.proxy"));let f=Proxy;return{native(){Proxy=f},custom(){Proxy=a(f)}}}}var Ie=gt(),z=dt(),V=mt();function dt(){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 mt(){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 gt(){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 je={html:"innerHTML",text:"textContent",class:"className"},ee=pt();function pt(){let t={get(e,r){let n=String(r)?.toLowerCase();switch(!0){case n in e:return e[n];case Ct(n):return Re(e,n,r);default:return Re(e,n,r,!0)}},enumerable:!1,configurable:!1};return new Proxy({},t)}function Re(t,e,r,n=!1){return Object.defineProperty(t,e,{get(){return n?o=>wt(r):Lt(e)}}),t[e]}function yt(t,e,r){return e=e?.isJQx&&e.first()||e,W({trial:n=>Et(e)?t.append(e):Qe(e)?t.insertAdjacentHTML("beforeend",e):t.append(e),whenError:n=>console.info(`${r} (for root ${t}) not created, reason
|
|
2
|
-
`,n)})}function
|
|
3
|
-
=> @charset, @namespace and @import are not supported here`),{done:!0}}function
|
|
4
|
-
${
|
|
5
|
-
Rule: ${
|
|
6
|
-
${r}`),
|
|
7
|
-
${
|
|
8
|
-
Rule: ${
|
|
9
|
-
${r}`),
|
|
10
|
-
`)}function
|
|
11
|
-
`).map(n=>n.replace(/\s|\/\/.*$/g,"").trim().replace(/(@s!)/g," ")).join(""),r)}function
|
|
1
|
+
var{IS:u,maybe:A,$Wrap:mr,isNothing:gr,xProxy:pr,addSymbolicExtensions:yr}=it({useSymbolicExtensions:!1});function it(t={}){let{useSymbolicExtensions:e}=t,{shouldbeIsSingleObject:r,ISOneOf:n,isExcept:i,verifyNothingness:a,xProxy:f,determineType:S,addSymbolicExtensions:y,maybe:x,$Wrap:d}=st(b,e);return f.custom(),e&&y(),{IS:b,maybe:x,$Wrap:d,isNothing:a,xProxy:f,addSymbolicExtensions:y};function b(m,...h){let g=typeof m=="symbol"?Symbol.isSymbol:m;switch(!0){case!!x({trial:c=>"isTypes"in(h?.[0]??{})}):return r(m,h[0]);default:return h.length>1?n(g,...h):S(m,...h)}}}function st(t,e){let{SymbolAndCustomProxyFactory:r,maybeFactory:n,WrapAnyFactory:i,verifyNothingness:a,determineType:f}=at(t,b),{xProxy:S,addSymbolicExtensions:y}=r(t,b,e),[x,d]=[n(),i(t,b)];return Object.freeze({shouldbeIsSingleObject:m,ISOneOf:h,isExcept:c,verifyNothingness:a,xProxy:S,determineType:f,addSymbolicExtensions:y,maybe:x,$Wrap:d});function b(o){return o?.[Symbol.proxy]??t(o)}function m(o,s){switch(!0){case"defaultValue"in s:return g(o,s);case"notTypes"in s:return c(o,s);default:return t(o,...[s.isTypes].flat())}}function h(o,...s){return s.some(l=>t(o,l))}function g(o,{defaultValue:s,isTypes:l=[void 0],notTypes:p}={}){return l=l?.constructor!==Array?[l]:l,p=p&&p?.constructor!==Array?[p]:[],p.length<1?t(o,...l)?o:s:c(o,{isTypes:l,notTypes:p})?o:s}function c(o,{isTypes:s=[void 0],notTypes:l=[void 0]}={}){return s=s?.constructor!==Array?[s]:s,l=l?.constructor!==Array?[l]:l,t(o,...s)&&!t(o,...l)}}function at(){let t={IS:"toa.is",TYPE:"toa.type",IS_SYMBOL:"toa.isASymbol",PROXY:"toa.proxy"},e={NAN:"NaN",INFINITY:"Infinity",BOOLEAN:"Boolean",OBJECT:"Object",PROXY_PREFIX:"Proxy ("};return Object.freeze({SymbolAndCustomProxyFactory:n,maybeFactory:g,WrapAnyFactory:h,verifyNothingness:c,determineType:y});function r(o,s){Symbol.is||(Symbol.is=Symbol.for(t.IS),Symbol.type=Symbol.for(t.TYPE),Object.defineProperties(Object.prototype,{[Symbol.type]:{get(){return s(this)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(...l){return o(this,...l)},enumerable:!1,configurable:!1}}),Object.defineProperties(Object,{[Symbol.type]:{value(l){return s(l)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(l,...p){return o(l,...p)},enumerable:!1,configurable:!1}}))}function n(o,s,l){return Symbol.isSymbol||(Symbol.isSymbol=Symbol.for(t.IS_SYMBOL)),{xProxy:f(),addSymbolicExtensions:()=>r(o,s)}}function i(o){return Object.getPrototypeOf(o)?.constructor?.name||e.OBJECT}function a(o){return Proxy=new o(o,{construct(s,l){let p=new s(...l);return p[Symbol.proxy]=`${e.PROXY_PREFIX}${i(l[0])})`,p}}),Proxy}function f(){Symbol.proxy||(Symbol.proxy=Symbol.for(t.PROXY));let o=Proxy;return{native(){Proxy=o},custom(){Proxy=a(o)}}}function S(o,...s){let l=s.length<1,p=o==null;return{noInput:p,noShouldbe:l,compareTo:!l&&s[0],inputCTOR:!p&&(o?.constructor||Object.getPrototypeOf(o)?.constructor),isNaN:Number.isNaN(o)||A({trial:v=>String(o)===e.NAN}),isInfinity:A({trial:v=>String(o)})===e.INFINITY,shouldBeFirstElementIsNothing:!l&&c(s[0])}}function y(o,...s){let{noInput:l,noShouldbe:p,compareTo:v,inputCTOR:F,isNaN:me,isInfinity:ge,shouldBeFirstElementIsNothing:pe}=S(o,...s);switch(s=s.length&&s[0],!0){case pe:return String(o)===String(v);case(o?.[Symbol.proxy]&&p):return o[Symbol.proxy];case me:return p?e.NAN:String(v)===String(o);case ge:return p?e.INFINITY:String(v)===String(o);case l:return p?String(o):String(v)===String(o);case F===Boolean:return p?e.BOOLEAN:F===s;default:return d(o,s,p,x(o,F))}}function x(o,s){switch(!0){case o===0:return Number;case o==="":return String;case!o:return{name:String(o)};default:return s}}function d(o,s,l,p){switch(!0){case(!l&&s===o||o?.[Symbol.proxy]&&s===Proxy):return!0;case String(s)===e.NAN:return String(o)===e.NAN;case(o?.[Symbol.toStringTag]&&typeof s=="string"):return String(s)===o[Symbol.toStringTag];default:return s?m(o,s,p):b(o,p)}}function b(o,s){return(o?.[Symbol.toStringTag]??o?.prototype?.[Symbol.toStringTag])||s?.name||String(s)}function m(o,s,l){return A({trial:p=>o instanceof s})||s===l||s===Object.getPrototypeOf(l)||`${s?.name}`===l?.name}function h(o,s){return function(l){let p={get value(){return l},is(...v){return o(l,...v)},get type(){return s(l)}};return Object[Symbol.type]&&Object.defineProperties(p,{[Symbol.type]:{get(){return s(l)}},[Symbol.is]:{value(...v){return o(l,...v)}}}),Object.freeze(p)}}function g(){let o=s=>{};return function({trial:s,whenError:l=o}={}){try{return s()}catch(p){return l(p)}}}function c(o,s=!1){let l=o==null;return l=s?l||u(o,1/0)||u(o,NaN):l,l}}var He=ct(),R=lt(),J=ut();function lt(){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 ut(){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["::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 Me={html:"innerHTML",text:"textContent",class:"className"},U=ft();function ft(){let t={get(e,r){let n=String(r)?.toLowerCase();switch(!0){case n in e:return e[n];case xt(n):return Ie(e,n,r);default:return Ie(e,n,r,!0)}},enumerable:!1,configurable:!1};return new Proxy({},t)}function Ie(t,e,r,n=!1){return Object.defineProperty(t,e,{get(){return n?i=>ht(r):Et(e)}}),t[e]}function dt(t,e,r){return e=e?.isJQx&&e.first()||e,A({trial:n=>St(e)?t.append(e):Re(e)?t.insertAdjacentHTML("beforeend",e):t.append(e),whenError:n=>console.info(`${r} (for root ${t}) not created, reason
|
|
2
|
+
`,n)})}function mt(t,e,...r){let n=gt(e,t);return r?.forEach(i=>dt(n,i,t)),n}function gt(t,e){switch(t=ye(e)?bt(t):t?.isJQx?t.first():t,!0){case u(t,String):return Q(e,Re(t,e)?{html:t}:{text:t});case u(t,Node):return yt(e,t);default:return Q(e,t)}}function pt(t){return delete t.data,Object.keys(t).length<1||Object.keys(t).forEach(e=>{let r=e.toLowerCase();r in Me&&(t[Me[r]]=t[e],delete t[e])}),t}function yt(t,e){let r=Q(t);return r.append(e),r}function Q(t,e={}){e=De(e,{});let r=Object.entries(e.data??{}),n=Object.assign(ye(t)?new Comment(e?.text):document.createElement(t),pt(e));return r.length&&r.forEach(([i,a])=>n.dataset[i]=String(a)),n}function De(t,e){return e?u(t,{isTypes:Object,notTypes:[Array,null,NaN,Proxy],defaultValue:e}):u(t,{isTypes:Object,notTypes:[Array,null,NaN,Proxy]})}function bt(t){return De(t)?t?.text??t?.textContent??"":String(t)}function ht(t){return Q("b",{style:"color:red",text:`'${t}' is not a valid HTML-tag`})}function Re(t,e){return!ye(e)&&u(t,String)&&/<.*>|&[#|0-9a-z]+[^;];/i.test(t)}function St(t){return t?.constructor===Comment||t?.constructor===CharacterData}function ye(t){return t?.constructor===Comment||/comment/i.test(t)}function xt(t){return!u(Q(t),HTMLUnknownElement)}function Et(t){return(e,...r)=>mt(t,e,...r)}var{IS:j,maybe:be,$Wrap:Er,isNothing:vr,xProxy:wr,addSymbolicExtensions:Tr}=vt({useSymbolicExtensions:!1});function vt(t={}){let{useSymbolicExtensions:e}=t,{shouldbeIsSingleObject:r,ISOneOf:n,isExcept:i,verifyNothingness:a,xProxy:f,determineType:S,addSymbolicExtensions:y,maybe:x,$Wrap:d}=wt(b,e);return f.custom(),e&&y(),{IS:b,maybe:x,$Wrap:d,isNothing:a,xProxy:f,addSymbolicExtensions:y};function b(m,...h){let g=typeof m=="symbol"?Symbol.isSymbol:m;switch(!0){case!!x({trial:c=>"isTypes"in(h?.[0]??{})}):return r(m,h[0]);default:return h.length>1?n(g,...h):S(m,...h)}}}function wt(t,e){let{SymbolAndCustomProxyFactory:r,maybeFactory:n,WrapAnyFactory:i,verifyNothingness:a,determineType:f}=Tt(t,b),{xProxy:S,addSymbolicExtensions:y}=r(t,b,e),[x,d]=[n(),i(t,b)];return Object.freeze({shouldbeIsSingleObject:m,ISOneOf:h,isExcept:c,verifyNothingness:a,xProxy:S,determineType:f,addSymbolicExtensions:y,maybe:x,$Wrap:d});function b(o){return o?.[Symbol.proxy]??t(o)}function m(o,s){switch(!0){case"defaultValue"in s:return g(o,s);case"notTypes"in s:return c(o,s);default:return t(o,...[s.isTypes].flat())}}function h(o,...s){return s.some(l=>t(o,l))}function g(o,{defaultValue:s,isTypes:l=[void 0],notTypes:p}={}){return l=l?.constructor!==Array?[l]:l,p=p&&p?.constructor!==Array?[p]:[],p.length<1?t(o,...l)?o:s:c(o,{isTypes:l,notTypes:p})?o:s}function c(o,{isTypes:s=[void 0],notTypes:l=[void 0]}={}){return s=s?.constructor!==Array?[s]:s,l=l?.constructor!==Array?[l]:l,t(o,...s)&&!t(o,...l)}}function Tt(){let t={IS:"toa.is",TYPE:"toa.type",IS_SYMBOL:"toa.isASymbol",PROXY:"toa.proxy"},e={NAN:"NaN",INFINITY:"Infinity",BOOLEAN:"Boolean",OBJECT:"Object",PROXY_PREFIX:"Proxy ("};return Object.freeze({SymbolAndCustomProxyFactory:n,maybeFactory:g,WrapAnyFactory:h,verifyNothingness:c,determineType:y});function r(o,s){Symbol.is||(Symbol.is=Symbol.for(t.IS),Symbol.type=Symbol.for(t.TYPE),Object.defineProperties(Object.prototype,{[Symbol.type]:{get(){return s(this)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(...l){return o(this,...l)},enumerable:!1,configurable:!1}}),Object.defineProperties(Object,{[Symbol.type]:{value(l){return s(l)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(l,...p){return o(l,...p)},enumerable:!1,configurable:!1}}))}function n(o,s,l){return Symbol.isSymbol||(Symbol.isSymbol=Symbol.for(t.IS_SYMBOL)),{xProxy:f(),addSymbolicExtensions:()=>r(o,s)}}function i(o){return Object.getPrototypeOf(o)?.constructor?.name||e.OBJECT}function a(o){return Proxy=new o(o,{construct(s,l){let p=new s(...l);return p[Symbol.proxy]=`${e.PROXY_PREFIX}${i(l[0])})`,p}}),Proxy}function f(){Symbol.proxy||(Symbol.proxy=Symbol.for(t.PROXY));let o=Proxy;return{native(){Proxy=o},custom(){Proxy=a(o)}}}function S(o,...s){let l=s.length<1,p=o==null;return{noInput:p,noShouldbe:l,compareTo:!l&&s[0],inputCTOR:!p&&(o?.constructor||Object.getPrototypeOf(o)?.constructor),isNaN:Number.isNaN(o)||be({trial:v=>String(o)===e.NAN}),isInfinity:be({trial:v=>String(o)})===e.INFINITY,shouldBeFirstElementIsNothing:!l&&c(s[0])}}function y(o,...s){let{noInput:l,noShouldbe:p,compareTo:v,inputCTOR:F,isNaN:me,isInfinity:ge,shouldBeFirstElementIsNothing:pe}=S(o,...s);switch(s=s.length&&s[0],!0){case pe:return String(o)===String(v);case(o?.[Symbol.proxy]&&p):return o[Symbol.proxy];case me:return p?e.NAN:String(v)===String(o);case ge:return p?e.INFINITY:String(v)===String(o);case l:return p?String(o):String(v)===String(o);case F===Boolean:return p?e.BOOLEAN:F===s;default:return d(o,s,p,x(o,F))}}function x(o,s){switch(!0){case o===0:return Number;case o==="":return String;case!o:return{name:String(o)};default:return s}}function d(o,s,l,p){switch(!0){case(!l&&s===o||o?.[Symbol.proxy]&&s===Proxy):return!0;case String(s)===e.NAN:return String(o)===e.NAN;case(o?.[Symbol.toStringTag]&&typeof s=="string"):return String(s)===o[Symbol.toStringTag];default:return s?m(o,s,p):b(o,p)}}function b(o,s){return(o?.[Symbol.toStringTag]??o?.prototype?.[Symbol.toStringTag])||s?.name||String(s)}function m(o,s,l){return be({trial:p=>o instanceof s})||s===l||s===Object.getPrototypeOf(l)||`${s?.name}`===l?.name}function h(o,s){return function(l){let p={get value(){return l},is(...v){return o(l,...v)},get type(){return s(l)}};return Object[Symbol.type]&&Object.defineProperties(p,{[Symbol.type]:{get(){return s(l)}},[Symbol.is]:{value(...v){return o(l,...v)}}}),Object.freeze(p)}}function g(){let o=s=>{};return function({trial:s,whenError:l=o}={}){try{return s()}catch(p){return l(p)}}}function c(o,s=!1){let l=o==null;return l=s?l||j(o,1/0)||j(o,NaN):l,l}}var k=Lt;function Lt({styleSheet:t,createWithId:e}={}){let{tryParseAtOrNestedRules:r,ruleExists:n,checkParams:i,sheet:a,removeRules:f,consider:S,currentSheetID:y}=Ct({styleSheet:t,createWithId:e});function x(g,c){if(g&&c.removeProperties){Object.keys(c.removeProperties).forEach(o=>g.style.removeProperty(je(o)));return}Object.entries(c).forEach(([o,s])=>{o=je(o.trim()),s=s.trim();let l;if(/!important/.test(s)&&(s=s.slice(0,s.indexOf("!important")).trim(),l="important"),!CSS.supports(o,s))return console.error(`StylingFactory ${y} error: '${o}' with value '${s}' not supported (yet)`);Je(()=>g.style.setProperty(o,s,l),`StylingFactory ${y} (setRule4Selector) failed`)})}function d(g,c,o=a){if(g=g?.trim?.(),!j(g,String)||!g.length||/[;,]$/g.test(g))return console.error(`StylingFactory ${y} (setRules): [${g||"[no selector given]"}] is not a valid selector`);if(c.removeRule)return f(g);let s=n(g,!0),l=s||o.cssRules[o.insertRule(`${g} {}`,o.cssRules.length||0)];return S(()=>x(l,c),g,s)}function b(g){let c=g.trim().split(/{/,2),o=c.shift().trim();if(!j(o,String)||!o?.trim()?.length)return console.error(`StylingFactory ${y} (doParse): no (valid) selector could be extracted from rule ${he(g)}`);let s=Ht(c.shift());return Je(()=>d(o,s),`StylingFactory ${y} (setRules) failed`)}function m(g){let c=r(g);return c.done?c.existing:b(g)}function h(g,c){return g.trim().startsWith("@media")?m(Nt(g,c)):d(g,c)}return function(g,c={}){return i(g,c)&&(Object.keys(c).length?h(g,c):m(g))}}function Ct({styleSheet:t,createWithId:e}){let r="Note: The rule or some of its properties may not be supported by your browser (yet)",n=`for style#${e}`;t=e?i(e):t;function i(m){let h=document.querySelector(`#${m}`)?.sheet;if(h)return h;let g=Object.assign(document.createElement("style"),{id:m});return document.head.insertAdjacentElement("beforeend",g),g.sheet}function a(m){return console.error(`StylingFactory ${n} [rule: ${m}]
|
|
3
|
+
=> @charset, @namespace and @import are not supported here`),{done:!0}}function f(m,h){return[...t.rules].find(g=>h?Qe(g.selectorText||"",m):$t`${At(m)}${[..."gim"]}`.test(g.cssText))}function S(m){return/^@charset|@import|namespace/i.test(m.trim())?a(m):m.match(/}/g)?.length>1?{existing:d(m,1),done:!0}:{done:!1}}function y(m){let h=[...t.cssRules].reduce((c,o,s)=>Qe(o.selectorText||"",m)&&c.concat(s)||c,[]),g=h.length;return h.forEach(c=>t.deleteRule(c)),g>0?console.info(`\u2714 Removed ${g} instance${g>1?"s":""} of selector ${m} from ${n.slice(4)}`):console.info(`\u2714 Remove rule: selector ${m} does not exist in ${n.slice(4)}`)}function x(m,h){return m&&j(m,String)&&m.trim().length>0&&j(h,Object)||(console.error(`StylingFactory ${n} called with invalid parameters`),!1)}function d(m){m=m.trim();let h=m.slice(0,m.indexOf("{")).trim(),g=!!f(h);try{return t.insertRule(`${m}`,t.cssRules.length),g}catch(c){return console.error(`StylingFactory ${n} (tryParse) ${c.name} Error:
|
|
4
|
+
${c.message}
|
|
5
|
+
Rule: ${he(m)}
|
|
6
|
+
${r}`),g}}function b(m,h,g){try{return m(),g}catch(c){return console.error(`StylingFactory ${n} (tryAddOrModify) ${c.name} Error:
|
|
7
|
+
${c.message}
|
|
8
|
+
Rule: ${he(h)}
|
|
9
|
+
${r}`),g}}return{sheet:t,removeRules:y,tryParseAtOrNestedRules:S,ruleExists:f,checkParams:x,tryParse:d,consider:b,currentSheetID:n}}function Nt(t,e){return`${t.trim()} ${Object.entries(e).map(([r,n])=>`${r}: { ${Ft(n)}`)}`}function he(t){let e=(t||"NO RULE").trim().slice(0,50).replace(/\n/g,"\\n").replace(/\s{2,}/g," ");return t.length>e.length?`${e.trim()}...truncated`:e}function Ft(t){return Object.entries(t).map(([e,r])=>`${e}: ${r.trim()}`).join(`;
|
|
10
|
+
`)}function At(t){return t.replace(/([*\[\]()-+{}.$?\\])/g,e=>`\\${e}`)}function $t(t,...e){let r=e.length&&Array.isArray(e.slice(-1))?e.pop().join(""):"";return new RegExp((e.length&&t.raw.reduce((n,i,a)=>n.concat(e[a-1]||"").concat(i),"")||t.raw.join("")).split(`
|
|
11
|
+
`).map(n=>n.replace(/\s|\/\/.*$/g,"").trim().replace(/(@s!)/g," ")).join(""),r)}function je(t){return t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`).replace(/[^--]^-|-$/,"")}function Je(t,e){try{return t()}catch(r){console.error(`${e||"an error occured"}: ${r.message}`)}}function Pt(t){return t.replace(/\/\*.+?\*\//gm,"").replace(/[}{\r\n]/g,"").replace(/(data:.+?);/g,(e,r)=>`${r}\\3b`).split(";").map(e=>e.trim()).join(`;
|
|
12
12
|
`).replaceAll("\\3b",";").split(`
|
|
13
|
-
`)}function Ot(t){return t.reduce((e,r)=>{let[n,
|
|
14
|
-
`)),n}function
|
|
15
|
-
`)),n}function
|
|
16
|
-
`));default:return n}}return Object.defineProperties(n,{log:{value:f,enumerable:!1},error:{value:a,enumerable:!1},warn:{value:w,enumerable:!1}}),Object.freeze(n)}function ue(){return(t=>`[${ae(t.getHours())}:${ae(t.getMinutes())}:${ae(t.getSeconds())}.${ae(t.getMilliseconds(),3)}]`)(new Date)}function $e(t,e){if(t)for(let[r,n]of Object.entries(e)){if(r=M(r),r.startsWith("data"))return de(t,n);s(n,String)&&ce(r)&&t.setAttribute(r,n.split(/[, ]/)?.join(" "))}}function de(t,e){if(t&&s(e,Object))for(let[r,n]of Object.entries(e))t.setAttribute(`data-${M(r)}`,n)}function me(t){return t?s(t,Proxy)?[t.EL]:s(t,NodeList)?[...t]:I(t)?[t]:K(t)?t:t.isJQx?t.collection:void 0:[]}function ge(t,e){return t.andThen(e)}function pe(t,e){return t.andThen(e,!0)}function I(t){return s(t,Text,HTMLElement,Comment)}function Z(t,e){if(s(e,Object))for(let[r,n]of Object.entries(e)){let o;/!important/i.test(n)&&(n=n.slice(0,n.indexOf("!")).trim(),o="important"),t.style.setProperty(M(r),n,o)}}function R(t){let e=t.cloneNode(!0);return e.removeAttribute&&e.removeAttribute("id"),t.isConnected?t.remove():t=null,e}function Ue(t){if(!s(t,HTMLElement))return;let e=t.style,r=getComputedStyle(t),n=!![e.visibility,r.visibility].includes("hidden"),o=!![e.display,r.display].includes("none"),i=!!t.hidden,a=parseInt(r.height)<1||parseInt(r.width)<1,w=t.offsetTop<0||t.offsetLeft+t.offsetWidth<0||t.offsetLeft>document.body.offsetWidth,f=+r.opacity==0||+(e.opacity||1)==0;return!(i||w||f||o||n||a)}function _e(t){return t?.isConnected?!![...document.querySelectorAll(":is(:read-write)")].find(e=>e===t):!1}function Ge(t){return t?.filter(e=>e).reduce((e,r)=>e.concat(Ne(r)?`<!--${r.data}-->`:be(r)?r.textContent:r.outerHTML),"")}function ae(t,e=2){return`${t}`.padStart(e,"0")}function Ze(t,e=0){return[t,e]=[Math.floor(t),Math.ceil(e)],Math.floor([...crypto.getRandomValues(new Uint32Array(1))].shift()/2**32*(t-e+1)+e)}function ye(){return`_${Ut(Bt).slice(0,8).join("")}`}function Ae(t){return t=s(t,String)&&/,/.test(t)?t.split(",").map(e=>e.trim().toLowerCase()).filter(e=>e.length>0):t,s(t,Array)?t:s(t,String)&&t?.trim().toLowerCase()||""}function Ye(t){return t?.isConnected?!![...document.querySelectorAll(":is(:modal)")].find(e=>e===t):!1}function He(t,e){switch(t=String(t).trim(),!0){case/^(0|false|f)$/i.test(t):return!1;case/^(1|true|t)$/i.test(t):return!0;default:return e}}function Ut(t){let e=t.length;for(;e--;){let r=Ze(e);[t[e],t[r]]=[t[r],t[e]]}return t}function Y(t){return s(t,String)?t.toLowerCase().split("-").map((e,r)=>r&&`${_t(e)}`||e).join(""):t}function M(t){return t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`).replace(/^-|-$/,"")}function _t([t,...e]){return`${t.toUpperCase()}${e.join("")}`}function be(t){return s(t,Comment,Text)}function Ne(t){s(t,Comment)}function Xe(t){return s(t,Text)}function X(t){return s(t,String)&&/^<|>$/.test(`${t}`.trim())}function K(t){return s(t,Array)&&!t?.find(e=>!I(e))}function he(t){return s(t,Array)&&!t?.find(e=>!X(e))}function T(t,e){let r=t.collection.filter(n=>!be(n));for(let n=0;n<r.length;n+=1)e(r[n],n);return t}function Ke(t){return t.node?s(t.node,Comment)?`<!--${t.node.textContent}-->`:t.HTML.get(1).split(">")[0]+">...":""}function Pe(t,e,r){let n=e!==document.body&&s(t,String)&&t.toLowerCase()!=="body"?e:document;try{r.collection=[...n.querySelectorAll(t)]}catch{F.warn(`JQx: Invalid CSS querySelector. [${s(t,String)?t:"Not a string!"}]`)}}function qe(){return{isCommentOrTextNode:be,isNode:I,isComment:Ne,isText:Xe,isHtmlString:X,isArrayOfHtmlElements:K,isArrayOfHtmlStrings:he,ElemArray2HtmlString:Ge,input2Collection:me,setCollectionFromCssSelector:Pe,cssRuleEdit:_({createWithId:"JQxStylesheet"})}}function et(){let e=Object.freeze({notInDOM:"n/a",writable:"n/a",modal:"n/a",empty:!0,open:"n/a",visible:"n/a"});return r=>{let n=r.node;return s(n,Node)?Object.freeze({get writable(){return _e(n)},get modal(){return Ye(n)},get inDOM(){return n.isConnected},get open(){return n.open??!1},get visible(){return Ue(n)},get disabled(){return n.hasAttribute("readonly")||n.hasAttribute("disabled")},get empty(){return r.collection.length<1},get virtual(){return r.isVirtual}}):e}}function tt(t,e,r,n){r&&s(e,String)&&(e={[e]:r==="-"?"":r});let o;e.className&&(o=e.className,delete e.className),o=[...t.classList].find(a=>a.startsWith("JQxClass-")||o&&a===o)||o||`JQxClass-${ye().slice(1)}`,n.editCssRule(`.${o}`,e),t.classList.add(o)}var Gt=et();function rt(t){return{factoryExtensions:Zt(t),instanceExtensions:Yt(t)}}function Zt(t){return{data(e){return{get all(){return new Proxy(e[0]?.dataset??{},Le)},set(r={}){if(!e.is.empty&&s(r,Object))for(let[n,o]of Object.entries(r))e.setData({[n]:o});return e},get(r,n){return e.data.all[r]??n},add(r={}){if(!e.is.empty&&s(r,Object))for(let[n,o]of Object.entries(r))e.setData({[n]:o});return e},remove(r){return e[0]?.removeAttribute(`data-${M(r)}`),e}}},dimensions(e){if(e.is.empty)return F.error("[JQx instance].dimensions called on empty instance"),{error:"[JQx instance].dimensions: NO ELEMENTS"};let{node:r}=e,n=r.getBoundingClientRect().toJSON();return n.scrollTopDistance=G(r,0),n.scrollLeftDistance=G(r,0,!1),n},node(e){return e[0]},HTML(e){return{get(r,n){if(e.is.empty)return"NO ELEMENTS IN COLLECTION";let o=r?e.outerHtml:e.html();return n?j(o):o},set(r,n=!1,o=!1){r=r.isJQx?r.HTML.get(1):r;let i=s(r,String);return r=i&&o?j(r):r,i&&(r||"").trim().length&&e.html(r,n),e},replace(r,n=!1){return e.HTML.set(r,!1,n)},append(r,n=!1){return r=s(r,HTMLElement)?t(r).HTML.get(1):r.isJQx?r.HTML.get(1):r,e.HTML.set(r,!0,n)},insert(r,n=!1){return r=s(r,HTMLElement)?t(r).HTML.get(1):r.isJQx?r.HTML.get(1):r,e.HTML.set(r+e.HTML.get(),!1,n)}}},is(e){return Gt(e)},length(e){return e.collection.length},outerHtml(e){return(e.first()||{outerHTML:void 0}).outerHTML},parent(e){let r=t(e[0]?.parentNode);return r.is.empty?e:r},render(e){switch(!0){case!e.is.empty:return e.toDOM();default:return t.logger.warn("[JQx.render]: empty collection"),e}},Style(e){return{get computed(){return e.is.empty?{}:getComputedStyle(e[0])},inline(r){return e.style(r)},inSheet(r){return e.css(r)},valueOf(r){return e.is.empty?void 0:getComputedStyle(e[0])[M(r)]},nwRule(r){return e.Style.byRule({rules:r})},byRule({classes2Apply:r=[],rules:n=[]}={}){let i=s(n,String)&&!r.length?n.split("{")[0].trim():"";if(n=n&&s(n,String)?[n]:n,r=r&&s(r,String)?[r]:r,(n?.length||r?.length)&&(n?.length&&t.editCssRules(...n),r))for(let a of r)e.addClass(a);return i?.startsWith(".")&&e.addClass(i.slice(1)),i?.startsWith("#")&&!e.attr("id")&&e.prop({id:i.slice(1)}),e}}}}}function Yt(t){return{addClass(e,...r){return T(e,n=>n&&r.forEach(o=>n.classList.add(o)))},after:ge,afterMe:ge,andThen(e,r,n=!1){if(!r||!s(r,String,Node,Proxy))return F.log("[JQx instance].[before(Me) | after(Me) | andThen]: invalid/-sufficient input."),e;r=r?.isJQx?r:s(r,Node)?t.virtual(r):t.virtual(P(r));let[o,i,a]=n?[0,"before",r.collection.concat(e.collection)]:[e.collection.length-1,"after",e.collection.concat(r.collection)];return e[o][i](...r.collection),e.collection=a,e},append(e,...r){if(e.is.empty||r.length<1)return e;let n=e.length===1;for(let o of r){if(!o.isJQx&&A(o)){let i=o.trim(),w=!/^<(.+)[^>]+>$/m.test(i)?t.text(o):P(o);T(e,f=>f.append(n?w:R(w)))}I(o)&&T(e,i=>i.append(n?o:R(o))),o.isJQx&&!o.is.empty&&T(e,i=>o.collection.forEach(a=>i.append(n?a:R(a))))}return e},appendTo(e,r){switch(!0){case(!r.isJQx&&!s(r,HTMLElement)):return $.warn("[JQx instance].appendTo: invalid input"),e;default:return(r.isJQx?r:t(r)).append(e),e}},attr(e,r,n){if(!e.node||s(e.node,Text,Comment))return e;if(!n&&A(r))return r=M(r),r==="class"?[...e.node.classList].join(" "):e.node.getAttribute(r);if(A(r)&&n)switch(r=M(r),!0){case r.startsWith("data-"):r={data:{[r.replace("data-","")]:n}};break;default:r={[r]:n}}return s(r,Object)&&!e.is.empty&&$e(e.node,r),e},before:pe,beforeMe:pe,clear(e){return T(e,fe)},closest(e,r){let n=A(r)?e.node?.closest(r):void 0;return n?t(n):e},computedStyle(e,r){let{node:n}=e;return n&&getComputedStyle(n)[r]},css(e,r,n){return T(e,o=>tt(o,r,n,t))},duplicate(e,r=!1,n=document.body){switch(!0){case e.is.empty:return F.error("Duplicating an empty JQx instance is not possible"),e;default:let o=e.collection[0].cloneNode(!0);return o.childNodes.forEach(i=>{i.removeAttribute&&i?.removeAttribute("id")}),r?t(o).toDOM(n):t.virtual(o)}},each(e,r){return T(e,r)},empty(e){return T(e,fe)},find(e,r){return e.collection.length>0?[...e.first()?.querySelectorAll(r)]:[]},find$(e,r){return e.collection.length>0?t(r,e):e},first(e,r=!1){return e.collection.length>0?r?e.single():e.collection[0]:void 0},first$(e,r){return e.single(r)},getData(e,r,n){return e.node?.dataset?.[r]||n},hasClass(e,...r){return e.is.empty||!e.node.classList.length?!1:r.find(n=>e.node.classList.contains(n))&&!0||!1},hide(e){return T(e,r=>Z(r,{display:"none !important"}))},html(e,r,n){switch(!0){case(e.is.empty&&!A(r)):return"";case!A(r):return e.node?.getHTML()??"";default:let o=P(`<div>${r.isJQx?r.HTML.get(!0):r}</div>`);return T(e,a=>(a.textContent=n?a.textContent:"",a.insertAdjacentHTML(t.at.end,o.getHTML())))}},htmlFor(e,r,n="",o=!1){if(e.is.empty||!A(r)||!A(n))return e;let i=e.find$(r);if(i.length<1)return e;let a=P(`<span>${n}</span>`);return i.each(w=>{o||(w.textContent=""),w.insertAdjacentHTML(t.at.end,a?.getHTML())}),e},isEmpty(e){return!e.node},nth$(e,r){return e.single(r)},on(e,r,...n){switch(!0){case(e.is.empty||!s(r,String,Array)||!A(r)||n.length<1):return e;default:return t.handle({type:r,node:e.node,handler:n}),e}},once(e,r,...n){switch(!0){case(e.is.empty||!s(r,String,Array)||!A(r)||n.length<1):return e;default:return t.handle({type:r,once:!0,node:e.node,handler:n}),e}},prepend(e,...r){if(e.is.empty||!r)return;let n=e.length===1;for(let o of r){if(A(o)){o=o.trim();let a=!/^<(.+)[^>]+>$/m.test(o)?t.text(o):P(o);a=n?a:R(a),T(e,w=>w.prepend(a.cloneNode(!0)))}I(o)&&T(e,i=>i.prepend(n?o:R(o))),o.isJQx&&!o.is.empty&&(o.collection.length>1&&o.collection.reverse(),T(e,i=>T(o,a=>i.prepend(n?a:R(a)))),o.collection.reverse())}return e},prependTo(e,r){return r.isJQx||(r=t.virtual(r)),r.prepend(e),e},prop(e,r,n){if(s(r,String)&&!n)return r.startsWith("data")?e[0]?.dataset[r.slice(r.indexOf("-")+1)]:e[0]?.[r];let o=s(r,Object)?r:{[r]:n};for(let[i,a]of Object.entries(o)){if(i=i.trim(),a&&!ce(i)||!a)return!1;if(i.toLowerCase()==="id")return e[0].id=a;T(e,f=>{if(i.startsWith("data"))return f.dataset[i.slice(i.indexOf("-")+1)]=a;f[i]=a})}return e},remove(e,r){let n=i=>i.remove(),o=()=>e.collection=e.collection.filter(i=>document.documentElement.contains(i));if(r){let i=e.find$(r);return i.is.empty||(T(i,n),o()),e}return T(e,n),o(),e},rmAttr(e,...r){for(let n of r)e.node.removeAttribute(n);return e},removeClass(e,...r){return T(e,n=>{if(n)for(let o of r)n.classList.remove(o)})},renderTo(e,r,n){return r=s(r,HTMLElement)||r.isJQx?r:document.body,n=s(n,String)&&t.at[n]?n:t.at.end,e.first$().toDOM(r,n),e},replace(e,r,n){let o=e.node;return!r||!s(n,HTMLElement)&&!n?.isJQx?(t.logger.error("JQx replace: invalid replacement value"),e):((n.isJQx||s(n,NodeList))&&(n=n[0]),o&&r&&(r=s(r,String)?o.querySelectorAll(r):r.isJQx?r.collection:r,s(r,HTMLElement,NodeList,Array)&&s(n,HTMLElement)&&(s(r,HTMLElement)?[r]:[...r]).forEach(i=>i.replaceWith(n.cloneNode(!0)))),e)},replaceClass(e,r,...n){return T(e,o=>{o.classList.remove(r);for(let i of n)o.classList.add(i)})},replaceMe(e,r){return e.replaceWith(r)},replaceWith(e,r){return r=s(r,Element)?r:r.isJQx?r[0]:void 0,r&&(e[0].replaceWith(r),e=t.virtual(r)),e},setData(e,r){return T(e,n=>de(n,r))},show(e){return T(e,r=>Z(r,{display:"revert-layer !important"}))},single(e,r){let n=e.collection.length>0;switch(r=r??0,!0){case(n&&s(r,String)):return e.find$(r);case(n&&s(r,Number)):return t(e.collection[r]);case n:return e.collection[0];default:return e}},style(e,r,n){return T(e,i=>{n&&s(r,String)&&(r={[r]:n||"none"}),Z(i,r)})},text(e,r,n=!1){switch(!0){case e.isEmpty():return e;case!s(r,String):return e.node.textContent;default:return T(e,o=>o.textContent=n?o.textContent+r:r)}},toDOM(e,r=document.body,n=H.BeforeEnd){return e.isVirtual=!1,k(e.collection,r,n),e},toggleClass(e,r){return T(e,n=>n.classList.toggle(r))},toNodeList(e){return[...e.collection].map(r=>document.importNode(r,!0))},trigger(e,r,n,o){n=s(n,Function)?n:Event,o=s(o,Object)?{...o,bubbles:o.bubbles??!0}:{bubbles:!0};let i=new n(r,o);return e.is.empty||e.each(a=>a.dispatchEvent(i)),e},val(e,r){switch(!0){case(e.is.empty||!s(e.node,HTMLInputElement,HTMLSelectElement,HTMLTextAreaElement)):return e;case!s(r,String):return e.node.value;default:return e.node.value=s(r,String)?r:"",e}}}}var Me,Se,{isComment:nn,isText:on,isHtmlString:ln,isArrayOfHtmlElements:sn,isArrayOfHtmlStrings:an,ElemArray2HtmlString:un,cssRuleEdit:Oe,addFn:Xt}=Kt();function Kt(){return{...qe(),addFn:qt}}function qt(t,e){return t=t?.trim(),!A(t)||!s(e,Function)?F.error("JQx.fn: method invalid parameter(s)"):Se[t]=(r,...n)=>e(r,...n)}function er(t){return function(e,r,n){if(e=e?.trim(),!A(e)||!s(r,Function))return t.error("JQx.staticFn: invalid parameter(s)");let o=n?{get(){return r()}}:{value(...i){return r(...i)}};try{Object.defineProperty(t,e,o)}catch{return t.warn(`JQx.staticFn: extension [${e}] already exists`)}return F.log(`JQx: added static extension function [${e}]`)}}function q(t){return new Proxy(t,Object.freeze({get:(e,r)=>tr(e,r,t)}))}function nt(t,e){return(...r)=>s(t,Function)&&t(q(e),...r)}function tr(t,e,r){switch(!0){case s(e,Symbol):return W({trial:()=>t[e],whenError:()=>t});case s(+e,Number):return t.collection?.[e]||void 0;case e in Me:return nt(Me[e],r)();case e in Se:return nt(Se[e],r);default:return t[e]}}function lt(t){let e=lr(t);for(let[r,n]of Object.entries(Object.getOwnPropertyDescriptors(e)))Object.defineProperty(t,r,n);return t}function rr(t){return{allow(e){let r=/-/.test(e),n=r&&e;e=r?Y(e):e.toLowerCase(),D.allowTag(e),Object.defineProperties(t,De(e,!0,t,n))},prohibit(e){e=e.toLowerCase(),D.prohibitTag(e),Object.defineProperties(t,De(e,!1,t))}}}function ot(...t){if(t.length===1){let e=String(t.shift().trim());t=e.startsWith("!")?[e.slice(1,-1)]:e.split(",").map(r=>r.trim())}for(let e of t.map(r=>r.startsWith("!")?r.slice(1,-1):r))Oe(e,{removeRule:1})}function nr(t){return function(e,r,n){r=r?.isJQx?r?.[0]:r,n=n&&Object.values(H).find(i=>n===i);let o=t(e,document.createElement("br"));if(r&&!s(r,HTMLBRElement))for(let i of o.collection)n?r.insertAdjacentElement(n,i):r.append(i);return o}}function or(...t){let e={};for(let r of t){let n=Object.getOwnPropertyDescriptors(r);for(let[o,i]of Object.entries(n))!(o in e)&&Object.defineProperty(e,o,{...i,enumerable:!1})}return e}function ir(t,e,r,n){return t=M(n||t.toLowerCase()),{get(){return(...o)=>{let i=e&&r.virtual(Q(ee[t](...o)))||void 0,w=!s(i?.node,Comment,Text,void 0)?Fe(i):"";return F.log(e?`JQx: created (virtual) instance from [JQx].${t} ${w}`:`JQx: ${t.toUpperCase()} is prohibited. Use [JQx].allowTag if necessary.`),i}},enumerable:!1,configurable:!0}}function De(t,e,r,n){t=t.toLowerCase();let o=ir(t,e,r,n);return n?{[n]:o,[Y(n)]:o}:{[t]:o,[t.toUpperCase()]:o}}function lr(t){return or(Object.entries(D.tagsRaw).reduce(sr(t),{}),mr(t))}function sr(t){return function(e,[r,n]){return Object.defineProperties(e,De(r,n,t)),e}}function ar(t){return function(e,r,...n){s(r,Function)&&(n.push(r),r=void 0),t({type:e,selector:r,handlers:n})}}function ur(t){return function(e){let{type:r,types:n,origin:o,selector:i,handler:a,handlers:w,node:f,name:E,capture:c,once:h,about:g}=e;a=w||a,r=n||r,i=o||i;let S=Ae(r),p=E;a=s(a,Function)?[a]:a;let m={type:S,selector:i||o,capture:c,name:p,once:h,node:f,about:g};switch(!0){case(s(S,Array)&&S.length>0):for(let b of S)m.type=b,it(a,m,t);break;default:return it(a,m,t)}}}function it(t,e,r){for(let n of t)r.listen({...e,handler:n})}function cr(t){return function(e,r){return r=A(r)&&r,e=A(e)&&e,r&&e&&t.listenerStore[e][r]}}function fr(t){return t.activePopup||Object.defineProperty(t,"activePopup",{value:ie(t),enumerable:!1}),t.activePopup}function dr(t){let e=(c,h)=>Oe(c,h),r=function(c){return _({createWithId:c||`jqx${ye()}`})},n=function(...c){for(let h of c)Oe(h)},o=rr(t),i=le(t),a=ur(i);return{editCssRule:e,createStyle:r,editCssRules:n,allowProhibit:o,handle:a,capturedHandling:a,log:(...c)=>F.on.log(...c).off,warn:(...c)=>F.on.warn(...c).off,error:(...c)=>F.on.error(...c).off,handlerWrapper:i}}function mr(t){let{factoryExtensions:e,instanceExtensions:r}=rt(t);Me=e,Se=r;let{editCssRule:n,createStyle:o,editCssRules:i,allowProhibit:a,handle:w,capturedHandling:f,log:E,warn:c,error:h,handlerWrapper:g}=dr(t),S=cr(t),p=er(t);return{log:E,warn:c,error:h,editCssRules:i,createStyle:o,editStylesheet:o,editCssRule:n,escHtml:j,logger:F,text(m,b=!1){return b?t.comment(m):document.createTextNode(m)},node(m,b=document){return b.querySelector(m,b)},nodes(m,b=document){return[...b.querySelectorAll(m,b)]},clearAllTimers:Te,get staticFn(){return function(m,b,C){return p(m,b,C)}},get toBool(){return He},get getNamedListener(){return S},get virtual(){return nr(t)},get allowTag(){return a.allow},get prohibitTag(){return a.prohibit},get removeCssRule(){return ot},get removeCssRules(){return ot},get delegate(){return ar(f)},get delegateCaptured(){return f},get handle(){return f},get listen(){return g.listen},get at(){return H},get setStyle(){return n},get fn(){return Xt},get lenient(){return D.allowUnknownHtmlTags},get IS(){return s},get Popup(){return fr(t)},get listenerStore(){return g.ListenerStore}}}var st=lt(gr());function gr(){return function(e,r,n=H.BeforeEnd){if(e?.isJQx)return e;let o=s(r,HTMLBRElement);r=(!o&&r&&r.isJQx?r[0]:r)||document.body,n=n&&Object.values(H).find(c=>n===c)?n:void 0;let i=X(e),w=!i&&he(e)||i,f={collection:me(e)??[],isVirtual:o,isJQx:!0},E=K(f.collection);if(f.collection.length&&E)return o||f.collection.forEach(c=>{r.contains(c)||k([c],r,n)}),q(f);if(w){if([e].flat().forEach(c=>f.collection.push(P(c))),f.collection.length>0){let c=f.collection.filter(p=>p?.dataset?.jqxcreationerror);f.collection=f.collection.filter(p=>!p?.dataset?.jqxcreationerror);let g=f.collection.map(p=>`${String(p.constructor).split(/function|\(/)[1].trim()}`).length>1;f=q(f);let S=f.collection.length>0?Ke(f):"sanitized: no elements remaining";F.log(`JQx: created ${f.isVirtual?"(virtual)":""} instance from ${g?"array of ":""}HTML string${g?"s":""} ${S}`),f.isVirtual||k(f.collection,r,n)}return f}return Pe(e,r,f),q(f)}}var pn=st;export{pn as default};
|
|
13
|
+
`)}function Ot(t){return t.reduce((e,r)=>{let[n,i]=[r.slice(0,r.indexOf(":")).trim(),r.slice(r.indexOf(":")+1).trim().replace(/;$|;.+(?=\/*).+\/$/,"")];return n&&i?{...e,[n]:i}:e},{})}function Ht(t){return Ot(Pt(t))}function Qe(t,e){return t?.replace("::",":")===e?.replace("::",":")}var Se=!1,Mt={on:()=>Se=!0,off:()=>Se=!1},P={tagsRaw:J,allowUnknownHtmlTags:Mt,isAllowed(t){if(Se)return!0;let e=u(t,String)?t.toLowerCase():t?.nodeName.toLowerCase()||"none";return e==="#text"||!!J[e]},allowTag:t=>J[t.toLowerCase()]=!0,prohibitTag:t=>J[t.toLowerCase()]=!1};var It=!0,X={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};function Dt(t){if(It&&Object.keys(t.removed).length){let e=Object.entries(t.removed).reduce((r,[n,i])=>[...r,`${H(n)} => ${i}`],[]).join("\\000A");w.error(`JQx: HTML creation error(s): ${e}`)}}function Rt(t){let e=t.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(e)&&!r.find(n=>n===e)||P.isAllowed(e)}function I(t){let e={rawHTML:t?.parentElement?.getHTML()??"no html",removed:{}};return u(t,HTMLElement)&&[...t.childNodes].forEach(r=>{if(r?.children?.length&&I(r),r?.attributes){let i=u(r,SVGElement)?R.svg:R.html;[...(r??{attributes:[]}).attributes].forEach(a=>{let f=a.name.trim().toLowerCase(),S=a.value.trim().toLowerCase().replace(X.whiteSpace,""),y=f==="href"?!X.validURL.test(S):X.notAllowedValues.test(S),x=f.startsWith("data")?!X.data.test(f):!!i[f];if(y||x){let d=G(a.value||"none",60);d+=d.length===60?"...":"",e.removed[`${a.name}`]=`attribute/property/value not allowed, removed. Value: ${d}`,r.removeAttribute(a.name)}})}if(!(Rt(r)||r.constructor===CharacterData||r.constructor===Comment)){let i=(r?.outerHTML||r?.textContent).trim(),a=G(i,60)??"EMPTY";a+=a.length===60?"...":"",e.removed[`<${r.nodeName?.toLowerCase()}>`]=`not allowed, not rendered. Value: ${a}`,r.remove()}}),Dt(e),t}function jt(t){let e=document.createElement("div");return e.insertAdjacentHTML(L.end,t),e.childNodes.length?I(e):void 0}function Jt(t,e,r){switch(!0){case u(t,Comment):return e.insertAdjacentHTML(r,`<!--${t.data}-->`);case u(t,Text):return e.insertAdjacentText(r,t.data||t.textContent);default:return}}function D(t=[],e=document.body,r=L.BeforeEnd){return r=r||L.BeforeEnd,e=e?.isJQx?e.node:e||document.body,t.reduce((n,i)=>{let a=O(i)&&Qt(i,e,r);return a?[...n,a]:n},[])}function Qt(t,e=document.body,r=L.BeforeEnd){return r=r||L.BeforeEnd,e=e?.isJQx?e?.[0]:e,u(t,Comment,Text)?Jt(t,e,r):u(t,HTMLElement)?e.insertAdjacentElement(r,t):void 0}function C(t){if(u(t,Text,Comment))return t;let e=t?.trim(),r=e?.split(/<text>|<\/text>/i)??[];if(r?.length&&(r=r.length>1?r.filter(i=>i.length).shift():void 0),e.startsWith("<!--")&&e.endsWith("-->"))return document.createComment(t.replace(/<!--|-->$/g,""));if(r||u(e,String)&&!/^<(.+)[^>]+>/m.test(e))return document.createTextNode(r??e);let n=jt(t);return n.childNodes.length<1?C(`<span data-jqxcreationerror="1">${Z(t,60)}</span>`):n.children[0]}function K(t){if(t.node("#jqxPopup"))return;t.logger.log("JQx: [JQx].Popup first call. Dialog element created."),t.dialog({id:"jqxPopup"},t.div({id:"jqxPopupContent"})).render,t.editCssRules(...He);let e=[],[r,n]=[t("#jqxPopupContent"),t.node("#jqxPopup")],i={};return t.handle({type:"click, cancel",handlers:m,name:"genericPopupCloseHandler",capture:!0,about:"A generic handler for JQx popups"}),Object.freeze({show:a,remove:f,removeModal:b});function a(c){if(n.open)switch(!0){case S(c):return;default:return f(),setTimeout(()=>a(c),200)}i={...c};let{content:o}=i;return t.IS(o,String,HTMLElement)||o?.isJQx?y():!0}function f(){return i.modal?g(i.warnMessage):x()}function S(c){for(let[o,s]of Object.entries(i))if(s!==c[o])return!1;return!0}function y(){r.clear();let{content:c,modal:o,closeAfter:s}=i;o=t.IS(o,Boolean)?o:!1;let l=o?"":t.div({id:"closeHandleIcon"});r.append(l,t.IS(c,String)?t.div(c):c),n.showModal(),!o&&t.IS(s,Number)&&h(f,s)}function x(){if(n.close(i.returnValue),d(),t.IS(i.callback,Function))return e.push(setTimeout(()=>i.callback(i.returnValue),200));i={}}function d(){e.forEach(c=>clearTimeout(c)),e=[]}function b({callback:c,value:o}={}){i.returnValue=o,i.modal=!1,i.callback=c||i.callback,f()}function m({evt:c}){if(!(Object.keys(i).length<1||!n.open)&&(c.type==="cancel"&&i.modal&&c.preventDefault(),c.target.closest("#closeHandleIcon")||!c.target.closest("#jqxPopupContent")))return i.activeTimer&&clearTimeout(i.activeTimer),f()}function h(c,o){t.IS(c,Function)&&t.IS(o,Number)&&o>0&&(d(),e.push(setTimeout(c,o*1e3)))}function g(c){if(!t.IS(c,String,HTMLElement,Proxy))return;let o=r.find$(".warn");switch(!0){case o.is.empty:o=t.div({class:"warn"},c);default:r.append(o.addClass("active")),h(()=>r.find$(".warn").removeClass("active"),2)}}}function q(t){let e={},r="anonymous_";function n(d){if(d){let{handler:b,capture:m,type:h}=d;document.addEventListener(h,b,{capture:m})}}function i(d){if(d){let{type:b,handler:m,capture:h}=d;document.removeEventListener(b,m,{capture:h})}}function a(d,b,m,h){return function(g){if(!T(b))return d({evt:g});let c=g.target.closest(b);if(c){let o=t(c);d({self:o,me:o,evt:g}),m&&y(g.type,h)}return!0}}function f(d){return e[d]=e[d]||{},e[d]}function S(d,b){return Object.entries(f(d)).find(([m])=>m===b)}function y(d,b){let m=S(d,b);m&&(i(m[1]),delete e[d][b],delete ee[b],w.warn(`Removed listener [${b}] for event type [${d}].`))}function x(d){let{type:b,handler:m,name:h,capture:g,once:c,selector:o,node:s,about:l}=d;e[b]=e[b]||{};let p=xe(h||m.name),v=m;if(s instanceof HTMLElement){let F=s.dataset.hid||p;s.dataset.hid=F,o=`[data-hid=${F}]`}switch(!0){case!e[b][p]:return w.log(`JQx: created listener for event type ${b}, with handler name ${p}`),e[b][p]={name:p,handler:a(m,o,c,p),capture:ke(b,g),once:!!c,type:b,initialHandler:v,selector:!!o&&o||!1,about:!!l&&l||!1,unListen(){y(b,p)}},e[b][p];default:return console.warn(`The listener [${p}] for [${b}] exists, it is not re-assigned.`)}}return{remove(...d){return y(...d)},listen:function(d){let{type:b,handler:m}=d;if(!T(b)||!u(m,Function))return;let h=x(d);if(h)return n(h),{type:b,name:h.name,unListen(){y(b,h.name)}}},get ListenerStore(){return Object.freeze({...e})}}}var w=Wt(),kt=["load","unload","scroll","focus","blur","DOMNodeRemovedFromDocument","DOMNodeInsertedIntoDocument","loadstart","progress","error","abort","load","loadend","pointerenter","pointerleave","readystatechange"],L=Object.freeze(new Proxy({start:"afterbegin",afterbegin:"afterbegin",end:"beforeend",beforeend:"beforeend",before:"beforebegin",beforebegin:"beforebegin",after:"afterend",afterend:"afterend"},{get(t,e){return t[String(e).toLowerCase()]??t[e]}})),Bt=[...Array(26)].map((t,e)=>String.fromCharCode(e+65)).concat([...Array(26)].map((t,e)=>String.fromCharCode(e+97))).concat([...Array(10)].map((t,e)=>`${e}`)),ve=Object.freeze({get(t,e){return t[z(e)]||t[e]},enumerable:!1,configurable:!1}),ee={};function we(){let t=setTimeout(()=>{});for(;t>=0;)clearTimeout(t--)}function xe(t){return T(t)&&!/^handler|handlers$/gi.test(t.trim())?t.trim():Be()}function Te(t){let e=!!t.node&&!u(t,Text,Comment);switch(!0){case e:let r=t.node.dataset?Object.keys(t.node.dataset).map(a=>`[data-${a}]`):[],i=[t.attr("id")&&`#${t?.attr("id")}`||void 0,t.attr("class")&&t?.attr("class").split(" ").map(a=>`.${a}`).join(", ")||void 0,r.length>0&&r.join(", ")||void 0].filter(a=>!!a).join(", ")||[];return i.length?`(${i})`:"";default:return""}}function Be(t){let e=`anonymous_${Math.random().toString(36).slice(2)}`;return ee[e]?Be():(ee[e]=e,e)}function ke(t,e){return!!kt.find(r=>r===t)||!!e}function ne(t){return t.startsWith("data")||R.html.find(e=>t.toLowerCase()===e)}function oe(t){return t&&(t.textContent="")}function B(t,e=0,r=!0){return t=t?.parentElement,e+=t?t[r?"scrollTop":"scrollLeft"]:0,t?B(t,e,r):e}function T(t,e=1){return e=u(e,Number)&&e||1,u(t,String)&&t.length>=e}function G(t,e=120){return Z(t,e).replace(/</g,"<")}function Z(t,e=120){return`${t}`.trim().slice(0,e).replace(/>\s+</g,"><").replace(/</g,"<").replace(/\s{2,}/g," ").replace(/\n/g,"\\n")+(t.length>e?" …":"").trim()}function H(t){switch(!0){case u(t,String):let e=document.createElement("div");return e.append(t),e.innerHTML;default:return t}}function Ee(t){return u(t,String)&&Object.assign(document.createElement("textarea"),{innerHTML:t}).textContent||t}function Wt(){let[t,e]=[!1,!0],r=[],n={get on(){return t=!0,n},get off(){return t=!1,n},get disable(){return e=!0,n},get enable(){return e=!1,n},get backLog(){return r}};function i(){e=!0}function a(){e=!1}function f(...x){return r.unshift(...x.map(d=>`${re()} \u2A3B ${Ee(d)}`)),console.error(r.slice(0,x.length).join(`
|
|
14
|
+
`)),n}function S(...x){return r.unshift(...x.map(d=>`${re()} \u26A0 ${Ee(d)}`)),console.warn(r.slice(0,x.length).join(`
|
|
15
|
+
`)),n}function y(...x){let d=x.map(b=>`${re()} \u2714 ${Ee(b)}`);switch(!e&&r.unshift(...d),t){case!0:console.log(d.join(`
|
|
16
|
+
`));default:return n}}return Object.defineProperties(n,{log:{value:y,enumerable:!1},error:{value:f,enumerable:!1},warn:{value:S,enumerable:!1}}),Object.freeze(n)}function re(){return(t=>`[${te(t.getHours())}:${te(t.getMinutes())}:${te(t.getSeconds())}.${te(t.getMilliseconds(),3)}]`)(new Date)}function Le(t,e){if(t)for(let[r,n]of Object.entries(e)){if(r=N(r),r.startsWith("data"))return ie(t,n);u(n,String)&&ne(r)&&t.setAttribute(r,n.split(/[, ]/)?.join(" "))}}function ie(t,e){if(t&&u(e,Object))for(let[r,n]of Object.entries(e))t.setAttribute(`data-${N(r)}`,n)}function se(t){return t?u(t,Proxy)?[t.EL]:u(t,NodeList)?[...t]:O(t)?[t]:_(t)?t:t.isJQx?t.collection:void 0:[]}function ae(t,e){return t.andThen(e)}function le(t,e){return t.andThen(e,!0)}function O(t){return u(t,Text,HTMLElement,Comment)}function W(t,e){if(u(e,Object))for(let[r,n]of Object.entries(e)){let i;/!important/i.test(n)&&(n=n.slice(0,n.indexOf("!")).trim(),i="important"),t.style.setProperty(N(r),n,i)}}function M(t){let e=t.cloneNode(!0);return e.removeAttribute&&e.removeAttribute("id"),t.isConnected?t.remove():t=null,e}function We(t){if(!u(t,HTMLElement))return;let e=t.style,r=getComputedStyle(t),n=!![e.visibility,r.visibility].includes("hidden"),i=!![e.display,r.display].includes("none"),a=!!t.hidden,f=parseInt(r.height)<1||parseInt(r.width)<1,S=t.offsetTop<0||t.offsetLeft+t.offsetWidth<0||t.offsetLeft>document.body.offsetWidth,y=+r.opacity==0||+(e.opacity||1)==0;return!(a||S||y||i||n||f)}function ze(t){return t?.isConnected?!![...document.querySelectorAll(":is(:read-write)")].find(e=>e===t):!1}function Ye(t){return t?.filter(e=>e).reduce((e,r)=>e.concat(Fe(r)?`<!--${r.data}-->`:ce(r)?r.textContent:r.outerHTML),"")}function te(t,e=2){return`${t}`.padStart(e,"0")}function _e(t,e=0){return[t,e]=[Math.floor(t),Math.ceil(e)],Math.floor([...crypto.getRandomValues(new Uint32Array(1))].shift()/2**32*(t-e+1)+e)}function ue(){return`_${zt(Bt).slice(0,8).join("")}`}function Ce(t){return t=u(t,String)&&/,/.test(t)?t.split(",").map(e=>e.trim().toLowerCase()).filter(e=>e.length>0):t,u(t,Array)?t:u(t,String)&&t?.trim().toLowerCase()||""}function Ve(t){return t?.isConnected?!![...document.querySelectorAll(":is(:modal)")].find(e=>e===t):!1}function Ne(t,e){switch(t=String(t).trim(),!0){case/^(0|false|f)$/i.test(t):return!1;case/^(1|true|t)$/i.test(t):return!0;default:return e}}function zt(t){let e=t.length;for(;e--;){let r=_e(e);[t[e],t[r]]=[t[r],t[e]]}return t}function z(t){return u(t,String)?t.toLowerCase().split("-").map((e,r)=>r&&`${Yt(e)}`||e).join(""):t}function N(t){return t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`).replace(/^-|-$/,"")}function Yt([t,...e]){return`${t.toUpperCase()}${e.join("")}`}function ce(t){return u(t,Comment,Text)}function Fe(t){u(t,Comment)}function Ue(t){return u(t,Text)}function Y(t){return u(t,String)&&/^<|>$/.test(`${t}`.trim())}function _(t){return u(t,Array)&&!t?.find(e=>!O(e))}function fe(t){return u(t,Array)&&!t?.find(e=>!Y(e))}function E(t,e){let r=t.collection.filter(n=>!ce(n));for(let n=0;n<r.length;n+=1)e(r[n],n);return t}function Xe(t){return t.node?u(t.node,Comment)?`<!--${t.node.textContent}-->`:t.HTML.get(1).split(">")[0]+">...":""}function Ae(t,e,r){let n=e!==document.body&&u(t,String)&&t.toLowerCase()!=="body"?e:document;try{r.collection=[...n.querySelectorAll(t)]}catch{w.warn(`JQx: Invalid CSS querySelector. [${u(t,String)?t:"Not a string!"}]`)}}function Ge(){return{isCommentOrTextNode:ce,isNode:O,isComment:Fe,isText:Ue,isHtmlString:Y,isArrayOfHtmlElements:_,isArrayOfHtmlStrings:fe,ElemArray2HtmlString:Ye,input2Collection:se,setCollectionFromCssSelector:Ae,cssRuleEdit:k({createWithId:"JQxStylesheet"})}}function Ze(){let e=Object.freeze({notInDOM:"n/a",writable:"n/a",modal:"n/a",empty:!0,open:"n/a",visible:"n/a"});return r=>{let n=r.node;return u(n,Node)?Object.freeze({get writable(){return ze(n)},get modal(){return Ve(n)},get inDOM(){return n.isConnected},get open(){return n.open??!1},get visible(){return We(n)},get disabled(){return n.hasAttribute("readonly")||n.hasAttribute("disabled")},get empty(){return r.collection.length<1},get virtual(){return r.isVirtual}}):e}}function Ke(t,e,r,n){r&&u(e,String)&&(e={[e]:r==="-"?"":r});let i;e.className&&(i=e.className,delete e.className),i=[...t.classList].find(f=>f.startsWith("JQxClass-")||i&&f===i)||i||`JQxClass-${ue().slice(1)}`,n.editCssRule(`.${i}`,e),t.classList.add(i)}var _t=Ze();function qe(t){return{factoryExtensions:Vt(t),instanceExtensions:Ut(t)}}function Vt(t){return{data(e){return{get all(){return new Proxy(e[0]?.dataset??{},ve)},set(r={}){if(!e.is.empty&&u(r,Object))for(let[n,i]of Object.entries(r))e.setData({[n]:i});return e},get(r,n){return e.data.all[r]??n},add(r={}){if(!e.is.empty&&u(r,Object))for(let[n,i]of Object.entries(r))e.setData({[n]:i});return e},remove(r){return e[0]?.removeAttribute(`data-${N(r)}`),e}}},dimensions(e){if(e.is.empty)return w.error("[JQx instance].dimensions called on empty instance"),{error:"[JQx instance].dimensions: NO ELEMENTS"};let{node:r}=e,n=r.getBoundingClientRect().toJSON();return n.scrollTopDistance=B(r,0),n.scrollLeftDistance=B(r,0,!1),n},node(e){return e[0]},HTML(e){return{get(r,n){if(e.is.empty)return"NO ELEMENTS IN COLLECTION";let i=r?e.outerHtml:e.html();return n?H(i):i},set(r,n=!1,i=!1){r=r.isJQx?r.HTML.get(1):r;let a=u(r,String);return r=a&&i?H(r):r,a&&(r||"").trim().length&&e.html(r,n),e},replace(r,n=!1){return e.HTML.set(r,!1,n)},append(r,n=!1){return r=u(r,HTMLElement)?t(r).HTML.get(1):r.isJQx?r.HTML.get(1):r,e.HTML.set(r,!0,n)},insert(r,n=!1){return r=u(r,HTMLElement)?t(r).HTML.get(1):r.isJQx?r.HTML.get(1):r,e.HTML.set(r+e.HTML.get(),!1,n)}}},is(e){return _t(e)},length(e){return e.collection.length},outerHtml(e){return(e.first()||{outerHTML:void 0}).outerHTML},parent(e){let r=t(e[0]?.parentNode);return r.is.empty?e:r},render(e){switch(!0){case!e.is.empty:return e.toDOM();default:return t.logger.warn("[JQx.render]: empty collection"),e}},Style(e){return{get computed(){return e.is.empty?{}:getComputedStyle(e[0])},inline(r){return e.style(r)},inSheet(r){return e.css(r)},valueOf(r){return e.is.empty?void 0:getComputedStyle(e[0])[N(r)]},nwRule(r){return e.Style.byRule({rules:r})},byRule({classes2Apply:r=[],rules:n=[]}={}){let a=u(n,String)&&!r.length?n.split("{")[0].trim():"";if(n=n&&u(n,String)?[n]:n,r=r&&u(r,String)?[r]:r,(n?.length||r?.length)&&(n?.length&&t.editCssRules(...n),r))for(let f of r)e.addClass(f);return a?.startsWith(".")&&e.addClass(a.slice(1)),a?.startsWith("#")&&!e.attr("id")&&e.prop({id:a.slice(1)}),e}}}}}function Ut(t){return{addClass(e,...r){return E(e,n=>n&&r.forEach(i=>n.classList.add(i)))},after:ae,afterMe:ae,andThen(e,r,n=!1){if(!r||!u(r,String,Node,Proxy))return w.log("[JQx instance].[before(Me) | after(Me) | andThen]: invalid/-sufficient input."),e;r=r?.isJQx?r:u(r,Node)?t.virtual(r):t.virtual(C(r));let[i,a,f]=n?[0,"before",r.collection.concat(e.collection)]:[e.collection.length-1,"after",e.collection.concat(r.collection)];return e[i][a](...r.collection),e.collection=f,e},append(e,...r){if(e.is.empty||r.length<1)return e;let n=e.length===1;for(let i of r){if(!i.isJQx&&T(i)){let a=i.trim(),S=!/^<(.+)[^>]+>$/m.test(a)?t.text(i):C(i);E(e,y=>y.append(n?S:M(S)))}O(i)&&E(e,a=>a.append(n?i:M(i))),i.isJQx&&!i.is.empty&&E(e,a=>i.collection.forEach(f=>a.append(n?f:M(f))))}return e},appendTo(e,r){switch(!0){case(!r.isJQx&&!u(r,HTMLElement)):return $.warn("[JQx instance].appendTo: invalid input"),e;default:return(r.isJQx?r:t(r)).append(e),e}},attr(e,r,n){if(!e.node||u(e.node,Text,Comment))return e;if(!n&&T(r))return r=N(r),r==="class"?[...e.node.classList].join(" "):e.node.getAttribute(r);if(T(r)&&n)switch(r=N(r),!0){case r.startsWith("data-"):r={data:{[r.replace("data-","")]:n}};break;default:r={[r]:n}}return u(r,Object)&&!e.is.empty&&Le(e.node,r),e},before:le,beforeMe:le,clear(e){return E(e,oe)},closest(e,r){let n=T(r)?e.node?.closest(r):void 0;return n?t(n):e},computedStyle(e,r){let{node:n}=e;return n&&getComputedStyle(n)[r]},css(e,r,n){return E(e,i=>Ke(i,r,n,t))},duplicate(e,r=!1,n=document.body){switch(!0){case e.is.empty:return w.error("Duplicating an empty JQx instance is not possible"),e;default:let i=e.collection[0].cloneNode(!0);return i.childNodes.forEach(a=>{a.removeAttribute&&a?.removeAttribute("id")}),r?t(i).toDOM(n):t.virtual(i)}},each(e,r){return E(e,r)},empty(e){return E(e,oe)},find(e,r){return e.collection.length>0?[...e.first()?.querySelectorAll(r)]:[]},find$(e,r){return e.collection.length>0?t(r,e):e},first(e,r=!1){return e.collection.length>0?r?e.single():e.collection[0]:void 0},first$(e,r){return e.single(r)},getData(e,r,n){return e.node?.dataset?.[r]||n},hasClass(e,...r){return e.is.empty||!e.node.classList.length?!1:r.find(n=>e.node.classList.contains(n))&&!0||!1},hide(e){return E(e,r=>W(r,{display:"none !important"}))},html(e,r,n){switch(!0){case(e.is.empty&&!T(r)):return"";case!T(r):return e.node?.getHTML()??"";default:let i=C(`<div>${r.isJQx?r.HTML.get(!0):r}</div>`);return E(e,f=>(f.textContent=n?f.textContent:"",f.insertAdjacentHTML(t.at.end,i.getHTML())))}},htmlFor(e,r,n="",i=!1){if(e.is.empty||!T(r)||!T(n))return e;let a=e.find$(r);if(a.length<1)return e;let f=C(`<span>${n}</span>`);return a.each(S=>{i||(S.textContent=""),S.insertAdjacentHTML(t.at.end,f?.getHTML())}),e},isEmpty(e){return!e.node},nth$(e,r){return e.single(r)},on(e,r,...n){switch(!0){case(e.is.empty||!u(r,String,Array)||!T(r)||n.length<1):return e;default:return t.handle({type:r,node:e.node,handler:n}),e}},once(e,r,...n){switch(!0){case(e.is.empty||!u(r,String,Array)||!T(r)||n.length<1):return e;default:return t.handle({type:r,once:!0,node:e.node,handler:n}),e}},prepend(e,...r){if(e.is.empty||!r)return;let n=e.length===1;for(let i of r){if(T(i)){i=i.trim();let f=!/^<(.+)[^>]+>$/m.test(i)?t.text(i):C(i);f=n?f:M(f),E(e,S=>S.prepend(f.cloneNode(!0)))}O(i)&&E(e,a=>a.prepend(n?i:M(i))),i.isJQx&&!i.is.empty&&(i.collection.length>1&&i.collection.reverse(),E(e,a=>E(i,f=>a.prepend(n?f:M(f)))),i.collection.reverse())}return e},prependTo(e,r){return r.isJQx||(r=t.virtual(r)),r.prepend(e),e},prop(e,r,n){if(u(r,String)&&!n)return r.startsWith("data")?e[0]?.dataset[r.slice(r.indexOf("-")+1)]:e[0]?.[r];let i=u(r,Object)?r:{[r]:n};for(let[a,f]of Object.entries(i)){if(a=a.trim(),f&&!ne(a)||!f)return!1;if(a.toLowerCase()==="id")return e[0].id=f;E(e,y=>{if(a.startsWith("data"))return y.dataset[a.slice(a.indexOf("-")+1)]=f;y[a]=f})}return e},remove(e,r){let n=a=>a.remove(),i=()=>e.collection=e.collection.filter(a=>document.documentElement.contains(a));if(r){let a=e.find$(r);return a.is.empty||(E(a,n),i()),e}return E(e,n),i(),e},rmAttr(e,...r){for(let n of r)e.node.removeAttribute(n);return e},removeClass(e,...r){return E(e,n=>{if(n)for(let i of r)n.classList.remove(i)})},renderTo(e,r,n){return r=u(r,HTMLElement)||r.isJQx?r:document.body,n=u(n,String)&&t.at[n]?n:t.at.end,e.first$().toDOM(r,n),e},replace(e,r,n){let i=e.node;return!r||!u(n,HTMLElement)&&!n?.isJQx?(t.logger.error("JQx replace: invalid replacement value"),e):((n.isJQx||u(n,NodeList))&&(n=n[0]),i&&r&&(r=u(r,String)?i.querySelectorAll(r):r.isJQx?r.collection:r,u(r,HTMLElement,NodeList,Array)&&u(n,HTMLElement)&&(u(r,HTMLElement)?[r]:[...r]).forEach(a=>a.replaceWith(n.cloneNode(!0)))),e)},replaceClass(e,r,...n){return E(e,i=>{i.classList.remove(r);for(let a of n)i.classList.add(a)})},replaceMe(e,r){return e.replaceWith(r)},replaceWith(e,r){return r=u(r,Element)?r:r.isJQx?r[0]:void 0,r&&(e[0].replaceWith(r),e=t.virtual(r)),e},setData(e,r){return E(e,n=>ie(n,r))},show(e){return E(e,r=>W(r,{display:"revert-layer !important"}))},single(e,r){let n=e.collection.length>0;switch(r=r??0,!0){case(n&&u(r,String)):return e.find$(r);case(n&&u(r,Number)):return t(e.collection[r]);case n:return e.collection[0];default:return e}},style(e,r,n){return E(e,a=>{n&&u(r,String)&&(r={[r]:n||"none"}),W(a,r)})},text(e,r,n=!1){switch(!0){case e.isEmpty():return e;case!u(r,String):return e.node.textContent;default:return E(e,i=>i.textContent=n?i.textContent+r:r)}},toDOM(e,r=document.body,n=L.BeforeEnd){return e.isVirtual=!1,D(e.collection,r,n),e},toggleClass(e,r){return E(e,n=>n.classList.toggle(r))},toNodeList(e){return[...e.collection].map(r=>document.importNode(r,!0))},trigger(e,r,n,i){n=u(n,Function)?n:Event,i=u(i,Object)?{...i,bubbles:i.bubbles??!0}:{bubbles:!0};let a=new n(r,i);return e.is.empty||e.each(f=>f.dispatchEvent(a)),e},val(e,r){switch(!0){case(e.is.empty||!u(e.node,HTMLInputElement,HTMLSelectElement,HTMLTextAreaElement)):return e;case!u(r,String):return e.node.value;default:return e.node.value=u(r,String)?r:"",e}}}}var $e,de,{isComment:tn,isText:rn,isHtmlString:nn,isArrayOfHtmlElements:on,isArrayOfHtmlStrings:sn,ElemArray2HtmlString:an,cssRuleEdit:Pe,addFn:Xt}=Gt();function Gt(){return{...Ge(),addFn:Zt}}function Zt(t,e){return t=t?.trim(),!T(t)||!u(e,Function)?w.error("JQx.fn: method invalid parameter(s)"):de[t]=(r,...n)=>e(r,...n)}function Kt(t){return function(e,r,n){if(e=e?.trim(),!T(e)||!u(r,Function))return t.error("JQx.staticFn: invalid parameter(s)");let i=n?{get(){return r()}}:{value(...a){return r(...a)}};try{Object.defineProperty(t,e,i)}catch{return t.warn(`JQx.staticFn: extension [${e}] already exists`)}return w.log(`JQx: added static extension function [${e}]`)}}function V(t){return new Proxy(t,Object.freeze({get:(e,r)=>qt(e,r,t)}))}function et(t,e){return(...r)=>u(t,Function)&&t(V(e),...r)}function qt(t,e,r){switch(!0){case u(e,Symbol):return A({trial:()=>t[e],whenError:()=>t});case u(+e,Number):return t.collection?.[e]||void 0;case e in $e:return et($e[e],r)();case e in de:return et(de[e],r);default:return t[e]}}function nt(t){let e=or(t);for(let[r,n]of Object.entries(Object.getOwnPropertyDescriptors(e)))Object.defineProperty(t,r,n);return t}function er(t){return{allow(e){let r=/-/.test(e),n=r&&e;e=r?z(e):e.toLowerCase(),P.allowTag(e),Object.defineProperties(t,Oe(e,!0,t,n))},prohibit(e){e=e.toLowerCase(),P.prohibitTag(e),Object.defineProperties(t,Oe(e,!1,t))}}}function tt(...t){if(t.length===1){let e=String(t.shift().trim());t=e.startsWith("!")?[e.slice(1,-1)]:e.split(",").map(r=>r.trim())}for(let e of t.map(r=>r.startsWith("!")?r.slice(1,-1):r))Pe(e,{removeRule:1})}function tr(t){return function(e,r,n){r=r?.isJQx?r?.[0]:r,n=n&&Object.values(L).find(a=>n===a);let i=t(e,document.createElement("br"));if(r&&!u(r,HTMLBRElement))for(let a of i.collection)n?r.insertAdjacentElement(n,a):r.append(a);return i}}function rr(...t){let e={};for(let r of t){let n=Object.getOwnPropertyDescriptors(r);for(let[i,a]of Object.entries(n))!(i in e)&&Object.defineProperty(e,i,{...a,enumerable:!1})}return e}function nr(t,e,r,n){return t=N(n||t.toLowerCase()),{get(){return(...i)=>{let a=e&&r.virtual(I(U[t](...i)))||void 0,S=!u(a?.node,Comment,Text,void 0)?Te(a):"";return w.log(e?`JQx: created (virtual) instance from [JQx].${t} ${S}`:`JQx: ${t.toUpperCase()} is prohibited. Use [JQx].allowTag if necessary.`),a}},enumerable:!1,configurable:!0}}function Oe(t,e,r,n){t=t.toLowerCase();let i=nr(t,e,r,n);return n?{[n]:i,[z(n)]:i}:{[t]:i,[t.toUpperCase()]:i}}function or(t){return rr(Object.entries(P.tagsRaw).reduce(ir(t),{}),fr(t))}function ir(t){return function(e,[r,n]){return Object.defineProperties(e,Oe(r,n,t)),e}}function sr(t){return function(e,r,...n){u(r,Function)&&(n.push(r),r=void 0),t({type:e,selector:r,handlers:n})}}function ar(t){return function(e){let{type:r,types:n,origin:i,selector:a,handler:f,handlers:S,node:y,name:x,capture:d,once:b,about:m}=e;f=S||f,r=n||r,a=i||a;let h=Ce(r),g=x;f=u(f,Function)?[f]:f;let c={type:h,selector:a||i,capture:d,name:g,once:b,node:y,about:m};switch(!0){case(u(h,Array)&&h.length>0):for(let o of h)c.type=o,rt(f,c,t);break;default:return rt(f,c,t)}}}function rt(t,e,r){for(let n of t)r.listen({...e,handler:n})}function lr(t){return function(e,r){return r=T(r)&&r,e=T(e)&&e,r&&e&&t.listenerStore[e][r]}}function ur(t){return t.activePopup||Object.defineProperty(t,"activePopup",{value:K(t),enumerable:!1}),t.activePopup}function cr(t){let e=(d,b)=>Pe(d,b),r=function(d){return k({createWithId:d||`jqx${ue()}`})},n=function(...d){for(let b of d)Pe(b)},i=er(t),a=q(t),f=ar(a);return{editCssRule:e,createStyle:r,editCssRules:n,allowProhibit:i,handle:f,capturedHandling:f,log:(...d)=>w.on.log(...d).off,warn:(...d)=>w.on.warn(...d).off,error:(...d)=>w.on.error(...d).off,handlerWrapper:a}}function fr(t){let{factoryExtensions:e,instanceExtensions:r}=qe(t);$e=e,de=r;let{editCssRule:n,createStyle:i,editCssRules:a,allowProhibit:f,handle:S,capturedHandling:y,log:x,warn:d,error:b,handlerWrapper:m}=cr(t),h=lr(t),g=Kt(t);return{log:x,warn:d,error:b,editCssRules:a,createStyle:i,editStylesheet:i,editCssRule:n,escHtml:H,logger:w,text(c,o=!1){return o?t.comment(c):document.createTextNode(c)},node(c,o=document){return o.querySelector(c,o)},nodes(c,o=document){return[...o.querySelectorAll(c,o)]},clearAllTimers:we,get staticFn(){return function(c,o,s){return g(c,o,s)}},get toBool(){return Ne},get getNamedListener(){return h},get virtual(){return tr(t)},get allowTag(){return f.allow},get prohibitTag(){return f.prohibit},get removeCssRule(){return tt},get removeCssRules(){return tt},get delegate(){return sr(y)},get delegateCaptured(){return y},get handle(){return y},get listen(){return m.listen},get at(){return L},get setStyle(){return n},get fn(){return Xt},get lenient(){return P.allowUnknownHtmlTags},get IS(){return u},get Popup(){return ur(t)},get listenerStore(){return m.ListenerStore}}}var ot=nt(dr());function dr(){return function(e,r,n=L.BeforeEnd){if(e?.isJQx)return e;let i=u(r,HTMLBRElement);r=(!i&&r&&r.isJQx?r[0]:r)||document.body,n=n&&Object.values(L).find(d=>n===d)?n:void 0;let a=Y(e),S=!a&&fe(e)||a,y={collection:se(e)??[],isVirtual:i,isJQx:!0},x=_(y.collection);if(y.collection.length&&x)return i||y.collection.forEach(d=>{r.contains(d)||D([d],r,n)}),V(y);if(S){if([e].flat().forEach(d=>y.collection.push(C(d))),y.collection.length>0){let d=y.collection.filter(g=>g?.dataset?.jqxcreationerror);y.collection=y.collection.filter(g=>!g?.dataset?.jqxcreationerror);let m=y.collection.map(g=>`${String(g.constructor).split(/function|\(/)[1].trim()}`).length>1;y=V(y);let h=y.collection.length>0?Xe(y):"sanitized: no elements remaining";w.log(`JQx: created ${y.isVirtual?"(virtual)":""} instance from ${m?"array of ":""}HTML string${m?"s":""} ${h}`),y.isVirtual||D(y.collection,r,n)}return y}return Ae(e,r,y),V(y)}}var mn=ot;export{mn as default};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
var{IS:
|
|
2
|
-
=> @charset, @namespace and @import are not supported here`),{done:!0}}function
|
|
3
|
-
${
|
|
4
|
-
Rule: ${
|
|
5
|
-
${
|
|
6
|
-
${
|
|
7
|
-
Rule: ${
|
|
8
|
-
${
|
|
9
|
-
`)}function
|
|
10
|
-
`).map(
|
|
1
|
+
var{IS:P,maybe:N,$Wrap:J,isNothing:U,xProxy:q,addSymbolicExtensions:G}=w({useSymbolicExtensions:!1});function w(n={}){let{useSymbolicExtensions:c}=n,{shouldbeIsSingleObject:l,ISOneOf:f,isExcept:m,verifyNothingness:g,xProxy:S,determineType:p,addSymbolicExtensions:y,maybe:$,$Wrap:b}=C(d,c);return S.custom(),c&&y(),{IS:d,maybe:$,$Wrap:b,isNothing:g,xProxy:S,addSymbolicExtensions:y};function d(i,...a){let o=typeof i=="symbol"?Symbol.isSymbol:i;switch(!0){case!!$({trial:u=>"isTypes"in(a?.[0]??{})}):return l(i,a[0]);default:return a.length>1?f(o,...a):p(i,...a)}}}function C(n,c){let{SymbolAndCustomProxyFactory:l,maybeFactory:f,WrapAnyFactory:m,verifyNothingness:g,determineType:S}=v(n,d),{xProxy:p,addSymbolicExtensions:y}=l(n,d,c),[$,b]=[f(),m(n,d)];return Object.freeze({shouldbeIsSingleObject:i,ISOneOf:a,isExcept:u,verifyNothingness:g,xProxy:p,determineType:S,addSymbolicExtensions:y,maybe:$,$Wrap:b});function d(e){return e?.[Symbol.proxy]??n(e)}function i(e,r){switch(!0){case"defaultValue"in r:return o(e,r);case"notTypes"in r:return u(e,r);default:return n(e,...[r.isTypes].flat())}}function a(e,...r){return r.some(t=>n(e,t))}function o(e,{defaultValue:r,isTypes:t=[void 0],notTypes:s}={}){return t=t?.constructor!==Array?[t]:t,s=s&&s?.constructor!==Array?[s]:[],s.length<1?n(e,...t)?e:r:u(e,{isTypes:t,notTypes:s})?e:r}function u(e,{isTypes:r=[void 0],notTypes:t=[void 0]}={}){return r=r?.constructor!==Array?[r]:r,t=t?.constructor!==Array?[t]:t,n(e,...r)&&!n(e,...t)}}function v(){let n={IS:"toa.is",TYPE:"toa.type",IS_SYMBOL:"toa.isASymbol",PROXY:"toa.proxy"},c={NAN:"NaN",INFINITY:"Infinity",BOOLEAN:"Boolean",OBJECT:"Object",PROXY_PREFIX:"Proxy ("};return Object.freeze({SymbolAndCustomProxyFactory:f,maybeFactory:o,WrapAnyFactory:a,verifyNothingness:u,determineType:y});function l(e,r){Symbol.is||(Symbol.is=Symbol.for(n.IS),Symbol.type=Symbol.for(n.TYPE),Object.defineProperties(Object.prototype,{[Symbol.type]:{get(){return r(this)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(...t){return e(this,...t)},enumerable:!1,configurable:!1}}),Object.defineProperties(Object,{[Symbol.type]:{value(t){return r(t)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(t,...s){return e(t,...s)},enumerable:!1,configurable:!1}}))}function f(e,r,t){return Symbol.isSymbol||(Symbol.isSymbol=Symbol.for(n.IS_SYMBOL)),{xProxy:S(),addSymbolicExtensions:()=>l(e,r)}}function m(e){return Object.getPrototypeOf(e)?.constructor?.name||c.OBJECT}function g(e){return Proxy=new e(e,{construct(r,t){let s=new r(...t);return s[Symbol.proxy]=`${c.PROXY_PREFIX}${m(t[0])})`,s}}),Proxy}function S(){Symbol.proxy||(Symbol.proxy=Symbol.for(n.PROXY));let e=Proxy;return{native(){Proxy=e},custom(){Proxy=g(e)}}}function p(e,...r){let t=r.length<1,s=e==null;return{noInput:s,noShouldbe:t,compareTo:!t&&r[0],inputCTOR:!s&&(e?.constructor||Object.getPrototypeOf(e)?.constructor),isNaN:Number.isNaN(e)||N({trial:x=>String(e)===c.NAN}),isInfinity:N({trial:x=>String(e)})===c.INFINITY,shouldBeFirstElementIsNothing:!t&&u(r[0])}}function y(e,...r){let{noInput:t,noShouldbe:s,compareTo:x,inputCTOR:O,isNaN:F,isInfinity:I,shouldBeFirstElementIsNothing:j}=p(e,...r);switch(r=r.length&&r[0],!0){case j:return String(e)===String(x);case(e?.[Symbol.proxy]&&s):return e[Symbol.proxy];case F:return s?c.NAN:String(x)===String(e);case I:return s?c.INFINITY:String(x)===String(e);case t:return s?String(e):String(x)===String(e);case O===Boolean:return s?c.BOOLEAN:O===r;default:return b(e,r,s,$(e,O))}}function $(e,r){switch(!0){case e===0:return Number;case e==="":return String;case!e:return{name:String(e)};default:return r}}function b(e,r,t,s){switch(!0){case(!t&&r===e||e?.[Symbol.proxy]&&r===Proxy):return!0;case String(r)===c.NAN:return String(e)===c.NAN;case(e?.[Symbol.toStringTag]&&typeof r=="string"):return String(r)===e[Symbol.toStringTag];default:return r?i(e,r,s):d(e,s)}}function d(e,r){return(e?.[Symbol.toStringTag]??e?.prototype?.[Symbol.toStringTag])||r?.name||String(r)}function i(e,r,t){return N({trial:s=>e instanceof r})||r===t||r===Object.getPrototypeOf(t)||`${r?.name}`===t?.name}function a(e,r){return function(t){let s={get value(){return t},is(...x){return e(t,...x)},get type(){return r(t)}};return Object[Symbol.type]&&Object.defineProperties(s,{[Symbol.type]:{get(){return r(t)}},[Symbol.is]:{value(...x){return e(t,...x)}}}),Object.freeze(s)}}function o(){let e=r=>{};return function({trial:r,whenError:t=e}={}){try{return r()}catch(s){return t(s)}}}function u(e,r=!1){let t=e==null;return t=r?t||P(e,1/0)||P(e,NaN):t,t}}var Q=Y;function Y({styleSheet:n,createWithId:c}={}){let{tryParseAtOrNestedRules:l,ruleExists:f,checkParams:m,sheet:g,removeRules:S,consider:p,currentSheetID:y}=T({styleSheet:n,createWithId:c});function $(o,u){if(o&&u.removeProperties){Object.keys(u.removeProperties).forEach(e=>o.style.removeProperty(R(e)));return}Object.entries(u).forEach(([e,r])=>{e=R(e.trim()),r=r.trim();let t;if(/!important/.test(r)&&(r=r.slice(0,r.indexOf("!important")).trim(),t="important"),!CSS.supports(e,r))return console.error(`StylingFactory ${y} error: '${e}' with value '${r}' not supported (yet)`);E(()=>o.style.setProperty(e,r,t),`StylingFactory ${y} (setRule4Selector) failed`)})}function b(o,u,e=g){if(o=o?.trim?.(),!P(o,String)||!o.length||/[;,]$/g.test(o))return console.error(`StylingFactory ${y} (setRules): [${o||"[no selector given]"}] is not a valid selector`);if(u.removeRule)return S(o);let r=f(o,!0),t=r||e.cssRules[e.insertRule(`${o} {}`,e.cssRules.length||0)];return p(()=>$(t,u),o,r)}function d(o){let u=o.trim().split(/{/,2),e=u.shift().trim();if(!P(e,String)||!e?.trim()?.length)return console.error(`StylingFactory ${y} (doParse): no (valid) selector could be extracted from rule ${h(o)}`);let r=H(u.shift());return E(()=>b(e,r),`StylingFactory ${y} (setRules) failed`)}function i(o){let u=l(o);return u.done?u.existing:d(o)}function a(o,u){return o.trim().startsWith("@media")?i(_(o,u)):b(o,u)}return function(o,u={}){return m(o,u)&&(Object.keys(u).length?a(o,u):i(o))}}function T({styleSheet:n,createWithId:c}){let l="Note: The rule or some of its properties may not be supported by your browser (yet)",f=`for style#${c}`;n=c?m(c):n;function m(i){let a=document.querySelector(`#${i}`)?.sheet;if(a)return a;let o=Object.assign(document.createElement("style"),{id:i});return document.head.insertAdjacentElement("beforeend",o),o.sheet}function g(i){return console.error(`StylingFactory ${f} [rule: ${i}]
|
|
2
|
+
=> @charset, @namespace and @import are not supported here`),{done:!0}}function S(i,a){return[...n.rules].find(o=>a?A(o.selectorText||"",i):k`${X(i)}${[..."gim"]}`.test(o.cssText))}function p(i){return/^@charset|@import|namespace/i.test(i.trim())?g(i):i.match(/}/g)?.length>1?{existing:b(i,1),done:!0}:{done:!1}}function y(i){let a=[...n.cssRules].reduce((u,e,r)=>A(e.selectorText||"",i)&&u.concat(r)||u,[]),o=a.length;return a.forEach(u=>n.deleteRule(u)),o>0?console.info(`\u2714 Removed ${o} instance${o>1?"s":""} of selector ${i} from ${f.slice(4)}`):console.info(`\u2714 Remove rule: selector ${i} does not exist in ${f.slice(4)}`)}function $(i,a){return i&&P(i,String)&&i.trim().length>0&&P(a,Object)||(console.error(`StylingFactory ${f} called with invalid parameters`),!1)}function b(i){i=i.trim();let a=i.slice(0,i.indexOf("{")).trim(),o=!!S(a);try{return n.insertRule(`${i}`,n.cssRules.length),o}catch(u){return console.error(`StylingFactory ${f} (tryParse) ${u.name} Error:
|
|
3
|
+
${u.message}
|
|
4
|
+
Rule: ${h(i)}
|
|
5
|
+
${l}`),o}}function d(i,a,o){try{return i(),o}catch(u){return console.error(`StylingFactory ${f} (tryAddOrModify) ${u.name} Error:
|
|
6
|
+
${u.message}
|
|
7
|
+
Rule: ${h(a)}
|
|
8
|
+
${l}`),o}}return{sheet:n,removeRules:y,tryParseAtOrNestedRules:p,ruleExists:S,checkParams:$,tryParse:b,consider:d,currentSheetID:f}}function _(n,c){return`${n.trim()} ${Object.entries(c).map(([l,f])=>`${l}: { ${L(f)}`)}`}function h(n){let c=(n||"NO RULE").trim().slice(0,50).replace(/\n/g,"\\n").replace(/\s{2,}/g," ");return n.length>c.length?`${c.trim()}...truncated`:c}function L(n){return Object.entries(n).map(([c,l])=>`${c}: ${l.trim()}`).join(`;
|
|
9
|
+
`)}function X(n){return n.replace(/([*\[\]()-+{}.$?\\])/g,c=>`\\${c}`)}function k(n,...c){let l=c.length&&Array.isArray(c.slice(-1))?c.pop().join(""):"";return new RegExp((c.length&&n.raw.reduce((f,m,g)=>f.concat(c[g-1]||"").concat(m),"")||n.raw.join("")).split(`
|
|
10
|
+
`).map(f=>f.replace(/\s|\/\/.*$/g,"").trim().replace(/(@s!)/g," ")).join(""),l)}function R(n){return n.replace(/[A-Z]/g,c=>`-${c.toLowerCase()}`).replace(/[^--]^-|-$/,"")}function E(n,c){try{return n()}catch(l){console.error(`${c||"an error occured"}: ${l.message}`)}}function M(n){return n.replace(/\/\*.+?\*\//gm,"").replace(/[}{\r\n]/g,"").replace(/(data:.+?);/g,(c,l)=>`${l}\\3b`).split(";").map(c=>c.trim()).join(`;
|
|
11
11
|
`).replaceAll("\\3b",";").split(`
|
|
12
|
-
`)}function
|
|
12
|
+
`)}function z(n){return n.reduce((c,l)=>{let[f,m]=[l.slice(0,l.indexOf(":")).trim(),l.slice(l.indexOf(":")+1).trim().replace(/;$|;.+(?=\/*).+\/$/,"")];return f&&m?{...c,[f]:m}:c},{})}function H(n){return z(M(n))}function A(n,c){return n?.replace("::",":")===c?.replace("::",":")}export{Q as default};
|
|
@@ -1,129 +1,54 @@
|
|
|
1
1
|
const { IS, maybe, $Wrap, isNothing, xProxy, addSymbolicExtensions } =
|
|
2
2
|
TOAFactory({useSymbolicExtensions: false});
|
|
3
|
+
|
|
3
4
|
export { IS as default, maybe, $Wrap, xProxy, isNothing, addSymbolicExtensions };
|
|
4
5
|
|
|
5
6
|
function TOAFactory(specs = {}) {
|
|
6
|
-
const {useSymbolicExtensions} = specs;
|
|
7
|
-
const {
|
|
8
|
-
|
|
9
|
-
const [$Wrap] = [WrapAnyFactory()];
|
|
7
|
+
const { useSymbolicExtensions } = specs;
|
|
8
|
+
const { shouldbeIsSingleObject, ISOneOf, isExcept, verifyNothingness, xProxy,
|
|
9
|
+
determineType, addSymbolicExtensions, maybe, $Wrap } = TOAHelpers(IS, useSymbolicExtensions);
|
|
10
10
|
xProxy.custom();
|
|
11
|
-
!!useSymbolicExtensions && addSymbolicExtensions();
|
|
12
11
|
|
|
13
|
-
|
|
12
|
+
if (!!useSymbolicExtensions) { addSymbolicExtensions(); }
|
|
13
|
+
|
|
14
|
+
return {IS, maybe, $Wrap, isNothing: verifyNothingness, xProxy, addSymbolicExtensions};
|
|
14
15
|
|
|
15
16
|
function IS(anything, ...shouldBe) {
|
|
16
17
|
const input = typeof anything === `symbol` ? Symbol.isSymbol : anything;
|
|
17
18
|
switch(true) {
|
|
18
|
-
case !!maybe({trial: _ => `isTypes` in (shouldBe?.[0] ?? {})}):
|
|
19
|
+
case !!maybe({trial: _ => `isTypes` in (shouldBe?.[0] ?? {})}):
|
|
20
|
+
return shouldbeIsSingleObject(anything, shouldBe[0]);
|
|
19
21
|
default: return shouldBe.length > 1 ? ISOneOf(input, ...shouldBe) : determineType(anything, ...shouldBe);
|
|
20
22
|
}
|
|
21
23
|
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function TOAHelpers(IS, useSymbolicExtensions) {
|
|
27
|
+
const { SymbolAndCustomProxyFactory, maybeFactory, WrapAnyFactory,
|
|
28
|
+
verifyNothingness, determineType } = AUXHelperFactory(IS, typeOf);
|
|
29
|
+
const {xProxy, addSymbolicExtensions} = SymbolAndCustomProxyFactory(IS, typeOf, useSymbolicExtensions);
|
|
30
|
+
const [maybe, $Wrap] = [maybeFactory(), WrapAnyFactory(IS, typeOf)];
|
|
22
31
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
case `notTypes` in isTypeObj: return isExcept(anything, isTypeObj);
|
|
27
|
-
default: return IS(anything, ...[isTypeObj.isTypes].flat());
|
|
28
|
-
}
|
|
29
|
-
}
|
|
32
|
+
return Object.freeze({
|
|
33
|
+
shouldbeIsSingleObject, ISOneOf, isExcept, verifyNothingness, xProxy,
|
|
34
|
+
determineType, addSymbolicExtensions, maybe, $Wrap });
|
|
30
35
|
|
|
31
36
|
function typeOf(anything) {
|
|
32
37
|
return anything?.[Symbol.proxy] ?? IS(anything);
|
|
33
38
|
}
|
|
34
39
|
|
|
35
|
-
function
|
|
36
|
-
let { noInput, noShouldbe, compareTo, inputCTOR, isNaN, isInfinity, shouldBeFirstElementIsNothing } =
|
|
37
|
-
processInput(input, ...shouldBe);
|
|
38
|
-
shouldBe = shouldBe.length && shouldBe[0];
|
|
39
|
-
|
|
40
|
-
switch (true) {
|
|
41
|
-
case shouldBeFirstElementIsNothing: return String(input) === String(compareTo);
|
|
42
|
-
case input?.[Symbol.proxy] && noShouldbe: return input[Symbol.proxy];
|
|
43
|
-
case isNaN: return noShouldbe ? `NaN` : String(compareTo) === String(input);
|
|
44
|
-
case isInfinity: return noShouldbe ? `Infinity` : String(compareTo) === String(input);
|
|
45
|
-
case noInput: return noShouldbe ? String(input) : String(compareTo) === String(input);
|
|
46
|
-
case inputCTOR === Boolean: return !shouldBe ? `Boolean` : inputCTOR === shouldBe;
|
|
47
|
-
default: return getResult(input, shouldBe, noShouldbe, getMe(input, inputCTOR));
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
function processInput(input, ...shouldBe) {
|
|
52
|
-
const noShouldbe = shouldBe.length < 1;
|
|
53
|
-
const noInput = input === undefined || input === null;
|
|
54
|
-
|
|
55
|
-
return {
|
|
56
|
-
noInput,
|
|
57
|
-
noShouldbe,
|
|
58
|
-
compareTo: !noShouldbe && shouldBe[0],
|
|
59
|
-
inputCTOR: !noInput && Object.getPrototypeOf(input)?.constructor,
|
|
60
|
-
isNaN: Number.isNaN(input) || maybe({trial: _ => String(input) === `NaN`}),
|
|
61
|
-
isInfinity: maybe({trial: _ => String(input)}) === `Infinity`,
|
|
62
|
-
shouldBeFirstElementIsNothing: !noShouldbe && isNothing(shouldBe[0])
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function getMe(input, inputCTOR) {
|
|
67
|
-
switch(true) {
|
|
68
|
-
case input === 0: return Number;
|
|
69
|
-
case input === ``: return String;
|
|
70
|
-
case !input: return {name: String(input)};
|
|
71
|
-
default: return inputCTOR;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
function getResult(input, compareWith, noShouldbe, me) {
|
|
40
|
+
function shouldbeIsSingleObject(anything, isTypeObj) {
|
|
76
41
|
switch(true) {
|
|
77
|
-
case
|
|
78
|
-
case
|
|
79
|
-
|
|
80
|
-
return String(compareWith) === input[Symbol.toStringTag];
|
|
81
|
-
default: return compareWith ? resultWithComparison(input, compareWith, me) : resultWithoutComparison(input, me);
|
|
42
|
+
case `defaultValue` in isTypeObj: return isOrDefault(anything, isTypeObj);
|
|
43
|
+
case `notTypes` in isTypeObj: return isExcept(anything, isTypeObj);
|
|
44
|
+
default: return IS(anything, ...[isTypeObj.isTypes].flat());
|
|
82
45
|
}
|
|
83
46
|
}
|
|
84
47
|
|
|
85
|
-
function resultWithoutComparison(input, me) {
|
|
86
|
-
const toStringTag = input?.[Symbol.toStringTag] ?? input?.prototype?.[Symbol.toStringTag];
|
|
87
|
-
return toStringTag || me?.name || String(me);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
function resultWithComparison(input, compareWith, me) {
|
|
91
|
-
return maybe({trial: _ =>
|
|
92
|
-
input instanceof compareWith}) ||
|
|
93
|
-
compareWith === me ||
|
|
94
|
-
compareWith === Object.getPrototypeOf(me) ||
|
|
95
|
-
`${compareWith?.name}` === me?.name;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
48
|
function ISOneOf(obj, ...params) {
|
|
99
49
|
return params.some(param => IS(obj, param));
|
|
100
50
|
}
|
|
101
51
|
|
|
102
|
-
function isNothing(maybeNothing, all = false) {
|
|
103
|
-
let nada = maybeNothing === null || maybeNothing === undefined;
|
|
104
|
-
nada = all ? nada || IS(maybeNothing, Infinity) || IS(maybeNothing, NaN) : nada;
|
|
105
|
-
return nada;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
function maybeFactory() {
|
|
109
|
-
const errFn = err => undefined;
|
|
110
|
-
return function({trial, whenError = errFn } = {}) {
|
|
111
|
-
try { return trial(); } catch (err) { return whenError(err); }
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
function WrapAnyFactory() {
|
|
116
|
-
return function (someObj) {
|
|
117
|
-
return Object.freeze({
|
|
118
|
-
get value() { return someObj; },
|
|
119
|
-
get [Symbol.type]() { return typeOf(someObj); },
|
|
120
|
-
get type() { return typeOf(someObj); },
|
|
121
|
-
[Symbol.is](...args) { return IS(someObj, ...args); },
|
|
122
|
-
is(...args) { return IS(someObj, ...args); }
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
52
|
function isOrDefault(input, {defaultValue, isTypes = [undefined], notTypes} = {}) {
|
|
128
53
|
isTypes = isTypes?.constructor !== Array ? [isTypes] : isTypes;
|
|
129
54
|
notTypes = notTypes && notTypes?.constructor !== Array ? [notTypes] : [];
|
|
@@ -137,33 +62,34 @@ function TOAFactory(specs = {}) {
|
|
|
137
62
|
notTypes = notTypes?.constructor !== Array ? [notTypes] : notTypes;
|
|
138
63
|
return IS(input, ...isTypes) && !IS(input, ...notTypes);
|
|
139
64
|
}
|
|
140
|
-
|
|
141
|
-
function addSymbols2Anything() {
|
|
142
|
-
if (!Object.getOwnPropertyDescriptors(Object.prototype)[Symbol.is]) {
|
|
143
|
-
Object.defineProperties(Object.prototype, {
|
|
144
|
-
[Symbol.type]: { get() { return typeOf(this); }, enumerable: false, configurable: false },
|
|
145
|
-
[Symbol.is]: { value: function (...args) { return IS(this, ...args); }, enumerable: false, configurable: false },
|
|
146
|
-
});
|
|
147
|
-
Object.defineProperties(Object, {
|
|
148
|
-
[Symbol.type]: { value(obj) { return typeOf(obj); }, enumerable: false, configurable: false },
|
|
149
|
-
[Symbol.is]: { value: function (obj, ...args) { return IS(obj, ...args); }, enumerable: false, configurable: false },
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
65
|
}
|
|
154
66
|
|
|
155
|
-
function
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
67
|
+
function AUXHelperFactory() {
|
|
68
|
+
const SYMBOL_KEYS = {
|
|
69
|
+
IS: 'toa.is',
|
|
70
|
+
TYPE: 'toa.type',
|
|
71
|
+
IS_SYMBOL: 'toa.isASymbol',
|
|
72
|
+
PROXY: 'toa.proxy'
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const TYPE_STRINGS = {
|
|
76
|
+
NAN: 'NaN',
|
|
77
|
+
INFINITY: 'Infinity',
|
|
78
|
+
BOOLEAN: 'Boolean',
|
|
79
|
+
OBJECT: 'Object',
|
|
80
|
+
PROXY_PREFIX: 'Proxy ('
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
return Object.freeze({
|
|
84
|
+
SymbolAndCustomProxyFactory, maybeFactory, WrapAnyFactory, verifyNothingness, determineType
|
|
85
|
+
}
|
|
86
|
+
);
|
|
159
87
|
|
|
160
|
-
function addSymbols2Anything() {
|
|
88
|
+
function addSymbols2Anything(IS, typeOf) {
|
|
161
89
|
if (!Symbol.is) {
|
|
162
|
-
Symbol.is = Symbol.for(
|
|
163
|
-
Symbol.type = Symbol.for(
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
if (!Object.getOwnPropertyDescriptors(Object.prototype)[Symbol.is]) {
|
|
90
|
+
Symbol.is = Symbol.for(SYMBOL_KEYS.IS);
|
|
91
|
+
Symbol.type = Symbol.for(SYMBOL_KEYS.TYPE);
|
|
92
|
+
|
|
167
93
|
Object.defineProperties(Object.prototype, {
|
|
168
94
|
[Symbol.type]: { get() { return typeOf(this); }, enumerable: false, configurable: false },
|
|
169
95
|
[Symbol.is]: { value: function (...args) { return IS(this, ...args); }, enumerable: false, configurable: false },
|
|
@@ -175,38 +101,131 @@ function SymbolAndCustomProxyFactory(IS, typeOf, useSymbolicExtension) {
|
|
|
175
101
|
}
|
|
176
102
|
}
|
|
177
103
|
|
|
178
|
-
function
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
return oldSetter(target, key, value);
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
return setterMethod2Modify;
|
|
104
|
+
function SymbolAndCustomProxyFactory(IS, typeOf, useSymbolicExtension) {
|
|
105
|
+
if (!Symbol.isSymbol) { Symbol.isSymbol = Symbol.for(SYMBOL_KEYS.IS_SYMBOL); }
|
|
106
|
+
|
|
107
|
+
return {xProxy: setCustomOrDefaultProxyFactory(), addSymbolicExtensions: () => addSymbols2Anything(IS, typeOf)};
|
|
186
108
|
}
|
|
187
109
|
|
|
188
|
-
function
|
|
110
|
+
function constructor2String(obj) {
|
|
189
111
|
const ctor = Object.getPrototypeOf(obj)?.constructor;
|
|
190
|
-
return ctor?.name ||
|
|
112
|
+
return ctor?.name || TYPE_STRINGS.OBJECT;
|
|
191
113
|
}
|
|
192
114
|
|
|
193
|
-
function
|
|
115
|
+
function createCustomProxy(nativeProxy) {
|
|
194
116
|
Proxy = new nativeProxy(nativeProxy, {
|
|
195
117
|
construct(target, args) {
|
|
196
|
-
for (let item of args) { if (item.set) { item = modifySetter(item); } }
|
|
197
118
|
const wrappedProxy = new target(...args);
|
|
198
|
-
wrappedProxy[Symbol.proxy] =
|
|
119
|
+
wrappedProxy[Symbol.proxy] = `${TYPE_STRINGS.PROXY_PREFIX}${constructor2String(args[0])})`;
|
|
199
120
|
return wrappedProxy;
|
|
200
121
|
}
|
|
201
122
|
});
|
|
202
123
|
return Proxy;
|
|
203
124
|
}
|
|
204
125
|
|
|
205
|
-
function
|
|
206
|
-
if (!Symbol.proxy) { Symbol.proxy = Symbol.for(
|
|
126
|
+
function setCustomOrDefaultProxyFactory() {
|
|
127
|
+
if (!Symbol.proxy) { Symbol.proxy = Symbol.for(SYMBOL_KEYS.PROXY); }
|
|
207
128
|
const nativeProxy = Proxy;
|
|
208
129
|
return {
|
|
209
130
|
native() { Proxy = nativeProxy; },
|
|
210
|
-
custom() { Proxy =
|
|
131
|
+
custom() { Proxy = createCustomProxy(nativeProxy); } };
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function processInput(input, ...shouldBe) {
|
|
135
|
+
const noShouldbe = shouldBe.length < 1;
|
|
136
|
+
const noInput = input === undefined || input === null;
|
|
137
|
+
|
|
138
|
+
return {
|
|
139
|
+
noInput,
|
|
140
|
+
noShouldbe,
|
|
141
|
+
compareTo: !noShouldbe && shouldBe[0],
|
|
142
|
+
inputCTOR: !noInput && (input?.constructor || Object.getPrototypeOf(input)?.constructor),
|
|
143
|
+
isNaN: Number.isNaN(input) || maybe({trial: _ => String(input) === TYPE_STRINGS.NAN}),
|
|
144
|
+
isInfinity: maybe({trial: _ => String(input)}) === TYPE_STRINGS.INFINITY,
|
|
145
|
+
shouldBeFirstElementIsNothing: !noShouldbe && verifyNothingness(shouldBe[0])
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
function determineType(input, ...shouldBe) {
|
|
150
|
+
let { noInput, noShouldbe, compareTo, inputCTOR, isNaN, isInfinity, shouldBeFirstElementIsNothing } =
|
|
151
|
+
processInput(input, ...shouldBe);
|
|
152
|
+
shouldBe = shouldBe.length && shouldBe[0];
|
|
153
|
+
|
|
154
|
+
switch (true) {
|
|
155
|
+
case shouldBeFirstElementIsNothing: return String(input) === String(compareTo);
|
|
156
|
+
case input?.[Symbol.proxy] && noShouldbe: return input[Symbol.proxy];
|
|
157
|
+
case isNaN: return noShouldbe ? TYPE_STRINGS.NAN : String(compareTo) === String(input);
|
|
158
|
+
case isInfinity: return noShouldbe ? TYPE_STRINGS.INFINITY : String(compareTo) === String(input);
|
|
159
|
+
case noInput: return noShouldbe ? String(input) : String(compareTo) === String(input);
|
|
160
|
+
case inputCTOR === Boolean: return noShouldbe ? TYPE_STRINGS.BOOLEAN : inputCTOR === shouldBe;
|
|
161
|
+
default: return getResult(input, shouldBe, noShouldbe, finalInputResolver(input, inputCTOR));
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
function finalInputResolver(input, inputCTOR) {
|
|
166
|
+
switch(true) {
|
|
167
|
+
case input === 0: return Number;
|
|
168
|
+
case input === ``: return String;
|
|
169
|
+
case !input: return {name: String(input)};
|
|
170
|
+
default: return inputCTOR;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
function getResult(input, compareWith, noShouldbe, maybeResult) {
|
|
175
|
+
switch (true) {
|
|
176
|
+
case (!noShouldbe && compareWith === input) || (input?.[Symbol.proxy] && compareWith === Proxy):
|
|
177
|
+
return true;
|
|
178
|
+
case String(compareWith) === TYPE_STRINGS.NAN:
|
|
179
|
+
return String(input) === TYPE_STRINGS.NAN;
|
|
180
|
+
case input?.[Symbol.toStringTag] && typeof compareWith === `string`:
|
|
181
|
+
return String(compareWith) === input[Symbol.toStringTag];
|
|
182
|
+
default:
|
|
183
|
+
return compareWith ?
|
|
184
|
+
resultWithComparison(input, compareWith, maybeResult) : resultWithoutComparison(input, maybeResult);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
function resultWithoutComparison(input, maybeResult) {
|
|
189
|
+
const toStringTag = input?.[Symbol.toStringTag] ?? input?.prototype?.[Symbol.toStringTag];
|
|
190
|
+
return toStringTag || maybeResult?.name || String(maybeResult);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
function resultWithComparison(input, compareWith, maybeResult) {
|
|
194
|
+
return maybe({trial: _ =>
|
|
195
|
+
input instanceof compareWith}) ||
|
|
196
|
+
compareWith === maybeResult ||
|
|
197
|
+
compareWith === Object.getPrototypeOf(maybeResult) ||
|
|
198
|
+
`${compareWith?.name}` === maybeResult?.name;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
function WrapAnyFactory(IS, typeOf) {
|
|
202
|
+
return function (someObj) {
|
|
203
|
+
const wrapper = {
|
|
204
|
+
get value() { return someObj; },
|
|
205
|
+
is(...args) { return IS(someObj, ...args); },
|
|
206
|
+
get type() { return typeOf(someObj); },
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
if (Object[Symbol.type]) {
|
|
210
|
+
Object.defineProperties(wrapper, {
|
|
211
|
+
[Symbol.type]: { get() { return typeOf(someObj);} },
|
|
212
|
+
[Symbol.is]: { value(...args) { return IS(someObj, ...args); }}
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
return Object.freeze(wrapper);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
function maybeFactory() {
|
|
220
|
+
const errFn = err => undefined;
|
|
221
|
+
return function({trial, whenError = errFn } = {}) {
|
|
222
|
+
try { return trial(); } catch (err) { return whenError(err); }
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
function verifyNothingness(maybeNothing, all = false) {
|
|
227
|
+
let nada = maybeNothing === null || maybeNothing === undefined;
|
|
228
|
+
nada = all ? nada || IS(maybeNothing, Infinity) || IS(maybeNothing, NaN) : nada;
|
|
229
|
+
return nada;
|
|
211
230
|
}
|
|
212
231
|
}
|