diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 5c5cc52..8955053 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -25,7 +25,6 @@ { "label": "dev-startup", "dependsOn": [ - "server", "vite" ], "problemMatcher": [] diff --git a/docs/assets/index-DTS3ifer.js b/docs/assets/index-CqaSrBDb.js similarity index 54% rename from docs/assets/index-DTS3ifer.js rename to docs/assets/index-CqaSrBDb.js index 9fd8140..b9b9a74 100644 --- a/docs/assets/index-DTS3ifer.js +++ b/docs/assets/index-CqaSrBDb.js @@ -1,4 +1,4 @@ -(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function t(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=t(o);fetch(o.href,i)}})();class st{parent;__hidden=!1;domEvents={};on(t,r,o){this.domEvents[t]||(this.domEvents[t]=new Map);const i=s=>r(s,this);return this.domEvents[t].set(r,i),this.dom.addEventListener(t,i,o),this}off(t,r,o){const i=this.domEvents[t]?.get(r);return i&&this.dom.removeEventListener(t,i,o),this}once(t,r,o){const i=s=>{this.dom.removeEventListener(t,i,o),r(s,this)};return this.dom.addEventListener(t,i,o),this}hide(t){return $.fluent(this,arguments,()=>this.__hidden,()=>{if(t!==void 0)return t instanceof lt?(this.__hidden=t.value,t.use(this,"hide")):this.__hidden=t,this.parent?.children.render(),this})}remove(){return this.parent?.children.remove(this).render(),this}replace(t){return this.parent?.children.replace(this,t).render(),this}contains(t){return t?t instanceof st?this.dom.contains(t.dom):t instanceof EventTarget?this.dom.contains($(t).dom):this.dom.contains(t):!1}self(t){return t(this),this}inDOM(){return document.contains(this.dom)}isElement(){if(this instanceof rt)return this}static from(t){if(t.$)return t.$;if(t instanceof HTMLElement){const r=$(t.tagName);return r.dom=t,t.parentElement&&(r.parent=$(t.parentElement)),r}else if(t instanceof Text){const r=new Bt(t.textContent??"");return r.dom=t,t.parentElement&&(r.parent=$(t.parentElement)),r}throw"$NODE.FROM: NOT SUPPORT TARGET ELEMENT TYPE"}}class rt extends st{dom;static_classes=new Set;constructor(t,r){super(),this.dom=document.createElement(t),this.dom.$=this,this.setOptions(r)}setOptions(t){return this.id(t?.id),t&&t.class&&this.class(...t.class),this}id(t){return $.fluent(this,arguments,()=>this.dom.id,()=>$.set(this.dom,"id",t))}class(...t){return $.fluent(this,arguments,()=>this.dom.classList,()=>{this.dom.classList.forEach(r=>this.static_classes.has(r)??this.dom.classList.remove(r)),this.dom.classList.add(...t.detype())})}addClass(...t){return $.fluent(this,arguments,()=>this,()=>{this.dom.classList.add(...t.detype())})}removeClass(...t){return $.fluent(this,arguments,()=>this,()=>{this.dom.classList.remove(...t.detype())})}staticClass(...t){return $.fluent(this,arguments,()=>this.static_classes,()=>{this.removeClass(...this.static_classes),this.static_classes.clear(),this.addStaticClass(...t)})}addStaticClass(...t){return $.fluent(this,arguments,()=>this,()=>{t.detype().forEach(r=>this.static_classes.add(r)),this.addClass(...t)})}removeStaticClass(...t){return $.fluent(this,arguments,()=>this,()=>{t.detype().forEach(r=>this.static_classes.delete(r)),this.removeClass(...t)})}css(t){return $.fluent(this,arguments,()=>this.dom.style,()=>{Object.assign(this.dom.style,t)})}attribute(t,r){return arguments.length?arguments.length===1?t===void 0?null:this.dom.getAttribute(t):arguments.length===2?(t&&r&&this.dom.setAttribute(t,`${r}`),this):this:null}autocapitalize(t){return $.fluent(this,arguments,()=>this.dom.autocapitalize,()=>$.set(this.dom,"autocapitalize",t))}dir(t){return $.fluent(this,arguments,()=>this.dom.dir,()=>$.set(this.dom,"dir",t))}innerText(t){return $.fluent(this,arguments,()=>this.dom.innerText,()=>$.set(this.dom,"innerText",t))}title(t){return $.fluent(this,arguments,()=>this.dom.title,()=>$.set(this.dom,"title",t))}translate(t){return $.fluent(this,arguments,()=>this.dom.translate,()=>$.set(this.dom,"translate",t))}popover(t){return $.fluent(this,arguments,()=>this.dom.popover,()=>$.set(this.dom,"popover",t))}spellcheck(t){return $.fluent(this,arguments,()=>this.dom.spellcheck,()=>$.set(this.dom,"spellcheck",t))}inert(t){return $.fluent(this,arguments,()=>this.dom.inert,()=>$.set(this.dom,"inert",t))}lang(t){return $.fluent(this,arguments,()=>this.dom.lang,()=>$.set(this.dom,"lang",t))}draggable(t){return $.fluent(this,arguments,()=>this.dom.draggable,()=>$.set(this.dom,"draggable",t))}hidden(t){return $.fluent(this,arguments,()=>this.dom.hidden,()=>$.set(this.dom,"hidden",t))}tabIndex(t){return $.fluent(this,arguments,()=>this.dom.tabIndex,()=>$.set(this.dom,"tabIndex",t))}click(){return this.dom.click(),this}attachInternals(){return this.dom.attachInternals()}hidePopover(){return this.dom.hidePopover(),this}showPopover(){return this.dom.showPopover(),this}togglePopover(){return this.dom.togglePopover(),this}focus(){return this.dom.focus(),this}blur(){return this.dom.blur(),this}animate(t,r,o){const i=this.dom.animate(t,r);return o&&o(i),this}getAnimations(t){return this.dom.getAnimations(t)}get accessKeyLabel(){return this.dom.accessKeyLabel}get offsetHeight(){return this.dom.offsetHeight}get offsetLeft(){return this.dom.offsetLeft}get offsetParent(){return $(this.dom.offsetParent)}get offsetTop(){return this.dom.offsetTop}get offsetWidth(){return this.dom.offsetWidth}get dataset(){return this.dom.dataset}}class Bt extends st{dom;constructor(t){super(),this.dom=new Text(t),this.dom.$=this}content(t){return $.fluent(this,arguments,()=>this.dom.textContent,()=>$.set(this.dom,"textContent",t))}}class fe{#t;elementList=new Set;constructor(t){this.#t=t}add(t){if(typeof t=="string"){const r=new Bt(t);r.parent=this.#t,this.elementList.add(r)}else t.parent=this.#t,this.elementList.add(t)}remove(t){return this.elementList.has(t)?(this.elementList.delete(t),t.parent=void 0,this):this}removeAll(t=!0){this.elementList.forEach(r=>this.remove(r)),t&&this.render()}replace(t,r){const o=this.array.map(i=>i===t?r:i);return this.elementList.clear(),o.forEach(i=>this.elementList.add(i)),t.parent=void 0,r.parent=this.#t,this}render(){const[t,r]=[this.array.map(i=>i.dom),Array.from(this.dom.childNodes)],o=[];for(;r.length||t.length;){const[i,s]=[r.at(0),t.at(0)];s?i?s!==i?(s.$.__hidden||(this.dom.insertBefore(s,i),o.push(s)),t.shift()):(s.$.__hidden&&this.dom.removeChild(s),t.shift(),r.shift()):(s.$.__hidden||this.dom.append(s),t.shift()):(i&&!o.includes(i)&&i.remove(),r.shift())}}get array(){return[...this.elementList.values()]}get dom(){return this.#t.dom}}class lt{value;attributes=new Map;constructor(t){this.value=t}set(t){this.value=t;for(const[r,o]of this.attributes.entries())for(const i of o)r[i]instanceof Function&&r[i](t)}toString(){return`${this.value}`}use(t,r){const o=this.attributes.get(t);o?o.add(r):this.attributes.set(t,new Set().add(r))}}class R extends rt{children=new fe(this);constructor(t,r){super(t,r)}content(t){return $.fluent(this,arguments,()=>this,()=>{this.children.removeAll(!1),this.insert(t)})}insert(t){return $.fluent(this,arguments,()=>this,()=>{t instanceof Function&&(t=t(this)),t=$.multableResolve(t);for(const r of t)if(r!==void 0)if(r instanceof Array)this.insert(r);else if(r instanceof lt){const o=new Bt(r.toString());r.use(o,"content"),this.children.add(o)}else this.children.add(r);this.children.render()})}clear(){return this.children.removeAll(),this}$(t){return $(this.dom.querySelector(t))}$all(t){return Array.from(this.dom.querySelectorAll(t)).map(r=>$(r))}}class Ht extends R{constructor(t){super("a",t),this.dom.addEventListener("click",r=>{$.anchorPreventDefault&&r.preventDefault(),$.anchorHandler&&this.href()&&$.anchorHandler(this.href(),r)})}href(t){return $.fluent(this,arguments,()=>this.dom.href,()=>{t&&(this.dom.href=t)})}target(t){return $.fluent(this,arguments,()=>this.dom.target,()=>{t&&(this.dom.target=t)})}}var kt;(e=>{function t(n,a,h,d){return a.length?(d(),n):h()}e.fluent=t;function r(n){return n instanceof Array?n:[n]}e.multableResolve=r;function o(n,a){return r(a).forEach(h=>{Object.getOwnPropertyNames(h.prototype).forEach(d=>{d!=="constructor"&&Object.defineProperty(n.prototype,d,Object.getOwnPropertyDescriptor(h.prototype,d)||Object.create(null))})}),n}e.mixin=o;function i(n,a,h){h!==void 0&&(n[a]=h)}e.set=i;function s(n){return new lt(n)}e.state=s})(kt||(kt={}));class It extends R{constructor(t){super("form",t)}autocomplete(t){return $.fluent(this,arguments,()=>this.dom.autocomplete,()=>$.set(this.dom,"autocomplete",t))}action(t){return $.fluent(this,arguments,()=>this.dom.formAction,()=>$.set(this.dom,"formAction",t))}enctype(t){return $.fluent(this,arguments,()=>this.dom.formEnctype,()=>$.set(this.dom,"formEnctype",t))}method(t){return $.fluent(this,arguments,()=>this.dom.formMethod,()=>$.set(this.dom,"formMethod",t))}noValidate(t){return $.fluent(this,arguments,()=>this.dom.formNoValidate,()=>$.set(this.dom,"formNoValidate",t))}acceptCharset(t){return $.fluent(this,arguments,()=>this.dom.acceptCharset,()=>$.set(this.dom,"acceptCharset",t))}target(t){return $.fluent(this,arguments,()=>this.dom.formTarget,()=>$.set(this.dom,"formTarget",t))}requestSubmit(){return this.dom.requestSubmit(),this}reset(){return this.dom.reset(),this}submit(){return this.dom.submit(),this}checkValidity(){return this.dom.checkValidity()}reportValidity(){return this.dom.reportValidity()}get length(){return this.dom.length}get elements(){return Array.from(this.dom.elements).map(t=>$(t))}}function Jt(e){return kt.mixin(e,xe)}class xe{formAction(t){return $.fluent(this,arguments,()=>this.dom.formAction,()=>$.set(this.dom,"formAction",t))}formEnctype(t){return $.fluent(this,arguments,()=>this.dom.formEnctype,()=>$.set(this.dom,"formEnctype",t))}formMethod(t){return $.fluent(this,arguments,()=>this.dom.formMethod,()=>$.set(this.dom,"formMethod",t))}formNoValidate(t){return $.fluent(this,arguments,()=>this.dom.formNoValidate,()=>$.set(this.dom,"formNoValidate",t))}formTarget(t){return $.fluent(this,arguments,()=>this.dom.formTarget,()=>$.set(this.dom,"formTarget",t))}name(t){return $.fluent(this,arguments,()=>this.dom.name,()=>$.set(this.dom,"name",t))}value(t){return $.fluent(this,arguments,()=>this.dom.value,()=>$.set(this.dom,"value",t))}get form(){return this.dom.form?$(this.dom.form):null}get labels(){return Array.from(this.dom.labels??[]).map(t=>$(t))}get validationMessage(){return this.dom.validationMessage}get validity(){return this.dom.validity}get willValidate(){return this.dom.willValidate}}var $e=Object.defineProperty,ye=Object.getOwnPropertyDescriptor,Le=(e,t,r,o)=>{for(var i=o>1?void 0:o?ye(t,r):t,s=e.length-1,n;s>=0;s--)(n=e[s])&&(i=(o?n(t,r,i):n(i))||i);return o&&i&&$e(t,r,i),i};let ut=class extends R{constructor(e){super("button",e)}disabled(e){return $.fluent(this,arguments,()=>this.dom.disabled,()=>$.set(this.dom,"disabled",e))}type(e){return $.fluent(this,arguments,()=>this.dom.type,()=>$.set(this.dom,"type",e))}checkValidity(){return this.dom.checkValidity()}reportValidity(){return this.dom.reportValidity()}};ut=Le([Jt],ut);var Re=Object.defineProperty,Ce=Object.getOwnPropertyDescriptor,Ae=(e,t,r,o)=>{for(var i=o>1?void 0:o?Ce(t,r):t,s=e.length-1,n;s>=0;s--)(n=e[s])&&(i=(o?n(t,r,i):n(i))||i);return o&&i&&Re(t,r,i),i};let ct=class extends rt{constructor(e){super("input",e)}accept(...e){return $.fluent(this,arguments,()=>this.dom.accept.split(","),()=>this.dom.accept=e.toString())}capture(e){return $.fluent(this,arguments,()=>this.dom.capture,()=>$.set(this.dom,"capture",e))}alt(e){return $.fluent(this,arguments,()=>this.dom.alt,()=>$.set(this.dom,"alt",e))}height(e){return $.fluent(this,arguments,()=>this.dom.height,()=>$.set(this.dom,"height",e))}width(e){return $.fluent(this,arguments,()=>this.dom.width,()=>$.set(this.dom,"width",e))}checked(e){return $.fluent(this,arguments,()=>this.dom.checked,()=>$.set(this.dom,"checked",e))}max(e){return $.fluent(this,arguments,()=>this.dom.max===""?null:parseInt(this.dom.min),()=>$.set(this.dom,"max",e?.toString()))}min(e){return $.fluent(this,arguments,()=>this.dom.min===""?null:parseInt(this.dom.min),()=>$.set(this.dom,"min",e?.toString()))}maxLength(e){return $.fluent(this,arguments,()=>this.dom.maxLength,()=>$.set(this.dom,"maxLength",e))}minLength(e){return $.fluent(this,arguments,()=>this.dom.minLength,()=>$.set(this.dom,"minLength",e))}autocomplete(e){return $.fluent(this,arguments,()=>this.dom.autocomplete,()=>$.set(this.dom,"autocomplete",e))}defaultValue(e){return $.fluent(this,arguments,()=>this.dom.defaultValue,()=>$.set(this.dom,"defaultValue",e))}defaultChecked(e){return $.fluent(this,arguments,()=>this.dom.defaultChecked,()=>$.set(this.dom,"defaultChecked",e))}dirName(e){return $.fluent(this,arguments,()=>this.dom.dirName,()=>$.set(this.dom,"dirName",e))}disabled(e){return $.fluent(this,arguments,()=>this.dom.disabled,()=>$.set(this.dom,"disabled",e))}multiple(e){return $.fluent(this,arguments,()=>this.dom.multiple,()=>$.set(this.dom,"multiple",e))}pattern(e){return $.fluent(this,arguments,()=>this.dom.pattern,()=>$.set(this.dom,"pattern",e))}placeholder(e){return $.fluent(this,arguments,()=>this.dom.placeholder,()=>$.set(this.dom,"placeholder",e))}readOnly(e){return $.fluent(this,arguments,()=>this.dom.readOnly,()=>$.set(this.dom,"readOnly",e))}required(e){return $.fluent(this,arguments,()=>this.dom.required,()=>$.set(this.dom,"required",e))}selectionDirection(e){return $.fluent(this,arguments,()=>this.dom.selectionDirection,()=>$.set(this.dom,"selectionDirection",e))}selectionEnd(e){return $.fluent(this,arguments,()=>this.dom.selectionEnd,()=>$.set(this.dom,"selectionEnd",e))}selectionStart(e){return $.fluent(this,arguments,()=>this.dom.selectionStart,()=>$.set(this.dom,"selectionStart",e))}size(e){return $.fluent(this,arguments,()=>this.dom.size,()=>$.set(this.dom,"size",e))}src(e){return $.fluent(this,arguments,()=>this.dom.src,()=>$.set(this.dom,"src",e))}step(e){return $.fluent(this,arguments,()=>Number(this.dom.step),()=>$.set(this.dom,"step",e?.toString()))}type(e){return $.fluent(this,arguments,()=>this.dom.type,()=>$.set(this.dom,"type",e))}inputMode(e){return $.fluent(this,arguments,()=>this.dom.inputMode,()=>$.set(this.dom,"inputMode",e))}valueAsDate(e){return $.fluent(this,arguments,()=>this.dom.valueAsDate,()=>$.set(this.dom,"valueAsDate",e))}valueAsNumber(e){return $.fluent(this,arguments,()=>this.dom.valueAsNumber,()=>$.set(this.dom,"valueAsNumber",e))}webkitdirectory(e){return $.fluent(this,arguments,()=>this.dom.webkitdirectory,()=>$.set(this.dom,"webkitdirectory",e))}select(){return this.dom.select(),this}setCustomValidity(e){return this.dom.setCustomValidity(e),this}setRangeText(e,t,r,o){return typeof t=="number"&&typeof r=="number"&&this.dom.setRangeText(e,t,r,o),this.dom.setRangeText(e),this}setSelectionRange(e,t,r){return this.dom.setSelectionRange(e,t,r),this}showPicker(){return this.dom.showPicker(),this}stepDown(){return this.dom.stepDown(),this}stepUp(){return this.dom.stepUp(),this}checkValidity(){return this.dom.checkValidity()}reportValidity(){return this.dom.reportValidity()}get files(){return this.dom.files}get webkitEntries(){return this.dom.webkitEntries}};ct=Ae([Jt],ct);class Dt extends R{constructor(t){super("label",t)}for(t){return $.fluent(this,arguments,()=>this.dom.htmlFor,()=>{$.set(this.dom,"htmlFor",t,"for")})}get form(){return this.dom.form}get control(){return this.dom.control}}class Ot extends rt{constructor(t){super("img",t)}alt(t){return $.fluent(this,arguments,()=>this.dom.alt,()=>$.set(this.dom,"alt",t))}crossOrigin(t){return $.fluent(this,arguments,()=>this.dom.crossOrigin,()=>$.set(this.dom,"crossOrigin",t))}decoding(t){return $.fluent(this,arguments,()=>this.dom.decoding,()=>$.set(this.dom,"decoding",t))}height(t){return $.fluent(this,arguments,()=>this.dom.height,()=>$.set(this.dom,"height",t))}isMap(t){return $.fluent(this,arguments,()=>this.dom.isMap,()=>$.set(this.dom,"isMap",t))}loading(t){return $.fluent(this,arguments,()=>this.dom.loading,()=>$.set(this.dom,"loading",t))}referrerPolicy(t){return $.fluent(this,arguments,()=>this.dom.referrerPolicy,()=>$.set(this.dom,"referrerPolicy",t))}sizes(t){return $.fluent(this,arguments,()=>this.dom.sizes,()=>$.set(this.dom,"sizes",t))}src(t){return $.fluent(this,arguments,()=>this.dom.src,()=>$.set(this.dom,"src",t))}srcset(t){return $.fluent(this,arguments,()=>this.dom.srcset,()=>$.set(this.dom,"srcset",t))}useMap(t){return $.fluent(this,arguments,()=>this.dom.useMap,()=>$.set(this.dom,"useMap",t))}width(t){return $.fluent(this,arguments,()=>this.dom.width,()=>$.set(this.dom,"width",t))}decode(){return this.dom.decode()}get complete(){return this.dom.complete}get currentSrc(){return this.dom.currentSrc}get naturalHeight(){return this.dom.naturalHeight}get naturalWidth(){return this.dom.naturalWidth}get x(){return this.dom.x}get y(){return this.dom.y}}class Gt extends R{constructor(t){super("canvas",t)}height(t){return $.fluent(this,arguments,()=>this.dom.height,()=>{$.set(this.dom,"height",t)})}width(t){return $.fluent(this,arguments,()=>this.dom.width,()=>{$.set(this.dom,"width",t)})}captureStream(t){return this.dom.captureStream(t)}getContext(t,r){return this.dom.getContext(t)}toBlob(t,r,o){return this.dom.toBlob(t,r,o),this}toDataURL(t,r){return this.dom.toDataURL(t,r)}transferControlToOffscreen(){return this.dom.transferControlToOffscreen()}}class Wt extends R{constructor(t){super("dialog",t)}open(t){return $.fluent(this,arguments,()=>this.dom.open,()=>$.set(this.dom,"open",t))}returnValue(t){return $.fluent(this,arguments,()=>this.dom.returnValue,()=>$.set(this.dom,"returnValue",t))}close(){return this.dom.close(),this}show(){return this.dom.show(),this}showModal(){return this.dom.showModal(),this}}function ae(e){return $.mixin(e,Ee)}class Ee{on(t,r){return this.events.on(t,r),this}off(t,r){return this.events.off(t,r),this}once(t,r){return this.events.once(t,r),this}}class Zt{eventMap=new Map;register(...t){return t.forEach(r=>{const o=new re(r);this.eventMap.set(o.name,o)}),this}delete(t){return this.eventMap.delete(t),this}fire(t,...r){const o=this.get(t);return o instanceof re&&o.fire(...r),this}on(t,r){return this.get(t).add(r),this}off(t,r){return this.get(t).delete(r),this}once(t,r){const o=(...i)=>{this.get(t).delete(o),r(...i)};return this.get(t).add(o),this}get(t){const r=this.eventMap.get(t);if(!r)throw new Error("EVENT NOT EXIST");return r}}class re{name;callbackList=new Set;constructor(t){this.name=t}fire(...t){this.callbackList.forEach(r=>r(...t))}add(t){this.callbackList.add(t)}delete(t){this.callbackList.delete(t)}}class Ct extends R{view_cache=new Map;event=new Zt().register("switch");content_id=null;constructor(t){super("view",t)}setView(t,r){return this.view_cache.set(t,r),this}deleteView(t){return this.view_cache.delete(t),this}deleteAllView(){return this.view_cache.clear(),this}switchView(t){const r=this.view_cache.get(t);if(r===void 0)throw"$View.switch(): target content is undefined";return this.content(r),this.content_id=t,this.event.fire("switch",t),this}}var Be=Object.defineProperty,ve=Object.getOwnPropertyDescriptor,Se=(e,t,r,o)=>{for(var i=o>1?void 0:o?ve(t,r):t,s=e.length-1,n;s>=0;s--)(n=e[s])&&(i=(o?n(t,r,i):n(i))||i);return o&&i&&Be(t,r,i),i};let pt=class extends R{constructor(){super("select")}add(e){return this.insert(e),this}item(e){return $(this.dom.item(e))}namedItem(e){return $(this.dom.namedItem(e))}disabled(e){return $.fluent(this,arguments,()=>this.dom.disabled,()=>$.set(this.dom,"disabled",e))}multiple(e){return $.fluent(this,arguments,()=>this.dom.multiple,()=>$.set(this.dom,"multiple",e))}required(e){return $.fluent(this,arguments,()=>this.dom.required,()=>$.set(this.dom,"required",e))}autocomplete(e){return $.fluent(this,arguments,()=>this.dom.autocomplete,()=>$.set(this.dom,"autocomplete",e))}get length(){return this.dom.length}get size(){return this.dom.size}get options(){return Array.from(this.dom.options).map(e=>$(e))}get selectedIndex(){return this.dom.selectedIndex}get selectedOptions(){return Array.from(this.dom.selectedOptions).map(e=>$(e))}};pt=Se([Jt],pt);class Nt extends R{constructor(t){super("option",t)}defaultSelected(t){return $.fluent(this,arguments,()=>this.dom.defaultSelected,()=>$.set(this.dom,"defaultSelected",t))}disabled(t){return $.fluent(this,arguments,()=>this.dom.disabled,()=>$.set(this.dom,"disabled",t))}label(t){return $.fluent(this,arguments,()=>this.dom.label,()=>$.set(this.dom,"label",t))}selected(t){return $.fluent(this,arguments,()=>this.dom.selected,()=>$.set(this.dom,"selected",t))}text(t){return $.fluent(this,arguments,()=>this.dom.text,()=>$.set(this.dom,"text",t))}value(t){return $.fluent(this,arguments,()=>this.dom.value,()=>$.set(this.dom,"value",t))}get form(){return this.dom.form?$(this.dom.form):null}get index(){return this.dom.index}}class _t extends R{constructor(t){super("optgroup",t)}disabled(t){return $.fluent(this,arguments,()=>this.dom.disabled,()=>$.set(this.dom,"disabled",t))}label(t){return $.fluent(this,arguments,()=>this.dom.label,()=>$.set(this.dom,"label",t))}}class Pt extends R{constructor(t){super("textarea",t)}cols(t){return $.fluent(this,arguments,()=>this.dom.cols,()=>$.set(this.dom,"cols",t))}name(t){return $.fluent(this,arguments,()=>this.dom.name,()=>$.set(this.dom,"name",t))}wrap(t){return $.fluent(this,arguments,()=>this.dom.wrap,()=>$.set(this.dom,"wrap",t))}value(t){return $.fluent(this,arguments,()=>this.dom.value,()=>$.set(this.dom,"value",t))}maxLength(t){return $.fluent(this,arguments,()=>this.dom.maxLength,()=>$.set(this.dom,"maxLength",t))}minLength(t){return $.fluent(this,arguments,()=>this.dom.minLength,()=>$.set(this.dom,"minLength",t))}autocomplete(t){return $.fluent(this,arguments,()=>this.dom.autocomplete,()=>$.set(this.dom,"autocomplete",t))}defaultValue(t){return $.fluent(this,arguments,()=>this.dom.defaultValue,()=>$.set(this.dom,"defaultValue",t))}dirName(t){return $.fluent(this,arguments,()=>this.dom.dirName,()=>$.set(this.dom,"dirName",t))}disabled(t){return $.fluent(this,arguments,()=>this.dom.disabled,()=>$.set(this.dom,"disabled",t))}placeholder(t){return $.fluent(this,arguments,()=>this.dom.placeholder,()=>$.set(this.dom,"placeholder",t))}readOnly(t){return $.fluent(this,arguments,()=>this.dom.readOnly,()=>$.set(this.dom,"readOnly",t))}required(t){return $.fluent(this,arguments,()=>this.dom.required,()=>$.set(this.dom,"required",t))}selectionDirection(t){return $.fluent(this,arguments,()=>this.dom.selectionDirection,()=>$.set(this.dom,"selectionDirection",t))}selectionEnd(t){return $.fluent(this,arguments,()=>this.dom.selectionEnd,()=>$.set(this.dom,"selectionEnd",t))}selectionStart(t){return $.fluent(this,arguments,()=>this.dom.selectionStart,()=>$.set(this.dom,"selectionStart",t))}type(t){return $.fluent(this,arguments,()=>this.dom.type,()=>$.set(this.dom,"type",t))}inputMode(t){return $.fluent(this,arguments,()=>this.dom.inputMode,()=>$.set(this.dom,"inputMode",t))}select(){return this.dom.select(),this}setCustomValidity(t){return this.dom.setCustomValidity(t),this}setRangeText(t,r,o,i){return typeof r=="number"&&typeof o=="number"&&this.dom.setRangeText(t,r,o,i),this.dom.setRangeText(t),this}setSelectionRange(t,r,o){return this.dom.setSelectionRange(t,r,o),this}checkValidity(){return this.dom.checkValidity()}reportValidity(){return this.dom.reportValidity()}get validationMessage(){return this.dom.validationMessage}get validity(){return this.dom.validity}get form(){return this.dom.form?$(this.dom.form):null}get labels(){return Array.from(this.dom.labels??[]).map(t=>$(t))}}function b(e){if(typeof e>"u"||e===null)return e;if(typeof e=="string"){if(e.startsWith("::"))return Array.from(document.querySelectorAll(e.replace(/^::/,""))).map(t=>b(t));if(e.startsWith(":"))return b(document.querySelector(e.replace(/^:/,"")));if(e in b.TagNameElementMap)switch(b.TagNameElementMap[e]){case rt:return new rt(e);case Ht:return new Ht;case R:return new R(e);case ct:return new ct;case Dt:return new Dt;case It:return new It;case ut:return new ut;case Ot:return new Ot;case Gt:return new Gt;case Wt:return new Wt;case Ct:return new Ct;case pt:return new pt;case Nt:return new Nt;case _t:return new _t;case Pt:return new Pt}else return new R(e)}if(e instanceof HTMLElement||e instanceof Text)return e.$?e.$:st.from(e);throw"$: NOT SUPPORT TARGET ELEMENT TYPE"}(e=>{e.anchorHandler=null,e.anchorPreventDefault=!1,e.body=document.body,e.routers=new Set,e.TagNameElementMap={a:Ht,p:R,pre:R,code:R,blockquote:R,strong:R,h1:R,h2:R,h3:R,h4:R,h5:R,h6:R,div:R,ol:R,ul:R,dl:R,li:R,input:ct,label:Dt,button:ut,form:It,img:Ot,dialog:Wt,canvas:Gt,view:Ct,select:pt,option:Nt,optgroup:_t,textarea:Pt};function t(d,m,l,c){return m.length?(c(),d):l()}e.fluent=t;function r(d){return d instanceof Array?d:[d]}e.multableResolve=r;function o(d,m){return r(m).forEach(l=>{Object.getOwnPropertyNames(l.prototype).forEach(c=>{c!=="constructor"&&Object.defineProperty(d.prototype,c,Object.getOwnPropertyDescriptor(l.prototype,c)||Object.create(null))})}),d}e.mixin=o;function i(d,m,l,c){if(l!==void 0){if(l instanceof lt&&d instanceof Node){l.use(d.$,c??m),d[m]=l.value;return}d[m]=l}}e.set=i;function s(d){return new lt(d)}e.state=s;async function n(d,m){return new Promise(l=>{const c=new FileReader;c.onload=g=>{const L=e("img");if(L.once("load",T=>{const A=e("canvas"),W=A.getContext("2d"),_=L.height()/L.width(),[V,P]=[_>1?m/_:m,_>1?m:m*_];A.height(P).width(V),W?.drawImage(L.dom,0,0,V,P),l(A.toDataURL(d.type))}),!g.target)throw"$.resize(): e.target is null";L.src(g.target.result)},c.readAsDataURL(d)})}e.resize=n;function a(d=1){return parseInt(getComputedStyle(document.documentElement).fontSize)*d}e.rem=a;function h(d,m,l){if(typeof m=="number")return Array(m).fill("").map(g=>{const L=c(d)?d[0](...d.slice(1)):e(d);return l&&l(L),L});{const g=[];for(const L of m){const T=d instanceof Function?d(...L):c(d)?d[0](...d.slice(1)):e(d);L instanceof Function?L(T):(L instanceof st||typeof L=="string")&&T.content(L),g.push(T)}return g}function c(g){return g instanceof Array&&g[0]instanceof Function}}e.builder=h})(b||(b={}));globalThis.$=b;var Te=Object.defineProperty,Fe=Object.getOwnPropertyDescriptor,we=(e,t,r,o)=>{for(var i=o>1?void 0:o?Fe(t,r):t,s=e.length-1,n;s>=0;s--)(n=e[s])&&(i=(o?n(t,r,i):n(i))||i);return o&&i&&Te(t,r,i),i};let Yt=class{id;content;events=new Zt().register("open","load");constructor(e){this.id=e}};Yt=we([ae],Yt);var Me=Object.defineProperty,He=Object.getOwnPropertyDescriptor,ke=(e,t,r,o)=>{for(var i=o>1?void 0:o?He(t,r):t,s=e.length-1,n;s>=0;s--)(n=e[s])&&(i=(o?n(t,r,i):n(i))||i);return o&&i&&Me(t,r,i),i};let oe=class{routeMap=new Map;recordMap=new Map;$view;index=0;events=new Zt().register("pathchange","notfound","load");basePath;constructor(e,t){this.basePath=e,this.$view=t??new Ct}addRoute(e){e=$.multableResolve(e);for(const t of e)this.routeMap.set(t.path,t);return this}listen(){if(!history.state||!("index"in history.state)){const e={index:this.index,data:{}};history.replaceState(e,"")}else this.index=history.state.index;return addEventListener("popstate",this.popstate),$.routers.add(this),this.resolvePath(),this.events.fire("pathchange",{path:location.href,navigation:"Forward"}),this}open(e){if(e===void 0)return;if(e===location.href)return this;this.index+=1;const t={index:this.index,data:{}};return history.pushState(t,"",e),$.routers.forEach(r=>r.resolvePath()),this.events.fire("pathchange",{path:e,navigation:"Forward"}),this}back(){return history.back(),this}replace(e){return history.replaceState({index:this.index},"",e),$.routers.forEach(t=>t.resolvePath(e)),this.events.fire("pathchange",{path:e,navigation:"Forward"}),this}setStateData(e,t){return history.state.data===void 0&&(history.state.data={}),history.state.data[e]=t,this}popstate=(()=>{history.state.index>this.index||history.state.index{const s=this.recordMap.get(i);return s?(t=!0,s.content&&!this.$view.contains(s.content)&&this.$view.switchView(i),s.events.fire("open",{path:e,record:s}),!0):!1},o=(i,s,n)=>{const a=new Yt(i);let h=s.builder({params:n,record:a,loaded:()=>{a.events.fire("load",{path:i,record:a}),this.events.fire("load",{path:i})}});typeof h=="string"&&(h=new Bt(h)),a.content=h,this.recordMap.set(i,a),this.$view.setView(i,h).switchView(i),a.events.fire("open",{path:e,record:a}),t=!0};for(const[i,s]of this.routeMap.entries()){if(i instanceof Function){const m=i(e);m&&(r(m)||o(m,s,void 0));continue}const[n,a]=[i.split("/").map(m=>`/${m}`),e.split("/").map(m=>`/${m}`)];n.shift(),a.shift();const h={};let d="";for(let m=0;mi=!0;this.events.fire("notfound",{path:e,preventDefault:s}),i||this.$view.clear()}}};oe=ke([ae],oe);Array.prototype.detype=function(...e){return this.filter(t=>{if(e.length)for(const r of e)return typeof t==typeof r;else return t!==void 0})};class Qt extends R{$value=$("input").class("value");$unit=$("span").staticClass("unit");$label=$("label").hide(!0);constructor(t){super("div"),this.staticClass("input-component",t),this.$value.id(t),this.$label.for(t)}unit(t){return this.$unit.content(t),this}value(t){return t===void 0?this:(this.$value.value(t.toString()),this)}label(t){return t&&this.$label.hide(!1),this.$label.content(t),this}min(t){return this.$value.min(t),this}max(t){return this.$value.max(t),this}}class Rt extends Qt{$color=$("input").type("color").class("color");constructor(t){super(t),this.addStaticClass("color"),this.$color.id(t),this.layout()}layout(){this.content([this.$label,$("div").content([this.$value,this.$color])]),this.$value.on("input",t=>this.$color.value(this.$value.value())),this.$color.on("input",t=>this.$value.value(this.$color.value()))}value(t){return super.value(t),this.$color.value(t),this}}class Y extends Qt{$range=$("input").type("range").class("range");constructor(t){super(t),this.addStaticClass("range"),this.$range.id(t),this.$value,this.layout()}layout(){this.content([this.$label,$("div").content([this.$value,this.$range,this.$unit])]),this.$range.on("input",t=>{this.$value.value(`${this.$range.value()}`)}),this.$value.on("input",t=>{this.$range.value(this.$value.value())})}value(t){return arguments.length?t===void 0?this:(t.match(/[a-zA-Z]/)&&(t=t.replaceAll(/[a-zA-Z]/g,"")),super.value(t),this.$range.value(t),this):this.$value.value()}min(t){return super.min(t),this.$range.min(t),this}max(t){return super.max(t),this.$range.max(t),this}}class ie extends Qt{$select=$("select");constructor(t){super(t),this.addStaticClass("select"),this.$select.id(t),this.layout()}layout(){this.content([this.$label,this.$select])}add(t){return this.$select.add(t),this}value(t){return super.value(t),this.$select.value(t),this}}var x,j,E,At;(function(e){e.HEX="HEX",e.RGB="RGB",e.HSL="HSL",e.CIELab="CIELab",e.CMYK="CMYK"})(x||(x={})),function(e){e.ANALOGOUS="ANALOGOUS",e.COMPLEMENTARY="COMPLEMENTARY",e.SPLIT_COMPLEMENTARY="SPLIT_COMPLEMENTARY",e.TRIADIC="TRIADIC",e.TETRADIC="TETRADIC",e.SQUARE="SQUARE"}(j||(j={})),function(e){e.ADDITIVE="ADDITIVE",e.SUBTRACTIVE="SUBTRACTIVE"}(E||(E={})),function(e){e.black="#000000",e.silver="#C0C0C0",e.gray="#808080",e.white="#FFFFFF",e.maroon="#800000",e.red="#FF0000",e.purple="#800080",e.fuchsia="#FF00FF",e.green="#008000",e.lime="#00FF00",e.olive="#808000",e.yellow="#FFFF00",e.navy="#000080",e.blue="#0000FF",e.teal="#008080",e.aqua="#00FFFF",e.orange="#FFA500",e.aliceblue="#F0F8FF",e.antiquewhite="#FAEBD7",e.aquamarine="#7FFFD4",e.azure="#F0FFFF",e.beige="#F5F5DC",e.bisque="#FFE4C4",e.blanchedalmond="#FFEBCD",e.blueviolet="#8A2BE2",e.brown="#A52A2A",e.burlywood="#DEB887",e.cadetblue="#5F9EA0",e.chartreuse="#7FFF00",e.chocolate="#D2691E",e.coral="#FF7F50",e.cornflowerblue="#6495ED",e.cornsilk="#FFF8DC",e.crimson="#DC143C",e.cyan="#00FFFF",e.darkblue="#00008B",e.darkcyan="#008B8B",e.darkgoldenrod="#B8860B",e.darkgray="#A9A9A9",e.darkgreen="#006400",e.darkgrey="#A9A9A9",e.darkkhaki="#BDB76B",e.darkmagenta="#8B008B",e.darkolivegreen="#556B2F",e.darkorange="#FF8C00",e.darkorchid="#9932CC",e.darkred="#8B0000",e.darksalmon="#E9967A",e.darkseagreen="#8FBC8F",e.darkslateblue="#483D8B",e.darkslategray="#2F4F4F",e.darkslategrey="#2F4F4F",e.darkturquoise="#00CED1",e.darkviolet="#9400D3",e.deeppink="#FF1493",e.deepskyblue="#00BFFF",e.dimgray="#696969",e.dimgrey="#696969",e.dodgerblue="#1E90FF",e.firebrick="#B22222",e.floralwhite="#FFFAF0",e.forestgreen="#228B22",e.gainsboro="#DCDCDC",e.ghostwhite="#F8F8FF",e.gold="#FFD700",e.goldenrod="#DAA520",e.greenyellow="#ADFF2F",e.grey="#808080",e.honeydew="#F0FFF0",e.hotpink="#FF69B4",e.indianred="#CD5C5C",e.indigo="#4B0082",e.ivory="#FFFFF0",e.khaki="#F0E68C",e.lavender="#E6E6FA",e.lavenderblush="#FFF0F5",e.lawngreen="#7CFC00",e.lemonchiffon="#FFFACD",e.lightblue="#ADD8E6",e.lightcoral="#F08080",e.lightcyan="#E0FFFF",e.lightgoldenrodyellow="#FAFAD2",e.lightgray="#D3D3D3",e.lightgreen="#90EE90",e.lightgrey="#D3D3D3",e.lightpink="#FFB6C1",e.lightsalmon="#FFA07A",e.lightseagreen="#20B2AA",e.lightskyblue="#87CEFA",e.lightslategray="#778899",e.lightslategrey="#778899",e.lightsteelblue="#B0C4DE",e.lightyellow="#FFFFE0",e.limegreen="#32CD32",e.linen="#FAF0E6",e.magenta="#FF00FF",e.mediumaquamarine="#66CDAA",e.mediumblue="#0000CD",e.mediumorchid="#BA55D3",e.mediumpurple="#9370DB",e.mediumseagreen="#3CB371",e.mediumslateblue="#7B68EE",e.mediumspringgreen="#00FA9A",e.mediumturquoise="#48D1CC",e.mediumvioletred="#C71585",e.midnightblue="#191970",e.mintcream="#F5FFFA",e.mistyrose="#FFE4E1",e.moccasin="#FFE4B5",e.navajowhite="#FFDEAD",e.oldlace="#FDF5E6",e.olivedrab="#6B8E23",e.orangered="#FF4500",e.orchid="#DA70D6",e.palegoldenrod="#EEE8AA",e.palegreen="#98FB98",e.paleturquoise="#AFEEEE",e.palevioletred="#DB7093",e.papayawhip="#FFEFD5",e.peachpuff="#FFDAB9",e.peru="#CD853F",e.pink="#FFC0CB",e.plum="#DDA0DD",e.powderblue="#B0E0E6",e.rosybrown="#BC8F8F",e.royalblue="#4169E1",e.saddlebrown="#8B4513",e.salmon="#FA8072",e.sandybrown="#F4A460",e.seagreen="#2E8B57",e.seashell="#FFF5EE",e.sienna="#A0522D",e.skyblue="#87CEEB",e.slateblue="#6A5ACD",e.slategray="#708090",e.slategrey="#708090",e.snow="#FFFAFA",e.springgreen="#00FF7F",e.steelblue="#4682B4",e.tan="#D2B48C",e.thistle="#D8BFD8",e.tomato="#FF6347",e.turquoise="#40E0D0",e.violet="#EE82EE",e.wheat="#F5DEB3",e.whitesmoke="#F5F5F5",e.yellowgreen="#9ACD32",e.rebeccapurple="#663399"}(At||(At={}));const de=Object.keys(At),Ie={HEX:["R","G","B","A"],RGB:["R","G","B","A"],HSL:["H","S","L","A"],CIELab:["L","a","b","A"],CMYK:["C","M","Y","K","A"]},jt={BGR:x.RGB,ABGR:x.RGB,HLS:x.HSL,AHLS:x.HSL,LAB:x.CIELab,ALAB:x.CIELab,CKMY:x.CMYK,ACKMY:x.CMYK};var ht;(function(e){e.NUMBER="number",e.BOOLEAN="boolean"})(ht||(ht={}));const O={[x.HEX]:/^#(?:([a-f\d])([a-f\d])([a-f\d])([a-f\d])?|([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?)$/i,[x.RGB]:/^rgba?\s*\(\s*(?:((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)(?:\s*,\s*((?:\d*\.)?\d+))?|((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)(?:\s*\/\s*((?:\d*\.)?\d+%?))?)\s*\)$/,[x.HSL]:/^hsla?\s*\(\s*(?:(-?(?:\d*\.)?\d+(?:deg|grad|rad|turn)?)\s*,\s*((?:\d*\.)?\d+)%\s*,\s*((?:\d*\.)?\d+)%(?:\s*,\s*((?:\d*\.)?\d+))?|(-?(?:\d*\.)?\d+(?:deg|grad|rad|turn)?)\s*((?:\d*\.)?\d+)%\s*((?:\d*\.)?\d+)%(?:\s*\/\s*((?:\d*\.)?\d+%?))?)\s*\)$/,[x.CIELab]:/^lab\s*\(\s*(?:((?:\d*\.)?\d+%?)\s*(-?(?:\d*\.)?\d+%?)\s*(-?(?:\d*\.)?\d+%?)(?:\s*\/\s*((?:\d*\.)?\d+%?))?)\s*\)$/,[x.CMYK]:/^(?:device-cmyk|cmyk)\s*\(\s*(?:((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)(?:\s*,\s*((?:\d*\.)?\d+))?|((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)(?:\s*\/\s*((?:\d*\.)?\d+%?))?)\s*\)$/},he=/^(-?(?:\d*\.)?\d+)((?:deg|grad|rad|turn)?)$/,S=/^(-?\d+(?:\.\d+)?|-?\.\d+)%$/,Vt=/^0x([a-f\d]{1,2})$/i,De=/\{(\d+)\}/g,Oe=/,( +|\d+)/g,Ge=/ +/,We="The provided string color doesn't have a correct format",Ne="The provided color object doesn't have the proper keys or format";var D,I,mt;(function(e){e.NONE="none",e.DEGREES="deg",e.GRADIANS="grad",e.RADIANS="rad",e.TURNS="turn"})(D||(D={})),function(e){e.NONE="none",e.PERCENT="percent"}(I||(I={})),function(e){e.DEVICE_CMYK="device-cmyk",e.CMYK="cmyk"}(mt||(mt={}));const X={decimals:6,legacyCSS:!1,spacesAfterCommas:!1,anglesUnit:D.NONE,rgbUnit:I.NONE,labUnit:I.NONE,cmykUnit:I.PERCENT,alphaUnit:I.NONE,cmykFunction:mt.DEVICE_CMYK},H=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),bt=e=>+`${e}`.replace(S,"$1"),q=e=>S.test(`${e}`)?bt(e):Math.min(+e,100),ft=e=>(e.length===1&&(e+=e),parseInt(e,16)),xt=e=>{const t=p(e,0).toString(16).toUpperCase();return t.length===1?`0x0${t}`:`0x${t}`},z=(e,t=!1)=>!t&&S.test(e)?Math.min(255*bt(e)/100,255):Vt.test(e)?(e.length===3&&(e+=e.slice(-1)),t?p(e)/255:p(e)):Math.min(+e,t?1:255),Et=e=>S.test(e)?w(125*bt(e)/100,-125,125):w(+e,-125,125),U=e=>Math.min(S.test(e)?bt(e)/100:+e,1),le=e=>[...e].sort().join("").toUpperCase(),p=(e,t=6)=>{const r=Math.pow(10,t);return Math.round(+e*r)/r},w=(e,t,r)=>Math.max(t,Math.min(e,r)),gt=e=>{if(typeof e=="string"){const t=e.match(he),r=+t[1];switch(t[2]){case D.RADIANS:e=p(180*r/Math.PI);break;case D.TURNS:e=p(360*r);break;case D.GRADIANS:e=p(.9*r);break;case D.DEGREES:default:e=r}}return(e>360||e<0)&&(e-=360*Math.floor(e/360)),e},_e=(e,t)=>{let r;switch(t){case D.RADIANS:r=p((o=>o*Math.PI/180)(e));break;case D.TURNS:r=p(e/360);break;case D.GRADIANS:r=p(10/9*e);break;case D.DEGREES:case D.NONE:default:r=e}return r},y=(e,...t)=>{const r=[],o=[],i=[],s=[],n=[],a=[],h=Object.values(D),d=Object.values(I),m=Object.values(mt),l={legacyCSS:0,spacesAfterCommas:0,cmykFunction:0};for(const c of t)if(typeof c=="string"){if(r.push(c),c.includes(",")){l.legacyCSS++;const g=c.match(Oe);new Set(g).size===1&&Ge.test(g[0].slice(1))&&l.spacesAfterCommas++}if(c.match(O.HSL)){const g=c.match(O.HSL),L=g[1]||g[5],T=g[8],A=L.match(he)[2];o.push(A===""?D.NONE:A),a.push(S.test(T));continue}if(O.RGB.test(c)){const g=c.match(O.RGB),L=g[1]||g[5],T=g[2]||g[6],A=g[3]||g[7],W=g[8];i.push(S.test(L)&&S.test(T)&&S.test(A)),a.push(S.test(W));continue}if(O.CIELab.test(c)){const g=c.match(O.CIELab),L=g[1],T=g[2],A=g[3],W=g[4];s.push(S.test(L)&&S.test(T)&&S.test(A)),a.push(S.test(W));continue}if(c.match(O.CMYK)){const g=c.match(O.CMYK),L=g[1]||g[6],T=g[2]||g[7],A=g[3]||g[8],W=g[4]||g[9],_=g[10];n.push(S.test(L)&&S.test(T)&&S.test(A)&&S.test(W)),c.startsWith("cmyk")&&l.cmykFunction++,a.push(S.test(_))}}return{decimals:typeof e.decimals===ht.NUMBER?e.decimals:X.decimals,legacyCSS:typeof e.legacyCSS===ht.BOOLEAN?e.legacyCSS:!!(r.length&&l.legacyCSS===r.length)||X.legacyCSS,spacesAfterCommas:typeof e.spacesAfterCommas===ht.BOOLEAN?e.spacesAfterCommas:!!(r.length&&l.spacesAfterCommas===r.length)||X.spacesAfterCommas,anglesUnit:e.anglesUnit&&h.includes(e.anglesUnit)?e.anglesUnit:new Set(o).size===1?o[0]:X.anglesUnit,rgbUnit:e.rgbUnit&&d.includes(e.rgbUnit)?e.rgbUnit:new Set(i).size===1&&i[0]?I.PERCENT:X.rgbUnit,labUnit:e.labUnit&&d.includes(e.labUnit)?e.labUnit:new Set(s).size===1&&s[0]?I.PERCENT:X.labUnit,cmykUnit:e.cmykUnit&&d.includes(e.cmykUnit)?e.cmykUnit:new Set(n).size!==1||n[0]?X.cmykUnit:I.NONE,alphaUnit:e.alphaUnit&&d.includes(e.alphaUnit)?e.alphaUnit:new Set(a).size===1&&a[0]?I.PERCENT:X.alphaUnit,cmykFunction:e.cmykFunction&&m.includes(e.cmykFunction)?e.cmykFunction:n.length&&n.length===l.cmykFunction?mt.CMYK:X.cmykFunction}},St=e=>`${e}`in E,ue=[[.4360747,.3850649,.1430804],[.2225045,.7168786,.0606169],[.0139322,.0971045,.7141733]],Pe=[[3.1338561,-1.6168667,-.4906146],[-.9787684,1.9161415,.033454],[.0719453,-.2289914,1.4052427]],tt=ue.map(e=>e.reduce((t,r)=>t+r,0)),Tt=(e,t,r)=>(r<0&&(r+=6),r>=6&&(r-=6),p(r<1?255*((t-e)*r+e):r<3?255*t:r<4?255*((t-e)*(4-r)+e):255*e)),Ye=e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4,je=e=>e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055,ce=(e,t,r,o)=>{const i=[0,0,0],s=[e,t,r];return o.forEach((n,a)=>{n.forEach((h,d)=>{i[a]+=h*s[d]})}),i},F=(e,t,r)=>{t/=100;const o=(r/=100)<=.5?r*(t+1):r+t-r*t,i=2*r-o;return{R:Tt(i,o,(e/=60)+2),G:Tt(i,o,e),B:Tt(i,o,e-2)}},ot=(e,t,r,o=1)=>{e/=255,t/=255,r/=255,o=Math.min(o,1);const i=Math.max(e,t,r),s=Math.min(e,t,r),n=i-s;let a=0,h=0;const d=(i+s)/2;if(n!==0){switch(i){case e:a=(t-r)/n%6;break;case t:a=(r-e)/n+2;break;case r:a=(e-t)/n+4}a=p(60*a),a<0&&(a+=360),h=n/(1-Math.abs(2*d-1))}return{H:a,S:p(100*h),L:p(100*d),A:o}},it=(e,t,r)=>{const o=[e/255,t/255,r/255].map(Ye),i=ce(o[0],o[1],o[2],ue),s=((n,a,h)=>{const d=c=>c>.008856451679035631?Math.cbrt(c):c/.12841854934601665+.13793103448275862,m=d(n/tt[0]),l=d(a/tt[1]);return[116*l-16,500*(m-l),200*(l-d(h/tt[2]))]})(i[0],i[1],i[2]);return{L:s[0],a:s[1],b:s[2]}},te=(e,t,r)=>{const o=((s,n,a)=>{const h=c=>c>.20689655172413793?c**3:.12841854934601665*(c-.13793103448275862),d=(s+16)/116,m=n/500,l=a/200;return[tt[0]*h(d+m),tt[1]*h(d),tt[2]*h(d-l)]})(e,t,r),i=ce(o[0],o[1],o[2],Pe).map(je);return{R:w(255*i[0],0,255),G:w(255*i[1],0,255),B:w(255*i[2],0,255)}},ee=(e,t,r,o)=>({R:p(255*(1-e)*(o=1-o)),G:p(255*(1-t)*o),B:p(255*(1-r)*o)}),pe=(e,t,r)=>{e/=255,t/=255,r/=255;const o=1-Math.max(e,t,r),i=1-o,s=i&&(i-t)/i,n=i&&(i-r)/i;return{C:p(100*(i&&(i-e)/i)),M:p(100*s),Y:p(100*n),K:p(100*o)}},se=(e,t)=>{if(e<0&&(e+=360),e>360&&(e-=360),e===360||e===0)return e;const r=[[0,120],[120,180],[180,240],[240,360]],o=[[0,60],[60,120],[120,240],[240,360]],i=t?o:r;let s=0,n=0,a=0,h=0;return(t?r:o).find((d,m)=>e>=d[0]&&ee?", ":",",at=(e,t)=>{const r=le(Object.keys(e));return Ie[jt[r]].reduce((o,i,s)=>{const n=e[i];return n!==void 0&&o.push(t(n,s)),o},[])},dt=(e,t)=>e.replace(De,(r,o)=>`${t[+o-1]}`),$t=(e,t,r=!1)=>{const{alphaUnit:o,legacyCSS:i,decimals:s}=t;return o!==I.PERCENT||i&&!r?p(e,s):`${p(100*e,s)}%`},f={[x.HEX]:e=>{const t=at(e,o=>(i=>{let s=p(i,0).toString(16).toUpperCase();return s.length===1&&(s=`0${s}`),s})(p(o))),r=t.length===4?"#{1}{2}{3}{4}":"#{1}{2}{3}";return dt(r,t)},[x.RGB]:(e,t)=>{const{decimals:r,legacyCSS:o,spacesAfterCommas:i,rgbUnit:s}=t,n=Ft(i),a=at(e,(d,m)=>s===I.PERCENT&&m<3?`${((l,c)=>p(l/255*100,c))(d,r)}%`:m===3?$t(d,t):p(d,r)),h=o?a.length===4?`rgba({1}${n}{2}${n}{3}${n}{4})`:`rgb({1}${n}{2}${n}{3})`:a.length===4?"rgb({1} {2} {3} / {4})":"rgb({1} {2} {3})";return dt(h,a)},[x.HSL]:(e,t)=>{const{decimals:r,legacyCSS:o,spacesAfterCommas:i,anglesUnit:s}=t,n=Ft(i),a=at(e,(d,m)=>m===0&&s!==D.NONE?`${p(_e(d,s),r)}${s}`:m===3?$t(d,t):p(d,r)),h=o?a.length===4?`hsla({1}${n}{2}%${n}{3}%${n}{4})`:`hsl({1}${n}{2}%${n}{3}%)`:a.length===4?"hsl({1} {2}% {3}% / {4})":"hsl({1} {2}% {3}%)";return dt(h,a)},[x.CIELab]:(e,t)=>{const{decimals:r,labUnit:o}=t,i=at(e,(n,a)=>{if(a===0){const h=p(q(n),r);return o===I.PERCENT?`${h}%`:`${h}`}return a<3?o===I.PERCENT?`${((h,d)=>p(h/125*100,d))(n,r)}%`:p(n,r):$t(n,t,!0)}),s=i.length===4?"lab({1} {2} {3} / {4})":"lab({1} {2} {3})";return dt(s,i)},[x.CMYK]:(e,t)=>{const{decimals:r,legacyCSS:o,spacesAfterCommas:i,cmykUnit:s,cmykFunction:n}=t,a=Ft(i),h=at(e,(m,l)=>s===I.PERCENT&&l<4?`${p(m,r)}%`:l===4?$t(m,t):p(m/100,r)),d=o?h.length===5?`${n}({1}${a}{2}${a}{3}${a}{4}${a}{5})`:`${n}({1}${a}{2}${a}{3}${a}{4})`:h.length===5?`${n}({1} {2} {3} {4} / {5})`:`${n}({1} {2} {3} {4})`;return dt(d,h)}},M=e=>(typeof e=="string"&&(e=S.test(e)?bt(e)/100:+e),isNaN(+e)||e>1?1:p(e)),nt=(e,t,r)=>t.reduce((o,i)=>[...o,{...e,H:r===E.ADDITIVE?gt(e.H+i):gt(se(se(e.H,!1)+i,!0))}],[{...e}]),Ve=(e,t)=>nt(e,[30,-30],t),Xe=(e,t)=>nt(e,[180],t),Ke=(e,t)=>nt(e,[150,-150],t),Ue=(e,t)=>nt(e,[120,-120],t),ze=(e,t)=>nt(e,[60,-120,180],t),qe=(e,t)=>nt(e,[90,-90,180],t),v=e=>typeof e=="string"?(t=>{let r;if(Object.keys(x).some(o=>{if(O[o].test(t))return r=o,!0}),!r&&~de.indexOf(t)&&(r=x.HEX),!r)throw new Error(We);return r})(e):(t=>{let r,o=!1;const i=le(Object.keys(t));if(jt[i]&&(r=jt[i]),r&&r===x.RGB){const s=Object.entries(t).some(a=>!Vt.test(`${a[1]}`)),n=Object.entries(t).some(a=>!(S.test(`${a[1]}`)||!Vt.test(`${a[1]}`)&&!isNaN(+a[1])&&+a[1]<=255));s&&n&&(o=!0),s||(r=x.HEX)}if(!r||o)throw new Error(Ne);return r})(e),Je={[x.HEX](e){const t=(~de.indexOf(e)?At[e]:e).match(O.HEX),r={R:ft(t[1]||t[5]),G:ft(t[2]||t[6]),B:ft(t[3]||t[7])},o=t[4]||t[8];return o!==void 0&&(r.A=ft(o)/255),r},[x.RGB](e){const t=e.match(O.RGB),r=z(t[1]||t[5]),o=z(t[2]||t[6]),i=z(t[3]||t[7]),s=t[4]||t[8],n={R:Math.min(r,255),G:Math.min(o,255),B:Math.min(i,255)};return s!==void 0&&(n.A=M(s)),n},[x.HSL](e){const t=e.match(O.HSL),r=gt(t[1]||t[5]),o=q(t[2]||t[6]),i=q(t[3]||t[7]),s=t[4]||t[8],n=F(r,o,i);return s!==void 0&&(n.A=M(s)),n},[x.CIELab](e){const t=e.match(O.CIELab),r=q(t[1]),o=Et(t[2]),i=Et(t[3]),s=t[4],n=te(r,o,i);return s!==void 0&&(n.A=M(s)),n},[x.CMYK](e){const t=e.match(O.CMYK),r=U(t[1]||t[6]),o=U(t[2]||t[7]),i=U(t[3]||t[8]),s=U(t[4]||t[9]),n=t[5]||t[10],a=ee(r,o,i,s);return n!==void 0&&(a.A=M(n)),a}},Ze={[x.HEX](e){const t={R:z(`${e.R}`),G:z(`${e.G}`),B:z(`${e.B}`)};return H(e,"A")&&(t.A=Math.min(z(`${e.A}`,!0),1)),t},[x.RGB](e){return this.HEX(e)},[x.HSL](e){const t=q(`${e.S}`),r=q(`${e.L}`),o=F(gt(e.H),t,r);return H(e,"A")&&(o.A=M(e.A)),o},[x.CIELab](e){const t=q(`${e.L}`),r=Et(`${e.a}`),o=Et(`${e.b}`),i=te(t,r,o);return H(e,"A")&&(i.A=M(e.A)),i},[x.CMYK](e){const t=U(`${e.C}`),r=U(`${e.M}`),o=U(`${e.Y}`),i=U(`${e.K}`),s=ee(t,r,o,i);return H(e,"A")&&(s.A=M(e.A)),s}},J=(e,t=v(e))=>typeof e=="string"?Je[t](e):Ze[t](e),u={[x.HEX]:e=>({R:xt(e.R),G:xt(e.G),B:xt(e.B)}),HEXA(e){const t=u.HEX(e);return t.A=H(e,"A")?xt(255*e.A):"0xFF",t},[x.RGB](e,t){const r=Qe(e,t);return H(r,"A")&&delete r.A,r},RGBA(e,t){const r=u.RGB(e,t);return r.A=H(e,"A")?p(e.A):1,r},[x.HSL](e,t){const r=ot(e.R,e.G,e.B);return delete r.A,Xt(r,t)},HSLA(e,t){const r=u.HSL(e,t);return r.A=H(e,"A")?p(e.A,t):1,r},[x.CIELab](e,t){const r=it(e.R,e.G,e.B);return tr(r,t)},CIELabA(e,t){const r=u.CIELab(e,t);return r.A=H(e,"A")?p(e.A,t):1,r},[x.CMYK]:(e,t)=>er(pe(e.R,e.G,e.B),t),CMYKA(e,t){const r=u.CMYK(e,t);return r.A=H(e,"A")?p(e.A,t):1,r}},yt=(e,t,r,o)=>{const i=v(e),s=typeof e=="string",n=J(e,i),a=typeof e=="string"&&H(n,"A")||typeof e!="string"&&H(e,"A"),h=ot(n.R,n.G,n.B,n.A);a||delete h.A;const d=r?h.L/(t+1):(100-h.L)/(t+1),m=Array(t).fill(null).map((l,c)=>({...h,L:h.L+d*(c+1)*(1-2*+r)}));switch(i){case x.HEX:default:return m.map(l=>{const c=F(l.H,l.S,l.L);return a&&(c.A=l.A),s?a?f.HEX({...c,A:p(255*c.A)}):f.HEX(c):a?u.HEXA(c):u.HEX(c)});case x.RGB:return m.map(l=>{const c=F(l.H,l.S,l.L);return a&&(c.A=l.A),s?f.RGB(c,o):a?u.RGBA(c,o.decimals):u.RGB(c,o.decimals)});case x.HSL:return m.map(l=>s?f.HSL(l,o):a?u.HSLA({...F(l.H,l.S,l.L),A:l.A},o.decimals):u.HSL(F(l.H,l.S,l.L),o.decimals));case x.CIELab:return m.map(l=>{const c=F(l.H,l.S,l.L);return s?f.CIELab(a?u.CIELabA(c,o.decimals):u.CIELab(c,o.decimals),o):a?u.CIELabA({...c,A:l.A},o.decimals):u.CIELab(c,o.decimals)})}},Q={buildHarmony(e,t,r,o){const i=v(e),s=J(e,i),n=ot(s.R,s.G,s.B,s.A),a=typeof e=="string"&&H(s,"A")||typeof e!="string"&&H(e,"A"),h=typeof e=="string";switch(i){case x.HEX:default:return a?this.HEXA(Xt(n,0),t,r,h):this.HEX(Xt(n,0),t,r,h);case x.HSL:return a?this.HSLA(n,t,r,h,o):this.HSL(n,t,r,h,o);case x.RGB:return a?this.RGBA(n,t,r,h,o):this.RGB(n,t,r,h,o);case x.CIELab:return a?this.CIELabA(n,t,r,h,o):this.CIELab(n,t,r,h,o)}},[x.HEX]:(e,t,r,o)=>t(e,r).map(i=>o?f.HEX(F(i.H,i.S,i.L)):u.HEX(F(i.H,i.S,i.L))),HEXA:(e,t,r,o)=>t(e,r).map(i=>o?f.HEX({...F(i.H,i.S,i.L),A:255*M(i.A)}):u.HEXA({...F(i.H,i.S,i.L),A:M(i.A)})),[x.RGB]:(e,t,r,o,i)=>t(e,r).map(s=>o?f.RGB(F(s.H,s.S,s.L),i):u.RGB(F(s.H,s.S,s.L),i.decimals)),RGBA:(e,t,r,o,i)=>t(e,r).map(s=>o?f.RGB({...F(s.H,s.S,s.L),A:M(s.A)},i):u.RGBA({...F(s.H,s.S,s.L),A:M(s.A)},i.decimals)),[x.HSL]:(e,t,r,o,i)=>t(e,r).map(s=>o?f.HSL({H:s.H,S:s.S,L:s.L},i):u.HSL(F(s.H,s.S,s.L),i.decimals)),HSLA:(e,t,r,o,i)=>t(e,r).map(s=>o?f.HSL({...s,A:M(s.A)},i):u.HSLA({...F(s.H,s.S,s.L),A:M(s.A)},i.decimals)),[x.CIELab]:(e,t,r,o,i)=>t(e,r).map(s=>{const n=F(s.H,s.S,s.L);return o?f.CIELab(it(n.R,n.G,n.B),i):u.CIELab(n,i.decimals)}),CIELabA:(e,t,r,o,i)=>t(e,r).map(s=>{const n=F(s.H,s.S,s.L);return o?f.CIELab({...it(n.R,n.G,n.B),A:M(s.A)},i):u.CIELabA({...n,A:M(s.A)},i.decimals)})},C={mix(e,t){const r=e.map(n=>{const a=v(n);return J(n,a)}),o=t===E.SUBTRACTIVE?r.map(n=>{const a=((h,d,m)=>{const l=Math.min(h,d,m),c=Math.min(255-h,255-d,255-m),g=h-l,L=d-l,T=m-l,A=Math.min(g,L),W=g-A,_=(L+A)/2,V=(T+L-A)/2,P=Math.max(W,_,V)/Math.max(g,L,T),vt=isNaN(P)||P===1/0||P<=0?1:P;return{R:W/vt+c,Y:_/vt+c,B:V/vt+c}})(n.R,n.G,n.B);return H(n,"A")&&(a.A=n.A),a}):null;function i(n){const a=t===E.ADDITIVE?{R:0,G:0,B:0,A:0}:{R:0,Y:0,B:0,A:0};return n.reduce((h,d)=>{const m=H(d,"A")?d.A:1,l={R:Math.min(h.R+d.R*m,255),B:Math.min(h.B+d.B*m,255),A:1-(1-m)*(1-h.A)},c="G"in h?h.G:h.Y,g="G"in d?d.G:d.Y;return{...l,...t===E.ADDITIVE?{G:Math.min(c+g*m,255)}:{Y:Math.min(c+g*m,255)}}},a)}let s;if(t===E.ADDITIVE)s=i(r);else{const n=i(o);s=((a,h,d)=>{const m=Math.min(a,h,d),l=Math.min(255-a,255-h,255-d),c=a-m,g=h-m,L=d-m,T=Math.min(g,L),A=c+g-T,W=g+T,_=2*(L-T),V=Math.max(A,W,_)/Math.max(c,g,L),P=isNaN(V)||V===1/0||V<=0?1:V;return{R:A/P+l,G:W/P+l,B:_/P+l}})(n.R,n.Y,n.B),s.A=n.A}return{R:p(s.R),G:p(s.G),B:p(s.B),A:w(s.A,0,1)}},[x.HEX](e,t,r){const o=this.mix(e,t);return delete o.A,r?f.HEX(o):u.HEX(o)},HEXA(e,t,r){const o=this.mix(e,t);return o.A=r?255*M(o.A):M(o.A),r?f.HEX(o):u.HEXA(o)},[x.RGB](e,t,r,o){const i=this.mix(e,t);return delete i.A,r?f.RGB(i,o):u.RGB(i,o.decimals)},RGBA(e,t,r,o){const i=this.mix(e,t);return r?f.RGB(i,o):u.RGBA(i,o.decimals)},[x.HSL](e,t,r,o){const i=this.mix(e,t),s=ot(i.R,i.G,i.B);return delete i.A,delete s.A,r?f.HSL(s,o):u.HSL(i,o.decimals)},HSLA(e,t,r,o){const i=this.mix(e,t),s=ot(i.R,i.G,i.B,i.A);return r?f.HSL(s,o):u.HSLA(i,o.decimals)},[x.CIELab](e,t,r,o){const i=this.mix(e,t),s=it(i.R,i.G,i.B);return delete i.A,r?f.CIELab(s,o):u.CIELabA(i,o.decimals)},CIELabA(e,t,r,o){const i=this.mix(e,t),s=it(i.R,i.G,i.B);return H(i,"A")&&(s.A=i.A),r?f.CIELab(s,o):u.CIELabA(i,o.decimals)}},Qe=(e,t)=>({R:p(e.R,t),G:p(e.G,t),B:p(e.B,t),...H(e,"A")?{A:p(e.A,t)}:{}}),Xt=(e,t)=>({H:p(e.H,t),S:p(e.S,t),L:p(e.L,t),...H(e,"A")?{A:p(e.A,t)}:{}}),tr=(e,t)=>({L:p(e.L,t),a:p(e.a,t),b:p(e.b,t)}),er=(e,t)=>({C:p(e.C,t),M:p(e.M,t),Y:p(e.Y,t),K:p(e.K,t)}),k=(e,t,r,o)=>o(J(e,t),r),B=(e,t,r,o,i)=>(r<1&&(r=5),((n,a,h)=>{const d=h-1,m=(a.R-n.R)/d,l=(a.G-n.G)/d,c=(a.B-n.B)/d,g=M(n.A),L=(M(a.A)-g)/d;return Array(h).fill(null).map((T,A)=>A===0?n:A===d?a:{R:p(n.R+m*A),G:p(n.G+l*A),B:p(n.B+c*A),A:p(g+L*A)})})(J(e),J(t),r).map(n=>i(n,o))),wt=(e,t,r,o)=>({[j.ANALOGOUS]:Q.buildHarmony(t,Ve,r,o),[j.COMPLEMENTARY]:Q.buildHarmony(t,Xe,r,o),[j.SPLIT_COMPLEMENTARY]:Q.buildHarmony(t,Ke,r,o),[j.TRIADIC]:Q.buildHarmony(t,Ue,r,o),[j.TETRADIC]:Q.buildHarmony(t,ze,r,o),[j.SQUARE]:Q.buildHarmony(t,qe,r,o)})[e];class N{constructor(t,r={}){this._options=y(r,t),this.rgb=J(t),this.updateHSL(),this.updateLab(),this.updateCMYK()}updateRGB(){this.rgb={...F(this.hsl.H,this.hsl.S,this.hsl.L),A:this.hsl.A}}updateRGBFromCMYK(){this.rgb={...ee(this.cmyk.C,this.cmyk.M,this.cmyk.Y,this.cmyk.K),A:this.rgb.A}}updateRGBFromLab(){this.rgb={...te(this.lab.L,this.lab.a,this.lab.b),A:this.rgb.A}}updateHSL(){this.hsl=ot(this.rgb.R,this.rgb.G,this.rgb.B,this.rgb.A)}updateLab(){this.lab={...it(this.rgb.R,this.rgb.G,this.rgb.B),A:this.rgb.A}}updateCMYK(){this.cmyk=pe(this.rgb.R,this.rgb.G,this.rgb.B)}setOptions(t={}){return this._options={...this._options,...t},this}setH(t){return this.hsl.H=gt(t),this.updateRGB(),this.updateLab(),this.updateCMYK(),this}setS(t){return this.hsl.S=w(t,0,100),this.updateRGB(),this.updateLab(),this.updateCMYK(),this}setL(t){return this.hsl.L=w(t,0,100),this.updateRGB(),this.updateLab(),this.updateCMYK(),this}setR(t){this.rgb.R=w(t,0,255),this.updateHSL(),this.updateLab(),this.updateCMYK()}setG(t){return this.rgb.G=w(t,0,255),this.updateHSL(),this.updateLab(),this.updateCMYK(),this}setB(t){return this.rgb.B=w(t,0,255),this.updateHSL(),this.updateLab(),this.updateCMYK(),this}setCIEL(t){return this.lab.L=w(t,0,100),this.updateRGBFromLab(),this.updateHSL(),this.updateCMYK(),this}setCIEa(t){return this.lab.a=w(t,-125,125),this.updateRGBFromLab(),this.updateHSL(),this.updateCMYK(),this}setCIEb(t){return this.lab.b=w(t,-125,125),this.updateRGBFromLab(),this.updateHSL(),this.updateCMYK(),this}setA(t){return this.hsl.A=this.rgb.A=w(t,0,1),this}setC(t){return this.cmyk.C=w(t,0,100),this.updateRGBFromCMYK(),this.updateHSL(),this.updateLab(),this}setM(t){return this.cmyk.M=w(t,0,100),this.updateRGBFromCMYK(),this.updateHSL(),this.updateLab(),this}setY(t){return this.cmyk.Y=w(t,0,100),this.updateRGBFromCMYK(),this.updateHSL(),this.updateLab(),this}setK(t){return this.cmyk.K=w(t,0,100),this.updateRGBFromCMYK(),this.updateHSL(),this.updateLab(),this}get options(){return this._options}get H(){return p(this.hsl.H,this.options.decimals)}get S(){return p(this.hsl.S,this.options.decimals)}get L(){return p(this.hsl.L,this.options.decimals)}get CIEL(){return p(this.lab.L,this.options.decimals)}get CIEa(){return p(this.lab.a,this.options.decimals)}get CIEb(){return p(this.lab.b,this.options.decimals)}get R(){return p(this.rgb.R,this.options.decimals)}get G(){return p(this.rgb.G,this.options.decimals)}get B(){return p(this.rgb.B,this.options.decimals)}get A(){return p(this.hsl.A,this.options.decimals)}get C(){return p(this.cmyk.C,this.options.decimals)}get M(){return p(this.cmyk.M,this.options.decimals)}get Y(){return p(this.cmyk.Y,this.options.decimals)}get K(){return p(this.cmyk.K,this.options.decimals)}get HEXObject(){return u.HEX(this.rgb)}get HEXAObject(){return u.HEXA(this.rgb)}get RGBObject(){return{R:this.R,G:this.G,B:this.B}}get RGBAObject(){return{...this.RGBObject,A:this.A}}get HSLObject(){return{H:this.H,S:this.S,L:this.L}}get HSLAObject(){return{...this.HSLObject,A:this.A}}get CIELabObject(){return{L:this.CIEL,a:this.CIEa,b:this.CIEb}}get CIELabAObject(){return{...this.CIELabObject,A:this.A}}get CMYKObject(){return{C:this.C,M:this.M,Y:this.Y,K:this.K}}get CMYKAObject(){return{...this.CMYKObject,A:this.A}}get HEX(){return f.HEX({R:this.R,G:this.G,B:this.B})}get HEXA(){return f.HEX({R:this.R,G:this.G,B:this.B,A:255*this.A})}get RGB(){return f.RGB({R:this.R,G:this.G,B:this.B},this.options)}get RGBA(){return f.RGB({R:this.R,G:this.G,B:this.B,A:this.A},this.options)}get HSL(){return f.HSL({H:this.H,S:this.S,L:this.L},this.options)}get HSLA(){return f.HSL({H:this.H,S:this.S,L:this.L,A:this.A},this.options)}get CIELab(){return f.CIELab({L:this.CIEL,a:this.CIEa,b:this.CIEb},this.options)}get CIELabA(){return f.CIELab({L:this.CIEL,a:this.CIEa,b:this.CIEb,A:this.A},this.options)}get CMYK(){return f.CMYK({C:this.C,M:this.M,Y:this.Y,K:this.K},this.options)}get CMYKA(){return f.CMYK({C:this.C,M:this.M,Y:this.Y,K:this.K,A:this.A},this.options)}static toHEXObject(t){const r=v(t);return k(t,r,0,u.HEX)}static toHEX(t){return f.HEX(N.toHEXObject(t))}static toHEXAObject(t){const r=v(t);return k(t,r,0,u.HEXA)}static toHEXA(t){return f.HEX(N.toHEXAObject(t))}static toRGBObject(t,r={}){const o=v(t);return k(t,o,r.decimals,u.RGB)}static toRGB(t,r={}){const o=v(t),i=y(r,t),s=k(t,o,r.decimals,u.RGB);return f.RGB(s,i)}static toRGBAObject(t,r={}){const o=v(t);return k(t,o,r.decimals,u.RGBA)}static toRGBA(t,r={}){const o=v(t),i=y(r,t),s=k(t,o,r.decimals,u.RGBA);return f.RGB(s,i)}static toHSLObject(t,r={}){const o=v(t);return k(t,o,r.decimals,u.HSL)}static toHSL(t,r={}){const o=v(t),i=y(r,t),s=k(t,o,r.decimals,u.HSL);return f.HSL(s,i)}static toHSLAObject(t,r={}){const o=v(t);return k(t,o,r.decimals,u.HSLA)}static toHSLA(t,r={}){const o=v(t),i=y(r,t),s=k(t,o,r.decimals,u.HSLA);return f.HSL(s,i)}static toCIELabObject(t,r={}){const o=v(t);return k(t,o,r.decimals,u.CIELab)}static toCIELab(t,r={}){const o=v(t),i=y(r,t),s=k(t,o,r.decimals,u.CIELab);return f.CIELab(s,i)}static toCIELabAObject(t,r={}){const o=v(t);return k(t,o,r.decimals,u.CIELabA)}static toCIELabA(t,r={}){const o=v(t),i=y(r,t),s=k(t,o,r.decimals,u.CIELabA);return f.CIELab(s,i)}static toCMYKObject(t,r={}){const o=v(t);return k(t,o,r.decimals,u.CMYK)}static toCMYK(t,r={}){const o=v(t),i=y(r,t),s=k(t,o,r.decimals,u.CMYK);return f.CMYK(s,i)}static toCMYKAObject(t,r={}){const o=v(t);return k(t,o,r.decimals,u.CMYKA)}static toCMYKA(t,r={}){const o=v(t),i=y(r,t),s=k(t,o,r.decimals,u.CMYKA);return f.CMYK(s,i)}static getBlendHEXObject(t,r,o=5){return B(t,r,o,0,u.HEX)}static getBlendHEX(t,r,o=5){return N.getBlendHEXObject(t,r,o).map(i=>f.HEX(i))}static getBlendHEXAObject(t,r,o=5){return B(t,r,o,0,u.HEXA)}static getBlendHEXA(t,r,o=5){return N.getBlendHEXAObject(t,r,o).map(i=>f.HEX(i))}static getBlendRGBObject(t,r,o,i){return typeof o=="number"?B(t,r,o,i?.decimals,u.RGB):B(t,r,5,o?.decimals,u.RGB)}static getBlendRGB(t,r,o,i){return typeof o=="number"?B(t,r,o,i?.decimals,u.RGB).map(s=>f.RGB(s,y(i||{},t,r))):B(t,r,5,o?.decimals,u.RGB).map(s=>f.RGB(s,y(o||{},t,r)))}static getBlendRGBAObject(t,r,o,i){return typeof o=="number"?B(t,r,o,i?.decimals,u.RGBA):B(t,r,5,o?.decimals,u.RGBA)}static getBlendRGBA(t,r,o,i){return typeof o=="number"?B(t,r,o,i?.decimals,u.RGBA).map(s=>f.RGB(s,y(i||{},t,r))):B(t,r,5,o?.decimals,u.RGBA).map(s=>f.RGB(s,y(o||{},t,r)))}static getBlendHSLObject(t,r,o,i){return B(t,r,typeof o=="number"?o:5,i?.decimals,u.HSL)}static getBlendHSL(t,r,o,i){return typeof o=="number"?B(t,r,o,i?.decimals,u.HSL).map(s=>f.HSL(s,y(i||{},t,r))):B(t,r,5,o?.decimals,u.HSL).map(s=>f.HSL(s,y(o||{},t,r)))}static getBlendHSLAObject(t,r,o,i){return typeof o=="number"?B(t,r,o,i?.decimals,u.HSLA):B(t,r,5,o?.decimals,u.HSLA)}static getBlendHSLA(t,r,o,i){return typeof o=="number"?B(t,r,o,i?.decimals,u.HSLA).map(s=>f.HSL(s,y(i||{},t,r))):B(t,r,5,o?.decimals,u.HSLA).map(s=>f.HSL(s,y(o||{},t,r)))}static getBlendCIELabObject(t,r,o,i){return typeof o=="number"?B(t,r,o,i?.decimals,u.CIELab):B(t,r,5,o?.decimals,u.CIELab)}static getBlendCIELab(t,r,o,i){return typeof o=="number"?B(t,r,o,i?.decimals,u.CIELab).map(s=>f.CIELab(s,y(i||{},t,r))):B(t,r,5,o?.decimals,u.CIELab).map(s=>f.CIELab(s,y(o||{},t,r)))}static getBlendCIELabAObject(t,r,o,i){return typeof o=="number"?B(t,r,o,i?.decimals,u.CIELabA):B(t,r,5,o?.decimals,u.CIELabA)}static getBlendCIELabA(t,r,o,i){return typeof o=="number"?B(t,r,o,i?.decimals,u.CIELabA).map(s=>f.CIELab(s,y(i||{},t,r))):B(t,r,5,o?.decimals,u.CIELabA).map(s=>f.CIELab(s,y(o||{},t,r)))}static getMixHEXObject(t,r=E.ADDITIVE){return C.HEX(t,r,!1)}static getMixHEX(t,r=E.ADDITIVE){return C.HEX(t,r,!0)}static getMixHEXAObject(t,r=E.ADDITIVE){return C.HEXA(t,r,!1)}static getMixHEXA(t,r=E.ADDITIVE){return C.HEXA(t,r,!0)}static getMixRGBObject(t,r,o){return typeof r=="string"?C.RGB(t,r,!1,y(o||{},...t)):C.RGB(t,E.ADDITIVE,!1,y(r||{},...t))}static getMixRGB(t,r,o){return typeof r=="string"?C.RGB(t,r,!0,y(o||{},...t)):C.RGB(t,E.ADDITIVE,!0,y(r||{},...t))}static getMixRGBAObject(t,r,o){return typeof r=="string"?C.RGBA(t,r,!1,y(o||{},...t)):C.RGBA(t,E.ADDITIVE,!1,y(r||{},...t))}static getMixRGBA(t,r,o){return typeof r=="string"?C.RGBA(t,r,!0,y(o||{},...t)):C.RGBA(t,E.ADDITIVE,!0,y(r||{},...t))}static getMixHSLObject(t,r,o){return typeof r=="string"?C.HSL(t,r,!1,y(o||{},...t)):C.HSL(t,E.ADDITIVE,!1,y(r||{},...t))}static getMixHSL(t,r,o){return typeof r=="string"?C.HSL(t,r,!0,y(o||{},...t)):C.HSL(t,E.ADDITIVE,!0,y(r||{},...t))}static getMixHSLAObject(t,r,o){return typeof r=="string"?C.HSLA(t,r,!1,y(o||{},...t)):C.HSLA(t,E.ADDITIVE,!1,y(r||{},...t))}static getMixHSLA(t,r,o){return typeof r=="string"?C.HSLA(t,r,!0,y(o||{},...t)):C.HSLA(t,E.ADDITIVE,!0,y(r||{},...t))}static getMixCIELabObject(t,r,o){return typeof r=="string"?C.CIELab(t,r,!1,y(o||{},...t)):C.CIELab(t,E.ADDITIVE,!1,y(r||{},...t))}static getMixCIELab(t,r,o){return typeof r=="string"?C.CIELab(t,r,!0,y(o||{},...t)):C.CIELab(t,E.ADDITIVE,!0,y(r||{},...t))}static getMixCIELabAObject(t,r,o){return typeof r=="string"?C.CIELabA(t,r,!1,y(o||{},...t)):C.CIELabA(t,E.ADDITIVE,!1,y(r||{},...t))}static getMixCIELabA(t,r,o){return typeof r=="string"?C.CIELabA(t,r,!0,y(o||{},...t)):C.CIELabA(t,E.ADDITIVE,!0,y(r||{},...t))}static getShades(t,r,o){return typeof r=="number"?yt(t,r,!0,y(o||{},t)):yt(t,5,!0,y(r||{},t))}static getTints(t,r,o){return typeof r=="number"?yt(t,r,!1,y(o||{},t)):yt(t,5,!1,y(r||{},t))}static getHarmony(t,r,o,i){return`${r}`in j?wt(r,t,St(o)?o:E.ADDITIVE,y(St(o)?i||{}:o||{},t)):St(r)?wt(j.COMPLEMENTARY,t,r,y(o||{},t)):wt(j.COMPLEMENTARY,t,E.ADDITIVE,y(r||{},t))}}function G(e){return e.charAt(0).toUpperCase()+e.slice(1)}function rr(e){return e.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).toString().replaceAll(",","")}class or extends R{type;name;constructor(t,r){super("div"),this.staticClass("style-panel"),this.type=r,this.name=t,this.layout(),this.on("input",o=>{this.update()})}update(){return this.role_model_list.forEach(([t,r])=>{r.update(this),K.updateStyle(this.name,r,[t])}),this}layout(){if(!this.roles.length)return this.clear();const t=this.data.backgroundColor==="??"?{HEX:"??",A:"??"}:new N(this.data.backgroundColor),r=this.data.color==="??"?{HEX:"??",A:"??"}:new N(this.data.color);this.content([$("section").content([$("h3").content("Properties"),$("div").content([new ie("display").label("Display").add([["block","inline","flex","none"].map(o=>$("option").content(o).value(o))]).value(this.data.display),new Y("opacity").value(this.data.opacity).unit("px").min(0).max(1).label("Opacity").self(o=>{o.$range.step(.01),o.$value.step(.1)})])]),this.type==="text"?$("section").content([$("h3").content("Font"),$("div").content([new Y("font-size").value(this.data.fontSize).unit("px").min(1).label("Size"),new Y("font-weight").min(100).max(900).label("Weight").value(this.data.fontWeight).self(o=>o.$range.step(100)),new Rt("font-color").value(this.data.color).label("Color"),new Y("font-color-transparent").value(r.A.toString()).unit("px").min(0).max(1).label("Transparent").self(o=>{o.$range.step(.01),o.$value.step(.1)})])]):void 0,this.type==="image"?$("section").content([$("h3").content("Dimension"),$("div").content([new Y("height").value(this.data.height).unit("px").min(1).label("Height"),new Y("width").value(this.data.width).unit("px").min(1).label("Width")])]):void 0,$("section").content([$("h3").content("Background"),$("div").content([new Rt("background-color").value(t.HEX).label("Color"),new Y("background-color-transparent").value(t.A.toString()).unit("px").min(0).max(1).label("Transparent").self(o=>{o.$range.step(.01),o.$value.step(.1)})])]),$("section").content([$("h3").content("Padding"),$("div").content([["left","top","right","bottom"].map(o=>new Y(`padding-${o}`).value(this.data[`padding${G(o)}`]).unit("px").label(G(o)))])]),$("section").content([$("h3").content("Margin"),$("div").content([["left","top","right","bottom"].map(o=>new Y(`margin-${o}`).value(this.data[`margin${G(o)}`]).unit("px").label(G(o)))])]),$("section").content([$("header").content([$("h3").content("Border"),$("div").content([$("label").content("Link").for("border-link"),$("input").id("border-link").type("checkbox").checked(!0)])]),$("div").content([["left","top","right","bottom"].map(o=>$("section").content([$("h4").content(G(o)),$("div").content([new Y(`border-${o}-width`).value(this.data[`border${G(o)}Width`]).unit("px").label("Width"),new ie(`border-${o}-style`).label("Style").add([["solid","dashed","doubled","dotted","groove","outset","inset","ridge","hidden"].map(i=>$("option").value(i).content(i).id(i))]).value(this.data[`border${G(o)}Style`]),new Rt(`border-${o}-color`).value(this.data[`border${G(o)}Color`]).label("Color")]).on("input",(i,s)=>{$(":#border-link")?.checked()&&["left","top","right","bottom"].forEach(n=>{if(n===o)return;const a=$(i.target)?.id();a?.includes("width")&&$(`:div.border-${n}-width`)?.value(s.$(`#border-${o}-width`)?.value()),a?.includes("style")&&$(`:div.border-${n}-style`)?.value(s.$(`#border-${o}-style`)?.value()),a?.includes("color")&&$(`:div.border-${n}-color`)?.value(s.$(`#border-${o}-color`)?.value())})})]))])]),$("section").content([$("header").content([$("h3").content("Border Radius"),$("div").content([$("label").content("Link").for("border-radius-link"),$("input").id("border-radius-link").type("checkbox").checked(!0)])]),$("div").content([["top-left","top-right","bottom-left","bottom-right"].map(o=>new Y(`border-${o}-radius`).value(this.data[`border${rr(o)}Radius`]).unit("px").label(`${o.split("-").map(i=>i.charAt(0).toUpperCase()+i.slice(1)).toString().replace(","," ")}`).on("input",(i,s)=>{$(":#border-radius-link")?.checked()&&["top-left","top-right","bottom-left","bottom-right"].forEach(n=>{n!==o&&$(`:div.border-${n}-radius`)?.value(s.value())})}))])])])}get models(){return this.roles.map(t=>Z.get(t).get(this.name))}get role_model_list(){return this.roles.map(t=>[t,Z.get(t).get(this.name)])}get data(){return this.roles.length>1?function(r,o){let i={};for(const[s,n]of Object.entries(r)){i[s]=n;for(const a of o)if(a[s]!==n){i[s]="??";break}}return i}(this.models[0].data,this.models.map(r=>r.data)):this.models[0].data}get roles(){return $("::.role-checkbox").map(t=>{if(t.checked())return t.value()}).detype()}}class ir{data;constructor(t){this.data=t}update(t){const r=(n,a,h=!1)=>n==="??"||n===void 0?a:h?n+"px":n,o=n=>({[`border${G(n)}Style`]:r(t.$(`#border-${n}-style`)?.value(),this.data[`boder${G(n)}Style`]),[`border${G(n)}Color`]:r(t.$(`#border-${n}-color`)?.value(),this.data[`boder${G(n)}Color`]),[`border${G(n)}Width`]:r(t.$(`#border-${n}-width`)?.value(),this.data[`boder${G(n)}Color`],!0)}),i=n=>({[`${n}Top`]:r(t.$(`#${n}-top`)?.value(),this.data[`${n}Top`],!0),[`${n}Bottom`]:r(t.$(`#${n}-bottom`)?.value(),this.data[`${n}Bottom`],!0),[`${n}Left`]:r(t.$(`#${n}-left`)?.value(),this.data[`${n}Left`],!0),[`${n}Right`]:r(t.$(`#${n}-right`)?.value(),this.data[`${n}Right`],!0)}),s={fontSize:r(t.$("#font-size")?.value(),this.data.fontSize,!0),fontWeight:r(t.$("#font-weight")?.value(),this.data.fontWeight),color:new N({...new N(r(t.$("#font-color")?.value(),this.data.color)).RGBObject,A:r(t.$("#font-color-transparent")?.value(),new N(this.data.color).A)}).HEXA,backgroundColor:new N({...new N(r(t.$("#background-color")?.value(),this.data.backgroundColor)).RGBObject,A:r(t.$("#background-color-transparent")?.value(),new N(this.data.backgroundColor).A)}).HEXA,...o("top"),...o("bottom"),...o("left"),...o("right"),borderTopLeftRadius:r(t.$("#border-top-left-radius")?.value(),this.data.borderTopLeftRadius,!0),borderTopRightRadius:r(t.$("#border-top-right-radius")?.value(),this.data.borderTopRightRadius,!0),borderBottomLeftRadius:r(t.$("#border-bottom-left-radius")?.value(),this.data.borderBottomLeftRadius,!0),borderBottomRightRadius:r(t.$("#border-bottom-right-radius")?.value(),this.data.borderBottomRightRadius,!0),...i("margin"),...i("padding"),opacity:r(t.$("#opacity")?.value(),this.data.opacity),display:r(t.$("#display")?.value(),this.data.display),height:r(t.$("#height")?.value(),this.data.height,!0),width:r(t.$("#width")?.value(),this.data.width,!0)};return this.data=s,this}cssObject(){const t={},r=(o,i)=>{for(let[s,n]of Object.entries(i)){if(s=o?o+s.charAt(0).toUpperCase()+s.slice(1):s,!(n instanceof Object)){typeof n=="number"&&s!=="opacity"&&(n=`${n}px`),Object.assign(t,{[`${s}`]:n});continue}r(s,n)}};return r(null,this.data),t}css(){}}const sr={Normal:{Message:{fontSize:"16px",fontWeight:"400",color:"#F0F0F0FF",backgroundColor:"#00000000",borderTopStyle:"solid",borderTopColor:"#000000",borderTopWidth:"0px",borderBottomStyle:"solid",borderBottomColor:"#000000",borderBottomWidth:"0px",borderLeftStyle:"solid",borderLeftColor:"#000000",borderLeftWidth:"0px",borderRightStyle:"solid",borderRightColor:"#000000",borderRightWidth:"0px",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",marginTop:"4px",marginBottom:"0px",marginLeft:"2px",marginRight:"2px",paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",opacity:"1",display:"block"},Name:{fontSize:"16px",fontWeight:"400",color:"#FFFFFFFF",backgroundColor:"#FF427B99",borderTopStyle:"solid",borderTopColor:"#000000",borderTopWidth:"0px",borderBottomStyle:"solid",borderBottomColor:"#000000",borderBottomWidth:"0px",borderLeftStyle:"solid",borderLeftColor:"#000000",borderLeftWidth:"0px",borderRightStyle:"solid",borderRightColor:"#000000",borderRightWidth:"0px",borderTopLeftRadius:"10px",borderTopRightRadius:"10px",borderBottomLeftRadius:"10px",borderBottomRightRadius:"10px",marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",paddingTop:"4px",paddingBottom:"4px",paddingLeft:"8px",paddingRight:"8px",opacity:"1",display:"block"},Avatar:{fontSize:"16px",color:"#000000FF",backgroundColor:"#00000000",borderTopStyle:"solid",borderTopColor:"#000000",borderTopWidth:"0px",borderBottomStyle:"solid",borderBottomColor:"#000000",borderBottomWidth:"0px",borderLeftStyle:"solid",borderLeftColor:"#000000",borderLeftWidth:"0px",borderRightStyle:"solid",borderRightColor:"#000000",borderRightWidth:"0px",borderTopLeftRadius:"10px",borderTopRightRadius:"10px",borderBottomLeftRadius:"10px",borderBottomRightRadius:"10px",marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",opacity:"1",display:"block",height:"60px",width:"60px"},"Author Area":{fontSize:"16px",color:"#000000FF",backgroundColor:"#00000000",borderTopStyle:"solid",borderTopColor:"#000000",borderTopWidth:"0px",borderBottomStyle:"solid",borderBottomColor:"#000000",borderBottomWidth:"0px",borderLeftStyle:"solid",borderLeftColor:"#000000",borderLeftWidth:"0px",borderRightStyle:"solid",borderRightColor:"#000000",borderRightWidth:"0px",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",opacity:"1",display:"flex"},"Content Area":{fontSize:"16px",color:"#000000FF",backgroundColor:"#00000000",borderTopStyle:"solid",borderTopColor:"#000000",borderTopWidth:"0px",borderBottomStyle:"solid",borderBottomColor:"#000000",borderBottomWidth:"0px",borderLeftStyle:"solid",borderLeftColor:"#000000",borderLeftWidth:"0px",borderRightStyle:"solid",borderRightColor:"#000000",borderRightWidth:"0px",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",marginTop:"0px",marginBottom:"0px",marginLeft:"10px",marginRight:"0px",paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",opacity:"1",display:"block"},"Outer Area":{fontSize:"16px",color:"#000000FF",backgroundColor:"#3D3D3D80",borderTopStyle:"solid",borderTopColor:"#000000",borderTopWidth:"0px",borderBottomStyle:"solid",borderBottomColor:"#000000",borderBottomWidth:"0px",borderLeftStyle:"solid",borderLeftColor:"#000000",borderLeftWidth:"0px",borderRightStyle:"solid",borderRightColor:"#000000",borderRightWidth:"0px",borderTopLeftRadius:"10px",borderTopRightRadius:"10px",borderBottomLeftRadius:"10px",borderBottomRightRadius:"10px",marginTop:"0px",marginBottom:"10px",marginLeft:"0px",marginRight:"0px",paddingTop:"8px",paddingBottom:"8px",paddingLeft:"8px",paddingRight:"8px",opacity:"1",display:"flex"}},Member:{Message:{fontSize:"16px",fontWeight:"400",color:"#F0F0F0FF",backgroundColor:"#00000000",borderTopStyle:"solid",borderTopColor:"#000000",borderTopWidth:"0px",borderBottomStyle:"solid",borderBottomColor:"#000000",borderBottomWidth:"0px",borderLeftStyle:"solid",borderLeftColor:"#000000",borderLeftWidth:"0px",borderRightStyle:"solid",borderRightColor:"#000000",borderRightWidth:"0px",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",marginTop:"4px",marginBottom:"0px",marginLeft:"2px",marginRight:"2px",paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",opacity:"1",display:"block"},Name:{fontSize:"16px",fontWeight:"400",color:"#FFD6D6FF",backgroundColor:"#FF333399",borderTopStyle:"solid",borderTopColor:"#000000",borderTopWidth:"0px",borderBottomStyle:"solid",borderBottomColor:"#000000",borderBottomWidth:"0px",borderLeftStyle:"solid",borderLeftColor:"#000000",borderLeftWidth:"0px",borderRightStyle:"solid",borderRightColor:"#000000",borderRightWidth:"0px",borderTopLeftRadius:"10px",borderTopRightRadius:"10px",borderBottomLeftRadius:"10px",borderBottomRightRadius:"10px",marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",paddingTop:"4px",paddingBottom:"4px",paddingLeft:"8px",paddingRight:"8px",opacity:"1",display:"block"},Avatar:{fontSize:"16px",color:"#000000FF",backgroundColor:"#00000000",borderTopStyle:"solid",borderTopColor:"#000000",borderTopWidth:"0px",borderBottomStyle:"solid",borderBottomColor:"#000000",borderBottomWidth:"0px",borderLeftStyle:"solid",borderLeftColor:"#000000",borderLeftWidth:"0px",borderRightStyle:"solid",borderRightColor:"#000000",borderRightWidth:"0px",borderTopLeftRadius:"10px",borderTopRightRadius:"10px",borderBottomLeftRadius:"10px",borderBottomRightRadius:"10px",marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",opacity:"1",display:"block",height:"60px",width:"60px"},"Author Area":{fontSize:"16px",color:"#000000FF",backgroundColor:"#00000000",borderTopStyle:"solid",borderTopColor:"#000000",borderTopWidth:"0px",borderBottomStyle:"solid",borderBottomColor:"#000000",borderBottomWidth:"0px",borderLeftStyle:"solid",borderLeftColor:"#000000",borderLeftWidth:"0px",borderRightStyle:"solid",borderRightColor:"#000000",borderRightWidth:"0px",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",opacity:"1",display:"flex"},"Content Area":{fontSize:"16px",color:"#000000FF",backgroundColor:"#00000000",borderTopStyle:"solid",borderTopColor:"#000000",borderTopWidth:"0px",borderBottomStyle:"solid",borderBottomColor:"#000000",borderBottomWidth:"0px",borderLeftStyle:"solid",borderLeftColor:"#000000",borderLeftWidth:"0px",borderRightStyle:"solid",borderRightColor:"#000000",borderRightWidth:"0px",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",marginTop:"0px",marginBottom:"0px",marginLeft:"10px",marginRight:"0px",paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",opacity:"1",display:"block"},"Outer Area":{fontSize:"16px",color:"#000000FF",backgroundColor:"#3D3D3D80",borderTopStyle:"solid",borderTopColor:"#000000",borderTopWidth:"0px",borderBottomStyle:"solid",borderBottomColor:"#000000",borderBottomWidth:"0px",borderLeftStyle:"solid",borderLeftColor:"#000000",borderLeftWidth:"0px",borderRightStyle:"solid",borderRightColor:"#000000",borderRightWidth:"0px",borderTopLeftRadius:"10px",borderTopRightRadius:"10px",borderBottomLeftRadius:"10px",borderBottomRightRadius:"10px",marginTop:"0px",marginBottom:"10px",marginLeft:"0px",marginRight:"0px",paddingTop:"8px",paddingBottom:"8px",paddingLeft:"8px",paddingRight:"8px",opacity:"1",display:"flex"}},Moderator:{Message:{fontSize:"16px",fontWeight:"400",color:"#F0F0F0FF",backgroundColor:"#00000000",borderTopStyle:"solid",borderTopColor:"#000000",borderTopWidth:"0px",borderBottomStyle:"solid",borderBottomColor:"#000000",borderBottomWidth:"0px",borderLeftStyle:"solid",borderLeftColor:"#000000",borderLeftWidth:"0px",borderRightStyle:"solid",borderRightColor:"#000000",borderRightWidth:"0px",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",marginTop:"4px",marginBottom:"0px",marginLeft:"2px",marginRight:"2px",paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",opacity:"1",display:"block"},Name:{fontSize:"16px",fontWeight:"400",color:"#B8CFFFFF",backgroundColor:"#2E58FF99",borderTopStyle:"solid",borderTopColor:"#000000",borderTopWidth:"0px",borderBottomStyle:"solid",borderBottomColor:"#000000",borderBottomWidth:"0px",borderLeftStyle:"solid",borderLeftColor:"#000000",borderLeftWidth:"0px",borderRightStyle:"solid",borderRightColor:"#000000",borderRightWidth:"0px",borderTopLeftRadius:"10px",borderTopRightRadius:"10px",borderBottomLeftRadius:"10px",borderBottomRightRadius:"10px",marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",paddingTop:"4px",paddingBottom:"4px",paddingLeft:"8px",paddingRight:"8px",opacity:"1",display:"block"},Avatar:{fontSize:"16px",color:"#000000FF",backgroundColor:"#00000000",borderTopStyle:"solid",borderTopColor:"#000000",borderTopWidth:"0px",borderBottomStyle:"solid",borderBottomColor:"#000000",borderBottomWidth:"0px",borderLeftStyle:"solid",borderLeftColor:"#000000",borderLeftWidth:"0px",borderRightStyle:"solid",borderRightColor:"#000000",borderRightWidth:"0px",borderTopLeftRadius:"10px",borderTopRightRadius:"10px",borderBottomLeftRadius:"10px",borderBottomRightRadius:"10px",marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",opacity:"1",display:"block",height:"60px",width:"60px"},"Author Area":{fontSize:"16px",color:"#000000FF",backgroundColor:"#00000000",borderTopStyle:"solid",borderTopColor:"#000000",borderTopWidth:"0px",borderBottomStyle:"solid",borderBottomColor:"#000000",borderBottomWidth:"0px",borderLeftStyle:"solid",borderLeftColor:"#000000",borderLeftWidth:"0px",borderRightStyle:"solid",borderRightColor:"#000000",borderRightWidth:"0px",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",opacity:"1",display:"flex"},"Content Area":{fontSize:"16px",color:"#000000FF",backgroundColor:"#00000000",borderTopStyle:"solid",borderTopColor:"#000000",borderTopWidth:"0px",borderBottomStyle:"solid",borderBottomColor:"#000000",borderBottomWidth:"0px",borderLeftStyle:"solid",borderLeftColor:"#000000",borderLeftWidth:"0px",borderRightStyle:"solid",borderRightColor:"#000000",borderRightWidth:"0px",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",marginTop:"0px",marginBottom:"0px",marginLeft:"10px",marginRight:"0px",paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",opacity:"1",display:"block"},"Outer Area":{fontSize:"16px",color:"#000000FF",backgroundColor:"#3D3D3D80",borderTopStyle:"solid",borderTopColor:"#000000",borderTopWidth:"0px",borderBottomStyle:"solid",borderBottomColor:"#000000",borderBottomWidth:"0px",borderLeftStyle:"solid",borderLeftColor:"#000000",borderLeftWidth:"0px",borderRightStyle:"solid",borderRightColor:"#000000",borderRightWidth:"0px",borderTopLeftRadius:"10px",borderTopRightRadius:"10px",borderBottomLeftRadius:"10px",borderBottomRightRadius:"10px",marginTop:"0px",marginBottom:"10px",marginLeft:"0px",marginRight:"0px",paddingTop:"8px",paddingBottom:"8px",paddingLeft:"8px",paddingRight:"8px",opacity:"1",display:"flex"}},Owner:{Message:{fontSize:"16px",fontWeight:"400",color:"#F0F0F0FF",backgroundColor:"#00000000",borderTopStyle:"solid",borderTopColor:"#000000",borderTopWidth:"0px",borderBottomStyle:"solid",borderBottomColor:"#000000",borderBottomWidth:"0px",borderLeftStyle:"solid",borderLeftColor:"#000000",borderLeftWidth:"0px",borderRightStyle:"solid",borderRightColor:"#000000",borderRightWidth:"0px",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",marginTop:"4px",marginBottom:"0px",marginLeft:"2px",marginRight:"2px",paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",opacity:"1",display:"block"},Name:{fontSize:"16px",fontWeight:"400",color:"#FFEB6BFF",backgroundColor:"#00000099",borderTopStyle:"solid",borderTopColor:"#000000",borderTopWidth:"0px",borderBottomStyle:"solid",borderBottomColor:"#000000",borderBottomWidth:"0px",borderLeftStyle:"solid",borderLeftColor:"#000000",borderLeftWidth:"0px",borderRightStyle:"solid",borderRightColor:"#000000",borderRightWidth:"0px",borderTopLeftRadius:"10px",borderTopRightRadius:"10px",borderBottomLeftRadius:"10px",borderBottomRightRadius:"10px",marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",paddingTop:"4px",paddingBottom:"4px",paddingLeft:"8px",paddingRight:"8px",opacity:"1",display:"block"},Avatar:{fontSize:"16px",color:"#000000FF",backgroundColor:"#00000000",borderTopStyle:"solid",borderTopColor:"#000000",borderTopWidth:"0px",borderBottomStyle:"solid",borderBottomColor:"#000000",borderBottomWidth:"0px",borderLeftStyle:"solid",borderLeftColor:"#000000",borderLeftWidth:"0px",borderRightStyle:"solid",borderRightColor:"#000000",borderRightWidth:"0px",borderTopLeftRadius:"10px",borderTopRightRadius:"10px",borderBottomLeftRadius:"10px",borderBottomRightRadius:"10px",marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",opacity:"1",display:"block",height:"60px",width:"60px"},"Author Area":{fontSize:"16px",color:"#000000FF",backgroundColor:"#00000000",borderTopStyle:"solid",borderTopColor:"#000000",borderTopWidth:"0px",borderBottomStyle:"solid",borderBottomColor:"#000000",borderBottomWidth:"0px",borderLeftStyle:"solid",borderLeftColor:"#000000",borderLeftWidth:"0px",borderRightStyle:"solid",borderRightColor:"#000000",borderRightWidth:"0px",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",opacity:"1",display:"flex"},"Content Area":{fontSize:"16px",color:"#000000FF",backgroundColor:"#00000000",borderTopStyle:"solid",borderTopColor:"#000000",borderTopWidth:"0px",borderBottomStyle:"solid",borderBottomColor:"#000000",borderBottomWidth:"0px",borderLeftStyle:"solid",borderLeftColor:"#000000",borderLeftWidth:"0px",borderRightStyle:"solid",borderRightColor:"#000000",borderRightWidth:"0px",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",marginTop:"0px",marginBottom:"0px",marginLeft:"10px",marginRight:"0px",paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",opacity:"1",display:"block"},"Outer Area":{fontSize:"16px",color:"#000000FF",backgroundColor:"#3D3D3D80",borderTopStyle:"solid",borderTopColor:"#000000",borderTopWidth:"0px",borderBottomStyle:"solid",borderBottomColor:"#000000",borderBottomWidth:"0px",borderLeftStyle:"solid",borderLeftColor:"#000000",borderLeftWidth:"0px",borderRightStyle:"solid",borderRightColor:"#000000",borderRightWidth:"0px",borderTopLeftRadius:"10px",borderTopRightRadius:"10px",borderBottomLeftRadius:"10px",borderBottomRightRadius:"10px",marginTop:"0px",marginBottom:"10px",marginLeft:"0px",marginRight:"0px",paddingTop:"8px",paddingBottom:"8px",paddingLeft:"8px",paddingRight:"8px",opacity:"1",display:"flex"}}},Lt={bocchi:["bocchi_1.png","bocchi_2.png"],kita:["kita_1.png","kita_2.png"],nijika:["nijika_1.png","nijika_2.png"],ryo:["ryo_1.png","ryo_2.png"]};class nr extends R{data;$content=$("div").id("content");$message=$("span").id("message");$name=$("span").id("author-name");$author_area=$("yt-live-chat-author-chip");$timestamp=$("span").id("timestamp");$avatar=$("yt-img-shadow").id("author-photo");$overlay=$("div").class("overlay");$hint=$("div").class("hint").css({display:"none"});constructor(t){super("yt-live-chat-text-message-renderer"),this.data=t,this.build(),this.init()}init(){Z.get(this.data.role)?.forEach((t,r)=>this.updateStyle(r,t))}build(){this.content([this.$overlay.content([`Role: ${this.data.role}`]),this.$hint,this.$avatar.content([$("img").src(`/${this.avatar_url}`)]),this.$content.content([this.$timestamp,this.$author_area.content([this.$name.content(this.data.name),$("span").id("chat-badges").content([$("yt-live-chat-author-badge-renderer").content([$("div").id("image").content([$("img")])]),this.data.role==="Moderator"?$("yt-live-chat-author-badge-renderer").attribute("type","moderator").content([$("div").id("image").self(t=>{t.dom.innerHTML=''})]):void 0])]),this.$message.content(this.data.message),$("span").id("deleted-state")])])}updateStyle(t,r){switch(t){case"Message":this.$message.css(r.data);break;case"Name":this.$name.css(r.data);break;case"Avatar":this.$avatar.css(r.data);break;case"Content Area":this.$content.css(r.data);break;case"Author Area":this.$author_area.css(r.data);break;case"Outer Area":this.css(r.data);break}}hint(t){switch(t){case"Message":this.hintPosition(this.$message);break;case"Name":this.hintPosition(this.$name);break;case"Avatar":this.hintPosition(this.$avatar);break;case"Content Area":this.hintPosition(this.$content);break;case"Author Area":this.hintPosition(this.$author_area);break;case"Outer Area":this.hintPosition(this);break}}hintPosition(t){const r=t.dom.getBoundingClientRect(),o=this.dom.getBoundingClientRect();this.$hint.css({position:"absolute",top:`${r.top-o.top}px`,left:`${r.left-o.left}px`,height:`${r.height}px`,width:`${r.width}px`,backgroundColor:"#ff000030",display:"block"})}get avatar_url(){const t=this.data.role==="Normal"?Lt.bocchi:this.data.role==="Member"?Lt.kita:this.data.role==="Moderator"?Lt.ryo:Lt.nijika;return t[Math.floor(Math.random()*t.length)]}}class ar extends R{messageList=new Set;constructor(){super("ytchat")}send(t){const r=new nr(t);return this.messageList.add(r),this.insert(r),this}updateStyle(t,r,o){this.messageList.forEach(i=>{o.includes(i.data.role)&&i.updateStyle(t,r)})}showHint(t){this.messageList.forEach(r=>{this.roles.includes(r.data.role)&&r.hint(t)})}hideHint(){this.messageList.forEach(t=>{t.$hint.css({display:"none"})})}get roles(){return $("::.role-checkbox").map(t=>{if(t.checked())return t.value()}).detype()}}const dr=`yt-live-chat-renderer yt-live-chat-header-renderer, +(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function t(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=t(o);fetch(o.href,i)}})();class st{parent;__hidden=!1;domEvents={};on(t,r,o){this.domEvents[t]||(this.domEvents[t]=new Map);const i=s=>r(s,this);return this.domEvents[t].set(r,i),this.dom.addEventListener(t,i,o),this}off(t,r,o){const i=this.domEvents[t]?.get(r);return i&&this.dom.removeEventListener(t,i,o),this}once(t,r,o){const i=s=>{this.dom.removeEventListener(t,i,o),r(s,this)};return this.dom.addEventListener(t,i,o),this}hide(t){return $.fluent(this,arguments,()=>this.__hidden,()=>{if(t!==void 0)return t instanceof ut?(this.__hidden=t.value,t.use(this,"hide")):this.__hidden=t,this.parent?.children.render(),this})}remove(){return this.parent?.children.remove(this).render(),this}replace(t){return this.parent?.children.replace(this,t).render(),this}contains(t){return t?t instanceof st?this.dom.contains(t.dom):t instanceof EventTarget?this.dom.contains($(t).dom):this.dom.contains(t):!1}self(t){return t(this),this}inDOM(){return document.contains(this.dom)}isElement(){if(this instanceof rt)return this}static from(t){if(t.$)return t.$;if(t instanceof HTMLElement){const r=$(t.tagName);return r.dom=t,t.parentElement&&(r.parent=$(t.parentElement)),r}else if(t instanceof Text){const r=new Bt(t.textContent??"");return r.dom=t,t.parentElement&&(r.parent=$(t.parentElement)),r}throw"$NODE.FROM: NOT SUPPORT TARGET ELEMENT TYPE"}}class rt extends st{dom;static_classes=new Set;constructor(t,r){super(),this.dom=document.createElement(t),this.dom.$=this,this.setOptions(r)}setOptions(t){return this.id(t?.id),t&&t.class&&this.class(...t.class),this}id(t){return $.fluent(this,arguments,()=>this.dom.id,()=>$.set(this.dom,"id",t))}class(...t){return $.fluent(this,arguments,()=>this.dom.classList,()=>{this.dom.classList.forEach(r=>this.static_classes.has(r)??this.dom.classList.remove(r)),this.dom.classList.add(...t.detype())})}addClass(...t){return $.fluent(this,arguments,()=>this,()=>{this.dom.classList.add(...t.detype())})}removeClass(...t){return $.fluent(this,arguments,()=>this,()=>{this.dom.classList.remove(...t.detype())})}staticClass(...t){return $.fluent(this,arguments,()=>this.static_classes,()=>{this.removeClass(...this.static_classes),this.static_classes.clear(),this.addStaticClass(...t)})}addStaticClass(...t){return $.fluent(this,arguments,()=>this,()=>{t.detype().forEach(r=>this.static_classes.add(r)),this.addClass(...t)})}removeStaticClass(...t){return $.fluent(this,arguments,()=>this,()=>{t.detype().forEach(r=>this.static_classes.delete(r)),this.removeClass(...t)})}css(t){return $.fluent(this,arguments,()=>this.dom.style,()=>{Object.assign(this.dom.style,t)})}attribute(t,r){return arguments.length?arguments.length===1?t===void 0?null:this.dom.getAttribute(t):arguments.length===2?(t&&r&&this.dom.setAttribute(t,`${r}`),this):this:null}autocapitalize(t){return $.fluent(this,arguments,()=>this.dom.autocapitalize,()=>$.set(this.dom,"autocapitalize",t))}dir(t){return $.fluent(this,arguments,()=>this.dom.dir,()=>$.set(this.dom,"dir",t))}innerText(t){return $.fluent(this,arguments,()=>this.dom.innerText,()=>$.set(this.dom,"innerText",t))}title(t){return $.fluent(this,arguments,()=>this.dom.title,()=>$.set(this.dom,"title",t))}translate(t){return $.fluent(this,arguments,()=>this.dom.translate,()=>$.set(this.dom,"translate",t))}popover(t){return $.fluent(this,arguments,()=>this.dom.popover,()=>$.set(this.dom,"popover",t))}spellcheck(t){return $.fluent(this,arguments,()=>this.dom.spellcheck,()=>$.set(this.dom,"spellcheck",t))}inert(t){return $.fluent(this,arguments,()=>this.dom.inert,()=>$.set(this.dom,"inert",t))}lang(t){return $.fluent(this,arguments,()=>this.dom.lang,()=>$.set(this.dom,"lang",t))}draggable(t){return $.fluent(this,arguments,()=>this.dom.draggable,()=>$.set(this.dom,"draggable",t))}hidden(t){return $.fluent(this,arguments,()=>this.dom.hidden,()=>$.set(this.dom,"hidden",t))}tabIndex(t){return $.fluent(this,arguments,()=>this.dom.tabIndex,()=>$.set(this.dom,"tabIndex",t))}click(){return this.dom.click(),this}attachInternals(){return this.dom.attachInternals()}hidePopover(){return this.dom.hidePopover(),this}showPopover(){return this.dom.showPopover(),this}togglePopover(){return this.dom.togglePopover(),this}focus(){return this.dom.focus(),this}blur(){return this.dom.blur(),this}animate(t,r,o){const i=this.dom.animate(t,r);return o&&o(i),this}getAnimations(t){return this.dom.getAnimations(t)}get accessKeyLabel(){return this.dom.accessKeyLabel}get offsetHeight(){return this.dom.offsetHeight}get offsetLeft(){return this.dom.offsetLeft}get offsetParent(){return $(this.dom.offsetParent)}get offsetTop(){return this.dom.offsetTop}get offsetWidth(){return this.dom.offsetWidth}get dataset(){return this.dom.dataset}}class Bt extends st{dom;constructor(t){super(),this.dom=new Text(t),this.dom.$=this}content(t){return $.fluent(this,arguments,()=>this.dom.textContent,()=>$.set(this.dom,"textContent",t))}}class be{#t;elementList=new Set;constructor(t){this.#t=t}add(t){if(typeof t=="string"){const r=new Bt(t);r.parent=this.#t,this.elementList.add(r)}else t.parent=this.#t,this.elementList.add(t)}remove(t){return this.elementList.has(t)?(this.elementList.delete(t),t.parent=void 0,this):this}removeAll(t=!0){this.elementList.forEach(r=>this.remove(r)),t&&this.render()}replace(t,r){const o=this.array.map(i=>i===t?r:i);return this.elementList.clear(),o.forEach(i=>this.elementList.add(i)),t.parent=void 0,r.parent=this.#t,this}render(){const[t,r]=[this.array.map(i=>i.dom),Array.from(this.dom.childNodes)],o=[];for(;r.length||t.length;){const[i,s]=[r.at(0),t.at(0)];s?i?s!==i?(s.$.__hidden||(this.dom.insertBefore(s,i),o.push(s)),t.shift()):(s.$.__hidden&&this.dom.removeChild(s),t.shift(),r.shift()):(s.$.__hidden||this.dom.append(s),t.shift()):(i&&!o.includes(i)&&i.remove(),r.shift())}}get array(){return[...this.elementList.values()]}get dom(){return this.#t.dom}}class ut{value;attributes=new Map;constructor(t){this.value=t}set(t){this.value=t;for(const[r,o]of this.attributes.entries())for(const i of o)r[i]instanceof Function&&r[i](t)}toString(){return`${this.value}`}use(t,r){const o=this.attributes.get(t);o?o.add(r):this.attributes.set(t,new Set().add(r))}}class R extends rt{children=new be(this);constructor(t,r){super(t,r)}content(t){return $.fluent(this,arguments,()=>this,()=>{this.children.removeAll(!1),this.insert(t)})}insert(t){return $.fluent(this,arguments,()=>this,()=>{t instanceof Function&&(t=t(this)),t=$.multableResolve(t);for(const r of t)if(r!==void 0)if(r instanceof Array)this.insert(r);else if(r instanceof ut){const o=new Bt(r.toString());r.use(o,"content"),this.children.add(o)}else this.children.add(r);this.children.render()})}clear(){return this.children.removeAll(),this}$(t){return $(this.dom.querySelector(t))}$all(t){return Array.from(this.dom.querySelectorAll(t)).map(r=>$(r))}}class kt extends R{constructor(t){super("a",t),this.dom.addEventListener("click",r=>{$.anchorPreventDefault&&r.preventDefault(),$.anchorHandler&&this.href()&&$.anchorHandler(this.href(),r)})}href(t){return $.fluent(this,arguments,()=>this.dom.href,()=>{t&&(this.dom.href=t)})}target(t){return $.fluent(this,arguments,()=>this.dom.target,()=>{t&&(this.dom.target=t)})}}var It;(e=>{function t(n,a,h,d){return a.length?(d(),n):h()}e.fluent=t;function r(n){return n instanceof Array?n:[n]}e.multableResolve=r;function o(n,a){return r(a).forEach(h=>{Object.getOwnPropertyNames(h.prototype).forEach(d=>{d!=="constructor"&&Object.defineProperty(n.prototype,d,Object.getOwnPropertyDescriptor(h.prototype,d)||Object.create(null))})}),n}e.mixin=o;function i(n,a,h){h!==void 0&&(n[a]=h)}e.set=i;function s(n){return new ut(n)}e.state=s})(It||(It={}));class Dt extends R{constructor(t){super("form",t)}autocomplete(t){return $.fluent(this,arguments,()=>this.dom.autocomplete,()=>$.set(this.dom,"autocomplete",t))}action(t){return $.fluent(this,arguments,()=>this.dom.formAction,()=>$.set(this.dom,"formAction",t))}enctype(t){return $.fluent(this,arguments,()=>this.dom.formEnctype,()=>$.set(this.dom,"formEnctype",t))}method(t){return $.fluent(this,arguments,()=>this.dom.formMethod,()=>$.set(this.dom,"formMethod",t))}noValidate(t){return $.fluent(this,arguments,()=>this.dom.formNoValidate,()=>$.set(this.dom,"formNoValidate",t))}acceptCharset(t){return $.fluent(this,arguments,()=>this.dom.acceptCharset,()=>$.set(this.dom,"acceptCharset",t))}target(t){return $.fluent(this,arguments,()=>this.dom.formTarget,()=>$.set(this.dom,"formTarget",t))}requestSubmit(){return this.dom.requestSubmit(),this}reset(){return this.dom.reset(),this}submit(){return this.dom.submit(),this}checkValidity(){return this.dom.checkValidity()}reportValidity(){return this.dom.reportValidity()}get length(){return this.dom.length}get elements(){return Array.from(this.dom.elements).map(t=>$(t))}}function Jt(e){return It.mixin(e,xe)}class xe{formAction(t){return $.fluent(this,arguments,()=>this.dom.formAction,()=>$.set(this.dom,"formAction",t))}formEnctype(t){return $.fluent(this,arguments,()=>this.dom.formEnctype,()=>$.set(this.dom,"formEnctype",t))}formMethod(t){return $.fluent(this,arguments,()=>this.dom.formMethod,()=>$.set(this.dom,"formMethod",t))}formNoValidate(t){return $.fluent(this,arguments,()=>this.dom.formNoValidate,()=>$.set(this.dom,"formNoValidate",t))}formTarget(t){return $.fluent(this,arguments,()=>this.dom.formTarget,()=>$.set(this.dom,"formTarget",t))}name(t){return $.fluent(this,arguments,()=>this.dom.name,()=>$.set(this.dom,"name",t))}value(t){return $.fluent(this,arguments,()=>this.dom.value,()=>$.set(this.dom,"value",t))}get form(){return this.dom.form?$(this.dom.form):null}get labels(){return Array.from(this.dom.labels??[]).map(t=>$(t))}get validationMessage(){return this.dom.validationMessage}get validity(){return this.dom.validity}get willValidate(){return this.dom.willValidate}}var $e=Object.defineProperty,ye=Object.getOwnPropertyDescriptor,Le=(e,t,r,o)=>{for(var i=o>1?void 0:o?ye(t,r):t,s=e.length-1,n;s>=0;s--)(n=e[s])&&(i=(o?n(t,r,i):n(i))||i);return o&&i&&$e(t,r,i),i};let ct=class extends R{constructor(e){super("button",e)}disabled(e){return $.fluent(this,arguments,()=>this.dom.disabled,()=>$.set(this.dom,"disabled",e))}type(e){return $.fluent(this,arguments,()=>this.dom.type,()=>$.set(this.dom,"type",e))}checkValidity(){return this.dom.checkValidity()}reportValidity(){return this.dom.reportValidity()}};ct=Le([Jt],ct);var Re=Object.defineProperty,Ce=Object.getOwnPropertyDescriptor,Ae=(e,t,r,o)=>{for(var i=o>1?void 0:o?Ce(t,r):t,s=e.length-1,n;s>=0;s--)(n=e[s])&&(i=(o?n(t,r,i):n(i))||i);return o&&i&&Re(t,r,i),i};let pt=class extends rt{constructor(e){super("input",e)}accept(...e){return $.fluent(this,arguments,()=>this.dom.accept.split(","),()=>this.dom.accept=e.toString())}capture(e){return $.fluent(this,arguments,()=>this.dom.capture,()=>$.set(this.dom,"capture",e))}alt(e){return $.fluent(this,arguments,()=>this.dom.alt,()=>$.set(this.dom,"alt",e))}height(e){return $.fluent(this,arguments,()=>this.dom.height,()=>$.set(this.dom,"height",e))}width(e){return $.fluent(this,arguments,()=>this.dom.width,()=>$.set(this.dom,"width",e))}checked(e){return $.fluent(this,arguments,()=>this.dom.checked,()=>$.set(this.dom,"checked",e))}max(e){return $.fluent(this,arguments,()=>this.dom.max===""?null:parseInt(this.dom.min),()=>$.set(this.dom,"max",e?.toString()))}min(e){return $.fluent(this,arguments,()=>this.dom.min===""?null:parseInt(this.dom.min),()=>$.set(this.dom,"min",e?.toString()))}maxLength(e){return $.fluent(this,arguments,()=>this.dom.maxLength,()=>$.set(this.dom,"maxLength",e))}minLength(e){return $.fluent(this,arguments,()=>this.dom.minLength,()=>$.set(this.dom,"minLength",e))}autocomplete(e){return $.fluent(this,arguments,()=>this.dom.autocomplete,()=>$.set(this.dom,"autocomplete",e))}defaultValue(e){return $.fluent(this,arguments,()=>this.dom.defaultValue,()=>$.set(this.dom,"defaultValue",e))}defaultChecked(e){return $.fluent(this,arguments,()=>this.dom.defaultChecked,()=>$.set(this.dom,"defaultChecked",e))}dirName(e){return $.fluent(this,arguments,()=>this.dom.dirName,()=>$.set(this.dom,"dirName",e))}disabled(e){return $.fluent(this,arguments,()=>this.dom.disabled,()=>$.set(this.dom,"disabled",e))}multiple(e){return $.fluent(this,arguments,()=>this.dom.multiple,()=>$.set(this.dom,"multiple",e))}pattern(e){return $.fluent(this,arguments,()=>this.dom.pattern,()=>$.set(this.dom,"pattern",e))}placeholder(e){return $.fluent(this,arguments,()=>this.dom.placeholder,()=>$.set(this.dom,"placeholder",e))}readOnly(e){return $.fluent(this,arguments,()=>this.dom.readOnly,()=>$.set(this.dom,"readOnly",e))}required(e){return $.fluent(this,arguments,()=>this.dom.required,()=>$.set(this.dom,"required",e))}selectionDirection(e){return $.fluent(this,arguments,()=>this.dom.selectionDirection,()=>$.set(this.dom,"selectionDirection",e))}selectionEnd(e){return $.fluent(this,arguments,()=>this.dom.selectionEnd,()=>$.set(this.dom,"selectionEnd",e))}selectionStart(e){return $.fluent(this,arguments,()=>this.dom.selectionStart,()=>$.set(this.dom,"selectionStart",e))}size(e){return $.fluent(this,arguments,()=>this.dom.size,()=>$.set(this.dom,"size",e))}src(e){return $.fluent(this,arguments,()=>this.dom.src,()=>$.set(this.dom,"src",e))}step(e){return $.fluent(this,arguments,()=>Number(this.dom.step),()=>$.set(this.dom,"step",e?.toString()))}type(e){return $.fluent(this,arguments,()=>this.dom.type,()=>$.set(this.dom,"type",e))}inputMode(e){return $.fluent(this,arguments,()=>this.dom.inputMode,()=>$.set(this.dom,"inputMode",e))}valueAsDate(e){return $.fluent(this,arguments,()=>this.dom.valueAsDate,()=>$.set(this.dom,"valueAsDate",e))}valueAsNumber(e){return $.fluent(this,arguments,()=>this.dom.valueAsNumber,()=>$.set(this.dom,"valueAsNumber",e))}webkitdirectory(e){return $.fluent(this,arguments,()=>this.dom.webkitdirectory,()=>$.set(this.dom,"webkitdirectory",e))}select(){return this.dom.select(),this}setCustomValidity(e){return this.dom.setCustomValidity(e),this}setRangeText(e,t,r,o){return typeof t=="number"&&typeof r=="number"&&this.dom.setRangeText(e,t,r,o),this.dom.setRangeText(e),this}setSelectionRange(e,t,r){return this.dom.setSelectionRange(e,t,r),this}showPicker(){return this.dom.showPicker(),this}stepDown(){return this.dom.stepDown(),this}stepUp(){return this.dom.stepUp(),this}checkValidity(){return this.dom.checkValidity()}reportValidity(){return this.dom.reportValidity()}get files(){return this.dom.files}get webkitEntries(){return this.dom.webkitEntries}};pt=Ae([Jt],pt);class Ot extends R{constructor(t){super("label",t)}for(t){return $.fluent(this,arguments,()=>this.dom.htmlFor,()=>{$.set(this.dom,"htmlFor",t,"for")})}get form(){return this.dom.form}get control(){return this.dom.control}}class Gt extends rt{constructor(t){super("img",t)}alt(t){return $.fluent(this,arguments,()=>this.dom.alt,()=>$.set(this.dom,"alt",t))}crossOrigin(t){return $.fluent(this,arguments,()=>this.dom.crossOrigin,()=>$.set(this.dom,"crossOrigin",t))}decoding(t){return $.fluent(this,arguments,()=>this.dom.decoding,()=>$.set(this.dom,"decoding",t))}height(t){return $.fluent(this,arguments,()=>this.dom.height,()=>$.set(this.dom,"height",t))}isMap(t){return $.fluent(this,arguments,()=>this.dom.isMap,()=>$.set(this.dom,"isMap",t))}loading(t){return $.fluent(this,arguments,()=>this.dom.loading,()=>$.set(this.dom,"loading",t))}referrerPolicy(t){return $.fluent(this,arguments,()=>this.dom.referrerPolicy,()=>$.set(this.dom,"referrerPolicy",t))}sizes(t){return $.fluent(this,arguments,()=>this.dom.sizes,()=>$.set(this.dom,"sizes",t))}src(t){return $.fluent(this,arguments,()=>this.dom.src,()=>$.set(this.dom,"src",t))}srcset(t){return $.fluent(this,arguments,()=>this.dom.srcset,()=>$.set(this.dom,"srcset",t))}useMap(t){return $.fluent(this,arguments,()=>this.dom.useMap,()=>$.set(this.dom,"useMap",t))}width(t){return $.fluent(this,arguments,()=>this.dom.width,()=>$.set(this.dom,"width",t))}decode(){return this.dom.decode()}get complete(){return this.dom.complete}get currentSrc(){return this.dom.currentSrc}get naturalHeight(){return this.dom.naturalHeight}get naturalWidth(){return this.dom.naturalWidth}get x(){return this.dom.x}get y(){return this.dom.y}}class Wt extends R{constructor(t){super("canvas",t)}height(t){return $.fluent(this,arguments,()=>this.dom.height,()=>{$.set(this.dom,"height",t)})}width(t){return $.fluent(this,arguments,()=>this.dom.width,()=>{$.set(this.dom,"width",t)})}captureStream(t){return this.dom.captureStream(t)}getContext(t,r){return this.dom.getContext(t)}toBlob(t,r,o){return this.dom.toBlob(t,r,o),this}toDataURL(t,r){return this.dom.toDataURL(t,r)}transferControlToOffscreen(){return this.dom.transferControlToOffscreen()}}class Nt extends R{constructor(t){super("dialog",t)}open(t){return $.fluent(this,arguments,()=>this.dom.open,()=>$.set(this.dom,"open",t))}returnValue(t){return $.fluent(this,arguments,()=>this.dom.returnValue,()=>$.set(this.dom,"returnValue",t))}close(){return this.dom.close(),this}show(){return this.dom.show(),this}showModal(){return this.dom.showModal(),this}}function de(e){return $.mixin(e,Ee)}class Ee{on(t,r){return this.events.on(t,r),this}off(t,r){return this.events.off(t,r),this}once(t,r){return this.events.once(t,r),this}}class Zt{eventMap=new Map;register(...t){return t.forEach(r=>{const o=new oe(r);this.eventMap.set(o.name,o)}),this}delete(t){return this.eventMap.delete(t),this}fire(t,...r){const o=this.get(t);return o instanceof oe&&o.fire(...r),this}on(t,r){return this.get(t).add(r),this}off(t,r){return this.get(t).delete(r),this}once(t,r){const o=(...i)=>{this.get(t).delete(o),r(...i)};return this.get(t).add(o),this}get(t){const r=this.eventMap.get(t);if(!r)throw new Error("EVENT NOT EXIST");return r}}class oe{name;callbackList=new Set;constructor(t){this.name=t}fire(...t){this.callbackList.forEach(r=>r(...t))}add(t){this.callbackList.add(t)}delete(t){this.callbackList.delete(t)}}class At extends R{view_cache=new Map;event=new Zt().register("switch");content_id=null;constructor(t){super("view",t)}setView(t,r){return this.view_cache.set(t,r),this}deleteView(t){return this.view_cache.delete(t),this}deleteAllView(){return this.view_cache.clear(),this}switchView(t){const r=this.view_cache.get(t);if(r===void 0)throw"$View.switch(): target content is undefined";return this.content(r),this.content_id=t,this.event.fire("switch",t),this}}var ve=Object.defineProperty,Be=Object.getOwnPropertyDescriptor,Se=(e,t,r,o)=>{for(var i=o>1?void 0:o?Be(t,r):t,s=e.length-1,n;s>=0;s--)(n=e[s])&&(i=(o?n(t,r,i):n(i))||i);return o&&i&&ve(t,r,i),i};let mt=class extends R{constructor(){super("select")}add(e){return this.insert(e),this}item(e){return $(this.dom.item(e))}namedItem(e){return $(this.dom.namedItem(e))}disabled(e){return $.fluent(this,arguments,()=>this.dom.disabled,()=>$.set(this.dom,"disabled",e))}multiple(e){return $.fluent(this,arguments,()=>this.dom.multiple,()=>$.set(this.dom,"multiple",e))}required(e){return $.fluent(this,arguments,()=>this.dom.required,()=>$.set(this.dom,"required",e))}autocomplete(e){return $.fluent(this,arguments,()=>this.dom.autocomplete,()=>$.set(this.dom,"autocomplete",e))}get length(){return this.dom.length}get size(){return this.dom.size}get options(){return Array.from(this.dom.options).map(e=>$(e))}get selectedIndex(){return this.dom.selectedIndex}get selectedOptions(){return Array.from(this.dom.selectedOptions).map(e=>$(e))}};mt=Se([Jt],mt);class _t extends R{constructor(t){super("option",t)}defaultSelected(t){return $.fluent(this,arguments,()=>this.dom.defaultSelected,()=>$.set(this.dom,"defaultSelected",t))}disabled(t){return $.fluent(this,arguments,()=>this.dom.disabled,()=>$.set(this.dom,"disabled",t))}label(t){return $.fluent(this,arguments,()=>this.dom.label,()=>$.set(this.dom,"label",t))}selected(t){return $.fluent(this,arguments,()=>this.dom.selected,()=>$.set(this.dom,"selected",t))}text(t){return $.fluent(this,arguments,()=>this.dom.text,()=>$.set(this.dom,"text",t))}value(t){return $.fluent(this,arguments,()=>this.dom.value,()=>$.set(this.dom,"value",t))}get form(){return this.dom.form?$(this.dom.form):null}get index(){return this.dom.index}}class Pt extends R{constructor(t){super("optgroup",t)}disabled(t){return $.fluent(this,arguments,()=>this.dom.disabled,()=>$.set(this.dom,"disabled",t))}label(t){return $.fluent(this,arguments,()=>this.dom.label,()=>$.set(this.dom,"label",t))}}class jt extends R{constructor(t){super("textarea",t)}cols(t){return $.fluent(this,arguments,()=>this.dom.cols,()=>$.set(this.dom,"cols",t))}name(t){return $.fluent(this,arguments,()=>this.dom.name,()=>$.set(this.dom,"name",t))}wrap(t){return $.fluent(this,arguments,()=>this.dom.wrap,()=>$.set(this.dom,"wrap",t))}value(t){return $.fluent(this,arguments,()=>this.dom.value,()=>$.set(this.dom,"value",t))}maxLength(t){return $.fluent(this,arguments,()=>this.dom.maxLength,()=>$.set(this.dom,"maxLength",t))}minLength(t){return $.fluent(this,arguments,()=>this.dom.minLength,()=>$.set(this.dom,"minLength",t))}autocomplete(t){return $.fluent(this,arguments,()=>this.dom.autocomplete,()=>$.set(this.dom,"autocomplete",t))}defaultValue(t){return $.fluent(this,arguments,()=>this.dom.defaultValue,()=>$.set(this.dom,"defaultValue",t))}dirName(t){return $.fluent(this,arguments,()=>this.dom.dirName,()=>$.set(this.dom,"dirName",t))}disabled(t){return $.fluent(this,arguments,()=>this.dom.disabled,()=>$.set(this.dom,"disabled",t))}placeholder(t){return $.fluent(this,arguments,()=>this.dom.placeholder,()=>$.set(this.dom,"placeholder",t))}readOnly(t){return $.fluent(this,arguments,()=>this.dom.readOnly,()=>$.set(this.dom,"readOnly",t))}required(t){return $.fluent(this,arguments,()=>this.dom.required,()=>$.set(this.dom,"required",t))}selectionDirection(t){return $.fluent(this,arguments,()=>this.dom.selectionDirection,()=>$.set(this.dom,"selectionDirection",t))}selectionEnd(t){return $.fluent(this,arguments,()=>this.dom.selectionEnd,()=>$.set(this.dom,"selectionEnd",t))}selectionStart(t){return $.fluent(this,arguments,()=>this.dom.selectionStart,()=>$.set(this.dom,"selectionStart",t))}type(t){return $.fluent(this,arguments,()=>this.dom.type,()=>$.set(this.dom,"type",t))}inputMode(t){return $.fluent(this,arguments,()=>this.dom.inputMode,()=>$.set(this.dom,"inputMode",t))}select(){return this.dom.select(),this}setCustomValidity(t){return this.dom.setCustomValidity(t),this}setRangeText(t,r,o,i){return typeof r=="number"&&typeof o=="number"&&this.dom.setRangeText(t,r,o,i),this.dom.setRangeText(t),this}setSelectionRange(t,r,o){return this.dom.setSelectionRange(t,r,o),this}checkValidity(){return this.dom.checkValidity()}reportValidity(){return this.dom.reportValidity()}get validationMessage(){return this.dom.validationMessage}get validity(){return this.dom.validity}get form(){return this.dom.form?$(this.dom.form):null}get labels(){return Array.from(this.dom.labels??[]).map(t=>$(t))}}function f(e){if(typeof e>"u"||e===null)return e;if(typeof e=="string"){if(e.startsWith("::"))return Array.from(document.querySelectorAll(e.replace(/^::/,""))).map(t=>f(t));if(e.startsWith(":"))return f(document.querySelector(e.replace(/^:/,"")));if(e in f.TagNameElementMap)switch(f.TagNameElementMap[e]){case rt:return new rt(e);case kt:return new kt;case R:return new R(e);case pt:return new pt;case Ot:return new Ot;case Dt:return new Dt;case ct:return new ct;case Gt:return new Gt;case Wt:return new Wt;case Nt:return new Nt;case At:return new At;case mt:return new mt;case _t:return new _t;case Pt:return new Pt;case jt:return new jt}else return new R(e)}if(e instanceof HTMLElement||e instanceof Text)return e.$?e.$:st.from(e);throw"$: NOT SUPPORT TARGET ELEMENT TYPE"}(e=>{e.anchorHandler=null,e.anchorPreventDefault=!1,e.body=document.body,e.routers=new Set,e.TagNameElementMap={a:kt,p:R,pre:R,code:R,blockquote:R,strong:R,h1:R,h2:R,h3:R,h4:R,h5:R,h6:R,div:R,ol:R,ul:R,dl:R,li:R,input:pt,label:Ot,button:ct,form:Dt,img:Gt,dialog:Nt,canvas:Wt,view:At,select:mt,option:_t,optgroup:Pt,textarea:jt};function t(d,m,l,c){return m.length?(c(),d):l()}e.fluent=t;function r(d){return d instanceof Array?d:[d]}e.multableResolve=r;function o(d,m){return r(m).forEach(l=>{Object.getOwnPropertyNames(l.prototype).forEach(c=>{c!=="constructor"&&Object.defineProperty(d.prototype,c,Object.getOwnPropertyDescriptor(l.prototype,c)||Object.create(null))})}),d}e.mixin=o;function i(d,m,l,c){if(l!==void 0){if(l instanceof ut&&d instanceof Node){l.use(d.$,c??m),d[m]=l.value;return}d[m]=l}}e.set=i;function s(d){return new ut(d)}e.state=s;async function n(d,m){return new Promise(l=>{const c=new FileReader;c.onload=g=>{const L=e("img");if(L.once("load",T=>{const A=e("canvas"),W=A.getContext("2d"),_=L.height()/L.width(),[V,j]=[_>1?m/_:m,_>1?m:m*_];A.height(j).width(V),W?.drawImage(L.dom,0,0,V,j),l(A.toDataURL(d.type))}),!g.target)throw"$.resize(): e.target is null";L.src(g.target.result)},c.readAsDataURL(d)})}e.resize=n;function a(d=1){return parseInt(getComputedStyle(document.documentElement).fontSize)*d}e.rem=a;function h(d,m,l){if(typeof m=="number")return Array(m).fill("").map(g=>{const L=c(d)?d[0](...d.slice(1)):e(d);return l&&l(L),L});{const g=[];for(const L of m){const T=d instanceof Function?d(...L):c(d)?d[0](...d.slice(1)):e(d);L instanceof Function?L(T):(L instanceof st||typeof L=="string")&&T.content(L),g.push(T)}return g}function c(g){return g instanceof Array&&g[0]instanceof Function}}e.builder=h})(f||(f={}));globalThis.$=f;var Te=Object.defineProperty,Fe=Object.getOwnPropertyDescriptor,we=(e,t,r,o)=>{for(var i=o>1?void 0:o?Fe(t,r):t,s=e.length-1,n;s>=0;s--)(n=e[s])&&(i=(o?n(t,r,i):n(i))||i);return o&&i&&Te(t,r,i),i};let Yt=class{id;content;events=new Zt().register("open","load");constructor(e){this.id=e}};Yt=we([de],Yt);var Me=Object.defineProperty,He=Object.getOwnPropertyDescriptor,ke=(e,t,r,o)=>{for(var i=o>1?void 0:o?He(t,r):t,s=e.length-1,n;s>=0;s--)(n=e[s])&&(i=(o?n(t,r,i):n(i))||i);return o&&i&&Me(t,r,i),i};let ie=class{routeMap=new Map;recordMap=new Map;$view;index=0;events=new Zt().register("pathchange","notfound","load");basePath;constructor(e,t){this.basePath=e,this.$view=t??new At}addRoute(e){e=$.multableResolve(e);for(const t of e)this.routeMap.set(t.path,t);return this}listen(){if(!history.state||!("index"in history.state)){const e={index:this.index,data:{}};history.replaceState(e,"")}else this.index=history.state.index;return addEventListener("popstate",this.popstate),$.routers.add(this),this.resolvePath(),this.events.fire("pathchange",{path:location.href,navigation:"Forward"}),this}open(e){if(e===void 0)return;if(e===location.href)return this;this.index+=1;const t={index:this.index,data:{}};return history.pushState(t,"",e),$.routers.forEach(r=>r.resolvePath()),this.events.fire("pathchange",{path:e,navigation:"Forward"}),this}back(){return history.back(),this}replace(e){return history.replaceState({index:this.index},"",e),$.routers.forEach(t=>t.resolvePath(e)),this.events.fire("pathchange",{path:e,navigation:"Forward"}),this}setStateData(e,t){return history.state.data===void 0&&(history.state.data={}),history.state.data[e]=t,this}popstate=(()=>{history.state.index>this.index||history.state.index{const s=this.recordMap.get(i);return s?(t=!0,s.content&&!this.$view.contains(s.content)&&this.$view.switchView(i),s.events.fire("open",{path:e,record:s}),!0):!1},o=(i,s,n)=>{const a=new Yt(i);let h=s.builder({params:n,record:a,loaded:()=>{a.events.fire("load",{path:i,record:a}),this.events.fire("load",{path:i})}});typeof h=="string"&&(h=new Bt(h)),a.content=h,this.recordMap.set(i,a),this.$view.setView(i,h).switchView(i),a.events.fire("open",{path:e,record:a}),t=!0};for(const[i,s]of this.routeMap.entries()){if(i instanceof Function){const m=i(e);m&&(r(m)||o(m,s,void 0));continue}const[n,a]=[i.split("/").map(m=>`/${m}`),e.split("/").map(m=>`/${m}`)];n.shift(),a.shift();const h={};let d="";for(let m=0;mi=!0;this.events.fire("notfound",{path:e,preventDefault:s}),i||this.$view.clear()}}};ie=ke([de],ie);Array.prototype.detype=function(...e){return this.filter(t=>{if(e.length)for(const r of e)return typeof t==typeof r;else return t!==void 0})};class Qt extends R{$value=$("input").class("value");$unit=$("span").staticClass("unit");$label=$("label").hide(!0);constructor(t){super("div"),this.staticClass("input-component",t),this.$value.id(t),this.$label.for(t)}unit(t){return this.$unit.content(t),this}value(t){return t===void 0?this:(this.$value.value(t.toString()),this)}label(t){return t&&this.$label.hide(!1),this.$label.content(t),this}min(t){return this.$value.min(t),this}max(t){return this.$value.max(t),this}}class Ct extends Qt{$color=$("input").type("color").class("color");constructor(t){super(t),this.addStaticClass("color"),this.$color.id(t),this.layout()}layout(){this.content([this.$label,$("div").content([this.$value,this.$color])]),this.$value.on("input",t=>this.$color.value(this.$value.value())),this.$color.on("input",t=>this.$value.value(this.$color.value()))}value(t){return super.value(t),this.$color.value(t),this}}class P extends Qt{$range=$("input").type("range").class("range");constructor(t){super(t),this.addStaticClass("range"),this.$range.id(t),this.$value,this.layout()}layout(){this.content([this.$label,$("div").content([this.$value,this.$range,this.$unit])]),this.$range.on("input",t=>{this.$value.value(`${this.$range.value()}`)}),this.$value.on("input",t=>{this.$range.value(this.$value.value())})}value(t){return arguments.length?t===void 0?this:(t.match(/[a-zA-Z]/)&&(t=t.replaceAll(/[a-zA-Z]/g,"")),super.value(t),this.$range.value(t),this):this.$value.value()}min(t){return super.min(t),this.$range.min(t),this}max(t){return super.max(t),this.$range.max(t),this}}class at extends Qt{$select=$("select");constructor(t){super(t),this.addStaticClass("select"),this.$select.id(t),this.layout()}layout(){this.content([this.$label,this.$select])}add(t){return this.$select.add(t),this}value(t){return super.value(t),this.$select.value(t),this}}var x,Y,E,Et;(function(e){e.HEX="HEX",e.RGB="RGB",e.HSL="HSL",e.CIELab="CIELab",e.CMYK="CMYK"})(x||(x={})),function(e){e.ANALOGOUS="ANALOGOUS",e.COMPLEMENTARY="COMPLEMENTARY",e.SPLIT_COMPLEMENTARY="SPLIT_COMPLEMENTARY",e.TRIADIC="TRIADIC",e.TETRADIC="TETRADIC",e.SQUARE="SQUARE"}(Y||(Y={})),function(e){e.ADDITIVE="ADDITIVE",e.SUBTRACTIVE="SUBTRACTIVE"}(E||(E={})),function(e){e.black="#000000",e.silver="#C0C0C0",e.gray="#808080",e.white="#FFFFFF",e.maroon="#800000",e.red="#FF0000",e.purple="#800080",e.fuchsia="#FF00FF",e.green="#008000",e.lime="#00FF00",e.olive="#808000",e.yellow="#FFFF00",e.navy="#000080",e.blue="#0000FF",e.teal="#008080",e.aqua="#00FFFF",e.orange="#FFA500",e.aliceblue="#F0F8FF",e.antiquewhite="#FAEBD7",e.aquamarine="#7FFFD4",e.azure="#F0FFFF",e.beige="#F5F5DC",e.bisque="#FFE4C4",e.blanchedalmond="#FFEBCD",e.blueviolet="#8A2BE2",e.brown="#A52A2A",e.burlywood="#DEB887",e.cadetblue="#5F9EA0",e.chartreuse="#7FFF00",e.chocolate="#D2691E",e.coral="#FF7F50",e.cornflowerblue="#6495ED",e.cornsilk="#FFF8DC",e.crimson="#DC143C",e.cyan="#00FFFF",e.darkblue="#00008B",e.darkcyan="#008B8B",e.darkgoldenrod="#B8860B",e.darkgray="#A9A9A9",e.darkgreen="#006400",e.darkgrey="#A9A9A9",e.darkkhaki="#BDB76B",e.darkmagenta="#8B008B",e.darkolivegreen="#556B2F",e.darkorange="#FF8C00",e.darkorchid="#9932CC",e.darkred="#8B0000",e.darksalmon="#E9967A",e.darkseagreen="#8FBC8F",e.darkslateblue="#483D8B",e.darkslategray="#2F4F4F",e.darkslategrey="#2F4F4F",e.darkturquoise="#00CED1",e.darkviolet="#9400D3",e.deeppink="#FF1493",e.deepskyblue="#00BFFF",e.dimgray="#696969",e.dimgrey="#696969",e.dodgerblue="#1E90FF",e.firebrick="#B22222",e.floralwhite="#FFFAF0",e.forestgreen="#228B22",e.gainsboro="#DCDCDC",e.ghostwhite="#F8F8FF",e.gold="#FFD700",e.goldenrod="#DAA520",e.greenyellow="#ADFF2F",e.grey="#808080",e.honeydew="#F0FFF0",e.hotpink="#FF69B4",e.indianred="#CD5C5C",e.indigo="#4B0082",e.ivory="#FFFFF0",e.khaki="#F0E68C",e.lavender="#E6E6FA",e.lavenderblush="#FFF0F5",e.lawngreen="#7CFC00",e.lemonchiffon="#FFFACD",e.lightblue="#ADD8E6",e.lightcoral="#F08080",e.lightcyan="#E0FFFF",e.lightgoldenrodyellow="#FAFAD2",e.lightgray="#D3D3D3",e.lightgreen="#90EE90",e.lightgrey="#D3D3D3",e.lightpink="#FFB6C1",e.lightsalmon="#FFA07A",e.lightseagreen="#20B2AA",e.lightskyblue="#87CEFA",e.lightslategray="#778899",e.lightslategrey="#778899",e.lightsteelblue="#B0C4DE",e.lightyellow="#FFFFE0",e.limegreen="#32CD32",e.linen="#FAF0E6",e.magenta="#FF00FF",e.mediumaquamarine="#66CDAA",e.mediumblue="#0000CD",e.mediumorchid="#BA55D3",e.mediumpurple="#9370DB",e.mediumseagreen="#3CB371",e.mediumslateblue="#7B68EE",e.mediumspringgreen="#00FA9A",e.mediumturquoise="#48D1CC",e.mediumvioletred="#C71585",e.midnightblue="#191970",e.mintcream="#F5FFFA",e.mistyrose="#FFE4E1",e.moccasin="#FFE4B5",e.navajowhite="#FFDEAD",e.oldlace="#FDF5E6",e.olivedrab="#6B8E23",e.orangered="#FF4500",e.orchid="#DA70D6",e.palegoldenrod="#EEE8AA",e.palegreen="#98FB98",e.paleturquoise="#AFEEEE",e.palevioletred="#DB7093",e.papayawhip="#FFEFD5",e.peachpuff="#FFDAB9",e.peru="#CD853F",e.pink="#FFC0CB",e.plum="#DDA0DD",e.powderblue="#B0E0E6",e.rosybrown="#BC8F8F",e.royalblue="#4169E1",e.saddlebrown="#8B4513",e.salmon="#FA8072",e.sandybrown="#F4A460",e.seagreen="#2E8B57",e.seashell="#FFF5EE",e.sienna="#A0522D",e.skyblue="#87CEEB",e.slateblue="#6A5ACD",e.slategray="#708090",e.slategrey="#708090",e.snow="#FFFAFA",e.springgreen="#00FF7F",e.steelblue="#4682B4",e.tan="#D2B48C",e.thistle="#D8BFD8",e.tomato="#FF6347",e.turquoise="#40E0D0",e.violet="#EE82EE",e.wheat="#F5DEB3",e.whitesmoke="#F5F5F5",e.yellowgreen="#9ACD32",e.rebeccapurple="#663399"}(Et||(Et={}));const he=Object.keys(Et),Ie={HEX:["R","G","B","A"],RGB:["R","G","B","A"],HSL:["H","S","L","A"],CIELab:["L","a","b","A"],CMYK:["C","M","Y","K","A"]},Vt={BGR:x.RGB,ABGR:x.RGB,HLS:x.HSL,AHLS:x.HSL,LAB:x.CIELab,ALAB:x.CIELab,CKMY:x.CMYK,ACKMY:x.CMYK};var lt;(function(e){e.NUMBER="number",e.BOOLEAN="boolean"})(lt||(lt={}));const O={[x.HEX]:/^#(?:([a-f\d])([a-f\d])([a-f\d])([a-f\d])?|([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?)$/i,[x.RGB]:/^rgba?\s*\(\s*(?:((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)(?:\s*,\s*((?:\d*\.)?\d+))?|((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)(?:\s*\/\s*((?:\d*\.)?\d+%?))?)\s*\)$/,[x.HSL]:/^hsla?\s*\(\s*(?:(-?(?:\d*\.)?\d+(?:deg|grad|rad|turn)?)\s*,\s*((?:\d*\.)?\d+)%\s*,\s*((?:\d*\.)?\d+)%(?:\s*,\s*((?:\d*\.)?\d+))?|(-?(?:\d*\.)?\d+(?:deg|grad|rad|turn)?)\s*((?:\d*\.)?\d+)%\s*((?:\d*\.)?\d+)%(?:\s*\/\s*((?:\d*\.)?\d+%?))?)\s*\)$/,[x.CIELab]:/^lab\s*\(\s*(?:((?:\d*\.)?\d+%?)\s*(-?(?:\d*\.)?\d+%?)\s*(-?(?:\d*\.)?\d+%?)(?:\s*\/\s*((?:\d*\.)?\d+%?))?)\s*\)$/,[x.CMYK]:/^(?:device-cmyk|cmyk)\s*\(\s*(?:((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)(?:\s*,\s*((?:\d*\.)?\d+))?|((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)(?:\s*\/\s*((?:\d*\.)?\d+%?))?)\s*\)$/},le=/^(-?(?:\d*\.)?\d+)((?:deg|grad|rad|turn)?)$/,S=/^(-?\d+(?:\.\d+)?|-?\.\d+)%$/,Xt=/^0x([a-f\d]{1,2})$/i,De=/\{(\d+)\}/g,Oe=/,( +|\d+)/g,Ge=/ +/,We="The provided string color doesn't have a correct format",Ne="The provided color object doesn't have the proper keys or format";var D,I,gt;(function(e){e.NONE="none",e.DEGREES="deg",e.GRADIANS="grad",e.RADIANS="rad",e.TURNS="turn"})(D||(D={})),function(e){e.NONE="none",e.PERCENT="percent"}(I||(I={})),function(e){e.DEVICE_CMYK="device-cmyk",e.CMYK="cmyk"}(gt||(gt={}));const X={decimals:6,legacyCSS:!1,spacesAfterCommas:!1,anglesUnit:D.NONE,rgbUnit:I.NONE,labUnit:I.NONE,cmykUnit:I.PERCENT,alphaUnit:I.NONE,cmykFunction:gt.DEVICE_CMYK},H=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),bt=e=>+`${e}`.replace(S,"$1"),q=e=>S.test(`${e}`)?bt(e):Math.min(+e,100),xt=e=>(e.length===1&&(e+=e),parseInt(e,16)),$t=e=>{const t=p(e,0).toString(16).toUpperCase();return t.length===1?`0x0${t}`:`0x${t}`},z=(e,t=!1)=>!t&&S.test(e)?Math.min(255*bt(e)/100,255):Xt.test(e)?(e.length===3&&(e+=e.slice(-1)),t?p(e)/255:p(e)):Math.min(+e,t?1:255),vt=e=>S.test(e)?w(125*bt(e)/100,-125,125):w(+e,-125,125),U=e=>Math.min(S.test(e)?bt(e)/100:+e,1),ue=e=>[...e].sort().join("").toUpperCase(),p=(e,t=6)=>{const r=Math.pow(10,t);return Math.round(+e*r)/r},w=(e,t,r)=>Math.max(t,Math.min(e,r)),ft=e=>{if(typeof e=="string"){const t=e.match(le),r=+t[1];switch(t[2]){case D.RADIANS:e=p(180*r/Math.PI);break;case D.TURNS:e=p(360*r);break;case D.GRADIANS:e=p(.9*r);break;case D.DEGREES:default:e=r}}return(e>360||e<0)&&(e-=360*Math.floor(e/360)),e},_e=(e,t)=>{let r;switch(t){case D.RADIANS:r=p((o=>o*Math.PI/180)(e));break;case D.TURNS:r=p(e/360);break;case D.GRADIANS:r=p(10/9*e);break;case D.DEGREES:case D.NONE:default:r=e}return r},y=(e,...t)=>{const r=[],o=[],i=[],s=[],n=[],a=[],h=Object.values(D),d=Object.values(I),m=Object.values(gt),l={legacyCSS:0,spacesAfterCommas:0,cmykFunction:0};for(const c of t)if(typeof c=="string"){if(r.push(c),c.includes(",")){l.legacyCSS++;const g=c.match(Oe);new Set(g).size===1&&Ge.test(g[0].slice(1))&&l.spacesAfterCommas++}if(c.match(O.HSL)){const g=c.match(O.HSL),L=g[1]||g[5],T=g[8],A=L.match(le)[2];o.push(A===""?D.NONE:A),a.push(S.test(T));continue}if(O.RGB.test(c)){const g=c.match(O.RGB),L=g[1]||g[5],T=g[2]||g[6],A=g[3]||g[7],W=g[8];i.push(S.test(L)&&S.test(T)&&S.test(A)),a.push(S.test(W));continue}if(O.CIELab.test(c)){const g=c.match(O.CIELab),L=g[1],T=g[2],A=g[3],W=g[4];s.push(S.test(L)&&S.test(T)&&S.test(A)),a.push(S.test(W));continue}if(c.match(O.CMYK)){const g=c.match(O.CMYK),L=g[1]||g[6],T=g[2]||g[7],A=g[3]||g[8],W=g[4]||g[9],_=g[10];n.push(S.test(L)&&S.test(T)&&S.test(A)&&S.test(W)),c.startsWith("cmyk")&&l.cmykFunction++,a.push(S.test(_))}}return{decimals:typeof e.decimals===lt.NUMBER?e.decimals:X.decimals,legacyCSS:typeof e.legacyCSS===lt.BOOLEAN?e.legacyCSS:!!(r.length&&l.legacyCSS===r.length)||X.legacyCSS,spacesAfterCommas:typeof e.spacesAfterCommas===lt.BOOLEAN?e.spacesAfterCommas:!!(r.length&&l.spacesAfterCommas===r.length)||X.spacesAfterCommas,anglesUnit:e.anglesUnit&&h.includes(e.anglesUnit)?e.anglesUnit:new Set(o).size===1?o[0]:X.anglesUnit,rgbUnit:e.rgbUnit&&d.includes(e.rgbUnit)?e.rgbUnit:new Set(i).size===1&&i[0]?I.PERCENT:X.rgbUnit,labUnit:e.labUnit&&d.includes(e.labUnit)?e.labUnit:new Set(s).size===1&&s[0]?I.PERCENT:X.labUnit,cmykUnit:e.cmykUnit&&d.includes(e.cmykUnit)?e.cmykUnit:new Set(n).size!==1||n[0]?X.cmykUnit:I.NONE,alphaUnit:e.alphaUnit&&d.includes(e.alphaUnit)?e.alphaUnit:new Set(a).size===1&&a[0]?I.PERCENT:X.alphaUnit,cmykFunction:e.cmykFunction&&m.includes(e.cmykFunction)?e.cmykFunction:n.length&&n.length===l.cmykFunction?gt.CMYK:X.cmykFunction}},Tt=e=>`${e}`in E,ce=[[.4360747,.3850649,.1430804],[.2225045,.7168786,.0606169],[.0139322,.0971045,.7141733]],Pe=[[3.1338561,-1.6168667,-.4906146],[-.9787684,1.9161415,.033454],[.0719453,-.2289914,1.4052427]],tt=ce.map(e=>e.reduce((t,r)=>t+r,0)),Ft=(e,t,r)=>(r<0&&(r+=6),r>=6&&(r-=6),p(r<1?255*((t-e)*r+e):r<3?255*t:r<4?255*((t-e)*(4-r)+e):255*e)),je=e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4,Ye=e=>e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055,pe=(e,t,r,o)=>{const i=[0,0,0],s=[e,t,r];return o.forEach((n,a)=>{n.forEach((h,d)=>{i[a]+=h*s[d]})}),i},F=(e,t,r)=>{t/=100;const o=(r/=100)<=.5?r*(t+1):r+t-r*t,i=2*r-o;return{R:Ft(i,o,(e/=60)+2),G:Ft(i,o,e),B:Ft(i,o,e-2)}},ot=(e,t,r,o=1)=>{e/=255,t/=255,r/=255,o=Math.min(o,1);const i=Math.max(e,t,r),s=Math.min(e,t,r),n=i-s;let a=0,h=0;const d=(i+s)/2;if(n!==0){switch(i){case e:a=(t-r)/n%6;break;case t:a=(r-e)/n+2;break;case r:a=(e-t)/n+4}a=p(60*a),a<0&&(a+=360),h=n/(1-Math.abs(2*d-1))}return{H:a,S:p(100*h),L:p(100*d),A:o}},it=(e,t,r)=>{const o=[e/255,t/255,r/255].map(je),i=pe(o[0],o[1],o[2],ce),s=((n,a,h)=>{const d=c=>c>.008856451679035631?Math.cbrt(c):c/.12841854934601665+.13793103448275862,m=d(n/tt[0]),l=d(a/tt[1]);return[116*l-16,500*(m-l),200*(l-d(h/tt[2]))]})(i[0],i[1],i[2]);return{L:s[0],a:s[1],b:s[2]}},te=(e,t,r)=>{const o=((s,n,a)=>{const h=c=>c>.20689655172413793?c**3:.12841854934601665*(c-.13793103448275862),d=(s+16)/116,m=n/500,l=a/200;return[tt[0]*h(d+m),tt[1]*h(d),tt[2]*h(d-l)]})(e,t,r),i=pe(o[0],o[1],o[2],Pe).map(Ye);return{R:w(255*i[0],0,255),G:w(255*i[1],0,255),B:w(255*i[2],0,255)}},ee=(e,t,r,o)=>({R:p(255*(1-e)*(o=1-o)),G:p(255*(1-t)*o),B:p(255*(1-r)*o)}),me=(e,t,r)=>{e/=255,t/=255,r/=255;const o=1-Math.max(e,t,r),i=1-o,s=i&&(i-t)/i,n=i&&(i-r)/i;return{C:p(100*(i&&(i-e)/i)),M:p(100*s),Y:p(100*n),K:p(100*o)}},se=(e,t)=>{if(e<0&&(e+=360),e>360&&(e-=360),e===360||e===0)return e;const r=[[0,120],[120,180],[180,240],[240,360]],o=[[0,60],[60,120],[120,240],[240,360]],i=t?o:r;let s=0,n=0,a=0,h=0;return(t?r:o).find((d,m)=>e>=d[0]&&ee?", ":",",dt=(e,t)=>{const r=ue(Object.keys(e));return Ie[Vt[r]].reduce((o,i,s)=>{const n=e[i];return n!==void 0&&o.push(t(n,s)),o},[])},ht=(e,t)=>e.replace(De,(r,o)=>`${t[+o-1]}`),yt=(e,t,r=!1)=>{const{alphaUnit:o,legacyCSS:i,decimals:s}=t;return o!==I.PERCENT||i&&!r?p(e,s):`${p(100*e,s)}%`},b={[x.HEX]:e=>{const t=dt(e,o=>(i=>{let s=p(i,0).toString(16).toUpperCase();return s.length===1&&(s=`0${s}`),s})(p(o))),r=t.length===4?"#{1}{2}{3}{4}":"#{1}{2}{3}";return ht(r,t)},[x.RGB]:(e,t)=>{const{decimals:r,legacyCSS:o,spacesAfterCommas:i,rgbUnit:s}=t,n=wt(i),a=dt(e,(d,m)=>s===I.PERCENT&&m<3?`${((l,c)=>p(l/255*100,c))(d,r)}%`:m===3?yt(d,t):p(d,r)),h=o?a.length===4?`rgba({1}${n}{2}${n}{3}${n}{4})`:`rgb({1}${n}{2}${n}{3})`:a.length===4?"rgb({1} {2} {3} / {4})":"rgb({1} {2} {3})";return ht(h,a)},[x.HSL]:(e,t)=>{const{decimals:r,legacyCSS:o,spacesAfterCommas:i,anglesUnit:s}=t,n=wt(i),a=dt(e,(d,m)=>m===0&&s!==D.NONE?`${p(_e(d,s),r)}${s}`:m===3?yt(d,t):p(d,r)),h=o?a.length===4?`hsla({1}${n}{2}%${n}{3}%${n}{4})`:`hsl({1}${n}{2}%${n}{3}%)`:a.length===4?"hsl({1} {2}% {3}% / {4})":"hsl({1} {2}% {3}%)";return ht(h,a)},[x.CIELab]:(e,t)=>{const{decimals:r,labUnit:o}=t,i=dt(e,(n,a)=>{if(a===0){const h=p(q(n),r);return o===I.PERCENT?`${h}%`:`${h}`}return a<3?o===I.PERCENT?`${((h,d)=>p(h/125*100,d))(n,r)}%`:p(n,r):yt(n,t,!0)}),s=i.length===4?"lab({1} {2} {3} / {4})":"lab({1} {2} {3})";return ht(s,i)},[x.CMYK]:(e,t)=>{const{decimals:r,legacyCSS:o,spacesAfterCommas:i,cmykUnit:s,cmykFunction:n}=t,a=wt(i),h=dt(e,(m,l)=>s===I.PERCENT&&l<4?`${p(m,r)}%`:l===4?yt(m,t):p(m/100,r)),d=o?h.length===5?`${n}({1}${a}{2}${a}{3}${a}{4}${a}{5})`:`${n}({1}${a}{2}${a}{3}${a}{4})`:h.length===5?`${n}({1} {2} {3} {4} / {5})`:`${n}({1} {2} {3} {4})`;return ht(d,h)}},M=e=>(typeof e=="string"&&(e=S.test(e)?bt(e)/100:+e),isNaN(+e)||e>1?1:p(e)),nt=(e,t,r)=>t.reduce((o,i)=>[...o,{...e,H:r===E.ADDITIVE?ft(e.H+i):ft(se(se(e.H,!1)+i,!0))}],[{...e}]),Ve=(e,t)=>nt(e,[30,-30],t),Xe=(e,t)=>nt(e,[180],t),Ke=(e,t)=>nt(e,[150,-150],t),Ue=(e,t)=>nt(e,[120,-120],t),ze=(e,t)=>nt(e,[60,-120,180],t),qe=(e,t)=>nt(e,[90,-90,180],t),B=e=>typeof e=="string"?(t=>{let r;if(Object.keys(x).some(o=>{if(O[o].test(t))return r=o,!0}),!r&&~he.indexOf(t)&&(r=x.HEX),!r)throw new Error(We);return r})(e):(t=>{let r,o=!1;const i=ue(Object.keys(t));if(Vt[i]&&(r=Vt[i]),r&&r===x.RGB){const s=Object.entries(t).some(a=>!Xt.test(`${a[1]}`)),n=Object.entries(t).some(a=>!(S.test(`${a[1]}`)||!Xt.test(`${a[1]}`)&&!isNaN(+a[1])&&+a[1]<=255));s&&n&&(o=!0),s||(r=x.HEX)}if(!r||o)throw new Error(Ne);return r})(e),Je={[x.HEX](e){const t=(~he.indexOf(e)?Et[e]:e).match(O.HEX),r={R:xt(t[1]||t[5]),G:xt(t[2]||t[6]),B:xt(t[3]||t[7])},o=t[4]||t[8];return o!==void 0&&(r.A=xt(o)/255),r},[x.RGB](e){const t=e.match(O.RGB),r=z(t[1]||t[5]),o=z(t[2]||t[6]),i=z(t[3]||t[7]),s=t[4]||t[8],n={R:Math.min(r,255),G:Math.min(o,255),B:Math.min(i,255)};return s!==void 0&&(n.A=M(s)),n},[x.HSL](e){const t=e.match(O.HSL),r=ft(t[1]||t[5]),o=q(t[2]||t[6]),i=q(t[3]||t[7]),s=t[4]||t[8],n=F(r,o,i);return s!==void 0&&(n.A=M(s)),n},[x.CIELab](e){const t=e.match(O.CIELab),r=q(t[1]),o=vt(t[2]),i=vt(t[3]),s=t[4],n=te(r,o,i);return s!==void 0&&(n.A=M(s)),n},[x.CMYK](e){const t=e.match(O.CMYK),r=U(t[1]||t[6]),o=U(t[2]||t[7]),i=U(t[3]||t[8]),s=U(t[4]||t[9]),n=t[5]||t[10],a=ee(r,o,i,s);return n!==void 0&&(a.A=M(n)),a}},Ze={[x.HEX](e){const t={R:z(`${e.R}`),G:z(`${e.G}`),B:z(`${e.B}`)};return H(e,"A")&&(t.A=Math.min(z(`${e.A}`,!0),1)),t},[x.RGB](e){return this.HEX(e)},[x.HSL](e){const t=q(`${e.S}`),r=q(`${e.L}`),o=F(ft(e.H),t,r);return H(e,"A")&&(o.A=M(e.A)),o},[x.CIELab](e){const t=q(`${e.L}`),r=vt(`${e.a}`),o=vt(`${e.b}`),i=te(t,r,o);return H(e,"A")&&(i.A=M(e.A)),i},[x.CMYK](e){const t=U(`${e.C}`),r=U(`${e.M}`),o=U(`${e.Y}`),i=U(`${e.K}`),s=ee(t,r,o,i);return H(e,"A")&&(s.A=M(e.A)),s}},J=(e,t=B(e))=>typeof e=="string"?Je[t](e):Ze[t](e),u={[x.HEX]:e=>({R:$t(e.R),G:$t(e.G),B:$t(e.B)}),HEXA(e){const t=u.HEX(e);return t.A=H(e,"A")?$t(255*e.A):"0xFF",t},[x.RGB](e,t){const r=Qe(e,t);return H(r,"A")&&delete r.A,r},RGBA(e,t){const r=u.RGB(e,t);return r.A=H(e,"A")?p(e.A):1,r},[x.HSL](e,t){const r=ot(e.R,e.G,e.B);return delete r.A,Kt(r,t)},HSLA(e,t){const r=u.HSL(e,t);return r.A=H(e,"A")?p(e.A,t):1,r},[x.CIELab](e,t){const r=it(e.R,e.G,e.B);return tr(r,t)},CIELabA(e,t){const r=u.CIELab(e,t);return r.A=H(e,"A")?p(e.A,t):1,r},[x.CMYK]:(e,t)=>er(me(e.R,e.G,e.B),t),CMYKA(e,t){const r=u.CMYK(e,t);return r.A=H(e,"A")?p(e.A,t):1,r}},Lt=(e,t,r,o)=>{const i=B(e),s=typeof e=="string",n=J(e,i),a=typeof e=="string"&&H(n,"A")||typeof e!="string"&&H(e,"A"),h=ot(n.R,n.G,n.B,n.A);a||delete h.A;const d=r?h.L/(t+1):(100-h.L)/(t+1),m=Array(t).fill(null).map((l,c)=>({...h,L:h.L+d*(c+1)*(1-2*+r)}));switch(i){case x.HEX:default:return m.map(l=>{const c=F(l.H,l.S,l.L);return a&&(c.A=l.A),s?a?b.HEX({...c,A:p(255*c.A)}):b.HEX(c):a?u.HEXA(c):u.HEX(c)});case x.RGB:return m.map(l=>{const c=F(l.H,l.S,l.L);return a&&(c.A=l.A),s?b.RGB(c,o):a?u.RGBA(c,o.decimals):u.RGB(c,o.decimals)});case x.HSL:return m.map(l=>s?b.HSL(l,o):a?u.HSLA({...F(l.H,l.S,l.L),A:l.A},o.decimals):u.HSL(F(l.H,l.S,l.L),o.decimals));case x.CIELab:return m.map(l=>{const c=F(l.H,l.S,l.L);return s?b.CIELab(a?u.CIELabA(c,o.decimals):u.CIELab(c,o.decimals),o):a?u.CIELabA({...c,A:l.A},o.decimals):u.CIELab(c,o.decimals)})}},Q={buildHarmony(e,t,r,o){const i=B(e),s=J(e,i),n=ot(s.R,s.G,s.B,s.A),a=typeof e=="string"&&H(s,"A")||typeof e!="string"&&H(e,"A"),h=typeof e=="string";switch(i){case x.HEX:default:return a?this.HEXA(Kt(n,0),t,r,h):this.HEX(Kt(n,0),t,r,h);case x.HSL:return a?this.HSLA(n,t,r,h,o):this.HSL(n,t,r,h,o);case x.RGB:return a?this.RGBA(n,t,r,h,o):this.RGB(n,t,r,h,o);case x.CIELab:return a?this.CIELabA(n,t,r,h,o):this.CIELab(n,t,r,h,o)}},[x.HEX]:(e,t,r,o)=>t(e,r).map(i=>o?b.HEX(F(i.H,i.S,i.L)):u.HEX(F(i.H,i.S,i.L))),HEXA:(e,t,r,o)=>t(e,r).map(i=>o?b.HEX({...F(i.H,i.S,i.L),A:255*M(i.A)}):u.HEXA({...F(i.H,i.S,i.L),A:M(i.A)})),[x.RGB]:(e,t,r,o,i)=>t(e,r).map(s=>o?b.RGB(F(s.H,s.S,s.L),i):u.RGB(F(s.H,s.S,s.L),i.decimals)),RGBA:(e,t,r,o,i)=>t(e,r).map(s=>o?b.RGB({...F(s.H,s.S,s.L),A:M(s.A)},i):u.RGBA({...F(s.H,s.S,s.L),A:M(s.A)},i.decimals)),[x.HSL]:(e,t,r,o,i)=>t(e,r).map(s=>o?b.HSL({H:s.H,S:s.S,L:s.L},i):u.HSL(F(s.H,s.S,s.L),i.decimals)),HSLA:(e,t,r,o,i)=>t(e,r).map(s=>o?b.HSL({...s,A:M(s.A)},i):u.HSLA({...F(s.H,s.S,s.L),A:M(s.A)},i.decimals)),[x.CIELab]:(e,t,r,o,i)=>t(e,r).map(s=>{const n=F(s.H,s.S,s.L);return o?b.CIELab(it(n.R,n.G,n.B),i):u.CIELab(n,i.decimals)}),CIELabA:(e,t,r,o,i)=>t(e,r).map(s=>{const n=F(s.H,s.S,s.L);return o?b.CIELab({...it(n.R,n.G,n.B),A:M(s.A)},i):u.CIELabA({...n,A:M(s.A)},i.decimals)})},C={mix(e,t){const r=e.map(n=>{const a=B(n);return J(n,a)}),o=t===E.SUBTRACTIVE?r.map(n=>{const a=((h,d,m)=>{const l=Math.min(h,d,m),c=Math.min(255-h,255-d,255-m),g=h-l,L=d-l,T=m-l,A=Math.min(g,L),W=g-A,_=(L+A)/2,V=(T+L-A)/2,j=Math.max(W,_,V)/Math.max(g,L,T),St=isNaN(j)||j===1/0||j<=0?1:j;return{R:W/St+c,Y:_/St+c,B:V/St+c}})(n.R,n.G,n.B);return H(n,"A")&&(a.A=n.A),a}):null;function i(n){const a=t===E.ADDITIVE?{R:0,G:0,B:0,A:0}:{R:0,Y:0,B:0,A:0};return n.reduce((h,d)=>{const m=H(d,"A")?d.A:1,l={R:Math.min(h.R+d.R*m,255),B:Math.min(h.B+d.B*m,255),A:1-(1-m)*(1-h.A)},c="G"in h?h.G:h.Y,g="G"in d?d.G:d.Y;return{...l,...t===E.ADDITIVE?{G:Math.min(c+g*m,255)}:{Y:Math.min(c+g*m,255)}}},a)}let s;if(t===E.ADDITIVE)s=i(r);else{const n=i(o);s=((a,h,d)=>{const m=Math.min(a,h,d),l=Math.min(255-a,255-h,255-d),c=a-m,g=h-m,L=d-m,T=Math.min(g,L),A=c+g-T,W=g+T,_=2*(L-T),V=Math.max(A,W,_)/Math.max(c,g,L),j=isNaN(V)||V===1/0||V<=0?1:V;return{R:A/j+l,G:W/j+l,B:_/j+l}})(n.R,n.Y,n.B),s.A=n.A}return{R:p(s.R),G:p(s.G),B:p(s.B),A:w(s.A,0,1)}},[x.HEX](e,t,r){const o=this.mix(e,t);return delete o.A,r?b.HEX(o):u.HEX(o)},HEXA(e,t,r){const o=this.mix(e,t);return o.A=r?255*M(o.A):M(o.A),r?b.HEX(o):u.HEXA(o)},[x.RGB](e,t,r,o){const i=this.mix(e,t);return delete i.A,r?b.RGB(i,o):u.RGB(i,o.decimals)},RGBA(e,t,r,o){const i=this.mix(e,t);return r?b.RGB(i,o):u.RGBA(i,o.decimals)},[x.HSL](e,t,r,o){const i=this.mix(e,t),s=ot(i.R,i.G,i.B);return delete i.A,delete s.A,r?b.HSL(s,o):u.HSL(i,o.decimals)},HSLA(e,t,r,o){const i=this.mix(e,t),s=ot(i.R,i.G,i.B,i.A);return r?b.HSL(s,o):u.HSLA(i,o.decimals)},[x.CIELab](e,t,r,o){const i=this.mix(e,t),s=it(i.R,i.G,i.B);return delete i.A,r?b.CIELab(s,o):u.CIELabA(i,o.decimals)},CIELabA(e,t,r,o){const i=this.mix(e,t),s=it(i.R,i.G,i.B);return H(i,"A")&&(s.A=i.A),r?b.CIELab(s,o):u.CIELabA(i,o.decimals)}},Qe=(e,t)=>({R:p(e.R,t),G:p(e.G,t),B:p(e.B,t),...H(e,"A")?{A:p(e.A,t)}:{}}),Kt=(e,t)=>({H:p(e.H,t),S:p(e.S,t),L:p(e.L,t),...H(e,"A")?{A:p(e.A,t)}:{}}),tr=(e,t)=>({L:p(e.L,t),a:p(e.a,t),b:p(e.b,t)}),er=(e,t)=>({C:p(e.C,t),M:p(e.M,t),Y:p(e.Y,t),K:p(e.K,t)}),k=(e,t,r,o)=>o(J(e,t),r),v=(e,t,r,o,i)=>(r<1&&(r=5),((n,a,h)=>{const d=h-1,m=(a.R-n.R)/d,l=(a.G-n.G)/d,c=(a.B-n.B)/d,g=M(n.A),L=(M(a.A)-g)/d;return Array(h).fill(null).map((T,A)=>A===0?n:A===d?a:{R:p(n.R+m*A),G:p(n.G+l*A),B:p(n.B+c*A),A:p(g+L*A)})})(J(e),J(t),r).map(n=>i(n,o))),Mt=(e,t,r,o)=>({[Y.ANALOGOUS]:Q.buildHarmony(t,Ve,r,o),[Y.COMPLEMENTARY]:Q.buildHarmony(t,Xe,r,o),[Y.SPLIT_COMPLEMENTARY]:Q.buildHarmony(t,Ke,r,o),[Y.TRIADIC]:Q.buildHarmony(t,Ue,r,o),[Y.TETRADIC]:Q.buildHarmony(t,ze,r,o),[Y.SQUARE]:Q.buildHarmony(t,qe,r,o)})[e];class N{constructor(t,r={}){this._options=y(r,t),this.rgb=J(t),this.updateHSL(),this.updateLab(),this.updateCMYK()}updateRGB(){this.rgb={...F(this.hsl.H,this.hsl.S,this.hsl.L),A:this.hsl.A}}updateRGBFromCMYK(){this.rgb={...ee(this.cmyk.C,this.cmyk.M,this.cmyk.Y,this.cmyk.K),A:this.rgb.A}}updateRGBFromLab(){this.rgb={...te(this.lab.L,this.lab.a,this.lab.b),A:this.rgb.A}}updateHSL(){this.hsl=ot(this.rgb.R,this.rgb.G,this.rgb.B,this.rgb.A)}updateLab(){this.lab={...it(this.rgb.R,this.rgb.G,this.rgb.B),A:this.rgb.A}}updateCMYK(){this.cmyk=me(this.rgb.R,this.rgb.G,this.rgb.B)}setOptions(t={}){return this._options={...this._options,...t},this}setH(t){return this.hsl.H=ft(t),this.updateRGB(),this.updateLab(),this.updateCMYK(),this}setS(t){return this.hsl.S=w(t,0,100),this.updateRGB(),this.updateLab(),this.updateCMYK(),this}setL(t){return this.hsl.L=w(t,0,100),this.updateRGB(),this.updateLab(),this.updateCMYK(),this}setR(t){this.rgb.R=w(t,0,255),this.updateHSL(),this.updateLab(),this.updateCMYK()}setG(t){return this.rgb.G=w(t,0,255),this.updateHSL(),this.updateLab(),this.updateCMYK(),this}setB(t){return this.rgb.B=w(t,0,255),this.updateHSL(),this.updateLab(),this.updateCMYK(),this}setCIEL(t){return this.lab.L=w(t,0,100),this.updateRGBFromLab(),this.updateHSL(),this.updateCMYK(),this}setCIEa(t){return this.lab.a=w(t,-125,125),this.updateRGBFromLab(),this.updateHSL(),this.updateCMYK(),this}setCIEb(t){return this.lab.b=w(t,-125,125),this.updateRGBFromLab(),this.updateHSL(),this.updateCMYK(),this}setA(t){return this.hsl.A=this.rgb.A=w(t,0,1),this}setC(t){return this.cmyk.C=w(t,0,100),this.updateRGBFromCMYK(),this.updateHSL(),this.updateLab(),this}setM(t){return this.cmyk.M=w(t,0,100),this.updateRGBFromCMYK(),this.updateHSL(),this.updateLab(),this}setY(t){return this.cmyk.Y=w(t,0,100),this.updateRGBFromCMYK(),this.updateHSL(),this.updateLab(),this}setK(t){return this.cmyk.K=w(t,0,100),this.updateRGBFromCMYK(),this.updateHSL(),this.updateLab(),this}get options(){return this._options}get H(){return p(this.hsl.H,this.options.decimals)}get S(){return p(this.hsl.S,this.options.decimals)}get L(){return p(this.hsl.L,this.options.decimals)}get CIEL(){return p(this.lab.L,this.options.decimals)}get CIEa(){return p(this.lab.a,this.options.decimals)}get CIEb(){return p(this.lab.b,this.options.decimals)}get R(){return p(this.rgb.R,this.options.decimals)}get G(){return p(this.rgb.G,this.options.decimals)}get B(){return p(this.rgb.B,this.options.decimals)}get A(){return p(this.hsl.A,this.options.decimals)}get C(){return p(this.cmyk.C,this.options.decimals)}get M(){return p(this.cmyk.M,this.options.decimals)}get Y(){return p(this.cmyk.Y,this.options.decimals)}get K(){return p(this.cmyk.K,this.options.decimals)}get HEXObject(){return u.HEX(this.rgb)}get HEXAObject(){return u.HEXA(this.rgb)}get RGBObject(){return{R:this.R,G:this.G,B:this.B}}get RGBAObject(){return{...this.RGBObject,A:this.A}}get HSLObject(){return{H:this.H,S:this.S,L:this.L}}get HSLAObject(){return{...this.HSLObject,A:this.A}}get CIELabObject(){return{L:this.CIEL,a:this.CIEa,b:this.CIEb}}get CIELabAObject(){return{...this.CIELabObject,A:this.A}}get CMYKObject(){return{C:this.C,M:this.M,Y:this.Y,K:this.K}}get CMYKAObject(){return{...this.CMYKObject,A:this.A}}get HEX(){return b.HEX({R:this.R,G:this.G,B:this.B})}get HEXA(){return b.HEX({R:this.R,G:this.G,B:this.B,A:255*this.A})}get RGB(){return b.RGB({R:this.R,G:this.G,B:this.B},this.options)}get RGBA(){return b.RGB({R:this.R,G:this.G,B:this.B,A:this.A},this.options)}get HSL(){return b.HSL({H:this.H,S:this.S,L:this.L},this.options)}get HSLA(){return b.HSL({H:this.H,S:this.S,L:this.L,A:this.A},this.options)}get CIELab(){return b.CIELab({L:this.CIEL,a:this.CIEa,b:this.CIEb},this.options)}get CIELabA(){return b.CIELab({L:this.CIEL,a:this.CIEa,b:this.CIEb,A:this.A},this.options)}get CMYK(){return b.CMYK({C:this.C,M:this.M,Y:this.Y,K:this.K},this.options)}get CMYKA(){return b.CMYK({C:this.C,M:this.M,Y:this.Y,K:this.K,A:this.A},this.options)}static toHEXObject(t){const r=B(t);return k(t,r,0,u.HEX)}static toHEX(t){return b.HEX(N.toHEXObject(t))}static toHEXAObject(t){const r=B(t);return k(t,r,0,u.HEXA)}static toHEXA(t){return b.HEX(N.toHEXAObject(t))}static toRGBObject(t,r={}){const o=B(t);return k(t,o,r.decimals,u.RGB)}static toRGB(t,r={}){const o=B(t),i=y(r,t),s=k(t,o,r.decimals,u.RGB);return b.RGB(s,i)}static toRGBAObject(t,r={}){const o=B(t);return k(t,o,r.decimals,u.RGBA)}static toRGBA(t,r={}){const o=B(t),i=y(r,t),s=k(t,o,r.decimals,u.RGBA);return b.RGB(s,i)}static toHSLObject(t,r={}){const o=B(t);return k(t,o,r.decimals,u.HSL)}static toHSL(t,r={}){const o=B(t),i=y(r,t),s=k(t,o,r.decimals,u.HSL);return b.HSL(s,i)}static toHSLAObject(t,r={}){const o=B(t);return k(t,o,r.decimals,u.HSLA)}static toHSLA(t,r={}){const o=B(t),i=y(r,t),s=k(t,o,r.decimals,u.HSLA);return b.HSL(s,i)}static toCIELabObject(t,r={}){const o=B(t);return k(t,o,r.decimals,u.CIELab)}static toCIELab(t,r={}){const o=B(t),i=y(r,t),s=k(t,o,r.decimals,u.CIELab);return b.CIELab(s,i)}static toCIELabAObject(t,r={}){const o=B(t);return k(t,o,r.decimals,u.CIELabA)}static toCIELabA(t,r={}){const o=B(t),i=y(r,t),s=k(t,o,r.decimals,u.CIELabA);return b.CIELab(s,i)}static toCMYKObject(t,r={}){const o=B(t);return k(t,o,r.decimals,u.CMYK)}static toCMYK(t,r={}){const o=B(t),i=y(r,t),s=k(t,o,r.decimals,u.CMYK);return b.CMYK(s,i)}static toCMYKAObject(t,r={}){const o=B(t);return k(t,o,r.decimals,u.CMYKA)}static toCMYKA(t,r={}){const o=B(t),i=y(r,t),s=k(t,o,r.decimals,u.CMYKA);return b.CMYK(s,i)}static getBlendHEXObject(t,r,o=5){return v(t,r,o,0,u.HEX)}static getBlendHEX(t,r,o=5){return N.getBlendHEXObject(t,r,o).map(i=>b.HEX(i))}static getBlendHEXAObject(t,r,o=5){return v(t,r,o,0,u.HEXA)}static getBlendHEXA(t,r,o=5){return N.getBlendHEXAObject(t,r,o).map(i=>b.HEX(i))}static getBlendRGBObject(t,r,o,i){return typeof o=="number"?v(t,r,o,i?.decimals,u.RGB):v(t,r,5,o?.decimals,u.RGB)}static getBlendRGB(t,r,o,i){return typeof o=="number"?v(t,r,o,i?.decimals,u.RGB).map(s=>b.RGB(s,y(i||{},t,r))):v(t,r,5,o?.decimals,u.RGB).map(s=>b.RGB(s,y(o||{},t,r)))}static getBlendRGBAObject(t,r,o,i){return typeof o=="number"?v(t,r,o,i?.decimals,u.RGBA):v(t,r,5,o?.decimals,u.RGBA)}static getBlendRGBA(t,r,o,i){return typeof o=="number"?v(t,r,o,i?.decimals,u.RGBA).map(s=>b.RGB(s,y(i||{},t,r))):v(t,r,5,o?.decimals,u.RGBA).map(s=>b.RGB(s,y(o||{},t,r)))}static getBlendHSLObject(t,r,o,i){return v(t,r,typeof o=="number"?o:5,i?.decimals,u.HSL)}static getBlendHSL(t,r,o,i){return typeof o=="number"?v(t,r,o,i?.decimals,u.HSL).map(s=>b.HSL(s,y(i||{},t,r))):v(t,r,5,o?.decimals,u.HSL).map(s=>b.HSL(s,y(o||{},t,r)))}static getBlendHSLAObject(t,r,o,i){return typeof o=="number"?v(t,r,o,i?.decimals,u.HSLA):v(t,r,5,o?.decimals,u.HSLA)}static getBlendHSLA(t,r,o,i){return typeof o=="number"?v(t,r,o,i?.decimals,u.HSLA).map(s=>b.HSL(s,y(i||{},t,r))):v(t,r,5,o?.decimals,u.HSLA).map(s=>b.HSL(s,y(o||{},t,r)))}static getBlendCIELabObject(t,r,o,i){return typeof o=="number"?v(t,r,o,i?.decimals,u.CIELab):v(t,r,5,o?.decimals,u.CIELab)}static getBlendCIELab(t,r,o,i){return typeof o=="number"?v(t,r,o,i?.decimals,u.CIELab).map(s=>b.CIELab(s,y(i||{},t,r))):v(t,r,5,o?.decimals,u.CIELab).map(s=>b.CIELab(s,y(o||{},t,r)))}static getBlendCIELabAObject(t,r,o,i){return typeof o=="number"?v(t,r,o,i?.decimals,u.CIELabA):v(t,r,5,o?.decimals,u.CIELabA)}static getBlendCIELabA(t,r,o,i){return typeof o=="number"?v(t,r,o,i?.decimals,u.CIELabA).map(s=>b.CIELab(s,y(i||{},t,r))):v(t,r,5,o?.decimals,u.CIELabA).map(s=>b.CIELab(s,y(o||{},t,r)))}static getMixHEXObject(t,r=E.ADDITIVE){return C.HEX(t,r,!1)}static getMixHEX(t,r=E.ADDITIVE){return C.HEX(t,r,!0)}static getMixHEXAObject(t,r=E.ADDITIVE){return C.HEXA(t,r,!1)}static getMixHEXA(t,r=E.ADDITIVE){return C.HEXA(t,r,!0)}static getMixRGBObject(t,r,o){return typeof r=="string"?C.RGB(t,r,!1,y(o||{},...t)):C.RGB(t,E.ADDITIVE,!1,y(r||{},...t))}static getMixRGB(t,r,o){return typeof r=="string"?C.RGB(t,r,!0,y(o||{},...t)):C.RGB(t,E.ADDITIVE,!0,y(r||{},...t))}static getMixRGBAObject(t,r,o){return typeof r=="string"?C.RGBA(t,r,!1,y(o||{},...t)):C.RGBA(t,E.ADDITIVE,!1,y(r||{},...t))}static getMixRGBA(t,r,o){return typeof r=="string"?C.RGBA(t,r,!0,y(o||{},...t)):C.RGBA(t,E.ADDITIVE,!0,y(r||{},...t))}static getMixHSLObject(t,r,o){return typeof r=="string"?C.HSL(t,r,!1,y(o||{},...t)):C.HSL(t,E.ADDITIVE,!1,y(r||{},...t))}static getMixHSL(t,r,o){return typeof r=="string"?C.HSL(t,r,!0,y(o||{},...t)):C.HSL(t,E.ADDITIVE,!0,y(r||{},...t))}static getMixHSLAObject(t,r,o){return typeof r=="string"?C.HSLA(t,r,!1,y(o||{},...t)):C.HSLA(t,E.ADDITIVE,!1,y(r||{},...t))}static getMixHSLA(t,r,o){return typeof r=="string"?C.HSLA(t,r,!0,y(o||{},...t)):C.HSLA(t,E.ADDITIVE,!0,y(r||{},...t))}static getMixCIELabObject(t,r,o){return typeof r=="string"?C.CIELab(t,r,!1,y(o||{},...t)):C.CIELab(t,E.ADDITIVE,!1,y(r||{},...t))}static getMixCIELab(t,r,o){return typeof r=="string"?C.CIELab(t,r,!0,y(o||{},...t)):C.CIELab(t,E.ADDITIVE,!0,y(r||{},...t))}static getMixCIELabAObject(t,r,o){return typeof r=="string"?C.CIELabA(t,r,!1,y(o||{},...t)):C.CIELabA(t,E.ADDITIVE,!1,y(r||{},...t))}static getMixCIELabA(t,r,o){return typeof r=="string"?C.CIELabA(t,r,!0,y(o||{},...t)):C.CIELabA(t,E.ADDITIVE,!0,y(r||{},...t))}static getShades(t,r,o){return typeof r=="number"?Lt(t,r,!0,y(o||{},t)):Lt(t,5,!0,y(r||{},t))}static getTints(t,r,o){return typeof r=="number"?Lt(t,r,!1,y(o||{},t)):Lt(t,5,!1,y(r||{},t))}static getHarmony(t,r,o,i){return`${r}`in Y?Mt(r,t,Tt(o)?o:E.ADDITIVE,y(Tt(o)?i||{}:o||{},t)):Tt(r)?Mt(Y.COMPLEMENTARY,t,r,y(o||{},t)):Mt(Y.COMPLEMENTARY,t,E.ADDITIVE,y(r||{},t))}}function G(e){return e.charAt(0).toUpperCase()+e.slice(1)}function rr(e){return e.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).toString().replaceAll(",","")}class or extends R{type;name;flex_hidden$=$.state(!1);constructor(t,r){super("div"),this.staticClass("style-panel"),this.type=r,this.name=t,this.layout(),this.on("input",o=>{this.update()})}update(){return this.role_model_list.forEach(([t,r])=>{r.update(this),K.updateStyle(this.name,r,[t])}),this.flex_hidden$.set(this.data?.display!=="flex"),this}layout(){if(!this.roles.length)return this.clear();const t=this.data.backgroundColor==="??"?{HEX:"??",A:"??"}:new N(this.data.backgroundColor),r=this.data.color==="??"?{HEX:"??",A:"??"}:new N(this.data.color);this.content([$("section").content([$("h3").content("Properties"),$("div").content([new at("display").label("Display").add([["block","inline","flex","none"].map(o=>$("option").content(o).value(o))]).value(this.data.display),new P("opacity").value(this.data.opacity).unit("px").min(0).max(1).label("Opacity").self(o=>{o.$range.step(.01),o.$value.step(.1)})])]),$("section").content([$("h3").content("Flex"),$("div").content([new at("flex-direction").label("Direction").add([["row","column","row-reverse","column-reverse"].map(o=>$("option").content(o).value(o))]).value(this.data.flexDirection),new P("gap").value(this.data.gap).unit("px").min(0).max(100).label("Gap"),new at("justify-content").label("Justify Content").add([["start","center","end","stretch","space-around","space-evenly","space-between"].map(o=>$("option").content(o).value(o))]).value(this.data.justifyContent),new at("align-items").label("Align Items").add([["start","center","end","stretch","space-around","space-evenly","space-between"].map(o=>$("option").content(o).value(o))]).value(this.data.alignItems)])]).hide(this.flex_hidden$),this.type==="text"?$("section").content([$("h3").content("Font"),$("div").content([new P("font-size").value(this.data.fontSize).unit("px").min(1).label("Size"),new P("font-weight").min(100).max(900).label("Weight").value(this.data.fontWeight).self(o=>o.$range.step(100)),new Ct("font-color").value(this.data.color).label("Color"),new P("font-color-transparent").value(r.A.toString()).unit("px").min(0).max(1).label("Transparent").self(o=>{o.$range.step(.01),o.$value.step(.1)})])]):void 0,this.type==="image"?$("section").content([$("h3").content("Dimension"),$("div").content([new P("height").value(this.data.height).unit("px").min(1).label("Height"),new P("width").value(this.data.width).unit("px").min(1).label("Width")])]):void 0,$("section").content([$("h3").content("Background"),$("div").content([new Ct("background-color").value(t.HEX).label("Color"),new P("background-color-transparent").value(t.A.toString()).unit("px").min(0).max(1).label("Transparent").self(o=>{o.$range.step(.01),o.$value.step(.1)})])]),$("section").content([$("h3").content("Padding"),$("div").content([["left","top","right","bottom"].map(o=>new P(`padding-${o}`).value(this.data[`padding${G(o)}`]).unit("px").label(G(o)))])]),$("section").content([$("h3").content("Margin"),$("div").content([["left","top","right","bottom"].map(o=>new P(`margin-${o}`).value(this.data[`margin${G(o)}`]).unit("px").label(G(o)))])]),$("section").content([$("header").content([$("h3").content("Border"),$("div").content([$("label").content("Link").for("border-link"),$("input").id("border-link").type("checkbox").checked(!0)])]),$("div").content([["left","top","right","bottom"].map(o=>$("section").content([$("h4").content(G(o)),$("div").content([new P(`border-${o}-width`).value(this.data[`border${G(o)}Width`]).unit("px").label("Width"),new at(`border-${o}-style`).label("Style").add([["solid","dashed","doubled","dotted","groove","outset","inset","ridge","hidden"].map(i=>$("option").value(i).content(i).id(i))]).value(this.data[`border${G(o)}Style`]),new Ct(`border-${o}-color`).value(this.data[`border${G(o)}Color`]).label("Color")]).on("input",(i,s)=>{$(":#border-link")?.checked()&&["left","top","right","bottom"].forEach(n=>{if(n===o)return;const a=$(i.target)?.id();a?.includes("width")&&$(`:div.border-${n}-width`)?.value(s.$(`#border-${o}-width`)?.value()),a?.includes("style")&&$(`:div.border-${n}-style`)?.value(s.$(`#border-${o}-style`)?.value()),a?.includes("color")&&$(`:div.border-${n}-color`)?.value(s.$(`#border-${o}-color`)?.value())})})]))])]),$("section").content([$("header").content([$("h3").content("Border Radius"),$("div").content([$("label").content("Link").for("border-radius-link"),$("input").id("border-radius-link").type("checkbox").checked(!0)])]),$("div").content([["top-left","top-right","bottom-left","bottom-right"].map(o=>new P(`border-${o}-radius`).value(this.data[`border${rr(o)}Radius`]).unit("px").label(`${o.split("-").map(i=>i.charAt(0).toUpperCase()+i.slice(1)).toString().replace(","," ")}`).on("input",(i,s)=>{$(":#border-radius-link")?.checked()&&["top-left","top-right","bottom-left","bottom-right"].forEach(n=>{n!==o&&$(`:div.border-${n}-radius`)?.value(s.value())})}))])])])}get models(){return this.roles.map(t=>Z.get(t).get(this.name))}get role_model_list(){return this.roles.map(t=>[t,Z.get(t).get(this.name)])}get data(){return this.roles.length>1?function(r,o){let i={};for(const[s,n]of Object.entries(r)){i[s]=n;for(const a of o)if(a[s]!==n){i[s]="??";break}}return i}(this.models[0].data,this.models.map(r=>r.data)):this.models[0].data}get roles(){return $("::.role-checkbox").map(t=>{if(t.checked())return t.value()}).detype()}}class ir{data;constructor(t){this.data=t}update(t){const r=(n,a,h=!1)=>n==="??"||n===void 0?a:h?n+"px":n,o=n=>({[`border${G(n)}Style`]:r(t.$(`#border-${n}-style`)?.value(),this.data[`border${G(n)}Style`]),[`border${G(n)}Color`]:r(t.$(`#border-${n}-color`)?.value(),this.data[`border${G(n)}Color`]),[`border${G(n)}Width`]:r(t.$(`#border-${n}-width`)?.value(),this.data[`border${G(n)}Width`],!0)}),i=n=>({[`${n}Top`]:r(t.$(`#${n}-top`)?.value(),this.data[`${n}Top`],!0),[`${n}Bottom`]:r(t.$(`#${n}-bottom`)?.value(),this.data[`${n}Bottom`],!0),[`${n}Left`]:r(t.$(`#${n}-left`)?.value(),this.data[`${n}Left`],!0),[`${n}Right`]:r(t.$(`#${n}-right`)?.value(),this.data[`${n}Right`],!0)}),s={fontSize:r(t.$("#font-size")?.value(),this.data.fontSize,!0),fontWeight:r(t.$("#font-weight")?.value(),this.data.fontWeight),color:new N({...new N(r(t.$("#font-color")?.value(),this.data.color)).RGBObject,A:r(t.$("#font-color-transparent")?.value(),new N(this.data.color).A)}).HEXA,backgroundColor:new N({...new N(r(t.$("#background-color")?.value(),this.data.backgroundColor)).RGBObject,A:r(t.$("#background-color-transparent")?.value(),new N(this.data.backgroundColor).A)}).HEXA,...o("top"),...o("bottom"),...o("left"),...o("right"),borderTopLeftRadius:r(t.$("#border-top-left-radius")?.value(),this.data.borderTopLeftRadius,!0),borderTopRightRadius:r(t.$("#border-top-right-radius")?.value(),this.data.borderTopRightRadius,!0),borderBottomLeftRadius:r(t.$("#border-bottom-left-radius")?.value(),this.data.borderBottomLeftRadius,!0),borderBottomRightRadius:r(t.$("#border-bottom-right-radius")?.value(),this.data.borderBottomRightRadius,!0),...i("margin"),...i("padding"),opacity:r(t.$("#opacity")?.value(),this.data.opacity),display:r(t.$("#display")?.value(),this.data.display),height:r(t.$("#height")?.value(),this.data.height,!0),width:r(t.$("#width")?.value(),this.data.width,!0),flexDirection:r(t.$("#flex-direction")?.value(),this.data.flexDirection),justifyContent:r(t.$("#justify-content")?.value(),this.data.justifyContent),alignItems:r(t.$("#align-items")?.value(),this.data.alignItems),gap:r(t.$("#gap")?.value(),this.data.gap,!0)};return this.data=s,this}}const sr={Normal:{Message:{fontSize:"16px",fontWeight:"400",color:"#F0F0F0FF",backgroundColor:"#00000000",borderTopStyle:"solid",borderTopColor:"#000000",borderTopWidth:"0px",borderBottomStyle:"solid",borderBottomColor:"#000000",borderBottomWidth:"0px",borderLeftStyle:"solid",borderLeftColor:"#000000",borderLeftWidth:"0px",borderRightStyle:"solid",borderRightColor:"#000000",borderRightWidth:"0px",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",marginTop:"4px",marginBottom:"0px",marginLeft:"2px",marginRight:"2px",paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",opacity:"1",display:"block",flexDirection:"row",gap:"0px"},Name:{fontSize:"16px",fontWeight:"400",color:"#FFFFFFFF",backgroundColor:"#FF427B99",borderTopStyle:"solid",borderTopColor:"#000000",borderTopWidth:"0px",borderBottomStyle:"solid",borderBottomColor:"#000000",borderBottomWidth:"0px",borderLeftStyle:"solid",borderLeftColor:"#000000",borderLeftWidth:"0px",borderRightStyle:"solid",borderRightColor:"#000000",borderRightWidth:"0px",borderTopLeftRadius:"10px",borderTopRightRadius:"10px",borderBottomLeftRadius:"10px",borderBottomRightRadius:"10px",marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",paddingTop:"4px",paddingBottom:"4px",paddingLeft:"8px",paddingRight:"8px",opacity:"1",display:"block",flexDirection:"row",gap:"0px"},Avatar:{fontSize:"16px",color:"#000000FF",backgroundColor:"#00000000",borderTopStyle:"solid",borderTopColor:"#000000",borderTopWidth:"0px",borderBottomStyle:"solid",borderBottomColor:"#000000",borderBottomWidth:"0px",borderLeftStyle:"solid",borderLeftColor:"#000000",borderLeftWidth:"0px",borderRightStyle:"solid",borderRightColor:"#000000",borderRightWidth:"0px",borderTopLeftRadius:"10px",borderTopRightRadius:"10px",borderBottomLeftRadius:"10px",borderBottomRightRadius:"10px",marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",opacity:"1",display:"block",height:"60px",width:"60px",flexDirection:"row",gap:"0px"},"Author Area":{fontSize:"16px",color:"#000000FF",backgroundColor:"#00000000",borderTopStyle:"solid",borderTopColor:"#000000",borderTopWidth:"0px",borderBottomStyle:"solid",borderBottomColor:"#000000",borderBottomWidth:"0px",borderLeftStyle:"solid",borderLeftColor:"#000000",borderLeftWidth:"0px",borderRightStyle:"solid",borderRightColor:"#000000",borderRightWidth:"0px",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",opacity:"1",display:"flex",flexDirection:"row",gap:"0px"},"Content Area":{fontSize:"16px",color:"#000000FF",backgroundColor:"#00000000",borderTopStyle:"solid",borderTopColor:"#000000",borderTopWidth:"0px",borderBottomStyle:"solid",borderBottomColor:"#000000",borderBottomWidth:"0px",borderLeftStyle:"solid",borderLeftColor:"#000000",borderLeftWidth:"0px",borderRightStyle:"solid",borderRightColor:"#000000",borderRightWidth:"0px",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",opacity:"1",display:"block",flexDirection:"row",gap:"0px"},"Outer Area":{fontSize:"16px",color:"#000000FF",backgroundColor:"#3D3D3D80",borderTopStyle:"solid",borderTopColor:"#000000",borderTopWidth:"0px",borderBottomStyle:"solid",borderBottomColor:"#000000",borderBottomWidth:"0px",borderLeftStyle:"solid",borderLeftColor:"#000000",borderLeftWidth:"0px",borderRightStyle:"solid",borderRightColor:"#000000",borderRightWidth:"0px",borderTopLeftRadius:"10px",borderTopRightRadius:"10px",borderBottomLeftRadius:"10px",borderBottomRightRadius:"10px",marginTop:"0px",marginBottom:"10px",marginLeft:"0px",marginRight:"0px",paddingTop:"8px",paddingBottom:"8px",paddingLeft:"8px",paddingRight:"8px",opacity:"1",display:"flex",flexDirection:"row",justifyContent:"start",alignItems:"start",gap:"10px"}},Member:{Message:{fontSize:"16px",fontWeight:"400",color:"#F0F0F0FF",backgroundColor:"#00000000",borderTopStyle:"solid",borderTopColor:"#000000",borderTopWidth:"0px",borderBottomStyle:"solid",borderBottomColor:"#000000",borderBottomWidth:"0px",borderLeftStyle:"solid",borderLeftColor:"#000000",borderLeftWidth:"0px",borderRightStyle:"solid",borderRightColor:"#000000",borderRightWidth:"0px",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",marginTop:"4px",marginBottom:"0px",marginLeft:"2px",marginRight:"2px",paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",opacity:"1",display:"block",gap:"0px"},Name:{fontSize:"16px",fontWeight:"400",color:"#FFFFFFFF",backgroundColor:"#FF427B99",borderTopStyle:"solid",borderTopColor:"#000000",borderTopWidth:"0px",borderBottomStyle:"solid",borderBottomColor:"#000000",borderBottomWidth:"0px",borderLeftStyle:"solid",borderLeftColor:"#000000",borderLeftWidth:"0px",borderRightStyle:"solid",borderRightColor:"#000000",borderRightWidth:"0px",borderTopLeftRadius:"10px",borderTopRightRadius:"10px",borderBottomLeftRadius:"10px",borderBottomRightRadius:"10px",marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",paddingTop:"4px",paddingBottom:"4px",paddingLeft:"8px",paddingRight:"8px",opacity:"1",display:"block",gap:"0px"},Avatar:{fontSize:"16px",color:"#000000FF",backgroundColor:"#00000000",borderTopStyle:"solid",borderTopColor:"#000000",borderTopWidth:"0px",borderBottomStyle:"solid",borderBottomColor:"#000000",borderBottomWidth:"0px",borderLeftStyle:"solid",borderLeftColor:"#000000",borderLeftWidth:"0px",borderRightStyle:"solid",borderRightColor:"#000000",borderRightWidth:"0px",borderTopLeftRadius:"10px",borderTopRightRadius:"10px",borderBottomLeftRadius:"10px",borderBottomRightRadius:"10px",marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",opacity:"1",display:"block",height:"60px",width:"60px",gap:"0px"},"Author Area":{fontSize:"16px",color:"#000000FF",backgroundColor:"#00000000",borderTopStyle:"solid",borderTopColor:"#000000",borderTopWidth:"0px",borderBottomStyle:"solid",borderBottomColor:"#000000",borderBottomWidth:"0px",borderLeftStyle:"solid",borderLeftColor:"#000000",borderLeftWidth:"0px",borderRightStyle:"solid",borderRightColor:"#000000",borderRightWidth:"0px",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",opacity:"1",display:"flex",flexDirection:"row",gap:"0px"},"Content Area":{fontSize:"16px",color:"#000000FF",backgroundColor:"#00000000",borderTopStyle:"solid",borderTopColor:"#000000",borderTopWidth:"0px",borderBottomStyle:"solid",borderBottomColor:"#000000",borderBottomWidth:"0px",borderLeftStyle:"solid",borderLeftColor:"#000000",borderLeftWidth:"0px",borderRightStyle:"solid",borderRightColor:"#000000",borderRightWidth:"0px",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",opacity:"1",display:"block",gap:"0px"},"Outer Area":{fontSize:"16px",color:"#000000FF",backgroundColor:"#3D3D3D80",borderTopStyle:"solid",borderTopColor:"#000000",borderTopWidth:"0px",borderBottomStyle:"solid",borderBottomColor:"#000000",borderBottomWidth:"0px",borderLeftStyle:"solid",borderLeftColor:"#000000",borderLeftWidth:"0px",borderRightStyle:"solid",borderRightColor:"#000000",borderRightWidth:"0px",borderTopLeftRadius:"10px",borderTopRightRadius:"10px",borderBottomLeftRadius:"10px",borderBottomRightRadius:"10px",marginTop:"0px",marginBottom:"10px",marginLeft:"0px",marginRight:"0px",paddingTop:"8px",paddingBottom:"8px",paddingLeft:"8px",paddingRight:"8px",opacity:"1",display:"flex",flexDirection:"row",justifyContent:"start",alignItems:"start",gap:"10px"}},Moderator:{Message:{fontSize:"16px",fontWeight:"400",color:"#F0F0F0FF",backgroundColor:"#00000000",borderTopStyle:"solid",borderTopColor:"#000000",borderTopWidth:"0px",borderBottomStyle:"solid",borderBottomColor:"#000000",borderBottomWidth:"0px",borderLeftStyle:"solid",borderLeftColor:"#000000",borderLeftWidth:"0px",borderRightStyle:"solid",borderRightColor:"#000000",borderRightWidth:"0px",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",marginTop:"4px",marginBottom:"0px",marginLeft:"2px",marginRight:"2px",paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",opacity:"1",display:"block",gap:"0px"},Name:{fontSize:"16px",fontWeight:"400",color:"#FFFFFFFF",backgroundColor:"#FF427B99",borderTopStyle:"solid",borderTopColor:"#000000",borderTopWidth:"0px",borderBottomStyle:"solid",borderBottomColor:"#000000",borderBottomWidth:"0px",borderLeftStyle:"solid",borderLeftColor:"#000000",borderLeftWidth:"0px",borderRightStyle:"solid",borderRightColor:"#000000",borderRightWidth:"0px",borderTopLeftRadius:"10px",borderTopRightRadius:"10px",borderBottomLeftRadius:"10px",borderBottomRightRadius:"10px",marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",paddingTop:"4px",paddingBottom:"4px",paddingLeft:"8px",paddingRight:"8px",opacity:"1",display:"block",gap:"0px"},Avatar:{fontSize:"16px",color:"#000000FF",backgroundColor:"#00000000",borderTopStyle:"solid",borderTopColor:"#000000",borderTopWidth:"0px",borderBottomStyle:"solid",borderBottomColor:"#000000",borderBottomWidth:"0px",borderLeftStyle:"solid",borderLeftColor:"#000000",borderLeftWidth:"0px",borderRightStyle:"solid",borderRightColor:"#000000",borderRightWidth:"0px",borderTopLeftRadius:"10px",borderTopRightRadius:"10px",borderBottomLeftRadius:"10px",borderBottomRightRadius:"10px",marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",opacity:"1",display:"block",height:"60px",width:"60px",gap:"0px"},"Author Area":{fontSize:"16px",color:"#000000FF",backgroundColor:"#00000000",borderTopStyle:"solid",borderTopColor:"#000000",borderTopWidth:"0px",borderBottomStyle:"solid",borderBottomColor:"#000000",borderBottomWidth:"0px",borderLeftStyle:"solid",borderLeftColor:"#000000",borderLeftWidth:"0px",borderRightStyle:"solid",borderRightColor:"#000000",borderRightWidth:"0px",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",opacity:"1",display:"flex",flexDirection:"row",gap:"0px"},"Content Area":{fontSize:"16px",color:"#000000FF",backgroundColor:"#00000000",borderTopStyle:"solid",borderTopColor:"#000000",borderTopWidth:"0px",borderBottomStyle:"solid",borderBottomColor:"#000000",borderBottomWidth:"0px",borderLeftStyle:"solid",borderLeftColor:"#000000",borderLeftWidth:"0px",borderRightStyle:"solid",borderRightColor:"#000000",borderRightWidth:"0px",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",opacity:"1",display:"block",gap:"0px"},"Outer Area":{fontSize:"16px",color:"#000000FF",backgroundColor:"#3D3D3D80",borderTopStyle:"solid",borderTopColor:"#000000",borderTopWidth:"0px",borderBottomStyle:"solid",borderBottomColor:"#000000",borderBottomWidth:"0px",borderLeftStyle:"solid",borderLeftColor:"#000000",borderLeftWidth:"0px",borderRightStyle:"solid",borderRightColor:"#000000",borderRightWidth:"0px",borderTopLeftRadius:"10px",borderTopRightRadius:"10px",borderBottomLeftRadius:"10px",borderBottomRightRadius:"10px",marginTop:"0px",marginBottom:"10px",marginLeft:"0px",marginRight:"0px",paddingTop:"8px",paddingBottom:"8px",paddingLeft:"8px",paddingRight:"8px",opacity:"1",display:"flex",flexDirection:"row",justifyContent:"start",alignItems:"start",gap:"10px"}},Owner:{Message:{fontSize:"16px",fontWeight:"400",color:"#F0F0F0FF",backgroundColor:"#00000000",borderTopStyle:"solid",borderTopColor:"#000000",borderTopWidth:"0px",borderBottomStyle:"solid",borderBottomColor:"#000000",borderBottomWidth:"0px",borderLeftStyle:"solid",borderLeftColor:"#000000",borderLeftWidth:"0px",borderRightStyle:"solid",borderRightColor:"#000000",borderRightWidth:"0px",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",marginTop:"4px",marginBottom:"0px",marginLeft:"2px",marginRight:"2px",paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",opacity:"1",display:"block",gap:"0px"},Name:{fontSize:"16px",fontWeight:"400",color:"#FFFFFFFF",backgroundColor:"#FF427B99",borderTopStyle:"solid",borderTopColor:"#000000",borderTopWidth:"0px",borderBottomStyle:"solid",borderBottomColor:"#000000",borderBottomWidth:"0px",borderLeftStyle:"solid",borderLeftColor:"#000000",borderLeftWidth:"0px",borderRightStyle:"solid",borderRightColor:"#000000",borderRightWidth:"0px",borderTopLeftRadius:"10px",borderTopRightRadius:"10px",borderBottomLeftRadius:"10px",borderBottomRightRadius:"10px",marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",paddingTop:"4px",paddingBottom:"4px",paddingLeft:"8px",paddingRight:"8px",opacity:"1",display:"block",gap:"0px"},Avatar:{fontSize:"16px",color:"#000000FF",backgroundColor:"#00000000",borderTopStyle:"solid",borderTopColor:"#000000",borderTopWidth:"0px",borderBottomStyle:"solid",borderBottomColor:"#000000",borderBottomWidth:"0px",borderLeftStyle:"solid",borderLeftColor:"#000000",borderLeftWidth:"0px",borderRightStyle:"solid",borderRightColor:"#000000",borderRightWidth:"0px",borderTopLeftRadius:"10px",borderTopRightRadius:"10px",borderBottomLeftRadius:"10px",borderBottomRightRadius:"10px",marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",opacity:"1",display:"block",height:"60px",width:"60px",gap:"0px"},"Author Area":{fontSize:"16px",color:"#000000FF",backgroundColor:"#00000000",borderTopStyle:"solid",borderTopColor:"#000000",borderTopWidth:"0px",borderBottomStyle:"solid",borderBottomColor:"#000000",borderBottomWidth:"0px",borderLeftStyle:"solid",borderLeftColor:"#000000",borderLeftWidth:"0px",borderRightStyle:"solid",borderRightColor:"#000000",borderRightWidth:"0px",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",opacity:"1",display:"flex",flexDirection:"row",gap:"0px"},"Content Area":{fontSize:"16px",color:"#000000FF",backgroundColor:"#00000000",borderTopStyle:"solid",borderTopColor:"#000000",borderTopWidth:"0px",borderBottomStyle:"solid",borderBottomColor:"#000000",borderBottomWidth:"0px",borderLeftStyle:"solid",borderLeftColor:"#000000",borderLeftWidth:"0px",borderRightStyle:"solid",borderRightColor:"#000000",borderRightWidth:"0px",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",opacity:"1",display:"block",gap:"0px"},"Outer Area":{fontSize:"16px",color:"#000000FF",backgroundColor:"#3D3D3D80",borderTopStyle:"solid",borderTopColor:"#000000",borderTopWidth:"0px",borderBottomStyle:"solid",borderBottomColor:"#000000",borderBottomWidth:"0px",borderLeftStyle:"solid",borderLeftColor:"#000000",borderLeftWidth:"0px",borderRightStyle:"solid",borderRightColor:"#000000",borderRightWidth:"0px",borderTopLeftRadius:"10px",borderTopRightRadius:"10px",borderBottomLeftRadius:"10px",borderBottomRightRadius:"10px",marginTop:"0px",marginBottom:"10px",marginLeft:"0px",marginRight:"0px",paddingTop:"8px",paddingBottom:"8px",paddingLeft:"8px",paddingRight:"8px",opacity:"1",display:"flex",flexDirection:"row",justifyContent:"start",alignItems:"start",gap:"10px"}}},Rt={bocchi:["bocchi_1.png","bocchi_2.png"],kita:["kita_1.png","kita_2.png"],nijika:["nijika_1.png","nijika_2.png"],ryo:["ryo_1.png","ryo_2.png"]};class nr extends R{data;$content=$("div").id("content");$message=$("span").id("message");$name=$("span").id("author-name");$author_area=$("yt-live-chat-author-chip");$timestamp=$("span").id("timestamp");$avatar=$("yt-img-shadow").id("author-photo");$overlay=$("div").class("overlay");$hint=$("div").class("hint").css({display:"none"});constructor(t){super("yt-live-chat-text-message-renderer"),this.data=t,this.build(),this.init()}init(){Z.get(this.data.role)?.forEach((t,r)=>this.updateStyle(r,t))}build(){this.content([this.$overlay.content([`Role: ${this.data.role}`]),this.$hint,this.$avatar.content([$("img").src(`/${this.avatar_url}`)]),this.$content.content([this.$timestamp,this.$author_area.content([this.$name.content(this.data.name),$("span").id("chat-badges").content([$("yt-live-chat-author-badge-renderer").content([$("div").id("image").content([$("img")])]),this.data.role==="Moderator"?$("yt-live-chat-author-badge-renderer").attribute("type","moderator").content([$("div").id("image").self(t=>{t.dom.innerHTML=''})]):void 0])]),this.$message.content(this.data.message),$("span").id("deleted-state")])])}updateStyle(t,r){switch(t){case"Message":this.$message.css(r.data);break;case"Name":this.$name.css(r.data);break;case"Avatar":this.$avatar.css(r.data);break;case"Content Area":this.$content.css(r.data);break;case"Author Area":this.$author_area.css(r.data);break;case"Outer Area":this.css(r.data);break}}hint(t){switch(t){case"Message":this.hintPosition(this.$message);break;case"Name":this.hintPosition(this.$name);break;case"Avatar":this.hintPosition(this.$avatar);break;case"Content Area":this.hintPosition(this.$content);break;case"Author Area":this.hintPosition(this.$author_area);break;case"Outer Area":this.hintPosition(this);break}}hintPosition(t){const r=t.dom.getBoundingClientRect(),o=this.dom.getBoundingClientRect();this.$hint.css({position:"absolute",top:`${r.top-o.top}px`,left:`${r.left-o.left}px`,height:`${r.height}px`,width:`${r.width}px`,backgroundColor:"#ff000030",display:"block"})}get avatar_url(){const t=this.data.role==="Normal"?Rt.bocchi:this.data.role==="Member"?Rt.kita:this.data.role==="Moderator"?Rt.ryo:Rt.nijika;return t[Math.floor(Math.random()*t.length)]}}class ar extends R{messageList=new Set;constructor(){super("ytchat")}send(t){const r=new nr(t);return this.messageList.add(r),this.insert(r),this}updateStyle(t,r,o){this.messageList.forEach(i=>{o.includes(i.data.role)&&i.updateStyle(t,r)})}showHint(t){this.messageList.forEach(r=>{this.roles.includes(r.data.role)&&r.hint(t)})}hideHint(){this.messageList.forEach(t=>{t.$hint.css({display:"none"})})}get roles(){return $("::.role-checkbox").map(t=>{if(t.checked())return t.value()}).detype()}}const dr=`yt-live-chat-renderer yt-live-chat-header-renderer, yt-live-chat-renderer yt-live-chat-ticker-renderer, yt-live-chat-renderer yt-live-chat-message-input-renderer, yt-live-chat-renderer #reaction-control-panel-overlay, @@ -50,9 +50,9 @@ yt-live-chat-text-message-renderer yt-live-chat-author-badge-renderer[type="mode fill: #5e84f1; } -`,Mt={version:"v1.0.5",github_homepage:"https://github.com/defaultkavy/youtube-chat-designer",author_link:"https://x.com/defaultkavy"},Z=new Map,Kt=["Normal","Member","Moderator","Owner"],Ut=["Message","Name","Avatar","Author Area","Content Area","Outer Area"],hr=["Message","Name","Timestamp"],lr=["Badge","Avatar"],me=new Map,et=b("view"),K=new ar().css({backgroundColor:"#131313"}).send({name:"ひとり",message:"Hover mouse on the message will show the author role info.",role:"Normal"}).send({name:"郁代",message:"Shift + Left Click on Role list to select multiple role, edit selected role settings in once.",role:"Member"}).send({name:"リョウ",message:"If you want to save your settings, using Copy JSON and save it, you can paste the JSON to recovery your settings.",role:"Moderator"}).send({name:"虹夏",message:"Try to send message for test your design.",role:"Owner"});ge();const zt=b("app").content([b("h1").content(["YouTube Chat Designer",b("span").content(Mt.version),b("a").content("GitHub").href(Mt.github_homepage).target("_blank"),b("a").content("@defaultkavy").href(Mt.author_link).target("_blank")]),b("div").class("content").content([b("div").class("console").content([b("div").class("menu").content([b("div").class("action-row").content([b("div").class("role-list").content([b("button").content("ROLE").on("click",()=>{const e=b("::.role-checkbox"),t=!e.find(r=>r.checked()===!1);e.slice(t?1:0).forEach(r=>r.checked(!t)),qt()}),b("div").content([Kt.map(e=>[b("div").class("role").content(t=>[b("input").class("role-checkbox").type("checkbox").value(e).id(e.toLowerCase()).on("input",qt),b("label").content(e).for(e.toLowerCase()).on("click",r=>{const o=b("::.role-checkbox"),i=t.$(`input#${e.toLowerCase()}`),s=o.filter(n=>n.checked()).length>1;if(r.shiftKey)return s?void 0:i.checked()?r.preventDefault():void 0;if(i.checked())return r.preventDefault();o.forEach(n=>{n.id()!==e.toLowerCase()&&n.checked(!1)})})])])])]),b("div").class("button-list").content([b("div").class("button-group").content([b("span").content("JSON"),b("button").content("Paste").self(e=>{let t;e.on("click",async r=>{const o=await navigator.clipboard.readText();try{const i=JSON.parse(o);ge(i)}catch{e.content("Error!").class("error"),t=setTimeout(()=>{e.removeClass("error").content("Paste"),t=void 0},3e3);return}be(),e.content("Pasted!").class("done"),t&&clearTimeout(t),t=setTimeout(()=>{e.removeClass("done").content("Paste"),t=void 0},3e3)})}),b("button").content("Copy").self(e=>{let t;e.on("click",r=>{navigator.clipboard.writeText(JSON.stringify(cr())),e.content("Copied!").class("done"),t&&clearTimeout(t),t=setTimeout(()=>{e.removeClass("done").content("Copy"),t=void 0},3e3)})})]),b("div").class("button-group").content([b("span").content("CSS"),b("button").content("Copy").self(e=>{let t;e.on("click",r=>{navigator.clipboard.writeText(ur()),e.content("Copied!").class("done"),t&&clearTimeout(t),t=setTimeout(()=>{e.removeClass("done").content("Copy"),t=void 0},3e3)})})])])]),b("div").class("element-list").content(e=>[Ut.map(t=>b("button").staticClass("element-button").content(t).on("click",(r,o)=>et.switchView(t)).self(r=>{et.event.on("switch",o=>{o!==t?r.removeClass("active"):r.addClass("active")})}).on("mouseenter",r=>{K.showHint(t)}))]).on("mouseleave",e=>{K.hideHint()})]),et]),b("div").class("preview").content([b("header").content([b("h2").content("YouTube Chat Preview"),new Rt("ytchat-background-color").label("Background Color").value("#131313").on("input",(e,t)=>{K.css({backgroundColor:t.$color.value()})})]),K,b("div").class("input-panel").content([b("div").content([b("select").id("role-select").add([Kt.map(e=>b("option").content(e).value(e))]),b("input").id("username").placeholder("User Name")]),b("div").content([b("textarea").id("message-input").attribute("placeholder","Type here...").on("keydown",e=>{e.key==="Enter"&&(e.preventDefault(),ne())}),b("button").content("Send").on("click",e=>{ne()})])])])])]);b(document.body).content(zt);be();window.addEventListener("resize",()=>pr());function ge(e=sr){Z.clear();for(const t of Kt){const r=new Map;Z.set(t,r);for(const o of Ut){const i=new ir(e[t][o]);r.set(o,i),K.updateStyle(o,i,[t])}}et.deleteAllView().clear();for(const t of Ut){const r=new or(t,hr.includes(t)?"text":lr.includes(t)?"image":"element");me.set(t,r),et.setView(t,r)}}function be(){et.switchView("Message"),b("::.role-checkbox")?.forEach(e=>e.checked(!1)),b(":#normal")?.checked(!0),qt()}function qt(){me.forEach(e=>e.layout())}function ne(){const e=b(":#message-input").value().trim();e!==""&&(K.send({name:b(":#username").value(),message:e,role:b(":#role-select").value()}),K.dom.scrollTop=K.dom.scrollHeight)}function ur(){let e=dr;for(const[r,o]of Z)for(const[i,s]of o){let n=r==="Normal"?"yt-live-chat-text-message-renderer":`yt-live-chat-text-message-renderer[author-type="${r.toLowerCase()}"]`;switch(i){case"Message":n+=" #message";break;case"Name":n+=" #author-name ";break;case"Badge":n+=" #chat-bagdes";break;case"Avatar":n+=" #author-photo";break;case"Author Area":n+=" yt-live-chat-author-clip";break;case"Content Area":n+=" #content";break}let a="";for(const[h,d]of Object.entries(s.data))a+=` ${t(h)}: ${d} !important; +`,Ht={version:"v1.0.5",github_homepage:"https://github.com/defaultkavy/youtube-chat-designer",author_link:"https://x.com/defaultkavy"},Z=new Map,Ut=["Normal","Member","Moderator","Owner"],zt=["Message","Name","Avatar","Author Area","Content Area","Outer Area"],hr=["Message","Name","Timestamp"],lr=["Badge","Avatar"],re=new Map,et=f("view"),K=new ar().css({backgroundColor:"#131313"}).send({name:"ひとり",message:"Hover mouse on the message will show the author role info.",role:"Normal"}).send({name:"郁代",message:"Shift + Left Click on Role list to select multiple role, edit selected role settings in once.",role:"Member"}).send({name:"リョウ",message:"If you want to save your settings, using Copy JSON and save it, you can paste the JSON to recovery your settings.",role:"Moderator"}).send({name:"虹夏",message:"Try to send message for test your design.",role:"Owner"});ge();const qt=f("app").content([f("h1").content(["YouTube Chat Designer",f("span").content(Ht.version),f("a").content("GitHub").href(Ht.github_homepage).target("_blank"),f("a").content("@defaultkavy").href(Ht.author_link).target("_blank")]),f("div").class("content").content([f("div").class("console").content([f("div").class("menu").content([f("div").class("action-row").content([f("div").class("role-list").content([f("button").content("ROLE").on("click",()=>{const e=f("::.role-checkbox"),t=!e.find(r=>r.checked()===!1);e.slice(t?1:0).forEach(r=>r.checked(!t)),ne()}),f("div").content([Ut.map(e=>[f("div").class("role").content(t=>[f("input").class("role-checkbox").type("checkbox").value(e).id(e.toLowerCase()).on("input",ne),f("label").content(e).for(e.toLowerCase()).on("click",r=>{const o=f("::.role-checkbox"),i=t.$(`input#${e.toLowerCase()}`),s=o.filter(n=>n.checked()).length>1;if(r.shiftKey)return s?void 0:i.checked()?r.preventDefault():void 0;if(i.checked())return r.preventDefault();o.forEach(n=>{n.id()!==e.toLowerCase()&&n.checked(!1)})})])])])]),f("div").class("button-list").content([f("div").class("button-group").content([f("span").content("JSON"),f("button").content("Paste").self(e=>{let t;e.on("click",async r=>{const o=await navigator.clipboard.readText();try{const i=JSON.parse(o);ge(i)}catch{e.content("Error!").class("error").removeClass("done"),t&&clearTimeout(t),t=setTimeout(()=>{e.removeClass("error").content("Paste"),t=void 0},3e3);return}fe(),e.content("Pasted!").class("done").removeClass("error"),t&&clearTimeout(t),t=setTimeout(()=>{e.removeClass("done").content("Paste"),t=void 0},3e3)})}),f("button").content("Copy").self(e=>{let t;e.on("click",r=>{navigator.clipboard.writeText(JSON.stringify(cr())),e.content("Copied!").class("done"),t&&clearTimeout(t),t=setTimeout(()=>{e.removeClass("done").content("Copy"),t=void 0},3e3)})})]),f("div").class("button-group").content([f("span").content("CSS"),f("button").content("Copy").self(e=>{let t;e.on("click",r=>{navigator.clipboard.writeText(ur()),e.content("Copied!").class("done"),t&&clearTimeout(t),t=setTimeout(()=>{e.removeClass("done").content("Copy"),t=void 0},3e3)})})])])]),f("div").class("element-list").content(e=>[zt.map(t=>f("button").staticClass("element-button").content(t).on("click",(r,o)=>et.switchView(t)).self(r=>{et.event.on("switch",o=>{o!==t?r.removeClass("active"):r.addClass("active")})}).on("mouseenter",r=>{K.showHint(t)}))]).on("mouseleave",e=>{K.hideHint()})]),et]),f("div").class("preview").content([f("header").content([f("h2").content("YouTube Chat Preview"),new Ct("ytchat-background-color").label("Background Color").value("#131313").on("input",(e,t)=>{K.css({backgroundColor:t.$color.value()})})]),K,f("div").class("input-panel").content([f("div").content([f("select").id("role-select").add([Ut.map(e=>f("option").content(e).value(e))]),f("input").id("username").placeholder("User Name")]),f("div").content([f("textarea").id("message-input").attribute("placeholder","Type here...").on("keydown",e=>{e.key==="Enter"&&(e.preventDefault(),ae())}),f("button").content("Send").on("click",e=>{ae()})])])])])]);f(document.body).content(qt);fe();window.addEventListener("resize",()=>pr());function ge(e=sr){Z.clear();for(const t of Ut){const r=new Map;Z.set(t,r);for(const o of zt){const i=mr(e[t][o]),s=new ir(i);r.set(o,s),K.updateStyle(o,s,[t])}}et.deleteAllView().clear();for(const t of zt){const r=new or(t,hr.includes(t)?"text":lr.includes(t)?"image":"element");re.set(t,r),et.setView(t,r)}}function fe(){et.switchView("Message"),f("::.role-checkbox")?.forEach(e=>e.checked(!1)),f(":#normal")?.checked(!0),re.forEach(e=>e.update().layout())}function ne(){re.forEach(e=>e.layout())}function ae(){const e=f(":#message-input").value().trim();e!==""&&(K.send({name:f(":#username").value(),message:e,role:f(":#role-select").value()}),K.dom.scrollTop=K.dom.scrollHeight)}function ur(){let e=dr;for(const[r,o]of Z)for(const[i,s]of o){let n=r==="Normal"?"yt-live-chat-text-message-renderer":`yt-live-chat-text-message-renderer[author-type="${r.toLowerCase()}"]`;switch(i){case"Message":n+=" #message";break;case"Name":n+=" #author-name ";break;case"Badge":n+=" #chat-bagdes";break;case"Avatar":n+=" #author-photo";break;case"Author Area":n+=" yt-live-chat-author-clip";break;case"Content Area":n+=" #content";break}let a="";for(const[h,d]of Object.entries(s.data))a+=` ${t(h)}: ${d} !important; `;e+=`${n} { ${a} } -`}return e;function t(r){return r.replaceAll(/[A-Z]/g,o=>`-${o.toLowerCase()}`)}}function cr(){const e={};for(const[t,r]of Z.entries()){const o={};for(const[i,s]of r.entries())o[i]=s.data;e[t]=o}return e}function pr(){innerWidth<700?b(document.body).content(b("div").content([`Please use a screen with a width greeter than 700px. Current width: ${innerWidth}px`])):zt.inDOM()||b(document.body).content(zt)} +`}return e;function t(r){return r.replaceAll(/[A-Z]/g,o=>`-${o.toLowerCase()}`)}}function cr(){const e={};for(const[t,r]of Z.entries()){const o={};for(const[i,s]of r.entries())o[i]=s.data;e[t]=o}return e}function pr(){innerWidth<700?f(document.body).content(f("div").content([`Please use a screen with a width greeter than 700px. Current width: ${innerWidth}px`])):qt.inDOM()||f(document.body).content(qt)}function mr(e){switch(void 0){case e.gap:e.gap="0px"}return e} diff --git a/docs/index.html b/docs/index.html index ec1d08a..3894b0a 100644 --- a/docs/index.html +++ b/docs/index.html @@ -29,7 +29,7 @@ - + diff --git a/src/data/defaultStyle.ts b/src/data/defaultStyle.ts index a96ace6..45a4f78 100644 --- a/src/data/defaultStyle.ts +++ b/src/data/defaultStyle.ts @@ -47,5 +47,6 @@ const style : {[key:string]:Partial} = { } export const defaultStyle: { [key: string]: {[key: string]: Partial} -} = {"Normal":{"Message":{"fontSize":"16px","fontWeight":"400","color":"#F0F0F0FF","backgroundColor":"#00000000","borderTopStyle":"solid","borderTopColor":"#000000","borderTopWidth":"0px","borderBottomStyle":"solid","borderBottomColor":"#000000","borderBottomWidth":"0px","borderLeftStyle":"solid","borderLeftColor":"#000000","borderLeftWidth":"0px","borderRightStyle":"solid","borderRightColor":"#000000","borderRightWidth":"0px","borderTopLeftRadius":"0px","borderTopRightRadius":"0px","borderBottomLeftRadius":"0px","borderBottomRightRadius":"0px","marginTop":"4px","marginBottom":"0px","marginLeft":"2px","marginRight":"2px","paddingTop":"0px","paddingBottom":"0px","paddingLeft":"0px","paddingRight":"0px","opacity":"1","display":"block"},"Name":{"fontSize":"16px","fontWeight":"400","color":"#FFFFFFFF","backgroundColor":"#FF427B99","borderTopStyle":"solid","borderTopColor":"#000000","borderTopWidth":"0px","borderBottomStyle":"solid","borderBottomColor":"#000000","borderBottomWidth":"0px","borderLeftStyle":"solid","borderLeftColor":"#000000","borderLeftWidth":"0px","borderRightStyle":"solid","borderRightColor":"#000000","borderRightWidth":"0px","borderTopLeftRadius":"10px","borderTopRightRadius":"10px","borderBottomLeftRadius":"10px","borderBottomRightRadius":"10px","marginTop":"0px","marginBottom":"0px","marginLeft":"0px","marginRight":"0px","paddingTop":"4px","paddingBottom":"4px","paddingLeft":"8px","paddingRight":"8px","opacity":"1","display":"block"},"Avatar":{"fontSize":"16px","color":"#000000FF","backgroundColor":"#00000000","borderTopStyle":"solid","borderTopColor":"#000000","borderTopWidth":"0px","borderBottomStyle":"solid","borderBottomColor":"#000000","borderBottomWidth":"0px","borderLeftStyle":"solid","borderLeftColor":"#000000","borderLeftWidth":"0px","borderRightStyle":"solid","borderRightColor":"#000000","borderRightWidth":"0px","borderTopLeftRadius":"10px","borderTopRightRadius":"10px","borderBottomLeftRadius":"10px","borderBottomRightRadius":"10px","marginTop":"0px","marginBottom":"0px","marginLeft":"0px","marginRight":"0px","paddingTop":"0px","paddingBottom":"0px","paddingLeft":"0px","paddingRight":"0px","opacity":"1","display":"block","height":"60px","width":"60px"},"Author Area":{"fontSize":"16px","color":"#000000FF","backgroundColor":"#00000000","borderTopStyle":"solid","borderTopColor":"#000000","borderTopWidth":"0px","borderBottomStyle":"solid","borderBottomColor":"#000000","borderBottomWidth":"0px","borderLeftStyle":"solid","borderLeftColor":"#000000","borderLeftWidth":"0px","borderRightStyle":"solid","borderRightColor":"#000000","borderRightWidth":"0px","borderTopLeftRadius":"0px","borderTopRightRadius":"0px","borderBottomLeftRadius":"0px","borderBottomRightRadius":"0px","marginTop":"0px","marginBottom":"0px","marginLeft":"0px","marginRight":"0px","paddingTop":"0px","paddingBottom":"0px","paddingLeft":"0px","paddingRight":"0px","opacity":"1","display":"flex"},"Content Area":{"fontSize":"16px","color":"#000000FF","backgroundColor":"#00000000","borderTopStyle":"solid","borderTopColor":"#000000","borderTopWidth":"0px","borderBottomStyle":"solid","borderBottomColor":"#000000","borderBottomWidth":"0px","borderLeftStyle":"solid","borderLeftColor":"#000000","borderLeftWidth":"0px","borderRightStyle":"solid","borderRightColor":"#000000","borderRightWidth":"0px","borderTopLeftRadius":"0px","borderTopRightRadius":"0px","borderBottomLeftRadius":"0px","borderBottomRightRadius":"0px","marginTop":"0px","marginBottom":"0px","marginLeft":"10px","marginRight":"0px","paddingTop":"0px","paddingBottom":"0px","paddingLeft":"0px","paddingRight":"0px","opacity":"1","display":"block"},"Outer Area":{"fontSize":"16px","color":"#000000FF","backgroundColor":"#3D3D3D80","borderTopStyle":"solid","borderTopColor":"#000000","borderTopWidth":"0px","borderBottomStyle":"solid","borderBottomColor":"#000000","borderBottomWidth":"0px","borderLeftStyle":"solid","borderLeftColor":"#000000","borderLeftWidth":"0px","borderRightStyle":"solid","borderRightColor":"#000000","borderRightWidth":"0px","borderTopLeftRadius":"10px","borderTopRightRadius":"10px","borderBottomLeftRadius":"10px","borderBottomRightRadius":"10px","marginTop":"0px","marginBottom":"10px","marginLeft":"0px","marginRight":"0px","paddingTop":"8px","paddingBottom":"8px","paddingLeft":"8px","paddingRight":"8px","opacity":"1","display":"flex"}},"Member":{"Message":{"fontSize":"16px","fontWeight":"400","color":"#F0F0F0FF","backgroundColor":"#00000000","borderTopStyle":"solid","borderTopColor":"#000000","borderTopWidth":"0px","borderBottomStyle":"solid","borderBottomColor":"#000000","borderBottomWidth":"0px","borderLeftStyle":"solid","borderLeftColor":"#000000","borderLeftWidth":"0px","borderRightStyle":"solid","borderRightColor":"#000000","borderRightWidth":"0px","borderTopLeftRadius":"0px","borderTopRightRadius":"0px","borderBottomLeftRadius":"0px","borderBottomRightRadius":"0px","marginTop":"4px","marginBottom":"0px","marginLeft":"2px","marginRight":"2px","paddingTop":"0px","paddingBottom":"0px","paddingLeft":"0px","paddingRight":"0px","opacity":"1","display":"block"},"Name":{"fontSize":"16px","fontWeight":"400","color":"#FFD6D6FF","backgroundColor":"#FF333399","borderTopStyle":"solid","borderTopColor":"#000000","borderTopWidth":"0px","borderBottomStyle":"solid","borderBottomColor":"#000000","borderBottomWidth":"0px","borderLeftStyle":"solid","borderLeftColor":"#000000","borderLeftWidth":"0px","borderRightStyle":"solid","borderRightColor":"#000000","borderRightWidth":"0px","borderTopLeftRadius":"10px","borderTopRightRadius":"10px","borderBottomLeftRadius":"10px","borderBottomRightRadius":"10px","marginTop":"0px","marginBottom":"0px","marginLeft":"0px","marginRight":"0px","paddingTop":"4px","paddingBottom":"4px","paddingLeft":"8px","paddingRight":"8px","opacity":"1","display":"block"},"Avatar":{"fontSize":"16px","color":"#000000FF","backgroundColor":"#00000000","borderTopStyle":"solid","borderTopColor":"#000000","borderTopWidth":"0px","borderBottomStyle":"solid","borderBottomColor":"#000000","borderBottomWidth":"0px","borderLeftStyle":"solid","borderLeftColor":"#000000","borderLeftWidth":"0px","borderRightStyle":"solid","borderRightColor":"#000000","borderRightWidth":"0px","borderTopLeftRadius":"10px","borderTopRightRadius":"10px","borderBottomLeftRadius":"10px","borderBottomRightRadius":"10px","marginTop":"0px","marginBottom":"0px","marginLeft":"0px","marginRight":"0px","paddingTop":"0px","paddingBottom":"0px","paddingLeft":"0px","paddingRight":"0px","opacity":"1","display":"block","height":"60px","width":"60px"},"Author Area":{"fontSize":"16px","color":"#000000FF","backgroundColor":"#00000000","borderTopStyle":"solid","borderTopColor":"#000000","borderTopWidth":"0px","borderBottomStyle":"solid","borderBottomColor":"#000000","borderBottomWidth":"0px","borderLeftStyle":"solid","borderLeftColor":"#000000","borderLeftWidth":"0px","borderRightStyle":"solid","borderRightColor":"#000000","borderRightWidth":"0px","borderTopLeftRadius":"0px","borderTopRightRadius":"0px","borderBottomLeftRadius":"0px","borderBottomRightRadius":"0px","marginTop":"0px","marginBottom":"0px","marginLeft":"0px","marginRight":"0px","paddingTop":"0px","paddingBottom":"0px","paddingLeft":"0px","paddingRight":"0px","opacity":"1","display":"flex"},"Content Area":{"fontSize":"16px","color":"#000000FF","backgroundColor":"#00000000","borderTopStyle":"solid","borderTopColor":"#000000","borderTopWidth":"0px","borderBottomStyle":"solid","borderBottomColor":"#000000","borderBottomWidth":"0px","borderLeftStyle":"solid","borderLeftColor":"#000000","borderLeftWidth":"0px","borderRightStyle":"solid","borderRightColor":"#000000","borderRightWidth":"0px","borderTopLeftRadius":"0px","borderTopRightRadius":"0px","borderBottomLeftRadius":"0px","borderBottomRightRadius":"0px","marginTop":"0px","marginBottom":"0px","marginLeft":"10px","marginRight":"0px","paddingTop":"0px","paddingBottom":"0px","paddingLeft":"0px","paddingRight":"0px","opacity":"1","display":"block"},"Outer Area":{"fontSize":"16px","color":"#000000FF","backgroundColor":"#3D3D3D80","borderTopStyle":"solid","borderTopColor":"#000000","borderTopWidth":"0px","borderBottomStyle":"solid","borderBottomColor":"#000000","borderBottomWidth":"0px","borderLeftStyle":"solid","borderLeftColor":"#000000","borderLeftWidth":"0px","borderRightStyle":"solid","borderRightColor":"#000000","borderRightWidth":"0px","borderTopLeftRadius":"10px","borderTopRightRadius":"10px","borderBottomLeftRadius":"10px","borderBottomRightRadius":"10px","marginTop":"0px","marginBottom":"10px","marginLeft":"0px","marginRight":"0px","paddingTop":"8px","paddingBottom":"8px","paddingLeft":"8px","paddingRight":"8px","opacity":"1","display":"flex"}},"Moderator":{"Message":{"fontSize":"16px","fontWeight":"400","color":"#F0F0F0FF","backgroundColor":"#00000000","borderTopStyle":"solid","borderTopColor":"#000000","borderTopWidth":"0px","borderBottomStyle":"solid","borderBottomColor":"#000000","borderBottomWidth":"0px","borderLeftStyle":"solid","borderLeftColor":"#000000","borderLeftWidth":"0px","borderRightStyle":"solid","borderRightColor":"#000000","borderRightWidth":"0px","borderTopLeftRadius":"0px","borderTopRightRadius":"0px","borderBottomLeftRadius":"0px","borderBottomRightRadius":"0px","marginTop":"4px","marginBottom":"0px","marginLeft":"2px","marginRight":"2px","paddingTop":"0px","paddingBottom":"0px","paddingLeft":"0px","paddingRight":"0px","opacity":"1","display":"block"},"Name":{"fontSize":"16px","fontWeight":"400","color":"#B8CFFFFF","backgroundColor":"#2E58FF99","borderTopStyle":"solid","borderTopColor":"#000000","borderTopWidth":"0px","borderBottomStyle":"solid","borderBottomColor":"#000000","borderBottomWidth":"0px","borderLeftStyle":"solid","borderLeftColor":"#000000","borderLeftWidth":"0px","borderRightStyle":"solid","borderRightColor":"#000000","borderRightWidth":"0px","borderTopLeftRadius":"10px","borderTopRightRadius":"10px","borderBottomLeftRadius":"10px","borderBottomRightRadius":"10px","marginTop":"0px","marginBottom":"0px","marginLeft":"0px","marginRight":"0px","paddingTop":"4px","paddingBottom":"4px","paddingLeft":"8px","paddingRight":"8px","opacity":"1","display":"block"},"Avatar":{"fontSize":"16px","color":"#000000FF","backgroundColor":"#00000000","borderTopStyle":"solid","borderTopColor":"#000000","borderTopWidth":"0px","borderBottomStyle":"solid","borderBottomColor":"#000000","borderBottomWidth":"0px","borderLeftStyle":"solid","borderLeftColor":"#000000","borderLeftWidth":"0px","borderRightStyle":"solid","borderRightColor":"#000000","borderRightWidth":"0px","borderTopLeftRadius":"10px","borderTopRightRadius":"10px","borderBottomLeftRadius":"10px","borderBottomRightRadius":"10px","marginTop":"0px","marginBottom":"0px","marginLeft":"0px","marginRight":"0px","paddingTop":"0px","paddingBottom":"0px","paddingLeft":"0px","paddingRight":"0px","opacity":"1","display":"block","height":"60px","width":"60px"},"Author Area":{"fontSize":"16px","color":"#000000FF","backgroundColor":"#00000000","borderTopStyle":"solid","borderTopColor":"#000000","borderTopWidth":"0px","borderBottomStyle":"solid","borderBottomColor":"#000000","borderBottomWidth":"0px","borderLeftStyle":"solid","borderLeftColor":"#000000","borderLeftWidth":"0px","borderRightStyle":"solid","borderRightColor":"#000000","borderRightWidth":"0px","borderTopLeftRadius":"0px","borderTopRightRadius":"0px","borderBottomLeftRadius":"0px","borderBottomRightRadius":"0px","marginTop":"0px","marginBottom":"0px","marginLeft":"0px","marginRight":"0px","paddingTop":"0px","paddingBottom":"0px","paddingLeft":"0px","paddingRight":"0px","opacity":"1","display":"flex"},"Content Area":{"fontSize":"16px","color":"#000000FF","backgroundColor":"#00000000","borderTopStyle":"solid","borderTopColor":"#000000","borderTopWidth":"0px","borderBottomStyle":"solid","borderBottomColor":"#000000","borderBottomWidth":"0px","borderLeftStyle":"solid","borderLeftColor":"#000000","borderLeftWidth":"0px","borderRightStyle":"solid","borderRightColor":"#000000","borderRightWidth":"0px","borderTopLeftRadius":"0px","borderTopRightRadius":"0px","borderBottomLeftRadius":"0px","borderBottomRightRadius":"0px","marginTop":"0px","marginBottom":"0px","marginLeft":"10px","marginRight":"0px","paddingTop":"0px","paddingBottom":"0px","paddingLeft":"0px","paddingRight":"0px","opacity":"1","display":"block"},"Outer Area":{"fontSize":"16px","color":"#000000FF","backgroundColor":"#3D3D3D80","borderTopStyle":"solid","borderTopColor":"#000000","borderTopWidth":"0px","borderBottomStyle":"solid","borderBottomColor":"#000000","borderBottomWidth":"0px","borderLeftStyle":"solid","borderLeftColor":"#000000","borderLeftWidth":"0px","borderRightStyle":"solid","borderRightColor":"#000000","borderRightWidth":"0px","borderTopLeftRadius":"10px","borderTopRightRadius":"10px","borderBottomLeftRadius":"10px","borderBottomRightRadius":"10px","marginTop":"0px","marginBottom":"10px","marginLeft":"0px","marginRight":"0px","paddingTop":"8px","paddingBottom":"8px","paddingLeft":"8px","paddingRight":"8px","opacity":"1","display":"flex"}},"Owner":{"Message":{"fontSize":"16px","fontWeight":"400","color":"#F0F0F0FF","backgroundColor":"#00000000","borderTopStyle":"solid","borderTopColor":"#000000","borderTopWidth":"0px","borderBottomStyle":"solid","borderBottomColor":"#000000","borderBottomWidth":"0px","borderLeftStyle":"solid","borderLeftColor":"#000000","borderLeftWidth":"0px","borderRightStyle":"solid","borderRightColor":"#000000","borderRightWidth":"0px","borderTopLeftRadius":"0px","borderTopRightRadius":"0px","borderBottomLeftRadius":"0px","borderBottomRightRadius":"0px","marginTop":"4px","marginBottom":"0px","marginLeft":"2px","marginRight":"2px","paddingTop":"0px","paddingBottom":"0px","paddingLeft":"0px","paddingRight":"0px","opacity":"1","display":"block"},"Name":{"fontSize":"16px","fontWeight":"400","color":"#FFEB6BFF","backgroundColor":"#00000099","borderTopStyle":"solid","borderTopColor":"#000000","borderTopWidth":"0px","borderBottomStyle":"solid","borderBottomColor":"#000000","borderBottomWidth":"0px","borderLeftStyle":"solid","borderLeftColor":"#000000","borderLeftWidth":"0px","borderRightStyle":"solid","borderRightColor":"#000000","borderRightWidth":"0px","borderTopLeftRadius":"10px","borderTopRightRadius":"10px","borderBottomLeftRadius":"10px","borderBottomRightRadius":"10px","marginTop":"0px","marginBottom":"0px","marginLeft":"0px","marginRight":"0px","paddingTop":"4px","paddingBottom":"4px","paddingLeft":"8px","paddingRight":"8px","opacity":"1","display":"block"},"Avatar":{"fontSize":"16px","color":"#000000FF","backgroundColor":"#00000000","borderTopStyle":"solid","borderTopColor":"#000000","borderTopWidth":"0px","borderBottomStyle":"solid","borderBottomColor":"#000000","borderBottomWidth":"0px","borderLeftStyle":"solid","borderLeftColor":"#000000","borderLeftWidth":"0px","borderRightStyle":"solid","borderRightColor":"#000000","borderRightWidth":"0px","borderTopLeftRadius":"10px","borderTopRightRadius":"10px","borderBottomLeftRadius":"10px","borderBottomRightRadius":"10px","marginTop":"0px","marginBottom":"0px","marginLeft":"0px","marginRight":"0px","paddingTop":"0px","paddingBottom":"0px","paddingLeft":"0px","paddingRight":"0px","opacity":"1","display":"block","height":"60px","width":"60px"},"Author Area":{"fontSize":"16px","color":"#000000FF","backgroundColor":"#00000000","borderTopStyle":"solid","borderTopColor":"#000000","borderTopWidth":"0px","borderBottomStyle":"solid","borderBottomColor":"#000000","borderBottomWidth":"0px","borderLeftStyle":"solid","borderLeftColor":"#000000","borderLeftWidth":"0px","borderRightStyle":"solid","borderRightColor":"#000000","borderRightWidth":"0px","borderTopLeftRadius":"0px","borderTopRightRadius":"0px","borderBottomLeftRadius":"0px","borderBottomRightRadius":"0px","marginTop":"0px","marginBottom":"0px","marginLeft":"0px","marginRight":"0px","paddingTop":"0px","paddingBottom":"0px","paddingLeft":"0px","paddingRight":"0px","opacity":"1","display":"flex"},"Content Area":{"fontSize":"16px","color":"#000000FF","backgroundColor":"#00000000","borderTopStyle":"solid","borderTopColor":"#000000","borderTopWidth":"0px","borderBottomStyle":"solid","borderBottomColor":"#000000","borderBottomWidth":"0px","borderLeftStyle":"solid","borderLeftColor":"#000000","borderLeftWidth":"0px","borderRightStyle":"solid","borderRightColor":"#000000","borderRightWidth":"0px","borderTopLeftRadius":"0px","borderTopRightRadius":"0px","borderBottomLeftRadius":"0px","borderBottomRightRadius":"0px","marginTop":"0px","marginBottom":"0px","marginLeft":"10px","marginRight":"0px","paddingTop":"0px","paddingBottom":"0px","paddingLeft":"0px","paddingRight":"0px","opacity":"1","display":"block"},"Outer Area":{"fontSize":"16px","color":"#000000FF","backgroundColor":"#3D3D3D80","borderTopStyle":"solid","borderTopColor":"#000000","borderTopWidth":"0px","borderBottomStyle":"solid","borderBottomColor":"#000000","borderBottomWidth":"0px","borderLeftStyle":"solid","borderLeftColor":"#000000","borderLeftWidth":"0px","borderRightStyle":"solid","borderRightColor":"#000000","borderRightWidth":"0px","borderTopLeftRadius":"10px","borderTopRightRadius":"10px","borderBottomLeftRadius":"10px","borderBottomRightRadius":"10px","marginTop":"0px","marginBottom":"10px","marginLeft":"0px","marginRight":"0px","paddingTop":"8px","paddingBottom":"8px","paddingLeft":"8px","paddingRight":"8px","opacity":"1","display":"flex"}}} +} = {"Normal":{"Message":{"fontSize":"16px","fontWeight":"400","color":"#F0F0F0FF","backgroundColor":"#00000000","borderTopStyle":"solid","borderTopColor":"#000000","borderTopWidth":"0px","borderBottomStyle":"solid","borderBottomColor":"#000000","borderBottomWidth":"0px","borderLeftStyle":"solid","borderLeftColor":"#000000","borderLeftWidth":"0px","borderRightStyle":"solid","borderRightColor":"#000000","borderRightWidth":"0px","borderTopLeftRadius":"0px","borderTopRightRadius":"0px","borderBottomLeftRadius":"0px","borderBottomRightRadius":"0px","marginTop":"4px","marginBottom":"0px","marginLeft":"2px","marginRight":"2px","paddingTop":"0px","paddingBottom":"0px","paddingLeft":"0px","paddingRight":"0px","opacity":"1","display":"block","flexDirection":"row","gap":"0px"},"Name":{"fontSize":"16px","fontWeight":"400","color":"#FFFFFFFF","backgroundColor":"#FF427B99","borderTopStyle":"solid","borderTopColor":"#000000","borderTopWidth":"0px","borderBottomStyle":"solid","borderBottomColor":"#000000","borderBottomWidth":"0px","borderLeftStyle":"solid","borderLeftColor":"#000000","borderLeftWidth":"0px","borderRightStyle":"solid","borderRightColor":"#000000","borderRightWidth":"0px","borderTopLeftRadius":"10px","borderTopRightRadius":"10px","borderBottomLeftRadius":"10px","borderBottomRightRadius":"10px","marginTop":"0px","marginBottom":"0px","marginLeft":"0px","marginRight":"0px","paddingTop":"4px","paddingBottom":"4px","paddingLeft":"8px","paddingRight":"8px","opacity":"1","display":"block","flexDirection":"row","gap":"0px"},"Avatar":{"fontSize":"16px","color":"#000000FF","backgroundColor":"#00000000","borderTopStyle":"solid","borderTopColor":"#000000","borderTopWidth":"0px","borderBottomStyle":"solid","borderBottomColor":"#000000","borderBottomWidth":"0px","borderLeftStyle":"solid","borderLeftColor":"#000000","borderLeftWidth":"0px","borderRightStyle":"solid","borderRightColor":"#000000","borderRightWidth":"0px","borderTopLeftRadius":"10px","borderTopRightRadius":"10px","borderBottomLeftRadius":"10px","borderBottomRightRadius":"10px","marginTop":"0px","marginBottom":"0px","marginLeft":"0px","marginRight":"0px","paddingTop":"0px","paddingBottom":"0px","paddingLeft":"0px","paddingRight":"0px","opacity":"1","display":"block","height":"60px","width":"60px","flexDirection":"row","gap":"0px"},"Author Area":{"fontSize":"16px","color":"#000000FF","backgroundColor":"#00000000","borderTopStyle":"solid","borderTopColor":"#000000","borderTopWidth":"0px","borderBottomStyle":"solid","borderBottomColor":"#000000","borderBottomWidth":"0px","borderLeftStyle":"solid","borderLeftColor":"#000000","borderLeftWidth":"0px","borderRightStyle":"solid","borderRightColor":"#000000","borderRightWidth":"0px","borderTopLeftRadius":"0px","borderTopRightRadius":"0px","borderBottomLeftRadius":"0px","borderBottomRightRadius":"0px","marginTop":"0px","marginBottom":"0px","marginLeft":"0px","marginRight":"0px","paddingTop":"0px","paddingBottom":"0px","paddingLeft":"0px","paddingRight":"0px","opacity":"1","display":"flex","flexDirection":"row","gap":"0px"},"Content Area":{"fontSize":"16px","color":"#000000FF","backgroundColor":"#00000000","borderTopStyle":"solid","borderTopColor":"#000000","borderTopWidth":"0px","borderBottomStyle":"solid","borderBottomColor":"#000000","borderBottomWidth":"0px","borderLeftStyle":"solid","borderLeftColor":"#000000","borderLeftWidth":"0px","borderRightStyle":"solid","borderRightColor":"#000000","borderRightWidth":"0px","borderTopLeftRadius":"0px","borderTopRightRadius":"0px","borderBottomLeftRadius":"0px","borderBottomRightRadius":"0px","marginTop":"0px","marginBottom":"0px","marginLeft":"0px","marginRight":"0px","paddingTop":"0px","paddingBottom":"0px","paddingLeft":"0px","paddingRight":"0px","opacity":"1","display":"block","flexDirection":"row","gap":"0px"},"Outer Area":{"fontSize":"16px","color":"#000000FF","backgroundColor":"#3D3D3D80","borderTopStyle":"solid","borderTopColor":"#000000","borderTopWidth":"0px","borderBottomStyle":"solid","borderBottomColor":"#000000","borderBottomWidth":"0px","borderLeftStyle":"solid","borderLeftColor":"#000000","borderLeftWidth":"0px","borderRightStyle":"solid","borderRightColor":"#000000","borderRightWidth":"0px","borderTopLeftRadius":"10px","borderTopRightRadius":"10px","borderBottomLeftRadius":"10px","borderBottomRightRadius":"10px","marginTop":"0px","marginBottom":"10px","marginLeft":"0px","marginRight":"0px","paddingTop":"8px","paddingBottom":"8px","paddingLeft":"8px","paddingRight":"8px","opacity":"1","display":"flex","flexDirection":"row","justifyContent":"start","alignItems":"start","gap":"10px"}},"Member":{"Message":{"fontSize":"16px","fontWeight":"400","color":"#F0F0F0FF","backgroundColor":"#00000000","borderTopStyle":"solid","borderTopColor":"#000000","borderTopWidth":"0px","borderBottomStyle":"solid","borderBottomColor":"#000000","borderBottomWidth":"0px","borderLeftStyle":"solid","borderLeftColor":"#000000","borderLeftWidth":"0px","borderRightStyle":"solid","borderRightColor":"#000000","borderRightWidth":"0px","borderTopLeftRadius":"0px","borderTopRightRadius":"0px","borderBottomLeftRadius":"0px","borderBottomRightRadius":"0px","marginTop":"4px","marginBottom":"0px","marginLeft":"2px","marginRight":"2px","paddingTop":"0px","paddingBottom":"0px","paddingLeft":"0px","paddingRight":"0px","opacity":"1","display":"block","gap":"0px"},"Name":{"fontSize":"16px","fontWeight":"400","color":"#FFFFFFFF","backgroundColor":"#FF427B99","borderTopStyle":"solid","borderTopColor":"#000000","borderTopWidth":"0px","borderBottomStyle":"solid","borderBottomColor":"#000000","borderBottomWidth":"0px","borderLeftStyle":"solid","borderLeftColor":"#000000","borderLeftWidth":"0px","borderRightStyle":"solid","borderRightColor":"#000000","borderRightWidth":"0px","borderTopLeftRadius":"10px","borderTopRightRadius":"10px","borderBottomLeftRadius":"10px","borderBottomRightRadius":"10px","marginTop":"0px","marginBottom":"0px","marginLeft":"0px","marginRight":"0px","paddingTop":"4px","paddingBottom":"4px","paddingLeft":"8px","paddingRight":"8px","opacity":"1","display":"block","gap":"0px"},"Avatar":{"fontSize":"16px","color":"#000000FF","backgroundColor":"#00000000","borderTopStyle":"solid","borderTopColor":"#000000","borderTopWidth":"0px","borderBottomStyle":"solid","borderBottomColor":"#000000","borderBottomWidth":"0px","borderLeftStyle":"solid","borderLeftColor":"#000000","borderLeftWidth":"0px","borderRightStyle":"solid","borderRightColor":"#000000","borderRightWidth":"0px","borderTopLeftRadius":"10px","borderTopRightRadius":"10px","borderBottomLeftRadius":"10px","borderBottomRightRadius":"10px","marginTop":"0px","marginBottom":"0px","marginLeft":"0px","marginRight":"0px","paddingTop":"0px","paddingBottom":"0px","paddingLeft":"0px","paddingRight":"0px","opacity":"1","display":"block","height":"60px","width":"60px","gap":"0px"},"Author Area":{"fontSize":"16px","color":"#000000FF","backgroundColor":"#00000000","borderTopStyle":"solid","borderTopColor":"#000000","borderTopWidth":"0px","borderBottomStyle":"solid","borderBottomColor":"#000000","borderBottomWidth":"0px","borderLeftStyle":"solid","borderLeftColor":"#000000","borderLeftWidth":"0px","borderRightStyle":"solid","borderRightColor":"#000000","borderRightWidth":"0px","borderTopLeftRadius":"0px","borderTopRightRadius":"0px","borderBottomLeftRadius":"0px","borderBottomRightRadius":"0px","marginTop":"0px","marginBottom":"0px","marginLeft":"0px","marginRight":"0px","paddingTop":"0px","paddingBottom":"0px","paddingLeft":"0px","paddingRight":"0px","opacity":"1","display":"flex","flexDirection":"row","gap":"0px"},"Content Area":{"fontSize":"16px","color":"#000000FF","backgroundColor":"#00000000","borderTopStyle":"solid","borderTopColor":"#000000","borderTopWidth":"0px","borderBottomStyle":"solid","borderBottomColor":"#000000","borderBottomWidth":"0px","borderLeftStyle":"solid","borderLeftColor":"#000000","borderLeftWidth":"0px","borderRightStyle":"solid","borderRightColor":"#000000","borderRightWidth":"0px","borderTopLeftRadius":"0px","borderTopRightRadius":"0px","borderBottomLeftRadius":"0px","borderBottomRightRadius":"0px","marginTop":"0px","marginBottom":"0px","marginLeft":"0px","marginRight":"0px","paddingTop":"0px","paddingBottom":"0px","paddingLeft":"0px","paddingRight":"0px","opacity":"1","display":"block","gap":"0px"},"Outer Area":{"fontSize":"16px","color":"#000000FF","backgroundColor":"#3D3D3D80","borderTopStyle":"solid","borderTopColor":"#000000","borderTopWidth":"0px","borderBottomStyle":"solid","borderBottomColor":"#000000","borderBottomWidth":"0px","borderLeftStyle":"solid","borderLeftColor":"#000000","borderLeftWidth":"0px","borderRightStyle":"solid","borderRightColor":"#000000","borderRightWidth":"0px","borderTopLeftRadius":"10px","borderTopRightRadius":"10px","borderBottomLeftRadius":"10px","borderBottomRightRadius":"10px","marginTop":"0px","marginBottom":"10px","marginLeft":"0px","marginRight":"0px","paddingTop":"8px","paddingBottom":"8px","paddingLeft":"8px","paddingRight":"8px","opacity":"1","display":"flex","flexDirection":"row","justifyContent":"start","alignItems":"start","gap":"10px"}},"Moderator":{"Message":{"fontSize":"16px","fontWeight":"400","color":"#F0F0F0FF","backgroundColor":"#00000000","borderTopStyle":"solid","borderTopColor":"#000000","borderTopWidth":"0px","borderBottomStyle":"solid","borderBottomColor":"#000000","borderBottomWidth":"0px","borderLeftStyle":"solid","borderLeftColor":"#000000","borderLeftWidth":"0px","borderRightStyle":"solid","borderRightColor":"#000000","borderRightWidth":"0px","borderTopLeftRadius":"0px","borderTopRightRadius":"0px","borderBottomLeftRadius":"0px","borderBottomRightRadius":"0px","marginTop":"4px","marginBottom":"0px","marginLeft":"2px","marginRight":"2px","paddingTop":"0px","paddingBottom":"0px","paddingLeft":"0px","paddingRight":"0px","opacity":"1","display":"block","gap":"0px"},"Name":{"fontSize":"16px","fontWeight":"400","color":"#FFFFFFFF","backgroundColor":"#FF427B99","borderTopStyle":"solid","borderTopColor":"#000000","borderTopWidth":"0px","borderBottomStyle":"solid","borderBottomColor":"#000000","borderBottomWidth":"0px","borderLeftStyle":"solid","borderLeftColor":"#000000","borderLeftWidth":"0px","borderRightStyle":"solid","borderRightColor":"#000000","borderRightWidth":"0px","borderTopLeftRadius":"10px","borderTopRightRadius":"10px","borderBottomLeftRadius":"10px","borderBottomRightRadius":"10px","marginTop":"0px","marginBottom":"0px","marginLeft":"0px","marginRight":"0px","paddingTop":"4px","paddingBottom":"4px","paddingLeft":"8px","paddingRight":"8px","opacity":"1","display":"block","gap":"0px"},"Avatar":{"fontSize":"16px","color":"#000000FF","backgroundColor":"#00000000","borderTopStyle":"solid","borderTopColor":"#000000","borderTopWidth":"0px","borderBottomStyle":"solid","borderBottomColor":"#000000","borderBottomWidth":"0px","borderLeftStyle":"solid","borderLeftColor":"#000000","borderLeftWidth":"0px","borderRightStyle":"solid","borderRightColor":"#000000","borderRightWidth":"0px","borderTopLeftRadius":"10px","borderTopRightRadius":"10px","borderBottomLeftRadius":"10px","borderBottomRightRadius":"10px","marginTop":"0px","marginBottom":"0px","marginLeft":"0px","marginRight":"0px","paddingTop":"0px","paddingBottom":"0px","paddingLeft":"0px","paddingRight":"0px","opacity":"1","display":"block","height":"60px","width":"60px","gap":"0px"},"Author Area":{"fontSize":"16px","color":"#000000FF","backgroundColor":"#00000000","borderTopStyle":"solid","borderTopColor":"#000000","borderTopWidth":"0px","borderBottomStyle":"solid","borderBottomColor":"#000000","borderBottomWidth":"0px","borderLeftStyle":"solid","borderLeftColor":"#000000","borderLeftWidth":"0px","borderRightStyle":"solid","borderRightColor":"#000000","borderRightWidth":"0px","borderTopLeftRadius":"0px","borderTopRightRadius":"0px","borderBottomLeftRadius":"0px","borderBottomRightRadius":"0px","marginTop":"0px","marginBottom":"0px","marginLeft":"0px","marginRight":"0px","paddingTop":"0px","paddingBottom":"0px","paddingLeft":"0px","paddingRight":"0px","opacity":"1","display":"flex","flexDirection":"row","gap":"0px"},"Content Area":{"fontSize":"16px","color":"#000000FF","backgroundColor":"#00000000","borderTopStyle":"solid","borderTopColor":"#000000","borderTopWidth":"0px","borderBottomStyle":"solid","borderBottomColor":"#000000","borderBottomWidth":"0px","borderLeftStyle":"solid","borderLeftColor":"#000000","borderLeftWidth":"0px","borderRightStyle":"solid","borderRightColor":"#000000","borderRightWidth":"0px","borderTopLeftRadius":"0px","borderTopRightRadius":"0px","borderBottomLeftRadius":"0px","borderBottomRightRadius":"0px","marginTop":"0px","marginBottom":"0px","marginLeft":"0px","marginRight":"0px","paddingTop":"0px","paddingBottom":"0px","paddingLeft":"0px","paddingRight":"0px","opacity":"1","display":"block","gap":"0px"},"Outer Area":{"fontSize":"16px","color":"#000000FF","backgroundColor":"#3D3D3D80","borderTopStyle":"solid","borderTopColor":"#000000","borderTopWidth":"0px","borderBottomStyle":"solid","borderBottomColor":"#000000","borderBottomWidth":"0px","borderLeftStyle":"solid","borderLeftColor":"#000000","borderLeftWidth":"0px","borderRightStyle":"solid","borderRightColor":"#000000","borderRightWidth":"0px","borderTopLeftRadius":"10px","borderTopRightRadius":"10px","borderBottomLeftRadius":"10px","borderBottomRightRadius":"10px","marginTop":"0px","marginBottom":"10px","marginLeft":"0px","marginRight":"0px","paddingTop":"8px","paddingBottom":"8px","paddingLeft":"8px","paddingRight":"8px","opacity":"1","display":"flex","flexDirection":"row","justifyContent":"start","alignItems":"start","gap":"10px"}},"Owner":{"Message":{"fontSize":"16px","fontWeight":"400","color":"#F0F0F0FF","backgroundColor":"#00000000","borderTopStyle":"solid","borderTopColor":"#000000","borderTopWidth":"0px","borderBottomStyle":"solid","borderBottomColor":"#000000","borderBottomWidth":"0px","borderLeftStyle":"solid","borderLeftColor":"#000000","borderLeftWidth":"0px","borderRightStyle":"solid","borderRightColor":"#000000","borderRightWidth":"0px","borderTopLeftRadius":"0px","borderTopRightRadius":"0px","borderBottomLeftRadius":"0px","borderBottomRightRadius":"0px","marginTop":"4px","marginBottom":"0px","marginLeft":"2px","marginRight":"2px","paddingTop":"0px","paddingBottom":"0px","paddingLeft":"0px","paddingRight":"0px","opacity":"1","display":"block","gap":"0px"},"Name":{"fontSize":"16px","fontWeight":"400","color":"#FFFFFFFF","backgroundColor":"#FF427B99","borderTopStyle":"solid","borderTopColor":"#000000","borderTopWidth":"0px","borderBottomStyle":"solid","borderBottomColor":"#000000","borderBottomWidth":"0px","borderLeftStyle":"solid","borderLeftColor":"#000000","borderLeftWidth":"0px","borderRightStyle":"solid","borderRightColor":"#000000","borderRightWidth":"0px","borderTopLeftRadius":"10px","borderTopRightRadius":"10px","borderBottomLeftRadius":"10px","borderBottomRightRadius":"10px","marginTop":"0px","marginBottom":"0px","marginLeft":"0px","marginRight":"0px","paddingTop":"4px","paddingBottom":"4px","paddingLeft":"8px","paddingRight":"8px","opacity":"1","display":"block","gap":"0px"},"Avatar":{"fontSize":"16px","color":"#000000FF","backgroundColor":"#00000000","borderTopStyle":"solid","borderTopColor":"#000000","borderTopWidth":"0px","borderBottomStyle":"solid","borderBottomColor":"#000000","borderBottomWidth":"0px","borderLeftStyle":"solid","borderLeftColor":"#000000","borderLeftWidth":"0px","borderRightStyle":"solid","borderRightColor":"#000000","borderRightWidth":"0px","borderTopLeftRadius":"10px","borderTopRightRadius":"10px","borderBottomLeftRadius":"10px","borderBottomRightRadius":"10px","marginTop":"0px","marginBottom":"0px","marginLeft":"0px","marginRight":"0px","paddingTop":"0px","paddingBottom":"0px","paddingLeft":"0px","paddingRight":"0px","opacity":"1","display":"block","height":"60px","width":"60px","gap":"0px"},"Author Area":{"fontSize":"16px","color":"#000000FF","backgroundColor":"#00000000","borderTopStyle":"solid","borderTopColor":"#000000","borderTopWidth":"0px","borderBottomStyle":"solid","borderBottomColor":"#000000","borderBottomWidth":"0px","borderLeftStyle":"solid","borderLeftColor":"#000000","borderLeftWidth":"0px","borderRightStyle":"solid","borderRightColor":"#000000","borderRightWidth":"0px","borderTopLeftRadius":"0px","borderTopRightRadius":"0px","borderBottomLeftRadius":"0px","borderBottomRightRadius":"0px","marginTop":"0px","marginBottom":"0px","marginLeft":"0px","marginRight":"0px","paddingTop":"0px","paddingBottom":"0px","paddingLeft":"0px","paddingRight":"0px","opacity":"1","display":"flex","flexDirection":"row","gap":"0px"},"Content Area":{"fontSize":"16px","color":"#000000FF","backgroundColor":"#00000000","borderTopStyle":"solid","borderTopColor":"#000000","borderTopWidth":"0px","borderBottomStyle":"solid","borderBottomColor":"#000000","borderBottomWidth":"0px","borderLeftStyle":"solid","borderLeftColor":"#000000","borderLeftWidth":"0px","borderRightStyle":"solid","borderRightColor":"#000000","borderRightWidth":"0px","borderTopLeftRadius":"0px","borderTopRightRadius":"0px","borderBottomLeftRadius":"0px","borderBottomRightRadius":"0px","marginTop":"0px","marginBottom":"0px","marginLeft":"0px","marginRight":"0px","paddingTop":"0px","paddingBottom":"0px","paddingLeft":"0px","paddingRight":"0px","opacity":"1","display":"block","gap":"0px"},"Outer Area":{"fontSize":"16px","color":"#000000FF","backgroundColor":"#3D3D3D80","borderTopStyle":"solid","borderTopColor":"#000000","borderTopWidth":"0px","borderBottomStyle":"solid","borderBottomColor":"#000000","borderBottomWidth":"0px","borderLeftStyle":"solid","borderLeftColor":"#000000","borderLeftWidth":"0px","borderRightStyle":"solid","borderRightColor":"#000000","borderRightWidth":"0px","borderTopLeftRadius":"10px","borderTopRightRadius":"10px","borderBottomLeftRadius":"10px","borderBottomRightRadius":"10px","marginTop":"0px","marginBottom":"10px","marginLeft":"0px","marginRight":"0px","paddingTop":"8px","paddingBottom":"8px","paddingLeft":"8px","paddingRight":"8px","opacity":"1","display":"flex","flexDirection":"row","justifyContent":"start","alignItems":"start","gap":"10px"}}} + //{"Normal": style,"Member": style,"Moderator": style,"Owner": style} \ No newline at end of file diff --git a/src/main.ts b/src/main.ts index 53d9c17..82ae91f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -22,7 +22,7 @@ export const $chat = new YouTubeChat().css({backgroundColor: '#131313'}) .send({name: 'リョウ', message: 'If you want to save your settings, using Copy JSON and save it, you can paste the JSON to recovery your settings.', role: 'Moderator'}) .send({name: '虹夏', message: 'Try to send message for test your design.', role: 'Owner'}) -init(); +modelInit(); const $app = $('app').content([ $('h1').content([ @@ -78,9 +78,10 @@ const $app = $('app').content([ const json_string = await navigator.clipboard.readText(); try { const json = JSON.parse(json_string); - init(json); + modelInit(json); } catch (err) { - $button.content('Error!').class('error'); + $button.content('Error!').class('error').removeClass('done'); + if (timer) clearTimeout(timer); timer = setTimeout(() => { $button.removeClass('error').content('Paste'); timer = undefined; @@ -88,7 +89,7 @@ const $app = $('app').content([ return; } load(); - $button.content('Pasted!').class('done') + $button.content('Pasted!').class('done').removeClass('error') if (timer) clearTimeout(timer); timer = setTimeout(() => { $button.removeClass('done').content('Paste'); @@ -177,15 +178,16 @@ $(document.body).content($app) load(); window.addEventListener('resize', () => checkWindowSize()) -function init(data = defaultStyle) { +function modelInit(data = defaultStyle) { ROLE_MODEL_MAP.clear(); for (const role of ROLE_LIST) { - const STYLE_MAP = new Map() + const STYLE_MAP = new Map(); ROLE_MODEL_MAP.set(role, STYLE_MAP); for (const element of ELEMENT_LIST) { - const model = new StyleModel(data[role][element]); - STYLE_MAP.set(element, model) - $chat.updateStyle(element, model, [role]) + const initialized_data = dataInit(data[role][element]); + const model = new StyleModel(initialized_data); + STYLE_MAP.set(element, model); + $chat.updateStyle(element, model, [role]); } } $view.deleteAllView().clear(); @@ -200,7 +202,7 @@ function load() { $view.switchView('Message'); $<$Input>('::.role-checkbox')?.forEach($input => $input.checked(false)); $<$Input>(':#normal')?.checked(true); - refreshPanel(); + PANEL_MAP.forEach(panel => panel.update().layout()) } function refreshPanel() { @@ -266,4 +268,11 @@ function checkWindowSize() { } else { if (!$app.inDOM()) $(document.body).content($app); } -} \ No newline at end of file +} + +function dataInit(data: Partial) { + switch (undefined) { + case data.gap: data.gap = '0px'; + } + return data; +} diff --git a/src/structure/StyleModel.ts b/src/structure/StyleModel.ts index 4c61ea5..b78644a 100644 --- a/src/structure/StyleModel.ts +++ b/src/structure/StyleModel.ts @@ -21,9 +21,9 @@ export class StyleModel { } const border = (dir: 'top' | 'right' | 'left' | 'bottom') => { return { - [`border${firstCap(dir)}Style`]: filterMultitype(panel.$<$Select>(`#border-${dir}-style`)?.value(), this.data[`boder${firstCap(dir)}Style`]), - [`border${firstCap(dir)}Color`]: filterMultitype(panel.$<$Input>(`#border-${dir}-color`)?.value(), this.data[`boder${firstCap(dir)}Color`]), - [`border${firstCap(dir)}Width`]: filterMultitype(panel.$<$Input>(`#border-${dir}-width`)?.value(), this.data[`boder${firstCap(dir)}Color`], true) + [`border${firstCap(dir)}Style`]: filterMultitype(panel.$<$Select>(`#border-${dir}-style`)?.value(), this.data[`border${firstCap(dir)}Style`]), + [`border${firstCap(dir)}Color`]: filterMultitype(panel.$<$Input>(`#border-${dir}-color`)?.value(), this.data[`border${firstCap(dir)}Color`]), + [`border${firstCap(dir)}Width`]: filterMultitype(panel.$<$Input>(`#border-${dir}-width`)?.value(), this.data[`border${firstCap(dir)}Width`], true) } } @@ -62,29 +62,12 @@ export class StyleModel { display: filterMultitype(panel.$<$Select>('#display')?.value(), this.data.display), height: filterMultitype(panel.$<$Input>('#height')?.value(), this.data.height, true), width: filterMultitype(panel.$<$Input>('#width')?.value(), this.data.width, true), + flexDirection: filterMultitype(panel.$<$Input>('#flex-direction')?.value(), this.data.flexDirection), + justifyContent: filterMultitype(panel.$<$Input>('#justify-content')?.value(), this.data.justifyContent), + alignItems: filterMultitype(panel.$<$Input>('#align-items')?.value(), this.data.alignItems), + gap: filterMultitype(panel.$<$Input>('#gap')?.value(), this.data.gap, true), } this.data = data; return this; } - - cssObject() { - const json = {}; - const convert = (passKey: string | null, data: Object) => { - for (let [key, value] of Object.entries(data)) { - key = passKey ? passKey + key.charAt(0).toUpperCase() + key.slice(1) : key; - if (value instanceof Object === false) { - if (typeof value === 'number' && key !== 'opacity') value = `${value}px`; - Object.assign(json, {[`${key}`]: value}); - continue; - } - convert(key, value); - } - } - convert(null, this.data); - return json - } - - css() { - - } } \ No newline at end of file diff --git a/src/structure/StylePanel.ts b/src/structure/StylePanel.ts index 63270fc..4522ba9 100644 --- a/src/structure/StylePanel.ts +++ b/src/structure/StylePanel.ts @@ -1,4 +1,4 @@ -import { $Container } from "fluentx"; +import { $Container, $State } from "fluentx"; import { ColorInput } from "../component/ColorInput"; import { RangeInput } from "../component/RangeInput"; import { SelectInput } from "../component/SelectInput"; @@ -10,6 +10,7 @@ import { firstCap, propCap } from "./util"; export class StylePanel extends $Container { type: StyleType; name: string; + flex_hidden$ = $.state(false); constructor(name: string, type: StyleType) { super('div'); this.staticClass('style-panel'); @@ -26,6 +27,7 @@ export class StylePanel extends $Container { model.update(this) $chat.updateStyle(this.name, model, [role]); }); + this.flex_hidden$.set(this.data?.display !== 'flex'); return this; } @@ -44,6 +46,22 @@ export class StylePanel extends $Container { ]) ]), + $('section').content([ + $('h3').content('Flex'), + $('div').content([ + new SelectInput('flex-direction').label('Direction').add([ + ['row', 'column', 'row-reverse', 'column-reverse',].map(value => $('option').content(value).value(value)) + ]).value(this.data.flexDirection), + new RangeInput('gap').value(this.data.gap).unit('px').min(0).max(100).label('Gap'), + new SelectInput('justify-content').label('Justify Content').add([ + ['start', 'center', 'end', 'stretch', 'space-around', 'space-evenly', 'space-between'].map(value => $('option').content(value).value(value)) + ]).value(this.data.justifyContent), + new SelectInput('align-items').label('Align Items').add([ + ['start', 'center', 'end', 'stretch', 'space-around', 'space-evenly', 'space-between'].map(value => $('option').content(value).value(value)) + ]).value(this.data.alignItems) + ]) + ]).hide(this.flex_hidden$), + this.type === 'text' ? $('section').content([ $('h3').content('Font'), $('div').content([