@amaui/style
Version:
CSS in JS styling solution
6 lines • 148 kB
JavaScript
/** @license AmauiStyle v1.1.21
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).AmauiStyle={})}(this,(function(e){"use strict";function t(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function a(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach((function(a){var r=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,r.get?r:{enumerable:!0,get:function(){return e[a]}})})),t}var r={},i={},s="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},o={exports:{}};!function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const a={},r="undefined"!=typeof window&&void 0!==window.document,i=!(void 0===s||!e.exports);t.default=function e(t,s,o={}){var n;const l=Object.assign(Object.assign({},a),o),{variant:u}=l,c=s&&"object"==typeof s&&Object.getPrototypeOf(s);switch(t){case"string":return"string"==typeof s;case"number":return"number"==typeof s&&!Number.isNaN(s);case"boolean":return"boolean"==typeof s;case"array":return Array.isArray(s);case"object":return"object"==typeof s&&!!s&&s.constructor===Object;case"object-like":return"object"==typeof s&&(null===s||s.constructor!==Object);case"class":return("object"==typeof s||"function"==typeof s)&&(/class/gi.test(String(s))||/class/gi.test(String(null==s?void 0:s.constructor)));case"function":return!!(s&&s instanceof Function);case"async":return!(!e("function",s)||!(r?"AsyncFunction"===s.constructor.name:s()instanceof Promise));case"map":return!(c!==Map.prototype);case"weakmap":return!(c!==WeakMap.prototype);case"set":return!(c!==Set.prototype);case"weakset":return!(c!==WeakSet.prototype);case"promise":return!(c!==Promise.prototype);case"int8array":return!(c!==Int8Array.prototype);case"uint8array":return!(c!==Uint8Array.prototype);case"uint8clampedarray":return!(c!==Uint8ClampedArray.prototype);case"int16array":return!(c!==Int16Array.prototype);case"uint16array":return!(c!==Uint16Array.prototype);case"int32array":return!(c!==Int32Array.prototype);case"uint32array":return!(c!==Uint32Array.prototype);case"float32array":return!(c!==Float32Array.prototype);case"float64array":return!(c!==Float64Array.prototype);case"bigint64array":return!(c!==BigInt64Array.prototype);case"biguint64array":return!(c!==BigUint64Array.prototype);case"typedarray":return e("int8array",s)||e("uint8array",s)||e("uint8clampedarray",s)||e("int16array",s)||e("uint16array",s)||e("int32array",s)||e("uint32array",s)||e("float32array",s)||e("float64array",s)||e("bigint64array",s)||e("biguint64array",s);case"dataview":return!(c!==DataView.prototype);case"arraybuffer":return!(c!==ArrayBuffer.prototype);case"sharedarraybuffer":return"undefined"!=typeof SharedArrayBuffer&&!(c!==SharedArrayBuffer.prototype);case"symbol":return!("symbol"!=typeof s);case"error":return!!(s&&s instanceof Error);case"date":return!!(s&&s instanceof Date);case"regexp":return!!(s&&s instanceof RegExp);case"arguments":return!(!s||"[object Arguments]"!==s.toString());case"null":return null===s;case"undefined":return void 0===s;case"blob":return r&&s instanceof Blob;case"buffer":return!(!i||"function"!=typeof(null===(n=null==s?void 0:s.constructor)||void 0===n?void 0:n.isBuffer)||!s.constructor.isBuffer(s));case"element":if(s)switch(u){case void 0:case"html":case"element":return r&&("object"==typeof HTMLElement?s instanceof HTMLElement:s&&"object"==typeof s&&null!==s&&1===s.nodeType&&"string"==typeof s.nodeName);case"node":return r&&("object"==typeof Node?s instanceof Node:s&&"object"==typeof s&&null!==s&&"number"==typeof s.nodeType&&"string"==typeof s.nodeName);case"react":return s.elementType||s.hasOwnProperty("$$typeof");default:return!1}return!1;case"simple":return e("string",s,l)||e("number",s,l)||e("boolean",s,l)||e("undefined",s,l)||e("null",s,l);case"not-array-object":return!e("array",s,l)&&!e("object",s,l);default:return!1}}}(o,o.exports);var n={},l={},u={},c={},d=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(c,"__esModule",{value:!0});const p=d(o.exports),h={decode:!1,decodeMethod:decodeURIComponent};var f=c.default=(e,t={})=>{const a=Object.assign(Object.assign({},h),t);let r=e;try{(0,p.default)("string",e)&&a.decode&&(0,p.default)("function",a.decodeMethod)&&(r=a.decodeMethod(e))}catch(e){}try{if((0,p.default)("string",r)){if("undefined"===r)return;return"NaN"===r?NaN:JSON.parse(r)}return r}catch(e){}return r};!function(e){var t=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.getObjectPropertyValue=void 0;const a=t(o.exports),r=t(c);e.getObjectPropertyValue=(t,i)=>{if(t&&i){if((0,a.default)("string",i)){const a=i.split(".").filter(Boolean).map((e=>(0,r.default)(e)));return(0,e.getObjectPropertyValue)(t,a)}if((0,a.default)("array",i)){const a=i[0];if(1===i.length)return t[a];if(t.hasOwnProperty(a))return(0,e.getObjectPropertyValue)(t[a],i.slice(1))}}},e.default=e.getObjectPropertyValue}(u);var m=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(l,"__esModule",{value:!0});const v=m(u);l.default=(e,...t)=>{if(!e||!t.length)return;let a;const r=t.filter(Boolean);for(const t of r)if(a=(0,v.default)(e,t),void 0!==a)return a};var y=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n,"__esModule",{value:!0});const g=y(o.exports),b=y(l);var w=n.default=(e,...t)=>{const a={simple:[],array:[],object:[]},r=[];return(0,g.default)("array",e)&&e.forEach((e=>{const i=(0,g.default)("not-array-object",e),s=(0,g.default)("array",e),o=i||!t.length?e:(0,b.default)(e,...t);a[i?"simple":s?"array":"object"].find((e=>o===e))||void 0===o||(r.push(e),a[i?"simple":s?"array":"object"].push(o))})),r},x=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(i,"__esModule",{value:!0});const S=x(o.exports),_=x(n),k={response:"array"};i.default=function(e,t={}){const a=Object.assign(Object.assign({},k),t);if((0,S.default)("array",e)){const t=(0,_.default)(e),r=t.length,i=(0,S.default)("number",a.items)?a.items:r;if(i<1)return[t];if(1===i)return t.map((e=>[e]));const s=new Array(i).fill(0);let o=i-2;const n=[];if("array"===a.response){for(;o>=0;){o=i-2;for(let e=0;e<r;e++)s[i-1]=e,n.push(s.map((e=>t[e])));for(;;){if(s[o]!==r-1){s[o]++;break}if(s[o]=0,o--,o<0)break}}return n}if("yield"===a.response)return function*(){for(;o>=0;){o=i-2;for(let e=0;e<r;e++){s[i-1]=e;const a=s.map((e=>t[e]));yield a,n.push(a)}for(;;){if(s[o]!==r-1){s[o]++;break}if(s[o]=0,o--,o<0)break}}return n}}};var j=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});const A=j(i),F={response:"array"};var E=r.default=function(e,t=0,a={}){const r=Object.assign(Object.assign({},F),a);return(0,A.default)(e,Object.assign(Object.assign({},r),{items:t}))},O={};Object.defineProperty(O,"__esModule",{value:!0});var M=O.default=()=>"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==s?s:void 0;function C(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}var N={exports:{}};!function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const a={},r="undefined"!=typeof window&&void 0!==window.document,i=!(void 0===s||!e.exports);t.default=function e(t,s,o={}){var n;const l=Object.assign(Object.assign({},a),o),{variant:u}=l,c=s&&"object"==typeof s&&Object.getPrototypeOf(s);switch(t){case"string":return"string"==typeof s;case"number":return"number"==typeof s&&!Number.isNaN(s);case"boolean":return"boolean"==typeof s;case"array":return Array.isArray(s);case"object":return"object"==typeof s&&!!s&&s.constructor===Object;case"object-like":return"object"==typeof s&&(null===s||s.constructor!==Object);case"class":return("object"==typeof s||"function"==typeof s)&&(/class/gi.test(String(s))||/class/gi.test(String(null==s?void 0:s.constructor)));case"function":return!!(s&&s instanceof Function);case"async":return!(!e("function",s)||!(r?"AsyncFunction"===s.constructor.name:s()instanceof Promise));case"map":return!(c!==Map.prototype);case"weakmap":return!(c!==WeakMap.prototype);case"set":return!(c!==Set.prototype);case"weakset":return!(c!==WeakSet.prototype);case"promise":return!(c!==Promise.prototype);case"int8array":return!(c!==Int8Array.prototype);case"uint8array":return!(c!==Uint8Array.prototype);case"uint8clampedarray":return!(c!==Uint8ClampedArray.prototype);case"int16array":return!(c!==Int16Array.prototype);case"uint16array":return!(c!==Uint16Array.prototype);case"int32array":return!(c!==Int32Array.prototype);case"uint32array":return!(c!==Uint32Array.prototype);case"float32array":return!(c!==Float32Array.prototype);case"float64array":return!(c!==Float64Array.prototype);case"bigint64array":return!(c!==BigInt64Array.prototype);case"biguint64array":return!(c!==BigUint64Array.prototype);case"typedarray":return e("int8array",s)||e("uint8array",s)||e("uint8clampedarray",s)||e("int16array",s)||e("uint16array",s)||e("int32array",s)||e("uint32array",s)||e("float32array",s)||e("float64array",s)||e("bigint64array",s)||e("biguint64array",s);case"dataview":return!(c!==DataView.prototype);case"arraybuffer":return!(c!==ArrayBuffer.prototype);case"sharedarraybuffer":return"undefined"!=typeof SharedArrayBuffer&&!(c!==SharedArrayBuffer.prototype);case"symbol":return!("symbol"!=typeof s);case"error":return!!(s&&s instanceof Error);case"date":return!!(s&&s instanceof Date);case"regexp":return!!(s&&s instanceof RegExp);case"arguments":return!(!s||"[object Arguments]"!==s.toString());case"null":return null===s;case"undefined":return void 0===s;case"blob":return r&&s instanceof Blob;case"buffer":return!(!i||"function"!=typeof(null===(n=null==s?void 0:s.constructor)||void 0===n?void 0:n.isBuffer)||!s.constructor.isBuffer(s));case"element":if(s)switch(u){case void 0:case"html":case"element":return r&&("object"==typeof HTMLElement?s instanceof HTMLElement:s&&"object"==typeof s&&null!==s&&1===s.nodeType&&"string"==typeof s.nodeName);case"node":return r&&("object"==typeof Node?s instanceof Node:s&&"object"==typeof s&&null!==s&&"number"==typeof s.nodeType&&"string"==typeof s.nodeName);case"react":return s.elementType||s.hasOwnProperty("$$typeof");default:return!1}return!1;case"simple":return e("string",s,l)||e("number",s,l)||e("boolean",s,l)||e("undefined",s,l)||e("null",s,l);case"not-array-object":return!e("array",s,l)&&!e("object",s,l);default:return!1}}}(N,N.exports);var B=t(N.exports),z={};Object.defineProperty(z,"__esModule",{value:!0});const D=e=>{if((e=>Array.isArray(e))(e))return e.map((e=>D(e)));if((e=>"object"==typeof e&&!!e&&e.constructor===Object)(e)){const t={};return Object.keys(e).forEach((a=>t[a]=D(e[a]))),t}return e};var R=z.default=D,P={},T={};Object.defineProperty(T,"__esModule",{value:!0});T.default=()=>"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==s?s:void 0;var $={},I={},U={},H=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(U,"__esModule",{value:!0});const q=H(N.exports);U.default=e=>(0,q.default)("string",e)?`${e.charAt(0).toUpperCase()}${e.slice(1)}`:e,function(e){var t=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.optionsDefault=void 0;const a=t(N.exports),r=t(U);e.optionsDefault={filters:[",",".","-","_","s+"],replaceWith:" ",trim:!0};e.default=(t,i={})=>{try{const s=Object.assign(Object.assign({},e.optionsDefault),i);if(s.className&&(s.replaceWith="-",s.cammelCaseTransform=!0,s.lowercase=!0),(0,a.default)("string",t)){let e=t;if(s.url){const t=e.split("?").filter(Boolean);let a=t[0];const r=t[1];return"/"===a.slice(-1)&&(a=a.slice(0,-1)),e=r?[a,r].join("?"):a,e}return s.cammelCaseTransform&&(e=e.split(/(?=[A-Z])/g).join(s.replaceWith||" ")),s.filters.forEach((t=>{const a=new RegExp(`\\${t}`,"g");e=e.replace(a,s.replaceWith||" ")})),s.trim&&(e=e.trim()),s.capitalize&&(e=(0,r.default)(e)),s.lowercase&&(e=e.toLocaleLowerCase()),e}return t}catch(e){}return t}}(I);var V={},W=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(V,"__esModule",{value:!0});const L=W(N.exports),Z={decode:!1,decodeMethod:decodeURIComponent};V.default=(e,t={})=>{const a=Object.assign(Object.assign({},Z),t);let r=e;try{(0,L.default)("string",e)&&a.decode&&(0,L.default)("function",a.decodeMethod)&&(r=a.decodeMethod(e))}catch(e){}try{if((0,L.default)("string",r)){if("undefined"===r)return;return"NaN"===r?NaN:JSON.parse(r)}return r}catch(e){}return r};var G=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty($,"__esModule",{value:!0});const K=G(N.exports),J=G(I),X=G(V),Q={valueOverride:!1},Y=(e,t="",a,r={})=>{const i=Object.assign(Object.assign({},Q),r);if(!e&&!t)return e;if((0,K.default)("string",t)){const r=t.split(".").filter(Boolean).map((e=>(0,X.default)(e)));return Y(e,r,a,i)}if((0,K.default)("array",t)){const r=t[0],s=(0,J.default)(String(r),{filters:[".",","],replaceWith:""});if(1!==t.length||void 0===a){e.hasOwnProperty(r)&&!i.valueOverride||(e[s]=(0,K.default)("number",t[1])?[]:{});const o=e[s];return(0,K.default)("object",o)||(0,K.default)("array",o)?Y(e[r],t.slice(1),a,i):e}((0,K.default)("array",e)&&(0,K.default)("number",r)||(0,K.default)("object",e)&&(0,K.default)("string",r))&&(e[(0,K.default)("string",r)?s:r]=a)}return e};$.default=Y;var ee=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(P,"__esModule",{value:!0});const te=ee(N.exports),ae=ee(T),re=ee($),ie={};var se=P.default=(e,t={})=>{var a,r,i,s;const o=Object.assign(Object.assign({},ie),t);try{return(0,te.default)("function",e)?e():void 0}catch(e){if(o.log){console.error("Try: ",e);const t=(0,ae.default)();"test"===(null===(a=t.AMAUI)||void 0===a?void 0:a.env)&&((null===(s=null===(i=null===(r=t.AMAUI)||void 0===r?void 0:r.test)||void 0===i?void 0:i.Try)||void 0===s?void 0:s.logs)||(0,re.default)(t,"AMAUI.test.Try.logs",[]),t.AMAUI.test.Try.logs.push(e))}}};const oe={emit:{priorValue:!0,copy:!1,pre:{},post:{}}};var ne=class{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};C(this,"methods",[]),this.value=e,this.options=t,this.options={...oe,...this.options}}get length(){return this.methods.length}emit(){for(var e,t,a,r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];const o=i;null!==(e=this.options.emit)&&void 0!==e&&e.priorValue&&(this.value=1===o.length?o[0]:o),B("function",null===(t=this.options.emit.pre)||void 0===t?void 0:t.method)&&this.options.emit.pre.method(...o),this.methods.map((e=>{B("function",e)&&e(...this.options.emit.copy?R(o):o)})),B("function",null===(a=this.options.emit.post)||void 0===a?void 0:a.method)&&this.options.emit.post.method(...o)}forEach(){for(var e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];this.methods.forEach((e=>se((()=>e(...t)))))}map(e){if(!this.methods.length)return;let t=e;for(const e of this.methods)t=se((()=>e(t)));return t}subscribe(e){-1===this.methods.indexOf(e)&&this.methods.push(e)}unsubscribe(e){if(this.methods.indexOf(e)>-1){const t=this.methods.findIndex((t=>t===e));t>-1&&this.methods.splice(t,1)}}};const le=e=>pe("string",e)?e.replace(/[A-Z]/g,(e=>"-".concat(e[0]))).toLowerCase():e,ue=e=>pe("string",e)?e.replace(/-./g,(e=>void 0!==e[1]?e[1].toUpperCase():"")):e,ce=e=>de(ue(e)),de=e=>pe("string",e)?e.charAt(0).toUpperCase()+e.slice(1):e,pe=(e,t)=>{switch(e){case"string":return"string"==typeof t;case"number":return"number"==typeof t&&!Number.isNaN(t);case"array":return Array.isArray(t);case"boolean":return"boolean"==typeof t;case"null":return null===t;case"undefined":return void 0===t;case"object":return"object"==typeof t&&!!t&&t.constructor===Object;case"function":return!!(t&&t instanceof Function);case"simple":return pe("string",t)||pe("number",t)||pe("boolean",t)||pe("undefined",t)||pe("null",t);default:return}},he=e=>e instanceof ne||pe("function",null==e?void 0:e.emit),fe=e=>{const t=[];if(pe("string",e)){const a=/\$[a-zA-Z1-9_]+/g;t.push(...(e.match(a)||[]).map((e=>e.replace("$",""))))}return t},me=(e,t,a)=>{const r={value:[],options:{}};if(pe("string",e)&&e.length&&void 0!==t&&a)if(pe("string",t))r.value=[t];else if(pe("number",t)){var i;const s=null===(i=a.subscriptions.rule.unit.map({property:e,value:t}))||void 0===i?void 0:i.value;r.value=[(null==s?void 0:s.value)||t]}else if(pe("array",t)&&t.every((e=>pe("simple",e))))r.value=[t.flatMap((t=>me(e,t,a).value)).join(" ")];else if(pe("array",t)&&t.every((e=>pe("array",e)||pe("object",e))))r.value=[t.flatMap((t=>me(e,t,a).value)).join(", ")];else if(pe("object",t))if(t.value){const i=(t.fallbacks||[]).flatMap((t=>me(e,t,a).value));r.value=[i,me(e,t.value,a).value].flat().filter(Boolean),t.rule&&(r.options.rule=t.rule)}else{var s;const i=null===(s=a.subscriptions.rule.value.map({property:e,value:t}))||void 0===s?void 0:s.value;r.value=i||[]}else r.value=[t];return r},ve=e=>pe("function",e)||he(e)||pe("object",e)&&Object.keys(e).some((t=>ve(e[t])));function*ye(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"abcdefghijklmnopqrstuvwxyz";const a=pe("array",t)?t:t.split("");let r,i=e,s=E(a,i,{response:"yield"})();for(;;){var o;r=s.next(),null!==(o=r)&&void 0!==o&&o.done&&(s=E(a,++i,{response:"yield"})(),r=s.next()),yield r.value.join("")}}const ge=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16;return Number((e/t).toFixed(4))};M().amaui_methods={makeName:ye()};const be=e=>pe("object",e)?(e.hasOwnProperty("className")||Object.defineProperty(e,"className",{get:function(){return Object.keys(e.classNames).map((t=>e.classNames[t])).join(" ")}}),e.hasOwnProperty("class")||Object.defineProperty(e,"class",{get:function(){return Object.keys(e.classes).map((t=>e.classes[t])).join(" ")}}),e.hasOwnProperty("styles")||(e.styles=function(){const t=[];for(var a=arguments.length,r=new Array(a),i=0;i<a;i++)r[i]=arguments[i];return r.forEach((a=>{e.classes[a]&&t.push(e.classes[a])})),t.join(" ")}),e):e;let we=0;const xe=()=>"".concat(we++,"-").concat((new Date).getTime()),Se=e=>e.replace(/\n/g,"").replace(/ ?(\{|:|,|>|~) ?/g,"$1").replace(/;(\})/g,"$1");var _e={};Object.defineProperty(_e,"__esModule",{value:!0});const ke=e=>{if((e=>Array.isArray(e))(e))return e.map((e=>ke(e)));if((e=>"object"==typeof e&&!!e&&e.constructor===Object)(e)){const t={};return Object.keys(e).forEach((a=>t[a]=ke(e[a]))),t}return e};var je=_e.default=ke,Ae={},Fe={},Ee=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Fe,"__esModule",{value:!0});const Oe=Ee(o.exports);var Me=Fe.default=function e(t,a){let r;switch(t){case"browser":return"undefined"!=typeof window&&void 0!==window.document;case"worker":return"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope;case"nodejs":return new Function("try {return this===global;}catch(e){return false;}")();case"localhost":return r=void 0!==a?a:e("browser")&&window.location.hostname,(0,Oe.default)("string",r)&&["localhost","127.0.0.1"].some((e=>r.indexOf(e)>-1));default:return!1}},Ce={},Ne={},Be={},ze={},De=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ze,"__esModule",{value:!0});const Re=De(o.exports);ze.default=e=>(0,Re.default)("string",e)?`${e.charAt(0).toUpperCase()}${e.slice(1)}`:e,function(e){var t=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.optionsDefault=void 0;const a=t(o.exports),r=t(ze);e.optionsDefault={filters:[",",".","-","_","s+"],replaceWith:" ",trim:!0};e.default=(t,i={})=>{try{const s=Object.assign(Object.assign({},e.optionsDefault),i);if(s.className&&(s.replaceWith="-",s.cammelCaseTransform=!0,s.lowercase=!0),(0,a.default)("string",t)){let e=t;if(s.url){const t=e.split("?").filter(Boolean);let a=t[0];const r=t[1];return"/"===a.slice(-1)&&(a=a.slice(0,-1)),e=r?[a,r].join("?"):a,e}return s.cammelCaseTransform&&(e=e.split(/(?=[A-Z])/g).join(s.replaceWith||" ")),s.filters.forEach((t=>{const a=new RegExp(`\\${t}`,"g");e=e.replace(a,s.replaceWith||" ")})),s.trim&&(e=e.trim()),s.capitalize&&(e=(0,r.default)(e)),s.lowercase&&(e=e.toLocaleLowerCase()),e}return t}catch(e){}return t}}(Be);var Pe=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ne,"__esModule",{value:!0});const Te=Pe(o.exports),$e=Pe(Be),Ie=Pe(c),Ue={valueOverride:!1},He=(e,t="",a,r={})=>{const i=Object.assign(Object.assign({},Ue),r);if(!e&&!t)return e;if((0,Te.default)("string",t)){const r=t.split(".").filter(Boolean).map((e=>(0,Ie.default)(e)));return He(e,r,a,i)}if((0,Te.default)("array",t)){const r=t[0],s=(0,$e.default)(String(r),{filters:[".",","],replaceWith:""});if(1!==t.length||void 0===a){e.hasOwnProperty(r)&&!i.valueOverride||(e[s]=(0,Te.default)("number",t[1])?[]:{});const o=e[s];return(0,Te.default)("object",o)||(0,Te.default)("array",o)?He(e[r],t.slice(1),a,i):e}((0,Te.default)("array",e)&&(0,Te.default)("number",r)||(0,Te.default)("object",e)&&(0,Te.default)("string",r))&&(e[(0,Te.default)("string",r)?s:r]=a)}return e};Ne.default=He;var qe=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ce,"__esModule",{value:!0});const Ve=qe(o.exports),We=qe(O),Le=qe(Ne),Ze={};var Ge=Ce.default=(e,t={})=>{var a,r,i,s;const o=Object.assign(Object.assign({},Ze),t);try{return(0,Ve.default)("function",e)?e():void 0}catch(e){if(o.log){console.error("Try: ",e);const t=(0,We.default)();"test"===(null===(a=t.AMAUI)||void 0===a?void 0:a.env)&&((null===(s=null===(i=null===(r=t.AMAUI)||void 0===r?void 0:r.test)||void 0===i?void 0:i.Try)||void 0===s?void 0:s.logs)||(0,Le.default)(t,"AMAUI.test.Try.logs",[]),t.AMAUI.test.Try.logs.push(e))}}},Ke=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ae,"__esModule",{value:!0});const Je=Ke(o.exports),Xe=Ke(Fe),Qe=Ke(Ce);var Ye=Ae.default=function e(t){const a={};a.value=t,(0,Je.default)("string",t)&&(a.value=window.document.querySelector(t)),(0,Je.default)("element",a.value)||delete a.value;const r=(e=a.value)=>{const t=(0,Je.default)("element",e)&&(e.matches||e.webkitMatchesSelector||e.mozMatchesSelector||e.oMatchesSelector||e.msMatchesSelector);return t?t.bind(e):()=>!1};return a.parent=function(){if(this.value&&(0,Xe.default)("browser")&&this.value.parentNode)return this.value.parentNode},a.parents=function(t,a="some"){const i=[];let s=this.value;for(;s&&s!==document;)s=e(s).parent(),s&&(!(null==t?void 0:t.length)||t[a]&&t[a]((e=>(0,Qe.default)((()=>r(s)(e))))))&&i.push(s);return i},a.nearest=function(t,a="some"){if(!(null==t?void 0:t.length)||t[a]&&t[a]((e=>(0,Qe.default)((()=>r(this.value)(e))))))return this.value;let i=this.value;for(;i&&i!==document;)if(i=e(i).parent(),i&&(!(null==t?void 0:t.length)||t[a]&&t[a]((e=>(0,Qe.default)((()=>r(i)(e)))))))return i},a.furthest=function(e,t="some"){const a=this.parents(e,t);return a[a.length-1]},a.hasParent=function(t,a=!0,i="some"){let s=this.value;if(!a)return!(null==t?void 0:t.length)||t[i]&&t[i]((e=>(0,Qe.default)((()=>r(this.parent())(e)))));for(;s&&s!==document;)if(s=e(s).parent(),s&&(!(null==t?void 0:t.length)||t[i]&&t[i]((e=>(0,Qe.default)((()=>r(s)(e)))))))return!0;return!1},a.hasParents=function(e,t=!0,a="some"){if(!(null==e?void 0:e.length))return!!this.parent();const i=this.parents();return!!(this.value&&(null==e?void 0:e.length)&&e[a]&&e[a]((e=>{const a=i.findIndex((t=>(0,Je.default)("string",e)?(0,Qe.default)((()=>r(t)(e))):t===e));return a>-1&&(t&&i.splice(a,1),!0)})))},a},et={},tt=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(et,"__esModule",{value:!0});const at=tt(o.exports),rt=tt(_e),it={copy:!1,merge:{array:!1}},st=(e,t,a={})=>{const r=Object.assign(Object.assign({},it),a);if(r.merge.array&&(0,at.default)("array",e)&&(0,at.default)("array",t)){const a=Math.max(e.length,t.length);for(let i=0;i<a;i++)void 0===e[i]&&(e[i]=t[i]),((0,at.default)("object",e[i])&&(0,at.default)("object",t[i])||(0,at.default)("array",e[i])&&(0,at.default)("array",t[i]))&&(e[i]=st(e[i],t[i],r))}return(0,at.default)("object",e)&&(0,at.default)("object",t)&&Object.keys(t).forEach((a=>{e.hasOwnProperty(a)?(0,at.default)("object",e[a])&&(0,at.default)("object",t[a])&&(e[a]=st(e[a],t[a],r)):e[a]=r.copy?(0,rt.default)(t[a]):t[a]})),e};var ot=et.default=st,nt={exports:{}};!function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const a={},r="undefined"!=typeof window&&void 0!==window.document,i=!(void 0===s||!e.exports);t.default=function e(t,s,o={}){var n;const l=Object.assign(Object.assign({},a),o),{variant:u}=l,c=s&&"object"==typeof s&&Object.getPrototypeOf(s);switch(t){case"string":return"string"==typeof s;case"number":return"number"==typeof s&&!Number.isNaN(s);case"boolean":return"boolean"==typeof s;case"array":return Array.isArray(s);case"object":return"object"==typeof s&&!!s&&s.constructor===Object;case"object-like":return"object"==typeof s&&(null===s||s.constructor!==Object);case"class":return("object"==typeof s||"function"==typeof s)&&(/class/gi.test(String(s))||/class/gi.test(String(null==s?void 0:s.constructor)));case"function":return!!(s&&s instanceof Function);case"async":return!(!e("function",s)||!(r?"AsyncFunction"===s.constructor.name:s()instanceof Promise));case"map":return!(c!==Map.prototype);case"weakmap":return!(c!==WeakMap.prototype);case"set":return!(c!==Set.prototype);case"weakset":return!(c!==WeakSet.prototype);case"promise":return!(c!==Promise.prototype);case"int8array":return!(c!==Int8Array.prototype);case"uint8array":return!(c!==Uint8Array.prototype);case"uint8clampedarray":return!(c!==Uint8ClampedArray.prototype);case"int16array":return!(c!==Int16Array.prototype);case"uint16array":return!(c!==Uint16Array.prototype);case"int32array":return!(c!==Int32Array.prototype);case"uint32array":return!(c!==Uint32Array.prototype);case"float32array":return!(c!==Float32Array.prototype);case"float64array":return!(c!==Float64Array.prototype);case"bigint64array":return!(c!==BigInt64Array.prototype);case"biguint64array":return!(c!==BigUint64Array.prototype);case"typedarray":return e("int8array",s)||e("uint8array",s)||e("uint8clampedarray",s)||e("int16array",s)||e("uint16array",s)||e("int32array",s)||e("uint32array",s)||e("float32array",s)||e("float64array",s)||e("bigint64array",s)||e("biguint64array",s);case"dataview":return!(c!==DataView.prototype);case"arraybuffer":return!(c!==ArrayBuffer.prototype);case"sharedarraybuffer":return"undefined"!=typeof SharedArrayBuffer&&!(c!==SharedArrayBuffer.prototype);case"symbol":return!("symbol"!=typeof s);case"error":return!!(s&&s instanceof Error);case"date":return!!(s&&s instanceof Date);case"regexp":return!!(s&&s instanceof RegExp);case"arguments":return!(!s||"[object Arguments]"!==s.toString());case"null":return null===s;case"undefined":return void 0===s;case"blob":return r&&s instanceof Blob;case"buffer":return!(!i||"function"!=typeof(null===(n=null==s?void 0:s.constructor)||void 0===n?void 0:n.isBuffer)||!s.constructor.isBuffer(s));case"element":if(s)switch(u){case void 0:case"html":case"element":return r&&("object"==typeof HTMLElement?s instanceof HTMLElement:s&&"object"==typeof s&&null!==s&&1===s.nodeType&&"string"==typeof s.nodeName);case"node":return r&&("object"==typeof Node?s instanceof Node:s&&"object"==typeof s&&null!==s&&"number"==typeof s.nodeType&&"string"==typeof s.nodeName);case"react":return s.elementType||s.hasOwnProperty("$$typeof");default:return!1}return!1;case"simple":return e("string",s,l)||e("number",s,l)||e("boolean",s,l)||e("undefined",s,l)||e("null",s,l);case"not-array-object":return!e("array",s,l)&&!e("object",s,l);default:return!1}}}(nt,nt.exports);var lt=t(nt.exports),ut={};Object.defineProperty(ut,"__esModule",{value:!0});const ct=e=>{if((e=>Array.isArray(e))(e))return e.map((e=>ct(e)));if((e=>"object"==typeof e&&!!e&&e.constructor===Object)(e)){const t={};return Object.keys(e).forEach((a=>t[a]=ct(e[a]))),t}return e};var dt=ut.default=ct;const pt=()=>Math.floor((new Date).getTime()/1e3),ht={value:{copy:!1},add:{override:!0}};class ft{static meta=new WeakMap;static options_=ht;static get options(){return this.options_}static set options(e){this.options_={...this.options,...e}}static class(){for(var e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];return e=>{const[a,r]=t;this.add(a,r,e)}}static method(){for(var e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];return(e,a)=>{const r=e.constructor,[i,s]=t;this.add(i,s,r,a)}}static property(){for(var e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];return(e,a)=>{const r=e.constructor,[i,s]=t;this.add(i,s,r,a)}}static parameter(){for(var e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];return(e,a,r)=>{const i=e.constructor,[s]=t;this.add("amaui-meta-param:".concat(r),s,i,a)}}static add(e,t,a,r){if(!lt("simple",a)){const i=this.options.value.copy?dt(t):t;let s=this.meta.get(a);if(s||(s=new Map,this.meta.set(a,s)),void 0!==r){let a=s.get(r);if(a||(a=new Map,s.set(r,a)),!a.has(e)||this.options.add.override)return a.set(e,{value:this.options.value.copy?dt(t):t,added_at:pt()}),i}else if(!s.has(e)||this.options.add.override)return s.set(e,{value:this.options.value.copy?dt(t):t,added_at:pt()}),i}}static update(e,t,a,r){if(!lt("simple",a)){const i=this.options.value.copy?dt(t):t;let s=this.meta.get(a);if(s||(s=new Map,this.meta.set(a,s)),void 0!==r){let t=s.get(r);if(t||(t=new Map,s.set(r,t)),t.has(e)){const a=t.get(e);return a.value=i,a.updated_at=pt(),t.set(e,a),i}}else if(s.has(e)){const t=s.get(e);return t.value=i,t.updated_at=pt(),s.set(e,t),i}}}static values(e,t){if(!lt("simple",e)){const a=this.meta.get(e);if(!a)return;if(void 0!==t){const e=a.get(t);return e&&Array.from(e.values())}return a&&Array.from(a.values()).map((e=>e.value))}}static keys(e,t){if(!lt("simple",e)){const a=this.meta.get(e);if(!a)return;if(void 0!==t){const e=a.get(t);return e&&Array.from(e.keys())}return a&&Array.from(a.keys())}}static get(e,t,a){if(!lt("simple",t)){const r=this.meta.get(t);if(!r)return;if(void 0!==a){const t=r.get(a);if(!t)return;if(!t.has(e))return;return this.options.value.copy?dt(t.get(e).value):t.get(e).value}if(!r.has(e))return;return this.options.value.copy?dt(r.get(e).value):r.get(e).value}}static has(e,t,a){if(!lt("simple",t)){const r=this.meta.get(t);if(!r)return!1;if(void 0!==a){const t=r.get(a);return!!t&&t.has(e)}return r.has(e)}}static remove(e,t,a){if(!lt("simple",t)){const r=this.meta.get(t);if(!r)return;if(void 0!==a){const t=r.get(a);if(!t)return;t.delete(e)}else r.delete(e)}}static reset(){this.meta=new WeakMap,this.options=ht}}var mt=ft;var vt=class{make(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{element:{},data:{}},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"style";if(Me("browser")){const a=window.document.createElement(t);return Object.keys((null==e?void 0:e.element)||{}).forEach((t=>a.setAttribute(t,e.element[t]))),Object.keys((null==e?void 0:e.data)||{}).forEach((t=>{a[t]=e.data[t],a.setAttribute(0===t.indexOf("data-")?t:"data-".concat(t),e.data[t])})),a}}add(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"lower",a=arguments.length>2?arguments[2]:void 0;if(Me("browser")){const s=window.document.styleSheets;if(s.length&&"upper"!==t){var r,i;const o=Array.from(s).find((e=>"reset"===e.ownerNode.method));let n=Array.from(s).filter((e=>"pure"===e.ownerNode.method));n=n[n.length-1],"reset"===(null==a||null===(r=a.data)||void 0===r?void 0:r.method)||"lower"===t&&!n&&!o?window.document.head.insertBefore(e,(null===(i=s[0])||void 0===i?void 0:i.ownerNode)||null):"lower"===t?n?window.document.head.insertBefore(e,n.ownerNode.nextElementSibling):o&&window.document.head.insertBefore(e,o.ownerNode.nextElementSibling):window.document.head.append(e)}else window.document.head.append(e);return e}}remove(e){var t;let a=e;null!=e&&e.ownerNode&&(a=a.ownerNode),null!==(t=a)&&void 0!==t&&t.remove&&a.remove()}};const yt={mode:"regular",rule:{sort:!0,prefix:!0,rtl:!1},minify:!0,optimize:!1,classNamePrefix:""};class gt{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:je(yt);C(this,"mode","regular"),C(this,"subscriptions",{className:{pre:new ne,name:new ne,post:new ne},keyframes:{pre:new ne,name:new ne,post:new ne},rule:{pre:new ne,unit:new ne,value:new ne,prefix:new ne,rtl:new ne,add:new ne,update:new ne,update_props:new ne,remove:new ne,post:new ne},rules:{sort:new ne},sheet:{add:new ne,update:new ne,update_props:new ne,remove:new ne},sheet_manager:{add:new ne,update:new ne,update_props:new ne,remove:new ne}}),C(this,"values",{css:""}),C(this,"refs",{}),C(this,"sheets",[]),C(this,"sheet_managers",[]),this.options=e,this.options=ot(e,yt,{copy:!0}),this.init()}get response(){return this.values.css="",this.sheets.forEach((e=>{const t=e.css;t&&(this.values.css+=t)})),this.values.css&&(this.values.css="\n".concat(this.values.css,"\n")),this.options.minify&&(this.values.css=Se(this.values.css)),this.values}get css(){return this.response.css}get plugins(){const e=this;return{set add(t){(pe("array",t)?t:[t]).filter((t=>pe("object",t)&&pe("function",t.method)&&!mt.get(t.method,e,"plugin")||pe("function",t)&&!mt.get(t,e,"plugin"))).forEach((t=>{try{const a=pe("function",t)?t:t.method,r=pe("object",t)?t.arguments:[],i=a(e,...r);mt.add(a,i,e,"plugin")}catch(e){console.error("AmauiStyle use: ",e)}}))},set remove(t){(pe("array",t)?t:[t]).filter((t=>pe("object",t)&&pe("function",t.method)&&!mt.get(t.method,e,"plugin")||pe("function",t)&&!mt.get(t,e,"plugin"))).forEach((t=>{try{const a=pe("function",t)?t:t.method,r=mt.get(a,e,"plugin");pe("function",null==r?void 0:r.remove)&&r.remove()}catch(e){console.error("AmauiStyle remove plugin: ",e)}}))}}}init(){if(this.element=this.options.element||this.element,this.mode=this.options.mode||"regular",this.renderer=this.options.renderer||new vt,void 0===this.id&&(this.id=xe()),Me("browser")){this.element||(this.element=window.document.body),this.element.setAttribute("data-amaui-style","true"),this.element["amaui-style"]=!0,this.element.amaui_style=this;const e=Ge((()=>window.getComputedStyle(this.element)));this.direction=(null==e?void 0:e.direction)||Ge((()=>window.getComputedStyle(document.documentElement).direction))||"ltr",this.options.rule.rtl="rtl"===this.direction}}static get(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const a=this.all(e);return a[-1===t?a.length-1:t]}static first(e){return this.get(e)}static last(e){return this.get(e,-1)}static nearest(e){var t;return null===(t=Ye(e).nearest(this.attributes.map((e=>"[".concat(e,"]")))))||void 0===t?void 0:t.amaui_style}static furthest(e){var t;return null===(t=Ye(e).furthest(this.attributes.map((e=>"[".concat(e,"]")))))||void 0===t?void 0:t.amaui_style}static all(e){return[e,...Ye(e).parents(this.attributes.map((e=>"[".concat(e,"]"))))].filter(Boolean).map((e=>e.amaui_style)).filter(Boolean)||[]}}C(gt,"counter",{className:0,keyframesName:0}),C(gt,"attributes",["data-amaui-style","amaui-style"]);var bt=gt,wt={},xt={exports:{}},St={exports:{}};!function(e,t){var a;e.exports=(a=a||function(e,t){var a;if("undefined"!=typeof window&&window.crypto&&(a=window.crypto),"undefined"!=typeof self&&self.crypto&&(a=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(a=globalThis.crypto),!a&&"undefined"!=typeof window&&window.msCrypto&&(a=window.msCrypto),!a&&void 0!==s&&s.crypto&&(a=s.crypto),!a)try{a=require("crypto")}catch(e){}var r=function(){if(a){if("function"==typeof a.getRandomValues)try{return a.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof a.randomBytes)try{return a.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},i=Object.create||function(){function e(){}return function(t){var a;return e.prototype=t,a=new e,e.prototype=null,a}}(),o={},n=o.lib={},l=n.Base={extend:function(e){var t=i(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},u=n.WordArray=l.extend({init:function(e,a){e=this.words=e||[],this.sigBytes=a!=t?a:4*e.length},toString:function(e){return(e||d).stringify(this)},concat:function(e){var t=this.words,a=e.words,r=this.sigBytes,i=e.sigBytes;if(this.clamp(),r%4)for(var s=0;s<i;s++){var o=a[s>>>2]>>>24-s%4*8&255;t[r+s>>>2]|=o<<24-(r+s)%4*8}else for(var n=0;n<i;n+=4)t[r+n>>>2]=a[n>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,a=this.sigBytes;t[a>>>2]&=4294967295<<32-a%4*8,t.length=e.ceil(a/4)},clone:function(){var e=l.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],a=0;a<e;a+=4)t.push(r());return new u.init(t,e)}}),c=o.enc={},d=c.Hex={stringify:function(e){for(var t=e.words,a=e.sigBytes,r=[],i=0;i<a;i++){var s=t[i>>>2]>>>24-i%4*8&255;r.push((s>>>4).toString(16)),r.push((15&s).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,a=[],r=0;r<t;r+=2)a[r>>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new u.init(a,t/2)}},p=c.Latin1={stringify:function(e){for(var t=e.words,a=e.sigBytes,r=[],i=0;i<a;i++){var s=t[i>>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(s))}return r.join("")},parse:function(e){for(var t=e.length,a=[],r=0;r<t;r++)a[r>>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new u.init(a,t)}},h=c.Utf8={stringify:function(e){try{return decodeURIComponent(escape(p.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return p.parse(unescape(encodeURIComponent(e)))}},f=n.BufferedBlockAlgorithm=l.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=h.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var a,r=this._data,i=r.words,s=r.sigBytes,o=this.blockSize,n=s/(4*o),l=(n=t?e.ceil(n):e.max((0|n)-this._minBufferSize,0))*o,c=e.min(4*l,s);if(l){for(var d=0;d<l;d+=o)this._doProcessBlock(i,d);a=i.splice(0,l),r.sigBytes-=c}return new u.init(a,c)},clone:function(){var e=l.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});n.Hasher=f.extend({cfg:l.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){f.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,a){return new e.init(a).finalize(t)}},_createHmacHelper:function(e){return function(t,a){return new m.HMAC.init(e,a).finalize(t)}}});var m=o.algo={};return o}(Math),a)}(St),function(e,t){var a;e.exports=(a=St.exports,function(e){var t=a,r=t.lib,i=r.WordArray,s=r.Hasher,o=t.algo,n=[],l=[];!function(){function t(t){for(var a=e.sqrt(t),r=2;r<=a;r++)if(!(t%r))return!1;return!0}function a(e){return 4294967296*(e-(0|e))|0}for(var r=2,i=0;i<64;)t(r)&&(i<8&&(n[i]=a(e.pow(r,.5))),l[i]=a(e.pow(r,1/3)),i++),r++}();var u=[],c=o.SHA256=s.extend({_doReset:function(){this._hash=new i.init(n.slice(0))},_doProcessBlock:function(e,t){for(var a=this._hash.words,r=a[0],i=a[1],s=a[2],o=a[3],n=a[4],c=a[5],d=a[6],p=a[7],h=0;h<64;h++){if(h<16)u[h]=0|e[t+h];else{var f=u[h-15],m=(f<<25|f>>>7)^(f<<14|f>>>18)^f>>>3,v=u[h-2],y=(v<<15|v>>>17)^(v<<13|v>>>19)^v>>>10;u[h]=m+u[h-7]+y+u[h-16]}var g=r&i^r&s^i&s,b=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),w=p+((n<<26|n>>>6)^(n<<21|n>>>11)^(n<<7|n>>>25))+(n&c^~n&d)+l[h]+u[h];p=d,d=c,c=n,n=o+w|0,o=s,s=i,i=r,r=w+(b+g)|0}a[0]=a[0]+r|0,a[1]=a[1]+i|0,a[2]=a[2]+s|0,a[3]=a[3]+o|0,a[4]=a[4]+n|0,a[5]=a[5]+c|0,a[6]=a[6]+d|0,a[7]=a[7]+p|0},_doFinalize:function(){var t=this._data,a=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;return a[i>>>5]|=128<<24-i%32,a[14+(i+64>>>9<<4)]=e.floor(r/4294967296),a[15+(i+64>>>9<<4)]=r,t.sigBytes=4*a.length,this._process(),this._hash},clone:function(){var e=s.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=s._createHelper(c),t.HmacSHA256=s._createHmacHelper(c)}(Math),a.SHA256)}(xt);var _t={},kt=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_t,"__esModule",{value:!0});const jt=kt(o.exports),At=(e,t)=>{let a=t(e);if(void 0===a)return"";try{(0,jt.default)("object-like",a)&&(0,jt.default)("not-array-object",a)&&null!==a&&(a=Object.assign({},a))}catch(e){}return(0,jt.default)("object",a)?`{${Object.keys(a).sort().map((e=>`"${e}":${At(a[e],t)}`)).filter((e=>":"!==e.slice(-1))).join(",")}}`:(0,jt.default)("array",a)?`[${a.map((e=>At(e,t))).filter(Boolean).join(",")}]`:(0,jt.default)("string",a)?`"${a}"`:(e=>(0,jt.default)("string",e)?e.replace(/(\s|\r|\n)+/," "):e)(JSON.stringify((e=>void 0===e?"undefined":e instanceof Function||e instanceof Object?e.toString():e)(a)))};_t.default=e=>{const t=new WeakSet;return At(e,(e=>{if("object"==typeof e&&null!==e){if(t.has(e))return;t.add(e)}return e}))};var Ft=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(wt,"__esModule",{value:!0});const Et=Ft(xt.exports),Ot=Ft(_t),Mt={serialize:!0,withPrefix:!0};var Ct=wt.default=(e,t={})=>{const a=Object.assign(Object.assign({},Mt),t);let r=e;return a.serialize&&(r=(0,Ot.default)(r)),r=(0,Et.default)(r).toString(),a.withPrefix?`0x${r}`:r};const Nt={value_version:"value",pure:!1,parents:[],sort:!0,prefix:!0,rtl:!0};class Bt{constructor(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Nt;C(this,"value_version","value"),C(this,"pure",!1),C(this,"parents",[]),C(this,"values",{property:"",value:"",css:""}),this.value=e,this.property=t,this.options=a,this.init()}get parent(){return this.parents[this.parents.length-1]}get response(){return{css:this.values.css}}get css(){return this.response.css}updateValues(){this.values.css="".concat(this.values.property,": ").concat(this.values.value,";"),this.values.css.indexOf("undefined")>-1&&(this.values.css="")}init(e){var t,a,r,i;this.values.property=le(this.property),this.values.value=void 0!==e?e:this.value,this.value_version=this.options.value_version||"value",this.pure=void 0!==this.options.pure&&this.options.pure,this.owner=this.options.owner,this.parents=this.options.parents||[],this.amauiStyle=this.options.amauiStyle,this.amauiStyleSheet=this.options.amauiStyleSheet,this.amauiStyleRule=this.options.amauiStyleRule,void 0===this.id&&(this.id=xe()),void 0===this.level&&(this.level=this.parents.length-1),this.parents.filter((e=>!(e instanceof qt))).forEach((e=>e.rules_owned.push(this))),void 0===e&&["method","amaui_subscription"].indexOf(this.value_version)>-1&&("method"===this.value_version?this.values.value=Ge((()=>this.value(this.amauiStyleSheet.props))):"amaui_subscription"===this.value_version&&(this.values.value=this.value.value,this.value.subscribed||(this.value.subscribed=[]),-1===this.value.subscribed.indexOf(this)&&(this.value.subscribe(this.update.bind(this)),this.value.subscribed.push(this))),this.values.value=pe("function",this.values.value)?Ge((()=>this.values.value(this.amauiStyleSheet.props))):this.values.value),this.values.value=me(this.values.property,this.values.value,this.amauiStyle).value[0];if(this.amauiStyle.options.rule.rtl&&(void 0===this.amauiStyleSheet||!1!==this.amauiStyleSheet.options.rule.rtl)&&(void 0===(null===(t=this.amauiStyleSheet)||void 0===t?void 0:t.amauiTheme)||this.amauiStyleSheet.amauiTheme.options.rule.rtl)&&!1!==(null===(a=this.parent)||void 0===a?void 0:a.options.rtl)){const e=this.amauiStyle.subscriptions.rule.rtl.map(this.values);var s,o;if(null!=e&&e.value)null!=e&&null!==(s=e.value)&&void 0!==s&&s.property&&(this.values.property=e.value.property),null!=e&&null!==(o=e.value)&&void 0!==o&&o.value&&(this.values.value=e.value.value)}if(this.amauiStyle.options.rule.prefix&&(void 0===this.amauiStyleSheet||!1!==this.amauiStyleSheet.options.rule.prefix)&&(void 0===(null===(r=this.amauiStyleSheet)||void 0===r?void 0:r.amauiTheme)||!1!==this.amauiStyleSheet.amauiTheme.options.rule.prefix)&&!1!==(null===(i=this.parent)||void 0===i?void 0:i.options.prefix)&&0!==this.values.property.indexOf("-")&&Ge((()=>0!==this.values.value.indexOf("-")))){var n;const e=(null===(n=this.amauiStyle.subscriptions.rule.prefix.map({value:this.values.value,property:this.values.property}))||void 0===n?void 0:n.value)||[];e.length&&e.forEach((e=>{var t;!((null===(t=this.parent)||void 0===t?void 0:t.rules)||[]).find((t=>t instanceof Bt&&t.values.property===e.property&&t.values.value===e.value))&&this.parent&&Bt.make(e.value,e.property,{value_version:"value",pure:this.pure,owner:this.parent,parents:this.parents,amauiStyleRule:this.amauiStyleRule,amauiStyleSheet:this.parent.amauiStyleSheet,amauiStyle:this.parent.amauiStyle})}))}if(this.owner){this.owner.rules.find((e=>e.value.id===this.id))||this.owner.rules.push({property:this.property,value:this}),this.level_actual=this.owner.level_actual+1}this.updateValues()}update(e){var t;void 0!==e&&this.init(e),this.makeSelector(),void 0===e&&["method","amaui_subscription"].indexOf(this.value_version)>-1&&("method"===this.value_version?this.values.value=Ge((()=>this.value(this.amauiStyleSheet.props))):"amaui_subscription"===this.value_version&&(this.values.value=this.value.value),this.values.value=pe("function",this.values.value)?Ge((()=>this.values.value(this.amauiStyleSheet.props))):this.values.value,this.values.value=me(this.values.property,this.values.value,this.amauiStyle).value[0]),this.updateValues();const a=this.amauiStyleSheet.domElementForTesting||Me("browser")&&window.document.createElement("div");a&&(a.style[this.values.property]=this.values.value);const r=(null==a||null===(t=a.style)||void 0===t?void 0:t[this.values.property])||this.values.value;if(this.owner.rule&&this.owner.rule.style[this.values.property]!==r){var i;const e=this.owner.owner.rule||this.owner.owner.sheet;if(pe("string",this.values.value)&&null!==(i=this.values.value)&&void 0!==i&&i.includes("!important")){let t=Array.from((null==e?void 0:e.cssRules)||[]).findIndex((e=>e===this.owner.rule));t>-1&&(Ge((()=>e.deleteRule(t))),this.owner.updateValues(),t=Ge((()=>e.insertRule(this.owner.values.css))),t>-1&&(this.owner.rule=e.cssRules[t]))}else Ge((()=>this.owner.rule.style[this.values.property]=this.values.value));this.values.css="".concat(this.values.property,": ").concat(this.values.value,";")}}remove(){this.clear()}makeSelector(){if(["animation","animation-name"].some((e=>this.values.property.indexOf(e)>-1))){const e=fe(this.values.value),t=e.map((e=>this.amauiStyleSheet.amauiStyleSheetManager.names.keyframes[e])).filter(Boolean);e.forEach(((e,a)=>this.values.value=this.values.value.replace("$".concat(e),t[a]))),this.updateValues()}}clear(){var e;if(null!==(e=this.owner)&&void 0!==e&&e.rule&&(this.owner.rule.style[this.values.property]=""),this.owner){const e=this.owner.rules.findIndex((e=>e.value===this));e>-1&&this.owner.rules.splice(e,1)}this.parents.filter((e=>!(e instanceof qt))).forEach((e=>{const t=e.rules_owned.findIndex((e=>e.value===this));t>-1&&e.rules_owned.splice(t,1)}))}static make(e,t){return new Bt(e,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{value_version:"value",pure:!1,parents:[this]})}}var zt=Bt;function Dt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=[];const i=(e,t)=>{pe("string",e)&&e.length?r.push(e):pe("object",e)?Object.keys(e).forEach((t=>i(e[t],t))):pe("array",e)?e.forEach((e=>i(e))):t&&e&&r.push(t)};return i(e),r=r.filter(Boolean).map((e=>{let a=e.trim();return[".","#"].indexOf(a[0])>-1&&(a=a.slice(1)),"".concat(t||"").concat(a)})),r=w(r),a?r:r.join(" ")}const Rt={mode:"regular",value_version:"value",version:"property",pure:!1,index:0,sort:!0,prefix:!0,rtl:!0},Pt=M();class Tt{constructor(e,t){var a=this;let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Rt;C(this,"value_version","value"),C(this,"mode","regular"),C(this,"version","property"),C(this,"pure",!1),C(this,"index",0),C(this,"parents",[]),C(this,"status","idle"),C(this,"isVariable",!1),C(this,"static",!0),C(this,"rules_owned",[]),C(this,"className_",""),C(this,"selector_",""),C(this,"classNames_",""),C(this,"keyframesName_",""),C(this,"values",{value:void 0,css:""}),C(this,"rules",[]),C(this,"makeRuleClassNameDefault",(function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"a";return"".concat((null===(e=a.amauiStyle.options)||void 0===e?void 0:e.classNamePrefix)||"").concat(t,"-").concat(++a.counter.className)})),C(this,"makeRuleKeyframesNameDefault",(function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"a";return"".concat((null===(e=a.amauiStyle.options)||void 0===e?void 0:e.classNamePrefix)||"").concat(t,"-").concat(++a.counter.keyframesName)})),this.value=e,this.property=t,this.options=r,this.options={...Rt,...this.options},this.init()}get selector(){return this.selector_}set selector(e){this.selector_=e}get className(){return this.className_}set className(e){"at-rule"===this.parent.version||(this.className_=e,this.classNames.match(new RegExp("^(.)?".concat(this.className," | (.)?").concat(this.className," | (.)?").concat(this.className,"$"),"g"))||(this.classNames="".concat(this.className," ").concat(this.classNames).trim()),this.amauiStyleSheet.names.classNames[this.property]=this.className,"static"===this.amauiStyleSheet.version&&this.amauiStyleSheet.amauiStyleSheetManager&&(this.amauiStyleSheet.amauiStyleSheetManager.names.classNames[th