@briklab/lib 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,19 +4,46 @@
4
4
  * Runtime JS Type Checker
5
5
  * @module JSTC
6
6
  */
7
+ /**
8
+ * # Primitive Type
9
+ */
7
10
  type PrimitiveType = "string" | "number" | "boolean" | "object" | "function" | "undefined" | "symbol" | "bigint";
11
+ /**
12
+ * JS constructor type
13
+ */
8
14
  type ConstructorType = Function;
15
+ /**
16
+ * # JSType
17
+ * A Valid Javascript Type
18
+ */
9
19
  export type JSType = PrimitiveType | ConstructorType | string;
20
+ /**
21
+ * # JSType
22
+ * A Valid JavaScript Type or a Valid JavaScript Type Array
23
+ */
10
24
  export type JSTypeOrArray = JSType | JSType[];
25
+ /**
26
+ * # JSTypeChecker
27
+ * A JS Type Checker. Add type checking to your javascript files as well
28
+ */
11
29
  export declare class JSTypeChecker {
12
30
  #private;
13
31
  /**
32
+ * ### JSTypeChecker.for
14
33
  * check if specific arguments are of a specific type, class, etc.
15
34
  * @param {unknown[]} args
16
35
  */
17
36
  for(args: unknown[]): {
37
+ /**
38
+ * ### JSTypeChecker.for().check
39
+ * Check the given arguments with corresponding given types
40
+ */
18
41
  check: (types: JSTypeOrArray[]) => boolean;
19
42
  };
43
+ /**
44
+ * ### JSTypeChecker.addCustomHandler
45
+ * Create a custom handler for checking types.
46
+ */
20
47
  addCustomHandler(name: string, handler: (value: unknown) => boolean): void;
21
48
  }
22
49
  declare const JSTC: JSTypeChecker;
@@ -1,8 +1,6 @@
1
- var c=function(n,t,r,e){if(r==="a"&&!e)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?n!==t||!e:!t.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?e:r==="a"?e.call(n):e?e.value:t.get(n)},s,u=class{constructor(){s.set(this,{Array:t=>Array.isArray(t),"string[]":t=>Array.isArray(t)&&t.every(r=>typeof r=="string")})}for(t){return Array.isArray(t)||(console.warn(`[JSTC.for] @briklab/lib/jstc: Invalid first argument!
1
+ var c=function(n,t,e,r){if(e==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?n!==t||!r:!t.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?r:e==="a"?r.call(n):r?r.value:t.get(n)},i,u=class{constructor(){i.set(this,{Array:t=>Array.isArray(t),"string[]":t=>Array.isArray(t)&&t.every(e=>typeof e=="string")})}for(t){return Array.isArray(t)||(console.warn(`[JSTC.for] @briklab/lib/jstc: Invalid first argument!
2
2
  Hint: The first argument must be a array.
3
- Using [givenValue] as fallback`),t=[t]),{check:r=>{if(Array.isArray(r)||(console.warn(`[JSTC.for().check] @briklab/lib/jstc: Invalid first argument!
4
- Hint: The first argument must be a valid array!
5
- Using [givenValue] as fallback`),r=[r]),t.length<r.length)return!1;for(let e=0;e<r.length;e++){let o=t[e],f=r[e],b=Array.isArray(f)?f:[f],i=!1;for(let l of b){let d=typeof l=="string"?l.split("|"):[l];for(let a of d)if(typeof a=="function"){if(o instanceof a){i=!0;break}}else if(typeof a=="string"&&c(this,s,"f")[a]){if(c(this,s,"f")[a](o)){i=!0;break}}else if(typeof o===a){i=!0;break}if(i)break}if(!i)return!1}return!0}}}addCustomHandler(t,r){typeof t=="string"&&typeof r=="function"||(console.warn(`[JSTC.addCustomHandler] @briklab/lib/jstc: Invalid Arguments!
3
+ Using [givenValue] as fallback`),t=[t]),{check:e=>{if(t.length<e.length)return!1;for(let r=0;r<e.length;r++){let o=t[r],f=e[r],y=Array.isArray(f)?f:[f],s=!1;for(let l of y){let d=typeof l=="string"?l.split("|"):[l];for(let a of d)if(typeof a=="function"){if(o instanceof a){s=!0;break}}else if(typeof a=="string"&&c(this,i,"f")[a]){if(c(this,i,"f")[a](o)){s=!0;break}}else if(typeof o===a){s=!0;break}if(s)break}if(!s)return!1}return!0}}}addCustomHandler(t,e){typeof t=="string"&&typeof e=="function"||(console.warn(`[JSTC.addCustomHandler] @briklab/lib/jstc: Invalid Arguments!
6
4
  Hint: The first argument must be a string, and the second argument must be a function
7
- Using String(argument1) and ()=>false as fallbacks`),t=String(t),r=()=>!1),c(this,s,"f")[t]=r}};s=new WeakMap;var g=new u,y=g;export{u as JSTypeChecker,y as default};
5
+ Using String(argument1) and ()=>false as fallbacks`),t=String(t),e=()=>!1),c(this,i,"f")[t]=e}};i=new WeakMap;var g=new u,b=g;export{u as JSTypeChecker,b as default};
8
6
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["index.js"],
4
- "sourcesContent": ["/**\n * # JSTC\n * @packageDocumentation\n * Runtime JS Type Checker\n * @module JSTC\n */\nvar __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar _JSTypeChecker___CustomHandler;\nexport class JSTypeChecker {\n constructor() {\n _JSTypeChecker___CustomHandler.set(this, {\n Array: (value) => Array.isArray(value),\n \"string[]\": (value) => Array.isArray(value) && value.every((v) => typeof v === \"string\"),\n });\n }\n /**\n * check if specific arguments are of a specific type, class, etc.\n * @param {unknown[]} args\n */\n for(args) {\n if (!Array.isArray(args)) {\n console.warn(`[JSTC.for] @briklab/lib/jstc: Invalid first argument!\r\n Hint: The first argument must be a array.\r\n Using [givenValue] as fallback`);\n args = [args];\n }\n return {\n check: (types) => {\n if (!Array.isArray(types)) {\n console.warn(`[JSTC.for().check] @briklab/lib/jstc: Invalid first argument!\r\n Hint: The first argument must be a valid array!\r\n Using [givenValue] as fallback`);\n types = [types];\n }\n if (args.length < types.length)\n return false;\n for (let i = 0; i < types.length; i++) {\n const value = args[i];\n const expected = types[i];\n const expectedTypes = Array.isArray(expected) ? expected : [expected];\n let matched = false;\n for (const tRaw of expectedTypes) {\n const unionTypes = typeof tRaw === \"string\" ? tRaw.split(\"|\") : [tRaw];\n for (const t of unionTypes) {\n if (typeof t === \"function\") {\n if (value instanceof t) {\n matched = true;\n break;\n }\n }\n else if (typeof t === \"string\" && __classPrivateFieldGet(this, _JSTypeChecker___CustomHandler, \"f\")[t]) {\n if (__classPrivateFieldGet(this, _JSTypeChecker___CustomHandler, \"f\")[t](value)) {\n matched = true;\n break;\n }\n }\n else if (typeof value === t) {\n matched = true;\n break;\n }\n }\n if (matched)\n break;\n }\n if (!matched)\n return false;\n }\n return true;\n },\n };\n }\n addCustomHandler(name, handler) {\n if (!(typeof name === \"string\" && typeof handler === \"function\")) {\n console.warn(`[JSTC.addCustomHandler] @briklab/lib/jstc: Invalid Arguments!\r\n Hint: The first argument must be a string, and the second argument must be a function\r\n Using String(argument1) and ()=>false as fallbacks`);\n name = String(name);\n handler = () => false;\n }\n __classPrivateFieldGet(this, _JSTypeChecker___CustomHandler, \"f\")[name] = handler;\n }\n}\n_JSTypeChecker___CustomHandler = new WeakMap();\nconst JSTC = new JSTypeChecker();\nexport default JSTC;\n"],
5
- "mappings": "AAMA,IAAIA,EAAkE,SAAUC,EAAUC,EAAOC,EAAMC,EAAG,CACtG,GAAID,IAAS,KAAO,CAACC,EAAG,MAAM,IAAI,UAAU,+CAA+C,EAC3F,GAAI,OAAOF,GAAU,WAAaD,IAAaC,GAAS,CAACE,EAAI,CAACF,EAAM,IAAID,CAAQ,EAAG,MAAM,IAAI,UAAU,0EAA0E,EACjL,OAAOE,IAAS,IAAMC,EAAID,IAAS,IAAMC,EAAE,KAAKH,CAAQ,EAAIG,EAAIA,EAAE,MAAQF,EAAM,IAAID,CAAQ,CAChG,EACII,EACSC,EAAN,KAAoB,CACvB,aAAc,CACVD,EAA+B,IAAI,KAAM,CACrC,MAAQE,GAAU,MAAM,QAAQA,CAAK,EACrC,WAAaA,GAAU,MAAM,QAAQA,CAAK,GAAKA,EAAM,MAAOC,GAAM,OAAOA,GAAM,QAAQ,CAC3F,CAAC,CACL,CAKA,IAAIC,EAAM,CACN,OAAK,MAAM,QAAQA,CAAI,IACnB,QAAQ,KAAK;AAAA;AAAA,uCAEc,EAC3BA,EAAO,CAACA,CAAI,GAET,CACH,MAAQC,GAAU,CAOd,GANK,MAAM,QAAQA,CAAK,IACpB,QAAQ,KAAK;AAAA;AAAA,2CAEU,EACvBA,EAAQ,CAACA,CAAK,GAEdD,EAAK,OAASC,EAAM,OACpB,MAAO,GACX,QAASC,EAAI,EAAGA,EAAID,EAAM,OAAQC,IAAK,CACnC,IAAMJ,EAAQE,EAAKE,CAAC,EACdC,EAAWF,EAAMC,CAAC,EAClBE,EAAgB,MAAM,QAAQD,CAAQ,EAAIA,EAAW,CAACA,CAAQ,EAChEE,EAAU,GACd,QAAWC,KAAQF,EAAe,CAC9B,IAAMG,EAAa,OAAOD,GAAS,SAAWA,EAAK,MAAM,GAAG,EAAI,CAACA,CAAI,EACrE,QAAWE,KAAKD,EACZ,GAAI,OAAOC,GAAM,YACb,GAAIV,aAAiBU,EAAG,CACpBH,EAAU,GACV,KACJ,UAEK,OAAOG,GAAM,UAAYjB,EAAuB,KAAMK,EAAgC,GAAG,EAAEY,CAAC,GACjG,GAAIjB,EAAuB,KAAMK,EAAgC,GAAG,EAAEY,CAAC,EAAEV,CAAK,EAAG,CAC7EO,EAAU,GACV,KACJ,UAEK,OAAOP,IAAUU,EAAG,CACzBH,EAAU,GACV,KACJ,CAEJ,GAAIA,EACA,KACR,CACA,GAAI,CAACA,EACD,MAAO,EACf,CACA,MAAO,EACX,CACJ,CACJ,CACA,iBAAiBI,EAAMC,EAAS,CACtB,OAAOD,GAAS,UAAY,OAAOC,GAAY,aACjD,QAAQ,KAAK;AAAA;AAAA,2DAEkC,EAC/CD,EAAO,OAAOA,CAAI,EAClBC,EAAU,IAAM,IAEpBnB,EAAuB,KAAMK,EAAgC,GAAG,EAAEa,CAAI,EAAIC,CAC9E,CACJ,EACAd,EAAiC,IAAI,QACrC,IAAMe,EAAO,IAAId,EACVe,EAAQD",
4
+ "sourcesContent": ["/**\n * # JSTC\n * @packageDocumentation\n * Runtime JS Type Checker\n * @module JSTC\n */\nvar __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar _JSTypeChecker___CustomHandler;\n/**\n * # JSTypeChecker\n * A JS Type Checker. Add type checking to your javascript files as well\n */\nexport class JSTypeChecker {\n constructor() {\n _JSTypeChecker___CustomHandler.set(this, {\n Array: (value) => Array.isArray(value),\n \"string[]\": (value) => Array.isArray(value) && value.every((v) => typeof v === \"string\"),\n });\n }\n /**\n * ### JSTypeChecker.for\n * check if specific arguments are of a specific type, class, etc.\n * @param {unknown[]} args\n */\n for(args) {\n if (!Array.isArray(args)) {\n console.warn(`[JSTC.for] @briklab/lib/jstc: Invalid first argument!\r\n Hint: The first argument must be a array.\r\n Using [givenValue] as fallback`);\n args = [args];\n }\n return {\n /**\n * ### JSTypeChecker.for().check\n * Check the given arguments with corresponding given types\n */\n check: (types) => {\n if (args.length < types.length)\n return false;\n for (let i = 0; i < types.length; i++) {\n const value = args[i];\n const expected = types[i];\n const expectedTypes = Array.isArray(expected) ? expected : [expected];\n let matched = false;\n for (const tRaw of expectedTypes) {\n const unionTypes = typeof tRaw === \"string\" ? tRaw.split(\"|\") : [tRaw];\n for (const t of unionTypes) {\n if (typeof t === \"function\") {\n if (value instanceof t) {\n matched = true;\n break;\n }\n }\n else if (typeof t === \"string\" && __classPrivateFieldGet(this, _JSTypeChecker___CustomHandler, \"f\")[t]) {\n if (__classPrivateFieldGet(this, _JSTypeChecker___CustomHandler, \"f\")[t](value)) {\n matched = true;\n break;\n }\n }\n else if (typeof value === t) {\n matched = true;\n break;\n }\n }\n if (matched)\n break;\n }\n if (!matched)\n return false;\n }\n return true;\n },\n };\n }\n /**\n * ### JSTypeChecker.addCustomHandler\n * Create a custom handler for checking types.\n */\n addCustomHandler(name, handler) {\n if (!(typeof name === \"string\" && typeof handler === \"function\")) {\n console.warn(`[JSTC.addCustomHandler] @briklab/lib/jstc: Invalid Arguments!\r\n Hint: The first argument must be a string, and the second argument must be a function\r\n Using String(argument1) and ()=>false as fallbacks`);\n name = String(name);\n handler = () => false;\n }\n __classPrivateFieldGet(this, _JSTypeChecker___CustomHandler, \"f\")[name] = handler;\n }\n}\n_JSTypeChecker___CustomHandler = new WeakMap();\nconst JSTC = new JSTypeChecker();\nexport default JSTC;\n"],
5
+ "mappings": "AAMA,IAAIA,EAAkE,SAAUC,EAAUC,EAAOC,EAAMC,EAAG,CACtG,GAAID,IAAS,KAAO,CAACC,EAAG,MAAM,IAAI,UAAU,+CAA+C,EAC3F,GAAI,OAAOF,GAAU,WAAaD,IAAaC,GAAS,CAACE,EAAI,CAACF,EAAM,IAAID,CAAQ,EAAG,MAAM,IAAI,UAAU,0EAA0E,EACjL,OAAOE,IAAS,IAAMC,EAAID,IAAS,IAAMC,EAAE,KAAKH,CAAQ,EAAIG,EAAIA,EAAE,MAAQF,EAAM,IAAID,CAAQ,CAChG,EACII,EAKSC,EAAN,KAAoB,CACvB,aAAc,CACVD,EAA+B,IAAI,KAAM,CACrC,MAAQE,GAAU,MAAM,QAAQA,CAAK,EACrC,WAAaA,GAAU,MAAM,QAAQA,CAAK,GAAKA,EAAM,MAAOC,GAAM,OAAOA,GAAM,QAAQ,CAC3F,CAAC,CACL,CAMA,IAAIC,EAAM,CACN,OAAK,MAAM,QAAQA,CAAI,IACnB,QAAQ,KAAK;AAAA;AAAA,uCAEc,EAC3BA,EAAO,CAACA,CAAI,GAET,CAKH,MAAQC,GAAU,CACd,GAAID,EAAK,OAASC,EAAM,OACpB,MAAO,GACX,QAASC,EAAI,EAAGA,EAAID,EAAM,OAAQC,IAAK,CACnC,IAAMJ,EAAQE,EAAKE,CAAC,EACdC,EAAWF,EAAMC,CAAC,EAClBE,EAAgB,MAAM,QAAQD,CAAQ,EAAIA,EAAW,CAACA,CAAQ,EAChEE,EAAU,GACd,QAAWC,KAAQF,EAAe,CAC9B,IAAMG,EAAa,OAAOD,GAAS,SAAWA,EAAK,MAAM,GAAG,EAAI,CAACA,CAAI,EACrE,QAAWE,KAAKD,EACZ,GAAI,OAAOC,GAAM,YACb,GAAIV,aAAiBU,EAAG,CACpBH,EAAU,GACV,KACJ,UAEK,OAAOG,GAAM,UAAYjB,EAAuB,KAAMK,EAAgC,GAAG,EAAEY,CAAC,GACjG,GAAIjB,EAAuB,KAAMK,EAAgC,GAAG,EAAEY,CAAC,EAAEV,CAAK,EAAG,CAC7EO,EAAU,GACV,KACJ,UAEK,OAAOP,IAAUU,EAAG,CACzBH,EAAU,GACV,KACJ,CAEJ,GAAIA,EACA,KACR,CACA,GAAI,CAACA,EACD,MAAO,EACf,CACA,MAAO,EACX,CACJ,CACJ,CAKA,iBAAiBI,EAAMC,EAAS,CACtB,OAAOD,GAAS,UAAY,OAAOC,GAAY,aACjD,QAAQ,KAAK;AAAA;AAAA,2DAEkC,EAC/CD,EAAO,OAAOA,CAAI,EAClBC,EAAU,IAAM,IAEpBnB,EAAuB,KAAMK,EAAgC,GAAG,EAAEa,CAAI,EAAIC,CAC9E,CACJ,EACAd,EAAiC,IAAI,QACrC,IAAMe,EAAO,IAAId,EACVe,EAAQD",
6
6
  "names": ["__classPrivateFieldGet", "receiver", "state", "kind", "f", "_JSTypeChecker___CustomHandler", "JSTypeChecker", "value", "v", "args", "types", "i", "expected", "expectedTypes", "matched", "tRaw", "unionTypes", "t", "name", "handler", "JSTC", "index_default"]
7
7
  }
@@ -1,38 +1,36 @@
1
- var gt=Object.create;var Ke=Object.defineProperty;var mt=Object.getOwnPropertyDescriptor;var bt=Object.getOwnPropertyNames;var vt=Object.getPrototypeOf,xt=Object.prototype.hasOwnProperty;var h=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports);var wt=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of bt(e))!xt.call(i,n)&&n!==t&&Ke(i,n,{get:()=>e[n],enumerable:!(r=mt(e,n))||r.enumerable});return i};var _t=(i,e,t)=>(t=i!=null?gt(vt(i)):{},wt(e||!i||!i.__esModule?Ke(t,"default",{value:i,enumerable:!0}):t,i));var _e=h(Ge=>{var Ne={};Ne.StyleSheet=function(){this.parentStyleSheet=null};Ge.StyleSheet=Ne.StyleSheet});var d=h(je=>{var f={};f.CSSRule=function(){this.parentRule=null,this.parentStyleSheet=null};f.CSSRule.UNKNOWN_RULE=0;f.CSSRule.STYLE_RULE=1;f.CSSRule.CHARSET_RULE=2;f.CSSRule.IMPORT_RULE=3;f.CSSRule.MEDIA_RULE=4;f.CSSRule.FONT_FACE_RULE=5;f.CSSRule.PAGE_RULE=6;f.CSSRule.KEYFRAMES_RULE=7;f.CSSRule.KEYFRAME_RULE=8;f.CSSRule.MARGIN_RULE=9;f.CSSRule.NAMESPACE_RULE=10;f.CSSRule.COUNTER_STYLE_RULE=11;f.CSSRule.SUPPORTS_RULE=12;f.CSSRule.DOCUMENT_RULE=13;f.CSSRule.FONT_FEATURE_VALUES_RULE=14;f.CSSRule.VIEWPORT_RULE=15;f.CSSRule.REGION_STYLE_RULE=16;f.CSSRule.prototype={constructor:f.CSSRule};je.CSSRule=f.CSSRule});var Q=h(We=>{var g={CSSStyleDeclaration:V().CSSStyleDeclaration,CSSRule:d().CSSRule};g.CSSStyleRule=function(){g.CSSRule.call(this),this.selectorText="",this.style=new g.CSSStyleDeclaration,this.style.parentRule=this};g.CSSStyleRule.prototype=new g.CSSRule;g.CSSStyleRule.prototype.constructor=g.CSSStyleRule;g.CSSStyleRule.prototype.type=1;Object.defineProperty(g.CSSStyleRule.prototype,"cssText",{get:function(){var i;return this.selectorText?i=this.selectorText+" {"+this.style.cssText+"}":i="",i},set:function(i){var e=g.CSSStyleRule.parse(i);this.style=e.style,this.selectorText=e.selectorText}});g.CSSStyleRule.parse=function(i){for(var e=0,t="selector",r,n=e,s="",l={selector:!0,value:!0},o=new g.CSSStyleRule,S,u="",a;a=i.charAt(e);e++)switch(a){case" ":case" ":case"\r":case`
2
- `:case"\f":if(l[t])switch(i.charAt(e-1)){case" ":case" ":case"\r":case`
3
- `:case"\f":break;default:s+=" ";break}break;case'"':if(n=e+1,r=i.indexOf('"',n)+1,!r)throw'" is missing';s+=i.slice(e,r),e=r-1;break;case"'":if(n=e+1,r=i.indexOf("'",n)+1,!r)throw"' is missing";s+=i.slice(e,r),e=r-1;break;case"/":if(i.charAt(e+1)==="*"){if(e+=2,r=i.indexOf("*/",e),r===-1)throw new SyntaxError("Missing */");e=r+1}else s+=a;break;case"{":t==="selector"&&(o.selectorText=s.trim(),s="",t="name");break;case":":t==="name"?(S=s.trim(),s="",t="value"):s+=a;break;case"!":t==="value"&&i.indexOf("!important",e)===e?(u="important",e+=9):s+=a;break;case";":t==="value"?(o.style.setProperty(S,s.trim(),u),u="",s="",t="name"):s+=a;break;case"}":if(t==="value")o.style.setProperty(S,s.trim(),u),u="",s="";else{if(t==="name")break;s+=a}t="selector";break;default:s+=a;break}return o};We.CSSStyleRule=g.CSSStyleRule});var ee=h(Be=>{var b={StyleSheet:_e().StyleSheet,CSSStyleRule:Q().CSSStyleRule};b.CSSStyleSheet=function(){b.StyleSheet.call(this),this.cssRules=[]};b.CSSStyleSheet.prototype=new b.StyleSheet;b.CSSStyleSheet.prototype.constructor=b.CSSStyleSheet;b.CSSStyleSheet.prototype.insertRule=function(i,e){if(e<0||e>this.cssRules.length)throw new RangeError("INDEX_SIZE_ERR");var t=b.parse(i).cssRules[0];return t.parentStyleSheet=this,this.cssRules.splice(e,0,t),e};b.CSSStyleSheet.prototype.deleteRule=function(i){if(i<0||i>=this.cssRules.length)throw new RangeError("INDEX_SIZE_ERR");this.cssRules.splice(i,1)};b.CSSStyleSheet.prototype.toString=function(){for(var i="",e=this.cssRules,t=0;t<e.length;t++)i+=e[t].cssText+`
4
- `;return i};Be.CSSStyleSheet=b.CSSStyleSheet;b.parse=le().parse});var ae=h(Je=>{var oe={};oe.MediaList=function(){this.length=0};oe.MediaList.prototype={constructor:oe.MediaList,get mediaText(){return Array.prototype.join.call(this,", ")},set mediaText(i){for(var e=i.split(","),t=this.length=e.length,r=0;r<t;r++)this[r]=e[r].trim()},appendMedium:function(i){Array.prototype.indexOf.call(this,i)===-1&&(this[this.length]=i,this.length++)},deleteMedium:function(i){var e=Array.prototype.indexOf.call(this,i);e!==-1&&Array.prototype.splice.call(this,e,1)}};Je.MediaList=oe.MediaList});var ke=h(Ye=>{var w={CSSRule:d().CSSRule,CSSStyleSheet:ee().CSSStyleSheet,MediaList:ae().MediaList};w.CSSImportRule=function(){w.CSSRule.call(this),this.href="",this.media=new w.MediaList,this.styleSheet=new w.CSSStyleSheet};w.CSSImportRule.prototype=new w.CSSRule;w.CSSImportRule.prototype.constructor=w.CSSImportRule;w.CSSImportRule.prototype.type=3;Object.defineProperty(w.CSSImportRule.prototype,"cssText",{get:function(){var i=this.media.mediaText;return"@import url("+this.href+")"+(i?" "+i:"")+";"},set:function(i){for(var e=0,t="",r="",n,s;s=i.charAt(e);e++)switch(s){case" ":case" ":case"\r":case`
5
- `:case"\f":t==="after-import"?t="url":r+=s;break;case"@":!t&&i.indexOf("@import",e)===e&&(t="after-import",e+=6,r="");break;case"u":if(t==="url"&&i.indexOf("url(",e)===e){if(n=i.indexOf(")",e+1),n===-1)throw e+': ")" not found';e+=4;var l=i.slice(e,n);l[0]===l[l.length-1]&&(l[0]==='"'||l[0]==="'")&&(l=l.slice(1,-1)),this.href=l,e=n,t="media"}break;case'"':if(t==="url"){if(n=i.indexOf('"',e+1),!n)throw e+`: '"' not found`;this.href=i.slice(e+1,n),e=n,t="media"}break;case"'":if(t==="url"){if(n=i.indexOf("'",e+1),!n)throw e+`: "'" not found`;this.href=i.slice(e+1,n),e=n,t="media"}break;case";":t==="media"&&r&&(this.media.mediaText=r.trim());break;default:t==="media"&&(r+=s);break}}});Ye.CSSImportRule=w.CSSImportRule});var U=h(Ze=>{var k={CSSRule:d().CSSRule};k.CSSGroupingRule=function(){k.CSSRule.call(this),this.cssRules=[]};k.CSSGroupingRule.prototype=new k.CSSRule;k.CSSGroupingRule.prototype.constructor=k.CSSGroupingRule;k.CSSGroupingRule.prototype.insertRule=function(e,t){if(t<0||t>this.cssRules.length)throw new RangeError("INDEX_SIZE_ERR");var r=k.parse(e).cssRules[0];return r.parentRule=this,this.cssRules.splice(t,0,r),t};k.CSSGroupingRule.prototype.deleteRule=function(e){if(e<0||e>=this.cssRules.length)throw new RangeError("INDEX_SIZE_ERR");this.cssRules.splice(e,1)[0].parentRule=null};Ze.CSSGroupingRule=k.CSSGroupingRule});var N=h(Xe=>{var $={CSSRule:d().CSSRule,CSSGroupingRule:U().CSSGroupingRule};$.CSSConditionRule=function(){$.CSSGroupingRule.call(this),this.cssRules=[]};$.CSSConditionRule.prototype=new $.CSSGroupingRule;$.CSSConditionRule.prototype.constructor=$.CSSConditionRule;$.CSSConditionRule.prototype.conditionText="";$.CSSConditionRule.prototype.cssText="";Xe.CSSConditionRule=$.CSSConditionRule});var Se=h(ze=>{var T={CSSRule:d().CSSRule,CSSGroupingRule:U().CSSGroupingRule,CSSConditionRule:N().CSSConditionRule,MediaList:ae().MediaList};T.CSSMediaRule=function(){T.CSSConditionRule.call(this),this.media=new T.MediaList};T.CSSMediaRule.prototype=new T.CSSConditionRule;T.CSSMediaRule.prototype.constructor=T.CSSMediaRule;T.CSSMediaRule.prototype.type=4;Object.defineProperties(T.CSSMediaRule.prototype,{conditionText:{get:function(){return this.media.mediaText},set:function(i){this.media.mediaText=i},configurable:!0,enumerable:!0},cssText:{get:function(){for(var i=[],e=0,t=this.cssRules.length;e<t;e++)i.push(this.cssRules[e].cssText);return"@media "+this.media.mediaText+" {"+i.join("")+"}"},configurable:!0,enumerable:!0}});ze.CSSMediaRule=T.CSSMediaRule});var ue=h(Qe=>{var q={CSSRule:d().CSSRule,CSSGroupingRule:U().CSSGroupingRule,CSSConditionRule:N().CSSConditionRule};q.CSSSupportsRule=function(){q.CSSConditionRule.call(this)};q.CSSSupportsRule.prototype=new q.CSSConditionRule;q.CSSSupportsRule.prototype.constructor=q.CSSSupportsRule;q.CSSSupportsRule.prototype.type=12;Object.defineProperty(q.CSSSupportsRule.prototype,"cssText",{get:function(){for(var i=[],e=0,t=this.cssRules.length;e<t;e++)i.push(this.cssRules[e].cssText);return"@supports "+this.conditionText+" {"+i.join("")+"}"}});Qe.CSSSupportsRule=q.CSSSupportsRule});var Te=h(et=>{var M={CSSStyleDeclaration:V().CSSStyleDeclaration,CSSRule:d().CSSRule};M.CSSFontFaceRule=function(){M.CSSRule.call(this),this.style=new M.CSSStyleDeclaration,this.style.parentRule=this};M.CSSFontFaceRule.prototype=new M.CSSRule;M.CSSFontFaceRule.prototype.constructor=M.CSSFontFaceRule;M.CSSFontFaceRule.prototype.type=5;Object.defineProperty(M.CSSFontFaceRule.prototype,"cssText",{get:function(){return"@font-face {"+this.style.cssText+"}"}});et.CSSFontFaceRule=M.CSSFontFaceRule});var Me=h(tt=>{var P={CSSRule:d().CSSRule};P.CSSHostRule=function(){P.CSSRule.call(this),this.cssRules=[]};P.CSSHostRule.prototype=new P.CSSRule;P.CSSHostRule.prototype.constructor=P.CSSHostRule;P.CSSHostRule.prototype.type=1001;Object.defineProperty(P.CSSHostRule.prototype,"cssText",{get:function(){for(var i=[],e=0,t=this.cssRules.length;e<t;e++)i.push(this.cssRules[e].cssText);return"@host {"+i.join("")+"}"}});tt.CSSHostRule=P.CSSHostRule});var ce=h(rt=>{var E={CSSRule:d().CSSRule,CSSStyleDeclaration:V().CSSStyleDeclaration};E.CSSKeyframeRule=function(){E.CSSRule.call(this),this.keyText="",this.style=new E.CSSStyleDeclaration,this.style.parentRule=this};E.CSSKeyframeRule.prototype=new E.CSSRule;E.CSSKeyframeRule.prototype.constructor=E.CSSKeyframeRule;E.CSSKeyframeRule.prototype.type=8;Object.defineProperty(E.CSSKeyframeRule.prototype,"cssText",{get:function(){return this.keyText+" {"+this.style.cssText+"} "}});rt.CSSKeyframeRule=E.CSSKeyframeRule});var he=h(it=>{var L={CSSRule:d().CSSRule};L.CSSKeyframesRule=function(){L.CSSRule.call(this),this.name="",this.cssRules=[]};L.CSSKeyframesRule.prototype=new L.CSSRule;L.CSSKeyframesRule.prototype.constructor=L.CSSKeyframesRule;L.CSSKeyframesRule.prototype.type=7;Object.defineProperty(L.CSSKeyframesRule.prototype,"cssText",{get:function(){for(var i=[],e=0,t=this.cssRules.length;e<t;e++)i.push(" "+this.cssRules[e].cssText);return"@"+(this._vendorPrefix||"")+"keyframes "+this.name+` {
1
+ var dt=Object.create;var Ue=Object.defineProperty;var gt=Object.getOwnPropertyDescriptor;var mt=Object.getOwnPropertyNames;var bt=Object.getPrototypeOf,vt=Object.prototype.hasOwnProperty;var h=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports);var xt=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let l of mt(e))!vt.call(i,l)&&l!==t&&Ue(i,l,{get:()=>e[l],enumerable:!(r=gt(e,l))||r.enumerable});return i};var wt=(i,e,t)=>(t=i!=null?dt(bt(i)):{},xt(e||!i||!i.__esModule?Ue(t,"default",{value:i,enumerable:!0}):t,i));var we=h(Ne=>{var Ke={};Ke.StyleSheet=function(){this.parentStyleSheet=null};Ne.StyleSheet=Ke.StyleSheet});var d=h(Ge=>{var f={};f.CSSRule=function(){this.parentRule=null,this.parentStyleSheet=null};f.CSSRule.UNKNOWN_RULE=0;f.CSSRule.STYLE_RULE=1;f.CSSRule.CHARSET_RULE=2;f.CSSRule.IMPORT_RULE=3;f.CSSRule.MEDIA_RULE=4;f.CSSRule.FONT_FACE_RULE=5;f.CSSRule.PAGE_RULE=6;f.CSSRule.KEYFRAMES_RULE=7;f.CSSRule.KEYFRAME_RULE=8;f.CSSRule.MARGIN_RULE=9;f.CSSRule.NAMESPACE_RULE=10;f.CSSRule.COUNTER_STYLE_RULE=11;f.CSSRule.SUPPORTS_RULE=12;f.CSSRule.DOCUMENT_RULE=13;f.CSSRule.FONT_FEATURE_VALUES_RULE=14;f.CSSRule.VIEWPORT_RULE=15;f.CSSRule.REGION_STYLE_RULE=16;f.CSSRule.prototype={constructor:f.CSSRule};Ge.CSSRule=f.CSSRule});var Q=h(je=>{var g={CSSStyleDeclaration:V().CSSStyleDeclaration,CSSRule:d().CSSRule};g.CSSStyleRule=function(){g.CSSRule.call(this),this.selectorText="",this.style=new g.CSSStyleDeclaration,this.style.parentRule=this};g.CSSStyleRule.prototype=new g.CSSRule;g.CSSStyleRule.prototype.constructor=g.CSSStyleRule;g.CSSStyleRule.prototype.type=1;Object.defineProperty(g.CSSStyleRule.prototype,"cssText",{get:function(){var i;return this.selectorText?i=this.selectorText+" {"+this.style.cssText+"}":i="",i},set:function(i){var e=g.CSSStyleRule.parse(i);this.style=e.style,this.selectorText=e.selectorText}});g.CSSStyleRule.parse=function(i){for(var e=0,t="selector",r,l=e,s="",n={selector:!0,value:!0},o=new g.CSSStyleRule,S,u="",a;a=i.charAt(e);e++)switch(a){case" ":case" ":case"\r":case`
2
+ `:case"\f":if(n[t])switch(i.charAt(e-1)){case" ":case" ":case"\r":case`
3
+ `:case"\f":break;default:s+=" ";break}break;case'"':if(l=e+1,r=i.indexOf('"',l)+1,!r)throw'" is missing';s+=i.slice(e,r),e=r-1;break;case"'":if(l=e+1,r=i.indexOf("'",l)+1,!r)throw"' is missing";s+=i.slice(e,r),e=r-1;break;case"/":if(i.charAt(e+1)==="*"){if(e+=2,r=i.indexOf("*/",e),r===-1)throw new SyntaxError("Missing */");e=r+1}else s+=a;break;case"{":t==="selector"&&(o.selectorText=s.trim(),s="",t="name");break;case":":t==="name"?(S=s.trim(),s="",t="value"):s+=a;break;case"!":t==="value"&&i.indexOf("!important",e)===e?(u="important",e+=9):s+=a;break;case";":t==="value"?(o.style.setProperty(S,s.trim(),u),u="",s="",t="name"):s+=a;break;case"}":if(t==="value")o.style.setProperty(S,s.trim(),u),u="",s="";else{if(t==="name")break;s+=a}t="selector";break;default:s+=a;break}return o};je.CSSStyleRule=g.CSSStyleRule});var ee=h(We=>{var b={StyleSheet:we().StyleSheet,CSSStyleRule:Q().CSSStyleRule};b.CSSStyleSheet=function(){b.StyleSheet.call(this),this.cssRules=[]};b.CSSStyleSheet.prototype=new b.StyleSheet;b.CSSStyleSheet.prototype.constructor=b.CSSStyleSheet;b.CSSStyleSheet.prototype.insertRule=function(i,e){if(e<0||e>this.cssRules.length)throw new RangeError("INDEX_SIZE_ERR");var t=b.parse(i).cssRules[0];return t.parentStyleSheet=this,this.cssRules.splice(e,0,t),e};b.CSSStyleSheet.prototype.deleteRule=function(i){if(i<0||i>=this.cssRules.length)throw new RangeError("INDEX_SIZE_ERR");this.cssRules.splice(i,1)};b.CSSStyleSheet.prototype.toString=function(){for(var i="",e=this.cssRules,t=0;t<e.length;t++)i+=e[t].cssText+`
4
+ `;return i};We.CSSStyleSheet=b.CSSStyleSheet;b.parse=ne().parse});var ae=h(Be=>{var oe={};oe.MediaList=function(){this.length=0};oe.MediaList.prototype={constructor:oe.MediaList,get mediaText(){return Array.prototype.join.call(this,", ")},set mediaText(i){for(var e=i.split(","),t=this.length=e.length,r=0;r<t;r++)this[r]=e[r].trim()},appendMedium:function(i){Array.prototype.indexOf.call(this,i)===-1&&(this[this.length]=i,this.length++)},deleteMedium:function(i){var e=Array.prototype.indexOf.call(this,i);e!==-1&&Array.prototype.splice.call(this,e,1)}};Be.MediaList=oe.MediaList});var _e=h(Je=>{var w={CSSRule:d().CSSRule,CSSStyleSheet:ee().CSSStyleSheet,MediaList:ae().MediaList};w.CSSImportRule=function(){w.CSSRule.call(this),this.href="",this.media=new w.MediaList,this.styleSheet=new w.CSSStyleSheet};w.CSSImportRule.prototype=new w.CSSRule;w.CSSImportRule.prototype.constructor=w.CSSImportRule;w.CSSImportRule.prototype.type=3;Object.defineProperty(w.CSSImportRule.prototype,"cssText",{get:function(){var i=this.media.mediaText;return"@import url("+this.href+")"+(i?" "+i:"")+";"},set:function(i){for(var e=0,t="",r="",l,s;s=i.charAt(e);e++)switch(s){case" ":case" ":case"\r":case`
5
+ `:case"\f":t==="after-import"?t="url":r+=s;break;case"@":!t&&i.indexOf("@import",e)===e&&(t="after-import",e+=6,r="");break;case"u":if(t==="url"&&i.indexOf("url(",e)===e){if(l=i.indexOf(")",e+1),l===-1)throw e+': ")" not found';e+=4;var n=i.slice(e,l);n[0]===n[n.length-1]&&(n[0]==='"'||n[0]==="'")&&(n=n.slice(1,-1)),this.href=n,e=l,t="media"}break;case'"':if(t==="url"){if(l=i.indexOf('"',e+1),!l)throw e+`: '"' not found`;this.href=i.slice(e+1,l),e=l,t="media"}break;case"'":if(t==="url"){if(l=i.indexOf("'",e+1),!l)throw e+`: "'" not found`;this.href=i.slice(e+1,l),e=l,t="media"}break;case";":t==="media"&&r&&(this.media.mediaText=r.trim());break;default:t==="media"&&(r+=s);break}}});Je.CSSImportRule=w.CSSImportRule});var U=h(Ye=>{var k={CSSRule:d().CSSRule};k.CSSGroupingRule=function(){k.CSSRule.call(this),this.cssRules=[]};k.CSSGroupingRule.prototype=new k.CSSRule;k.CSSGroupingRule.prototype.constructor=k.CSSGroupingRule;k.CSSGroupingRule.prototype.insertRule=function(e,t){if(t<0||t>this.cssRules.length)throw new RangeError("INDEX_SIZE_ERR");var r=k.parse(e).cssRules[0];return r.parentRule=this,this.cssRules.splice(t,0,r),t};k.CSSGroupingRule.prototype.deleteRule=function(e){if(e<0||e>=this.cssRules.length)throw new RangeError("INDEX_SIZE_ERR");this.cssRules.splice(e,1)[0].parentRule=null};Ye.CSSGroupingRule=k.CSSGroupingRule});var N=h(Ze=>{var $={CSSRule:d().CSSRule,CSSGroupingRule:U().CSSGroupingRule};$.CSSConditionRule=function(){$.CSSGroupingRule.call(this),this.cssRules=[]};$.CSSConditionRule.prototype=new $.CSSGroupingRule;$.CSSConditionRule.prototype.constructor=$.CSSConditionRule;$.CSSConditionRule.prototype.conditionText="";$.CSSConditionRule.prototype.cssText="";Ze.CSSConditionRule=$.CSSConditionRule});var Se=h(Xe=>{var T={CSSRule:d().CSSRule,CSSGroupingRule:U().CSSGroupingRule,CSSConditionRule:N().CSSConditionRule,MediaList:ae().MediaList};T.CSSMediaRule=function(){T.CSSConditionRule.call(this),this.media=new T.MediaList};T.CSSMediaRule.prototype=new T.CSSConditionRule;T.CSSMediaRule.prototype.constructor=T.CSSMediaRule;T.CSSMediaRule.prototype.type=4;Object.defineProperties(T.CSSMediaRule.prototype,{conditionText:{get:function(){return this.media.mediaText},set:function(i){this.media.mediaText=i},configurable:!0,enumerable:!0},cssText:{get:function(){for(var i=[],e=0,t=this.cssRules.length;e<t;e++)i.push(this.cssRules[e].cssText);return"@media "+this.media.mediaText+" {"+i.join("")+"}"},configurable:!0,enumerable:!0}});Xe.CSSMediaRule=T.CSSMediaRule});var ue=h(ze=>{var q={CSSRule:d().CSSRule,CSSGroupingRule:U().CSSGroupingRule,CSSConditionRule:N().CSSConditionRule};q.CSSSupportsRule=function(){q.CSSConditionRule.call(this)};q.CSSSupportsRule.prototype=new q.CSSConditionRule;q.CSSSupportsRule.prototype.constructor=q.CSSSupportsRule;q.CSSSupportsRule.prototype.type=12;Object.defineProperty(q.CSSSupportsRule.prototype,"cssText",{get:function(){for(var i=[],e=0,t=this.cssRules.length;e<t;e++)i.push(this.cssRules[e].cssText);return"@supports "+this.conditionText+" {"+i.join("")+"}"}});ze.CSSSupportsRule=q.CSSSupportsRule});var ke=h(Qe=>{var M={CSSStyleDeclaration:V().CSSStyleDeclaration,CSSRule:d().CSSRule};M.CSSFontFaceRule=function(){M.CSSRule.call(this),this.style=new M.CSSStyleDeclaration,this.style.parentRule=this};M.CSSFontFaceRule.prototype=new M.CSSRule;M.CSSFontFaceRule.prototype.constructor=M.CSSFontFaceRule;M.CSSFontFaceRule.prototype.type=5;Object.defineProperty(M.CSSFontFaceRule.prototype,"cssText",{get:function(){return"@font-face {"+this.style.cssText+"}"}});Qe.CSSFontFaceRule=M.CSSFontFaceRule});var Te=h(et=>{var P={CSSRule:d().CSSRule};P.CSSHostRule=function(){P.CSSRule.call(this),this.cssRules=[]};P.CSSHostRule.prototype=new P.CSSRule;P.CSSHostRule.prototype.constructor=P.CSSHostRule;P.CSSHostRule.prototype.type=1001;Object.defineProperty(P.CSSHostRule.prototype,"cssText",{get:function(){for(var i=[],e=0,t=this.cssRules.length;e<t;e++)i.push(this.cssRules[e].cssText);return"@host {"+i.join("")+"}"}});et.CSSHostRule=P.CSSHostRule});var ce=h(tt=>{var E={CSSRule:d().CSSRule,CSSStyleDeclaration:V().CSSStyleDeclaration};E.CSSKeyframeRule=function(){E.CSSRule.call(this),this.keyText="",this.style=new E.CSSStyleDeclaration,this.style.parentRule=this};E.CSSKeyframeRule.prototype=new E.CSSRule;E.CSSKeyframeRule.prototype.constructor=E.CSSKeyframeRule;E.CSSKeyframeRule.prototype.type=8;Object.defineProperty(E.CSSKeyframeRule.prototype,"cssText",{get:function(){return this.keyText+" {"+this.style.cssText+"} "}});tt.CSSKeyframeRule=E.CSSKeyframeRule});var he=h(rt=>{var L={CSSRule:d().CSSRule};L.CSSKeyframesRule=function(){L.CSSRule.call(this),this.name="",this.cssRules=[]};L.CSSKeyframesRule.prototype=new L.CSSRule;L.CSSKeyframesRule.prototype.constructor=L.CSSKeyframesRule;L.CSSKeyframesRule.prototype.type=7;Object.defineProperty(L.CSSKeyframesRule.prototype,"cssText",{get:function(){for(var i=[],e=0,t=this.cssRules.length;e<t;e++)i.push(" "+this.cssRules[e].cssText);return"@"+(this._vendorPrefix||"")+"keyframes "+this.name+` {
6
6
  `+i.join(`
7
7
  `)+`
8
- }`}});it.CSSKeyframesRule=L.CSSKeyframesRule});var Ee=h(st=>{var pe={};pe.CSSValue=function(){};pe.CSSValue.prototype={constructor:pe.CSSValue,set cssText(i){var e=this._getConstructorName();throw new Error('DOMException: property "cssText" of "'+e+'" is readonly and can not be replaced with "'+i+'"!')},get cssText(){var i=this._getConstructorName();throw new Error('getter "cssText" of "'+i+'" is not implemented!')},_getConstructorName:function(){var i=this.constructor.toString(),e=i.match(/function\s([^\(]+)/),t=e[1];return t}};st.CSSValue=pe.CSSValue});var Ie=h(nt=>{var _={CSSValue:Ee().CSSValue};_.CSSValueExpression=function(e,t){this._token=e,this._idx=t};_.CSSValueExpression.prototype=new _.CSSValue;_.CSSValueExpression.prototype.constructor=_.CSSValueExpression;_.CSSValueExpression.prototype.parse=function(){for(var i=this._token,e=this._idx,t="",r="",n="",s,l=[];;++e){if(t=i.charAt(e),t===""){n="css expression error: unfinished expression!";break}switch(t){case"(":l.push(t),r+=t;break;case")":l.pop(t),r+=t;break;case"/":(s=this._parseJSComment(i,e))?s.error?n="css expression error: unfinished comment in expression!":e=s.idx:(s=this._parseJSRexExp(i,e))?(e=s.idx,r+=s.text):r+=t;break;case"'":case'"':s=this._parseJSString(i,e,t),s?(e=s.idx,r+=s.text):r+=t;break;default:r+=t;break}if(n||l.length===0)break}var o;return n?o={error:n}:o={idx:e,expression:r},o};_.CSSValueExpression.prototype._parseJSComment=function(i,e){var t=i.charAt(e+1),r;if(t==="/"||t==="*"){var n=e,s,l;if(t==="/"?l=`
9
- `:t==="*"&&(l="*/"),s=i.indexOf(l,n+1+1),s!==-1)return s=s+l.length-1,r=i.substring(e,s+1),{idx:s,text:r};var o="css expression error: unfinished comment in expression!";return{error:o}}else return!1};_.CSSValueExpression.prototype._parseJSString=function(i,e,t){var r=this._findMatchedIdx(i,e,t),n;return r===-1?!1:(n=i.substring(e,r+t.length),{idx:r,text:n})};_.CSSValueExpression.prototype._parseJSRexExp=function(i,e){var t=i.substring(0,e).replace(/\s+$/,""),r=[/^$/,/\($/,/\[$/,/\!$/,/\+$/,/\-$/,/\*$/,/\/\s+/,/\%$/,/\=$/,/\>$/,/<$/,/\&$/,/\|$/,/\^$/,/\~$/,/\?$/,/\,$/,/delete$/,/in$/,/instanceof$/,/new$/,/typeof$/,/void$/],n=r.some(function(l){return l.test(t)});if(n){var s="/";return this._parseJSString(i,e,s)}else return!1};_.CSSValueExpression.prototype._findMatchedIdx=function(i,e,t){for(var r=e,n,s=-1;;)if(n=i.indexOf(t,r+1),n===-1){n=s;break}else{var l=i.substring(e+1,n),o=l.match(/\\+$/);if(!o||o[0]%2===0)break;r=n}var S=i.indexOf(`
10
- `,e+1);return S<n&&(n=s),n};nt.CSSValueExpression=_.CSSValueExpression});var Oe=h(lt=>{var fe={};fe.MatcherList=function(){this.length=0};fe.MatcherList.prototype={constructor:fe.MatcherList,get matcherText(){return Array.prototype.join.call(this,", ")},set matcherText(i){for(var e=i.split(","),t=this.length=e.length,r=0;r<t;r++)this[r]=e[r].trim()},appendMatcher:function(i){Array.prototype.indexOf.call(this,i)===-1&&(this[this.length]=i,this.length++)},deleteMatcher:function(i){var e=Array.prototype.indexOf.call(this,i);e!==-1&&Array.prototype.splice.call(this,e,1)}};lt.MatcherList=fe.MatcherList});var $e=h(ot=>{var I={CSSRule:d().CSSRule,MatcherList:Oe().MatcherList};I.CSSDocumentRule=function(){I.CSSRule.call(this),this.matcher=new I.MatcherList,this.cssRules=[]};I.CSSDocumentRule.prototype=new I.CSSRule;I.CSSDocumentRule.prototype.constructor=I.CSSDocumentRule;I.CSSDocumentRule.prototype.type=10;Object.defineProperty(I.CSSDocumentRule.prototype,"cssText",{get:function(){for(var i=[],e=0,t=this.cssRules.length;e<t;e++)i.push(this.cssRules[e].cssText);return"@-moz-document "+this.matcher.matcherText+" {"+i.join("")+"}"}});ot.CSSDocumentRule=I.CSSDocumentRule});var le=h(at=>{var c={};c.parse=function(e){for(var t=0,r="before-selector",n,s="",l=0,o={selector:!0,value:!0,"value-parenthesis":!0,atRule:!0,"importRule-begin":!0,importRule:!0,atBlock:!0,conditionBlock:!0,"documentRule-begin":!0},S=new c.CSSStyleSheet,u=S,a,x=[],D=!1,Ae,ve,W="",R,B,J,Y,Z,H,K,re,Fe=/@(-(?:\w+-)+)?keyframes/g,X=function(dt){var He=e.substring(0,t).split(`
11
- `),Ve=He.length,Ue=He.pop().length+1,ne=new Error(dt+" (line "+Ve+", char "+Ue+")");throw ne.line=Ve,ne.char=Ue,ne.styleSheet=S,ne},y;y=e.charAt(t);t++)switch(y){case" ":case" ":case"\r":case`
12
- `:case"\f":o[r]&&(s+=y);break;case'"':n=t+1;do n=e.indexOf('"',n)+1,n||X('Unmatched "');while(e[n-2]==="\\");switch(s+=e.slice(t,n),t=n-1,r){case"before-value":r="value";break;case"importRule-begin":r="importRule";break}break;case"'":n=t+1;do n=e.indexOf("'",n)+1,n||X("Unmatched '");while(e[n-2]==="\\");switch(s+=e.slice(t,n),t=n-1,r){case"before-value":r="value";break;case"importRule-begin":r="importRule";break}break;case"/":e.charAt(t+1)==="*"?(t+=2,n=e.indexOf("*/",t),n===-1?X("Missing */"):t=n+1):s+=y,r==="importRule-begin"&&(s+=" ",r="importRule");break;case"@":if(e.indexOf("@-moz-document",t)===t){r="documentRule-begin",K=new c.CSSDocumentRule,K.__starts=t,t+=13,s="";break}else if(e.indexOf("@media",t)===t){r="atBlock",B=new c.CSSMediaRule,B.__starts=t,t+=5,s="";break}else if(e.indexOf("@supports",t)===t){r="conditionBlock",J=new c.CSSSupportsRule,J.__starts=t,t+=8,s="";break}else if(e.indexOf("@host",t)===t){r="hostRule-begin",t+=4,re=new c.CSSHostRule,re.__starts=t,s="";break}else if(e.indexOf("@import",t)===t){r="importRule-begin",t+=6,s+="@import";break}else if(e.indexOf("@font-face",t)===t){r="fontFaceRule-begin",t+=9,Z=new c.CSSFontFaceRule,Z.__starts=t,s="";break}else{Fe.lastIndex=t;var ie=Fe.exec(e);if(ie&&ie.index===t){r="keyframesRule-begin",H=new c.CSSKeyframesRule,H.__starts=t,H._vendorPrefix=ie[1],t+=ie[0].length-1,s="";break}else r==="selector"&&(r="atRule")}s+=y;break;case"{":r==="selector"||r==="atRule"?(R.selectorText=s.trim(),R.style.__starts=t,s="",r="before-name"):r==="atBlock"?(B.media.mediaText=s.trim(),a&&x.push(a),u=a=B,B.parentStyleSheet=S,s="",r="before-selector"):r==="conditionBlock"?(J.conditionText=s.trim(),a&&x.push(a),u=a=J,J.parentStyleSheet=S,s="",r="before-selector"):r==="hostRule-begin"?(a&&x.push(a),u=a=re,re.parentStyleSheet=S,s="",r="before-selector"):r==="fontFaceRule-begin"?(a&&(Z.parentRule=a),Z.parentStyleSheet=S,R=Z,s="",r="before-name"):r==="keyframesRule-begin"?(H.name=s.trim(),a&&(x.push(a),H.parentRule=a),H.parentStyleSheet=S,u=a=H,s="",r="keyframeRule-begin"):r==="keyframeRule-begin"?(R=new c.CSSKeyframeRule,R.keyText=s.trim(),R.__starts=t,s="",r="before-name"):r==="documentRule-begin"&&(K.matcher.matcherText=s.trim(),a&&(x.push(a),K.parentRule=a),u=a=K,K.parentStyleSheet=S,s="",r="before-selector");break;case":":r==="name"?(ve=s.trim(),s="",r="before-value"):s+=y;break;case"(":if(r==="value")if(s.trim()==="expression"){var se=new c.CSSValueExpression(e,t).parse();se.error?X(se.error):(s+=se.expression,t=se.idx)}else r="value-parenthesis",l=1,s+=y;else r==="value-parenthesis"&&l++,s+=y;break;case")":r==="value-parenthesis"&&(l--,l===0&&(r="value")),s+=y;break;case"!":r==="value"&&e.indexOf("!important",t)===t?(W="important",t+=9):s+=y;break;case";":switch(r){case"value":R.style.setProperty(ve,s.trim(),W),W="",s="",r="before-name";break;case"atRule":s="",r="before-selector";break;case"importRule":Y=new c.CSSImportRule,Y.parentStyleSheet=Y.styleSheet.parentStyleSheet=S,Y.cssText=s+y,S.cssRules.push(Y),s="",r="before-selector";break;default:s+=y;break}break;case"}":switch(r){case"value":R.style.setProperty(ve,s.trim(),W),W="";case"before-name":case"name":R.__ends=t+1,a&&(R.parentRule=a),R.parentStyleSheet=S,u.cssRules.push(R),s="",u.constructor===c.CSSKeyframesRule?r="keyframeRule-begin":r="before-selector";break;case"keyframeRule-begin":case"before-selector":case"selector":for(a||X("Unexpected }"),D=x.length>0;x.length>0;){if(a=x.pop(),a.constructor.name==="CSSMediaRule"||a.constructor.name==="CSSSupportsRule"){Ae=u,u=a,u.cssRules.push(Ae);break}x.length===0&&(D=!1)}D||(u.__ends=t+1,S.cssRules.push(u),u=S,a=null),s="",r="before-selector";break}break;default:switch(r){case"before-selector":r="selector",R=new c.CSSStyleRule,R.__starts=t;break;case"before-name":r="name";break;case"before-value":r="value";break;case"importRule-begin":r="importRule";break}s+=y;break}return S};at.parse=c.parse;c.CSSStyleSheet=ee().CSSStyleSheet;c.CSSStyleRule=Q().CSSStyleRule;c.CSSImportRule=ke().CSSImportRule;c.CSSGroupingRule=U().CSSGroupingRule;c.CSSMediaRule=Se().CSSMediaRule;c.CSSConditionRule=N().CSSConditionRule;c.CSSSupportsRule=ue().CSSSupportsRule;c.CSSFontFaceRule=Te().CSSFontFaceRule;c.CSSHostRule=Me().CSSHostRule;c.CSSStyleDeclaration=V().CSSStyleDeclaration;c.CSSKeyframeRule=ce().CSSKeyframeRule;c.CSSKeyframesRule=he().CSSKeyframesRule;c.CSSValueExpression=Ie().CSSValueExpression;c.CSSDocumentRule=$e().CSSDocumentRule});var V=h(St=>{var G={};G.CSSStyleDeclaration=function(){this.length=0,this.parentRule=null,this._importants={}};G.CSSStyleDeclaration.prototype={constructor:G.CSSStyleDeclaration,getPropertyValue:function(i){return this[i]||""},setProperty:function(i,e,t){if(this[i]){var r=Array.prototype.indexOf.call(this,i);r<0&&(this[this.length]=i,this.length++)}else this[this.length]=i,this.length++;this[i]=e+"",this._importants[i]=t},removeProperty:function(i){if(!(i in this))return"";var e=Array.prototype.indexOf.call(this,i);if(e<0)return"";var t=this[i];return this[i]="",Array.prototype.splice.call(this,e,1),t},getPropertyCSSValue:function(){},getPropertyPriority:function(i){return this._importants[i]||""},getPropertyShorthand:function(){},isPropertyImplicit:function(){},get cssText(){for(var i=[],e=0,t=this.length;e<t;++e){var r=this[e],n=this.getPropertyValue(r),s=this.getPropertyPriority(r);s&&(s=" !"+s),i[e]=r+": "+n+s+";"}return i.join(" ")},set cssText(i){var e,t;for(e=this.length;e--;)t=this[e],this[t]="";Array.prototype.splice.call(this,0,this.length),this._importants={};var r=G.parse("#bogus{"+i+"}").cssRules[0].style,n=r.length;for(e=0;e<n;++e)t=r[e],this.setProperty(r[e],r.getPropertyValue(t),r.getPropertyPriority(t))}};St.CSSStyleDeclaration=G.CSSStyleDeclaration;G.parse=le().parse});var ct=h(ut=>{var Ce={CSSStyleSheet:ee().CSSStyleSheet,CSSRule:d().CSSRule,CSSStyleRule:Q().CSSStyleRule,CSSGroupingRule:U().CSSGroupingRule,CSSConditionRule:N().CSSConditionRule,CSSMediaRule:Se().CSSMediaRule,CSSSupportsRule:ue().CSSSupportsRule,CSSStyleDeclaration:V().CSSStyleDeclaration,CSSKeyframeRule:ce().CSSKeyframeRule,CSSKeyframesRule:he().CSSKeyframesRule};Ce.clone=function i(e){var t=new Ce.CSSStyleSheet,r=e.cssRules;if(!r)return t;for(var n=0,s=r.length;n<s;n++){var l=r[n],o=t.cssRules[n]=new l.constructor,S=l.style;if(S){for(var u=o.style=new Ce.CSSStyleDeclaration,a=0,x=S.length;a<x;a++){var D=u[a]=S[a];u[D]=S[D],u._importants[D]=S.getPropertyPriority(D)}u.length=S.length}l.hasOwnProperty("keyText")&&(o.keyText=l.keyText),l.hasOwnProperty("selectorText")&&(o.selectorText=l.selectorText),l.hasOwnProperty("mediaText")&&(o.mediaText=l.mediaText),l.hasOwnProperty("conditionText")&&(o.conditionText=l.conditionText),l.hasOwnProperty("cssRules")&&(o.cssRules=i(l).cssRules)}return t};ut.clone=Ce.clone});var ht=h(p=>{"use strict";p.CSSStyleDeclaration=V().CSSStyleDeclaration;p.CSSRule=d().CSSRule;p.CSSGroupingRule=U().CSSGroupingRule;p.CSSConditionRule=N().CSSConditionRule;p.CSSStyleRule=Q().CSSStyleRule;p.MediaList=ae().MediaList;p.CSSMediaRule=Se().CSSMediaRule;p.CSSSupportsRule=ue().CSSSupportsRule;p.CSSImportRule=ke().CSSImportRule;p.CSSFontFaceRule=Te().CSSFontFaceRule;p.CSSHostRule=Me().CSSHostRule;p.StyleSheet=_e().StyleSheet;p.CSSStyleSheet=ee().CSSStyleSheet;p.CSSKeyframesRule=he().CSSKeyframesRule;p.CSSKeyframeRule=ce().CSSKeyframeRule;p.MatcherList=Oe().MatcherList;p.CSSDocumentRule=$e().CSSDocumentRule;p.CSSValue=Ee().CSSValue;p.CSSValueExpression=Ie().CSSValueExpression;p.parse=le().parse;p.clone=ct().clone});var xe=function(i,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?i!==e||!r:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(i):r?r.value:e.get(i)},z,we=class{constructor(){z.set(this,{Array:e=>Array.isArray(e),"string[]":e=>Array.isArray(e)&&e.every(t=>typeof t=="string")})}for(e){return Array.isArray(e)||(console.warn(`[JSTC.for] @briklab/lib/jstc: Invalid first argument!
8
+ }`}});rt.CSSKeyframesRule=L.CSSKeyframesRule});var Me=h(it=>{var pe={};pe.CSSValue=function(){};pe.CSSValue.prototype={constructor:pe.CSSValue,set cssText(i){var e=this._getConstructorName();throw new Error('DOMException: property "cssText" of "'+e+'" is readonly and can not be replaced with "'+i+'"!')},get cssText(){var i=this._getConstructorName();throw new Error('getter "cssText" of "'+i+'" is not implemented!')},_getConstructorName:function(){var i=this.constructor.toString(),e=i.match(/function\s([^\(]+)/),t=e[1];return t}};it.CSSValue=pe.CSSValue});var Ee=h(st=>{var _={CSSValue:Me().CSSValue};_.CSSValueExpression=function(e,t){this._token=e,this._idx=t};_.CSSValueExpression.prototype=new _.CSSValue;_.CSSValueExpression.prototype.constructor=_.CSSValueExpression;_.CSSValueExpression.prototype.parse=function(){for(var i=this._token,e=this._idx,t="",r="",l="",s,n=[];;++e){if(t=i.charAt(e),t===""){l="css expression error: unfinished expression!";break}switch(t){case"(":n.push(t),r+=t;break;case")":n.pop(t),r+=t;break;case"/":(s=this._parseJSComment(i,e))?s.error?l="css expression error: unfinished comment in expression!":e=s.idx:(s=this._parseJSRexExp(i,e))?(e=s.idx,r+=s.text):r+=t;break;case"'":case'"':s=this._parseJSString(i,e,t),s?(e=s.idx,r+=s.text):r+=t;break;default:r+=t;break}if(l||n.length===0)break}var o;return l?o={error:l}:o={idx:e,expression:r},o};_.CSSValueExpression.prototype._parseJSComment=function(i,e){var t=i.charAt(e+1),r;if(t==="/"||t==="*"){var l=e,s,n;if(t==="/"?n=`
9
+ `:t==="*"&&(n="*/"),s=i.indexOf(n,l+1+1),s!==-1)return s=s+n.length-1,r=i.substring(e,s+1),{idx:s,text:r};var o="css expression error: unfinished comment in expression!";return{error:o}}else return!1};_.CSSValueExpression.prototype._parseJSString=function(i,e,t){var r=this._findMatchedIdx(i,e,t),l;return r===-1?!1:(l=i.substring(e,r+t.length),{idx:r,text:l})};_.CSSValueExpression.prototype._parseJSRexExp=function(i,e){var t=i.substring(0,e).replace(/\s+$/,""),r=[/^$/,/\($/,/\[$/,/\!$/,/\+$/,/\-$/,/\*$/,/\/\s+/,/\%$/,/\=$/,/\>$/,/<$/,/\&$/,/\|$/,/\^$/,/\~$/,/\?$/,/\,$/,/delete$/,/in$/,/instanceof$/,/new$/,/typeof$/,/void$/],l=r.some(function(n){return n.test(t)});if(l){var s="/";return this._parseJSString(i,e,s)}else return!1};_.CSSValueExpression.prototype._findMatchedIdx=function(i,e,t){for(var r=e,l,s=-1;;)if(l=i.indexOf(t,r+1),l===-1){l=s;break}else{var n=i.substring(e+1,l),o=n.match(/\\+$/);if(!o||o[0]%2===0)break;r=l}var S=i.indexOf(`
10
+ `,e+1);return S<l&&(l=s),l};st.CSSValueExpression=_.CSSValueExpression});var Ie=h(lt=>{var fe={};fe.MatcherList=function(){this.length=0};fe.MatcherList.prototype={constructor:fe.MatcherList,get matcherText(){return Array.prototype.join.call(this,", ")},set matcherText(i){for(var e=i.split(","),t=this.length=e.length,r=0;r<t;r++)this[r]=e[r].trim()},appendMatcher:function(i){Array.prototype.indexOf.call(this,i)===-1&&(this[this.length]=i,this.length++)},deleteMatcher:function(i){var e=Array.prototype.indexOf.call(this,i);e!==-1&&Array.prototype.splice.call(this,e,1)}};lt.MatcherList=fe.MatcherList});var Oe=h(nt=>{var I={CSSRule:d().CSSRule,MatcherList:Ie().MatcherList};I.CSSDocumentRule=function(){I.CSSRule.call(this),this.matcher=new I.MatcherList,this.cssRules=[]};I.CSSDocumentRule.prototype=new I.CSSRule;I.CSSDocumentRule.prototype.constructor=I.CSSDocumentRule;I.CSSDocumentRule.prototype.type=10;Object.defineProperty(I.CSSDocumentRule.prototype,"cssText",{get:function(){for(var i=[],e=0,t=this.cssRules.length;e<t;e++)i.push(this.cssRules[e].cssText);return"@-moz-document "+this.matcher.matcherText+" {"+i.join("")+"}"}});nt.CSSDocumentRule=I.CSSDocumentRule});var ne=h(ot=>{var c={};c.parse=function(e){for(var t=0,r="before-selector",l,s="",n=0,o={selector:!0,value:!0,"value-parenthesis":!0,atRule:!0,"importRule-begin":!0,importRule:!0,atBlock:!0,conditionBlock:!0,"documentRule-begin":!0},S=new c.CSSStyleSheet,u=S,a,x=[],D=!1,De,ve,W="",R,B,J,Y,Z,H,K,re,Ae=/@(-(?:\w+-)+)?keyframes/g,X=function(yt){var Fe=e.substring(0,t).split(`
11
+ `),He=Fe.length,Ve=Fe.pop().length+1,le=new Error(yt+" (line "+He+", char "+Ve+")");throw le.line=He,le.char=Ve,le.styleSheet=S,le},y;y=e.charAt(t);t++)switch(y){case" ":case" ":case"\r":case`
12
+ `:case"\f":o[r]&&(s+=y);break;case'"':l=t+1;do l=e.indexOf('"',l)+1,l||X('Unmatched "');while(e[l-2]==="\\");switch(s+=e.slice(t,l),t=l-1,r){case"before-value":r="value";break;case"importRule-begin":r="importRule";break}break;case"'":l=t+1;do l=e.indexOf("'",l)+1,l||X("Unmatched '");while(e[l-2]==="\\");switch(s+=e.slice(t,l),t=l-1,r){case"before-value":r="value";break;case"importRule-begin":r="importRule";break}break;case"/":e.charAt(t+1)==="*"?(t+=2,l=e.indexOf("*/",t),l===-1?X("Missing */"):t=l+1):s+=y,r==="importRule-begin"&&(s+=" ",r="importRule");break;case"@":if(e.indexOf("@-moz-document",t)===t){r="documentRule-begin",K=new c.CSSDocumentRule,K.__starts=t,t+=13,s="";break}else if(e.indexOf("@media",t)===t){r="atBlock",B=new c.CSSMediaRule,B.__starts=t,t+=5,s="";break}else if(e.indexOf("@supports",t)===t){r="conditionBlock",J=new c.CSSSupportsRule,J.__starts=t,t+=8,s="";break}else if(e.indexOf("@host",t)===t){r="hostRule-begin",t+=4,re=new c.CSSHostRule,re.__starts=t,s="";break}else if(e.indexOf("@import",t)===t){r="importRule-begin",t+=6,s+="@import";break}else if(e.indexOf("@font-face",t)===t){r="fontFaceRule-begin",t+=9,Z=new c.CSSFontFaceRule,Z.__starts=t,s="";break}else{Ae.lastIndex=t;var ie=Ae.exec(e);if(ie&&ie.index===t){r="keyframesRule-begin",H=new c.CSSKeyframesRule,H.__starts=t,H._vendorPrefix=ie[1],t+=ie[0].length-1,s="";break}else r==="selector"&&(r="atRule")}s+=y;break;case"{":r==="selector"||r==="atRule"?(R.selectorText=s.trim(),R.style.__starts=t,s="",r="before-name"):r==="atBlock"?(B.media.mediaText=s.trim(),a&&x.push(a),u=a=B,B.parentStyleSheet=S,s="",r="before-selector"):r==="conditionBlock"?(J.conditionText=s.trim(),a&&x.push(a),u=a=J,J.parentStyleSheet=S,s="",r="before-selector"):r==="hostRule-begin"?(a&&x.push(a),u=a=re,re.parentStyleSheet=S,s="",r="before-selector"):r==="fontFaceRule-begin"?(a&&(Z.parentRule=a),Z.parentStyleSheet=S,R=Z,s="",r="before-name"):r==="keyframesRule-begin"?(H.name=s.trim(),a&&(x.push(a),H.parentRule=a),H.parentStyleSheet=S,u=a=H,s="",r="keyframeRule-begin"):r==="keyframeRule-begin"?(R=new c.CSSKeyframeRule,R.keyText=s.trim(),R.__starts=t,s="",r="before-name"):r==="documentRule-begin"&&(K.matcher.matcherText=s.trim(),a&&(x.push(a),K.parentRule=a),u=a=K,K.parentStyleSheet=S,s="",r="before-selector");break;case":":r==="name"?(ve=s.trim(),s="",r="before-value"):s+=y;break;case"(":if(r==="value")if(s.trim()==="expression"){var se=new c.CSSValueExpression(e,t).parse();se.error?X(se.error):(s+=se.expression,t=se.idx)}else r="value-parenthesis",n=1,s+=y;else r==="value-parenthesis"&&n++,s+=y;break;case")":r==="value-parenthesis"&&(n--,n===0&&(r="value")),s+=y;break;case"!":r==="value"&&e.indexOf("!important",t)===t?(W="important",t+=9):s+=y;break;case";":switch(r){case"value":R.style.setProperty(ve,s.trim(),W),W="",s="",r="before-name";break;case"atRule":s="",r="before-selector";break;case"importRule":Y=new c.CSSImportRule,Y.parentStyleSheet=Y.styleSheet.parentStyleSheet=S,Y.cssText=s+y,S.cssRules.push(Y),s="",r="before-selector";break;default:s+=y;break}break;case"}":switch(r){case"value":R.style.setProperty(ve,s.trim(),W),W="";case"before-name":case"name":R.__ends=t+1,a&&(R.parentRule=a),R.parentStyleSheet=S,u.cssRules.push(R),s="",u.constructor===c.CSSKeyframesRule?r="keyframeRule-begin":r="before-selector";break;case"keyframeRule-begin":case"before-selector":case"selector":for(a||X("Unexpected }"),D=x.length>0;x.length>0;){if(a=x.pop(),a.constructor.name==="CSSMediaRule"||a.constructor.name==="CSSSupportsRule"){De=u,u=a,u.cssRules.push(De);break}x.length===0&&(D=!1)}D||(u.__ends=t+1,S.cssRules.push(u),u=S,a=null),s="",r="before-selector";break}break;default:switch(r){case"before-selector":r="selector",R=new c.CSSStyleRule,R.__starts=t;break;case"before-name":r="name";break;case"before-value":r="value";break;case"importRule-begin":r="importRule";break}s+=y;break}return S};ot.parse=c.parse;c.CSSStyleSheet=ee().CSSStyleSheet;c.CSSStyleRule=Q().CSSStyleRule;c.CSSImportRule=_e().CSSImportRule;c.CSSGroupingRule=U().CSSGroupingRule;c.CSSMediaRule=Se().CSSMediaRule;c.CSSConditionRule=N().CSSConditionRule;c.CSSSupportsRule=ue().CSSSupportsRule;c.CSSFontFaceRule=ke().CSSFontFaceRule;c.CSSHostRule=Te().CSSHostRule;c.CSSStyleDeclaration=V().CSSStyleDeclaration;c.CSSKeyframeRule=ce().CSSKeyframeRule;c.CSSKeyframesRule=he().CSSKeyframesRule;c.CSSValueExpression=Ee().CSSValueExpression;c.CSSDocumentRule=Oe().CSSDocumentRule});var V=h(at=>{var G={};G.CSSStyleDeclaration=function(){this.length=0,this.parentRule=null,this._importants={}};G.CSSStyleDeclaration.prototype={constructor:G.CSSStyleDeclaration,getPropertyValue:function(i){return this[i]||""},setProperty:function(i,e,t){if(this[i]){var r=Array.prototype.indexOf.call(this,i);r<0&&(this[this.length]=i,this.length++)}else this[this.length]=i,this.length++;this[i]=e+"",this._importants[i]=t},removeProperty:function(i){if(!(i in this))return"";var e=Array.prototype.indexOf.call(this,i);if(e<0)return"";var t=this[i];return this[i]="",Array.prototype.splice.call(this,e,1),t},getPropertyCSSValue:function(){},getPropertyPriority:function(i){return this._importants[i]||""},getPropertyShorthand:function(){},isPropertyImplicit:function(){},get cssText(){for(var i=[],e=0,t=this.length;e<t;++e){var r=this[e],l=this.getPropertyValue(r),s=this.getPropertyPriority(r);s&&(s=" !"+s),i[e]=r+": "+l+s+";"}return i.join(" ")},set cssText(i){var e,t;for(e=this.length;e--;)t=this[e],this[t]="";Array.prototype.splice.call(this,0,this.length),this._importants={};var r=G.parse("#bogus{"+i+"}").cssRules[0].style,l=r.length;for(e=0;e<l;++e)t=r[e],this.setProperty(r[e],r.getPropertyValue(t),r.getPropertyPriority(t))}};at.CSSStyleDeclaration=G.CSSStyleDeclaration;G.parse=ne().parse});var ut=h(St=>{var Ce={CSSStyleSheet:ee().CSSStyleSheet,CSSRule:d().CSSRule,CSSStyleRule:Q().CSSStyleRule,CSSGroupingRule:U().CSSGroupingRule,CSSConditionRule:N().CSSConditionRule,CSSMediaRule:Se().CSSMediaRule,CSSSupportsRule:ue().CSSSupportsRule,CSSStyleDeclaration:V().CSSStyleDeclaration,CSSKeyframeRule:ce().CSSKeyframeRule,CSSKeyframesRule:he().CSSKeyframesRule};Ce.clone=function i(e){var t=new Ce.CSSStyleSheet,r=e.cssRules;if(!r)return t;for(var l=0,s=r.length;l<s;l++){var n=r[l],o=t.cssRules[l]=new n.constructor,S=n.style;if(S){for(var u=o.style=new Ce.CSSStyleDeclaration,a=0,x=S.length;a<x;a++){var D=u[a]=S[a];u[D]=S[D],u._importants[D]=S.getPropertyPriority(D)}u.length=S.length}n.hasOwnProperty("keyText")&&(o.keyText=n.keyText),n.hasOwnProperty("selectorText")&&(o.selectorText=n.selectorText),n.hasOwnProperty("mediaText")&&(o.mediaText=n.mediaText),n.hasOwnProperty("conditionText")&&(o.conditionText=n.conditionText),n.hasOwnProperty("cssRules")&&(o.cssRules=i(n).cssRules)}return t};St.clone=Ce.clone});var ct=h(p=>{"use strict";p.CSSStyleDeclaration=V().CSSStyleDeclaration;p.CSSRule=d().CSSRule;p.CSSGroupingRule=U().CSSGroupingRule;p.CSSConditionRule=N().CSSConditionRule;p.CSSStyleRule=Q().CSSStyleRule;p.MediaList=ae().MediaList;p.CSSMediaRule=Se().CSSMediaRule;p.CSSSupportsRule=ue().CSSSupportsRule;p.CSSImportRule=_e().CSSImportRule;p.CSSFontFaceRule=ke().CSSFontFaceRule;p.CSSHostRule=Te().CSSHostRule;p.StyleSheet=we().StyleSheet;p.CSSStyleSheet=ee().CSSStyleSheet;p.CSSKeyframesRule=he().CSSKeyframesRule;p.CSSKeyframeRule=ce().CSSKeyframeRule;p.MatcherList=Ie().MatcherList;p.CSSDocumentRule=Oe().CSSDocumentRule;p.CSSValue=Me().CSSValue;p.CSSValueExpression=Ee().CSSValueExpression;p.parse=ne().parse;p.clone=ut().clone});var xe=function(i,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?i!==e||!r:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(i):r?r.value:e.get(i)},z,_t=class{constructor(){z.set(this,{Array:i=>Array.isArray(i),"string[]":i=>Array.isArray(i)&&i.every(e=>typeof e=="string")})}for(i){return Array.isArray(i)||(console.warn(`[JSTC.for] @briklab/lib/jstc: Invalid first argument!
13
13
  Hint: The first argument must be a array.
14
- Using [givenValue] as fallback`),e=[e]),{check:t=>{if(Array.isArray(t)||(console.warn(`[JSTC.for().check] @briklab/lib/jstc: Invalid first argument!
15
- Hint: The first argument must be a valid array!
16
- Using [givenValue] as fallback`),t=[t]),e.length<t.length)return!1;for(let r=0;r<t.length;r++){let n=e[r],s=t[r],l=Array.isArray(s)?s:[s],o=!1;for(let S of l){let u=typeof S=="string"?S.split("|"):[S];for(let a of u)if(typeof a=="function"){if(n instanceof a){o=!0;break}}else if(typeof a=="string"&&xe(this,z,"f")[a]){if(xe(this,z,"f")[a](n)){o=!0;break}}else if(typeof n===a){o=!0;break}if(o)break}if(!o)return!1}return!0}}}addCustomHandler(e,t){typeof e=="string"&&typeof t=="function"||(console.warn(`[JSTC.addCustomHandler] @briklab/lib/jstc: Invalid Arguments!
14
+ Using [givenValue] as fallback`),i=[i]),{check:e=>{if(i.length<e.length)return!1;for(let t=0;t<e.length;t++){let r=i[t],l=e[t],s=Array.isArray(l)?l:[l],n=!1;for(let o of s){let S=typeof o=="string"?o.split("|"):[o];for(let u of S)if(typeof u=="function"){if(r instanceof u){n=!0;break}}else if(typeof u=="string"&&xe(this,z,"f")[u]){if(xe(this,z,"f")[u](r)){n=!0;break}}else if(typeof r===u){n=!0;break}if(n)break}if(!n)return!1}return!0}}}addCustomHandler(i,e){typeof i=="string"&&typeof e=="function"||(console.warn(`[JSTC.addCustomHandler] @briklab/lib/jstc: Invalid Arguments!
17
15
  Hint: The first argument must be a string, and the second argument must be a function
18
- Using String(argument1) and ()=>false as fallbacks`),e=String(e),t=()=>!1),xe(this,z,"f")[e]=t}};z=new WeakMap;var kt=new we,O=kt;var De=_t(ht(),1);var m=function(i,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?i!==e||!r:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(i):r?r.value:e.get(i)},C,qe,Re,ye,ft,Pe,Le,pt={red:"#ff0000",blue:"#0000ff",green:"#00ff00",yellow:"#ffff00",orange:"#ffa500",black:"#000000",white:"#ffffff",gray:"#808080"},j=class i{constructor(e){if(C.add(this),this.r=0,this.g=0,this.b=0,this.a=1,typeof e=="string")m(this,C,"m",ft).call(this,e);else if("r"in e&&"g"in e&&"b"in e)this.r=m(this,C,"m",Re).call(this,e.r),this.g=m(this,C,"m",Re).call(this,e.g),this.b=m(this,C,"m",Re).call(this,e.b),this.a=e.a??1;else if("h"in e&&"s"in e&&"l"in e){let{r:t,g:r,b:n}=m(this,C,"m",Pe).call(this,e.h,e.s,e.l);this.r=t,this.g=r,this.b=n,this.a=e.a??1}else console.warn(`[Color.constructor] Invalid first argument!
16
+ Using String(argument1) and ()=>false as fallbacks`),i=String(i),e=()=>!1),xe(this,z,"f")[i]=e}};z=new WeakMap;var kt=new _t,O=kt;var Le=wt(ct(),1);var m=function(i,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?i!==e||!r:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(i):r?r.value:e.get(i)},C,$e,Re,ye,pt,qe,Pe,ht={red:"#ff0000",blue:"#0000ff",green:"#00ff00",yellow:"#ffff00",orange:"#ffa500",black:"#000000",white:"#ffffff",gray:"#808080"},j=class i{constructor(e){if(C.add(this),this.r=0,this.g=0,this.b=0,this.a=1,typeof e=="string")m(this,C,"m",pt).call(this,e);else if("r"in e&&"g"in e&&"b"in e)this.r=m(this,C,"m",Re).call(this,e.r),this.g=m(this,C,"m",Re).call(this,e.g),this.b=m(this,C,"m",Re).call(this,e.b),this.a=e.a??1;else if("h"in e&&"s"in e&&"l"in e){let{r:t,g:r,b:l}=m(this,C,"m",qe).call(this,e.h,e.s,e.l);this.r=t,this.g=r,this.b=l,this.a=e.a??1}else console.warn(`[Color.constructor] Invalid first argument!
19
17
  Hint: The first argument must be a valid color array
20
- Using black as fallback.`)}hex(){return`#${m(this,C,"m",ye).call(this,this.r)}${m(this,C,"m",ye).call(this,this.g)}${m(this,C,"m",ye).call(this,this.b)}`}rgb(){return`rgb(${this.r}, ${this.g}, ${this.b})`}rgba(){return`rgba(${this.r}, ${this.g}, ${this.b}, ${this.a})`}hsl(){let{h:e,s:t,l:r}=m(this,C,"m",Le).call(this,this.r,this.g,this.b);return`hsl(${e}, ${t}%, ${r}%)`}hsla(){let{h:e,s:t,l:r}=m(this,C,"m",Le).call(this,this.r,this.g,this.b);return`hsla(${e}, ${t}%, ${r}%, ${this.a})`}css(){return this.a===1?this.hex():this.rgba()}ansiTruecolor(){return`\x1B[38;2;${this.r};${this.g};${this.b}m`}ansiTruecolorBg(){return`\x1B[48;2;${this.r};${this.g};${this.b}m`}ansi256(){return`\x1B[38;5;${m(this,C,"m",qe).call(this,this.r,this.g,this.b)}m`}ansi256Bg(){return`\x1B[48;5;${m(this,C,"m",qe).call(this,this.r,this.g,this.b)}m`}wrapAnsi(e,t={}){let r=!!t.use256,n=t.background?r?this.ansi256Bg():this.ansiTruecolorBg():r?this.ansi256():this.ansiTruecolor();return`${`${t.bold?i.BOLD:""}${t.underline?i.UNDERLINE:""}`}${n}${e}${i.RESET}`}};C=new WeakSet,qe=function(e,t,r){if(e===t&&t===r)return e<8?16:e>248?231:Math.round((e-8)/247*24)+232;let n=S=>Math.round(S/255*5),s=n(e),l=n(t),o=n(r);return 16+36*s+6*l+o},Re=function(e){return Math.max(0,Math.min(255,e))},ye=function(e){return e.toString(16).padStart(2,"0")},ft=function(e){if(e=e.trim().toLowerCase(),pt[e]&&(e=pt[e]),e.startsWith("#")){let t=e.slice(1);t.length===3?(this.r=parseInt(t[0]+t[0],16),this.g=parseInt(t[1]+t[1],16),this.b=parseInt(t[2]+t[2],16)):t.length===6?(this.r=parseInt(t.slice(0,2),16),this.g=parseInt(t.slice(2,4),16),this.b=parseInt(t.slice(4,6),16)):console.warn(`[Color class] @briklab/lib/color: Invalid hex!
18
+ Using black as fallback.`)}hex(){return`#${m(this,C,"m",ye).call(this,this.r)}${m(this,C,"m",ye).call(this,this.g)}${m(this,C,"m",ye).call(this,this.b)}`}rgb(){return`rgb(${this.r}, ${this.g}, ${this.b})`}rgba(){return`rgba(${this.r}, ${this.g}, ${this.b}, ${this.a})`}hsl(){let{h:e,s:t,l:r}=m(this,C,"m",Pe).call(this,this.r,this.g,this.b);return`hsl(${e}, ${t}%, ${r}%)`}hsla(){let{h:e,s:t,l:r}=m(this,C,"m",Pe).call(this,this.r,this.g,this.b);return`hsla(${e}, ${t}%, ${r}%, ${this.a})`}css(){return this.a===1?this.hex():this.rgba()}ansiTruecolor(){return`\x1B[38;2;${this.r};${this.g};${this.b}m`}ansiTruecolorBg(){return`\x1B[48;2;${this.r};${this.g};${this.b}m`}ansi256(){return`\x1B[38;5;${m(this,C,"m",$e).call(this,this.r,this.g,this.b)}m`}ansi256Bg(){return`\x1B[48;5;${m(this,C,"m",$e).call(this,this.r,this.g,this.b)}m`}wrapAnsi(e,t={}){let r=!!t.use256,l=t.background?r?this.ansi256Bg():this.ansiTruecolorBg():r?this.ansi256():this.ansiTruecolor();return`${`${t.bold?i.BOLD:""}${t.underline?i.UNDERLINE:""}`}${l}${e}${i.RESET}`}};C=new WeakSet,$e=function(e,t,r){if(e===t&&t===r)return e<8?16:e>248?231:Math.round((e-8)/247*24)+232;let l=S=>Math.round(S/255*5),s=l(e),n=l(t),o=l(r);return 16+36*s+6*n+o},Re=function(e){return Math.max(0,Math.min(255,e))},ye=function(e){return e.toString(16).padStart(2,"0")},pt=function(e){if(e=e.trim().toLowerCase(),ht[e]&&(e=ht[e]),e.startsWith("#")){let t=e.slice(1);t.length===3?(this.r=parseInt(t[0]+t[0],16),this.g=parseInt(t[1]+t[1],16),this.b=parseInt(t[2]+t[2],16)):t.length===6?(this.r=parseInt(t.slice(0,2),16),this.g=parseInt(t.slice(2,4),16),this.b=parseInt(t.slice(4,6),16)):console.warn(`[Color class] @briklab/lib/color: Invalid hex!
21
19
  Hint: You must pass a valid hex color string!
22
- Using black as fallback.`)}else if(e.startsWith("rgb")){let t=e.match(/[\d.]+/g)?.map(Number);t&&t.length>=3&&([this.r,this.g,this.b]=t,this.a=t[3]??1)}else if(e.startsWith("hsl")){let t=e.match(/[\d.]+/g)?.map(Number);if(t&&t.length>=3){let{r,g:n,b:s}=m(this,C,"m",Pe).call(this,t[0],t[1],t[2]);this.r=r,this.g=n,this.b=s,this.a=t[3]??1}}else console.warn(`[Color class] @briklab/lib/color: Unknown color string "${e}"!
20
+ Using black as fallback.`)}else if(e.startsWith("rgb")){let t=e.match(/[\d.]+/g)?.map(Number);t&&t.length>=3&&([this.r,this.g,this.b]=t,this.a=t[3]??1)}else if(e.startsWith("hsl")){let t=e.match(/[\d.]+/g)?.map(Number);if(t&&t.length>=3){let{r,g:l,b:s}=m(this,C,"m",qe).call(this,t[0],t[1],t[2]);this.r=r,this.g=l,this.b=s,this.a=t[3]??1}}else console.warn(`[Color class] @briklab/lib/color: Unknown color string "${e}"!
23
21
  Hint: The argument must be a valid color string!
24
- Using black as fallback.`)},Pe=function(e,t,r){t/=100,r/=100;let n=o=>(o+e/30)%12,s=t*Math.min(r,1-r),l=o=>r-s*Math.max(-1,Math.min(n(o)-3,Math.min(9-n(o),1)));return{r:Math.round(l(0)*255),g:Math.round(l(8)*255),b:Math.round(l(4)*255)}},Le=function(e,t,r){e/=255,t/=255,r/=255;let n=Math.max(e,t,r),s=Math.min(e,t,r),l=0,o=0,S=(n+s)/2;if(n!==s){let u=n-s;switch(o=S>.5?u/(2-n-s):u/(n+s),n){case e:l=(t-r)/u+(t<r?6:0);break;case t:l=(r-e)/u+2;break;case r:l=(e-t)/u+4;break}l*=60}return{h:Math.round(l),s:Math.round(o*100),l:Math.round(S*100)}};j.RESET="\x1B[0m";j.BOLD="\x1B[1m";j.UNDERLINE="\x1B[4m";var te=j;var de=function(i,e,t,r,n){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?i!==e||!n:!e.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?n.call(i,t):n?n.value=t:e.set(i,t),t},v=function(i,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?i!==e||!r:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(i):r?r.value:e.get(i)},me,ge,Ct,yt,A,F,be=class{constructor(e){me.add(this),ge.set(this,void 0),A.set(this,void 0),O.for([e]).check(["object|undefined"])||(console.warn(`[InlineStyle class] @briklab/lib/stylesheet: Invalid first argument!
22
+ Using black as fallback.`)},qe=function(e,t,r){t/=100,r/=100;let l=o=>(o+e/30)%12,s=t*Math.min(r,1-r),n=o=>r-s*Math.max(-1,Math.min(l(o)-3,Math.min(9-l(o),1)));return{r:Math.round(n(0)*255),g:Math.round(n(8)*255),b:Math.round(n(4)*255)}},Pe=function(e,t,r){e/=255,t/=255,r/=255;let l=Math.max(e,t,r),s=Math.min(e,t,r),n=0,o=0,S=(l+s)/2;if(l!==s){let u=l-s;switch(o=S>.5?u/(2-l-s):u/(l+s),l){case e:n=(t-r)/u+(t<r?6:0);break;case t:n=(r-e)/u+2;break;case r:n=(e-t)/u+4;break}n*=60}return{h:Math.round(n),s:Math.round(o*100),l:Math.round(S*100)}};j.RESET="\x1B[0m";j.BOLD="\x1B[1m";j.UNDERLINE="\x1B[4m";var te=j;var de=function(i,e,t,r,l){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!l)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?i!==e||!l:!e.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?l.call(i,t):l?l.value=t:e.set(i,t),t},v=function(i,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?i!==e||!r:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(i):r?r.value:e.get(i)},me,ge,ft,Rt,A,F,be=class{constructor(e){me.add(this),ge.set(this,void 0),A.set(this,void 0),O.for([e]).check(["object|undefined"])||(console.warn(`[InlineStyle class] @briklab/lib/stylesheet: Invalid first argument!
25
23
  Hint: The first argument must be a valid style object or not be given!
26
- Using {"imeMode":givenValue} as fallback`),e={imeMode:`${e}`}),de(this,A,e,"f"),de(this,ge,new De.CSSStyleDeclaration,"f")}generate(){let e=v(this,ge,"f"),t=v(this,A,"f"),r=Object.keys(t),n=Object.values(t);for(let s=0;s<r.length;s++){let l=r[s],o=n[s];if(o==null){console.warn(`[InlineStyle.generate] @briklab/lib/stylesheet: Skipping property "${l}" with ${String(o)} value. Hint: avoid null/undefined style values.`);continue}typeof o!="string"&&(console.warn(`[InlineStyle.generate] @briklab/lib/stylesheet: Non-string style value for "${l}" (type=${typeof o}). Coercing to string.`),o=String(o)),e.setProperty(l,o)}return e.cssText}get text(){return this.generate()}get ansi(){let e=v(this,A,"f")||{},t=[];(e["font-weight"]==="bold"||e.fontWeight==="bold")&&t.push(te.BOLD),(e["text-decoration"]||e.textDecoration||"").includes("underline")&&t.push(te.UNDERLINE);let r=e.color||e.color;if(r)try{let s=new te(String(r));t.push(s.ansiTruecolor())}catch{console.warn(`[InlineStyle.ansi] @briklab/lib/stylesheet: Invalid color value "${String(r)}" \u2014 ignoring. Hint: use a valid hex, rgb(), hsl() or named color.`)}let n=e["background-color"]||e.backgroundColor;if(n)try{let s=new te(String(n));t.push(s.ansiTruecolorBg())}catch{console.warn(`[InlineStyle.ansi] @briklab/lib/stylesheet: Invalid background-color value "${String(n)}" \u2014 ignoring. Hint: use a valid hex, rgb(), hsl() or named color.`)}return t.join("")}addStyleWithObject(e){return O.for([e]).check(["object"])?(de(this,A,{...v(this,A,"f"),...e},"f"),this.generate(),this):(console.warn(`[InlineStyle.addStyleWithObject] @briklab/lib/stylesheet: Invalid first argument!
24
+ Using {"imeMode":givenValue} as fallback`),e={imeMode:`${e}`}),de(this,A,e,"f"),de(this,ge,new Le.CSSStyleDeclaration,"f")}generate(){let e=v(this,ge,"f"),t=v(this,A,"f"),r=Object.keys(t),l=Object.values(t);for(let s=0;s<r.length;s++){let n=r[s],o=l[s];if(o==null){console.warn(`[InlineStyle.generate] @briklab/lib/stylesheet: Skipping property "${n}" with ${String(o)} value. Hint: avoid null/undefined style values.`);continue}typeof o!="string"&&(console.warn(`[InlineStyle.generate] @briklab/lib/stylesheet: Non-string style value for "${n}" (type=${typeof o}). Coercing to string.`),o=String(o)),e.setProperty(n,o)}return e.cssText}get text(){return this.generate()}get ansi(){let e=v(this,A,"f")||{},t=[];(e["font-weight"]==="bold"||e.fontWeight==="bold")&&t.push(te.BOLD),(e["text-decoration"]||e.textDecoration||"").includes("underline")&&t.push(te.UNDERLINE);let r=e.color||e.color;if(r)try{let s=new te(String(r));t.push(s.ansiTruecolor())}catch{console.warn(`[InlineStyle.ansi] @briklab/lib/stylesheet: Invalid color value "${String(r)}" \u2014 ignoring. Hint: use a valid hex, rgb(), hsl() or named color.`)}let l=e["background-color"]||e.backgroundColor;if(l)try{let s=new te(String(l));t.push(s.ansiTruecolorBg())}catch{console.warn(`[InlineStyle.ansi] @briklab/lib/stylesheet: Invalid background-color value "${String(l)}" \u2014 ignoring. Hint: use a valid hex, rgb(), hsl() or named color.`)}return t.join("")}addStyleWithObject(e){return O.for([e]).check(["object"])?(de(this,A,{...v(this,A,"f"),...e},"f"),this.generate(),this):(console.warn(`[InlineStyle.addStyleWithObject] @briklab/lib/stylesheet: Invalid first argument!
27
25
  Hint: expected a plain object with CSS properties. Received: ${String(e)}
28
26
  Returned with no operations.`),this)}addStyleWithInlineCSS(e){if(!O.for([e]).check(["string"]))return console.warn(`[InlineStyle.addStyleWithInlineCSS] @briklab/lib/stylesheet: Invalid first argument!
29
27
  Hint: The first argument must be a valid inline css string!
30
- Returned with no operations.`),this;let t=new De.CSSStyleDeclaration;t.cssText=v(this,me,"m",yt).call(this,e);let r={};for(let n=0;n<t.length;n++){let s=t[n],l=t.getPropertyValue(s);r[s]=l}return this.addStyleWithObject(r),this}removeStyle(e){if(!O.for([e]).check(["string[]|string"]))return console.warn(`[InlineStyle.removeStyle] @briklab/lib/stylesheet: Invalid first argument!
28
+ Returned with no operations.`),this;let t=new Le.CSSStyleDeclaration;t.cssText=v(this,me,"m",Rt).call(this,e);let r={};for(let l=0;l<t.length;l++){let s=t[l],n=t.getPropertyValue(s);r[s]=n}return this.addStyleWithObject(r),this}removeStyle(e){if(!O.for([e]).check(["string[]|string"]))return console.warn(`[InlineStyle.removeStyle] @briklab/lib/stylesheet: Invalid first argument!
31
29
  Hint: expected a string or array of strings. Returned with no operations. Received: ${String(e)}`),this;typeof e=="string"&&(e=[e]);for(let t=0;t<e.length;t++){let r=e[t];if(typeof r!="string"){console.warn(`[InlineStyle.removeStyle] @briklab/lib/stylesheet: Ignoring non-string style name at index ${t}: ${String(r)}`);continue}delete v(this,A,"f")[r]}return this}applyTo(e){return O.for([e]).check(["object"])?!e||typeof e.style!="object"?(console.warn("[InlineStyle.applyTo] @briklab/lib/stylesheet: Given object does not look like an HTMLElement (missing .style). No operation was performed."),this):(e.style.cssText=this.generate(),this):(console.warn(`[InlineStyle.applyTo] @briklab/lib/stylesheet: Invalid first argument!
32
- Hint: expected an HTMLElement. No operation was performed.`),this)}};ge=new WeakMap,A=new WeakMap,me=new WeakSet,Ct=function(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)},yt=function(e){let t=String(e).split(";"),r="";for(let n=0;n<t.length;n++){let s=t[n].trim();if(!s)continue;let l=s.split(":");if(l.length<2){console.warn(`[InlineStyle.#convertKeysToValidCSS] @briklab/lib/stylesheet: Skipping malformed rule: "${s}". Hint: expected "property: value" pairs separated by ";"`);continue}let o=l[0].trim(),S=l.slice(1).join(":").trim();if(!o||!S){console.warn(`[InlineStyle.#convertKeysToValidCSS] @briklab/lib/stylesheet: Skipping empty property or value in rule: "${s}".`);continue}r+=`${v(this,me,"m",Ct).call(this,o)}:${S};`}return r};var er=be,Rt=class{constructor(){F.set(this,void 0),de(this,F,{},"f")}set(e,t){return O.for([e,t]).check(["string","object"])?t instanceof be?(v(this,F,"f")[e]=t,this):(console.warn(`[StyleSheet.set] @briklab/lib/stylesheet: Provided style is not an InlineStyle instance!
30
+ Hint: expected an HTMLElement. No operation was performed.`),this)}};ge=new WeakMap,A=new WeakMap,me=new WeakSet,ft=function(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)},Rt=function(e){let t=String(e).split(";"),r="";for(let l=0;l<t.length;l++){let s=t[l].trim();if(!s)continue;let n=s.split(":");if(n.length<2){console.warn(`[InlineStyle.#convertKeysToValidCSS] @briklab/lib/stylesheet: Skipping malformed rule: "${s}". Hint: expected "property: value" pairs separated by ";"`);continue}let o=n[0].trim(),S=n.slice(1).join(":").trim();if(!o||!S){console.warn(`[InlineStyle.#convertKeysToValidCSS] @briklab/lib/stylesheet: Skipping empty property or value in rule: "${s}".`);continue}r+=`${v(this,me,"m",ft).call(this,o)}:${S};`}return r};var tr=be,Ct=class{constructor(){F.set(this,void 0),de(this,F,{},"f")}set(e,t){return O.for([e,t]).check(["string","object"])?t instanceof be?(v(this,F,"f")[e]=t,this):(console.warn(`[StyleSheet.set] @briklab/lib/stylesheet: Provided style is not an InlineStyle instance!
33
31
  Hint: create the style with new InlineStyle({...}). Received: ${String(t)}. Returned with no operations.`),this):(console.warn(`[StyleSheet.set] @briklab/lib/stylesheet: Invalid arguments!
34
32
  Hint: call .set("ruleName", new InlineStyle({...})). Received name=${String(e)}, style=${String(t)}. Returned with no operations.`),this)}get(e){if(!O.for([e]).check(["string"])){console.warn(`[StyleSheet.get] @briklab/lib/stylesheet: Invalid argument!
35
33
  Hint: name must be a string. Received: ${String(e)}. Returned undefined.`);return}return v(this,F,"f")[e]}remove(e){return O.for([e]).check(["string"])?(delete v(this,F,"f")[e],this):(console.warn(`[StyleSheet.remove] @briklab/lib/stylesheet: Invalid argument!
36
34
  Hint: name must be a string. Received: ${String(e)}. No-op.`),this)}generate(){let e="";for(let t in v(this,F,"f")){let r=v(this,F,"f")[t];r&&(e+=`${t} { ${r.text} }
37
- `)}return e.trim()}toString(){return this.generate()}};F=new WeakMap;export{Rt as StyleSheet,er as default};
35
+ `)}return e.trim()}toString(){return this.generate()}};F=new WeakMap;export{Ct as StyleSheet,tr as default};
38
36
  //# sourceMappingURL=index.js.map